From owner-p4-projects Mon Mar 3 11:56:46 2003 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7042937B405; Mon, 3 Mar 2003 11:56:41 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E2B9337B401 for ; Mon, 3 Mar 2003 11:56:40 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 82BAF43F93 for ; Mon, 3 Mar 2003 11:56:40 -0800 (PST) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h23Jue0U020228 for ; Mon, 3 Mar 2003 11:56:40 -0800 (PST) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h23JudPh020225 for perforce@freebsd.org; Mon, 3 Mar 2003 11:56:39 -0800 (PST) Date: Mon, 3 Mar 2003 11:56:39 -0800 (PST) Message-Id: <200303031956.h23JudPh020225@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin Subject: PERFORCE change 26293 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=26293 Change 26293 by jhb@jhb_laptop on 2003/03/03 11:56:17 Add a HTT kernel option. Affected files ... .. //depot/projects/smpng/sys/conf/options.i386#21 edit .. //depot/projects/smpng/sys/i386/conf/NOTES#49 edit .. //depot/projects/smpng/sys/i386/i386/mp_machdep.c#38 edit Differences ... ==== //depot/projects/smpng/sys/conf/options.i386#21 (text+ko) ==== @@ -29,6 +29,7 @@ PECOFF_DEBUG opt_pecoff.h # i386 SMP options APIC_IO opt_global.h +HTT # Change KVM size. Changes things all over the kernel. KVA_PAGES opt_global.h ==== //depot/projects/smpng/sys/i386/conf/NOTES#49 (text+ko) ==== @@ -36,6 +36,7 @@ # Mandatory: options APIC_IO # Symmetric (APIC) I/O +options HTT # HyperThreading Technology # # Rogue SMP hardware: ==== //depot/projects/smpng/sys/i386/i386/mp_machdep.c#38 (text+ko) ==== @@ -26,6 +26,7 @@ */ #include "opt_cpu.h" +#include "opt_htt.h" #include "opt_kstack_pages.h" #ifdef SMP @@ -237,8 +238,10 @@ #define MP_ANNOUNCE_POST 0x19 +#ifdef HTT static int need_hyperthreading_fixup; static u_int logical_cpus; +#endif /* used to hold the AP's until we are ready to release them */ static struct mtx ap_boot_mtx; @@ -315,7 +318,9 @@ static int search_for_sig(u_int32_t target, int count); static void mp_enable(u_int boot_addr); +#ifdef HTT static void mptable_hyperthread_fixup(u_int id_mask); +#endif static void mptable_pass1(void); static int mptable_pass2(void); static void default_mp_table(int type); @@ -786,7 +791,9 @@ void* position; int count; int type; +#ifdef HTT u_int id_mask; +#endif POSTCODE(MPTABLE_PASS1_POST); @@ -800,7 +807,9 @@ mp_nbusses = 0; mp_napics = 0; nintrs = 0; +#ifdef HTT id_mask = 0; +#endif /* check for use of 'default' configuration */ if (MPFPS_MPFB1 != 0) { @@ -835,8 +844,10 @@ & PROCENTRY_FLAG_EN) { ++mp_naps; mp_maxid++; +#ifdef HTT id_mask |= 1 << ((proc_entry_ptr)position)->apic_id; +#endif } break; case 1: /* bus_entry */ @@ -871,8 +882,10 @@ mp_naps = MAXCPU; } +#ifdef HTT /* See if we need to fixup HT logical CPUs. */ mptable_hyperthread_fixup(id_mask); +#endif /* * Count the BSP. @@ -898,7 +911,9 @@ static int mptable_pass2(void) { +#ifdef HTT struct PROCENTRY proc; +#endif int x; mpcth_t cth; int totalSize; @@ -911,10 +926,12 @@ POSTCODE(MPTABLE_PASS2_POST); +#ifdef HTT /* Initialize fake proc entry for use with HT fixup. */ bzero(&proc, sizeof(proc)); proc.type = 0; proc.cpu_flags = PROCENTRY_FLAG_EN; +#endif pgeflag = 0; /* XXX - Not used under SMP yet. */ @@ -994,6 +1011,7 @@ if (processor_entry(position, cpu)) ++cpu; +#ifdef HTT if (need_hyperthreading_fixup) { /* * Create fake mptable processor entries @@ -1007,6 +1025,7 @@ cpu++; } } +#endif break; case 1: if (bus_entry(position, bus)) @@ -1039,6 +1058,7 @@ return 0; } +#ifdef HTT /* * Check if we should perform a hyperthreading "fix-up" to * enumerate any logical CPU's that aren't already listed @@ -1088,6 +1108,7 @@ mp_maxid *= logical_cpus; mp_naps *= logical_cpus; } +#endif void assign_apic_irq(int apic, int intpin, int irq) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message