Date: Mon, 23 Sep 2002 11:17:22 -0700 From: Terry Lambert <tlambert2@mindspring.com> To: John Baldwin <jhb@FreeBSD.org>, smp@freebsd.org, beemern <beemern@ksu.edu> Subject: PATCH: start_ap(), and P4 SMP hack to try Message-ID: <3D8F5AB2.8857A73B@mindspring.com> References: <XFMail.20020923094001.jhb@FreeBSD.org> <3D8F48FB.F3DBE738@mindspring.com>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------56423703072FC3266B63C540 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Terry Lambert wrote: > Depending on the version, I can probably provide a patch that > does what I'm suggesting, some time this week. If it doesn't > work, it's not like you've lost anything by trying it... OK, here is a hack patch. It is against RELENG_4 as of yesterday, but how to convert it to work in -current should be obvious. What it does is correct the start_ap routine to take a physical instead of a logical CPU as an argument. This is a good idea in general, but what it lets you do is the hack that John initially suggested, and it should cause the hack to actually work now -- though it may hang again, at a later point, for other reasons which should be clear from reading the code. Now to retry JMB's hack, in start_all_aps(), change: /* get the PHYSICAL APIC ID# */ physical_cpu = CPU_TO_ID(x); if (!start_ap(physical_cpu, boot_addr)) { printf("AP #%d (PHY# %d) failed!\n", x, CPU_TO_ID(x)); To: /* XXX Override BIOS APIC ID */ #define OVERRIDE_ID 6 /* Put correct value here */ CPU_TO_ID(x) = OVERRIDE_ID; ID_TO_CPU(CPU_TO_ID(x)) = x; /* get the PHYSICAL APIC ID# */ physical_cpu = CPU_TO_ID(x); if (!start_ap(physical_cpu, boot_addr)) { printf("AP #%d (PHY# %d) failed!\n", x, CPU_TO_ID(x)); And then try it with different values of OVERRIDE_ID. In any case, the patch should probably be committed, even if the hack is unsuccessful, since it cleans up the semantics of the start_ap() function. -- Terry --------------56423703072FC3266B63C540 Content-Type: text/plain; charset=us-ascii; name="startp.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="startp.diff" Index: mp_machdep.c =================================================================== RCS file: /usr/cvs/src/sys/i386/i386/mp_machdep.c,v retrieving revision 1.115.2.12 diff -c -r1.115.2.12 mp_machdep.c *** mp_machdep.c 28 Apr 2002 18:18:17 -0000 1.115.2.12 --- mp_machdep.c 23 Sep 2002 18:06:14 -0000 *************** *** 333,339 **** static void init_locks(void); static int start_all_aps(u_int boot_addr); static void install_ap_tramp(u_int boot_addr); ! static int start_ap(int logicalCpu, u_int boot_addr); static int apic_int_is_bus_type(int intr, int bus_type); /* --- 333,339 ---- static void init_locks(void); static int start_all_aps(u_int boot_addr); static void install_ap_tramp(u_int boot_addr); ! static int start_ap(int physicalCpu, u_int boot_addr); static int apic_int_is_bus_type(int intr, int bus_type); /* *************** *** 1987,1992 **** --- 1987,1993 ---- struct globaldata *gd; char *stack; uintptr_t kptbase; + int physical_cpu; POSTCODE(START_ALL_APS_POST); *************** *** 2066,2072 **** /* attempt to start the Application Processor */ CHECK_INIT(99); /* setup checkpoints */ ! if (!start_ap(x, boot_addr)) { printf("AP #%d (PHY# %d) failed!\n", x, CPU_TO_ID(x)); CHECK_PRINT("trace"); /* show checkpoints */ /* better panic as the AP may be running loose */ --- 2067,2077 ---- /* attempt to start the Application Processor */ CHECK_INIT(99); /* setup checkpoints */ ! ! /* get the PHYSICAL APIC ID# */ ! physical_cpu = CPU_TO_ID(x); ! ! if (!start_ap(physical_cpu, boot_addr)) { printf("AP #%d (PHY# %d) failed!\n", x, CPU_TO_ID(x)); CHECK_PRINT("trace"); /* show checkpoints */ /* better panic as the AP may be running loose */ *************** *** 2185,2201 **** * but it seems to work. */ static int ! start_ap(int logical_cpu, u_int boot_addr) { - int physical_cpu; int vector; int cpus; u_long icr_lo, icr_hi; POSTCODE(START_AP_POST); - - /* get the PHYSICAL APIC ID# */ - physical_cpu = CPU_TO_ID(logical_cpu); /* calculate the vector */ vector = (boot_addr >> 12) & 0xff; --- 2190,2202 ---- * but it seems to work. */ static int ! start_ap(int physical_cpu, u_int boot_addr) { int vector; int cpus; u_long icr_lo, icr_hi; POSTCODE(START_AP_POST); /* calculate the vector */ vector = (boot_addr >> 12) & 0xff; --------------56423703072FC3266B63C540-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3D8F5AB2.8857A73B>