ia64/xen-unstable

changeset 17716:5cc5b9c37c6d

x86: Fix Xen boot on 8-node AMD machines

In xen/arch/x86/cpu/amd.c the function disable_c1_ramping iterates
over the northbridges using NR_CPUS as an upper bound for the number of
nodes. If there are no more northbridges found, it stops iterating.
Sadly it just adds the northbridge number to 0x18 and uses this as a
PCI device number, so probing the 9th northbridge on an 8 node system will
be caught by the newly inserted assertion in pci_conf_read in current
unstable. We fix this by first querying the number of nodes from the
first northbridge to avoid the overflow.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Verified by Mark.Johnson@sun.com
author Keir Fraser <keir.fraser@citrix.com>
date Fri May 23 11:15:19 2008 +0100 (2008-05-23)
parents 938ae6abe297
children 21422854b9f8
files xen/arch/x86/cpu/amd.c
line diff
     1.1 --- a/xen/arch/x86/cpu/amd.c	Fri May 23 10:57:03 2008 +0100
     1.2 +++ b/xen/arch/x86/cpu/amd.c	Fri May 23 11:15:19 2008 +0100
     1.3 @@ -74,9 +74,11 @@ static int c1_ramping_may_cause_clock_dr
     1.4  static void disable_c1_ramping(void) 
     1.5  {
     1.6  	u8 pmm7;
     1.7 -	int node;
     1.8 +	int node, nr_nodes;
     1.9  
    1.10 -	for (node=0; node < NR_CPUS; node++) {
    1.11 +	/* Read the number of nodes from the first Northbridge. */
    1.12 +	nr_nodes = ((pci_conf_read32(0, 0x18, 0x0, 0x60)>>4)&0x07)+1;
    1.13 +	for (node = 0; node < nr_nodes; node++) {
    1.14  		/* PMM7: bus=0, dev=0x18+node, function=0x3, register=0x87. */
    1.15  		pmm7 = pci_conf_read8(0, 0x18+node, 0x3, 0x87);
    1.16  		/* Invalid read means we've updated every Northbridge. */