aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-x86/paging.h
diff options
context:
space:
mode:
authorTim Deegan <Tim.Deegan@eu.citrix.com>2007-11-02 15:41:57 +0000
committerTim Deegan <Tim.Deegan@eu.citrix.com>2007-11-02 15:41:57 +0000
commite6934effa82ba57e5de5efa123048886252d5c78 (patch)
tree0adf2ac8b74474dba027e20257bfd0d1661c88e3 /xen/include/asm-x86/paging.h
parent07fb260f00b310acbbbfdd693d503d9ea800c7ad (diff)
downloadxen-e6934effa82ba57e5de5efa123048886252d5c78.tar.gz
xen-e6934effa82ba57e5de5efa123048886252d5c78.tar.bz2
xen-e6934effa82ba57e5de5efa123048886252d5c78.zip
[SHADOW] Make the guest PT walker more complete.
We now check access rights and write back the _PAGE_ACCESSED and _PAGE_DIRTY bits into the guest entries as we walk the tables. This makes the shadow fault handler simpler, and the various emulation paths more correct. This patch doesn't add checking and write-back to the HAP pagetable walker; it just fixes up its arguments to match the new shadow one. Signed-off-by: Tim Deegan <Tim.Deegan@eu.citrix.com>
Diffstat (limited to 'xen/include/asm-x86/paging.h')
-rw-r--r--xen/include/asm-x86/paging.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index 842c4c7134..26a34c4836 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -105,7 +105,8 @@ 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);
- unsigned long (*gva_to_gfn )(struct vcpu *v, unsigned long va);
+ unsigned long (*gva_to_gfn )(struct vcpu *v, unsigned long va,
+ uint32_t *pfec);
void (*update_cr3 )(struct vcpu *v, int do_locking);
void (*update_paging_modes )(struct vcpu *v);
void (*write_p2m_entry )(struct vcpu *v, unsigned long gfn,
@@ -204,12 +205,17 @@ static inline int paging_invlpg(struct vcpu *v, unsigned long va)
}
/* Translate a guest virtual address to the frame number that the
- * *guest* pagetables would map it to. Returns INVALID_GFN if the guest
- * tables don't map this address. */
+ * *guest* pagetables would map it to. Returns INVALID_GFN if the guest
+ * tables don't map this address for this kind of access.
+ * pfec[0] is used to determine which kind of access this is when
+ * walking the tables. The caller should set the PFEC_page_present bit
+ * in pfec[0]; in the failure case, that bit will be cleared if appropriate. */
#define INVALID_GFN (-1UL)
-static inline unsigned long paging_gva_to_gfn(struct vcpu *v, unsigned long va)
+static inline unsigned long paging_gva_to_gfn(struct vcpu *v,
+ unsigned long va,
+ uint32_t *pfec)
{
- return v->arch.paging.mode->gva_to_gfn(v, va);
+ return v->arch.paging.mode->gva_to_gfn(v, va, pfec);
}
/* Update all the things that are derived from the guest's CR3.