summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/platform/ring0/pagetables
diff options
context:
space:
mode:
authorIan Gudger <igudger@google.com>2018-05-07 16:37:08 -0700
committerShentubot <shentubot@google.com>2018-05-07 16:38:01 -0700
commit7c8c3705ea5d891a3d6126090b1f49d8bae44177 (patch)
tree222d3febc96553ff2e1408e341e10f81fd97fdc2 /pkg/sentry/platform/ring0/pagetables
parenta445b17933d38ee6f9cea9138c6197a07387b462 (diff)
Fix misspellings
PiperOrigin-RevId: 195742598 Change-Id: Ibd4a8e4394e268c87700b6d1e50b4b37dfce5182
Diffstat (limited to 'pkg/sentry/platform/ring0/pagetables')
-rw-r--r--pkg/sentry/platform/ring0/pagetables/pagetables.go20
-rw-r--r--pkg/sentry/platform/ring0/pagetables/pagetables_amd64.go2
2 files changed, 11 insertions, 11 deletions
diff --git a/pkg/sentry/platform/ring0/pagetables/pagetables.go b/pkg/sentry/platform/ring0/pagetables/pagetables.go
index 3cbf0bfa5..ee7f27601 100644
--- a/pkg/sentry/platform/ring0/pagetables/pagetables.go
+++ b/pkg/sentry/platform/ring0/pagetables/pagetables.go
@@ -44,18 +44,18 @@ type PageTables struct {
// root is the pagetable root.
root *Node
- // translater is the translater passed at creation.
- translater Translater
+ // translator is the translator passed at creation.
+ translator Translator
// archPageTables includes architecture-specific features.
archPageTables
- // allNodes is a set of nodes indexed by translater address.
+ // allNodes is a set of nodes indexed by translator address.
allNodes map[uintptr]*Node
}
-// Translater translates to guest physical addresses.
-type Translater interface {
+// Translator translates to guest physical addresses.
+type Translator interface {
// TranslateToPhysical translates the given pointer object into a
// "physical" address. We do not require that it translates back, the
// reverse mapping is maintained internally.
@@ -63,9 +63,9 @@ type Translater interface {
}
// New returns new PageTables.
-func New(t Translater, opts Opts) *PageTables {
+func New(t Translator, opts Opts) *PageTables {
p := &PageTables{
- translater: t,
+ translator: t,
allNodes: make(map[uintptr]*Node),
}
p.root = p.allocNode()
@@ -80,7 +80,7 @@ func New(t Translater, opts Opts) *PageTables {
// managing multiple sets of pagetables.
func (p *PageTables) New() *PageTables {
np := &PageTables{
- translater: p.translater,
+ translator: p.translator,
allNodes: make(map[uintptr]*Node),
}
np.root = np.allocNode()
@@ -90,7 +90,7 @@ func (p *PageTables) New() *PageTables {
// setPageTable sets the given index as a page table.
func (p *PageTables) setPageTable(n *Node, index int, child *Node) {
- phys := p.translater.TranslateToPhysical(child.PTEs())
+ phys := p.translator.TranslateToPhysical(child.PTEs())
p.allNodes[phys] = child
pte := &n.PTEs()[index]
pte.setPageTable(phys)
@@ -188,6 +188,6 @@ func (p *PageTables) Lookup(addr usermem.Addr) (physical uintptr, accessType use
// allocNode allocates a new page.
func (p *PageTables) allocNode() *Node {
n := new(Node)
- n.physical = p.translater.TranslateToPhysical(n.PTEs())
+ n.physical = p.translator.TranslateToPhysical(n.PTEs())
return n
}
diff --git a/pkg/sentry/platform/ring0/pagetables/pagetables_amd64.go b/pkg/sentry/platform/ring0/pagetables/pagetables_amd64.go
index b89665c96..a2050b99c 100644
--- a/pkg/sentry/platform/ring0/pagetables/pagetables_amd64.go
+++ b/pkg/sentry/platform/ring0/pagetables/pagetables_amd64.go
@@ -301,7 +301,7 @@ func (p *PageTables) iterateRange(startAddr, endAddr uintptr, alloc bool, fn fun
}
// This level has 2-MB huge pages. If this
- // region is contined in a single PMD entry?
+ // region is contained in a single PMD entry?
// As above, we can skip allocating a new page.
if start&(pmdSize-1) == 0 && end-start >= pmdSize {
pmdEntry.SetSuper()