From owner-svn-src-stable@FreeBSD.ORG Mon Jul 13 15:32:41 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 DF281106564A; Mon, 13 Jul 2009 15:32:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id ACE6A8FC21; Mon, 13 Jul 2009 15:32:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 6129246B37; Mon, 13 Jul 2009 11:32:41 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 1CECB8A096; Mon, 13 Jul 2009 11:32:40 -0400 (EDT) From: John Baldwin To: Brian Somers Date: Mon, 13 Jul 2009 11:18:59 -0400 User-Agent: KMail/1.9.7 References: <200907090912.n699CGx0077581@svn.freebsd.org> <200907092235.18828.max@love2party.net> <20090710013243.68775e75@dev.lan.Awfulhak.org> In-Reply-To: <20090710013243.68775e75@dev.lan.Awfulhak.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907131119.00579.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 13 Jul 2009 11:32:40 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-stable-7@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov , Max Laier Subject: Re: svn commit: r195485 - in stable/7/sys: . contrib/pf kern 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: Mon, 13 Jul 2009 15:32:42 -0000 On Friday 10 July 2009 4:32:43 am Brian Somers wrote: > we might need to import it in two pieces so that we can maintain the > contrib/some-package part of the hierarchy when merging sys/, even > though the other two hierarchies can be merged directly into src/etc > and usr.bin/program directly. We actually already have that split up since vendor and vendor-sys are separate. However, I think the idea was to try to keep the trees under vendor and vendor-sys as pristine as possible. > However, the bit that I don't understand about the original commit and > its update of the contrib/pf mergeinfo is why it's updated at all by svn > - it just seems wrong. When I do: > > cd svn/stable/7/sys > svn merge -c NNNNN ^/head/sys > > given that change NNNNN has nothing to do with pf, I don't understand > why subversion updates stable/7/sys/contrib/pf's mergeinfo. Is the > "special" thing about sys/contrib/pf just that it already has mergeinfo > associated with it? And if so, why does that make it special. Surely > having NNNNN in sys's mergeinfo implies that it's been merged to > every part beneath sys. No, mergeinfo is _not_ inherited, so the mergeinfo for sys/ has to be duplicated in sys/contrib/pf. -- John Baldwin From owner-svn-src-stable@FreeBSD.ORG Mon Jul 13 16:36:04 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 EFD38106566B; Mon, 13 Jul 2009 16:36:04 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC3308FC1A; Mon, 13 Jul 2009 16:36:04 +0000 (UTC) (envelope-from rpaulo@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 n6DGa4TS030093; Mon, 13 Jul 2009 16:36:04 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6DGa4mT030091; Mon, 13 Jul 2009 16:36:04 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200907131636.n6DGa4mT030091@svn.freebsd.org> From: Rui Paulo Date: Mon, 13 Jul 2009 16:36:04 +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: r195657 - in stable/7/sys: . boot/i386/libi386 contrib/pf geom/label 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: Mon, 13 Jul 2009 16:36:05 -0000 Author: rpaulo Date: Mon Jul 13 16:36:04 2009 New Revision: 195657 URL: http://svn.freebsd.org/changeset/base/195657 Log: MFC r195045: On special systems where the MBR and the GPT are in sync (up to the 4th slicei, Apple EFI hardware), the bootloader will fail to recognize the GPT if it finds anything else but the EFI partition. Change the check to continue detecting the GPT by looking at the EFI partition on the MBR but stopping successfuly after finding it. PR: kern/134590 Submitted by: Christoph Langguth Reviewed by: jhb Modified: stable/7/sys/ (props changed) stable/7/sys/boot/i386/libi386/biosdisk.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/geom/label/ (props changed) stable/7/sys/geom/label/g_label.c (props changed) Modified: stable/7/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- stable/7/sys/boot/i386/libi386/biosdisk.c Mon Jul 13 12:53:43 2009 (r195656) +++ stable/7/sys/boot/i386/libi386/biosdisk.c Mon Jul 13 16:36:04 2009 (r195657) @@ -888,7 +888,7 @@ bd_open_gpt(struct open_disk *od, struct for (i = 0; i < NDOSPART; i++) { if (dp[i].dp_typ == 0xee) part++; - else if (dp[i].dp_typ != 0x00) + else if ((part != 1) && (dp[i].dp_typ != 0x00)) return (EINVAL); } if (part != 1) From owner-svn-src-stable@FreeBSD.ORG Mon Jul 13 17:46:17 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 B2FC91065677; Mon, 13 Jul 2009 17:46:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85B058FC18; Mon, 13 Jul 2009 17:46:17 +0000 (UTC) (envelope-from jhb@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 n6DHkHqf031495; Mon, 13 Jul 2009 17:46:17 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6DHkHx6031494; Mon, 13 Jul 2009 17:46:17 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200907131746.n6DHkHx6031494@svn.freebsd.org> From: John Baldwin Date: Mon, 13 Jul 2009 17:46:17 +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: r195658 - in stable/7/sys: . contrib/pf geom/label 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: Mon, 13 Jul 2009 17:46:18 -0000 Author: jhb Date: Mon Jul 13 17:46:17 2009 New Revision: 195658 URL: http://svn.freebsd.org/changeset/base/195658 Log: Move the mergeinfo for 195617 up to sys/. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/geom/label/ (props changed) stable/7/sys/geom/label/g_label.c (props changed) From owner-svn-src-stable@FreeBSD.ORG Mon Jul 13 22:13:14 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 10E551065673; Mon, 13 Jul 2009 22:13:14 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F024C8FC18; Mon, 13 Jul 2009 22:13:13 +0000 (UTC) (envelope-from jkim@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 n6DMDDst037165; Mon, 13 Jul 2009 22:13:13 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6DMDDWb037150; Mon, 13 Jul 2009 22:13:13 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200907132213.n6DMDDWb037150@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 13 Jul 2009 22:13:13 +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: r195667 - in stable/7/sys: . amd64/amd64 amd64/include boot/i386/libi386 compat/linprocfs conf contrib/pf i386/cpufreq i386/i386 modules/agp pci 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: Mon, 13 Jul 2009 22:13:14 -0000 Author: jkim Date: Mon Jul 13 22:13:13 2009 New Revision: 195667 URL: http://svn.freebsd.org/changeset/base/195667 Log: MFC: Replace remaining cpu_vendor with cpu_vendor_id and add basic VIA Nano processor support for amd64 and i386. r186797 - Add Centaur/IDT/VIA vendor ID for Nano family. r187101 - Allow VIA Nano processors to boot FreeBSD/amd64. r187117 - Replace more cpu_vendor with cpu_vendor_id. r187118 - Add basic i386 support for VIA Nano processors. r187157 - Enable MSI support for VIA Nano processors on i386. r187594 - Replace more cpu_vendor with cpu_vendor_id. r187597 - Include a missing header file. r187598 - VIA Nano processor has P-state invariant TSC. r187633 - Add more VIA bridges to agp_via.c. Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/identcpu.c stable/7/sys/amd64/include/cputypes.h stable/7/sys/amd64/include/specialreg.h stable/7/sys/boot/i386/libi386/bootinfo64.c stable/7/sys/compat/linprocfs/linprocfs.c stable/7/sys/conf/files.amd64 stable/7/sys/contrib/pf/ (props changed) stable/7/sys/i386/cpufreq/est.c stable/7/sys/i386/cpufreq/smist.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/msi.c stable/7/sys/modules/agp/Makefile stable/7/sys/pci/agp_via.c Modified: stable/7/sys/amd64/amd64/identcpu.c ============================================================================== --- stable/7/sys/amd64/amd64/identcpu.c Mon Jul 13 21:36:31 2009 (r195666) +++ stable/7/sys/amd64/amd64/identcpu.c Mon Jul 13 22:13:13 2009 (r195667) @@ -102,6 +102,7 @@ static struct { } cpu_vendors[] = { { INTEL_VENDOR_ID, CPU_VENDOR_INTEL }, /* GenuineIntel */ { AMD_VENDOR_ID, CPU_VENDOR_AMD }, /* AuthenticAMD */ + { CENTAUR_VENDOR_ID, CPU_VENDOR_CENTAUR }, /* CentaurHauls */ }; void @@ -368,6 +369,12 @@ printcpuinfo(void) AMD64_CPU_MODEL(cpu_id) >= 0x3)) tsc_is_invariant = 1; break; + case CPU_VENDOR_CENTAUR: + if (AMD64_CPU_FAMILY(cpu_id) == 0x6 && + AMD64_CPU_MODEL(cpu_id) >= 0xf && + (rdmsr(0x1203) & 0x100000000ULL) == 0) + tsc_is_invariant = 1; + break; } if (tsc_is_invariant) printf("\n TSC: P-state invariant"); Modified: stable/7/sys/amd64/include/cputypes.h ============================================================================== --- stable/7/sys/amd64/include/cputypes.h Mon Jul 13 21:36:31 2009 (r195666) +++ stable/7/sys/amd64/include/cputypes.h Mon Jul 13 22:13:13 2009 (r195667) @@ -47,7 +47,9 @@ * Vendors of processor. */ #define CPU_VENDOR_AMD 0x1022 /* AMD */ +#define CPU_VENDOR_IDT 0x111d /* Centaur/IDT/VIA */ #define CPU_VENDOR_INTEL 0x8086 /* Intel */ +#define CPU_VENDOR_CENTAUR CPU_VENDOR_IDT #ifndef LOCORE extern int cpu; Modified: stable/7/sys/amd64/include/specialreg.h ============================================================================== --- stable/7/sys/amd64/include/specialreg.h Mon Jul 13 21:36:31 2009 (r195666) +++ stable/7/sys/amd64/include/specialreg.h Mon Jul 13 22:13:13 2009 (r195667) @@ -205,6 +205,7 @@ * CPUID manufacturers identifiers */ #define AMD_VENDOR_ID "AuthenticAMD" +#define CENTAUR_VENDOR_ID "CentaurHauls" #define INTEL_VENDOR_ID "GenuineIntel" /* Modified: stable/7/sys/boot/i386/libi386/bootinfo64.c ============================================================================== --- stable/7/sys/boot/i386/libi386/bootinfo64.c Mon Jul 13 21:36:31 2009 (r195666) +++ stable/7/sys/boot/i386/libi386/bootinfo64.c Mon Jul 13 22:13:13 2009 (r195667) @@ -150,8 +150,9 @@ bi_checkcpu(void) cpu_vendor = (char *)vendor; /* Check for vendors that support AMD features. */ - if (strncmp(cpu_vendor, "GenuineIntel", 12) != 0 && - strncmp(cpu_vendor, "AuthenticAMD", 12) != 0) + if (strncmp(cpu_vendor, INTEL_VENDOR_ID, 12) != 0 && + strncmp(cpu_vendor, AMD_VENDOR_ID, 12) != 0 && + strncmp(cpu_vendor, CENTAUR_VENDOR_ID, 12) != 0) return (0); /* Has to support AMD features. */ Modified: stable/7/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/7/sys/compat/linprocfs/linprocfs.c Mon Jul 13 21:36:31 2009 (r195666) +++ stable/7/sys/compat/linprocfs/linprocfs.c Mon Jul 13 22:13:13 2009 (r195667) @@ -273,11 +273,17 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) sbuf_cat(sb, "flags\t\t:"); - if (!strcmp(cpu_vendor, "AuthenticAMD") && (class < 6)) { - flags[16] = "fcmov"; - } else if (!strcmp(cpu_vendor, "CyrixInstead")) { +#ifdef __i386__ + switch (cpu_vendor_id) { + case CPU_VENDOR_AMD: + if (class < 6) + flags[16] = "fcmov"; + break; + case CPU_VENDOR_CYRIX: flags[24] = "cxmmx"; + break; } +#endif for (i = 0; i < 32; i++) if (cpu_feature & (1 << i)) Modified: stable/7/sys/conf/files.amd64 ============================================================================== --- stable/7/sys/conf/files.amd64 Mon Jul 13 21:36:31 2009 (r195666) +++ stable/7/sys/conf/files.amd64 Mon Jul 13 22:13:13 2009 (r195667) @@ -205,6 +205,7 @@ kern/link_elf_obj.c standard pci/agp_amd64.c optional agp pci/agp_i810.c optional agp pci/agp_intel.c optional agp +pci/agp_via.c optional agp # # IA32 binary support # Modified: stable/7/sys/i386/cpufreq/est.c ============================================================================== --- stable/7/sys/i386/cpufreq/est.c Mon Jul 13 21:36:31 2009 (r195666) +++ stable/7/sys/i386/cpufreq/est.c Mon Jul 13 22:13:13 2009 (r195667) @@ -55,10 +55,6 @@ __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; Modified: stable/7/sys/i386/cpufreq/smist.c ============================================================================== --- stable/7/sys/i386/cpufreq/smist.c Mon Jul 13 21:36:31 2009 (r195666) +++ stable/7/sys/i386/cpufreq/smist.c Mon Jul 13 22:13:13 2009 (r195667) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -285,7 +286,7 @@ smist_identify(driver_t *driver, device_ return; /* Check for a supported processor */ - if (strcmp(cpu_vendor, "GenuineIntel") != 0) + if (cpu_vendor_id != CPU_VENDOR_INTEL) return; switch (cpu_id & 0xff0) { case 0x680: /* Pentium III [coppermine] */ Modified: stable/7/sys/i386/i386/i686_mem.c ============================================================================== --- stable/7/sys/i386/i386/i686_mem.c Mon Jul 13 21:36:31 2009 (r195666) +++ stable/7/sys/i386/i386/i686_mem.c Mon Jul 13 22:13:13 2009 (r195667) @@ -678,9 +678,17 @@ i686_mem_drvinit(void *unused) return; if ((cpu_id & 0xf00) != 0x600 && (cpu_id & 0xf00) != 0xf00) return; - if (cpu_vendor_id != CPU_VENDOR_INTEL && - cpu_vendor_id != CPU_VENDOR_AMD) + switch (cpu_vendor_id) { + case CPU_VENDOR_INTEL: + case CPU_VENDOR_AMD: + break; + case CPU_VENDOR_CENTAUR: + if (cpu_exthigh >= 0x80000008) + break; + /* FALLTHROUGH */ + default: return; + } mem_range_softc.mr_op = &i686_mrops; } SYSINIT(i686memdev, SI_SUB_DRIVERS, SI_ORDER_FIRST, i686_mem_drvinit, NULL); Modified: stable/7/sys/i386/i386/identcpu.c ============================================================================== --- stable/7/sys/i386/i386/identcpu.c Mon Jul 13 21:36:31 2009 (r195666) +++ stable/7/sys/i386/i386/identcpu.c Mon Jul 13 22:13:13 2009 (r195667) @@ -603,6 +603,9 @@ printcpuinfo(void) case 0x6d0: strcpy(cpu_model, "VIA C7 Esther"); break; + case 0x6f0: + strcpy(cpu_model, "VIA Nano"); + break; default: strcpy(cpu_model, "VIA/IDT Unknown"); } @@ -853,6 +856,9 @@ printcpuinfo(void) ); } + if (cpu_vendor_id == CPU_VENDOR_CENTAUR) + print_via_padlock_info(); + if ((cpu_feature & CPUID_HTT) && cpu_vendor_id == CPU_VENDOR_AMD) cpu_feature &= ~CPUID_HTT; @@ -872,6 +878,12 @@ printcpuinfo(void) if (amd_pminfo & AMDPM_TSC_INVARIANT) tsc_is_invariant = 1; break; + case CPU_VENDOR_CENTAUR: + if (I386_CPU_FAMILY(cpu_id) == 0x6 && + I386_CPU_MODEL(cpu_id) >= 0xf && + (rdmsr(0x1203) & 0x100000000ULL) == 0) + tsc_is_invariant = 1; + break; } if (tsc_is_invariant) printf("\n TSC: P-state invariant"); @@ -906,8 +918,6 @@ printcpuinfo(void) printf("\n CPU cache: write-through mode"); #endif } - if (cpu_vendor_id == CPU_VENDOR_CENTAUR) - print_via_padlock_info(); /* Avoid ugly blank lines: only print newline when we have to. */ if (*cpu_vendor || cpu_id) @@ -1559,6 +1569,7 @@ print_via_padlock_info(void) return; case 0x6a0: case 0x6d0: + case 0x6f0: break; default: return; Modified: stable/7/sys/i386/i386/initcpu.c ============================================================================== --- stable/7/sys/i386/i386/initcpu.c Mon Jul 13 21:36:31 2009 (r195666) +++ stable/7/sys/i386/i386/initcpu.c Mon Jul 13 22:13:13 2009 (r195667) @@ -650,7 +650,7 @@ initializecpu(void) init_6x86MX(); break; case CPU_686: - if (strcmp(cpu_vendor, "GenuineIntel") == 0) { + if (cpu_vendor_id == CPU_VENDOR_INTEL) { switch (cpu_id & 0xff0) { case 0x610: init_ppro(); @@ -659,7 +659,7 @@ initializecpu(void) init_mendocino(); break; } - } else if (strcmp(cpu_vendor, "AuthenticAMD") == 0) { + } else if (cpu_vendor_id == CPU_VENDOR_AMD) { #if defined(I686_CPU) && defined(CPU_ATHLON_SSE_HACK) /* * Sometimes the BIOS doesn't enable SSE instructions. @@ -678,7 +678,7 @@ initializecpu(void) cpu_feature = regs[3]; } #endif - } else if (strcmp(cpu_vendor, "CentaurHauls") == 0) { + } else if (cpu_vendor_id == CPU_VENDOR_CENTAUR) { switch (cpu_id & 0xff0) { case 0x690: if ((cpu_id & 0xf) < 3) @@ -686,6 +686,7 @@ initializecpu(void) /* fall through. */ case 0x6a0: case 0x6d0: + case 0x6f0: init_via(); break; default: @@ -718,7 +719,7 @@ initializecpu(void) * CPU_UPGRADE_HW_CACHE option in your kernel configuration file. * This option eliminates unneeded cache flush instruction(s). */ - if (strcmp(cpu_vendor, "CyrixInstead") == 0) { + if (cpu_vendor_id == CPU_VENDOR_CYRIX) { switch (cpu) { #ifdef I486_CPU case CPU_486DLC: @@ -737,7 +738,7 @@ initializecpu(void) default: break; } - } else if (strcmp(cpu_vendor, "AuthenticAMD") == 0) { + } else if (cpu_vendor_id == CPU_VENDOR_AMD) { switch (cpu_id & 0xFF0) { case 0x470: /* Enhanced Am486DX2 WB */ case 0x490: /* Enhanced Am486DX4 WB */ @@ -745,7 +746,7 @@ initializecpu(void) need_pre_dma_flush = 1; break; } - } else if (strcmp(cpu_vendor, "IBM") == 0) { + } else if (cpu_vendor_id == CPU_VENDOR_IBM) { need_post_dma_flush = 1; } else { #ifdef CPU_I486_ON_386 @@ -941,7 +942,7 @@ DB_SHOW_COMMAND(cyrixreg, cyrixreg) u_char ccr0 = 0, ccr4 = 0, ccr5 = 0, pcr0 = 0; cr0 = rcr0(); - if (strcmp(cpu_vendor,"CyrixInstead") == 0) { + if (cpu_vendor_id == CPU_VENDOR_CYRIX) { eflags = read_eflags(); disable_intr(); Modified: stable/7/sys/i386/i386/msi.c ============================================================================== --- stable/7/sys/i386/i386/msi.c Mon Jul 13 21:36:31 2009 (r195666) +++ stable/7/sys/i386/i386/msi.c Mon Jul 13 22:13:13 2009 (r195667) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* Fields in address for Intel MSI messages. */ @@ -212,9 +213,18 @@ msi_init(void) { /* Check if we have a supported CPU. */ - if (!(cpu_vendor_id == CPU_VENDOR_INTEL || - cpu_vendor_id == CPU_VENDOR_AMD)) + switch (cpu_vendor_id) { + case CPU_VENDOR_INTEL: + case CPU_VENDOR_AMD: + break; + case CPU_VENDOR_CENTAUR: + if (I386_CPU_FAMILY(cpu_id) == 0x6 && + I386_CPU_MODEL(cpu_id) >= 0xf) + break; + /* FALLTHROUGH */ + default: return; + } msi_enabled = 1; intr_register_pic(&msi_pic); Modified: stable/7/sys/modules/agp/Makefile ============================================================================== --- stable/7/sys/modules/agp/Makefile Mon Jul 13 21:36:31 2009 (r195666) +++ stable/7/sys/modules/agp/Makefile Mon Jul 13 22:13:13 2009 (r195667) @@ -12,7 +12,7 @@ SRCS+= agp_i810.c agp_intel.c agp_via.c SRCS+= agp_amd64.c .endif .if ${MACHINE_ARCH} == "amd64" -SRCS+= agp_amd64.c agp_i810.c +SRCS+= agp_amd64.c agp_i810.c agp_via.c .endif SRCS+= device_if.h bus_if.h agp_if.h pci_if.h SRCS+= opt_bus.h Modified: stable/7/sys/pci/agp_via.c ============================================================================== --- stable/7/sys/pci/agp_via.c Mon Jul 13 21:36:31 2009 (r195666) +++ stable/7/sys/pci/agp_via.c Mon Jul 13 22:13:13 2009 (r195667) @@ -85,8 +85,14 @@ agp_via_match(device_t dev) return ("VIA 3296 (P4M800) host to PCI bridge"); case 0x03051106: return ("VIA 82C8363 (Apollo KT133x/KM133) host to PCI bridge"); + case 0x03141106: + return ("VIA 3314 (P4M800CE) host to PCI bridge"); case 0x03241106: return ("VIA VT3324 (CX700) host to PCI bridge"); + case 0x03271106: + return ("VIA 3327 (P4M890) host to PCI bridge"); + case 0x03641106: + return ("VIA 3364 (P4M900) host to PCI bridge"); case 0x03911106: return ("VIA 8371 (Apollo KX133) host to PCI bridge"); case 0x05011106: @@ -168,7 +174,10 @@ agp_via_attach(device_t dev) case 0x02591106: case 0x02691106: case 0x02961106: + case 0x03141106: case 0x03241106: + case 0x03271106: + case 0x03641106: case 0x31231106: case 0x31681106: case 0x31891106: From owner-svn-src-stable@FreeBSD.ORG Tue Jul 14 14:56:02 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 25B46106564A; Tue, 14 Jul 2009 14:56:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 131478FC13; Tue, 14 Jul 2009 14:56:02 +0000 (UTC) (envelope-from jhb@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 n6EEu1ws062936; Tue, 14 Jul 2009 14:56:01 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6EEu1du062934; Tue, 14 Jul 2009 14:56:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200907141456.n6EEu1du062934@svn.freebsd.org> From: John Baldwin Date: Tue, 14 Jul 2009 14:56:01 +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: r195679 - in stable/7/sys: . contrib/pf dev/pci 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, 14 Jul 2009 14:56:02 -0000 Author: jhb Date: Tue Jul 14 14:56:01 2009 New Revision: 195679 URL: http://svn.freebsd.org/changeset/base/195679 Log: MFC: Enable MSI in the MSI capability registers any time that the first message in an MSI group is enabled, not just if the address/data pair are not initialized. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/pci/pci.c Modified: stable/7/sys/dev/pci/pci.c ============================================================================== --- stable/7/sys/dev/pci/pci.c Tue Jul 14 14:41:48 2009 (r195678) +++ stable/7/sys/dev/pci/pci.c Tue Jul 14 14:56:01 2009 (r195679) @@ -2869,8 +2869,10 @@ pci_setup_intr(device_t dev, device_t ch goto bad; dinfo->cfg.msi.msi_addr = addr; dinfo->cfg.msi.msi_data = data; - pci_enable_msi(child, addr, data); } + if (dinfo->cfg.msi.msi_handlers == 0) + pci_enable_msi(child, dinfo->cfg.msi.msi_addr, + dinfo->cfg.msi.msi_data); dinfo->cfg.msi.msi_handlers++; } else { KASSERT(dinfo->cfg.msix.msix_alloc > 0, From owner-svn-src-stable@FreeBSD.ORG Tue Jul 14 15:06: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 59F201065691; Tue, 14 Jul 2009 15:06:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43C0D8FC14; Tue, 14 Jul 2009 15:06:59 +0000 (UTC) (envelope-from jhb@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 n6EF6xfR063191; Tue, 14 Jul 2009 15:06:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6EF6xEE063189; Tue, 14 Jul 2009 15:06:59 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200907141506.n6EF6xEE063189@svn.freebsd.org> From: John Baldwin Date: Tue, 14 Jul 2009 15:06:59 +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: r195680 - in stable/6/sys: . contrib/pf dev/cxgb dev/pci 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, 14 Jul 2009 15:07:01 -0000 Author: jhb Date: Tue Jul 14 15:06:58 2009 New Revision: 195680 URL: http://svn.freebsd.org/changeset/base/195680 Log: MFC: Enable MSI in the MSI capability registers any time that the first message in an MSI group is enabled, not just if the address/data pair are not initialized. Modified: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) stable/6/sys/dev/pci/pci.c Modified: stable/6/sys/dev/pci/pci.c ============================================================================== --- stable/6/sys/dev/pci/pci.c Tue Jul 14 14:56:01 2009 (r195679) +++ stable/6/sys/dev/pci/pci.c Tue Jul 14 15:06:58 2009 (r195680) @@ -2221,8 +2221,10 @@ pci_setup_intr(device_t dev, device_t ch goto bad; dinfo->cfg.msi.msi_addr = addr; dinfo->cfg.msi.msi_data = data; - pci_enable_msi(child, addr, data); } + if (dinfo->cfg.msi.msi_handlers == 0) + pci_enable_msi(child, dinfo->cfg.msi.msi_addr, + dinfo->cfg.msi.msi_data); dinfo->cfg.msi.msi_handlers++; } else { KASSERT(dinfo->cfg.msix.msix_alloc > 0, From owner-svn-src-stable@FreeBSD.ORG Tue Jul 14 15:16:40 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 0034A1065674; Tue, 14 Jul 2009 15:16:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1E278FC13; Tue, 14 Jul 2009 15:16:39 +0000 (UTC) (envelope-from jhb@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 n6EFGdx9063428; Tue, 14 Jul 2009 15:16:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6EFGdRD063426; Tue, 14 Jul 2009 15:16:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200907141516.n6EFGdRD063426@svn.freebsd.org> From: John Baldwin Date: Tue, 14 Jul 2009 15:16:39 +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: r195681 - in stable/7/sys: . contrib/pf kern 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, 14 Jul 2009 15:16:40 -0000 Author: jhb Date: Tue Jul 14 15:16:39 2009 New Revision: 195681 URL: http://svn.freebsd.org/changeset/base/195681 Log: MFC: Return errors from intr_event_bind() to the caller of intr_set_affinity(). Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/kern/kern_intr.c Modified: stable/7/sys/kern/kern_intr.c ============================================================================== --- stable/7/sys/kern/kern_intr.c Tue Jul 14 15:06:58 2009 (r195680) +++ stable/7/sys/kern/kern_intr.c Tue Jul 14 15:16:39 2009 (r195681) @@ -373,8 +373,7 @@ intr_setaffinity(int irq, void *m) ie = intr_lookup(irq); if (ie == NULL) return (ESRCH); - intr_event_bind(ie, cpu); - return (0); + return (intr_event_bind(ie, cpu)); } int From owner-svn-src-stable@FreeBSD.ORG Tue Jul 14 15:26:42 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 AB25E106564A; Tue, 14 Jul 2009 15:26:42 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from gizmo.2hip.net (gizmo.2hip.net [64.74.207.195]) by mx1.freebsd.org (Postfix) with ESMTP id 4A8388FC12; Tue, 14 Jul 2009 15:26:42 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from [192.168.1.4] (adsl-154-199-204.ard.bellsouth.net [72.154.199.204]) (authenticated bits=0) by gizmo.2hip.net (8.14.3/8.14.3) with ESMTP id n6EF4iQP069702 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 14 Jul 2009 11:04:45 -0400 (EDT) (envelope-from rnoland@FreeBSD.org) From: Robert Noland To: John Baldwin In-Reply-To: <200907141456.n6EEu1du062934@svn.freebsd.org> References: <200907141456.n6EEu1du062934@svn.freebsd.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-F/l7SUirLr6zh0DZZy/M" Organization: FreeBSD Date: Tue, 14 Jul 2009 10:04:39 -0500 Message-Id: <1247583879.1745.24.camel@balrog.2hip.net> Mime-Version: 1.0 X-Mailer: Evolution 2.26.2 FreeBSD GNOME Team Port X-Spam-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_PBL, RCVD_IN_SORBS_DUL, RDNS_DYNAMIC, SPF_SOFTFAIL autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on gizmo.2hip.net Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r195679 - in stable/7/sys: . contrib/pf dev/pci 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, 14 Jul 2009 15:26:43 -0000 --=-F/l7SUirLr6zh0DZZy/M Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2009-07-14 at 14:56 +0000, John Baldwin wrote: > Author: jhb > Date: Tue Jul 14 14:56:01 2009 > New Revision: 195679 > URL: http://svn.freebsd.org/changeset/base/195679 >=20 > Log: > MFC: Enable MSI in the MSI capability registers any time that the first > message in an MSI group is enabled, not just if the address/data pair a= re > not initialized. With this MFC, Intel drm on 965+ chipsets should suck substantially less than before. i.e. This should fix interrupts after a VT Switch issue. I'll follow on and MFC the rest of the changes from HEAD in the next day or so. robert. > Modified: > stable/7/sys/ (props changed) > stable/7/sys/contrib/pf/ (props changed) > stable/7/sys/dev/pci/pci.c >=20 > Modified: stable/7/sys/dev/pci/pci.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/7/sys/dev/pci/pci.c Tue Jul 14 14:41:48 2009 (r195678) > +++ stable/7/sys/dev/pci/pci.c Tue Jul 14 14:56:01 2009 (r195679) > @@ -2869,8 +2869,10 @@ pci_setup_intr(device_t dev, device_t ch > goto bad; > dinfo->cfg.msi.msi_addr =3D addr; > dinfo->cfg.msi.msi_data =3D data; > - pci_enable_msi(child, addr, data); > } > + if (dinfo->cfg.msi.msi_handlers =3D=3D 0) > + pci_enable_msi(child, dinfo->cfg.msi.msi_addr, > + dinfo->cfg.msi.msi_data); > dinfo->cfg.msi.msi_handlers++; > } else { > KASSERT(dinfo->cfg.msix.msix_alloc > 0, --=20 Robert Noland FreeBSD --=-F/l7SUirLr6zh0DZZy/M Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iEYEABECAAYFAkpcnocACgkQM4TrQ4qfROO++wCfSNn5PmM6Fd9B0mZTgO20MCDb 9OkAnjEStI/j84WhiKKXKlNn2k5La5Mv =GrSP -----END PGP SIGNATURE----- --=-F/l7SUirLr6zh0DZZy/M-- From owner-svn-src-stable@FreeBSD.ORG Tue Jul 14 15:31:00 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 411E2106566C; Tue, 14 Jul 2009 15:31:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EA418FC13; Tue, 14 Jul 2009 15:31:00 +0000 (UTC) (envelope-from jhb@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 n6EFV0SQ063725; Tue, 14 Jul 2009 15:31:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6EFV03F063723; Tue, 14 Jul 2009 15:31:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200907141531.n6EFV03F063723@svn.freebsd.org> From: John Baldwin Date: Tue, 14 Jul 2009 15:31: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: r195682 - stable/7/usr.sbin/sysinstall 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, 14 Jul 2009 15:31:00 -0000 Author: jhb Date: Tue Jul 14 15:30:59 2009 New Revision: 195682 URL: http://svn.freebsd.org/changeset/base/195682 Log: MFC: Raise the default size of the EFI partition on ia64 from 100MB to 400MB. Modified: stable/7/usr.sbin/sysinstall/ (props changed) stable/7/usr.sbin/sysinstall/label.c Modified: stable/7/usr.sbin/sysinstall/label.c ============================================================================== --- stable/7/usr.sbin/sysinstall/label.c Tue Jul 14 15:16:39 2009 (r195681) +++ stable/7/usr.sbin/sysinstall/label.c Tue Jul 14 15:30:59 2009 (r195682) @@ -1410,7 +1410,7 @@ try_auto_label(Device **devs, Device *de #ifdef __ia64__ AutoEfi = NULL; if (EfiChunk == NULL) { - sz = 100 * ONE_MEG; + sz = 400 * ONE_MEG; AutoEfi = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, sz, efi, 0, 0); if (AutoEfi == NULL) { From owner-svn-src-stable@FreeBSD.ORG Tue Jul 14 17:37: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 BB5191065674; Tue, 14 Jul 2009 17:37:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A69358FC27; Tue, 14 Jul 2009 17:37:59 +0000 (UTC) (envelope-from jkim@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 n6EHbxrR066469; Tue, 14 Jul 2009 17:37:59 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6EHbxrN066458; Tue, 14 Jul 2009 17:37:59 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200907141737.n6EHbxrN066458@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 14 Jul 2009 17:37: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: r195686 - in stable/7/sys: . amd64/amd64 amd64/include conf contrib/pf crypto/via modules 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, 14 Jul 2009 17:38:00 -0000 Author: jkim Date: Tue Jul 14 17:37:59 2009 New Revision: 195686 URL: http://svn.freebsd.org/changeset/base/195686 Log: MFC: r187109, r187112 r187109 - Add basic amd64 support for VIA Nano processors. r187112 - Connect padlock(4) to amd64 build for VIA Nano processors. 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/msi.c stable/7/sys/amd64/include/md_var.h stable/7/sys/amd64/include/specialreg.h stable/7/sys/conf/files.amd64 stable/7/sys/contrib/pf/ (props changed) stable/7/sys/crypto/via/padlock.c stable/7/sys/crypto/via/padlock_hash.c stable/7/sys/modules/Makefile Modified: stable/7/sys/amd64/amd64/amd64_mem.c ============================================================================== --- stable/7/sys/amd64/amd64/amd64_mem.c Tue Jul 14 17:26:37 2009 (r195685) +++ stable/7/sys/amd64/amd64/amd64_mem.c Tue Jul 14 17:37:59 2009 (r195686) @@ -678,9 +678,17 @@ amd64_mem_drvinit(void *unused) return; if ((cpu_id & 0xf00) != 0x600 && (cpu_id & 0xf00) != 0xf00) return; - if (cpu_vendor_id != CPU_VENDOR_INTEL && - cpu_vendor_id != CPU_VENDOR_AMD) + switch (cpu_vendor_id) { + case CPU_VENDOR_INTEL: + case CPU_VENDOR_AMD: + break; + case CPU_VENDOR_CENTAUR: + if (cpu_exthigh >= 0x80000008) + break; + /* FALLTHROUGH */ + default: return; + } mem_range_softc.mr_op = &amd64_mrops; } SYSINIT(amd64memdev, SI_SUB_DRIVERS, SI_ORDER_FIRST, amd64_mem_drvinit, NULL); Modified: stable/7/sys/amd64/amd64/identcpu.c ============================================================================== --- stable/7/sys/amd64/amd64/identcpu.c Tue Jul 14 17:26:37 2009 (r195685) +++ stable/7/sys/amd64/amd64/identcpu.c Tue Jul 14 17:37:59 2009 (r195686) @@ -72,6 +72,7 @@ void panicifcpuunsupported(void); static u_int find_cpu_vendor_id(void); static void print_AMD_info(void); static void print_AMD_assoc(int i); +static void print_via_padlock_info(void); int cpu_class; char machine[] = "amd64"; @@ -125,24 +126,33 @@ printcpuinfo(void) } } - if (cpu_vendor_id == CPU_VENDOR_INTEL) { + switch (cpu_vendor_id) { + case CPU_VENDOR_INTEL: /* Please make up your mind folks! */ strcat(cpu_model, "EM64T"); - } else if (cpu_vendor_id == CPU_VENDOR_AMD) { + break; + case CPU_VENDOR_AMD: /* * Values taken from AMD Processor Recognition * http://www.amd.com/K6/k6docs/pdf/20734g.pdf * (also describes ``Features'' encodings. */ strcpy(cpu_model, "AMD "); - switch (cpu_id & 0xF00) { - case 0xf00: + if ((cpu_id & 0xf00) == 0xf00) strcat(cpu_model, "AMD64 Processor"); - break; - default: + else strcat(cpu_model, "Unknown"); - break; - } + break; + case CPU_VENDOR_CENTAUR: + strcpy(cpu_model, "VIA "); + if ((cpu_id & 0xff0) == 0x6f0) + strcat(cpu_model, "Nano Processor"); + else + strcat(cpu_model, "Unknown"); + break; + default: + strcat(cpu_model, "Unknown"); + break; } /* @@ -174,7 +184,8 @@ printcpuinfo(void) printf(" Id = 0x%x", cpu_id); if (cpu_vendor_id == CPU_VENDOR_INTEL || - cpu_vendor_id == CPU_VENDOR_AMD) { + cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_CENTAUR) { printf(" Stepping = %u", cpu_id & 0xf); if (cpu_high > 0) { u_int cmp = 1, htt = 1; @@ -346,6 +357,9 @@ printcpuinfo(void) ); } + if (cpu_vendor_id == CPU_VENDOR_CENTAUR) + print_via_padlock_info(); + if ((cpu_feature & CPUID_HTT) && cpu_vendor_id == CPU_VENDOR_AMD) cpu_feature &= ~CPUID_HTT; @@ -454,7 +468,7 @@ EVENTHANDLER_DEFINE(cpufreq_post_change, EVENTHANDLER_PRI_ANY); /* - * Final stage of CPU identification. -- Should I check TI? + * Final stage of CPU identification. */ void identify_cpu(void) @@ -476,7 +490,8 @@ identify_cpu(void) cpu_feature2 = regs[2]; if (cpu_vendor_id == CPU_VENDOR_INTEL || - cpu_vendor_id == CPU_VENDOR_AMD) { + cpu_vendor_id == CPU_VENDOR_AMD || + cpu_vendor_id == CPU_VENDOR_CENTAUR) { do_cpuid(0x80000000, regs); cpu_exthigh = regs[0]; } @@ -597,3 +612,37 @@ print_AMD_info(void) print_AMD_l2_assoc((regs[2] >> 12) & 0x0f); } } + +static void +print_via_padlock_info(void) +{ + u_int regs[4]; + + /* Check for supported models. */ + switch (cpu_id & 0xff0) { + case 0x690: + if ((cpu_id & 0xf) < 3) + return; + case 0x6a0: + case 0x6d0: + case 0x6f0: + break; + default: + return; + } + + do_cpuid(0xc0000000, regs); + if (regs[0] >= 0xc0000001) + do_cpuid(0xc0000001, regs); + else + return; + + printf("\n VIA Padlock Features=0x%b", regs[3], + "\020" + "\003RNG" /* RNG */ + "\007AES" /* ACE */ + "\011AES-CTR" /* ACE2 */ + "\013SHA1,SHA256" /* PHE */ + "\015RSA" /* PMM */ + ); +} Modified: stable/7/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/7/sys/amd64/amd64/initcpu.c Tue Jul 14 17:26:37 2009 (r195685) +++ stable/7/sys/amd64/amd64/initcpu.c Tue Jul 14 17:37:59 2009 (r195686) @@ -54,6 +54,8 @@ u_int cpu_feature2; /* Feature flags */ u_int amd_feature; /* AMD feature flags */ u_int amd_feature2; /* AMD feature flags */ u_int amd_pminfo; /* AMD advanced power management info */ +u_int via_feature_rng; /* VIA RNG features */ +u_int via_feature_xcrypt; /* VIA ACE features */ u_int cpu_high; /* Highest arg to CPUID */ u_int cpu_exthigh; /* Highest arg to extended CPUID */ u_int cpu_id; /* Stepping ID */ @@ -64,6 +66,75 @@ u_int cpu_vendor_id; /* CPU vendor ID * u_int cpu_fxsr; /* SSE enabled */ u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */ +SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD, + &via_feature_rng, 0, "VIA C3/C7 RNG feature available in CPU"); +SYSCTL_UINT(_hw, OID_AUTO, via_feature_xcrypt, CTLFLAG_RD, + &via_feature_xcrypt, 0, "VIA C3/C7 xcrypt feature available in CPU"); + +/* + * Initialize special VIA C3/C7 features + */ +static void +init_via(void) +{ + u_int regs[4], val; + u_int64_t msreg; + + do_cpuid(0xc0000000, regs); + val = regs[0]; + if (val >= 0xc0000001) { + do_cpuid(0xc0000001, regs); + val = regs[3]; + } else + val = 0; + + /* Enable RNG if present and disabled */ + if (val & VIA_CPUID_HAS_RNG) { + if (!(val & VIA_CPUID_DO_RNG)) { + msreg = rdmsr(0x110B); + msreg |= 0x40; + wrmsr(0x110B, msreg); + } + via_feature_rng = VIA_HAS_RNG; + } + /* Enable AES engine if present and disabled */ + if (val & VIA_CPUID_HAS_ACE) { + if (!(val & VIA_CPUID_DO_ACE)) { + msreg = rdmsr(0x1107); + msreg |= (0x01 << 28); + wrmsr(0x1107, msreg); + } + via_feature_xcrypt |= VIA_HAS_AES; + } + /* Enable ACE2 engine if present and disabled */ + if (val & VIA_CPUID_HAS_ACE2) { + if (!(val & VIA_CPUID_DO_ACE2)) { + msreg = rdmsr(0x1107); + msreg |= (0x01 << 28); + wrmsr(0x1107, msreg); + } + via_feature_xcrypt |= VIA_HAS_AESCTR; + } + /* Enable SHA engine if present and disabled */ + if (val & VIA_CPUID_HAS_PHE) { + if (!(val & VIA_CPUID_DO_PHE)) { + msreg = rdmsr(0x1107); + msreg |= (0x01 << 28/**/); + wrmsr(0x1107, msreg); + } + via_feature_xcrypt |= VIA_HAS_SHA; + } + /* Enable MM engine if present and disabled */ + if (val & VIA_CPUID_HAS_PMM) { + if (!(val & VIA_CPUID_DO_PMM)) { + msreg = rdmsr(0x1107); + msreg |= (0x01 << 28/**/); + wrmsr(0x1107, msreg); + } + via_feature_xcrypt |= VIA_HAS_MM; + } +} + /* * Initialize CPU control registers */ @@ -81,4 +152,8 @@ initializecpu(void) wrmsr(MSR_EFER, msr); pg_nx = PG_NX; } + if (cpu_vendor_id == CPU_VENDOR_CENTAUR && + AMD64_CPU_FAMILY(cpu_id) == 0x6 && + AMD64_CPU_MODEL(cpu_id) >= 0xf) + init_via(); } Modified: stable/7/sys/amd64/amd64/msi.c ============================================================================== --- stable/7/sys/amd64/amd64/msi.c Tue Jul 14 17:26:37 2009 (r195685) +++ stable/7/sys/amd64/amd64/msi.c Tue Jul 14 17:37:59 2009 (r195686) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* Fields in address for Intel MSI messages. */ @@ -212,9 +213,18 @@ msi_init(void) { /* Check if we have a supported CPU. */ - if (!(cpu_vendor_id == CPU_VENDOR_INTEL || - cpu_vendor_id == CPU_VENDOR_AMD)) + switch (cpu_vendor_id) { + case CPU_VENDOR_INTEL: + case CPU_VENDOR_AMD: + break; + case CPU_VENDOR_CENTAUR: + if (AMD64_CPU_FAMILY(cpu_id) == 0x6 && + AMD64_CPU_MODEL(cpu_id) >= 0xf) + break; + /* FALLTHROUGH */ + default: return; + } msi_enabled = 1; intr_register_pic(&msi_pic); Modified: stable/7/sys/amd64/include/md_var.h ============================================================================== --- stable/7/sys/amd64/include/md_var.h Tue Jul 14 17:26:37 2009 (r195685) +++ stable/7/sys/amd64/include/md_var.h Tue Jul 14 17:37:59 2009 (r195686) @@ -45,6 +45,8 @@ extern u_int cpu_feature2; extern u_int amd_feature; extern u_int amd_feature2; extern u_int amd_pminfo; +extern u_int via_feature_rng; +extern u_int via_feature_xcrypt; extern u_int cpu_fxsr; extern u_int cpu_high; extern u_int cpu_id; Modified: stable/7/sys/amd64/include/specialreg.h ============================================================================== --- stable/7/sys/amd64/include/specialreg.h Tue Jul 14 17:26:37 2009 (r195685) +++ stable/7/sys/amd64/include/specialreg.h Tue Jul 14 17:37:59 2009 (r195686) @@ -459,4 +459,40 @@ #define MSR_TOP_MEM2 0xc001001d /* boundary for ram above 4G */ #define MSR_K8_UCODE_UPDATE 0xc0010020 /* update microcode */ +/* VIA ACE crypto featureset: for via_feature_rng */ +#define VIA_HAS_RNG 1 /* cpu has RNG */ + +/* VIA ACE crypto featureset: for via_feature_xcrypt */ +#define VIA_HAS_AES 1 /* cpu has AES */ +#define VIA_HAS_SHA 2 /* cpu has SHA1 & SHA256 */ +#define VIA_HAS_MM 4 /* cpu has RSA instructions */ +#define VIA_HAS_AESCTR 8 /* cpu has AES-CTR instructions */ + +/* Centaur Extended Feature flags */ +#define VIA_CPUID_HAS_RNG 0x000004 +#define VIA_CPUID_DO_RNG 0x000008 +#define VIA_CPUID_HAS_ACE 0x000040 +#define VIA_CPUID_DO_ACE 0x000080 +#define VIA_CPUID_HAS_ACE2 0x000100 +#define VIA_CPUID_DO_ACE2 0x000200 +#define VIA_CPUID_HAS_PHE 0x000400 +#define VIA_CPUID_DO_PHE 0x000800 +#define VIA_CPUID_HAS_PMM 0x001000 +#define VIA_CPUID_DO_PMM 0x002000 + +/* VIA ACE xcrypt-* instruction context control options */ +#define VIA_CRYPT_CWLO_ROUND_M 0x0000000f +#define VIA_CRYPT_CWLO_ALG_M 0x00000070 +#define VIA_CRYPT_CWLO_ALG_AES 0x00000000 +#define VIA_CRYPT_CWLO_KEYGEN_M 0x00000080 +#define VIA_CRYPT_CWLO_KEYGEN_HW 0x00000000 +#define VIA_CRYPT_CWLO_KEYGEN_SW 0x00000080 +#define VIA_CRYPT_CWLO_NORMAL 0x00000000 +#define VIA_CRYPT_CWLO_INTERMEDIATE 0x00000100 +#define VIA_CRYPT_CWLO_ENCRYPT 0x00000000 +#define VIA_CRYPT_CWLO_DECRYPT 0x00000200 +#define VIA_CRYPT_CWLO_KEY128 0x0000000a /* 128bit, 10 rds */ +#define VIA_CRYPT_CWLO_KEY192 0x0000040c /* 192bit, 12 rds */ +#define VIA_CRYPT_CWLO_KEY256 0x0000080e /* 256bit, 15 rds */ + #endif /* !_MACHINE_SPECIALREG_H_ */ Modified: stable/7/sys/conf/files.amd64 ============================================================================== --- stable/7/sys/conf/files.amd64 Tue Jul 14 17:26:37 2009 (r195685) +++ stable/7/sys/conf/files.amd64 Tue Jul 14 17:37:59 2009 (r195686) @@ -130,6 +130,9 @@ amd64/pci/pci_bus.c optional pci amd64/pci/pci_cfgreg.c optional pci crypto/blowfish/bf_enc.c optional crypto | ipsec crypto/des/des_enc.c optional crypto | ipsec | netsmb +crypto/via/padlock.c optional padlock +crypto/via/padlock_cipher.c optional padlock +crypto/via/padlock_hash.c optional padlock dev/acpica/acpi_if.m standard dev/amdtemp/amdtemp.c optional amdtemp dev/arcmsr/arcmsr.c optional arcmsr pci Modified: stable/7/sys/crypto/via/padlock.c ============================================================================== --- stable/7/sys/crypto/via/padlock.c Tue Jul 14 17:26:37 2009 (r195685) +++ stable/7/sys/crypto/via/padlock.c Tue Jul 14 17:37:59 2009 (r195686) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(__i386__) && !defined(PC98) +#if defined(__amd64__) || (defined(__i386__) && !defined(PC98)) #include #include #include @@ -83,7 +83,7 @@ padlock_probe(device_t dev) { char capp[256]; -#if defined(__i386__) && !defined(PC98) +#if defined(__amd64__) || (defined(__i386__) && !defined(PC98)) /* If there is no AES support, we has nothing to do here. */ if (!(via_feature_xcrypt & VIA_HAS_AES)) { device_printf(dev, "No ACE support.\n"); Modified: stable/7/sys/crypto/via/padlock_hash.c ============================================================================== --- stable/7/sys/crypto/via/padlock_hash.c Tue Jul 14 17:26:37 2009 (r195685) +++ stable/7/sys/crypto/via/padlock_hash.c Tue Jul 14 17:37:59 2009 (r195686) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(__i386__) && !defined(PC98) +#if defined(__amd64__) || (defined(__i386__) && !defined(PC98)) #include #include #include Modified: stable/7/sys/modules/Makefile ============================================================================== --- stable/7/sys/modules/Makefile Tue Jul 14 17:26:37 2009 (r195685) +++ stable/7/sys/modules/Makefile Tue Jul 14 17:37:59 2009 (r195686) @@ -559,6 +559,11 @@ _nxge= nxge .if ${MK_CDDL} != "no" || defined(ALL_MODULES) _opensolaris= opensolaris .endif +.if ${MK_CRYPT} != "no" || defined(ALL_MODULES) +.if exists(${.CURDIR}/../crypto/via) +_padlock= padlock +.endif +.endif _pccard= pccard _rdma= rdma _safe= safe From owner-svn-src-stable@FreeBSD.ORG Tue Jul 14 18:40:31 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 8D50D106564A; Tue, 14 Jul 2009 18:40:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79DEB8FC1D; Tue, 14 Jul 2009 18:40:31 +0000 (UTC) (envelope-from jkim@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 n6EIeVrh067800; Tue, 14 Jul 2009 18:40:31 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6EIeV4i067797; Tue, 14 Jul 2009 18:40:31 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200907141840.n6EIeV4i067797@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 14 Jul 2009 18:40:31 +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: r195687 - in stable/7/sys: . amd64/amd64 contrib/pf i386/i386 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, 14 Jul 2009 18:40:32 -0000 Author: jkim Date: Tue Jul 14 18:40:31 2009 New Revision: 195687 URL: http://svn.freebsd.org/changeset/base/195687 Log: MFC: r191788 Unlock the largest standard CPUID on Intel CPUs for both amd64 and i386. On i386, we extend it to cover Core, Core 2, and Core i7 processors, not just Pentium 4 family, and move it to better place. On amd64, all supported Intel CPUs should have this MSR. Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/identcpu.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/i386/i386/identcpu.c Modified: stable/7/sys/amd64/amd64/identcpu.c ============================================================================== --- stable/7/sys/amd64/amd64/identcpu.c Tue Jul 14 17:37:59 2009 (r195686) +++ stable/7/sys/amd64/amd64/identcpu.c Tue Jul 14 18:40:31 2009 (r195687) @@ -489,6 +489,22 @@ identify_cpu(void) cpu_feature = regs[3]; cpu_feature2 = regs[2]; + /* + * Clear "Limit CPUID Maxval" bit and get the largest standard CPUID + * function number again if it is set from BIOS. It is necessary + * for probing correct CPU topology later. + * XXX This is only done on the BSP package. + */ + if (cpu_vendor_id == CPU_VENDOR_INTEL && cpu_high > 0 && cpu_high < 4) { + uint64_t msr; + msr = rdmsr(MSR_IA32_MISC_ENABLE); + if ((msr & 0x400000ULL) != 0) { + wrmsr(MSR_IA32_MISC_ENABLE, msr & ~0x400000ULL); + do_cpuid(0, regs); + cpu_high = regs[0]; + } + } + if (cpu_vendor_id == CPU_VENDOR_INTEL || cpu_vendor_id == CPU_VENDOR_AMD || cpu_vendor_id == CPU_VENDOR_CENTAUR) { Modified: stable/7/sys/i386/i386/identcpu.c ============================================================================== --- stable/7/sys/i386/i386/identcpu.c Tue Jul 14 17:37:59 2009 (r195686) +++ stable/7/sys/i386/i386/identcpu.c Tue Jul 14 18:40:31 2009 (r195687) @@ -209,7 +209,6 @@ printcpuinfo(void) if (cpu_vendor_id == CPU_VENDOR_INTEL) { if ((cpu_id & 0xf00) > 0x300) { u_int brand_index; - u_int model; cpu_model[0] = '\0'; @@ -322,16 +321,6 @@ printcpuinfo(void) case 0xf00: strcat(cpu_model, "Pentium 4"); cpu = CPU_P4; - model = (cpu_id & 0x0f0) >> 4; - if (model == 3 || model == 4 || model == 6) { - uint64_t tmp; - - tmp = rdmsr(MSR_IA32_MISC_ENABLE); - wrmsr(MSR_IA32_MISC_ENABLE, - tmp & ~(1LL << 22)); - do_cpuid(0, regs); - cpu_high = regs[0]; - } break; default: strcat(cpu_model, "unknown"); @@ -1127,6 +1116,24 @@ finishidentcpu(void) cpu_vendor_id = find_cpu_vendor_id(); + /* + * Clear "Limit CPUID Maxval" bit and get the largest standard CPUID + * function number again if it is set from BIOS. It is necessary + * for probing correct CPU topology later. + * XXX This is only done on the BSP package. + */ + if (cpu_vendor_id == CPU_VENDOR_INTEL && cpu_high > 0 && cpu_high < 4 && + ((I386_CPU_FAMILY(cpu_id) == 0xf && I386_CPU_MODEL(cpu_id) >= 0x3) || + (I386_CPU_FAMILY(cpu_id) == 0x6 && I386_CPU_MODEL(cpu_id) >= 0xe))) { + uint64_t msr; + msr = rdmsr(MSR_IA32_MISC_ENABLE); + if ((msr & 0x400000ULL) != 0) { + wrmsr(MSR_IA32_MISC_ENABLE, msr & ~0x400000ULL); + do_cpuid(0, regs); + cpu_high = regs[0]; + } + } + /* Detect AMD features (PTE no-execute bit, 3dnow, 64 bit mode etc) */ if (cpu_vendor_id == CPU_VENDOR_INTEL || cpu_vendor_id == CPU_VENDOR_AMD) { From owner-svn-src-stable@FreeBSD.ORG Tue Jul 14 19:48:33 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 E3898106568A; Tue, 14 Jul 2009 19:48:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 049608FC0C; Tue, 14 Jul 2009 19:48:32 +0000 (UTC) (envelope-from jhb@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 n6EJmVSI069453; Tue, 14 Jul 2009 19:48:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6EJmVs0069443; Tue, 14 Jul 2009 19:48:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200907141948.n6EJmVs0069443@svn.freebsd.org> From: John Baldwin Date: Tue, 14 Jul 2009 19:48:31 +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: r195694 - in stable/7: include lib/libc lib/libc/sys sys sys/compat/freebsd32 sys/contrib/pf sys/kern sys/sys tools/regression/file tools/regression/file/closefrom tools/regression/file... 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, 14 Jul 2009 19:48:35 -0000 Author: jhb Date: Tue Jul 14 19:48:31 2009 New Revision: 195694 URL: http://svn.freebsd.org/changeset/base/195694 Log: MFC: Add a new 'void closefrom(int lowfd)' system call. When called, it closes any open file descriptors >= 'lowfd'. Bump __FreeBSD_version to 702104. Added: stable/7/lib/libc/sys/closefrom.2 - copied unchanged from r194262, head/lib/libc/sys/closefrom.2 stable/7/tools/regression/file/closefrom/ - copied from r194262, head/tools/regression/file/closefrom/ Modified: stable/7/include/ (props changed) stable/7/include/unistd.h stable/7/lib/libc/ (props changed) stable/7/lib/libc/sys/Makefile.inc stable/7/lib/libc/sys/Symbol.map stable/7/lib/libc/sys/close.2 stable/7/sys/ (props changed) stable/7/sys/compat/freebsd32/syscalls.master stable/7/sys/contrib/pf/ (props changed) stable/7/sys/kern/kern_descrip.c stable/7/sys/kern/syscalls.master stable/7/sys/sys/param.h stable/7/tools/regression/file/ (props changed) stable/7/tools/regression/file/flock/ (props changed) Modified: stable/7/include/unistd.h ============================================================================== --- stable/7/include/unistd.h Tue Jul 14 19:45:36 2009 (r195693) +++ stable/7/include/unistd.h Tue Jul 14 19:48:31 2009 (r195694) @@ -326,6 +326,7 @@ unsigned int alarm(unsigned int); int chdir(const char *); int chown(const char *, uid_t, gid_t); int close(int); +void closefrom(int); int dup(int); int dup2(int, int); int eaccess(const char *, int); Modified: stable/7/lib/libc/sys/Makefile.inc ============================================================================== --- stable/7/lib/libc/sys/Makefile.inc Tue Jul 14 19:45:36 2009 (r195693) +++ stable/7/lib/libc/sys/Makefile.inc Tue Jul 14 19:48:31 2009 (r195694) @@ -63,7 +63,7 @@ MAN+= _exit.2 abort2.2 accept.2 access.2 aio_cancel.2 aio_error.2 aio_read.2 aio_return.2 \ aio_suspend.2 aio_waitcomplete.2 aio_write.2 \ bind.2 brk.2 chdir.2 chflags.2 \ - chmod.2 chown.2 chroot.2 clock_gettime.2 close.2 \ + chmod.2 chown.2 chroot.2 clock_gettime.2 close.2 closefrom.2 \ connect.2 cpuset.2 cpuset_getaffinity.2 dup.2 execve.2 \ extattr_get_file.2 fcntl.2 fhopen.2 flock.2 fork.2 fsync.2 \ getdirentries.2 getdtablesize.2 \ Modified: stable/7/lib/libc/sys/Symbol.map ============================================================================== --- stable/7/lib/libc/sys/Symbol.map Tue Jul 14 19:45:36 2009 (r195693) +++ stable/7/lib/libc/sys/Symbol.map Tue Jul 14 19:48:31 2009 (r195694) @@ -337,6 +337,7 @@ FBSD_1.0 { }; FBSD_1.1 { + closefrom; cpuset; cpuset_getid; cpuset_setid; @@ -458,6 +459,8 @@ FBSDprivate_1.0 { __sys_clock_settime; _close; __sys_close; + _closefrom; + __sys_closefrom; _connect; __sys_connect; _cpuset; Modified: stable/7/lib/libc/sys/close.2 ============================================================================== --- stable/7/lib/libc/sys/close.2 Tue Jul 14 19:45:36 2009 (r195693) +++ stable/7/lib/libc/sys/close.2 Tue Jul 14 19:48:31 2009 (r195694) @@ -120,6 +120,7 @@ before all pending data was delivered. .El .Sh SEE ALSO .Xr accept 2 , +.Xr closefrom 2 , .Xr execve 2 , .Xr fcntl 2 , .Xr flock 2 , Copied: stable/7/lib/libc/sys/closefrom.2 (from r194262, head/lib/libc/sys/closefrom.2) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/lib/libc/sys/closefrom.2 Tue Jul 14 19:48:31 2009 (r195694, copy of r194262, head/lib/libc/sys/closefrom.2) @@ -0,0 +1,53 @@ +.\" Copyright (c) 2009 Advanced Computing Technologies LLC +.\" Written by: John H. Baldwin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 12, 2009 +.Dt CLOSEFROM 2 +.Os +.Sh NAME +.Nm closefrom +.Nd delete open file descriptors +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In unistd.h +.Ft void +.Fn closefrom "int lowfd" +.Sh DESCRIPTION +The +.Fn closefrom +system call deletes all open file descriptors greater than or equal to +.Fa lowfd +from the per-process object reference table. +Any errors encountered while closing file descriptors are ignored. +.Sh SEE ALSO +.Xr close 2 +.Sh HISTORY +The +.Fn closefrom +function first appeared in +.Fx 8.0 . Modified: stable/7/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/7/sys/compat/freebsd32/syscalls.master Tue Jul 14 19:45:36 2009 (r195693) +++ stable/7/sys/compat/freebsd32/syscalls.master Tue Jul 14 19:48:31 2009 (r195694) @@ -854,3 +854,24 @@ uint32_t idlo, uint32_t idhi, \ size_t cpusetsize, \ const cpuset_t *mask); } +489 AUE_NULL UNIMPL faccessat +490 AUE_NULL UNIMPL fchmodat +491 AUE_NULL UNIMPL fchownat +492 AUE_NULL UNIMPL freebsd32_fexecve +493 AUE_NULL UNIMPL freebsd32_fstatat +494 AUE_NULL UNIMPL freebsd32_futimesat +495 AUE_NULL UNIMPL linkat +496 AUE_NULL UNIMPL mkdirat +497 AUE_NULL UNIMPL mkfifoat +498 AUE_NULL UNIMPL mknodat +499 AUE_NULL UNIMPL openat +500 AUE_NULL UNIMPL readlinkat +501 AUE_NULL UNIMPL renameat +502 AUE_NULL UNIMPL symlinkat +503 AUE_NULL UNIMPL unlinkat +504 AUE_NULL UNIMPL posix_openpt +505 AUE_NULL UNIMPL gssd_syscall +506 AUE_NULL UNIMPL freebsd32_jail_get +507 AUE_NULL UNIMPL freebsd32_jail_set +508 AUE_NULL UNIMPL jail_remove +509 AUE_CLOSEFROM NOPROTO { int closefrom(int lowfd); } Modified: stable/7/sys/kern/kern_descrip.c ============================================================================== --- stable/7/sys/kern/kern_descrip.c Tue Jul 14 19:45:36 2009 (r195693) +++ stable/7/sys/kern/kern_descrip.c Tue Jul 14 19:48:31 2009 (r195694) @@ -1136,6 +1136,42 @@ kern_close(td, fd) return (error); } +/* + * Close open file descriptors. + */ +#ifndef _SYS_SYSPROTO_H_ +struct closefrom_args { + int lowfd; +}; +#endif +/* ARGSUSED */ +int +closefrom(struct thread *td, struct closefrom_args *uap) +{ + struct filedesc *fdp; + int fd; + + fdp = td->td_proc->p_fd; + AUDIT_ARG(fd, uap->lowfd); + + /* + * Treat negative starting file descriptor values identical to + * closefrom(0) which closes all files. + */ + if (uap->lowfd < 0) + uap->lowfd = 0; + FILEDESC_SLOCK(fdp); + for (fd = uap->lowfd; fd < fdp->fd_nfiles; fd++) { + if (fdp->fd_ofiles[fd] != NULL) { + FILEDESC_SUNLOCK(fdp); + (void)kern_close(td, fd); + FILEDESC_SLOCK(fdp); + } + } + FILEDESC_SUNLOCK(fdp); + return (0); +} + #if defined(COMPAT_43) /* * Return status information about a file descriptor. Modified: stable/7/sys/kern/syscalls.master ============================================================================== --- stable/7/sys/kern/syscalls.master Tue Jul 14 19:45:36 2009 (r195693) +++ stable/7/sys/kern/syscalls.master Tue Jul 14 19:48:31 2009 (r195694) @@ -870,6 +870,26 @@ 488 AUE_NULL STD { int cpuset_setaffinity(cpulevel_t level, \ cpuwhich_t which, id_t id, size_t cpusetsize, \ const cpuset_t *mask); } - +489 AUE_NULL UNIMPL faccessat +490 AUE_NULL UNIMPL fchmodat +491 AUE_NULL UNIMPL fchownat +492 AUE_NULL UNIMPL fexecve +493 AUE_NULL UNIMPL fstatat +494 AUE_NULL UNIMPL futimesat +495 AUE_NULL UNIMPL linkat +496 AUE_NULL UNIMPL mkdirat +497 AUE_NULL UNIMPL mkfifoat +498 AUE_NULL UNIMPL mknodat +499 AUE_NULL UNIMPL openat +500 AUE_NULL UNIMPL readlinkat +501 AUE_NULL UNIMPL renameat +502 AUE_NULL UNIMPL symlinkat +503 AUE_NULL UNIMPL unlinkat +504 AUE_NULL UNIMPL posix_openpt +505 AUE_NULL UNIMPL gssd_syscall +506 AUE_NULL UNIMPL jail_get +507 AUE_NULL UNIMPL jail_set +508 AUE_NULL UNIMPL jail_remove +509 AUE_CLOSEFROM STD { int closefrom(int lowfd); } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Modified: stable/7/sys/sys/param.h ============================================================================== --- stable/7/sys/sys/param.h Tue Jul 14 19:45:36 2009 (r195693) +++ stable/7/sys/sys/param.h Tue Jul 14 19:48:31 2009 (r195694) @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 702103 /* Master, propagated to newvers */ +#define __FreeBSD_version 702104 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-stable@FreeBSD.ORG Tue Jul 14 19:50:46 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 B4BF4106566C; Tue, 14 Jul 2009 19:50:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A03F58FC22; Tue, 14 Jul 2009 19:50:46 +0000 (UTC) (envelope-from jhb@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 n6EJokag069561; Tue, 14 Jul 2009 19:50:46 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6EJokxc069550; Tue, 14 Jul 2009 19:50:46 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200907141950.n6EJokxc069550@svn.freebsd.org> From: John Baldwin Date: Tue, 14 Jul 2009 19:50:46 +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: r195695 - in stable/7/sys: compat/freebsd32 kern sys 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, 14 Jul 2009 19:50:47 -0000 Author: jhb Date: Tue Jul 14 19:50:46 2009 New Revision: 195695 URL: http://svn.freebsd.org/changeset/base/195695 Log: Regenerate after addition of closefrom(). Modified: stable/7/sys/compat/freebsd32/freebsd32_proto.h stable/7/sys/compat/freebsd32/freebsd32_syscall.h stable/7/sys/compat/freebsd32/freebsd32_syscalls.c stable/7/sys/compat/freebsd32/freebsd32_sysent.c stable/7/sys/kern/init_sysent.c stable/7/sys/kern/syscalls.c stable/7/sys/kern/systrace_args.c stable/7/sys/sys/syscall.h stable/7/sys/sys/syscall.mk stable/7/sys/sys/sysproto.h Modified: stable/7/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/7/sys/compat/freebsd32/freebsd32_proto.h Tue Jul 14 19:48:31 2009 (r195694) +++ stable/7/sys/compat/freebsd32/freebsd32_proto.h Tue Jul 14 19:50:46 2009 (r195695) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 194359 2009-06-17 13:12:43Z kib + * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 195694 2009-07-14 19:48:31Z jhb */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: stable/7/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/7/sys/compat/freebsd32/freebsd32_syscall.h Tue Jul 14 19:48:31 2009 (r195694) +++ stable/7/sys/compat/freebsd32/freebsd32_syscall.h Tue Jul 14 19:50:46 2009 (r195695) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 194359 2009-06-17 13:12:43Z kib + * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 195694 2009-07-14 19:48:31Z jhb */ #define FREEBSD32_SYS_syscall 0 @@ -361,4 +361,5 @@ #define FREEBSD32_SYS_freebsd32_cpuset_getid 486 #define FREEBSD32_SYS_freebsd32_cpuset_getaffinity 487 #define FREEBSD32_SYS_freebsd32_cpuset_setaffinity 488 -#define FREEBSD32_SYS_MAXSYSCALL 489 +#define FREEBSD32_SYS_closefrom 509 +#define FREEBSD32_SYS_MAXSYSCALL 510 Modified: stable/7/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/7/sys/compat/freebsd32/freebsd32_syscalls.c Tue Jul 14 19:48:31 2009 (r195694) +++ stable/7/sys/compat/freebsd32/freebsd32_syscalls.c Tue Jul 14 19:50:46 2009 (r195695) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 194359 2009-06-17 13:12:43Z kib + * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 195694 2009-07-14 19:48:31Z jhb */ const char *freebsd32_syscallnames[] = { @@ -496,4 +496,25 @@ const char *freebsd32_syscallnames[] = { "freebsd32_cpuset_getid", /* 486 = freebsd32_cpuset_getid */ "freebsd32_cpuset_getaffinity", /* 487 = freebsd32_cpuset_getaffinity */ "freebsd32_cpuset_setaffinity", /* 488 = freebsd32_cpuset_setaffinity */ + "#489", /* 489 = faccessat */ + "#490", /* 490 = fchmodat */ + "#491", /* 491 = fchownat */ + "#492", /* 492 = freebsd32_fexecve */ + "#493", /* 493 = freebsd32_fstatat */ + "#494", /* 494 = freebsd32_futimesat */ + "#495", /* 495 = linkat */ + "#496", /* 496 = mkdirat */ + "#497", /* 497 = mkfifoat */ + "#498", /* 498 = mknodat */ + "#499", /* 499 = openat */ + "#500", /* 500 = readlinkat */ + "#501", /* 501 = renameat */ + "#502", /* 502 = symlinkat */ + "#503", /* 503 = unlinkat */ + "#504", /* 504 = posix_openpt */ + "#505", /* 505 = gssd_syscall */ + "#506", /* 506 = freebsd32_jail_get */ + "#507", /* 507 = freebsd32_jail_set */ + "#508", /* 508 = jail_remove */ + "closefrom", /* 509 = closefrom */ }; Modified: stable/7/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/7/sys/compat/freebsd32/freebsd32_sysent.c Tue Jul 14 19:48:31 2009 (r195694) +++ stable/7/sys/compat/freebsd32/freebsd32_sysent.c Tue Jul 14 19:50:46 2009 (r195695) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 194359 2009-06-17 13:12:43Z kib + * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 195694 2009-07-14 19:48:31Z jhb */ #include "opt_compat.h" @@ -527,4 +527,25 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_cpuset_getid_args), (sy_call_t *)freebsd32_cpuset_getid, AUE_NULL, NULL, 0, 0 }, /* 486 = freebsd32_cpuset_getid */ { AS(freebsd32_cpuset_getaffinity_args), (sy_call_t *)freebsd32_cpuset_getaffinity, AUE_NULL, NULL, 0, 0 }, /* 487 = freebsd32_cpuset_getaffinity */ { AS(freebsd32_cpuset_setaffinity_args), (sy_call_t *)freebsd32_cpuset_setaffinity, AUE_NULL, NULL, 0, 0 }, /* 488 = freebsd32_cpuset_setaffinity */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 489 = faccessat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 490 = fchmodat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 491 = fchownat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 492 = freebsd32_fexecve */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 493 = freebsd32_fstatat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 494 = freebsd32_futimesat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 495 = linkat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 496 = mkdirat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 497 = mkfifoat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 498 = mknodat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 499 = openat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 500 = readlinkat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 501 = renameat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 502 = symlinkat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 503 = unlinkat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 504 = posix_openpt */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 505 = gssd_syscall */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 506 = freebsd32_jail_get */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 507 = freebsd32_jail_set */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 508 = jail_remove */ + { AS(closefrom_args), (sy_call_t *)closefrom, AUE_CLOSEFROM, NULL, 0, 0 }, /* 509 = closefrom */ }; Modified: stable/7/sys/kern/init_sysent.c ============================================================================== --- stable/7/sys/kern/init_sysent.c Tue Jul 14 19:48:31 2009 (r195694) +++ stable/7/sys/kern/init_sysent.c Tue Jul 14 19:50:46 2009 (r195695) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/kern/syscalls.master 180808 2008-07-25 17:46:01Z jhb + * created from FreeBSD: stable/7/sys/kern/syscalls.master 195694 2009-07-14 19:48:31Z jhb */ #include "opt_compat.h" @@ -517,4 +517,25 @@ struct sysent sysent[] = { { AS(cpuset_getid_args), (sy_call_t *)cpuset_getid, AUE_NULL, NULL, 0, 0 }, /* 486 = cpuset_getid */ { AS(cpuset_getaffinity_args), (sy_call_t *)cpuset_getaffinity, AUE_NULL, NULL, 0, 0 }, /* 487 = cpuset_getaffinity */ { AS(cpuset_setaffinity_args), (sy_call_t *)cpuset_setaffinity, AUE_NULL, NULL, 0, 0 }, /* 488 = cpuset_setaffinity */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 489 = faccessat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 490 = fchmodat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 491 = fchownat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 492 = fexecve */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 493 = fstatat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 494 = futimesat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 495 = linkat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 496 = mkdirat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 497 = mkfifoat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 498 = mknodat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 499 = openat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 500 = readlinkat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 501 = renameat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 502 = symlinkat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 503 = unlinkat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 504 = posix_openpt */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 505 = gssd_syscall */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 506 = jail_get */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 507 = jail_set */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 508 = jail_remove */ + { AS(closefrom_args), (sy_call_t *)closefrom, AUE_CLOSEFROM, NULL, 0, 0 }, /* 509 = closefrom */ }; Modified: stable/7/sys/kern/syscalls.c ============================================================================== --- stable/7/sys/kern/syscalls.c Tue Jul 14 19:48:31 2009 (r195694) +++ stable/7/sys/kern/syscalls.c Tue Jul 14 19:50:46 2009 (r195695) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/kern/syscalls.master 180808 2008-07-25 17:46:01Z jhb + * created from FreeBSD: stable/7/sys/kern/syscalls.master 195694 2009-07-14 19:48:31Z jhb */ const char *syscallnames[] = { @@ -496,4 +496,25 @@ const char *syscallnames[] = { "cpuset_getid", /* 486 = cpuset_getid */ "cpuset_getaffinity", /* 487 = cpuset_getaffinity */ "cpuset_setaffinity", /* 488 = cpuset_setaffinity */ + "#489", /* 489 = faccessat */ + "#490", /* 490 = fchmodat */ + "#491", /* 491 = fchownat */ + "#492", /* 492 = fexecve */ + "#493", /* 493 = fstatat */ + "#494", /* 494 = futimesat */ + "#495", /* 495 = linkat */ + "#496", /* 496 = mkdirat */ + "#497", /* 497 = mkfifoat */ + "#498", /* 498 = mknodat */ + "#499", /* 499 = openat */ + "#500", /* 500 = readlinkat */ + "#501", /* 501 = renameat */ + "#502", /* 502 = symlinkat */ + "#503", /* 503 = unlinkat */ + "#504", /* 504 = posix_openpt */ + "#505", /* 505 = gssd_syscall */ + "#506", /* 506 = jail_get */ + "#507", /* 507 = jail_set */ + "#508", /* 508 = jail_remove */ + "closefrom", /* 509 = closefrom */ }; Modified: stable/7/sys/kern/systrace_args.c ============================================================================== --- stable/7/sys/kern/systrace_args.c Tue Jul 14 19:48:31 2009 (r195694) +++ stable/7/sys/kern/systrace_args.c Tue Jul 14 19:50:46 2009 (r195695) @@ -2936,6 +2936,13 @@ systrace_args(int sysnum, void *params, *n_args = 5; break; } + /* closefrom */ + case 509: { + struct closefrom_args *p = params; + iarg[0] = p->lowfd; /* int */ + *n_args = 1; + break; + } default: *n_args = 0; break; @@ -4489,6 +4496,16 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; + /* setfib */ + case 175: + switch(ndx) { + case 0: + p = "int"; + break; + default: + break; + }; + break; /* ntp_adjtime */ case 176: switch(ndx) { @@ -7652,6 +7669,105 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; + /* cpuset */ + case 484: + switch(ndx) { + case 0: + p = "cpusetid_t *"; + break; + default: + break; + }; + break; + /* cpuset_setid */ + case 485: + switch(ndx) { + case 0: + p = "cpuwhich_t"; + break; + case 1: + p = "id_t"; + break; + case 2: + p = "cpusetid_t"; + break; + default: + break; + }; + break; + /* cpuset_getid */ + case 486: + switch(ndx) { + case 0: + p = "cpulevel_t"; + break; + case 1: + p = "cpuwhich_t"; + break; + case 2: + p = "id_t"; + break; + case 3: + p = "cpusetid_t *"; + break; + default: + break; + }; + break; + /* cpuset_getaffinity */ + case 487: + switch(ndx) { + case 0: + p = "cpulevel_t"; + break; + case 1: + p = "cpuwhich_t"; + break; + case 2: + p = "id_t"; + break; + case 3: + p = "size_t"; + break; + case 4: + p = "cpuset_t *"; + break; + default: + break; + }; + break; + /* cpuset_setaffinity */ + case 488: + switch(ndx) { + case 0: + p = "cpulevel_t"; + break; + case 1: + p = "cpuwhich_t"; + break; + case 2: + p = "id_t"; + break; + case 3: + p = "size_t"; + break; + case 4: + p = "const cpuset_t *"; + break; + default: + break; + }; + break; + /* closefrom */ + case 509: + switch(ndx) { + case 0: + p = "int"; + break; + default: + break; + }; + break; default: break; }; Modified: stable/7/sys/sys/syscall.h ============================================================================== --- stable/7/sys/sys/syscall.h Tue Jul 14 19:48:31 2009 (r195694) +++ stable/7/sys/sys/syscall.h Tue Jul 14 19:50:46 2009 (r195695) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/kern/syscalls.master 180808 2008-07-25 17:46:01Z jhb + * created from FreeBSD: stable/7/sys/kern/syscalls.master 195694 2009-07-14 19:48:31Z jhb */ #define SYS_syscall 0 @@ -408,4 +408,5 @@ #define SYS_cpuset_getid 486 #define SYS_cpuset_getaffinity 487 #define SYS_cpuset_setaffinity 488 -#define SYS_MAXSYSCALL 489 +#define SYS_closefrom 509 +#define SYS_MAXSYSCALL 510 Modified: stable/7/sys/sys/syscall.mk ============================================================================== --- stable/7/sys/sys/syscall.mk Tue Jul 14 19:48:31 2009 (r195694) +++ stable/7/sys/sys/syscall.mk Tue Jul 14 19:50:46 2009 (r195695) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: stable/7/sys/kern/syscalls.master 180808 2008-07-25 17:46:01Z jhb +# created from FreeBSD: stable/7/sys/kern/syscalls.master 195694 2009-07-14 19:48:31Z jhb MIASM = \ syscall.o \ exit.o \ @@ -356,4 +356,5 @@ MIASM = \ cpuset_setid.o \ cpuset_getid.o \ cpuset_getaffinity.o \ - cpuset_setaffinity.o + cpuset_setaffinity.o \ + closefrom.o Modified: stable/7/sys/sys/sysproto.h ============================================================================== --- stable/7/sys/sys/sysproto.h Tue Jul 14 19:48:31 2009 (r195694) +++ stable/7/sys/sys/sysproto.h Tue Jul 14 19:50:46 2009 (r195695) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/kern/syscalls.master 180808 2008-07-25 17:46:01Z jhb + * created from FreeBSD: stable/7/sys/kern/syscalls.master 195694 2009-07-14 19:48:31Z jhb */ #ifndef _SYS_SYSPROTO_H_ @@ -1558,6 +1558,9 @@ struct cpuset_setaffinity_args { char cpusetsize_l_[PADL_(size_t)]; size_t cpusetsize; char cpusetsize_r_[PADR_(size_t)]; char mask_l_[PADL_(const cpuset_t *)]; const cpuset_t * mask; char mask_r_[PADR_(const cpuset_t *)]; }; +struct closefrom_args { + char lowfd_l_[PADL_(int)]; int lowfd; char lowfd_r_[PADR_(int)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_exit(struct thread *, struct sys_exit_args *); int fork(struct thread *, struct fork_args *); @@ -1904,6 +1907,7 @@ int cpuset_setid(struct thread *, struct int cpuset_getid(struct thread *, struct cpuset_getid_args *); int cpuset_getaffinity(struct thread *, struct cpuset_getaffinity_args *); int cpuset_setaffinity(struct thread *, struct cpuset_setaffinity_args *); +int closefrom(struct thread *, struct closefrom_args *); #ifdef COMPAT_43 @@ -2475,6 +2479,7 @@ int freebsd4_sigreturn(struct thread *, #define SYS_AUE_cpuset_getid AUE_NULL #define SYS_AUE_cpuset_getaffinity AUE_NULL #define SYS_AUE_cpuset_setaffinity AUE_NULL +#define SYS_AUE_closefrom AUE_CLOSEFROM #undef PAD_ #undef PADL_ From owner-svn-src-stable@FreeBSD.ORG Tue Jul 14 20:46:19 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 C2800106566B; Tue, 14 Jul 2009 20:46:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 952548FC0A; Tue, 14 Jul 2009 20:46:19 +0000 (UTC) (envelope-from jhb@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 n6EKkJ6N070827; Tue, 14 Jul 2009 20:46:19 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6EKkJwO070823; Tue, 14 Jul 2009 20:46:19 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200907142046.n6EKkJwO070823@svn.freebsd.org> From: John Baldwin Date: Tue, 14 Jul 2009 20:46:19 +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: r195696 - in stable/7: crypto/openssh secure/lib/libssh 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, 14 Jul 2009 20:46:20 -0000 Author: jhb Date: Tue Jul 14 20:46:19 2009 New Revision: 195696 URL: http://svn.freebsd.org/changeset/base/195696 Log: MFC: Use the closefrom(2) system call. Modified: stable/7/crypto/openssh/ (props changed) stable/7/crypto/openssh/config.h stable/7/crypto/openssh/ssh_namespace.h stable/7/secure/lib/libssh/ (props changed) stable/7/secure/lib/libssh/Makefile Modified: stable/7/crypto/openssh/config.h ============================================================================== --- stable/7/crypto/openssh/config.h Tue Jul 14 19:50:46 2009 (r195695) +++ stable/7/crypto/openssh/config.h Tue Jul 14 20:46:19 2009 (r195696) @@ -211,7 +211,7 @@ #define HAVE_CLOCK_T 1 /* Define to 1 if you have the `closefrom' function. */ -/* #undef HAVE_CLOSEFROM */ +#define HAVE_CLOSEFROM 1 /* Define if gai_strerror() returns const char * */ #define HAVE_CONST_GAI_STRERROR_PROTO 1 Modified: stable/7/crypto/openssh/ssh_namespace.h ============================================================================== --- stable/7/crypto/openssh/ssh_namespace.h Tue Jul 14 19:50:46 2009 (r195695) +++ stable/7/crypto/openssh/ssh_namespace.h Tue Jul 14 20:46:19 2009 (r195696) @@ -154,7 +154,6 @@ #define ciphers_valid ssh_ciphers_valid #define cleanhostname ssh_cleanhostname #define cleanup_exit ssh_cleanup_exit -#define closefrom ssh_closefrom #define colon ssh_colon #define compat_cipher_proposal ssh_compat_cipher_proposal #define compat_datafellows ssh_compat_datafellows Modified: stable/7/secure/lib/libssh/Makefile ============================================================================== --- stable/7/secure/lib/libssh/Makefile Tue Jul 14 19:50:46 2009 (r195695) +++ stable/7/secure/lib/libssh/Makefile Tue Jul 14 20:46:19 2009 (r195696) @@ -19,7 +19,7 @@ SRCS= acss.c authfd.c authfile.c bufaux. # compiled directly into sshd instead. # Portability layer -SRCS+= bsd-arc4random.c bsd-closefrom.c bsd-misc.c fmt_scaled.c \ +SRCS+= bsd-arc4random.c bsd-misc.c fmt_scaled.c \ getrrsetbyname.c openssl-compat.c port-tun.c strtonum.c \ vis.c xcrypt.c xmmap.c # FreeBSD additions From owner-svn-src-stable@FreeBSD.ORG Wed Jul 15 08:32:20 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 19C79106566C; Wed, 15 Jul 2009 08:32:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0638D8FC1A; Wed, 15 Jul 2009 08:32:20 +0000 (UTC) (envelope-from ed@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 n6F8WJnx085522; Wed, 15 Jul 2009 08:32:19 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6F8WJeh085517; Wed, 15 Jul 2009 08:32:19 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200907150832.n6F8WJeh085517@svn.freebsd.org> From: Ed Schouten Date: Wed, 15 Jul 2009 08:32:19 +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: r195706 - in stable/7/sys: . amd64/conf contrib/pf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf 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, 15 Jul 2009 08:32:21 -0000 Author: ed Date: Wed Jul 15 08:32:19 2009 New Revision: 195706 URL: http://svn.freebsd.org/changeset/base/195706 Log: MFC r195295: Enable POSIX semaphores on all non-embedded architectures by default. More applications (including Firefox) seem to depend on this nowadays, so not having this enabled by default is a bad idea. Proposed by: miwi Patch by: Florian Smeets Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/conf/GENERIC stable/7/sys/contrib/pf/ (props changed) stable/7/sys/i386/conf/GENERIC stable/7/sys/ia64/conf/GENERIC stable/7/sys/pc98/conf/GENERIC stable/7/sys/powerpc/conf/GENERIC stable/7/sys/sparc64/conf/GENERIC stable/7/sys/sun4v/conf/GENERIC Modified: stable/7/sys/amd64/conf/GENERIC ============================================================================== --- stable/7/sys/amd64/conf/GENERIC Wed Jul 15 00:56:15 2009 (r195705) +++ stable/7/sys/amd64/conf/GENERIC Wed Jul 15 08:32:19 2009 (r195706) @@ -58,6 +58,7 @@ options STACK # stack(9) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores +options P1003_1B_SEMAPHORES # POSIX-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev options ADAPTIVE_GIANT # Giant mutex is adaptive. Modified: stable/7/sys/i386/conf/GENERIC ============================================================================== --- stable/7/sys/i386/conf/GENERIC Wed Jul 15 00:56:15 2009 (r195705) +++ stable/7/sys/i386/conf/GENERIC Wed Jul 15 08:32:19 2009 (r195706) @@ -59,6 +59,7 @@ options STACK # stack(9) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores +options P1003_1B_SEMAPHORES # POSIX-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev options ADAPTIVE_GIANT # Giant mutex is adaptive. Modified: stable/7/sys/ia64/conf/GENERIC ============================================================================== --- stable/7/sys/ia64/conf/GENERIC Wed Jul 15 00:56:15 2009 (r195705) +++ stable/7/sys/ia64/conf/GENERIC Wed Jul 15 08:32:19 2009 (r195706) @@ -55,6 +55,7 @@ options STACK # stack(9) support options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options SYSVSHM # SYSV-style shared memory +options P1003_1B_SEMAPHORES # POSIX-style semaphores options UFS_ACL # Support for access control lists options UFS_DIRHASH # Hash-based directory lookup scheme options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B RT extensions Modified: stable/7/sys/pc98/conf/GENERIC ============================================================================== --- stable/7/sys/pc98/conf/GENERIC Wed Jul 15 00:56:15 2009 (r195705) +++ stable/7/sys/pc98/conf/GENERIC Wed Jul 15 08:32:19 2009 (r195706) @@ -62,6 +62,7 @@ options STACK # stack(9) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores +options P1003_1B_SEMAPHORES # POSIX-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev options AUDIT # Security event auditing Modified: stable/7/sys/powerpc/conf/GENERIC ============================================================================== --- stable/7/sys/powerpc/conf/GENERIC Wed Jul 15 00:56:15 2009 (r195705) +++ stable/7/sys/powerpc/conf/GENERIC Wed Jul 15 08:32:19 2009 (r195706) @@ -60,6 +60,7 @@ options STACK #stack(9) support options SYSVSHM #SYSV-style shared memory options SYSVMSG #SYSV-style message queues options SYSVSEM #SYSV-style semaphores +options P1003_1B_SEMAPHORES # POSIX-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions options AUDIT # Security event auditing Modified: stable/7/sys/sparc64/conf/GENERIC ============================================================================== --- stable/7/sys/sparc64/conf/GENERIC Wed Jul 15 00:56:15 2009 (r195705) +++ stable/7/sys/sparc64/conf/GENERIC Wed Jul 15 08:32:19 2009 (r195706) @@ -61,6 +61,7 @@ options STACK # stack(9) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores +options P1003_1B_SEMAPHORES # POSIX-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options ADAPTIVE_GIANT # Giant mutex is adaptive. options AUDIT # Security event auditing Modified: stable/7/sys/sun4v/conf/GENERIC ============================================================================== --- stable/7/sys/sun4v/conf/GENERIC Wed Jul 15 00:56:15 2009 (r195705) +++ stable/7/sys/sun4v/conf/GENERIC Wed Jul 15 08:32:19 2009 (r195706) @@ -60,6 +60,7 @@ options STACK # stack(9) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores +options P1003_1B_SEMAPHORES # POSIX-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options AHC_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~128k to driver. From owner-svn-src-stable@FreeBSD.ORG Wed Jul 15 10:08:19 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 E59C2106566B; Wed, 15 Jul 2009 10:08:19 +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 D1A0F8FC1A; Wed, 15 Jul 2009 10:08:19 +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 n6FA8Ja7087977; Wed, 15 Jul 2009 10:08:19 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6FA8JcM087975; Wed, 15 Jul 2009 10:08:19 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200907151008.n6FA8JcM087975@svn.freebsd.org> From: Alexander Motin Date: Wed, 15 Jul 2009 10:08:19 +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: r195708 - in stable/7/sys: . contrib/pf dev/sound/pci/hda 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, 15 Jul 2009 10:08:20 -0000 Author: mav Date: Wed Jul 15 10:08:19 2009 New Revision: 195708 URL: http://svn.freebsd.org/changeset/base/195708 Log: MFC r188656, r189086, r189127, r190630, r193228, r193642, r194177, r194861, r195690. Sync snd_hda driver with HEAD, except latest "Sound Mega-commit" r193640. Except some fixes, this commit also enables MSI interrupts usage by default, when supported, except some reported to be broken chips. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/sound/pci/hda/hdac.c Modified: stable/7/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/7/sys/dev/sound/pci/hda/hdac.c Wed Jul 15 09:19:01 2009 (r195707) +++ stable/7/sys/dev/sound/pci/hda/hdac.c Wed Jul 15 10:08:19 2009 (r195708) @@ -83,7 +83,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20090329_0131" +#define HDA_DRV_TEST_REV "20090624_0136" SND_DECLARE_FILE("$FreeBSD$"); @@ -109,12 +109,6 @@ SND_DECLARE_FILE("$FreeBSD$"); #define hdac_lockassert(sc) snd_mtxassert((sc)->lock) #define hdac_lockowned(sc) mtx_owned((sc)->lock) -#undef HDAC_MSI_ENABLED -#if __FreeBSD_version >= 700026 || \ - (__FreeBSD_version < 700000 && __FreeBSD_version >= 602106) -#define HDAC_MSI_ENABLED 1 -#endif - #define HDA_FLAG_MATCH(fl, v) (((fl) & (v)) == (v)) #define HDA_DEV_MATCH(fl, v) ((fl) == (v) || \ (fl) == 0xffffffff || \ @@ -267,6 +261,7 @@ SND_DECLARE_FILE("$FreeBSD$"); #define ASUS_A7T_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x13c2) #define ASUS_W2J_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x1971) #define ASUS_M5200_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x1993) +#define ASUS_P5PL2_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x817f) #define ASUS_P1AH2_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x81cb) #define ASUS_M2NPVMX_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x81cb) #define ASUS_M2V_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x81e7) @@ -474,53 +469,57 @@ static uint32_t hdac_fmt[] = { static struct pcmchan_caps hdac_caps = {48000, 48000, hdac_fmt, 0}; +#define HDAC_NO_MSI 1 +#define HDAC_NO_64BIT 2 + static const struct { uint32_t model; char *desc; + char flags; } hdac_devices[] = { - { HDA_INTEL_82801F, "Intel 82801F" }, - { HDA_INTEL_63XXESB, "Intel 631x/632xESB" }, - { HDA_INTEL_82801G, "Intel 82801G" }, - { HDA_INTEL_82801H, "Intel 82801H" }, - { HDA_INTEL_82801I, "Intel 82801I" }, - { HDA_INTEL_82801J, "Intel 82801J" }, - { HDA_INTEL_PCH, "Intel PCH" }, - { HDA_INTEL_SCH, "Intel SCH" }, - { HDA_NVIDIA_MCP51, "NVidia MCP51" }, - { HDA_NVIDIA_MCP55, "NVidia MCP55" }, - { HDA_NVIDIA_MCP61_1, "NVidia MCP61" }, - { HDA_NVIDIA_MCP61_2, "NVidia MCP61" }, - { HDA_NVIDIA_MCP65_1, "NVidia MCP65" }, - { HDA_NVIDIA_MCP65_2, "NVidia MCP65" }, - { HDA_NVIDIA_MCP67_1, "NVidia MCP67" }, - { HDA_NVIDIA_MCP67_2, "NVidia MCP67" }, - { HDA_NVIDIA_MCP73_1, "NVidia MCP73" }, - { HDA_NVIDIA_MCP73_2, "NVidia MCP73" }, - { HDA_NVIDIA_MCP78_1, "NVidia MCP78" }, - { HDA_NVIDIA_MCP78_2, "NVidia MCP78" }, - { HDA_NVIDIA_MCP78_3, "NVidia MCP78" }, - { HDA_NVIDIA_MCP78_4, "NVidia MCP78" }, - { HDA_NVIDIA_MCP79_1, "NVidia MCP79" }, - { HDA_NVIDIA_MCP79_2, "NVidia MCP79" }, - { HDA_NVIDIA_MCP79_3, "NVidia MCP79" }, - { HDA_NVIDIA_MCP79_4, "NVidia MCP79" }, - { HDA_ATI_SB450, "ATI SB450" }, - { HDA_ATI_SB600, "ATI SB600" }, - { HDA_ATI_RS600, "ATI RS600" }, - { HDA_ATI_RS690, "ATI RS690" }, - { HDA_ATI_RS780, "ATI RS780" }, - { HDA_ATI_R600, "ATI R600" }, - { HDA_ATI_RV610, "ATI RV610" }, - { HDA_ATI_RV620, "ATI RV620" }, - { HDA_ATI_RV630, "ATI RV630" }, - { HDA_ATI_RV635, "ATI RV635" }, - { HDA_ATI_RV710, "ATI RV710" }, - { HDA_ATI_RV730, "ATI RV730" }, - { HDA_ATI_RV740, "ATI RV740" }, - { HDA_ATI_RV770, "ATI RV770" }, - { HDA_VIA_VT82XX, "VIA VT8251/8237A" }, - { HDA_SIS_966, "SiS 966" }, - { HDA_ULI_M5461, "ULI M5461" }, + { HDA_INTEL_82801F, "Intel 82801F", 0 }, + { HDA_INTEL_63XXESB, "Intel 631x/632xESB", 0 }, + { HDA_INTEL_82801G, "Intel 82801G", 0 }, + { HDA_INTEL_82801H, "Intel 82801H", 0 }, + { HDA_INTEL_82801I, "Intel 82801I", 0 }, + { HDA_INTEL_82801J, "Intel 82801J", 0 }, + { HDA_INTEL_PCH, "Intel PCH", 0 }, + { HDA_INTEL_SCH, "Intel SCH", 0 }, + { HDA_NVIDIA_MCP51, "NVidia MCP51", HDAC_NO_MSI }, + { HDA_NVIDIA_MCP55, "NVidia MCP55", HDAC_NO_MSI }, + { HDA_NVIDIA_MCP61_1, "NVidia MCP61", 0 }, + { HDA_NVIDIA_MCP61_2, "NVidia MCP61", 0 }, + { HDA_NVIDIA_MCP65_1, "NVidia MCP65", 0 }, + { HDA_NVIDIA_MCP65_2, "NVidia MCP65", 0 }, + { HDA_NVIDIA_MCP67_1, "NVidia MCP67", 0 }, + { HDA_NVIDIA_MCP67_2, "NVidia MCP67", 0 }, + { HDA_NVIDIA_MCP73_1, "NVidia MCP73", 0 }, + { HDA_NVIDIA_MCP73_2, "NVidia MCP73", 0 }, + { HDA_NVIDIA_MCP78_1, "NVidia MCP78", HDAC_NO_64BIT }, + { HDA_NVIDIA_MCP78_2, "NVidia MCP78", HDAC_NO_64BIT }, + { HDA_NVIDIA_MCP78_3, "NVidia MCP78", HDAC_NO_64BIT }, + { HDA_NVIDIA_MCP78_4, "NVidia MCP78", HDAC_NO_64BIT }, + { HDA_NVIDIA_MCP79_1, "NVidia MCP79", 0 }, + { HDA_NVIDIA_MCP79_2, "NVidia MCP79", 0 }, + { HDA_NVIDIA_MCP79_3, "NVidia MCP79", 0 }, + { HDA_NVIDIA_MCP79_4, "NVidia MCP79", 0 }, + { HDA_ATI_SB450, "ATI SB450", 0 }, + { HDA_ATI_SB600, "ATI SB600", 0 }, + { HDA_ATI_RS600, "ATI RS600", 0 }, + { HDA_ATI_RS690, "ATI RS690", 0 }, + { HDA_ATI_RS780, "ATI RS780", 0 }, + { HDA_ATI_R600, "ATI R600", 0 }, + { HDA_ATI_RV610, "ATI RV610", 0 }, + { HDA_ATI_RV620, "ATI RV620", 0 }, + { HDA_ATI_RV630, "ATI RV630", 0 }, + { HDA_ATI_RV635, "ATI RV635", 0 }, + { HDA_ATI_RV710, "ATI RV710", 0 }, + { HDA_ATI_RV730, "ATI RV730", 0 }, + { HDA_ATI_RV740, "ATI RV740", 0 }, + { HDA_ATI_RV770, "ATI RV770", 0 }, + { HDA_VIA_VT82XX, "VIA VT8251/8237A",0 }, + { HDA_SIS_966, "SiS 966", 0 }, + { HDA_ULI_M5461, "ULI M5461", 0 }, /* Unknown */ { HDA_INTEL_ALL, "Intel (Unknown)" }, { HDA_NVIDIA_ALL, "NVidia (Unknown)" }, @@ -1593,20 +1592,19 @@ hdac_dma_alloc(struct hdac_softc *sc, st { bus_size_t roundsz; int result; - int lowaddr; roundsz = roundup2(size, HDAC_DMA_ALIGNMENT); - lowaddr = (sc->support_64bit) ? BUS_SPACE_MAXADDR : - BUS_SPACE_MAXADDR_32BIT; bzero(dma, sizeof(*dma)); /* * Create a DMA tag */ - result = bus_dma_tag_create(NULL, /* parent */ + result = bus_dma_tag_create( + bus_get_dma_tag(sc->dev), /* parent */ HDAC_DMA_ALIGNMENT, /* alignment */ 0, /* boundary */ - lowaddr, /* lowaddr */ + (sc->support_64bit) ? BUS_SPACE_MAXADDR : + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, /* filtfunc */ NULL, /* fistfuncarg */ @@ -1751,13 +1749,11 @@ hdac_irq_alloc(struct hdac_softc *sc) irq = &sc->irq; irq->irq_rid = 0x0; -#ifdef HDAC_MSI_ENABLED if ((sc->flags & HDAC_F_MSI) && (result = pci_msi_count(sc->dev)) == 1 && pci_alloc_msi(sc->dev, &result) == 0) irq->irq_rid = 0x1; else -#endif sc->flags &= ~HDAC_F_MSI; irq->irq_res = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, @@ -1800,10 +1796,8 @@ hdac_irq_free(struct hdac_softc *sc) if (irq->irq_res != NULL) bus_release_resource(sc->dev, SYS_RES_IRQ, irq->irq_rid, irq->irq_res); -#ifdef HDAC_MSI_ENABLED - if ((sc->flags & HDAC_F_MSI) && irq->irq_rid == 0x1) + if (irq->irq_rid == 0x1) pci_release_msi(sc->dev); -#endif irq->irq_handle = NULL; irq->irq_res = NULL; irq->irq_rid = 0x0; @@ -2432,13 +2426,20 @@ hdac_widget_pin_getconfig(struct hdac_wi /* New patches */ if (id == HDA_CODEC_AD1986A && (sc->pci_subvendor == ASUS_M2NPVMX_SUBVENDOR || - sc->pci_subvendor == ASUS_A8NVMCSM_SUBVENDOR)) { + sc->pci_subvendor == ASUS_A8NVMCSM_SUBVENDOR || + sc->pci_subvendor == ASUS_P5PL2_SUBVENDOR)) { switch (nid) { - case 28: /* 5.1 out => 2.0 out + 2 inputs */ + case 26: /* Headphones with redirection */ + patch = "as=1 seq=15"; + break; + case 28: /* 5.1 out => 2.0 out + 1 input */ patch = "device=Line-in as=8 seq=1"; break; - case 29: - patch = "device=Mic as=8 seq=2"; + case 29: /* Can't use this as input, as the only available mic + * preamplifier is busy by front panel mic (nid 31). + * If you want to use this rear connector as mic input, + * you have to disable the front panel one. */ + patch = "as=0"; break; case 31: /* Lot of inputs configured with as=15 and unusable */ patch = "as=8 seq=3"; @@ -3990,12 +3991,32 @@ hdac_attach(device_t dev) { struct hdac_softc *sc; int result; - int i; + int i, devid = -1; + uint32_t model; + uint16_t class, subclass; uint16_t vendor; uint8_t v; device_printf(dev, "HDA Driver Revision: %s\n", HDA_DRV_TEST_REV); + model = (uint32_t)pci_get_device(dev) << 16; + model |= (uint32_t)pci_get_vendor(dev) & 0x0000ffff; + class = pci_get_class(dev); + subclass = pci_get_subclass(dev); + + for (i = 0; i < HDAC_DEVICES_LEN; i++) { + if (hdac_devices[i].model == model) { + devid = i; + break; + } + if (HDA_DEV_MATCH(hdac_devices[i].model, model) && + class == PCIC_MULTIMEDIA && + subclass == PCIS_MULTIMEDIA_HDA) { + devid = i; + break; + } + } + sc = device_get_softc(dev); sc->lock = snd_mtxcreate(device_get_nameunit(dev), HDAC_MTX_NAME); sc->dev = dev; @@ -4022,29 +4043,6 @@ hdac_attach(device_t dev) else sc->polling = 0; - result = bus_dma_tag_create(NULL, /* parent */ - HDAC_DMA_ALIGNMENT, /* alignment */ - 0, /* boundary */ - BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, /* filtfunc */ - NULL, /* fistfuncarg */ - HDA_BUFSZ_MAX, /* maxsize */ - 1, /* nsegments */ - HDA_BUFSZ_MAX, /* maxsegsz */ - 0, /* flags */ - NULL, /* lockfunc */ - NULL, /* lockfuncarg */ - &sc->chan_dmat); /* dmat */ - if (result != 0) { - device_printf(dev, "%s: bus_dma_tag_create failed (%x)\n", - __func__, result); - snd_mtxfree(sc->lock); - free(sc, M_DEVBUF); - return (ENXIO); - } - - sc->hdabus = NULL; for (i = 0; i < HDAC_CODEC_MAX; i++) sc->codecs[i] = NULL; @@ -4061,14 +4059,17 @@ hdac_attach(device_t dev) ); } -#ifdef HDAC_MSI_ENABLED - if (resource_int_value(device_get_name(dev), - device_get_unit(dev), "msi", &i) == 0 && i != 0 && - pci_msi_count(dev) == 1) - sc->flags |= HDAC_F_MSI; - else -#endif + if (devid >= 0 && (hdac_devices[devid].flags & HDAC_NO_MSI)) sc->flags &= ~HDAC_F_MSI; + else + sc->flags |= HDAC_F_MSI; + if (resource_int_value(device_get_name(dev), + device_get_unit(dev), "msi", &i) == 0) { + if (i == 0) + sc->flags &= ~HDAC_F_MSI; + else + sc->flags |= HDAC_F_MSI; + } #if defined(__i386__) || defined(__amd64__) sc->flags |= HDAC_F_DMA_NOCACHE; @@ -4138,6 +4139,9 @@ hdac_attach(device_t dev) if (result != 0) goto hdac_attach_fail; + if (devid >= 0 && (hdac_devices[devid].flags & HDAC_NO_64BIT)) + sc->support_64bit = 0; + /* Allocate CORB and RIRB dma memory */ result = hdac_dma_alloc(sc, &sc->corb_dma, sc->corb_size * sizeof(uint32_t)); @@ -4148,6 +4152,28 @@ hdac_attach(device_t dev) if (result != 0) goto hdac_attach_fail; + result = bus_dma_tag_create( + bus_get_dma_tag(sc->dev), /* parent */ + HDAC_DMA_ALIGNMENT, /* alignment */ + 0, /* boundary */ + (sc->support_64bit) ? BUS_SPACE_MAXADDR : + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, /* filtfunc */ + NULL, /* fistfuncarg */ + HDA_BUFSZ_MAX, /* maxsize */ + 1, /* nsegments */ + HDA_BUFSZ_MAX, /* maxsegsz */ + 0, /* flags */ + NULL, /* lockfunc */ + NULL, /* lockfuncarg */ + &sc->chan_dmat); /* dmat */ + if (result != 0) { + device_printf(dev, "%s: bus_dma_tag_create failed (%x)\n", + __func__, result); + goto hdac_attach_fail; + } + /* Quiesce everything */ HDA_BOOTHVERBOSE( device_printf(dev, "Reset controller...\n"); @@ -4633,6 +4659,7 @@ hdac_vendor_patch_parse(struct hdac_devi } switch (id) { +#if 0 case HDA_CODEC_ALC883: /* * nid: 24/25 = External (jack) or Internal (fixed) Mic. @@ -4662,6 +4689,7 @@ hdac_vendor_patch_parse(struct hdac_devi * nid: 26 = Line-in, leave it alone. */ break; +#endif case HDA_CODEC_AD1983: /* * This codec has several possible usages, but none @@ -4715,6 +4743,35 @@ hdac_vendor_patch_parse(struct hdac_devi w = hdac_widget_get(devinfo, 15); if (w != NULL) w->connsenable[3] = 0; + /* There is only one mic preamplifier, use it effectively. */ + w = hdac_widget_get(devinfo, 31); + if (w != NULL) { + if ((w->wclass.pin.config & + HDA_CONFIG_DEFAULTCONF_DEVICE_MASK) == + HDA_CONFIG_DEFAULTCONF_DEVICE_MIC_IN) { + w = hdac_widget_get(devinfo, 16); + if (w != NULL) + w->connsenable[2] = 0; + } else { + w = hdac_widget_get(devinfo, 15); + if (w != NULL) + w->connsenable[0] = 0; + } + } + w = hdac_widget_get(devinfo, 32); + if (w != NULL) { + if ((w->wclass.pin.config & + HDA_CONFIG_DEFAULTCONF_DEVICE_MASK) == + HDA_CONFIG_DEFAULTCONF_DEVICE_MIC_IN) { + w = hdac_widget_get(devinfo, 16); + if (w != NULL) + w->connsenable[0] = 0; + } else { + w = hdac_widget_get(devinfo, 15); + if (w != NULL) + w->connsenable[1] = 0; + } + } if (subvendor == ASUS_A8X_SUBVENDOR) { /* From owner-svn-src-stable@FreeBSD.ORG Thu Jul 16 08:27:12 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 BE96E106566C; Thu, 16 Jul 2009 08:27:12 +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 ABA7A8FC14; Thu, 16 Jul 2009 08:27:12 +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 n6G8RCYW017164; Thu, 16 Jul 2009 08:27:12 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6G8RC05017163; Thu, 16 Jul 2009 08:27:12 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200907160827.n6G8RC05017163@svn.freebsd.org> From: Alexander Motin Date: Thu, 16 Jul 2009 08:27:12 +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: r195714 - in stable/7/sys: . contrib/pf dev/acpica 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, 16 Jul 2009 08:27:13 -0000 Author: mav Date: Thu Jul 16 08:27:12 2009 New Revision: 195714 URL: http://svn.freebsd.org/changeset/base/195714 Log: MFC rev. 191760, 191763, 191764. Avoid comparing negative signed to positive unsignad values. It was leading to a bug, when C-state does not decrease on sleep shorter then declared transition latency. Fixing this deprecates workaround for broken C-states on some hardware. By the way, change state selecting logic a bit. Instead of last sleep time use short-time average of it. Global interrupts rate in system is a quite random value, to corellate subsequent sleeps so directly. Make dev.cpu.X.cx_usage sysctl also report current average of sleep time. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/acpica/acpi_cpu.c Modified: stable/7/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/7/sys/dev/acpica/acpi_cpu.c Wed Jul 15 22:27:36 2009 (r195713) +++ stable/7/sys/dev/acpica/acpi_cpu.c Thu Jul 16 08:27:12 2009 (r195714) @@ -79,7 +79,6 @@ struct acpi_cpu_softc { int cpu_features; /* Child driver supported features. */ /* Runtime state. */ int cpu_non_c3; /* Index of lowest non-C3 state. */ - int cpu_short_slp; /* Count of < 1us sleeps. */ u_int cpu_cx_stats[MAX_CX_STATES];/* Cx usage history. */ /* Values for sysctl. */ struct sysctl_ctx_list cpu_sysctl_ctx; @@ -875,43 +874,13 @@ acpi_cpu_idle() return; } - /* - * If we slept 100 us or more, use the lowest Cx state. Otherwise, - * find the lowest state that has a latency less than or equal to - * the length of our last sleep. - */ - cx_next_idx = sc->cpu_cx_lowest; - if (sc->cpu_prev_sleep < 100) { - /* - * If we sleep too short all the time, this system may not implement - * C2/3 correctly (i.e. reads return immediately). In this case, - * back off and use the next higher level. - * It seems that when you have a dual core cpu (like the Intel Core Duo) - * that both cores will get out of C3 state as soon as one of them - * requires it. This breaks the sleep detection logic as the sleep - * counter is local to each cpu. Disable the sleep logic for now as a - * workaround if there's more than one CPU. The right fix would probably - * be to add quirks for system that don't really support C3 state. - */ - if (mp_ncpus < 2 && sc->cpu_prev_sleep <= 1) { - sc->cpu_short_slp++; - if (sc->cpu_short_slp == 1000 && sc->cpu_cx_lowest != 0) { - if (sc->cpu_non_c3 == sc->cpu_cx_lowest && sc->cpu_non_c3 != 0) - sc->cpu_non_c3--; - sc->cpu_cx_lowest--; - sc->cpu_short_slp = 0; - device_printf(sc->cpu_dev, - "too many short sleeps, backing off to C%d\n", - sc->cpu_cx_lowest + 1); - } - } else - sc->cpu_short_slp = 0; - - for (i = sc->cpu_cx_lowest; i >= 0; i--) - if (sc->cpu_cx_states[i].trans_lat <= sc->cpu_prev_sleep) { - cx_next_idx = i; - break; - } + /* Find the lowest state that has small enough latency. */ + cx_next_idx = 0; + for (i = sc->cpu_cx_lowest; i >= 0; i--) { + if (sc->cpu_cx_states[i].trans_lat * 3 <= sc->cpu_prev_sleep) { + cx_next_idx = i; + break; + } } /* @@ -936,10 +905,10 @@ acpi_cpu_idle() /* * Execute HLT (or equivalent) and wait for an interrupt. We can't * calculate the time spent in C1 since the place we wake up is an - * ISR. Assume we slept one quantum and return. + * ISR. Assume we slept half of quantum and return. */ if (cx_next->type == ACPI_STATE_C1) { - sc->cpu_prev_sleep = 1000000 / hz; + sc->cpu_prev_sleep = (sc->cpu_prev_sleep * 3 + 500000 / hz) / 4; acpi_cpu_c1(); return; } @@ -982,9 +951,9 @@ acpi_cpu_idle() } ACPI_ENABLE_IRQS(); - /* Find the actual time asleep in microseconds, minus overhead. */ + /* Find the actual time asleep in microseconds. */ end_time = acpi_TimerDelta(end_time, start_time); - sc->cpu_prev_sleep = PM_USEC(end_time) - cx_next->trans_lat; + sc->cpu_prev_sleep = (sc->cpu_prev_sleep * 3 + PM_USEC(end_time)) / 4; } /* @@ -1106,8 +1075,9 @@ acpi_cpu_usage_sysctl(SYSCTL_HANDLER_ARG sbuf_printf(&sb, "%u.%02u%% ", (u_int)(whole / sum), (u_int)(fract / sum)); } else - sbuf_printf(&sb, "0%% "); + sbuf_printf(&sb, "0.00%% "); } + sbuf_printf(&sb, "last %dus", sc->cpu_prev_sleep); sbuf_trim(&sb); sbuf_finish(&sb); sysctl_handle_string(oidp, sbuf_data(&sb), sbuf_len(&sb), req); From owner-svn-src-stable@FreeBSD.ORG Fri Jul 17 07:07:39 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 0FAD5106566C; Fri, 17 Jul 2009 07:07:39 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D692D8FC17; Fri, 17 Jul 2009 07:07:38 +0000 (UTC) (envelope-from des@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 n6H77c9n057856; Fri, 17 Jul 2009 07:07:38 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6H77cfp057855; Fri, 17 Jul 2009 07:07:38 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200907170707.n6H77cfp057855@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Fri, 17 Jul 2009 07:07:38 +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: r195733 - in stable/7/share/man/man4: . man4.i386 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: Fri, 17 Jul 2009 07:07:39 -0000 Author: des Date: Fri Jul 17 07:07:38 2009 New Revision: 195733 URL: http://svn.freebsd.org/changeset/base/195733 Log: merge r181967: delete duplicate ichwd(4) Deleted: stable/7/share/man/man4/man4.i386/ichwd.4 Modified: stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/ichwd.4 stable/7/share/man/man4/man4.i386/Makefile Modified: stable/7/share/man/man4/ichwd.4 ============================================================================== --- stable/7/share/man/man4/ichwd.4 Fri Jul 17 02:28:27 2009 (r195732) +++ stable/7/share/man/man4/ichwd.4 Fri Jul 17 07:07:38 2009 (r195733) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 23, 2007 +.Dd August 20, 2008 .Dt ICHWD 4 .Os .Sh NAME @@ -50,12 +50,29 @@ The .Nm driver provides .Xr watchdog 4 -support for the watchdog interrupt timer present in -the Intel ICH motherboard chipsets. +support for the watchdog interrupt timer present on +all Intel ICH motherboard chipsets. +.Pp +The ICH WDT counts down in ticks of approximately 0.6 seconds; the +exact value depends on hardware quality and environmental factors. +Supported watchdog intervals range from 2 to 63 ticks. +.Pp +Note that on some ICH-based systems, the WDT may be present but +disabled, either in hardware or by the BIOS. +The +.Nm +driver attempts to detect this condition and will refuse to attach if +it believes the WDT is disabled. .Sh SEE ALSO .Xr watchdog 4 , .Xr watchdog 8 , -.Xr watchdogd 8 +.Xr watchdogd 8, +.Xr watchdog 9 +.Rs +.%T Using the Intel ICH Family Watchdog Timer (WDT) +.%R Intel Application Note AP-725 +.%O Document Number 292273-001 +.Re .Sh HISTORY The .Nm @@ -65,8 +82,9 @@ driver first appeared in .An -nosplit The .Nm -driver was originally written by -.An Wm. Daryl Hawkins -of Texas A&M University. +driver was written by +.An Wm. Daryl Hawkins Aq dhawkins@tamu.edu +of Texas A&M University and +.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org . This manual page was written by .An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org . Modified: stable/7/share/man/man4/man4.i386/Makefile ============================================================================== --- stable/7/share/man/man4/man4.i386/Makefile Fri Jul 17 02:28:27 2009 (r195732) +++ stable/7/share/man/man4/man4.i386/Makefile Fri Jul 17 07:07:38 2009 (r195733) @@ -25,7 +25,6 @@ MAN= acpi_aiboost.4 \ ex.4 \ fe.4 \ glxsb.4 \ - ichwd.4 \ ie.4 \ io.4 \ linux.4 \ From owner-svn-src-stable@FreeBSD.ORG Sat Jul 18 20:19:26 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 71F99106566C; Sat, 18 Jul 2009 20:19:26 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CE8C8FC20; Sat, 18 Jul 2009 20:19:26 +0000 (UTC) (envelope-from brian@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 n6IKJQXx010798; Sat, 18 Jul 2009 20:19:26 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6IKJPIX010790; Sat, 18 Jul 2009 20:19:25 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <200907182019.n6IKJPIX010790@svn.freebsd.org> From: Brian Somers Date: Sat, 18 Jul 2009 20:19: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: r195756 - in stable/7: share/man/man8 usr.bin/ypcat usr.bin/ypmatch usr.bin/ypwhich usr.sbin/ypserv 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, 18 Jul 2009 20:19:27 -0000 Author: brian Date: Sat Jul 18 20:19:25 2009 New Revision: 195756 URL: http://svn.freebsd.org/changeset/base/195756 Log: MFC: Support shadow.byname and shadow.byuid maps, protecting them by insisting on privileged port access. Include /var/yp/Makefile.local if it exists and suggest using it to override /var/yp/Makefile behaviour. Modified: stable/7/share/man/man8/ (props changed) stable/7/share/man/man8/yp.8 stable/7/usr.bin/ypcat/ (props changed) stable/7/usr.bin/ypcat/ypcat.c stable/7/usr.bin/ypmatch/ (props changed) stable/7/usr.bin/ypmatch/ypmatch.c stable/7/usr.bin/ypwhich/ (props changed) stable/7/usr.bin/ypwhich/ypwhich.c stable/7/usr.sbin/ypserv/ (props changed) stable/7/usr.sbin/ypserv/Makefile.yp stable/7/usr.sbin/ypserv/yp_access.c stable/7/usr.sbin/ypserv/ypserv.8 Modified: stable/7/share/man/man8/yp.8 ============================================================================== --- stable/7/share/man/man8/yp.8 Sat Jul 18 17:38:18 2009 (r195755) +++ stable/7/share/man/man8/yp.8 Sat Jul 18 20:19:25 2009 (r195756) @@ -28,7 +28,7 @@ .\" from: @(#)yp.8 1.0 (deraadt) 4/26/93 .\" $FreeBSD$ .\" -.Dd April 5, 1993 +.Dd June 25, 2009 .Dt YP 8 .Os .Sh NAME @@ -310,9 +310,15 @@ The .Tn NIS .Pa Makefile .Pq Pa /var/yp/Makefile -will do this automatically if the administrator comments out the -line which says -.Dq Li NOPUSH=true +will do this automatically if the administrator creates +.Pa /var/yp/Makefile.local +and empties the +.Va NOPUSH +variable: +.Bd -literal -offset four +.Li NOPUSH= +.Ed +.Pp .Va ( NOPUSH is set to true by default because the default configuration is for a small network with only one @@ -394,9 +400,11 @@ To help prevent this, .Fx Ns 's .Tn NIS server handles the shadow password maps -.Pa ( master.passwd.byname +.Pa ( master.passwd.byname , +.Pa master.passwd.byuid , +.Pa shadow.byname and -.Pa master.passwd.byuid ) +.Pa shadow.byuid ) in a special way: the server will only provide access to these maps in response to requests that originate on privileged ports. Since only the super-user is allowed to bind to a privileged port, Modified: stable/7/usr.bin/ypcat/ypcat.c ============================================================================== --- stable/7/usr.bin/ypcat/ypcat.c Sat Jul 18 17:38:18 2009 (r195755) +++ stable/7/usr.bin/ypcat/ypcat.c Sat Jul 18 20:19:25 2009 (r195756) @@ -52,6 +52,7 @@ struct ypalias { } ypaliases[] = { { "passwd", "passwd.byname" }, { "master.passwd", "master.passwd.byname" }, + { "shadow", "shadow.byname" }, { "group", "group.byname" }, { "networks", "networks.byaddr" }, { "hosts", "hosts.byaddr" }, Modified: stable/7/usr.bin/ypmatch/ypmatch.c ============================================================================== --- stable/7/usr.bin/ypmatch/ypmatch.c Sat Jul 18 17:38:18 2009 (r195755) +++ stable/7/usr.bin/ypmatch/ypmatch.c Sat Jul 18 20:19:25 2009 (r195756) @@ -52,6 +52,7 @@ struct ypalias { } ypaliases[] = { { "passwd", "passwd.byname" }, { "master.passwd", "master.passwd.byname" }, + { "shadow", "shadow.byname" }, { "group", "group.byname" }, { "networks", "networks.byaddr" }, { "hosts", "hosts.byname" }, Modified: stable/7/usr.bin/ypwhich/ypwhich.c ============================================================================== --- stable/7/usr.bin/ypwhich/ypwhich.c Sat Jul 18 17:38:18 2009 (r195755) +++ stable/7/usr.bin/ypwhich/ypwhich.c Sat Jul 18 20:19:25 2009 (r195756) @@ -64,6 +64,7 @@ struct ypalias { } ypaliases[] = { { "passwd", "passwd.byname" }, { "master.passwd", "master.passwd.byname" }, + { "shadow", "shadow.byname" }, { "group", "group.byname" }, { "networks", "networks.byaddr" }, { "hosts", "hosts.byaddr" }, Modified: stable/7/usr.sbin/ypserv/Makefile.yp ============================================================================== --- stable/7/usr.sbin/ypserv/Makefile.yp Sat Jul 18 17:38:18 2009 (r195755) +++ stable/7/usr.sbin/ypserv/Makefile.yp Sat Jul 18 20:19:25 2009 (r195756) @@ -11,33 +11,40 @@ # This Makefile can be modified to support more NIS maps if desired. # -# If this machine is an NIS master, comment out this next line so -# that changes to the NIS maps can be propagated to the slave servers. -# (By default we assume that we are only serving a small domain with -# only one server.) +# If this machine is an NIS master, reset this variable (NOPUSH=) +# in Makefile.local so that changes to the NIS maps can be propagated to +# the slave servers. (By default we assume that we are only serving a +# small domain with only one server.) # NOPUSH = "True" +# If this machine does not wish to generate a linux-style shadow map +# from the master.passwd file, reset this variable (SHADOW=) in +# Makefile.local. +SHADOW = "True" + # If you want to use a FreeBSD NIS server to serve non-FreeBSD clients # (i.e. clients who expect the password field in the passwd maps to be -# valid) then uncomment this line. This will cause $YPDIR/passwd to -# be generated with valid password fields. This is insecure: FreeBSD -# normally only serves the master.passwd maps (which have real encrypted -# passwords in them) to the superuser on other FreeBSD machines, but -# non-FreeBSD clients (e.g. SunOS, Solaris (without NIS+), IRIX, HP-UX, -# etc...) will only work properly in 'unsecure' mode. +# valid) then set this variable (UNSECURE="True") in Makefile.local. +# This will cause $YPDIR/passwd to be generated with valid password +# fields. This is insecure: FreeBSD normally only serves the +# master.passwd and shadow maps (which have real encrypted passwords +# in them) to the superuser on other FreeBSD machines, but non-FreeBSD +# clients (e.g. SunOS, Solaris (without NIS+), IRIX, HP-UX, etc...) +# will only work properly in 'unsecure' mode. # #UNSECURE = "True" # The following line encodes the YP_INTERDOMAIN key into the hosts.byname # and hosts.byaddr maps so that ypserv(8) will do DNS lookups to resolve -# hosts not in the current domain. Commenting this line out will disable -# the DNS lookups. +# hosts not in the current domain. Resetting this variable in +# Makefile.local (B=) will disable the DNS lookups. B=-b -# Normally, the master.passwd.* maps are guarded against access from -# non-privileged users. By commenting out the following line, the YP_SECURE -# key will be removed from these maps, allowing anyone to access them. +# Normally, the master.passwd.* and shadow.* maps are guarded against access +# from non-privileged users. By resetting S in Makefile.local (S=), the +# YP_SECURE key will be removed from these maps, allowing anyone to access +# them. S=-s # These are commands which this Makefile needs to properly rebuild the @@ -118,6 +125,17 @@ PUBLICKEY = $(YPSRCDIR)/publickey NETID = $(YPSRCDIR)/netid AMDHOST = $(YPSRCDIR)/amd.map +target: + @if [ ! -d $(DOMAIN) ]; then mkdir $(DOMAIN); fi; \ + cd $(DOMAIN) ; echo "NIS Map update started on `date` for domain $(DOMAIN)" ; \ + make -f ../Makefile all; echo "NIS Map update completed." + +# Read overrides. Note, the current directory will be /var/yp/ +# when 'all' is built. +.if exists(${YPDIR}/Makefile.local) +.include "${YPDIR}/Makefile.local" +.endif + # List of maps that are always built. # If you want to omit some of them, feel free to comment # them out from this list. @@ -148,6 +166,9 @@ NETGROUP= /dev/null .if exists($(MASTER)) TARGETS+= passwd master.passwd netid +.if ${SHADOW} == "\"True\"" +TARGETS+= shadow +.endif .else MASTER= /dev/null TARGETS+= nopass @@ -171,11 +192,6 @@ TARGETS+= ipnodes IPNODES= /dev/null .endif -target: - @if [ ! -d $(DOMAIN) ]; then mkdir $(DOMAIN); fi; \ - cd $(DOMAIN) ; echo "NIS Map update started on `date` for domain $(DOMAIN)" ; \ - make -f ../Makefile all; echo "NIS Map update completed." - all: $(TARGETS) ethers: ethers.byname ethers.byaddr @@ -187,6 +203,7 @@ protocols: protocols.bynumber protocols. rpc: rpc.byname rpc.bynumber services: services.byname passwd: passwd.byname passwd.byuid +shadow: shadow.byname shadow.byuid group: group.byname group.bygid netgrp: netgroup netid: netid.byname @@ -207,6 +224,10 @@ pushpw: @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) master.passwd.byname ; fi @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) master.passwd.byuid ; fi +.if ${SHADOW} == "\"True\"" + @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) shadow.byname ; fi + @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) shadow.byuid ; fi +.endif @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) passwd.byname ; fi @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) passwd.byuid ; fi @@ -586,6 +607,36 @@ master.passwd.byuid: $(MASTER) .endif +shadow.byname: $(MASTER) + @echo "Updating $@..." +.if ${MASTER} == "/dev/null" + @echo "Master.passwd source file not found -- skipping" +.else + @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ + print $$1"\t"$$1":"$$2":12000:0:99999:7:::" }' $(MASTER) \ + | sed 's/\( [^:]*:\)\*:/\1!:/' \ + | $(DBLOAD) ${S} -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \ + $(RMV) $(TMP) $@ + @$(DBLOAD) -c + @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi + @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi +.endif + +shadow.byuid: $(MASTER) + @echo "Updating $@..." +.if ${MASTER} == "/dev/null" + @echo "Master.passwd source file not found -- skipping" +.else + @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ + print $$3"\t"$$1":"$$2":12000:0:99999:7:::" }' $(MASTER) \ + | sed 's/\( [^:]*:\)\*:/\1!:/' \ + | $(DBLOAD) ${S} -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \ + $(RMV) $(TMP) $@ + @$(DBLOAD) -c + @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi + @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi +.endif + amd.map: $(AMDHOST) @echo "Updating $@..." @$(AWK) '$$1 !~ "^#.*" { \ @@ -604,4 +655,3 @@ amd.map: $(AMDHOST) @$(DBLOAD) -c @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi - Modified: stable/7/usr.sbin/ypserv/yp_access.c ============================================================================== --- stable/7/usr.sbin/ypserv/yp_access.c Sat Jul 18 17:38:18 2009 (r195755) +++ stable/7/usr.sbin/ypserv/yp_access.c Sat Jul 18 20:19:25 2009 (r195756) @@ -178,9 +178,9 @@ load_securenets(void) * yp_access() checks the mapname and client host address and watches for * the following things: * - * - If the client is referencing one of the master.passwd.* maps, it must - * be using a privileged port to make its RPC to us. If it is, then we can - * assume that the caller is root and allow the RPC to succeed. If it + * - If the client is referencing one of the master.passwd.* or shadow.* maps, + * it must be using a privileged port to make its RPC to us. If it is, then + * we can assume that the caller is root and allow the RPC to succeed. If it * isn't access is denied. * * - The client's IP address is checked against the securenets rules. @@ -254,7 +254,7 @@ possible spoof attempt from %s:%d", #ifdef DB_CACHE if ((yp_testflag((char *)map, (char *)domain, YP_SECURE) || #else - if ((strstr(map, "master.passwd.") || + if ((strstr(map, "master.passwd.") || strstr(map, "shadow.") || #endif (rqstp->rq_prog == YPPROG && rqstp->rq_proc == YPPROC_XFR) || Modified: stable/7/usr.sbin/ypserv/ypserv.8 ============================================================================== --- stable/7/usr.sbin/ypserv/ypserv.8 Sat Jul 18 17:38:18 2009 (r195755) +++ stable/7/usr.sbin/ypserv/ypserv.8 Sat Jul 18 20:19:25 2009 (r195756) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 3, 2008 +.Dd June 25, 2009 .Dt YPSERV 8 .Os .Sh NAME @@ -142,7 +142,11 @@ and .Pa master.passwd.byuid maps in a special way. When the server receives a request to access -either of these two maps, it will check the TCP port from which the +either of these two maps (or in fact either of the +.Pa shadow.byname +or +.Pa shadow.byuid +maps), it will check the TCP port from which the request originated and return an error if the port number is greater than 1023. Since only the superuser is allowed to bind to TCP ports From owner-svn-src-stable@FreeBSD.ORG Sat Jul 18 21:50:53 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 62A75106564A; Sat, 18 Jul 2009 21:50:53 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 503798FC0A; Sat, 18 Jul 2009 21:50:53 +0000 (UTC) (envelope-from brian@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 n6ILormX012693; Sat, 18 Jul 2009 21:50:53 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6ILorri012691; Sat, 18 Jul 2009 21:50:53 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <200907182150.n6ILorri012691@svn.freebsd.org> From: Brian Somers Date: Sat, 18 Jul 2009 21:50:53 +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: r195758 - stable/7 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, 18 Jul 2009 21:50:54 -0000 Author: brian Date: Sat Jul 18 21:50:53 2009 New Revision: 195758 URL: http://svn.freebsd.org/changeset/base/195758 Log: Fix some typos. The changes only apply to UPDATING in stable/7. PR: 133110 Submitted by: Glen Barber - glen.j.barber at gmail Modified: stable/7/UPDATING Modified: stable/7/UPDATING ============================================================================== --- stable/7/UPDATING Sat Jul 18 20:19:53 2009 (r195757) +++ stable/7/UPDATING Sat Jul 18 21:50:53 2009 (r195758) @@ -143,13 +143,13 @@ portupgrade. The important thing to note is that the 82575 adapters were supported in the em driver in 7.0, but now needed - to be moved into igb, so if you have the effected cards + to be moved into igb, so if you have the affected cards be sure and make any script changes to follow the name change. - There are only 3 PCI ID's effected in this change: + There are only 3 PCI ID's affected in this change: 0x10A7, 0x10A9, and 0x10D6 - So you can know ahead of time if they will be effected, + So you can know ahead of time if they will be affected, these will now be supported in the igb driver. That driver will also support the new 82576 followon. @@ -161,7 +161,7 @@ portupgrade. 20080724: I have MFC'd in code to support multiple routing tables. - see the man pages setfib(1) and setfib(2). + See the man pages setfib(1) and setfib(2). This is a backwards compatible version, but to make use of it you need to compile your kernel with options ROUTETABLES=2 (or more up to 16).