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 <elsk@google.com>
Change-Id: I0eae9213493d78a6899aa15c8096f3c7694328a3
(cherry picked from commit 3d56edf4a961a522ffc4d422c7d7f80eaa970391)
This commit is contained in:
Yifan Hong 2022-10-21 23:07:21 -07:00
parent e07b026ae0
commit a08c2979ec

View File

@ -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 = [],