diff options
author | Izik Eidus <avi@qumranet.com> | 2007-10-18 05:09:33 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:52:54 -0500 |
commit | 8a7ae055f3533b520401c170ac55e30628b34df5 (patch) | |
tree | f9654746dc92fa18ef66e49e12537dc6cb1d32e6 /drivers/kvm/kvm.h | |
parent | cea7bb21280e3a825e64b54740edc5d3e6e4193c (diff) |
KVM: MMU: Partial swapping of guest memory
This allows guest memory to be swapped. Pages which are currently mapped
via shadow page tables are pinned into memory, but all other pages can
be freely swapped.
The patch makes gfn_to_page() elevate the page's reference count, and
introduces kvm_release_page() that pairs with it.
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 | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index 0c17c76d030f..df0711ce9baa 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h | |||
@@ -409,6 +409,7 @@ struct kvm_memory_slot { | |||
409 | unsigned long *rmap; | 409 | unsigned long *rmap; |
410 | unsigned long *dirty_bitmap; | 410 | unsigned long *dirty_bitmap; |
411 | int user_alloc; /* user allocated memory */ | 411 | int user_alloc; /* user allocated memory */ |
412 | unsigned long userspace_addr; | ||
412 | }; | 413 | }; |
413 | 414 | ||
414 | struct kvm { | 415 | struct kvm { |
@@ -570,6 +571,7 @@ extern struct page *bad_page; | |||
570 | int is_error_page(struct page *page); | 571 | int is_error_page(struct page *page); |
571 | gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn); | 572 | gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn); |
572 | struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); | 573 | struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); |
574 | void kvm_release_page(struct page *page); | ||
573 | int kvm_read_guest_page(struct kvm *kvm, gfn_t gfn, void *data, int offset, | 575 | int kvm_read_guest_page(struct kvm *kvm, gfn_t gfn, void *data, int offset, |
574 | int len); | 576 | int len); |
575 | int kvm_read_guest(struct kvm *kvm, gpa_t gpa, void *data, unsigned long len); | 577 | int kvm_read_guest(struct kvm *kvm, gpa_t gpa, void *data, unsigned long len); |