diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2008-04-02 15:46:56 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-04-27 05:01:15 -0400 |
commit | 35149e2129fe34fc8cb5917e1ecf5156b0fa3415 (patch) | |
tree | b67cb16fa6054769ee476fce99a32601b126af10 /include/asm-x86 | |
parent | fdae862f91728aec6dd8fd62cd2398868c906b6b (diff) |
KVM: MMU: Don't assume struct page for x86
This patch introduces a gfn_to_pfn() function and corresponding functions like
kvm_release_pfn_dirty(). Using these new functions, we can modify the x86
MMU to no longer assume that it can always get a struct page for any given gfn.
We don't want to eliminate gfn_to_page() entirely because a number of places
assume they can do gfn_to_page() and then kmap() the results. When we support
IO memory, gfn_to_page() will fail for IO pages although gfn_to_pfn() will
succeed.
This does not implement support for avoiding reference counting for reserved
RAM or for IO memory. However, it should make those things pretty straight
forward.
Since we're only introducing new common symbols, I don't think it will break
the non-x86 architectures but I haven't tested those. I've tested Intel,
AMD, NPT, and hugetlbfs with Windows and Linux guests.
[avi: fix overflow when shifting left pfns by adding casts]
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/kvm_host.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/asm-x86/kvm_host.h b/include/asm-x86/kvm_host.h index b9230490d777..de3eccfb767c 100644 --- a/include/asm-x86/kvm_host.h +++ b/include/asm-x86/kvm_host.h | |||
@@ -248,8 +248,8 @@ struct kvm_vcpu_arch { | |||
248 | u64 *last_pte_updated; | 248 | u64 *last_pte_updated; |
249 | 249 | ||
250 | struct { | 250 | struct { |
251 | gfn_t gfn; /* presumed gfn during guest pte update */ | 251 | gfn_t gfn; /* presumed gfn during guest pte update */ |
252 | struct page *page; /* page corresponding to that gfn */ | 252 | pfn_t pfn; /* pfn corresponding to that gfn */ |
253 | int largepage; | 253 | int largepage; |
254 | } update_pte; | 254 | } update_pte; |
255 | 255 | ||