ANDROID: GKI: fix up abi issues with 4.19.172

The futex changes in 4.19.172 required some additions to struct
task_struct, which of course, is a structure used by just about
everyone.

To preserve the abi, do some gyrations with the reserved fields in order
to handle the growth of the structure.  Given that we are adding a
larger structure than a pointer, carve out a chunk of reserved fields
from the block we were reserving.

These changes fix the genksyms issues, but libabigail is smarter than
that, so we also need to update the .xml file to make it happy with this
change.

The results of libabigail is:

Leaf changes summary: 1 artifact changed
Changed leaf types summary: 1 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

'struct task_struct at sched.h:647:1' changed:
  type size hasn't changed
  3 data member deletions:
    'u64 task_struct::android_kabi_reserved4', at offset 22592 (in bits) at sched.h:1300:1
    'u64 task_struct::android_kabi_reserved5', at offset 22656 (in bits) at sched.h:1301:1
    'u64 task_struct::android_kabi_reserved6', at offset 22720 (in bits) at sched.h:1302:1
  there are data member changes:
    data member u64 task_struct::android_kabi_reserved2 at offset 22464 (in bits) became anonymous data member 'union {unsigned int futex_state; struct {u64 android_kabi_reserved2;} __UNIQUE_ID_android_kabi_hide48; union {};}'
    type 'typedef u64' of 'task_struct::android_kabi_reserved3' changed:
      entity changed from 'typedef u64' to 'struct mutex' at mutex.h:53:1
      type size changed from 64 to 256 (in bits)
    and name of 'task_struct::android_kabi_reserved3' changed to 'task_struct::futex_exit_mutex' at sched.h:1313:1
  1955 impacted interfaces

Bug: 161946584
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iab623aa5441c1d11e2dc4eb77c7153e4e9517429
This commit is contained in:
Greg Kroah-Hartman
2021-02-01 13:56:51 +01:00
parent 1a02ec69a6
commit c9b5531f57
2 changed files with 844 additions and 659 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1080,8 +1080,6 @@ struct task_struct {
#endif
struct list_head pi_state_list;
struct futex_pi_state *pi_state_cache;
struct mutex futex_exit_mutex;
unsigned int futex_state;
#endif
#ifdef CONFIG_PERF_EVENTS
struct perf_event_context *perf_event_ctxp[perf_nr_task_contexts];
@@ -1297,11 +1295,24 @@ struct task_struct {
/* task is frozen/stopped (used by the cgroup freezer) */
ANDROID_KABI_USE(1, unsigned frozen:1);
ANDROID_KABI_RESERVE(2);
/* 095444fad7e3 ("futex: Replace PF_EXITPIDONE with a state") */
ANDROID_KABI_USE(2, unsigned int futex_state);
/*
* f9b0c6c556db ("futex: Add mutex around futex exit")
* A struct mutex takes 32 bytes, or 4 64bit entries, so pick off
* 4 of the reserved members, and replace them with a struct mutex.
* Do the GENKSYMS hack to work around the CRC issues
*/
#ifdef __GENKSYMS__
ANDROID_KABI_RESERVE(3);
ANDROID_KABI_RESERVE(4);
ANDROID_KABI_RESERVE(5);
ANDROID_KABI_RESERVE(6);
#else
struct mutex futex_exit_mutex;
#endif
ANDROID_KABI_RESERVE(7);
ANDROID_KABI_RESERVE(8);