ANDROID: Split ANDROID_STRUCT_PADDING into separate configs
Not all non-GKI platforms support disabling ANDROID_STRUCT_PADDING, as some modules may require Android vendor data. However, it would be beneficial to have the option to disable some of the struct paddings, such as ANDROID_KABI_RESERVE, for memory savings given a situation where the ANDROID_STRUCT_PADDING config cannot be disabled. Split the ANDROID_STRUCT_PADDING config into two configs, one to control ANDROID_VENDOR_DATA and ANDROID_OEM_DATA, and another to control ANDROID_KABI_RESERVE. Bug: 206561931 Change-Id: Iea4b962dff386a17c9bef20ae048be4e17bf43ab Signed-off-by: Jaskaran Singh <quic_jasksing@quicinc.com>
This commit is contained in:
@@ -74,14 +74,32 @@ config ANDROID_VENDOR_HOOKS
|
|||||||
Allow vendor modules to attach to tracepoint "hooks" defined via
|
Allow vendor modules to attach to tracepoint "hooks" defined via
|
||||||
DECLARE_HOOK or DECLARE_RESTRICTED_HOOK.
|
DECLARE_HOOK or DECLARE_RESTRICTED_HOOK.
|
||||||
|
|
||||||
config ANDROID_STRUCT_PADDING
|
config ANDROID_KABI_RESERVE
|
||||||
bool "Android Struct Padding"
|
bool "Android KABI reserve padding"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
This option enables the padding that the Android GKI kernel adds
|
||||||
|
to many different kernel structures to support an in-kernel stable ABI
|
||||||
|
over the lifespan of support for the kernel.
|
||||||
|
|
||||||
|
Only disable this option if you have a system that needs the Android
|
||||||
|
kernel drivers, but is NOT an Android GKI kernel image. If disabled
|
||||||
|
it has the possibility to make the kernel static and runtime image
|
||||||
|
slightly smaller but will NOT be supported by the Google Android
|
||||||
|
kernel team.
|
||||||
|
|
||||||
|
If even slightly unsure, say Y.
|
||||||
|
|
||||||
|
config ANDROID_VENDOR_OEM_DATA
|
||||||
|
bool "Android vendor and OEM data padding"
|
||||||
default y
|
default y
|
||||||
help
|
help
|
||||||
This option enables the padding that the Android GKI kernel adds
|
This option enables the padding that the Android GKI kernel adds
|
||||||
to many different kernel structures to support an in-kernel stable ABI
|
to many different kernel structures to support an in-kernel stable ABI
|
||||||
over the lifespan of support for the kernel as well as OEM additional
|
over the lifespan of support for the kernel as well as OEM additional
|
||||||
fields that are needed by some of the Android kernel tracepoints.
|
fields that are needed by some of the Android kernel tracepoints. The
|
||||||
|
macros enabled by this option are used to enable padding in vendor modules
|
||||||
|
used for the above specified purposes.
|
||||||
|
|
||||||
Only disable this option if you have a system that needs the Android
|
Only disable this option if you have a system that needs the Android
|
||||||
kernel drivers, but is NOT an Android GKI kernel image and you do NOT
|
kernel drivers, but is NOT an Android GKI kernel image and you do NOT
|
||||||
|
@@ -83,7 +83,7 @@
|
|||||||
* number: the "number" of the padding variable in the structure. Start with
|
* number: the "number" of the padding variable in the structure. Start with
|
||||||
* 1 and go up.
|
* 1 and go up.
|
||||||
*/
|
*/
|
||||||
#ifdef CONFIG_ANDROID_STRUCT_PADDING
|
#ifdef CONFIG_ANDROID_KABI_RESERVE
|
||||||
#define ANDROID_KABI_RESERVE(number) _ANDROID_KABI_RESERVE(number)
|
#define ANDROID_KABI_RESERVE(number) _ANDROID_KABI_RESERVE(number)
|
||||||
#else
|
#else
|
||||||
#define ANDROID_KABI_RESERVE(number)
|
#define ANDROID_KABI_RESERVE(number)
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
* Same as ANDROID_VENDOR_DATA but allocates an array of u64 with
|
* Same as ANDROID_VENDOR_DATA but allocates an array of u64 with
|
||||||
* the specified size
|
* the specified size
|
||||||
*/
|
*/
|
||||||
#ifdef CONFIG_ANDROID_STRUCT_PADDING
|
#ifdef CONFIG_ANDROID_VENDOR_OEM_DATA
|
||||||
#define ANDROID_VENDOR_DATA(n) u64 android_vendor_data##n
|
#define ANDROID_VENDOR_DATA(n) u64 android_vendor_data##n
|
||||||
#define ANDROID_VENDOR_DATA_ARRAY(n, s) u64 android_vendor_data##n[s]
|
#define ANDROID_VENDOR_DATA_ARRAY(n, s) u64 android_vendor_data##n[s]
|
||||||
|
|
||||||
|
@@ -213,7 +213,7 @@ struct task_struct init_task
|
|||||||
#ifdef CONFIG_SECCOMP_FILTER
|
#ifdef CONFIG_SECCOMP_FILTER
|
||||||
.seccomp = { .filter_count = ATOMIC_INIT(0) },
|
.seccomp = { .filter_count = ATOMIC_INIT(0) },
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_ANDROID_STRUCT_PADDING
|
#ifdef CONFIG_ANDROID_VENDOR_OEM_DATA
|
||||||
.android_vendor_data1 = {0, },
|
.android_vendor_data1 = {0, },
|
||||||
.android_oem_data1 = {0, },
|
.android_oem_data1 = {0, },
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user