summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/platform/ring0/pagetables/BUILD
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2018-06-11 18:14:22 -0700
committerShentubot <shentubot@google.com>2018-06-11 18:15:14 -0700
commit1397a413b49d6036f2586e85c8074aa3d4d6c6fa (patch)
tree7bb617429fe26dfdc47bc02bab8d74eb621775e6 /pkg/sentry/platform/ring0/pagetables/BUILD
parent09b0a9c320bd777bc52384bd0ec91ecfc61e481d (diff)
Make page tables split-safe.
In order to minimize the likelihood of exit during page table modifications, make the full set of page table functions split-safe. This is not strictly necessary (and you may still incur splits due to allocations from the allocator pool) but should make retries a very rare occurance. PiperOrigin-RevId: 200146688 Change-Id: I8fa36aa16b807beda2f0b057be60038258e8d597
Diffstat (limited to 'pkg/sentry/platform/ring0/pagetables/BUILD')
-rw-r--r--pkg/sentry/platform/ring0/pagetables/BUILD72
1 files changed, 72 insertions, 0 deletions
diff --git a/pkg/sentry/platform/ring0/pagetables/BUILD b/pkg/sentry/platform/ring0/pagetables/BUILD
index 08b73e87d..023e298a0 100644
--- a/pkg/sentry/platform/ring0/pagetables/BUILD
+++ b/pkg/sentry/platform/ring0/pagetables/BUILD
@@ -1,6 +1,73 @@
package(licenses = ["notice"]) # Apache 2.0
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("//tools/go_generics:defs.bzl", "go_template", "go_template_instance")
+
+go_template(
+ name = "generic_walker",
+ srcs = [
+ "walker_amd64.go",
+ ],
+ opt_types = [
+ "Visitor",
+ ],
+ visibility = [":__pkg__"],
+)
+
+go_template_instance(
+ name = "walker_map",
+ out = "walker_map.go",
+ package = "pagetables",
+ prefix = "map",
+ template = ":generic_walker",
+ types = {
+ "Visitor": "mapVisitor",
+ },
+)
+
+go_template_instance(
+ name = "walker_unmap",
+ out = "walker_unmap.go",
+ package = "pagetables",
+ prefix = "unmap",
+ template = ":generic_walker",
+ types = {
+ "Visitor": "unmapVisitor",
+ },
+)
+
+go_template_instance(
+ name = "walker_lookup",
+ out = "walker_lookup.go",
+ package = "pagetables",
+ prefix = "lookup",
+ template = ":generic_walker",
+ types = {
+ "Visitor": "lookupVisitor",
+ },
+)
+
+go_template_instance(
+ name = "walker_empty",
+ out = "walker_empty.go",
+ package = "pagetables",
+ prefix = "empty",
+ template = ":generic_walker",
+ types = {
+ "Visitor": "emptyVisitor",
+ },
+)
+
+go_template_instance(
+ name = "walker_check",
+ out = "walker_check.go",
+ package = "pagetables",
+ prefix = "check",
+ template = ":generic_walker",
+ types = {
+ "Visitor": "checkVisitor",
+ },
+)
go_library(
name = "pagetables",
@@ -11,6 +78,10 @@ go_library(
"pagetables_amd64.go",
"pagetables_x86.go",
"pcids_x86.go",
+ "walker_empty.go",
+ "walker_lookup.go",
+ "walker_map.go",
+ "walker_unmap.go",
],
importpath = "gvisor.googlesource.com/gvisor/pkg/sentry/platform/ring0/pagetables",
visibility = [
@@ -26,6 +97,7 @@ go_test(
srcs = [
"pagetables_amd64_test.go",
"pagetables_test.go",
+ "walker_check.go",
],
embed = [":pagetables"],
deps = ["//pkg/sentry/usermem"],