aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/paravirt.h
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2008-07-08 18:07:12 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-16 05:05:23 -0400
commitc24481e9da2c7bc8aafab46e0bc64821244a24a6 (patch)
tree50f5a7de7e7be85a70dce9ee221ebc72f861efd9 /include/asm-x86/paravirt.h
parentc05f1cfaba846dfbd4a67e348087d32326288fe0 (diff)
xen64: save lots of registers
The Xen hypercall interface is allowed to trash any or all of the argument registers, so we need to be careful that the kernel state isn't damaged. On 32-bit kernels, the hypercall parameter registers same as a regparm function call, so we've got away without explicit clobbering so far. The 64-bit ABI defines lots of caller-save registers, so save them all for safety. We can trim this set later by re-distributing the responsibility for saving all these registers. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Cc: Stephen Tweedie <sct@redhat.com> Cc: Eduardo Habkost <ehabkost@redhat.com> Cc: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86/paravirt.h')
-rw-r--r--include/asm-x86/paravirt.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
index ef5e8ec6a6ab..eef8095a09dc 100644
--- a/include/asm-x86/paravirt.h
+++ b/include/asm-x86/paravirt.h
@@ -1396,8 +1396,8 @@ extern struct paravirt_patch_site __parainstructions[],
1396 * caller saved registers but the argument parameter */ 1396 * caller saved registers but the argument parameter */
1397#define PV_SAVE_REGS "pushq %%rdi;" 1397#define PV_SAVE_REGS "pushq %%rdi;"
1398#define PV_RESTORE_REGS "popq %%rdi;" 1398#define PV_RESTORE_REGS "popq %%rdi;"
1399#define PV_EXTRA_CLOBBERS EXTRA_CLOBBERS, "rcx" , "rdx" 1399#define PV_EXTRA_CLOBBERS EXTRA_CLOBBERS, "rcx" , "rdx", "rsi"
1400#define PV_VEXTRA_CLOBBERS EXTRA_CLOBBERS, "rdi", "rcx" , "rdx" 1400#define PV_VEXTRA_CLOBBERS EXTRA_CLOBBERS, "rdi", "rcx" , "rdx", "rsi"
1401#define PV_FLAGS_ARG "D" 1401#define PV_FLAGS_ARG "D"
1402#endif 1402#endif
1403 1403
@@ -1489,8 +1489,26 @@ static inline unsigned long __raw_local_irq_save(void)
1489 1489
1490 1490
1491#ifdef CONFIG_X86_64 1491#ifdef CONFIG_X86_64
1492#define PV_SAVE_REGS pushq %rax; pushq %rdi; pushq %rcx; pushq %rdx 1492#define PV_SAVE_REGS \
1493#define PV_RESTORE_REGS popq %rdx; popq %rcx; popq %rdi; popq %rax 1493 push %rax; \
1494 push %rcx; \
1495 push %rdx; \
1496 push %rsi; \
1497 push %rdi; \
1498 push %r8; \
1499 push %r9; \
1500 push %r10; \
1501 push %r11
1502#define PV_RESTORE_REGS \
1503 pop %r11; \
1504 pop %r10; \
1505 pop %r9; \
1506 pop %r8; \
1507 pop %rdi; \
1508 pop %rsi; \
1509 pop %rdx; \
1510 pop %rcx; \
1511 pop %rax
1494#define PARA_PATCH(struct, off) ((PARAVIRT_PATCH_##struct + (off)) / 8) 1512#define PARA_PATCH(struct, off) ((PARAVIRT_PATCH_##struct + (off)) / 8)
1495#define PARA_SITE(ptype, clobbers, ops) _PVSITE(ptype, clobbers, ops, .quad, 8) 1513#define PARA_SITE(ptype, clobbers, ops) _PVSITE(ptype, clobbers, ops, .quad, 8)
1496#define PARA_INDIRECT(addr) *addr(%rip) 1514#define PARA_INDIRECT(addr) *addr(%rip)