diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-03-06 12:05:30 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-03-06 12:05:30 -0800 |
commit | 18d41cf15368c4d091ffdf84da655994eb1a1099 (patch) | |
tree | 5abebffaf5e1c22a19aabdcd45c5f4dc1e34999e /pkg/sentry/platform/kvm/kvm.go | |
parent | 56c427256826520d211e3f20b9399a165b4d1d4f (diff) | |
parent | 73201f4c5700ce7af404b968698b86d80989ab1e (diff) |
Merge pull request #1963 from xiaobo55x:kvm_common
PiperOrigin-RevId: 299405855
Diffstat (limited to 'pkg/sentry/platform/kvm/kvm.go')
-rw-r--r-- | pkg/sentry/platform/kvm/kvm.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/pkg/sentry/platform/kvm/kvm.go b/pkg/sentry/platform/kvm/kvm.go index 972ba85c3..a9b4af43e 100644 --- a/pkg/sentry/platform/kvm/kvm.go +++ b/pkg/sentry/platform/kvm/kvm.go @@ -27,6 +27,38 @@ import ( "gvisor.dev/gvisor/pkg/usermem" ) +// userMemoryRegion is a region of physical memory. +// +// This mirrors kvm_memory_region. +type userMemoryRegion struct { + slot uint32 + flags uint32 + guestPhysAddr uint64 + memorySize uint64 + userspaceAddr uint64 +} + +// runData is the run structure. This may be mapped for synchronous register +// access (although that doesn't appear to be supported by my kernel at least). +// +// This mirrors kvm_run. +type runData struct { + requestInterruptWindow uint8 + _ [7]uint8 + + exitReason uint32 + readyForInterruptInjection uint8 + ifFlag uint8 + _ [2]uint8 + + cr8 uint64 + apicBase uint64 + + // This is the union data for exits. Interpretation depends entirely on + // the exitReason above (see vCPU code for more information). + data [32]uint64 +} + // KVM represents a lightweight VM context. type KVM struct { platform.NoCPUPreemptionDetection |