diff options
author | Izik Eidus <izike@qumranet.com> | 2007-10-24 17:57:46 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:52:56 -0500 |
commit | e0d62c7f48605119a7f9fa632e77561c89928963 (patch) | |
tree | eb11b29780f12433897a720a7c9db719663152cf /drivers/kvm/kvm.h | |
parent | 210c7c4d7f200f00ec34960a8c96bb990cbd266d (diff) |
KVM: Add kernel-internal memory slots
Reserve a few memory slots for kernel internal use. This is good for case
you have to register memory region and you want to be sure it was not
registered from userspace, and for case you want to register a memory region
that won't be seen from userspace.
Signed-off-by: Izik Eidus <izike@qumranet.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm.h')
-rw-r--r-- | drivers/kvm/kvm.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index f3dda088e34b..82c3b13e5d0a 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h | |||
@@ -41,6 +41,8 @@ | |||
41 | #define KVM_MAX_VCPUS 4 | 41 | #define KVM_MAX_VCPUS 4 |
42 | #define KVM_ALIAS_SLOTS 4 | 42 | #define KVM_ALIAS_SLOTS 4 |
43 | #define KVM_MEMORY_SLOTS 8 | 43 | #define KVM_MEMORY_SLOTS 8 |
44 | /* memory slots that does not exposed to userspace */ | ||
45 | #define KVM_PRIVATE_MEM_SLOTS 4 | ||
44 | #define KVM_PERMILLE_MMU_PAGES 20 | 46 | #define KVM_PERMILLE_MMU_PAGES 20 |
45 | #define KVM_MIN_ALLOC_MMU_PAGES 64 | 47 | #define KVM_MIN_ALLOC_MMU_PAGES 64 |
46 | #define KVM_NUM_MMU_PAGES 1024 | 48 | #define KVM_NUM_MMU_PAGES 1024 |
@@ -361,7 +363,8 @@ struct kvm { | |||
361 | int naliases; | 363 | int naliases; |
362 | struct kvm_mem_alias aliases[KVM_ALIAS_SLOTS]; | 364 | struct kvm_mem_alias aliases[KVM_ALIAS_SLOTS]; |
363 | int nmemslots; | 365 | int nmemslots; |
364 | struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS]; | 366 | struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS + |
367 | KVM_PRIVATE_MEM_SLOTS]; | ||
365 | /* | 368 | /* |
366 | * Hash table of struct kvm_mmu_page. | 369 | * Hash table of struct kvm_mmu_page. |
367 | */ | 370 | */ |
@@ -529,6 +532,7 @@ int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data, | |||
529 | int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len); | 532 | int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len); |
530 | int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len); | 533 | int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len); |
531 | struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn); | 534 | struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn); |
535 | int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn); | ||
532 | void mark_page_dirty(struct kvm *kvm, gfn_t gfn); | 536 | void mark_page_dirty(struct kvm *kvm, gfn_t gfn); |
533 | 537 | ||
534 | enum emulation_result { | 538 | enum emulation_result { |