diff options
author | Andres Lagar-Cavilla <andres@lagarcavilla.org> | 2011-11-11 18:11:34 +0000 |
---|---|---|
committer | Andres Lagar-Cavilla <andres@lagarcavilla.org> | 2011-11-11 18:11:34 +0000 |
commit | 51032ca058e43fbd37ea1f7c7c003496f6451340 (patch) | |
tree | 179fda9e3eba652562ca7aa3e6139852cbe3ed23 /xen/arch/x86/hvm/viridian.c | |
parent | e0594d9bc1c7996840f421a4084830d5a296e51b (diff) | |
download | xen-51032ca058e43fbd37ea1f7c7c003496f6451340.tar.gz xen-51032ca058e43fbd37ea1f7c7c003496f6451340.tar.bz2 xen-51032ca058e43fbd37ea1f7c7c003496f6451340.zip |
Modify naming of queries into the p2m
Callers of lookups into the p2m code are now variants of get_gfn. All
callers need to call put_gfn. The code behind it is a no-op at the
moment, but will change to proper locking in a later patch.
This patch does not change functionality. Only naming, and adds
put_gfn's.
set_p2m_entry retains its name because it is always called with
p2m_lock held.
This patch is humongous, unfortunately, given the dozens of call sites
involved.
After this patch, anyone using old style gfn_to_mfn will not succeed
in compiling their code. This is on purpose: adapt to the new API.
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/hvm/viridian.c')
-rw-r--r-- | xen/arch/x86/hvm/viridian.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xen/arch/x86/hvm/viridian.c b/xen/arch/x86/hvm/viridian.c index 5a60f6bb95..6d3b899d2e 100644 --- a/xen/arch/x86/hvm/viridian.c +++ b/xen/arch/x86/hvm/viridian.c @@ -134,12 +134,13 @@ void dump_apic_assist(struct vcpu *v) static void enable_hypercall_page(struct domain *d) { unsigned long gmfn = d->arch.hvm_domain.viridian.hypercall_gpa.fields.pfn; - unsigned long mfn = gmfn_to_mfn(d, gmfn); + unsigned long mfn = get_gfn_untyped(d, gmfn); uint8_t *p; if ( !mfn_valid(mfn) || !get_page_and_type(mfn_to_page(mfn), d, PGT_writable_page) ) { + put_gfn(d, gmfn); gdprintk(XENLOG_WARNING, "Bad GMFN %lx (MFN %lx)\n", gmfn, mfn); return; } @@ -162,13 +163,14 @@ static void enable_hypercall_page(struct domain *d) unmap_domain_page(p); put_page_and_type(mfn_to_page(mfn)); + put_gfn(d, gmfn); } void initialize_apic_assist(struct vcpu *v) { struct domain *d = v->domain; unsigned long gmfn = v->arch.hvm_vcpu.viridian.apic_assist.fields.pfn; - unsigned long mfn = gmfn_to_mfn(d, gmfn); + unsigned long mfn = get_gfn_untyped(d, gmfn); uint8_t *p; /* @@ -184,6 +186,7 @@ void initialize_apic_assist(struct vcpu *v) if ( !mfn_valid(mfn) || !get_page_and_type(mfn_to_page(mfn), d, PGT_writable_page) ) { + put_gfn(d, gmfn); gdprintk(XENLOG_WARNING, "Bad GMFN %lx (MFN %lx)\n", gmfn, mfn); return; } @@ -195,6 +198,7 @@ void initialize_apic_assist(struct vcpu *v) unmap_domain_page(p); put_page_and_type(mfn_to_page(mfn)); + put_gfn(d, gmfn); } int wrmsr_viridian_regs(uint32_t idx, uint64_t val) |