* Patch: use .pushsection/.popsection
@ 2006-08-09 6:02 Zachary Amsden
2006-08-09 6:09 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 4+ messages in thread
From: Zachary Amsden @ 2006-08-09 6:02 UTC (permalink / raw)
To: Rusty Russell, Jeremy Fitzhardinge, Virtualization Mailing List
[-- Attachment #1: Type: text/plain, Size: 36 bytes --]
I think this might fix the X bug...
[-- Attachment #2: use-push-popsection.patch --]
[-- Type: text/plain, Size: 3823 bytes --]
diff -r e698e6ee2fa1 arch/i386/kernel/entry.S
--- a/arch/i386/kernel/entry.S Tue Aug 08 10:18:34 2006 -0700
+++ b/arch/i386/kernel/entry.S Tue Aug 08 10:36:17 2006 -0700
@@ -162,17 +162,17 @@ 2: popl %es; \
2: popl %es; \
CFI_ADJUST_CFA_OFFSET -4;\
/*CFI_RESTORE es;*/\
-.section .fixup,"ax"; \
+.pushsection .fixup,"ax"; \
3: movl $0,(%esp); \
jmp 1b; \
4: movl $0,(%esp); \
jmp 2b; \
-.previous; \
-.section __ex_table,"a";\
+.popsection \
+.pushsection __ex_table,"a";\
.align 4; \
.long 1b,3b; \
.long 2b,4b; \
-.previous
+.popsection
#define RING0_INT_FRAME \
CFI_STARTPROC simple;\
@@ -300,10 +300,10 @@ sysenter_past_esp:
cmpl $__PAGE_OFFSET-3,%ebp
jae syscall_fault
1: movl (%ebp),%ebp
-.section __ex_table,"a"
+.pushsection __ex_table,"a"
.align 4
.long 1b,syscall_fault
-.previous
+.popsection
pushl %eax
CFI_ADJUST_CFA_OFFSET 4
@@ -378,18 +378,18 @@ restore_nocheck_notrace:
addl $4, %esp
CFI_ADJUST_CFA_OFFSET -4
1: INTERRUPT_RETURN
-.section .fixup,"ax"
+.pushsection .fixup,"ax"
iret_exc:
TRACE_IRQS_ON
ENABLE_INTERRUPTS
pushl $0 # no error code
pushl $do_iret_error
jmp error_code
-.previous
-.section __ex_table,"a"
+.popsection
+.pushsection __ex_table,"a"
.align 4
.long 1b,iret_exc
-.previous
+.popsection
CFI_RESTORE_STATE
ldt_ss:
@@ -415,11 +415,11 @@ ldt_ss:
TRACE_IRQS_IRET
RESTORE_REGS
lss 20+4(%esp), %esp # switch to 16bit stack
-1: INTERRUPT_RETURN
-.section __ex_table,"a"
+1: iret
+.pushsection __ex_table,"a"
.align 4
.long 1b,iret_exc
-.previous
+.popsection
CFI_ENDPROC
# perform work that needs to be done immediately before resumption
@@ -525,14 +525,14 @@ syscall_badsys:
je 28f; \
27: popl %eax; \
CFI_ADJUST_CFA_OFFSET -4; \
-.section .fixup,"ax"; \
+.pushsection .fixup,"ax"; \
28: movl $__KERNEL_DS, %eax; \
movl %eax, %ds; \
movl %eax, %es; \
/* switch to 32bit stack */ \
FIXUP_ESPFIX_STACK; \
jmp 27b; \
-.previous
+.popsection
/*
* Build the entry stubs and pointer table with
@@ -639,7 +639,7 @@ error_code:
call *%edi
jmp ret_from_exception
CFI_ENDPROC
-.previous
+KPROBE_EXIT
ENTRY(coprocessor_error)
RING0_INT_FRAME
@@ -715,7 +715,7 @@ debug_stack_correct:
call do_debug
jmp ret_from_exception
CFI_ENDPROC
-.previous
+KPROBE_EXIT
/*
* NMI is doubly nasty. It can happen _while_ we're handling
@@ -795,12 +795,12 @@ nmi_16bit_stack:
call do_nmi
RESTORE_REGS
lss 12+4(%esp), %esp # back to 16bit stack
-1: INTERRUPT_RETURN
- CFI_ENDPROC
-.section __ex_table,"a"
+1: iret
+ CFI_ENDPROC
+.pushsection __ex_table,"a"
.align 4
.long 1b,iret_exc
-.previous
+.popsection
#ifdef CONFIG_PARAVIRT
ENTRY(nopara_iret)
@@ -821,7 +821,7 @@ KPROBE_ENTRY(int3)
call do_int3
jmp ret_from_exception
CFI_ENDPROC
-.previous
+KPROBE_EXIT
ENTRY(overflow)
RING0_INT_FRAME
@@ -886,7 +886,7 @@ KPROBE_ENTRY(general_protection)
CFI_ADJUST_CFA_OFFSET 4
jmp error_code
CFI_ENDPROC
-.previous
+KPROBE_EXIT
ENTRY(alignment_check)
RING0_EC_FRAME
diff -r e698e6ee2fa1 include/asm-i386/alternative-asm.i
--- a/include/asm-i386/alternative-asm.i Tue Aug 08 10:18:34 2006 -0700
+++ b/include/asm-i386/alternative-asm.i Tue Aug 08 10:33:13 2006 -0700
@@ -3,10 +3,10 @@
#ifdef CONFIG_SMP
.macro LOCK_PREFIX
1: lock
- .section .smp_locks,"a"
+ .pushsection .smp_locks,"a"
.align 4
.long 1b
- .previous
+ .popsection
.endm
#else
.macro LOCK_PREFIX
diff -r e698e6ee2fa1 include/linux/linkage.h
--- a/include/linux/linkage.h Tue Aug 08 10:18:34 2006 -0700
+++ b/include/linux/linkage.h Tue Aug 08 10:35:55 2006 -0700
@@ -35,8 +35,11 @@
#endif
#define KPROBE_ENTRY(name) \
- .section .kprobes.text, "ax"; \
+ .pushsection .kprobes.text, "ax"; \
ENTRY(name)
+
+#define KPROBE_EXIT \
+ .popsection
#ifndef END
#define END(name) \
[-- Attachment #3: Type: text/plain, Size: 165 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Patch: use .pushsection/.popsection
2006-08-09 6:02 Patch: use .pushsection/.popsection Zachary Amsden
@ 2006-08-09 6:09 ` Jeremy Fitzhardinge
2006-08-09 6:26 ` Andi Kleen
0 siblings, 1 reply; 4+ messages in thread
From: Jeremy Fitzhardinge @ 2006-08-09 6:09 UTC (permalink / raw)
To: Zachary Amsden; +Cc: Virtualization Mailing List
Zachary Amsden wrote:
> I think this might fix the X bug...
I just posted an equivalent patch to Andi Kleen/AKPM/LKML. I haven't
tested to see if it actually helps yet, but it certainly makes entry.o
look a lot cleaner.
J
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Patch: use .pushsection/.popsection
2006-08-09 6:09 ` Jeremy Fitzhardinge
@ 2006-08-09 6:26 ` Andi Kleen
2006-08-09 6:33 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2006-08-09 6:26 UTC (permalink / raw)
To: virtualization
On Wednesday 09 August 2006 08:09, Jeremy Fitzhardinge wrote:
> Zachary Amsden wrote:
> > I think this might fix the X bug...
> I just posted an equivalent patch to Andi Kleen/AKPM/LKML. I haven't
> tested to see if it actually helps yet, but it certainly makes entry.o
> look a lot cleaner.
I have already merged it.
But in theory all code should run fine in .fixup, so it shouldn't
actually unbreak anything.
-Andi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Patch: use .pushsection/.popsection
2006-08-09 6:26 ` Andi Kleen
@ 2006-08-09 6:33 ` Jeremy Fitzhardinge
0 siblings, 0 replies; 4+ messages in thread
From: Jeremy Fitzhardinge @ 2006-08-09 6:33 UTC (permalink / raw)
To: Andi Kleen; +Cc: virtualization
Andi Kleen wrote:
> I have already merged it.
>
> But in theory all code should run fine in .fixup, so it shouldn't
> actually unbreak anything.
>
No, it makes actual broken code without this:
#define RESTORE_REGS \
RESTORE_INT_REGS; \
1: popl %ds; \
CFI_ADJUST_CFA_OFFSET -4;\
/*CFI_RESTORE ds;*/\
2: popl %es; \
CFI_ADJUST_CFA_OFFSET -4;\
/*CFI_RESTORE es;*/\
.section .fixup,"ax"; \
3: movl $0,(%esp); \
jmp 1b; \
4: movl $0,(%esp); \
jmp 2b; \
.previous; \
...
Those jmp 1b's look a lot like infinite loops if 1: is in the same
section as 3:.
J
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-08-09 6:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-09 6:02 Patch: use .pushsection/.popsection Zachary Amsden
2006-08-09 6:09 ` Jeremy Fitzhardinge
2006-08-09 6:26 ` Andi Kleen
2006-08-09 6:33 ` Jeremy Fitzhardinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).