From owner-svn-src-stable-7@FreeBSD.ORG Sun Jul 18 11:03:32 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E31A1065670; Sun, 18 Jul 2010 11:03:32 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CC408FC08; Sun, 18 Jul 2010 11:03:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6IB3WLa029424; Sun, 18 Jul 2010 11:03:32 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6IB3WXD029422; Sun, 18 Jul 2010 11:03:32 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201007181103.o6IB3WXD029422@svn.freebsd.org> From: Benedict Reuschling Date: Sun, 18 Jul 2010 11:03:32 +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: r210219 - stable/7/sbin/reboot X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jul 2010 11:03:32 -0000 Author: bcr (doc committer) Date: Sun Jul 18 11:03:32 2010 New Revision: 210219 URL: http://svn.freebsd.org/changeset/base/210219 Log: MFC r209703: Let boot(8) refer to the uart(4) serial driver, which is the replacement for the obsolete sio(4) driver. PR: docs/144498 Submitted by: Bruce Cran (bruce at cran dot org dot uk) Approved by: marcel Modified: stable/7/sbin/reboot/boot_i386.8 Modified: stable/7/sbin/reboot/boot_i386.8 ============================================================================== --- stable/7/sbin/reboot/boot_i386.8 Sun Jul 18 10:56:20 2010 (r210218) +++ stable/7/sbin/reboot/boot_i386.8 Sun Jul 18 11:03:32 2010 (r210219) @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 18, 2005 +.Dd July 4, 2010 .Dt BOOT 8 i386 .Os .Sh NAME @@ -220,14 +220,14 @@ you can use the option to force the kernel to use the serial port as its console device. The serial port driver -.Xr sio 4 +.Xr uart 4 has a flag (0x20) to override this option. If that flag is set, the serial port will always be used as the console, regardless of the .Fl h option described here. See the man page for -.Xr sio 4 +.Xr uart 4 for more details. .It Fl m mute the console to suppress all console input and output during the From owner-svn-src-stable-7@FreeBSD.ORG Sun Jul 18 13:53:51 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4132F1065677; Sun, 18 Jul 2010 13:53:51 +0000 (UTC) (envelope-from gavin@ury.york.ac.uk) Received: from mail-gw0.york.ac.uk (mail-gw0.york.ac.uk [144.32.128.245]) by mx1.freebsd.org (Postfix) with ESMTP id CF7AC8FC28; Sun, 18 Jul 2010 13:53:50 +0000 (UTC) Received: from ury.york.ac.uk (ury.york.ac.uk [144.32.108.81]) by mail-gw0.york.ac.uk (8.13.6/8.13.6) with ESMTP id o6IDM3aE006386; Sun, 18 Jul 2010 14:22:03 +0100 (BST) Received: from gavin (helo=localhost) by ury.york.ac.uk with local-esmtp (Exim 4.72) (envelope-from ) id 1OaToh-0001JO-LC; Sun, 18 Jul 2010 14:22:03 +0100 Date: Sun, 18 Jul 2010 14:22:03 +0100 (BST) From: Gavin Atkinson X-X-Sender: gavin@ury.york.ac.uk To: Benedict Reuschling In-Reply-To: <201007181103.o6IB3WXD029422@svn.freebsd.org> Message-ID: References: <201007181103.o6IB3WXD029422@svn.freebsd.org> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: X-York-MailScanner: Found to be clean X-York-MailScanner-From: gavin@ury.york.ac.uk 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: r210219 - stable/7/sbin/reboot X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jul 2010 13:53:51 -0000 On Sun, 18 Jul 2010, Benedict Reuschling wrote: > Author: bcr (doc committer) > Date: Sun Jul 18 11:03:32 2010 > New Revision: 210219 > URL: http://svn.freebsd.org/changeset/base/210219 > > Log: > MFC r209703: > > Let boot(8) refer to the uart(4) serial driver, which is the replacement > for the obsolete sio(4) driver. > > PR: docs/144498 > Submitted by: Bruce Cran (bruce at cran dot org dot uk) > Approved by: marcel > > Modified: > stable/7/sbin/reboot/boot_i386.8 Hmm, sio(4) is still the default on stable/7 - should this be reverted? Gavin From owner-svn-src-stable-7@FreeBSD.ORG Sun Jul 18 14:18:48 2010 Return-Path: Delivered-To: svn-src-stable-7@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 128081065674; Sun, 18 Jul 2010 14:18:48 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from mxout0.bln1.prohost.de (mxout0.bln1.prohost.de [213.160.84.46]) by mx1.freebsd.org (Postfix) with ESMTP id 793498FC21; Sun, 18 Jul 2010 14:18:44 +0000 (UTC) Received: from Macintosh.local (p4FC77F0E.dip.t-dialin.net [79.199.127.14]) (authenticated bits=0) by mx1.bln1.prohost.de (8.14.1/8.14.1) with ESMTP id o6IE7iQ1028004 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 18 Jul 2010 16:07:44 +0200 Message-ID: <4C430AB2.8090405@FreeBSD.org> Date: Sun, 18 Jul 2010 16:07:46 +0200 From: Benedict Reuschling Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.2.4) Gecko/20100608 Thunderbird/3.1 MIME-Version: 1.0 To: Gavin Atkinson References: <201007181103.o6IB3WXD029422@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.1.1 OpenPGP: id=4A819348 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Null-Tag: 43024fa974ec584590b9f8b809f71ae1 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: r210219 - stable/7/sbin/reboot X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: bcr@FreeBSD.org List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jul 2010 14:18:48 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 18.07.10 15:22, schrieb Gavin Atkinson: > On Sun, 18 Jul 2010, Benedict Reuschling wrote: > >> Author: bcr (doc committer) >> Date: Sun Jul 18 11:03:32 2010 >> New Revision: 210219 >> URL: http://svn.freebsd.org/changeset/base/210219 >> >> Log: >> MFC r209703: >> >> Let boot(8) refer to the uart(4) serial driver, which is the replacement >> for the obsolete sio(4) driver. >> >> PR: docs/144498 >> Submitted by: Bruce Cran (bruce at cran dot org dot uk) >> Approved by: marcel >> >> Modified: >> stable/7/sbin/reboot/boot_i386.8 > > Hmm, sio(4) is still the default on stable/7 - should this be reverted? > > Gavin If that is the case, then I guess a revert is probably the best thing to do. Thanks for the hint. Regards Benedict Reuschling Mail: bcr@FreeBSD.org The FreeBSD Documentation Project FreeBSD German Documentation Project - https://doc.bsdgroup.de -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkxDCq0ACgkQTSZQLkqBk0hBUQCcDpCMzzyta74sFKPfz7YW7lS6 MDoAoMqTXOU8DxVCqQ7WZnlgxs39Ag+F =bwQU -----END PGP SIGNATURE----- From owner-svn-src-stable-7@FreeBSD.ORG Sun Jul 18 14:52:41 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E50F106566C; Sun, 18 Jul 2010 14:52:41 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D1128FC1A; Sun, 18 Jul 2010 14:52:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6IEqfqR079534; Sun, 18 Jul 2010 14:52:41 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6IEqfaq079533; Sun, 18 Jul 2010 14:52:41 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201007181452.o6IEqfaq079533@svn.freebsd.org> From: Benedict Reuschling Date: Sun, 18 Jul 2010 14:52:41 +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: r210222 - stable/7/sbin/reboot X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jul 2010 14:52:41 -0000 Author: bcr (doc committer) Date: Sun Jul 18 14:52:40 2010 New Revision: 210222 URL: http://svn.freebsd.org/changeset/base/210222 Log: Revert to r172506, because sio(4) is still the default in stable/7. Pointed out by: gavin Modified: stable/7/sbin/reboot/boot_i386.8 Modified: stable/7/sbin/reboot/boot_i386.8 ============================================================================== --- stable/7/sbin/reboot/boot_i386.8 Sun Jul 18 12:45:31 2010 (r210221) +++ stable/7/sbin/reboot/boot_i386.8 Sun Jul 18 14:52:40 2010 (r210222) @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 4, 2010 +.Dd August 18, 2005 .Dt BOOT 8 i386 .Os .Sh NAME @@ -220,14 +220,14 @@ you can use the option to force the kernel to use the serial port as its console device. The serial port driver -.Xr uart 4 +.Xr sio 4 has a flag (0x20) to override this option. If that flag is set, the serial port will always be used as the console, regardless of the .Fl h option described here. See the man page for -.Xr uart 4 +.Xr sio 4 for more details. .It Fl m mute the console to suppress all console input and output during the From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 20 17:57:04 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F9471065674; Tue, 20 Jul 2010 17:57:04 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CE2F8FC1C; Tue, 20 Jul 2010 17:57:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6KHv45r066651; Tue, 20 Jul 2010 17:57:04 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6KHv4IC066648; Tue, 20 Jul 2010 17:57:04 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201007201757.o6KHv4IC066648@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 20 Jul 2010 17:57: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: r210301 - stable/7/sys/dev/hwpmc X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2010 17:57:04 -0000 Author: gnn Date: Tue Jul 20 17:57:03 2010 New Revision: 210301 URL: http://svn.freebsd.org/changeset/base/210301 Log: MFC r210012: Fix a panic brought about by writing an MSR without a proper mask. All of the necessary wrmsr calls are now preceded by a rdmsr and we leave the reserved bits alone. Document the bits in the relevant registers for future reference. Tested by: mdf Modified: stable/7/sys/dev/hwpmc/hwpmc_core.c stable/7/sys/dev/hwpmc/hwpmc_core.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_core.c Tue Jul 20 17:42:13 2010 (r210300) +++ stable/7/sys/dev/hwpmc/hwpmc_core.c Tue Jul 20 17:57:03 2010 (r210301) @@ -147,6 +147,7 @@ core_pcpu_fini(struct pmc_mdep *md, int int core_ri, n, npmc; struct pmc_cpu *pc; struct core_cpu *cc; + uint64_t msr = 0; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[core,%d] insane cpu number (%d)", __LINE__, cpu)); @@ -166,11 +167,14 @@ core_pcpu_fini(struct pmc_mdep *md, int npmc = md->pmd_classdep[PMC_MDEP_CLASS_INDEX_IAP].pcd_num; core_ri = md->pmd_classdep[PMC_MDEP_CLASS_INDEX_IAP].pcd_ri; - for (n = 0; n < npmc; n++) - wrmsr(IAP_EVSEL0 + n, 0); + for (n = 0; n < npmc; n++) { + msr = rdmsr(IAP_EVSEL0 + n); + wrmsr(IAP_EVSEL0 + n, msr & ~IAP_EVSEL_MASK); + } if (core_cputype != PMC_CPU_INTEL_CORE) { - wrmsr(IAF_CTRL, 0); + msr = rdmsr(IAF_CTRL); + wrmsr(IAF_CTRL, msr & ~IAF_CTRL_MASK); npmc += md->pmd_classdep[PMC_MDEP_CLASS_INDEX_IAF].pcd_num; } @@ -374,6 +378,7 @@ iaf_start_pmc(int cpu, int ri) { struct pmc *pm; struct core_cpu *iafc; + uint64_t msr = 0; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[core,%d] illegal CPU value %d", __LINE__, cpu)); @@ -387,12 +392,15 @@ iaf_start_pmc(int cpu, int ri) iafc->pc_iafctrl |= pm->pm_md.pm_iaf.pm_iaf_ctrl; - wrmsr(IAF_CTRL, iafc->pc_iafctrl); + msr = rdmsr(IAF_CTRL); + wrmsr(IAF_CTRL, msr | (iafc->pc_iafctrl & IAF_CTRL_MASK)); do { iafc->pc_resync = 0; iafc->pc_globalctrl |= (1ULL << (ri + IAF_OFFSET)); - wrmsr(IA_GLOBAL_CTRL, iafc->pc_globalctrl); + msr = rdmsr(IA_GLOBAL_CTRL); + wrmsr(IA_GLOBAL_CTRL, msr | (iafc->pc_globalctrl & + IAF_GLOBAL_CTRL_MASK)); } while (iafc->pc_resync != 0); PMCDBG(MDP,STA,1,"iafctrl=%x(%x) globalctrl=%jx(%jx)", @@ -407,6 +415,7 @@ iaf_stop_pmc(int cpu, int ri) { uint32_t fc; struct core_cpu *iafc; + uint64_t msr = 0; PMCDBG(MDP,STO,1,"iaf-stop cpu=%d ri=%d", cpu, ri); @@ -425,12 +434,15 @@ iaf_stop_pmc(int cpu, int ri) iafc->pc_iafctrl &= ~fc; PMCDBG(MDP,STO,1,"iaf-stop iafctrl=%x", iafc->pc_iafctrl); - wrmsr(IAF_CTRL, iafc->pc_iafctrl); + msr = rdmsr(IAF_CTRL); + wrmsr(IAF_CTRL, msr | (iafc->pc_iafctrl & IAF_CTRL_MASK)); do { iafc->pc_resync = 0; iafc->pc_globalctrl &= ~(1ULL << (ri + IAF_OFFSET)); - wrmsr(IA_GLOBAL_CTRL, iafc->pc_globalctrl); + msr = rdmsr(IA_GLOBAL_CTRL); + wrmsr(IA_GLOBAL_CTRL, msr | (iafc->pc_globalctrl & + IAF_GLOBAL_CTRL_MASK)); } while (iafc->pc_resync != 0); PMCDBG(MDP,STO,1,"iafctrl=%x(%x) globalctrl=%jx(%jx)", @@ -445,6 +457,7 @@ iaf_write_pmc(int cpu, int ri, pmc_value { struct core_cpu *cc; struct pmc *pm; + uint64_t msr; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[core,%d] illegal cpu value %d", __LINE__, cpu)); @@ -460,9 +473,11 @@ iaf_write_pmc(int cpu, int ri, pmc_value if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) v = iaf_reload_count_to_perfctr_value(v); - wrmsr(IAF_CTRL, 0); /* Turn off fixed counters */ - wrmsr(IAF_CTR0 + ri, v); - wrmsr(IAF_CTRL, cc->pc_iafctrl); + msr = rdmsr(IAF_CTRL); + wrmsr(IAF_CTRL, msr & ~IAF_CTRL_MASK); + wrmsr(IAF_CTR0 + ri, v & ((1ULL << core_iaf_width) - 1)); + msr = rdmsr(IAF_CTRL); + wrmsr(IAF_CTRL, msr | (cc->pc_iafctrl & IAF_CTRL_MASK)); PMCDBG(MDP,WRI,1, "iaf-write cpu=%d ri=%d msr=0x%x v=%jx iafctrl=%jx " "pmc=%jx", cpu, ri, IAF_RI_TO_MSR(ri), v, @@ -1879,6 +1894,7 @@ iap_stop_pmc(int cpu, int ri) { struct pmc *pm; struct core_cpu *cc; + uint64_t msr; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[core,%d] illegal cpu value %d", __LINE__, cpu)); @@ -1894,7 +1910,8 @@ iap_stop_pmc(int cpu, int ri) PMCDBG(MDP,STO,1, "iap-stop cpu=%d ri=%d", cpu, ri); - wrmsr(IAP_EVSEL0 + ri, 0); /* stop hw */ + msr = rdmsr(IAP_EVSEL0 + ri); + wrmsr(IAP_EVSEL0 + ri, msr & IAP_EVSEL_MASK); /* stop hw */ if (core_cputype == PMC_CPU_INTEL_CORE) return (0); @@ -1937,7 +1954,7 @@ iap_write_pmc(int cpu, int ri, pmc_value * a stopped state when the pcd_write() entry point is called. */ - wrmsr(IAP_PMC0 + ri, v); + wrmsr(IAP_PMC0 + ri, v & ((1ULL << core_iap_width) - 1)); return (0); } @@ -1987,6 +2004,7 @@ core_intr(int cpu, struct trapframe *tf) struct pmc *pm; struct core_cpu *cc; int error, found_interrupt, ri; + uint64_t msr = 0; PMCDBG(MDP,INT, 1, "cpu=%d tf=0x%p um=%d", cpu, (void *) tf, TRAPF_USERMODE(tf)); @@ -2018,7 +2036,8 @@ core_intr(int cpu, struct trapframe *tf) * Stop the counter, reload it but only restart it if * the PMC is not stalled. */ - wrmsr(IAP_EVSEL0 + ri, 0); + msr = rdmsr(IAP_EVSEL0 + ri); + wrmsr(IAP_EVSEL0 + ri, msr & ~IAP_EVSEL_MASK); wrmsr(IAP_PMC0 + ri, v); if (error) Modified: stable/7/sys/dev/hwpmc/hwpmc_core.h ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_core.h Tue Jul 20 17:42:13 2010 (r210300) +++ stable/7/sys/dev/hwpmc/hwpmc_core.h Tue Jul 20 17:57:03 2010 (r210301) @@ -67,20 +67,59 @@ struct pmc_md_iap_op_pmcallocate { /* * Fixed-function counters. */ + #define IAF_MASK 0xF +#define IAF_COUNTER_MASK 0x0000ffffffffffff #define IAF_CTR0 0x309 #define IAF_CTR1 0x30A #define IAF_CTR2 0x30B +/* + * The IAF_CTRL MSR is laid out in the following way. + * + * Bit Position Use + * 63 - 12 Reserved (do not touch) + * 11 Ctr 2 PMI + * 10 Reserved (do not touch) + * 9-8 Ctr 2 Enable + * 7 Ctr 1 PMI + * 6 Reserved (do not touch) + * 5-4 Ctr 1 Enable + * 3 Ctr 0 PMI + * 2 Reserved (do not touch) + * 1-0 Ctr 0 Enable (3: All Levels, 2: User, 1: OS, 0: Disable) + */ + #define IAF_OFFSET 32 #define IAF_CTRL 0x38D +#define IAF_CTRL_MASK 0x0000000000000bbb /* * Programmable counters. */ #define IAP_PMC0 0x0C1 + +/* + * IAP_EVSEL(n) is laid out in the following way. + * + * Bit Position Use + * 63-31 Reserved (do not touch) + * 31-24 Counter Mask + * 23 Invert + * 22 Enable + * 21 Reserved (do not touch) + * 20 APIC Interrupt Enable + * 19 Pin Control + * 18 Edge Detect + * 17 OS + * 16 User + * 15-8 Unit Mask + * 7-0 Event Select + */ + +#define IAP_EVSEL_MASK 0x00000000ffdfffff #define IAP_EVSEL0 0x186 /* @@ -90,6 +129,21 @@ struct pmc_md_iap_op_pmcallocate { #define IA_GLOBAL_STATUS 0x38E #define IA_GLOBAL_CTRL 0x38F + +/* + * IA_GLOBAL_CTRL is layed out in the following way. + * + * Bit Position Use + * 63-35 Reserved (do not touch) + * 34 IAF Counter 2 Enable + * 33 IAF Counter 1 Enable + * 32 IAF Counter 0 Enable + * 31-0 Depends on programmable counters + */ + +/* The mask is only for the fixed porttion of the register. */ +#define IAF_GLOBAL_CTRL_MASK 0x0000000700000000 + #define IA_GLOBAL_OVF_CTRL 0x390 #define IA_GLOBAL_STATUS_FLAG_CONDCHG (1ULL << 63) From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 20 19:11:47 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 622D51065676; Tue, 20 Jul 2010 19:11:47 +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 50ADF8FC14; Tue, 20 Jul 2010 19:11:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6KJBlaw083870; Tue, 20 Jul 2010 19:11:47 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6KJBlAg083868; Tue, 20 Jul 2010 19:11:47 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201007201911.o6KJBlAg083868@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 20 Jul 2010 19:11:47 +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: r210309 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2010 19:11:47 -0000 Author: jkim Date: Tue Jul 20 19:11:47 2010 New Revision: 210309 URL: http://svn.freebsd.org/changeset/base/210309 Log: MFC: r209836, r209949 Implement optional 'precision' for numbers. Previously, it was parsed but ignored. Some third-party modules (e.g., ACPICA) prefer this format over zero padding flag '0'. Modified: stable/7/sys/kern/subr_prf.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/subr_prf.c ============================================================================== --- stable/7/sys/kern/subr_prf.c Tue Jul 20 19:06:37 2010 (r210308) +++ stable/7/sys/kern/subr_prf.c Tue Jul 20 19:11:47 2010 (r210309) @@ -822,7 +822,8 @@ number: neg = 1; num = -(intmax_t)num; } - p = ksprintn(nbuf, num, base, &tmp, upper); + p = ksprintn(nbuf, num, base, &n, upper); + tmp = 0; if (sharpflag && num != 0) { if (base == 8) tmp++; @@ -832,10 +833,13 @@ number: if (neg) tmp++; - if (!ladjust && padc != '0' && width - && (width -= tmp) > 0) - while (width--) - PCHAR(padc); + if (!ladjust && padc == '0') + dwidth = width - tmp; + width -= tmp + imax(dwidth, n); + dwidth -= n; + if (!ladjust) + while (width-- > 0) + PCHAR(' '); if (neg) PCHAR('-'); if (sharpflag && num != 0) { @@ -846,16 +850,15 @@ number: PCHAR('x'); } } - if (!ladjust && width && (width -= tmp) > 0) - while (width--) - PCHAR(padc); + while (dwidth-- > 0) + PCHAR('0'); while (*p) PCHAR(*p--); - if (ladjust && width && (width -= tmp) > 0) - while (width--) - PCHAR(padc); + if (ladjust) + while (width-- > 0) + PCHAR(' '); break; default: From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 20 19:13:31 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD1A8106564A; Tue, 20 Jul 2010 19:13: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 AB3E28FC08; Tue, 20 Jul 2010 19:13:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6KJDV0d084320; Tue, 20 Jul 2010 19:13:31 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6KJDVR8084318; Tue, 20 Jul 2010 19:13:31 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201007201913.o6KJDVR8084318@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 20 Jul 2010 19:13: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: r210310 - stable/7/lib/libstand X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2010 19:13:31 -0000 Author: jkim Date: Tue Jul 20 19:13:31 2010 New Revision: 210310 URL: http://svn.freebsd.org/changeset/base/210310 Log: MFC: r209837, r209842, r209949 Sync. printf() of libstand(3) with sys/kern/subr_prf.c. CVS r1.94 jhb: Cast the integer read as the first argument for %b to an unsigned integer so it's value is not sign extended when assigned to the uintmax_t variable used internally by printf. For example, if bit 31 is set in the cpuid feature word, then %b would print out the initial value as a 16 character hexadecimal value. Now it only prints out an 8 character value. CVS r1.109 njl: Add support for 'h' and 'hh' modifiers for printf(9). CVS r1.117 phk: If we ignore an unknown % sequence, we must stop interpreting the remaining % arguments because the varargs are now out of sync and there is a risk that we might for instance dereference an integer in a %s argument. SVN r209836 jkim: Implement optional 'precision' for numbers. Previously, it was parsed but ignored. Some third-party modules (e.g., ACPICA) prefer this format over zero padding flag '0'. Modified: stable/7/lib/libstand/printf.c Directory Properties: stable/7/lib/libstand/ (props changed) Modified: stable/7/lib/libstand/printf.c ============================================================================== --- stable/7/lib/libstand/printf.c Tue Jul 20 19:11:47 2010 (r210309) +++ stable/7/lib/libstand/printf.c Tue Jul 20 19:13:31 2010 (r210310) @@ -159,10 +159,10 @@ kvprintf(char const *fmt, void (*func)(i int ch, n; uintmax_t num; int base, lflag, qflag, tmp, width, ladjust, sharpflag, neg, sign, dot; - int jflag, tflag, zflag; + int cflag, hflag, jflag, tflag, zflag; int dwidth, upper; char padc; - int retval = 0; + int stop = 0, retval = 0; num = 0; if (!func) @@ -179,7 +179,7 @@ kvprintf(char const *fmt, void (*func)(i for (;;) { padc = ' '; width = 0; - while ((ch = (u_char)*fmt++) != '%') { + while ((ch = (u_char)*fmt++) != '%' || stop) { if (ch == '\0') return (retval); PCHAR(ch); @@ -187,7 +187,7 @@ kvprintf(char const *fmt, void (*func)(i percent = fmt - 1; qflag = 0; lflag = 0; ladjust = 0; sharpflag = 0; neg = 0; sign = 0; dot = 0; dwidth = 0; upper = 0; - jflag = 0; tflag = 0; zflag = 0; + cflag = 0; hflag = 0; jflag = 0; tflag = 0; zflag = 0; reswitch: switch (ch = (u_char)*fmt++) { case '.': dot = 1; @@ -234,7 +234,7 @@ reswitch: switch (ch = (u_char)*fmt++) { width = n; goto reswitch; case 'b': - num = va_arg(ap, int); + num = (u_int)va_arg(ap, int); p = va_arg(ap, char *); for (q = ksprintn(nbuf, num, *p++, NULL, 0); *q;) PCHAR(*q--); @@ -278,6 +278,13 @@ reswitch: switch (ch = (u_char)*fmt++) { base = 10; sign = 1; goto handle_sign; + case 'h': + if (hflag) { + hflag = 0; + cflag = 1; + } else + hflag = 1; + goto reswitch; case 'j': jflag = 1; goto reswitch; @@ -297,6 +304,10 @@ reswitch: switch (ch = (u_char)*fmt++) { *(va_arg(ap, long *)) = retval; else if (zflag) *(va_arg(ap, size_t *)) = retval; + else if (hflag) + *(va_arg(ap, short *)) = retval; + else if (cflag) + *(va_arg(ap, char *)) = retval; else *(va_arg(ap, int *)) = retval; break; @@ -368,6 +379,10 @@ handle_nosign: num = va_arg(ap, u_long); else if (zflag) num = va_arg(ap, size_t); + else if (hflag) + num = (u_short)va_arg(ap, int); + else if (cflag) + num = (u_char)va_arg(ap, int); else num = va_arg(ap, u_int); goto number; @@ -382,6 +397,10 @@ handle_sign: num = va_arg(ap, long); else if (zflag) num = va_arg(ap, ssize_t); + else if (hflag) + num = (short)va_arg(ap, int); + else if (cflag) + num = (char)va_arg(ap, int); else num = va_arg(ap, int); number: @@ -389,7 +408,8 @@ number: neg = 1; num = -(intmax_t)num; } - p = ksprintn(nbuf, num, base, &tmp, upper); + p = ksprintn(nbuf, num, base, &n, upper); + tmp = 0; if (sharpflag && num != 0) { if (base == 8) tmp++; @@ -399,9 +419,13 @@ number: if (neg) tmp++; - if (!ladjust && width && (width -= tmp) > 0) - while (width--) - PCHAR(padc); + if (!ladjust && padc == '0') + dwidth = width - tmp; + width -= tmp + imax(dwidth, n); + dwidth -= n; + if (!ladjust) + while (width-- > 0) + PCHAR(' '); if (neg) PCHAR('-'); if (sharpflag && num != 0) { @@ -412,18 +436,27 @@ number: PCHAR('x'); } } + while (dwidth-- > 0) + PCHAR('0'); while (*p) PCHAR(*p--); - if (ladjust && width && (width -= tmp) > 0) - while (width--) - PCHAR(padc); + if (ladjust) + while (width-- > 0) + PCHAR(' '); break; default: while (percent < fmt) PCHAR(*percent++); + /* + * Since we ignore an formatting argument it is no + * longer safe to obey the remaining formatting + * arguments as the arguments will no longer match + * the format specs. + */ + stop = 1; break; } } From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 20 19:43:25 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB48B106566B; Tue, 20 Jul 2010 19:43:25 +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 D94E08FC08; Tue, 20 Jul 2010 19:43:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6KJhP4U091350; Tue, 20 Jul 2010 19:43:25 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6KJhPCh091347; Tue, 20 Jul 2010 19:43:25 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201007201943.o6KJhPCh091347@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 20 Jul 2010 19:43: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: r210314 - stable/7/sys/dev/acpica/Osd X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2010 19:43:26 -0000 Author: jkim Date: Tue Jul 20 19:43:25 2010 New Revision: 210314 URL: http://svn.freebsd.org/changeset/base/210314 Log: MFC: r209965, r209966, r210129, r210137, r210155 - According to ACPICA User Guide and Programmer Reference, the read data must be zero extended to fill the 32-bit or 64-bit return value even if the bit width of the port or location is less than 32 or 64. - Use pmap_mapdev()/pmap_unmapdev() to map device memory instead of using AcpiOsMapMemory()/AcpiOsUnmapMemory() (-> pmap_mapbios()/pmap_unmapbios()) for AcpiOsReadMemory() and AcpiOsWriteMemory(). Although they do not sound too obvious, these functions are exclusively used to access memory mapped IO in ACPICA. - Remove 64-bit access from AcpiOsReadMemory() and AcpiOsWriteMemory(). These functions do not support 64-bit access. Likewise, return error when 64-bit access is requested for PCI configuration space. - Clean up some white spaces. Modified: stable/7/sys/dev/acpica/Osd/OsdHardware.c stable/7/sys/dev/acpica/Osd/OsdMemory.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/acpica/Osd/OsdHardware.c ============================================================================== --- stable/7/sys/dev/acpica/Osd/OsdHardware.c Tue Jul 20 19:38:38 2010 (r210313) +++ stable/7/sys/dev/acpica/Osd/OsdHardware.c Tue Jul 20 19:43:25 2010 (r210314) @@ -53,16 +53,16 @@ __FBSDID("$FreeBSD$"); */ #ifdef __i386__ -#define ACPI_BUS_SPACE_IO I386_BUS_SPACE_IO -#define ACPI_BUS_HANDLE 0 +#define ACPI_BUS_SPACE_IO I386_BUS_SPACE_IO +#define ACPI_BUS_HANDLE 0 #endif #ifdef __ia64__ -#define ACPI_BUS_SPACE_IO IA64_BUS_SPACE_IO -#define ACPI_BUS_HANDLE 0 +#define ACPI_BUS_SPACE_IO IA64_BUS_SPACE_IO +#define ACPI_BUS_HANDLE 0 #endif #ifdef __amd64__ -#define ACPI_BUS_SPACE_IO AMD64_BUS_SPACE_IO -#define ACPI_BUS_HANDLE 0 +#define ACPI_BUS_SPACE_IO AMD64_BUS_SPACE_IO +#define ACPI_BUS_HANDLE 0 #endif /* @@ -137,19 +137,13 @@ AcpiOsReadPort(ACPI_IO_ADDRESS InPort, U switch (Width) { case 8: - *(u_int8_t *)Value = bus_space_read_1(ACPI_BUS_SPACE_IO, - ACPI_BUS_HANDLE, InPort); - break; + *Value = bus_space_read_1(ACPI_BUS_SPACE_IO, ACPI_BUS_HANDLE, InPort); + break; case 16: - *(u_int16_t *)Value = bus_space_read_2(ACPI_BUS_SPACE_IO, - ACPI_BUS_HANDLE, InPort); - break; + *Value = bus_space_read_2(ACPI_BUS_SPACE_IO, ACPI_BUS_HANDLE, InPort); + break; case 32: - *(u_int32_t *)Value = bus_space_read_4(ACPI_BUS_SPACE_IO, - ACPI_BUS_HANDLE, InPort); - break; - default: - /* debug trap goes here */ + *Value = bus_space_read_4(ACPI_BUS_SPACE_IO, ACPI_BUS_HANDLE, InPort); break; } @@ -172,16 +166,13 @@ AcpiOsWritePort(ACPI_IO_ADDRESS OutPort, switch (Width) { case 8: - bus_space_write_1(ACPI_BUS_SPACE_IO, ACPI_BUS_HANDLE, OutPort, Value); - break; + bus_space_write_1(ACPI_BUS_SPACE_IO, ACPI_BUS_HANDLE, OutPort, Value); + break; case 16: - bus_space_write_2(ACPI_BUS_SPACE_IO, ACPI_BUS_HANDLE, OutPort, Value); - break; + bus_space_write_2(ACPI_BUS_SPACE_IO, ACPI_BUS_HANDLE, OutPort, Value); + break; case 32: - bus_space_write_4(ACPI_BUS_SPACE_IO, ACPI_BUS_HANDLE, OutPort, Value); - break; - default: - /* debug trap goes here */ + bus_space_write_4(ACPI_BUS_SPACE_IO, ACPI_BUS_HANDLE, OutPort, Value); break; } @@ -192,28 +183,15 @@ ACPI_STATUS AcpiOsReadPciConfiguration(ACPI_PCI_ID *PciId, UINT32 Register, void *Value, UINT32 Width) { - u_int32_t byte_width = Width / 8; - u_int32_t val; + + if (Width == 64) + return (AE_SUPPORT); if (!pci_cfgregopen()) - return (AE_NOT_EXIST); + return (AE_NOT_EXIST); - val = pci_cfgregread(PciId->Bus, PciId->Device, PciId->Function, Register, - byte_width); - switch (Width) { - case 8: - *(u_int8_t *)Value = val & 0xff; - break; - case 16: - *(u_int16_t *)Value = val & 0xffff; - break; - case 32: - *(u_int32_t *)Value = val; - break; - default: - /* debug trap goes here */ - break; - } + *(UINT64 *)Value = pci_cfgregread(PciId->Bus, PciId->Device, + PciId->Function, Register, Width / 8); return (AE_OK); } @@ -223,13 +201,15 @@ ACPI_STATUS AcpiOsWritePciConfiguration (ACPI_PCI_ID *PciId, UINT32 Register, ACPI_INTEGER Value, UINT32 Width) { - u_int32_t byte_width = Width / 8; + + if (Width == 64) + return (AE_SUPPORT); if (!pci_cfgregopen()) return (AE_NOT_EXIST); pci_cfgregwrite(PciId->Bus, PciId->Device, PciId->Function, Register, - Value, byte_width); + Value, Width / 8); return (AE_OK); } Modified: stable/7/sys/dev/acpica/Osd/OsdMemory.c ============================================================================== --- stable/7/sys/dev/acpica/Osd/OsdMemory.c Tue Jul 20 19:38:38 2010 (r210313) +++ stable/7/sys/dev/acpica/Osd/OsdMemory.c Tue Jul 20 19:43:25 2010 (r210314) @@ -108,29 +108,23 @@ AcpiOsReadMemory(ACPI_PHYSICAL_ADDRESS A { void *LogicalAddress; - LogicalAddress = AcpiOsMapMemory(Address, Width / 8); + LogicalAddress = pmap_mapdev(Address, Width / 8); if (LogicalAddress == NULL) return (AE_NOT_EXIST); switch (Width) { case 8: - *(u_int8_t *)Value = (*(volatile u_int8_t *)LogicalAddress); + *Value = *(volatile uint8_t *)LogicalAddress; break; case 16: - *(u_int16_t *)Value = (*(volatile u_int16_t *)LogicalAddress); + *Value = *(volatile uint16_t *)LogicalAddress; break; case 32: - *(u_int32_t *)Value = (*(volatile u_int32_t *)LogicalAddress); - break; - case 64: - *(u_int64_t *)Value = (*(volatile u_int64_t *)LogicalAddress); - break; - default: - /* debug trap goes here */ + *Value = *(volatile uint32_t *)LogicalAddress; break; } - AcpiOsUnmapMemory(LogicalAddress, Width / 8); + pmap_unmapdev((vm_offset_t)LogicalAddress, Width / 8); return (AE_OK); } @@ -140,29 +134,23 @@ AcpiOsWriteMemory(ACPI_PHYSICAL_ADDRESS { void *LogicalAddress; - LogicalAddress = AcpiOsMapMemory(Address, Width / 8); + LogicalAddress = pmap_mapdev(Address, Width / 8); if (LogicalAddress == NULL) return (AE_NOT_EXIST); switch (Width) { case 8: - (*(volatile u_int8_t *)LogicalAddress) = Value & 0xff; + *(volatile uint8_t *)LogicalAddress = Value; break; case 16: - (*(volatile u_int16_t *)LogicalAddress) = Value & 0xffff; + *(volatile uint16_t *)LogicalAddress = Value; break; case 32: - (*(volatile u_int32_t *)LogicalAddress) = Value & 0xffffffff; - break; - case 64: - (*(volatile u_int64_t *)LogicalAddress) = Value; - break; - default: - /* debug trap goes here */ + *(volatile uint32_t *)LogicalAddress = Value; break; } - AcpiOsUnmapMemory(LogicalAddress, Width / 8); + pmap_unmapdev((vm_offset_t)LogicalAddress, Width / 8); return (AE_OK); } From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 20 21:52:26 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DF3E106564A; Tue, 20 Jul 2010 21:52:26 +0000 (UTC) (envelope-from anders@FreeBSD.org) Received: from fupp.net (totem.fix.no [80.91.36.20]) by mx1.freebsd.org (Postfix) with ESMTP id 1D9238FC0A; Tue, 20 Jul 2010 21:52:25 +0000 (UTC) Received: from localhost (totem.fix.no [80.91.36.20]) by fupp.net (Postfix) with ESMTP id 166AA462A6; Tue, 20 Jul 2010 23:52:25 +0200 (CEST) Received: from fupp.net ([80.91.36.20]) by localhost (totem.fix.no [80.91.36.20]) (amavisd-new, port 10024) with LMTP id XHpppQK3gady; Tue, 20 Jul 2010 23:52:24 +0200 (CEST) Received: by fupp.net (Postfix, from userid 1000) id DC08A462A5; Tue, 20 Jul 2010 23:52:24 +0200 (CEST) Date: Tue, 20 Jul 2010 23:52:24 +0200 From: Anders Nordby To: Pyun YongHyeon Message-ID: <20100720215224.GA47151@fupp.net> References: <201006101804.o5AI4PEX024259@svn.freebsd.org> <20100629074831.GA75332@fupp.net> <1277820825.55649.7.camel@bauer.cse.buffalo.edu> <20100701215218.GC7090@michelle.cdnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20100701215218.GC7090@michelle.cdnetworks.com> User-Agent: Mutt/1.4.2.3i X-PGP-Key: http://anders.fix.no/pgp/ X-PGP-Key-FingerPrint: 1E0F C53C D8DF 6A8F EAAD 19C5 D12A BC9F 0083 5956 Cc: src-committers@freebsd.org, Ken Smith , jdc@parodius.com, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-7@freebsd.org, marcel@freebsd.org, Pyun YongHyeon Subject: Re: svn commit: r208995 - stable/7/sys/dev/bge X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2010 21:52:26 -0000 Hi, On Thu, Jul 01, 2010 at 02:52:18PM -0700, Pyun YongHyeon wrote: >> > Is it possible to get this fix into FreeBSD 7.3-RELEASE? >> We typically rely on developers to decide if fixes might warrant >> consideration as an Errata Notice and send email to re@ suggesting >> it. It's hard for us to judge on our own - factors include things >> like the individual developers' confidence level in the fix, etc. > Even though I didn't receive positive feedback from jumbo frame > users I'm pretty sure the change set will fix regression introduced > in r199011. As you might know, the bug was not detected for a very > long time(about 6 months) so I think it's better to wait 2 or 3 > weeks to get more confidence on the patch. Ok, so it's been 19 days since your mail. And much longer since june 10, when you fixed it in RELENG_7 and RELENG_8. Do you feel OK with the patch by now? My experience with the patch on production systems is entirely positive. Would be great to have this fix in 7.3. Only 7.3 has this bug. I can send the reports of my problems to re@ if you are OK with putting this into the release. Regards, -- Anders. From owner-svn-src-stable-7@FreeBSD.ORG Thu Jul 22 00:11:16 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8530010656B6; Thu, 22 Jul 2010 00:11:16 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 14EB98FC19; Thu, 22 Jul 2010 00:11:15 +0000 (UTC) Received: by pzk7 with SMTP id 7so2795431pzk.13 for ; Wed, 21 Jul 2010 17:11:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=Wi1Lf0Mfu6hr5RuFG9TQhgU9Az2IFuzybsHBpkaxXe8=; b=FQLFtoe/aeQV5BD+vH7Hj952mUlNxZ3vRuhQHR+Hmsh96hIm3KLi8Mj22HWVNXfi/F 8GfE8vJlgrCxtLsNVCt2cDnjcAC2ZBdyljvTu7wIv7yMH2pV7kD2kwfUQeWpwG8/6TYs lhDQHYy6D+lvRArlXix61SyV4VQWIhBaOFLbs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=Bjri2RpFKWQyyhoxBwJBWgsx84aVxSopRqioefCIdOX1OQhDJg8Fxnx9RsE3lVv43K p4n9V9v6XqXvedTRfc7nbx79aa1zQjer4r0eh0eW2IaP8k1HYi9F+WH9IGO7cBmTsMiA SUePXAkOnORLTWZx4fy14Nvs5bYhkxXIarZu0= Received: by 10.142.164.14 with SMTP id m14mr1189826wfe.152.1279757475291; Wed, 21 Jul 2010 17:11:15 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id 23sm9684968wfa.10.2010.07.21.17.11.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 21 Jul 2010 17:11:13 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Wed, 21 Jul 2010 17:10:25 -0700 From: Pyun YongHyeon Date: Wed, 21 Jul 2010 17:10:25 -0700 To: Anders Nordby Message-ID: <20100722001025.GF10798@michelle.cdnetworks.com> References: <201006101804.o5AI4PEX024259@svn.freebsd.org> <20100629074831.GA75332@fupp.net> <1277820825.55649.7.camel@bauer.cse.buffalo.edu> <20100701215218.GC7090@michelle.cdnetworks.com> <20100720215224.GA47151@fupp.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100720215224.GA47151@fupp.net> User-Agent: Mutt/1.4.2.3i X-Mailman-Approved-At: Thu, 22 Jul 2010 01:21:11 +0000 Cc: src-committers@freebsd.org, re@FreeBSD.org, Ken Smith , jdc@parodius.com, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-7@freebsd.org, marcel@freebsd.org, Pyun YongHyeon Subject: Re: svn commit: r208995 - stable/7/sys/dev/bge X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2010 00:11:16 -0000 On Tue, Jul 20, 2010 at 11:52:24PM +0200, Anders Nordby wrote: > Hi, > > On Thu, Jul 01, 2010 at 02:52:18PM -0700, Pyun YongHyeon wrote: > >> > Is it possible to get this fix into FreeBSD 7.3-RELEASE? > >> We typically rely on developers to decide if fixes might warrant > >> consideration as an Errata Notice and send email to re@ suggesting > >> it. It's hard for us to judge on our own - factors include things > >> like the individual developers' confidence level in the fix, etc. > > Even though I didn't receive positive feedback from jumbo frame > > users I'm pretty sure the change set will fix regression introduced > > in r199011. As you might know, the bug was not detected for a very > > long time(about 6 months) so I think it's better to wait 2 or 3 > > weeks to get more confidence on the patch. > > Ok, so it's been 19 days since your mail. And much longer since june 10, > when you fixed it in RELENG_7 and RELENG_8. Do you feel OK with the > patch by now? My experience with the patch on production systems is > entirely positive. > > Would be great to have this fix in 7.3. Only 7.3 has this bug. I can > send the reports of my problems to re@ if you are OK with putting this > into the release. > Ok, thanks for reminding this. I also agree that bge(4) errata for 7.3-RELEASE would be good thing. Do I need to send another official mail to re@ for the details of bug(CCed to re@)? From owner-svn-src-stable-7@FreeBSD.ORG Thu Jul 22 17:02:52 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17A821065675; Thu, 22 Jul 2010 17:02:52 +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 05ACE8FC15; Thu, 22 Jul 2010 17:02:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6MH2p33006416; Thu, 22 Jul 2010 17:02:51 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6MH2pBC006415; Thu, 22 Jul 2010 17:02:51 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201007221702.o6MH2pBC006415@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 22 Jul 2010 17:02:51 +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: r210379 - stable/7/sys/dev/syscons X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2010 17:02:52 -0000 Author: jkim Date: Thu Jul 22 17:02:51 2010 New Revision: 210379 URL: http://svn.freebsd.org/changeset/base/210379 Log: MFC: r210248 Fix two long-standing line wrapping bugs in VGA renderer for pixel mode. Font size may be smaller than 16 and logical scan line may be larger than the displayed scan line. Modified: stable/7/sys/dev/syscons/scvgarndr.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/syscons/scvgarndr.c ============================================================================== --- stable/7/sys/dev/syscons/scvgarndr.c Thu Jul 22 17:02:11 2010 (r210378) +++ stable/7/sys/dev/syscons/scvgarndr.c Thu Jul 22 17:02:51 2010 (r210379) @@ -758,8 +758,9 @@ vga_vgadraw_direct(scr_stat *scp, int fr d += 8 * pixel_size; if ((i % scp->xsize) == scp->xsize - 1) - d += scp->xoff * 16 * pixel_size + - (scp->font_size - 1) * line_width; + d += scp->xoff * scp->font_size * pixel_size + + scp->font_size * line_width - + scp->xpixel * pixel_size; } } From owner-svn-src-stable-7@FreeBSD.ORG Fri Jul 23 14:30:32 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47719106574B; Fri, 23 Jul 2010 14:30:32 +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 359F58FC24; Fri, 23 Jul 2010 14:30:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6NEUW2g017708; Fri, 23 Jul 2010 14:30:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6NEUWf0017706; Fri, 23 Jul 2010 14:30:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201007231430.o6NEUWf0017706@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Jul 2010 14:30:32 +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: r210413 - stable/7/sys/dev/ipmi X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2010 14:30:32 -0000 Author: jhb Date: Fri Jul 23 14:30:31 2010 New Revision: 210413 URL: http://svn.freebsd.org/changeset/base/210413 Log: MFC 210066: Rework the SMBIOS table walker to make it operate like other table walkers and remove a buffer overflow. Modified: stable/7/sys/dev/ipmi/ipmi_smbios.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ipmi/ipmi_smbios.c ============================================================================== --- stable/7/sys/dev/ipmi/ipmi_smbios.c Fri Jul 23 14:30:14 2010 (r210412) +++ stable/7/sys/dev/ipmi/ipmi_smbios.c Fri Jul 23 14:30:31 2010 (r210413) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); #define pmap_unmapbios pmap_unmapdev #endif -struct smbios_table_entry { +struct smbios_table { uint8_t anchor_string[4]; uint8_t checksum; uint8_t length; @@ -108,27 +108,30 @@ struct ipmi_entry { #define SMBIOS_LEN 4 #define SMBIOS_SIG "_SM_" -typedef void (*dispatchproc_t)(uint8_t *p, char **table, - struct ipmi_get_info *info); +typedef void (*smbios_callback_t)(struct structure_header *, void *); static struct ipmi_get_info ipmi_info; static int ipmi_probed; static struct mtx ipmi_info_mtx; MTX_SYSINIT(ipmi_info, &ipmi_info_mtx, "ipmi info", MTX_DEF); -static char *get_strings(char *, char **); static void ipmi_smbios_probe(struct ipmi_get_info *); -static int smbios_cksum (struct smbios_table_entry *); -static void smbios_run_table(uint8_t *, int, dispatchproc_t *, - struct ipmi_get_info *); -static void smbios_t38_proc_info(uint8_t *, char **, - struct ipmi_get_info *); +static int smbios_cksum(struct smbios_table *); +static void smbios_walk_table(uint8_t *, int, smbios_callback_t, + void *); +static void smbios_ipmi_info(struct structure_header *, void *); static void -smbios_t38_proc_info(uint8_t *p, char **table, struct ipmi_get_info *info) +smbios_ipmi_info(struct structure_header *h, void *arg) { - struct ipmi_entry *s = (struct ipmi_entry *)p; + struct ipmi_get_info *info; + struct ipmi_entry *s; + if (h->type != 38 || h->length < + offsetof(struct ipmi_entry, interrupt_number)) + return; + s = (struct ipmi_entry *)h; + info = arg; bzero(info, sizeof(struct ipmi_get_info)); switch (s->interface_type) { case KCS_MODE: @@ -172,44 +175,28 @@ smbios_t38_proc_info(uint8_t *p, char ** info->iface_type = s->interface_type; } -static char * -get_strings(char *p, char **table) -{ - /* Scan for strings, stoping at a single null byte */ - while (*p != 0) { - *table++ = p; - p += strlen(p) + 1; - } - *table = 0; - - /* Skip past terminating null byte */ - return (p + 1); -} - - static void -smbios_run_table(uint8_t *p, int entries, dispatchproc_t *dispatchstatus, - struct ipmi_get_info *info) +smbios_walk_table(uint8_t *p, int entries, smbios_callback_t cb, void *arg) { struct structure_header *s; - char *table[20]; - uint8_t *nextp; - while(entries--) { - s = (struct structure_header *) p; - nextp = get_strings(p + s->length, table); + while (entries--) { + s = (struct structure_header *)p; + cb(s, arg); /* - * No strings still has a double-null at the end, - * skip over it + * Look for a double-nul after the end of the + * formatted area of this structure. */ - if (table[0] == 0) - nextp++; + p += s->length; + while (p[0] != 0 && p[1] != 0) + p++; - if (dispatchstatus[*p]) { - (dispatchstatus[*p])(p, table, info); - } - p = nextp; + /* + * Skip over the double-nul to the start of the next + * structure. + */ + p += 2; } } @@ -221,8 +208,7 @@ smbios_run_table(uint8_t *p, int entries static void ipmi_smbios_probe(struct ipmi_get_info *info) { - dispatchproc_t dispatch_smbios_ipmi[256]; - struct smbios_table_entry *header; + struct smbios_table *header; void *table; u_int32_t addr; @@ -239,9 +225,9 @@ ipmi_smbios_probe(struct ipmi_get_info * * length and then map it a second time with the actual length so * we can verify the checksum. */ - header = pmap_mapbios(addr, sizeof(struct smbios_table_entry)); + header = pmap_mapbios(addr, sizeof(struct smbios_table)); table = pmap_mapbios(addr, header->length); - pmap_unmapbios((vm_offset_t)header, sizeof(struct smbios_table_entry)); + pmap_unmapbios((vm_offset_t)header, sizeof(struct smbios_table)); header = table; if (smbios_cksum(header) != 0) { pmap_unmapbios((vm_offset_t)header, header->length); @@ -251,9 +237,7 @@ ipmi_smbios_probe(struct ipmi_get_info * /* Now map the actual table and walk it looking for an IPMI entry. */ table = pmap_mapbios(header->structure_table_address, header->structure_table_length); - bzero((void *)dispatch_smbios_ipmi, sizeof(dispatch_smbios_ipmi)); - dispatch_smbios_ipmi[38] = (void *)smbios_t38_proc_info; - smbios_run_table(table, header->number_structures, dispatch_smbios_ipmi, + smbios_walk_table(table, header->number_structures, smbios_ipmi_info, info); /* Unmap everything. */ @@ -298,7 +282,7 @@ ipmi_smbios_identify(struct ipmi_get_inf } static int -smbios_cksum (struct smbios_table_entry *e) +smbios_cksum(struct smbios_table *e) { u_int8_t *ptr; u_int8_t cksum; From owner-svn-src-stable-7@FreeBSD.ORG Fri Jul 23 15:16:37 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82738106566C; Fri, 23 Jul 2010 15:16:37 +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 715E78FC0A; Fri, 23 Jul 2010 15:16:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6NFGbfi028398; Fri, 23 Jul 2010 15:16:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6NFGbCw028396; Fri, 23 Jul 2010 15:16:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201007231516.o6NFGbCw028396@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Jul 2010 15:16:37 +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: r210417 - stable/7/usr.bin/ktrace X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2010 15:16:37 -0000 Author: jhb Date: Fri Jul 23 15:16:37 2010 New Revision: 210417 URL: http://svn.freebsd.org/changeset/base/210417 Log: MFC 210068: - Sort list of trace points. - Note that 'y' (sysctl requests) is in the default set of trace points. Modified: stable/7/usr.bin/ktrace/ktrace.1 Directory Properties: stable/7/usr.bin/ktrace/ (props changed) Modified: stable/7/usr.bin/ktrace/ktrace.1 ============================================================================== --- stable/7/usr.bin/ktrace/ktrace.1 Fri Jul 23 15:16:27 2010 (r210416) +++ stable/7/usr.bin/ktrace/ktrace.1 Fri Jul 23 15:16:37 2010 (r210417) @@ -112,11 +112,11 @@ The following table equates the letters .Bl -tag -width flag -compact .It Cm c trace system calls -.It Cm n -trace namei translations .It Cm i trace .Tn I/O +.It Cm n +trace namei translations .It Cm s trace signal processing .It Cm t @@ -131,7 +131,7 @@ trace requests .It Cm + trace the default set of trace points - -.Cm c , n , i , s , t , u +.Cm c , i , n , s , t , u , y .El .It Ar command Execute From owner-svn-src-stable-7@FreeBSD.ORG Fri Jul 23 15:26:32 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F2C1106574A; Fri, 23 Jul 2010 15:26:32 +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 8E0AB8FC17; Fri, 23 Jul 2010 15:26:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6NFQWPh031091; Fri, 23 Jul 2010 15:26:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6NFQWJx031089; Fri, 23 Jul 2010 15:26:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201007231526.o6NFQWJx031089@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Jul 2010 15:26:32 +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: r210419 - stable/7/sys/nfsclient X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2010 15:26:32 -0000 Author: jhb Date: Fri Jul 23 15:26:32 2010 New Revision: 210419 URL: http://svn.freebsd.org/changeset/base/210419 Log: MFC 209946: - Add missing locking around flushing of an NFS node's attribute cache in the NMODIFIED case of nfs_open(). - Cosmetic tweak to simplify an expression in nfs_lookup(). Modified: stable/7/sys/nfsclient/nfs_vnops.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/nfsclient/nfs_vnops.c ============================================================================== --- stable/7/sys/nfsclient/nfs_vnops.c Fri Jul 23 15:26:19 2010 (r210418) +++ stable/7/sys/nfsclient/nfs_vnops.c Fri Jul 23 15:26:32 2010 (r210419) @@ -476,9 +476,11 @@ nfs_open(struct vop_open_args *ap) error = nfs_vinvalbuf(vp, V_SAVE, ap->a_td, 1); if (error == EINTR || error == EIO) return (error); + mtx_lock(&np->n_mtx); np->n_attrstamp = 0; if (vp->v_type == VDIR) np->n_direofoffset = 0; + mtx_unlock(&np->n_mtx); error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_td); if (error) return (error); @@ -913,8 +915,8 @@ nfs_lookup(struct vop_lookup_args *ap) */ newvp = *vpp; newnp = VTONFS(newvp); - if ((cnp->cn_flags & (ISLASTCN | ISOPEN)) == - (ISLASTCN | ISOPEN) && !(newnp->n_flag & NMODIFIED)) { + if ((flags & (ISLASTCN | ISOPEN)) == (ISLASTCN | ISOPEN) && + !(newnp->n_flag & NMODIFIED)) { mtx_lock(&newnp->n_mtx); newnp->n_attrstamp = 0; mtx_unlock(&newnp->n_mtx); From owner-svn-src-stable-7@FreeBSD.ORG Fri Jul 23 15:32:44 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0D0B1065673; Fri, 23 Jul 2010 15:32:44 +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 8FC548FC14; Fri, 23 Jul 2010 15:32:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6NFWiIW032770; Fri, 23 Jul 2010 15:32:44 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6NFWikh032768; Fri, 23 Jul 2010 15:32:44 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201007231532.o6NFWikh032768@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Jul 2010 15:32:44 +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: r210421 - stable/7/sys/amd64/amd64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2010 15:32:44 -0000 Author: jhb Date: Fri Jul 23 15:32:44 2010 New Revision: 210421 URL: http://svn.freebsd.org/changeset/base/210421 Log: MFC 209956: Remove a dead test. We already exclude NMI traps from this code in an earlier condition. Modified: stable/7/sys/amd64/amd64/trap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/amd64/trap.c ============================================================================== --- stable/7/sys/amd64/amd64/trap.c Fri Jul 23 15:32:22 2010 (r210420) +++ stable/7/sys/amd64/amd64/trap.c Fri Jul 23 15:32:44 2010 (r210421) @@ -275,9 +275,9 @@ trap(struct trapframe *frame) type); /* * We shouldn't enable interrupts while holding a - * spin lock or servicing an NMI. + * spin lock. */ - if (type != T_NMI && td->td_md.md_spinlock_count == 0) + if (td->td_md.md_spinlock_count == 0) enable_intr(); } }