summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2011-08-28 23:15:33 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2011-08-28 23:15:33 +0200
commit32fe0684cc758e7624223044e4286f3e7c9f2c92 (patch)
treefc42ddc9fe6919ea802fd491ddd629756079bf26
parent9899c659b1a2436085e772d02f5394db7869bf64 (diff)
Disable (<i486)-only WP workaround on Xen & PAE
i386 didn't support PAE anyway. * i386/i386/locore.S (copyout_retry) [MACH_HYP || PAE]: Remove. * xen/xen.c (hyp_invalidate_pte): Remove function. * xen/xen.h (hyp_invalidate_pte): Remove prototype.
-rw-r--r--i386/i386/locore.S38
-rw-r--r--xen/xen.c7
-rw-r--r--xen/xen.h1
3 files changed, 2 insertions, 44 deletions
diff --git a/i386/i386/locore.S b/i386/i386/locore.S
index 379b219..77ca05b 100644
--- a/i386/i386/locore.S
+++ b/i386/i386/locore.S
@@ -1294,42 +1294,15 @@ Entry(copyoutmsg)
* XXX only have to do this on 386's.
*/
copyout_retry:
-#ifdef MACH_HYP
- movl cr3,%ecx /* point to page directory */
-#else /* MACH_HYP */
+#if !defined(MACH_HYP) && !PAE
movl %cr3,%ecx /* point to page directory */
-#endif /* MACH_HYP */
-#if PAE
- movl %edi,%eax /* get page directory pointer bits */
- shrl $(PDPSHIFT),%eax /* from user address */
- movl KERNELBASE(%ecx,%eax,PTE_SIZE),%ecx
- /* get page directory pointer */
-#ifdef MACH_PSEUDO_PHYS
- shrl $(PTESHIFT),%ecx
- movl pfn_list,%eax
- movl (%eax,%ecx,4),%ecx /* mfn_to_pfn */
- shll $(PTESHIFT),%ecx
-#else /* MACH_PSEUDO_PHYS */
- andl $(PTE_PFN),%ecx /* isolate page frame address */
-#endif /* MACH_PSEUDO_PHYS */
-#endif /* PAE */
movl %edi,%eax /* get page directory bits */
shrl $(PDESHIFT),%eax /* from user address */
-#if PAE
- andl $(PDEMASK),%eax
-#endif /* PAE */
movl KERNELBASE(%ecx,%eax,PTE_SIZE),%ecx
/* get page directory pointer */
testl $(PTE_V),%ecx /* present? */
jz 0f /* if not, fault is OK */
-#ifdef MACH_PSEUDO_PHYS
- shrl $(PTESHIFT),%ecx
- movl pfn_list,%eax
- movl (%eax,%ecx,4),%ecx /* mfn_to_pfn */
- shll $(PTESHIFT),%ecx
-#else /* MACH_PSEUDO_PHYS */
andl $(PTE_PFN),%ecx /* isolate page frame address */
-#endif /* MACH_PSEUDO_PHYS */
movl %edi,%eax /* get page table bits */
shrl $(PTESHIFT),%eax
andl $(PTEMASK),%eax /* from user address */
@@ -1343,18 +1316,11 @@ copyout_retry:
/*
* Not writable - must fake a fault. Turn off access to the page.
*/
-#ifdef MACH_HYP
- pushl %edx
- pushl %ecx
- call hyp_invalidate_pte
- popl %ecx
- popl %edx
-#else /* MACH_HYP */
andl $(PTE_INVALID),(%ecx) /* turn off valid bit */
movl %cr3,%eax /* invalidate TLB */
movl %eax,%cr3
-#endif /* MACH_HYP */
0:
+#endif /* !defined(MACH_HYP) && !PAE */
/*
* Copy only what fits on the current destination page.
diff --git a/xen/xen.c b/xen/xen.c
index f8f964e..c3c533c 100644
--- a/xen/xen.c
+++ b/xen/xen.c
@@ -30,13 +30,6 @@
#include "xen.h"
#include "evt.h"
-void hyp_invalidate_pte(pt_entry_t *pte)
-{
- if (!hyp_mmu_update_pte(kv_to_ma(pte), (*pte) & ~INTEL_PTE_VALID))
- panic("%s:%d could not set pte %p(%p) to %p(%p)\n",__FILE__,__LINE__,pte,(vm_offset_t) kv_to_ma(pte),*pte,ma_to_pa(*pte));
- hyp_mmuext_op_void(MMUEXT_TLB_FLUSH_LOCAL);
-}
-
void hyp_debug()
{
panic("debug");
diff --git a/xen/xen.h b/xen/xen.h
index 6eeb350..2f4d6bd 100644
--- a/xen/xen.h
+++ b/xen/xen.h
@@ -21,7 +21,6 @@
void hyp_init(void);
void hyp_dev_init(void);
-void hyp_invalidate_pte(pt_entry_t *pte);
void hyp_idle(void);
void hyp_p2m_init(void);