diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2010-09-10 11:30:48 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-10-24 04:52:34 -0400 |
commit | c30a358d33e0e111f06e54a4a4125371e6b6693c (patch) | |
tree | bdd1d80f2eca1a63344b80f8e4353095cd06a947 /include/linux/kvm_host.h | |
parent | 1e301feb079e8ee6091bb75283e960fc33059a68 (diff) |
KVM: MMU: Add infrastructure for two-level page walker
This patch introduces a mmu-callback to translate gpa
addresses in the walk_addr code. This is later used to
translate l2_gpa addresses into l1_gpa addresses.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r-- | include/linux/kvm_host.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index f2ecdd52032b..917e68ff5ed2 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -534,6 +534,11 @@ static inline gpa_t gfn_to_gpa(gfn_t gfn) | |||
534 | return (gpa_t)gfn << PAGE_SHIFT; | 534 | return (gpa_t)gfn << PAGE_SHIFT; |
535 | } | 535 | } |
536 | 536 | ||
537 | static inline gfn_t gpa_to_gfn(gpa_t gpa) | ||
538 | { | ||
539 | return (gfn_t)(gpa >> PAGE_SHIFT); | ||
540 | } | ||
541 | |||
537 | static inline hpa_t pfn_to_hpa(pfn_t pfn) | 542 | static inline hpa_t pfn_to_hpa(pfn_t pfn) |
538 | { | 543 | { |
539 | return (hpa_t)pfn << PAGE_SHIFT; | 544 | return (hpa_t)pfn << PAGE_SHIFT; |