rpms/kernel/FC-6 linux-2.6-20_x86_64_xapic_8_bit_dest.patch, NONE, 1.1 linux-2.6-ptrace-natural-clone.patch, NONE, 1.1 kernel-2.6.spec, 1.2928, 1.2929 linux-2.6-utrace-fixup.patch, 1.1, NONE

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Thu Mar 15 16:09:51 UTC 2007


Author: cebbert

Update of /cvs/dist/rpms/kernel/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv21267

Modified Files:
	kernel-2.6.spec 
Added Files:
	linux-2.6-20_x86_64_xapic_8_bit_dest.patch 
	linux-2.6-ptrace-natural-clone.patch 
Removed Files:
	linux-2.6-utrace-fixup.patch 
Log Message:
* Thu Mar 15 2007 Chuck Ebbert <cebbert at redhat.com>
- added
	  16: linux-2.6-ptrace-natural-clone.patch
	 206: linux-2.6-20_x86_64_xapic_8_bit_dest.patch


linux-2.6-20_x86_64_xapic_8_bit_dest.patch:
 arch/x86_64/kernel/io_apic.c |   24 +++++++++++-------------
 include/asm-x86_64/io_apic.h |   14 ++------------
 2 files changed, 13 insertions(+), 25 deletions(-)

--- NEW FILE linux-2.6-20_x86_64_xapic_8_bit_dest.patch ---

# HG changeset patch
# User Benjamin Romer <benjamin.romer at unisys.com>
# Date 1171369585 -3600
# Node ID cf8a01523c4e29911f611438515e9d2d8e723c0f
# Parent 89cf2407b4249d70cb79c2c7f84997b399c76f5c
[PATCH] x86-64: update IO-APIC dest field to 8-bit for xAPIC

On the Unisys ES7000/ONE system, we encountered a problem where performing
a kexec reboot or dump on any cell other than cell 0 causes the system
timer to stop working, resulting in a hang during timer calibration in the
new kernel.

We traced the problem to one line of code in disable_IO_APIC(), which needs
to restore the timer's IO-APIC configuration before rebooting.  The code is
currently using the 4-bit physical destination field, rather than using the
8-bit logical destination field, and it cuts off the upper 4 bits of the
timer's APIC ID.  If we change this to use the logical destination field,
the timer works and we can kexec on the upper cells.  This was tested on
two different cells (0 and 2) in an ES7000/ONE system.

For reference, the relevant Intel xAPIC spec is kept at
ftp://download.intel.com/design/chipsets/e8501/datashts/30962001.pdf,
specifically on page 334.

Signed-off-by: Benjamin M Romer <benjamin.romer at unisys.com>
Signed-off-by: Andi Kleen <ak at suse.de>
Cc: Andi Kleen <ak at suse.de>
Cc: "Eric W. Biederman" <ebiederm at xmission.com>
Cc: Vivek Goyal <vgoyal at in.ibm.com>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>

committer: Andi Kleen <andi at basil.nowhere.org>

--- a/arch/x86_64/kernel/io_apic.c	Tue Feb 13 13:26:25 2007 +0100
+++ b/arch/x86_64/kernel/io_apic.c	Tue Feb 13 13:26:25 2007 +0100
@@ -831,7 +831,7 @@ static void __init setup_IO_APIC_irq(int
 	entry.delivery_mode = INT_DELIVERY_MODE;
 	entry.dest_mode = INT_DEST_MODE;
 	entry.mask = 0;				/* enable IRQ */
-	entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS);
+	entry.dest = cpu_mask_to_apicid(TARGET_CPUS);
 
 	entry.trigger = irq_trigger(idx);
 	entry.polarity = irq_polarity(idx);
@@ -839,7 +839,7 @@ static void __init setup_IO_APIC_irq(int
 	if (irq_trigger(idx)) {
 		entry.trigger = 1;
 		entry.mask = 1;
-		entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS);
+		entry.dest = cpu_mask_to_apicid(TARGET_CPUS);
 	}
 
 	if (!apic && !IO_APIC_IRQ(irq))
@@ -851,7 +851,7 @@ static void __init setup_IO_APIC_irq(int
 		if (vector < 0)
 			return;
 
-		entry.dest.logical.logical_dest = cpu_mask_to_apicid(mask);
+		entry.dest = cpu_mask_to_apicid(mask);
 		entry.vector = vector;
 
 		ioapic_register_intr(irq, vector, IOAPIC_AUTO);
@@ -920,7 +920,7 @@ static void __init setup_ExtINT_IRQ0_pin
 	 */
 	entry.dest_mode = INT_DEST_MODE;
 	entry.mask = 0;					/* unmask IRQ now */
-	entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS);
+	entry.dest = cpu_mask_to_apicid(TARGET_CPUS);
 	entry.delivery_mode = INT_DELIVERY_MODE;
 	entry.polarity = 0;
 	entry.trigger = 0;
@@ -1020,18 +1020,17 @@ void __apicdebuginit print_IO_APIC(void)
 
 	printk(KERN_DEBUG ".... IRQ redirection table:\n");
 
-	printk(KERN_DEBUG " NR Log Phy Mask Trig IRR Pol"
-			  " Stat Dest Deli Vect:   \n");
+	printk(KERN_DEBUG " NR Dst Mask Trig IRR Pol"
+			  " Stat Dmod Deli Vect:   \n");
 
 	for (i = 0; i <= reg_01.bits.entries; i++) {
 		struct IO_APIC_route_entry entry;
 
 		entry = ioapic_read_entry(apic, i);
 
-		printk(KERN_DEBUG " %02x %03X %02X  ",
+		printk(KERN_DEBUG " %02x %03X ",
 			i,
-			entry.dest.logical.logical_dest,
-			entry.dest.physical.physical_dest
+			entry.dest
 		);
 
 		printk("%1d    %1d    %1d   %1d   %1d    %1d    %1d    %02X\n",
@@ -1293,8 +1292,7 @@ void disable_IO_APIC(void)
 		entry.dest_mode       = 0; /* Physical */
 		entry.delivery_mode   = dest_ExtINT; /* ExtInt */
 		entry.vector          = 0;
-		entry.dest.physical.physical_dest =
-					GET_APIC_ID(apic_read(APIC_ID));
+		entry.dest          = GET_APIC_ID(apic_read(APIC_ID));
 
 		/*
 		 * Add it to the IO-APIC irq-routing table:
@@ -1556,7 +1554,7 @@ static inline void unlock_ExtINT_logic(v
 
 	entry1.dest_mode = 0;			/* physical delivery */
 	entry1.mask = 0;			/* unmask IRQ now */
-	entry1.dest.physical.physical_dest = hard_smp_processor_id();
+	entry1.dest = hard_smp_processor_id();
 	entry1.delivery_mode = dest_ExtINT;
 	entry1.polarity = entry0.polarity;
 	entry1.trigger = 0;
@@ -2131,7 +2129,7 @@ int io_apic_set_pci_routing (int ioapic,
 
 	entry.delivery_mode = INT_DELIVERY_MODE;
 	entry.dest_mode = INT_DEST_MODE;
-	entry.dest.logical.logical_dest = cpu_mask_to_apicid(mask);
+	entry.dest = cpu_mask_to_apicid(mask);
 	entry.trigger = triggering;
 	entry.polarity = polarity;
 	entry.mask = 1;					 /* Disabled (masked) */
--- a/include/asm-x86_64/io_apic.h	Tue Feb 13 13:26:25 2007 +0100
+++ b/include/asm-x86_64/io_apic.h	Tue Feb 13 13:26:25 2007 +0100
@@ -85,18 +85,8 @@ struct IO_APIC_route_entry {
 		mask		:  1,	/* 0: enabled, 1: disabled */
 		__reserved_2	: 15;
 
-	union {		struct { __u32
-					__reserved_1	: 24,
-					physical_dest	:  4,
-					__reserved_2	:  4;
-			} physical;
-
-			struct { __u32
-					__reserved_1	: 24,
-					logical_dest	:  8;
-			} logical;
-	} dest;
-
+	__u32	__reserved_3	: 24,
+		dest		:  8;
 } __attribute__ ((packed));
 
 /*


linux-2.6-ptrace-natural-clone.patch:
 ptrace.c |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

--- NEW FILE linux-2.6-ptrace-natural-clone.patch ---
commit 2a0eadd3320f24ffd5c37bcc4e14033177804d56
Author: Roland McGrath <roland at redhat.com>
Date:   Wed Mar 14 17:40:27 2007 -0700

    Fix ptrace wait for clone threads of natural child.
    Also fix ptrace wait status value for non-instigating threads in group exit.

diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 809a4fb..b25681c 100644  
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -1137,11 +1137,19 @@ found:
 	BUG_ON(state->parent != tsk);
 	rcu_read_unlock();
 
-	pr_debug("%d ptrace_do_wait (%d) found %d code %x (%lu)\n",
-		 current->pid, tsk->pid, p->pid, exit_code, p->exit_state);
+	pr_debug("%d ptrace_do_wait (%d) found %d code %x (%lu/%d)\n",
+		 current->pid, tsk->pid, p->pid, exit_code,
+		 p->exit_state, p->exit_signal);
+
+	/*
+	 * If there was a group exit in progress, all threads report that
+	 * status.  Most will have SIGKILL in their own exit_code.
+	 */
+	if (p->signal->flags & SIGNAL_GROUP_EXIT)
+		exit_code = p->signal->group_exit_code;
 
 	if (p->exit_state) {
-		if (unlikely(p->parent == tsk))
+		if (unlikely(p->parent == tsk && p->exit_signal != -1))
 			/*
 			 * This is our natural child we were ptracing.
 			 * When it dies it detaches (see ptrace_report_death).
@@ -1326,16 +1334,17 @@ ptrace_report_death(struct utrace_attach
 		 */
 		tsk->exit_code = SIGKILL;
 
-	if (tsk->parent == state->parent) {
+	if (tsk->parent == state->parent && tsk->exit_signal != -1) {
 		/*
-		 * This is a natural child, so we detach and let the normal
+		 * This is a natural child (excluding clone siblings of a
+		 * child group_leader), so we detach and let the normal
 		 * reporting happen once our NOREAP action is gone.  But
 		 * first, generate a SIGCHLD for those cases where normal
 		 * behavior won't.  A ptrace'd child always generates SIGCHLD.
 		 */
 		pr_debug("ptrace %d death natural parent %d exit_code %x\n",
 			 tsk->pid, state->parent->pid, tsk->exit_code);
-		if (tsk->exit_signal == -1 || !thread_group_empty(tsk))
+		if (!thread_group_empty(tsk))
 			do_notify(tsk, state->parent, CLD_EXITED);
 		ptrace_state_unlink(state);
 		rcu_assign_pointer(engine->data, 0UL);


Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/FC-6/kernel-2.6.spec,v
retrieving revision 1.2928
retrieving revision 1.2929
diff -u -r1.2928 -r1.2929
--- kernel-2.6.spec	14 Mar 2007 13:14:32 -0000	1.2928
+++ kernel-2.6.spec	15 Mar 2007 16:09:48 -0000	1.2929
@@ -324,7 +324,7 @@
 Patch11: linux-2.6-x86_64_ptrace_ck_retval.patch
 # utrace
 Patch15: linux-2.6-utrace.patch
-Patch16: linux-2.6-utrace-fixup.patch
+Patch16: linux-2.6-ptrace-natural-clone.patch
 
 # enable sysrq-c on all kernels, not only kexec
 Patch20: linux-2.6-sysrq-c.patch
@@ -339,6 +339,7 @@
 Patch203: linux-2.6-x86_64-silence-up-apic-errors.patch
 Patch204: linux-2.6-x86-apic-auto.patch
 Patch205: linux-2.6-x86_64_edac_update.patch
+Patch206: linux-2.6-20_x86_64_xapic_8_bit_dest.patch
 
 # 300 - 399   ppc(64)
 Patch301: linux-2.6-cell-mambo-drivers.patch
@@ -908,6 +909,8 @@
 %patch11 -p1
 # utrace
 %patch15 -p1
+# utrace fix from roland
+%patch16 -p1
 
 # sysrq works always
 %patch20 -p1
@@ -933,6 +936,8 @@
 #%patch204 -p1
 # K8 EDAC update for DDR2 memory and new CPU models
 %patch205 -p1
+# 8-bit dest field for xAPIC
+%patch206 -p1
 
 #
 # PowerPC
@@ -2088,6 +2093,11 @@
 %endif
 
 %changelog
+* Thu Mar 15 2007 Chuck Ebbert <cebbert at redhat.com>
+- added
+	  16: linux-2.6-ptrace-natural-clone.patch
+	 206: linux-2.6-20_x86_64_xapic_8_bit_dest.patch
+
 * Wed Mar 14 2007 Juan Quintela <quintela at redhat.com>
 - make brew happy with new changeset.
 


--- linux-2.6-utrace-fixup.patch DELETED ---




More information about the fedora-cvs-commits mailing list