diff options
author | Tim Deegan <Tim.Deegan@citrix.com> | 2011-06-02 13:16:52 +0100 |
---|---|---|
committer | Tim Deegan <Tim.Deegan@citrix.com> | 2011-06-02 13:16:52 +0100 |
commit | 2e11350a2c29344ca372d98b5136e105bc0631de (patch) | |
tree | f6d3b909c52b5b0f5100f2ea5ce69980f4a11c99 /xen/include/asm-x86/paging.h | |
parent | 4ce6c4a45536f7e8094ef3f1cebfa048f23028f0 (diff) | |
download | xen-2e11350a2c29344ca372d98b5136e105bc0631de.tar.gz xen-2e11350a2c29344ca372d98b5136e105bc0631de.tar.bz2 xen-2e11350a2c29344ca372d98b5136e105bc0631de.zip |
x86/mm/p2m: paging_p2m_ga_to_gfn() doesn't need so many arguments
It has only one caller and is always called with p2m == hostp2m and mode
== hostmode. Also, since it's only called from nested HAP code, remove
the check of paging_mode_hap(). Then rename it to reflect its new
interface.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Diffstat (limited to 'xen/include/asm-x86/paging.h')
-rw-r--r-- | xen/include/asm-x86/paging.h | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h index b408e41273..adfec252e7 100644 --- a/xen/include/asm-x86/paging.h +++ b/xen/include/asm-x86/paging.h @@ -265,26 +265,19 @@ unsigned long paging_gva_to_gfn(struct vcpu *v, unsigned long va, uint32_t *pfec); -/* Translates a guest virtual address to guest physical address - * where the specified cr3 is translated to host physical address - * using the specified p2m table. - * This allows to do page walks in the guest or even in the nested guest. - * It returns the guest's gfn or the nested guest's gfn. +/* Translate a guest address using a particular CR3 value. This is used + * to by nested HAP code, to walk the guest-supplied NPT tables as if + * they were pagetables. * Use 'paddr_t' for the guest address so it won't overflow when * guest or nested guest is in 32bit PAE mode. */ -static inline unsigned long paging_p2m_ga_to_gfn(struct vcpu *v, - struct p2m_domain *p2m, - const struct paging_mode *mode, +static inline unsigned long paging_ga_to_gfn_cr3(struct vcpu *v, unsigned long cr3, paddr_t ga, uint32_t *pfec) { - if ( is_hvm_domain(v->domain) && paging_mode_hap(v->domain) ) - return mode->p2m_ga_to_gfn(v, p2m, cr3, ga, pfec); - - /* shadow paging */ - return paging_gva_to_gfn(v, ga, pfec); + struct p2m_domain *p2m = v->domain->arch.p2m; + return paging_get_hostmode(v)->p2m_ga_to_gfn(v, p2m, cr3, ga, pfec); } /* Update all the things that are derived from the guest's CR3. |