gvisor.dev/gvisor@v0.0.0-20240520182842-f9d4d51c7e0f/pkg/sentry/platform/kvm/BUILD (about)

     1  load("//tools:defs.bzl", "go_library", "go_test")
     2  load("//tools/go_generics:defs.bzl", "go_template_instance")
     3  
     4  package(
     5      default_applicable_licenses = ["//:license"],
     6      licenses = ["notice"],
     7  )
     8  
     9  go_template_instance(
    10      name = "atomicptr_machine",
    11      out = "atomicptr_machine_unsafe.go",
    12      package = "kvm",
    13      prefix = "machine",
    14      template = "//pkg/sync/atomicptr:generic_atomicptr",
    15      types = {
    16          "Value": "machine",
    17      },
    18  )
    19  
    20  go_library(
    21      name = "kvm",
    22      srcs = [
    23          "address_space.go",
    24          "address_space_amd64.go",
    25          "address_space_arm64.go",
    26          "atomicptr_machine_unsafe.go",
    27          "bluepill.go",
    28          "bluepill_allocator.go",
    29          "bluepill_amd64.go",
    30          "bluepill_amd64.s",
    31          "bluepill_amd64_unsafe.go",
    32          "bluepill_arm64.go",
    33          "bluepill_arm64.s",
    34          "bluepill_arm64_unsafe.go",
    35          "bluepill_fault.go",
    36          "bluepill_unsafe.go",
    37          "context.go",
    38          "filters.go",
    39          "filters_amd64.go",
    40          "filters_arm64.go",
    41          "kvm.go",
    42          "kvm_amd64.go",
    43          "kvm_amd64_unsafe.go",
    44          "kvm_arm64.go",
    45          "kvm_arm64_unsafe.go",
    46          "kvm_const.go",
    47          "kvm_const_amd64.go",
    48          "kvm_const_arm64.go",
    49          "kvm_profiling.go",
    50          "kvm_profiling_fake.go",
    51          "machine.go",
    52          "machine_amd64.go",
    53          "machine_amd64_unsafe.go",
    54          "machine_arm64.go",
    55          "machine_arm64_unsafe.go",
    56          "machine_unsafe.go",
    57          "physical_map.go",
    58          "physical_map_amd64.go",
    59          "physical_map_arm64.go",
    60          "virtual_map.go",
    61      ],
    62      visibility = ["//pkg/sentry:internal"],
    63      deps = [
    64          "//pkg/abi/linux",
    65          "//pkg/atomicbitops",
    66          "//pkg/context",
    67          "//pkg/cpuid",
    68          "//pkg/fd",
    69          "//pkg/hostarch",
    70          "//pkg/hosttid",
    71          "//pkg/log",
    72          "//pkg/metric",
    73          "//pkg/ring0",
    74          "//pkg/ring0/pagetables",
    75          "//pkg/seccomp",
    76          "//pkg/sentry/arch",
    77          "//pkg/sentry/arch/fpu",
    78          "//pkg/sentry/memmap",
    79          "//pkg/sentry/platform",
    80          "//pkg/sentry/platform/interrupt",
    81          "//pkg/sentry/time",
    82          "//pkg/sighandling",
    83          "//pkg/sync",
    84          "@org_golang_x_sys//unix:go_default_library",
    85      ],
    86  )
    87  
    88  go_test(
    89      name = "kvm_test",
    90      srcs = [
    91          "kvm_amd64_test.go",
    92          "kvm_amd64_test.s",
    93          "kvm_arm64_test.go",
    94          "kvm_safecopy_test.go",
    95          "kvm_test.go",
    96          "virtual_map_test.go",
    97      ],
    98      library = ":kvm",
    99      # FIXME(gvisor.dev/issue/3374): Not working with all build systems.
   100      nogo = False,
   101      # cgo has to be disabled. We have seen libc that blocks all signals and
   102      # calls mmap from pthread_create, but we use SIGSYS to trap mmap system
   103      # calls.
   104      pure = True,
   105      tags = [
   106          "manual",
   107          "nogotsan",
   108          "requires-kvm",
   109      ],
   110      deps = [
   111          "//pkg/abi/linux",
   112          "//pkg/cpuid",
   113          "//pkg/hostarch",
   114          "//pkg/memutil",
   115          "//pkg/ring0",
   116          "//pkg/ring0/pagetables",
   117          "//pkg/safecopy",
   118          "//pkg/sentry/arch",
   119          "//pkg/sentry/arch/fpu",
   120          "//pkg/sentry/platform",
   121          "//pkg/sentry/platform/kvm/testutil",
   122          "//pkg/sentry/time",
   123          "@org_golang_x_sys//unix:go_default_library",
   124      ],
   125  )