github.com/SagerNet/gvisor@v0.0.0-20210707092255-7731c139d75c/pkg/sentry/platform/kvm/BUILD (about)

     1  load("//tools:defs.bzl", "go_library", "go_test")
     2  
     3  package(licenses = ["notice"])
     4  
     5  go_library(
     6      name = "kvm",
     7      srcs = [
     8          "address_space.go",
     9          "address_space_amd64.go",
    10          "address_space_arm64.go",
    11          "bluepill.go",
    12          "bluepill_allocator.go",
    13          "bluepill_amd64.go",
    14          "bluepill_amd64_unsafe.go",
    15          "bluepill_arm64.go",
    16          "bluepill_arm64.s",
    17          "bluepill_arm64_unsafe.go",
    18          "bluepill_fault.go",
    19          "bluepill_impl_amd64.s",
    20          "bluepill_unsafe.go",
    21          "context.go",
    22          "filters_amd64.go",
    23          "filters_arm64.go",
    24          "kvm.go",
    25          "kvm_amd64.go",
    26          "kvm_amd64_unsafe.go",
    27          "kvm_arm64.go",
    28          "kvm_arm64_unsafe.go",
    29          "kvm_const.go",
    30          "kvm_const_arm64.go",
    31          "machine.go",
    32          "machine_amd64.go",
    33          "machine_amd64_unsafe.go",
    34          "machine_arm64.go",
    35          "machine_arm64_unsafe.go",
    36          "machine_unsafe.go",
    37          "physical_map.go",
    38          "physical_map_amd64.go",
    39          "physical_map_arm64.go",
    40          "virtual_map.go",
    41      ],
    42      visibility = ["//pkg/sentry:internal"],
    43      deps = [
    44          "//pkg/abi/linux",
    45          "//pkg/atomicbitops",
    46          "//pkg/context",
    47          "//pkg/cpuid",
    48          "//pkg/hostarch",
    49          "//pkg/log",
    50          "//pkg/procid",
    51          "//pkg/ring0",
    52          "//pkg/ring0/pagetables",
    53          "//pkg/safecopy",
    54          "//pkg/seccomp",
    55          "//pkg/sentry/arch",
    56          "//pkg/sentry/arch/fpu",
    57          "//pkg/sentry/memmap",
    58          "//pkg/sentry/platform",
    59          "//pkg/sentry/platform/interrupt",
    60          "//pkg/sentry/time",
    61          "//pkg/sync",
    62          "@org_golang_x_sys//unix:go_default_library",
    63      ],
    64  )
    65  
    66  go_test(
    67      name = "kvm_test",
    68      srcs = [
    69          "kvm_amd64_test.go",
    70          "kvm_amd64_test.s",
    71          "kvm_arm64_test.go",
    72          "kvm_test.go",
    73          "virtual_map_test.go",
    74      ],
    75      library = ":kvm",
    76      tags = [
    77          "manual",
    78          "nogotsan",
    79          "requires-kvm",
    80      ],
    81      deps = [
    82          "//pkg/abi/linux",
    83          "//pkg/hostarch",
    84          "//pkg/ring0",
    85          "//pkg/ring0/pagetables",
    86          "//pkg/sentry/arch",
    87          "//pkg/sentry/arch/fpu",
    88          "//pkg/sentry/platform",
    89          "//pkg/sentry/platform/kvm/testutil",
    90          "//pkg/sentry/time",
    91          "@org_golang_x_sys//unix:go_default_library",
    92      ],
    93  )
    94  
    95  genrule(
    96      name = "bluepill_impl_amd64",
    97      srcs = ["bluepill_amd64.s"],
    98      outs = ["bluepill_impl_amd64.s"],
    99      cmd = "(echo -e '// build +amd64\\n' && $(location //pkg/ring0/gen_offsets) && cat $(SRCS)) > $@",
   100      tools = ["//pkg/ring0/gen_offsets"],
   101  )