diff options
author | Tim Deegan <Tim.Deegan@xensource.com> | 2007-02-20 15:37:03 +0000 |
---|---|---|
committer | Tim Deegan <Tim.Deegan@xensource.com> | 2007-02-20 15:37:03 +0000 |
commit | 621bd0c079569d4b1f2046a46386836888ae4e4f (patch) | |
tree | f1f43a1700261c835620890d6c054dbb5923bc34 /xen/include/asm-x86/paging.h | |
parent | 25fc3fb4645e8d079f8e3648ec40fa08088b30fd (diff) | |
download | xen-621bd0c079569d4b1f2046a46386836888ae4e4f.tar.gz xen-621bd0c079569d4b1f2046a46386836888ae4e4f.tar.bz2 xen-621bd0c079569d4b1f2046a46386836888ae4e4f.zip |
[XEN] Get rid of gva_to_gpa translation
It didn't have any sensible error checking. Make all callers
use gva_to_gfn translation and check the result. MMIO and PIO
callers inject pagefaults to the guest iof the non-IO address is
not mapped.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
Diffstat (limited to 'xen/include/asm-x86/paging.h')
-rw-r--r-- | xen/include/asm-x86/paging.h | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h index 63ef49d693..249e206a5a 100644 --- a/xen/include/asm-x86/paging.h +++ b/xen/include/asm-x86/paging.h @@ -115,7 +115,6 @@ struct paging_mode { int (*page_fault )(struct vcpu *v, unsigned long va, struct cpu_user_regs *regs); int (*invlpg )(struct vcpu *v, unsigned long va); - paddr_t (*gva_to_gpa )(struct vcpu *v, unsigned long va); unsigned long (*gva_to_gfn )(struct vcpu *v, unsigned long va); void (*update_cr3 )(struct vcpu *v, int do_locking); void (*update_paging_modes )(struct vcpu *v); @@ -190,18 +189,10 @@ static inline int paging_invlpg(struct vcpu *v, unsigned long va) return v->arch.paging.mode->invlpg(v, va); } -/* Translate a guest virtual address to the physical address that the - * *guest* pagetables would map it to. */ -static inline paddr_t paging_gva_to_gpa(struct vcpu *v, unsigned long va) -{ - if ( unlikely(!paging_vcpu_mode_translate(v)) ) - return (paddr_t) va; - - return v->arch.paging.mode->gva_to_gpa(v, va); -} - /* Translate a guest virtual address to the frame number that the - * *guest* pagetables would map it to. */ + * *guest* pagetables would map it to. Returns INVALID_GFN if the guest + * tables don't map this address. */ +#define INVALID_GFN (-1UL) static inline unsigned long paging_gva_to_gfn(struct vcpu *v, unsigned long va) { if ( unlikely(!paging_vcpu_mode_translate(v)) ) |