2011-03-02 08:43:24

by Shaohua Li

[permalink] [raw]
Subject: [tip:x86/mm] x86: Work around old gas bug

Commit-ID: 253d89d3dd6b65595f317e5f1ecef43aa207a3a0
Gitweb: http://git.kernel.org/tip/253d89d3dd6b65595f317e5f1ecef43aa207a3a0
Author: Shaohua Li <[email protected]>
AuthorDate: Tue, 1 Mar 2011 15:52:26 -0800
Committer: Ingo Molnar <[email protected]>
CommitDate: Wed, 2 Mar 2011 08:16:23 +0100

x86: Work around old gas bug

pre-2.16 binutils works fine, post-2.16 binutils works fine, but 2.16 broke again:

> arch/x86/kernel/entry_64.S: Assembler messages:
> arch/x86/kernel/entry_64.S:984: Error: junk at end of line, first unrecognized character is `1'
> [...]

Signed-off-by: Shaohua Li <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Jan Beulich <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
---
arch/x86/include/asm/entry_arch.h | 164 +++++++++++++++++++++++++++++++++++--
arch/x86/kernel/entry_64.S | 133 ++++++++++++++++++++++++++++--
2 files changed, 285 insertions(+), 12 deletions(-)

diff --git a/arch/x86/include/asm/entry_arch.h b/arch/x86/include/asm/entry_arch.h
index 1cd6d26..374c641 100644
--- a/arch/x86/include/asm/entry_arch.h
+++ b/arch/x86/include/asm/entry_arch.h
@@ -16,14 +16,166 @@ BUILD_INTERRUPT(call_function_single_interrupt,CALL_FUNCTION_SINGLE_VECTOR)
BUILD_INTERRUPT(irq_move_cleanup_interrupt,IRQ_MOVE_CLEANUP_VECTOR)
BUILD_INTERRUPT(reboot_interrupt,REBOOT_VECTOR)

-.irp idx,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, \
- 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
-.if NUM_INVALIDATE_TLB_VECTORS > \idx
-BUILD_INTERRUPT3(invalidate_interrupt\idx,
- (INVALIDATE_TLB_VECTOR_START)+\idx,
+.if NUM_INVALIDATE_TLB_VECTORS > 0
+BUILD_INTERRUPT3(invalidate_interrupt0,
+ (INVALIDATE_TLB_VECTOR_START)+0,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 1
+BUILD_INTERRUPT3(invalidate_interrupt1,
+ (INVALIDATE_TLB_VECTOR_START)+1,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 2
+BUILD_INTERRUPT3(invalidate_interrupt2,
+ (INVALIDATE_TLB_VECTOR_START)+2,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 3
+BUILD_INTERRUPT3(invalidate_interrupt3,
+ (INVALIDATE_TLB_VECTOR_START)+3,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 4
+BUILD_INTERRUPT3(invalidate_interrupt4,
+ (INVALIDATE_TLB_VECTOR_START)+4,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 5
+BUILD_INTERRUPT3(invalidate_interrupt5,
+ (INVALIDATE_TLB_VECTOR_START)+5,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 6
+BUILD_INTERRUPT3(invalidate_interrupt6,
+ (INVALIDATE_TLB_VECTOR_START)+6,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 7
+BUILD_INTERRUPT3(invalidate_interrupt7,
+ (INVALIDATE_TLB_VECTOR_START)+7,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 8
+BUILD_INTERRUPT3(invalidate_interrupt8,
+ (INVALIDATE_TLB_VECTOR_START)+8,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 9
+BUILD_INTERRUPT3(invalidate_interrupt9,
+ (INVALIDATE_TLB_VECTOR_START)+9,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 10
+BUILD_INTERRUPT3(invalidate_interrupt10,
+ (INVALIDATE_TLB_VECTOR_START)+10,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 11
+BUILD_INTERRUPT3(invalidate_interrupt11,
+ (INVALIDATE_TLB_VECTOR_START)+11,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 12
+BUILD_INTERRUPT3(invalidate_interrupt12,
+ (INVALIDATE_TLB_VECTOR_START)+12,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 13
+BUILD_INTERRUPT3(invalidate_interrupt13,
+ (INVALIDATE_TLB_VECTOR_START)+13,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 14
+BUILD_INTERRUPT3(invalidate_interrupt14,
+ (INVALIDATE_TLB_VECTOR_START)+14,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 15
+BUILD_INTERRUPT3(invalidate_interrupt15,
+ (INVALIDATE_TLB_VECTOR_START)+15,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 16
+BUILD_INTERRUPT3(invalidate_interrupt16,
+ (INVALIDATE_TLB_VECTOR_START)+16,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 17
+BUILD_INTERRUPT3(invalidate_interrupt17,
+ (INVALIDATE_TLB_VECTOR_START)+17,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 18
+BUILD_INTERRUPT3(invalidate_interrupt18,
+ (INVALIDATE_TLB_VECTOR_START)+18,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 19
+BUILD_INTERRUPT3(invalidate_interrupt19,
+ (INVALIDATE_TLB_VECTOR_START)+19,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 20
+BUILD_INTERRUPT3(invalidate_interrupt20,
+ (INVALIDATE_TLB_VECTOR_START)+20,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 21
+BUILD_INTERRUPT3(invalidate_interrupt21,
+ (INVALIDATE_TLB_VECTOR_START)+21,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 22
+BUILD_INTERRUPT3(invalidate_interrupt22,
+ (INVALIDATE_TLB_VECTOR_START)+22,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 23
+BUILD_INTERRUPT3(invalidate_interrupt23,
+ (INVALIDATE_TLB_VECTOR_START)+23,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 24
+BUILD_INTERRUPT3(invalidate_interrupt24,
+ (INVALIDATE_TLB_VECTOR_START)+24,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 25
+BUILD_INTERRUPT3(invalidate_interrupt25,
+ (INVALIDATE_TLB_VECTOR_START)+25,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 26
+BUILD_INTERRUPT3(invalidate_interrupt26,
+ (INVALIDATE_TLB_VECTOR_START)+26,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 27
+BUILD_INTERRUPT3(invalidate_interrupt27,
+ (INVALIDATE_TLB_VECTOR_START)+27,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 28
+BUILD_INTERRUPT3(invalidate_interrupt28,
+ (INVALIDATE_TLB_VECTOR_START)+28,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 29
+BUILD_INTERRUPT3(invalidate_interrupt29,
+ (INVALIDATE_TLB_VECTOR_START)+29,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 30
+BUILD_INTERRUPT3(invalidate_interrupt30,
+ (INVALIDATE_TLB_VECTOR_START)+30,
+ smp_invalidate_interrupt)
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 31
+BUILD_INTERRUPT3(invalidate_interrupt31,
+ (INVALIDATE_TLB_VECTOR_START)+31,
smp_invalidate_interrupt)
.endif
-.endr
#endif

BUILD_INTERRUPT(x86_platform_ipi, X86_PLATFORM_IPI_VECTOR)
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 891268c..1705021 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -975,13 +975,134 @@ apicinterrupt X86_PLATFORM_IPI_VECTOR \
x86_platform_ipi smp_x86_platform_ipi

#ifdef CONFIG_SMP
-.irp idx,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, \
- 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
-.if NUM_INVALIDATE_TLB_VECTORS > \idx
-apicinterrupt (INVALIDATE_TLB_VECTOR_START)+\idx \
- invalidate_interrupt\idx smp_invalidate_interrupt
+.if NUM_INVALIDATE_TLB_VECTORS > 0
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+0 \
+ invalidate_interrupt0 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 1
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+1 \
+ invalidate_interrupt1 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 2
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+2 \
+ invalidate_interrupt2 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 3
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+3 \
+ invalidate_interrupt3 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 4
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+4 \
+ invalidate_interrupt4 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 5
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+5 \
+ invalidate_interrupt5 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 6
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+6 \
+ invalidate_interrupt6 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 7
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+7 \
+ invalidate_interrupt7 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 8
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+8 \
+ invalidate_interrupt8 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 9
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+9 \
+ invalidate_interrupt9 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 10
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+10 \
+ invalidate_interrupt10 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 11
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+11 \
+ invalidate_interrupt11 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 12
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+12 \
+ invalidate_interrupt12 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 13
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+13 \
+ invalidate_interrupt13 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 14
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+14 \
+ invalidate_interrupt14 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 15
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+15 \
+ invalidate_interrupt15 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 16
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+16 \
+ invalidate_interrupt16 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 17
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+17 \
+ invalidate_interrupt17 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 18
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+18 \
+ invalidate_interrupt18 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 19
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+19 \
+ invalidate_interrupt19 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 20
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+20 \
+ invalidate_interrupt20 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 21
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+21 \
+ invalidate_interrupt21 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 22
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+22 \
+ invalidate_interrupt22 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 23
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+23 \
+ invalidate_interrupt23 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 24
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+24 \
+ invalidate_interrupt24 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 25
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+25 \
+ invalidate_interrupt25 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 26
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+26 \
+ invalidate_interrupt26 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 27
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+27 \
+ invalidate_interrupt27 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 28
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+28 \
+ invalidate_interrupt28 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 29
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+29 \
+ invalidate_interrupt29 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 30
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+30 \
+ invalidate_interrupt30 smp_invalidate_interrupt
+.endif
+.if NUM_INVALIDATE_TLB_VECTORS > 31
+apicinterrupt (INVALIDATE_TLB_VECTOR_START)+31 \
+ invalidate_interrupt31 smp_invalidate_interrupt
.endif
-.endr
#endif

apicinterrupt THRESHOLD_APIC_VECTOR \


2011-03-02 10:35:44

by Jan Beulich

[permalink] [raw]
Subject: Re: [tip:x86/mm] x86: Work around old gas bug

>>> On 02.03.11 at 09:42, tip-bot for Shaohua Li <[email protected]> wrote:
> Commit-ID: 253d89d3dd6b65595f317e5f1ecef43aa207a3a0
> Gitweb:
> http://git.kernel.org/tip/253d89d3dd6b65595f317e5f1ecef43aa207a3a0
> Author: Shaohua Li <[email protected]>
> AuthorDate: Tue, 1 Mar 2011 15:52:26 -0800
> Committer: Ingo Molnar <[email protected]>
> CommitDate: Wed, 2 Mar 2011 08:16:23 +0100
>
> x86: Work around old gas bug
>
> pre-2.16 binutils works fine, post-2.16 binutils works fine, but 2.16 broke
> again:
>
> > arch/x86/kernel/entry_64.S: Assembler messages:
> > arch/x86/kernel/entry_64.S:984: Error: junk at end of line, first
> unrecognized character is `1'
> > [...]
>
> Signed-off-by: Shaohua Li <[email protected]>
> Signed-off-by: Andrew Morton <[email protected]>
> Cc: "H. Peter Anvin" <[email protected]>
> Cc: Jan Beulich <[email protected]>
> LKML-Reference: <[email protected]>
> Signed-off-by: Ingo Molnar <[email protected]>

Ingo, didn't you write yesterday that this looks unacceptable to
you?

Shaohua, did you try whether the .irpc alternative I suggested
works (knowing that a similar .irpc was in place previously)?

Jan

> ---
> arch/x86/include/asm/entry_arch.h | 164
> +++++++++++++++++++++++++++++++++++--
> arch/x86/kernel/entry_64.S | 133 ++++++++++++++++++++++++++++--
> 2 files changed, 285 insertions(+), 12 deletions(-)
>
> diff --git a/arch/x86/include/asm/entry_arch.h
> b/arch/x86/include/asm/entry_arch.h
> index 1cd6d26..374c641 100644
> --- a/arch/x86/include/asm/entry_arch.h
> +++ b/arch/x86/include/asm/entry_arch.h
> @@ -16,14 +16,166 @@
> BUILD_INTERRUPT(call_function_single_interrupt,CALL_FUNCTION_SINGLE_VECTOR)
> BUILD_INTERRUPT(irq_move_cleanup_interrupt,IRQ_MOVE_CLEANUP_VECTOR)
> BUILD_INTERRUPT(reboot_interrupt,REBOOT_VECTOR)
>
> -.irp idx,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, \
> - 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
> -.if NUM_INVALIDATE_TLB_VECTORS > \idx
> -BUILD_INTERRUPT3(invalidate_interrupt\idx,
> - (INVALIDATE_TLB_VECTOR_START)+\idx,
> +.if NUM_INVALIDATE_TLB_VECTORS > 0
> +BUILD_INTERRUPT3(invalidate_interrupt0,
> + (INVALIDATE_TLB_VECTOR_START)+0,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 1
> +BUILD_INTERRUPT3(invalidate_interrupt1,
> + (INVALIDATE_TLB_VECTOR_START)+1,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 2
> +BUILD_INTERRUPT3(invalidate_interrupt2,
> + (INVALIDATE_TLB_VECTOR_START)+2,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 3
> +BUILD_INTERRUPT3(invalidate_interrupt3,
> + (INVALIDATE_TLB_VECTOR_START)+3,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 4
> +BUILD_INTERRUPT3(invalidate_interrupt4,
> + (INVALIDATE_TLB_VECTOR_START)+4,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 5
> +BUILD_INTERRUPT3(invalidate_interrupt5,
> + (INVALIDATE_TLB_VECTOR_START)+5,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 6
> +BUILD_INTERRUPT3(invalidate_interrupt6,
> + (INVALIDATE_TLB_VECTOR_START)+6,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 7
> +BUILD_INTERRUPT3(invalidate_interrupt7,
> + (INVALIDATE_TLB_VECTOR_START)+7,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 8
> +BUILD_INTERRUPT3(invalidate_interrupt8,
> + (INVALIDATE_TLB_VECTOR_START)+8,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 9
> +BUILD_INTERRUPT3(invalidate_interrupt9,
> + (INVALIDATE_TLB_VECTOR_START)+9,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 10
> +BUILD_INTERRUPT3(invalidate_interrupt10,
> + (INVALIDATE_TLB_VECTOR_START)+10,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 11
> +BUILD_INTERRUPT3(invalidate_interrupt11,
> + (INVALIDATE_TLB_VECTOR_START)+11,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 12
> +BUILD_INTERRUPT3(invalidate_interrupt12,
> + (INVALIDATE_TLB_VECTOR_START)+12,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 13
> +BUILD_INTERRUPT3(invalidate_interrupt13,
> + (INVALIDATE_TLB_VECTOR_START)+13,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 14
> +BUILD_INTERRUPT3(invalidate_interrupt14,
> + (INVALIDATE_TLB_VECTOR_START)+14,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 15
> +BUILD_INTERRUPT3(invalidate_interrupt15,
> + (INVALIDATE_TLB_VECTOR_START)+15,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 16
> +BUILD_INTERRUPT3(invalidate_interrupt16,
> + (INVALIDATE_TLB_VECTOR_START)+16,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 17
> +BUILD_INTERRUPT3(invalidate_interrupt17,
> + (INVALIDATE_TLB_VECTOR_START)+17,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 18
> +BUILD_INTERRUPT3(invalidate_interrupt18,
> + (INVALIDATE_TLB_VECTOR_START)+18,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 19
> +BUILD_INTERRUPT3(invalidate_interrupt19,
> + (INVALIDATE_TLB_VECTOR_START)+19,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 20
> +BUILD_INTERRUPT3(invalidate_interrupt20,
> + (INVALIDATE_TLB_VECTOR_START)+20,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 21
> +BUILD_INTERRUPT3(invalidate_interrupt21,
> + (INVALIDATE_TLB_VECTOR_START)+21,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 22
> +BUILD_INTERRUPT3(invalidate_interrupt22,
> + (INVALIDATE_TLB_VECTOR_START)+22,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 23
> +BUILD_INTERRUPT3(invalidate_interrupt23,
> + (INVALIDATE_TLB_VECTOR_START)+23,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 24
> +BUILD_INTERRUPT3(invalidate_interrupt24,
> + (INVALIDATE_TLB_VECTOR_START)+24,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 25
> +BUILD_INTERRUPT3(invalidate_interrupt25,
> + (INVALIDATE_TLB_VECTOR_START)+25,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 26
> +BUILD_INTERRUPT3(invalidate_interrupt26,
> + (INVALIDATE_TLB_VECTOR_START)+26,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 27
> +BUILD_INTERRUPT3(invalidate_interrupt27,
> + (INVALIDATE_TLB_VECTOR_START)+27,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 28
> +BUILD_INTERRUPT3(invalidate_interrupt28,
> + (INVALIDATE_TLB_VECTOR_START)+28,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 29
> +BUILD_INTERRUPT3(invalidate_interrupt29,
> + (INVALIDATE_TLB_VECTOR_START)+29,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 30
> +BUILD_INTERRUPT3(invalidate_interrupt30,
> + (INVALIDATE_TLB_VECTOR_START)+30,
> + smp_invalidate_interrupt)
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 31
> +BUILD_INTERRUPT3(invalidate_interrupt31,
> + (INVALIDATE_TLB_VECTOR_START)+31,
> smp_invalidate_interrupt)
> .endif
> -.endr
> #endif
>
> BUILD_INTERRUPT(x86_platform_ipi, X86_PLATFORM_IPI_VECTOR)
> diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
> index 891268c..1705021 100644
> --- a/arch/x86/kernel/entry_64.S
> +++ b/arch/x86/kernel/entry_64.S
> @@ -975,13 +975,134 @@ apicinterrupt X86_PLATFORM_IPI_VECTOR \
> x86_platform_ipi smp_x86_platform_ipi
>
> #ifdef CONFIG_SMP
> -.irp idx,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, \
> - 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
> -.if NUM_INVALIDATE_TLB_VECTORS > \idx
> -apicinterrupt (INVALIDATE_TLB_VECTOR_START)+\idx \
> - invalidate_interrupt\idx smp_invalidate_interrupt
> +.if NUM_INVALIDATE_TLB_VECTORS > 0
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+0 \
> + invalidate_interrupt0 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 1
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+1 \
> + invalidate_interrupt1 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 2
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+2 \
> + invalidate_interrupt2 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 3
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+3 \
> + invalidate_interrupt3 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 4
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+4 \
> + invalidate_interrupt4 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 5
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+5 \
> + invalidate_interrupt5 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 6
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+6 \
> + invalidate_interrupt6 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 7
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+7 \
> + invalidate_interrupt7 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 8
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+8 \
> + invalidate_interrupt8 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 9
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+9 \
> + invalidate_interrupt9 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 10
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+10 \
> + invalidate_interrupt10 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 11
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+11 \
> + invalidate_interrupt11 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 12
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+12 \
> + invalidate_interrupt12 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 13
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+13 \
> + invalidate_interrupt13 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 14
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+14 \
> + invalidate_interrupt14 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 15
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+15 \
> + invalidate_interrupt15 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 16
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+16 \
> + invalidate_interrupt16 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 17
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+17 \
> + invalidate_interrupt17 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 18
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+18 \
> + invalidate_interrupt18 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 19
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+19 \
> + invalidate_interrupt19 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 20
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+20 \
> + invalidate_interrupt20 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 21
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+21 \
> + invalidate_interrupt21 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 22
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+22 \
> + invalidate_interrupt22 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 23
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+23 \
> + invalidate_interrupt23 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 24
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+24 \
> + invalidate_interrupt24 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 25
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+25 \
> + invalidate_interrupt25 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 26
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+26 \
> + invalidate_interrupt26 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 27
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+27 \
> + invalidate_interrupt27 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 28
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+28 \
> + invalidate_interrupt28 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 29
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+29 \
> + invalidate_interrupt29 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 30
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+30 \
> + invalidate_interrupt30 smp_invalidate_interrupt
> +.endif
> +.if NUM_INVALIDATE_TLB_VECTORS > 31
> +apicinterrupt (INVALIDATE_TLB_VECTOR_START)+31 \
> + invalidate_interrupt31 smp_invalidate_interrupt
> .endif
> -.endr
> #endif
>
> apicinterrupt THRESHOLD_APIC_VECTOR \

2011-03-02 10:42:09

by Ingo Molnar

[permalink] [raw]
Subject: Re: [tip:x86/mm] x86: Work around old gas bug


* Jan Beulich <[email protected]> wrote:

> >>> On 02.03.11 at 09:42, tip-bot for Shaohua Li <[email protected]> wrote:
> > Commit-ID: 253d89d3dd6b65595f317e5f1ecef43aa207a3a0
> > Gitweb:
> > http://git.kernel.org/tip/253d89d3dd6b65595f317e5f1ecef43aa207a3a0
> > Author: Shaohua Li <[email protected]>
> > AuthorDate: Tue, 1 Mar 2011 15:52:26 -0800
> > Committer: Ingo Molnar <[email protected]>
> > CommitDate: Wed, 2 Mar 2011 08:16:23 +0100
> >
> > x86: Work around old gas bug
> >
> > pre-2.16 binutils works fine, post-2.16 binutils works fine, but 2.16 broke
> > again:
> >
> > > arch/x86/kernel/entry_64.S: Assembler messages:
> > > arch/x86/kernel/entry_64.S:984: Error: junk at end of line, first
> > unrecognized character is `1'
> > > [...]
> >
> > Signed-off-by: Shaohua Li <[email protected]>
> > Signed-off-by: Andrew Morton <[email protected]>
> > Cc: "H. Peter Anvin" <[email protected]>
> > Cc: Jan Beulich <[email protected]>
> > LKML-Reference: <[email protected]>
> > Signed-off-by: Ingo Molnar <[email protected]>
>
> Ingo, didn't you write yesterday that this looks unacceptable to you?

Yes, and we can push this to Linus only once that's been resolved. I trust you to
queue up the real solution or come up with good reasons why that is not possible for
GAS 2.16. (at which point we'll just have to live with the ugliness, up to the point
we decide to deprecate binutils 2.16.)

Meanwhile, what i hate more than ugly code repetition is code that does not build at
all on akpm's test environment ;-)

Thanks,

Ingo

2011-03-02 12:49:15

by Shaohua Li

[permalink] [raw]
Subject: Re: [tip:x86/mm] x86: Work around old gas bug

On Wed, Mar 02, 2011 at 06:35:39PM +0800, Jan Beulich wrote:
> >>> On 02.03.11 at 09:42, tip-bot for Shaohua Li <[email protected]> wrote:
> > Commit-ID: 253d89d3dd6b65595f317e5f1ecef43aa207a3a0
> > Gitweb:
> > http://git.kernel.org/tip/253d89d3dd6b65595f317e5f1ecef43aa207a3a0
> > Author: Shaohua Li <[email protected]>
> > AuthorDate: Tue, 1 Mar 2011 15:52:26 -0800
> > Committer: Ingo Molnar <[email protected]>
> > CommitDate: Wed, 2 Mar 2011 08:16:23 +0100
> >
> > x86: Work around old gas bug
> >
> > pre-2.16 binutils works fine, post-2.16 binutils works fine, but 2.16 broke
> > again:
> >
> > > arch/x86/kernel/entry_64.S: Assembler messages:
> > > arch/x86/kernel/entry_64.S:984: Error: junk at end of line, first
> > unrecognized character is `1'
> > > [...]
> >
> > Signed-off-by: Shaohua Li <[email protected]>
> > Signed-off-by: Andrew Morton <[email protected]>
> > Cc: "H. Peter Anvin" <[email protected]>
> > Cc: Jan Beulich <[email protected]>
> > LKML-Reference: <[email protected]>
> > Signed-off-by: Ingo Molnar <[email protected]>
>
> Ingo, didn't you write yesterday that this looks unacceptable to
> you?
>
> Shaohua, did you try whether the .irpc alternative I suggested
> works (knowing that a similar .irpc was in place previously)?
I tried, but fails at early stage (not related to the problem). According
to HPA, I need rebuild gcc too, which I haven't done yet.

Thanks,
Shaohua

2011-03-02 16:25:49

by Andrew Morton

[permalink] [raw]
Subject: Re: [tip:x86/mm] x86: Work around old gas bug

On Wed, 2 Mar 2011 11:41:44 +0100 Ingo Molnar <[email protected]> wrote:

> Meanwhile, what i hate more than ugly code repetition is code that does not build at
> all on akpm's test environment ;-)

I hadn't got around to testing it. Bad news :(

x86_64 allmodconfig:

arch/x86/kernel/entry_64.S: Assembler messages:
arch/x86/kernel/entry_64.S:979: Error: too many positional arguments
arch/x86/kernel/entry_64.S:983: Error: too many positional arguments
arch/x86/kernel/entry_64.S:987: Error: too many positional arguments
arch/x86/kernel/entry_64.S:991: Error: too many positional arguments
arch/x86/kernel/entry_64.S:995: Error: too many positional arguments
arch/x86/kernel/entry_64.S:999: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1003: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1007: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1011: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1015: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1019: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1023: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1027: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1031: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1035: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1039: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1043: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1047: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1051: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1055: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1059: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1063: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1067: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1071: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1075: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1079: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1083: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1087: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1091: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1095: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1099: Error: too many positional arguments
arch/x86/kernel/entry_64.S:1103: Error: too many positional arguments
make[1]: *** [arch/x86/kernel/entry_64.o] Error 1
make: *** [arch/x86/kernel/entry_64.o] Error 2

There much be some magic workaround for this within apicinterrupt but I
didn't find it.

2011-03-03 05:27:27

by Shaohua Li

[permalink] [raw]
Subject: Re: [tip:x86/mm] x86: Work around old gas bug

On Thu, 2011-03-03 at 00:24 +0800, Andrew Morton wrote:
> On Wed, 2 Mar 2011 11:41:44 +0100 Ingo Molnar <[email protected]> wrote:
>
> > Meanwhile, what i hate more than ugly code repetition is code that does not build at
> > all on akpm's test environment ;-)
>
> I hadn't got around to testing it. Bad news :(
>
Andrew,
can you this on your side? this is what Jan proposed. I can only test a
latest binutils here.

Thanks,
Shaohua

---
arch/x86/include/asm/entry_arch.h | 13 ++++---
arch/x86/include/asm/hw_irq.h | 44 ++++++++++++-------------
arch/x86/kernel/entry_64.S | 13 ++++---
arch/x86/kernel/irqinit.c | 66 +++++++++++++++++++-------------------
4 files changed, 69 insertions(+), 67 deletions(-)

Index: linux/arch/x86/include/asm/entry_arch.h
===================================================================
--- linux.orig/arch/x86/include/asm/entry_arch.h 2011-03-03 11:24:15.000000000 +0800
+++ linux/arch/x86/include/asm/entry_arch.h 2011-03-03 11:29:01.000000000 +0800
@@ -16,13 +16,14 @@ BUILD_INTERRUPT(call_function_single_int
BUILD_INTERRUPT(irq_move_cleanup_interrupt,IRQ_MOVE_CLEANUP_VECTOR)
BUILD_INTERRUPT(reboot_interrupt,REBOOT_VECTOR)

-.irp idx,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, \
- 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
-.if NUM_INVALIDATE_TLB_VECTORS > \idx
-BUILD_INTERRUPT3(invalidate_interrupt\idx,
- (INVALIDATE_TLB_VECTOR_START)+\idx,
+.irpc maj, "01"
+ .irpc min, "0123456789abcdef"
+ .if NUM_INVALIDATE_TLB_VECTORS > 0x\maj\min
+BUILD_INTERRUPT3(invalidate_interrupt\maj\min,
+ (INVALIDATE_TLB_VECTOR_START)+0x\maj\min,
smp_invalidate_interrupt)
-.endif
+ .endif
+ .endr
.endr
#endif

Index: linux/arch/x86/kernel/entry_64.S
===================================================================
--- linux.orig/arch/x86/kernel/entry_64.S 2011-03-03 11:23:57.000000000 +0800
+++ linux/arch/x86/kernel/entry_64.S 2011-03-03 11:29:04.000000000 +0800
@@ -975,12 +975,13 @@ apicinterrupt X86_PLATFORM_IPI_VECTOR \
x86_platform_ipi smp_x86_platform_ipi

#ifdef CONFIG_SMP
-.irp idx,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, \
- 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
-.if NUM_INVALIDATE_TLB_VECTORS > \idx
-apicinterrupt (INVALIDATE_TLB_VECTOR_START)+\idx \
- invalidate_interrupt\idx smp_invalidate_interrupt
-.endif
+.irpc maj, "01"
+ .irpc min, "0123456789abcdef"
+ .if NUM_INVALIDATE_TLB_VECTORS > 0x\maj\min
+ apicinterrupt (INVALIDATE_TLB_VECTOR_START)+0x\maj\min \
+ invalidate_interrupt\maj\min smp_invalidate_interrupt
+ .endif
+ .endr
.endr
#endif

Index: linux/arch/x86/include/asm/hw_irq.h
===================================================================
--- linux.orig/arch/x86/include/asm/hw_irq.h 2011-03-03 11:29:42.000000000 +0800
+++ linux/arch/x86/include/asm/hw_irq.h 2011-03-03 11:31:37.000000000 +0800
@@ -37,16 +37,22 @@ extern void reschedule_interrupt(void);
extern void mce_self_interrupt(void);

extern void invalidate_interrupt(void);
-extern void invalidate_interrupt0(void);
-extern void invalidate_interrupt1(void);
-extern void invalidate_interrupt2(void);
-extern void invalidate_interrupt3(void);
-extern void invalidate_interrupt4(void);
-extern void invalidate_interrupt5(void);
-extern void invalidate_interrupt6(void);
-extern void invalidate_interrupt7(void);
-extern void invalidate_interrupt8(void);
-extern void invalidate_interrupt9(void);
+extern void invalidate_interrupt00(void);
+extern void invalidate_interrupt01(void);
+extern void invalidate_interrupt02(void);
+extern void invalidate_interrupt03(void);
+extern void invalidate_interrupt04(void);
+extern void invalidate_interrupt05(void);
+extern void invalidate_interrupt06(void);
+extern void invalidate_interrupt07(void);
+extern void invalidate_interrupt08(void);
+extern void invalidate_interrupt09(void);
+extern void invalidate_interrupt0a(void);
+extern void invalidate_interrupt0b(void);
+extern void invalidate_interrupt0c(void);
+extern void invalidate_interrupt0d(void);
+extern void invalidate_interrupt0e(void);
+extern void invalidate_interrupt0f(void);
extern void invalidate_interrupt10(void);
extern void invalidate_interrupt11(void);
extern void invalidate_interrupt12(void);
@@ -57,18 +63,12 @@ extern void invalidate_interrupt16(void)
extern void invalidate_interrupt17(void);
extern void invalidate_interrupt18(void);
extern void invalidate_interrupt19(void);
-extern void invalidate_interrupt20(void);
-extern void invalidate_interrupt21(void);
-extern void invalidate_interrupt22(void);
-extern void invalidate_interrupt23(void);
-extern void invalidate_interrupt24(void);
-extern void invalidate_interrupt25(void);
-extern void invalidate_interrupt26(void);
-extern void invalidate_interrupt27(void);
-extern void invalidate_interrupt28(void);
-extern void invalidate_interrupt29(void);
-extern void invalidate_interrupt30(void);
-extern void invalidate_interrupt31(void);
+extern void invalidate_interrupt1a(void);
+extern void invalidate_interrupt1b(void);
+extern void invalidate_interrupt1c(void);
+extern void invalidate_interrupt1d(void);
+extern void invalidate_interrupt1e(void);
+extern void invalidate_interrupt1f(void);

extern void irq_move_cleanup_interrupt(void);
extern void reboot_interrupt(void);
Index: linux/arch/x86/kernel/irqinit.c
===================================================================
--- linux.orig/arch/x86/kernel/irqinit.c 2011-03-03 11:32:04.000000000 +0800
+++ linux/arch/x86/kernel/irqinit.c 2011-03-03 11:39:48.000000000 +0800
@@ -165,74 +165,74 @@ static void __init smp_intr_init(void)

/* IPIs for invalidation */
#define ALLOC_INVTLB_VEC(NR) \
- alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+NR, \
+ alloc_intr_gate(INVALIDATE_TLB_VECTOR_START+0x##NR, \
invalidate_interrupt##NR)

switch (NUM_INVALIDATE_TLB_VECTORS) {
default:
- ALLOC_INVTLB_VEC(31);
+ ALLOC_INVTLB_VEC(1f);
case 31:
- ALLOC_INVTLB_VEC(30);
+ ALLOC_INVTLB_VEC(1e);
case 30:
- ALLOC_INVTLB_VEC(29);
+ ALLOC_INVTLB_VEC(1d);
case 29:
- ALLOC_INVTLB_VEC(28);
+ ALLOC_INVTLB_VEC(1c);
case 28:
- ALLOC_INVTLB_VEC(27);
+ ALLOC_INVTLB_VEC(1b);
case 27:
- ALLOC_INVTLB_VEC(26);
+ ALLOC_INVTLB_VEC(1a);
case 26:
- ALLOC_INVTLB_VEC(25);
+ ALLOC_INVTLB_VEC(19);
case 25:
- ALLOC_INVTLB_VEC(24);
+ ALLOC_INVTLB_VEC(18);
case 24:
- ALLOC_INVTLB_VEC(23);
+ ALLOC_INVTLB_VEC(17);
case 23:
- ALLOC_INVTLB_VEC(22);
+ ALLOC_INVTLB_VEC(16);
case 22:
- ALLOC_INVTLB_VEC(21);
+ ALLOC_INVTLB_VEC(15);
case 21:
- ALLOC_INVTLB_VEC(20);
+ ALLOC_INVTLB_VEC(14);
case 20:
- ALLOC_INVTLB_VEC(19);
+ ALLOC_INVTLB_VEC(13);
case 19:
- ALLOC_INVTLB_VEC(18);
+ ALLOC_INVTLB_VEC(12);
case 18:
- ALLOC_INVTLB_VEC(17);
+ ALLOC_INVTLB_VEC(11);
case 17:
- ALLOC_INVTLB_VEC(16);
+ ALLOC_INVTLB_VEC(10);
case 16:
- ALLOC_INVTLB_VEC(15);
+ ALLOC_INVTLB_VEC(0f);
case 15:
- ALLOC_INVTLB_VEC(14);
+ ALLOC_INVTLB_VEC(0e);
case 14:
- ALLOC_INVTLB_VEC(13);
+ ALLOC_INVTLB_VEC(0d);
case 13:
- ALLOC_INVTLB_VEC(12);
+ ALLOC_INVTLB_VEC(0c);
case 12:
- ALLOC_INVTLB_VEC(11);
+ ALLOC_INVTLB_VEC(0b);
case 11:
- ALLOC_INVTLB_VEC(10);
+ ALLOC_INVTLB_VEC(0a);
case 10:
- ALLOC_INVTLB_VEC(9);
+ ALLOC_INVTLB_VEC(09);
case 9:
- ALLOC_INVTLB_VEC(8);
+ ALLOC_INVTLB_VEC(08);
case 8:
- ALLOC_INVTLB_VEC(7);
+ ALLOC_INVTLB_VEC(07);
case 7:
- ALLOC_INVTLB_VEC(6);
+ ALLOC_INVTLB_VEC(06);
case 6:
- ALLOC_INVTLB_VEC(5);
+ ALLOC_INVTLB_VEC(05);
case 5:
- ALLOC_INVTLB_VEC(4);
+ ALLOC_INVTLB_VEC(04);
case 4:
- ALLOC_INVTLB_VEC(3);
+ ALLOC_INVTLB_VEC(03);
case 3:
- ALLOC_INVTLB_VEC(2);
+ ALLOC_INVTLB_VEC(02);
case 2:
- ALLOC_INVTLB_VEC(1);
+ ALLOC_INVTLB_VEC(01);
case 1:
- ALLOC_INVTLB_VEC(0);
+ ALLOC_INVTLB_VEC(00);
break;
}


2011-03-03 05:36:23

by Andrew Morton

[permalink] [raw]
Subject: Re: [tip:x86/mm] x86: Work around old gas bug

On Thu, 03 Mar 2011 13:27:05 +0800 Shaohua Li <[email protected]> wrote:

> On Thu, 2011-03-03 at 00:24 +0800, Andrew Morton wrote:
> > On Wed, 2 Mar 2011 11:41:44 +0100 Ingo Molnar <[email protected]> wrote:
> >
> > > Meanwhile, what i hate more than ugly code repetition is code that does not build at
> > > all on akpm's test environment ;-)
> >
> > I hadn't got around to testing it. Bad news :(
> >
> Andrew,
> can you this on your side? this is what Jan proposed. I can only test a
> latest binutils here.

Nope.

arch/x86/kernel/entry_64.S: Assembler messages:
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
arch/x86/kernel/entry_64.S:985: Error: too many positional arguments

2011-03-03 05:37:29

by Andrew Morton

[permalink] [raw]
Subject: Re: [tip:x86/mm] x86: Work around old gas bug

On Thu, 03 Mar 2011 13:27:05 +0800 Shaohua Li <[email protected]> wrote:

> On Thu, 2011-03-03 at 00:24 +0800, Andrew Morton wrote:
> > On Wed, 2 Mar 2011 11:41:44 +0100 Ingo Molnar <[email protected]> wrote:
> >
> > > Meanwhile, what i hate more than ugly code repetition is code that does not build at
> > > all on akpm's test environment ;-)
> >
> > I hadn't got around to testing it. Bad news :(
> >
> Andrew,
> can you this on your side? this is what Jan proposed. I can only test a
> latest binutils here.

btw, binaries for the offending binutils are at
http://userweb.kernel.org/~akpm/cross-compilers/ in
x86_64-cross.tar.bz2

2011-03-03 09:35:36

by Ingo Molnar

[permalink] [raw]
Subject: Re: [tip:x86/mm] x86: Work around old gas bug


* Jan Beulich <[email protected]> wrote:

> >>> On 03.03.11 at 06:35, Andrew Morton <[email protected]> wrote:
> > On Thu, 03 Mar 2011 13:27:05 +0800 Shaohua Li <[email protected]> wrote:
> >
> >> On Thu, 2011-03-03 at 00:24 +0800, Andrew Morton wrote:
> >> > On Wed, 2 Mar 2011 11:41:44 +0100 Ingo Molnar <[email protected]> wrote:
> >> >
> >> > > Meanwhile, what i hate more than ugly code repetition is code that does
> > not build at
> >> > > all on akpm's test environment ;-)
> >> >
> >> > I hadn't got around to testing it. Bad news :(
> >> >
> >> Andrew,
> >> can you this on your side? this is what Jan proposed. I can only test a
> >> latest binutils here.
> >
> > Nope.
> >
> > arch/x86/kernel/entry_64.S: Assembler messages:
> > arch/x86/kernel/entry_64.S:985: Error: too many positional arguments
>
> Indeed - the problem isn't with the actual assembly construct, but
> rather with the changed definitions of *INVALIDATE_TLB_VECTOR* -
> properly parenthesizing them (as we needed to do in other places)
> and removing unnecessary spaces gets this to build for me, even
> with the original use of .irp instead of .irpc:
>
> #if NR_CPUS <= 32
> # define NUM_INVALIDATE_TLB_VECTORS (NR_CPUS)
> #else
> # define NUM_INVALIDATE_TLB_VECTORS (32)
> #endif
>
> #define INVALIDATE_TLB_VECTOR_END (0xee)
> #define INVALIDATE_TLB_VECTOR_START \
> (INVALIDATE_TLB_VECTOR_END-NUM_INVALIDATE_TLB_VECTORS+1)

That looks much nicer!

Mind sending a patch? I zapped the original non-working workaround from -tip.

Thanks,

Ingo

2011-03-03 09:48:08

by Jan Beulich

[permalink] [raw]
Subject: Re: [tip:x86/mm] x86: Work around old gas bug

>>> On 03.03.11 at 06:35, Andrew Morton <[email protected]> wrote:
> On Thu, 03 Mar 2011 13:27:05 +0800 Shaohua Li <[email protected]> wrote:
>
>> On Thu, 2011-03-03 at 00:24 +0800, Andrew Morton wrote:
>> > On Wed, 2 Mar 2011 11:41:44 +0100 Ingo Molnar <[email protected]> wrote:
>> >
>> > > Meanwhile, what i hate more than ugly code repetition is code that does
> not build at
>> > > all on akpm's test environment ;-)
>> >
>> > I hadn't got around to testing it. Bad news :(
>> >
>> Andrew,
>> can you this on your side? this is what Jan proposed. I can only test a
>> latest binutils here.
>
> Nope.
>
> arch/x86/kernel/entry_64.S: Assembler messages:
> arch/x86/kernel/entry_64.S:985: Error: too many positional arguments

Indeed - the problem isn't with the actual assembly construct, but
rather with the changed definitions of *INVALIDATE_TLB_VECTOR* -
properly parenthesizing them (as we needed to do in other places)
and removing unnecessary spaces gets this to build for me, even
with the original use of .irp instead of .irpc:

#if NR_CPUS <= 32
# define NUM_INVALIDATE_TLB_VECTORS (NR_CPUS)
#else
# define NUM_INVALIDATE_TLB_VECTORS (32)
#endif

#define INVALIDATE_TLB_VECTOR_END (0xee)
#define INVALIDATE_TLB_VECTOR_START \
(INVALIDATE_TLB_VECTOR_END-NUM_INVALIDATE_TLB_VECTORS+1)

Jan