aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2011-10-18 23:58:28 -0700
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2011-10-18 23:58:28 -0700
commit378e05b539bdc7fed704070125480a4b7b58cef6 (patch)
tree35553136e570f4272fbb52659aa57cbd5dba0631
parent65b8e3da92e15a5012b1cec2daf9c931351a14e9 (diff)
downloadxen/mmu-perf-tweak.tar.gz
x86-32: add patching for set_pte* where possiblexen/mmu-perf-tweak
When using PAE, the code can get too large to inline - or have on-stack parameters - so only inline where possible. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
-rw-r--r--arch/x86/kernel/paravirt_patch_32.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/x86/kernel/paravirt_patch_32.c b/arch/x86/kernel/paravirt_patch_32.c
index d9f32e6d6ab654..ce5209bc4c5c65 100644
--- a/arch/x86/kernel/paravirt_patch_32.c
+++ b/arch/x86/kernel/paravirt_patch_32.c
@@ -11,6 +11,15 @@ DEF_NATIVE(pv_mmu_ops, write_cr3, "mov %eax, %cr3");
DEF_NATIVE(pv_mmu_ops, read_cr3, "mov %cr3, %eax");
DEF_NATIVE(pv_cpu_ops, clts, "clts");
DEF_NATIVE(pv_cpu_ops, read_tsc, "rdtsc");
+#if PAGETABLE_LEVELS < 3
+DEF_NATIVE(pv_mmu_ops, set_pte, "mov %edx, (%eax)");
+DEF_NATIVE(pv_mmu_ops, set_pte_at, "mov %eax, (%ecx)");
+DEF_NATIVE(pv_mmu_ops, ptep_modify_prot_start, "xor %eax, %eax; xchg %eax, (%ecx)");
+DEF_NATIVE(pv_mmu_ops, ptep_modify_prot_commit, "mov %eax, (%ecx)");
+#else
+DEF_NATIVE(pv_mmu_ops, set_pte, "mov %ecx,0x4(%eax); mov %edx,(%eax)");
+DEF_NATIVE(pv_mmu_ops, ptep_modify_prot_start, "xor %eax, %eax; xchg %eax, (%ecx); mov 4(%ecx), %edx");
+#endif
unsigned paravirt_patch_ident_32(void *insnbuf, unsigned len)
{
@@ -47,6 +56,12 @@ unsigned native_patch(u8 type, u16 clobbers, void *ibuf,
PATCH_SITE(pv_mmu_ops, write_cr3);
PATCH_SITE(pv_cpu_ops, clts);
PATCH_SITE(pv_cpu_ops, read_tsc);
+ PATCH_SITE(pv_mmu_ops, set_pte);
+ PATCH_SITE(pv_mmu_ops, ptep_modify_prot_start);
+#if PAGETABLE_LEVELS < 2
+ PATCH_SITE(pv_mmu_ops, set_pte_at);
+ PATCH_SITE(pv_mmu_ops, ptep_modify_prot_commit);
+#endif
patch_site:
ret = paravirt_patch_insns(ibuf, len, start, end);