From owner-svn-src-stable@FreeBSD.ORG Tue Jun 30 03:05:50 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A37C31065670; Tue, 30 Jun 2009 03:05:50 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 911298FC19; Tue, 30 Jun 2009 03:05:50 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5U35ovu066384; Tue, 30 Jun 2009 03:05:50 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5U35o1I066382; Tue, 30 Jun 2009 03:05:50 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200906300305.n5U35o1I066382@svn.freebsd.org> From: Alexander Kabaev Date: Tue, 30 Jun 2009 03:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195180 - stable/7/libexec/rtld-elf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2009 03:05:51 -0000 Author: kan Date: Tue Jun 30 03:05:50 2009 New Revision: 195180 URL: http://svn.freebsd.org/changeset/base/195180 Log: MFC r194298: FreeBSD returns main object handle from dlopen(NULL, ...) calls. dlsym seaches using this handle are expected to look for symbol definitions in all objects loaded at the program start time along with all objects currently in RTLD_GLOBAL scope. Modified: stable/7/libexec/rtld-elf/ (props changed) stable/7/libexec/rtld-elf/rtld.c Modified: stable/7/libexec/rtld-elf/rtld.c ============================================================================== --- stable/7/libexec/rtld-elf/rtld.c Mon Jun 29 23:53:27 2009 (r195179) +++ stable/7/libexec/rtld-elf/rtld.c Tue Jun 30 03:05:50 2009 (r195180) @@ -1966,6 +1966,16 @@ do_dlsym(void *handle, const char *name, /* Search main program and all libraries loaded by it. */ def = symlook_list(name, hash, &list_main, &defobj, ve, flags, &donelist); + + /* + * We do not distinguish between 'main' object and global scope. + * If symbol is not defined by objects loaded at startup, continue + * search among dynamically loaded objects with RTLD_GLOBAL + * scope. + */ + if (def == NULL) + def = symlook_list(name, hash, &list_global, &defobj, ve, + flags, &donelist); } else { Needed_Entry fake; From owner-svn-src-stable@FreeBSD.ORG Tue Jun 30 09:20:43 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A92D1065676; Tue, 30 Jun 2009 09:20:43 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 564138FC17; Tue, 30 Jun 2009 09:20:43 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5U9KhX3073784; Tue, 30 Jun 2009 09:20:43 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5U9KhHB073782; Tue, 30 Jun 2009 09:20:43 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200906300920.n5U9KhHB073782@svn.freebsd.org> From: Nick Hibma Date: Tue, 30 Jun 2009 09:20:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195184 - stable/7/tools/tools/nanobsd X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2009 09:20:44 -0000 Author: n_hibma Date: Tue Jun 30 09:20:43 2009 New Revision: 195184 URL: http://svn.freebsd.org/changeset/base/195184 Log: MFC all changes up to 194958: 194288: Fix NanoBSD when the data partition size is defined as a negative number. 194431: Allow building world into a separate dir (for reuse in multiple images). 194437: Reverse some stuff I accidentally committed in the previous commit. 194440: Cleanups. 194958: Make pprint print through fd 3 so pprint can be used in customise functions. Prefix each log line with the running time. Modified: stable/7/tools/tools/nanobsd/nanobsd.sh (contents, props changed) Modified: stable/7/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- stable/7/tools/tools/nanobsd/nanobsd.sh Tue Jun 30 09:14:09 2009 (r195183) +++ stable/7/tools/tools/nanobsd/nanobsd.sh Tue Jun 30 09:20:43 2009 (r195184) @@ -51,7 +51,6 @@ NANO_PACKAGE_LIST="*" # Object tree directory # default is subdir of /usr/obj -# XXX: MAKEOBJDIRPREFIX handling... ? #NANO_OBJ="" # The directory to put the final images @@ -147,21 +146,19 @@ NANO_ARCH=i386 clean_build ( ) ( pprint 2 "Clean and create object directory (${MAKEOBJDIRPREFIX})" - if rm -rf ${MAKEOBJDIRPREFIX} > /dev/null 2>&1 ; then - true - else + if ! rm -rf ${MAKEOBJDIRPREFIX} > /dev/null 2>&1 ; then chflags -R noschg ${MAKEOBJDIRPREFIX} - rm -rf ${MAKEOBJDIRPREFIX} + rm -r ${MAKEOBJDIRPREFIX} fi mkdir -p ${MAKEOBJDIRPREFIX} printenv > ${MAKEOBJDIRPREFIX}/_.env ) make_conf_build ( ) ( - pprint 2 "Construct build make.conf ($NANO_MAKE_CONF)" + pprint 2 "Construct build make.conf ($NANO_MAKE_CONF_BUILD)" - echo "${CONF_WORLD}" > ${NANO_MAKE_CONF} - echo "${CONF_BUILD}" >> ${NANO_MAKE_CONF} + echo "${CONF_WORLD}" > ${NANO_MAKE_CONF_BUILD} + echo "${CONF_BUILD}" >> ${NANO_MAKE_CONF_BUILD} ) build_world ( ) ( @@ -170,7 +167,7 @@ build_world ( ) ( cd ${NANO_SRC} env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} \ - __MAKE_CONF=${NANO_MAKE_CONF} buildworld \ + __MAKE_CONF=${NANO_MAKE_CONF_BUILD} buildworld \ > ${MAKEOBJDIRPREFIX}/_.bw 2>&1 ) @@ -188,62 +185,70 @@ build_kernel ( ) ( unset TARGET_CPUTYPE unset TARGET_BIG_ENDIAN env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} buildkernel \ - __MAKE_CONF=${NANO_MAKE_CONF} KERNCONF=`basename ${NANO_KERNEL}` \ + __MAKE_CONF=${NANO_MAKE_CONF_BUILD} KERNCONF=`basename ${NANO_KERNEL}` \ > ${MAKEOBJDIRPREFIX}/_.bk 2>&1 ) ) clean_world ( ) ( - pprint 2 "Clean and create world directory (${NANO_WORLDDIR})" - if rm -rf ${NANO_WORLDDIR}/ > /dev/null 2>&1 ; then - true + if [ "${NANO_OBJ}" != "${MAKEOBJDIRPREFIX}" ]; then + pprint 2 "Clean and create object directory (${NANO_OBJ})" + if ! rm -rf ${NANO_OBJ} > /dev/null 2>&1 ; then + chflags -R noschg ${NANO_OBJ} + rm -r ${NANO_OBJ} + fi + mkdir -p ${NANO_OBJ} ${NANO_WORLDDIR} + printenv > ${NANO_OBJ}/_.env else - chflags -R noschg ${NANO_WORLDDIR}/ - rm -rf ${NANO_WORLDDIR}/ + pprint 2 "Clean and create world directory (${NANO_WORLDDIR})" + if ! rm -rf ${NANO_WORLDDIR}/ > /dev/null 2>&1 ; then + chflags -R noschg ${NANO_WORLDDIR} + rm -rf ${NANO_WORLDDIR} + fi + mkdir -p ${NANO_WORLDDIR} fi - mkdir -p ${NANO_WORLDDIR}/ ) make_conf_install ( ) ( - pprint 2 "Construct install make.conf ($NANO_MAKE_CONF)" + pprint 2 "Construct install make.conf ($NANO_MAKE_CONF_INSTALL)" - echo "${CONF_WORLD}" > ${NANO_MAKE_CONF} - echo "${CONF_INSTALL}" >> ${NANO_MAKE_CONF} + echo "${CONF_WORLD}" > ${NANO_MAKE_CONF_INSTALL} + echo "${CONF_INSTALL}" >> ${NANO_MAKE_CONF_INSTALL} ) install_world ( ) ( pprint 2 "installworld" - pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.iw" + pprint 3 "log: ${NANO_OBJ}/_.iw" cd ${NANO_SRC} env TARGET_ARCH=${NANO_ARCH} \ - ${NANO_PMAKE} __MAKE_CONF=${NANO_MAKE_CONF} installworld \ + ${NANO_PMAKE} __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} installworld \ DESTDIR=${NANO_WORLDDIR} \ - > ${MAKEOBJDIRPREFIX}/_.iw 2>&1 + > ${NANO_OBJ}/_.iw 2>&1 chflags -R noschg ${NANO_WORLDDIR} ) install_etc ( ) ( pprint 2 "install /etc" - pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.etc" + pprint 3 "log: ${NANO_OBJ}/_.etc" cd ${NANO_SRC} env TARGET_ARCH=${NANO_ARCH} \ - ${NANO_PMAKE} __MAKE_CONF=${NANO_MAKE_CONF} distribution \ + ${NANO_PMAKE} __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} distribution \ DESTDIR=${NANO_WORLDDIR} \ - > ${MAKEOBJDIRPREFIX}/_.etc 2>&1 + > ${NANO_OBJ}/_.etc 2>&1 ) install_kernel ( ) ( pprint 2 "install kernel" - pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.ik" + pprint 3 "log: ${NANO_OBJ}/_.ik" cd ${NANO_SRC} env TARGET_ARCH=${NANO_ARCH} ${NANO_PMAKE} installkernel \ DESTDIR=${NANO_WORLDDIR} \ - __MAKE_CONF=${NANO_MAKE_CONF} KERNCONF=`basename ${NANO_KERNEL}` \ - > ${MAKEOBJDIRPREFIX}/_.ik 2>&1 + __MAKE_CONF=${NANO_MAKE_CONF_INSTALL} KERNCONF=`basename ${NANO_KERNEL}` \ + > ${NANO_OBJ}/_.ik 2>&1 ) run_customize() ( @@ -252,9 +257,9 @@ run_customize() ( for c in $NANO_CUSTOMIZE do pprint 2 "customize \"$c\"" - pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.cust.$c" + pprint 3 "log: ${NANO_OBJ}/_.cust.$c" pprint 4 "`type $c`" - ( $c ) > ${MAKEOBJDIRPREFIX}/_.cust.$c 2>&1 + ( $c ) > ${NANO_OBJ}/_.cust.$c 2>&1 done ) @@ -264,15 +269,15 @@ run_late_customize() ( for c in $NANO_LATE_CUSTOMIZE do pprint 2 "late customize \"$c\"" - pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.late_cust.$c" + pprint 3 "log: ${NANO_OBJ}/_.late_cust.$c" pprint 4 "`type $c`" - ( $c ) > ${MAKEOBJDIRPREFIX}/_.late_cust.$c 2>&1 + ( $c ) > ${NANO_OBJ}/_.late_cust.$c 2>&1 done ) setup_nanobsd ( ) ( pprint 2 "configure nanobsd setup" - pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.dl" + pprint 3 "log: ${NANO_OBJ}/_.dl" ( cd ${NANO_WORLDDIR} @@ -312,7 +317,7 @@ setup_nanobsd ( ) ( rm tmp || true ln -s var/tmp tmp - ) > ${MAKEOBJDIRPREFIX}/_.dl 2>&1 + ) > ${NANO_OBJ}/_.dl 2>&1 ) setup_nanobsd_etc ( ) ( @@ -348,7 +353,7 @@ prune_usr() ( create_i386_diskimage ( ) ( pprint 2 "build diskimage" - pprint 3 "log: ${MAKEOBJDIRPREFIX}/_.di" + pprint 3 "log: ${NANO_OBJ}/_.di" ( echo $NANO_MEDIASIZE $NANO_IMAGES \ @@ -417,10 +422,10 @@ create_i386_diskimage ( ) ( # for booting the image from a USB device to work. print "a 1" } - ' > ${MAKEOBJDIRPREFIX}/_.fdisk + ' > ${NANO_OBJ}/_.fdisk IMG=${NANO_DISKIMGDIR}/${NANO_IMGNAME} - MNT=${MAKEOBJDIRPREFIX}/_.mnt + MNT=${NANO_OBJ}/_.mnt mkdir -p ${MNT} if [ "${NANO_MD_BACKING}" = "swap" ] ; then @@ -436,7 +441,7 @@ create_i386_diskimage ( ) ( trap "df -i ${MNT} ; umount ${MNT} || true ; mdconfig -d -u $MD" 1 2 15 EXIT - fdisk -i -f ${MAKEOBJDIRPREFIX}/_.fdisk ${MD} + fdisk -i -f ${NANO_OBJ}/_.fdisk ${MD} fdisk ${MD} # XXX: params # XXX: pick up cached boot* files, they may not be in image anymore. @@ -452,8 +457,8 @@ create_i386_diskimage ( ) ( ( cd ${NANO_WORLDDIR} && find . -print | cpio -dump ${MNT} ) df -i ${MNT} echo "Generating mtree..." - ( cd ${MNT} && mtree -c ) > ${MAKEOBJDIRPREFIX}/_.mtree - ( cd ${MNT} && du -k ) > ${MAKEOBJDIRPREFIX}/_.du + ( cd ${MNT} && mtree -c ) > ${NANO_OBJ}/_.mtree + ( cd ${MNT} && du -k ) > ${NANO_OBJ}/_.du umount ${MNT} if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then @@ -466,7 +471,6 @@ create_i386_diskimage ( ) ( sed -i "" "s/${NANO_DRIVE}s1/${NANO_DRIVE}s2/g" $f done umount ${MNT} - fi # Create Config slice @@ -480,21 +484,21 @@ create_i386_diskimage ( ) ( fi if [ "${NANO_MD_BACKING}" = "swap" ] ; then - echo "Writing out _.disk.full..." + echo "Writing out ${NANO_IMGNAME}..." dd if=/dev/${MD} of=${IMG} bs=64k fi echo "Writing out _.disk.image..." dd if=/dev/${MD}s1 of=${NANO_DISKIMGDIR}/_.disk.image bs=64k mdconfig -d -u $MD - ) > ${MAKEOBJDIRPREFIX}/_.di 2>&1 + ) > ${NANO_OBJ}/_.di 2>&1 ) last_orders () ( # Redefine this function with any last orders you may have # after the build completed, for instance to copy the finished # image to a more convenient place: - # cp ${MAKEOBJDIRPREFIX}/_.disk.image /home/ftp/pub/nanobsd.disk + # cp ${NANO_DISKIMGDIR}/_.disk.image /home/ftp/pub/nanobsd.disk ) ####################################################################### @@ -660,7 +664,8 @@ late_customize_cmd () { # Print $2 at level $1. pprint() { if [ "$1" -le $PPLEVEL ]; then - printf "%.${1}s %s\n" "#####" "$2" + runtime=$(( `date +%s` - $NANO_STARTTIME )) + printf "%s %.${1}s %s\n" "`date -u -r $runtime +%H:%M:%S`" "#####" "$2" 1>&3 fi } @@ -751,19 +756,13 @@ fi ####################################################################### # Setup and Export Internal variables # -if [ "x${NANO_OBJ}" = "x" ] ; then - MAKEOBJDIRPREFIX=/usr/obj/nanobsd.${NANO_NAME}/ - NANO_OBJ=${MAKEOBJDIRPREFIX} -else - MAKEOBJDIRPREFIX=${NANO_OBJ} -fi - -if [ "x${NANO_DISKIMGDIR}" = "x" ] ; then - NANO_DISKIMGDIR=${MAKEOBJDIRPREFIX} -fi - -NANO_WORLDDIR=${MAKEOBJDIRPREFIX}/_.w -NANO_MAKE_CONF=${MAKEOBJDIRPREFIX}/make.conf +test -n "${NANO_OBJ}" || NANO_OBJ=/usr/obj/nanobsd.${NANO_NAME}/ +test -n "${MAKEOBJDIRPREFIX}" || MAKEOBJDIRPREFIX=${NANO_OBJ} +test -n "${NANO_DISKIMGDIR}" || NANO_DISKIMGDIR=${NANO_OBJ} + +NANO_WORLDDIR=${NANO_OBJ}/_.w +NANO_MAKE_CONF_BUILD=${MAKEOBJDIRPREFIX}/make.conf.build +NANO_MAKE_CONF_INSTALL=${NANO_OBJ}/make.conf.install if [ -d ${NANO_TOOLS} ] ; then true @@ -791,7 +790,8 @@ export NANO_DRIVE export NANO_HEADS export NANO_IMAGES export NANO_IMGNAME -export NANO_MAKE_CONF +export NANO_MAKE_CONF_BUILD +export NANO_MAKE_CONF_INSTALL export NANO_MEDIASIZE export NANO_NAME export NANO_NEWFS @@ -807,6 +807,10 @@ export NANO_BOOTLOADER ####################################################################### # And then it is as simple as that... +# File descriptor 3 is used for logging output, see pprint +exec 3>&1 + +NANO_STARTTIME=`date +%s` pprint 1 "NanoBSD image ${NANO_NAME} build starting" if $do_world ; then @@ -840,7 +844,6 @@ prune_usr run_late_customize if $do_image ; then create_${NANO_ARCH}_diskimage - echo "# Created NanoBSD disk image: ${MAKEOBJDIRPREFIX}/${NANO_IMGNAME}" else pprint 2 "Skipping image build (as instructed)" fi From owner-svn-src-stable@FreeBSD.ORG Tue Jun 30 14:11:44 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09344106566C; Tue, 30 Jun 2009 14:11:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E90BF8FC0C; Tue, 30 Jun 2009 14:11:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5UEBhKC082961; Tue, 30 Jun 2009 14:11:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5UEBhm5082955; Tue, 30 Jun 2009 14:11:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906301411.n5UEBhm5082955@svn.freebsd.org> From: Andriy Gapon Date: Tue, 30 Jun 2009 14:11:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195193 - in stable/7/sys: . amd64/amd64 arm/arm contrib/pf i386/i386 ia64/ia64 sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2009 14:11:44 -0000 Author: avg Date: Tue Jun 30 14:11:43 2009 New Revision: 195193 URL: http://svn.freebsd.org/changeset/base/195193 Log: MFC 179229 (alc), 195188: The VM system no longer uses setPQL2(). Remove it and its helpers. Drop unused extern declarations in amd64 that seem to have been related. Reviewed by: alc Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/identcpu.c stable/7/sys/arm/arm/identcpu.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/i386/i386/identcpu.c stable/7/sys/ia64/ia64/machdep.c stable/7/sys/sparc64/sparc64/identcpu.c Modified: stable/7/sys/amd64/amd64/identcpu.c ============================================================================== --- stable/7/sys/amd64/amd64/identcpu.c Tue Jun 30 13:53:54 2009 (r195192) +++ stable/7/sys/amd64/amd64/identcpu.c Tue Jun 30 14:11:43 2009 (r195193) @@ -71,8 +71,6 @@ void panicifcpuunsupported(void); static void print_AMD_info(void); static void print_AMD_assoc(int i); -void setPQL2(int *const size, int *const ways); -static void setPQL2_AMD(int *const size, int *const ways); int cpu_class; char machine[] = "amd64"; @@ -97,9 +95,6 @@ static struct { { "Sledgehammer", CPUCLASS_K8 }, /* CPU_SLEDGEHAMMER */ }; -extern int pq_l2size; -extern int pq_l2nways; - void printcpuinfo(void) { @@ -564,30 +559,3 @@ print_AMD_info(void) print_AMD_l2_assoc((regs[2] >> 12) & 0x0f); } } - -static void -setPQL2_AMD(int *const size, int *const ways) -{ - if (cpu_exthigh >= 0x80000006) { - u_int regs[4]; - - do_cpuid(0x80000006, regs); - *size = regs[2] >> 16; - *ways = (regs[2] >> 12) & 0x0f; - switch (*ways) { - case 0: /* disabled/not present */ - case 15: /* fully associative */ - default: *ways = 1; break; /* reserved configuration */ - case 4: *ways = 4; break; - case 6: *ways = 8; break; - case 8: *ways = 16; break; - } - } -} - -void -setPQL2(int *const size, int *const ways) -{ - if (strcmp(cpu_vendor, "AuthenticAMD") == 0) - setPQL2_AMD(size, ways); -} Modified: stable/7/sys/arm/arm/identcpu.c ============================================================================== --- stable/7/sys/arm/arm/identcpu.c Tue Jun 30 13:53:54 2009 (r195192) +++ stable/7/sys/arm/arm/identcpu.c Tue Jun 30 14:11:43 2009 (r195193) @@ -356,14 +356,6 @@ static const char * const wtnames[] = { "**unknown 15**", }; -void setPQL2(int *const size, int *const ways); - -void -setPQL2(int *const size, int *const ways) -{ - return; -} - extern int ctrl; void Modified: stable/7/sys/i386/i386/identcpu.c ============================================================================== --- stable/7/sys/i386/i386/identcpu.c Tue Jun 30 13:53:54 2009 (r195192) +++ stable/7/sys/i386/i386/identcpu.c Tue Jun 30 14:11:43 2009 (r195193) @@ -77,10 +77,6 @@ void panicifcpuunsupported(void); static void identifycyrix(void); static void init_exthigh(void); -void setPQL2(int *const size, int *const ways); -static void setPQL2_AMD(int *const size, int *const ways); -static void setPQL2_INTEL(int *const size, int *const ways); -static void get_INTEL_TLB(u_int data, int *const size, int *const ways); static void print_AMD_info(void); static void print_INTEL_info(void); static void print_INTEL_TLB(u_int data); @@ -1477,300 +1473,6 @@ print_INTEL_TLB(u_int data) } } - -static void -setPQL2_AMD(int *const size, int *const ways) -{ - if (cpu_exthigh >= 0x80000006) { - u_int regs[4]; - - do_cpuid(0x80000006, regs); - *size = regs[2] >> 16; - *ways = (regs[2] >> 12) & 0x0f; - } -} - - -static void -setPQL2_INTEL(int *const size, int *const ways) -{ - u_int rounds, regnum; - u_int regs[4]; - u_int nwaycode; - - if (cpu_high >= 2) { - rounds = 0; - do { - do_cpuid(0x2, regs); - if (rounds == 0 && (rounds = (regs[0] & 0xff)) == 0) - break; /* we have a buggy CPU */ - - for (regnum = 0; regnum <= 3; ++regnum) { - if (regs[regnum] & (1<<31)) - continue; - if (regnum != 0) - get_INTEL_TLB(regs[regnum] & 0xff, - size, ways); - get_INTEL_TLB((regs[regnum] >> 8) & 0xff, - size, ways); - get_INTEL_TLB((regs[regnum] >> 16) & 0xff, - size, ways); - get_INTEL_TLB((regs[regnum] >> 24) & 0xff, - size, ways); - } - } while (--rounds > 0); - } - - if (cpu_exthigh >= 0x80000006) { - do_cpuid(0x80000006, regs); - if (*size < ((regs[2] >> 16) & 0xffff)) { - *size = (regs[2] >> 16) & 0xffff; - nwaycode = (regs[2] >> 12) & 0x0f; - if (nwaycode >= 0x02 && nwaycode <= 0x08) - *ways = 1 << (nwaycode / 2); - else - *ways = 0; - } - } -} - -static void -get_INTEL_TLB(u_int data, int *const size, int *const ways) -{ - switch (data) { - default: - break; - case 0x22: - /* 3rd-level cache: 512 KB, 4-way set associative, - * sectored cache, 64 byte line size */ - if (*size < 512) { - *size = 512; - *ways = 4; - } - break; - case 0x23: - /* 3rd-level cache: 1 MB, 8-way set associative, - * sectored cache, 64 byte line size */ - if (*size < 1024) { - *size = 1024; - *ways = 8; - } - break; - case 0x25: - /* 3rd-level cache: 2 MB, 8-way set associative, - * sectored cache, 64 byte line size */ - if (*size < 2048) { - *size = 2048; - *ways = 8; - } - break; - case 0x29: - /* 3rd-level cache: 4 MB, 8-way set associative, - * sectored cache, 64 byte line size */ - if (*size < 4096) { - *size = 4096; - *ways = 8; - } - break; - case 0x39: - /* 2nd-level cache: 128 KB, 4-way set associative, - * sectored cache, 64 byte line size */ - if (*size < 128) { - *size = 128; - *ways = 4; - } - break; - case 0x3b: - /* 2nd-level cache: 128 KB, 2-way set associative, - * sectored cache, 64 byte line size */ - if (*size < 128) { - *size = 128; - *ways = 2; - } - break; - case 0x3c: - /* 2nd-level cache: 256 KB, 4-way set associative, - * sectored cache, 64 byte line size */ - if (*size < 256) { - *size = 256; - *ways = 4; - } - break; - case 0x41: - /* 2nd-level cache: 128 KB, 4-way set associative, - * 32 byte line size */ - if (*size < 128) { - *size = 128; - *ways = 4; - } - break; - case 0x42: - /* 2nd-level cache: 256 KB, 4-way set associative, - * 32 byte line size */ - if (*size < 256) { - *size = 256; - *ways = 4; - } - break; - case 0x43: - /* 2nd-level cache: 512 KB, 4-way set associative, - * 32 byte line size */ - if (*size < 512) { - *size = 512; - *ways = 4; - } - break; - case 0x44: - /* 2nd-level cache: 1 MB, 4-way set associative, - * 32 byte line size */ - if (*size < 1024) { - *size = 1024; - *ways = 4; - } - break; - case 0x45: - /* 2nd-level cache: 2 MB, 4-way set associative, - * 32 byte line size */ - if (*size < 2048) { - *size = 2048; - *ways = 4; - } - break; - case 0x46: - /* 3rd-level cache: 4 MB, 4-way set associative, - * 64 byte line size */ - if (*size < 4096) { - *size = 4096; - *ways = 4; - } - break; - case 0x47: - /* 3rd-level cache: 8 MB, 8-way set associative, - * 64 byte line size */ - if (*size < 8192) { - *size = 8192; - *ways = 8; - } - break; - case 0x78: - /* 2nd-level cache: 1 MB, 4-way set associative, - * 64-byte line size */ - if (*size < 1024) { - *size = 1024; - *ways = 4; - } - break; - case 0x79: - /* 2nd-level cache: 128 KB, 8-way set associative, - * sectored cache, 64 byte line size */ - if (*size < 128) { - *size = 128; - *ways = 8; - } - break; - case 0x7a: - /* 2nd-level cache: 256 KB, 8-way set associative, - * sectored cache, 64 byte line size */ - if (*size < 256) { - *size = 256; - *ways = 8; - } - break; - case 0x7b: - /* 2nd-level cache: 512 KB, 8-way set associative, - * sectored cache, 64 byte line size */ - if (*size < 512) { - *size = 512; - *ways = 8; - } - break; - case 0x7c: - /* 2nd-level cache: 1 MB, 8-way set associative, - * sectored cache, 64 byte line size */ - if (*size < 1024) { - *size = 1024; - *ways = 8; - } - break; - case 0x7d: - /* 2nd-level cache: 2 MB, 8-way set associative, - * 64-byte line size */ - if (*size < 2048) { - *size = 2048; - *ways = 8; - } - break; - case 0x7f: - /* 2nd-level cache: 512 KB, 2-way set associative, - * 64-byte line size */ - if (*size < 512) { - *size = 512; - *ways = 2; - } - break; - case 0x82: - /* 2nd-level cache: 256 KB, 8-way set associative, - * 32 byte line size */ - if (*size < 256) { - *size = 256; - *ways = 8; - } - break; - case 0x83: - /* 2nd-level cache: 512 KB, 8-way set associative, - * 32 byte line size */ - if (*size < 512) { - *size = 512; - *ways = 8; - } - break; - case 0x84: - /* 2nd-level cache: 1 MB, 8-way set associative, - * 32 byte line size */ - if (*size < 1024) { - *size = 1024; - *ways = 8; - } - break; - case 0x85: - /* 2nd-level cache: 2 MB, 8-way set associative, - * 32 byte line size */ - if (*size < 2048) { - *size = 2048; - *ways = 8; - } - break; - case 0x86: - /* 2nd-level cache: 512 KB, 4-way set associative, - * 64 byte line size */ - if (*size < 512) { - *size = 512; - *ways = 4; - } - break; - case 0x87: - /* 2nd-level cache: 1 MB, 8-way set associative, - * 64 byte line size */ - if (*size < 1024) { - *size = 512; - *ways = 8; - } - break; - } -} - -void -setPQL2(int *const size, int *const ways) -{ - /* make sure the cpu_exthigh variable is initialized */ - init_exthigh(); - - if (strcmp(cpu_vendor, "AuthenticAMD") == 0) - setPQL2_AMD(size, ways); - else if (strcmp(cpu_vendor, "GenuineIntel") == 0) - setPQL2_INTEL(size, ways); -} - static void print_transmeta_info(void) { Modified: stable/7/sys/ia64/ia64/machdep.c ============================================================================== --- stable/7/sys/ia64/ia64/machdep.c Tue Jun 30 13:53:54 2009 (r195192) +++ stable/7/sys/ia64/ia64/machdep.c Tue Jun 30 14:11:43 2009 (r195193) @@ -162,14 +162,6 @@ struct kva_md_info kmi; #define Mhz 1000000L #define Ghz (1000L*Mhz) -void setPQL2(int *const size, int *const ways); - -void -setPQL2(int *const size, int *const ways) -{ - return; -} - static void identifycpu(void) { Modified: stable/7/sys/sparc64/sparc64/identcpu.c ============================================================================== --- stable/7/sys/sparc64/sparc64/identcpu.c Tue Jun 30 13:53:54 2009 (r195192) +++ stable/7/sys/sparc64/sparc64/identcpu.c Tue Jun 30 14:11:43 2009 (r195193) @@ -29,19 +29,6 @@ SYSCTL_STRING(_hw, HW_MODEL, model, CTLF int cpu_impl; -void setPQL2(int *const size, int *const ways); - -void -setPQL2(int *const size, int *const ways) -{ -#ifdef SUN4V -/* XXX hardcoding is lame */ - *size = 3*1024; - *ways = 12; -#endif - return; -} - void cpu_identify(u_long vers, u_int freq, u_int id) { From owner-svn-src-stable@FreeBSD.ORG Tue Jun 30 15:23:16 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DEEF1065670; Tue, 30 Jun 2009 15:23:16 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B99D8FC1D; Tue, 30 Jun 2009 15:23:16 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5UFNGwn084564; Tue, 30 Jun 2009 15:23:16 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5UFNGmN084562; Tue, 30 Jun 2009 15:23:16 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200906301523.n5UFNGmN084562@svn.freebsd.org> From: Attilio Rao Date: Tue, 30 Jun 2009 15:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195196 - stable/6/sys/netinet X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2009 15:23:17 -0000 Author: attilio Date: Tue Jun 30 15:23:16 2009 New Revision: 195196 URL: http://svn.freebsd.org/changeset/base/195196 Log: If the table is empty we can end up with a NULL pointer. Handle that case trying to free and re-allocate a new object for the timerqueue, managing unallocations. This is not an issue on 7 and further branches. Submitted by: emaste Sponsored by: Sandvine Incorporated Reported by: Kyle Larose Modified: stable/6/sys/netinet/tcp_syncache.c Modified: stable/6/sys/netinet/tcp_syncache.c ============================================================================== --- stable/6/sys/netinet/tcp_syncache.c Tue Jun 30 14:34:06 2009 (r195195) +++ stable/6/sys/netinet/tcp_syncache.c Tue Jun 30 15:23:16 2009 (r195196) @@ -891,13 +891,15 @@ syncache_add(inc, to, th, sop, m) /* NB: guarded by INP_INFO_WLOCK(&tcbinfo) */ for (i = SYNCACHE_MAXREXMTS; i >= 0; i--) { sc = TAILQ_FIRST(&tcp_syncache.timerq[i]); - if (sc != NULL) + if (sc != NULL) { + sc->sc_tp->ts_recent = ticks; + syncache_drop(sc, NULL); + tcpstat.tcps_sc_zonefail++; + sc = uma_zalloc(tcp_syncache.zone, M_NOWAIT | + M_ZERO); break; + } } - sc->sc_tp->ts_recent = ticks; - syncache_drop(sc, NULL); - tcpstat.tcps_sc_zonefail++; - sc = uma_zalloc(tcp_syncache.zone, M_NOWAIT | M_ZERO); if (sc == NULL) { if (ipopts) (void) m_free(ipopts); From owner-svn-src-stable@FreeBSD.ORG Tue Jun 30 17:10:09 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6061A1065675; Tue, 30 Jun 2009 17:10:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BA448FC16; Tue, 30 Jun 2009 17:10:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5UHA9vS086737; Tue, 30 Jun 2009 17:10:09 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5UHA8b0086710; Tue, 30 Jun 2009 17:10:08 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906301710.n5UHA8b0086710@svn.freebsd.org> From: Andriy Gapon Date: Tue, 30 Jun 2009 17:10:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195197 - in stable/7/sys: . amd64/amd64 amd64/include contrib/pf dev/coretemp dev/hwpmc i386/cpufreq i386/i386 i386/include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2009 17:10:10 -0000 Author: avg Date: Tue Jun 30 17:10:08 2009 New Revision: 195197 URL: http://svn.freebsd.org/changeset/base/195197 Log: MFC 185295, 185341, 185343: cpu identification improvements Goal of this MFC is to minimize unnecessary code differences between head and the branch, and to improve/fix invariant TSC detection for a wide range of CPUs. 185295 by takawata: Honor AMDPM_TSC_INVARIANT for Intel CPUs (i386 only) 185341 by jkim: Introduce cpu_vendor_id... 185343 by jkim: Use newly introduced cpu_vendor_id... These revision are bundled together because all intermediate revisions have one or more of the following deficiencies: o AMDPM_TSC_INVARIANT bit (CPUID.0x80000007.EDX[8]) is not honored for Intel CPUs; o AMD-specific CPU model/revision checks are performed on Intel CPUs. Nod from: jkim Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/amd64_mem.c stable/7/sys/amd64/amd64/identcpu.c stable/7/sys/amd64/amd64/initcpu.c stable/7/sys/amd64/amd64/local_apic.c stable/7/sys/amd64/amd64/mp_machdep.c stable/7/sys/amd64/amd64/msi.c stable/7/sys/amd64/include/cputypes.h stable/7/sys/amd64/include/md_var.h stable/7/sys/amd64/include/specialreg.h stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/coretemp/coretemp.c stable/7/sys/dev/hwpmc/hwpmc_intel.c stable/7/sys/dev/hwpmc/hwpmc_piv.c stable/7/sys/dev/hwpmc/hwpmc_ppro.c stable/7/sys/dev/hwpmc/hwpmc_x86.c stable/7/sys/i386/cpufreq/est.c stable/7/sys/i386/i386/i686_mem.c stable/7/sys/i386/i386/identcpu.c stable/7/sys/i386/i386/initcpu.c stable/7/sys/i386/i386/k6_mem.c stable/7/sys/i386/i386/local_apic.c stable/7/sys/i386/i386/longrun.c stable/7/sys/i386/i386/mp_machdep.c stable/7/sys/i386/i386/msi.c stable/7/sys/i386/include/cputypes.h stable/7/sys/i386/include/md_var.h stable/7/sys/i386/include/specialreg.h Modified: stable/7/sys/amd64/amd64/amd64_mem.c ============================================================================== --- stable/7/sys/amd64/amd64/amd64_mem.c Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/amd64/amd64/amd64_mem.c Tue Jun 30 17:10:08 2009 (r195197) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -677,8 +678,8 @@ amd64_mem_drvinit(void *unused) return; if ((cpu_id & 0xf00) != 0x600 && (cpu_id & 0xf00) != 0xf00) return; - if ((strcmp(cpu_vendor, "GenuineIntel") != 0) && - (strcmp(cpu_vendor, "AuthenticAMD") != 0)) + if (cpu_vendor_id != CPU_VENDOR_INTEL && + cpu_vendor_id != CPU_VENDOR_AMD) return; mem_range_softc.mr_op = &amd64_mrops; } Modified: stable/7/sys/amd64/amd64/identcpu.c ============================================================================== --- stable/7/sys/amd64/amd64/identcpu.c Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/amd64/amd64/identcpu.c Tue Jun 30 17:10:08 2009 (r195197) @@ -69,6 +69,7 @@ void identify_cpu(void); void earlysetcpuclass(void); void panicifcpuunsupported(void); +static u_int find_cpu_vendor_id(void); static void print_AMD_info(void); static void print_AMD_assoc(int i); @@ -95,6 +96,14 @@ static struct { { "Sledgehammer", CPUCLASS_K8 }, /* CPU_SLEDGEHAMMER */ }; +static struct { + char *vendor; + u_int vendor_id; +} cpu_vendors[] = { + { INTEL_VENDOR_ID, CPU_VENDOR_INTEL }, /* GenuineIntel */ + { AMD_VENDOR_ID, CPU_VENDOR_AMD }, /* AuthenticAMD */ +}; + void printcpuinfo(void) { @@ -115,10 +124,10 @@ printcpuinfo(void) } } - if (strcmp(cpu_vendor, "GenuineIntel") == 0) { + if (cpu_vendor_id == CPU_VENDOR_INTEL) { /* Please make up your mind folks! */ strcat(cpu_model, "EM64T"); - } else if (strcmp(cpu_vendor, "AuthenticAMD") == 0) { + } else if (cpu_vendor_id == CPU_VENDOR_AMD) { /* * Values taken from AMD Processor Recognition * http://www.amd.com/K6/k6docs/pdf/20734g.pdf @@ -158,13 +167,13 @@ printcpuinfo(void) printf("Unknown"); /* will panic below... */ } printf("-class CPU)\n"); - if(*cpu_vendor) - printf(" Origin = \"%s\"",cpu_vendor); - if(cpu_id) + if (*cpu_vendor) + printf(" Origin = \"%s\"", cpu_vendor); + if (cpu_id) printf(" Id = 0x%x", cpu_id); - if (strcmp(cpu_vendor, "GenuineIntel") == 0 || - strcmp(cpu_vendor, "AuthenticAMD") == 0) { + if (cpu_vendor_id == CPU_VENDOR_INTEL || + cpu_vendor_id == CPU_VENDOR_AMD) { printf(" Stepping = %u", cpu_id & 0xf); if (cpu_high > 0) { u_int cmp = 1, htt = 1; @@ -336,22 +345,28 @@ printcpuinfo(void) ); } - if (cpu_feature & CPUID_HTT && strcmp(cpu_vendor, - "AuthenticAMD") == 0) + if ((cpu_feature & CPUID_HTT) && + cpu_vendor_id == CPU_VENDOR_AMD) cpu_feature &= ~CPUID_HTT; /* * If this CPU supports P-state invariant TSC then * mention the capability. */ - if (!tsc_is_invariant && - (strcmp(cpu_vendor, "AuthenticAMD") == 0 && - ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 || - AMD64_CPU_FAMILY(cpu_id) >= 0x10 || - cpu_id == 0x60fb2))) { - tsc_is_invariant = 1; - printf("\n TSC: P-state invariant"); + switch (cpu_vendor_id) { + case CPU_VENDOR_AMD: + if ((amd_pminfo & AMDPM_TSC_INVARIANT) || + AMD64_CPU_FAMILY(cpu_id) >= 0x10 || + cpu_id == 0x60fb2) + tsc_is_invariant = 1; + break; + case CPU_VENDOR_INTEL: + if (amd_pminfo & AMDPM_TSC_INVARIANT) + tsc_is_invariant = 1; + break; } + if (tsc_is_invariant) + printf("\n TSC: P-state invariant"); /* * If this CPU supports HTT or CMP then mention the @@ -359,10 +374,10 @@ printcpuinfo(void) */ if (cpu_feature & CPUID_HTT) htt = (cpu_procinfo & CPUID_HTT_CORES) >> 16; - if (strcmp(cpu_vendor, "AuthenticAMD") == 0 && + if (cpu_vendor_id == CPU_VENDOR_AMD && (amd_feature2 & AMDID2_CMP)) cmp = (cpu_procinfo2 & AMDID_CMP_CORES) + 1; - else if (strcmp(cpu_vendor, "GenuineIntel") == 0 && + else if (cpu_vendor_id == CPU_VENDOR_INTEL && (cpu_high >= 4)) { cpuid_count(4, 0, regs); if ((regs[0] & 0x1f) != 0) @@ -382,7 +397,7 @@ printcpuinfo(void) if (!bootverbose) return; - if (strcmp(cpu_vendor, "AuthenticAMD") == 0) + if (cpu_vendor_id == CPU_VENDOR_AMD) print_AMD_info(); } @@ -441,6 +456,7 @@ identify_cpu(void) ((u_int *)&cpu_vendor)[1] = regs[3]; ((u_int *)&cpu_vendor)[2] = regs[2]; cpu_vendor[12] = '\0'; + cpu_vendor_id = find_cpu_vendor_id(); do_cpuid(1, regs); cpu_id = regs[0]; @@ -448,8 +464,8 @@ identify_cpu(void) cpu_feature = regs[3]; cpu_feature2 = regs[2]; - if (strcmp(cpu_vendor, "GenuineIntel") == 0 || - strcmp(cpu_vendor, "AuthenticAMD") == 0) { + if (cpu_vendor_id == CPU_VENDOR_INTEL || + cpu_vendor_id == CPU_VENDOR_AMD) { do_cpuid(0x80000000, regs); cpu_exthigh = regs[0]; } @@ -471,6 +487,17 @@ identify_cpu(void) cpu = CPU_CLAWHAMMER; } +static u_int +find_cpu_vendor_id(void) +{ + int i; + + for (i = 0; i < sizeof(cpu_vendors) / sizeof(cpu_vendors[0]); i++) + if (strcmp(cpu_vendor, cpu_vendors[i].vendor) == 0) + return (cpu_vendors[i].vendor_id); + return (0); +} + static void print_AMD_assoc(int i) { Modified: stable/7/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/7/sys/amd64/amd64/initcpu.c Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/amd64/amd64/initcpu.c Tue Jun 30 17:10:08 2009 (r195197) @@ -60,6 +60,7 @@ u_int cpu_id; /* Stepping ID */ u_int cpu_procinfo; /* HyperThreading Info / Brand Index / CLFUSH */ u_int cpu_procinfo2; /* Multicore info */ char cpu_vendor[20]; /* CPU Origin code */ +u_int cpu_vendor_id; /* CPU vendor ID */ u_int cpu_fxsr; /* SSE enabled */ u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */ Modified: stable/7/sys/amd64/amd64/local_apic.c ============================================================================== --- stable/7/sys/amd64/amd64/local_apic.c Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/amd64/amd64/local_apic.c Tue Jun 30 17:10:08 2009 (r195197) @@ -323,7 +323,7 @@ lapic_setup(int boot) /* XXX: Error and thermal LVTs */ - if (strcmp(cpu_vendor, "AuthenticAMD") == 0) { + if (cpu_vendor_id == CPU_VENDOR_AMD) { /* * Detect the presence of C1E capability mostly on latest * dual-cores (or future) k8 family. This feature renders Modified: stable/7/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/7/sys/amd64/amd64/mp_machdep.c Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/amd64/amd64/mp_machdep.c Tue Jun 30 17:10:08 2009 (r195197) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -376,8 +377,7 @@ cpu_mp_start(void) * First determine if this is an Intel processor which claims * to have hyperthreading support. */ - if ((cpu_feature & CPUID_HTT) && - (strcmp(cpu_vendor, "GenuineIntel") == 0)) { + if ((cpu_feature & CPUID_HTT) && cpu_vendor_id == CPU_VENDOR_INTEL) { /* * If the "deterministic cache parameters" cpuid calls * are available, use them. Modified: stable/7/sys/amd64/amd64/msi.c ============================================================================== --- stable/7/sys/amd64/amd64/msi.c Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/amd64/amd64/msi.c Tue Jun 30 17:10:08 2009 (r195197) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -211,8 +212,8 @@ msi_init(void) { /* Check if we have a supported CPU. */ - if (!(strcmp(cpu_vendor, "GenuineIntel") == 0 || - strcmp(cpu_vendor, "AuthenticAMD") == 0)) + if (!(cpu_vendor_id == CPU_VENDOR_INTEL || + cpu_vendor_id == CPU_VENDOR_AMD)) return; msi_enabled = 1; Modified: stable/7/sys/amd64/include/cputypes.h ============================================================================== --- stable/7/sys/amd64/include/cputypes.h Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/amd64/include/cputypes.h Tue Jun 30 17:10:08 2009 (r195197) @@ -33,15 +33,21 @@ /* * Classes of processor. */ -#define CPUCLASS_X86 0 /* X86 */ -#define CPUCLASS_K8 1 /* K8 AMD64 class */ +#define CPUCLASS_X86 0 /* X86 */ +#define CPUCLASS_K8 1 /* K8 AMD64 class */ /* * Kinds of processor. */ -#define CPU_X86 0 /* Intel */ -#define CPU_CLAWHAMMER 1 /* AMD Clawhammer */ -#define CPU_SLEDGEHAMMER 2 /* AMD Sledgehammer */ +#define CPU_X86 0 /* Intel */ +#define CPU_CLAWHAMMER 1 /* AMD Clawhammer */ +#define CPU_SLEDGEHAMMER 2 /* AMD Sledgehammer */ + +/* + * Vendors of processor. + */ +#define CPU_VENDOR_AMD 0x1022 /* AMD */ +#define CPU_VENDOR_INTEL 0x8086 /* Intel */ #ifndef LOCORE extern int cpu; Modified: stable/7/sys/amd64/include/md_var.h ============================================================================== --- stable/7/sys/amd64/include/md_var.h Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/amd64/include/md_var.h Tue Jun 30 17:10:08 2009 (r195197) @@ -52,6 +52,7 @@ extern u_int cpu_mxcsr_mask; extern u_int cpu_procinfo; extern u_int cpu_procinfo2; extern char cpu_vendor[]; +extern u_int cpu_vendor_id; extern char kstack[]; extern char sigcode[]; extern int szsigcode; Modified: stable/7/sys/amd64/include/specialreg.h ============================================================================== --- stable/7/sys/amd64/include/specialreg.h Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/amd64/include/specialreg.h Tue Jun 30 17:10:08 2009 (r195197) @@ -204,8 +204,8 @@ /* * CPUID manufacturers identifiers */ -#define INTEL_VENDOR_ID "GenuineIntel" -#define AMD_VENDOR_ID "AuthenticAMD" +#define AMD_VENDOR_ID "AuthenticAMD" +#define INTEL_VENDOR_ID "GenuineIntel" /* * Model-specific registers for the i386 family Modified: stable/7/sys/dev/coretemp/coretemp.c ============================================================================== --- stable/7/sys/dev/coretemp/coretemp.c Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/dev/coretemp/coretemp.c Tue Jun 30 17:10:08 2009 (r195197) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include struct coretemp_softc { @@ -94,7 +95,7 @@ coretemp_identify(driver_t *driver, devi return; /* Check that CPUID 0x06 is supported and the vendor is Intel.*/ - if (cpu_high < 6 || strcmp(cpu_vendor, "GenuineIntel")) + if (cpu_high < 6 || cpu_vendor_id != CPU_VENDOR_INTEL) return; /* * CPUID 0x06 returns 1 if the processor has on-die thermal Modified: stable/7/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_intel.c Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/dev/hwpmc/hwpmc_intel.c Tue Jun 30 17:10:08 2009 (r195197) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -79,7 +80,7 @@ pmc_intel_initialize(void) enum pmc_cputype cputype; int error, model, nclasses, ncpus; - KASSERT(strcmp(cpu_vendor, "GenuineIntel") == 0, + KASSERT(cpu_vendor_id == CPU_VENDOR_INTEL, ("[intel,%d] Initializing non-intel processor", __LINE__)); PMCDBG(MDP,INI,0, "intel-initialize cpuid=0x%x", cpu_id); Modified: stable/7/sys/dev/hwpmc/hwpmc_piv.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_piv.c Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/dev/hwpmc/hwpmc_piv.c Tue Jun 30 17:10:08 2009 (r195197) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -1610,7 +1611,7 @@ pmc_p4_initialize(struct pmc_mdep *md, i struct p4_event_descr *pe; KASSERT(md != NULL, ("[p4,%d] md is NULL", __LINE__)); - KASSERT(strcmp(cpu_vendor, "GenuineIntel") == 0, + KASSERT(cpu_vendor_id == CPU_VENDOR_INTEL, ("[p4,%d] Initializing non-intel processor", __LINE__)); PMCDBG(MDP,INI,1, "%s", "p4-initialize"); Modified: stable/7/sys/dev/hwpmc/hwpmc_ppro.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_ppro.c Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/dev/hwpmc/hwpmc_ppro.c Tue Jun 30 17:10:08 2009 (r195197) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -781,7 +782,7 @@ pmc_p6_initialize(struct pmc_mdep *md, i { struct pmc_classdep *pcd; - KASSERT(strcmp(cpu_vendor, "GenuineIntel") == 0, + KASSERT(cpu_vendor_id == CPU_VENDOR_INTEL, ("[p6,%d] Initializing non-intel processor", __LINE__)); PMCDBG(MDP,INI,1, "%s", "p6-initialize"); Modified: stable/7/sys/dev/hwpmc/hwpmc_x86.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_x86.c Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/dev/hwpmc/hwpmc_x86.c Tue Jun 30 17:10:08 2009 (r195197) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -252,9 +253,9 @@ pmc_md_initialize() /* determine the CPU kind */ md = NULL; - if (strcmp(cpu_vendor, "AuthenticAMD") == 0) + if (cpu_vendor_id == CPU_VENDOR_AMD) md = pmc_amd_initialize(); - else if (strcmp(cpu_vendor, "GenuineIntel") == 0) + else if (cpu_vendor_id == CPU_VENDOR_INTEL) md = pmc_intel_initialize(); else KASSERT(0, ("[x86,%d] Unknown vendor", __LINE__)); @@ -270,9 +271,9 @@ pmc_md_initialize() void pmc_md_finalize(struct pmc_mdep *md) { - if (strcmp(cpu_vendor, "AuthenticAMD") == 0) + if (cpu_vendor_id == CPU_VENDOR_AMD) pmc_amd_finalize(md); - else if (strcmp(cpu_vendor, "GenuineIntel") == 0) + else if (cpu_vendor_id == CPU_VENDOR_INTEL) pmc_intel_finalize(md); else KASSERT(0, ("[x86,%d] Unknown vendor", __LINE__)); Modified: stable/7/sys/i386/cpufreq/est.c ============================================================================== --- stable/7/sys/i386/cpufreq/est.c Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/i386/cpufreq/est.c Tue Jun 30 17:10:08 2009 (r195197) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include "cpufreq_if.h" #include +#include #include #include @@ -54,6 +55,10 @@ __FBSDID("$FreeBSD$"); #define MSR_MISC_ENABLE 0x1a0 #define MSR_SS_ENABLE (1<<16) +#ifndef CPU_VENDOR_CENTAUR +#define CPU_VENDOR_CENTAUR 0x111d +#endif + /* Frequency and MSR control values. */ typedef struct { uint16_t freq; @@ -64,7 +69,7 @@ typedef struct { /* Identifying characteristics of a processor and supported frequencies. */ typedef struct { - const char *vendor; + const u_int vendor_id; uint32_t id32; freq_info *freqtab; } cpu_info; @@ -88,12 +93,10 @@ struct est_softc { #define FREQ_INFO(MHz, mV, bus_clk) \ FREQ_INFO_PWR(MHz, mV, bus_clk, CPUFREQ_VAL_UNKNOWN) #define INTEL(tab, zhi, vhi, zlo, vlo, bus_clk) \ - { intel_id, ID32(zhi, vhi, zlo, vlo, bus_clk), tab } + { CPU_VENDOR_INTEL, ID32(zhi, vhi, zlo, vlo, bus_clk), tab } #define CENTAUR(tab, zhi, vhi, zlo, vlo, bus_clk) \ - { centaur_id, ID32(zhi, vhi, zlo, vlo, bus_clk), tab } + { CPU_VENDOR_CENTAUR, ID32(zhi, vhi, zlo, vlo, bus_clk), tab } -const char intel_id[] = "GenuineIntel"; -const char centaur_id[] = "CentaurHauls"; static int msr_info_enabled = 0; TUNABLE_INT("hw.est.msr_info", &msr_info_enabled); @@ -891,7 +894,7 @@ static cpu_info ESTprocs[] = { CENTAUR(C7M_772_ULV, 1200, 844, 400, 796, 100), CENTAUR(C7M_779_ULV, 1000, 796, 400, 796, 100), CENTAUR(C7M_770_ULV, 1000, 844, 400, 796, 100), - { NULL, 0, NULL }, + { 0, 0, NULL }, }; static void est_identify(driver_t *driver, device_t parent); @@ -958,8 +961,8 @@ est_identify(driver_t *driver, device_t return; /* Check that CPUID is supported and the vendor is Intel.*/ - if (cpu_high == 0 || (strcmp(cpu_vendor, intel_id) != 0 && - strcmp(cpu_vendor, centaur_id) != 0)) + if (cpu_high == 0 || (cpu_vendor_id != CPU_VENDOR_INTEL && + cpu_vendor_id != CPU_VENDOR_CENTAUR)) return; /* @@ -1159,7 +1162,7 @@ est_table_info(device_t dev, uint64_t ms /* Find a table which matches (vendor, id32). */ id = msr >> 32; for (p = ESTprocs; p->id32 != 0; p++) { - if (strcmp(p->vendor, cpu_vendor) == 0 && p->id32 == id) + if (p->vendor_id == cpu_vendor_id && p->id32 == id) break; } if (p->id32 == 0) Modified: stable/7/sys/i386/i386/i686_mem.c ============================================================================== --- stable/7/sys/i386/i386/i686_mem.c Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/i386/i386/i686_mem.c Tue Jun 30 17:10:08 2009 (r195197) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -677,8 +678,8 @@ i686_mem_drvinit(void *unused) return; if ((cpu_id & 0xf00) != 0x600 && (cpu_id & 0xf00) != 0xf00) return; - if ((strcmp(cpu_vendor, "GenuineIntel") != 0) && - (strcmp(cpu_vendor, "AuthenticAMD") != 0)) + if (cpu_vendor_id != CPU_VENDOR_INTEL && + cpu_vendor_id != CPU_VENDOR_AMD) return; mem_range_softc.mr_op = &i686_mrops; } Modified: stable/7/sys/i386/i386/identcpu.c ============================================================================== --- stable/7/sys/i386/i386/identcpu.c Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/i386/i386/identcpu.c Tue Jun 30 17:10:08 2009 (r195197) @@ -77,6 +77,7 @@ void panicifcpuunsupported(void); static void identifycyrix(void); static void init_exthigh(void); +static u_int find_cpu_vendor_id(void); static void print_AMD_info(void); static void print_INTEL_info(void); static void print_INTEL_TLB(u_int data); @@ -138,6 +139,26 @@ static struct { { "Pentium 4", CPUCLASS_686 }, /* CPU_P4 */ }; +static struct { + char *vendor; + u_int vendor_id; +} cpu_vendors[] = { + { INTEL_VENDOR_ID, CPU_VENDOR_INTEL }, /* GenuineIntel */ + { AMD_VENDOR_ID, CPU_VENDOR_AMD }, /* AuthenticAMD */ + { CENTAUR_VENDOR_ID, CPU_VENDOR_CENTAUR }, /* CentaurHauls */ + { NSC_VENDOR_ID, CPU_VENDOR_NSC }, /* Geode by NSC */ + { CYRIX_VENDOR_ID, CPU_VENDOR_CYRIX }, /* CyrixInstead */ + { TRANSMETA_VENDOR_ID, CPU_VENDOR_TRANSMETA }, /* GenuineTMx86 */ + { SIS_VENDOR_ID, CPU_VENDOR_SIS }, /* SiS SiS SiS */ + { UMC_VENDOR_ID, CPU_VENDOR_UMC }, /* UMC UMC UMC */ + { NEXGEN_VENDOR_ID, CPU_VENDOR_NEXGEN }, /* NexGenDriven */ + { RISE_VENDOR_ID, CPU_VENDOR_RISE }, /* RiseRiseRise */ +#if 0 + /* XXX CPUID 8000_0000h and 8086_0000h, not 0000_0000h */ + { "TransmetaCPU", CPU_VENDOR_TRANSMETA }, +#endif +}; + #if defined(I586_CPU) && !defined(NO_F00F_HACK) int has_f00f_bug = 0; /* Initialized so that it can be patched. */ #endif @@ -150,12 +171,11 @@ init_exthigh(void) if (done == 0) { if (cpu_high > 0 && - (strcmp(cpu_vendor, "GenuineIntel") == 0 || - strcmp(cpu_vendor, "AuthenticAMD") == 0 || - strcmp(cpu_vendor, "GenuineTMx86") == 0 || - strcmp(cpu_vendor, "TransmetaCPU") == 0 || - strcmp(cpu_vendor, "CentaurHauls") == 0 || - strcmp(cpu_vendor, "Geode by NSC") == 0)) { + (cpu_vendor_id == CPU_VENDOR_INTEL || + cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_TRANSMETA || + cpu_vendor_id == CPU_VENDOR_CENTAUR || + cpu_vendor_id == CPU_VENDOR_NSC)) { do_cpuid(0x80000000, regs); if (regs[0] >= 0x80000000) cpu_exthigh = regs[0]; @@ -186,7 +206,7 @@ printcpuinfo(void) } } - if (strcmp(cpu_vendor, "GenuineIntel") == 0) { + if (cpu_vendor_id == CPU_VENDOR_INTEL) { if ((cpu_id & 0xf00) > 0x300) { u_int brand_index; u_int model; @@ -330,7 +350,7 @@ printcpuinfo(void) cpu_brandtable[brand_index]); } } - } else if (strcmp(cpu_vendor, "AuthenticAMD") == 0) { + } else if (cpu_vendor_id == CPU_VENDOR_AMD) { /* * Values taken from AMD Processor Recognition * http://www.amd.com/K6/k6docs/pdf/20734g.pdf @@ -410,7 +430,7 @@ printcpuinfo(void) enable_K6_wt_alloc(); } #endif - } else if (strcmp(cpu_vendor, "CyrixInstead") == 0) { + } else if (cpu_vendor_id == CPU_VENDOR_CYRIX) { strcpy(cpu_model, "Cyrix "); switch (cpu_id & 0xff0) { case 0x440: @@ -546,7 +566,7 @@ printcpuinfo(void) } break; } - } else if (strcmp(cpu_vendor, "RiseRiseRise") == 0) { + } else if (cpu_vendor_id == CPU_VENDOR_RISE) { strcpy(cpu_model, "Rise "); switch (cpu_id & 0xff0) { case 0x500: @@ -555,7 +575,7 @@ printcpuinfo(void) default: strcat(cpu_model, "Unknown"); } - } else if (strcmp(cpu_vendor, "CentaurHauls") == 0) { + } else if (cpu_vendor_id == CPU_VENDOR_CENTAUR) { switch (cpu_id & 0xff0) { case 0x540: strcpy(cpu_model, "IDT WinChip C6"); @@ -586,9 +606,9 @@ printcpuinfo(void) default: strcpy(cpu_model, "VIA/IDT Unknown"); } - } else if (strcmp(cpu_vendor, "IBM") == 0) { + } else if (cpu_vendor_id == CPU_VENDOR_IBM) { strcpy(cpu_model, "Blue Lightning CPU"); - } else if (strcmp(cpu_vendor, "Geode by NSC") == 0) { + } else if (cpu_vendor_id == CPU_VENDOR_NSC) { switch (cpu_id & 0xfff) { case 0x540: strcpy(cpu_model, "Geode SC1100"); @@ -652,17 +672,16 @@ printcpuinfo(void) if(cpu_id) printf(" Id = 0x%x", cpu_id); - if (strcmp(cpu_vendor, "GenuineIntel") == 0 || - strcmp(cpu_vendor, "AuthenticAMD") == 0 || - strcmp(cpu_vendor, "GenuineTMx86") == 0 || - strcmp(cpu_vendor, "TransmetaCPU") == 0 || - strcmp(cpu_vendor, "RiseRiseRise") == 0 || - strcmp(cpu_vendor, "CentaurHauls") == 0 || - strcmp(cpu_vendor, "Geode by NSC") == 0 || - ((strcmp(cpu_vendor, "CyrixInstead") == 0) && + if (cpu_vendor_id == CPU_VENDOR_INTEL || + cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_TRANSMETA || + cpu_vendor_id == CPU_VENDOR_RISE || + cpu_vendor_id == CPU_VENDOR_CENTAUR || + cpu_vendor_id == CPU_VENDOR_NSC || + (cpu_vendor_id == CPU_VENDOR_CYRIX && ((cpu_id & 0xf00) > 0x500))) { printf(" Stepping = %u", cpu_id & 0xf); - if (strcmp(cpu_vendor, "CyrixInstead") == 0) + if (cpu_vendor_id == CPU_VENDOR_CYRIX) printf(" DIR=0x%04x", cyrix_did); if (cpu_high > 0) { u_int cmp = 1, htt = 1; @@ -834,22 +853,28 @@ printcpuinfo(void) ); } - if (cpu_feature & CPUID_HTT && strcmp(cpu_vendor, - "AuthenticAMD") == 0) + if ((cpu_feature & CPUID_HTT) && + cpu_vendor_id == CPU_VENDOR_AMD) cpu_feature &= ~CPUID_HTT; /* * If this CPU supports P-state invariant TSC then * mention the capability. */ - if (!tsc_is_invariant && - (strcmp(cpu_vendor, "AuthenticAMD") == 0 && - ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 || - I386_CPU_FAMILY(cpu_id) >= 0x10 || - cpu_id == 0x60fb2))) { - tsc_is_invariant = 1; - printf("\n TSC: P-state invariant"); + switch (cpu_vendor_id) { + case CPU_VENDOR_AMD: + if ((amd_pminfo & AMDPM_TSC_INVARIANT) || + I386_CPU_FAMILY(cpu_id) >= 0x10 || + cpu_id == 0x60fb2) + tsc_is_invariant = 1; + break; + case CPU_VENDOR_INTEL: + if (amd_pminfo & AMDPM_TSC_INVARIANT) + tsc_is_invariant = 1; + break; } + if (tsc_is_invariant) + printf("\n TSC: P-state invariant"); /* * If this CPU supports HTT or CMP then mention the @@ -857,10 +882,10 @@ printcpuinfo(void) */ if (cpu_feature & CPUID_HTT) htt = (cpu_procinfo & CPUID_HTT_CORES) >> 16; - if (strcmp(cpu_vendor, "AuthenticAMD") == 0 && + if (cpu_vendor_id == CPU_VENDOR_AMD && (amd_feature2 & AMDID2_CMP)) cmp = (cpu_procinfo2 & AMDID_CMP_CORES) + 1; - else if (strcmp(cpu_vendor, "GenuineIntel") == 0 && + else if (cpu_vendor_id == CPU_VENDOR_INTEL && (cpu_high >= 4)) { cpuid_count(4, 0, regs); if ((regs[0] & 0x1f) != 0) @@ -872,7 +897,7 @@ printcpuinfo(void) printf("\n Logical CPUs per core: %d", htt / cmp); } - } else if (strcmp(cpu_vendor, "CyrixInstead") == 0) { + } else if (cpu_vendor_id == CPU_VENDOR_CYRIX) { printf(" DIR=0x%04x", cyrix_did); printf(" Stepping=%u", (cyrix_did & 0xf000) >> 12); printf(" Revision=%u", (cyrix_did & 0x0f00) >> 8); @@ -881,7 +906,7 @@ printcpuinfo(void) printf("\n CPU cache: write-through mode"); #endif } - if (strcmp(cpu_vendor, "CentaurHauls") == 0) + if (cpu_vendor_id == CPU_VENDOR_CENTAUR) print_via_padlock_info(); /* Avoid ugly blank lines: only print newline when we have to. */ @@ -891,12 +916,11 @@ printcpuinfo(void) if (!bootverbose) return; - if (strcmp(cpu_vendor, "AuthenticAMD") == 0) + if (cpu_vendor_id == CPU_VENDOR_AMD) print_AMD_info(); - else if (strcmp(cpu_vendor, "GenuineIntel") == 0) + else if (cpu_vendor_id == CPU_VENDOR_INTEL) print_INTEL_info(); - else if (strcmp(cpu_vendor, "GenuineTMx86") == 0 || - strcmp(cpu_vendor, "TransmetaCPU") == 0) + else if (cpu_vendor_id == CPU_VENDOR_TRANSMETA) print_transmeta_info(); } @@ -1091,9 +1115,11 @@ finishidentcpu(void) u_char ccr3; u_int regs[4]; + cpu_vendor_id = find_cpu_vendor_id(); + /* Detect AMD features (PTE no-execute bit, 3dnow, 64 bit mode etc) */ - if (strcmp(cpu_vendor, "GenuineIntel") == 0 || - strcmp(cpu_vendor, "AuthenticAMD") == 0) { + if (cpu_vendor_id == CPU_VENDOR_INTEL || + cpu_vendor_id == CPU_VENDOR_AMD) { init_exthigh(); if (cpu_exthigh >= 0x80000001) { do_cpuid(0x80000001, regs); @@ -1108,7 +1134,7 @@ finishidentcpu(void) do_cpuid(0x80000008, regs); cpu_procinfo2 = regs[2]; } - } else if (strcmp(cpu_vendor, "CyrixInstead") == 0) { + } else if (cpu_vendor_id == CPU_VENDOR_CYRIX) { if (cpu == CPU_486) { /* * These conditions are equivalent to: @@ -1118,6 +1144,7 @@ finishidentcpu(void) isblue = identblue(); if (isblue == IDENTBLUE_IBMCPU) { strcpy(cpu_vendor, "IBM"); + cpu_vendor_id = CPU_VENDOR_IBM; cpu = CPU_BLUE; return; } @@ -1191,12 +1218,24 @@ finishidentcpu(void) isblue = identblue(); if (isblue == IDENTBLUE_IBMCPU) { strcpy(cpu_vendor, "IBM"); + cpu_vendor_id = CPU_VENDOR_IBM; cpu = CPU_BLUE; return; } } } +static u_int +find_cpu_vendor_id(void) +{ + int i; + + for (i = 0; i < sizeof(cpu_vendors) / sizeof(cpu_vendors[0]); i++) + if (strcmp(cpu_vendor, cpu_vendors[i].vendor) == 0) + return (cpu_vendors[i].vendor_id); + return (0); +} + static void print_AMD_assoc(int i) { Modified: stable/7/sys/i386/i386/initcpu.c ============================================================================== --- stable/7/sys/i386/i386/initcpu.c Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/i386/i386/initcpu.c Tue Jun 30 17:10:08 2009 (r195197) @@ -90,6 +90,7 @@ u_int cpu_id = 0; /* Stepping ID */ u_int cpu_procinfo = 0; /* HyperThreading Info / Brand Index / CLFUSH */ u_int cpu_procinfo2 = 0; /* Multicore info */ char cpu_vendor[20] = ""; /* CPU Origin code */ +u_int cpu_vendor_id = 0; /* CPU vendor ID */ SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD, &via_feature_rng, 0, "VIA C3/C7 RNG feature available in CPU"); Modified: stable/7/sys/i386/i386/k6_mem.c ============================================================================== --- stable/7/sys/i386/i386/k6_mem.c Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/i386/i386/k6_mem.c Tue Jun 30 17:10:08 2009 (r195197) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -175,7 +176,7 @@ static void k6_mem_drvinit(void *unused) { - if (strcmp(cpu_vendor, "AuthenticAMD") != 0) + if (cpu_vendor_id != CPU_VENDOR_AMD) return; if ((cpu_id & 0xf00) != 0x500) return; Modified: stable/7/sys/i386/i386/local_apic.c ============================================================================== --- stable/7/sys/i386/i386/local_apic.c Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/i386/i386/local_apic.c Tue Jun 30 17:10:08 2009 (r195197) @@ -325,7 +325,7 @@ lapic_setup(int boot) /* XXX: Error and thermal LVTs */ - if (strcmp(cpu_vendor, "AuthenticAMD") == 0) { + if (cpu_vendor_id == CPU_VENDOR_AMD) { /* * Detect the presence of C1E capability mostly on latest * dual-cores (or future) k8 family. This feature renders @@ -1073,7 +1073,7 @@ apic_init(void *dummy __unused) * CPUs during early startup. We need to turn the local APIC back * on on such CPUs now. */ - if (cpu == CPU_686 && strcmp(cpu_vendor, "GenuineIntel") == 0 && + if (cpu == CPU_686 && cpu_vendor_id == CPU_VENDOR_INTEL && (cpu_id & 0xff0) == 0x610) { apic_base = rdmsr(MSR_APICBASE); apic_base |= APICBASE_ENABLED; Modified: stable/7/sys/i386/i386/longrun.c ============================================================================== --- stable/7/sys/i386/i386/longrun.c Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/i386/i386/longrun.c Tue Jun 30 17:10:08 2009 (r195197) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -262,8 +263,8 @@ tmx86_longrun_profile_sysctl(SYSCTL_HAND static void setup_tmx86_longrun(void *dummy __unused) { - if (strcmp(cpu_vendor, "GenuineTMx86") != 0 && - strcmp(cpu_vendor, "TransmetaCPU") != 0) + + if (cpu_vendor_id != CPU_VENDOR_TRANSMETA) return; crusoe_longrun = tmx86_get_longrun_mode(); Modified: stable/7/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/7/sys/i386/i386/mp_machdep.c Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/i386/i386/mp_machdep.c Tue Jun 30 17:10:08 2009 (r195197) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -425,8 +426,7 @@ cpu_mp_start(void) * First determine if this is an Intel processor which claims * to have hyperthreading support. */ - if ((cpu_feature & CPUID_HTT) && - (strcmp(cpu_vendor, "GenuineIntel") == 0)) { + if ((cpu_feature & CPUID_HTT) && cpu_vendor_id == CPU_VENDOR_INTEL) { /* * If the "deterministic cache parameters" cpuid calls * are available, use them. Modified: stable/7/sys/i386/i386/msi.c ============================================================================== --- stable/7/sys/i386/i386/msi.c Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/i386/i386/msi.c Tue Jun 30 17:10:08 2009 (r195197) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -211,8 +212,8 @@ msi_init(void) { /* Check if we have a supported CPU. */ - if (!(strcmp(cpu_vendor, "GenuineIntel") == 0 || - strcmp(cpu_vendor, "AuthenticAMD") == 0)) + if (!(cpu_vendor_id == CPU_VENDOR_INTEL || + cpu_vendor_id == CPU_VENDOR_AMD)) return; msi_enabled = 1; Modified: stable/7/sys/i386/include/cputypes.h ============================================================================== --- stable/7/sys/i386/include/cputypes.h Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/i386/include/cputypes.h Tue Jun 30 17:10:08 2009 (r195197) @@ -33,33 +33,49 @@ /* * Classes of processor. */ -#define CPUCLASS_286 0 -#define CPUCLASS_386 1 -#define CPUCLASS_486 2 -#define CPUCLASS_586 3 -#define CPUCLASS_686 4 +#define CPUCLASS_286 0 +#define CPUCLASS_386 1 +#define CPUCLASS_486 2 +#define CPUCLASS_586 3 +#define CPUCLASS_686 4 /* * Kinds of processor. */ -#define CPU_286 0 /* Intel 80286 */ -#define CPU_386SX 1 /* Intel 80386SX */ -#define CPU_386 2 /* Intel 80386DX */ -#define CPU_486SX 3 /* Intel 80486SX */ -#define CPU_486 4 /* Intel 80486DX */ -#define CPU_586 5 /* Intel P.....m (I hate lawyers; it's TM) */ -#define CPU_486DLC 6 /* Cyrix 486DLC */ -#define CPU_686 7 /* Pentium Pro */ -#define CPU_M1SC 8 /* Cyrix M1sc (aka 5x86) */ -#define CPU_M1 9 /* Cyrix M1 (aka 6x86) */ -#define CPU_BLUE 10 /* IBM BlueLighting CPU */ -#define CPU_M2 11 /* Cyrix M2 (aka enhanced 6x86 with MMX */ -#define CPU_NX586 12 /* NexGen (now AMD) 586 */ -#define CPU_CY486DX 13 /* Cyrix 486S/DX/DX2/DX4 */ -#define CPU_PII 14 /* Intel Pentium II */ -#define CPU_PIII 15 /* Intel Pentium III */ -#define CPU_P4 16 /* Intel Pentium 4 */ -#define CPU_GEODE1100 17 /* NS Geode SC1100 */ +#define CPU_286 0 /* Intel 80286 */ +#define CPU_386SX 1 /* Intel 80386SX */ +#define CPU_386 2 /* Intel 80386DX */ +#define CPU_486SX 3 /* Intel 80486SX */ +#define CPU_486 4 /* Intel 80486DX */ +#define CPU_586 5 /* Intel Pentium */ +#define CPU_486DLC 6 /* Cyrix 486DLC */ +#define CPU_686 7 /* Pentium Pro */ +#define CPU_M1SC 8 /* Cyrix M1sc (aka 5x86) */ +#define CPU_M1 9 /* Cyrix M1 (aka 6x86) */ +#define CPU_BLUE 10 /* IBM BlueLighting CPU */ +#define CPU_M2 11 /* Cyrix M2 (enhanced 6x86 with MMX) */ +#define CPU_NX586 12 /* NexGen (now AMD) 586 */ +#define CPU_CY486DX 13 /* Cyrix 486S/DX/DX2/DX4 */ +#define CPU_PII 14 /* Intel Pentium II */ +#define CPU_PIII 15 /* Intel Pentium III */ +#define CPU_P4 16 /* Intel Pentium 4 */ +#define CPU_GEODE1100 17 /* NS Geode SC1100 */ + +/* + * Vendors of processor. + */ +#define CPU_VENDOR_NSC 0x100b /* NSC */ +#define CPU_VENDOR_IBM 0x1014 /* IBM */ +#define CPU_VENDOR_AMD 0x1022 /* AMD */ +#define CPU_VENDOR_SIS 0x1039 /* SiS */ +#define CPU_VENDOR_UMC 0x1060 /* UMC */ +#define CPU_VENDOR_NEXGEN 0x1074 /* Nexgen */ +#define CPU_VENDOR_CYRIX 0x1078 /* Cyrix */ +#define CPU_VENDOR_IDT 0x111d /* Centaur/IDT/VIA */ +#define CPU_VENDOR_TRANSMETA 0x1279 /* Transmeta */ +#define CPU_VENDOR_INTEL 0x8086 /* Intel */ +#define CPU_VENDOR_RISE 0xdead2bad /* Rise */ +#define CPU_VENDOR_CENTAUR CPU_VENDOR_IDT #ifndef LOCORE extern int cpu; Modified: stable/7/sys/i386/include/md_var.h ============================================================================== --- stable/7/sys/i386/include/md_var.h Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/i386/include/md_var.h Tue Jun 30 17:10:08 2009 (r195197) @@ -59,6 +59,7 @@ extern u_int cpu_mxcsr_mask; extern u_int cpu_procinfo; extern u_int cpu_procinfo2; extern char cpu_vendor[]; +extern u_int cpu_vendor_id; extern u_int cyrix_did; extern char kstack[]; extern char sigcode[]; Modified: stable/7/sys/i386/include/specialreg.h ============================================================================== --- stable/7/sys/i386/include/specialreg.h Tue Jun 30 15:23:16 2009 (r195196) +++ stable/7/sys/i386/include/specialreg.h Tue Jun 30 17:10:08 2009 (r195197) @@ -203,8 +203,16 @@ /* * CPUID manufacturers identifiers */ -#define INTEL_VENDOR_ID "GenuineIntel" -#define AMD_VENDOR_ID "AuthenticAMD" +#define AMD_VENDOR_ID "AuthenticAMD" +#define CENTAUR_VENDOR_ID "CentaurHauls" +#define CYRIX_VENDOR_ID "CyrixInstead" +#define INTEL_VENDOR_ID "GenuineIntel" +#define NEXGEN_VENDOR_ID "NexGenDriven" +#define NSC_VENDOR_ID "Geode by NSC" +#define RISE_VENDOR_ID "RiseRiseRise" +#define SIS_VENDOR_ID "SiS SiS SiS " +#define TRANSMETA_VENDOR_ID "GenuineTMx86" +#define UMC_VENDOR_ID "UMC UMC UMC " /* * Model-specific registers for the i386 family From owner-svn-src-stable@FreeBSD.ORG Tue Jun 30 17:19:11 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCEA5106566C; Tue, 30 Jun 2009 17:19:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA2FB8FC12; Tue, 30 Jun 2009 17:19:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5UHJBGn086973; Tue, 30 Jun 2009 17:19:11 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5UHJB1h086971; Tue, 30 Jun 2009 17:19:11 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906301719.n5UHJB1h086971@svn.freebsd.org> From: Andriy Gapon Date: Tue, 30 Jun 2009 17:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195198 - in stable/7/sys: . amd64/amd64 contrib/pf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2009 17:19:12 -0000 Author: avg Date: Tue Jun 30 17:19:11 2009 New Revision: 195198 URL: http://svn.freebsd.org/changeset/base/195198 Log: MFC 185460 (mav): improve invariant TSC detection for Intel CPUs Nod from: mav Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/identcpu.c stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/amd64/identcpu.c ============================================================================== --- stable/7/sys/amd64/amd64/identcpu.c Tue Jun 30 17:10:08 2009 (r195197) +++ stable/7/sys/amd64/amd64/identcpu.c Tue Jun 30 17:19:11 2009 (r195198) @@ -361,7 +361,11 @@ printcpuinfo(void) tsc_is_invariant = 1; break; case CPU_VENDOR_INTEL: - if (amd_pminfo & AMDPM_TSC_INVARIANT) + if ((amd_pminfo & AMDPM_TSC_INVARIANT) || + (AMD64_CPU_FAMILY(cpu_id) == 0x6 && + AMD64_CPU_MODEL(cpu_id) >= 0xe) || + (AMD64_CPU_FAMILY(cpu_id) == 0xf && + AMD64_CPU_MODEL(cpu_id) >= 0x3)) tsc_is_invariant = 1; break; } From owner-svn-src-stable@FreeBSD.ORG Tue Jun 30 17:27:54 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 321D8106566C; Tue, 30 Jun 2009 17:27:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FE808FC19; Tue, 30 Jun 2009 17:27:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5UHRs3Z087214; Tue, 30 Jun 2009 17:27:54 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5UHRsht087212; Tue, 30 Jun 2009 17:27:54 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200906301727.n5UHRsht087212@svn.freebsd.org> From: Andriy Gapon Date: Tue, 30 Jun 2009 17:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195199 - in stable/7/sys: . amd64/amd64 contrib/pf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2009 17:27:54 -0000 Author: avg Date: Tue Jun 30 17:27:53 2009 New Revision: 195199 URL: http://svn.freebsd.org/changeset/base/195199 Log: MFC 185561 (ganbold): Remove unused variable. Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/intr_machdep.c stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/amd64/intr_machdep.c ============================================================================== --- stable/7/sys/amd64/amd64/intr_machdep.c Tue Jun 30 17:19:11 2009 (r195198) +++ stable/7/sys/amd64/amd64/intr_machdep.c Tue Jun 30 17:27:53 2009 (r195199) @@ -239,11 +239,8 @@ void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame) { struct intr_event *ie; - struct thread *td; int vector; - td = curthread; - /* * We count software interrupts when we process them. The * code here follows previous practice, but there's an From owner-svn-src-stable@FreeBSD.ORG Wed Jul 1 08:43:06 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 249F21065672; Wed, 1 Jul 2009 08:43:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11C5F8FC15; Wed, 1 Jul 2009 08:43:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n618h5Ai006672; Wed, 1 Jul 2009 08:43:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n618h5Xm006670; Wed, 1 Jul 2009 08:43:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200907010843.n618h5Xm006670@svn.freebsd.org> From: Alexander Motin Date: Wed, 1 Jul 2009 08:43:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195232 - in stable/7/sys: . contrib/pf netgraph X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2009 08:43:06 -0000 Author: mav Date: Wed Jul 1 08:43:05 2009 New Revision: 195232 URL: http://svn.freebsd.org/changeset/base/195232 Log: MFC rev.194699: Mark ng_ether node hooks as HI_STACK. It is usually the last point when netgraph may unroll the call stack, and I have found that in some cases 2K guarantied there for i386 may be not enough for NIC driver and BPF. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/netgraph/ng_ether.c Modified: stable/7/sys/netgraph/ng_ether.c ============================================================================== --- stable/7/sys/netgraph/ng_ether.c Wed Jul 1 08:08:56 2009 (r195231) +++ stable/7/sys/netgraph/ng_ether.c Wed Jul 1 08:43:05 2009 (r195232) @@ -403,7 +403,7 @@ ng_ether_newhook(node_p node, hook_p hoo /* Disable hardware checksums while 'upper' hook is connected */ if (hookptr == &priv->upper) priv->ifp->if_hwassist = 0; - + NG_HOOK_HI_STACK(hook); /* OK */ *hookptr = hook; return (0); From owner-svn-src-stable@FreeBSD.ORG Wed Jul 1 12:44:23 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B991C1065673; Wed, 1 Jul 2009 12:44:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C3BA8FC19; Wed, 1 Jul 2009 12:44:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n61CiN89012916; Wed, 1 Jul 2009 12:44:23 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n61CiNVH012914; Wed, 1 Jul 2009 12:44:23 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200907011244.n61CiNVH012914@svn.freebsd.org> From: Andriy Gapon Date: Wed, 1 Jul 2009 12:44:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195236 - in stable/7/sys: . contrib/pf nfsserver X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2009 12:44:24 -0000 Author: avg Date: Wed Jul 1 12:44:23 2009 New Revision: 195236 URL: http://svn.freebsd.org/changeset/base/195236 Log: MFC 185586 (kan): Change nfsserver slightly so that it does not trip over the timestamp validation code on ZFS. This should fix O_CREAT|O_EXCL open on NFS where a server is 64-bit with v13 ZFS code. PR: kern/135412 Pointed out by: Jaakko Heinonen Tested by: Jaakko Heinonen, Danny Braniss Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/nfsserver/nfs_serv.c Modified: stable/7/sys/nfsserver/nfs_serv.c ============================================================================== --- stable/7/sys/nfsserver/nfs_serv.c Wed Jul 1 12:36:10 2009 (r195235) +++ stable/7/sys/nfsserver/nfs_serv.c Wed Jul 1 12:44:23 2009 (r195236) @@ -1656,13 +1656,12 @@ nfsrv_create(struct nfsrv_descript *nfsd caddr_t bpos; int error = 0, rdev, len, tsize, dirfor_ret = 1, diraft_ret = 1; int v3 = (nfsd->nd_flag & ND_NFSV3), how, exclusive_flag = 0; - caddr_t cp; struct mbuf *mb, *mreq; struct vnode *dirp = NULL; nfsfh_t nfh; fhandle_t *fhp; u_quad_t tempsize; - u_char cverf[NFSX_V3CREATEVERF]; + struct timespec cverf; struct mount *mp = NULL; int tvfslocked; int vfslocked; @@ -1741,8 +1740,11 @@ nfsrv_create(struct nfsrv_descript *nfsd nfsm_srvsattr(vap); break; case NFSV3CREATE_EXCLUSIVE: - cp = nfsm_dissect_nonblock(caddr_t, NFSX_V3CREATEVERF); - bcopy(cp, cverf, NFSX_V3CREATEVERF); + tl = nfsm_dissect_nonblock(u_int32_t *, + NFSX_V3CREATEVERF); + /* Unique bytes, endianness is not important. */ + cverf.tv_sec = tl[0]; + cverf.tv_nsec = tl[1]; exclusive_flag = 1; break; }; @@ -1788,8 +1790,7 @@ nfsrv_create(struct nfsrv_descript *nfsd if (exclusive_flag) { exclusive_flag = 0; VATTR_NULL(vap); - bcopy(cverf, (caddr_t)&vap->va_atime, - NFSX_V3CREATEVERF); + vap->va_atime = cverf; error = VOP_SETATTR(nd.ni_vp, vap, cred, td); } @@ -1873,7 +1874,7 @@ nfsrv_create(struct nfsrv_descript *nfsd } if (v3) { if (exclusive_flag && !error && - bcmp(cverf, (caddr_t)&vap->va_atime, NFSX_V3CREATEVERF)) + bcmp(&cverf, &vap->va_atime, sizeof (cverf))) error = EEXIST; if (dirp == nd.ni_dvp) diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td); From owner-svn-src-stable@FreeBSD.ORG Wed Jul 1 17:50:59 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8833E10656CA; Wed, 1 Jul 2009 17:50:59 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75BBF8FC1D; Wed, 1 Jul 2009 17:50:59 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n61Hox4u019740; Wed, 1 Jul 2009 17:50:59 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n61HoxPr019738; Wed, 1 Jul 2009 17:50:59 GMT (envelope-from np@svn.freebsd.org) Message-Id: <200907011750.n61HoxPr019738@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 1 Jul 2009 17:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195250 - stable/7/sys/dev/cxgb X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2009 17:51:00 -0000 Author: np Date: Wed Jul 1 17:50:59 2009 New Revision: 195250 URL: http://svn.freebsd.org/changeset/base/195250 Log: Fix cxgb's version checks in stable. This makes it select the correct buffer size for freelist1. Approved by: gnn (mentor) Modified: stable/7/sys/dev/cxgb/cxgb_sge.c Modified: stable/7/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- stable/7/sys/dev/cxgb/cxgb_sge.c Wed Jul 1 17:20:07 2009 (r195249) +++ stable/7/sys/dev/cxgb/cxgb_sge.c Wed Jul 1 17:50:59 2009 (r195250) @@ -375,7 +375,7 @@ t3_sge_prep(adapter_t *adap, struct sge_ while (!powerof2(fl_q_size)) fl_q_size--; -#if __FreeBSD_version > 700000 +#if __FreeBSD_version >= 700111 if (cxgb_use_16k_clusters) jumbo_q_size = min(nmbjumbo16/(3*nqsets), JUMBO_Q_SIZE); else @@ -2377,7 +2377,7 @@ t3_sge_alloc_qset(adapter_t *sc, u_int i q->fl[0].buf_size = (MCLBYTES - header_size); q->fl[0].zone = zone_clust; q->fl[0].type = EXT_CLUSTER; -#if __FreeBSD_version > 800000 +#if __FreeBSD_version >= 700111 if (cxgb_use_16k_clusters) { q->fl[1].buf_size = MJUM16BYTES - header_size; q->fl[1].zone = zone_jumbo16; From owner-svn-src-stable@FreeBSD.ORG Thu Jul 2 00:36:01 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DF971065697; Thu, 2 Jul 2009 00:36:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B5958FC14; Thu, 2 Jul 2009 00:36:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n620a0eG028509; Thu, 2 Jul 2009 00:36:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n620a06g028508; Thu, 2 Jul 2009 00:36:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200907020036.n620a06g028508@svn.freebsd.org> From: Xin LI Date: Thu, 2 Jul 2009 00:36:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195272 - in stable/7/usr.sbin/sysinstall: . help X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2009 00:36:01 -0000 Author: delphij Date: Thu Jul 2 00:36:00 2009 New Revision: 195272 URL: http://svn.freebsd.org/changeset/base/195272 Log: MFC r180208 (peter): Set magic fbsd:nokeywords property that allows files to bypass keyword expansion. (file-specific replacement for CVSROOT/exclude) Modified: stable/7/usr.sbin/sysinstall/ (props changed) stable/7/usr.sbin/sysinstall/help/anonftp.hlp (props changed) stable/7/usr.sbin/sysinstall/help/configure.hlp (props changed) stable/7/usr.sbin/sysinstall/help/distributions.hlp (props changed) stable/7/usr.sbin/sysinstall/help/drives.hlp (props changed) stable/7/usr.sbin/sysinstall/help/fixit.hlp (props changed) stable/7/usr.sbin/sysinstall/help/html.hlp (props changed) stable/7/usr.sbin/sysinstall/help/media.hlp (props changed) stable/7/usr.sbin/sysinstall/help/network_device.hlp (props changed) stable/7/usr.sbin/sysinstall/help/options.hlp (props changed) stable/7/usr.sbin/sysinstall/help/partition.hlp (props changed) stable/7/usr.sbin/sysinstall/help/securelevel.hlp (props changed) stable/7/usr.sbin/sysinstall/help/shortcuts.hlp (props changed) stable/7/usr.sbin/sysinstall/help/slice.hlp (props changed) stable/7/usr.sbin/sysinstall/help/tcp.hlp (props changed) stable/7/usr.sbin/sysinstall/help/usage.hlp (props changed) stable/7/usr.sbin/sysinstall/help/usermgmt.hlp (props changed) From owner-svn-src-stable@FreeBSD.ORG Thu Jul 2 00:39:25 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0AB0106564A; Thu, 2 Jul 2009 00:39:25 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE0DC8FC12; Thu, 2 Jul 2009 00:39:25 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n620dPrp028675; Thu, 2 Jul 2009 00:39:25 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n620dPMp028673; Thu, 2 Jul 2009 00:39:25 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200907020039.n620dPMp028673@svn.freebsd.org> From: Xin LI Date: Thu, 2 Jul 2009 00:39:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195273 - in stable/7/usr.sbin/sysinstall: . help X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2009 00:39:26 -0000 Author: delphij Date: Thu Jul 2 00:39:25 2009 New Revision: 195273 URL: http://svn.freebsd.org/changeset/base/195273 Log: MFC r195012: Correct a typo (which you can use to in order -> which you can use in order to). PR: bin/136040 Submitted by: "Vikentii L. Karabin" Modified: stable/7/usr.sbin/sysinstall/ (props changed) stable/7/usr.sbin/sysinstall/help/usage.hlp Modified: stable/7/usr.sbin/sysinstall/help/usage.hlp ============================================================================== --- stable/7/usr.sbin/sysinstall/help/usage.hlp Thu Jul 2 00:36:00 2009 (r195272) +++ stable/7/usr.sbin/sysinstall/help/usage.hlp Thu Jul 2 00:39:25 2009 (r195273) @@ -56,7 +56,7 @@ it's also useful when dealing with sub-s that don't use menus and tend to scroll their output off the top of the screen. -FreeBSD also supports multiple "virtual consoles" which you can use to +FreeBSD also supports multiple "virtual consoles" which you can use in order to have several active sessions at once. Use ALT-F to switch between screens, where `F' is the function key corresponding to the screen you wish to see. By default, the system comes with 8 From owner-svn-src-stable@FreeBSD.ORG Thu Jul 2 00:44:21 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABBAE10656BB; Thu, 2 Jul 2009 00:44:21 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98B9C8FC1D; Thu, 2 Jul 2009 00:44:21 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n620iLAX028935; Thu, 2 Jul 2009 00:44:21 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n620iLoD028934; Thu, 2 Jul 2009 00:44:21 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200907020044.n620iLoD028934@svn.freebsd.org> From: Xin LI Date: Thu, 2 Jul 2009 00:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195276 - in stable/6/usr.sbin/sysinstall: . help X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2009 00:44:22 -0000 Author: delphij Date: Thu Jul 2 00:44:21 2009 New Revision: 195276 URL: http://svn.freebsd.org/changeset/base/195276 Log: MFC r180208 (peter): Set magic fbsd:nokeywords property that allows files to bypass keyword expansion. (file-specific replacement for CVSROOT/exclude) Modified: stable/6/usr.sbin/sysinstall/ (props changed) stable/6/usr.sbin/sysinstall/help/anonftp.hlp (props changed) stable/6/usr.sbin/sysinstall/help/configure.hlp (props changed) stable/6/usr.sbin/sysinstall/help/distributions.hlp (props changed) stable/6/usr.sbin/sysinstall/help/drives.hlp (props changed) stable/6/usr.sbin/sysinstall/help/fixit.hlp (props changed) stable/6/usr.sbin/sysinstall/help/html.hlp (props changed) stable/6/usr.sbin/sysinstall/help/media.hlp (props changed) stable/6/usr.sbin/sysinstall/help/network_device.hlp (props changed) stable/6/usr.sbin/sysinstall/help/options.hlp (props changed) stable/6/usr.sbin/sysinstall/help/partition.hlp (props changed) stable/6/usr.sbin/sysinstall/help/securelevel.hlp (props changed) stable/6/usr.sbin/sysinstall/help/shortcuts.hlp (props changed) stable/6/usr.sbin/sysinstall/help/slice.hlp (props changed) stable/6/usr.sbin/sysinstall/help/tcp.hlp (props changed) stable/6/usr.sbin/sysinstall/help/usage.hlp (props changed) stable/6/usr.sbin/sysinstall/help/usermgmt.hlp (props changed) From owner-svn-src-stable@FreeBSD.ORG Thu Jul 2 00:45:29 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BC69106567A; Thu, 2 Jul 2009 00:45:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0990A8FC18; Thu, 2 Jul 2009 00:45:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n620jSIn029010; Thu, 2 Jul 2009 00:45:28 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n620jSi6029008; Thu, 2 Jul 2009 00:45:28 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200907020045.n620jSi6029008@svn.freebsd.org> From: Xin LI Date: Thu, 2 Jul 2009 00:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195277 - in stable/6/usr.sbin/sysinstall: . help X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2009 00:45:30 -0000 Author: delphij Date: Thu Jul 2 00:45:28 2009 New Revision: 195277 URL: http://svn.freebsd.org/changeset/base/195277 Log: MFC r195012: Correct a typo (which you can use to in order -> which you can use in order to). PR: bin/136040 Submitted by: "Vikentii L. Karabin" Modified: stable/6/usr.sbin/sysinstall/ (props changed) stable/6/usr.sbin/sysinstall/help/usage.hlp Modified: stable/6/usr.sbin/sysinstall/help/usage.hlp ============================================================================== --- stable/6/usr.sbin/sysinstall/help/usage.hlp Thu Jul 2 00:44:21 2009 (r195276) +++ stable/6/usr.sbin/sysinstall/help/usage.hlp Thu Jul 2 00:45:28 2009 (r195277) @@ -56,7 +56,7 @@ it's also useful when dealing with sub-s that don't use menus and tend to scroll their output off the top of the screen. -FreeBSD also supports multiple "virtual consoles" which you can use to +FreeBSD also supports multiple "virtual consoles" which you can use in order to have several active sessions at once. Use ALT-F to switch between screens, where `F' is the function key corresponding to the screen you wish to see. By default, the system comes with 8 From owner-svn-src-stable@FreeBSD.ORG Sat Jul 4 06:00:57 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA65C106566C; Sat, 4 Jul 2009 06:00:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B795A8FC17; Sat, 4 Jul 2009 06:00:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6460vCg000181; Sat, 4 Jul 2009 06:00:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6460vaU000179; Sat, 4 Jul 2009 06:00:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200907040600.n6460vaU000179@svn.freebsd.org> From: Alexander Motin Date: Sat, 4 Jul 2009 06:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195336 - in stable/7/sys: . contrib/pf netgraph X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jul 2009 06:00:58 -0000 Author: mav Date: Sat Jul 4 06:00:57 2009 New Revision: 195336 URL: http://svn.freebsd.org/changeset/base/195336 Log: MFC rev.195335: Fix infinite loop in ng_iface, that happens when packet passes out via two different ng interfaces sequentially due to tunnelling. PR: kern/134557 Submitted by: Mikolaj Golub Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/netgraph/ng_iface.c Modified: stable/7/sys/netgraph/ng_iface.c ============================================================================== --- stable/7/sys/netgraph/ng_iface.c Sat Jul 4 05:07:52 2009 (r195335) +++ stable/7/sys/netgraph/ng_iface.c Sat Jul 4 06:00:57 2009 (r195336) @@ -365,7 +365,8 @@ ng_iface_output(struct ifnet *ifp, struc } /* Protect from deadly infinite recursion. */ - while ((mtag = m_tag_locate(m, MTAG_NGIF, MTAG_NGIF_CALLED, NULL))) { + mtag = NULL; + while ((mtag = m_tag_locate(m, MTAG_NGIF, MTAG_NGIF_CALLED, mtag))) { if (*(struct ifnet **)(mtag + 1) == ifp) { log(LOG_NOTICE, "Loop detected on %s\n", ifp->if_xname); m_freem(m);