From a08c2979ec0500df08838d8f294bd2e7572756fd Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Fri, 21 Oct 2022 23:07:21 -0700 Subject: [PATCH] ANDROID: kleaf: Initial list of ddk_headers (2: virtual_device_x86_64) This CL includes headers used by the external modules of virtual_device_x86_64. Allowlist: This is a list of headers and a list of include directories that are known to be safe to be used by modules. - This list includes: - Everything under - arch/x86/include - include Unsafe list: This is the list of headers that are known to be used by the external modules of virtual_device_x86_64, minus allowlist. This means, with the allowlist and unsafe list, the certain Pixel device kernel build can be transitioned to DDK without any change to the source code. - Note that for cleaness of DDK modules, we may want to remove some items in the allowlist of includes and require device source code to #include from the correct directory. The command to generate this list is: bazel run //build/kernel/kleaf:gen_ddk_headers \ --gen_ddk_headers_target=//common-modules/virtual-device:virtual_device_x86_64_modules_install \ --gen_ddk_headers_input_archives=//common:kernel_x86_64_ddk_allowlist_headers \ -- -k Manual edits: - arch/arm64/include/ is added back. This is due to a limitation of the generation script that globs aren't properly handled. Bug: 248351908 Bug: 254735056 Signed-off-by: Yifan Hong Change-Id: I0eae9213493d78a6899aa15c8096f3c7694328a3 (cherry picked from commit 3d56edf4a961a522ffc4d422c7d7f80eaa970391) --- BUILD.bazel | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BUILD.bazel b/BUILD.bazel index 5f96a036a29c..1bfadc06631d 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -268,6 +268,8 @@ ddk_headers( includes = [ "arch/arm64/include", "arch/arm64/include/uapi", + "arch/x86/include", + "arch/x86/include/uapi", "include", "include/uapi", ], @@ -281,6 +283,7 @@ filegroup( name = "all_headers_allowlist_globs", srcs = glob([ "arch/arm64/include/**/*.h", + "arch/x86/include/**/*.h", "include/**/*.h", ]), visibility = ["//visibility:private"], @@ -294,7 +297,9 @@ filegroup( # - be moved into all_headers ddk_headers( name = "all_headers_unsafe", - hdrs = [], + hdrs = [ + "drivers/gpu/drm/virtio/virtgpu_trace.h", + ], # The list of include directories where source files can #include headers # from. In other words, these are the `-I` option to the C compiler. includes = [],