summaryrefslogtreecommitdiffstats
path: root/drivers/kvm/paging_tmpl.h
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-01-05 16:36:42 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2007-01-05 23:55:24 -0800
commit25c0de2cc6c26cb99553c2444936a7951c120c09 (patch)
treec2b5bd7ff189a1232ed3a89b50caa2ebbad67634 /drivers/kvm/paging_tmpl.h
parentaef3d3fe1314f2a130f5ccc7114df20865ba784f (diff)
downloadblackbird-op-linux-25c0de2cc6c26cb99553c2444936a7951c120c09.tar.gz
blackbird-op-linux-25c0de2cc6c26cb99553c2444936a7951c120c09.zip
[PATCH] KVM: MMU: Make kvm_mmu_alloc_page() return a kvm_mmu_page pointer
This allows further manipulation on the shadow page table. Signed-off-by: Avi Kivity <avi@qumranet.com> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/kvm/paging_tmpl.h')
-rw-r--r--drivers/kvm/paging_tmpl.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h
index 7af49ae80e5a..11cac9ddf26a 100644
--- a/drivers/kvm/paging_tmpl.h
+++ b/drivers/kvm/paging_tmpl.h
@@ -179,6 +179,7 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
for (; ; level--) {
u32 index = SHADOW_PT_INDEX(addr, level);
u64 *shadow_ent = ((u64 *)__va(shadow_addr)) + index;
+ struct kvm_mmu_page *shadow_page;
u64 shadow_pte;
if (is_present_pte(*shadow_ent) || is_io_pte(*shadow_ent)) {
@@ -204,9 +205,10 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
return shadow_ent;
}
- shadow_addr = kvm_mmu_alloc_page(vcpu, shadow_ent);
- if (!VALID_PAGE(shadow_addr))
+ shadow_page = kvm_mmu_alloc_page(vcpu, shadow_ent);
+ if (!shadow_page)
return ERR_PTR(-ENOMEM);
+ shadow_addr = shadow_page->page_hpa;
shadow_pte = shadow_addr | PT_PRESENT_MASK | PT_ACCESSED_MASK
| PT_WRITABLE_MASK | PT_USER_MASK;
*shadow_ent = shadow_pte;
OpenPOWER on IntegriCloud