2018-04-27 17:37:02 +00:00
|
|
|
package(licenses = ["notice"]) # Apache 2.0
|
|
|
|
|
2018-07-27 17:16:27 +00:00
|
|
|
load("//tools/go_stateify:defs.bzl", "go_library", "go_test")
|
2018-06-12 01:14:22 +00:00
|
|
|
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",
|
|
|
|
},
|
|
|
|
)
|
2018-04-27 17:37:02 +00:00
|
|
|
|
|
|
|
go_library(
|
|
|
|
name = "pagetables",
|
|
|
|
srcs = [
|
2018-06-07 04:47:39 +00:00
|
|
|
"allocator.go",
|
|
|
|
"allocator_unsafe.go",
|
2018-04-27 17:37:02 +00:00
|
|
|
"pagetables.go",
|
|
|
|
"pagetables_amd64.go",
|
|
|
|
"pagetables_x86.go",
|
|
|
|
"pcids_x86.go",
|
2018-06-12 01:14:22 +00:00
|
|
|
"walker_empty.go",
|
|
|
|
"walker_lookup.go",
|
|
|
|
"walker_map.go",
|
|
|
|
"walker_unmap.go",
|
2018-04-27 17:37:02 +00:00
|
|
|
],
|
|
|
|
importpath = "gvisor.googlesource.com/gvisor/pkg/sentry/platform/ring0/pagetables",
|
|
|
|
visibility = [
|
|
|
|
"//pkg/sentry/platform/kvm:__subpackages__",
|
|
|
|
"//pkg/sentry/platform/ring0:__subpackages__",
|
|
|
|
],
|
|
|
|
deps = ["//pkg/sentry/usermem"],
|
|
|
|
)
|
|
|
|
|
|
|
|
go_test(
|
|
|
|
name = "pagetables_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = [
|
2018-05-30 22:13:36 +00:00
|
|
|
"pagetables_amd64_test.go",
|
2018-04-27 17:37:02 +00:00
|
|
|
"pagetables_test.go",
|
2018-06-12 01:14:22 +00:00
|
|
|
"walker_check.go",
|
2018-04-27 17:37:02 +00:00
|
|
|
],
|
|
|
|
embed = [":pagetables"],
|
|
|
|
deps = ["//pkg/sentry/usermem"],
|
|
|
|
)
|