aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/paravirt.h
diff options
context:
space:
mode:
authorGlauber de Oliveira Costa <gcosta@redhat.com>2008-01-30 07:32:06 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:32:06 -0500
commit658be9d395630d30a501c850bde90ac791a678c9 (patch)
tree0166e88fadd12baabd0aa1259fe266f28843e7aa /include/asm-x86/paravirt.h
parente5aaac443635c7c6f842f0bf8169f71f3236d574 (diff)
x86: change assembly definition of paravirt_patch_site
To account for differences in x86_64, we change the macros that create raw instances of the paravirt_patch_site struct. We need to align 64-pointers to 64-bit boundaries, so we add an alignment directive. Also, we need to make room for a word-sized pointer, instead of a fixed 32-bit one Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/paravirt.h')
-rw-r--r--include/asm-x86/paravirt.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
index 8f7984319c30..56389954d100 100644
--- a/include/asm-x86/paravirt.h
+++ b/include/asm-x86/paravirt.h
@@ -5,6 +5,7 @@
5 5
6#ifdef CONFIG_PARAVIRT 6#ifdef CONFIG_PARAVIRT
7#include <asm/page.h> 7#include <asm/page.h>
8#include <asm/asm.h>
8 9
9/* Bitmask of what can be clobbered: usually at least eax. */ 10/* Bitmask of what can be clobbered: usually at least eax. */
10#define CLBR_NONE 0x0 11#define CLBR_NONE 0x0
@@ -281,7 +282,8 @@ extern struct pv_mmu_ops pv_mmu_ops;
281#define _paravirt_alt(insn_string, type, clobber) \ 282#define _paravirt_alt(insn_string, type, clobber) \
282 "771:\n\t" insn_string "\n" "772:\n" \ 283 "771:\n\t" insn_string "\n" "772:\n" \
283 ".pushsection .parainstructions,\"a\"\n" \ 284 ".pushsection .parainstructions,\"a\"\n" \
284 " .long 771b\n" \ 285 _ASM_ALIGN "\n" \
286 _ASM_PTR " 771b\n" \
285 " .byte " type "\n" \ 287 " .byte " type "\n" \
286 " .byte 772b-771b\n" \ 288 " .byte 772b-771b\n" \
287 " .short " clobber "\n" \ 289 " .short " clobber "\n" \
@@ -1159,17 +1161,25 @@ static inline unsigned long __raw_local_irq_save(void)
1159 1161
1160#define PARA_PATCH(struct, off) ((PARAVIRT_PATCH_##struct + (off)) / 4) 1162#define PARA_PATCH(struct, off) ((PARAVIRT_PATCH_##struct + (off)) / 4)
1161 1163
1162#define PARA_SITE(ptype, clobbers, ops) \ 1164#define _PVSITE(ptype, clobbers, ops, word, algn) \
1163771:; \ 1165771:; \
1164 ops; \ 1166 ops; \
1165772:; \ 1167772:; \
1166 .pushsection .parainstructions,"a"; \ 1168 .pushsection .parainstructions,"a"; \
1167 .long 771b; \ 1169 .align algn; \
1170 word 771b; \
1168 .byte ptype; \ 1171 .byte ptype; \
1169 .byte 772b-771b; \ 1172 .byte 772b-771b; \
1170 .short clobbers; \ 1173 .short clobbers; \
1171 .popsection 1174 .popsection
1172 1175
1176
1177#ifdef CONFIG_X86_64
1178#define PARA_SITE(ptype, clobbers, ops) _PVSITE(ptype, clobbers, ops, .quad, 8)
1179#else
1180#define PARA_SITE(ptype, clobbers, ops) _PVSITE(ptype, clobbers, ops, .long, 4)
1181#endif
1182
1173#define INTERRUPT_RETURN \ 1183#define INTERRUPT_RETURN \
1174 PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_iret), CLBR_NONE, \ 1184 PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_iret), CLBR_NONE, \
1175 jmp *%cs:pv_cpu_ops+PV_CPU_iret) 1185 jmp *%cs:pv_cpu_ops+PV_CPU_iret)