aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/kvm.h
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-03-30 09:54:30 -0400
committerAvi Kivity <avi@qumranet.com>2007-05-03 03:52:28 -0400
commite8207547d2f7b2f557bdb73015c1f74c32474438 (patch)
tree7e5c15bec5cf9ef45a81227b009e6449f5c6d47c /drivers/kvm/kvm.h
parent954bbbc236afe23b368abdf4942f313a5f6e1d50 (diff)
KVM: Add physical memory aliasing feature
With this, we can specify that accesses to one physical memory range will be remapped to another. This is useful for the vga window at 0xa0000 which is used as a movable window into the (much larger) framebuffer. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm.h')
-rw-r--r--drivers/kvm/kvm.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index d19985a5508a..fceeb840a255 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -51,6 +51,7 @@
51#define UNMAPPED_GVA (~(gpa_t)0) 51#define UNMAPPED_GVA (~(gpa_t)0)
52 52
53#define KVM_MAX_VCPUS 1 53#define KVM_MAX_VCPUS 1
54#define KVM_ALIAS_SLOTS 4
54#define KVM_MEMORY_SLOTS 4 55#define KVM_MEMORY_SLOTS 4
55#define KVM_NUM_MMU_PAGES 256 56#define KVM_NUM_MMU_PAGES 256
56#define KVM_MIN_FREE_MMU_PAGES 5 57#define KVM_MIN_FREE_MMU_PAGES 5
@@ -312,6 +313,12 @@ struct kvm_vcpu {
312 struct kvm_cpuid_entry cpuid_entries[KVM_MAX_CPUID_ENTRIES]; 313 struct kvm_cpuid_entry cpuid_entries[KVM_MAX_CPUID_ENTRIES];
313}; 314};
314 315
316struct kvm_mem_alias {
317 gfn_t base_gfn;
318 unsigned long npages;
319 gfn_t target_gfn;
320};
321
315struct kvm_memory_slot { 322struct kvm_memory_slot {
316 gfn_t base_gfn; 323 gfn_t base_gfn;
317 unsigned long npages; 324 unsigned long npages;
@@ -322,6 +329,8 @@ struct kvm_memory_slot {
322 329
323struct kvm { 330struct kvm {
324 spinlock_t lock; /* protects everything except vcpus */ 331 spinlock_t lock; /* protects everything except vcpus */
332 int naliases;
333 struct kvm_mem_alias aliases[KVM_ALIAS_SLOTS];
325 int nmemslots; 334 int nmemslots;
326 struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS]; 335 struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS];
327 /* 336 /*