* [PATCH for 2.6.22] [1/3] i386: Make CMPXCHG64 only dependent on PAE
@ 2007-06-23 0:29 Andi Kleen
2007-06-23 0:29 ` [PATCH for 2.6.22] [2/3] x86_64: Fix only make Macintosh drivers default on Macs Andi Kleen
2007-06-23 0:29 ` [PATCH for 2.6.22] [3/3] x86_64: Ignore compat mode SYSCALL when IA32_EMULATION is not defined Andi Kleen
0 siblings, 2 replies; 3+ messages in thread
From: Andi Kleen @ 2007-06-23 0:29 UTC (permalink / raw)
To: patches, torvalds, linux-kernel
It is only used for PAE kernels in set_64bit.
The problem is that due to a old Windows bug many CPUs need magic MSRs
to enable CMPXCHG64, and we can't do that nicely early enough before
it is potentially used.
But since we only need it in PAE kernels so only force the checking
for CMPXCHG65 with PAE.
This fixes a boot failure on Transmeta Crusoe
Signed-off-by: Andi Kleen <ak@suse.de>
---
arch/i386/Kconfig.cpu | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux/arch/i386/Kconfig.cpu
===================================================================
--- linux.orig/arch/i386/Kconfig.cpu
+++ linux/arch/i386/Kconfig.cpu
@@ -299,7 +299,7 @@ config X86_POPAD_OK
config X86_CMPXCHG64
bool
- depends on !M386 && !M486
+ depends on X86_PAE
default y
config X86_ALIGNMENT_16
Index: linux/arch/i386/Kconfig
===================================================================
--- linux.orig/arch/i386/Kconfig
+++ linux/arch/i386/Kconfig
@@ -541,7 +541,7 @@ config HIGHMEM4G
config HIGHMEM64G
bool "64GB"
- depends on X86_CMPXCHG64
+ depends on !M386 && !M486
help
Select this if you have a 32-bit processor and more than 4
gigabytes of physical RAM.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH for 2.6.22] [2/3] x86_64: Fix only make Macintosh drivers default on Macs
2007-06-23 0:29 [PATCH for 2.6.22] [1/3] i386: Make CMPXCHG64 only dependent on PAE Andi Kleen
@ 2007-06-23 0:29 ` Andi Kleen
2007-06-23 0:29 ` [PATCH for 2.6.22] [3/3] x86_64: Ignore compat mode SYSCALL when IA32_EMULATION is not defined Andi Kleen
1 sibling, 0 replies; 3+ messages in thread
From: Andi Kleen @ 2007-06-23 0:29 UTC (permalink / raw)
To: olaf, patches, torvalds, linux-kernel
From: Olaf Hering <olaf@aepfle.de>
Include PPC_MAC in the default too, not only MAC which only covers
m68k MACs.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Andi Kleen <ak@suse.de>
---
drivers/macintosh/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux/drivers/macintosh/Kconfig
===================================================================
--- linux.orig/drivers/macintosh/Kconfig
+++ linux/drivers/macintosh/Kconfig
@@ -2,7 +2,7 @@
menuconfig MACINTOSH_DRIVERS
bool "Macintosh device drivers"
depends on PPC || MAC || X86
- default y if MAC
+ default y if (PPC_PMAC || MAC)
if MACINTOSH_DRIVERS
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH for 2.6.22] [3/3] x86_64: Ignore compat mode SYSCALL when IA32_EMULATION is not defined
2007-06-23 0:29 [PATCH for 2.6.22] [1/3] i386: Make CMPXCHG64 only dependent on PAE Andi Kleen
2007-06-23 0:29 ` [PATCH for 2.6.22] [2/3] x86_64: Fix only make Macintosh drivers default on Macs Andi Kleen
@ 2007-06-23 0:29 ` Andi Kleen
1 sibling, 0 replies; 3+ messages in thread
From: Andi Kleen @ 2007-06-23 0:29 UTC (permalink / raw)
To: jbeulich, patches, torvalds, linux-kernel
Previously a program could switch to a compat mode segment and then
execute SYSCALL and it would jump to an uninitialized MSR and crash
the kernel.
Instead supply a dummy target for this case.
Pointed out by Jan Beulich
Cc: jbeulich@novell.com
Signed-off-by: Andi Kleen <ak@suse.de>
---
arch/x86_64/kernel/entry.S | 7 +++++++
arch/x86_64/kernel/setup64.c | 3 +++
2 files changed, 10 insertions(+)
Index: linux/arch/x86_64/kernel/entry.S
===================================================================
--- linux.orig/arch/x86_64/kernel/entry.S
+++ linux/arch/x86_64/kernel/entry.S
@@ -1163,3 +1163,10 @@ ENTRY(call_softirq)
ret
CFI_ENDPROC
ENDPROC(call_softirq)
+
+KPROBE_ENTRY(ignore_sysret)
+ CFI_STARTPROC
+ mov $-ENOSYS,%eax
+ sysret
+ CFI_ENDPROC
+ENDPROC(ignore_sysret)
Index: linux/arch/x86_64/kernel/setup64.c
===================================================================
--- linux.orig/arch/x86_64/kernel/setup64.c
+++ linux/arch/x86_64/kernel/setup64.c
@@ -150,6 +150,8 @@ void pda_init(int cpu)
char boot_exception_stacks[(N_EXCEPTION_STACKS - 1) * EXCEPTION_STKSZ + DEBUG_STKSZ]
__attribute__((section(".bss.page_aligned")));
+extern asmlinkage void ignore_sysret(void);
+
/* May not be marked __init: used by software suspend */
void syscall_init(void)
{
@@ -160,6 +162,7 @@ void syscall_init(void)
*/
wrmsrl(MSR_STAR, ((u64)__USER32_CS)<<48 | ((u64)__KERNEL_CS)<<32);
wrmsrl(MSR_LSTAR, system_call);
+ wrmsrl(MSR_CSTAR, ignore_sysret);
#ifdef CONFIG_IA32_EMULATION
syscall32_cpu_init ();
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-06-23 0:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-23 0:29 [PATCH for 2.6.22] [1/3] i386: Make CMPXCHG64 only dependent on PAE Andi Kleen
2007-06-23 0:29 ` [PATCH for 2.6.22] [2/3] x86_64: Fix only make Macintosh drivers default on Macs Andi Kleen
2007-06-23 0:29 ` [PATCH for 2.6.22] [3/3] x86_64: Ignore compat mode SYSCALL when IA32_EMULATION is not defined Andi Kleen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox