* [PATCH] [1/19] x86_64: Update defconfig
[not found] <20061021 651.356252000@suse.de>
@ 2006-10-21 16:51 ` Andi Kleen
2006-10-21 16:51 ` [PATCH] [2/19] i386: " Andi Kleen
` (15 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Andi Kleen @ 2006-10-21 16:51 UTC (permalink / raw)
To: patches, linux-kernel
Signed-off-by: Andi Kleen <ak@suse.de>
---
arch/x86_64/defconfig | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)
Index: linux/arch/x86_64/defconfig
===================================================================
--- linux.orig/arch/x86_64/defconfig
+++ linux/arch/x86_64/defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.19-rc1
-# Thu Oct 5 13:04:43 2006
+# Linux kernel version: 2.6.19-rc2-git4
+# Sat Oct 21 03:38:52 2006
#
CONFIG_X86_64=y
CONFIG_64BIT=y
@@ -335,8 +335,8 @@ CONFIG_IPV6=y
# CONFIG_INET6_XFRM_MODE_TUNNEL is not set
# CONFIG_INET6_XFRM_MODE_BEET is not set
# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=y
# CONFIG_IPV6_TUNNEL is not set
-# CONFIG_IPV6_SUBTREES is not set
# CONFIG_IPV6_MULTIPLE_TABLES is not set
# CONFIG_NETWORK_SECMARK is not set
# CONFIG_NETFILTER is not set
@@ -438,6 +438,13 @@ CONFIG_BLK_DEV_INITRD=y
# CONFIG_ATA_OVER_ETH is not set
#
+# Misc devices
+#
+# CONFIG_IBM_ASM is not set
+# CONFIG_SGI_IOC4 is not set
+# CONFIG_TIFM_CORE is not set
+
+#
# ATA/ATAPI/MFM/RLL support
#
CONFIG_IDE=y
@@ -1008,6 +1015,7 @@ CONFIG_I2C_ISA=m
#
# Dallas's 1-wire bus
#
+# CONFIG_W1 is not set
#
# Hardware Monitoring support
@@ -1059,12 +1067,6 @@ CONFIG_SENSORS_SMSC47B397=m
# CONFIG_HWMON_DEBUG_CHIP is not set
#
-# Misc devices
-#
-# CONFIG_IBM_ASM is not set
-# CONFIG_TIFM_CORE is not set
-
-#
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set
@@ -1196,7 +1198,6 @@ CONFIG_USB_HIDINPUT=y
# CONFIG_USB_ATI_REMOTE2 is not set
# CONFIG_USB_KEYSPAN_REMOTE is not set
# CONFIG_USB_APPLETOUCH is not set
-# CONFIG_USB_TRANCEVIBRATOR is not set
#
# USB Imaging devices
@@ -1242,6 +1243,7 @@ CONFIG_USB_MON=y
# CONFIG_USB_APPLEDISPLAY is not set
# CONFIG_USB_SISUSBVGA is not set
# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
# CONFIG_USB_TEST is not set
#
@@ -1318,6 +1320,7 @@ CONFIG_EXT3_FS=y
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
# CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4DEV_FS is not set
CONFIG_JBD=y
# CONFIG_JBD_DEBUG is not set
CONFIG_FS_MBCACHE=y
@@ -1341,6 +1344,7 @@ CONFIG_DNOTIFY=y
# CONFIG_AUTOFS_FS is not set
CONFIG_AUTOFS4_FS=y
# CONFIG_FUSE_FS is not set
+CONFIG_GENERIC_ACL=y
#
# CD-ROM/DVD Filesystems
@@ -1418,7 +1422,6 @@ CONFIG_SUNRPC=y
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set
# CONFIG_9P_FS is not set
-CONFIG_GENERIC_ACL=y
#
# Partition Types
@@ -1471,10 +1474,6 @@ CONFIG_NLS_ISO8859_15=y
CONFIG_NLS_UTF8=y
#
-# Distributed Lock Manager
-#
-
-#
# Instrumentation Support
#
CONFIG_PROFILING=y
@@ -1512,6 +1511,7 @@ CONFIG_DEBUG_FS=y
CONFIG_UNWIND_INFO=y
CONFIG_STACK_UNWIND=y
# CONFIG_FORCED_INLINING is not set
+# CONFIG_HEADERS_CHECK is not set
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_LKDTM is not set
# CONFIG_DEBUG_RODATA is not set
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH] [2/19] i386: Update defconfig
[not found] <20061021 651.356252000@suse.de>
2006-10-21 16:51 ` [PATCH] [1/19] x86_64: Update defconfig Andi Kleen
@ 2006-10-21 16:51 ` Andi Kleen
2006-10-21 16:51 ` [PATCH] [3/19] x86_64: x86_64 hot-add memory srat.c fix Andi Kleen
` (14 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Andi Kleen @ 2006-10-21 16:51 UTC (permalink / raw)
To: patches, linux-kernel
Signed-off-by: Andi Kleen <ak@suse.de>
---
arch/i386/defconfig | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)
Index: linux/arch/i386/defconfig
===================================================================
--- linux.orig/arch/i386/defconfig
+++ linux/arch/i386/defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.19-rc1
-# Thu Oct 5 13:04:53 2006
+# Linux kernel version: 2.6.19-rc2-git4
+# Sat Oct 21 03:38:56 2006
#
CONFIG_X86_32=y
CONFIG_GENERIC_TIME=y
@@ -380,8 +380,8 @@ CONFIG_INET6_XFRM_MODE_TRANSPORT=y
CONFIG_INET6_XFRM_MODE_TUNNEL=y
# CONFIG_INET6_XFRM_MODE_BEET is not set
# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=y
# CONFIG_IPV6_TUNNEL is not set
-# CONFIG_IPV6_SUBTREES is not set
# CONFIG_IPV6_MULTIPLE_TABLES is not set
# CONFIG_NETWORK_SECMARK is not set
# CONFIG_NETFILTER is not set
@@ -483,6 +483,13 @@ CONFIG_BLK_DEV_INITRD=y
# CONFIG_ATA_OVER_ETH is not set
#
+# Misc devices
+#
+# CONFIG_IBM_ASM is not set
+# CONFIG_SGI_IOC4 is not set
+# CONFIG_TIFM_CORE is not set
+
+#
# ATA/ATAPI/MFM/RLL support
#
CONFIG_IDE=y
@@ -1024,6 +1031,7 @@ CONFIG_HANGCHECK_TIMER=y
#
# Dallas's 1-wire bus
#
+# CONFIG_W1 is not set
#
# Hardware Monitoring support
@@ -1032,12 +1040,6 @@ CONFIG_HANGCHECK_TIMER=y
# CONFIG_HWMON_VID is not set
#
-# Misc devices
-#
-# CONFIG_IBM_ASM is not set
-# CONFIG_TIFM_CORE is not set
-
-#
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set
@@ -1169,7 +1171,6 @@ CONFIG_USB_HIDINPUT=y
# CONFIG_USB_ATI_REMOTE2 is not set
# CONFIG_USB_KEYSPAN_REMOTE is not set
# CONFIG_USB_APPLETOUCH is not set
-# CONFIG_USB_TRANCEVIBRATOR is not set
#
# USB Imaging devices
@@ -1215,6 +1216,7 @@ CONFIG_USB_MON=y
# CONFIG_USB_APPLEDISPLAY is not set
# CONFIG_USB_SISUSBVGA is not set
# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
# CONFIG_USB_TEST is not set
#
@@ -1284,6 +1286,7 @@ CONFIG_EXT3_FS=y
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
# CONFIG_EXT3_FS_SECURITY is not set
+# CONFIG_EXT4DEV_FS is not set
CONFIG_JBD=y
# CONFIG_JBD_DEBUG is not set
CONFIG_FS_MBCACHE=y
@@ -1307,6 +1310,7 @@ CONFIG_DNOTIFY=y
# CONFIG_AUTOFS_FS is not set
CONFIG_AUTOFS4_FS=y
# CONFIG_FUSE_FS is not set
+CONFIG_GENERIC_ACL=y
#
# CD-ROM/DVD Filesystems
@@ -1384,7 +1388,6 @@ CONFIG_SUNRPC=y
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set
# CONFIG_9P_FS is not set
-CONFIG_GENERIC_ACL=y
#
# Partition Types
@@ -1437,10 +1440,6 @@ CONFIG_NLS_ISO8859_15=y
CONFIG_NLS_UTF8=y
#
-# Distributed Lock Manager
-#
-
-#
# Instrumentation Support
#
CONFIG_PROFILING=y
@@ -1480,6 +1479,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_UNWIND_INFO=y
CONFIG_STACK_UNWIND=y
# CONFIG_FORCED_INLINING is not set
+# CONFIG_HEADERS_CHECK is not set
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_LKDTM is not set
CONFIG_EARLY_PRINTK=y
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH] [3/19] x86_64: x86_64 hot-add memory srat.c fix
[not found] <20061021 651.356252000@suse.de>
2006-10-21 16:51 ` [PATCH] [1/19] x86_64: Update defconfig Andi Kleen
2006-10-21 16:51 ` [PATCH] [2/19] i386: " Andi Kleen
@ 2006-10-21 16:51 ` Andi Kleen
2006-10-21 16:51 ` [PATCH] [4/19] x86_64: typo in __assign_irq_vector when updating pos for vector and offset Andi Kleen
` (13 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Andi Kleen @ 2006-10-21 16:51 UTC (permalink / raw)
To: keith mannthey, patches, linux-kernel
From: keith mannthey <kmannth@us.ibm.com>
This patch corrects the logic used in srat.c to figure out what
parsing what action to take when registering hot-add areas. Hot-add
areas should only be added to the node information for the
MEMORY_HOTPLUG_RESERVE case. When booting MEMORY_HOTPLUG_SPARSE hot-add
areas on everything but the last node are getting include in the node
data and during kernel boot the pages are setup then the kernel dies
when the pages are used. This patch fixes this issue.
Signed-off-by: Keith Mannthey <kmannth@us.ibm.com>
Signed-off-by: Andi Kleen <ak@suse.de>
---
srat.c | 4 ++--
arch/x86_64/mm/srat.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: linux/arch/x86_64/mm/srat.c
===================================================================
--- linux.orig/arch/x86_64/mm/srat.c
+++ linux/arch/x86_64/mm/srat.c
@@ -207,7 +207,7 @@ static inline int save_add_info(void)
return hotadd_percent > 0;
}
#else
-int update_end_of_memory(unsigned long end) {return 0;}
+int update_end_of_memory(unsigned long end) {return -1;}
static int hotadd_enough_memory(struct bootnode *nd) {return 1;}
#ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
static inline int save_add_info(void) {return 1;}
@@ -337,7 +337,7 @@ acpi_numa_memory_affinity_init(struct ac
push_node_boundaries(node, nd->start >> PAGE_SHIFT,
nd->end >> PAGE_SHIFT);
- if (ma->flags.hot_pluggable && !reserve_hotadd(node, start, end) < 0) {
+ if (ma->flags.hot_pluggable && (reserve_hotadd(node, start, end) < 0)) {
/* Ignore hotadd region. Undo damage */
printk(KERN_NOTICE "SRAT: Hotplug region ignored\n");
*nd = oldnode;
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH] [4/19] x86_64: typo in __assign_irq_vector when updating pos for vector and offset
[not found] <20061021 651.356252000@suse.de>
` (2 preceding siblings ...)
2006-10-21 16:51 ` [PATCH] [3/19] x86_64: x86_64 hot-add memory srat.c fix Andi Kleen
@ 2006-10-21 16:51 ` Andi Kleen
2006-10-21 16:51 ` [PATCH] [5/19] i386: fix .cfi_signal_frame copy-n-paste error Andi Kleen
` (12 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Andi Kleen @ 2006-10-21 16:51 UTC (permalink / raw)
To: Yinghai Lu, patches, linux-kernel
From: Yinghai Lu <yinghai.lu@amd.com>
typo with cpu instead of new_cpu
Signed-off-by: Yinghai Lu <yinghai.lu@amd.com>
Signed-off-by: Andi Kleen <ak@suse.de>
---
arch/x86_64/kernel/io_apic.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
Index: linux/arch/x86_64/kernel/io_apic.c
===================================================================
--- linux.orig/arch/x86_64/kernel/io_apic.c
+++ linux/arch/x86_64/kernel/io_apic.c
@@ -651,12 +651,12 @@ next:
if (vector == IA32_SYSCALL_VECTOR)
goto next;
for_each_cpu_mask(new_cpu, domain)
- if (per_cpu(vector_irq, cpu)[vector] != -1)
+ if (per_cpu(vector_irq, new_cpu)[vector] != -1)
goto next;
/* Found one! */
for_each_cpu_mask(new_cpu, domain) {
- pos[cpu].vector = vector;
- pos[cpu].offset = offset;
+ pos[new_cpu].vector = vector;
+ pos[new_cpu].offset = offset;
}
if (old_vector >= 0) {
int old_cpu;
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH] [5/19] i386: fix .cfi_signal_frame copy-n-paste error
[not found] <20061021 651.356252000@suse.de>
` (3 preceding siblings ...)
2006-10-21 16:51 ` [PATCH] [4/19] x86_64: typo in __assign_irq_vector when updating pos for vector and offset Andi Kleen
@ 2006-10-21 16:51 ` Andi Kleen
2006-10-21 16:51 ` [PATCH] [6/19] x86_64: Fix for arch/x86_64/pci/Makefile CFLAGS Andi Kleen
` (11 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Andi Kleen @ 2006-10-21 16:51 UTC (permalink / raw)
To: Andrew Morton, Andi Kleen, Jan Beulich, Ingo Molnar, patches,
linux-kernel
From: Andrew Morton <akpm@osdl.org>
This was copied, pasted but not edited.
Cc: Andi Kleen <ak@muc.de>
Cc: Jan Beulich <jbeulich@novell.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Andi Kleen <ak@suse.de>
---
arch/i386/Makefile | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: linux/arch/i386/Makefile
===================================================================
--- linux.orig/arch/i386/Makefile
+++ linux/arch/i386/Makefile
@@ -51,8 +51,8 @@ cflags-y += $(call as-instr,.cfi_startpr
AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
# is .cfi_signal_frame supported too?
-cflags-y += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
-AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
+cflags-y += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,)
+AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,)
CFLAGS += $(cflags-y)
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH] [6/19] x86_64: Fix for arch/x86_64/pci/Makefile CFLAGS
[not found] <20061021 651.356252000@suse.de>
` (4 preceding siblings ...)
2006-10-21 16:51 ` [PATCH] [5/19] i386: fix .cfi_signal_frame copy-n-paste error Andi Kleen
@ 2006-10-21 16:51 ` Andi Kleen
2006-10-21 16:51 ` [PATCH] [7/19] x86_64: fix page align in e820 allocator Andi Kleen
` (10 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Andi Kleen @ 2006-10-21 16:51 UTC (permalink / raw)
To: Corey Minyard, Andi Kleen, Vojtech Pavlik, Sam Ravnborg, patches,
linux-kernel
From: Corey Minyard <minyard@acm.org>
The arch/x86_64/pci directory was giving problems in a wierd cross-compile
environment. The exact cause is unknown, but the Makefile used CFLAGS
instead of EXTRA_CFLAGS. From what I can tell from
Documentation/kbuild/makefiles.txt, CFLAGS should not be used for this, it
should be EXTRA_CFLAGS. And it solves the cross-compile problem.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Andi Kleen <ak@muc.de>
Cc: Vojtech Pavlik <vojtech@suse.cz>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---
arch/x86_64/pci/Makefile | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: linux/arch/x86_64/pci/Makefile
===================================================================
--- linux.orig/arch/x86_64/pci/Makefile
+++ linux/arch/x86_64/pci/Makefile
@@ -3,7 +3,7 @@
#
# Reuse the i386 PCI subsystem
#
-CFLAGS += -Iarch/i386/pci
+EXTRA_CFLAGS += -Iarch/i386/pci
obj-y := i386.o
obj-$(CONFIG_PCI_DIRECT)+= direct.o
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH] [7/19] x86_64: fix page align in e820 allocator
[not found] <20061021 651.356252000@suse.de>
` (5 preceding siblings ...)
2006-10-21 16:51 ` [PATCH] [6/19] x86_64: Fix for arch/x86_64/pci/Makefile CFLAGS Andi Kleen
@ 2006-10-21 16:51 ` Andi Kleen
2006-10-21 16:51 ` [PATCH] [8/19] x86: Use -maccumulate-outgoing-args Andi Kleen
` (9 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Andi Kleen @ 2006-10-21 16:51 UTC (permalink / raw)
To: Vivek Goyal, Andi Kleen, patches, linux-kernel
From: Vivek Goyal <vgoyal@in.ibm.com>
Currently some code pieces assume that address returned by find_e820_area()
are page aligned. But looks like find_e820_area() had no such intention
and hence one might end up stomping over some of the data. One such case
is bootmem allocator initialization code stomped over bss.
This patch modified find_e820_area() to return page aligned address. This
might be little wasteful of memory but at the same time probably it is
easier to handle page aligned memory.
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---
arch/x86_64/kernel/e820.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
Index: linux/arch/x86_64/kernel/e820.c
===================================================================
--- linux.orig/arch/x86_64/kernel/e820.c
+++ linux/arch/x86_64/kernel/e820.c
@@ -54,13 +54,13 @@ static inline int bad_addr(unsigned long
/* various gunk below that needed for SMP startup */
if (addr < 0x8000) {
- *addrp = 0x8000;
+ *addrp = PAGE_ALIGN(0x8000);
return 1;
}
/* direct mapping tables of the kernel */
if (last >= table_start<<PAGE_SHIFT && addr < table_end<<PAGE_SHIFT) {
- *addrp = table_end << PAGE_SHIFT;
+ *addrp = PAGE_ALIGN(table_end << PAGE_SHIFT);
return 1;
}
@@ -68,18 +68,18 @@ static inline int bad_addr(unsigned long
#ifdef CONFIG_BLK_DEV_INITRD
if (LOADER_TYPE && INITRD_START && last >= INITRD_START &&
addr < INITRD_START+INITRD_SIZE) {
- *addrp = INITRD_START + INITRD_SIZE;
+ *addrp = PAGE_ALIGN(INITRD_START + INITRD_SIZE);
return 1;
}
#endif
/* kernel code */
- if (last >= __pa_symbol(&_text) && last < __pa_symbol(&_end)) {
- *addrp = __pa_symbol(&_end);
+ if (last >= __pa_symbol(&_text) && addr < __pa_symbol(&_end)) {
+ *addrp = PAGE_ALIGN(__pa_symbol(&_end));
return 1;
}
if (last >= ebda_addr && addr < ebda_addr + ebda_size) {
- *addrp = ebda_addr + ebda_size;
+ *addrp = PAGE_ALIGN(ebda_addr + ebda_size);
return 1;
}
@@ -152,7 +152,7 @@ unsigned long __init find_e820_area(unsi
continue;
while (bad_addr(&addr, size) && addr+size <= ei->addr+ei->size)
;
- last = addr + size;
+ last = PAGE_ALIGN(addr) + size;
if (last > ei->addr + ei->size)
continue;
if (last > end)
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH] [8/19] x86: Use -maccumulate-outgoing-args
[not found] <20061021 651.356252000@suse.de>
` (6 preceding siblings ...)
2006-10-21 16:51 ` [PATCH] [7/19] x86_64: fix page align in e820 allocator Andi Kleen
@ 2006-10-21 16:51 ` Andi Kleen
2006-10-21 17:18 ` Dave Jones
2006-10-21 16:51 ` [PATCH] [9/19] x86_64: Speed up dwarf2 unwinder Andi Kleen
` (8 subsequent siblings)
16 siblings, 1 reply; 30+ messages in thread
From: Andi Kleen @ 2006-10-21 16:51 UTC (permalink / raw)
To: jbeulich, patches, linux-kernel
This avoids some problems with gcc 4.x and earlier generating
invalid unwind information. In 4.1 the option is default
when unwind information is enabled.
And it seems to generate smaller code too, so it's probably
a good thing on its own. With gcc 4.0:
i386:
4683198 902112 480868 6066178 5c9002 vmlinux (before)
4449895 902112 480868 5832875 5900ab vmlinux (after)
x86-64:
4939761 1449584 648216 7037561 6b6279 vmlinux (before)
4854193 1449584 648216 6951993 6a1439 vmlinux (after)
On 4.1 it shouldn't make much difference because it is
default when unwind is enabled anyways.
Suggested by Michael Matz and Jan Beulich
Cc: jbeulich@novell.com
Signed-off-by: Andi Kleen <ak@suse.de>
---
arch/i386/Makefile | 4 ++++
arch/x86_64/Makefile | 4 ++++
2 files changed, 8 insertions(+)
Index: linux/arch/i386/Makefile
===================================================================
--- linux.orig/arch/i386/Makefile
+++ linux/arch/i386/Makefile
@@ -42,6 +42,10 @@ cflags-$(CONFIG_REGPARM) += -mregparm=3
# temporary until string.h is fixed
cflags-y += -ffreestanding
+# this works around some issues with generating unwind tables in older gccs
+# newer gccs do it by default
+cflags-y += -maccumulate-outgoing-args
+
# Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use
# a lot more stack due to the lack of sharing of stacklots:
CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then echo $(call cc-option,-fno-unit-at-a-time); fi ;)
Index: linux/arch/x86_64/Makefile
===================================================================
--- linux.orig/arch/x86_64/Makefile
+++ linux/arch/x86_64/Makefile
@@ -54,6 +54,10 @@ endif
cflags-y += $(call cc-option,-funit-at-a-time)
# prevent gcc from generating any FP code by mistake
cflags-y += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,)
+# this works around some issues with generating unwind tables in older gccs
+# newer gccs do it by default
+cflags-y += -maccumulate-outgoing-args
+
# do binutils support CFI?
cflags-y += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH] [9/19] x86_64: Speed up dwarf2 unwinder
[not found] <20061021 651.356252000@suse.de>
` (7 preceding siblings ...)
2006-10-21 16:51 ` [PATCH] [8/19] x86: Use -maccumulate-outgoing-args Andi Kleen
@ 2006-10-21 16:51 ` Andi Kleen
2006-10-21 16:51 ` [PATCH] [10/19] x86_64: x86_64 add NX mask for PTE entry Andi Kleen
` (7 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Andi Kleen @ 2006-10-21 16:51 UTC (permalink / raw)
To: Jan Beulich, patches, linux-kernel
From: Jan Beulich <jbeulich@novell.com>
This changes the dwarf2 unwinder to do a binary search for CIEs
instead of a linear work. The linker is unfortunately not
able to build a proper lookup table at link time, instead it creates
one at runtime as soon as the bootmem allocator is usable (so you'll continue
using the linear lookup for the first [hopefully] few calls).
The code should be ready to utilize a build-time created table once
a fixed linker becomes available.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andi Kleen <ak@suse.de>
---
Makefile | 1
include/asm-generic/vmlinux.lds.h | 16 +
include/linux/unwind.h | 2
init/main.c | 1
kernel/unwind.c | 316 +++++++++++++++++++++++++++++++++-----
5 files changed, 298 insertions(+), 38 deletions(-)
Index: linux/Makefile
===================================================================
--- linux.orig/Makefile
+++ linux/Makefile
@@ -499,6 +499,7 @@ endif
ifdef CONFIG_UNWIND_INFO
CFLAGS += -fasynchronous-unwind-tables
+LDFLAGS_vmlinux += --eh-frame-hdr
endif
ifdef CONFIG_DEBUG_INFO
Index: linux/include/asm-generic/vmlinux.lds.h
===================================================================
--- linux.orig/include/asm-generic/vmlinux.lds.h
+++ linux/include/asm-generic/vmlinux.lds.h
@@ -125,6 +125,10 @@
*(__param) \
VMLINUX_SYMBOL(__stop___param) = .; \
} \
+ \
+ /* Unwind data binary search table */ \
+ EH_FRAME_HDR \
+ \
__end_rodata = .; \
. = ALIGN(4096);
@@ -157,6 +161,18 @@
*(.kprobes.text) \
VMLINUX_SYMBOL(__kprobes_text_end) = .;
+#ifdef CONFIG_STACK_UNWIND
+ /* Unwind data binary search table */
+#define EH_FRAME_HDR \
+ .eh_frame_hdr : AT(ADDR(.eh_frame_hdr) - LOAD_OFFSET) { \
+ VMLINUX_SYMBOL(__start_unwind_hdr) = .; \
+ *(.eh_frame_hdr) \
+ VMLINUX_SYMBOL(__end_unwind_hdr) = .; \
+ }
+#else
+#define EH_FRAME_HDR
+#endif
+
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to
the beginning of the section so we begin them at 0. */
Index: linux/include/linux/unwind.h
===================================================================
--- linux.orig/include/linux/unwind.h
+++ linux/include/linux/unwind.h
@@ -26,6 +26,7 @@ struct module;
* Initialize unwind support.
*/
extern void unwind_init(void);
+extern void unwind_setup(void);
#ifdef CONFIG_MODULES
@@ -73,6 +74,7 @@ extern int unwind_to_user(struct unwind_
struct unwind_frame_info {};
static inline void unwind_init(void) {}
+static inline void unwind_setup(void) {}
#ifdef CONFIG_MODULES
Index: linux/init/main.c
===================================================================
--- linux.orig/init/main.c
+++ linux/init/main.c
@@ -503,6 +503,7 @@ asmlinkage void __init start_kernel(void
printk(KERN_NOTICE);
printk(linux_banner);
setup_arch(&command_line);
+ unwind_setup();
setup_per_cpu_areas();
smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */
Index: linux/kernel/unwind.c
===================================================================
--- linux.orig/kernel/unwind.c
+++ linux/kernel/unwind.c
@@ -11,13 +11,15 @@
#include <linux/unwind.h>
#include <linux/module.h>
-#include <linux/delay.h>
+#include <linux/bootmem.h>
+#include <linux/sort.h>
#include <linux/stop_machine.h>
#include <asm/sections.h>
#include <asm/uaccess.h>
#include <asm/unaligned.h>
extern char __start_unwind[], __end_unwind[];
+extern const u8 __start_unwind_hdr[], __end_unwind_hdr[];
#define MAX_STACK_DEPTH 8
@@ -100,6 +102,8 @@ static struct unwind_table {
} core, init;
const void *address;
unsigned long size;
+ const unsigned char *header;
+ unsigned long hdrsz;
struct unwind_table *link;
const char *name;
} root_table;
@@ -145,6 +149,10 @@ static struct unwind_table *find_table(u
return table;
}
+static unsigned long read_pointer(const u8 **pLoc,
+ const void *end,
+ signed ptrType);
+
static void init_unwind_table(struct unwind_table *table,
const char *name,
const void *core_start,
@@ -152,14 +160,30 @@ static void init_unwind_table(struct unw
const void *init_start,
unsigned long init_size,
const void *table_start,
- unsigned long table_size)
+ unsigned long table_size,
+ const u8 *header_start,
+ unsigned long header_size)
{
+ const u8 *ptr = header_start + 4;
+ const u8 *end = header_start + header_size;
+
table->core.pc = (unsigned long)core_start;
table->core.range = core_size;
table->init.pc = (unsigned long)init_start;
table->init.range = init_size;
table->address = table_start;
table->size = table_size;
+ /* See if the linker provided table looks valid. */
+ if (header_size <= 4
+ || header_start[0] != 1
+ || (void *)read_pointer(&ptr, end, header_start[1]) != table_start
+ || header_start[2] == DW_EH_PE_omit
+ || read_pointer(&ptr, end, header_start[2]) <= 0
+ || header_start[3] == DW_EH_PE_omit)
+ header_start = NULL;
+ table->hdrsz = header_size;
+ smp_wmb();
+ table->header = header_start;
table->link = NULL;
table->name = name;
}
@@ -169,7 +193,143 @@ void __init unwind_init(void)
init_unwind_table(&root_table, "kernel",
_text, _end - _text,
NULL, 0,
- __start_unwind, __end_unwind - __start_unwind);
+ __start_unwind, __end_unwind - __start_unwind,
+ __start_unwind_hdr, __end_unwind_hdr - __start_unwind_hdr);
+}
+
+static const u32 bad_cie, not_fde;
+static const u32 *cie_for_fde(const u32 *fde, const struct unwind_table *);
+static signed fde_pointer_type(const u32 *cie);
+
+struct eh_frame_hdr_table_entry {
+ unsigned long start, fde;
+};
+
+static int cmp_eh_frame_hdr_table_entries(const void *p1, const void *p2)
+{
+ const struct eh_frame_hdr_table_entry *e1 = p1;
+ const struct eh_frame_hdr_table_entry *e2 = p2;
+
+ return (e1->start > e2->start) - (e1->start < e2->start);
+}
+
+static void swap_eh_frame_hdr_table_entries(void *p1, void *p2, int size)
+{
+ struct eh_frame_hdr_table_entry *e1 = p1;
+ struct eh_frame_hdr_table_entry *e2 = p2;
+ unsigned long v;
+
+ v = e1->start;
+ e1->start = e2->start;
+ e2->start = v;
+ v = e1->fde;
+ e1->fde = e2->fde;
+ e2->fde = v;
+}
+
+static void __init setup_unwind_table(struct unwind_table *table,
+ void *(*alloc)(unsigned long))
+{
+ const u8 *ptr;
+ unsigned long tableSize = table->size, hdrSize;
+ unsigned n;
+ const u32 *fde;
+ struct {
+ u8 version;
+ u8 eh_frame_ptr_enc;
+ u8 fde_count_enc;
+ u8 table_enc;
+ unsigned long eh_frame_ptr;
+ unsigned int fde_count;
+ struct eh_frame_hdr_table_entry table[];
+ } __attribute__((__packed__)) *header;
+
+ if (table->header)
+ return;
+
+ if (table->hdrsz)
+ printk(KERN_WARNING ".eh_frame_hdr for '%s' present but unusable\n",
+ table->name);
+
+ if (tableSize & (sizeof(*fde) - 1))
+ return;
+
+ for (fde = table->address, n = 0;
+ tableSize > sizeof(*fde) && tableSize - sizeof(*fde) >= *fde;
+ tableSize -= sizeof(*fde) + *fde, fde += 1 + *fde / sizeof(*fde)) {
+ const u32 *cie = cie_for_fde(fde, table);
+ signed ptrType;
+
+ if (cie == ¬_fde)
+ continue;
+ if (cie == NULL
+ || cie == &bad_cie
+ || (ptrType = fde_pointer_type(cie)) < 0)
+ return;
+ ptr = (const u8 *)(fde + 2);
+ if (!read_pointer(&ptr,
+ (const u8 *)(fde + 1) + *fde,
+ ptrType))
+ return;
+ ++n;
+ }
+
+ if (tableSize || !n)
+ return;
+
+ hdrSize = 4 + sizeof(unsigned long) + sizeof(unsigned int)
+ + 2 * n * sizeof(unsigned long);
+ header = alloc(hdrSize);
+ if (!header)
+ return;
+ header->version = 1;
+ header->eh_frame_ptr_enc = DW_EH_PE_abs|DW_EH_PE_native;
+ header->fde_count_enc = DW_EH_PE_abs|DW_EH_PE_data4;
+ header->table_enc = DW_EH_PE_abs|DW_EH_PE_native;
+ put_unaligned((unsigned long)table->address, &header->eh_frame_ptr);
+ BUILD_BUG_ON(offsetof(typeof(*header), fde_count)
+ % __alignof(typeof(header->fde_count)));
+ header->fde_count = n;
+
+ BUILD_BUG_ON(offsetof(typeof(*header), table)
+ % __alignof(typeof(*header->table)));
+ for (fde = table->address, tableSize = table->size, n = 0;
+ tableSize;
+ tableSize -= sizeof(*fde) + *fde, fde += 1 + *fde / sizeof(*fde)) {
+ const u32 *cie = fde + 1 - fde[1] / sizeof(*fde);
+
+ if (!fde[1])
+ continue; /* this is a CIE */
+ ptr = (const u8 *)(fde + 2);
+ header->table[n].start = read_pointer(&ptr,
+ (const u8 *)(fde + 1) + *fde,
+ fde_pointer_type(cie));
+ header->table[n].fde = (unsigned long)fde;
+ ++n;
+ }
+ WARN_ON(n != header->fde_count);
+
+ sort(header->table,
+ n,
+ sizeof(*header->table),
+ cmp_eh_frame_hdr_table_entries,
+ swap_eh_frame_hdr_table_entries);
+
+ table->hdrsz = hdrSize;
+ smp_wmb();
+ table->header = (const void *)header;
+}
+
+static void *__init balloc(unsigned long sz)
+{
+ return __alloc_bootmem_nopanic(sz,
+ sizeof(unsigned int),
+ __pa(MAX_DMA_ADDRESS));
+}
+
+void __init unwind_setup(void)
+{
+ setup_unwind_table(&root_table, balloc);
}
#ifdef CONFIG_MODULES
@@ -193,7 +353,8 @@ void *unwind_add_table(struct module *mo
init_unwind_table(table, module->name,
module->module_core, module->core_size,
module->module_init, module->init_size,
- table_start, table_size);
+ table_start, table_size,
+ NULL, 0);
if (last_table)
last_table->link = table;
@@ -303,6 +464,26 @@ static sleb128_t get_sleb128(const u8 **
return value;
}
+static const u32 *cie_for_fde(const u32 *fde, const struct unwind_table *table)
+{
+ const u32 *cie;
+
+ if (!*fde || (*fde & (sizeof(*fde) - 1)))
+ return &bad_cie;
+ if (!fde[1])
+ return ¬_fde; /* this is a CIE */
+ if ((fde[1] & (sizeof(*fde) - 1))
+ || fde[1] > (unsigned long)(fde + 1) - (unsigned long)table->address)
+ return NULL; /* this is not a valid FDE */
+ cie = fde + 1 - fde[1] / sizeof(*fde);
+ if (*cie <= sizeof(*cie) + 4
+ || *cie >= fde[1] - sizeof(*fde)
+ || (*cie & (sizeof(*cie) - 1))
+ || cie[1])
+ return NULL; /* this is not a (valid) CIE */
+ return cie;
+}
+
static unsigned long read_pointer(const u8 **pLoc,
const void *end,
signed ptrType)
@@ -610,49 +791,108 @@ int unwind(struct unwind_frame_info *fra
unsigned i;
signed ptrType = -1;
uleb128_t retAddrReg = 0;
- struct unwind_table *table;
+ const struct unwind_table *table;
struct unwind_state state;
if (UNW_PC(frame) == 0)
return -EINVAL;
if ((table = find_table(pc)) != NULL
&& !(table->size & (sizeof(*fde) - 1))) {
- unsigned long tableSize = table->size;
+ const u8 *hdr = table->header;
+ unsigned long tableSize;
- for (fde = table->address;
- tableSize > sizeof(*fde) && tableSize - sizeof(*fde) >= *fde;
- tableSize -= sizeof(*fde) + *fde,
- fde += 1 + *fde / sizeof(*fde)) {
- if (!*fde || (*fde & (sizeof(*fde) - 1)))
- break;
- if (!fde[1])
- continue; /* this is a CIE */
- if ((fde[1] & (sizeof(*fde) - 1))
- || fde[1] > (unsigned long)(fde + 1)
- - (unsigned long)table->address)
- continue; /* this is not a valid FDE */
- cie = fde + 1 - fde[1] / sizeof(*fde);
- if (*cie <= sizeof(*cie) + 4
- || *cie >= fde[1] - sizeof(*fde)
- || (*cie & (sizeof(*cie) - 1))
- || cie[1]
- || (ptrType = fde_pointer_type(cie)) < 0) {
- cie = NULL; /* this is not a (valid) CIE */
- continue;
+ smp_rmb();
+ if (hdr && hdr[0] == 1) {
+ switch(hdr[3] & DW_EH_PE_FORM) {
+ case DW_EH_PE_native: tableSize = sizeof(unsigned long); break;
+ case DW_EH_PE_data2: tableSize = 2; break;
+ case DW_EH_PE_data4: tableSize = 4; break;
+ case DW_EH_PE_data8: tableSize = 8; break;
+ default: tableSize = 0; break;
+ }
+ ptr = hdr + 4;
+ end = hdr + table->hdrsz;
+ if (tableSize
+ && read_pointer(&ptr, end, hdr[1])
+ == (unsigned long)table->address
+ && (i = read_pointer(&ptr, end, hdr[2])) > 0
+ && i == (end - ptr) / (2 * tableSize)
+ && !((end - ptr) % (2 * tableSize))) {
+ do {
+ const u8 *cur = ptr + (i / 2) * (2 * tableSize);
+
+ startLoc = read_pointer(&cur,
+ cur + tableSize,
+ hdr[3]);
+ if (pc < startLoc)
+ i /= 2;
+ else {
+ ptr = cur - tableSize;
+ i = (i + 1) / 2;
+ }
+ } while (startLoc && i > 1);
+ if (i == 1
+ && (startLoc = read_pointer(&ptr,
+ ptr + tableSize,
+ hdr[3])) != 0
+ && pc >= startLoc)
+ fde = (void *)read_pointer(&ptr,
+ ptr + tableSize,
+ hdr[3]);
}
+ }
+
+ if (fde != NULL) {
+ cie = cie_for_fde(fde, table);
ptr = (const u8 *)(fde + 2);
- startLoc = read_pointer(&ptr,
- (const u8 *)(fde + 1) + *fde,
- ptrType);
- endLoc = startLoc
- + read_pointer(&ptr,
- (const u8 *)(fde + 1) + *fde,
- ptrType & DW_EH_PE_indirect
- ? ptrType
- : ptrType & (DW_EH_PE_FORM|DW_EH_PE_signed));
- if (pc >= startLoc && pc < endLoc)
- break;
- cie = NULL;
+ if(cie != NULL
+ && cie != &bad_cie
+ && cie != ¬_fde
+ && (ptrType = fde_pointer_type(cie)) >= 0
+ && read_pointer(&ptr,
+ (const u8 *)(fde + 1) + *fde,
+ ptrType) == startLoc) {
+ if (!(ptrType & DW_EH_PE_indirect))
+ ptrType &= DW_EH_PE_FORM|DW_EH_PE_signed;
+ endLoc = startLoc
+ + read_pointer(&ptr,
+ (const u8 *)(fde + 1) + *fde,
+ ptrType);
+ if(pc >= endLoc)
+ fde = NULL;
+ } else
+ fde = NULL;
+ }
+ if (fde == NULL) {
+ for (fde = table->address, tableSize = table->size;
+ cie = NULL, tableSize > sizeof(*fde)
+ && tableSize - sizeof(*fde) >= *fde;
+ tableSize -= sizeof(*fde) + *fde,
+ fde += 1 + *fde / sizeof(*fde)) {
+ cie = cie_for_fde(fde, table);
+ if (cie == &bad_cie) {
+ cie = NULL;
+ break;
+ }
+ if (cie == NULL
+ || cie == ¬_fde
+ || (ptrType = fde_pointer_type(cie)) < 0)
+ continue;
+ ptr = (const u8 *)(fde + 2);
+ startLoc = read_pointer(&ptr,
+ (const u8 *)(fde + 1) + *fde,
+ ptrType);
+ if (!startLoc)
+ continue;
+ if (!(ptrType & DW_EH_PE_indirect))
+ ptrType &= DW_EH_PE_FORM|DW_EH_PE_signed;
+ endLoc = startLoc
+ + read_pointer(&ptr,
+ (const u8 *)(fde + 1) + *fde,
+ ptrType);
+ if (pc >= startLoc && pc < endLoc)
+ break;
+ }
}
}
if (cie != NULL) {
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH] [10/19] x86_64: x86_64 add NX mask for PTE entry
[not found] <20061021 651.356252000@suse.de>
` (8 preceding siblings ...)
2006-10-21 16:51 ` [PATCH] [9/19] x86_64: Speed up dwarf2 unwinder Andi Kleen
@ 2006-10-21 16:51 ` Andi Kleen
2006-10-21 16:51 ` [PATCH] [11/19] i386: Fix fake return address Andi Kleen
` (6 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Andi Kleen @ 2006-10-21 16:51 UTC (permalink / raw)
To: bibo,mao, patches, linux-kernel
From: "bibo,mao" <bibo.mao@intel.com>
If function change_page_attr_addr calls revert_page to revert
to original pte value, mk_pte_phys does not mask NX bit. If NX bit
is set on no NX hardware supported x86_64 machine, there is will
be RSVD type page fault and system will crash. This patch adds NX
mask bit for PTE entry.
Signed-off-by: bibo,mao <bibo.mao@intel.com>
Signed-off-by: Andi Kleen <ak@suse.de>
---
include/asm-x86_64/pgtable.h | 1 +
1 files changed, 1 insertion(+)
Index: linux/include/asm-x86_64/pgtable.h
===================================================================
--- linux.orig/include/asm-x86_64/pgtable.h
+++ linux/include/asm-x86_64/pgtable.h
@@ -366,6 +366,7 @@ static inline pte_t mk_pte_phys(unsigned
{
pte_t pte;
pte_val(pte) = physpage | pgprot_val(pgprot);
+ pte_val(pte) &= __supported_pte_mask;
return pte;
}
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH] [11/19] i386: Fix fake return address
[not found] <20061021 651.356252000@suse.de>
` (9 preceding siblings ...)
2006-10-21 16:51 ` [PATCH] [10/19] x86_64: x86_64 add NX mask for PTE entry Andi Kleen
@ 2006-10-21 16:51 ` Andi Kleen
2006-10-21 18:12 ` Jeremy Fitzhardinge
2006-10-21 18:17 ` Andreas Schwab
2006-10-21 16:51 ` [PATCH] [12/19] x86_64: Fix ENOSYS in system call tracing Andi Kleen
` (5 subsequent siblings)
16 siblings, 2 replies; 30+ messages in thread
From: Andi Kleen @ 2006-10-21 16:51 UTC (permalink / raw)
To: Jeremy Fitzhardinge, Andi Kleen, Andrew Morton, patches,
linux-kernel
From: Jeremy Fitzhardinge <jeremy@goop.org>
The fake return address was being set to __KERNEL_PDA, rather than 0.
Push it earlier while %eax still equals 0.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Andi Kleen <ak@muc.de>
Cc: Andrew Morton <akpm@osdl.org>
---
arch/i386/kernel/head.S | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: linux/arch/i386/kernel/head.S
===================================================================
--- linux.orig/arch/i386/kernel/head.S
+++ linux/arch/i386/kernel/head.S
@@ -317,7 +317,7 @@ is386: movl $2,%ecx # set MP
movl %eax,%gs
lldt %ax
cld # gcc2 wants the direction flag cleared at all times
- pushl %eax # fake return address
+ pushl $0 # fake return address for unwinder
#ifdef CONFIG_SMP
movb ready, %cl
movb $1, ready
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH] [12/19] x86_64: Fix ENOSYS in system call tracing
[not found] <20061021 651.356252000@suse.de>
` (10 preceding siblings ...)
2006-10-21 16:51 ` [PATCH] [11/19] i386: Fix fake return address Andi Kleen
@ 2006-10-21 16:51 ` Andi Kleen
2006-10-21 16:51 ` [PATCH] [13/19] x86_64: Revert interrupt backlink changes Andi Kleen
` (4 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Andi Kleen @ 2006-10-21 16:51 UTC (permalink / raw)
To: Jan Beulich, patches, linux-kernel
From: "Jan Beulich" <jbeulich@novell.com>
This patch:
- out of range system calls failing to return -ENOSYS under
system call tracing
[AK: split out from another patch by Jan as separate bugfix]
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andi Kleen <ak@suse.de>
---
arch/x86_64/kernel/entry.S | 2 ++
1 files changed, 2 insertions(+)
Index: linux/arch/x86_64/kernel/entry.S
===================================================================
--- linux.orig/arch/x86_64/kernel/entry.S
+++ linux/arch/x86_64/kernel/entry.S
@@ -315,6 +315,8 @@ tracesys:
LOAD_ARGS ARGOFFSET /* reload args from stack in case ptrace changed it */
RESTORE_REST
cmpq $__NR_syscall_max,%rax
+ movq $-ENOSYS,%rcx
+ cmova %rcx,%rax
ja 1f
movq %r10,%rcx /* fixup for C */
call *sys_call_table(,%rax,8)
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH] [13/19] x86_64: Revert interrupt backlink changes
[not found] <20061021 651.356252000@suse.de>
` (11 preceding siblings ...)
2006-10-21 16:51 ` [PATCH] [12/19] x86_64: Fix ENOSYS in system call tracing Andi Kleen
@ 2006-10-21 16:51 ` Andi Kleen
2006-10-21 16:51 ` [PATCH] [14/19] i386: Disable nmi watchdog on all ThinkPads Andi Kleen
` (3 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Andi Kleen @ 2006-10-21 16:51 UTC (permalink / raw)
To: patches, linux-kernel
They break more than they fix
Signed-off-by: Andi Kleen <ak@suse.de>
---
arch/x86_64/kernel/entry.S | 3 ---
1 files changed, 3 deletions(-)
Index: linux/arch/x86_64/kernel/entry.S
===================================================================
--- linux.orig/arch/x86_64/kernel/entry.S
+++ linux/arch/x86_64/kernel/entry.S
@@ -537,8 +537,6 @@ END(stub_rt_sigreturn)
1: incl %gs:pda_irqcount
cmoveq %gs:pda_irqstackptr,%rsp
push %rbp # backlink for old unwinder
- CFI_ADJUST_CFA_OFFSET 8
- CFI_REL_OFFSET rbp,0
/*
* We entered an interrupt context - irqs are off:
*/
@@ -1178,7 +1176,6 @@ ENTRY(call_softirq)
incl %gs:pda_irqcount
cmove %gs:pda_irqstackptr,%rsp
push %rbp # backlink for old unwinder
- CFI_ADJUST_CFA_OFFSET 8
call __do_softirq
leaveq
CFI_DEF_CFA_REGISTER rsp
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH] [14/19] i386: Disable nmi watchdog on all ThinkPads
[not found] <20061021 651.356252000@suse.de>
` (12 preceding siblings ...)
2006-10-21 16:51 ` [PATCH] [13/19] x86_64: Revert interrupt backlink changes Andi Kleen
@ 2006-10-21 16:51 ` Andi Kleen
2006-10-21 17:24 ` Dave Jones
2006-10-21 16:51 ` [PATCH] [16/19] x86: Revert new unwind kernel stack termination Andi Kleen
` (2 subsequent siblings)
16 siblings, 1 reply; 30+ messages in thread
From: Andi Kleen @ 2006-10-21 16:51 UTC (permalink / raw)
To: patches, linux-kernel
Even newer Thinkpads have bugs in SMM code that causes hangs with
NMI watchdog.
Signed-off-by: Andi Kleen <ak@suse.de>
---
arch/i386/kernel/nmi.c | 10 +++++-----
drivers/firmware/dmi_scan.c | 20 ++++++++++++++++++++
include/linux/dmi.h | 2 ++
3 files changed, 27 insertions(+), 5 deletions(-)
Index: linux/arch/i386/kernel/nmi.c
===================================================================
--- linux.orig/arch/i386/kernel/nmi.c
+++ linux/arch/i386/kernel/nmi.c
@@ -219,11 +219,11 @@ static int __init check_nmi_watchdog(voi
int cpu;
/* Enable NMI watchdog for newer systems.
- Actually it should be safe for most systems before 2004 too except
- for some IBM systems that corrupt registers when NMI happens
- during SMM. Unfortunately we don't have more exact information
- on these and use this coarse check. */
- if (nmi_watchdog == NMI_DEFAULT && dmi_get_year(DMI_BIOS_DATE) >= 2004)
+ Probably safe on most older systems too, but let's be careful.
+ IBM ThinkPads use INT10 inside SMM and that allows early NMI inside SMM
+ which hangs the system. Disable watchdog for all thinkpads */
+ if (nmi_watchdog == NMI_DEFAULT && dmi_get_year(DMI_BIOS_DATE) >= 2004 &&
+ !dmi_name_in_vendors("ThinkPad"))
nmi_watchdog = NMI_LOCAL_APIC;
if ((nmi_watchdog == NMI_NONE) || (nmi_watchdog == NMI_DEFAULT))
Index: linux/drivers/firmware/dmi_scan.c
===================================================================
--- linux.orig/drivers/firmware/dmi_scan.c
+++ linux/drivers/firmware/dmi_scan.c
@@ -326,6 +326,26 @@ char *dmi_get_system_info(int field)
}
EXPORT_SYMBOL(dmi_get_system_info);
+
+/**
+ * dmi_name_in_vendors - Check if string is anywhere in the DMI vendor information.
+ * @str: Case sensitive Name
+ */
+int dmi_name_in_vendors(char *str)
+{
+ static int fields[] = { DMI_BIOS_VENDOR, DMI_BIOS_VERSION, DMI_SYS_VENDOR,
+ DMI_PRODUCT_NAME, DMI_PRODUCT_VERSION, DMI_BOARD_VENDOR,
+ DMI_BOARD_NAME, DMI_BOARD_VERSION, DMI_NONE };
+ int i;
+ for (i = 0; fields[i] != DMI_NONE; i++) {
+ int f = fields[i];
+ if (dmi_ident[f] && strstr(dmi_ident[f], str))
+ return 1;
+ }
+ return 0;
+}
+EXPORT_SYMBOL(dmi_name_in_vendors);
+
/**
* dmi_find_device - find onboard device by type/name
* @type: device type or %DMI_DEV_TYPE_ANY to match all device types
Index: linux/include/linux/dmi.h
===================================================================
--- linux.orig/include/linux/dmi.h
+++ linux/include/linux/dmi.h
@@ -69,6 +69,7 @@ extern struct dmi_device * dmi_find_devi
struct dmi_device *from);
extern void dmi_scan_machine(void);
extern int dmi_get_year(int field);
+extern int dmi_name_in_vendors(char *str);
#else
@@ -77,6 +78,7 @@ static inline char * dmi_get_system_info
static inline struct dmi_device * dmi_find_device(int type, const char *name,
struct dmi_device *from) { return NULL; }
static inline int dmi_get_year(int year) { return 0; }
+static inline int dmi_name_in_vendors(char *s) { return 0; }
#endif
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH] [16/19] x86: Revert new unwind kernel stack termination
[not found] <20061021 651.356252000@suse.de>
` (13 preceding siblings ...)
2006-10-21 16:51 ` [PATCH] [14/19] i386: Disable nmi watchdog on all ThinkPads Andi Kleen
@ 2006-10-21 16:51 ` Andi Kleen
2006-10-21 16:51 ` [PATCH] [18/19] x86_64: Overlapping program headers in physical addr space fix Andi Kleen
2006-10-21 16:51 ` [PATCH] [19/19] x86_64: Revert timer routing behaviour back to 2.6.16 state Andi Kleen
16 siblings, 0 replies; 30+ messages in thread
From: Andi Kleen @ 2006-10-21 16:51 UTC (permalink / raw)
To: jbeulich, patches, linux-kernel
Jan convinced me that it was unnecessary because the assembly stubs do
this already on the stack.
Cc: jbeulich@novell.com
Signed-off-by: Andi Kleen <ak@suse.de>
---
arch/i386/kernel/process.c | 6 +-----
arch/x86_64/kernel/entry.S | 5 -----
2 files changed, 1 insertion(+), 10 deletions(-)
Index: linux/arch/i386/kernel/process.c
===================================================================
--- linux.orig/arch/i386/kernel/process.c
+++ linux/arch/i386/kernel/process.c
@@ -336,7 +336,6 @@ extern void kernel_thread_helper(void);
int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
{
struct pt_regs regs;
- int err;
memset(®s, 0, sizeof(regs));
@@ -351,10 +350,7 @@ int kernel_thread(int (*fn)(void *), voi
regs.eflags = X86_EFLAGS_IF | X86_EFLAGS_SF | X86_EFLAGS_PF | 0x2;
/* Ok, create the new process.. */
- err = do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, ®s, 0, NULL, NULL);
- if (err == 0) /* terminate kernel stack */
- task_pt_regs(current)->eip = 0;
- return err;
+ return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, ®s, 0, NULL, NULL);
}
EXPORT_SYMBOL(kernel_thread);
Index: linux/arch/x86_64/kernel/entry.S
===================================================================
--- linux.orig/arch/x86_64/kernel/entry.S
+++ linux/arch/x86_64/kernel/entry.S
@@ -980,11 +980,6 @@ ENTRY(kernel_thread)
call do_fork
movq %rax,RAX(%rsp)
xorl %edi,%edi
- test %rax,%rax
- jnz 1f
- /* terminate stack in child */
- movq %rdi,RIP(%rsp)
-1:
/*
* It isn't worth to check for reschedule here,
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH] [18/19] x86_64: Overlapping program headers in physical addr space fix
[not found] <20061021 651.356252000@suse.de>
` (14 preceding siblings ...)
2006-10-21 16:51 ` [PATCH] [16/19] x86: Revert new unwind kernel stack termination Andi Kleen
@ 2006-10-21 16:51 ` Andi Kleen
2006-10-23 7:20 ` [patches] " Jan Beulich
2006-10-21 16:51 ` [PATCH] [19/19] x86_64: Revert timer routing behaviour back to 2.6.16 state Andi Kleen
16 siblings, 1 reply; 30+ messages in thread
From: Andi Kleen @ 2006-10-21 16:51 UTC (permalink / raw)
To: Vivek Goyal, Magnus Damm, Andi Kleen, Eric W. Biederman, patches,
linux-kernel
From: Vivek Goyal <vgoyal@in.ibm.com>
o A recent change to vmlinux.ld.S file broke kexec as now resulting vmlinux
program headers are overlapping in physical address space.
o Now all the vsyscall related sections are placed after data and after
that mostly init data sections are placed. To avoid physical overlap
among phdrs, there are three possible solutions.
- Place vsyscall sections also in data phdrs instead of user
- move vsyscal sections after init data in bss.
- create another phdrs say data.init and move all the sections
after vsyscall into this new phdr.
o This patch implements the third solution.
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Magnus Damm <magnus@valinux.co.jp>
Cc: Andi Kleen <ak@suse.de>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---
arch/x86_64/kernel/vmlinux.lds.S | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
Index: linux/arch/x86_64/kernel/vmlinux.lds.S
===================================================================
--- linux.orig/arch/x86_64/kernel/vmlinux.lds.S
+++ linux/arch/x86_64/kernel/vmlinux.lds.S
@@ -17,6 +17,7 @@ PHDRS {
text PT_LOAD FLAGS(5); /* R_E */
data PT_LOAD FLAGS(7); /* RWE */
user PT_LOAD FLAGS(7); /* RWE */
+ data.init PT_LOAD FLAGS(7); /* RWE */
note PT_NOTE FLAGS(4); /* R__ */
}
SECTIONS
@@ -131,7 +132,7 @@ SECTIONS
. = ALIGN(8192); /* init_task */
.data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
*(.data.init_task)
- } :data
+ }:data.init
. = ALIGN(4096);
.data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH] [19/19] x86_64: Revert timer routing behaviour back to 2.6.16 state
[not found] <20061021 651.356252000@suse.de>
` (15 preceding siblings ...)
2006-10-21 16:51 ` [PATCH] [18/19] x86_64: Overlapping program headers in physical addr space fix Andi Kleen
@ 2006-10-21 16:51 ` Andi Kleen
16 siblings, 0 replies; 30+ messages in thread
From: Andi Kleen @ 2006-10-21 16:51 UTC (permalink / raw)
To: patches, linux-kernel
By default route the 8254 over the 8259 and only disable
it on ATI boards where this causes double timer interrupts.
This should unbreak some Nvidia boards where the timer doesn't
seem to tick of it isn't enabled in the 8259. At least one
VIA board also seemed to have a little trouble with the disabled
8259.
For 2.6.20 we'll try both dynamically without black listing, but I think
for .19 this is the safer approach because it has been already well tested
in earlier kernels. This also makes the x86-64 behaviour the same
as i386.
Command line options can change all this of course.
Signed-off-by: Andi Kleen <ak@suse.de>
---
arch/x86_64/kernel/early-quirks.c | 9 +++++----
arch/x86_64/kernel/io_apic.c | 2 +-
include/asm-x86_64/proto.h | 2 ++
3 files changed, 8 insertions(+), 5 deletions(-)
Index: linux/arch/x86_64/kernel/early-quirks.c
===================================================================
--- linux.orig/arch/x86_64/kernel/early-quirks.c
+++ linux/arch/x86_64/kernel/early-quirks.c
@@ -61,10 +61,11 @@ static void nvidia_bugs(void)
static void ati_bugs(void)
{
-#if 1 /* for testing */
- printk("ATI board detected\n");
-#endif
- /* No bugs right now */
+ if (timer_over_8254 == 1) {
+ timer_over_8254 = 0;
+ printk(KERN_INFO
+ "ATI board detected. Disabling timer routing over 8254.\n");
+ }
}
struct chipset {
Index: linux/arch/x86_64/kernel/io_apic.c
===================================================================
--- linux.orig/arch/x86_64/kernel/io_apic.c
+++ linux/arch/x86_64/kernel/io_apic.c
@@ -57,7 +57,7 @@ static int no_timer_check;
static int disable_timer_pin_1 __initdata;
-int timer_over_8254 __initdata = 0;
+int timer_over_8254 __initdata = 1;
/* Where if anywhere is the i8259 connect in external int mode */
static struct { int pin, apic; } ioapic_i8259 = { -1, -1 };
Index: linux/include/asm-x86_64/proto.h
===================================================================
--- linux.orig/include/asm-x86_64/proto.h
+++ linux/include/asm-x86_64/proto.h
@@ -122,6 +122,8 @@ extern int fix_aperture;
extern int reboot_force;
extern int notsc_setup(char *);
+extern int timer_over_8254;
+
extern int gsi_irq_sharing(int gsi);
extern void smp_local_timer_interrupt(void);
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH] [8/19] x86: Use -maccumulate-outgoing-args
2006-10-21 16:51 ` [PATCH] [8/19] x86: Use -maccumulate-outgoing-args Andi Kleen
@ 2006-10-21 17:18 ` Dave Jones
2006-10-21 18:20 ` Andi Kleen
0 siblings, 1 reply; 30+ messages in thread
From: Dave Jones @ 2006-10-21 17:18 UTC (permalink / raw)
To: Andi Kleen; +Cc: jbeulich, patches, linux-kernel
On Sat, Oct 21, 2006 at 06:51:28PM +0200, Andi Kleen wrote:
>
> This avoids some problems with gcc 4.x and earlier generating
> invalid unwind information. In 4.1 the option is default
> when unwind information is enabled.
>
> And it seems to generate smaller code too, so it's probably
> a good thing on its own. With gcc 4.0:
That's quite odd. The gcc man page mentions that
"The drawback is a notable increase in code size."
for this option. I wonder if this is just stale documentation,
or there's a reason why we're special :)
Dave
--
http://www.codemonkey.org.uk
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH] [14/19] i386: Disable nmi watchdog on all ThinkPads
2006-10-21 16:51 ` [PATCH] [14/19] i386: Disable nmi watchdog on all ThinkPads Andi Kleen
@ 2006-10-21 17:24 ` Dave Jones
2006-10-21 18:11 ` [patches] " Andi Kleen
0 siblings, 1 reply; 30+ messages in thread
From: Dave Jones @ 2006-10-21 17:24 UTC (permalink / raw)
To: Andi Kleen; +Cc: patches, linux-kernel
On Sat, Oct 21, 2006 at 06:51:34PM +0200, Andi Kleen wrote:
>
> Even newer Thinkpads have bugs in SMM code that causes hangs with
> NMI watchdog.
>
> Signed-off-by: Andi Kleen <ak@suse.de>
>
> ---
> arch/i386/kernel/nmi.c | 10 +++++-----
> drivers/firmware/dmi_scan.c | 20 ++++++++++++++++++++
> include/linux/dmi.h | 2 ++
> 3 files changed, 27 insertions(+), 5 deletions(-)
>
> Index: linux/arch/i386/kernel/nmi.c
> ===================================================================
> --- linux.orig/arch/i386/kernel/nmi.c
> +++ linux/arch/i386/kernel/nmi.c
> @@ -219,11 +219,11 @@ static int __init check_nmi_watchdog(voi
> int cpu;
>
> /* Enable NMI watchdog for newer systems.
> - Actually it should be safe for most systems before 2004 too except
> - for some IBM systems that corrupt registers when NMI happens
> - during SMM. Unfortunately we don't have more exact information
> - on these and use this coarse check. */
> - if (nmi_watchdog == NMI_DEFAULT && dmi_get_year(DMI_BIOS_DATE) >= 2004)
> + Probably safe on most older systems too, but let's be careful.
> + IBM ThinkPads use INT10 inside SMM and that allows early NMI inside SMM
> + which hangs the system. Disable watchdog for all thinkpads */
> + if (nmi_watchdog == NMI_DEFAULT && dmi_get_year(DMI_BIOS_DATE) >= 2004 &&
> + !dmi_name_in_vendors("ThinkPad"))
> nmi_watchdog = NMI_LOCAL_APIC;
This is going to get some people scratching their heads wondering
why it isn't working if they ever try nmi_watchdog on one of these.
How about adding an explanitory printk ?
Dave
--
http://www.codemonkey.org.uk
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patches] Re: [PATCH] [14/19] i386: Disable nmi watchdog on all ThinkPads
2006-10-21 17:24 ` Dave Jones
@ 2006-10-21 18:11 ` Andi Kleen
2006-10-21 18:14 ` Dave Jones
0 siblings, 1 reply; 30+ messages in thread
From: Andi Kleen @ 2006-10-21 18:11 UTC (permalink / raw)
To: patches; +Cc: Dave Jones, linux-kernel
> > - if (nmi_watchdog == NMI_DEFAULT && dmi_get_year(DMI_BIOS_DATE) >= 2004)
> > + Probably safe on most older systems too, but let's be careful.
> > + IBM ThinkPads use INT10 inside SMM and that allows early NMI inside SMM
> > + which hangs the system. Disable watchdog for all thinkpads */
> > + if (nmi_watchdog == NMI_DEFAULT && dmi_get_year(DMI_BIOS_DATE) >= 2004 &&
> > + !dmi_name_in_vendors("ThinkPad"))
> > nmi_watchdog = NMI_LOCAL_APIC;
>
> This is going to get some people scratching their heads wondering
> why it isn't working if they ever try nmi_watchdog on one of these.
> How about adding an explanitory printk ?
When you enable it manually then NMI_DEFAULT won't be set and this code
is never executed.
BTW their machines will likely not stay up long enough that they can
see the printk (unless Lenovo fixes that particular bug in the future,
they are aware of it)
-Andi
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH] [11/19] i386: Fix fake return address
2006-10-21 16:51 ` [PATCH] [11/19] i386: Fix fake return address Andi Kleen
@ 2006-10-21 18:12 ` Jeremy Fitzhardinge
2006-10-21 18:14 ` Andi Kleen
2006-10-21 18:17 ` Andreas Schwab
1 sibling, 1 reply; 30+ messages in thread
From: Jeremy Fitzhardinge @ 2006-10-21 18:12 UTC (permalink / raw)
To: Andi Kleen; +Cc: Andi Kleen, Andrew Morton, patches, linux-kernel
Andi Kleen wrote:
> From: Jeremy Fitzhardinge <jeremy@goop.org>
> The fake return address was being set to __KERNEL_PDA, rather than 0.
> Push it earlier while %eax still equals 0.
>
> Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
> Signed-off-by: Andi Kleen <ak@suse.de>
> Cc: Andi Kleen <ak@muc.de>
> Cc: Andrew Morton <akpm@osdl.org>
>
> ---
> arch/i386/kernel/head.S | 2 +-
> 1 files changed, 1 insertion(+), 1 deletion(-)
>
> Index: linux/arch/i386/kernel/head.S
> ===================================================================
> --- linux.orig/arch/i386/kernel/head.S
> +++ linux/arch/i386/kernel/head.S
> @@ -317,7 +317,7 @@ is386: movl $2,%ecx # set MP
> movl %eax,%gs
> lldt %ax
> cld # gcc2 wants the direction flag cleared at all times
> - pushl %eax # fake return address
> + pushl $0 # fake return address for unwinder
> #ifdef CONFIG_SMP
Yep, that's better than my patch, but the comment is out of date.
J
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH] [11/19] i386: Fix fake return address
2006-10-21 18:12 ` Jeremy Fitzhardinge
@ 2006-10-21 18:14 ` Andi Kleen
0 siblings, 0 replies; 30+ messages in thread
From: Andi Kleen @ 2006-10-21 18:14 UTC (permalink / raw)
To: Jeremy Fitzhardinge; +Cc: Andrew Morton, patches, linux-kernel
> Yep, that's better than my patch, but the comment is out of date.
Sorry, i changed it while doing a merge (original patch rejected
somewhere) but forgot to adapt the description
-Andi
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patches] Re: [PATCH] [14/19] i386: Disable nmi watchdog on all ThinkPads
2006-10-21 18:11 ` [patches] " Andi Kleen
@ 2006-10-21 18:14 ` Dave Jones
2006-10-21 18:22 ` Andi Kleen
0 siblings, 1 reply; 30+ messages in thread
From: Dave Jones @ 2006-10-21 18:14 UTC (permalink / raw)
To: Andi Kleen; +Cc: patches, linux-kernel
On Sat, Oct 21, 2006 at 08:11:56PM +0200, Andi Kleen wrote:
>
> > > - if (nmi_watchdog == NMI_DEFAULT && dmi_get_year(DMI_BIOS_DATE) >= 2004)
> > > + Probably safe on most older systems too, but let's be careful.
> > > + IBM ThinkPads use INT10 inside SMM and that allows early NMI inside SMM
> > > + which hangs the system. Disable watchdog for all thinkpads */
> > > + if (nmi_watchdog == NMI_DEFAULT && dmi_get_year(DMI_BIOS_DATE) >= 2004 &&
> > > + !dmi_name_in_vendors("ThinkPad"))
> > > nmi_watchdog = NMI_LOCAL_APIC;
> >
> > This is going to get some people scratching their heads wondering
> > why it isn't working if they ever try nmi_watchdog on one of these.
> > How about adding an explanitory printk ?
>
> When you enable it manually then NMI_DEFAULT won't be set and this code
> is never executed.
>
> BTW their machines will likely not stay up long enough that they can
> see the printk (unless Lenovo fixes that particular bug in the future,
> they are aware of it)
Ouch, nasty. I'm surprised no-one complained about this earlier.
Dave
--
http://www.codemonkey.org.uk
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH] [11/19] i386: Fix fake return address
2006-10-21 16:51 ` [PATCH] [11/19] i386: Fix fake return address Andi Kleen
2006-10-21 18:12 ` Jeremy Fitzhardinge
@ 2006-10-21 18:17 ` Andreas Schwab
1 sibling, 0 replies; 30+ messages in thread
From: Andreas Schwab @ 2006-10-21 18:17 UTC (permalink / raw)
To: Andi Kleen
Cc: Jeremy Fitzhardinge, Andi Kleen, Andrew Morton, patches,
linux-kernel
Andi Kleen <ak@suse.de> writes:
> From: Jeremy Fitzhardinge <jeremy@goop.org>
> The fake return address was being set to __KERNEL_PDA, rather than 0.
> Push it earlier while %eax still equals 0.
There is a slight discrepancy between the description and what is really
implemented by the patch.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH] [8/19] x86: Use -maccumulate-outgoing-args
2006-10-21 17:18 ` Dave Jones
@ 2006-10-21 18:20 ` Andi Kleen
0 siblings, 0 replies; 30+ messages in thread
From: Andi Kleen @ 2006-10-21 18:20 UTC (permalink / raw)
To: Dave Jones; +Cc: jbeulich, patches, linux-kernel
On Saturday 21 October 2006 19:18, Dave Jones wrote:
> On Sat, Oct 21, 2006 at 06:51:28PM +0200, Andi Kleen wrote:
> >
> > This avoids some problems with gcc 4.x and earlier generating
> > invalid unwind information. In 4.1 the option is default
> > when unwind information is enabled.
> >
> > And it seems to generate smaller code too, so it's probably
> > a good thing on its own. With gcc 4.0:
>
> That's quite odd. The gcc man page mentions that
> "The drawback is a notable increase in code size."
> for this option. I wonder if this is just stale documentation,
> or there's a reason why we're special :)
I redid the measurements originally because someone else commented
on this too, but I still saw the same numbers.
If someone else wants to redo them too please do
(note on gcc 4.1 you need to disable the stack unwinder or debug info
first, otherwise it is a nop)
-Andi
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patches] Re: [PATCH] [14/19] i386: Disable nmi watchdog on all ThinkPads
2006-10-21 18:14 ` Dave Jones
@ 2006-10-21 18:22 ` Andi Kleen
0 siblings, 0 replies; 30+ messages in thread
From: Andi Kleen @ 2006-10-21 18:22 UTC (permalink / raw)
To: patches; +Cc: Dave Jones, linux-kernel
> Ouch, nasty. I'm surprised no-one complained about this earlier.
i386 only enabled it post 2.6.18. I suppose nobody tested ThinkPads
after that.
Actually I should probably add it to 64bit too, but still waiting
for at least one report (maybe maybe they have already fixed it in
the Core2 capable models)
-Andi
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patches] [PATCH] [18/19] x86_64: Overlapping program headers in physical addr space fix
2006-10-21 16:51 ` [PATCH] [18/19] x86_64: Overlapping program headers in physical addr space fix Andi Kleen
@ 2006-10-23 7:20 ` Jan Beulich
2006-10-23 14:41 ` Vivek Goyal
0 siblings, 1 reply; 30+ messages in thread
From: Jan Beulich @ 2006-10-23 7:20 UTC (permalink / raw)
To: Vivek Goyal, Andi Kleen
Cc: Magnus Damm, linux-kernel, patches, Eric W. Biederman
>@@ -17,6 +17,7 @@ PHDRS {
> text PT_LOAD FLAGS(5); /* R_E */
> data PT_LOAD FLAGS(7); /* RWE */
> user PT_LOAD FLAGS(7); /* RWE */
>+ data.init PT_LOAD FLAGS(7); /* RWE */
> note PT_NOTE FLAGS(4); /* R__ */
> }
> SECTIONS
Even though it's only cosmetic, I think it would have been
more than appropriate to remove the ill 'E' permission on data
with that change. (Btw., why does 'note' need 'R'?) Also, I
consider the naming of the new segment misleading - just 'init'
would have been more correct.
Jan
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patches] [PATCH] [18/19] x86_64: Overlapping program headers in physical addr space fix
2006-10-23 7:20 ` [patches] " Jan Beulich
@ 2006-10-23 14:41 ` Vivek Goyal
2006-10-23 15:02 ` Ian Campbell
2006-10-23 16:08 ` Jan Beulich
0 siblings, 2 replies; 30+ messages in thread
From: Vivek Goyal @ 2006-10-23 14:41 UTC (permalink / raw)
To: Jan Beulich
Cc: Andi Kleen, Magnus Damm, linux-kernel, patches, Eric W. Biederman,
Ian.Campbell
On Mon, Oct 23, 2006 at 08:20:38AM +0100, Jan Beulich wrote:
> >@@ -17,6 +17,7 @@ PHDRS {
> > text PT_LOAD FLAGS(5); /* R_E */
> > data PT_LOAD FLAGS(7); /* RWE */
> > user PT_LOAD FLAGS(7); /* RWE */
> >+ data.init PT_LOAD FLAGS(7); /* RWE */
> > note PT_NOTE FLAGS(4); /* R__ */
> > }
> > SECTIONS
>
> Even though it's only cosmetic, I think it would have been
> more than appropriate to remove the ill 'E' permission on data
> with that change.
May be. I just kept it because already data segment had 'E' permissions.
Ian, any reason why did you keep 'E' on data segment? If it is not
intentional, I will get rid of it.
>(Btw., why does 'note' need 'R'?)
I went through the comments Ian had put in his patch. There also he
mentions that people objected to 'R' permissions for note segment as
it is read only by boot loader. He kept it because i386 had the similar
thing.
Ian, again if there is no specific reason to keep 'R' for note, I will
get rid of it.
> Also, I
> consider the naming of the new segment misleading - just 'init'
> would have been more correct.
>
I think plain "init" also does not reflect the correct name as this section
is also mapping .data.init_task, .data.page_aligned and .data_nosave, which
will probably never get freed. It maps smp alternatives sections which will
not be freed if CPU_HOTPLUG is enabled. It also maps .bss, which will never
get freed.
I think, the sections which are not being freed, should be moved up and
made part of 'data' segment. Then create a segment 'init' for all the init
text/data and finally create another segment say 'bss' to map bss at the
end. How does this sound?
Thanks
Vivek
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patches] [PATCH] [18/19] x86_64: Overlapping program headers in physical addr space fix
2006-10-23 14:41 ` Vivek Goyal
@ 2006-10-23 15:02 ` Ian Campbell
2006-10-23 16:08 ` Jan Beulich
1 sibling, 0 replies; 30+ messages in thread
From: Ian Campbell @ 2006-10-23 15:02 UTC (permalink / raw)
To: vgoyal
Cc: Jan Beulich, Andi Kleen, Magnus Damm, linux-kernel, patches,
Eric W. Biederman
On Mon, 2006-10-23 at 10:41 -0400, Vivek Goyal wrote:
> On Mon, Oct 23, 2006 at 08:20:38AM +0100, Jan Beulich wrote:
> > >@@ -17,6 +17,7 @@ PHDRS {
> > > text PT_LOAD FLAGS(5); /* R_E */
> > > data PT_LOAD FLAGS(7); /* RWE */
> > > user PT_LOAD FLAGS(7); /* RWE */
> > >+ data.init PT_LOAD FLAGS(7); /* RWE */
> > > note PT_NOTE FLAGS(4); /* R__ */
> > > }
> > > SECTIONS
> >
> > Even though it's only cosmetic, I think it would have been
> > more than appropriate to remove the ill 'E' permission on data
> > with that change.
>
> May be. I just kept it because already data segment had 'E' permissions.
> Ian, any reason why did you keep 'E' on data segment? If it is not
> intentional, I will get rid of it.
I wasn't 100% sure (only 99% :-)) it was unneeded so I kept it to
minimise the changes in the final image since the original .data section
had it.
> >(Btw., why does 'note' need 'R'?)
>
> I went through the comments Ian had put in his patch. There also he
> mentions that people objected to 'R' permissions for note segment as
> it is read only by boot loader. He kept it because i386 had the similar
> thing.
>
> Ian, again if there is no specific reason to keep 'R' for note, I will
> get rid of it.
There was a suggestion at one point that the note section was aliased by
a PT_LOAD and so needed the R but it turned out that wasn't the case.
You can drop it as far as I'm concerned.
Ian.
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [patches] [PATCH] [18/19] x86_64: Overlapping program headers in physical addr space fix
2006-10-23 14:41 ` Vivek Goyal
2006-10-23 15:02 ` Ian Campbell
@ 2006-10-23 16:08 ` Jan Beulich
1 sibling, 0 replies; 30+ messages in thread
From: Jan Beulich @ 2006-10-23 16:08 UTC (permalink / raw)
To: vgoyal
Cc: Andi Kleen, Magnus Damm, linux-kernel, patches, Ian.Campbell,
Eric W. Biederman
>I think plain "init" also does not reflect the correct name as this section
>is also mapping .data.init_task, .data.page_aligned and .data_nosave, which
>will probably never get freed. It maps smp alternatives sections which will
>not be freed if CPU_HOTPLUG is enabled. It also maps .bss, which will never
>get freed.
>
>I think, the sections which are not being freed, should be moved up and
>made part of 'data' segment. Then create a segment 'init' for all the init
>text/data and finally create another segment say 'bss' to map bss at the
>end. How does this sound?
Superb. Though I guess .bss needs no extra segment, it should simply
be the last thing in the data segment.
Jan
^ permalink raw reply [flat|nested] 30+ messages in thread
end of thread, other threads:[~2006-10-23 16:06 UTC | newest]
Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20061021 651.356252000@suse.de>
2006-10-21 16:51 ` [PATCH] [1/19] x86_64: Update defconfig Andi Kleen
2006-10-21 16:51 ` [PATCH] [2/19] i386: " Andi Kleen
2006-10-21 16:51 ` [PATCH] [3/19] x86_64: x86_64 hot-add memory srat.c fix Andi Kleen
2006-10-21 16:51 ` [PATCH] [4/19] x86_64: typo in __assign_irq_vector when updating pos for vector and offset Andi Kleen
2006-10-21 16:51 ` [PATCH] [5/19] i386: fix .cfi_signal_frame copy-n-paste error Andi Kleen
2006-10-21 16:51 ` [PATCH] [6/19] x86_64: Fix for arch/x86_64/pci/Makefile CFLAGS Andi Kleen
2006-10-21 16:51 ` [PATCH] [7/19] x86_64: fix page align in e820 allocator Andi Kleen
2006-10-21 16:51 ` [PATCH] [8/19] x86: Use -maccumulate-outgoing-args Andi Kleen
2006-10-21 17:18 ` Dave Jones
2006-10-21 18:20 ` Andi Kleen
2006-10-21 16:51 ` [PATCH] [9/19] x86_64: Speed up dwarf2 unwinder Andi Kleen
2006-10-21 16:51 ` [PATCH] [10/19] x86_64: x86_64 add NX mask for PTE entry Andi Kleen
2006-10-21 16:51 ` [PATCH] [11/19] i386: Fix fake return address Andi Kleen
2006-10-21 18:12 ` Jeremy Fitzhardinge
2006-10-21 18:14 ` Andi Kleen
2006-10-21 18:17 ` Andreas Schwab
2006-10-21 16:51 ` [PATCH] [12/19] x86_64: Fix ENOSYS in system call tracing Andi Kleen
2006-10-21 16:51 ` [PATCH] [13/19] x86_64: Revert interrupt backlink changes Andi Kleen
2006-10-21 16:51 ` [PATCH] [14/19] i386: Disable nmi watchdog on all ThinkPads Andi Kleen
2006-10-21 17:24 ` Dave Jones
2006-10-21 18:11 ` [patches] " Andi Kleen
2006-10-21 18:14 ` Dave Jones
2006-10-21 18:22 ` Andi Kleen
2006-10-21 16:51 ` [PATCH] [16/19] x86: Revert new unwind kernel stack termination Andi Kleen
2006-10-21 16:51 ` [PATCH] [18/19] x86_64: Overlapping program headers in physical addr space fix Andi Kleen
2006-10-23 7:20 ` [patches] " Jan Beulich
2006-10-23 14:41 ` Vivek Goyal
2006-10-23 15:02 ` Ian Campbell
2006-10-23 16:08 ` Jan Beulich
2006-10-21 16:51 ` [PATCH] [19/19] x86_64: Revert timer routing behaviour back to 2.6.16 state Andi Kleen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox