From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 00:08:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6876710B; Sun, 20 Jul 2014 00:08:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 558B92BF1; Sun, 20 Jul 2014 00:08:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K08pOZ064212; Sun, 20 Jul 2014 00:08:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K08pZV064211; Sun, 20 Jul 2014 00:08:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201407200008.s6K08pZV064211@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 20 Jul 2014 00:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268898 - head/sys/powerpc/ps3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 00:08:51 -0000 Author: nwhitehorn Date: Sun Jul 20 00:08:50 2014 New Revision: 268898 URL: http://svnweb.freebsd.org/changeset/base/268898 Log: Fix allocation of 128MB extended memory region, broken since some careless modifications in December. MFC after: 3 days Modified: head/sys/powerpc/ps3/platform_ps3.c Modified: head/sys/powerpc/ps3/platform_ps3.c ============================================================================== --- head/sys/powerpc/ps3/platform_ps3.c Sat Jul 19 23:57:36 2014 (r268897) +++ head/sys/powerpc/ps3/platform_ps3.c Sun Jul 20 00:08:50 2014 (r268898) @@ -110,14 +110,6 @@ ps3_probe(platform_t plat) static int ps3_attach(platform_t plat) { - uint64_t junk; - int count; - struct mem_region avail_regions[2]; - - ps3_mem_regions(plat, NULL, NULL, avail_regions, &count); - - lv1_allocate_memory(avail_regions[1].mr_size, 24 /* 16 MB pages */, - 0, 0x04 /* any address */, &avail_regions[1].mr_start, &junk); pmap_mmu_install("mmu_ps3", BUS_PROBE_SPECIFIC); cpu_idle_hook = ps3_cpu_idle; @@ -152,6 +144,11 @@ ps3_mem_regions(platform_t plat, struct /* Convert to maximum amount we can allocate in 16 MB pages */ avail_regions[1].mr_size -= avail_regions[0].mr_size; avail_regions[1].mr_size -= avail_regions[1].mr_size % (16*1024*1024); + + /* Allocate extended memory region */ + lv1_allocate_memory(avail_regions[1].mr_size, 24 /* 16 MB pages */, + 0, 0x04 /* any address */, &avail_regions[1].mr_start, &junk); + *availsz = 2; if (phys != NULL) { From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 00:21:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85D3545A; Sun, 20 Jul 2014 00:21:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CEBA2D1B; Sun, 20 Jul 2014 00:21:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K0LdEV070274; Sun, 20 Jul 2014 00:21:39 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K0LduN070272; Sun, 20 Jul 2014 00:21:39 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407200021.s6K0LduN070272@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 20 Jul 2014 00:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268899 - in stable/10: contrib/byacc contrib/byacc/package contrib/byacc/package/debian contrib/byacc/package/pkgsrc contrib/byacc/test contrib/byacc/test/btyacc contrib/byacc/test/yac... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 00:21:39 -0000 Author: bapt Date: Sun Jul 20 00:21:38 2014 New Revision: 268899 URL: http://svnweb.freebsd.org/changeset/base/268899 Log: MFC: r257315, r260445, r264803 Update byacc to 20140422 Added: stable/10/contrib/byacc/MANIFEST - copied, changed from r264803, head/contrib/byacc/MANIFEST stable/10/contrib/byacc/NOTES-btyacc-Changes - copied unchanged from r264803, head/contrib/byacc/NOTES-btyacc-Changes stable/10/contrib/byacc/NOTES-btyacc-Disposition - copied unchanged from r264803, head/contrib/byacc/NOTES-btyacc-Disposition stable/10/contrib/byacc/README.BTYACC - copied, changed from r264803, head/contrib/byacc/README.BTYACC stable/10/contrib/byacc/btyaccpar.c - copied unchanged from r264803, head/contrib/byacc/btyaccpar.c stable/10/contrib/byacc/btyaccpar.skel - copied unchanged from r264803, head/contrib/byacc/btyaccpar.skel stable/10/contrib/byacc/mstring.c - copied, changed from r264803, head/contrib/byacc/mstring.c stable/10/contrib/byacc/package/mingw-byacc.spec - copied, changed from r257315, head/contrib/byacc/package/mingw-byacc.spec stable/10/contrib/byacc/skel2c - copied unchanged from r264803, head/contrib/byacc/skel2c stable/10/contrib/byacc/test/btyacc/ - copied from r264803, head/contrib/byacc/test/btyacc/ stable/10/contrib/byacc/test/btyacc_calc1.y - copied unchanged from r264803, head/contrib/byacc/test/btyacc_calc1.y stable/10/contrib/byacc/test/btyacc_demo.y - copied unchanged from r264803, head/contrib/byacc/test/btyacc_demo.y stable/10/contrib/byacc/test/code_debug.y - copied unchanged from r264803, head/contrib/byacc/test/code_debug.y stable/10/contrib/byacc/test/empty.y - copied unchanged from r264803, head/contrib/byacc/test/empty.y stable/10/contrib/byacc/test/err_inherit1.y - copied unchanged from r264803, head/contrib/byacc/test/err_inherit1.y stable/10/contrib/byacc/test/err_inherit2.y - copied unchanged from r264803, head/contrib/byacc/test/err_inherit2.y stable/10/contrib/byacc/test/err_inherit3.y - copied unchanged from r264803, head/contrib/byacc/test/err_inherit3.y stable/10/contrib/byacc/test/err_inherit4.y - copied unchanged from r264803, head/contrib/byacc/test/err_inherit4.y stable/10/contrib/byacc/test/err_inherit5.y - copied unchanged from r264803, head/contrib/byacc/test/err_inherit5.y stable/10/contrib/byacc/test/err_syntax1.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax1.y stable/10/contrib/byacc/test/err_syntax10.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax10.y stable/10/contrib/byacc/test/err_syntax11.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax11.y stable/10/contrib/byacc/test/err_syntax12.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax12.y stable/10/contrib/byacc/test/err_syntax13.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax13.y stable/10/contrib/byacc/test/err_syntax14.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax14.y stable/10/contrib/byacc/test/err_syntax15.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax15.y stable/10/contrib/byacc/test/err_syntax16.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax16.y stable/10/contrib/byacc/test/err_syntax17.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax17.y stable/10/contrib/byacc/test/err_syntax18.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax18.y stable/10/contrib/byacc/test/err_syntax19.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax19.y stable/10/contrib/byacc/test/err_syntax2.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax2.y stable/10/contrib/byacc/test/err_syntax20.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax20.y stable/10/contrib/byacc/test/err_syntax21.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax21.y stable/10/contrib/byacc/test/err_syntax22.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax22.y stable/10/contrib/byacc/test/err_syntax23.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax23.y stable/10/contrib/byacc/test/err_syntax24.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax24.y stable/10/contrib/byacc/test/err_syntax25.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax25.y stable/10/contrib/byacc/test/err_syntax26.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax26.y stable/10/contrib/byacc/test/err_syntax27.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax27.y stable/10/contrib/byacc/test/err_syntax3.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax3.y stable/10/contrib/byacc/test/err_syntax4.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax4.y stable/10/contrib/byacc/test/err_syntax5.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax5.y stable/10/contrib/byacc/test/err_syntax6.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax6.y stable/10/contrib/byacc/test/err_syntax7.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax7.y stable/10/contrib/byacc/test/err_syntax7a.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax7a.y stable/10/contrib/byacc/test/err_syntax7b.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax7b.y stable/10/contrib/byacc/test/err_syntax8.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax8.y stable/10/contrib/byacc/test/err_syntax8a.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax8a.y stable/10/contrib/byacc/test/err_syntax9.y - copied unchanged from r264803, head/contrib/byacc/test/err_syntax9.y stable/10/contrib/byacc/test/inherit0.y - copied unchanged from r264803, head/contrib/byacc/test/inherit0.y stable/10/contrib/byacc/test/inherit1.y - copied unchanged from r264803, head/contrib/byacc/test/inherit1.y stable/10/contrib/byacc/test/inherit2.y - copied unchanged from r264803, head/contrib/byacc/test/inherit2.y stable/10/contrib/byacc/test/ok_syntax1.y - copied unchanged from r264803, head/contrib/byacc/test/ok_syntax1.y stable/10/contrib/byacc/test/varsyntax_calc1.y - copied unchanged from r264803, head/contrib/byacc/test/varsyntax_calc1.y stable/10/contrib/byacc/test/yacc/ - copied from r264803, head/contrib/byacc/test/yacc/ stable/10/contrib/byacc/yaccpar.c - copied unchanged from r264803, head/contrib/byacc/yaccpar.c stable/10/contrib/byacc/yaccpar.skel - copied unchanged from r264803, head/contrib/byacc/yaccpar.skel Deleted: stable/10/contrib/byacc/skeleton.c stable/10/contrib/byacc/test/calc.output stable/10/contrib/byacc/test/calc.tab.c stable/10/contrib/byacc/test/calc.tab.h stable/10/contrib/byacc/test/calc1.output stable/10/contrib/byacc/test/calc1.tab.c stable/10/contrib/byacc/test/calc1.tab.h stable/10/contrib/byacc/test/calc2.output stable/10/contrib/byacc/test/calc2.tab.c stable/10/contrib/byacc/test/calc2.tab.h stable/10/contrib/byacc/test/calc3.output stable/10/contrib/byacc/test/calc3.tab.c stable/10/contrib/byacc/test/calc3.tab.h stable/10/contrib/byacc/test/code_calc.code.c stable/10/contrib/byacc/test/code_calc.output stable/10/contrib/byacc/test/code_calc.tab.c stable/10/contrib/byacc/test/code_calc.tab.h stable/10/contrib/byacc/test/code_error.code.c stable/10/contrib/byacc/test/code_error.output stable/10/contrib/byacc/test/code_error.tab.c stable/10/contrib/byacc/test/code_error.tab.h stable/10/contrib/byacc/test/error.output stable/10/contrib/byacc/test/error.tab.c stable/10/contrib/byacc/test/error.tab.h stable/10/contrib/byacc/test/ftp.output stable/10/contrib/byacc/test/ftp.tab.c stable/10/contrib/byacc/test/ftp.tab.h stable/10/contrib/byacc/test/ftp.y stable/10/contrib/byacc/test/grammar.output stable/10/contrib/byacc/test/grammar.tab.c stable/10/contrib/byacc/test/grammar.tab.h stable/10/contrib/byacc/test/pure_calc.output stable/10/contrib/byacc/test/pure_calc.tab.c stable/10/contrib/byacc/test/pure_calc.tab.h stable/10/contrib/byacc/test/pure_error.output stable/10/contrib/byacc/test/pure_error.tab.c stable/10/contrib/byacc/test/pure_error.tab.h stable/10/contrib/byacc/test/quote_calc-s.output stable/10/contrib/byacc/test/quote_calc-s.tab.c stable/10/contrib/byacc/test/quote_calc-s.tab.h stable/10/contrib/byacc/test/quote_calc.output stable/10/contrib/byacc/test/quote_calc.tab.c stable/10/contrib/byacc/test/quote_calc.tab.h stable/10/contrib/byacc/test/quote_calc2-s.output stable/10/contrib/byacc/test/quote_calc2-s.tab.c stable/10/contrib/byacc/test/quote_calc2-s.tab.h stable/10/contrib/byacc/test/quote_calc2.output stable/10/contrib/byacc/test/quote_calc2.tab.c stable/10/contrib/byacc/test/quote_calc2.tab.h stable/10/contrib/byacc/test/quote_calc3-s.output stable/10/contrib/byacc/test/quote_calc3-s.tab.c stable/10/contrib/byacc/test/quote_calc3-s.tab.h stable/10/contrib/byacc/test/quote_calc3.output stable/10/contrib/byacc/test/quote_calc3.tab.c stable/10/contrib/byacc/test/quote_calc3.tab.h stable/10/contrib/byacc/test/quote_calc4-s.output stable/10/contrib/byacc/test/quote_calc4-s.tab.c stable/10/contrib/byacc/test/quote_calc4-s.tab.h stable/10/contrib/byacc/test/quote_calc4.output stable/10/contrib/byacc/test/quote_calc4.tab.c stable/10/contrib/byacc/test/quote_calc4.tab.h Modified: stable/10/contrib/byacc/CHANGES stable/10/contrib/byacc/VERSION stable/10/contrib/byacc/aclocal.m4 stable/10/contrib/byacc/closure.c stable/10/contrib/byacc/config.guess stable/10/contrib/byacc/config.sub stable/10/contrib/byacc/config_h.in stable/10/contrib/byacc/configure stable/10/contrib/byacc/configure.in stable/10/contrib/byacc/defs.h stable/10/contrib/byacc/descrip.mms stable/10/contrib/byacc/error.c stable/10/contrib/byacc/graph.c stable/10/contrib/byacc/lalr.c stable/10/contrib/byacc/lr0.c stable/10/contrib/byacc/main.c stable/10/contrib/byacc/makefile.in stable/10/contrib/byacc/mkpar.c stable/10/contrib/byacc/output.c stable/10/contrib/byacc/package/byacc.spec stable/10/contrib/byacc/package/debian/changelog stable/10/contrib/byacc/package/pkgsrc/Makefile stable/10/contrib/byacc/reader.c stable/10/contrib/byacc/symtab.c stable/10/contrib/byacc/test/calc2.y stable/10/contrib/byacc/test/calc3.y stable/10/contrib/byacc/test/run_lint.sh stable/10/contrib/byacc/test/run_make.sh stable/10/contrib/byacc/test/run_test.sh stable/10/contrib/byacc/verbose.c stable/10/contrib/byacc/vmsbuild.com stable/10/contrib/byacc/yacc.1 stable/10/usr.bin/yacc/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/byacc/CHANGES ============================================================================== --- stable/10/contrib/byacc/CHANGES Sun Jul 20 00:08:50 2014 (r268898) +++ stable/10/contrib/byacc/CHANGES Sun Jul 20 00:21:38 2014 (r268899) @@ -1,3 +1,767 @@ +2014-04-22 Thomas E. Dickey + + * mstring.c: + use vsnprintf() to ensure that msprintf's buffer is large enough. + + * main.c, defs.h: add mstring_leaks() + + * configure: regen + + * output.c: fix a complementary warning + + * mstring.c: introduce vsnprintf + + * configure.in, config_h.in: add check for vsnprintf + + * output.c: quiet a type-conversion warning + + * mstring.c: fix a potential memory leak on ENOMEM + quiet a couple of type-conversion warnings + + * defs.h: add/use GCC_PRINTFLIKE for msprintf() + +2014-04-22 Tom.Shields + + * README.BTYACC: + drop "NOTES-btyacc-Changes" and "NOTES-btyacc-Disposition", merging relevant + content into README.BTYACC + +2014-04-22 Thomas E. Dickey + + * package/pkgsrc/Makefile, VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec: + bump + +2014-04-19 Thomas E. Dickey + + * config.sub: 2014-04-03 + + * config.guess: 2014-03-23 + +2014-04-09 Rick.Spates + + * main.c, defs.h: patch to allow DEBUG build with WIN32 system + +2014-04-09 Thomas E. Dickey + + * output.c, reader.c: gcc warnings + + * reader.c: fix const-cast warnings + + * test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/code_error.tab.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/error.tab.c, test/btyacc/rename_debug.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.tab.c, output.c: + fix a few clang --analyze warnings; one was a case where output_ctable emitted + an empty table (which should be an error). + + * reader.c: appease clang --analyze + + * defs.h: mark two functions as no-return. + + * package/debian/changelog: reason for release + + * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + + * makefile.in: use $LINT_OPTS from environment via configure script + + * test/btyacc/ok_syntax1.output, test/btyacc/ok_syntax1.tab.c, test/yacc/ok_syntax1.tab.c, test/ok_syntax1.y, test/yacc/ok_syntax1.output: + tweaks to make generated files from ok_syntax1.y compile with check_make rule + + * test/btyacc/rename_debug.c, test/btyacc/rename_debug.error, test/btyacc/rename_debug.h, test/btyacc/rename_debug.i, test/btyacc/rename_debug.output, test/yacc/rename_debug.c: + reference output for testing + + * test/run_test.sh: + retain the renaming done for code_debug.y so that check_make will work. + + * test/yacc/rename_debug.error, test/yacc/rename_debug.h, test/yacc/rename_debug.i, test/yacc/rename_debug.output: + reference output for testing + + * test/btyacc/ok_syntax1.error: RCS_BASE + + * test/yacc/quote_calc4-s.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/ok_syntax1.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, yaccpar.c: + regen + + * yacc.1: + clarify relationship of btyacc features to default configuration. + +2014-04-08 Thomas E. Dickey + + * test/yacc/ok_syntax1.output, test/yacc/ok_syntax1.tab.c, test/yacc/ok_syntax1.tab.h, test/btyacc/ok_syntax1.output, test/btyacc/ok_syntax1.tab.c, test/btyacc/ok_syntax1.tab.h: + reference output for testing + + * test/ok_syntax1.y: RCS_BASE + + * test/yacc/ok_syntax1.error: reference output for testing + + * test/yacc/big_b.error, test/yacc/big_b.output, test/yacc/big_l.error, test/yacc/big_l.output, test/btyacc/big_b.error, test/btyacc/big_b.output, test/btyacc/big_l.error, test/btyacc/big_l.output, test/run_test.sh: + exercise -L/-B options + + * test/yacc/code_debug.c, test/btyacc/code_debug.c, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax21.tab.c, test/yacc/err_syntax22.tab.c, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax27.tab.c, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax9.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/q uote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax1.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/btyacc/err_syntax13.tab.c, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax2.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax24.tab.c, test/btyacc/err_syntax25.tab.c, test/btyacc/err_syntax26.tab.c, test/btyacc/err_syntax27.t ab.c, test/btyacc/err_syntax3.tab.c, test/bt! yacc/err_syntax4.tab.c, test/btyacc/err_syntax5.tab.c, test/btyacc/err_syntax6.tab.c, test/btyacc/err_syntax7.tab.c, test/btyacc/err_syntax7a.tab.c, test/btyacc/err_syntax7b.tab.c, test/btyacc/err_syntax8.tab.c, test/btyacc/err_syntax8a.tab.c, test/btyacc/err_syntax9.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit5.tab.c, test/btyacc/err_syntax1.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.t ab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/run_test.sh, test/yacc/no_b_opt1.output: + use a better renaming of the YYPATCH definition (none of the test-cases rely + upon it, but redefinition in the "make check_make" rule is a problem). + + * test/btyacc/err_syntax1.tab.c, test/btyacc/err_syntax13.tab.c, test/btyacc/err_syntax2.tab.c, test/btyacc/err_syntax25.tab.c, test/btyacc/err_syntax26.tab.c, test/btyacc/err_syntax27.tab.c, test/btyacc/err_syntax3.tab.c, test/btyacc/err_syntax4.tab.c, test/btyacc/err_syntax5.tab.c, test/btyacc/err_syntax6.tab.c, test/btyacc/err_syntax7.tab.c, test/btyacc/err_syntax7a.tab.c, test/btyacc/err_syntax7b.tab.c, test/btyacc/err_syntax8.tab.c, test/btyacc/err_syntax8a.tab.c, test/btyacc/err_syntax9.tab.c, test/btyacc/varsyntax_calc1.tab.c: + undid temporary reordering in reader() by Tom Shields to align with byacc outputs + + * test/run_test.sh: remove a repeated test-case + + * mstring.c: minor reformatting to make coverage analysis simpler + +2014-04-07 Thomas E. Dickey + + * test/run_test.sh: tidy + + * test/yacc/help.error, test/yacc/help.output, test/yacc/no_b_opt.error, test/yacc/no_b_opt.output, test/yacc/no_b_opt1.error, test/yacc/no_b_opt1.output, test/yacc/no_code_c.error, test/yacc/no_code_c.output, test/yacc/no_defines.error, test/yacc/no_defines.output, test/yacc/no_graph.error, test/yacc/no_graph.output, test/yacc/no_include.error, test/yacc/no_include.output, test/yacc/no_opts.error, test/yacc/no_opts.output, test/yacc/no_output.error, test/yacc/no_output.output, test/yacc/no_output1.error, test/yacc/no_output1.output, test/yacc/no_output2.error, test/yacc/no_output2.output, test/yacc/no_p_opt.error, test/yacc/no_p_opt.output, test/yacc/no_p_opt1.error, test/yacc/no_p_opt1.output, test/yacc/no_verbose.error, test/yacc/no_verbose.output, test/yacc/nostdin.error, test/yacc/nostdin.output, test/yacc/test-no_b_opt1.output: + reference output for testing + + * test/run_test.sh: + add special checks for flags which depend on writable/existing files + + * test/btyacc/no_b_opt1.output, test/btyacc/no_p_opt1.output, test/btyacc/no_b_opt.error, test/btyacc/no_b_opt.output, test/btyacc/no_b_opt1.error, test/btyacc/no_code_c.output, test/btyacc/no_p_opt.error, test/btyacc/no_p_opt.output, test/btyacc/no_p_opt1.error, test/btyacc/no_output2.output, test/btyacc/no_code_c.error, test/btyacc/no_output2.error, test/btyacc/no_include.error, test/btyacc/no_include.output, test/btyacc/no_defines.output, test/btyacc/no_defines.error, test/btyacc/no_verbose.output, test/btyacc/no_graph.output, test/btyacc/no_graph.error, test/btyacc/no_opts.error, test/btyacc/no_opts.output, test/btyacc/no_verbose.error, test/btyacc/nostdin.error, test/btyacc/nostdin.output, test/btyacc/no_output.error, test/btyacc/no_output.output, test/btyacc/no_output1.error, test/btyacc/no_output1.output: + reference output for testing + + * main.c: + change CREATE_FILE_NAMES() to use local function rather than inline code, + to simplify coverage analysis. + + * test/btyacc/err_syntax27.error, test/btyacc/err_syntax27.output, test/btyacc/err_syntax27.tab.c, test/btyacc/err_syntax27.tab.h, test/btyacc/help.error, test/btyacc/help.output, test/yacc/err_syntax27.error, test/yacc/err_syntax27.output, test/yacc/err_syntax27.tab.c, test/yacc/err_syntax27.tab.h: + reference output for testing + + * test/err_syntax27.y: testcase for missing_brace() + + * error.c: ifdef'd non-btyacc function + + * lr0.c: ifdef'd debug-code + + * yaccpar.skel: use YYINT's to replace short's as in btyaccpar.skel + + * test/btyacc/code_debug.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax24.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/c alc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit5.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/co de_debug.c, test/yacc/code_error.code.c, tes! t/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, output.c, test/yacc/err_syntax1.tab.c, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax21.tab.c, test/yacc/err_syntax22.tab.c, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax9.tab.c, test/run_test.sh: + 2010/11/26 simplification of output.c using putc_code() and putl_code() + omitted an adjustment of the #line value used for code-file. Fix that. + Also, amend 2005/05/04 change to run_test.sh to retain a dummy line for + YYPATCH #define's to make test-outputs easier to compare #line's (report + by Tom Shields) + +2014-04-06 Thomas E. Dickey + + * reader.c: fix for valgrind + (the calloc's are intentional - valgrind reported use of uninitialized memory) + + * lr0.c, output.c: fix for valgrind + + * test/btyacc/code_debug.c, test/btyacc/code_debug.error, test/btyacc/code_debug.h, test/btyacc/code_debug.i, test/btyacc/code_debug.output: + RCS_BASE + + * test/yacc/code_debug.c, test/yacc/code_debug.h: + exercise the -i option + + * test/yacc/code_debug.i: reference output for testing + + * test/run_test.sh: exercise the -i option + + * test/yacc/code_debug.c: reference output for testing + + * test/run_test.sh: exercise the "-o" option + + * test/yacc/code_debug.error, test/yacc/code_debug.h, test/yacc/code_debug.output: + reference output for testing + + * output.c: don't call exit() without giving a chance to cleanup. + + * mstring.c: ifdef'd functions not used in byacc + + * btyaccpar.c: generated from btyaccpar.skel + + * yaccpar.c: generated from yaccpar.skel + + * skel2c: + change the generated-by comment to show which version of this script (and + which version of the given skeleton file) were used to produce the C-file. + + * configure: regen + + * makefile.in: + add rules to generate byacc and btyacc parser skeleton files independently + + * aclocal.m4: CF_PROG_AWK - add to byacc's configure script + CF_INTEL_COMPILER + cleanup the -no-gcc option which was leftover from testing - prcs does + not build with this option. + CF_MAKE_DOCS + protect $2 from substitution, for luit's "$(manext)" + CF_XOPEN_SOURCE + for Solaris (tested with gcc/g++ 3.4.3 on Solaris 10 and gcc/g++ 4.5.2 + on Solaris 11), suppress the followup check for defining _XOPEN_SOURCE + because it is not needed, as well as because g++ 4.7.3 (no package, + used in Sage for Solaris 10) has some unspecified header breakage which + is triggered by the duplicate definition. + + * configure.in: + modify so skeleton-source is determined by configure options rather than by + having developer rename yaccpar.skel.old to yaccpar.skel + + * descrip.mms: rename skeleton + + * vmsbuild.com: + fwiw, renamed the skeleton for consistency with makefile + + * skel2c, skeleton.c: resync skeleton and its generating files + + * yaccpar.skel: + renamed yaccpar.skel.old to yaccpar.skel, to allow using makefile suffix rules + + * yaccpar.skel.old: resync skeleton and its generating files + + * test/run_make.sh: improve cleanup after error recovery + + * test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, output.c, skeleton.c, defs.h: + use improvement from Tom Shield's btyacc changes, getting rid of special cases for generating two yyerror calls in skeleton + + * output.c: simplify output_yyerror_decl() + + * test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.tab.c, test/yacc/code_error.tab.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, output.c: + add second "const" to string-table declarations, from Tom Shield's btyacc changes + + * test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c: + discard unnecessary call on write_code_lineno() from Tom Shield's changes + + * test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_calc.tab.c, test/yacc/code_error.code.c, test/yacc/code_error.tab.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, output.c: + use YYINT typedef from Tom Shield's btyacc changes to replace explicit "short" + + * test/yacc/code_calc.code.c, test/yacc/code_error.code.c, output.c: + use fix from Tom Shield's btyacc changes: remove redundant extern-declaration for YYPARSE_DECL() + + * test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c: + discard unnecessary call on write_code_lineno() from Tom Shield's changes + + * output.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/code_calc.tab.c, test/yacc/code_error.tab.c: + use fix from Tom Shield's btyacc changes: prefix-definitions went to the + output (.tab.c) file in a case where they should have gone to the code + (.code.c) file. Remove now-redundant call to output_prefix(). + + * main.c: do the same for help-message + + * main.c: use OUTPUT_SUFFIX symbol in an overlooked case + + * test/run_make.sh: + modify to avoid use of VPATH, which has no standard implementation + +2014-04-05 Thomas E. Dickey + + * test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c: + discard a change which merged CountLines() with explicit comparisons against + code_file because that adds extra to the #line values + + * test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/calc.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/error.tab.c, output.c: + add Tom Shield's change to allow definition of YYSTYPE_IS_DECLARED symbol to + override fallback typedef for YYSTYPE when that symbol is undefined + + * test/btyacc/error.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c: + minor tweak to coding style - use parenthesis for "defined" operator's parameter + + * test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c: + regen to make YYMAXTOKEN and YYUNDFTOKEN adjacent + + * test/yacc/err_syntax20.tab.c, test/yacc/grammar.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_calc.tab.c, test/yacc/code_error.code.c, test/yacc/code_error.tab.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c: + regen after adding the YYUNDFTOKEN symbol + + * output.c: + integrate Tom Shield's btyacc changes which introduce the YYUNDFTOKEN symbol + (I changed order of output to keep this adjacent to YYMAXTOKEN) + + * reader.c: + merge all but one small change from Tom Shield's btyacc changes - that + changes the order of code-file in the tests. + + * test/btyacc/btyacc_demo.tab.c: regen + + * test/btyacc_demo.y: fix prototypes + +2014-04-04 Thomas E. Dickey + + * reader.c, defs.h, main.c: + more merging of Tom Shield's btyacc changes. In the merge, I moved the + symbol_pval inside the btyacc ifdef's and added some more btyacc ifdefs + +2014-04-03 Thomas E. Dickey + + * reader.c: + merge-in 3/4 of btyacc's changes, deferring those which change test-outputs. + Tom Shield's changes split-out copy_string() and copy_comment() functions + to simplify some logic, as well as adding btyacc-only chunks + + * makefile.in: build mstring.o, needed for changes in reader.c + + * output.c: + merge-in all of btyacc's changes which do not change byacc's test-output. + Some of the merge uses ifdef-changes which I applied to ongoing resync, + e.g., the introduction of PER_STATE. + +2014-04-02 Thomas E. Dickey + + * test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c: regen + + * output.c: fix typo + + * output.c, reader.c: + merge in some chunks of reader and output files which do not affect byacc tests + + * test/yacc/calc2.tab.c, test/yacc/calc3.tab.c: regen + + * test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax9.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax1.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax16.tab.c, test /yacc/err_syntax17.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax21.tab.c, test/yacc/err_syntax22.tab.c, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, skeleton.c: + incorporate YYENOMEM and YYEOF symbols from btyacc + + * output.c: merge chunk from btyacc changes for header-guards + + * btyaccpar.skel: RCS_BASE + + * yaccpar.skel: comment-out yysccsid[], for FreeBSD build-issues + remove GCC_UNUSED to reduce name-pollution as well as being simpler + + * main.c: + move a btyacc symbol outside ifdef to work around current state of merge + + * defs.h: + add USE_HEADER_GUARDS to defer whether to modify byacc's header-output + + * test/run_make.sh: + do not try to compile files used for testing syntax-errors, since they are + likely to be incomplete + +2014-04-02 Tom.Shields + + * main.c: changes for btyacc + +2014-04-01 Thomas E. Dickey + + * reader.c: + integrate change by Tom Shields to use bsearch rather than successive + calls to matchec() + + * defs.h: typedef __compar_fn_t is unnecessary + + * test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c: + omit the GCC_UNUSED, as noted by Tom Shields not really essential + +2014-04-01 Tom.Shields + + * verbose.c: changes for btyacc, ifdef'd + +2014-04-01 Thomas E. Dickey + + * mkpar.c: eliminate most of the ifdef's using macros + +2014-04-01 Tom.Shields + + * mkpar.c: merge btyacc changes (ifdef'd - no change to byacc) + + * error.c: + new functions used for reporting errors from the btyacc configuration + (I reordered some, and ifdef'd the new ones -TD) + +2014-03-31 Thomas E. Dickey + + * test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c: + omit the GCC_UNUSED, as noted by Tom Shields not really essential + + * test/btyacc/empty.tab.c, test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit5.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax24.tab.c: + regen + +2014-03-29 Thomas E. Dickey + + * test/yacc/err_syntax22.tab.c, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax9.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/y acc/err_syntax1.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax21.tab.c, skeleton.c: + comment-out yysccsid in the banner because it produces unnecessary compiler + warnings. The suggested alternative (using #pragma ident) in the preceding + comment is also obsolete; remove that comment (request by Gleb Smirnoff). + + * test/run_test.sh: + for yacc, ignore the inherit testcases, since they are btyacc-specific + +2014-03-28 Thomas E. Dickey + + * test/yacc/varsyntax_calc1.error, test/yacc/varsyntax_calc1.output, test/yacc/varsyntax_calc1.tab.c, test/yacc/varsyntax_calc1.tab.h, test/yacc/err_inherit3.error, test/yacc/err_inherit3.output, test/yacc/err_inherit3.tab.c, test/yacc/err_inherit3.tab.h, test/yacc/err_inherit4.error, test/yacc/err_inherit4.output, test/yacc/err_inherit4.tab.c, test/yacc/err_inherit4.tab.h, test/yacc/err_inherit5.error, test/yacc/err_inherit5.output, test/yacc/err_inherit5.tab.c, test/yacc/err_inherit5.tab.h, test/yacc/inherit0.error, test/yacc/inherit0.output, test/yacc/inherit0.tab.c, test/yacc/inherit0.tab.h, test/yacc/inherit1.error, test/yacc/inherit1.output, test/yacc/inherit1.tab.c, test/yacc/inherit1.tab.h, test/yacc/inherit2.error, test/yacc/inherit2.output, test/yacc/inherit2.tab.c, test/yacc/inherit2.tab.h, test/yacc/empty.error, test/yacc/empty.output, test/yacc/empty.tab.c, test/yacc/empty.tab.h, test/yacc/err_inherit1.error, test/yacc/err_inherit1.output, test/yacc/err_inherit1.tab.c, test/yacc/err_inherit1.tab.h, test/yacc/err_inherit2.error, test/yacc/err_inherit2.output, test/yacc/err_inherit2.tab.c, test/yacc/err_inherit2.tab.h: + reference output for testing + + * test/run_lint.sh, test/run_make.sh, test/run_test.sh: + moving #define's out of makefile broke check for yacc vs btyacc (fix) + +2014-03-28 Tom.Shields + + * test/btyacc/btyacc_demo.tab.c, test/btyacc/err_inherit3.error, test/btyacc/err_inherit3.output, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit3.tab.h, test/btyacc/err_inherit2.error, test/btyacc/err_inherit2.output, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit2.tab.h, test/btyacc/err_inherit4.error, test/btyacc/err_inherit4.output, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit4.tab.h, test/btyacc/err_inherit5.error, test/btyacc/err_inherit5.output, test/btyacc/err_inherit5.tab.c, test/btyacc/err_inherit5.tab.h, test/btyacc/inherit0.error, test/btyacc/inherit0.output, test/btyacc/inherit0.tab.c, test/btyacc/inherit0.tab.h, test/btyacc/inherit1.error, test/btyacc/inherit1.output, test/btyacc/inherit1.tab.c, test/btyacc/inherit1.tab.h, test/btyacc/inherit2.error, test/btyacc/inherit2.output, test/btyacc/inherit2.tab.c, test/btyacc/inherit2.tab.h, test/btyacc/calc.error, test/btyacc/err_inherit1.error, test/btyacc/err_inherit1.output, test/btyacc/err_inh erit1.tab.c, test/btyacc/err_inherit1.tab.h: + reference output for testing + + * defs.h: new functions/variables for btyacc + (I reordered and ifdef'd -TD) + + * test/inherit0.y, test/inherit1.y: testcase for btyacc + +2014-03-27 Tom.Shields + + * test/err_inherit5.y, test/err_inherit4.y, test/err_inherit3.y, test/err_inherit2.y, test/err_inherit1.y, test/inherit2.y: + testcase for btyacc + +2014-03-25 Tom.Shields + + * symtab.c: extra initialization needed for btyacc + (I ifdef'd -TD) + + * yacc.1: document -L/-B features from btyacc + +2014-03-25 Thomas E. Dickey + + * yacc.1: typo + + * configure: regen + + * configure.in: + modified new options to act like those in my other configure-scripts, e.g., + showing what option is being tested, and the resulting value. Put the + definitions in config.h rather than in the makefile. + +2014-03-25 Tom.Shields + + * makefile.in: add/use LINTFLAGS variable + make all of the objects (not just skeleton) rebuild if makefile changes + modify check-rule to reflect updates to run_test.sh vs subdirectory + + * mstring.c: byacc-btyacc-20140323 + +2014-03-25 Thomas E. Dickey + + * test/btyacc/RCS, test/yacc/RCS: PERMIT FILE + + * config_h.in: updated with autoheader-252 + +2014-03-25 Tom.Shields + + * README.BTYACC: byacc-btyacc-20140323 + +2014-03-24 Tom.Shields + + * test/btyacc/err_syntax1.output, test/btyacc/err_syntax1.tab.c, test/btyacc/err_syntax1.tab.h, test/btyacc/err_syntax10.error, test/btyacc/err_syntax10.output, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax10.tab.h, test/btyacc/err_syntax11.error, test/btyacc/err_syntax11.output, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax11.tab.h, test/btyacc/err_syntax12.error, test/btyacc/err_syntax12.output, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax12.tab.h, test/btyacc/err_syntax13.error, test/btyacc/err_syntax13.output, test/btyacc/err_syntax13.tab.c, test/btyacc/err_syntax13.tab.h, test/btyacc/err_syntax14.error, test/btyacc/err_syntax14.output, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax14.tab.h, test/btyacc/err_syntax15.error, test/btyacc/err_syntax15.output, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax15.tab.h, test/btyacc/err_syntax16.error, test/btyacc/err_syntax16.output, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax16.tab. h, test/btyacc/err_syntax17.error, test/btyacc/err_syntax17.output, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax17.tab.h, test/btyacc/err_syntax18.error, test/btyacc/err_syntax18.output, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax18.tab.h, test/btyacc/err_syntax19.error, test/btyacc/err_syntax19.output, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax19.tab.h, test/btyacc/err_syntax2.output, test/btyacc/err_syntax2.tab.c, test/btyacc/err_syntax2.tab.h, test/btyacc/err_syntax20.error, test/btyacc/err_syntax20.output, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax20.tab.h, test/btyacc/err_syntax21.error, test/btyacc/err_syntax21.output, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax21.tab.h, test/btyacc/err_syntax22.error, test/btyacc/err_syntax22.output, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax22.tab.h, test/btyacc/err_syntax23.error, test/btyacc/err_syntax23.output, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax23.tab. h, test/btyacc/err_syntax24.error, test/btya! cc/err_syntax24.output, test/btyacc/err_syntax24.tab.c, test/btyacc/err_syntax24.tab.h, test/btyacc/err_syntax25.error, test/btyacc/err_syntax25.output, test/btyacc/err_syntax25.tab.c, test/btyacc/err_syntax25.tab.h, test/btyacc/err_syntax26.error, test/btyacc/err_syntax26.output, test/btyacc/err_syntax26.tab.c, test/btyacc/err_syntax26.tab.h, test/btyacc/err_syntax3.output, test/btyacc/err_syntax3.tab.c, test/btyacc/err_syntax3.tab.h, test/btyacc/err_syntax4.output, test/btyacc/err_syntax4.tab.c, test/btyacc/err_syntax4.tab.h, test/btyacc/err_syntax5.output, test/btyacc/err_syntax5.tab.c, test/btyacc/err_syntax5.tab.h, test/btyacc/err_syntax6.output, test/btyacc/err_syntax6.tab.c, test/btyacc/err_syntax6.tab.h, test/btyacc/err_syntax7.output, test/btyacc/err_syntax7.tab.c, test/btyacc/err_syntax7.tab.h, test/btyacc/err_syntax7a.output, test/btyacc/err_syntax7a.tab.c, test/btyacc/err_syntax7a.tab.h, test/btyacc/err_syntax7b.output, test/btyacc/err_syntax7b.tab.c, test/btyacc/err_syn tax7b.tab.h, test/btyacc/err_syntax8.output, test/btyacc/err_syntax8.tab.c, test/btyacc/err_syntax8.tab.h, test/btyacc/err_syntax8a.output, test/btyacc/err_syntax8a.tab.c, test/btyacc/err_syntax8a.tab.h, test/btyacc/err_syntax9.output, test/btyacc/err_syntax9.tab.c, test/btyacc/err_syntax9.tab.h: + reference output for testing + +2014-03-24 Thomas E. Dickey + + * defs.h: fix compiler warnings due to mputc() + +2014-03-23 Tom.Shields + + * test/btyacc_demo.y: testcase for btyacc + + * test/btyacc/varsyntax_calc1.error, test/btyacc/varsyntax_calc1.output, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/varsyntax_calc1.tab.h: + reference output for testing + + * test/varsyntax_calc1.y, test/btyacc_calc1.y: testcase for btyacc + +2014-03-23 Thomas E. Dickey + + * test/err_syntax26.error, test/err_syntax26.output, test/err_syntax26.tab.c, test/err_syntax26.tab.h, test/yacc/err_syntax26.error, test/yacc/err_syntax26.output, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax26.tab.h: + reference output for testing + + * test/err_syntax26.y: testcase for missing_brace() + + * test/err_syntax25.error, test/err_syntax25.output, test/err_syntax25.tab.c, test/err_syntax25.tab.h, test/yacc/err_syntax25.error, test/yacc/err_syntax25.output, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax25.tab.h: + reference output for testing + + * test/err_syntax25.y: testcase for over_unionized() + + * test/err_syntax24.error, test/err_syntax24.output, test/err_syntax24.tab.c, test/err_syntax24.tab.h, test/yacc/err_syntax24.error, test/yacc/err_syntax24.output, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax24.tab.h: + reference output for testing + + * test/err_syntax24.y: testcase for default_action_warning() + +2014-03-23 Tom.Shields + + * test/btyacc/quote_calc3-s.error, test/btyacc/quote_calc4-s.error, test/btyacc/quote_calc4.error, test/btyacc/grammar.dot, test/btyacc/grammar.error, test/btyacc/pure_calc.error, test/btyacc/pure_error.error, test/btyacc/quote_calc-s.error, test/btyacc/quote_calc.error, test/btyacc/quote_calc2-s.error, test/btyacc/quote_calc2.error, test/btyacc/quote_calc3.error, test/btyacc/err_syntax2.error, test/btyacc/err_syntax3.error, test/btyacc/err_syntax4.error, test/btyacc/err_syntax5.error, test/btyacc/err_syntax6.error, test/btyacc/err_syntax7.error, test/btyacc/err_syntax7a.error, test/btyacc/err_syntax7b.error, test/btyacc/err_syntax8.error, test/btyacc/err_syntax8a.error, test/btyacc/err_syntax9.error, test/btyacc/error.error, test/btyacc/calc1.error, test/btyacc/calc2.error, test/btyacc/calc3.error, test/btyacc/code_calc.error, test/btyacc/code_error.error, test/btyacc/empty.error, test/btyacc/err_syntax1.error, test/btyacc/btyacc_calc1.error, test/btyacc/btyacc_demo.error: + reference output for testing + +2014-03-23 Thomas E. Dickey + + * test/err_syntax23.error, test/err_syntax23.output, test/err_syntax23.tab.c, test/err_syntax23.tab.h, test/yacc/err_syntax23.error, test/yacc/err_syntax23.output, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax23.tab.h: + reference output for testing + + * test/err_syntax23.y: testcase for untyped_lhs() + +2014-03-23 Tom.Shields + + * test/run_test.sh: + move test-outputs into subdirectories to keep btyacc/yacc results separate + +2014-03-23 Thomas E. Dickey + + * test/err_syntax22.error, test/err_syntax22.output, test/err_syntax22.tab.c, test/err_syntax22.tab.h, test/yacc/err_syntax22.error, test/yacc/err_syntax22.output, test/yacc/err_syntax22.tab.c, test/yacc/err_syntax22.tab.h: + reference output for testing + + * test/err_syntax22.y: testcase for untyped_rhs() + + * test/err_syntax21.error, test/err_syntax21.output, test/err_syntax21.tab.c, test/err_syntax21.tab.h, test/yacc/err_syntax21.error, test/yacc/err_syntax21.output, test/yacc/err_syntax21.tab.c, test/yacc/err_syntax21.tab.h, test/err_syntax20.error, test/err_syntax20.output, test/err_syntax20.tab.c, test/err_syntax20.tab.h, test/yacc/err_syntax20.error, test/yacc/err_syntax20.output, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax20.tab.h: + reference output for testing + + * test/err_syntax20.y: testcase for undefined_symbol_warning() + + * test/err_syntax21.y: testcase for unknown_rhs() + + * test/err_syntax19.error, test/err_syntax19.output, test/err_syntax19.tab.c, test/err_syntax19.tab.h, test/yacc/err_syntax19.error, test/yacc/err_syntax19.output, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax19.tab.h: + reference output for testing + + * test/err_syntax19.y: testcase for dollar_error() + + * test/err_syntax18.error, test/err_syntax18.output, test/err_syntax18.tab.c, test/err_syntax18.tab.h, test/yacc/err_syntax18.error, test/yacc/err_syntax18.output, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax18.tab.h: + reference output for testing + + * test/err_syntax18.y: testcase for dollar_warning() + + * test/err_syntax17.error, test/err_syntax17.output, test/err_syntax17.tab.c, test/err_syntax17.tab.h, test/yacc/err_syntax17.error, test/yacc/err_syntax17.output, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax17.tab.h: + reference output for testing + + * test/err_syntax17.y: testcase for unterminated_action() + +2014-03-22 Thomas E. Dickey + + * test/err_syntax16.error, test/err_syntax16.output, test/err_syntax16.tab.c, test/err_syntax16.tab.h, test/yacc/err_syntax16.error, test/yacc/err_syntax16.output, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax16.tab.h: + reference output for testing + + * test/err_syntax16.y: testcase for terminal_lhs() + + * test/err_syntax15.error, test/err_syntax15.output, test/err_syntax15.tab.c, test/err_syntax15.tab.h, test/yacc/err_syntax15.error, test/yacc/err_syntax15.output, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax15.tab.h: + reference output for testing + + * test/err_syntax15.y: testcase for no_grammar() + + * test/err_syntax14.error, test/err_syntax14.output, test/err_syntax14.tab.c, test/err_syntax14.tab.h, test/yacc/err_syntax14.error, test/yacc/err_syntax14.output, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax14.tab.h: + reference output for testing + + * test/err_syntax14.y: + testcase for restarted_warning() and undefined_goal() + + * test/err_syntax13.error, test/err_syntax13.output, test/err_syntax13.tab.c, test/err_syntax13.tab.h, test/yacc/err_syntax13.error, test/yacc/err_syntax13.output, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax13.tab.h: + reference output for testing + + * test/err_syntax13.y: testcase for terminal_start() + + * test/err_syntax12.error, test/err_syntax12.output, test/err_syntax12.tab.c, test/err_syntax12.tab.h, test/yacc/err_syntax12.error, test/yacc/err_syntax12.output, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax12.tab.h: + reference output for testing + + * test/err_syntax12.y: testcase for revalued_warning() + + * test/err_syntax11.error, test/err_syntax11.output, test/err_syntax11.tab.c, test/err_syntax11.tab.h, test/yacc/err_syntax11.error, test/yacc/err_syntax11.output, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax11.tab.h: + reference output for testing + + * test/err_syntax11.y: testcase for reprec_warning() + + * test/err_syntax10.error, test/err_syntax10.output, test/err_syntax10.tab.c, test/err_syntax10.tab.h, test/yacc/err_syntax10.error, test/yacc/err_syntax10.output, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax10.tab.h: + reference output for testing + + * test/err_syntax10.y: testcase for retyped_warning() + +2014-03-21 Thomas E. Dickey + + * test/err_syntax9.error, test/err_syntax9.output, test/err_syntax9.tab.c, test/err_syntax9.tab.h, test/yacc/err_syntax9.error, test/yacc/err_syntax9.output, test/yacc/err_syntax9.tab.c, test/yacc/err_syntax9.tab.h: + reference output for testing + + * test/err_syntax9.y: testcase for tokenized_start() + + * test/err_syntax8.error, test/err_syntax8.output, test/err_syntax8.tab.c, test/err_syntax8.tab.h, test/err_syntax8a.error, test/err_syntax8a.output, test/err_syntax8a.tab.c, test/err_syntax8a.tab.h, test/yacc/err_syntax8.error, test/yacc/err_syntax8.output, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8.tab.h, test/yacc/err_syntax8a.error, test/yacc/err_syntax8a.output, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax8a.tab.h: + reference output for testing + + * test/err_syntax8a.y, test/err_syntax8.y: testcase for used_reserved() + + * test/err_syntax7.error, test/err_syntax7.output, test/err_syntax7.tab.c, test/err_syntax7.tab.h, test/err_syntax7a.error, test/err_syntax7a.output, test/err_syntax7a.tab.c, test/err_syntax7a.tab.h, test/err_syntax7b.error, test/err_syntax7b.output, test/err_syntax7b.tab.c, test/err_syntax7b.tab.h, test/yacc/err_syntax7.error, test/yacc/err_syntax7.output, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7.tab.h, test/yacc/err_syntax7a.error, test/yacc/err_syntax7a.output, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7a.tab.h, test/yacc/err_syntax7b.error, test/yacc/err_syntax7b.output, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax7b.tab.h: + reference output for testing + + * test/err_syntax7b.y, test/err_syntax7a.y, test/err_syntax7.y: + testcase for illegal_character() + + * test/err_syntax6.error, test/err_syntax6.output, test/err_syntax6.tab.c, test/err_syntax6.tab.h, test/yacc/err_syntax6.error, test/yacc/err_syntax6.output, test/yacc/err_syntax6.tab.c, test/yacc/err_syntax6.tab.h: + reference output for testing + + * test/err_syntax6.y: testcase for illegal_tag() + + * test/err_syntax5.error, test/err_syntax5.output, test/err_syntax5.tab.c, test/err_syntax5.tab.h, test/yacc/err_syntax5.error, test/yacc/err_syntax5.output, test/yacc/err_syntax5.tab.c, test/yacc/err_syntax5.tab.h: + reference output for testing + + * test/err_syntax5.y: testcase for unterminated_union() + + * test/err_syntax4.error, test/err_syntax4.output, test/err_syntax4.tab.c, test/err_syntax4.tab.h, test/yacc/err_syntax4.error, test/yacc/err_syntax4.output, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax4.tab.h: + reference output for testing + + * test/err_syntax4.y: testcase for unterminated_text() + + * test/err_syntax3.error, test/err_syntax3.output, test/err_syntax3.tab.c, test/err_syntax3.tab.h, test/yacc/err_syntax3.error, test/yacc/err_syntax3.output, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax3.tab.h: + reference output for testing + + * test/err_syntax3.y: testcase for unterminated_string() + + * test/err_syntax2.error, test/err_syntax2.output, test/err_syntax2.tab.c, test/err_syntax2.tab.h, test/yacc/err_syntax2.error, test/yacc/err_syntax2.output, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax2.tab.h: + reference output for testing + + * test/err_syntax2.y: testcase for unterminated_comment() + + * test/err_syntax1.error, test/yacc/err_syntax1.error: + reference output for testing + + * test/err_syntax1.y: + test-case with syntax error (and nonprinting character) + + * test/calc.error, test/calc1.error, test/calc2.error, test/calc3.error, test/code_calc.error, test/code_error.error, test/err_syntax1.error, test/error.error, test/grammar.error, test/pure_calc.error, test/pure_error.error, test/quote_calc-s.error, test/quote_calc.error, test/quote_calc2-s.error, test/quote_calc2.error, test/quote_calc3-s.error, test/quote_calc3.error, test/quote_calc4-s.error, test/quote_calc4.error, test/yacc/calc.error, test/yacc/calc1.error, test/yacc/calc2.error, test/yacc/calc3.error, test/yacc/code_calc.error, test/yacc/code_error.error, test/yacc/error.error, test/yacc/grammar.error, test/yacc/pure_calc.error, test/yacc/pure_error.error, test/yacc/quote_calc-s.error, test/yacc/quote_calc.error, test/yacc/quote_calc2-s.error, test/yacc/quote_calc2.error, test/yacc/quote_calc3-s.error, test/yacc/quote_calc3.error, test/yacc/quote_calc4-s.error, test/yacc/quote_calc4.error: + reference output for testing + + * test/run_test.sh: + save stderr to reference files, to capture shift/reduce messages as well + as syntax-error messages + + * test/err_syntax1.output, test/err_syntax1.tab.c, test/err_syntax1.tab.h, test/yacc/err_syntax1.output, test/yacc/err_syntax1.tab.c, test/yacc/err_syntax1.tab.h: + reference output for testing + + * test/run_test.sh: generate a ".dot" file for the grammar file + + * test/grammar.dot: RCS_BASE + + * test/yacc/grammar.dot: reference output for testing + +2014-03-19 Tom.Shields + + * output.c: rename MAXSHORT to MAXYYINT + +2014-03-18 Tom.Shields + + * yaccpar.skel: skeleton with btyacc additions + + * NOTES-btyacc-Changes: byacc-btyacc-20140323 + + * test/btyacc/btyacc_calc1.output, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_calc1.tab.h: + reference output for testing + + * test/run_make.sh: + move test-outputs into subdirectories to keep btyacc/yacc results separate + + * test/btyacc/pure_calc.tab.c, test/btyacc/pure_calc.tab.h, test/btyacc/pure_error.output, test/btyacc/pure_error.tab.c, test/btyacc/pure_error.tab.h, test/btyacc/quote_calc-s.output, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc-s.tab.h, test/btyacc/quote_calc.output, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc.tab.h, test/btyacc/quote_calc2-s.output, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2-s.tab.h, test/btyacc/quote_calc2.output, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc2.tab.h, test/btyacc/quote_calc3-s.output, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3-s.tab.h, test/btyacc/quote_calc3.output, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc3.tab.h, test/btyacc/quote_calc4-s.output, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4-s.tab.h, test/btyacc/quote_calc4.output, test/btyacc/quote_calc4.tab.c, test/btyacc/quote_calc4.tab.h, test/btyacc/calc1.output, test/btyacc/calc1.tab.c, test/btyacc/calc1.tab.h, test/btyacc/calc2.output, test/btyacc/calc2.tab.c, test/btyacc/calc2.tab.h, test/btyacc/calc3.output, test/btyacc/calc3.tab.c, test/btyacc/calc3.tab.h, test/btyacc/code_calc.code.c, test/btyacc/code_calc.output, test/btyacc/code_calc.tab.c, test/btyacc/code_calc.tab.h, test/btyacc/code_error.code.c, test/btyacc/code_error.output, test/btyacc/code_error.tab.c, test/btyacc/code_error.tab.h, test/btyacc/empty.output, test/btyacc/empty.tab.c, test/btyacc/empty.tab.h, test/btyacc/error.output, test/btyacc/error.tab.c, test/btyacc/error.tab.h, test/btyacc/grammar.output, test/btyacc/grammar.tab.c, test/btyacc/grammar.tab.h, test/btyacc/pure_calc.output, test/btyacc/btyacc_demo.output, test/btyacc/btyacc_demo.tab.h, test/btyacc/calc.output, test/btyacc/calc.tab.c, test/btyacc/calc.tab.h: + reference output for testing + + * defs.h: + several changes to help decouple the use of 'short' as the type of value + used in yacc parsers. + + * NOTES-btyacc-Disposition: byacc-btyacc-20140323 + +2014-03-17 Tom.Shields + + * skel2c, yaccpar.skel, yaccpar.skel.old: RCS_BASE + + * test/run_lint.sh: + move test-outputs into subdirectories to keep btyacc/yacc results separate + + * configure.in: add --with-max-table-size and --enable-btyacc options + +2014-03-16 Tom.Shields + + * main.c: use Value_t rather than short + +2014-03-11 Tom.Shields + + * test/empty.y: testcase for btyacc + +2014-03-10 Tom.Shields + + * test/calc3.y, test/calc2.y: fix unused-variable warning + +2014-02-18 Tom.Shields + + * lr0.c, graph.c: use Value_t rather than short + + * closure.c: use Value_t rather than short + ifdef'd forward-reference prototypes to match ifdef'ing of the actual functions + + * lalr.c: rename MAXSHORT to MAXYYINT + +2014-01-01 Thomas E. Dickey + + * yacc.1: document %token-table, improve presentation of double-quotes + + * VERSION, package/byacc.spec, package/debian/changelog: bump + + * test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_calc.tab.c, test/yacc/code_error.code.c, test/yacc/code_error.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c: + reference output for testing + + * test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_calc.tab.c, test/code_error.code.c, test/code_error.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/quote_calc2-s.tab.c, test/quote_calc2.tab.c, test/quote_calc3-s.tab.c, test/quote_calc3.tab.c, test/quote_calc4-s.tab.c, test/quote_calc4.tab.c: + regen + + * output.c, skeleton.c: + amend the last change so that yytname is #define'd as needed rather than + permanent - to avoid breaking cproto for instance. + +2014-01-01 Christos.Zoulas + + * output.c, defs.h, main.c, reader.c, skeleton.c: + changes to build ntpd using byacc: + - rename yyname[] to yytname[] + - add YYTRANSLATE() macro + - recognize bison's %token-table declaration + +2014-01-01 Thomas E. Dickey + + * configure: regen + + * yacc.1: s/EE/XE/ to work around groff bug on Debian 6 + + * makefile.in: use CF_MAKE_DOCS + + * aclocal.m4: add CF_MAKE_DOCS + + * configure.in: use CF_MAKE_DOCS + +2013-12-26 Thomas E. Dickey + + * config.guess: 2013-11-29 + +2013-11-19 Thomas E. Dickey + + * aclocal.m4: resync with my-autoconf (fixes for clang and mingw) + +2013-10-25 Thomas E. Dickey + + * config.sub: 2013-10-01 + +2013-09-25 Thomas E. Dickey + + * reader.c: fix two loop-limits found by clang 3.3 --analyze + + * configure: regen + + * aclocal.m4: + tweaks to CF_MIXEDCASE_FILENAMES and CF_XOPEN_SOURCE for msys from ncurses + + * package/mingw-byacc.spec: RCS_BASE + + * test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/quote_calc2-s.tab.c, test/quote_calc2.tab.c, test/quote_calc3-s.tab.c, test/quote_calc3.tab.c, test/quote_calc4-s.tab.c, test/quote_calc4.tab.c: + regen + + * skeleton.c: + Increase default stack-size to match FreeBSD version noted as from + "BSD 4.4 Lite Usr.bin Sources". See + + http://svnweb.freebsd.org/base/vendor/CSRG/dist/usr.bin/yacc/ + http://svnweb.freebsd.org/base/head/usr.bin/yacc/ + http://svnweb.freebsd.org/base/vendor/byacc/ + + The original 1.9 sources (on which I based development) used 500 for + stacksize; the BSD Lite sources (a year or two later) used 10000. + + This is a change to default values; the YYMAXDEPTH and YYSTACKSIZE + symbols have "always" been overridable by applications, but rarely + needed to do this. RedHat began using the FreeBSD source in 2000, + and switched to this source in 2007 using the 20050813 snapshot. + + RedHat #743343 misattributed the change in default stacksize to + a regression in byacc, but did not report the issue upstream. + + * package/debian/changelog, VERSION, package/byacc.spec: bump + +2013-09-07 Thomas E. Dickey + + * config.sub: update to 2013-09-15 + + * config.guess: update to 2013-06-10 + 2013-03-04 Thomas E. Dickey * package/debian/changelog, VERSION, package/byacc.spec: bump @@ -30,7 +794,7 @@ 2013-02-10 Thomas E. Dickey - * config.sub, config.guess: 2013-02-04 + * config.sub, config.guess: update to 2013-02-04 2012-10-03 Thomas E. Dickey @@ -162,6 +926,8 @@ * VERSION, package/debian/changelog, package/byacc.spec: bump + * test/yacc/calc1.output: reference output for testing + * test/calc1.output, test/calc1.tab.c: regen * test/calc1.y: @@ -181,6 +947,8 @@ * test/calc2.tab.c, test/calc3.tab.c, test/code_error.code.c, test/ftp.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c: regen + * test/code_debug.y: RCS_BASE + * test/calc2.y, test/calc3.y, test/code_error.y, test/ftp.y: byacc already declares yyerror @@ -273,6 +1041,9 @@ * test/quote_calc-s.output, test/quote_calc-s.tab.c, test/quote_calc-s.tab.h, test/quote_calc2-s.output, test/quote_calc2-s.tab.c, test/quote_calc2-s.tab.h, test/quote_calc3-s.output, test/quote_calc3-s.tab.c, test/quote_calc3-s.tab.h, test/quote_calc4-s.output, test/quote_calc4-s.tab.c, test/quote_calc4-s.tab.h: RCS_BASE + * test/yacc/quote_calc-s.output, test/yacc/quote_calc-s.tab.h, test/yacc/quote_calc2-s.output, test/yacc/quote_calc2-s.tab.h, test/yacc/quote_calc3-s.output, test/yacc/quote_calc3-s.tab.h, test/yacc/quote_calc4-s.output, test/yacc/quote_calc4-s.tab.h: + reference output for testing + * test/run_test.sh: generate/test with "-s" option applied. 2012-01-13 Thomas E. Dickey @@ -285,9 +1056,24 @@ * main.c: add -s option to usage message. - * test/quote_calc3.output, test/quote_calc3.tab.c, test/quote_calc4.output, test/quote_calc4.tab.c, test/quote_calc4.tab.h, test/quote_calc3.y, test/quote_calc.tab.h, test/quote_calc.output, test/quote_calc.tab.c, test/quote_calc2.output, test/quote_calc2.tab.c, test/quote_calc2.tab.h, test/quote_calc3.tab.h, test/quote_calc4.y, test/quote_calc.y, test/quote_calc2.y: + * test/quote_calc3.output, test/quote_calc3.tab.c, test/quote_calc4.output, test/quote_calc4.tab.c, test/quote_calc4.tab.h: + RCS_BASE + + * test/yacc/quote_calc3.output, test/yacc/quote_calc4.output, test/yacc/quote_calc4.tab.h: + reference output for testing + + * test/quote_calc3.y, test/quote_calc.tab.h: RCS_BASE + + * test/yacc/quote_calc.tab.h: reference output for testing + + * test/quote_calc.output, test/quote_calc.tab.c, test/quote_calc2.output, test/quote_calc2.tab.c, test/quote_calc2.tab.h, test/quote_calc3.tab.h: RCS_BASE + * test/yacc/quote_calc.output, test/yacc/quote_calc2.output, test/yacc/quote_calc2.tab.h, test/yacc/quote_calc3.tab.h: + reference output for testing + + * test/quote_calc4.y, test/quote_calc.y, test/quote_calc2.y: RCS_BASE + * configure: regen * aclocal.m4: resync with my-autoconf, i.e., fixes for CF_XOPEN_SOURCE @@ -348,11 +1134,11 @@ 2011-04-01 Thomas E. Dickey - * config.sub: 2011-04-01 + * config.sub: update to 2011-04-01 2011-02-02 Thomas E. Dickey - * config.guess: 2011-01-01 + * config.guess: update to 2011-01-01 2010-12-29 Thomas E. Dickey @@ -470,6 +1256,8 @@ * output.c: simplified a little, using putc_code() and putl_code() + * test/yacc/calc1.tab.h: reference output for testing + * test/calc1.tab.h: regen * reader.c: @@ -530,11 +1318,11 @@ 2010-09-28 Thomas E. Dickey - * config.guess: 2010-09-24 + * config.guess: update to 2010-09-24 2010-09-10 Thomas E. Dickey - * config.sub: 2010-09-11 + * config.sub: update to 2010-09-11 2010-06-10 Thomas E. Dickey @@ -551,9 +1339,20 @@ improve %lex-param / %parse-param implementation by allowing for arrays to be passed as parameters, e.g., "int regs[26]". - * test/calc3.tab.c, test/calc3.y, test/calc3.output, test/calc3.tab.h, test/calc2.tab.c, test/calc2.y, test/calc2.tab.h, test/calc2.output: + * test/calc3.tab.c, test/calc3.y, test/calc3.output, test/calc3.tab.h: RCS_BASE + * test/yacc/calc3.output, test/yacc/calc3.tab.h: + reference output for testing + + * test/calc2.tab.c, test/calc2.y, test/calc2.tab.h: RCS_BASE + + * test/yacc/calc2.tab.h: reference output for testing + + * test/calc2.output: RCS_BASE + + * test/yacc/calc2.output: reference output for testing + * output.c: improve %lex-param / %parse-param implementation by allowing for arrays to be passed as parameters, e.g., "int regs[26]". @@ -613,9 +1412,27 @@ provide for testing -r and -P options by checking if the ".y" filename begins with "code_" or "pure_", respectively. - * test/code_error.code.c, test/code_error.tab.c, test/code_error.tab.h, test/code_calc.code.c, test/code_calc.tab.c, test/code_calc.tab.h, test/pure_calc.output, test/pure_calc.tab.h, test/pure_error.output, test/pure_error.tab.h, test/code_calc.output, test/code_error.output: + * test/code_error.code.c, test/code_error.tab.c, test/code_error.tab.h: + RCS_BASE + + * test/yacc/code_error.tab.h: reference output for testing + + * test/code_calc.code.c, test/code_calc.tab.c, test/code_calc.tab.h: RCS_BASE + * test/yacc/code_calc.tab.h: reference output for testing + + * test/pure_calc.output, test/pure_calc.tab.h, test/pure_error.output, test/pure_error.tab.h: + RCS_BASE + + * test/yacc/pure_calc.output, test/yacc/pure_calc.tab.h, test/yacc/pure_error.output, test/yacc/pure_error.tab.h: + reference output for testing + + * test/code_calc.output, test/code_error.output: RCS_BASE + + * test/yacc/code_calc.output, test/yacc/code_error.output: + reference output for testing + * test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c: regen * test/run_test.sh: @@ -770,9 +1587,9 @@ 2009-12-31 Thomas E. Dickey - * config.guess: 2009-12-30 + * config.guess: update to 2009-12-30 - * config.sub: 2009-12-31 + * config.sub: update to 2009-12-31 2009-10-27 Thomas E. Dickey @@ -798,7 +1615,7 @@ 2009-08-25 Thomas E. Dickey - * config.guess, config.sub: 2009-08-19 + * config.guess, config.sub: update to 2009-08-19 2009-02-21 Thomas E. Dickey @@ -979,11 +1796,11 @@ 2006-12-22 Thomas E. Dickey - * config.guess: 2006/12/22 + * config.guess: update to 2006/12/22 2006-12-08 Thomas E. Dickey - * config.sub: 2006/12/08 + * config.sub: update to 2006/12/08 2005-08-13 Thomas E. Dickey @@ -1012,9 +1829,9 @@ 2005-06-25 Thomas E. Dickey - * config.sub: 2005/6/2 + * config.sub: update to 2005/6/2 - * config.guess: 2005/5/27 + * config.guess: update to 2005/5/27 2005-05-05 Thomas E. Dickey @@ -1108,9 +1925,9 @@ 2005-04-16 Thomas E. Dickey - * config.sub: 2005/2/10 + * config.sub: update to 2005/2/10 - * config.guess: 2005/3/24 + * config.guess: update to 2005/3/24 2005-04-13 Thomas E. Dickey @@ -1164,9 +1981,18 @@ * test/grammar.output, test/grammar.tab.c, test/grammar.tab.h: RCS_BASE + * test/yacc/grammar.output, test/yacc/grammar.tab.h: + reference output for testing + * makefile.in: turn on "make check" rule - * test/calc.output, test/run_test.sh, test/calc.tab.h: RCS_BASE + * test/calc.output: RCS_BASE + + * test/yacc/calc.output: reference output for testing + + * test/run_test.sh, test/calc.tab.h: RCS_BASE + + * test/yacc/calc.tab.h: reference output for testing * test/ftp.tab.c: yyparse() is now yyparse(void) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 00:29:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E92A67A; Sun, 20 Jul 2014 00:29:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEE452D6F; Sun, 20 Jul 2014 00:29:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K0Tgs8074175; Sun, 20 Jul 2014 00:29:42 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K0TgEU074162; Sun, 20 Jul 2014 00:29:42 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407200029.s6K0TgEU074162@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 20 Jul 2014 00:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268900 - stable/10/lib/libfetch X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 00:29:43 -0000 Author: bapt Date: Sun Jul 20 00:29:41 2014 New Revision: 268900 URL: http://svnweb.freebsd.org/changeset/base/268900 Log: MFC: r267131, r267132, r267133, r268493, r268671 Use NULL instead of 0 (Patch by Sascha Wildner for Dragonfly) Remove unnecessary semicolons (Patch by Sascha Wildner for Dragonfly) Add support for arbitrary http requests [1] Support EAGAIN in fetch_writev Submitted by: Alex Hornung [1] Reviewed by: des Modified: stable/10/lib/libfetch/common.c stable/10/lib/libfetch/common.h stable/10/lib/libfetch/fetch.h stable/10/lib/libfetch/http.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libfetch/common.c ============================================================================== --- stable/10/lib/libfetch/common.c Sun Jul 20 00:21:38 2014 (r268899) +++ stable/10/lib/libfetch/common.c Sun Jul 20 00:29:41 2014 (r268900) @@ -1110,6 +1110,9 @@ fetch_writev(conn_t *conn, struct iovec errno = 0; pfd.revents = 0; if (poll(&pfd, 1, deltams) < 0) { + /* POSIX compliance */ + if (errno == EAGAIN) + continue; if (errno == EINTR && fetchRestartCalls) continue; return (-1); Modified: stable/10/lib/libfetch/common.h ============================================================================== --- stable/10/lib/libfetch/common.h Sun Jul 20 00:21:38 2014 (r268899) +++ stable/10/lib/libfetch/common.h Sun Jul 20 00:29:41 2014 (r268900) @@ -117,6 +117,9 @@ int fetch_no_proxy_match(const char *) */ FILE *http_request(struct url *, const char *, struct url_stat *, struct url *, const char *); +FILE *http_request_body(struct url *, const char *, + struct url_stat *, struct url *, const char *, + const char *, const char *); FILE *ftp_request(struct url *, const char *, struct url_stat *, struct url *, const char *); Modified: stable/10/lib/libfetch/fetch.h ============================================================================== --- stable/10/lib/libfetch/fetch.h Sun Jul 20 00:21:38 2014 (r268899) +++ stable/10/lib/libfetch/fetch.h Sun Jul 20 00:29:41 2014 (r268900) @@ -102,6 +102,8 @@ FILE *fetchGetHTTP(struct url *, const FILE *fetchPutHTTP(struct url *, const char *); int fetchStatHTTP(struct url *, struct url_stat *, const char *); struct url_ent *fetchListHTTP(struct url *, const char *); +FILE *fetchReqHTTP(struct url *, const char *, const char *, + const char *, const char *); /* FTP-specific functions */ FILE *fetchXGetFTP(struct url *, struct url_stat *, const char *); Modified: stable/10/lib/libfetch/http.c ============================================================================== --- stable/10/lib/libfetch/http.c Sun Jul 20 00:21:38 2014 (r268899) +++ stable/10/lib/libfetch/http.c Sun Jul 20 00:29:41 2014 (r268900) @@ -1030,7 +1030,7 @@ typedef struct { static void init_http_auth_params(http_auth_params_t *s) { - s->scheme = s->realm = s->user = s->password = 0; + s->scheme = s->realm = s->user = s->password = NULL; } static void @@ -1129,7 +1129,7 @@ CvtHex(IN HASH Bin, OUT HASHHEX Hex) Hex[i*2] = hexchars[j]; j = Bin[i] & 0xf; Hex[i*2+1] = hexchars[j]; - }; + } Hex[HASHHEXLEN] = '\0'; }; @@ -1164,7 +1164,7 @@ DigestCalcHA1( MD5Update(&Md5Ctx, ":", 1); MD5Update(&Md5Ctx, pszCNonce, strlen(pszCNonce)); MD5Final(HA1, &Md5Ctx); - }; + } CvtHex(HA1, SessionKey); } @@ -1198,7 +1198,7 @@ DigestCalcResponse( if (strcasecmp(pszQop, "auth-int") == 0) { MD5Update(&Md5Ctx, ":", 1); MD5Update(&Md5Ctx, HEntity, HASHHEXLEN); - }; + } MD5Final(HA2, &Md5Ctx); CvtHex(HA2, HA2Hex); @@ -1215,7 +1215,7 @@ DigestCalcResponse( MD5Update(&Md5Ctx, ":", 1); MD5Update(&Md5Ctx, pszQop, strlen(pszQop)); MD5Update(&Md5Ctx, ":", 1); - }; + } MD5Update(&Md5Ctx, HA2Hex, HASHHEXLEN); MD5Final(RespHash, &Md5Ctx); CvtHex(RespHash, Response); @@ -1249,7 +1249,7 @@ http_digest_auth(conn_t *conn, const cha int r; char noncecount[10]; char cnonce[40]; - char *options = 0; + char *options = NULL; if (!c->realm || !c->nonce) { DEBUG(fprintf(stderr, "realm/nonce not set in challenge\n")); @@ -1494,6 +1494,14 @@ http_print_html(FILE *out, FILE *in) * Core */ +FILE * +http_request(struct url *URL, const char *op, struct url_stat *us, + struct url *purl, const char *flags) +{ + + return (http_request_body(URL, op, us, purl, flags, NULL, NULL)); +} + /* * Send a request and process the reply * @@ -1501,8 +1509,9 @@ http_print_html(FILE *out, FILE *in) * XXX off into a separate function. */ FILE * -http_request(struct url *URL, const char *op, struct url_stat *us, - struct url *purl, const char *flags) +http_request_body(struct url *URL, const char *op, struct url_stat *us, + struct url *purl, const char *flags, const char *content_type, + const char *body) { char timebuf[80]; char hbuf[MAXHOSTNAMELEN + 7], *host; @@ -1519,6 +1528,7 @@ http_request(struct url *URL, const char http_headerbuf_t headerbuf; http_auth_challenges_t server_challenges; http_auth_challenges_t proxy_challenges; + size_t body_len; /* The following calls don't allocate anything */ init_http_headerbuf(&headerbuf); @@ -1690,8 +1700,19 @@ http_request(struct url *URL, const char if (url->offset > 0) http_cmd(conn, "Range: bytes=%lld-", (long long)url->offset); http_cmd(conn, "Connection: close"); + + if (body) { + body_len = strlen(body); + http_cmd(conn, "Content-Length: %zu", body_len); + if (content_type != NULL) + http_cmd(conn, "Content-Type: %s", content_type); + } + http_cmd(conn, ""); + if (body) + fetch_write(conn, body, body_len); + /* * Force the queued request to be dispatched. Normally, one * would do this with shutdown(2) but squid proxies can be @@ -2042,3 +2063,12 @@ fetchListHTTP(struct url *url __unused, warnx("fetchListHTTP(): not implemented"); return (NULL); } + +FILE * +fetchReqHTTP(struct url *URL, const char *method, const char *flags, + const char *content_type, const char *body) +{ + + return (http_request_body(URL, method, NULL, http_get_proxy(URL, flags), + flags, content_type, body)); +} From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 00:30:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14B7D7CA; Sun, 20 Jul 2014 00:30:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 012692DE5; Sun, 20 Jul 2014 00:30:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K0UT2d075375; Sun, 20 Jul 2014 00:30:29 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K0UTO1075370; Sun, 20 Jul 2014 00:30:29 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407200030.s6K0UTO1075370@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 20 Jul 2014 00:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r268901 - stable/9/lib/libfetch X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 00:30:30 -0000 Author: bapt Date: Sun Jul 20 00:30:28 2014 New Revision: 268901 URL: http://svnweb.freebsd.org/changeset/base/268901 Log: MFC: r267131, r267132, r267133, r268493, r268671 Use NULL instead of 0 (Patch by Sascha Wildner for Dragonfly) Remove unnecessary semicolons (Patch by Sascha Wildner for Dragonfly) Add support for arbitrary http requests [1] Support EAGAIN in fetch_writev Submitted by: Alex Hornung [1] Reviewed by: des Modified: stable/9/lib/libfetch/common.c stable/9/lib/libfetch/common.h stable/9/lib/libfetch/fetch.h stable/9/lib/libfetch/http.c Directory Properties: stable/9/lib/libfetch/ (props changed) Modified: stable/9/lib/libfetch/common.c ============================================================================== --- stable/9/lib/libfetch/common.c Sun Jul 20 00:29:41 2014 (r268900) +++ stable/9/lib/libfetch/common.c Sun Jul 20 00:30:28 2014 (r268901) @@ -1110,6 +1110,9 @@ fetch_writev(conn_t *conn, struct iovec errno = 0; pfd.revents = 0; if (poll(&pfd, 1, deltams) < 0) { + /* POSIX compliance */ + if (errno == EAGAIN) + continue; if (errno == EINTR && fetchRestartCalls) continue; return (-1); Modified: stable/9/lib/libfetch/common.h ============================================================================== --- stable/9/lib/libfetch/common.h Sun Jul 20 00:29:41 2014 (r268900) +++ stable/9/lib/libfetch/common.h Sun Jul 20 00:30:28 2014 (r268901) @@ -117,6 +117,9 @@ int fetch_no_proxy_match(const char *) */ FILE *http_request(struct url *, const char *, struct url_stat *, struct url *, const char *); +FILE *http_request_body(struct url *, const char *, + struct url_stat *, struct url *, const char *, + const char *, const char *); FILE *ftp_request(struct url *, const char *, struct url_stat *, struct url *, const char *); Modified: stable/9/lib/libfetch/fetch.h ============================================================================== --- stable/9/lib/libfetch/fetch.h Sun Jul 20 00:29:41 2014 (r268900) +++ stable/9/lib/libfetch/fetch.h Sun Jul 20 00:30:28 2014 (r268901) @@ -102,6 +102,8 @@ FILE *fetchGetHTTP(struct url *, const FILE *fetchPutHTTP(struct url *, const char *); int fetchStatHTTP(struct url *, struct url_stat *, const char *); struct url_ent *fetchListHTTP(struct url *, const char *); +FILE *fetchReqHTTP(struct url *, const char *, const char *, + const char *, const char *); /* FTP-specific functions */ FILE *fetchXGetFTP(struct url *, struct url_stat *, const char *); Modified: stable/9/lib/libfetch/http.c ============================================================================== --- stable/9/lib/libfetch/http.c Sun Jul 20 00:29:41 2014 (r268900) +++ stable/9/lib/libfetch/http.c Sun Jul 20 00:30:28 2014 (r268901) @@ -1030,7 +1030,7 @@ typedef struct { static void init_http_auth_params(http_auth_params_t *s) { - s->scheme = s->realm = s->user = s->password = 0; + s->scheme = s->realm = s->user = s->password = NULL; } static void @@ -1129,7 +1129,7 @@ CvtHex(IN HASH Bin, OUT HASHHEX Hex) Hex[i*2] = hexchars[j]; j = Bin[i] & 0xf; Hex[i*2+1] = hexchars[j]; - }; + } Hex[HASHHEXLEN] = '\0'; }; @@ -1164,7 +1164,7 @@ DigestCalcHA1( MD5Update(&Md5Ctx, ":", 1); MD5Update(&Md5Ctx, pszCNonce, strlen(pszCNonce)); MD5Final(HA1, &Md5Ctx); - }; + } CvtHex(HA1, SessionKey); } @@ -1198,7 +1198,7 @@ DigestCalcResponse( if (strcasecmp(pszQop, "auth-int") == 0) { MD5Update(&Md5Ctx, ":", 1); MD5Update(&Md5Ctx, HEntity, HASHHEXLEN); - }; + } MD5Final(HA2, &Md5Ctx); CvtHex(HA2, HA2Hex); @@ -1215,7 +1215,7 @@ DigestCalcResponse( MD5Update(&Md5Ctx, ":", 1); MD5Update(&Md5Ctx, pszQop, strlen(pszQop)); MD5Update(&Md5Ctx, ":", 1); - }; + } MD5Update(&Md5Ctx, HA2Hex, HASHHEXLEN); MD5Final(RespHash, &Md5Ctx); CvtHex(RespHash, Response); @@ -1249,7 +1249,7 @@ http_digest_auth(conn_t *conn, const cha int r; char noncecount[10]; char cnonce[40]; - char *options = 0; + char *options = NULL; if (!c->realm || !c->nonce) { DEBUG(fprintf(stderr, "realm/nonce not set in challenge\n")); @@ -1494,6 +1494,14 @@ http_print_html(FILE *out, FILE *in) * Core */ +FILE * +http_request(struct url *URL, const char *op, struct url_stat *us, + struct url *purl, const char *flags) +{ + + return (http_request_body(URL, op, us, purl, flags, NULL, NULL)); +} + /* * Send a request and process the reply * @@ -1501,8 +1509,9 @@ http_print_html(FILE *out, FILE *in) * XXX off into a separate function. */ FILE * -http_request(struct url *URL, const char *op, struct url_stat *us, - struct url *purl, const char *flags) +http_request_body(struct url *URL, const char *op, struct url_stat *us, + struct url *purl, const char *flags, const char *content_type, + const char *body) { char timebuf[80]; char hbuf[MAXHOSTNAMELEN + 7], *host; @@ -1519,6 +1528,7 @@ http_request(struct url *URL, const char http_headerbuf_t headerbuf; http_auth_challenges_t server_challenges; http_auth_challenges_t proxy_challenges; + size_t body_len; /* The following calls don't allocate anything */ init_http_headerbuf(&headerbuf); @@ -1690,8 +1700,19 @@ http_request(struct url *URL, const char if (url->offset > 0) http_cmd(conn, "Range: bytes=%lld-", (long long)url->offset); http_cmd(conn, "Connection: close"); + + if (body) { + body_len = strlen(body); + http_cmd(conn, "Content-Length: %zu", body_len); + if (content_type != NULL) + http_cmd(conn, "Content-Type: %s", content_type); + } + http_cmd(conn, ""); + if (body) + fetch_write(conn, body, body_len); + /* * Force the queued request to be dispatched. Normally, one * would do this with shutdown(2) but squid proxies can be @@ -2042,3 +2063,12 @@ fetchListHTTP(struct url *url __unused, warnx("fetchListHTTP(): not implemented"); return (NULL); } + +FILE * +fetchReqHTTP(struct url *URL, const char *method, const char *flags, + const char *content_type, const char *body) +{ + + return (http_request_body(URL, method, NULL, http_get_proxy(URL, flags), + flags, content_type, body)); +} From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 00:32:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A741922; Sun, 20 Jul 2014 00:32:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 770C22DF3; Sun, 20 Jul 2014 00:32:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K0WNTU077819; Sun, 20 Jul 2014 00:32:23 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K0WNpY077817; Sun, 20 Jul 2014 00:32:23 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407200032.s6K0WNpY077817@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 20 Jul 2014 00:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268902 - stable/10/lib/libz X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 00:32:23 -0000 Author: bapt Date: Sun Jul 20 00:32:22 2014 New Revision: 268902 URL: http://svnweb.freebsd.org/changeset/base/268902 Log: MFC: r267376 Add a zlib pkg-config file (more and more ports requires it) Approved by: delphij Added: stable/10/lib/libz/zlib.pc - copied unchanged from r267376, head/lib/libz/zlib.pc Modified: stable/10/lib/libz/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libz/Makefile ============================================================================== --- stable/10/lib/libz/Makefile Sun Jul 20 00:30:28 2014 (r268901) +++ stable/10/lib/libz/Makefile Sun Jul 20 00:32:22 2014 (r268902) @@ -68,6 +68,10 @@ test: example minigzip (export LD_LIBRARY_PATH=. ; \ echo hello world | ./minigzip | ./minigzip -d ) +beforeinstall: + ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${.CURDIR}/zlib.pc ${DESTDIR}${LIBDATADIR}/pkgconfig + .include ## XXX: clang integrated-as doesn't grok .intel_syntax directives yet Copied: stable/10/lib/libz/zlib.pc (from r267376, head/lib/libz/zlib.pc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libz/zlib.pc Sun Jul 20 00:32:22 2014 (r268902, copy of r267376, head/lib/libz/zlib.pc) @@ -0,0 +1,14 @@ +# $FreeBSD$ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +sharedlibdir=${libdir} +includedir=${prefix}/include + +Name: zlib +Description: zlib compression library +Version: 1.2.8 + +Requires: +Libs: -L${libdir} -L${sharedlibdir} -lz +Cflags: -I${includedir} From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 00:34:55 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B3E6A63; Sun, 20 Jul 2014 00:34:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC4D52DFF; Sun, 20 Jul 2014 00:34:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K0YsoJ078296; Sun, 20 Jul 2014 00:34:54 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K0YsO6078294; Sun, 20 Jul 2014 00:34:54 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407200034.s6K0YsO6078294@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 20 Jul 2014 00:34:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268903 - stable/10/sbin/kldstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 00:34:55 -0000 Author: bapt Date: Sun Jul 20 00:34:54 2014 New Revision: 268903 URL: http://svnweb.freebsd.org/changeset/base/268903 Log: MFC: r261032 Add quiet support for kldstat -n PR: bin/180014 Submitted by: Olivier Cochard-Labbé Modified: stable/10/sbin/kldstat/kldstat.8 stable/10/sbin/kldstat/kldstat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/kldstat/kldstat.8 ============================================================================== --- stable/10/sbin/kldstat/kldstat.8 Sun Jul 20 00:32:22 2014 (r268902) +++ stable/10/sbin/kldstat/kldstat.8 Sun Jul 20 00:34:54 2014 (r268903) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 23, 2005 +.Dd January 22, 2014 .Dt KLDSTAT 8 .Os .Sh NAME @@ -33,6 +33,7 @@ .Nd display status of dynamic kernel linker .Sh SYNOPSIS .Nm +.Op Fl q .Op Fl v .Op Fl i Ar id .Op Fl n Ar filename Modified: stable/10/sbin/kldstat/kldstat.c ============================================================================== --- stable/10/sbin/kldstat/kldstat.c Sun Jul 20 00:32:22 2014 (r268902) +++ stable/10/sbin/kldstat/kldstat.c Sun Jul 20 00:34:54 2014 (r268903) @@ -78,7 +78,7 @@ printfile(int fileid, int verbose) static void usage(void) { - fprintf(stderr, "usage: kldstat [-v] [-i id] [-n filename]\n"); + fprintf(stderr, "usage: kldstat [-q] [-v] [-i id] [-n filename]\n"); fprintf(stderr, " kldstat [-q] [-m modname]\n"); exit(1); } @@ -146,8 +146,13 @@ main(int argc, char** argv) } if (filename != NULL) { - if ((fileid = kldfind(filename)) < 0) - err(1, "can't find file %s", filename); + if ((fileid = kldfind(filename)) < 0) { + if (!quiet) + warn("can't find file %s", filename); + return 1; + } else if (quiet) { + return 0; + } } printf("Id Refs Address%*c Size Name\n", POINTER_WIDTH - 7, ' '); From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 01:03:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 632C3E25; Sun, 20 Jul 2014 01:03:09 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id A4C972FEA; Sun, 20 Jul 2014 01:03:08 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id 5960520E7088C; Sun, 20 Jul 2014 01:03:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: ** X-Spam-Status: No, score=2.3 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,HELO_NO_DOMAIN,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no version=3.3.1 Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTPS id 5A1D620E7088A; Sun, 20 Jul 2014 01:02:57 +0000 (UTC) Message-ID: <32EEE9A6E8FE4D6FBE0E8CD53F2709CE@multiplay.co.uk> From: "Steven Hartland" To: "Baptiste Daroussin" , , , , References: <201407200029.s6K0TgEU074162@svn.freebsd.org> Subject: Re: svn commit: r268900 - stable/10/lib/libfetch Date: Sun, 20 Jul 2014 02:02:48 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 01:03:09 -0000 poll isnt documented as ever returning EAGAIN, are the docs for poll incorrect or does that part of this patch require reverting? Regards Steve ----- Original Message ----- From: "Baptiste Daroussin" To: ; ; ; Sent: Sunday, July 20, 2014 1:29 AM Subject: svn commit: r268900 - stable/10/lib/libfetch > Author: bapt > Date: Sun Jul 20 00:29:41 2014 > New Revision: 268900 > URL: http://svnweb.freebsd.org/changeset/base/268900 > > Log: > MFC: r267131, r267132, r267133, r268493, r268671 > > Use NULL instead of 0 (Patch by Sascha Wildner for Dragonfly) > Remove unnecessary semicolons (Patch by Sascha Wildner for Dragonfly) > Add support for arbitrary http requests [1] > Support EAGAIN in fetch_writev > > Submitted by: Alex Hornung [1] > Reviewed by: des > > Modified: > stable/10/lib/libfetch/common.c > stable/10/lib/libfetch/common.h > stable/10/lib/libfetch/fetch.h > stable/10/lib/libfetch/http.c > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/lib/libfetch/common.c > ============================================================================== > --- stable/10/lib/libfetch/common.c Sun Jul 20 00:21:38 2014 (r268899) > +++ stable/10/lib/libfetch/common.c Sun Jul 20 00:29:41 2014 (r268900) > @@ -1110,6 +1110,9 @@ fetch_writev(conn_t *conn, struct iovec > errno = 0; > pfd.revents = 0; > if (poll(&pfd, 1, deltams) < 0) { > + /* POSIX compliance */ > + if (errno == EAGAIN) > + continue; > if (errno == EINTR && fetchRestartCalls) > continue; > return (-1); > > Modified: stable/10/lib/libfetch/common.h > ============================================================================== > --- stable/10/lib/libfetch/common.h Sun Jul 20 00:21:38 2014 (r268899) > +++ stable/10/lib/libfetch/common.h Sun Jul 20 00:29:41 2014 (r268900) > @@ -117,6 +117,9 @@ int fetch_no_proxy_match(const char *) > */ > FILE *http_request(struct url *, const char *, > struct url_stat *, struct url *, const char *); > +FILE *http_request_body(struct url *, const char *, > + struct url_stat *, struct url *, const char *, > + const char *, const char *); > FILE *ftp_request(struct url *, const char *, > struct url_stat *, struct url *, const char *); > > > Modified: stable/10/lib/libfetch/fetch.h > ============================================================================== > --- stable/10/lib/libfetch/fetch.h Sun Jul 20 00:21:38 2014 (r268899) > +++ stable/10/lib/libfetch/fetch.h Sun Jul 20 00:29:41 2014 (r268900) > @@ -102,6 +102,8 @@ FILE *fetchGetHTTP(struct url *, const > FILE *fetchPutHTTP(struct url *, const char *); > int fetchStatHTTP(struct url *, struct url_stat *, const char *); > struct url_ent *fetchListHTTP(struct url *, const char *); > +FILE *fetchReqHTTP(struct url *, const char *, const char *, > + const char *, const char *); > > /* FTP-specific functions */ > FILE *fetchXGetFTP(struct url *, struct url_stat *, const char *); > > Modified: stable/10/lib/libfetch/http.c > ============================================================================== > --- stable/10/lib/libfetch/http.c Sun Jul 20 00:21:38 2014 (r268899) > +++ stable/10/lib/libfetch/http.c Sun Jul 20 00:29:41 2014 (r268900) > @@ -1030,7 +1030,7 @@ typedef struct { > static void > init_http_auth_params(http_auth_params_t *s) > { > - s->scheme = s->realm = s->user = s->password = 0; > + s->scheme = s->realm = s->user = s->password = NULL; > } > > static void > @@ -1129,7 +1129,7 @@ CvtHex(IN HASH Bin, OUT HASHHEX Hex) > Hex[i*2] = hexchars[j]; > j = Bin[i] & 0xf; > Hex[i*2+1] = hexchars[j]; > - }; > + } > Hex[HASHHEXLEN] = '\0'; > }; > > @@ -1164,7 +1164,7 @@ DigestCalcHA1( > MD5Update(&Md5Ctx, ":", 1); > MD5Update(&Md5Ctx, pszCNonce, strlen(pszCNonce)); > MD5Final(HA1, &Md5Ctx); > - }; > + } > CvtHex(HA1, SessionKey); > } > > @@ -1198,7 +1198,7 @@ DigestCalcResponse( > if (strcasecmp(pszQop, "auth-int") == 0) { > MD5Update(&Md5Ctx, ":", 1); > MD5Update(&Md5Ctx, HEntity, HASHHEXLEN); > - }; > + } > MD5Final(HA2, &Md5Ctx); > CvtHex(HA2, HA2Hex); > > @@ -1215,7 +1215,7 @@ DigestCalcResponse( > MD5Update(&Md5Ctx, ":", 1); > MD5Update(&Md5Ctx, pszQop, strlen(pszQop)); > MD5Update(&Md5Ctx, ":", 1); > - }; > + } > MD5Update(&Md5Ctx, HA2Hex, HASHHEXLEN); > MD5Final(RespHash, &Md5Ctx); > CvtHex(RespHash, Response); > @@ -1249,7 +1249,7 @@ http_digest_auth(conn_t *conn, const cha > int r; > char noncecount[10]; > char cnonce[40]; > - char *options = 0; > + char *options = NULL; > > if (!c->realm || !c->nonce) { > DEBUG(fprintf(stderr, "realm/nonce not set in challenge\n")); > @@ -1494,6 +1494,14 @@ http_print_html(FILE *out, FILE *in) > * Core > */ > > +FILE * > +http_request(struct url *URL, const char *op, struct url_stat *us, > + struct url *purl, const char *flags) > +{ > + > + return (http_request_body(URL, op, us, purl, flags, NULL, NULL)); > +} > + > /* > * Send a request and process the reply > * > @@ -1501,8 +1509,9 @@ http_print_html(FILE *out, FILE *in) > * XXX off into a separate function. > */ > FILE * > -http_request(struct url *URL, const char *op, struct url_stat *us, > - struct url *purl, const char *flags) > +http_request_body(struct url *URL, const char *op, struct url_stat *us, > + struct url *purl, const char *flags, const char *content_type, > + const char *body) > { > char timebuf[80]; > char hbuf[MAXHOSTNAMELEN + 7], *host; > @@ -1519,6 +1528,7 @@ http_request(struct url *URL, const char > http_headerbuf_t headerbuf; > http_auth_challenges_t server_challenges; > http_auth_challenges_t proxy_challenges; > + size_t body_len; > > /* The following calls don't allocate anything */ > init_http_headerbuf(&headerbuf); > @@ -1690,8 +1700,19 @@ http_request(struct url *URL, const char > if (url->offset > 0) > http_cmd(conn, "Range: bytes=%lld-", (long long)url->offset); > http_cmd(conn, "Connection: close"); > + > + if (body) { > + body_len = strlen(body); > + http_cmd(conn, "Content-Length: %zu", body_len); > + if (content_type != NULL) > + http_cmd(conn, "Content-Type: %s", content_type); > + } > + > http_cmd(conn, ""); > > + if (body) > + fetch_write(conn, body, body_len); > + > /* > * Force the queued request to be dispatched. Normally, one > * would do this with shutdown(2) but squid proxies can be > @@ -2042,3 +2063,12 @@ fetchListHTTP(struct url *url __unused, > warnx("fetchListHTTP(): not implemented"); > return (NULL); > } > + > +FILE * > +fetchReqHTTP(struct url *URL, const char *method, const char *flags, > + const char *content_type, const char *body) > +{ > + > + return (http_request_body(URL, method, NULL, http_get_proxy(URL, flags), > + flags, content_type, body)); > +} > > From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 01:15:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE3B0361; Sun, 20 Jul 2014 01:15:08 +0000 (UTC) Received: from mail-oa0-x236.google.com (mail-oa0-x236.google.com [IPv6:2607:f8b0:4003:c02::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6483520D6; Sun, 20 Jul 2014 01:15:08 +0000 (UTC) Received: by mail-oa0-f54.google.com with SMTP id n16so5604850oag.27 for ; Sat, 19 Jul 2014 18:15:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=cPEEMB6e1FHr/u+4mW0Rx6ttz45SwQeGDpw3ITtom7s=; b=xj9pR0mDpa7oShgK28mkjry/iht9cs9ExR8rx0fjzJOaCaIBT6Eo5Q/OYxSS7MHkqN 0uhhk3jJenOssBy+0tU1z0pKbmgrXzJMxt0criJLPRFzN9YY9kWZMTzMNZ3CDpvJv1Rl dnnJCyoBGZthnGiJvXSefKYY+wO4RAY+xF+T80PSO6p516jcQRgHfPrq2bE+lIiXZGj5 ZmPaKhD1ZQY0tJX2kiIoVUgf8IqbxziyPSP2uMEXGFr8dAAtMg00OkSM70PYqU8kI/kt vX+AojkZS+tnLd8omUAt5LNdDHF85jo7emQ14XWga4y5soVs+B1Gv2xAyrPkPXzIfo7R HU7A== MIME-Version: 1.0 X-Received: by 10.60.116.166 with SMTP id jx6mr22222190oeb.6.1405818907733; Sat, 19 Jul 2014 18:15:07 -0700 (PDT) Received: by 10.182.142.34 with HTTP; Sat, 19 Jul 2014 18:15:07 -0700 (PDT) In-Reply-To: <32EEE9A6E8FE4D6FBE0E8CD53F2709CE@multiplay.co.uk> References: <201407200029.s6K0TgEU074162@svn.freebsd.org> <32EEE9A6E8FE4D6FBE0E8CD53F2709CE@multiplay.co.uk> Date: Sat, 19 Jul 2014 21:15:07 -0400 Message-ID: Subject: Re: svn commit: r268900 - stable/10/lib/libfetch From: Benjamin Kaduk To: Steven Hartland Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: svn-src-stable@freebsd.org, Baptiste Daroussin , "src-committers@freebsd.org" , svn-src-stable-10@freebsd.org, "svn-src-all@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 01:15:08 -0000 On Sat, Jul 19, 2014 at 9:02 PM, Steven Hartland wrote: > poll isnt documented as ever returning EAGAIN, are the docs for poll > incorrect > or does that part of this patch require reverting? > This was covered after the initial commit to head; see http://lists.freebsd.org/pipermail/svn-src-head/2014-July/060301.html -Ben From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 01:21:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8EEE74D3; Sun, 20 Jul 2014 01:21:21 +0000 (UTC) Received: from mail-we0-x230.google.com (mail-we0-x230.google.com [IPv6:2a00:1450:400c:c03::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A651F2162; Sun, 20 Jul 2014 01:21:20 +0000 (UTC) Received: by mail-we0-f176.google.com with SMTP id q58so6082291wes.7 for ; Sat, 19 Jul 2014 18:21:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=HJXeUH0mtohUKn3fhMFcCYYZ3teM0w8pjpwH3/fiXI8=; b=q9LEfQ40lveMJ73kAvyDVNqJKKQsKE6H/JTp/VuXni0mz/cWBm5J5oHSnMSZY/oMUc 1sd2TlJfToJRDi1JVDDBxeSIp9msZEykaTKrBUkddQkJuZSJstGYbxzLo8pxHFxbec9j M8OPSawST8B6un4j/sMcFRxK+r7X9ENxaSMTTMcsfVfCpDcD37Nka3Np1afjPv1rZsMR Hs0c6m/Pq25SYm1m/t0tLy29XT9/zFcurdrrbKWBeZkJ4pgK8clEn57OQ1zgMfAUYFTg gB99ORbaRv2VG1px1u544Q75LhazwY5BfOvDN8bSedu4YKXa5g0N4ebn1/awTvRv7uL8 /Kdw== X-Received: by 10.195.11.132 with SMTP id ei4mr868531wjd.95.1405819278775; Sat, 19 Jul 2014 18:21:18 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id jy8sm25813740wjc.7.2014.07.19.18.21.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 19 Jul 2014 18:21:17 -0700 (PDT) Sender: Baptiste Daroussin Date: Sun, 20 Jul 2014 03:21:15 +0200 From: Baptiste Daroussin To: Steven Hartland Subject: Re: svn commit: r268900 - stable/10/lib/libfetch Message-ID: <20140720012112.GA26778@ivaldir.etoilebsd.net> References: <201407200029.s6K0TgEU074162@svn.freebsd.org> <32EEE9A6E8FE4D6FBE0E8CD53F2709CE@multiplay.co.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vkogqOf2sHV7VnPd" Content-Disposition: inline In-Reply-To: <32EEE9A6E8FE4D6FBE0E8CD53F2709CE@multiplay.co.uk> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 01:21:21 -0000 --vkogqOf2sHV7VnPd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 20, 2014 at 02:02:48AM +0100, Steven Hartland wrote: > poll isnt documented as ever returning EAGAIN, are the docs for poll inco= rrect > or does that part of this patch require reverting? >=20 > Regards > Steve Hence the comment about the POSIX compatibility, libfetch can work on other operating systems where poll can return EAGAIN according to POSIX: http://pubs.opengroup.org/onlinepubs/009695399/functions/poll.html This kib's comment here: http://lists.freebsd.org/pipermail/svn-src-head/2014-July/060314.html regards, Bapt --vkogqOf2sHV7VnPd Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlPLGYgACgkQ8kTtMUmk6ExnJQCff0hdClN0s7BJYdwdBw8y/0dp PnoAnjXqs2qKZamx0mCBqo8e5qOUjY9v =7AFv -----END PGP SIGNATURE----- --vkogqOf2sHV7VnPd-- From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 02:15:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53C3AB75; Sun, 20 Jul 2014 02:15:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40FA92481; Sun, 20 Jul 2014 02:15:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K2FFOp029860; Sun, 20 Jul 2014 02:15:15 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K2FF2L029859; Sun, 20 Jul 2014 02:15:15 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201407200215.s6K2FF2L029859@svn.freebsd.org> From: Hiren Panchasara Date: Sun, 20 Jul 2014 02:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268904 - stable/10/sys/dev/ixgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 02:15:15 -0000 Author: hiren Date: Sun Jul 20 02:15:14 2014 New Revision: 268904 URL: http://svnweb.freebsd.org/changeset/base/268904 Log: MFC r268790 Fix a typo. Modified: stable/10/sys/dev/ixgbe/ixgbe.c Modified: stable/10/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe.c Sun Jul 20 00:34:54 2014 (r268903) +++ stable/10/sys/dev/ixgbe/ixgbe.c Sun Jul 20 02:15:14 2014 (r268904) @@ -306,7 +306,7 @@ SYSCTL_INT(_hw_ix, OID_AUTO, num_queues, static int ixgbe_txd = PERFORM_TXD; TUNABLE_INT("hw.ixgbe.txd", &ixgbe_txd); SYSCTL_INT(_hw_ix, OID_AUTO, txd, CTLFLAG_RDTUN, &ixgbe_txd, 0, - "Number of receive descriptors per queue"); + "Number of transmit descriptors per queue"); /* Number of RX descriptors per ring */ static int ixgbe_rxd = PERFORM_RXD; From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 02:20:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C804CFF; Sun, 20 Jul 2014 02:20:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4964D2496; Sun, 20 Jul 2014 02:20:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K2K4KU030640; Sun, 20 Jul 2014 02:20:04 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K2K4ZE030639; Sun, 20 Jul 2014 02:20:04 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201407200220.s6K2K4ZE030639@svn.freebsd.org> From: Hiren Panchasara Date: Sun, 20 Jul 2014 02:20:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r268905 - stable/9/sys/dev/ixgbe X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 02:20:04 -0000 Author: hiren Date: Sun Jul 20 02:20:03 2014 New Revision: 268905 URL: http://svnweb.freebsd.org/changeset/base/268905 Log: MFC r268790 Fix a typo. Modified: stable/9/sys/dev/ixgbe/ixgbe.c Modified: stable/9/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe.c Sun Jul 20 02:15:14 2014 (r268904) +++ stable/9/sys/dev/ixgbe/ixgbe.c Sun Jul 20 02:20:03 2014 (r268905) @@ -306,7 +306,7 @@ SYSCTL_INT(_hw_ix, OID_AUTO, num_queues, static int ixgbe_txd = PERFORM_TXD; TUNABLE_INT("hw.ixgbe.txd", &ixgbe_txd); SYSCTL_INT(_hw_ix, OID_AUTO, txd, CTLFLAG_RDTUN, &ixgbe_txd, 0, - "Number of receive descriptors per queue"); + "Number of transmit descriptors per queue"); /* Number of RX descriptors per ring */ static int ixgbe_rxd = PERFORM_RXD; From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 02:38:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2FB22183; Sun, 20 Jul 2014 02:38:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C7D925E6; Sun, 20 Jul 2014 02:38:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K2cwfa039649; Sun, 20 Jul 2014 02:38:58 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K2cwdd039648; Sun, 20 Jul 2014 02:38:58 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201407200238.s6K2cwdd039648@svn.freebsd.org> From: Hiren Panchasara Date: Sun, 20 Jul 2014 02:38:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r268906 - stable/9/sys/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 02:38:59 -0000 Author: hiren Date: Sun Jul 20 02:38:58 2014 New Revision: 268906 URL: http://svnweb.freebsd.org/changeset/base/268906 Log: MFC r250764 Fix rte leak introduced in r248070. Modified: stable/9/sys/net/route.c Modified: stable/9/sys/net/route.c ============================================================================== --- stable/9/sys/net/route.c Sun Jul 20 02:20:03 2014 (r268905) +++ stable/9/sys/net/route.c Sun Jul 20 02:38:58 2014 (r268906) @@ -1638,7 +1638,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int info.rti_ifa = NULL; info.rti_flags = RTF_RNH_LOCKED; - error = rtrequest1_fib(RTM_DELETE, &info, &rt, fibnum); + error = rtrequest1_fib(RTM_DELETE, &info, NULL, fibnum); if (error == 0) { info.rti_ifa = ifa; info.rti_flags = flags | RTF_RNH_LOCKED | From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 03:28:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6737692B for ; Sun, 20 Jul 2014 03:28:44 +0000 (UTC) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAA3B2A17 for ; Sun, 20 Jul 2014 03:28:43 +0000 (UTC) Received: by mail-lb0-f180.google.com with SMTP id v6so3674845lbi.11 for ; Sat, 19 Jul 2014 20:28:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=y8heppdZLvTyYt8ENQOO4NkYq7EOkydV1vD+FfrAuq8=; b=SOOcppPncUJXnn565dF6KHTcnil9mOAJQfguJRPn0obrsq2q1qta/XvvkbjWebrBVD 7zXOle0etj/TyhWtjeuPpPb6b8oaBvbx//iq0/OaK2DS1O1yy3f6w6uIiycCR21gbzXk XAnQySseHdpH8TzOTe0G4Fg769FKv5gnLxnRE71XB1KW9Z5T2FzrWnO69bnNW8Jxe71p AqAfMRPj066Pgt4CqovTJvAepC8sLvz/lkSub28vVtf/uZl3IUs+UpRsiKepT1O/ZmMt ANwldnis7IEBZA8Q25/4tHLK5qOCW0KGFLRQGvY3hKzK5UGWkfHeOTBIsnr2ZVjIrw9Q VPTA== X-Gm-Message-State: ALoCoQnnGPit1uzMLAtMY1PkCKMP9nJsWdfUS7/EH7rMfEB4XPG7haiR4ZmY05bXhxT5/FfGYT6q X-Received: by 10.112.84.199 with SMTP id b7mr14953226lbz.25.1405826915022; Sat, 19 Jul 2014 20:28:35 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id q8sm17658470lbr.28.2014.07.19.20.28.33 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 19 Jul 2014 20:28:34 -0700 (PDT) Message-ID: <53CB3760.5050008@freebsd.org> Date: Sun, 20 Jul 2014 07:28:32 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r268896 - in stable/10: contrib/libucl contrib/libucl/cmake contrib/libucl/doc contrib/libucl/include contrib/libucl/src contrib/libucl/tests contrib/libucl/tests/basic contrib/libucl/t... References: <201407192344.s6JNiwhg052804@svn.freebsd.org> In-Reply-To: <201407192344.s6JNiwhg052804@svn.freebsd.org> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 03:28:44 -0000 On 20.07.2014 3:44, Baptiste Daroussin wrote: > Adapt pkg(7) to the new libucl API There is no -lm added, as result: cc -O2 -pipe -march=core2 -I/usr/src/usr.sbin/pkg/../../contrib/libucl/include -std=gnu99 -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wmissing-variable-declarations -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -L/usr/lib/private -rpath /usr/lib/private -o pkg pkg.o dns_utils.o config.o -larchive -lelf -lfetch -lucl -lsbuf -lssl -lcrypto /usr/lib/private/libucl.so: undefined reference to `remainder' cc: error: linker command failed with exit code 1 (use -v to see invocation) *** Error code 1 Stop. make: stopped in /usr/src/usr.sbin/pkg -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 04:11:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB549C8D; Sun, 20 Jul 2014 04:11:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A91022D2A; Sun, 20 Jul 2014 04:11:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K4BICp084818; Sun, 20 Jul 2014 04:11:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K4BI3u084817; Sun, 20 Jul 2014 04:11:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407200411.s6K4BI3u084817@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 Jul 2014 04:11:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268907 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 04:11:18 -0000 Author: adrian Date: Sun Jul 20 04:11:18 2014 New Revision: 268907 URL: http://svnweb.freebsd.org/changeset/base/268907 Log: Correctly program the RSS redirection table entries. Without this, the RSS bucket assignments aren't correct - they're DCBA instead of ABCD in each DWORD. Tested: 82599EB ixgbe(4), TCP and UDP RSS Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sun Jul 20 02:38:58 2014 (r268906) +++ head/sys/dev/ixgbe/ixgbe.c Sun Jul 20 04:11:18 2014 (r268907) @@ -4230,10 +4230,16 @@ ixgbe_initialise_rss_mapping(struct adap #else queue_id = (j * 0x11); #endif - /* XXX endian? */ - reta = (reta << 8) | queue_id; - if ((i & 3) == 3) + /* + * The low 8 bits are for hash value (n+0); + * The next 8 bits are for hash value (n+1), etc. + */ + reta = reta >> 8; + reta = reta | ( ((uint32_t) queue_id) << 24); + if ((i & 3) == 3) { IXGBE_WRITE_REG(hw, IXGBE_RETA(i >> 2), reta); + reta = 0; + } } /* Now fill our hash function seeds */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 06:03:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71003B45; Sun, 20 Jul 2014 06:03:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5286024E9; Sun, 20 Jul 2014 06:03:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K63rde040455; Sun, 20 Jul 2014 06:03:53 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K63rwQ040454; Sun, 20 Jul 2014 06:03:53 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201407200603.s6K63rwQ040454@svn.freebsd.org> From: Don Lewis Date: Sun, 20 Jul 2014 06:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r268908 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 06:03:53 -0000 Author: truckman Date: Sun Jul 20 06:03:52 2014 New Revision: 268908 URL: http://svnweb.freebsd.org/changeset/base/268908 Log: MFC r268373 Declaration whitespace changes for style(9). Modified: stable/8/sys/kern/subr_rman.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/subr_rman.c ============================================================================== --- stable/8/sys/kern/subr_rman.c Sun Jul 20 04:11:18 2014 (r268907) +++ stable/8/sys/kern/subr_rman.c Sun Jul 20 06:03:52 2014 (r268908) @@ -94,12 +94,12 @@ struct resource_i { u_long r_end; /* index of the last entry (inclusive) */ u_int r_flags; void *r_virtual; /* virtual address of this resource */ - struct device *r_dev; /* device which has allocated this resource */ - struct rman *r_rm; /* resource manager from whence this came */ + struct device *r_dev; /* device which has allocated this resource */ + struct rman *r_rm; /* resource manager from whence this came */ int r_rid; /* optional rid for this resource. */ }; -static int rman_debug = 0; +static int rman_debug = 0; TUNABLE_INT("debug.rman_debug", &rman_debug); SYSCTL_INT(_debug, OID_AUTO, rman_debug, CTLFLAG_RW, &rman_debug, 0, "rman debug"); @@ -108,12 +108,12 @@ SYSCTL_INT(_debug, OID_AUTO, rman_debug, static MALLOC_DEFINE(M_RMAN, "rman", "Resource manager"); -struct rman_head rman_head; -static struct mtx rman_mtx; /* mutex to protect rman_head */ -static int int_rman_activate_resource(struct rman *rm, struct resource_i *r, +struct rman_head rman_head; +static struct mtx rman_mtx; /* mutex to protect rman_head */ +static int int_rman_activate_resource(struct rman *rm, struct resource_i *r, struct resource_i **whohas); -static int int_rman_deactivate_resource(struct resource_i *r); -static int int_rman_release_resource(struct rman *rm, struct resource_i *r); +static int int_rman_deactivate_resource(struct resource_i *r); +static int int_rman_release_resource(struct rman *rm, struct resource_i *r); static __inline struct resource_i * int_alloc_resource(int malloc_flag) @@ -312,8 +312,8 @@ rman_last_free_region(struct rman *rm, u int rman_adjust_resource(struct resource *rr, u_long start, u_long end) { - struct resource_i *r, *s, *t, *new; - struct rman *rm; + struct resource_i *r, *s, *t, *new; + struct rman *rm; /* Not supported for shared resources. */ r = rr->__r_i; @@ -434,12 +434,12 @@ rman_adjust_resource(struct resource *rr struct resource * rman_reserve_resource_bound(struct rman *rm, u_long start, u_long end, - u_long count, u_long bound, u_int flags, - struct device *dev) + u_long count, u_long bound, u_int flags, + struct device *dev) { - u_int new_rflags; - struct resource_i *r, *s, *rv; - u_long rstart, rend, amask, bmask; + u_int new_rflags; + struct resource_i *r, *s, *rv; + u_long rstart, rend, amask, bmask; rv = NULL; @@ -716,9 +716,9 @@ rman_activate_resource(struct resource * int rman_await_resource(struct resource *re, int pri, int timo) { - int rv; - struct resource_i *r, *whohas; - struct rman *rm; + int rv; + struct resource_i *r, *whohas; + struct rman *rm; r = re->__r_i; rm = r->r_rm; @@ -754,7 +754,7 @@ int_rman_deactivate_resource(struct reso int rman_deactivate_resource(struct resource *r) { - struct rman *rm; + struct rman *rm; rm = r->__r_i->r_rm; mtx_lock(rm->rm_mtx); @@ -766,7 +766,7 @@ rman_deactivate_resource(struct resource static int int_rman_release_resource(struct rman *rm, struct resource_i *r) { - struct resource_i *s, *t; + struct resource_i *s, *t; if (r->r_flags & RF_ACTIVE) int_rman_deactivate_resource(r); @@ -860,9 +860,9 @@ out: int rman_release_resource(struct resource *re) { - int rv; - struct resource_i *r; - struct rman *rm; + int rv; + struct resource_i *r; + struct rman *rm; r = re->__r_i; rm = r->r_rm; @@ -875,7 +875,7 @@ rman_release_resource(struct resource *r uint32_t rman_make_alignment_flags(uint32_t size) { - int i; + int i; /* * Find the hightest bit set, and add one if more than one bit @@ -893,96 +893,112 @@ rman_make_alignment_flags(uint32_t size) void rman_set_start(struct resource *r, u_long start) { + r->__r_i->r_start = start; } u_long rman_get_start(struct resource *r) { + return (r->__r_i->r_start); } void rman_set_end(struct resource *r, u_long end) { + r->__r_i->r_end = end; } u_long rman_get_end(struct resource *r) { + return (r->__r_i->r_end); } u_long rman_get_size(struct resource *r) { + return (r->__r_i->r_end - r->__r_i->r_start + 1); } u_int rman_get_flags(struct resource *r) { + return (r->__r_i->r_flags); } void rman_set_virtual(struct resource *r, void *v) { + r->__r_i->r_virtual = v; } void * rman_get_virtual(struct resource *r) { + return (r->__r_i->r_virtual); } void rman_set_bustag(struct resource *r, bus_space_tag_t t) { + r->r_bustag = t; } bus_space_tag_t rman_get_bustag(struct resource *r) { + return (r->r_bustag); } void rman_set_bushandle(struct resource *r, bus_space_handle_t h) { + r->r_bushandle = h; } bus_space_handle_t rman_get_bushandle(struct resource *r) { + return (r->r_bushandle); } void rman_set_rid(struct resource *r, int rid) { + r->__r_i->r_rid = rid; } int rman_get_rid(struct resource *r) { + return (r->__r_i->r_rid); } void rman_set_device(struct resource *r, struct device *dev) { + r->__r_i->r_dev = dev; } struct device * rman_get_device(struct resource *r) { + return (r->__r_i->r_dev); } From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 06:30:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BEF5F28; Sun, 20 Jul 2014 06:30:47 +0000 (UTC) Received: from mail-qc0-x22b.google.com (mail-qc0-x22b.google.com [IPv6:2607:f8b0:400d:c01::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8BEB26D5; Sun, 20 Jul 2014 06:30:46 +0000 (UTC) Received: by mail-qc0-f171.google.com with SMTP id i17so4623219qcy.2 for ; Sat, 19 Jul 2014 23:30:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=UzKHSALb5RAsA6XJFmv42EppQtYKy0W447Z/2El7Zvw=; b=HwCCSebgqXzz7CJZmso7GceL9M+yl1DlYYex/kh8jL9dB6htVdcRWD0d5Rsrpbd2+P 0IFejwYxV0PHxe5vqbYx4iTlFNUaQP6GZwFk6O6fWPpn1rExzV6XA3J9xZr5pU/RQDqK gtudEophyLZUo0AMEHwC363CZpjahmClTzHc+q1IHUaPJK9pGLwEbvMkj9y01drgGg5s aJ0+mLPCtI053KzHh5gTbcqxhpB9qeVFb7ILakT9D1kS12Pv/bErPUy2ztiNeHlqplLf iVTqP8HhLEk8RI0i5FCHW+izFYNsD2JL3W/ir5HeDV6vf1YoZTVHeKCCz3P1DQdS0vSf x5og== MIME-Version: 1.0 X-Received: by 10.224.71.198 with SMTP id i6mr27194791qaj.76.1405837845600; Sat, 19 Jul 2014 23:30:45 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.1.6 with HTTP; Sat, 19 Jul 2014 23:30:45 -0700 (PDT) In-Reply-To: <201407192059.s6JKx8un072543@svn.freebsd.org> References: <201407192059.s6JKx8un072543@svn.freebsd.org> Date: Sat, 19 Jul 2014 23:30:45 -0700 X-Google-Sender-Auth: QXZuCMbAHfRxwibbkylEwGh2DJU Message-ID: Subject: Re: svn commit: r268889 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve usr.sbin/bhyvectl From: Adrian Chadd To: Neel Natu Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 06:30:47 -0000 Hi! This broke -HEAD. 'exc' in vmx_inject_interrupts() is no longer initialised before use /and/ it's part of a KASSERT() output. Thanks! -a On 19 July 2014 13:59, Neel Natu wrote: > Author: neel > Date: Sat Jul 19 20:59:08 2014 > New Revision: 268889 > URL: http://svnweb.freebsd.org/changeset/base/268889 > > Log: > Handle nested exceptions in bhyve. > > A nested exception condition arises when a second exception is triggered while > delivering the first exception. Most nested exceptions can be handled serially > but some are converted into a double fault. If an exception is generated during > delivery of a double fault then the virtual machine shuts down as a result of > a triple fault. > > vm_exit_intinfo() is used to record that a VM-exit happened while an event was > being delivered through the IDT. If an exception is triggered while handling > the VM-exit it will be treated like a nested exception. > > vm_entry_intinfo() is used by processor-specific code to get the event to be > injected into the guest on the next VM-entry. This function is responsible for > deciding the disposition of nested exceptions. > > Modified: > head/lib/libvmmapi/vmmapi.c > head/lib/libvmmapi/vmmapi.h > head/sys/amd64/include/vmm.h > head/sys/amd64/include/vmm_dev.h > head/sys/amd64/vmm/intel/vmx.c > head/sys/amd64/vmm/vmm.c > head/sys/amd64/vmm/vmm_dev.c > head/usr.sbin/bhyve/bhyverun.c > head/usr.sbin/bhyve/task_switch.c > head/usr.sbin/bhyvectl/bhyvectl.c > > Modified: head/lib/libvmmapi/vmmapi.c > ============================================================================== > --- head/lib/libvmmapi/vmmapi.c Sat Jul 19 20:55:13 2014 (r268888) > +++ head/lib/libvmmapi/vmmapi.c Sat Jul 19 20:59:08 2014 (r268889) > @@ -1106,3 +1106,32 @@ vm_activate_cpu(struct vmctx *ctx, int v > error = ioctl(ctx->fd, VM_ACTIVATE_CPU, &ac); > return (error); > } > + > +int > +vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *info1, uint64_t *info2) > +{ > + struct vm_intinfo vmii; > + int error; > + > + bzero(&vmii, sizeof(struct vm_intinfo)); > + vmii.vcpuid = vcpu; > + error = ioctl(ctx->fd, VM_GET_INTINFO, &vmii); > + if (error == 0) { > + *info1 = vmii.info1; > + *info2 = vmii.info2; > + } > + return (error); > +} > + > +int > +vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t info1) > +{ > + struct vm_intinfo vmii; > + int error; > + > + bzero(&vmii, sizeof(struct vm_intinfo)); > + vmii.vcpuid = vcpu; > + vmii.info1 = info1; > + error = ioctl(ctx->fd, VM_SET_INTINFO, &vmii); > + return (error); > +} > > Modified: head/lib/libvmmapi/vmmapi.h > ============================================================================== > --- head/lib/libvmmapi/vmmapi.h Sat Jul 19 20:55:13 2014 (r268888) > +++ head/lib/libvmmapi/vmmapi.h Sat Jul 19 20:59:08 2014 (r268889) > @@ -104,6 +104,9 @@ int vm_setup_pptdev_msix(struct vmctx *c > int func, int idx, uint64_t addr, uint64_t msg, > uint32_t vector_control); > > +int vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *i1, uint64_t *i2); > +int vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t exit_intinfo); > + > /* > * Return a pointer to the statistics buffer. Note that this is not MT-safe. > */ > > Modified: head/sys/amd64/include/vmm.h > ============================================================================== > --- head/sys/amd64/include/vmm.h Sat Jul 19 20:55:13 2014 (r268888) > +++ head/sys/amd64/include/vmm.h Sat Jul 19 20:59:08 2014 (r268889) > @@ -34,6 +34,7 @@ enum vm_suspend_how { > VM_SUSPEND_RESET, > VM_SUSPEND_POWEROFF, > VM_SUSPEND_HALT, > + VM_SUSPEND_TRIPLEFAULT, > VM_SUSPEND_LAST > }; > > @@ -88,6 +89,16 @@ enum x2apic_state { > X2APIC_STATE_LAST > }; > > +#define VM_INTINFO_VECTOR(info) ((info) & 0xff) > +#define VM_INTINFO_DEL_ERRCODE 0x800 > +#define VM_INTINFO_RSVD 0x7ffff000 > +#define VM_INTINFO_VALID 0x80000000 > +#define VM_INTINFO_TYPE 0x700 > +#define VM_INTINFO_HWINTR (0 << 8) > +#define VM_INTINFO_NMI (2 << 8) > +#define VM_INTINFO_HWEXCEPTION (3 << 8) > +#define VM_INTINFO_SWINTR (4 << 8) > + > #ifdef _KERNEL > > #define VM_MAX_NAMELEN 32 > @@ -278,14 +289,31 @@ struct vatpit *vm_atpit(struct vm *vm); > int vm_inject_exception(struct vm *vm, int vcpuid, struct vm_exception *vme); > > /* > - * Returns 0 if there is no exception pending for this vcpu. Returns 1 if an > - * exception is pending and also updates 'vme'. The pending exception is > - * cleared when this function returns. > + * This function is called after a VM-exit that occurred during exception or > + * interrupt delivery through the IDT. The format of 'intinfo' is described > + * in Figure 15-1, "EXITINTINFO for All Intercepts", APM, Vol 2. > * > - * This function should only be called in the context of the thread that is > - * executing this vcpu. > + * If a VM-exit handler completes the event delivery successfully then it > + * should call vm_exit_intinfo() to extinguish the pending event. For e.g., > + * if the task switch emulation is triggered via a task gate then it should > + * call this function with 'intinfo=0' to indicate that the external event > + * is not pending anymore. > + * > + * Return value is 0 on success and non-zero on failure. > */ > -int vm_exception_pending(struct vm *vm, int vcpuid, struct vm_exception *vme); > +int vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_t intinfo); > + > +/* > + * This function is called before every VM-entry to retrieve a pending > + * event that should be injected into the guest. This function combines > + * nested events into a double or triple fault. > + * > + * Returns 0 if there are no events that need to be injected into the guest > + * and non-zero otherwise. > + */ > +int vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t *info); > + > +int vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *info1, uint64_t *info2); > > void vm_inject_gp(struct vm *vm, int vcpuid); /* general protection fault */ > void vm_inject_ud(struct vm *vm, int vcpuid); /* undefined instruction fault */ > > Modified: head/sys/amd64/include/vmm_dev.h > ============================================================================== > --- head/sys/amd64/include/vmm_dev.h Sat Jul 19 20:55:13 2014 (r268888) > +++ head/sys/amd64/include/vmm_dev.h Sat Jul 19 20:59:08 2014 (r268889) > @@ -189,6 +189,12 @@ struct vm_cpuset { > #define VM_ACTIVE_CPUS 0 > #define VM_SUSPENDED_CPUS 1 > > +struct vm_intinfo { > + int vcpuid; > + uint64_t info1; > + uint64_t info2; > +}; > + > enum { > /* general routines */ > IOCNUM_ABIVERS = 0, > @@ -211,6 +217,8 @@ enum { > IOCNUM_GET_SEGMENT_DESCRIPTOR = 23, > > /* interrupt injection */ > + IOCNUM_GET_INTINFO = 28, > + IOCNUM_SET_INTINFO = 29, > IOCNUM_INJECT_EXCEPTION = 30, > IOCNUM_LAPIC_IRQ = 31, > IOCNUM_INJECT_NMI = 32, > @@ -324,4 +332,8 @@ enum { > _IOW('v', IOCNUM_ACTIVATE_CPU, struct vm_activate_cpu) > #define VM_GET_CPUS \ > _IOW('v', IOCNUM_GET_CPUSET, struct vm_cpuset) > +#define VM_SET_INTINFO \ > + _IOW('v', IOCNUM_SET_INTINFO, struct vm_intinfo) > +#define VM_GET_INTINFO \ > + _IOWR('v', IOCNUM_GET_INTINFO, struct vm_intinfo) > #endif > > Modified: head/sys/amd64/vmm/intel/vmx.c > ============================================================================== > --- head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:55:13 2014 (r268888) > +++ head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:59:08 2014 (r268889) > @@ -1213,22 +1213,31 @@ vmx_inject_interrupts(struct vmx *vmx, i > { > struct vm_exception exc; > int vector, need_nmi_exiting, extint_pending; > - uint64_t rflags; > + uint64_t rflags, entryinfo; > uint32_t gi, info; > > - if (vm_exception_pending(vmx->vm, vcpu, &exc)) { > - KASSERT(exc.vector >= 0 && exc.vector < 32, > - ("%s: invalid exception vector %d", __func__, exc.vector)); > + if (vm_entry_intinfo(vmx->vm, vcpu, &entryinfo)) { > + KASSERT((entryinfo & VMCS_INTR_VALID) != 0, ("%s: entry " > + "intinfo is not valid: %#lx", __func__, entryinfo)); > > info = vmcs_read(VMCS_ENTRY_INTR_INFO); > KASSERT((info & VMCS_INTR_VALID) == 0, ("%s: cannot inject " > "pending exception %d: %#x", __func__, exc.vector, info)); > > - info = exc.vector | VMCS_INTR_T_HWEXCEPTION | VMCS_INTR_VALID; > - if (exc.error_code_valid) { > - info |= VMCS_INTR_DEL_ERRCODE; > - vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, exc.error_code); > + info = entryinfo; > + vector = info & 0xff; > + if (vector == IDT_BP || vector == IDT_OF) { > + /* > + * VT-x requires #BP and #OF to be injected as software > + * exceptions. > + */ > + info &= ~VMCS_INTR_T_MASK; > + info |= VMCS_INTR_T_SWEXCEPTION; > } > + > + if (info & VMCS_INTR_DEL_ERRCODE) > + vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, entryinfo >> 32); > + > vmcs_write(VMCS_ENTRY_INTR_INFO, info); > } > > @@ -1407,6 +1416,16 @@ vmx_clear_nmi_blocking(struct vmx *vmx, > vmcs_write(VMCS_GUEST_INTERRUPTIBILITY, gi); > } > > +static void > +vmx_assert_nmi_blocking(struct vmx *vmx, int vcpuid) > +{ > + uint32_t gi; > + > + gi = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); > + KASSERT(gi & VMCS_INTERRUPTIBILITY_NMI_BLOCKING, > + ("NMI blocking is not in effect %#x", gi)); > +} > + > static int > vmx_emulate_xsetbv(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) > { > @@ -2050,7 +2069,7 @@ vmx_exit_process(struct vmx *vmx, int vc > struct vm_task_switch *ts; > uint32_t eax, ecx, edx, idtvec_info, idtvec_err, intr_info, inst_info; > uint32_t intr_type, reason; > - uint64_t qual, gpa; > + uint64_t exitintinfo, qual, gpa; > bool retu; > > CTASSERT((PINBASED_CTLS_ONE_SETTING & PINBASED_VIRTUAL_NMI) != 0); > @@ -2070,47 +2089,49 @@ vmx_exit_process(struct vmx *vmx, int vc > * be handled specially by re-injecting the event if the IDT > * vectoring information field's valid bit is set. > * > - * If the VM-exit is due to a task gate in the IDT then we don't > - * reinject the event because emulating the task switch also > - * completes the event delivery. > - * > * See "Information for VM Exits During Event Delivery" in Intel SDM > * for details. > */ > - switch (reason) { > - case EXIT_REASON_EPT_FAULT: > - case EXIT_REASON_EPT_MISCONFIG: > - case EXIT_REASON_APIC_ACCESS: > - case EXIT_REASON_TASK_SWITCH: > - case EXIT_REASON_EXCEPTION: > - idtvec_info = vmcs_idt_vectoring_info(); > - VCPU_CTR2(vmx->vm, vcpu, "vm exit %s: idtvec_info 0x%08x", > - exit_reason_to_str(reason), idtvec_info); > - if ((idtvec_info & VMCS_IDT_VEC_VALID) && > - (reason != EXIT_REASON_TASK_SWITCH)) { > - idtvec_info &= ~(1 << 12); /* clear undefined bit */ > - vmcs_write(VMCS_ENTRY_INTR_INFO, idtvec_info); > - if (idtvec_info & VMCS_IDT_VEC_ERRCODE_VALID) { > - idtvec_err = vmcs_idt_vectoring_err(); > - vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, > - idtvec_err); > - } > - /* > - * If 'virtual NMIs' are being used and the VM-exit > - * happened while injecting an NMI during the previous > - * VM-entry, then clear "blocking by NMI" in the Guest > - * Interruptibility-state. > - */ > - if ((idtvec_info & VMCS_INTR_T_MASK) == > - VMCS_INTR_T_NMI) { > - vmx_clear_nmi_blocking(vmx, vcpu); > - } > + idtvec_info = vmcs_idt_vectoring_info(); > + if (idtvec_info & VMCS_IDT_VEC_VALID) { > + idtvec_info &= ~(1 << 12); /* clear undefined bit */ > + exitintinfo = idtvec_info; > + if (idtvec_info & VMCS_IDT_VEC_ERRCODE_VALID) { > + idtvec_err = vmcs_idt_vectoring_err(); > + exitintinfo |= (uint64_t)idtvec_err << 32; > + } > + error = vm_exit_intinfo(vmx->vm, vcpu, exitintinfo); > + KASSERT(error == 0, ("%s: vm_set_intinfo error %d", > + __func__, error)); > + > + /* > + * If 'virtual NMIs' are being used and the VM-exit > + * happened while injecting an NMI during the previous > + * VM-entry, then clear "blocking by NMI" in the > + * Guest Interruptibility-State so the NMI can be > + * reinjected on the subsequent VM-entry. > + * > + * However, if the NMI was being delivered through a task > + * gate, then the new task must start execution with NMIs > + * blocked so don't clear NMI blocking in this case. > + */ > + intr_type = idtvec_info & VMCS_INTR_T_MASK; > + if (intr_type == VMCS_INTR_T_NMI) { > + if (reason != EXIT_REASON_TASK_SWITCH) > + vmx_clear_nmi_blocking(vmx, vcpu); > + else > + vmx_assert_nmi_blocking(vmx, vcpu); > + } > + > + /* > + * Update VM-entry instruction length if the event being > + * delivered was a software interrupt or software exception. > + */ > + if (intr_type == VMCS_INTR_T_SWINTR || > + intr_type == VMCS_INTR_T_PRIV_SWEXCEPTION || > + intr_type == VMCS_INTR_T_SWEXCEPTION) { > vmcs_write(VMCS_ENTRY_INST_LENGTH, vmexit->inst_length); > } > - break; > - default: > - idtvec_info = 0; > - break; > } > > switch (reason) { > @@ -2136,7 +2157,7 @@ vmx_exit_process(struct vmx *vmx, int vc > */ > if (ts->reason == TSR_IDT_GATE) { > KASSERT(idtvec_info & VMCS_IDT_VEC_VALID, > - ("invalid idtvec_info %x for IDT task switch", > + ("invalid idtvec_info %#x for IDT task switch", > idtvec_info)); > intr_type = idtvec_info & VMCS_INTR_T_MASK; > if (intr_type != VMCS_INTR_T_SWINTR && > @@ -2302,6 +2323,7 @@ vmx_exit_process(struct vmx *vmx, int vc > * the guest. > * > * See "Resuming Guest Software after Handling an Exception". > + * See "Information for VM Exits Due to Vectored Events". > */ > if ((idtvec_info & VMCS_IDT_VEC_VALID) == 0 && > (intr_info & 0xff) != IDT_DF && > @@ -2519,6 +2541,13 @@ vmx_run(void *arg, int vcpu, register_t > * pmap_invalidate_ept(). > */ > disable_intr(); > + vmx_inject_interrupts(vmx, vcpu, vlapic); > + > + /* > + * Check for vcpu suspension after injecting events because > + * vmx_inject_interrupts() can suspend the vcpu due to a > + * triple fault. > + */ > if (vcpu_suspended(suspend_cookie)) { > enable_intr(); > vm_exit_suspended(vmx->vm, vcpu, vmcs_guest_rip()); > @@ -2539,7 +2568,6 @@ vmx_run(void *arg, int vcpu, register_t > break; > } > > - vmx_inject_interrupts(vmx, vcpu, vlapic); > vmx_run_trace(vmx, vcpu); > rc = vmx_enter_guest(vmxctx, vmx, launched); > > > Modified: head/sys/amd64/vmm/vmm.c > ============================================================================== > --- head/sys/amd64/vmm/vmm.c Sat Jul 19 20:55:13 2014 (r268888) > +++ head/sys/amd64/vmm/vmm.c Sat Jul 19 20:59:08 2014 (r268889) > @@ -97,6 +97,7 @@ struct vcpu { > int hostcpu; /* (o) vcpu's host cpu */ > struct vlapic *vlapic; /* (i) APIC device model */ > enum x2apic_state x2apic_state; /* (i) APIC mode */ > + uint64_t exitintinfo; /* (i) events pending at VM exit */ > int nmi_pending; /* (i) NMI pending */ > int extint_pending; /* (i) INTR pending */ > struct vm_exception exception; /* (x) exception collateral */ > @@ -241,6 +242,7 @@ vcpu_init(struct vm *vm, int vcpu_id, bo > > vcpu->vlapic = VLAPIC_INIT(vm->cookie, vcpu_id); > vm_set_x2apic_state(vm, vcpu_id, X2APIC_DISABLED); > + vcpu->exitintinfo = 0; > vcpu->nmi_pending = 0; > vcpu->extint_pending = 0; > vcpu->exception_pending = 0; > @@ -1458,6 +1460,202 @@ restart: > } > > int > +vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_t info) > +{ > + struct vcpu *vcpu; > + int type, vector; > + > + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) > + return (EINVAL); > + > + vcpu = &vm->vcpu[vcpuid]; > + > + if (info & VM_INTINFO_VALID) { > + type = info & VM_INTINFO_TYPE; > + vector = info & 0xff; > + if (type == VM_INTINFO_NMI && vector != IDT_NMI) > + return (EINVAL); > + if (type == VM_INTINFO_HWEXCEPTION && vector >= 32) > + return (EINVAL); > + if (info & VM_INTINFO_RSVD) > + return (EINVAL); > + } else { > + info = 0; > + } > + VCPU_CTR2(vm, vcpuid, "%s: info1(%#lx)", __func__, info); > + vcpu->exitintinfo = info; > + return (0); > +} > + > +enum exc_class { > + EXC_BENIGN, > + EXC_CONTRIBUTORY, > + EXC_PAGEFAULT > +}; > + > +#define IDT_VE 20 /* Virtualization Exception (Intel specific) */ > + > +static enum exc_class > +exception_class(uint64_t info) > +{ > + int type, vector; > + > + KASSERT(info & VM_INTINFO_VALID, ("intinfo must be valid: %#lx", info)); > + type = info & VM_INTINFO_TYPE; > + vector = info & 0xff; > + > + /* Table 6-4, "Interrupt and Exception Classes", Intel SDM, Vol 3 */ > + switch (type) { > + case VM_INTINFO_HWINTR: > + case VM_INTINFO_SWINTR: > + case VM_INTINFO_NMI: > + return (EXC_BENIGN); > + default: > + /* > + * Hardware exception. > + * > + * SVM and VT-x use identical type values to represent NMI, > + * hardware interrupt and software interrupt. > + * > + * SVM uses type '3' for all exceptions. VT-x uses type '3' > + * for exceptions except #BP and #OF. #BP and #OF use a type > + * value of '5' or '6'. Therefore we don't check for explicit > + * values of 'type' to classify 'intinfo' into a hardware > + * exception. > + */ > + break; > + } > + > + switch (vector) { > + case IDT_PF: > + case IDT_VE: > + return (EXC_PAGEFAULT); > + case IDT_DE: > + case IDT_TS: > + case IDT_NP: > + case IDT_SS: > + case IDT_GP: > + return (EXC_CONTRIBUTORY); > + default: > + return (EXC_BENIGN); > + } > +} > + > +static int > +nested_fault(struct vm *vm, int vcpuid, uint64_t info1, uint64_t info2, > + uint64_t *retinfo) > +{ > + enum exc_class exc1, exc2; > + int type1, vector1; > + > + KASSERT(info1 & VM_INTINFO_VALID, ("info1 %#lx is not valid", info1)); > + KASSERT(info2 & VM_INTINFO_VALID, ("info2 %#lx is not valid", info2)); > + > + /* > + * If an exception occurs while attempting to call the double-fault > + * handler the processor enters shutdown mode (aka triple fault). > + */ > + type1 = info1 & VM_INTINFO_TYPE; > + vector1 = info1 & 0xff; > + if (type1 == VM_INTINFO_HWEXCEPTION && vector1 == IDT_DF) { > + VCPU_CTR2(vm, vcpuid, "triple fault: info1(%#lx), info2(%#lx)", > + info1, info2); > + vm_suspend(vm, VM_SUSPEND_TRIPLEFAULT); > + *retinfo = 0; > + return (0); > + } > + > + /* > + * Table 6-5 "Conditions for Generating a Double Fault", Intel SDM, Vol3 > + */ > + exc1 = exception_class(info1); > + exc2 = exception_class(info2); > + if ((exc1 == EXC_CONTRIBUTORY && exc2 == EXC_CONTRIBUTORY) || > + (exc1 == EXC_PAGEFAULT && exc2 != EXC_BENIGN)) { > + /* Convert nested fault into a double fault. */ > + *retinfo = IDT_DF; > + *retinfo |= VM_INTINFO_VALID | VM_INTINFO_HWEXCEPTION; > + *retinfo |= VM_INTINFO_DEL_ERRCODE; > + } else { > + /* Handle exceptions serially */ > + *retinfo = info2; > + } > + return (1); > +} > + > +static uint64_t > +vcpu_exception_intinfo(struct vcpu *vcpu) > +{ > + uint64_t info = 0; > + > + if (vcpu->exception_pending) { > + info = vcpu->exception.vector & 0xff; > + info |= VM_INTINFO_VALID | VM_INTINFO_HWEXCEPTION; > + if (vcpu->exception.error_code_valid) { > + info |= VM_INTINFO_DEL_ERRCODE; > + info |= (uint64_t)vcpu->exception.error_code << 32; > + } > + } > + return (info); > +} > + > +int > +vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t *retinfo) > +{ > + struct vcpu *vcpu; > + uint64_t info1, info2; > + int valid; > + > + KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, ("invalid vcpu %d", vcpuid)); > + > + vcpu = &vm->vcpu[vcpuid]; > + > + info1 = vcpu->exitintinfo; > + vcpu->exitintinfo = 0; > + > + info2 = 0; > + if (vcpu->exception_pending) { > + info2 = vcpu_exception_intinfo(vcpu); > + vcpu->exception_pending = 0; > + VCPU_CTR2(vm, vcpuid, "Exception %d delivered: %#lx", > + vcpu->exception.vector, info2); > + } > + > + if ((info1 & VM_INTINFO_VALID) && (info2 & VM_INTINFO_VALID)) { > + valid = nested_fault(vm, vcpuid, info1, info2, retinfo); > + } else if (info1 & VM_INTINFO_VALID) { > + *retinfo = info1; > + valid = 1; > + } else if (info2 & VM_INTINFO_VALID) { > + *retinfo = info2; > + valid = 1; > + } else { > + valid = 0; > + } > + > + if (valid) { > + VCPU_CTR4(vm, vcpuid, "%s: info1(%#lx), info2(%#lx), " > + "retinfo(%#lx)", __func__, info1, info2, *retinfo); > + } > + > + return (valid); > +} > + > +int > +vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *info1, uint64_t *info2) > +{ > + struct vcpu *vcpu; > + > + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) > + return (EINVAL); > + > + vcpu = &vm->vcpu[vcpuid]; > + *info1 = vcpu->exitintinfo; > + *info2 = vcpu_exception_intinfo(vcpu); > + return (0); > +} > + > +int > vm_inject_exception(struct vm *vm, int vcpuid, struct vm_exception *exception) > { > struct vcpu *vcpu; > @@ -1468,6 +1666,14 @@ vm_inject_exception(struct vm *vm, int v > if (exception->vector < 0 || exception->vector >= 32) > return (EINVAL); > > + /* > + * A double fault exception should never be injected directly into > + * the guest. It is a derived exception that results from specific > + * combinations of nested faults. > + */ > + if (exception->vector == IDT_DF) > + return (EINVAL); > + > vcpu = &vm->vcpu[vcpuid]; > > if (vcpu->exception_pending) { > @@ -1483,25 +1689,6 @@ vm_inject_exception(struct vm *vm, int v > return (0); > } > > -int > -vm_exception_pending(struct vm *vm, int vcpuid, struct vm_exception *exception) > -{ > - struct vcpu *vcpu; > - int pending; > - > - KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, ("invalid vcpu %d", vcpuid)); > - > - vcpu = &vm->vcpu[vcpuid]; > - pending = vcpu->exception_pending; > - if (pending) { > - vcpu->exception_pending = 0; > - *exception = vcpu->exception; > - VCPU_CTR1(vm, vcpuid, "Exception %d delivered", > - exception->vector); > - } > - return (pending); > -} > - > static void > vm_inject_fault(struct vm *vm, int vcpuid, struct vm_exception *exception) > { > > Modified: head/sys/amd64/vmm/vmm_dev.c > ============================================================================== > --- head/sys/amd64/vmm/vmm_dev.c Sat Jul 19 20:55:13 2014 (r268888) > +++ head/sys/amd64/vmm/vmm_dev.c Sat Jul 19 20:59:08 2014 (r268889) > @@ -173,6 +173,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c > struct vm_gla2gpa *gg; > struct vm_activate_cpu *vac; > struct vm_cpuset *vm_cpuset; > + struct vm_intinfo *vmii; > > sc = vmmdev_lookup2(cdev); > if (sc == NULL) > @@ -199,6 +200,8 @@ vmmdev_ioctl(struct cdev *cdev, u_long c > case VM_SET_X2APIC_STATE: > case VM_GLA2GPA: > case VM_ACTIVATE_CPU: > + case VM_SET_INTINFO: > + case VM_GET_INTINFO: > /* > * XXX fragile, handle with care > * Assumes that the first field of the ioctl data is the vcpu. > @@ -470,6 +473,15 @@ vmmdev_ioctl(struct cdev *cdev, u_long c > error = copyout(cpuset, vm_cpuset->cpus, size); > free(cpuset, M_TEMP); > break; > + case VM_SET_INTINFO: > + vmii = (struct vm_intinfo *)data; > + error = vm_exit_intinfo(sc->vm, vmii->vcpuid, vmii->info1); > + break; > + case VM_GET_INTINFO: > + vmii = (struct vm_intinfo *)data; > + error = vm_get_intinfo(sc->vm, vmii->vcpuid, &vmii->info1, > + &vmii->info2); > + break; > default: > error = ENOTTY; > break; > > Modified: head/usr.sbin/bhyve/bhyverun.c > ============================================================================== > --- head/usr.sbin/bhyve/bhyverun.c Sat Jul 19 20:55:13 2014 (r268888) > +++ head/usr.sbin/bhyve/bhyverun.c Sat Jul 19 20:59:08 2014 (r268889) > @@ -534,6 +534,8 @@ vmexit_suspend(struct vmctx *ctx, struct > exit(1); > case VM_SUSPEND_HALT: > exit(2); > + case VM_SUSPEND_TRIPLEFAULT: > + exit(3); > default: > fprintf(stderr, "vmexit_suspend: invalid reason %d\n", how); > exit(100); > > Modified: head/usr.sbin/bhyve/task_switch.c > ============================================================================== > --- head/usr.sbin/bhyve/task_switch.c Sat Jul 19 20:55:13 2014 (r268888) > +++ head/usr.sbin/bhyve/task_switch.c Sat Jul 19 20:59:08 2014 (r268889) > @@ -904,10 +904,14 @@ vmexit_task_switch(struct vmctx *ctx, st > */ > > /* > - * XXX is the original task switch was triggered by a hardware > - * exception then do we generate a double-fault if we encounter > - * an exception during the task switch? > + * If the task switch was triggered by an event delivered through > + * the IDT then extinguish the pending event from the vcpu's > + * exitintinfo. > */ > + if (task_switch->reason == TSR_IDT_GATE) { > + error = vm_set_intinfo(ctx, vcpu, 0); > + assert(error == 0); > + } > > /* > * XXX should inject debug exception if 'T' bit is 1 > > Modified: head/usr.sbin/bhyvectl/bhyvectl.c > ============================================================================== > --- head/usr.sbin/bhyvectl/bhyvectl.c Sat Jul 19 20:55:13 2014 (r268888) > +++ head/usr.sbin/bhyvectl/bhyvectl.c Sat Jul 19 20:59:08 2014 (r268889) > @@ -195,7 +195,8 @@ usage(void) > " [--force-reset]\n" > " [--force-poweroff]\n" > " [--get-active-cpus]\n" > - " [--get-suspended-cpus]\n", > + " [--get-suspended-cpus]\n" > + " [--get-intinfo]\n", > progname); > exit(1); > } > @@ -205,6 +206,7 @@ static int inject_nmi, assert_lapic_lvt; > static int force_reset, force_poweroff; > static const char *capname; > static int create, destroy, get_lowmem, get_highmem; > +static int get_intinfo; > static int get_active_cpus, get_suspended_cpus; > static uint64_t memsize; > static int set_cr0, get_cr0, set_cr3, get_cr3, set_cr4, get_cr4; > @@ -412,6 +414,37 @@ print_cpus(const char *banner, const cpu > printf("\n"); > } > > +static void > +print_intinfo(const char *banner, uint64_t info) > +{ > + int type; > + > + printf("%s:\t", banner); > + if (info & VM_INTINFO_VALID) { > + type = info & VM_INTINFO_TYPE; > + switch (type) { > + case VM_INTINFO_HWINTR: > + printf("extint"); > + break; > + case VM_INTINFO_NMI: > + printf("nmi"); > + break; > + case VM_INTINFO_SWINTR: > + printf("swint"); > + break; > + default: > + printf("exception"); > + break; > + } > + printf(" vector %d", (int)VM_INTINFO_VECTOR(info)); > + if (info & VM_INTINFO_DEL_ERRCODE) > + printf(" errcode %#x", (u_int)(info >> 32)); > + } else { > + printf("n/a"); > + } > + printf("\n"); > +} > + > int > main(int argc, char *argv[]) > { > @@ -420,7 +453,7 @@ main(int argc, char *argv[]) > vm_paddr_t gpa, gpa_pmap; > size_t len; > struct vm_exit vmexit; > - uint64_t ctl, eptp, bm, addr, u64, pteval[4], *pte; > + uint64_t ctl, eptp, bm, addr, u64, pteval[4], *pte, info[2]; > struct vmctx *ctx; > int wired; > cpuset_t cpus; > @@ -595,6 +628,7 @@ main(int argc, char *argv[]) > { "force-poweroff", NO_ARG, &force_poweroff, 1 }, > { "get-active-cpus", NO_ARG, &get_active_cpus, 1 }, > { "get-suspended-cpus", NO_ARG, &get_suspended_cpus, 1 }, > + { "get-intinfo", NO_ARG, &get_intinfo, 1 }, > { NULL, 0, NULL, 0 } > }; > > @@ -1566,6 +1600,14 @@ main(int argc, char *argv[]) > print_cpus("suspended cpus", &cpus); > } > > + if (!error && (get_intinfo || get_all)) { > + error = vm_get_intinfo(ctx, vcpu, &info[0], &info[1]); > + if (!error) { > + print_intinfo("pending", info[0]); > + print_intinfo("current", info[1]); > + } > + } > + > if (!error && run) { > error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RIP, &rip); > assert(error == 0); > From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 07:31:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E7EF685; Sun, 20 Jul 2014 07:31:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C0012ADC; Sun, 20 Jul 2014 07:31:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K7Vunr082295; Sun, 20 Jul 2014 07:31:56 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K7VuxQ082294; Sun, 20 Jul 2014 07:31:56 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407200731.s6K7VuxQ082294@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 Jul 2014 07:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268909 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 07:31:56 -0000 Author: adrian Date: Sun Jul 20 07:31:55 2014 New Revision: 268909 URL: http://svnweb.freebsd.org/changeset/base/268909 Log: Update the comment to be more concise. Modified: head/sys/netinet/in_rss.c Modified: head/sys/netinet/in_rss.c ============================================================================== --- head/sys/netinet/in_rss.c Sun Jul 20 06:03:52 2014 (r268908) +++ head/sys/netinet/in_rss.c Sun Jul 20 07:31:55 2014 (r268909) @@ -149,9 +149,8 @@ SYSCTL_INT(_net_inet_rss, OID_AUTO, base * * XXXRW: And that we don't randomize it yet! * - * XXXRW: This default is actually the default key from Chelsio T5 cards, as - * it offers reasonable distribution, unlike all-0 keys which always - * generate a hash of 0 (upsettingly). + * This is the default Microsoft RSS specification key which is also + * the Chelsio T5 firmware default key. */ static uint8_t rss_key[RSS_KEYSIZE] = { 0xbe, 0xac, 0x01, 0xfa, 0x6a, 0x42, 0xb7, 0x3b, From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 07:35:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4C4C7F3; Sun, 20 Jul 2014 07:35:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C16B02AEC; Sun, 20 Jul 2014 07:35:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K7Z08F082895; Sun, 20 Jul 2014 07:35:00 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K7Z0qb082892; Sun, 20 Jul 2014 07:35:00 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407200735.s6K7Z0qb082892@svn.freebsd.org> From: Alexander Motin Date: Sun, 20 Jul 2014 07:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268910 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 07:35:00 -0000 Author: mav Date: Sun Jul 20 07:35:00 2014 New Revision: 268910 URL: http://svnweb.freebsd.org/changeset/base/268910 Log: MFC r268795: Fix ctld crash on startup if target alias is not set. Modified: stable/10/usr.sbin/ctld/kernel.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/kernel.c ============================================================================== --- stable/10/usr.sbin/ctld/kernel.c Sun Jul 20 07:31:55 2014 (r268909) +++ stable/10/usr.sbin/ctld/kernel.c Sun Jul 20 07:35:00 2014 (r268910) @@ -851,9 +851,12 @@ kernel_port_add(struct target *targ) req.args[0].value = &port_id; req.args[0].flags = CTL_BEARG_WR; str_arg(&req.args[1], "cfiscsi_target", targ->t_name); - str_arg(&req.args[2], "cfiscsi_target_alias", targ->t_alias); snprintf(tagstr, sizeof(tagstr), "%d", targ->t_portal_group->pg_tag); - str_arg(&req.args[3], "cfiscsi_portal_group_tag", tagstr); + str_arg(&req.args[2], "cfiscsi_portal_group_tag", tagstr); + if (targ->t_alias) + str_arg(&req.args[3], "cfiscsi_target_alias", targ->t_alias); + else + req.num_args--; error = ioctl(ctl_fd, CTL_PORT_REQ, &req); free(req.args); From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 07:37:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45CE0942; Sun, 20 Jul 2014 07:37:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 330832AFE; Sun, 20 Jul 2014 07:37:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K7b0LO083215; Sun, 20 Jul 2014 07:37:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K7axG6083204; Sun, 20 Jul 2014 07:36:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407200736.s6K7axG6083204@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 Jul 2014 07:36:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268911 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 07:37:00 -0000 Author: adrian Date: Sun Jul 20 07:36:59 2014 New Revision: 268911 URL: http://svnweb.freebsd.org/changeset/base/268911 Log: Implement rss_gethashconfig() - return the currently supported hash methods by the stack. Right now the stack isn't really setup for RSS with 4-tuple UDP hashing for either IPv4 and IPv6. The specifics: * The UDP init path udp_init() and udplite_init() specify the hash as 2-tuple, so the PCBGROUPS code only tries a 2-tuple check; * The PCBGROUPS and RSS code doesn't know about the UDP hash types just yet, so they're never treated as valid hashes. * For correctness, 4-tuple can't be enabled in the general case because UDP datagrams can be more fragmented than IP datagrams may be. Strictly speaking, TCP datagrams may also be fragmented and this could cause issues with PCBGROUPS/RSS until the IP defragment path grows some code to re-calculate the RSS hash. I'll follow this commit up with awareness of the UDP 4-tuple for those who wish to configure it, but for now it'll stay disabled. No drivers (yet) know to use this function when RSS is enabled. Modified: head/sys/netinet/in_rss.c head/sys/netinet/in_rss.h Modified: head/sys/netinet/in_rss.c ============================================================================== --- head/sys/netinet/in_rss.c Sun Jul 20 07:35:00 2014 (r268910) +++ head/sys/netinet/in_rss.c Sun Jul 20 07:36:59 2014 (r268911) @@ -535,6 +535,40 @@ rss_getnumcpus(void) } /* + * Return the supported RSS hash configuration. + * + * NICs should query this to determine what to configure in their redirection + * matching table. + */ +u_int +rss_gethashconfig(void) +{ + /* Return 4-tuple for TCP; 2-tuple for others */ + /* + * UDP may fragment more often than TCP and thus we'll end up with + * NICs returning 2-tuple fragments. + * udp_init() and udplite_init() both currently initialise things + * as 2-tuple. + * So for now disable UDP 4-tuple hashing until all of the other + * pieces are in place. + */ + return ( + RSS_HASHTYPE_RSS_IPV4 + | RSS_HASHTYPE_RSS_TCP_IPV4 + | RSS_HASHTYPE_RSS_IPV6 + | RSS_HASHTYPE_RSS_TCP_IPV6 + | RSS_HASHTYPE_RSS_IPV6_EX + | RSS_HASHTYPE_RSS_TCP_IPV6_EX +#if 0 + | RSS_HASHTYPE_RSS_UDP_IPV4 + | RSS_HASHTYPE_RSS_UDP_IPV4_EX + | RSS_HASHTYPE_RSS_UDP_IPV6 + | RSS_HASHTYPE_RSS_UDP_IPV6_EX +#endif + ); +} + +/* * XXXRW: Confirm that sysctl -a won't dump this keying material, don't want * it appearing in debugging output unnecessarily. */ Modified: head/sys/netinet/in_rss.h ============================================================================== --- head/sys/netinet/in_rss.h Sun Jul 20 07:35:00 2014 (r268910) +++ head/sys/netinet/in_rss.h Sun Jul 20 07:36:59 2014 (r268911) @@ -52,6 +52,25 @@ #define RSS_HASHFIELDS_2TUPLE 2 /* + * Define RSS representations of the M_HASHTYPE_* values, representing + * which particular bits are supported. The NICs can then use this to + * calculate which hash types to enable and which not to enable. + * + * The fact that these line up with M_HASHTYPE_* is not to be relied + * upon. + */ +#define RSS_HASHTYPE_RSS_IPV4 (1 << 1) /* IPv4 2-tuple */ +#define RSS_HASHTYPE_RSS_TCP_IPV4 (1 << 2) /* TCPv4 4-tuple */ +#define RSS_HASHTYPE_RSS_IPV6 (1 << 3) /* IPv6 2-tuple */ +#define RSS_HASHTYPE_RSS_TCP_IPV6 (1 << 4) /* TCPv6 4-tuple */ +#define RSS_HASHTYPE_RSS_IPV6_EX (1 << 5) /* IPv6 2-tuple + ext hdrs */ +#define RSS_HASHTYPE_RSS_TCP_IPV6_EX (1 << 6) /* TCPv6 4-tiple + ext hdrs */ +#define RSS_HASHTYPE_RSS_UDP_IPV4 (1 << 7) /* IPv4 UDP 4-tuple */ +#define RSS_HASHTYPE_RSS_UDP_IPV4_EX (1 << 8) /* IPv4 UDP 4-tuple + ext hdrs */ +#define RSS_HASHTYPE_RSS_UDP_IPV6 (1 << 9) /* IPv6 UDP 4-tuple */ +#define RSS_HASHTYPE_RSS_UDP_IPV6_EX (1 << 10) /* IPv6 UDP 4-tuple + ext hdrs */ + +/* * Compile-time limits on the size of the indirection table. */ #define RSS_MAXBITS 7 @@ -75,6 +94,7 @@ void rss_getkey(uint8_t *key); u_int rss_gethashalgo(void); u_int rss_getnumbuckets(void); u_int rss_getnumcpus(void); +u_int rss_gethashconfig(void); /* * Network stack interface to generate a hash for a protocol tuple. From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 07:37:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CDC2AA9; Sun, 20 Jul 2014 07:37:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A7D02B18; Sun, 20 Jul 2014 07:37:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K7bmQk083422; Sun, 20 Jul 2014 07:37:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K7bmtK083421; Sun, 20 Jul 2014 07:37:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407200737.s6K7bmtK083421@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 Jul 2014 07:37:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268912 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 07:37:48 -0000 Author: adrian Date: Sun Jul 20 07:37:47 2014 New Revision: 268912 URL: http://svnweb.freebsd.org/changeset/base/268912 Log: Add hash awareness of the IPv4 and IPv6 UDP 4-tuple. Note: it would be nice if the supported hash check would be used here! Modified: head/sys/netinet/in_rss.c Modified: head/sys/netinet/in_rss.c ============================================================================== --- head/sys/netinet/in_rss.c Sun Jul 20 07:36:59 2014 (r268911) +++ head/sys/netinet/in_rss.c Sun Jul 20 07:37:47 2014 (r268912) @@ -436,8 +436,10 @@ rss_hash2cpuid(uint32_t hash_val, uint32 switch (hash_type) { case M_HASHTYPE_RSS_IPV4: case M_HASHTYPE_RSS_TCP_IPV4: + case M_HASHTYPE_RSS_UDP_IPV4: case M_HASHTYPE_RSS_IPV6: case M_HASHTYPE_RSS_TCP_IPV6: + case M_HASHTYPE_RSS_UDP_IPV6: return (rss_getcpu(rss_getbucket(hash_val))); default: return (NETISR_CPUID_NONE); @@ -455,8 +457,10 @@ rss_hash2bucket(uint32_t hash_val, uint3 switch (hash_type) { case M_HASHTYPE_RSS_IPV4: case M_HASHTYPE_RSS_TCP_IPV4: + case M_HASHTYPE_RSS_UDP_IPV4: case M_HASHTYPE_RSS_IPV6: case M_HASHTYPE_RSS_TCP_IPV6: + case M_HASHTYPE_RSS_UDP_IPV6: *bucket_id = rss_getbucket(hash_val); return (0); default: From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 07:38:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF8D7BF1; Sun, 20 Jul 2014 07:38:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D21D2B20; Sun, 20 Jul 2014 07:38:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K7ccdn083613; Sun, 20 Jul 2014 07:38:38 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K7ccYN083612; Sun, 20 Jul 2014 07:38:38 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407200738.s6K7ccYN083612@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 Jul 2014 07:38:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268913 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 07:38:38 -0000 Author: adrian Date: Sun Jul 20 07:38:38 2014 New Revision: 268913 URL: http://svnweb.freebsd.org/changeset/base/268913 Log: Make the PCBGROUPS code aware of IPv4 UDP 4-tuple. Modified: head/sys/netinet/in_pcbgroup.c Modified: head/sys/netinet/in_pcbgroup.c ============================================================================== --- head/sys/netinet/in_pcbgroup.c Sun Jul 20 07:37:47 2014 (r268912) +++ head/sys/netinet/in_pcbgroup.c Sun Jul 20 07:38:38 2014 (r268913) @@ -243,6 +243,8 @@ in_pcbgroup_byhash(struct inpcbinfo *pcb #ifdef RSS if ((pcbinfo->ipi_hashfields == IPI_HASHFIELDS_4TUPLE && hashtype == M_HASHTYPE_RSS_TCP_IPV4) || + (pcbinfo->ipi_hashfields == IPI_HASHFIELDS_4TUPLE && + hashtype == M_HASHTYPE_RSS_UDP_IPV4) || (pcbinfo->ipi_hashfields == IPI_HASHFIELDS_2TUPLE && hashtype == M_HASHTYPE_RSS_IPV4)) return (&pcbinfo->ipi_pcbgroups[ From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 07:39:55 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FAD0D49; Sun, 20 Jul 2014 07:39:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D2562B2E; Sun, 20 Jul 2014 07:39:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K7dtJK083807; Sun, 20 Jul 2014 07:39:55 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K7dtEv083806; Sun, 20 Jul 2014 07:39:55 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407200739.s6K7dtEv083806@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 Jul 2014 07:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268914 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 07:39:55 -0000 Author: adrian Date: Sun Jul 20 07:39:54 2014 New Revision: 268914 URL: http://svnweb.freebsd.org/changeset/base/268914 Log: When it's time to do 4-tuple UDP IPv6 hashing, make sure this is a known type. Modified: head/sys/netinet6/in6_pcbgroup.c Modified: head/sys/netinet6/in6_pcbgroup.c ============================================================================== --- head/sys/netinet6/in6_pcbgroup.c Sun Jul 20 07:38:38 2014 (r268913) +++ head/sys/netinet6/in6_pcbgroup.c Sun Jul 20 07:39:54 2014 (r268914) @@ -73,6 +73,8 @@ in6_pcbgroup_byhash(struct inpcbinfo *pc #ifdef RSS if ((pcbinfo->ipi_hashfields == IPI_HASHFIELDS_4TUPLE && hashtype == M_HASHTYPE_RSS_TCP_IPV6) || + (pcbinfo->ipi_hashfields == IPI_HASHFIELDS_4TUPLE && + hashtype == M_HASHTYPE_RSS_UDP_IPV6) || (pcbinfo->ipi_hashfields == IPI_HASHFIELDS_2TUPLE && hashtype == M_HASHTYPE_RSS_IPV6)) return (&pcbinfo->ipi_pcbgroups[ From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 07:43:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A04F2ED5; Sun, 20 Jul 2014 07:43:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D4F12BB5; Sun, 20 Jul 2014 07:43:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K7hffZ087497; Sun, 20 Jul 2014 07:43:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K7hfkh087496; Sun, 20 Jul 2014 07:43:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407200743.s6K7hfkh087496@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 Jul 2014 07:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268915 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 07:43:41 -0000 Author: adrian Date: Sun Jul 20 07:43:41 2014 New Revision: 268915 URL: http://svnweb.freebsd.org/changeset/base/268915 Log: Disable the ixgbe(4) UDP 4-tuple hashing for the time being. A mix of fragmented and non-fragmented UDP in a single stream will end up being hashed differently, resulting in out-of-order behaviour in the receive path. This was done in the linux e1000 driver in 2011. Discussed with: jfv Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sun Jul 20 07:39:54 2014 (r268914) +++ head/sys/dev/ixgbe/ixgbe.c Sun Jul 20 07:43:41 2014 (r268915) @@ -4247,16 +4247,26 @@ ixgbe_initialise_rss_mapping(struct adap IXGBE_WRITE_REG(hw, IXGBE_RSSRK(i), rss_key[i]); /* Perform hash on these packet types */ + /* + * Disable UDP - IP fragments aren't currently being handled + * and so we end up with a mix of 2-tuple and 4-tuple + * traffic. + */ mrqc = IXGBE_MRQC_RSSEN | IXGBE_MRQC_RSS_FIELD_IPV4 | IXGBE_MRQC_RSS_FIELD_IPV4_TCP +#if 0 | IXGBE_MRQC_RSS_FIELD_IPV4_UDP +#endif | IXGBE_MRQC_RSS_FIELD_IPV6_EX_TCP | IXGBE_MRQC_RSS_FIELD_IPV6_EX | IXGBE_MRQC_RSS_FIELD_IPV6 | IXGBE_MRQC_RSS_FIELD_IPV6_TCP +#if 0 | IXGBE_MRQC_RSS_FIELD_IPV6_UDP - | IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP; + | IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP +#endif + ; IXGBE_WRITE_REG(hw, IXGBE_MRQC, mrqc); } From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 07:45:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18DEFC7; Sun, 20 Jul 2014 07:45:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0EF22BC3; Sun, 20 Jul 2014 07:45:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K7jmKY087874; Sun, 20 Jul 2014 07:45:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K7jmxQ087873; Sun, 20 Jul 2014 07:45:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407200745.s6K7jmxQ087873@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 Jul 2014 07:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268916 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 07:45:49 -0000 Author: adrian Date: Sun Jul 20 07:45:48 2014 New Revision: 268916 URL: http://svnweb.freebsd.org/changeset/base/268916 Log: Teach ixgbe(4) about rss_gethashconfig(). If RSS is enabled, ixgbe(4) will query the RSS API for the types of hashes which should be used. It'll then only enable hashes that are exposed via the RSS layer. This way it won't try to do things like enable UDP hashing if RSS explicitly states that it isn't supported in lookups. Tested: * 82599EB ixgbe(4) NIC Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sun Jul 20 07:43:41 2014 (r268915) +++ head/sys/dev/ixgbe/ixgbe.c Sun Jul 20 07:45:48 2014 (r268916) @@ -4204,6 +4204,9 @@ ixgbe_initialise_rss_mapping(struct adap int i, j, queue_id; uint32_t rss_key[10]; uint32_t mrqc; +#ifdef RSS + uint32_t rss_hash_config; +#endif /* Setup RSS */ reta = 0; @@ -4247,6 +4250,32 @@ ixgbe_initialise_rss_mapping(struct adap IXGBE_WRITE_REG(hw, IXGBE_RSSRK(i), rss_key[i]); /* Perform hash on these packet types */ +#ifdef RSS + mrqc = IXGBE_MRQC_RSSEN; + rss_hash_config = rss_gethashconfig(); + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV4) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV4; + if (rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV4) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV4_TCP; + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV6) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6; + if (rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV6) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_TCP; + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV6_EX) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_EX; + if (rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV6_EX) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_EX_TCP; + if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV4) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV4_UDP; + if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV4_EX) + device_printf(adapter->dev, + "%s: RSS_HASHTYPE_RSS_UDP_IPV4_EX defined, " + "but not supported\n", __func__); + if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV6) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_UDP; + if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV6_EX) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP; +#else /* * Disable UDP - IP fragments aren't currently being handled * and so we end up with a mix of 2-tuple and 4-tuple @@ -4267,6 +4296,7 @@ ixgbe_initialise_rss_mapping(struct adap | IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP #endif ; +#endif /* RSS */ IXGBE_WRITE_REG(hw, IXGBE_MRQC, mrqc); } From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 07:47:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AEB04225; Sun, 20 Jul 2014 07:47:17 +0000 (UTC) Received: from mail-qg0-x22a.google.com (mail-qg0-x22a.google.com [IPv6:2607:f8b0:400d:c04::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 253262BD3; Sun, 20 Jul 2014 07:47:17 +0000 (UTC) Received: by mail-qg0-f42.google.com with SMTP id j5so4603399qga.29 for ; Sun, 20 Jul 2014 00:47:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=nc/Q96bGcSzP6zdaJ7n3Vab2FGTnW4n+maeyHHQtmgs=; b=JRIAhR83LF3vHQgWJAASgaGUkq+eUQYCwv05yaFRsIClytvr7AEBqznWBa/G+veHKf tPbTsIzSuyjbwxV1C1s59lBysCwvpt6olAcRGY8NSSq9+ZbLHT4F6Y2Lu0JaXUgcqf1L ye8ZhvfM40EAHeNE1zTQ6JfoRX3REWIzQ9S8uai+YphIWfXHltWANtJS7oYm0Qm/ze8y SUo9wjwufxF8KzCxjC15A24Z+66zuGiZ6C8yUxMCwf8rlN+3ZndlKhb1VLP6yJ3txF8c igMnMIAGhtbUHiaW8GLXxq+8A9BeFGpQw/8ws1a12gEvgZixDPRvaPhqHyLI/NxoglmG D4WQ== MIME-Version: 1.0 X-Received: by 10.140.96.229 with SMTP id k92mr25309169qge.38.1405842435763; Sun, 20 Jul 2014 00:47:15 -0700 (PDT) Received: by 10.140.48.37 with HTTP; Sun, 20 Jul 2014 00:47:15 -0700 (PDT) In-Reply-To: References: <201407192059.s6JKx8un072543@svn.freebsd.org> Date: Sun, 20 Jul 2014 00:47:15 -0700 Message-ID: Subject: Re: svn commit: r268889 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve usr.sbin/bhyvectl From: Neel Natu To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Neel Natu X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 07:47:17 -0000 Hi Adrian, On Sat, Jul 19, 2014 at 11:30 PM, Adrian Chadd wrote: > Hi! > > This broke -HEAD. 'exc' in vmx_inject_interrupts() is no longer > initialised before use /and/ it's part of a KASSERT() output. > Are you building with an external toolchain? best Neel > Thanks! > > > -a > > > On 19 July 2014 13:59, Neel Natu wrote: >> Author: neel >> Date: Sat Jul 19 20:59:08 2014 >> New Revision: 268889 >> URL: http://svnweb.freebsd.org/changeset/base/268889 >> >> Log: >> Handle nested exceptions in bhyve. >> >> A nested exception condition arises when a second exception is triggered while >> delivering the first exception. Most nested exceptions can be handled serially >> but some are converted into a double fault. If an exception is generated during >> delivery of a double fault then the virtual machine shuts down as a result of >> a triple fault. >> >> vm_exit_intinfo() is used to record that a VM-exit happened while an event was >> being delivered through the IDT. If an exception is triggered while handling >> the VM-exit it will be treated like a nested exception. >> >> vm_entry_intinfo() is used by processor-specific code to get the event to be >> injected into the guest on the next VM-entry. This function is responsible for >> deciding the disposition of nested exceptions. >> >> Modified: >> head/lib/libvmmapi/vmmapi.c >> head/lib/libvmmapi/vmmapi.h >> head/sys/amd64/include/vmm.h >> head/sys/amd64/include/vmm_dev.h >> head/sys/amd64/vmm/intel/vmx.c >> head/sys/amd64/vmm/vmm.c >> head/sys/amd64/vmm/vmm_dev.c >> head/usr.sbin/bhyve/bhyverun.c >> head/usr.sbin/bhyve/task_switch.c >> head/usr.sbin/bhyvectl/bhyvectl.c >> >> Modified: head/lib/libvmmapi/vmmapi.c >> ============================================================================== >> --- head/lib/libvmmapi/vmmapi.c Sat Jul 19 20:55:13 2014 (r268888) >> +++ head/lib/libvmmapi/vmmapi.c Sat Jul 19 20:59:08 2014 (r268889) >> @@ -1106,3 +1106,32 @@ vm_activate_cpu(struct vmctx *ctx, int v >> error = ioctl(ctx->fd, VM_ACTIVATE_CPU, &ac); >> return (error); >> } >> + >> +int >> +vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *info1, uint64_t *info2) >> +{ >> + struct vm_intinfo vmii; >> + int error; >> + >> + bzero(&vmii, sizeof(struct vm_intinfo)); >> + vmii.vcpuid = vcpu; >> + error = ioctl(ctx->fd, VM_GET_INTINFO, &vmii); >> + if (error == 0) { >> + *info1 = vmii.info1; >> + *info2 = vmii.info2; >> + } >> + return (error); >> +} >> + >> +int >> +vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t info1) >> +{ >> + struct vm_intinfo vmii; >> + int error; >> + >> + bzero(&vmii, sizeof(struct vm_intinfo)); >> + vmii.vcpuid = vcpu; >> + vmii.info1 = info1; >> + error = ioctl(ctx->fd, VM_SET_INTINFO, &vmii); >> + return (error); >> +} >> >> Modified: head/lib/libvmmapi/vmmapi.h >> ============================================================================== >> --- head/lib/libvmmapi/vmmapi.h Sat Jul 19 20:55:13 2014 (r268888) >> +++ head/lib/libvmmapi/vmmapi.h Sat Jul 19 20:59:08 2014 (r268889) >> @@ -104,6 +104,9 @@ int vm_setup_pptdev_msix(struct vmctx *c >> int func, int idx, uint64_t addr, uint64_t msg, >> uint32_t vector_control); >> >> +int vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *i1, uint64_t *i2); >> +int vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t exit_intinfo); >> + >> /* >> * Return a pointer to the statistics buffer. Note that this is not MT-safe. >> */ >> >> Modified: head/sys/amd64/include/vmm.h >> ============================================================================== >> --- head/sys/amd64/include/vmm.h Sat Jul 19 20:55:13 2014 (r268888) >> +++ head/sys/amd64/include/vmm.h Sat Jul 19 20:59:08 2014 (r268889) >> @@ -34,6 +34,7 @@ enum vm_suspend_how { >> VM_SUSPEND_RESET, >> VM_SUSPEND_POWEROFF, >> VM_SUSPEND_HALT, >> + VM_SUSPEND_TRIPLEFAULT, >> VM_SUSPEND_LAST >> }; >> >> @@ -88,6 +89,16 @@ enum x2apic_state { >> X2APIC_STATE_LAST >> }; >> >> +#define VM_INTINFO_VECTOR(info) ((info) & 0xff) >> +#define VM_INTINFO_DEL_ERRCODE 0x800 >> +#define VM_INTINFO_RSVD 0x7ffff000 >> +#define VM_INTINFO_VALID 0x80000000 >> +#define VM_INTINFO_TYPE 0x700 >> +#define VM_INTINFO_HWINTR (0 << 8) >> +#define VM_INTINFO_NMI (2 << 8) >> +#define VM_INTINFO_HWEXCEPTION (3 << 8) >> +#define VM_INTINFO_SWINTR (4 << 8) >> + >> #ifdef _KERNEL >> >> #define VM_MAX_NAMELEN 32 >> @@ -278,14 +289,31 @@ struct vatpit *vm_atpit(struct vm *vm); >> int vm_inject_exception(struct vm *vm, int vcpuid, struct vm_exception *vme); >> >> /* >> - * Returns 0 if there is no exception pending for this vcpu. Returns 1 if an >> - * exception is pending and also updates 'vme'. The pending exception is >> - * cleared when this function returns. >> + * This function is called after a VM-exit that occurred during exception or >> + * interrupt delivery through the IDT. The format of 'intinfo' is described >> + * in Figure 15-1, "EXITINTINFO for All Intercepts", APM, Vol 2. >> * >> - * This function should only be called in the context of the thread that is >> - * executing this vcpu. >> + * If a VM-exit handler completes the event delivery successfully then it >> + * should call vm_exit_intinfo() to extinguish the pending event. For e.g., >> + * if the task switch emulation is triggered via a task gate then it should >> + * call this function with 'intinfo=0' to indicate that the external event >> + * is not pending anymore. >> + * >> + * Return value is 0 on success and non-zero on failure. >> */ >> -int vm_exception_pending(struct vm *vm, int vcpuid, struct vm_exception *vme); >> +int vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_t intinfo); >> + >> +/* >> + * This function is called before every VM-entry to retrieve a pending >> + * event that should be injected into the guest. This function combines >> + * nested events into a double or triple fault. >> + * >> + * Returns 0 if there are no events that need to be injected into the guest >> + * and non-zero otherwise. >> + */ >> +int vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t *info); >> + >> +int vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *info1, uint64_t *info2); >> >> void vm_inject_gp(struct vm *vm, int vcpuid); /* general protection fault */ >> void vm_inject_ud(struct vm *vm, int vcpuid); /* undefined instruction fault */ >> >> Modified: head/sys/amd64/include/vmm_dev.h >> ============================================================================== >> --- head/sys/amd64/include/vmm_dev.h Sat Jul 19 20:55:13 2014 (r268888) >> +++ head/sys/amd64/include/vmm_dev.h Sat Jul 19 20:59:08 2014 (r268889) >> @@ -189,6 +189,12 @@ struct vm_cpuset { >> #define VM_ACTIVE_CPUS 0 >> #define VM_SUSPENDED_CPUS 1 >> >> +struct vm_intinfo { >> + int vcpuid; >> + uint64_t info1; >> + uint64_t info2; >> +}; >> + >> enum { >> /* general routines */ >> IOCNUM_ABIVERS = 0, >> @@ -211,6 +217,8 @@ enum { >> IOCNUM_GET_SEGMENT_DESCRIPTOR = 23, >> >> /* interrupt injection */ >> + IOCNUM_GET_INTINFO = 28, >> + IOCNUM_SET_INTINFO = 29, >> IOCNUM_INJECT_EXCEPTION = 30, >> IOCNUM_LAPIC_IRQ = 31, >> IOCNUM_INJECT_NMI = 32, >> @@ -324,4 +332,8 @@ enum { >> _IOW('v', IOCNUM_ACTIVATE_CPU, struct vm_activate_cpu) >> #define VM_GET_CPUS \ >> _IOW('v', IOCNUM_GET_CPUSET, struct vm_cpuset) >> +#define VM_SET_INTINFO \ >> + _IOW('v', IOCNUM_SET_INTINFO, struct vm_intinfo) >> +#define VM_GET_INTINFO \ >> + _IOWR('v', IOCNUM_GET_INTINFO, struct vm_intinfo) >> #endif >> >> Modified: head/sys/amd64/vmm/intel/vmx.c >> ============================================================================== >> --- head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:55:13 2014 (r268888) >> +++ head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:59:08 2014 (r268889) >> @@ -1213,22 +1213,31 @@ vmx_inject_interrupts(struct vmx *vmx, i >> { >> struct vm_exception exc; >> int vector, need_nmi_exiting, extint_pending; >> - uint64_t rflags; >> + uint64_t rflags, entryinfo; >> uint32_t gi, info; >> >> - if (vm_exception_pending(vmx->vm, vcpu, &exc)) { >> - KASSERT(exc.vector >= 0 && exc.vector < 32, >> - ("%s: invalid exception vector %d", __func__, exc.vector)); >> + if (vm_entry_intinfo(vmx->vm, vcpu, &entryinfo)) { >> + KASSERT((entryinfo & VMCS_INTR_VALID) != 0, ("%s: entry " >> + "intinfo is not valid: %#lx", __func__, entryinfo)); >> >> info = vmcs_read(VMCS_ENTRY_INTR_INFO); >> KASSERT((info & VMCS_INTR_VALID) == 0, ("%s: cannot inject " >> "pending exception %d: %#x", __func__, exc.vector, info)); >> >> - info = exc.vector | VMCS_INTR_T_HWEXCEPTION | VMCS_INTR_VALID; >> - if (exc.error_code_valid) { >> - info |= VMCS_INTR_DEL_ERRCODE; >> - vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, exc.error_code); >> + info = entryinfo; >> + vector = info & 0xff; >> + if (vector == IDT_BP || vector == IDT_OF) { >> + /* >> + * VT-x requires #BP and #OF to be injected as software >> + * exceptions. >> + */ >> + info &= ~VMCS_INTR_T_MASK; >> + info |= VMCS_INTR_T_SWEXCEPTION; >> } >> + >> + if (info & VMCS_INTR_DEL_ERRCODE) >> + vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, entryinfo >> 32); >> + >> vmcs_write(VMCS_ENTRY_INTR_INFO, info); >> } >> >> @@ -1407,6 +1416,16 @@ vmx_clear_nmi_blocking(struct vmx *vmx, >> vmcs_write(VMCS_GUEST_INTERRUPTIBILITY, gi); >> } >> >> +static void >> +vmx_assert_nmi_blocking(struct vmx *vmx, int vcpuid) >> +{ >> + uint32_t gi; >> + >> + gi = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); >> + KASSERT(gi & VMCS_INTERRUPTIBILITY_NMI_BLOCKING, >> + ("NMI blocking is not in effect %#x", gi)); >> +} >> + >> static int >> vmx_emulate_xsetbv(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) >> { >> @@ -2050,7 +2069,7 @@ vmx_exit_process(struct vmx *vmx, int vc >> struct vm_task_switch *ts; >> uint32_t eax, ecx, edx, idtvec_info, idtvec_err, intr_info, inst_info; >> uint32_t intr_type, reason; >> - uint64_t qual, gpa; >> + uint64_t exitintinfo, qual, gpa; >> bool retu; >> >> CTASSERT((PINBASED_CTLS_ONE_SETTING & PINBASED_VIRTUAL_NMI) != 0); >> @@ -2070,47 +2089,49 @@ vmx_exit_process(struct vmx *vmx, int vc >> * be handled specially by re-injecting the event if the IDT >> * vectoring information field's valid bit is set. >> * >> - * If the VM-exit is due to a task gate in the IDT then we don't >> - * reinject the event because emulating the task switch also >> - * completes the event delivery. >> - * >> * See "Information for VM Exits During Event Delivery" in Intel SDM >> * for details. >> */ >> - switch (reason) { >> - case EXIT_REASON_EPT_FAULT: >> - case EXIT_REASON_EPT_MISCONFIG: >> - case EXIT_REASON_APIC_ACCESS: >> - case EXIT_REASON_TASK_SWITCH: >> - case EXIT_REASON_EXCEPTION: >> - idtvec_info = vmcs_idt_vectoring_info(); >> - VCPU_CTR2(vmx->vm, vcpu, "vm exit %s: idtvec_info 0x%08x", >> - exit_reason_to_str(reason), idtvec_info); >> - if ((idtvec_info & VMCS_IDT_VEC_VALID) && >> - (reason != EXIT_REASON_TASK_SWITCH)) { >> - idtvec_info &= ~(1 << 12); /* clear undefined bit */ >> - vmcs_write(VMCS_ENTRY_INTR_INFO, idtvec_info); >> - if (idtvec_info & VMCS_IDT_VEC_ERRCODE_VALID) { >> - idtvec_err = vmcs_idt_vectoring_err(); >> - vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, >> - idtvec_err); >> - } >> - /* >> - * If 'virtual NMIs' are being used and the VM-exit >> - * happened while injecting an NMI during the previous >> - * VM-entry, then clear "blocking by NMI" in the Guest >> - * Interruptibility-state. >> - */ >> - if ((idtvec_info & VMCS_INTR_T_MASK) == >> - VMCS_INTR_T_NMI) { >> - vmx_clear_nmi_blocking(vmx, vcpu); >> - } >> + idtvec_info = vmcs_idt_vectoring_info(); >> + if (idtvec_info & VMCS_IDT_VEC_VALID) { >> + idtvec_info &= ~(1 << 12); /* clear undefined bit */ >> + exitintinfo = idtvec_info; >> + if (idtvec_info & VMCS_IDT_VEC_ERRCODE_VALID) { >> + idtvec_err = vmcs_idt_vectoring_err(); >> + exitintinfo |= (uint64_t)idtvec_err << 32; >> + } >> + error = vm_exit_intinfo(vmx->vm, vcpu, exitintinfo); >> + KASSERT(error == 0, ("%s: vm_set_intinfo error %d", >> + __func__, error)); >> + >> + /* >> + * If 'virtual NMIs' are being used and the VM-exit >> + * happened while injecting an NMI during the previous >> + * VM-entry, then clear "blocking by NMI" in the >> + * Guest Interruptibility-State so the NMI can be >> + * reinjected on the subsequent VM-entry. >> + * >> + * However, if the NMI was being delivered through a task >> + * gate, then the new task must start execution with NMIs >> + * blocked so don't clear NMI blocking in this case. >> + */ >> + intr_type = idtvec_info & VMCS_INTR_T_MASK; >> + if (intr_type == VMCS_INTR_T_NMI) { >> + if (reason != EXIT_REASON_TASK_SWITCH) >> + vmx_clear_nmi_blocking(vmx, vcpu); >> + else >> + vmx_assert_nmi_blocking(vmx, vcpu); >> + } >> + >> + /* >> + * Update VM-entry instruction length if the event being >> + * delivered was a software interrupt or software exception. >> + */ >> + if (intr_type == VMCS_INTR_T_SWINTR || >> + intr_type == VMCS_INTR_T_PRIV_SWEXCEPTION || >> + intr_type == VMCS_INTR_T_SWEXCEPTION) { >> vmcs_write(VMCS_ENTRY_INST_LENGTH, vmexit->inst_length); >> } >> - break; >> - default: >> - idtvec_info = 0; >> - break; >> } >> >> switch (reason) { >> @@ -2136,7 +2157,7 @@ vmx_exit_process(struct vmx *vmx, int vc >> */ >> if (ts->reason == TSR_IDT_GATE) { >> KASSERT(idtvec_info & VMCS_IDT_VEC_VALID, >> - ("invalid idtvec_info %x for IDT task switch", >> + ("invalid idtvec_info %#x for IDT task switch", >> idtvec_info)); >> intr_type = idtvec_info & VMCS_INTR_T_MASK; >> if (intr_type != VMCS_INTR_T_SWINTR && >> @@ -2302,6 +2323,7 @@ vmx_exit_process(struct vmx *vmx, int vc >> * the guest. >> * >> * See "Resuming Guest Software after Handling an Exception". >> + * See "Information for VM Exits Due to Vectored Events". >> */ >> if ((idtvec_info & VMCS_IDT_VEC_VALID) == 0 && >> (intr_info & 0xff) != IDT_DF && >> @@ -2519,6 +2541,13 @@ vmx_run(void *arg, int vcpu, register_t >> * pmap_invalidate_ept(). >> */ >> disable_intr(); >> + vmx_inject_interrupts(vmx, vcpu, vlapic); >> + >> + /* >> + * Check for vcpu suspension after injecting events because >> + * vmx_inject_interrupts() can suspend the vcpu due to a >> + * triple fault. >> + */ >> if (vcpu_suspended(suspend_cookie)) { >> enable_intr(); >> vm_exit_suspended(vmx->vm, vcpu, vmcs_guest_rip()); >> @@ -2539,7 +2568,6 @@ vmx_run(void *arg, int vcpu, register_t >> break; >> } >> >> - vmx_inject_interrupts(vmx, vcpu, vlapic); >> vmx_run_trace(vmx, vcpu); >> rc = vmx_enter_guest(vmxctx, vmx, launched); >> >> >> Modified: head/sys/amd64/vmm/vmm.c >> ============================================================================== >> --- head/sys/amd64/vmm/vmm.c Sat Jul 19 20:55:13 2014 (r268888) >> +++ head/sys/amd64/vmm/vmm.c Sat Jul 19 20:59:08 2014 (r268889) >> @@ -97,6 +97,7 @@ struct vcpu { >> int hostcpu; /* (o) vcpu's host cpu */ >> struct vlapic *vlapic; /* (i) APIC device model */ >> enum x2apic_state x2apic_state; /* (i) APIC mode */ >> + uint64_t exitintinfo; /* (i) events pending at VM exit */ >> int nmi_pending; /* (i) NMI pending */ >> int extint_pending; /* (i) INTR pending */ >> struct vm_exception exception; /* (x) exception collateral */ >> @@ -241,6 +242,7 @@ vcpu_init(struct vm *vm, int vcpu_id, bo >> >> vcpu->vlapic = VLAPIC_INIT(vm->cookie, vcpu_id); >> vm_set_x2apic_state(vm, vcpu_id, X2APIC_DISABLED); >> + vcpu->exitintinfo = 0; >> vcpu->nmi_pending = 0; >> vcpu->extint_pending = 0; >> vcpu->exception_pending = 0; >> @@ -1458,6 +1460,202 @@ restart: >> } >> >> int >> +vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_t info) >> +{ >> + struct vcpu *vcpu; >> + int type, vector; >> + >> + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) >> + return (EINVAL); >> + >> + vcpu = &vm->vcpu[vcpuid]; >> + >> + if (info & VM_INTINFO_VALID) { >> + type = info & VM_INTINFO_TYPE; >> + vector = info & 0xff; >> + if (type == VM_INTINFO_NMI && vector != IDT_NMI) >> + return (EINVAL); >> + if (type == VM_INTINFO_HWEXCEPTION && vector >= 32) >> + return (EINVAL); >> + if (info & VM_INTINFO_RSVD) >> + return (EINVAL); >> + } else { >> + info = 0; >> + } >> + VCPU_CTR2(vm, vcpuid, "%s: info1(%#lx)", __func__, info); >> + vcpu->exitintinfo = info; >> + return (0); >> +} >> + >> +enum exc_class { >> + EXC_BENIGN, >> + EXC_CONTRIBUTORY, >> + EXC_PAGEFAULT >> +}; >> + >> +#define IDT_VE 20 /* Virtualization Exception (Intel specific) */ >> + >> +static enum exc_class >> +exception_class(uint64_t info) >> +{ >> + int type, vector; >> + >> + KASSERT(info & VM_INTINFO_VALID, ("intinfo must be valid: %#lx", info)); >> + type = info & VM_INTINFO_TYPE; >> + vector = info & 0xff; >> + >> + /* Table 6-4, "Interrupt and Exception Classes", Intel SDM, Vol 3 */ >> + switch (type) { >> + case VM_INTINFO_HWINTR: >> + case VM_INTINFO_SWINTR: >> + case VM_INTINFO_NMI: >> + return (EXC_BENIGN); >> + default: >> + /* >> + * Hardware exception. >> + * >> + * SVM and VT-x use identical type values to represent NMI, >> + * hardware interrupt and software interrupt. >> + * >> + * SVM uses type '3' for all exceptions. VT-x uses type '3' >> + * for exceptions except #BP and #OF. #BP and #OF use a type >> + * value of '5' or '6'. Therefore we don't check for explicit >> + * values of 'type' to classify 'intinfo' into a hardware >> + * exception. >> + */ >> + break; >> + } >> + >> + switch (vector) { >> + case IDT_PF: >> + case IDT_VE: >> + return (EXC_PAGEFAULT); >> + case IDT_DE: >> + case IDT_TS: >> + case IDT_NP: >> + case IDT_SS: >> + case IDT_GP: >> + return (EXC_CONTRIBUTORY); >> + default: >> + return (EXC_BENIGN); >> + } >> +} >> + >> +static int >> +nested_fault(struct vm *vm, int vcpuid, uint64_t info1, uint64_t info2, >> + uint64_t *retinfo) >> +{ >> + enum exc_class exc1, exc2; >> + int type1, vector1; >> + >> + KASSERT(info1 & VM_INTINFO_VALID, ("info1 %#lx is not valid", info1)); >> + KASSERT(info2 & VM_INTINFO_VALID, ("info2 %#lx is not valid", info2)); >> + >> + /* >> + * If an exception occurs while attempting to call the double-fault >> + * handler the processor enters shutdown mode (aka triple fault). >> + */ >> + type1 = info1 & VM_INTINFO_TYPE; >> + vector1 = info1 & 0xff; >> + if (type1 == VM_INTINFO_HWEXCEPTION && vector1 == IDT_DF) { >> + VCPU_CTR2(vm, vcpuid, "triple fault: info1(%#lx), info2(%#lx)", >> + info1, info2); >> + vm_suspend(vm, VM_SUSPEND_TRIPLEFAULT); >> + *retinfo = 0; >> + return (0); >> + } >> + >> + /* >> + * Table 6-5 "Conditions for Generating a Double Fault", Intel SDM, Vol3 >> + */ >> + exc1 = exception_class(info1); >> + exc2 = exception_class(info2); >> + if ((exc1 == EXC_CONTRIBUTORY && exc2 == EXC_CONTRIBUTORY) || >> + (exc1 == EXC_PAGEFAULT && exc2 != EXC_BENIGN)) { >> + /* Convert nested fault into a double fault. */ >> + *retinfo = IDT_DF; >> + *retinfo |= VM_INTINFO_VALID | VM_INTINFO_HWEXCEPTION; >> + *retinfo |= VM_INTINFO_DEL_ERRCODE; >> + } else { >> + /* Handle exceptions serially */ >> + *retinfo = info2; >> + } >> + return (1); >> +} >> + >> +static uint64_t >> +vcpu_exception_intinfo(struct vcpu *vcpu) >> +{ >> + uint64_t info = 0; >> + >> + if (vcpu->exception_pending) { >> + info = vcpu->exception.vector & 0xff; >> + info |= VM_INTINFO_VALID | VM_INTINFO_HWEXCEPTION; >> + if (vcpu->exception.error_code_valid) { >> + info |= VM_INTINFO_DEL_ERRCODE; >> + info |= (uint64_t)vcpu->exception.error_code << 32; >> + } >> + } >> + return (info); >> +} >> + >> +int >> +vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t *retinfo) >> +{ >> + struct vcpu *vcpu; >> + uint64_t info1, info2; >> + int valid; >> + >> + KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, ("invalid vcpu %d", vcpuid)); >> + >> + vcpu = &vm->vcpu[vcpuid]; >> + >> + info1 = vcpu->exitintinfo; >> + vcpu->exitintinfo = 0; >> + >> + info2 = 0; >> + if (vcpu->exception_pending) { >> + info2 = vcpu_exception_intinfo(vcpu); >> + vcpu->exception_pending = 0; >> + VCPU_CTR2(vm, vcpuid, "Exception %d delivered: %#lx", >> + vcpu->exception.vector, info2); >> + } >> + >> + if ((info1 & VM_INTINFO_VALID) && (info2 & VM_INTINFO_VALID)) { >> + valid = nested_fault(vm, vcpuid, info1, info2, retinfo); >> + } else if (info1 & VM_INTINFO_VALID) { >> + *retinfo = info1; >> + valid = 1; >> + } else if (info2 & VM_INTINFO_VALID) { >> + *retinfo = info2; >> + valid = 1; >> + } else { >> + valid = 0; >> + } >> + >> + if (valid) { >> + VCPU_CTR4(vm, vcpuid, "%s: info1(%#lx), info2(%#lx), " >> + "retinfo(%#lx)", __func__, info1, info2, *retinfo); >> + } >> + >> + return (valid); >> +} >> + >> +int >> +vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *info1, uint64_t *info2) >> +{ >> + struct vcpu *vcpu; >> + >> + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) >> + return (EINVAL); >> + >> + vcpu = &vm->vcpu[vcpuid]; >> + *info1 = vcpu->exitintinfo; >> + *info2 = vcpu_exception_intinfo(vcpu); >> + return (0); >> +} >> + >> +int >> vm_inject_exception(struct vm *vm, int vcpuid, struct vm_exception *exception) >> { >> struct vcpu *vcpu; >> @@ -1468,6 +1666,14 @@ vm_inject_exception(struct vm *vm, int v >> if (exception->vector < 0 || exception->vector >= 32) >> return (EINVAL); >> >> + /* >> + * A double fault exception should never be injected directly into >> + * the guest. It is a derived exception that results from specific >> + * combinations of nested faults. >> + */ >> + if (exception->vector == IDT_DF) >> + return (EINVAL); >> + >> vcpu = &vm->vcpu[vcpuid]; >> >> if (vcpu->exception_pending) { >> @@ -1483,25 +1689,6 @@ vm_inject_exception(struct vm *vm, int v >> return (0); >> } >> >> -int >> -vm_exception_pending(struct vm *vm, int vcpuid, struct vm_exception *exception) >> -{ >> - struct vcpu *vcpu; >> - int pending; >> - >> - KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, ("invalid vcpu %d", vcpuid)); >> - >> - vcpu = &vm->vcpu[vcpuid]; >> - pending = vcpu->exception_pending; >> - if (pending) { >> - vcpu->exception_pending = 0; >> - *exception = vcpu->exception; >> - VCPU_CTR1(vm, vcpuid, "Exception %d delivered", >> - exception->vector); >> - } >> - return (pending); >> -} >> - >> static void >> vm_inject_fault(struct vm *vm, int vcpuid, struct vm_exception *exception) >> { >> >> Modified: head/sys/amd64/vmm/vmm_dev.c >> ============================================================================== >> --- head/sys/amd64/vmm/vmm_dev.c Sat Jul 19 20:55:13 2014 (r268888) >> +++ head/sys/amd64/vmm/vmm_dev.c Sat Jul 19 20:59:08 2014 (r268889) >> @@ -173,6 +173,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c >> struct vm_gla2gpa *gg; >> struct vm_activate_cpu *vac; >> struct vm_cpuset *vm_cpuset; >> + struct vm_intinfo *vmii; >> >> sc = vmmdev_lookup2(cdev); >> if (sc == NULL) >> @@ -199,6 +200,8 @@ vmmdev_ioctl(struct cdev *cdev, u_long c >> case VM_SET_X2APIC_STATE: >> case VM_GLA2GPA: >> case VM_ACTIVATE_CPU: >> + case VM_SET_INTINFO: >> + case VM_GET_INTINFO: >> /* >> * XXX fragile, handle with care >> * Assumes that the first field of the ioctl data is the vcpu. >> @@ -470,6 +473,15 @@ vmmdev_ioctl(struct cdev *cdev, u_long c >> error = copyout(cpuset, vm_cpuset->cpus, size); >> free(cpuset, M_TEMP); >> break; >> + case VM_SET_INTINFO: >> + vmii = (struct vm_intinfo *)data; >> + error = vm_exit_intinfo(sc->vm, vmii->vcpuid, vmii->info1); >> + break; >> + case VM_GET_INTINFO: >> + vmii = (struct vm_intinfo *)data; >> + error = vm_get_intinfo(sc->vm, vmii->vcpuid, &vmii->info1, >> + &vmii->info2); >> + break; >> default: >> error = ENOTTY; >> break; >> >> Modified: head/usr.sbin/bhyve/bhyverun.c >> ============================================================================== >> --- head/usr.sbin/bhyve/bhyverun.c Sat Jul 19 20:55:13 2014 (r268888) >> +++ head/usr.sbin/bhyve/bhyverun.c Sat Jul 19 20:59:08 2014 (r268889) >> @@ -534,6 +534,8 @@ vmexit_suspend(struct vmctx *ctx, struct >> exit(1); >> case VM_SUSPEND_HALT: >> exit(2); >> + case VM_SUSPEND_TRIPLEFAULT: >> + exit(3); >> default: >> fprintf(stderr, "vmexit_suspend: invalid reason %d\n", how); >> exit(100); >> >> Modified: head/usr.sbin/bhyve/task_switch.c >> ============================================================================== >> --- head/usr.sbin/bhyve/task_switch.c Sat Jul 19 20:55:13 2014 (r268888) >> +++ head/usr.sbin/bhyve/task_switch.c Sat Jul 19 20:59:08 2014 (r268889) >> @@ -904,10 +904,14 @@ vmexit_task_switch(struct vmctx *ctx, st >> */ >> >> /* >> - * XXX is the original task switch was triggered by a hardware >> - * exception then do we generate a double-fault if we encounter >> - * an exception during the task switch? >> + * If the task switch was triggered by an event delivered through >> + * the IDT then extinguish the pending event from the vcpu's >> + * exitintinfo. >> */ >> + if (task_switch->reason == TSR_IDT_GATE) { >> + error = vm_set_intinfo(ctx, vcpu, 0); >> + assert(error == 0); >> + } >> >> /* >> * XXX should inject debug exception if 'T' bit is 1 >> >> Modified: head/usr.sbin/bhyvectl/bhyvectl.c >> ============================================================================== >> --- head/usr.sbin/bhyvectl/bhyvectl.c Sat Jul 19 20:55:13 2014 (r268888) >> +++ head/usr.sbin/bhyvectl/bhyvectl.c Sat Jul 19 20:59:08 2014 (r268889) >> @@ -195,7 +195,8 @@ usage(void) >> " [--force-reset]\n" >> " [--force-poweroff]\n" >> " [--get-active-cpus]\n" >> - " [--get-suspended-cpus]\n", >> + " [--get-suspended-cpus]\n" >> + " [--get-intinfo]\n", >> progname); >> exit(1); >> } >> @@ -205,6 +206,7 @@ static int inject_nmi, assert_lapic_lvt; >> static int force_reset, force_poweroff; >> static const char *capname; >> static int create, destroy, get_lowmem, get_highmem; >> +static int get_intinfo; >> static int get_active_cpus, get_suspended_cpus; >> static uint64_t memsize; >> static int set_cr0, get_cr0, set_cr3, get_cr3, set_cr4, get_cr4; >> @@ -412,6 +414,37 @@ print_cpus(const char *banner, const cpu >> printf("\n"); >> } >> >> +static void >> +print_intinfo(const char *banner, uint64_t info) >> +{ >> + int type; >> + >> + printf("%s:\t", banner); >> + if (info & VM_INTINFO_VALID) { >> + type = info & VM_INTINFO_TYPE; >> + switch (type) { >> + case VM_INTINFO_HWINTR: >> + printf("extint"); >> + break; >> + case VM_INTINFO_NMI: >> + printf("nmi"); >> + break; >> + case VM_INTINFO_SWINTR: >> + printf("swint"); >> + break; >> + default: >> + printf("exception"); >> + break; >> + } >> + printf(" vector %d", (int)VM_INTINFO_VECTOR(info)); >> + if (info & VM_INTINFO_DEL_ERRCODE) >> + printf(" errcode %#x", (u_int)(info >> 32)); >> + } else { >> + printf("n/a"); >> + } >> + printf("\n"); >> +} >> + >> int >> main(int argc, char *argv[]) >> { >> @@ -420,7 +453,7 @@ main(int argc, char *argv[]) >> vm_paddr_t gpa, gpa_pmap; >> size_t len; >> struct vm_exit vmexit; >> - uint64_t ctl, eptp, bm, addr, u64, pteval[4], *pte; >> + uint64_t ctl, eptp, bm, addr, u64, pteval[4], *pte, info[2]; >> struct vmctx *ctx; >> int wired; >> cpuset_t cpus; >> @@ -595,6 +628,7 @@ main(int argc, char *argv[]) >> { "force-poweroff", NO_ARG, &force_poweroff, 1 }, >> { "get-active-cpus", NO_ARG, &get_active_cpus, 1 }, >> { "get-suspended-cpus", NO_ARG, &get_suspended_cpus, 1 }, >> + { "get-intinfo", NO_ARG, &get_intinfo, 1 }, >> { NULL, 0, NULL, 0 } >> }; >> >> @@ -1566,6 +1600,14 @@ main(int argc, char *argv[]) >> print_cpus("suspended cpus", &cpus); >> } >> >> + if (!error && (get_intinfo || get_all)) { >> + error = vm_get_intinfo(ctx, vcpu, &info[0], &info[1]); >> + if (!error) { >> + print_intinfo("pending", info[0]); >> + print_intinfo("current", info[1]); >> + } >> + } >> + >> if (!error && run) { >> error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RIP, &rip); >> assert(error == 0); >> From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 07:48:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F07FC370; Sun, 20 Jul 2014 07:48:42 +0000 (UTC) Received: from mail-qa0-x22e.google.com (mail-qa0-x22e.google.com [IPv6:2607:f8b0:400d:c00::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 772D02BD9; Sun, 20 Jul 2014 07:48:42 +0000 (UTC) Received: by mail-qa0-f46.google.com with SMTP id v10so4295553qac.33 for ; Sun, 20 Jul 2014 00:48:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=VVTrLHvjBBw7OLyMfVZeZ2Vs1PgGhUDmm8fKcb4agjM=; b=TlA9RQhHlZq5ZcaDGMm0+C8RHu6CUn/wg78L6Un+doj5u6Gq4wdXt91eyV6HLYilnP n716YtAW4lZoVYWOSsRWH9FgD+LOYWA2rn8mnS9IEuQP9sR0DPQ9LknZZSimMFj/e7e2 ZG7Ou837RGf2rLKtD2pdWeM4LfzQpjRvVPi4HInVo8NHmtNTXunDknLzsj/uteX4oVn6 WXkMmnW1a+Z7E0jV0jSiwomMyO9sm9iyUHt43fUkzjE+jvdYvw7R+Jb7oBxK3wmfYkBi sywRhAPgxNOv5q9GhqTtY8+SGKvEEeP6xSNPSOlfYibnJLrJtXeGnr5LSqjVX2bfliQP 7L2w== MIME-Version: 1.0 X-Received: by 10.229.184.9 with SMTP id ci9mr26758398qcb.11.1405842521530; Sun, 20 Jul 2014 00:48:41 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.1.6 with HTTP; Sun, 20 Jul 2014 00:48:41 -0700 (PDT) In-Reply-To: References: <201407192059.s6JKx8un072543@svn.freebsd.org> Date: Sun, 20 Jul 2014 00:48:41 -0700 X-Google-Sender-Auth: Ngv77A7pobDJqrRPEvCZWd6U0M4 Message-ID: Subject: Re: svn commit: r268889 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve usr.sbin/bhyvectl From: Adrian Chadd To: Neel Natu Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Neel Natu X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 07:48:43 -0000 On 20 July 2014 00:47, Neel Natu wrote: > Hi Adrian, > > On Sat, Jul 19, 2014 at 11:30 PM, Adrian Chadd wrote: >> Hi! >> >> This broke -HEAD. 'exc' in vmx_inject_interrupts() is no longer >> initialised before use /and/ it's part of a KASSERT() output. >> > > Are you building with an external toolchain? Nope; just head with invariants disabled. -a > best > Neel > >> Thanks! >> >> >> -a >> >> >> On 19 July 2014 13:59, Neel Natu wrote: >>> Author: neel >>> Date: Sat Jul 19 20:59:08 2014 >>> New Revision: 268889 >>> URL: http://svnweb.freebsd.org/changeset/base/268889 >>> >>> Log: >>> Handle nested exceptions in bhyve. >>> >>> A nested exception condition arises when a second exception is triggered while >>> delivering the first exception. Most nested exceptions can be handled serially >>> but some are converted into a double fault. If an exception is generated during >>> delivery of a double fault then the virtual machine shuts down as a result of >>> a triple fault. >>> >>> vm_exit_intinfo() is used to record that a VM-exit happened while an event was >>> being delivered through the IDT. If an exception is triggered while handling >>> the VM-exit it will be treated like a nested exception. >>> >>> vm_entry_intinfo() is used by processor-specific code to get the event to be >>> injected into the guest on the next VM-entry. This function is responsible for >>> deciding the disposition of nested exceptions. >>> >>> Modified: >>> head/lib/libvmmapi/vmmapi.c >>> head/lib/libvmmapi/vmmapi.h >>> head/sys/amd64/include/vmm.h >>> head/sys/amd64/include/vmm_dev.h >>> head/sys/amd64/vmm/intel/vmx.c >>> head/sys/amd64/vmm/vmm.c >>> head/sys/amd64/vmm/vmm_dev.c >>> head/usr.sbin/bhyve/bhyverun.c >>> head/usr.sbin/bhyve/task_switch.c >>> head/usr.sbin/bhyvectl/bhyvectl.c >>> >>> Modified: head/lib/libvmmapi/vmmapi.c >>> ============================================================================== >>> --- head/lib/libvmmapi/vmmapi.c Sat Jul 19 20:55:13 2014 (r268888) >>> +++ head/lib/libvmmapi/vmmapi.c Sat Jul 19 20:59:08 2014 (r268889) >>> @@ -1106,3 +1106,32 @@ vm_activate_cpu(struct vmctx *ctx, int v >>> error = ioctl(ctx->fd, VM_ACTIVATE_CPU, &ac); >>> return (error); >>> } >>> + >>> +int >>> +vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *info1, uint64_t *info2) >>> +{ >>> + struct vm_intinfo vmii; >>> + int error; >>> + >>> + bzero(&vmii, sizeof(struct vm_intinfo)); >>> + vmii.vcpuid = vcpu; >>> + error = ioctl(ctx->fd, VM_GET_INTINFO, &vmii); >>> + if (error == 0) { >>> + *info1 = vmii.info1; >>> + *info2 = vmii.info2; >>> + } >>> + return (error); >>> +} >>> + >>> +int >>> +vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t info1) >>> +{ >>> + struct vm_intinfo vmii; >>> + int error; >>> + >>> + bzero(&vmii, sizeof(struct vm_intinfo)); >>> + vmii.vcpuid = vcpu; >>> + vmii.info1 = info1; >>> + error = ioctl(ctx->fd, VM_SET_INTINFO, &vmii); >>> + return (error); >>> +} >>> >>> Modified: head/lib/libvmmapi/vmmapi.h >>> ============================================================================== >>> --- head/lib/libvmmapi/vmmapi.h Sat Jul 19 20:55:13 2014 (r268888) >>> +++ head/lib/libvmmapi/vmmapi.h Sat Jul 19 20:59:08 2014 (r268889) >>> @@ -104,6 +104,9 @@ int vm_setup_pptdev_msix(struct vmctx *c >>> int func, int idx, uint64_t addr, uint64_t msg, >>> uint32_t vector_control); >>> >>> +int vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *i1, uint64_t *i2); >>> +int vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t exit_intinfo); >>> + >>> /* >>> * Return a pointer to the statistics buffer. Note that this is not MT-safe. >>> */ >>> >>> Modified: head/sys/amd64/include/vmm.h >>> ============================================================================== >>> --- head/sys/amd64/include/vmm.h Sat Jul 19 20:55:13 2014 (r268888) >>> +++ head/sys/amd64/include/vmm.h Sat Jul 19 20:59:08 2014 (r268889) >>> @@ -34,6 +34,7 @@ enum vm_suspend_how { >>> VM_SUSPEND_RESET, >>> VM_SUSPEND_POWEROFF, >>> VM_SUSPEND_HALT, >>> + VM_SUSPEND_TRIPLEFAULT, >>> VM_SUSPEND_LAST >>> }; >>> >>> @@ -88,6 +89,16 @@ enum x2apic_state { >>> X2APIC_STATE_LAST >>> }; >>> >>> +#define VM_INTINFO_VECTOR(info) ((info) & 0xff) >>> +#define VM_INTINFO_DEL_ERRCODE 0x800 >>> +#define VM_INTINFO_RSVD 0x7ffff000 >>> +#define VM_INTINFO_VALID 0x80000000 >>> +#define VM_INTINFO_TYPE 0x700 >>> +#define VM_INTINFO_HWINTR (0 << 8) >>> +#define VM_INTINFO_NMI (2 << 8) >>> +#define VM_INTINFO_HWEXCEPTION (3 << 8) >>> +#define VM_INTINFO_SWINTR (4 << 8) >>> + >>> #ifdef _KERNEL >>> >>> #define VM_MAX_NAMELEN 32 >>> @@ -278,14 +289,31 @@ struct vatpit *vm_atpit(struct vm *vm); >>> int vm_inject_exception(struct vm *vm, int vcpuid, struct vm_exception *vme); >>> >>> /* >>> - * Returns 0 if there is no exception pending for this vcpu. Returns 1 if an >>> - * exception is pending and also updates 'vme'. The pending exception is >>> - * cleared when this function returns. >>> + * This function is called after a VM-exit that occurred during exception or >>> + * interrupt delivery through the IDT. The format of 'intinfo' is described >>> + * in Figure 15-1, "EXITINTINFO for All Intercepts", APM, Vol 2. >>> * >>> - * This function should only be called in the context of the thread that is >>> - * executing this vcpu. >>> + * If a VM-exit handler completes the event delivery successfully then it >>> + * should call vm_exit_intinfo() to extinguish the pending event. For e.g., >>> + * if the task switch emulation is triggered via a task gate then it should >>> + * call this function with 'intinfo=0' to indicate that the external event >>> + * is not pending anymore. >>> + * >>> + * Return value is 0 on success and non-zero on failure. >>> */ >>> -int vm_exception_pending(struct vm *vm, int vcpuid, struct vm_exception *vme); >>> +int vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_t intinfo); >>> + >>> +/* >>> + * This function is called before every VM-entry to retrieve a pending >>> + * event that should be injected into the guest. This function combines >>> + * nested events into a double or triple fault. >>> + * >>> + * Returns 0 if there are no events that need to be injected into the guest >>> + * and non-zero otherwise. >>> + */ >>> +int vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t *info); >>> + >>> +int vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *info1, uint64_t *info2); >>> >>> void vm_inject_gp(struct vm *vm, int vcpuid); /* general protection fault */ >>> void vm_inject_ud(struct vm *vm, int vcpuid); /* undefined instruction fault */ >>> >>> Modified: head/sys/amd64/include/vmm_dev.h >>> ============================================================================== >>> --- head/sys/amd64/include/vmm_dev.h Sat Jul 19 20:55:13 2014 (r268888) >>> +++ head/sys/amd64/include/vmm_dev.h Sat Jul 19 20:59:08 2014 (r268889) >>> @@ -189,6 +189,12 @@ struct vm_cpuset { >>> #define VM_ACTIVE_CPUS 0 >>> #define VM_SUSPENDED_CPUS 1 >>> >>> +struct vm_intinfo { >>> + int vcpuid; >>> + uint64_t info1; >>> + uint64_t info2; >>> +}; >>> + >>> enum { >>> /* general routines */ >>> IOCNUM_ABIVERS = 0, >>> @@ -211,6 +217,8 @@ enum { >>> IOCNUM_GET_SEGMENT_DESCRIPTOR = 23, >>> >>> /* interrupt injection */ >>> + IOCNUM_GET_INTINFO = 28, >>> + IOCNUM_SET_INTINFO = 29, >>> IOCNUM_INJECT_EXCEPTION = 30, >>> IOCNUM_LAPIC_IRQ = 31, >>> IOCNUM_INJECT_NMI = 32, >>> @@ -324,4 +332,8 @@ enum { >>> _IOW('v', IOCNUM_ACTIVATE_CPU, struct vm_activate_cpu) >>> #define VM_GET_CPUS \ >>> _IOW('v', IOCNUM_GET_CPUSET, struct vm_cpuset) >>> +#define VM_SET_INTINFO \ >>> + _IOW('v', IOCNUM_SET_INTINFO, struct vm_intinfo) >>> +#define VM_GET_INTINFO \ >>> + _IOWR('v', IOCNUM_GET_INTINFO, struct vm_intinfo) >>> #endif >>> >>> Modified: head/sys/amd64/vmm/intel/vmx.c >>> ============================================================================== >>> --- head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:55:13 2014 (r268888) >>> +++ head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:59:08 2014 (r268889) >>> @@ -1213,22 +1213,31 @@ vmx_inject_interrupts(struct vmx *vmx, i >>> { >>> struct vm_exception exc; >>> int vector, need_nmi_exiting, extint_pending; >>> - uint64_t rflags; >>> + uint64_t rflags, entryinfo; >>> uint32_t gi, info; >>> >>> - if (vm_exception_pending(vmx->vm, vcpu, &exc)) { >>> - KASSERT(exc.vector >= 0 && exc.vector < 32, >>> - ("%s: invalid exception vector %d", __func__, exc.vector)); >>> + if (vm_entry_intinfo(vmx->vm, vcpu, &entryinfo)) { >>> + KASSERT((entryinfo & VMCS_INTR_VALID) != 0, ("%s: entry " >>> + "intinfo is not valid: %#lx", __func__, entryinfo)); >>> >>> info = vmcs_read(VMCS_ENTRY_INTR_INFO); >>> KASSERT((info & VMCS_INTR_VALID) == 0, ("%s: cannot inject " >>> "pending exception %d: %#x", __func__, exc.vector, info)); >>> >>> - info = exc.vector | VMCS_INTR_T_HWEXCEPTION | VMCS_INTR_VALID; >>> - if (exc.error_code_valid) { >>> - info |= VMCS_INTR_DEL_ERRCODE; >>> - vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, exc.error_code); >>> + info = entryinfo; >>> + vector = info & 0xff; >>> + if (vector == IDT_BP || vector == IDT_OF) { >>> + /* >>> + * VT-x requires #BP and #OF to be injected as software >>> + * exceptions. >>> + */ >>> + info &= ~VMCS_INTR_T_MASK; >>> + info |= VMCS_INTR_T_SWEXCEPTION; >>> } >>> + >>> + if (info & VMCS_INTR_DEL_ERRCODE) >>> + vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, entryinfo >> 32); >>> + >>> vmcs_write(VMCS_ENTRY_INTR_INFO, info); >>> } >>> >>> @@ -1407,6 +1416,16 @@ vmx_clear_nmi_blocking(struct vmx *vmx, >>> vmcs_write(VMCS_GUEST_INTERRUPTIBILITY, gi); >>> } >>> >>> +static void >>> +vmx_assert_nmi_blocking(struct vmx *vmx, int vcpuid) >>> +{ >>> + uint32_t gi; >>> + >>> + gi = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); >>> + KASSERT(gi & VMCS_INTERRUPTIBILITY_NMI_BLOCKING, >>> + ("NMI blocking is not in effect %#x", gi)); >>> +} >>> + >>> static int >>> vmx_emulate_xsetbv(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) >>> { >>> @@ -2050,7 +2069,7 @@ vmx_exit_process(struct vmx *vmx, int vc >>> struct vm_task_switch *ts; >>> uint32_t eax, ecx, edx, idtvec_info, idtvec_err, intr_info, inst_info; >>> uint32_t intr_type, reason; >>> - uint64_t qual, gpa; >>> + uint64_t exitintinfo, qual, gpa; >>> bool retu; >>> >>> CTASSERT((PINBASED_CTLS_ONE_SETTING & PINBASED_VIRTUAL_NMI) != 0); >>> @@ -2070,47 +2089,49 @@ vmx_exit_process(struct vmx *vmx, int vc >>> * be handled specially by re-injecting the event if the IDT >>> * vectoring information field's valid bit is set. >>> * >>> - * If the VM-exit is due to a task gate in the IDT then we don't >>> - * reinject the event because emulating the task switch also >>> - * completes the event delivery. >>> - * >>> * See "Information for VM Exits During Event Delivery" in Intel SDM >>> * for details. >>> */ >>> - switch (reason) { >>> - case EXIT_REASON_EPT_FAULT: >>> - case EXIT_REASON_EPT_MISCONFIG: >>> - case EXIT_REASON_APIC_ACCESS: >>> - case EXIT_REASON_TASK_SWITCH: >>> - case EXIT_REASON_EXCEPTION: >>> - idtvec_info = vmcs_idt_vectoring_info(); >>> - VCPU_CTR2(vmx->vm, vcpu, "vm exit %s: idtvec_info 0x%08x", >>> - exit_reason_to_str(reason), idtvec_info); >>> - if ((idtvec_info & VMCS_IDT_VEC_VALID) && >>> - (reason != EXIT_REASON_TASK_SWITCH)) { >>> - idtvec_info &= ~(1 << 12); /* clear undefined bit */ >>> - vmcs_write(VMCS_ENTRY_INTR_INFO, idtvec_info); >>> - if (idtvec_info & VMCS_IDT_VEC_ERRCODE_VALID) { >>> - idtvec_err = vmcs_idt_vectoring_err(); >>> - vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, >>> - idtvec_err); >>> - } >>> - /* >>> - * If 'virtual NMIs' are being used and the VM-exit >>> - * happened while injecting an NMI during the previous >>> - * VM-entry, then clear "blocking by NMI" in the Guest >>> - * Interruptibility-state. >>> - */ >>> - if ((idtvec_info & VMCS_INTR_T_MASK) == >>> - VMCS_INTR_T_NMI) { >>> - vmx_clear_nmi_blocking(vmx, vcpu); >>> - } >>> + idtvec_info = vmcs_idt_vectoring_info(); >>> + if (idtvec_info & VMCS_IDT_VEC_VALID) { >>> + idtvec_info &= ~(1 << 12); /* clear undefined bit */ >>> + exitintinfo = idtvec_info; >>> + if (idtvec_info & VMCS_IDT_VEC_ERRCODE_VALID) { >>> + idtvec_err = vmcs_idt_vectoring_err(); >>> + exitintinfo |= (uint64_t)idtvec_err << 32; >>> + } >>> + error = vm_exit_intinfo(vmx->vm, vcpu, exitintinfo); >>> + KASSERT(error == 0, ("%s: vm_set_intinfo error %d", >>> + __func__, error)); >>> + >>> + /* >>> + * If 'virtual NMIs' are being used and the VM-exit >>> + * happened while injecting an NMI during the previous >>> + * VM-entry, then clear "blocking by NMI" in the >>> + * Guest Interruptibility-State so the NMI can be >>> + * reinjected on the subsequent VM-entry. >>> + * >>> + * However, if the NMI was being delivered through a task >>> + * gate, then the new task must start execution with NMIs >>> + * blocked so don't clear NMI blocking in this case. >>> + */ >>> + intr_type = idtvec_info & VMCS_INTR_T_MASK; >>> + if (intr_type == VMCS_INTR_T_NMI) { >>> + if (reason != EXIT_REASON_TASK_SWITCH) >>> + vmx_clear_nmi_blocking(vmx, vcpu); >>> + else >>> + vmx_assert_nmi_blocking(vmx, vcpu); >>> + } >>> + >>> + /* >>> + * Update VM-entry instruction length if the event being >>> + * delivered was a software interrupt or software exception. >>> + */ >>> + if (intr_type == VMCS_INTR_T_SWINTR || >>> + intr_type == VMCS_INTR_T_PRIV_SWEXCEPTION || >>> + intr_type == VMCS_INTR_T_SWEXCEPTION) { >>> vmcs_write(VMCS_ENTRY_INST_LENGTH, vmexit->inst_length); >>> } >>> - break; >>> - default: >>> - idtvec_info = 0; >>> - break; >>> } >>> >>> switch (reason) { >>> @@ -2136,7 +2157,7 @@ vmx_exit_process(struct vmx *vmx, int vc >>> */ >>> if (ts->reason == TSR_IDT_GATE) { >>> KASSERT(idtvec_info & VMCS_IDT_VEC_VALID, >>> - ("invalid idtvec_info %x for IDT task switch", >>> + ("invalid idtvec_info %#x for IDT task switch", >>> idtvec_info)); >>> intr_type = idtvec_info & VMCS_INTR_T_MASK; >>> if (intr_type != VMCS_INTR_T_SWINTR && >>> @@ -2302,6 +2323,7 @@ vmx_exit_process(struct vmx *vmx, int vc >>> * the guest. >>> * >>> * See "Resuming Guest Software after Handling an Exception". >>> + * See "Information for VM Exits Due to Vectored Events". >>> */ >>> if ((idtvec_info & VMCS_IDT_VEC_VALID) == 0 && >>> (intr_info & 0xff) != IDT_DF && >>> @@ -2519,6 +2541,13 @@ vmx_run(void *arg, int vcpu, register_t >>> * pmap_invalidate_ept(). >>> */ >>> disable_intr(); >>> + vmx_inject_interrupts(vmx, vcpu, vlapic); >>> + >>> + /* >>> + * Check for vcpu suspension after injecting events because >>> + * vmx_inject_interrupts() can suspend the vcpu due to a >>> + * triple fault. >>> + */ >>> if (vcpu_suspended(suspend_cookie)) { >>> enable_intr(); >>> vm_exit_suspended(vmx->vm, vcpu, vmcs_guest_rip()); >>> @@ -2539,7 +2568,6 @@ vmx_run(void *arg, int vcpu, register_t >>> break; >>> } >>> >>> - vmx_inject_interrupts(vmx, vcpu, vlapic); >>> vmx_run_trace(vmx, vcpu); >>> rc = vmx_enter_guest(vmxctx, vmx, launched); >>> >>> >>> Modified: head/sys/amd64/vmm/vmm.c >>> ============================================================================== >>> --- head/sys/amd64/vmm/vmm.c Sat Jul 19 20:55:13 2014 (r268888) >>> +++ head/sys/amd64/vmm/vmm.c Sat Jul 19 20:59:08 2014 (r268889) >>> @@ -97,6 +97,7 @@ struct vcpu { >>> int hostcpu; /* (o) vcpu's host cpu */ >>> struct vlapic *vlapic; /* (i) APIC device model */ >>> enum x2apic_state x2apic_state; /* (i) APIC mode */ >>> + uint64_t exitintinfo; /* (i) events pending at VM exit */ >>> int nmi_pending; /* (i) NMI pending */ >>> int extint_pending; /* (i) INTR pending */ >>> struct vm_exception exception; /* (x) exception collateral */ >>> @@ -241,6 +242,7 @@ vcpu_init(struct vm *vm, int vcpu_id, bo >>> >>> vcpu->vlapic = VLAPIC_INIT(vm->cookie, vcpu_id); >>> vm_set_x2apic_state(vm, vcpu_id, X2APIC_DISABLED); >>> + vcpu->exitintinfo = 0; >>> vcpu->nmi_pending = 0; >>> vcpu->extint_pending = 0; >>> vcpu->exception_pending = 0; >>> @@ -1458,6 +1460,202 @@ restart: >>> } >>> >>> int >>> +vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_t info) >>> +{ >>> + struct vcpu *vcpu; >>> + int type, vector; >>> + >>> + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) >>> + return (EINVAL); >>> + >>> + vcpu = &vm->vcpu[vcpuid]; >>> + >>> + if (info & VM_INTINFO_VALID) { >>> + type = info & VM_INTINFO_TYPE; >>> + vector = info & 0xff; >>> + if (type == VM_INTINFO_NMI && vector != IDT_NMI) >>> + return (EINVAL); >>> + if (type == VM_INTINFO_HWEXCEPTION && vector >= 32) >>> + return (EINVAL); >>> + if (info & VM_INTINFO_RSVD) >>> + return (EINVAL); >>> + } else { >>> + info = 0; >>> + } >>> + VCPU_CTR2(vm, vcpuid, "%s: info1(%#lx)", __func__, info); >>> + vcpu->exitintinfo = info; >>> + return (0); >>> +} >>> + >>> +enum exc_class { >>> + EXC_BENIGN, >>> + EXC_CONTRIBUTORY, >>> + EXC_PAGEFAULT >>> +}; >>> + >>> +#define IDT_VE 20 /* Virtualization Exception (Intel specific) */ >>> + >>> +static enum exc_class >>> +exception_class(uint64_t info) >>> +{ >>> + int type, vector; >>> + >>> + KASSERT(info & VM_INTINFO_VALID, ("intinfo must be valid: %#lx", info)); >>> + type = info & VM_INTINFO_TYPE; >>> + vector = info & 0xff; >>> + >>> + /* Table 6-4, "Interrupt and Exception Classes", Intel SDM, Vol 3 */ >>> + switch (type) { >>> + case VM_INTINFO_HWINTR: >>> + case VM_INTINFO_SWINTR: >>> + case VM_INTINFO_NMI: >>> + return (EXC_BENIGN); >>> + default: >>> + /* >>> + * Hardware exception. >>> + * >>> + * SVM and VT-x use identical type values to represent NMI, >>> + * hardware interrupt and software interrupt. >>> + * >>> + * SVM uses type '3' for all exceptions. VT-x uses type '3' >>> + * for exceptions except #BP and #OF. #BP and #OF use a type >>> + * value of '5' or '6'. Therefore we don't check for explicit >>> + * values of 'type' to classify 'intinfo' into a hardware >>> + * exception. >>> + */ >>> + break; >>> + } >>> + >>> + switch (vector) { >>> + case IDT_PF: >>> + case IDT_VE: >>> + return (EXC_PAGEFAULT); >>> + case IDT_DE: >>> + case IDT_TS: >>> + case IDT_NP: >>> + case IDT_SS: >>> + case IDT_GP: >>> + return (EXC_CONTRIBUTORY); >>> + default: >>> + return (EXC_BENIGN); >>> + } >>> +} >>> + >>> +static int >>> +nested_fault(struct vm *vm, int vcpuid, uint64_t info1, uint64_t info2, >>> + uint64_t *retinfo) >>> +{ >>> + enum exc_class exc1, exc2; >>> + int type1, vector1; >>> + >>> + KASSERT(info1 & VM_INTINFO_VALID, ("info1 %#lx is not valid", info1)); >>> + KASSERT(info2 & VM_INTINFO_VALID, ("info2 %#lx is not valid", info2)); >>> + >>> + /* >>> + * If an exception occurs while attempting to call the double-fault >>> + * handler the processor enters shutdown mode (aka triple fault). >>> + */ >>> + type1 = info1 & VM_INTINFO_TYPE; >>> + vector1 = info1 & 0xff; >>> + if (type1 == VM_INTINFO_HWEXCEPTION && vector1 == IDT_DF) { >>> + VCPU_CTR2(vm, vcpuid, "triple fault: info1(%#lx), info2(%#lx)", >>> + info1, info2); >>> + vm_suspend(vm, VM_SUSPEND_TRIPLEFAULT); >>> + *retinfo = 0; >>> + return (0); >>> + } >>> + >>> + /* >>> + * Table 6-5 "Conditions for Generating a Double Fault", Intel SDM, Vol3 >>> + */ >>> + exc1 = exception_class(info1); >>> + exc2 = exception_class(info2); >>> + if ((exc1 == EXC_CONTRIBUTORY && exc2 == EXC_CONTRIBUTORY) || >>> + (exc1 == EXC_PAGEFAULT && exc2 != EXC_BENIGN)) { >>> + /* Convert nested fault into a double fault. */ >>> + *retinfo = IDT_DF; >>> + *retinfo |= VM_INTINFO_VALID | VM_INTINFO_HWEXCEPTION; >>> + *retinfo |= VM_INTINFO_DEL_ERRCODE; >>> + } else { >>> + /* Handle exceptions serially */ >>> + *retinfo = info2; >>> + } >>> + return (1); >>> +} >>> + >>> +static uint64_t >>> +vcpu_exception_intinfo(struct vcpu *vcpu) >>> +{ >>> + uint64_t info = 0; >>> + >>> + if (vcpu->exception_pending) { >>> + info = vcpu->exception.vector & 0xff; >>> + info |= VM_INTINFO_VALID | VM_INTINFO_HWEXCEPTION; >>> + if (vcpu->exception.error_code_valid) { >>> + info |= VM_INTINFO_DEL_ERRCODE; >>> + info |= (uint64_t)vcpu->exception.error_code << 32; >>> + } >>> + } >>> + return (info); >>> +} >>> + >>> +int >>> +vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t *retinfo) >>> +{ >>> + struct vcpu *vcpu; >>> + uint64_t info1, info2; >>> + int valid; >>> + >>> + KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, ("invalid vcpu %d", vcpuid)); >>> + >>> + vcpu = &vm->vcpu[vcpuid]; >>> + >>> + info1 = vcpu->exitintinfo; >>> + vcpu->exitintinfo = 0; >>> + >>> + info2 = 0; >>> + if (vcpu->exception_pending) { >>> + info2 = vcpu_exception_intinfo(vcpu); >>> + vcpu->exception_pending = 0; >>> + VCPU_CTR2(vm, vcpuid, "Exception %d delivered: %#lx", >>> + vcpu->exception.vector, info2); >>> + } >>> + >>> + if ((info1 & VM_INTINFO_VALID) && (info2 & VM_INTINFO_VALID)) { >>> + valid = nested_fault(vm, vcpuid, info1, info2, retinfo); >>> + } else if (info1 & VM_INTINFO_VALID) { >>> + *retinfo = info1; >>> + valid = 1; >>> + } else if (info2 & VM_INTINFO_VALID) { >>> + *retinfo = info2; >>> + valid = 1; >>> + } else { >>> + valid = 0; >>> + } >>> + >>> + if (valid) { >>> + VCPU_CTR4(vm, vcpuid, "%s: info1(%#lx), info2(%#lx), " >>> + "retinfo(%#lx)", __func__, info1, info2, *retinfo); >>> + } >>> + >>> + return (valid); >>> +} >>> + >>> +int >>> +vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *info1, uint64_t *info2) >>> +{ >>> + struct vcpu *vcpu; >>> + >>> + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) >>> + return (EINVAL); >>> + >>> + vcpu = &vm->vcpu[vcpuid]; >>> + *info1 = vcpu->exitintinfo; >>> + *info2 = vcpu_exception_intinfo(vcpu); >>> + return (0); >>> +} >>> + >>> +int >>> vm_inject_exception(struct vm *vm, int vcpuid, struct vm_exception *exception) >>> { >>> struct vcpu *vcpu; >>> @@ -1468,6 +1666,14 @@ vm_inject_exception(struct vm *vm, int v >>> if (exception->vector < 0 || exception->vector >= 32) >>> return (EINVAL); >>> >>> + /* >>> + * A double fault exception should never be injected directly into >>> + * the guest. It is a derived exception that results from specific >>> + * combinations of nested faults. >>> + */ >>> + if (exception->vector == IDT_DF) >>> + return (EINVAL); >>> + >>> vcpu = &vm->vcpu[vcpuid]; >>> >>> if (vcpu->exception_pending) { >>> @@ -1483,25 +1689,6 @@ vm_inject_exception(struct vm *vm, int v >>> return (0); >>> } >>> >>> -int >>> -vm_exception_pending(struct vm *vm, int vcpuid, struct vm_exception *exception) >>> -{ >>> - struct vcpu *vcpu; >>> - int pending; >>> - >>> - KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, ("invalid vcpu %d", vcpuid)); >>> - >>> - vcpu = &vm->vcpu[vcpuid]; >>> - pending = vcpu->exception_pending; >>> - if (pending) { >>> - vcpu->exception_pending = 0; >>> - *exception = vcpu->exception; >>> - VCPU_CTR1(vm, vcpuid, "Exception %d delivered", >>> - exception->vector); >>> - } >>> - return (pending); >>> -} >>> - >>> static void >>> vm_inject_fault(struct vm *vm, int vcpuid, struct vm_exception *exception) >>> { >>> >>> Modified: head/sys/amd64/vmm/vmm_dev.c >>> ============================================================================== >>> --- head/sys/amd64/vmm/vmm_dev.c Sat Jul 19 20:55:13 2014 (r268888) >>> +++ head/sys/amd64/vmm/vmm_dev.c Sat Jul 19 20:59:08 2014 (r268889) >>> @@ -173,6 +173,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c >>> struct vm_gla2gpa *gg; >>> struct vm_activate_cpu *vac; >>> struct vm_cpuset *vm_cpuset; >>> + struct vm_intinfo *vmii; >>> >>> sc = vmmdev_lookup2(cdev); >>> if (sc == NULL) >>> @@ -199,6 +200,8 @@ vmmdev_ioctl(struct cdev *cdev, u_long c >>> case VM_SET_X2APIC_STATE: >>> case VM_GLA2GPA: >>> case VM_ACTIVATE_CPU: >>> + case VM_SET_INTINFO: >>> + case VM_GET_INTINFO: >>> /* >>> * XXX fragile, handle with care >>> * Assumes that the first field of the ioctl data is the vcpu. >>> @@ -470,6 +473,15 @@ vmmdev_ioctl(struct cdev *cdev, u_long c >>> error = copyout(cpuset, vm_cpuset->cpus, size); >>> free(cpuset, M_TEMP); >>> break; >>> + case VM_SET_INTINFO: >>> + vmii = (struct vm_intinfo *)data; >>> + error = vm_exit_intinfo(sc->vm, vmii->vcpuid, vmii->info1); >>> + break; >>> + case VM_GET_INTINFO: >>> + vmii = (struct vm_intinfo *)data; >>> + error = vm_get_intinfo(sc->vm, vmii->vcpuid, &vmii->info1, >>> + &vmii->info2); >>> + break; >>> default: >>> error = ENOTTY; >>> break; >>> >>> Modified: head/usr.sbin/bhyve/bhyverun.c >>> ============================================================================== >>> --- head/usr.sbin/bhyve/bhyverun.c Sat Jul 19 20:55:13 2014 (r268888) >>> +++ head/usr.sbin/bhyve/bhyverun.c Sat Jul 19 20:59:08 2014 (r268889) >>> @@ -534,6 +534,8 @@ vmexit_suspend(struct vmctx *ctx, struct >>> exit(1); >>> case VM_SUSPEND_HALT: >>> exit(2); >>> + case VM_SUSPEND_TRIPLEFAULT: >>> + exit(3); >>> default: >>> fprintf(stderr, "vmexit_suspend: invalid reason %d\n", how); >>> exit(100); >>> >>> Modified: head/usr.sbin/bhyve/task_switch.c >>> ============================================================================== >>> --- head/usr.sbin/bhyve/task_switch.c Sat Jul 19 20:55:13 2014 (r268888) >>> +++ head/usr.sbin/bhyve/task_switch.c Sat Jul 19 20:59:08 2014 (r268889) >>> @@ -904,10 +904,14 @@ vmexit_task_switch(struct vmctx *ctx, st >>> */ >>> >>> /* >>> - * XXX is the original task switch was triggered by a hardware >>> - * exception then do we generate a double-fault if we encounter >>> - * an exception during the task switch? >>> + * If the task switch was triggered by an event delivered through >>> + * the IDT then extinguish the pending event from the vcpu's >>> + * exitintinfo. >>> */ >>> + if (task_switch->reason == TSR_IDT_GATE) { >>> + error = vm_set_intinfo(ctx, vcpu, 0); >>> + assert(error == 0); >>> + } >>> >>> /* >>> * XXX should inject debug exception if 'T' bit is 1 >>> >>> Modified: head/usr.sbin/bhyvectl/bhyvectl.c >>> ============================================================================== >>> --- head/usr.sbin/bhyvectl/bhyvectl.c Sat Jul 19 20:55:13 2014 (r268888) >>> +++ head/usr.sbin/bhyvectl/bhyvectl.c Sat Jul 19 20:59:08 2014 (r268889) >>> @@ -195,7 +195,8 @@ usage(void) >>> " [--force-reset]\n" >>> " [--force-poweroff]\n" >>> " [--get-active-cpus]\n" >>> - " [--get-suspended-cpus]\n", >>> + " [--get-suspended-cpus]\n" >>> + " [--get-intinfo]\n", >>> progname); >>> exit(1); >>> } >>> @@ -205,6 +206,7 @@ static int inject_nmi, assert_lapic_lvt; >>> static int force_reset, force_poweroff; >>> static const char *capname; >>> static int create, destroy, get_lowmem, get_highmem; >>> +static int get_intinfo; >>> static int get_active_cpus, get_suspended_cpus; >>> static uint64_t memsize; >>> static int set_cr0, get_cr0, set_cr3, get_cr3, set_cr4, get_cr4; >>> @@ -412,6 +414,37 @@ print_cpus(const char *banner, const cpu >>> printf("\n"); >>> } >>> >>> +static void >>> +print_intinfo(const char *banner, uint64_t info) >>> +{ >>> + int type; >>> + >>> + printf("%s:\t", banner); >>> + if (info & VM_INTINFO_VALID) { >>> + type = info & VM_INTINFO_TYPE; >>> + switch (type) { >>> + case VM_INTINFO_HWINTR: >>> + printf("extint"); >>> + break; >>> + case VM_INTINFO_NMI: >>> + printf("nmi"); >>> + break; >>> + case VM_INTINFO_SWINTR: >>> + printf("swint"); >>> + break; >>> + default: >>> + printf("exception"); >>> + break; >>> + } >>> + printf(" vector %d", (int)VM_INTINFO_VECTOR(info)); >>> + if (info & VM_INTINFO_DEL_ERRCODE) >>> + printf(" errcode %#x", (u_int)(info >> 32)); >>> + } else { >>> + printf("n/a"); >>> + } >>> + printf("\n"); >>> +} >>> + >>> int >>> main(int argc, char *argv[]) >>> { >>> @@ -420,7 +453,7 @@ main(int argc, char *argv[]) >>> vm_paddr_t gpa, gpa_pmap; >>> size_t len; >>> struct vm_exit vmexit; >>> - uint64_t ctl, eptp, bm, addr, u64, pteval[4], *pte; >>> + uint64_t ctl, eptp, bm, addr, u64, pteval[4], *pte, info[2]; >>> struct vmctx *ctx; >>> int wired; >>> cpuset_t cpus; >>> @@ -595,6 +628,7 @@ main(int argc, char *argv[]) >>> { "force-poweroff", NO_ARG, &force_poweroff, 1 }, >>> { "get-active-cpus", NO_ARG, &get_active_cpus, 1 }, >>> { "get-suspended-cpus", NO_ARG, &get_suspended_cpus, 1 }, >>> + { "get-intinfo", NO_ARG, &get_intinfo, 1 }, >>> { NULL, 0, NULL, 0 } >>> }; >>> >>> @@ -1566,6 +1600,14 @@ main(int argc, char *argv[]) >>> print_cpus("suspended cpus", &cpus); >>> } >>> >>> + if (!error && (get_intinfo || get_all)) { >>> + error = vm_get_intinfo(ctx, vcpu, &info[0], &info[1]); >>> + if (!error) { >>> + print_intinfo("pending", info[0]); >>> + print_intinfo("current", info[1]); >>> + } >>> + } >>> + >>> if (!error && run) { >>> error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RIP, &rip); >>> assert(error == 0); >>> From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 07:54:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B5A25F2; Sun, 20 Jul 2014 07:54:52 +0000 (UTC) Received: from mail-qg0-x231.google.com (mail-qg0-x231.google.com [IPv6:2607:f8b0:400d:c04::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 121A32C7B; Sun, 20 Jul 2014 07:54:52 +0000 (UTC) Received: by mail-qg0-f49.google.com with SMTP id j107so4364557qga.36 for ; Sun, 20 Jul 2014 00:54:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=2uKyvxrfl6v1BuNqOppUzPnxYUBWfVfqyiNtdx0SgFY=; b=06+QSH8xtd8VQp9prGSJhZp9sgsRWhLfx7Ey6/igXzF+orjTFraNxz5311QDuIeMcc WNXPh2u9VWZFasYKTIyZlI1joX1lJNxQglJN/EY0gFIoIAVGMOLV+zwRsm51XuGdrJ9x PEIuAUet5i3YDqY6JZIE0rrvv12mBahjzltp89XHUIXDNCUyOzuTv/B4+bUqGhljcYZr rsuX0W0IBMa0TFhhIPxXx+ZrdSto71HjfSyZfWUY241+dwf5mS0vLDuCeLa7AUY6yqfC 5Yytei1QLD4IOcMvofisAIEP/MeU9VS6r7PVPgaYEvE759hq10geKry7C1olDOcTOR9v dqtg== MIME-Version: 1.0 X-Received: by 10.224.167.136 with SMTP id q8mr26510537qay.35.1405842891248; Sun, 20 Jul 2014 00:54:51 -0700 (PDT) Received: by 10.140.48.37 with HTTP; Sun, 20 Jul 2014 00:54:51 -0700 (PDT) In-Reply-To: References: <201407192059.s6JKx8un072543@svn.freebsd.org> Date: Sun, 20 Jul 2014 00:54:51 -0700 Message-ID: Subject: Re: svn commit: r268889 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve usr.sbin/bhyvectl From: Neel Natu To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Neel Natu X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 07:54:52 -0000 Hi Adrian, On Sun, Jul 20, 2014 at 12:48 AM, Adrian Chadd wrote: > On 20 July 2014 00:47, Neel Natu wrote: >> Hi Adrian, >> >> On Sat, Jul 19, 2014 at 11:30 PM, Adrian Chadd wrote: >>> Hi! >>> >>> This broke -HEAD. 'exc' in vmx_inject_interrupts() is no longer >>> initialised before use /and/ it's part of a KASSERT() output. >>> >> >> Are you building with an external toolchain? > > Nope; just head with invariants disabled. > Ok, so it broke your custom kernel config as opposed to breaking HEAD. I'll fix it shortly. best Neel > > > -a > >> best >> Neel >> >>> Thanks! >>> >>> >>> -a >>> >>> >>> On 19 July 2014 13:59, Neel Natu wrote: >>>> Author: neel >>>> Date: Sat Jul 19 20:59:08 2014 >>>> New Revision: 268889 >>>> URL: http://svnweb.freebsd.org/changeset/base/268889 >>>> >>>> Log: >>>> Handle nested exceptions in bhyve. >>>> >>>> A nested exception condition arises when a second exception is triggered while >>>> delivering the first exception. Most nested exceptions can be handled serially >>>> but some are converted into a double fault. If an exception is generated during >>>> delivery of a double fault then the virtual machine shuts down as a result of >>>> a triple fault. >>>> >>>> vm_exit_intinfo() is used to record that a VM-exit happened while an event was >>>> being delivered through the IDT. If an exception is triggered while handling >>>> the VM-exit it will be treated like a nested exception. >>>> >>>> vm_entry_intinfo() is used by processor-specific code to get the event to be >>>> injected into the guest on the next VM-entry. This function is responsible for >>>> deciding the disposition of nested exceptions. >>>> >>>> Modified: >>>> head/lib/libvmmapi/vmmapi.c >>>> head/lib/libvmmapi/vmmapi.h >>>> head/sys/amd64/include/vmm.h >>>> head/sys/amd64/include/vmm_dev.h >>>> head/sys/amd64/vmm/intel/vmx.c >>>> head/sys/amd64/vmm/vmm.c >>>> head/sys/amd64/vmm/vmm_dev.c >>>> head/usr.sbin/bhyve/bhyverun.c >>>> head/usr.sbin/bhyve/task_switch.c >>>> head/usr.sbin/bhyvectl/bhyvectl.c >>>> >>>> Modified: head/lib/libvmmapi/vmmapi.c >>>> ============================================================================== >>>> --- head/lib/libvmmapi/vmmapi.c Sat Jul 19 20:55:13 2014 (r268888) >>>> +++ head/lib/libvmmapi/vmmapi.c Sat Jul 19 20:59:08 2014 (r268889) >>>> @@ -1106,3 +1106,32 @@ vm_activate_cpu(struct vmctx *ctx, int v >>>> error = ioctl(ctx->fd, VM_ACTIVATE_CPU, &ac); >>>> return (error); >>>> } >>>> + >>>> +int >>>> +vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *info1, uint64_t *info2) >>>> +{ >>>> + struct vm_intinfo vmii; >>>> + int error; >>>> + >>>> + bzero(&vmii, sizeof(struct vm_intinfo)); >>>> + vmii.vcpuid = vcpu; >>>> + error = ioctl(ctx->fd, VM_GET_INTINFO, &vmii); >>>> + if (error == 0) { >>>> + *info1 = vmii.info1; >>>> + *info2 = vmii.info2; >>>> + } >>>> + return (error); >>>> +} >>>> + >>>> +int >>>> +vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t info1) >>>> +{ >>>> + struct vm_intinfo vmii; >>>> + int error; >>>> + >>>> + bzero(&vmii, sizeof(struct vm_intinfo)); >>>> + vmii.vcpuid = vcpu; >>>> + vmii.info1 = info1; >>>> + error = ioctl(ctx->fd, VM_SET_INTINFO, &vmii); >>>> + return (error); >>>> +} >>>> >>>> Modified: head/lib/libvmmapi/vmmapi.h >>>> ============================================================================== >>>> --- head/lib/libvmmapi/vmmapi.h Sat Jul 19 20:55:13 2014 (r268888) >>>> +++ head/lib/libvmmapi/vmmapi.h Sat Jul 19 20:59:08 2014 (r268889) >>>> @@ -104,6 +104,9 @@ int vm_setup_pptdev_msix(struct vmctx *c >>>> int func, int idx, uint64_t addr, uint64_t msg, >>>> uint32_t vector_control); >>>> >>>> +int vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *i1, uint64_t *i2); >>>> +int vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t exit_intinfo); >>>> + >>>> /* >>>> * Return a pointer to the statistics buffer. Note that this is not MT-safe. >>>> */ >>>> >>>> Modified: head/sys/amd64/include/vmm.h >>>> ============================================================================== >>>> --- head/sys/amd64/include/vmm.h Sat Jul 19 20:55:13 2014 (r268888) >>>> +++ head/sys/amd64/include/vmm.h Sat Jul 19 20:59:08 2014 (r268889) >>>> @@ -34,6 +34,7 @@ enum vm_suspend_how { >>>> VM_SUSPEND_RESET, >>>> VM_SUSPEND_POWEROFF, >>>> VM_SUSPEND_HALT, >>>> + VM_SUSPEND_TRIPLEFAULT, >>>> VM_SUSPEND_LAST >>>> }; >>>> >>>> @@ -88,6 +89,16 @@ enum x2apic_state { >>>> X2APIC_STATE_LAST >>>> }; >>>> >>>> +#define VM_INTINFO_VECTOR(info) ((info) & 0xff) >>>> +#define VM_INTINFO_DEL_ERRCODE 0x800 >>>> +#define VM_INTINFO_RSVD 0x7ffff000 >>>> +#define VM_INTINFO_VALID 0x80000000 >>>> +#define VM_INTINFO_TYPE 0x700 >>>> +#define VM_INTINFO_HWINTR (0 << 8) >>>> +#define VM_INTINFO_NMI (2 << 8) >>>> +#define VM_INTINFO_HWEXCEPTION (3 << 8) >>>> +#define VM_INTINFO_SWINTR (4 << 8) >>>> + >>>> #ifdef _KERNEL >>>> >>>> #define VM_MAX_NAMELEN 32 >>>> @@ -278,14 +289,31 @@ struct vatpit *vm_atpit(struct vm *vm); >>>> int vm_inject_exception(struct vm *vm, int vcpuid, struct vm_exception *vme); >>>> >>>> /* >>>> - * Returns 0 if there is no exception pending for this vcpu. Returns 1 if an >>>> - * exception is pending and also updates 'vme'. The pending exception is >>>> - * cleared when this function returns. >>>> + * This function is called after a VM-exit that occurred during exception or >>>> + * interrupt delivery through the IDT. The format of 'intinfo' is described >>>> + * in Figure 15-1, "EXITINTINFO for All Intercepts", APM, Vol 2. >>>> * >>>> - * This function should only be called in the context of the thread that is >>>> - * executing this vcpu. >>>> + * If a VM-exit handler completes the event delivery successfully then it >>>> + * should call vm_exit_intinfo() to extinguish the pending event. For e.g., >>>> + * if the task switch emulation is triggered via a task gate then it should >>>> + * call this function with 'intinfo=0' to indicate that the external event >>>> + * is not pending anymore. >>>> + * >>>> + * Return value is 0 on success and non-zero on failure. >>>> */ >>>> -int vm_exception_pending(struct vm *vm, int vcpuid, struct vm_exception *vme); >>>> +int vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_t intinfo); >>>> + >>>> +/* >>>> + * This function is called before every VM-entry to retrieve a pending >>>> + * event that should be injected into the guest. This function combines >>>> + * nested events into a double or triple fault. >>>> + * >>>> + * Returns 0 if there are no events that need to be injected into the guest >>>> + * and non-zero otherwise. >>>> + */ >>>> +int vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t *info); >>>> + >>>> +int vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *info1, uint64_t *info2); >>>> >>>> void vm_inject_gp(struct vm *vm, int vcpuid); /* general protection fault */ >>>> void vm_inject_ud(struct vm *vm, int vcpuid); /* undefined instruction fault */ >>>> >>>> Modified: head/sys/amd64/include/vmm_dev.h >>>> ============================================================================== >>>> --- head/sys/amd64/include/vmm_dev.h Sat Jul 19 20:55:13 2014 (r268888) >>>> +++ head/sys/amd64/include/vmm_dev.h Sat Jul 19 20:59:08 2014 (r268889) >>>> @@ -189,6 +189,12 @@ struct vm_cpuset { >>>> #define VM_ACTIVE_CPUS 0 >>>> #define VM_SUSPENDED_CPUS 1 >>>> >>>> +struct vm_intinfo { >>>> + int vcpuid; >>>> + uint64_t info1; >>>> + uint64_t info2; >>>> +}; >>>> + >>>> enum { >>>> /* general routines */ >>>> IOCNUM_ABIVERS = 0, >>>> @@ -211,6 +217,8 @@ enum { >>>> IOCNUM_GET_SEGMENT_DESCRIPTOR = 23, >>>> >>>> /* interrupt injection */ >>>> + IOCNUM_GET_INTINFO = 28, >>>> + IOCNUM_SET_INTINFO = 29, >>>> IOCNUM_INJECT_EXCEPTION = 30, >>>> IOCNUM_LAPIC_IRQ = 31, >>>> IOCNUM_INJECT_NMI = 32, >>>> @@ -324,4 +332,8 @@ enum { >>>> _IOW('v', IOCNUM_ACTIVATE_CPU, struct vm_activate_cpu) >>>> #define VM_GET_CPUS \ >>>> _IOW('v', IOCNUM_GET_CPUSET, struct vm_cpuset) >>>> +#define VM_SET_INTINFO \ >>>> + _IOW('v', IOCNUM_SET_INTINFO, struct vm_intinfo) >>>> +#define VM_GET_INTINFO \ >>>> + _IOWR('v', IOCNUM_GET_INTINFO, struct vm_intinfo) >>>> #endif >>>> >>>> Modified: head/sys/amd64/vmm/intel/vmx.c >>>> ============================================================================== >>>> --- head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:55:13 2014 (r268888) >>>> +++ head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:59:08 2014 (r268889) >>>> @@ -1213,22 +1213,31 @@ vmx_inject_interrupts(struct vmx *vmx, i >>>> { >>>> struct vm_exception exc; >>>> int vector, need_nmi_exiting, extint_pending; >>>> - uint64_t rflags; >>>> + uint64_t rflags, entryinfo; >>>> uint32_t gi, info; >>>> >>>> - if (vm_exception_pending(vmx->vm, vcpu, &exc)) { >>>> - KASSERT(exc.vector >= 0 && exc.vector < 32, >>>> - ("%s: invalid exception vector %d", __func__, exc.vector)); >>>> + if (vm_entry_intinfo(vmx->vm, vcpu, &entryinfo)) { >>>> + KASSERT((entryinfo & VMCS_INTR_VALID) != 0, ("%s: entry " >>>> + "intinfo is not valid: %#lx", __func__, entryinfo)); >>>> >>>> info = vmcs_read(VMCS_ENTRY_INTR_INFO); >>>> KASSERT((info & VMCS_INTR_VALID) == 0, ("%s: cannot inject " >>>> "pending exception %d: %#x", __func__, exc.vector, info)); >>>> >>>> - info = exc.vector | VMCS_INTR_T_HWEXCEPTION | VMCS_INTR_VALID; >>>> - if (exc.error_code_valid) { >>>> - info |= VMCS_INTR_DEL_ERRCODE; >>>> - vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, exc.error_code); >>>> + info = entryinfo; >>>> + vector = info & 0xff; >>>> + if (vector == IDT_BP || vector == IDT_OF) { >>>> + /* >>>> + * VT-x requires #BP and #OF to be injected as software >>>> + * exceptions. >>>> + */ >>>> + info &= ~VMCS_INTR_T_MASK; >>>> + info |= VMCS_INTR_T_SWEXCEPTION; >>>> } >>>> + >>>> + if (info & VMCS_INTR_DEL_ERRCODE) >>>> + vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, entryinfo >> 32); >>>> + >>>> vmcs_write(VMCS_ENTRY_INTR_INFO, info); >>>> } >>>> >>>> @@ -1407,6 +1416,16 @@ vmx_clear_nmi_blocking(struct vmx *vmx, >>>> vmcs_write(VMCS_GUEST_INTERRUPTIBILITY, gi); >>>> } >>>> >>>> +static void >>>> +vmx_assert_nmi_blocking(struct vmx *vmx, int vcpuid) >>>> +{ >>>> + uint32_t gi; >>>> + >>>> + gi = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); >>>> + KASSERT(gi & VMCS_INTERRUPTIBILITY_NMI_BLOCKING, >>>> + ("NMI blocking is not in effect %#x", gi)); >>>> +} >>>> + >>>> static int >>>> vmx_emulate_xsetbv(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) >>>> { >>>> @@ -2050,7 +2069,7 @@ vmx_exit_process(struct vmx *vmx, int vc >>>> struct vm_task_switch *ts; >>>> uint32_t eax, ecx, edx, idtvec_info, idtvec_err, intr_info, inst_info; >>>> uint32_t intr_type, reason; >>>> - uint64_t qual, gpa; >>>> + uint64_t exitintinfo, qual, gpa; >>>> bool retu; >>>> >>>> CTASSERT((PINBASED_CTLS_ONE_SETTING & PINBASED_VIRTUAL_NMI) != 0); >>>> @@ -2070,47 +2089,49 @@ vmx_exit_process(struct vmx *vmx, int vc >>>> * be handled specially by re-injecting the event if the IDT >>>> * vectoring information field's valid bit is set. >>>> * >>>> - * If the VM-exit is due to a task gate in the IDT then we don't >>>> - * reinject the event because emulating the task switch also >>>> - * completes the event delivery. >>>> - * >>>> * See "Information for VM Exits During Event Delivery" in Intel SDM >>>> * for details. >>>> */ >>>> - switch (reason) { >>>> - case EXIT_REASON_EPT_FAULT: >>>> - case EXIT_REASON_EPT_MISCONFIG: >>>> - case EXIT_REASON_APIC_ACCESS: >>>> - case EXIT_REASON_TASK_SWITCH: >>>> - case EXIT_REASON_EXCEPTION: >>>> - idtvec_info = vmcs_idt_vectoring_info(); >>>> - VCPU_CTR2(vmx->vm, vcpu, "vm exit %s: idtvec_info 0x%08x", >>>> - exit_reason_to_str(reason), idtvec_info); >>>> - if ((idtvec_info & VMCS_IDT_VEC_VALID) && >>>> - (reason != EXIT_REASON_TASK_SWITCH)) { >>>> - idtvec_info &= ~(1 << 12); /* clear undefined bit */ >>>> - vmcs_write(VMCS_ENTRY_INTR_INFO, idtvec_info); >>>> - if (idtvec_info & VMCS_IDT_VEC_ERRCODE_VALID) { >>>> - idtvec_err = vmcs_idt_vectoring_err(); >>>> - vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, >>>> - idtvec_err); >>>> - } >>>> - /* >>>> - * If 'virtual NMIs' are being used and the VM-exit >>>> - * happened while injecting an NMI during the previous >>>> - * VM-entry, then clear "blocking by NMI" in the Guest >>>> - * Interruptibility-state. >>>> - */ >>>> - if ((idtvec_info & VMCS_INTR_T_MASK) == >>>> - VMCS_INTR_T_NMI) { >>>> - vmx_clear_nmi_blocking(vmx, vcpu); >>>> - } >>>> + idtvec_info = vmcs_idt_vectoring_info(); >>>> + if (idtvec_info & VMCS_IDT_VEC_VALID) { >>>> + idtvec_info &= ~(1 << 12); /* clear undefined bit */ >>>> + exitintinfo = idtvec_info; >>>> + if (idtvec_info & VMCS_IDT_VEC_ERRCODE_VALID) { >>>> + idtvec_err = vmcs_idt_vectoring_err(); >>>> + exitintinfo |= (uint64_t)idtvec_err << 32; >>>> + } >>>> + error = vm_exit_intinfo(vmx->vm, vcpu, exitintinfo); >>>> + KASSERT(error == 0, ("%s: vm_set_intinfo error %d", >>>> + __func__, error)); >>>> + >>>> + /* >>>> + * If 'virtual NMIs' are being used and the VM-exit >>>> + * happened while injecting an NMI during the previous >>>> + * VM-entry, then clear "blocking by NMI" in the >>>> + * Guest Interruptibility-State so the NMI can be >>>> + * reinjected on the subsequent VM-entry. >>>> + * >>>> + * However, if the NMI was being delivered through a task >>>> + * gate, then the new task must start execution with NMIs >>>> + * blocked so don't clear NMI blocking in this case. >>>> + */ >>>> + intr_type = idtvec_info & VMCS_INTR_T_MASK; >>>> + if (intr_type == VMCS_INTR_T_NMI) { >>>> + if (reason != EXIT_REASON_TASK_SWITCH) >>>> + vmx_clear_nmi_blocking(vmx, vcpu); >>>> + else >>>> + vmx_assert_nmi_blocking(vmx, vcpu); >>>> + } >>>> + >>>> + /* >>>> + * Update VM-entry instruction length if the event being >>>> + * delivered was a software interrupt or software exception. >>>> + */ >>>> + if (intr_type == VMCS_INTR_T_SWINTR || >>>> + intr_type == VMCS_INTR_T_PRIV_SWEXCEPTION || >>>> + intr_type == VMCS_INTR_T_SWEXCEPTION) { >>>> vmcs_write(VMCS_ENTRY_INST_LENGTH, vmexit->inst_length); >>>> } >>>> - break; >>>> - default: >>>> - idtvec_info = 0; >>>> - break; >>>> } >>>> >>>> switch (reason) { >>>> @@ -2136,7 +2157,7 @@ vmx_exit_process(struct vmx *vmx, int vc >>>> */ >>>> if (ts->reason == TSR_IDT_GATE) { >>>> KASSERT(idtvec_info & VMCS_IDT_VEC_VALID, >>>> - ("invalid idtvec_info %x for IDT task switch", >>>> + ("invalid idtvec_info %#x for IDT task switch", >>>> idtvec_info)); >>>> intr_type = idtvec_info & VMCS_INTR_T_MASK; >>>> if (intr_type != VMCS_INTR_T_SWINTR && >>>> @@ -2302,6 +2323,7 @@ vmx_exit_process(struct vmx *vmx, int vc >>>> * the guest. >>>> * >>>> * See "Resuming Guest Software after Handling an Exception". >>>> + * See "Information for VM Exits Due to Vectored Events". >>>> */ >>>> if ((idtvec_info & VMCS_IDT_VEC_VALID) == 0 && >>>> (intr_info & 0xff) != IDT_DF && >>>> @@ -2519,6 +2541,13 @@ vmx_run(void *arg, int vcpu, register_t >>>> * pmap_invalidate_ept(). >>>> */ >>>> disable_intr(); >>>> + vmx_inject_interrupts(vmx, vcpu, vlapic); >>>> + >>>> + /* >>>> + * Check for vcpu suspension after injecting events because >>>> + * vmx_inject_interrupts() can suspend the vcpu due to a >>>> + * triple fault. >>>> + */ >>>> if (vcpu_suspended(suspend_cookie)) { >>>> enable_intr(); >>>> vm_exit_suspended(vmx->vm, vcpu, vmcs_guest_rip()); >>>> @@ -2539,7 +2568,6 @@ vmx_run(void *arg, int vcpu, register_t >>>> break; >>>> } >>>> >>>> - vmx_inject_interrupts(vmx, vcpu, vlapic); >>>> vmx_run_trace(vmx, vcpu); >>>> rc = vmx_enter_guest(vmxctx, vmx, launched); >>>> >>>> >>>> Modified: head/sys/amd64/vmm/vmm.c >>>> ============================================================================== >>>> --- head/sys/amd64/vmm/vmm.c Sat Jul 19 20:55:13 2014 (r268888) >>>> +++ head/sys/amd64/vmm/vmm.c Sat Jul 19 20:59:08 2014 (r268889) >>>> @@ -97,6 +97,7 @@ struct vcpu { >>>> int hostcpu; /* (o) vcpu's host cpu */ >>>> struct vlapic *vlapic; /* (i) APIC device model */ >>>> enum x2apic_state x2apic_state; /* (i) APIC mode */ >>>> + uint64_t exitintinfo; /* (i) events pending at VM exit */ >>>> int nmi_pending; /* (i) NMI pending */ >>>> int extint_pending; /* (i) INTR pending */ >>>> struct vm_exception exception; /* (x) exception collateral */ >>>> @@ -241,6 +242,7 @@ vcpu_init(struct vm *vm, int vcpu_id, bo >>>> >>>> vcpu->vlapic = VLAPIC_INIT(vm->cookie, vcpu_id); >>>> vm_set_x2apic_state(vm, vcpu_id, X2APIC_DISABLED); >>>> + vcpu->exitintinfo = 0; >>>> vcpu->nmi_pending = 0; >>>> vcpu->extint_pending = 0; >>>> vcpu->exception_pending = 0; >>>> @@ -1458,6 +1460,202 @@ restart: >>>> } >>>> >>>> int >>>> +vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_t info) >>>> +{ >>>> + struct vcpu *vcpu; >>>> + int type, vector; >>>> + >>>> + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) >>>> + return (EINVAL); >>>> + >>>> + vcpu = &vm->vcpu[vcpuid]; >>>> + >>>> + if (info & VM_INTINFO_VALID) { >>>> + type = info & VM_INTINFO_TYPE; >>>> + vector = info & 0xff; >>>> + if (type == VM_INTINFO_NMI && vector != IDT_NMI) >>>> + return (EINVAL); >>>> + if (type == VM_INTINFO_HWEXCEPTION && vector >= 32) >>>> + return (EINVAL); >>>> + if (info & VM_INTINFO_RSVD) >>>> + return (EINVAL); >>>> + } else { >>>> + info = 0; >>>> + } >>>> + VCPU_CTR2(vm, vcpuid, "%s: info1(%#lx)", __func__, info); >>>> + vcpu->exitintinfo = info; >>>> + return (0); >>>> +} >>>> + >>>> +enum exc_class { >>>> + EXC_BENIGN, >>>> + EXC_CONTRIBUTORY, >>>> + EXC_PAGEFAULT >>>> +}; >>>> + >>>> +#define IDT_VE 20 /* Virtualization Exception (Intel specific) */ >>>> + >>>> +static enum exc_class >>>> +exception_class(uint64_t info) >>>> +{ >>>> + int type, vector; >>>> + >>>> + KASSERT(info & VM_INTINFO_VALID, ("intinfo must be valid: %#lx", info)); >>>> + type = info & VM_INTINFO_TYPE; >>>> + vector = info & 0xff; >>>> + >>>> + /* Table 6-4, "Interrupt and Exception Classes", Intel SDM, Vol 3 */ >>>> + switch (type) { >>>> + case VM_INTINFO_HWINTR: >>>> + case VM_INTINFO_SWINTR: >>>> + case VM_INTINFO_NMI: >>>> + return (EXC_BENIGN); >>>> + default: >>>> + /* >>>> + * Hardware exception. >>>> + * >>>> + * SVM and VT-x use identical type values to represent NMI, >>>> + * hardware interrupt and software interrupt. >>>> + * >>>> + * SVM uses type '3' for all exceptions. VT-x uses type '3' >>>> + * for exceptions except #BP and #OF. #BP and #OF use a type >>>> + * value of '5' or '6'. Therefore we don't check for explicit >>>> + * values of 'type' to classify 'intinfo' into a hardware >>>> + * exception. >>>> + */ >>>> + break; >>>> + } >>>> + >>>> + switch (vector) { >>>> + case IDT_PF: >>>> + case IDT_VE: >>>> + return (EXC_PAGEFAULT); >>>> + case IDT_DE: >>>> + case IDT_TS: >>>> + case IDT_NP: >>>> + case IDT_SS: >>>> + case IDT_GP: >>>> + return (EXC_CONTRIBUTORY); >>>> + default: >>>> + return (EXC_BENIGN); >>>> + } >>>> +} >>>> + >>>> +static int >>>> +nested_fault(struct vm *vm, int vcpuid, uint64_t info1, uint64_t info2, >>>> + uint64_t *retinfo) >>>> +{ >>>> + enum exc_class exc1, exc2; >>>> + int type1, vector1; >>>> + >>>> + KASSERT(info1 & VM_INTINFO_VALID, ("info1 %#lx is not valid", info1)); >>>> + KASSERT(info2 & VM_INTINFO_VALID, ("info2 %#lx is not valid", info2)); >>>> + >>>> + /* >>>> + * If an exception occurs while attempting to call the double-fault >>>> + * handler the processor enters shutdown mode (aka triple fault). >>>> + */ >>>> + type1 = info1 & VM_INTINFO_TYPE; >>>> + vector1 = info1 & 0xff; >>>> + if (type1 == VM_INTINFO_HWEXCEPTION && vector1 == IDT_DF) { >>>> + VCPU_CTR2(vm, vcpuid, "triple fault: info1(%#lx), info2(%#lx)", >>>> + info1, info2); >>>> + vm_suspend(vm, VM_SUSPEND_TRIPLEFAULT); >>>> + *retinfo = 0; >>>> + return (0); >>>> + } >>>> + >>>> + /* >>>> + * Table 6-5 "Conditions for Generating a Double Fault", Intel SDM, Vol3 >>>> + */ >>>> + exc1 = exception_class(info1); >>>> + exc2 = exception_class(info2); >>>> + if ((exc1 == EXC_CONTRIBUTORY && exc2 == EXC_CONTRIBUTORY) || >>>> + (exc1 == EXC_PAGEFAULT && exc2 != EXC_BENIGN)) { >>>> + /* Convert nested fault into a double fault. */ >>>> + *retinfo = IDT_DF; >>>> + *retinfo |= VM_INTINFO_VALID | VM_INTINFO_HWEXCEPTION; >>>> + *retinfo |= VM_INTINFO_DEL_ERRCODE; >>>> + } else { >>>> + /* Handle exceptions serially */ >>>> + *retinfo = info2; >>>> + } >>>> + return (1); >>>> +} >>>> + >>>> +static uint64_t >>>> +vcpu_exception_intinfo(struct vcpu *vcpu) >>>> +{ >>>> + uint64_t info = 0; >>>> + >>>> + if (vcpu->exception_pending) { >>>> + info = vcpu->exception.vector & 0xff; >>>> + info |= VM_INTINFO_VALID | VM_INTINFO_HWEXCEPTION; >>>> + if (vcpu->exception.error_code_valid) { >>>> + info |= VM_INTINFO_DEL_ERRCODE; >>>> + info |= (uint64_t)vcpu->exception.error_code << 32; >>>> + } >>>> + } >>>> + return (info); >>>> +} >>>> + >>>> +int >>>> +vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t *retinfo) >>>> +{ >>>> + struct vcpu *vcpu; >>>> + uint64_t info1, info2; >>>> + int valid; >>>> + >>>> + KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, ("invalid vcpu %d", vcpuid)); >>>> + >>>> + vcpu = &vm->vcpu[vcpuid]; >>>> + >>>> + info1 = vcpu->exitintinfo; >>>> + vcpu->exitintinfo = 0; >>>> + >>>> + info2 = 0; >>>> + if (vcpu->exception_pending) { >>>> + info2 = vcpu_exception_intinfo(vcpu); >>>> + vcpu->exception_pending = 0; >>>> + VCPU_CTR2(vm, vcpuid, "Exception %d delivered: %#lx", >>>> + vcpu->exception.vector, info2); >>>> + } >>>> + >>>> + if ((info1 & VM_INTINFO_VALID) && (info2 & VM_INTINFO_VALID)) { >>>> + valid = nested_fault(vm, vcpuid, info1, info2, retinfo); >>>> + } else if (info1 & VM_INTINFO_VALID) { >>>> + *retinfo = info1; >>>> + valid = 1; >>>> + } else if (info2 & VM_INTINFO_VALID) { >>>> + *retinfo = info2; >>>> + valid = 1; >>>> + } else { >>>> + valid = 0; >>>> + } >>>> + >>>> + if (valid) { >>>> + VCPU_CTR4(vm, vcpuid, "%s: info1(%#lx), info2(%#lx), " >>>> + "retinfo(%#lx)", __func__, info1, info2, *retinfo); >>>> + } >>>> + >>>> + return (valid); >>>> +} >>>> + >>>> +int >>>> +vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *info1, uint64_t *info2) >>>> +{ >>>> + struct vcpu *vcpu; >>>> + >>>> + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) >>>> + return (EINVAL); >>>> + >>>> + vcpu = &vm->vcpu[vcpuid]; >>>> + *info1 = vcpu->exitintinfo; >>>> + *info2 = vcpu_exception_intinfo(vcpu); >>>> + return (0); >>>> +} >>>> + >>>> +int >>>> vm_inject_exception(struct vm *vm, int vcpuid, struct vm_exception *exception) >>>> { >>>> struct vcpu *vcpu; >>>> @@ -1468,6 +1666,14 @@ vm_inject_exception(struct vm *vm, int v >>>> if (exception->vector < 0 || exception->vector >= 32) >>>> return (EINVAL); >>>> >>>> + /* >>>> + * A double fault exception should never be injected directly into >>>> + * the guest. It is a derived exception that results from specific >>>> + * combinations of nested faults. >>>> + */ >>>> + if (exception->vector == IDT_DF) >>>> + return (EINVAL); >>>> + >>>> vcpu = &vm->vcpu[vcpuid]; >>>> >>>> if (vcpu->exception_pending) { >>>> @@ -1483,25 +1689,6 @@ vm_inject_exception(struct vm *vm, int v >>>> return (0); >>>> } >>>> >>>> -int >>>> -vm_exception_pending(struct vm *vm, int vcpuid, struct vm_exception *exception) >>>> -{ >>>> - struct vcpu *vcpu; >>>> - int pending; >>>> - >>>> - KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, ("invalid vcpu %d", vcpuid)); >>>> - >>>> - vcpu = &vm->vcpu[vcpuid]; >>>> - pending = vcpu->exception_pending; >>>> - if (pending) { >>>> - vcpu->exception_pending = 0; >>>> - *exception = vcpu->exception; >>>> - VCPU_CTR1(vm, vcpuid, "Exception %d delivered", >>>> - exception->vector); >>>> - } >>>> - return (pending); >>>> -} >>>> - >>>> static void >>>> vm_inject_fault(struct vm *vm, int vcpuid, struct vm_exception *exception) >>>> { >>>> >>>> Modified: head/sys/amd64/vmm/vmm_dev.c >>>> ============================================================================== >>>> --- head/sys/amd64/vmm/vmm_dev.c Sat Jul 19 20:55:13 2014 (r268888) >>>> +++ head/sys/amd64/vmm/vmm_dev.c Sat Jul 19 20:59:08 2014 (r268889) >>>> @@ -173,6 +173,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c >>>> struct vm_gla2gpa *gg; >>>> struct vm_activate_cpu *vac; >>>> struct vm_cpuset *vm_cpuset; >>>> + struct vm_intinfo *vmii; >>>> >>>> sc = vmmdev_lookup2(cdev); >>>> if (sc == NULL) >>>> @@ -199,6 +200,8 @@ vmmdev_ioctl(struct cdev *cdev, u_long c >>>> case VM_SET_X2APIC_STATE: >>>> case VM_GLA2GPA: >>>> case VM_ACTIVATE_CPU: >>>> + case VM_SET_INTINFO: >>>> + case VM_GET_INTINFO: >>>> /* >>>> * XXX fragile, handle with care >>>> * Assumes that the first field of the ioctl data is the vcpu. >>>> @@ -470,6 +473,15 @@ vmmdev_ioctl(struct cdev *cdev, u_long c >>>> error = copyout(cpuset, vm_cpuset->cpus, size); >>>> free(cpuset, M_TEMP); >>>> break; >>>> + case VM_SET_INTINFO: >>>> + vmii = (struct vm_intinfo *)data; >>>> + error = vm_exit_intinfo(sc->vm, vmii->vcpuid, vmii->info1); >>>> + break; >>>> + case VM_GET_INTINFO: >>>> + vmii = (struct vm_intinfo *)data; >>>> + error = vm_get_intinfo(sc->vm, vmii->vcpuid, &vmii->info1, >>>> + &vmii->info2); >>>> + break; >>>> default: >>>> error = ENOTTY; >>>> break; >>>> >>>> Modified: head/usr.sbin/bhyve/bhyverun.c >>>> ============================================================================== >>>> --- head/usr.sbin/bhyve/bhyverun.c Sat Jul 19 20:55:13 2014 (r268888) >>>> +++ head/usr.sbin/bhyve/bhyverun.c Sat Jul 19 20:59:08 2014 (r268889) >>>> @@ -534,6 +534,8 @@ vmexit_suspend(struct vmctx *ctx, struct >>>> exit(1); >>>> case VM_SUSPEND_HALT: >>>> exit(2); >>>> + case VM_SUSPEND_TRIPLEFAULT: >>>> + exit(3); >>>> default: >>>> fprintf(stderr, "vmexit_suspend: invalid reason %d\n", how); >>>> exit(100); >>>> >>>> Modified: head/usr.sbin/bhyve/task_switch.c >>>> ============================================================================== >>>> --- head/usr.sbin/bhyve/task_switch.c Sat Jul 19 20:55:13 2014 (r268888) >>>> +++ head/usr.sbin/bhyve/task_switch.c Sat Jul 19 20:59:08 2014 (r268889) >>>> @@ -904,10 +904,14 @@ vmexit_task_switch(struct vmctx *ctx, st >>>> */ >>>> >>>> /* >>>> - * XXX is the original task switch was triggered by a hardware >>>> - * exception then do we generate a double-fault if we encounter >>>> - * an exception during the task switch? >>>> + * If the task switch was triggered by an event delivered through >>>> + * the IDT then extinguish the pending event from the vcpu's >>>> + * exitintinfo. >>>> */ >>>> + if (task_switch->reason == TSR_IDT_GATE) { >>>> + error = vm_set_intinfo(ctx, vcpu, 0); >>>> + assert(error == 0); >>>> + } >>>> >>>> /* >>>> * XXX should inject debug exception if 'T' bit is 1 >>>> >>>> Modified: head/usr.sbin/bhyvectl/bhyvectl.c >>>> ============================================================================== >>>> --- head/usr.sbin/bhyvectl/bhyvectl.c Sat Jul 19 20:55:13 2014 (r268888) >>>> +++ head/usr.sbin/bhyvectl/bhyvectl.c Sat Jul 19 20:59:08 2014 (r268889) >>>> @@ -195,7 +195,8 @@ usage(void) >>>> " [--force-reset]\n" >>>> " [--force-poweroff]\n" >>>> " [--get-active-cpus]\n" >>>> - " [--get-suspended-cpus]\n", >>>> + " [--get-suspended-cpus]\n" >>>> + " [--get-intinfo]\n", >>>> progname); >>>> exit(1); >>>> } >>>> @@ -205,6 +206,7 @@ static int inject_nmi, assert_lapic_lvt; >>>> static int force_reset, force_poweroff; >>>> static const char *capname; >>>> static int create, destroy, get_lowmem, get_highmem; >>>> +static int get_intinfo; >>>> static int get_active_cpus, get_suspended_cpus; >>>> static uint64_t memsize; >>>> static int set_cr0, get_cr0, set_cr3, get_cr3, set_cr4, get_cr4; >>>> @@ -412,6 +414,37 @@ print_cpus(const char *banner, const cpu >>>> printf("\n"); >>>> } >>>> >>>> +static void >>>> +print_intinfo(const char *banner, uint64_t info) >>>> +{ >>>> + int type; >>>> + >>>> + printf("%s:\t", banner); >>>> + if (info & VM_INTINFO_VALID) { >>>> + type = info & VM_INTINFO_TYPE; >>>> + switch (type) { >>>> + case VM_INTINFO_HWINTR: >>>> + printf("extint"); >>>> + break; >>>> + case VM_INTINFO_NMI: >>>> + printf("nmi"); >>>> + break; >>>> + case VM_INTINFO_SWINTR: >>>> + printf("swint"); >>>> + break; >>>> + default: >>>> + printf("exception"); >>>> + break; >>>> + } >>>> + printf(" vector %d", (int)VM_INTINFO_VECTOR(info)); >>>> + if (info & VM_INTINFO_DEL_ERRCODE) >>>> + printf(" errcode %#x", (u_int)(info >> 32)); >>>> + } else { >>>> + printf("n/a"); >>>> + } >>>> + printf("\n"); >>>> +} >>>> + >>>> int >>>> main(int argc, char *argv[]) >>>> { >>>> @@ -420,7 +453,7 @@ main(int argc, char *argv[]) >>>> vm_paddr_t gpa, gpa_pmap; >>>> size_t len; >>>> struct vm_exit vmexit; >>>> - uint64_t ctl, eptp, bm, addr, u64, pteval[4], *pte; >>>> + uint64_t ctl, eptp, bm, addr, u64, pteval[4], *pte, info[2]; >>>> struct vmctx *ctx; >>>> int wired; >>>> cpuset_t cpus; >>>> @@ -595,6 +628,7 @@ main(int argc, char *argv[]) >>>> { "force-poweroff", NO_ARG, &force_poweroff, 1 }, >>>> { "get-active-cpus", NO_ARG, &get_active_cpus, 1 }, >>>> { "get-suspended-cpus", NO_ARG, &get_suspended_cpus, 1 }, >>>> + { "get-intinfo", NO_ARG, &get_intinfo, 1 }, >>>> { NULL, 0, NULL, 0 } >>>> }; >>>> >>>> @@ -1566,6 +1600,14 @@ main(int argc, char *argv[]) >>>> print_cpus("suspended cpus", &cpus); >>>> } >>>> >>>> + if (!error && (get_intinfo || get_all)) { >>>> + error = vm_get_intinfo(ctx, vcpu, &info[0], &info[1]); >>>> + if (!error) { >>>> + print_intinfo("pending", info[0]); >>>> + print_intinfo("current", info[1]); >>>> + } >>>> + } >>>> + >>>> if (!error && run) { >>>> error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RIP, &rip); >>>> assert(error == 0); >>>> From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 08:43:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38B78F89; Sun, 20 Jul 2014 08:43:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 259C12FE0; Sun, 20 Jul 2014 08:43:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K8hsji017328; Sun, 20 Jul 2014 08:43:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K8hsAW017327; Sun, 20 Jul 2014 08:43:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407200843.s6K8hsAW017327@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 Jul 2014 08:43:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268917 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 08:43:54 -0000 Author: adrian Date: Sun Jul 20 08:43:53 2014 New Revision: 268917 URL: http://svnweb.freebsd.org/changeset/base/268917 Log: Add the UDP hash -> RSS mbuf hash type for the ixgbe(4) driver. Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sun Jul 20 07:45:48 2014 (r268916) +++ head/sys/dev/ixgbe/ixgbe.c Sun Jul 20 08:43:53 2014 (r268917) @@ -4745,12 +4745,15 @@ ixgbe_rxeof(struct ix_queue *que) case IXGBE_RXDADV_RSSTYPE_IPV6_TCP_EX: M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_TCP_IPV6_EX); break; - /* XXX no UDP support in RSS just yet */ -#ifdef notyet - case IGXBE_RXDADV_RSSTYPE_IPV4_UDP: - case IGXBE_RXDADV_RSSTYPE_IPV6_UDP: - case IGXBE_RXDADV_RSSTYPE_IPV6_UDP_EX: -#endif /* notyet */ + case IXGBE_RXDADV_RSSTYPE_IPV4_UDP: + M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_UDP_IPV4); + break; + case IXGBE_RXDADV_RSSTYPE_IPV6_UDP: + M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_UDP_IPV6); + break; + case IXGBE_RXDADV_RSSTYPE_IPV6_UDP_EX: + M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_UDP_IPV6_EX); + break; default: /* XXX fallthrough */ M_HASHTYPE_SET(sendmp, M_HASHTYPE_NONE); From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 08:53:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6AA01FF; Sun, 20 Jul 2014 08:53:08 +0000 (UTC) Received: from smtp2.wemm.org (smtp2.wemm.org [192.203.228.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8755820AD; Sun, 20 Jul 2014 08:53:08 +0000 (UTC) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 2C76B917; Sun, 20 Jul 2014 01:53:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1405846388; bh=AzuITOY834ZmwOGO9zGTAHeMS6PUagj92jKPNcpeVrM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BBZoeP+E9KhDfee7E3mDhrvfiZS+Rk5vy8nFtMD8mSQ+1ID88IZ8evSTcaYgxWY48 IvLg26g4z5fMP8IQo3yO7ty9VUp2SPNibMiifPDWDThZd74VBN15QiCojWUsbNLlYz Vu5ADYWz/cZ7lmh1MhH2FzXZ5OtipqoEh69adv0g= From: Peter Wemm To: Benjamin Kaduk Subject: Re: svn commit: r268827 - head/usr.sbin/ndp Date: Sun, 20 Jul 2014 01:53:03 -0700 Message-ID: <3782322.IFK7GnHDGh@overcee.wemm.org> User-Agent: KMail/4.12.5 (FreeBSD/11.0-CURRENT; KDE/4.12.5; amd64; ; ) In-Reply-To: References: <201407180648.s6I6m2U7075749@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1766375.Jl0GEnxtpW"; micalg="pgp-sha1"; protocol="application/pgp-signature" Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Peter Wemm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 08:53:08 -0000 --nextPart1766375.Jl0GEnxtpW Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Friday 18 July 2014 10:35:33 Benjamin Kaduk wrote: > On Fri, Jul 18, 2014 at 2:48 AM, Peter Wemm wrote= : > > Author: peter > > Date: Fri Jul 18 06:48:02 2014 > > New Revision: 268827 > > URL: http://svnweb.freebsd.org/changeset/base/268827 > >=20 > > Log: > > Fix "ndp -d hostname". >=20 > MFC? >=20 > -Ben It is not broken in 10.x or earlier, so no. =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart1766375.Jl0GEnxtpW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABAgAGBQJTy4NzAAoJEDXWlwnsgJ4EXewIALe75+z00TH7BXmP6ex7HiOu 5lgbSj/tvMBxsZ6f11GPx8Zo9BcnWZVtokCCyNu13p90fMiTs8Mg6VRgl46qJ5r2 XCC9UZbHWIiSPVLXhKV9CwM5A2AaChfVnG/E/VTdw6pK/o0JM4tYNJpUpikBwa/i 3x5H5ZeVV38+WVffbyk3mHcFbeZJm5cEDqjZ92CTACy8GLCPGwuLn1N49NqchDUM 0gxkGLaoDor/xp7JgVPGNA86051ZK4/jHmBDcJ5PYX9Sv8YXvjnLFvf3pOaMPKqf IkvVzoGXdv0LOn+/uJjjMzlN6HddruGHFPJaYKw146BoPKtobtS5ywpWYQ3qN2s= =tPWa -----END PGP SIGNATURE----- --nextPart1766375.Jl0GEnxtpW-- From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 10:54:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2368E581; Sun, 20 Jul 2014 10:54:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D1AC28C4; Sun, 20 Jul 2014 10:54:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KAsjQh079345; Sun, 20 Jul 2014 10:54:45 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KAsjUZ079344; Sun, 20 Jul 2014 10:54:45 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407201054.s6KAsjUZ079344@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 20 Jul 2014 10:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268918 - stable/10/usr.sbin/pkg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 10:54:46 -0000 Author: bapt Date: Sun Jul 20 10:54:45 2014 New Revision: 268918 URL: http://svnweb.freebsd.org/changeset/base/268918 Log: MFC: r263650, r263686 Add missing dependency on libm Modified: stable/10/usr.sbin/pkg/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pkg/Makefile ============================================================================== --- stable/10/usr.sbin/pkg/Makefile Sun Jul 20 08:43:53 2014 (r268917) +++ stable/10/usr.sbin/pkg/Makefile Sun Jul 20 10:54:45 2014 (r268918) @@ -7,8 +7,8 @@ MAN= pkg.7 CFLAGS+=-I${.CURDIR}/../../contrib/libucl/include .PATH: ${.CURDIR}/../../contrib/libucl/include DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBUCL} ${LIBSBUF} ${LIBSSL} \ - ${LIBCRYPTO} -LDADD= -larchive -lelf -lfetch -lucl -lsbuf -lssl -lcrypto + ${LIBCRYPTO} ${LIBM} +LDADD= -larchive -lelf -lfetch -lucl -lsbuf -lssl -lcrypto -lm USEPRIVATELIB= ucl .include From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 11:00:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A31D575A; Sun, 20 Jul 2014 11:00:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F1E628EB; Sun, 20 Jul 2014 11:00:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KB0pHI081440; Sun, 20 Jul 2014 11:00:51 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KB0pR0081439; Sun, 20 Jul 2014 11:00:51 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407201100.s6KB0pR0081439@svn.freebsd.org> From: Baptiste Daroussin Date: Sun, 20 Jul 2014 11:00:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r268919 - stable/9/usr.sbin/pkg X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 11:00:51 -0000 Author: bapt Date: Sun Jul 20 11:00:51 2014 New Revision: 268919 URL: http://svnweb.freebsd.org/changeset/base/268919 Log: MFC: r263650, r263686 Add missing dependency on libm Modified: stable/9/usr.sbin/pkg/Makefile Directory Properties: stable/9/usr.sbin/pkg/ (props changed) Modified: stable/9/usr.sbin/pkg/Makefile ============================================================================== --- stable/9/usr.sbin/pkg/Makefile Sun Jul 20 10:54:45 2014 (r268918) +++ stable/9/usr.sbin/pkg/Makefile Sun Jul 20 11:00:51 2014 (r268919) @@ -7,8 +7,8 @@ MAN= pkg.7 CFLAGS+=-I${.CURDIR}/../../contrib/libucl/include .PATH: ${.CURDIR}/../../contrib/libucl/include DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBUCL} ${LIBSBUF} ${LIBSSL} \ - ${LIBCRYPTO} -LDADD= -larchive -lelf -lfetch -lucl -lsbuf -lssl -lcrypto + ${LIBCRYPTO} ${LIBM} +LDADD= -larchive -lelf -lfetch -lucl -lsbuf -lssl -lcrypto -lm USEPRIVATELIB= ucl .include From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 11:08:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 107808FE; Sun, 20 Jul 2014 11:08:40 +0000 (UTC) Received: from mail-wi0-x22b.google.com (mail-wi0-x22b.google.com [IPv6:2a00:1450:400c:c05::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 04F88299E; Sun, 20 Jul 2014 11:08:38 +0000 (UTC) Received: by mail-wi0-f171.google.com with SMTP id hi2so2775427wib.16 for ; Sun, 20 Jul 2014 04:08:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=hUwdBCFPuv/I1c49jfw8uVbtyJaUVsRqIfPyHSDdWIw=; b=1G0rbW8oexxXATtn1xqFfqMd80SUtMqfOzM09KoDmQDWuzW8Iit4ivWWyMhX/8DeLQ XV8jXFRKikUEtMQSNJ1Qe8e1BaRvAEN80KQD+SXs0yNqvAXIPYhwaQQbstoEaR2mzcmM qm33tBaZu+xE9TL8uIbNaki4ALYaaeCmEIGhIkobvsrgGPwB6DXhn0e2KLQ/6LItlKnc iEbTxvLPctrV6d3rw0cQwbRAquSW/n+doXuQGl/DmOdzQwhJzTr/gJZY+FzbQJVlqCGQ Bx1wknTMxRyb2lHIOAqokWu51pBJhEYWskEDdxQKhpl6vG52dJ6h6Vtz/4rpn6gprBN9 y/Zg== X-Received: by 10.194.90.201 with SMTP id by9mr12299073wjb.94.1405854517226; Sun, 20 Jul 2014 04:08:37 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id pl1sm6855032wic.17.2014.07.20.04.08.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Jul 2014 04:08:36 -0700 (PDT) Sender: Baptiste Daroussin Date: Sun, 20 Jul 2014 13:08:34 +0200 From: Baptiste Daroussin To: Andrey Chernov Subject: Re: svn commit: r268896 - in stable/10: contrib/libucl contrib/libucl/cmake contrib/libucl/doc contrib/libucl/include contrib/libucl/src contrib/libucl/tests contrib/libucl/tests/basic contrib/libucl/t... Message-ID: <20140720110834.GC26778@ivaldir.etoilebsd.net> References: <201407192344.s6JNiwhg052804@svn.freebsd.org> <53CB3760.5050008@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9Ek0hoCL9XbhcSqy" Content-Disposition: inline In-Reply-To: <53CB3760.5050008@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 11:08:40 -0000 --9Ek0hoCL9XbhcSqy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 20, 2014 at 07:28:32AM +0400, Andrey Chernov wrote: > On 20.07.2014 3:44, Baptiste Daroussin wrote: > > Adapt pkg(7) to the new libucl API >=20 this is fixed, sorry about, I forgot 2 ci in this MFC Bapt --9Ek0hoCL9XbhcSqy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlPLozIACgkQ8kTtMUmk6ExGswCfZABXAC4ntD341nwvxTv3aSof x4QAni37hbMBFjMH/afhimLtcLmB61yh =rm7E -----END PGP SIGNATURE----- --9Ek0hoCL9XbhcSqy-- From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 12:06:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55E58A92; Sun, 20 Jul 2014 12:06:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AAAB2E01; Sun, 20 Jul 2014 12:06:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KC6rtf013339; Sun, 20 Jul 2014 12:06:53 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KC6q37013335; Sun, 20 Jul 2014 12:06:52 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201407201206.s6KC6q37013335@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 20 Jul 2014 12:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268920 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 12:06:53 -0000 Author: jilles Date: Sun Jul 20 12:06:52 2014 New Revision: 268920 URL: http://svnweb.freebsd.org/changeset/base/268920 Log: sh: Remove prefix() function. Use strncmp() instead. Modified: head/bin/sh/exec.c head/bin/sh/jobs.c head/bin/sh/mystring.c head/bin/sh/mystring.h Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Sun Jul 20 11:00:51 2014 (r268919) +++ head/bin/sh/exec.c Sun Jul 20 12:06:52 2014 (r268920) @@ -365,7 +365,7 @@ find_command(const char *name, struct cm for (;(fullname = padvance(&path, name)) != NULL; stunalloc(fullname)) { idx++; if (pathopt) { - if (prefix("func", pathopt)) { + if (strncmp(pathopt, "func", 4) == 0) { /* handled below */ } else { continue; /* ignore unimplemented options */ Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sun Jul 20 11:00:51 2014 (r268919) +++ head/bin/sh/jobs.c Sun Jul 20 12:06:52 2014 (r268920) @@ -562,6 +562,7 @@ getjob_nonotfound(const char *name) { int jobno; struct job *found, *jp; + size_t namelen; pid_t pid; int i; @@ -603,10 +604,12 @@ currentjob: if ((jp = getcurjob(NULL)) = if (found != NULL) return (found); } else { + namelen = strlen(name); found = NULL; for (jp = jobtab, i = njobs ; --i >= 0 ; jp++) { if (jp->used && jp->nprocs > 0 - && prefix(name + 1, jp->ps[0].cmd)) { + && strncmp(jp->ps[0].cmd, name + 1, + namelen - 1) == 0) { if (found) error("%s: ambiguous", name); found = jp; Modified: head/bin/sh/mystring.c ============================================================================== --- head/bin/sh/mystring.c Sun Jul 20 11:00:51 2014 (r268919) +++ head/bin/sh/mystring.c Sun Jul 20 12:06:52 2014 (r268920) @@ -61,21 +61,6 @@ char nullstr[1]; /* zero length string /* - * prefix -- see if pfx is a prefix of string. - */ - -int -prefix(const char *pfx, const char *string) -{ - while (*pfx) { - if (*pfx++ != *string++) - return 0; - } - return 1; -} - - -/* * Convert a string of digits to an integer, printing an error message on * failure. */ Modified: head/bin/sh/mystring.h ============================================================================== --- head/bin/sh/mystring.h Sun Jul 20 11:00:51 2014 (r268919) +++ head/bin/sh/mystring.h Sun Jul 20 12:06:52 2014 (r268920) @@ -35,7 +35,6 @@ #include -int prefix(const char *, const char *); int number(const char *); int is_number(const char *); From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 14:24:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 704B92E5; Sun, 20 Jul 2014 14:24:04 +0000 (UTC) Received: from fep12.mx.upcmail.net (fep12.mx.upcmail.net [62.179.121.32]) by mx1.freebsd.org (Postfix) with ESMTP id 4902C2824; Sun, 20 Jul 2014 14:24:02 +0000 (UTC) Received: from edge04.upcmail.net ([192.168.13.239]) by viefep12-int.chello.at (InterMail vM.8.01.05.13 201-2260-151-135-20130320) with ESMTP id <20140720142355.YCGR63670.viefep12-int.chello.at@edge04.upcmail.net>; Sun, 20 Jul 2014 16:23:55 +0200 Received: from mole.fafoe.narf.at ([80.109.55.137]) by edge04.upcmail.net with edge id UePu1o00p2xdvHc03ePuB6; Sun, 20 Jul 2014 16:23:55 +0200 X-SourceIP: 80.109.55.137 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id 77AF36D40D; Sun, 20 Jul 2014 16:23:54 +0200 (CEST) Date: Sun, 20 Jul 2014 16:23:54 +0200 From: Stefan Farfeleder To: Neel Natu Subject: Re: svn commit: r268889 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve usr.sbin/bhyvectl Message-ID: <20140720142354.GA1205@mole.fafoe.narf.at> References: <201407192059.s6JKx8un072543@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201407192059.s6JKx8un072543@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 14:24:04 -0000 Hi, On Sat, Jul 19, 2014 at 08:59:08PM +0000, Neel Natu wrote: > Author: neel > Date: Sat Jul 19 20:59:08 2014 > New Revision: 268889 > URL: http://svnweb.freebsd.org/changeset/base/268889 > Modified: head/sys/amd64/vmm/intel/vmx.c > ============================================================================== > --- head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:55:13 2014 (r268888) > +++ head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:59:08 2014 (r268889) > @@ -1213,22 +1213,31 @@ vmx_inject_interrupts(struct vmx *vmx, i > { > struct vm_exception exc; > int vector, need_nmi_exiting, extint_pending; > - uint64_t rflags; > + uint64_t rflags, entryinfo; > uint32_t gi, info; > > - if (vm_exception_pending(vmx->vm, vcpu, &exc)) { > - KASSERT(exc.vector >= 0 && exc.vector < 32, > - ("%s: invalid exception vector %d", __func__, exc.vector)); > + if (vm_entry_intinfo(vmx->vm, vcpu, &entryinfo)) { > + KASSERT((entryinfo & VMCS_INTR_VALID) != 0, ("%s: entry " > + "intinfo is not valid: %#lx", __func__, entryinfo)); > > info = vmcs_read(VMCS_ENTRY_INTR_INFO); > KASSERT((info & VMCS_INTR_VALID) == 0, ("%s: cannot inject " > "pending exception %d: %#x", __func__, exc.vector, info)); > /usr/src/sys/modules/vmm/../../amd64/vmm/intel/vmx.c:1214:22: error: unused variable 'exc' [-Werror,-Wunused-variable] struct vm_exception exc; ^ 1 error generated. Printing the uninitialised object in the KASSERT is most probably wrong. BR, Stefan From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 14:31:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 705DC741; Sun, 20 Jul 2014 14:31:15 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49180290C; Sun, 20 Jul 2014 14:31:15 +0000 (UTC) Received: from pippin.baldwin.cx (75-48-77-17.lightspeed.cncrca.sbcglobal.net [75.48.77.17]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 31193B968; Sun, 20 Jul 2014 10:31:14 -0400 (EDT) From: John Baldwin To: Don Lewis Subject: Re: svn commit: r268780 - in head: share/man/man9 sys/kern sys/sys Date: Sat, 19 Jul 2014 12:37:22 -0400 Message-ID: <3826918.4Hm7dJqFvt@pippin.baldwin.cx> User-Agent: KMail/4.12.5 (FreeBSD/11.0-CURRENT; KDE/4.12.5; amd64; ; ) In-Reply-To: <201407162218.s6GMIJYR043517@svn.freebsd.org> References: <201407162218.s6GMIJYR043517@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sun, 20 Jul 2014 10:31:14 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 14:31:15 -0000 On Wednesday 16 July 2014 22:18:19 Don Lewis wrote: > Author: truckman > Date: Wed Jul 16 22:18:19 2014 > New Revision: 268780 > URL: http://svnweb.freebsd.org/changeset/base/268780 > > Log: > Nuke the never-used RF_TIMESHARE feature, reducing the complexity of the > code. The consensus on arch@ is that this feature might have been useful > in the distant past, but is now just unnecessary bloat. > > The int_rman_activate_resource() and int_rman_deactivate_resource() > functions become trivial, so manually inline them. > > The special deferred handling of RF_ACTIVE is no longer needed in > reserve_resource_bound(), so eliminate the associated code at the > end of the function. > > These changes reduce the object file size by more than 500 bytes on i386. > > Update the rman.9 man page to reflect the removal of the RF_TIMESHARE > feature. > > MFC after: 2 weeks Thanks! -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 14:32:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DF5CA83; Sun, 20 Jul 2014 14:32:36 +0000 (UTC) Received: from fep22.mx.upcmail.net (fep22.mx.upcmail.net [62.179.121.42]) by mx1.freebsd.org (Postfix) with ESMTP id 3A40D294D; Sun, 20 Jul 2014 14:32:34 +0000 (UTC) Received: from edge04.upcmail.net ([192.168.13.239]) by viefep22-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20140720143219.SAKX10910.viefep22-int.chello.at@edge04.upcmail.net>; Sun, 20 Jul 2014 16:32:19 +0200 Received: from mole.fafoe.narf.at ([80.109.55.137]) by edge04.upcmail.net with edge id UeYK1o00d2xdvHc03eYKuJ; Sun, 20 Jul 2014 16:32:19 +0200 X-SourceIP: 80.109.55.137 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id 26B426D40D; Sun, 20 Jul 2014 16:32:19 +0200 (CEST) Date: Sun, 20 Jul 2014 16:32:19 +0200 From: Stefan Farfeleder To: Mark Johnston Subject: Re: svn commit: r268869 - in head/sys: amd64/amd64 cddl/dev/dtrace/amd64 cddl/dev/fbt Message-ID: <20140720143218.GB1205@mole.fafoe.narf.at> References: <201407190227.s6J2RWvL042340@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201407190227.s6J2RWvL042340@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 14:32:36 -0000 Hi, On Sat, Jul 19, 2014 at 02:27:32AM +0000, Mark Johnston wrote: > Author: markj > Date: Sat Jul 19 02:27:31 2014 > New Revision: 268869 > URL: http://svnweb.freebsd.org/changeset/base/268869 > Modified: head/sys/amd64/amd64/trap.c > ============================================================================== > --- head/sys/amd64/amd64/trap.c Sat Jul 19 02:15:28 2014 (r268868) > +++ head/sys/amd64/amd64/trap.c Sat Jul 19 02:27:31 2014 (r268869) > @@ -97,7 +97,8 @@ PMC_SOFT_DEFINE( , , page_fault, write); > #include > #endif > > -extern void trap(struct trapframe *frame); > +extern void __noinline trap(struct trapframe *frame); > +extern void trap_check(struct trapframe *frame); > extern void syscall(struct trapframe *frame); > void dblfault_handler(struct trapframe *frame); > > @@ -604,6 +605,19 @@ out: > return; > } > > +/* > + * Ensure that we ignore any DTrace-induced faults. This function cannot > + * be instrumented, so it cannot generate such faults itself. > + */ > +void > +trap_check(struct trapframe *frame) > +{ > + > + if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame)) > + return; > + trap(frame); > +} > + > static int /usr/src/sys/amd64/amd64/trap.c:616:6: error: use of undeclared identifier 'dtrace_trap_func' if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame)) ^ This is without KDTRACE_HOOKS. BR, Stefan From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 14:47:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 932D4FCD; Sun, 20 Jul 2014 14:47:46 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 55F032A74; Sun, 20 Jul 2014 14:47:46 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id DFDAA75F1; Sun, 20 Jul 2014 14:47:38 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 5CC44570; Sun, 20 Jul 2014 16:47:19 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Ian Lepore Subject: Re: svn commit: r268877 - head/share/mk References: <201407191426.s6JEQ4en083862@svn.freebsd.org> <1405805007.85788.24.camel@revolution.hippie.lan> Date: Sun, 20 Jul 2014 16:47:19 +0200 In-Reply-To: <1405805007.85788.24.camel@revolution.hippie.lan> (Ian Lepore's message of "Sat, 19 Jul 2014 15:23:27 -0600") Message-ID: <8661isrsso.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 14:47:46 -0000 Ian Lepore writes: > This change breaks the ability to bootstrap from versions prior to 10.0 > because the older lex requires "-ofilename" rather than "-o filename". Right, I didn't test that: des@nine ~head/lib/libunbound% make -m ~head/share/mk obj depend /usr/obj/home/des/freebsd/base/head/lib/libunbound created for /home/des/fr= eebsd/base/head/lib/libunbound cp -p /home/des/freebsd/base/head/lib/libunbound/../../contrib/unbound/util= /configlexer.lex configlexer.l lex -Pub_c_ -o configlexer.c configlexer.l lex: can't open configlexer.c *** [configlexer.c] Error code 1 Stop in /home/des/freebsd/base/head/lib/libunbound. > It seems like the path of least resistance would be to remove the space > between -o and ${TARGET}, which I'll leave for you if you agree, so that > you can MFC them together when the time comes. Seems like a trivial enough fix. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 14:49:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F1E72C9; Sun, 20 Jul 2014 14:49:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D0C52A8C; Sun, 20 Jul 2014 14:49:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KEnOf5089121; Sun, 20 Jul 2014 14:49:24 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KEnOXw089120; Sun, 20 Jul 2014 14:49:24 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201407201449.s6KEnOXw089120@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 20 Jul 2014 14:49:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268921 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 14:49:24 -0000 Author: des Date: Sun Jul 20 14:49:24 2014 New Revision: 268921 URL: http://svnweb.freebsd.org/changeset/base/268921 Log: Older versions of flex (like the one used in FreeBSD <= 9) expect the output file name to follow the -o flag immediately, with no intervening whitespace. Reported by: ian@ MFC after: 1 week Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Sun Jul 20 12:06:52 2014 (r268920) +++ head/share/mk/bsd.dep.mk Sun Jul 20 14:49:24 2014 (r268921) @@ -82,7 +82,7 @@ ${_S:R}.o: ${_S} .for _LSRC in ${SRCS:M*.l:N*/*} .for _LC in ${_LSRC:R}.c ${_LC}: ${_LSRC} - ${LEX} ${LFLAGS} -o ${.TARGET} ${.ALLSRC} + ${LEX} ${LFLAGS} -o${.TARGET} ${.ALLSRC} .if !exists(${.OBJDIR}/${DEPENDFILE}) ${_LC:R}.o: ${_LC} .endif From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 16:34:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4949D81; Sun, 20 Jul 2014 16:34:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 927D42413; Sun, 20 Jul 2014 16:34:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KGYZ99041398; Sun, 20 Jul 2014 16:34:35 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KGYZCD041397; Sun, 20 Jul 2014 16:34:35 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201407201634.s6KGYZCD041397@svn.freebsd.org> From: Neel Natu Date: Sun, 20 Jul 2014 16:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268922 - head/sys/amd64/vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 16:34:35 -0000 Author: neel Date: Sun Jul 20 16:34:35 2014 New Revision: 268922 URL: http://svnweb.freebsd.org/changeset/base/268922 Log: Fix build without INVARIANTS defined by getting rid of unused variable 'exc'. Reported by: adrian, stefanf Modified: head/sys/amd64/vmm/intel/vmx.c Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Sun Jul 20 14:49:24 2014 (r268921) +++ head/sys/amd64/vmm/intel/vmx.c Sun Jul 20 16:34:35 2014 (r268922) @@ -1211,7 +1211,6 @@ vmx_inject_nmi(struct vmx *vmx, int vcpu static void vmx_inject_interrupts(struct vmx *vmx, int vcpu, struct vlapic *vlapic) { - struct vm_exception exc; int vector, need_nmi_exiting, extint_pending; uint64_t rflags, entryinfo; uint32_t gi, info; @@ -1222,7 +1221,7 @@ vmx_inject_interrupts(struct vmx *vmx, i info = vmcs_read(VMCS_ENTRY_INTR_INFO); KASSERT((info & VMCS_INTR_VALID) == 0, ("%s: cannot inject " - "pending exception %d: %#x", __func__, exc.vector, info)); + "pending exception: %#lx/%#x", __func__, entryinfo, info)); info = entryinfo; vector = info & 0xff; From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 16:37:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6ED57F47; Sun, 20 Jul 2014 16:37:47 +0000 (UTC) Received: from mail-qa0-x230.google.com (mail-qa0-x230.google.com [IPv6:2607:f8b0:400d:c00::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E19562442; Sun, 20 Jul 2014 16:37:46 +0000 (UTC) Received: by mail-qa0-f48.google.com with SMTP id m5so4408098qaj.21 for ; Sun, 20 Jul 2014 09:37:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=41sUlijyg8JhWpmVDKKU7lBviJ0pTw+t6HgaW+lB2FQ=; b=F7xGYHNk8CUxTPLZNpacZ9e3Ymu7dVMv8BKyo3vESC3ozfspSB6Syi9Kls2X5Y8jUq tXPwY+I2L9FRe5kfRRcZDPsOKBL0NZ70DDipYPkFH3FeIcE7xlJQZCiFMZ7SbN206QVi 6SmG7QZNv6c34Lr8vuQmXOeo0OOkjA40nJH0zrNNJXoKOdtSoTwNmS4KhtG+A+qlvTse TMk99DAXldbHQ1dE7mE8Z+5RUA5L6i15V+BngyP805MqPeo/Fc0udCQZgvKlh5oZ4yKM YDLAYV+5j7yWQJ1/1Nz6QzZ0YYtuPmm9SOVENBNCPPMv0pYeewLdPWJWFOHti+Bp6c6W TLMQ== MIME-Version: 1.0 X-Received: by 10.140.40.165 with SMTP id x34mr29875881qgx.23.1405874265953; Sun, 20 Jul 2014 09:37:45 -0700 (PDT) Received: by 10.140.48.37 with HTTP; Sun, 20 Jul 2014 09:37:45 -0700 (PDT) In-Reply-To: <20140720142354.GA1205@mole.fafoe.narf.at> References: <201407192059.s6JKx8un072543@svn.freebsd.org> <20140720142354.GA1205@mole.fafoe.narf.at> Date: Sun, 20 Jul 2014 09:37:45 -0700 Message-ID: Subject: Re: svn commit: r268889 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve usr.sbin/bhyvectl From: Neel Natu To: Stefan Farfeleder Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Neel Natu X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 16:37:47 -0000 Hi, On Sun, Jul 20, 2014 at 7:23 AM, Stefan Farfeleder wrote: > Hi, > > On Sat, Jul 19, 2014 at 08:59:08PM +0000, Neel Natu wrote: >> Author: neel >> Date: Sat Jul 19 20:59:08 2014 >> New Revision: 268889 >> URL: http://svnweb.freebsd.org/changeset/base/268889 > > > >> Modified: head/sys/amd64/vmm/intel/vmx.c >> ============================================================================== >> --- head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:55:13 2014 (r268888) >> +++ head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:59:08 2014 (r268889) >> @@ -1213,22 +1213,31 @@ vmx_inject_interrupts(struct vmx *vmx, i >> { >> struct vm_exception exc; >> int vector, need_nmi_exiting, extint_pending; >> - uint64_t rflags; >> + uint64_t rflags, entryinfo; >> uint32_t gi, info; >> >> - if (vm_exception_pending(vmx->vm, vcpu, &exc)) { >> - KASSERT(exc.vector >= 0 && exc.vector < 32, >> - ("%s: invalid exception vector %d", __func__, exc.vector)); >> + if (vm_entry_intinfo(vmx->vm, vcpu, &entryinfo)) { >> + KASSERT((entryinfo & VMCS_INTR_VALID) != 0, ("%s: entry " >> + "intinfo is not valid: %#lx", __func__, entryinfo)); >> >> info = vmcs_read(VMCS_ENTRY_INTR_INFO); >> KASSERT((info & VMCS_INTR_VALID) == 0, ("%s: cannot inject " >> "pending exception %d: %#x", __func__, exc.vector, info)); >> > > /usr/src/sys/modules/vmm/../../amd64/vmm/intel/vmx.c:1214:22: error: unused variable 'exc' [-Werror,-Wunused-variable] > struct vm_exception exc; > ^ > 1 error generated. > > Printing the uninitialised object in the KASSERT is most probably wrong. > Fixed in r268922. best Neel > BR, > Stefan From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 16:47:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04836243; Sun, 20 Jul 2014 16:47:32 +0000 (UTC) Received: from mail-qc0-x22e.google.com (mail-qc0-x22e.google.com [IPv6:2607:f8b0:400d:c01::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74A2F2506; Sun, 20 Jul 2014 16:47:31 +0000 (UTC) Received: by mail-qc0-f174.google.com with SMTP id o8so4863635qcw.5 for ; Sun, 20 Jul 2014 09:47:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=o8KZ19Yxma7ZDFT8Lude7HPKySSlVLd96sfsxKxhh+A=; b=iUecXC0ziioCcYKx5Ep/SNCT+z/EVJp1VhaEfVv1hay1FpXMUu8oCL8NiOV2EjBMFF owSbiXIIm+ZjpT6wzA0iD/1WZ+P5QFs+BVvd1Mf8J2GZeAQ/fMCAyTmtJBhEr4DcqJoa PPvEsEx6wtsuqMssXgMf3FA69AlvBc+yolvGBaEa1qIeT6AlX+BIjsEyHV8aRbC+LmFc yoqAvGgUb8FpeR+DVOifCtwckzO9nO2tbXQNXMdLPDWFm6kyNARzCR0GmZPMMcHI46Rn qMUBvUeA8D9cVQiQi9mvaLvUnhCp/gK+mQvnstWbFGjCK0sXKaqqNNBrtszYskr0dED3 S4uA== MIME-Version: 1.0 X-Received: by 10.140.38.169 with SMTP id t38mr29607511qgt.3.1405874849085; Sun, 20 Jul 2014 09:47:29 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.1.6 with HTTP; Sun, 20 Jul 2014 09:47:29 -0700 (PDT) In-Reply-To: References: <201407192059.s6JKx8un072543@svn.freebsd.org> <20140720142354.GA1205@mole.fafoe.narf.at> Date: Sun, 20 Jul 2014 09:47:29 -0700 X-Google-Sender-Auth: zM6dkwRJn_BTyphrsDZ3-9dLaxk Message-ID: Subject: Re: svn commit: r268889 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve usr.sbin/bhyvectl From: Adrian Chadd To: Neel Natu Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Stefan Farfeleder , "src-committers@freebsd.org" , Neel Natu X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 16:47:32 -0000 Thanks! -a On 20 July 2014 09:37, Neel Natu wrote: > Hi, > > On Sun, Jul 20, 2014 at 7:23 AM, Stefan Farfeleder wrote: >> Hi, >> >> On Sat, Jul 19, 2014 at 08:59:08PM +0000, Neel Natu wrote: >>> Author: neel >>> Date: Sat Jul 19 20:59:08 2014 >>> New Revision: 268889 >>> URL: http://svnweb.freebsd.org/changeset/base/268889 >> >> >> >>> Modified: head/sys/amd64/vmm/intel/vmx.c >>> ============================================================================== >>> --- head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:55:13 2014 (r268888) >>> +++ head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:59:08 2014 (r268889) >>> @@ -1213,22 +1213,31 @@ vmx_inject_interrupts(struct vmx *vmx, i >>> { >>> struct vm_exception exc; >>> int vector, need_nmi_exiting, extint_pending; >>> - uint64_t rflags; >>> + uint64_t rflags, entryinfo; >>> uint32_t gi, info; >>> >>> - if (vm_exception_pending(vmx->vm, vcpu, &exc)) { >>> - KASSERT(exc.vector >= 0 && exc.vector < 32, >>> - ("%s: invalid exception vector %d", __func__, exc.vector)); >>> + if (vm_entry_intinfo(vmx->vm, vcpu, &entryinfo)) { >>> + KASSERT((entryinfo & VMCS_INTR_VALID) != 0, ("%s: entry " >>> + "intinfo is not valid: %#lx", __func__, entryinfo)); >>> >>> info = vmcs_read(VMCS_ENTRY_INTR_INFO); >>> KASSERT((info & VMCS_INTR_VALID) == 0, ("%s: cannot inject " >>> "pending exception %d: %#x", __func__, exc.vector, info)); >>> >> >> /usr/src/sys/modules/vmm/../../amd64/vmm/intel/vmx.c:1214:22: error: unused variable 'exc' [-Werror,-Wunused-variable] >> struct vm_exception exc; >> ^ >> 1 error generated. >> >> Printing the uninitialised object in the KASSERT is most probably wrong. >> > > Fixed in r268922. > > best > Neel > >> BR, >> Stefan > From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 18:44:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3CF4EB97; Sun, 20 Jul 2014 18:44:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A52F2FAF; Sun, 20 Jul 2014 18:44:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KIivfG004207; Sun, 20 Jul 2014 18:44:57 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KIiv31004206; Sun, 20 Jul 2014 18:44:57 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201407201844.s6KIiv31004206@svn.freebsd.org> From: Mark Johnston Date: Sun, 20 Jul 2014 18:44:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268923 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 18:44:57 -0000 Author: markj Date: Sun Jul 20 18:44:56 2014 New Revision: 268923 URL: http://svnweb.freebsd.org/changeset/base/268923 Log: Fix the build when DTrace isn't enabled. Reported by: stefanf X-MFC-With: r268600 Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sun Jul 20 16:34:35 2014 (r268922) +++ head/sys/amd64/amd64/trap.c Sun Jul 20 18:44:56 2014 (r268923) @@ -613,8 +613,10 @@ void trap_check(struct trapframe *frame) { +#ifdef KDTRACE_HOOKS if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame)) return; +#endif trap(frame); } From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 18:46:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 64106CE6; Sun, 20 Jul 2014 18:46:49 +0000 (UTC) Received: from mail-ie0-x231.google.com (mail-ie0-x231.google.com [IPv6:2607:f8b0:4001:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1358F2FC0; Sun, 20 Jul 2014 18:46:49 +0000 (UTC) Received: by mail-ie0-f177.google.com with SMTP id at20so6093142iec.22 for ; Sun, 20 Jul 2014 11:46:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=xXtPBjLuXEAs+jGiwQlVwO2cKhzeb2NO9Gz3SaLBUgE=; b=kgXl0nfxL3yNF+PEG8n+Aymgha1ONHThFsWZHWuQLJexTxeD/VV1OrQyU6n+VwsHXn 1iVkO32gr9u+AkPcXVU7M7pX1XLNmq6leeQM34Suoe/cjxbzrYUsDuHKBGUGm6QzeGGi ltsVBXujmdcRCkTswTpJisDD7QMVKjEhGf25WgAjD/euMT89Nlk5xYExHy09OOGZ9V0L dbNN4JzPPVPzJifxvDkoYH01DyQD6nRwEeCe8ozEHbwN5vA6kqzYjBEEtWYv53wJgVNj 4GbUnYzh6v7o8KJbgr1hLpyORVPd4gxaDaIu2yPUJ0+Kp/aDCFi+rtnqEzI9Ey6ilYJk eugw== X-Received: by 10.50.66.179 with SMTP id g19mr34511651igt.29.1405882008070; Sun, 20 Jul 2014 11:46:48 -0700 (PDT) Received: from charmander.home ([65.92.195.187]) by mx.google.com with ESMTPSA id ro10sm30614110igb.18.2014.07.20.11.46.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Jul 2014 11:46:47 -0700 (PDT) Sender: Mark Johnston Date: Sun, 20 Jul 2014 14:46:11 -0400 From: Mark Johnston To: Stefan Farfeleder Subject: Re: svn commit: r268869 - in head/sys: amd64/amd64 cddl/dev/dtrace/amd64 cddl/dev/fbt Message-ID: <20140720184610.GA1321@charmander.home> References: <201407190227.s6J2RWvL042340@svn.freebsd.org> <20140720143218.GB1205@mole.fafoe.narf.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140720143218.GB1205@mole.fafoe.narf.at> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 18:46:49 -0000 On Sun, Jul 20, 2014 at 04:32:19PM +0200, Stefan Farfeleder wrote: > Hi, > > On Sat, Jul 19, 2014 at 02:27:32AM +0000, Mark Johnston wrote: > > Author: markj > > Date: Sat Jul 19 02:27:31 2014 > > New Revision: 268869 > > URL: http://svnweb.freebsd.org/changeset/base/268869 > > > > > Modified: head/sys/amd64/amd64/trap.c > > ============================================================================== > > --- head/sys/amd64/amd64/trap.c Sat Jul 19 02:15:28 2014 (r268868) > > +++ head/sys/amd64/amd64/trap.c Sat Jul 19 02:27:31 2014 (r268869) > > @@ -97,7 +97,8 @@ PMC_SOFT_DEFINE( , , page_fault, write); > > #include > > #endif > > > > -extern void trap(struct trapframe *frame); > > +extern void __noinline trap(struct trapframe *frame); > > +extern void trap_check(struct trapframe *frame); > > extern void syscall(struct trapframe *frame); > > void dblfault_handler(struct trapframe *frame); > > > > @@ -604,6 +605,19 @@ out: > > return; > > } > > > > +/* > > + * Ensure that we ignore any DTrace-induced faults. This function cannot > > + * be instrumented, so it cannot generate such faults itself. > > + */ > > +void > > +trap_check(struct trapframe *frame) > > +{ > > + > > + if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame)) > > + return; > > + trap(frame); > > +} > > + > > static int > > /usr/src/sys/amd64/amd64/trap.c:616:6: error: use of undeclared identifier 'dtrace_trap_func' > if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame)) > ^ > > This is without KDTRACE_HOOKS. Sorry about that. This is fixed in r268923. -Mark From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 20:05:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B49AA72A; Sun, 20 Jul 2014 20:05:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8806126A5; Sun, 20 Jul 2014 20:05:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KK5dno044644; Sun, 20 Jul 2014 20:05:39 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KK5dgT044643; Sun, 20 Jul 2014 20:05:39 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407202005.s6KK5dgT044643@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 20 Jul 2014 20:05:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268924 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 20:05:39 -0000 Author: pfg Date: Sun Jul 20 20:05:39 2014 New Revision: 268924 URL: http://svnweb.freebsd.org/changeset/base/268924 Log: Update fflush(3) to return success on a read-only stream. This has small changes to what Apple uses for compliance with SUSv3. The changes cause no secondary effects in the gnulib tests (we pass them). Obtained from: Apple Inc. (Libc 997.90.3 with changes) Reviewed by: bde Phabric: D440 Modified: head/lib/libc/stdio/fflush.c Modified: head/lib/libc/stdio/fflush.c ============================================================================== --- head/lib/libc/stdio/fflush.c Sun Jul 20 18:44:56 2014 (r268923) +++ head/lib/libc/stdio/fflush.c Sun Jul 20 20:05:39 2014 (r268924) @@ -60,7 +60,7 @@ fflush(FILE *fp) /* * There is disagreement about the correct behaviour of fflush() - * when passed a file which is not open for reading. According to + * when passed a file which is not open for writing. According to * the ISO C standard, the behaviour is undefined. * Under linux, such an fflush returns success and has no effect; * under Windows, such an fflush is documented as behaving instead @@ -68,11 +68,13 @@ fflush(FILE *fp) * Given that applications may be written with the expectation of * either of these two behaviours, the only safe (non-astonishing) * option is to return EBADF and ask that applications be fixed. + * SUSv3 now requires that fflush() returns success on a read-only + * stream. + * */ - if ((fp->_flags & (__SWR | __SRW)) == 0) { - errno = EBADF; - retval = EOF; - } else + if ((fp->_flags & (__SWR | __SRW)) == 0) + retval = 0; + else retval = __sflush(fp); FUNLOCKFILE(fp); return (retval); @@ -89,10 +91,9 @@ __fflush(FILE *fp) if (fp == NULL) return (_fwalk(sflush_locked)); - if ((fp->_flags & (__SWR | __SRW)) == 0) { - errno = EBADF; - retval = EOF; - } else + if ((fp->_flags & (__SWR | __SRW)) == 0) + retval = 0; + else retval = __sflush(fp); return (retval); } @@ -122,6 +123,12 @@ __sflush(FILE *fp) for (; n > 0; n -= t, p += t) { t = _swrite(fp, (char *)p, n); if (t <= 0) { + /* Reset _p and _w. */ + if (p > fp->_p) /* Some was written. */ + memmove(fp->_p, p, n); + fp->_p += n; + if ((fp->_flags & (__SLBF | __SNBF)) == 0) + fp->_w -= n; fp->_flags |= __SERR; return (EOF); } From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 20:11:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D094A8DD; Sun, 20 Jul 2014 20:11:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDB1926E5; Sun, 20 Jul 2014 20:11:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KKBZ06048352; Sun, 20 Jul 2014 20:11:35 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KKBZHe048349; Sun, 20 Jul 2014 20:11:35 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201407202011.s6KKBZHe048349@svn.freebsd.org> From: Robert Watson Date: Sun, 20 Jul 2014 20:11:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268925 - head/usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 20:11:35 -0000 Author: rwatson Date: Sun Jul 20 20:11:34 2014 New Revision: 268925 URL: http://svnweb.freebsd.org/changeset/base/268925 Log: In "procstat -v" (VM), spell out 'FL' to 'FLAG' since there are two extra columns available anyway. Also left align as we tend to do for flags fields, although you can't see that currently as the string fully fills that available columns. MFC after: 3 days Sponsored by: DARPA, AFRL Modified: head/usr.bin/procstat/procstat.1 head/usr.bin/procstat/procstat_vm.c Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Sun Jul 20 20:05:39 2014 (r268924) +++ head/usr.bin/procstat/procstat.1 Sun Jul 20 20:11:34 2014 (r268925) @@ -445,7 +445,7 @@ private resident pages reference count .It SHD shadow page count -.It FL +.It FLAG mapping flags .It TP VM object type Modified: head/usr.bin/procstat/procstat_vm.c ============================================================================== --- head/usr.bin/procstat/procstat_vm.c Sun Jul 20 20:05:39 2014 (r268924) +++ head/usr.bin/procstat/procstat_vm.c Sun Jul 20 20:11:34 2014 (r268925) @@ -50,9 +50,9 @@ procstat_vm(struct procstat *procstat, s ptrwidth = 2*sizeof(void *) + 2; if (!hflag) - printf("%5s %*s %*s %3s %4s %4s %3s %3s %4s %-2s %-s\n", + printf("%5s %*s %*s %3s %4s %4s %3s %3s %-4s %-2s %-s\n", "PID", ptrwidth, "START", ptrwidth, "END", "PRT", "RES", - "PRES", "REF", "SHD", "FL", "TP", "PATH"); + "PRES", "REF", "SHD", "FLAG", "TP", "PATH"); freep = procstat_getvmmap(procstat, kipp, &cnt); if (freep == NULL) From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 20:14:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 350E0A3B; Sun, 20 Jul 2014 20:14:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22ECF2761; Sun, 20 Jul 2014 20:14:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KKEGkT049485; Sun, 20 Jul 2014 20:14:16 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KKEFpB049484; Sun, 20 Jul 2014 20:14:15 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407202014.s6KKEFpB049484@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 20 Jul 2014 20:14:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268926 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 20:14:16 -0000 Author: pfg Date: Sun Jul 20 20:14:15 2014 New Revision: 268926 URL: http://svnweb.freebsd.org/changeset/base/268926 Log: Use a correct errno in freopen. Use EBADF instead of EINVAL when working around incorrect O_ACCMODE. Phabric: D442 Obtained from: Apple Inc. (Libc 997.90.3) Reviewed by: jilles MFC after: 1 week Modified: head/lib/libc/stdio/freopen.c Modified: head/lib/libc/stdio/freopen.c ============================================================================== --- head/lib/libc/stdio/freopen.c Sun Jul 20 20:11:34 2014 (r268925) +++ head/lib/libc/stdio/freopen.c Sun Jul 20 20:14:15 2014 (r268926) @@ -97,7 +97,7 @@ freopen(const char * __restrict file, co (dflags & (O_ACCMODE | O_EXEC)) != (oflags & O_ACCMODE)) { fclose(fp); FUNLOCKFILE(fp); - errno = EINVAL; + errno = EBADF; return (NULL); } if (fp->_flags & __SWR) From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 20:29:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31360E5; Sun, 20 Jul 2014 20:29:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EC7F2896; Sun, 20 Jul 2014 20:29:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KKTA0e055033; Sun, 20 Jul 2014 20:29:10 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KKTA2N055030; Sun, 20 Jul 2014 20:29:10 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201407202029.s6KKTA2N055030@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 20 Jul 2014 20:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268927 - in head/bin/sh: . tests/builtins X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 20:29:11 -0000 Author: jilles Date: Sun Jul 20 20:29:09 2014 New Revision: 268927 URL: http://svnweb.freebsd.org/changeset/base/268927 Log: sh: Allow arbitrarily large numbers in break and continue. The argument is capped to loopnest, so strtol()'s [ERANGE] can be ignored. Added: head/bin/sh/tests/builtins/break6.0 (contents, props changed) Modified: head/bin/sh/eval.c head/bin/sh/tests/builtins/Makefile Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun Jul 20 20:14:15 2014 (r268926) +++ head/bin/sh/eval.c Sun Jul 20 20:29:09 2014 (r268927) @@ -1250,8 +1250,16 @@ bltincmd(int argc, char **argv) int breakcmd(int argc, char **argv) { - int n = argc > 1 ? number(argv[1]) : 1; + long n; + char *end; + if (argc > 1) { + /* Allow arbitrarily large numbers. */ + n = strtol(argv[1], &end, 10); + if (!is_digit(argv[1][0]) || *end != '\0') + error("Illegal number: %s", argv[1]); + } else + n = 1; if (n > loopnest) n = loopnest; if (n > 0) { Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Sun Jul 20 20:14:15 2014 (r268926) +++ head/bin/sh/tests/builtins/Makefile Sun Jul 20 20:29:09 2014 (r268927) @@ -14,6 +14,7 @@ FILES+= break2.0 break2.0.stdout FILES+= break3.0 FILES+= break4.4 FILES+= break5.4 +FILES+= break6.0 FILES+= builtin1.0 FILES+= case1.0 FILES+= case2.0 Added: head/bin/sh/tests/builtins/break6.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/break6.0 Sun Jul 20 20:29:09 2014 (r268927) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# Per POSIX, this need only work if LONG_MAX > 4294967295. + +while :; do + break 4294967296 + echo bad + exit 3 +done From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 20:29:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A5C7220; Sun, 20 Jul 2014 20:29:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27E6F289A; Sun, 20 Jul 2014 20:29:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KKTTAB055123; Sun, 20 Jul 2014 20:29:29 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KKTTtk055122; Sun, 20 Jul 2014 20:29:29 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407202029.s6KKTTtk055122@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 20 Jul 2014 20:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268928 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 20:29:29 -0000 Author: pfg Date: Sun Jul 20 20:29:28 2014 New Revision: 268928 URL: http://svnweb.freebsd.org/changeset/base/268928 Log: Const-ify a character string. Obtained from: Apple Inc. (Libc 997.90.3) MFC after: 3 days Modified: head/lib/libc/stdio/gets.c Modified: head/lib/libc/stdio/gets.c ============================================================================== --- head/lib/libc/stdio/gets.c Sun Jul 20 20:29:09 2014 (r268927) +++ head/lib/libc/stdio/gets.c Sun Jul 20 20:29:28 2014 (r268928) @@ -52,7 +52,7 @@ gets(char *buf) int c; char *s; static int warned; - static char w[] = + static const char w[] = "warning: this program uses gets(), which is unsafe.\n"; FLOCKFILE(stdin); From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 21:02:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 52285D57; Sun, 20 Jul 2014 21:02:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F9462B9D; Sun, 20 Jul 2014 21:02:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KL2a6B073204; Sun, 20 Jul 2014 21:02:36 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KL2Z1W073202; Sun, 20 Jul 2014 21:02:35 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201407202102.s6KL2Z1W073202@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 20 Jul 2014 21:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268929 - in head/sys/dev/usb: . serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 21:02:36 -0000 Author: hselasky Date: Sun Jul 20 21:02:35 2014 New Revision: 268929 URL: http://svnweb.freebsd.org/changeset/base/268929 Log: Add new device ID. MFC after: 1 week PR: 191959 Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Sun Jul 20 20:29:28 2014 (r268928) +++ head/sys/dev/usb/serial/u3g.c Sun Jul 20 21:02:35 2014 (r268929) @@ -343,6 +343,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(NOVATEL, EU870D, 0), U3G_DEV(NOVATEL, MC760, 0), U3G_DEV(NOVATEL, MC547, 0), + U3G_DEV(NOVATEL, MC679, 0), U3G_DEV(NOVATEL, MC950D, 0), U3G_DEV(NOVATEL, MIFI2200, U3GINIT_SCSIEJECT), U3G_DEV(NOVATEL, MIFI2200V, U3GINIT_SCSIEJECT), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Jul 20 20:29:28 2014 (r268928) +++ head/sys/dev/usb/usbdevs Sun Jul 20 21:02:35 2014 (r268929) @@ -3239,6 +3239,7 @@ product NOVATEL U727_2 0x5100 Merlin U7 product NOVATEL U760 0x6000 Novatel U760 product NOVATEL MC760 0x6002 Novatel MC760 product NOVATEL MC547 0x7042 Novatel MC547 +product NOVATEL MC679 0x7031 Novatel MC679 product NOVATEL2 FLEXPACKGPS 0x0100 NovAtel FlexPack GPS receiver /* Merlin products */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 21:24:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5705669E; Sun, 20 Jul 2014 21:24:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A2FF2D62; Sun, 20 Jul 2014 21:24:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KLOUC4083882; Sun, 20 Jul 2014 21:24:30 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KLOTKk083874; Sun, 20 Jul 2014 21:24:29 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407202124.s6KLOTKk083874@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 20 Jul 2014 21:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268930 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 21:24:30 -0000 Author: pfg Date: Sun Jul 20 21:24:29 2014 New Revision: 268930 URL: http://svnweb.freebsd.org/changeset/base/268930 Log: Adjust errno on failed prepwrite. Obtained from: Apple Inc. (Libc 997.90.3) Phabric: D442 MFC after: 1 week Modified: head/lib/libc/stdio/vfprintf.c head/lib/libc/stdio/vfwprintf.c head/lib/libc/stdio/wbuf.c Modified: head/lib/libc/stdio/vfprintf.c ============================================================================== --- head/lib/libc/stdio/vfprintf.c Sun Jul 20 21:02:35 2014 (r268929) +++ head/lib/libc/stdio/vfprintf.c Sun Jul 20 21:24:29 2014 (r268930) @@ -455,8 +455,10 @@ __vfprintf(FILE *fp, locale_t locale, co return (__xvprintf(fp, fmt0, ap)); /* sorry, fprintf(read_only_file, "") returns EOF, not 0 */ - if (prepwrite(fp) != 0) + if (prepwrite(fp) != 0) { + errno = EBADF; return (EOF); + } convbuf = NULL; fmt = (char *)fmt0; Modified: head/lib/libc/stdio/vfwprintf.c ============================================================================== --- head/lib/libc/stdio/vfwprintf.c Sun Jul 20 21:02:35 2014 (r268929) +++ head/lib/libc/stdio/vfwprintf.c Sun Jul 20 21:24:29 2014 (r268930) @@ -531,8 +531,10 @@ __vfwprintf(FILE *fp, locale_t locale, c /* sorry, fwprintf(read_only_file, L"") returns WEOF, not 0 */ - if (prepwrite(fp) != 0) + if (prepwrite(fp) != 0) { + errno = EBADF; return (EOF); + } convbuf = NULL; fmt = (wchar_t *)fmt0; Modified: head/lib/libc/stdio/wbuf.c ============================================================================== --- head/lib/libc/stdio/wbuf.c Sun Jul 20 21:02:35 2014 (r268929) +++ head/lib/libc/stdio/wbuf.c Sun Jul 20 21:24:29 2014 (r268930) @@ -36,6 +36,7 @@ static char sccsid[] = "@(#)wbuf.c 8.1 ( #include __FBSDID("$FreeBSD$"); +#include #include #include "local.h" @@ -59,8 +60,10 @@ __swbuf(int c, FILE *fp) * calls might wrap _w from negative to positive. */ fp->_w = fp->_lbfsize; - if (prepwrite(fp) != 0) + if (prepwrite(fp) != 0) { + errno = EBADF; return (EOF); + } c = (unsigned char)c; ORIENT(fp, -1); From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 22:13:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BFF7EE94; Sun, 20 Jul 2014 22:13:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC7472224; Sun, 20 Jul 2014 22:13:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KMDpoO008277; Sun, 20 Jul 2014 22:13:51 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KMDpVU008275; Sun, 20 Jul 2014 22:13:51 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201407202213.s6KMDpVU008275@svn.freebsd.org> From: Warren Block Date: Sun, 20 Jul 2014 22:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268931 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 22:13:51 -0000 Author: wblock (doc committer) Date: Sun Jul 20 22:13:51 2014 New Revision: 268931 URL: http://svnweb.freebsd.org/changeset/base/268931 Log: Correct spelling errors in ctld.8. While here, correct similar errors in ctl.conf.5 and fix a couple of contractions. PR: 191984 Submitted by: olgeni MFC after: 1 week Modified: head/usr.sbin/ctld/ctl.conf.5 head/usr.sbin/ctld/ctld.8 Modified: head/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- head/usr.sbin/ctld/ctl.conf.5 Sun Jul 20 21:24:29 2014 (r268930) +++ head/usr.sbin/ctld/ctl.conf.5 Sun Jul 20 22:13:51 2014 (r268931) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 24, 2014 +.Dd July 20, 2014 .Dt CTL.CONF 5 .Os .Sh NAME @@ -104,14 +104,14 @@ The following statements are available a .It Ic auth-type Ao Ar type Ac Specifies authentication type. Type can be either "none", "deny", "chap", or "chap-mutual". -In most cases it is not neccessary to set the type using this clause; +In most cases it is not necessary to set the type using this clause; it is usually used to disable authentication for a given auth-group. .It Ic chap Ao Ar user Ac Aq Ar secret Specifies CHAP authentication credentials. .It Ic chap-mutual Ao Ar user Ac Ao Ar secret Ac Ao Ar mutualuser Ac Aq Ar mutualsecret Specifies mutual CHAP authentication credentials. Note that for any auth-group, configuration may contain either chap, -or chap-mutual entries; it's an error to mix them. +or chap-mutual entries; it is an error to mix them. .It Ic initiator-name Ao Ar initiator-name Ac Specifies iSCSI initiator name. If not defined, there will be no restrictions based on initiator @@ -158,18 +158,18 @@ without authentication. .It Ic auth-type Ao Ar type Ac Specifies authentication type. Type can be either "none", "deny", "chap", or "chap-mutual". -In most cases it is not neccessary to set the type using this clause; +In most cases it is not necessary to set the type using this clause; it is usually used to disable authentication for a given target. This clause is mutually exclusive with auth-group; one cannot use both in a single target. .It Ic chap Ao Ar user Ac Aq Ar secret Specifies CHAP authentication credentials. Note that targets must use either auth-group, or chap, -or chap-mutual clauses; it's a configuration error to mix them in one target. +or chap-mutual clauses; it is a configuration error to mix them in one target. .It Ic chap-mutual Ao Ar user Ac Ao Ar secret Ac Ao Ar mutualuser Ac Aq Ar mutualsecret Specifies mutual CHAP authentication credentials. Note that targets must use either auth-group, chap, or -chap-mutual clauses; it's a configuration error to mix them in one target. +chap-mutual clauses; it is a configuration error to mix them in one target. .It Ic initiator-name Ao Ar initiator-name Ac Specifies iSCSI initiator name. If not defined, there will be no restrictions based on initiator Modified: head/usr.sbin/ctld/ctld.8 ============================================================================== --- head/usr.sbin/ctld/ctld.8 Sun Jul 20 21:24:29 2014 (r268930) +++ head/usr.sbin/ctld/ctld.8 Sun Jul 20 22:13:51 2014 (r268931) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 20, 2012 +.Dd July 20, 2014 .Dt CTLD 8 .Os .Sh NAME @@ -51,7 +51,7 @@ Then it compares the configuration with by previously running .Nm instances, removes LUNs no longer existing in the configuration file, -and creates new LUNs as neccessary. +and creates new LUNs as necessary. After that it listens for the incoming iSCSI connections, performs authentication, and, if successful, passes the connections to the kernel part of CTL iSCSI target, which handles it from that point. @@ -59,13 +59,13 @@ of CTL iSCSI target, which handles it fr When it receives a SIGHUP signal, the .Nm reloads its configuration and applies the changes to the kernel. -Changes are applied in a way that avoids unneccessary disruptions; +Changes are applied in a way that avoids unnecessary disruptions; for example removing one LUN does not affect other LUNs. .Pp When exiting gracefully, the .Nm daemon removes LUNs it managed and forcibly disconnects all the clients. -Otherwise - e.g. when killed with SIGKILL - LUNs stay configured +Otherwise - for example, when killed with SIGKILL - LUNs stay configured and clients remain connected. .Pp To perform administrative actions that apply to already connected From owner-svn-src-all@FreeBSD.ORG Sun Jul 20 22:54:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1BD2D641; Sun, 20 Jul 2014 22:54:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0A2625A9; Sun, 20 Jul 2014 22:54:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KMs4aR028758; Sun, 20 Jul 2014 22:54:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KMs3xn028748; Sun, 20 Jul 2014 22:54:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201407202254.s6KMs3xn028748@svn.freebsd.org> From: John Baldwin Date: Sun, 20 Jul 2014 22:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268932 - in stable/10: sys/boot/userboot sys/boot/userboot/userboot sys/boot/userboot/zfs usr.sbin/bhyveload X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 22:54:05 -0000 Author: jhb Date: Sun Jul 20 22:54:03 2014 New Revision: 268932 URL: http://svnweb.freebsd.org/changeset/base/268932 Log: MFC 262331,262487,262495,262523: ZFS boot support for bhyveload. Added: stable/10/sys/boot/userboot/zfs/ - copied from r262331, head/sys/boot/userboot/zfs/ Modified: stable/10/sys/boot/userboot/Makefile stable/10/sys/boot/userboot/userboot/Makefile stable/10/sys/boot/userboot/userboot/conf.c stable/10/sys/boot/userboot/userboot/devicename.c stable/10/sys/boot/userboot/userboot/main.c stable/10/usr.sbin/bhyveload/bhyveload.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/userboot/Makefile ============================================================================== --- stable/10/sys/boot/userboot/Makefile Sun Jul 20 22:13:51 2014 (r268931) +++ stable/10/sys/boot/userboot/Makefile Sun Jul 20 22:54:03 2014 (r268932) @@ -2,7 +2,7 @@ .include -SUBDIR= ficl libstand test userboot +SUBDIR= ficl libstand test zfs userboot .include Modified: stable/10/sys/boot/userboot/userboot/Makefile ============================================================================== --- stable/10/sys/boot/userboot/userboot/Makefile Sun Jul 20 22:13:51 2014 (r268931) +++ stable/10/sys/boot/userboot/userboot/Makefile Sun Jul 20 22:54:03 2014 (r268932) @@ -51,12 +51,17 @@ LIBFICL= ${.OBJDIR}/../ficl/libficl.a LIBSTAND= ${.OBJDIR}/../libstand/libstand.a .endif +.if ${MK_ZFS} != "no" +CFLAGS+= -DUSERBOOT_ZFS_SUPPORT +LIBZFSBOOT= ${.OBJDIR}/../zfs/libzfsboot.a +.endif + # Always add MI sources .PATH: ${.CURDIR}/../../common .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -DPADD= ${LIBFICL} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBSTAND} +DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSTAND} +LDADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSTAND} .include Modified: stable/10/sys/boot/userboot/userboot/conf.c ============================================================================== --- stable/10/sys/boot/userboot/userboot/conf.c Sun Jul 20 22:13:51 2014 (r268931) +++ stable/10/sys/boot/userboot/userboot/conf.c Sun Jul 20 22:54:03 2014 (r268932) @@ -38,6 +38,10 @@ __FBSDID("$FreeBSD$"); #include "libuserboot.h" +#if defined(USERBOOT_ZFS_SUPPORT) +#include "../zfs/libzfs.h" +#endif + /* * We could use linker sets for some or all of these, but * then we would have to control what ended up linked into @@ -51,6 +55,9 @@ __FBSDID("$FreeBSD$"); struct devsw *devsw[] = { &host_dev, &userboot_disk, +#if defined(USERBOOT_ZFS_SUPPORT) + &zfs_dev, +#endif NULL }; @@ -59,6 +66,9 @@ struct fs_ops *file_system[] = { &ufs_fsops, &cd9660_fsops, &gzipfs_fsops, +#if defined(USERBOOT_ZFS_SUPPORT) + &zfs_fsops, +#endif NULL }; Modified: stable/10/sys/boot/userboot/userboot/devicename.c ============================================================================== --- stable/10/sys/boot/userboot/userboot/devicename.c Sun Jul 20 22:13:51 2014 (r268931) +++ stable/10/sys/boot/userboot/userboot/devicename.c Sun Jul 20 22:54:03 2014 (r268932) @@ -34,6 +34,10 @@ __FBSDID("$FreeBSD$"); #include "disk.h" #include "libuserboot.h" +#if defined(USERBOOT_ZFS_SUPPORT) +#include "../zfs/libzfs.h" +#endif + static int userboot_parsedev(struct disk_devdesc **dev, const char *devspec, const char **path); /* @@ -119,7 +123,6 @@ userboot_parsedev(struct disk_devdesc ** case DEVT_CD: case DEVT_NET: - case DEVT_ZFS: unit = 0; if (*np && (*np != ':')) { @@ -141,6 +144,16 @@ userboot_parsedev(struct disk_devdesc ** *path = (*cp == 0) ? cp : cp + 1; break; + case DEVT_ZFS: +#if defined(USERBOOT_ZFS_SUPPORT) + err = zfs_parsedev((struct zfs_devdesc *)idev, np, path); + if (err != 0) + goto fail; + break; +#else + /* FALLTHROUGH */ +#endif + default: err = EINVAL; goto fail; @@ -179,8 +192,15 @@ userboot_fmtdev(void *vdev) return (disk_fmtdev(vdev)); case DEVT_NET: + sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); + break; + case DEVT_ZFS: +#if defined(USERBOOT_ZFS_SUPPORT) + return (zfs_fmtdev(vdev)); +#else sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); +#endif break; } return(buf); Modified: stable/10/sys/boot/userboot/userboot/main.c ============================================================================== --- stable/10/sys/boot/userboot/userboot/main.c Sun Jul 20 22:13:51 2014 (r268931) +++ stable/10/sys/boot/userboot/userboot/main.c Sun Jul 20 22:54:03 2014 (r268932) @@ -36,8 +36,17 @@ __FBSDID("$FreeBSD$"); #include "disk.h" #include "libuserboot.h" +#if defined(USERBOOT_ZFS_SUPPORT) +#include "../zfs/libzfs.h" + +static void userboot_zfs_probe(void); +static int userboot_zfs_found; +#endif + #define USERBOOT_VERSION USERBOOT_VERSION_3 +#define MALLOCSZ (10*1024*1024) + struct loader_callbacks *callbacks; void *callbacks_arg; @@ -69,7 +78,7 @@ exit(int v) void loader_main(struct loader_callbacks *cb, void *arg, int version, int ndisks) { - static char malloc[1024*1024]; + static char mallocbuf[MALLOCSZ]; const char *var; int i; @@ -82,23 +91,15 @@ loader_main(struct loader_callbacks *cb, /* * initialise the heap as early as possible. Once this is done, - * alloc() is usable. The stack is buried inside us, so this is - * safe. + * alloc() is usable. */ - setheap((void *)malloc, (void *)(malloc + 1024*1024)); + setheap((void *)mallocbuf, (void *)(mallocbuf + sizeof(mallocbuf))); /* * Hook up the console */ cons_probe(); - /* - * March through the device switch probing for things. - */ - for (i = 0; devsw[i] != NULL; i++) - if (devsw[i]->dv_init != NULL) - (devsw[i]->dv_init)(); - printf("\n"); printf("%s, Revision %s\n", bootprog_name, bootprog_rev); printf("(%s, %s)\n", bootprog_maker, bootprog_date); @@ -124,6 +125,16 @@ loader_main(struct loader_callbacks *cb, archsw.arch_copyin = userboot_copyin; archsw.arch_copyout = userboot_copyout; archsw.arch_readin = userboot_readin; +#if defined(USERBOOT_ZFS_SUPPORT) + archsw.arch_zfs_probe = userboot_zfs_probe; +#endif + + /* + * March through the device switch probing for things. + */ + for (i = 0; devsw[i] != NULL; i++) + if (devsw[i]->dv_init != NULL) + (devsw[i]->dv_init)(); extract_currdev(); @@ -146,6 +157,19 @@ extract_currdev(void) //bzero(&dev, sizeof(dev)); +#if defined(USERBOOT_ZFS_SUPPORT) + if (userboot_zfs_found) { + struct zfs_devdesc zdev; + + /* Leave the pool/root guid's unassigned */ + bzero(&zdev, sizeof(zdev)); + zdev.d_dev = &zfs_dev; + zdev.d_type = zdev.d_dev->dv_type; + + dev = *(struct disk_devdesc *)&zdev; + } else +#endif + if (userboot_disk_maxunit > 0) { dev.d_dev = &userboot_disk; dev.d_type = dev.d_dev->dv_type; @@ -172,6 +196,49 @@ extract_currdev(void) env_noset, env_nounset); } +#if defined(USERBOOT_ZFS_SUPPORT) +static void +userboot_zfs_probe(void) +{ + char devname[32]; + uint64_t pool_guid; + int unit; + + /* + * Open all the disks we can find and see if we can reconstruct + * ZFS pools from them. Record if any were found. + */ + for (unit = 0; unit < userboot_disk_maxunit; unit++) { + sprintf(devname, "disk%d:", unit); + pool_guid = 0; + zfs_probe_dev(devname, &pool_guid); + if (pool_guid != 0) + userboot_zfs_found = 1; + } +} + +COMMAND_SET(lszfs, "lszfs", "list child datasets of a zfs dataset", + command_lszfs); + +static int +command_lszfs(int argc, char *argv[]) +{ + int err; + + if (argc != 2) { + command_errmsg = "a single dataset must be supplied"; + return (CMD_ERROR); + } + + err = zfs_list(argv[1]); + if (err != 0) { + command_errmsg = strerror(err); + return (CMD_ERROR); + } + return (CMD_OK); +} +#endif /* USERBOOT_ZFS_SUPPORT */ + COMMAND_SET(quit, "quit", "exit the loader", command_quit); static int Modified: stable/10/usr.sbin/bhyveload/bhyveload.c ============================================================================== --- stable/10/usr.sbin/bhyveload/bhyveload.c Sun Jul 20 22:13:51 2014 (r268931) +++ stable/10/usr.sbin/bhyveload/bhyveload.c Sun Jul 20 22:54:03 2014 (r268932) @@ -88,9 +88,12 @@ __FBSDID("$FreeBSD$"); #define GB (1024 * 1024 * 1024UL) #define BSP 0 +#define NDISKS 32 + static char *host_base; static struct termios term, oldterm; -static int disk_fd = -1; +static int disk_fd[NDISKS]; +static int ndisks; static int consin_fd, consout_fd; static char *vmname, *progname; @@ -287,9 +290,9 @@ cb_diskread(void *arg, int unit, uint64_ { ssize_t n; - if (unit != 0 || disk_fd == -1) + if (unit < 0 || unit >= ndisks ) return (EIO); - n = pread(disk_fd, to, size, from); + n = pread(disk_fd[unit], to, size, from); if (n < 0) return (errno); *resid = size - n; @@ -301,7 +304,7 @@ cb_diskioctl(void *arg, int unit, u_long { struct stat sb; - if (unit != 0 || disk_fd == -1) + if (unit < 0 || unit >= ndisks) return (EBADF); switch (cmd) { @@ -309,7 +312,7 @@ cb_diskioctl(void *arg, int unit, u_long *(u_int *)data = 512; break; case DIOCGMEDIASIZE: - if (fstat(disk_fd, &sb) == 0) + if (fstat(disk_fd[unit], &sb) == 0) *(off_t *)data = sb.st_size; else return (ENOTTY); @@ -601,6 +604,26 @@ altcons_open(char *path) return (err); } +static int +disk_open(char *path) +{ + int err, fd; + + if (ndisks > NDISKS) + return (ERANGE); + + err = 0; + fd = open(path, O_RDONLY); + + if (fd > 0) { + disk_fd[ndisks] = fd; + ndisks++; + } else + err = errno; + + return (err); +} + static void usage(void) { @@ -620,12 +643,10 @@ main(int argc, char** argv) void (*func)(struct loader_callbacks *, void *, int, int); uint64_t mem_size; int opt, error; - char *disk_image; progname = basename(argv[0]); mem_size = 256 * MB; - disk_image = NULL; consin_fd = STDIN_FILENO; consout_fd = STDOUT_FILENO; @@ -637,8 +658,11 @@ main(int argc, char** argv) if (error != 0) errx(EX_USAGE, "Could not open '%s'", optarg); break; + case 'd': - disk_image = optarg; + error = disk_open(optarg); + if (error != 0) + errx(EX_USAGE, "Could not open '%s'", optarg); break; case 'e': @@ -704,12 +728,8 @@ main(int argc, char** argv) return (1); } - if (disk_image) { - disk_fd = open(disk_image, O_RDONLY); - } - addenv("smbios.bios.vendor=BHYVE"); addenv("boot_serial=1"); - func(&cb, NULL, USERBOOT_VERSION_3, disk_fd >= 0); + func(&cb, NULL, USERBOOT_VERSION_3, ndisks); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 00:22:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31048872; Mon, 21 Jul 2014 00:22:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00AEF2D42; Mon, 21 Jul 2014 00:22:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6L0LxET072265; Mon, 21 Jul 2014 00:21:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6L0Lv1W072248; Mon, 21 Jul 2014 00:21:57 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201407210021.s6L0Lv1W072248@svn.freebsd.org> From: John Baldwin Date: Mon, 21 Jul 2014 00:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268933 - in stable/10: share/man/man4 sys/amd64/conf sys/conf sys/dev/virtio/random sys/i386/conf sys/modules/virtio sys/modules/virtio/random sys/sys usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 00:22:00 -0000 Author: jhb Date: Mon Jul 21 00:21:56 2014 New Revision: 268933 URL: http://svnweb.freebsd.org/changeset/base/268933 Log: MFC 260847,264055,264867: - Add a very simple virtio_random(4) driver for FreeBSD guests to harvest entropy from hypervisors. - Add support to bhyve for the virtio RNG entropy-source device to provide entry to bhyve guests. Added: stable/10/share/man/man4/virtio_random.4 - copied unchanged from r260847, head/share/man/man4/virtio_random.4 stable/10/sys/dev/virtio/random/ - copied from r260847, head/sys/dev/virtio/random/ stable/10/sys/modules/virtio/random/ - copied from r260847, head/sys/modules/virtio/random/ stable/10/usr.sbin/bhyve/pci_virtio_rnd.c - copied unchanged from r264055, head/usr.sbin/bhyve/pci_virtio_rnd.c Modified: stable/10/share/man/man4/Makefile stable/10/sys/amd64/conf/NOTES stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/dev/virtio/random/virtio_random.c stable/10/sys/i386/conf/NOTES stable/10/sys/modules/virtio/Makefile stable/10/sys/sys/random.h stable/10/usr.sbin/bhyve/Makefile stable/10/usr.sbin/bhyve/bhyve.8 stable/10/usr.sbin/bhyve/virtio.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Sun Jul 20 22:54:03 2014 (r268932) +++ stable/10/share/man/man4/Makefile Mon Jul 21 00:21:56 2014 (r268933) @@ -555,6 +555,7 @@ MAN= aac.4 \ ${_virtio.4} \ ${_virtio_balloon.4} \ ${_virtio_blk.4} \ + ${_virtio_random.4} \ ${_virtio_scsi.4} \ vkbd.4 \ vlan.4 \ @@ -804,6 +805,7 @@ _nxge.4= nxge.4 _virtio.4= virtio.4 _virtio_balloon.4=virtio_balloon.4 _virtio_blk.4= virtio_blk.4 +_virtio_random.4= virtio_random.4 _virtio_scsi.4= virtio_scsi.4 _vmx.4= vmx.4 _vtnet.4= vtnet.4 Copied: stable/10/share/man/man4/virtio_random.4 (from r260847, head/share/man/man4/virtio_random.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/virtio_random.4 Mon Jul 21 00:21:56 2014 (r268933, copy of r260847, head/share/man/man4/virtio_random.4) @@ -0,0 +1,61 @@ +.\" Copyright (c) 2013 Bryan Venteicher +.\" 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 December 28, 2013 +.Dt VIRTIO_RANDOM 4 +.Os +.Sh NAME +.Nm virtio_random +.Nd VirtIO Entropy driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device virtio_random" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +virtio_random_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +device driver provides support for VirtIO entropy devices. +.Pp +The entropy device supplies high-quality randomness from the +hypervisor to the guest. +.Sh SEE ALSO +.Xr random 4 +.Xr virtio 4 +.Sh HISTORY +The +.Nm +driver was written by +.An Bryan Venteicher Aq bryanv@FreeBSD.org . Modified: stable/10/sys/amd64/conf/NOTES ============================================================================== --- stable/10/sys/amd64/conf/NOTES Sun Jul 20 22:54:03 2014 (r268932) +++ stable/10/sys/amd64/conf/NOTES Mon Jul 21 00:21:56 2014 (r268933) @@ -472,6 +472,7 @@ device vtnet # VirtIO Ethernet device device virtio_blk # VirtIO Block device device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device +device virtio_random # VirtIO Entropy device device hyperv # HyperV drivers Modified: stable/10/sys/conf/files.amd64 ============================================================================== --- stable/10/sys/conf/files.amd64 Sun Jul 20 22:54:03 2014 (r268932) +++ stable/10/sys/conf/files.amd64 Mon Jul 21 00:21:56 2014 (r268933) @@ -448,6 +448,7 @@ dev/virtio/network/if_vtnet.c optional dev/virtio/block/virtio_blk.c optional virtio_blk dev/virtio/balloon/virtio_balloon.c optional virtio_balloon dev/virtio/scsi/virtio_scsi.c optional virtio_scsi +dev/virtio/random/virtio_random.c optional virtio_random isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/imgact_binmisc.c optional imagact_binmisc Modified: stable/10/sys/conf/files.i386 ============================================================================== --- stable/10/sys/conf/files.i386 Sun Jul 20 22:54:03 2014 (r268932) +++ stable/10/sys/conf/files.i386 Mon Jul 21 00:21:56 2014 (r268933) @@ -413,6 +413,7 @@ dev/virtio/network/if_vtnet.c optional dev/virtio/block/virtio_blk.c optional virtio_blk dev/virtio/balloon/virtio_balloon.c optional virtio_balloon dev/virtio/scsi/virtio_scsi.c optional virtio_scsi +dev/virtio/random/virtio_random.c optional virtio_random i386/acpica/acpi_machdep.c optional acpi acpi_wakecode.o optional acpi \ dependency "$S/i386/acpica/acpi_wakecode.S assym.s" \ Modified: stable/10/sys/dev/virtio/random/virtio_random.c ============================================================================== --- head/sys/dev/virtio/random/virtio_random.c Sat Jan 18 06:14:38 2014 (r260847) +++ stable/10/sys/dev/virtio/random/virtio_random.c Mon Jul 21 00:21:56 2014 (r268933) @@ -156,7 +156,7 @@ vtrnd_detach(device_t dev) sc = device_get_softc(dev); - callout_stop(&sc->vtrnd_callout); + callout_drain(&sc->vtrnd_callout); return (0); } Modified: stable/10/sys/i386/conf/NOTES ============================================================================== --- stable/10/sys/i386/conf/NOTES Sun Jul 20 22:54:03 2014 (r268932) +++ stable/10/sys/i386/conf/NOTES Mon Jul 21 00:21:56 2014 (r268933) @@ -800,6 +800,7 @@ device vtnet # VirtIO Ethernet device device virtio_blk # VirtIO Block device device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device +device virtio_random # VirtIO Entropy device device hyperv # HyperV drivers Modified: stable/10/sys/modules/virtio/Makefile ============================================================================== --- stable/10/sys/modules/virtio/Makefile Sun Jul 20 22:54:03 2014 (r268932) +++ stable/10/sys/modules/virtio/Makefile Mon Jul 21 00:21:56 2014 (r268933) @@ -23,6 +23,6 @@ # SUCH DAMAGE. # -SUBDIR= virtio pci network block balloon scsi +SUBDIR= virtio pci network block balloon scsi random .include Modified: stable/10/sys/sys/random.h ============================================================================== --- stable/10/sys/sys/random.h Sun Jul 20 22:54:03 2014 (r268932) +++ stable/10/sys/sys/random.h Mon Jul 21 00:21:56 2014 (r268933) @@ -56,6 +56,7 @@ enum esource { RANDOM_PURE_RDRAND, RANDOM_PURE_NEHEMIAH, RANDOM_PURE_RNDTEST, + RANDOM_PURE_VIRTIO, ENTROPYSOURCE }; void random_harvest(void *, u_int, u_int, enum esource); Modified: stable/10/usr.sbin/bhyve/Makefile ============================================================================== --- stable/10/usr.sbin/bhyve/Makefile Sun Jul 20 22:54:03 2014 (r268932) +++ stable/10/usr.sbin/bhyve/Makefile Mon Jul 21 00:21:56 2014 (r268933) @@ -26,6 +26,7 @@ SRCS= \ pci_passthru.c \ pci_virtio_block.c \ pci_virtio_net.c \ + pci_virtio_rnd.c \ pci_uart.c \ pm.c \ pmtmr.c \ Modified: stable/10/usr.sbin/bhyve/bhyve.8 ============================================================================== --- stable/10/usr.sbin/bhyve/bhyve.8 Sun Jul 20 22:54:03 2014 (r268932) +++ stable/10/usr.sbin/bhyve/bhyve.8 Mon Jul 21 00:21:56 2014 (r268933) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 27, 2014 +.Dd April 2, 2014 .Dt BHYVE 8 .Os .Sh NAME @@ -126,6 +126,8 @@ PCI pass-through device. Virtio network interface. .It Li virtio-blk Virtio block storage interface. +.It Li virtio-rnd +Virtio RNG interface. .It Li ahci-cd AHCI controller attached to an ATAPI CD/DVD. .It Li ahci-hd Copied: stable/10/usr.sbin/bhyve/pci_virtio_rnd.c (from r264055, head/usr.sbin/bhyve/pci_virtio_rnd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/bhyve/pci_virtio_rnd.c Mon Jul 21 00:21:56 2014 (r268933, copy of r264055, head/usr.sbin/bhyve/pci_virtio_rnd.c) @@ -0,0 +1,189 @@ +/*- + * Copyright (c) 2014 Nahanni Systems Inc. + * 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 + * in this position and unchanged. + * 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. + */ + +/* + * virtio entropy device emulation. + * Randomness is sourced from /dev/random which does not block + * once it has been seeded at bootup. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "bhyverun.h" +#include "pci_emul.h" +#include "virtio.h" + +#define VTRND_RINGSZ 64 + + +static int pci_vtrnd_debug; +#define DPRINTF(params) if (pci_vtrnd_debug) printf params +#define WPRINTF(params) printf params + +/* + * Per-device softc + */ +struct pci_vtrnd_softc { + struct virtio_softc vrsc_vs; + struct vqueue_info vrsc_vq; + pthread_mutex_t vrsc_mtx; + uint64_t vrsc_cfg; + int vrsc_fd; +}; + +static void pci_vtrnd_reset(void *); +static void pci_vtrnd_notify(void *, struct vqueue_info *); + +static struct virtio_consts vtrnd_vi_consts = { + "vtrnd", /* our name */ + 1, /* we support 1 virtqueue */ + 0, /* config reg size */ + pci_vtrnd_reset, /* reset */ + pci_vtrnd_notify, /* device-wide qnotify */ + NULL, /* read virtio config */ + NULL, /* write virtio config */ + 0, /* our capabilities */ +}; + + +static void +pci_vtrnd_reset(void *vsc) +{ + struct pci_vtrnd_softc *sc; + + sc = vsc; + + DPRINTF(("vtrnd: device reset requested !\n")); + vi_reset_dev(&sc->vrsc_vs); +} + + +static void +pci_vtrnd_notify(void *vsc, struct vqueue_info *vq) +{ + struct iovec iov; + struct pci_vtrnd_softc *sc; + int len; + + sc = vsc; + + vq_startchains(vq); + + if (sc->vrsc_fd < 0) { + vq_endchains(vq, 0); + return; + } + + while (vq_has_descs(vq)) { + vq_getchain(vq, &iov, 1, NULL); + + len = read(sc->vrsc_fd, iov.iov_base, iov.iov_len); + + DPRINTF(("vtrnd: vtrnd_notify(): %d\r\n", len)); + + /* Catastrophe if unable to read from /dev/random */ + assert(len > 0); + + /* + * Release this chain and handle more + */ + vq_relchain(vq, len); + } + vq_endchains(vq, 1); /* Generate interrupt if appropriate. */ +} + + +static int +pci_vtrnd_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) +{ + struct pci_vtrnd_softc *sc; + int fd; + int len; + uint8_t v; + + /* + * Should always be able to open /dev/random. + */ + fd = open("/dev/random", O_RDONLY | O_NONBLOCK); + + assert(fd >= 0); + + /* + * Check that device is seeded and non-blocking. + */ + len = read(fd, &v, sizeof(v)); + if (len <= 0) { + WPRINTF(("vtrnd: /dev/random not ready, read(): %d", len)); + return (1); + } + + sc = malloc(sizeof(struct pci_vtrnd_softc)); + memset(sc, 0, sizeof(struct pci_vtrnd_softc)); + + vi_softc_linkup(&sc->vrsc_vs, &vtrnd_vi_consts, sc, pi, &sc->vrsc_vq); + sc->vrsc_vs.vs_mtx = &sc->vrsc_mtx; + + sc->vrsc_vq.vq_qsize = VTRND_RINGSZ; + + /* keep /dev/random opened while emulating */ + sc->vrsc_fd = fd; + + /* initialize config space */ + pci_set_cfgdata16(pi, PCIR_DEVICE, VIRTIO_DEV_RANDOM); + pci_set_cfgdata16(pi, PCIR_VENDOR, VIRTIO_VENDOR); + pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_CRYPTO); + pci_set_cfgdata16(pi, PCIR_SUBDEV_0, VIRTIO_TYPE_ENTROPY); + + if (vi_intr_init(&sc->vrsc_vs, 1, fbsdrun_virtio_msix())) + return (1); + vi_set_io_bar(&sc->vrsc_vs, 0); + + return (0); +} + + +struct pci_devemu pci_de_vrnd = { + .pe_emu = "virtio-rnd", + .pe_init = pci_vtrnd_init, + .pe_barwrite = vi_pci_write, + .pe_barread = vi_pci_read +}; +PCI_EMUL_SET(pci_de_vrnd); Modified: stable/10/usr.sbin/bhyve/virtio.h ============================================================================== --- stable/10/usr.sbin/bhyve/virtio.h Sun Jul 20 22:54:03 2014 (r268932) +++ stable/10/usr.sbin/bhyve/virtio.h Mon Jul 21 00:21:56 2014 (r268933) @@ -209,6 +209,7 @@ struct vring_used { #define VIRTIO_VENDOR 0x1AF4 #define VIRTIO_DEV_NET 0x1000 #define VIRTIO_DEV_BLOCK 0x1001 +#define VIRTIO_DEV_RANDOM 0x1002 /* * PCI config space constants. From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 02:17:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3E7DBF0; Mon, 21 Jul 2014 02:17:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8A7D25E3; Mon, 21 Jul 2014 02:17:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6L2HTkt024772; Mon, 21 Jul 2014 02:17:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6L2HTaK024769; Mon, 21 Jul 2014 02:17:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201407210217.s6L2HTaK024769@svn.freebsd.org> From: John Baldwin Date: Mon, 21 Jul 2014 02:17:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268934 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 02:17:29 -0000 Author: jhb Date: Mon Jul 21 02:17:28 2014 New Revision: 268934 URL: http://svnweb.freebsd.org/changeset/base/268934 Log: MFC 264916,267611: Provide a very basic stub for the 8042 PS/2 keyboard controller. Added: stable/10/usr.sbin/bhyve/atkbdc.c - copied, changed from r264916, head/usr.sbin/bhyve/atkbdc.c Modified: stable/10/usr.sbin/bhyve/Makefile stable/10/usr.sbin/bhyve/bhyverun.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/Makefile ============================================================================== --- stable/10/usr.sbin/bhyve/Makefile Mon Jul 21 00:21:56 2014 (r268933) +++ stable/10/usr.sbin/bhyve/Makefile Mon Jul 21 02:17:28 2014 (r268934) @@ -9,6 +9,7 @@ DEBUG_FLAGS= -g -O0 MAN= bhyve.8 SRCS= \ + atkbdc.c \ acpi.c \ bhyverun.c \ block_if.c \ Copied and modified: stable/10/usr.sbin/bhyve/atkbdc.c (from r264916, head/usr.sbin/bhyve/atkbdc.c) ============================================================================== --- head/usr.sbin/bhyve/atkbdc.c Fri Apr 25 13:38:18 2014 (r264916, copy source) +++ stable/10/usr.sbin/bhyve/atkbdc.c Mon Jul 21 02:17:28 2014 (r268934) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #define KBD_DATA_PORT 0x60 #define KBD_STS_CTL_PORT 0x64 -#define KDB_SYS_FLAG 0x4 +#define KBD_SYS_FLAG 0x4 #define KBDC_RESET 0xfe @@ -66,7 +66,7 @@ atkbdc_sts_ctl_handler(struct vmctx *ctx retval = INOUT_OK; if (in) { - *eax = KDB_SYS_FLAG; /* system passed POST */ + *eax = KBD_SYS_FLAG; /* system passed POST */ } else { switch (*eax) { case KBDC_RESET: /* Pulse "reset" line. */ Modified: stable/10/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.c Mon Jul 21 00:21:56 2014 (r268933) +++ stable/10/usr.sbin/bhyve/bhyverun.c Mon Jul 21 02:17:28 2014 (r268934) @@ -315,10 +315,6 @@ vmexit_inout(struct vmctx *ctx, struct v if (vme->u.inout.string || vme->u.inout.rep) return (VMEXIT_ABORT); - /* Special case of guest reset */ - if (out && port == 0x64 && (uint8_t)eax == 0xFE) - return (vmexit_catch_reset()); - /* Extra-special case of host notifications */ if (out && port == GUEST_NIO_PORT) return (vmexit_handle_notify(ctx, vme, pvcpu, eax)); From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 02:39:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C1DCFD8; Mon, 21 Jul 2014 02:39:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6615E2783; Mon, 21 Jul 2014 02:39:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6L2dJwH034214; Mon, 21 Jul 2014 02:39:19 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6L2dHxo034200; Mon, 21 Jul 2014 02:39:17 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201407210239.s6L2dHxo034200@svn.freebsd.org> From: John Baldwin Date: Mon, 21 Jul 2014 02:39:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268935 - in stable/10: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/amd sys/amd64/vmm/intel usr.sbin/bhyve usr.sbin/bhyvectl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 02:39:19 -0000 Author: jhb Date: Mon Jul 21 02:39:17 2014 New Revision: 268935 URL: http://svnweb.freebsd.org/changeset/base/268935 Log: MFC 263780,264516,265062,265101,265203,265364: Add an ioctl to suspend a virtual machine (VM_SUSPEND). Add logic in the HLT exit handler to detect if the guest has put all vcpus to sleep permanently by executing a HLT with interrupts disabled. When this condition is detected the guest with be suspended with a reason of VM_SUSPEND_HALT and the bhyve(8) process will exit. This logic can be disabled via the tunable 'hw.vmm.halt_detection'. Modified: stable/10/lib/libvmmapi/vmmapi.c stable/10/lib/libvmmapi/vmmapi.h stable/10/sys/amd64/include/vmm.h stable/10/sys/amd64/include/vmm_dev.h stable/10/sys/amd64/vmm/amd/amdv.c stable/10/sys/amd64/vmm/intel/vmx.c stable/10/sys/amd64/vmm/vmm.c stable/10/sys/amd64/vmm/vmm_dev.c stable/10/usr.sbin/bhyve/bhyverun.c stable/10/usr.sbin/bhyvectl/bhyvectl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libvmmapi/vmmapi.c ============================================================================== --- stable/10/lib/libvmmapi/vmmapi.c Mon Jul 21 02:17:28 2014 (r268934) +++ stable/10/lib/libvmmapi/vmmapi.c Mon Jul 21 02:39:17 2014 (r268935) @@ -342,6 +342,16 @@ vm_run(struct vmctx *ctx, int vcpu, uint return (error); } +int +vm_suspend(struct vmctx *ctx, enum vm_suspend_how how) +{ + struct vm_suspend vmsuspend; + + bzero(&vmsuspend, sizeof(vmsuspend)); + vmsuspend.how = how; + return (ioctl(ctx->fd, VM_SUSPEND, &vmsuspend)); +} + static int vm_inject_exception_real(struct vmctx *ctx, int vcpu, int vector, int error_code, int error_code_valid) Modified: stable/10/lib/libvmmapi/vmmapi.h ============================================================================== --- stable/10/lib/libvmmapi/vmmapi.h Mon Jul 21 02:17:28 2014 (r268934) +++ stable/10/lib/libvmmapi/vmmapi.h Mon Jul 21 02:39:17 2014 (r268935) @@ -61,6 +61,7 @@ int vm_set_register(struct vmctx *ctx, i int vm_get_register(struct vmctx *ctx, int vcpu, int reg, uint64_t *retval); int vm_run(struct vmctx *ctx, int vcpu, uint64_t rip, struct vm_exit *ret_vmexit); +int vm_suspend(struct vmctx *ctx, enum vm_suspend_how how); int vm_apicid2vcpu(struct vmctx *ctx, int apicid); int vm_inject_exception(struct vmctx *ctx, int vcpu, int vec); int vm_inject_exception2(struct vmctx *ctx, int vcpu, int vec, int errcode); Modified: stable/10/sys/amd64/include/vmm.h ============================================================================== --- stable/10/sys/amd64/include/vmm.h Mon Jul 21 02:17:28 2014 (r268934) +++ stable/10/sys/amd64/include/vmm.h Mon Jul 21 02:39:17 2014 (r268935) @@ -29,6 +29,14 @@ #ifndef _VMM_H_ #define _VMM_H_ +enum vm_suspend_how { + VM_SUSPEND_NONE, + VM_SUSPEND_RESET, + VM_SUSPEND_POWEROFF, + VM_SUSPEND_HALT, + VM_SUSPEND_LAST +}; + #ifdef _KERNEL #define VM_MAX_NAMELEN 32 @@ -53,7 +61,8 @@ typedef int (*vmm_cleanup_func_t)(void); typedef void (*vmm_resume_func_t)(void); typedef void * (*vmi_init_func_t)(struct vm *vm, struct pmap *pmap); typedef int (*vmi_run_func_t)(void *vmi, int vcpu, register_t rip, - struct pmap *pmap, void *rendezvous_cookie); + struct pmap *pmap, void *rendezvous_cookie, + void *suspend_cookie); typedef void (*vmi_cleanup_func_t)(void *vmi); typedef int (*vmi_get_register_t)(void *vmi, int vcpu, int num, uint64_t *retval); @@ -114,6 +123,7 @@ int vm_get_seg_desc(struct vm *vm, int v int vm_set_seg_desc(struct vm *vm, int vcpu, int reg, struct seg_desc *desc); int vm_run(struct vm *vm, struct vm_run *vmrun); +int vm_suspend(struct vm *vm, enum vm_suspend_how how); int vm_inject_nmi(struct vm *vm, int vcpu); int vm_nmi_pending(struct vm *vm, int vcpuid); void vm_nmi_clear(struct vm *vm, int vcpuid); @@ -132,6 +142,7 @@ int vm_apicid2vcpuid(struct vm *vm, int void vm_activate_cpu(struct vm *vm, int vcpu); cpuset_t vm_active_cpus(struct vm *vm); struct vm_exit *vm_exitinfo(struct vm *vm, int vcpuid); +void vm_exit_suspended(struct vm *vm, int vcpuid, uint64_t rip); /* * Rendezvous all vcpus specified in 'dest' and execute 'func(arg)'. @@ -158,6 +169,13 @@ vcpu_rendezvous_pending(void *rendezvous return (*(uintptr_t *)rendezvous_cookie != 0); } +static __inline int +vcpu_suspended(void *suspend_cookie) +{ + + return (*(int *)suspend_cookie); +} + /* * Return 1 if device indicated by bus/slot/func is supposed to be a * pci passthrough device. @@ -308,9 +326,10 @@ enum vm_exitcode { VM_EXITCODE_PAGING, VM_EXITCODE_INST_EMUL, VM_EXITCODE_SPINUP_AP, - VM_EXITCODE_SPINDOWN_CPU, + VM_EXITCODE_DEPRECATED1, /* used to be SPINDOWN_CPU */ VM_EXITCODE_RENDEZVOUS, VM_EXITCODE_IOAPIC_EOI, + VM_EXITCODE_SUSPENDED, VM_EXITCODE_MAX }; @@ -372,6 +391,9 @@ struct vm_exit { struct { int vector; } ioapic_eoi; + struct { + enum vm_suspend_how how; + } suspended; } u; }; Modified: stable/10/sys/amd64/include/vmm_dev.h ============================================================================== --- stable/10/sys/amd64/include/vmm_dev.h Mon Jul 21 02:17:28 2014 (r268934) +++ stable/10/sys/amd64/include/vmm_dev.h Mon Jul 21 02:39:17 2014 (r268935) @@ -159,12 +159,17 @@ struct vm_hpet_cap { uint32_t capabilities; /* lower 32 bits of HPET capabilities */ }; +struct vm_suspend { + enum vm_suspend_how how; +}; + enum { /* general routines */ IOCNUM_ABIVERS = 0, IOCNUM_RUN = 1, IOCNUM_SET_CAPABILITY = 2, IOCNUM_GET_CAPABILITY = 3, + IOCNUM_SUSPEND = 4, /* memory apis */ IOCNUM_MAP_MEMORY = 10, @@ -212,6 +217,8 @@ enum { #define VM_RUN \ _IOWR('v', IOCNUM_RUN, struct vm_run) +#define VM_SUSPEND \ + _IOW('v', IOCNUM_SUSPEND, struct vm_suspend) #define VM_MAP_MEMORY \ _IOWR('v', IOCNUM_MAP_MEMORY, struct vm_memory_segment) #define VM_GET_MEMORY_SEG \ Modified: stable/10/sys/amd64/vmm/amd/amdv.c ============================================================================== --- stable/10/sys/amd64/vmm/amd/amdv.c Mon Jul 21 02:17:28 2014 (r268934) +++ stable/10/sys/amd64/vmm/amd/amdv.c Mon Jul 21 02:39:17 2014 (r268935) @@ -67,7 +67,8 @@ amdv_vminit(struct vm *vm, struct pmap * } static int -amdv_vmrun(void *arg, int vcpu, register_t rip, struct pmap *pmap, void *cookie) +amdv_vmrun(void *arg, int vcpu, register_t rip, struct pmap *pmap, + void *rptr, void *sptr) { printf("amdv_vmrun: not implemented\n"); Modified: stable/10/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx.c Mon Jul 21 02:17:28 2014 (r268934) +++ stable/10/sys/amd64/vmm/intel/vmx.c Mon Jul 21 02:39:17 2014 (r268935) @@ -2136,7 +2136,7 @@ vmx_exit_handle_nmi(struct vmx *vmx, int static int vmx_run(void *arg, int vcpu, register_t startrip, pmap_t pmap, - void *rendezvous_cookie) + void *rendezvous_cookie, void *suspend_cookie) { int rc, handled, launched; struct vmx *vmx; @@ -2193,9 +2193,10 @@ vmx_run(void *arg, int vcpu, register_t * pmap_invalidate_ept(). */ disable_intr(); - if (curthread->td_flags & (TDF_ASTPENDING | TDF_NEEDRESCHED)) { + if (vcpu_suspended(suspend_cookie)) { enable_intr(); - handled = vmx_exit_astpending(vmx, vcpu, vmexit); + vm_exit_suspended(vmx->vm, vcpu, vmcs_guest_rip()); + handled = UNHANDLED; break; } @@ -2205,6 +2206,12 @@ vmx_run(void *arg, int vcpu, register_t break; } + if (curthread->td_flags & (TDF_ASTPENDING | TDF_NEEDRESCHED)) { + enable_intr(); + handled = vmx_exit_astpending(vmx, vcpu, vmexit); + break; + } + vmx_inject_interrupts(vmx, vcpu, vlapic); vmx_run_trace(vmx, vcpu); rc = vmx_enter_guest(vmxctx, vmx, launched); Modified: stable/10/sys/amd64/vmm/vmm.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm.c Mon Jul 21 02:17:28 2014 (r268934) +++ stable/10/sys/amd64/vmm/vmm.c Mon Jul 21 02:39:17 2014 (r268935) @@ -139,6 +139,11 @@ struct vm { cpuset_t rendezvous_done_cpus; void *rendezvous_arg; vm_rendezvous_func_t rendezvous_func; + + int suspend; + volatile cpuset_t suspended_cpus; + + volatile cpuset_t halted_cpus; }; static int vmm_initialized; @@ -149,8 +154,8 @@ static struct vmm_ops *ops; #define VMM_RESUME() (ops != NULL ? (*ops->resume)() : 0) #define VMINIT(vm, pmap) (ops != NULL ? (*ops->vminit)(vm, pmap): NULL) -#define VMRUN(vmi, vcpu, rip, pmap, rptr) \ - (ops != NULL ? (*ops->vmrun)(vmi, vcpu, rip, pmap, rptr) : ENXIO) +#define VMRUN(vmi, vcpu, rip, pmap, rptr, sptr) \ + (ops != NULL ? (*ops->vmrun)(vmi, vcpu, rip, pmap, rptr, sptr) : ENXIO) #define VMCLEANUP(vmi) (ops != NULL ? (*ops->vmcleanup)(vmi) : NULL) #define VMSPACE_ALLOC(min, max) \ (ops != NULL ? (*ops->vmspace_alloc)(min, max) : NULL) @@ -184,12 +189,20 @@ static VMM_STAT(VCPU_TOTAL_RUNTIME, "vcp SYSCTL_NODE(_hw, OID_AUTO, vmm, CTLFLAG_RW, NULL, NULL); +/* + * Halt the guest if all vcpus are executing a HLT instruction with + * interrupts disabled. + */ +static int halt_detection_enabled = 1; +TUNABLE_INT("hw.vmm.halt_detection", &halt_detection_enabled); +SYSCTL_INT(_hw_vmm, OID_AUTO, halt_detection, CTLFLAG_RDTUN, + &halt_detection_enabled, 0, + "Halt VM if all vcpus execute HLT with interrupts disabled"); + static int vmm_ipinum; SYSCTL_INT(_hw_vmm, OID_AUTO, ipinum, CTLFLAG_RD, &vmm_ipinum, 0, "IPI vector used for vcpu notifications"); -static void vm_deactivate_cpu(struct vm *vm, int vcpuid); - static void vcpu_cleanup(struct vm *vm, int i) { @@ -1003,56 +1016,73 @@ vm_handle_rendezvous(struct vm *vm, int static int vm_handle_hlt(struct vm *vm, int vcpuid, bool intr_disabled, bool *retu) { - struct vm_exit *vmexit; struct vcpu *vcpu; - int t, timo, spindown; + const char *wmesg; + int t, vcpu_halted, vm_halted; + + KASSERT(!CPU_ISSET(vcpuid, &vm->halted_cpus), ("vcpu already halted")); vcpu = &vm->vcpu[vcpuid]; - spindown = 0; + vcpu_halted = 0; + vm_halted = 0; vcpu_lock(vcpu); + while (1) { + /* + * Do a final check for pending NMI or interrupts before + * really putting this thread to sleep. Also check for + * software events that would cause this vcpu to wakeup. + * + * These interrupts/events could have happened after the + * vcpu returned from VMRUN() and before it acquired the + * vcpu lock above. + */ + if (vm->rendezvous_func != NULL || vm->suspend) + break; + if (vm_nmi_pending(vm, vcpuid)) + break; + if (!intr_disabled) { + if (vm_extint_pending(vm, vcpuid) || + vlapic_pending_intr(vcpu->vlapic, NULL)) { + break; + } + } - /* - * Do a final check for pending NMI or interrupts before - * really putting this thread to sleep. - * - * These interrupts could have happened any time after we - * returned from VMRUN() and before we grabbed the vcpu lock. - */ - if (!vm_nmi_pending(vm, vcpuid) && - (intr_disabled || !vlapic_pending_intr(vcpu->vlapic, NULL))) { - t = ticks; - vcpu_require_state_locked(vcpu, VCPU_SLEEPING); - if (vlapic_enabled(vcpu->vlapic)) { - /* - * XXX msleep_spin() is not interruptible so use the - * 'timo' to put an upper bound on the sleep time. - */ - timo = hz; - msleep_spin(vcpu, &vcpu->mtx, "vmidle", timo); + /* + * Some Linux guests implement "halt" by having all vcpus + * execute HLT with interrupts disabled. 'halted_cpus' keeps + * track of the vcpus that have entered this state. When all + * vcpus enter the halted state the virtual machine is halted. + */ + if (intr_disabled) { + wmesg = "vmhalt"; + VCPU_CTR0(vm, vcpuid, "Halted"); + if (!vcpu_halted && halt_detection_enabled) { + vcpu_halted = 1; + CPU_SET_ATOMIC(vcpuid, &vm->halted_cpus); + } + if (CPU_CMP(&vm->halted_cpus, &vm->active_cpus) == 0) { + vm_halted = 1; + break; + } } else { - /* - * Spindown the vcpu if the apic is disabled and it - * had entered the halted state. - */ - spindown = 1; + wmesg = "vmidle"; } + + t = ticks; + vcpu_require_state_locked(vcpu, VCPU_SLEEPING); + msleep_spin(vcpu, &vcpu->mtx, wmesg, 0); vcpu_require_state_locked(vcpu, VCPU_FROZEN); vmm_stat_incr(vm, vcpuid, VCPU_IDLE_TICKS, ticks - t); } + + if (vcpu_halted) + CPU_CLR_ATOMIC(vcpuid, &vm->halted_cpus); + vcpu_unlock(vcpu); - /* - * Since 'vm_deactivate_cpu()' grabs a sleep mutex we must call it - * outside the confines of the vcpu spinlock. - */ - if (spindown) { - *retu = true; - vmexit = vm_exitinfo(vm, vcpuid); - vmexit->exitcode = VM_EXITCODE_SPINDOWN_CPU; - vm_deactivate_cpu(vm, vcpuid); - VCPU_CTR0(vm, vcpuid, "spinning down cpu"); - } + if (vm_halted) + vm_suspend(vm, VM_SUSPEND_HALT); return (0); } @@ -1152,6 +1182,100 @@ vm_handle_inst_emul(struct vm *vm, int v return (error); } +static int +vm_handle_suspend(struct vm *vm, int vcpuid, bool *retu) +{ + int i, done; + struct vcpu *vcpu; + + done = 0; + vcpu = &vm->vcpu[vcpuid]; + + CPU_SET_ATOMIC(vcpuid, &vm->suspended_cpus); + + /* + * Wait until all 'active_cpus' have suspended themselves. + * + * Since a VM may be suspended at any time including when one or + * more vcpus are doing a rendezvous we need to call the rendezvous + * handler while we are waiting to prevent a deadlock. + */ + vcpu_lock(vcpu); + while (1) { + if (CPU_CMP(&vm->suspended_cpus, &vm->active_cpus) == 0) { + VCPU_CTR0(vm, vcpuid, "All vcpus suspended"); + break; + } + + if (vm->rendezvous_func == NULL) { + VCPU_CTR0(vm, vcpuid, "Sleeping during suspend"); + vcpu_require_state_locked(vcpu, VCPU_SLEEPING); + msleep_spin(vcpu, &vcpu->mtx, "vmsusp", hz); + vcpu_require_state_locked(vcpu, VCPU_FROZEN); + } else { + VCPU_CTR0(vm, vcpuid, "Rendezvous during suspend"); + vcpu_unlock(vcpu); + vm_handle_rendezvous(vm, vcpuid); + vcpu_lock(vcpu); + } + } + vcpu_unlock(vcpu); + + /* + * Wakeup the other sleeping vcpus and return to userspace. + */ + for (i = 0; i < VM_MAXCPU; i++) { + if (CPU_ISSET(i, &vm->suspended_cpus)) { + vcpu_notify_event(vm, i, false); + } + } + + *retu = true; + return (0); +} + +int +vm_suspend(struct vm *vm, enum vm_suspend_how how) +{ + int i; + + if (how <= VM_SUSPEND_NONE || how >= VM_SUSPEND_LAST) + return (EINVAL); + + if (atomic_cmpset_int(&vm->suspend, 0, how) == 0) { + VM_CTR2(vm, "virtual machine already suspended %d/%d", + vm->suspend, how); + return (EALREADY); + } + + VM_CTR1(vm, "virtual machine successfully suspended %d", how); + + /* + * Notify all active vcpus that they are now suspended. + */ + for (i = 0; i < VM_MAXCPU; i++) { + if (CPU_ISSET(i, &vm->active_cpus)) + vcpu_notify_event(vm, i, false); + } + + return (0); +} + +void +vm_exit_suspended(struct vm *vm, int vcpuid, uint64_t rip) +{ + struct vm_exit *vmexit; + + KASSERT(vm->suspend > VM_SUSPEND_NONE && vm->suspend < VM_SUSPEND_LAST, + ("vm_exit_suspended: invalid suspend type %d", vm->suspend)); + + vmexit = vm_exitinfo(vm, vcpuid); + vmexit->rip = rip; + vmexit->inst_length = 0; + vmexit->exitcode = VM_EXITCODE_SUSPENDED; + vmexit->u.suspended.how = vm->suspend; +} + int vm_run(struct vm *vm, struct vm_run *vmrun) { @@ -1162,12 +1286,15 @@ vm_run(struct vm *vm, struct vm_run *vmr struct vm_exit *vme; bool retu, intr_disabled; pmap_t pmap; + void *rptr, *sptr; vcpuid = vmrun->cpuid; if (vcpuid < 0 || vcpuid >= VM_MAXCPU) return (EINVAL); + rptr = &vm->rendezvous_func; + sptr = &vm->suspend; pmap = vmspace_pmap(vm->vmspace); vcpu = &vm->vcpu[vcpuid]; vme = &vcpu->exitinfo; @@ -1187,7 +1314,7 @@ restart: restore_guest_fpustate(vcpu); vcpu_require_state(vm, vcpuid, VCPU_RUNNING); - error = VMRUN(vm->cookie, vcpuid, rip, pmap, &vm->rendezvous_func); + error = VMRUN(vm->cookie, vcpuid, rip, pmap, rptr, sptr); vcpu_require_state(vm, vcpuid, VCPU_FROZEN); save_guest_fpustate(vcpu); @@ -1200,6 +1327,9 @@ restart: if (error == 0) { retu = false; switch (vme->exitcode) { + case VM_EXITCODE_SUSPENDED: + error = vm_handle_suspend(vm, vcpuid, &retu); + break; case VM_EXITCODE_IOAPIC_EOI: vioapic_process_eoi(vm, vcpuid, vme->u.ioapic_eoi.vector); @@ -1567,30 +1697,6 @@ vm_activate_cpu(struct vm *vm, int vcpui CPU_SET_ATOMIC(vcpuid, &vm->active_cpus); } -static void -vm_deactivate_cpu(struct vm *vm, int vcpuid) -{ - - KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, - ("vm_deactivate_cpu: invalid vcpuid %d", vcpuid)); - KASSERT(CPU_ISSET(vcpuid, &vm->active_cpus), - ("vm_deactivate_cpu: vcpuid %d is not active", vcpuid)); - - VCPU_CTR0(vm, vcpuid, "deactivated"); - CPU_CLR_ATOMIC(vcpuid, &vm->active_cpus); - - /* - * If a vcpu rendezvous is in progress then it could be blocked - * on 'vcpuid' - unblock it before disappearing forever. - */ - mtx_lock(&vm->rendezvous_mtx); - if (vm->rendezvous_func != NULL) { - VCPU_CTR0(vm, vcpuid, "unblock rendezvous after deactivation"); - wakeup(&vm->rendezvous_func); - } - mtx_unlock(&vm->rendezvous_mtx); -} - cpuset_t vm_active_cpus(struct vm *vm) { Modified: stable/10/sys/amd64/vmm/vmm_dev.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_dev.c Mon Jul 21 02:17:28 2014 (r268934) +++ stable/10/sys/amd64/vmm/vmm_dev.c Mon Jul 21 02:39:17 2014 (r268935) @@ -166,6 +166,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c struct vm_stat_desc *statdesc; struct vm_x2apic *x2apic; struct vm_gpa_pte *gpapte; + struct vm_suspend *vmsuspend; sc = vmmdev_lookup2(cdev); if (sc == NULL) @@ -240,6 +241,10 @@ vmmdev_ioctl(struct cdev *cdev, u_long c vmrun = (struct vm_run *)data; error = vm_run(sc->vm, vmrun); break; + case VM_SUSPEND: + vmsuspend = (struct vm_suspend *)data; + error = vm_suspend(sc->vm, vmsuspend->how); + break; case VM_STAT_DESC: { statdesc = (struct vm_stat_desc *)data; error = vmm_stat_desc_copy(statdesc->index, Modified: stable/10/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.c Mon Jul 21 02:17:28 2014 (r268934) +++ stable/10/usr.sbin/bhyve/bhyverun.c Mon Jul 21 02:39:17 2014 (r268935) @@ -113,6 +113,7 @@ struct bhyvestats { uint64_t cpu_switch_rotate; uint64_t cpu_switch_direct; int io_reset; + int io_poweroff; } stats; struct mt_vmm_info { @@ -271,13 +272,6 @@ fbsdrun_deletecpu(struct vmctx *ctx, int } static int -vmexit_catch_reset(void) -{ - stats.io_reset++; - return (VMEXIT_RESET); -} - -static int vmexit_catch_inout(void) { return (VMEXIT_ABORT); @@ -327,8 +321,10 @@ vmexit_inout(struct vmctx *ctx, struct v case INOUT_OK: return (VMEXIT_CONTINUE); case INOUT_RESET: + stats.io_reset++; return (VMEXIT_RESET); case INOUT_POWEROFF: + stats.io_poweroff++; return (VMEXIT_POWEROFF); default: fprintf(stderr, "Unhandled %s%c 0x%04x\n", @@ -399,17 +395,6 @@ vmexit_spinup_ap(struct vmctx *ctx, stru } static int -vmexit_spindown_cpu(struct vmctx *ctx, struct vm_exit *vme, int *pvcpu) -{ - int lastcpu; - - lastcpu = fbsdrun_deletecpu(ctx, *pvcpu); - if (!lastcpu) - pthread_exit(NULL); - return (vmexit_catch_reset()); -} - -static int vmexit_vmx(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) { @@ -493,6 +478,45 @@ vmexit_inst_emul(struct vmctx *ctx, stru return (VMEXIT_CONTINUE); } +static pthread_mutex_t resetcpu_mtx = PTHREAD_MUTEX_INITIALIZER; +static pthread_cond_t resetcpu_cond = PTHREAD_COND_INITIALIZER; + +static int +vmexit_suspend(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) +{ + enum vm_suspend_how how; + + how = vmexit->u.suspended.how; + + fbsdrun_deletecpu(ctx, *pvcpu); + + if (*pvcpu != BSP) { + pthread_mutex_lock(&resetcpu_mtx); + pthread_cond_signal(&resetcpu_cond); + pthread_mutex_unlock(&resetcpu_mtx); + pthread_exit(NULL); + } + + pthread_mutex_lock(&resetcpu_mtx); + while (!CPU_EMPTY(&cpumask)) { + pthread_cond_wait(&resetcpu_cond, &resetcpu_mtx); + } + pthread_mutex_unlock(&resetcpu_mtx); + + switch (how) { + case VM_SUSPEND_RESET: + exit(0); + case VM_SUSPEND_POWEROFF: + exit(1); + case VM_SUSPEND_HALT: + exit(2); + default: + fprintf(stderr, "vmexit_suspend: invalid reason %d\n", how); + exit(100); + } + return (0); /* NOTREACHED */ +} + static vmexit_handler_t handler[VM_EXITCODE_MAX] = { [VM_EXITCODE_INOUT] = vmexit_inout, [VM_EXITCODE_VMX] = vmexit_vmx, @@ -502,7 +526,7 @@ static vmexit_handler_t handler[VM_EXITC [VM_EXITCODE_MTRAP] = vmexit_mtrap, [VM_EXITCODE_INST_EMUL] = vmexit_inst_emul, [VM_EXITCODE_SPINUP_AP] = vmexit_spinup_ap, - [VM_EXITCODE_SPINDOWN_CPU] = vmexit_spindown_cpu, + [VM_EXITCODE_SUSPENDED] = vmexit_suspend }; static void @@ -510,6 +534,7 @@ vm_loop(struct vmctx *ctx, int vcpu, uin { int error, rc, prevcpu; enum vm_exitcode exitcode; + enum vm_suspend_how how; if (vcpumap[vcpu] != NULL) { error = pthread_setaffinity_np(pthread_self(), @@ -541,7 +566,15 @@ vm_loop(struct vmctx *ctx, int vcpu, uin rip = vmexit[vcpu].rip; break; case VMEXIT_RESET: - exit(0); + case VMEXIT_POWEROFF: + if (rc == VMEXIT_RESET) + how = VM_SUSPEND_RESET; + else + how = VM_SUSPEND_POWEROFF; + error = vm_suspend(ctx, how); + assert(error == 0 || errno == EALREADY); + rip = vmexit[vcpu].rip + vmexit[vcpu].inst_length; + break; default: exit(1); } Modified: stable/10/usr.sbin/bhyvectl/bhyvectl.c ============================================================================== --- stable/10/usr.sbin/bhyvectl/bhyvectl.c Mon Jul 21 02:17:28 2014 (r268934) +++ stable/10/usr.sbin/bhyvectl/bhyvectl.c Mon Jul 21 02:39:17 2014 (r268935) @@ -191,13 +191,16 @@ usage(void) " [--get-highmem]\n" " [--get-gpa-pmap]\n" " [--assert-lapic-lvt=]\n" - " [--inject-nmi]\n", + " [--inject-nmi]\n" + " [--force-reset]\n" + " [--force-poweroff]\n", progname); exit(1); } static int get_stats, getcap, setcap, capval, get_gpa_pmap; static int inject_nmi, assert_lapic_lvt; +static int force_reset, force_poweroff; static const char *capname; static int create, destroy, get_lowmem, get_highmem; static uint64_t memsize; @@ -565,6 +568,8 @@ main(int argc, char *argv[]) { "create", NO_ARG, &create, 1 }, { "destroy", NO_ARG, &destroy, 1 }, { "inject-nmi", NO_ARG, &inject_nmi, 1 }, + { "force-reset", NO_ARG, &force_reset, 1 }, + { "force-poweroff", NO_ARG, &force_poweroff, 1 }, { NULL, 0, NULL, 0 } }; @@ -1534,6 +1539,12 @@ main(int argc, char *argv[]) printf("vm_run error %d\n", error); } + if (!error && force_reset) + error = vm_suspend(ctx, VM_SUSPEND_RESET); + + if (!error && force_poweroff) + error = vm_suspend(ctx, VM_SUSPEND_POWEROFF); + if (error) printf("errno = %d\n", errno); From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 04:48:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6329A2C; Mon, 21 Jul 2014 04:48:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1DC42292; Mon, 21 Jul 2014 04:48:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6L4m3WX095786; Mon, 21 Jul 2014 04:48:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6L4m3te095783; Mon, 21 Jul 2014 04:48:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407210448.s6L4m3te095783@svn.freebsd.org> From: Adrian Chadd Date: Mon, 21 Jul 2014 04:48:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268936 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 04:48:03 -0000 Author: adrian Date: Mon Jul 21 04:48:02 2014 New Revision: 268936 URL: http://svnweb.freebsd.org/changeset/base/268936 Log: Add the PCBGROUPS manpage. Thanks to wblock for helping me with this manpage. Added: head/share/man/man9/PCBGROUPS.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Jul 21 02:39:17 2014 (r268935) +++ head/share/man/man9/Makefile Mon Jul 21 04:48:02 2014 (r268936) @@ -188,6 +188,7 @@ MAN= accept_filter.9 \ osd.9 \ panic.9 \ pbuf.9 \ + PCBGROUPS.9 \ p_candebug.9 \ p_cansee.9 \ pci.9 \ Added: head/share/man/man9/PCBGROUPS.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/PCBGROUPS.9 Mon Jul 21 04:48:02 2014 (r268936) @@ -0,0 +1,228 @@ +.\" Copyright (c) 2014 Adrian Chadd +.\" 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. +.\" 3. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" 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 July 18, 2014 +.Dt PCBGROUPS 9 +.Os +.Sh NAME +.Nm PCBGROUPS +.Nd Distributed Protocol Control Block Groups +.Sh SYNOPSIS +.Ft void +.Fn in_pcbgroup_init(struct inpcbinfo *pcbinfo, u_int hashfields, int hash_nelements); +.Ft void +.Fn in_pcbgroup_destroy(struct inpcbinfo *pcbinfo); +.Ft struct inpcbgroup * +.Fn in_pcbgroup_byhash(struct inpcbinfo *pcbinfo, u_int hashtype, uint32_t hash); +.Ft struct inpcbgroup * +.Fn in_pcbgroup_byinpcb(struct inpcb *inp); +.Ft void +.Fn in_pcbgroup_update(struct inpcb *inp); +.Ft void +.Fn in_pcbgroup_update_mbuf(struct inpcb *inp, struct mbuf *m); +.Ft void +.Fn in_pcbgroup_remove(struct inpcb *inp); +.Ft int +.Fn in_pcbgroup_enabled(struct inpcbinfo *pcbinfo); +.Ft struct inpcbgroup * +.Fn in6_pcbgroup_byhash(struct inpcbinfo *pcbinfo, u_int hashtype, uint32_t hash); +.Pp +.Cd "options PCBGROUPS" +.Sh DESCRIPTION +PCBGROUPS, or "connection groups", are based on Willman, Rixner, and Cox's +2006 USENIX paper, +.Qo +An Evaluation of Network Stack Parallelization Strategies in Modern +Operating Systems +.Qc . +.Pp +The PCBGROUPS paper describes two main kind of connection groups. +The first, called ConnP-T, uses a pool of worker threads which +implement the network stack. +Serialization occurs when queuing work into and completing work from +the network stack. +No locking is required inside each worker thread. +.Pp +The second type of connection group, called ConnP-L, uses an array +of PCB groups rather than a single list. +Each PCB group is protected by its own lock. +.Pp +This implementation differs significantly from that described in the +paper, in that it attempts to introduce not just notions of affinity +for connections and distribute work so as to reduce lock contention, +but also align those notions with hardware work distribution strategies +such as RSS. +In this construction, connection groups supplement, rather than replace, +existing reservation tables for protocol 4-tuples, offering CPU-affine +lookup tables with minimal cache line migration and lock contention +during steady state operation. +.Pp +Internet protocols like UDP and TCP register to use connection groups +by providing an ipi_hashfields value other than IPI_HASHFIELDS_NONE. +This indicates to the connection group code whether a 2-tuple or +4-tuple is used as an argument to hashes that assign a connection to +a particular group. +This must be aligned with any hardware-offloaded distribution model, +such as RSS or similar approaches taken in embedded network boards. +Wildcard sockets require special handling, as in Willman 2006, and +are shared between connection groups while being protected by +group-local locks. +Connection establishment and teardown can be signficantly more +expensive than without connection groups, but that steady-state +processing can be significantly faster. +.Pp +Enabling PCBGROUPS in the kernel only provides the infrastructure +required to create and manage multiple PCB groups. +An implementation needs to fill in a few functions to provide PCB +group hash information in order for PCBs to be placed in a PCB group. +.Ss Operation +By default, each PCB info block (struct pcbinfo) has a single hash for +all PCB entries for the given protocol with a single lock protecting it. +This can be a significant source of lock contention on SMP hardware. +When a PCBGROUP is created, an array of separate hash tables are +created, each with its own lock. +A separate table for wildcard PCBs is provided. +By default, a PCBGROUP table is created for each available CPU. +The PCBGROUP code attempts to calculate a hash value from the given +PCB or mbuf when looking up a PCBGROUP. +While processing a received frame, +.Fn in_pcbgroup_byhash() +can be used in conjunction with either a hardware-provided hash +value +.Po +eg the +.Xr RSS 9 +calculated hash value provided by some NICs +.Pc +or a software-provided hash value in order to choose a PCBGROUP +table to query. +A single table lock is held while performing a wildcard match. +However, all of the table locks are acquired before modifying the +wildcard table. +The PCBGROUP tables operate in conjunction with the normal single PCB list +in a PCB info block. +Thus, inserting and removing a PCB will still incur the same costs +as without PCBGROUPS. +A protocol which uses PCBGROUPS should fall back to the normal PCB list +lookup if a call to the PCBGROUPS layer does not yield a lookup hit. +.Ss Usage +Initialize a PCBGROUP in a PCB info block +.Pq Vt "struct pcbinfo" +by calling +.Fn in_pcbgroup_init . +.Pp +Add a connection to a PCBGROUP with +.Fn in_pcbgroup_update . +Connections are removed by with +.Fn in_pcbgroup_remove . +These in turn will determine which PCBGROUP bucket the given PCB +is placed into and calculate the hash value appropriately. +.Pp +Wildcard PCBs are hashed differently and placed in a single wildcard +PCB list. +If +.Xr RSS 9 +is enabled and in use, RSS-aware wildcard PCBs are placed in a single +PCBGROUP based on RSS information. +Protocols may look up the PCB entry in a PCBGROUP by using the lookup +functions +.Fn in_pcbgroup_byhash +and +.Fn in_pcbgroup_byinpcb . +.Sh IMPLEMENTATION NOTES +The PCB code in +.Pa sys/netinet +and +.Pa sys/netinet6 +is aware of PCBGROUPS and will call into the PCBGROUPS code to do +PCBGROUP assignment and lookup, preferring a PCBGROUP lookup to the +default global PCB info table. +.Pp +An implementor wishing to experiment or modify the PCBGROUP assignment +should modify this set of functions: +.Bl -tag -width "12345678" -offset indent +.It Fn in_pcbgroup_getbucket No and Fn in6_pcbgroup_getbucket +Map a given 32 bit hash value to a PCBGROUP. +By default this is hash % number_of_pcbgroups. +However, this distribution may not align with NIC receive queues or +the +.Xr netisr 9 +configuration. +.It Fn in_pcbgroup_byhash No and Fn in6_pcbgroup_byhash +Map a 32 bit hash value and a hash type identifier to a PCBGROUP. +By default, this simply returns NULL. +This function is used by the +.Xr mbuf 9 +receive path in +.Pa sys/netinet/in_pcb.c +to map an mbuf to a PCBGROUP. +.It Fn in_pcbgroup_bytuple No and Fn in6_pcbgroup_bytuple +Map the source and destination address and port details to a PCBGROUP. +By default, this does a very simple XOR hash. +This function is used by both the PCB lookup code and as a fallback in +the +.Xr mbuf 9 +receive path in +.Pa sys/netinet/in_pcb.c . +.El +.Sh SEE ALSO +.Xr mbuf 9 , +.Xr RSS 9 , +.Xr netisr 9 +.Sh HISTORY +PCBGROUPS first appeared in FreeBSD 9.0. +.Pp +The PCBGROUPS implementation is inspired by Willman, Rixner, and Cox's +2006 USENIX paper, +.Qo +An Evaluation of Network Stack Parallelization Strategies in Modern +Operating Systems +.Qc : +.Li http://www.ece.rice.edu/~willmann/pubs/paranet_usenix.pdf +.Sh AUTHORS +.An -nosplit +The PCBGROUPS implementation was written by +.An Robert N. M. Watson Aq Mt rwatson@FreeBSD.org +under contract to Juniper Networks, Inc. +.Pp +This manual page written by +.An Adrian Chadd Aq Mt adrian@FreeBSD.org . +.Sh NOTES +The +.Xr RSS 9 +implementation currently uses +.Ic #ifdef +blocks to tie into PCBGROUPS. +This is a sign that a more abstract programming API is needed. +.Pp +There is currently no support for re-balancing the PCBGROUPS assignment, +nor is there any support for overriding which PCBGROUP a socket/PCB +should be in. +.Pp +No statistics are kept to indicate how often PCBGROUPS lookups +succeed or fail. From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 06:45:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EEC6A34E; Mon, 21 Jul 2014 06:45:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB6B52B8D; Mon, 21 Jul 2014 06:45:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6L6jJuW051923; Mon, 21 Jul 2014 06:45:19 GMT (envelope-from cy@svn.freebsd.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6L6jJdS051921; Mon, 21 Jul 2014 06:45:19 GMT (envelope-from cy@svn.freebsd.org) Message-Id: <201407210645.s6L6jJdS051921@svn.freebsd.org> From: Cy Schubert Date: Mon, 21 Jul 2014 06:45:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268937 - in stable/10: contrib/ipfilter/lib sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 06:45:20 -0000 Author: cy Date: Mon Jul 21 06:45:19 2014 New Revision: 268937 URL: http://svnweb.freebsd.org/changeset/base/268937 Log: MFC r268532 and r268585. When world and kernel are built without INET6 support, the userland was still built with INET6 turned on. PR: 190964 Approved by: glebius (mentor, implicit) Modified: stable/10/contrib/ipfilter/lib/printipfexpr.c stable/10/sys/contrib/ipfilter/netinet/ip_compat.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ipfilter/lib/printipfexpr.c ============================================================================== --- stable/10/contrib/ipfilter/lib/printipfexpr.c Mon Jul 21 04:48:02 2014 (r268936) +++ stable/10/contrib/ipfilter/lib/printipfexpr.c Mon Jul 21 06:45:19 2014 (r268937) @@ -3,7 +3,9 @@ static void printport __P((int *)); static void printhosts __P((int *)); static void printsingle __P((int *)); +#ifdef USE_INET6 static void printhostsv6 __P((int *)); +#endif void printipfexpr(array) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_compat.h Mon Jul 21 04:48:02 2014 (r268936) +++ stable/10/sys/contrib/ipfilter/netinet/ip_compat.h Mon Jul 21 06:45:19 2014 (r268937) @@ -33,10 +33,6 @@ #endif #define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4))) -#if defined(__FreeBSD_version) && (__FreeBSD_version >= 400000) && \ - !defined(_KERNEL) && !defined(USE_INET6) && !defined(NOINET6) -# define USE_INET6 -#endif #if defined(__SVR4) || defined(__svr4__) || defined(__sgi) From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 07:07:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDE5F7DE; Mon, 21 Jul 2014 07:07:36 +0000 (UTC) Received: from mail-qc0-x235.google.com (mail-qc0-x235.google.com [IPv6:2607:f8b0:400d:c01::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EFC22D38; Mon, 21 Jul 2014 07:07:36 +0000 (UTC) Received: by mail-qc0-f181.google.com with SMTP id w7so5175498qcr.26 for ; Mon, 21 Jul 2014 00:07:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=7n+f+/bYcFPtnH7lrIMhrhTe/lV8Ztn1lWg+1rfitLE=; b=rlw5gMXRBY/+qUweaifNXiLY5vM1g4GvlY5i3US1HR2wVK09FQ0W2cQCDPVeSVAN1u M9RFYa83qbXbciLQPrCT4iTLsVhyVWWKCeQ/MepQ6lbRj5RhFGYPfmgXbNrIZOHf5J+u zUWmPCrmSe+6O3F9phNyt4L/8F5leUYgdY0/+5AvV8ho5WMAONb1aDvs4K0NkzD+r2Ad Lt11OmMMywSMHnj0vO4QBnc8aggnxdocN6dCxzwULsUUqg6g0STdj0S6qkfmNRkk2ys7 zJuGYjv6JRgJTtWcRHonWB3JuzNQ5Nd9k9tJX2kz9hyZfilKn3uE2qL6apkldQwVCS5P xmtg== MIME-Version: 1.0 X-Received: by 10.224.36.130 with SMTP id t2mr7402849qad.45.1405926455296; Mon, 21 Jul 2014 00:07:35 -0700 (PDT) Sender: hiren.panchasara@gmail.com Received: by 10.96.73.39 with HTTP; Mon, 21 Jul 2014 00:07:35 -0700 (PDT) In-Reply-To: <201407210448.s6L4m3te095783@svn.freebsd.org> References: <201407210448.s6L4m3te095783@svn.freebsd.org> Date: Mon, 21 Jul 2014 00:07:35 -0700 X-Google-Sender-Auth: 21CA9Q-lRAzkEJiJOWxXzAWZl5s Message-ID: Subject: Re: svn commit: r268936 - head/share/man/man9 From: hiren panchasara To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head , svn-src-all , src-committers X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 07:07:36 -0000 On Sun, Jul 20, 2014 at 9:48 PM, Adrian Chadd wrote: > Author: adrian > Date: Mon Jul 21 04:48:02 2014 > New Revision: 268936 > URL: http://svnweb.freebsd.org/changeset/base/268936 > > Log: > Add the PCBGROUPS manpage. > > Thanks to wblock for helping me with this manpage. Thanks a lot. Any plans to mfc this? cheers, Hiren From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 07:20:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F33B1A68; Mon, 21 Jul 2014 07:20:16 +0000 (UTC) Received: from mail-qc0-x22f.google.com (mail-qc0-x22f.google.com [IPv6:2607:f8b0:400d:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82C412E4A; Mon, 21 Jul 2014 07:20:16 +0000 (UTC) Received: by mail-qc0-f175.google.com with SMTP id w7so5211062qcr.20 for ; Mon, 21 Jul 2014 00:20:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=MCkGvAdH+e1RtecMpt/iqKto0q+VdCLz5100OKofNYY=; b=cAzenh3XuRuipQ3v8Vgwco9/MMIe448s5k29mDs5FjhlQL2i7u5IOis2xK74dspMZo X/hjkG4w7WoDPeL+BrZA14BTnNQhHAY5zkrRfc5CSxqttLWwC2305zKVvGugCg4GJUj4 yCnBCyYCPi422yjB0RTZ3OZC5r+GHV9lwwy36KdOjZyKsjhhS07UwEcmbtIheQrbD/1D cmeL7NEgr34jy3NrvR7lqJxV8PZ0VQG4wE/8eHpWBDJE8+Fndv8QH7VkTIwGDzDZNpUi 1XppxeEVESDjTd7uS9SBVSVM+pN7i1nvL7yQmfldI/E0ReFdaJ2dkRtY20uVMvtSSAK8 MYJA== MIME-Version: 1.0 X-Received: by 10.229.171.196 with SMTP id i4mr38044922qcz.15.1405927215667; Mon, 21 Jul 2014 00:20:15 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.1.6 with HTTP; Mon, 21 Jul 2014 00:20:15 -0700 (PDT) In-Reply-To: References: <201407210448.s6L4m3te095783@svn.freebsd.org> Date: Mon, 21 Jul 2014 00:20:15 -0700 X-Google-Sender-Auth: U6j_prB14pl03WEiJcXAHwFEMas Message-ID: Subject: Re: svn commit: r268936 - head/share/man/man9 From: Adrian Chadd To: hiren panchasara Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head , svn-src-all , src-committers X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 07:20:17 -0000 I don't have any plans to MFC it but if someone wants to vet it for correctness on -10 then please do MFC it as appropriate. Thanks! -a On 21 July 2014 00:07, hiren panchasara wrote: > On Sun, Jul 20, 2014 at 9:48 PM, Adrian Chadd wrote: >> Author: adrian >> Date: Mon Jul 21 04:48:02 2014 >> New Revision: 268936 >> URL: http://svnweb.freebsd.org/changeset/base/268936 >> >> Log: >> Add the PCBGROUPS manpage. >> >> Thanks to wblock for helping me with this manpage. > > Thanks a lot. Any plans to mfc this? > > cheers, > Hiren From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 08:42:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34756BC7; Mon, 21 Jul 2014 08:42:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07BD228C1; Mon, 21 Jul 2014 08:42:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6L8gZDw007213; Mon, 21 Jul 2014 08:42:35 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6L8gZeo007212; Mon, 21 Jul 2014 08:42:35 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201407210842.s6L8gZeo007212@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 21 Jul 2014 08:42:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268938 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 08:42:36 -0000 Author: pluknet Date: Mon Jul 21 08:42:35 2014 New Revision: 268938 URL: http://svnweb.freebsd.org/changeset/base/268938 Log: [mdoc] cleanup Modified: head/share/man/man9/PCBGROUPS.9 Modified: head/share/man/man9/PCBGROUPS.9 ============================================================================== --- head/share/man/man9/PCBGROUPS.9 Mon Jul 21 06:45:19 2014 (r268937) +++ head/share/man/man9/PCBGROUPS.9 Mon Jul 21 08:42:35 2014 (r268938) @@ -34,23 +34,29 @@ .Nd Distributed Protocol Control Block Groups .Sh SYNOPSIS .Ft void -.Fn in_pcbgroup_init(struct inpcbinfo *pcbinfo, u_int hashfields, int hash_nelements); +.Fo in_pcbgroup_init +.Fa "struct inpcbinfo *pcbinfo" "u_int hashfields" "int hash_nelements" +.Fc .Ft void -.Fn in_pcbgroup_destroy(struct inpcbinfo *pcbinfo); +.Fn in_pcbgroup_destroy "struct inpcbinfo *pcbinfo" .Ft struct inpcbgroup * -.Fn in_pcbgroup_byhash(struct inpcbinfo *pcbinfo, u_int hashtype, uint32_t hash); +.Fo in_pcbgroup_byhash +.Fa "struct inpcbinfo *pcbinfo" "u_int hashtype" "uint32_t hash" +.Fc .Ft struct inpcbgroup * -.Fn in_pcbgroup_byinpcb(struct inpcb *inp); +.Fn in_pcbgroup_byinpcb "struct inpcb *inp" .Ft void -.Fn in_pcbgroup_update(struct inpcb *inp); +.Fn in_pcbgroup_update "struct inpcb *inp" .Ft void -.Fn in_pcbgroup_update_mbuf(struct inpcb *inp, struct mbuf *m); +.Fn in_pcbgroup_update_mbuf "struct inpcb *inp" "struct mbuf *m" .Ft void -.Fn in_pcbgroup_remove(struct inpcb *inp); +.Fn in_pcbgroup_remove "struct inpcb *inp" .Ft int -.Fn in_pcbgroup_enabled(struct inpcbinfo *pcbinfo); +.Fn in_pcbgroup_enabled "struct inpcbinfo *pcbinfo" .Ft struct inpcbgroup * -.Fn in6_pcbgroup_byhash(struct inpcbinfo *pcbinfo, u_int hashtype, uint32_t hash); +.Fo in6_pcbgroup_byhash +.Fa "struct inpcbinfo *pcbinfo" "u_int hashtype" "uint32_t hash" +.Fc .Pp .Cd "options PCBGROUPS" .Sh DESCRIPTION @@ -111,7 +117,7 @@ By default, a PCBGROUP table is created The PCBGROUP code attempts to calculate a hash value from the given PCB or mbuf when looking up a PCBGROUP. While processing a received frame, -.Fn in_pcbgroup_byhash() +.Fn in_pcbgroup_byhash can be used in conjunction with either a hardware-provided hash value .Po @@ -192,10 +198,11 @@ receive path in .El .Sh SEE ALSO .Xr mbuf 9 , -.Xr RSS 9 , -.Xr netisr 9 +.Xr netisr 9 , +.Xr RSS 9 .Sh HISTORY -PCBGROUPS first appeared in FreeBSD 9.0. +PCBGROUPS first appeared in +.Fx 9.0. .Pp The PCBGROUPS implementation is inspired by Willman, Rixner, and Cox's 2006 USENIX paper, From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 08:47:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC839DD5; Mon, 21 Jul 2014 08:47:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9AA228F2; Mon, 21 Jul 2014 08:47:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6L8lsCm007876; Mon, 21 Jul 2014 08:47:54 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6L8lsX9007875; Mon, 21 Jul 2014 08:47:54 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201407210847.s6L8lsX9007875@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 21 Jul 2014 08:47:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268939 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 08:47:55 -0000 Author: pluknet Date: Mon Jul 21 08:47:54 2014 New Revision: 268939 URL: http://svnweb.freebsd.org/changeset/base/268939 Log: Fixed fallout from previous change. Modified: head/share/man/man9/PCBGROUPS.9 Modified: head/share/man/man9/PCBGROUPS.9 ============================================================================== --- head/share/man/man9/PCBGROUPS.9 Mon Jul 21 08:42:35 2014 (r268938) +++ head/share/man/man9/PCBGROUPS.9 Mon Jul 21 08:47:54 2014 (r268939) @@ -202,7 +202,7 @@ receive path in .Xr RSS 9 .Sh HISTORY PCBGROUPS first appeared in -.Fx 9.0. +.Fx 9.0 . .Pp The PCBGROUPS implementation is inspired by Willman, Rixner, and Cox's 2006 USENIX paper, From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 09:07:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from ptrcrt.ch (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFDA359E; Mon, 21 Jul 2014 09:07:22 +0000 (UTC) Date: Mon, 21 Jul 2014 11:07:18 +0200 From: Pietro Cerutti To: Bryan Drewery Subject: Re: svn commit: r268494 - in head: lib/libsbuf sys/kern sys/sys Message-ID: <20140721090718.GC51328@ptrcrt.ch> Reply-To: gahr@FreeBSD.org References: <201407101308.s6AD8pbR080041@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="LyciRD1jyfeSSjG0" Content-Disposition: inline In-Reply-To: X-PGP-Key: fp="DA6D E106 A5B8 54B8 5DD8 6D49 ADD0 D38E A192 089E"; id="0xA192089E"; get=; get=; User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, owner-src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 09:07:24 -0000 --LyciRD1jyfeSSjG0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2014-Jul-18, 18:47, Bryan Drewery wrote: > On 2014-07-10 08:08, Pietro Cerutti wrote: > > Author: gahr (ports committer) > > Date: Thu Jul 10 13:08:51 2014 > > New Revision: 268494 > > URL: http://svnweb.freebsd.org/changeset/base/268494 > >=20 > > Log: > > Implement Short/Small String Optimization in SBUF(9) and change=20 > > lengths and > > positions in the API from ssize_t and int to size_t. > >=20 > > CR: D388 > > Approved by: des, bapt > >=20 > > Modified: > > head/lib/libsbuf/Makefile > > head/sys/kern/subr_sbuf.c > > head/sys/sys/sbuf.h > >=20 > > Modified: head/lib/libsbuf/Makefile > > =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 > > --- head/lib/libsbuf/Makefile Thu Jul 10 13:04:52 2014 (r268493) > > +++ head/lib/libsbuf/Makefile Thu Jul 10 13:08:51 2014 (r268494) > > @@ -4,7 +4,7 @@ LIB=3D sbuf > > SHLIBDIR?=3D /lib > > SRCS=3D subr_sbuf.c > >=20 > > -SHLIB_MAJOR =3D 6 > > +SHLIB_MAJOR =3D 7 > >=20 > > SYMBOL_MAPS=3D ${.CURDIR}/Symbol.map > > VERSION_DEF=3D ${.CURDIR}/Version.def > >=20 >=20 > We have symbol versioning in libsbuf. Shouldn't need to bump the=20 > version. Just need to add a compat function for everything. It would be= =20 > a lot of work, but bumping for ssize_t->size_t seems gratuitous to me. The bump was due mainly to the addition of the s_static_buf field to the sbuf struct. --=20 Pietro Cerutti The FreeBSD Project gahr@FreeBSD.org PGP Public Key: http://gahr.ch/pgp --LyciRD1jyfeSSjG0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJTzNhGXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQTZERTEwNkE1Qjg1NEI4NUREODZENDlB REQwRDM4RUExOTIwODlFAAoJEK3Q046hkgie0L8P/1ZDdbBcqq5R2LZB2aN5RWxU 77tpZeTzV576p1pkvzvkt+OUlVvBpxrjOA7o+PEmw0w1BzIIS4Mz2OUqNuci/M3K EU/ar1yyQghEknXiS8MW4KfpPJqSbInfnnXv+/i6YTjSVN4SH7ZVMZoucmfub9zI iZSn29ZGhXMgUBvEDyH09uGsyAvOcVcGX0UuZKHXV3VNiYOwz1WvWYhbls9Zky3b 2nG0CM5v+JURJfC3xE13EHkq6gkDSWFbd3SK0psdQOKfRVhTs6n7cKIRdaghIKFo KK+CuVQJKI16FRDex3bh4zZgpAu/iTvRpxBQsx/IL9WUEIL7rChDgvFQ+ok9aDCB 9iteikJqK40NQyM/LgfYdPgFENYKgti3+sxbwBOvRvu183FQrTdPhC/1uiE07zrp AUAG/vUAWCR/5l4qYjrjIfgz+LkCap7d2WdddLQEiY39LwqVHipe1S5afhg3kFoh cDmC4KYX9GGvzuPpqb4jroyDD0zoeFLfcspkTXfr03kRN27E82IQrLFbVq/6IOHj 3qzasU0B0c4kHHJtrTEJYCSmIlb/GcK0QRsPQ/VIJhe6ttGnov9KLrnmdeunvfM6 v4aaKFOUhxYGuzn5C5RPcGuXXAHa7NL/hg619HGKWMk4W1P7Wf0AhBJyp9KWtAgm xb6WQspUNRbkn6NcmZ2Y =DXz8 -----END PGP SIGNATURE----- --LyciRD1jyfeSSjG0-- From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 13:51:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3ADE2A7E; Mon, 21 Jul 2014 13:51:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 270EA2853; Mon, 21 Jul 2014 13:51:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LDpUHT044156; Mon, 21 Jul 2014 13:51:30 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LDpTfm044152; Mon, 21 Jul 2014 13:51:29 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201407211351.s6LDpTfm044152@svn.freebsd.org> From: Ed Maste Date: Mon, 21 Jul 2014 13:51:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268940 - stable/10/share/vt/keymaps X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 13:51:30 -0000 Author: emaste Date: Mon Jul 21 13:51:29 2014 New Revision: 268940 URL: http://svnweb.freebsd.org/changeset/base/268940 Log: MFC r267603 by trasz: Add polish vt(4) keymap. Sponsored by: The FreeBSD Foundation Added: stable/10/share/vt/keymaps/pl.kbd - copied unchanged from r267603, head/share/vt/keymaps/pl.kbd Modified: stable/10/share/vt/keymaps/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/vt/keymaps/Makefile ============================================================================== --- stable/10/share/vt/keymaps/Makefile Mon Jul 21 08:47:54 2014 (r268939) +++ stable/10/share/vt/keymaps/Makefile Mon Jul 21 13:51:29 2014 (r268940) @@ -1,6 +1,6 @@ # $FreeBSD$ -FILES= ua.kbd ua.shift.alt.kbd +FILES= pl.kbd ua.kbd ua.shift.alt.kbd FILESDIR= ${SHAREDIR}/vt/keymaps Copied: stable/10/share/vt/keymaps/pl.kbd (from r267603, head/share/vt/keymaps/pl.kbd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/vt/keymaps/pl.kbd Mon Jul 21 13:51:29 2014 (r268940, copy of r267603, head/share/vt/keymaps/pl.kbd) @@ -0,0 +1,116 @@ +# Polish ISO-8859-2 keymap by Krzysztof Mlynarski (17:46 27-04-1996 MET DST) +# (krzysio@hydra.mimuw.edu.pl) +# $FreeBSD$ +# alt +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '1' '!' nop nop '1' '!' nop nop O + 003 '2' '@' nul nul '2' '@' nul nul O + 004 '3' '#' nop nop '3' '#' nop nop O + 005 '4' '$' nop nop '4' '$' nop nop O + 006 '5' '%' nop nop '5' '%' nop nop O + 007 '6' '^' rs rs '6' '^' rs rs O + 008 '7' '&' nop nop '7' '&' nop nop O + 009 '8' '*' nop nop '8' '*' nop nop O + 010 '9' '(' nop nop '9' '(' nop nop O + 011 '0' ')' nop nop '0' ')' nop nop O + 012 '-' '_' us us '-' '_' us us O + 013 '=' '+' nop nop '=' '+' nop nop O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C + 017 'w' 'W' etb etb 'w' 'W' etb etb C + 018 'e' 'E' enq enq 281 280 enq enq C + 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C + 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C + 021 'y' 'Y' em em 'y' 'Y' em em C + 022 'u' 'U' nak nak 'u' 'U' nak nak C + 023 'i' 'I' ht ht 'i' 'I' ht ht C + 024 'o' 'O' si si 243 211 si si C + 025 'p' 'P' dle dle 'p' 'P' dle dle C + 026 '[' '{' esc esc '[' '{' esc esc O + 027 ']' '}' gs gs ']' '}' gs gs O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 261 260 soh soh C + 031 's' 'S' dc3 dc3 347 346 dc3 dc3 C + 032 'd' 'D' eot eot 'd' 'D' eot eot C + 033 'f' 'F' ack ack 'f' 'F' ack ack C + 034 'g' 'G' bel bel 'g' 'G' bel bel C + 035 'h' 'H' bs bs 'h' 'H' bs bs C + 036 'j' 'J' nl nl 'j' 'J' nl nl C + 037 'k' 'K' vt vt 'k' 'K' vt vt C + 038 'l' 'L' ff ff 322 321 ff ff C + 039 ';' ':' nop nop ';' ':' nop nop O + 040 ''' '"' nop nop ''' '"' nop nop O + 041 '`' '~' nop nop '`' '~' nop nop O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 '\' '|' fs fs '\' '|' fs fs O + 044 'z' 'Z' sub sub 380 379 sub sub C + 045 'x' 'X' can can 378 377 can can C + 046 'c' 'C' etx etx 263 262 etx etx C + 047 'v' 'V' syn syn 'v' 'V' syn syn C + 048 'b' 'B' stx stx 'b' 'B' stx stx C + 049 'n' 'N' so so 324 323 so so C + 050 'm' 'M' cr cr 'm' 'M' cr cr C + 051 ',' '<' nop nop ',' '<' nop nop O + 052 '.' '>' nop nop '.' '>' nop nop O + 053 '/' '?' nop nop '/' '?' nop nop O + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 nop nop nop nop nop nop nop nop O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr cr cr cr cr cr cr O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' O + 092 nscr pscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 14:31:58 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2542EA4E; Mon, 21 Jul 2014 14:31:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 114D72CC7; Mon, 21 Jul 2014 14:31:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LEVvgj061767; Mon, 21 Jul 2014 14:31:57 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LEVvHI061766; Mon, 21 Jul 2014 14:31:57 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201407211431.s6LEVvHI061766@svn.freebsd.org> From: Ed Maste Date: Mon, 21 Jul 2014 14:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268941 - stable/10/sys/dev/vt X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 14:31:58 -0000 Author: emaste Date: Mon Jul 21 14:31:57 2014 New Revision: 268941 URL: http://svnweb.freebsd.org/changeset/base/268941 Log: MFC r268460 by ray: Fix inconsistent token parameters for kbd_allocate() and kbd_release() in vt(4). PR: 191306 Submitted by: jau789 at gmail.com Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/vt/vt_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/vt/vt_core.c ============================================================================== --- stable/10/sys/dev/vt/vt_core.c Mon Jul 21 13:51:29 2014 (r268940) +++ stable/10/sys/dev/vt/vt_core.c Mon Jul 21 14:31:57 2014 (r268941) @@ -618,7 +618,7 @@ vt_kbdevent(keyboard_t *kbd, int event, case KBDIO_UNLOADING: mtx_lock(&Giant); vd->vd_keyboard = -1; - kbd_release(kbd, (void *)&vd->vd_keyboard); + kbd_release(kbd, (void *)vd); mtx_unlock(&Giant); return (0); default: @@ -1785,11 +1785,10 @@ skip_thunk: return (EINVAL); } i = kbd_allocate(kbd->kb_name, kbd->kb_unit, - (void *)&vd->vd_keyboard, vt_kbdevent, vd); + (void *)vd, vt_kbdevent, vd); if (i >= 0) { if (vd->vd_keyboard != -1) { - kbd_release(kbd, - (void *)&vd->vd_keyboard); + kbd_release(kbd, (void *)vd); } kbd = kbd_get_keyboard(i); vd->vd_keyboard = i; @@ -1811,7 +1810,7 @@ skip_thunk: mtx_unlock(&Giant); return (EINVAL); } - error = kbd_release(kbd, (void *)&vd->vd_keyboard); + error = kbd_release(kbd, (void *)vd); if (error == 0) { vd->vd_keyboard = -1; } From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 14:36:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48596D89; Mon, 21 Jul 2014 14:36:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34A012D21; Mon, 21 Jul 2014 14:36:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LEaa1U062541; Mon, 21 Jul 2014 14:36:36 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LEaavM062540; Mon, 21 Jul 2014 14:36:36 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201407211436.s6LEaavM062540@svn.freebsd.org> From: Ed Maste Date: Mon, 21 Jul 2014 14:36:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r268942 - stable/9/sys/dev/vt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 14:36:36 -0000 Author: emaste Date: Mon Jul 21 14:36:35 2014 New Revision: 268942 URL: http://svnweb.freebsd.org/changeset/base/268942 Log: MFC r268460 by ray: Fix inconsistent token parameters for kbd_allocate() and kbd_release() in vt(4). PR: 191306 Submitted by: jau789 at gmail.com Sponsored by: The FreeBSD Foundation Modified: stable/9/sys/dev/vt/vt_core.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/vt/vt_core.c ============================================================================== --- stable/9/sys/dev/vt/vt_core.c Mon Jul 21 14:31:57 2014 (r268941) +++ stable/9/sys/dev/vt/vt_core.c Mon Jul 21 14:36:35 2014 (r268942) @@ -536,7 +536,7 @@ vt_kbdevent(keyboard_t *kbd, int event, case KBDIO_UNLOADING: mtx_lock(&Giant); vd->vd_keyboard = -1; - kbd_release(kbd, (void *)&vd->vd_keyboard); + kbd_release(kbd, (void *)vd); mtx_unlock(&Giant); return (0); default: @@ -1651,11 +1651,10 @@ skip_thunk: return (EINVAL); } i = kbd_allocate(kbd->kb_name, kbd->kb_unit, - (void *)&vd->vd_keyboard, vt_kbdevent, vd); + (void *)vd, vt_kbdevent, vd); if (i >= 0) { if (vd->vd_keyboard != -1) { - kbd_release(kbd, - (void *)&vd->vd_keyboard); + kbd_release(kbd, (void *)vd); } kbd = kbd_get_keyboard(i); vd->vd_keyboard = i; @@ -1677,7 +1676,7 @@ skip_thunk: mtx_unlock(&Giant); return (EINVAL); } - error = kbd_release(kbd, (void *)&vd->vd_keyboard); + error = kbd_release(kbd, (void *)vd); if (error == 0) { vd->vd_keyboard = -1; } From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 15:18:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C56FEB8F; Mon, 21 Jul 2014 15:18:07 +0000 (UTC) Received: from mail-qa0-x231.google.com (mail-qa0-x231.google.com [IPv6:2607:f8b0:400d:c00::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5482D20EC; Mon, 21 Jul 2014 15:18:07 +0000 (UTC) Received: by mail-qa0-f49.google.com with SMTP id dc16so5194125qab.22 for ; Mon, 21 Jul 2014 08:18:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=kddszopaxVhHqUYcb46L+rz8dittSNuW3FfPm/Zrj2U=; b=pVATJ7cAxJ0oVE/S0UtsmEb964V5rKwpdHM5y0kxhWP5gmyvigTA+ow0TAzqm+bC1F fh3w7AMd8XEhah62lMGvXWNYjAQnYawiwhaIpgNzs064mdZI9qqWZQtIfWFOVn+V3U2I FL4dkpFyRFkpBN6BRBoCFiBnhxci//fP0EPE4DnYqeGYjl876JGAy4XCBhKUvjvz8iSY dU0NfI9fioGc/EMOaGqQCbrjmVlf8Um9oKNwwLyO/zBD2vXD3fANWXKDkm5zeZIduSL9 QQnZ5yCMroTuupBAlYx3xnMOnykk1QPZUpI0ZHRP89cY/xPKj7X1FYhwiVV+VjsyhhVg EupA== MIME-Version: 1.0 X-Received: by 10.224.223.135 with SMTP id ik7mr44773282qab.26.1405955886457; Mon, 21 Jul 2014 08:18:06 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.1.6 with HTTP; Mon, 21 Jul 2014 08:18:06 -0700 (PDT) In-Reply-To: <201407210842.s6L8gZeo007212@svn.freebsd.org> References: <201407210842.s6L8gZeo007212@svn.freebsd.org> Date: Mon, 21 Jul 2014 08:18:06 -0700 X-Google-Sender-Auth: BYap5o9qXZSX_37BJMSNR7s_hOQ Message-ID: Subject: Re: svn commit: r268938 - head/share/man/man9 From: Adrian Chadd To: Sergey Kandaurov Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 15:18:08 -0000 thanks! -a On 21 July 2014 01:42, Sergey Kandaurov wrote: > Author: pluknet > Date: Mon Jul 21 08:42:35 2014 > New Revision: 268938 > URL: http://svnweb.freebsd.org/changeset/base/268938 > > Log: > [mdoc] cleanup > > Modified: > head/share/man/man9/PCBGROUPS.9 > > Modified: head/share/man/man9/PCBGROUPS.9 > ============================================================================== > --- head/share/man/man9/PCBGROUPS.9 Mon Jul 21 06:45:19 2014 (r268937) > +++ head/share/man/man9/PCBGROUPS.9 Mon Jul 21 08:42:35 2014 (r268938) > @@ -34,23 +34,29 @@ > .Nd Distributed Protocol Control Block Groups > .Sh SYNOPSIS > .Ft void > -.Fn in_pcbgroup_init(struct inpcbinfo *pcbinfo, u_int hashfields, int hash_nelements); > +.Fo in_pcbgroup_init > +.Fa "struct inpcbinfo *pcbinfo" "u_int hashfields" "int hash_nelements" > +.Fc > .Ft void > -.Fn in_pcbgroup_destroy(struct inpcbinfo *pcbinfo); > +.Fn in_pcbgroup_destroy "struct inpcbinfo *pcbinfo" > .Ft struct inpcbgroup * > -.Fn in_pcbgroup_byhash(struct inpcbinfo *pcbinfo, u_int hashtype, uint32_t hash); > +.Fo in_pcbgroup_byhash > +.Fa "struct inpcbinfo *pcbinfo" "u_int hashtype" "uint32_t hash" > +.Fc > .Ft struct inpcbgroup * > -.Fn in_pcbgroup_byinpcb(struct inpcb *inp); > +.Fn in_pcbgroup_byinpcb "struct inpcb *inp" > .Ft void > -.Fn in_pcbgroup_update(struct inpcb *inp); > +.Fn in_pcbgroup_update "struct inpcb *inp" > .Ft void > -.Fn in_pcbgroup_update_mbuf(struct inpcb *inp, struct mbuf *m); > +.Fn in_pcbgroup_update_mbuf "struct inpcb *inp" "struct mbuf *m" > .Ft void > -.Fn in_pcbgroup_remove(struct inpcb *inp); > +.Fn in_pcbgroup_remove "struct inpcb *inp" > .Ft int > -.Fn in_pcbgroup_enabled(struct inpcbinfo *pcbinfo); > +.Fn in_pcbgroup_enabled "struct inpcbinfo *pcbinfo" > .Ft struct inpcbgroup * > -.Fn in6_pcbgroup_byhash(struct inpcbinfo *pcbinfo, u_int hashtype, uint32_t hash); > +.Fo in6_pcbgroup_byhash > +.Fa "struct inpcbinfo *pcbinfo" "u_int hashtype" "uint32_t hash" > +.Fc > .Pp > .Cd "options PCBGROUPS" > .Sh DESCRIPTION > @@ -111,7 +117,7 @@ By default, a PCBGROUP table is created > The PCBGROUP code attempts to calculate a hash value from the given > PCB or mbuf when looking up a PCBGROUP. > While processing a received frame, > -.Fn in_pcbgroup_byhash() > +.Fn in_pcbgroup_byhash > can be used in conjunction with either a hardware-provided hash > value > .Po > @@ -192,10 +198,11 @@ receive path in > .El > .Sh SEE ALSO > .Xr mbuf 9 , > -.Xr RSS 9 , > -.Xr netisr 9 > +.Xr netisr 9 , > +.Xr RSS 9 > .Sh HISTORY > -PCBGROUPS first appeared in FreeBSD 9.0. > +PCBGROUPS first appeared in > +.Fx 9.0. > .Pp > The PCBGROUPS implementation is inspired by Willman, Rixner, and Cox's > 2006 USENIX paper, > From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 15:22:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F7A3123; Mon, 21 Jul 2014 15:22:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AFF921B2; Mon, 21 Jul 2014 15:22:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LFMoo5084641; Mon, 21 Jul 2014 15:22:50 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LFMnQo084633; Mon, 21 Jul 2014 15:22:49 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407211522.s6LFMnQo084633@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 21 Jul 2014 15:22:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268943 - in head: include lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 15:22:50 -0000 Author: pfg Date: Mon Jul 21 15:22:48 2014 New Revision: 268943 URL: http://svnweb.freebsd.org/changeset/base/268943 Log: Add re-entrant versions of the hash functions based on the GNU api. While testing this I found a conformance issue in hdestroy() that will be fixed in a subsequent commit. Obtained from: NetBSD (hcreate.c, CVS Rev. 1.7) Modified: head/include/search.h head/lib/libc/stdlib/Makefile.inc head/lib/libc/stdlib/Symbol.map head/lib/libc/stdlib/hcreate.3 head/lib/libc/stdlib/hcreate.c Modified: head/include/search.h ============================================================================== --- head/include/search.h Mon Jul 21 14:36:35 2014 (r268942) +++ head/include/search.h Mon Jul 21 15:22:48 2014 (r268943) @@ -1,8 +1,8 @@ /*- - * Written by J.T. Conklin + * Written by J.T. Conklin * Public domain. * - * $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $ + * $NetBSD: search.h,v 1.16 2005/02/03 04:39:32 perry Exp $ * $FreeBSD$ */ @@ -45,6 +45,15 @@ struct que_elem { }; #endif +#if __BSD_VISIBLE +struct _ENTRY; +struct hsearch_data { + struct _ENTRY *table; + size_t size; + size_t filled; +}; +#endif + __BEGIN_DECLS int hcreate(size_t); void hdestroy(void); @@ -61,6 +70,13 @@ void *tfind(const void *, void * const * int (*)(const void *, const void *)); void *tsearch(const void *, void **, int (*)(const void *, const void *)); void twalk(const void *, void (*)(const void *, VISIT, int)); + +#if __BSD_VISIBLE +int hcreate_r(size_t, struct hsearch_data *); +void hdestroy_r(struct hsearch_data *); +int hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *); +#endif + __END_DECLS #endif /* !_SEARCH_H_ */ Modified: head/lib/libc/stdlib/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/Makefile.inc Mon Jul 21 14:36:35 2014 (r268942) +++ head/lib/libc/stdlib/Makefile.inc Mon Jul 21 15:22:48 2014 (r268943) @@ -35,6 +35,7 @@ MLINKS+=exit.3 _Exit.3 MLINKS+=getenv.3 putenv.3 getenv.3 setenv.3 getenv.3 unsetenv.3 MLINKS+=getopt_long.3 getopt_long_only.3 MLINKS+=hcreate.3 hdestroy.3 hcreate.3 hsearch.3 +MLINKS+=hcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 hcreate.3 hsearch_r.3 MLINKS+=insque.3 remque.3 MLINKS+=lsearch.3 lfind.3 MLINKS+=ptsname.3 grantpt.3 ptsname.3 unlockpt.3 Modified: head/lib/libc/stdlib/Symbol.map ============================================================================== --- head/lib/libc/stdlib/Symbol.map Mon Jul 21 14:36:35 2014 (r268942) +++ head/lib/libc/stdlib/Symbol.map Mon Jul 21 15:22:48 2014 (r268943) @@ -109,6 +109,9 @@ FBSD_1.4 { heapsort_b; mergesort_b; qsort_b; + hcreate_r; + hdestroy_r; + hsearch_r; }; FBSDprivate_1.0 { Modified: head/lib/libc/stdlib/hcreate.3 ============================================================================== --- head/lib/libc/stdlib/hcreate.3 Mon Jul 21 14:36:35 2014 (r268942) +++ head/lib/libc/stdlib/hcreate.3 Mon Jul 21 15:22:48 2014 (r268943) @@ -28,11 +28,16 @@ .\" .\" $FreeBSD$ .\" -.Dd July 6, 2008 +.Dd July 21, 2014 .Dt HCREATE 3 .Os .Sh NAME -.Nm hcreate , hdestroy , hsearch +.Nm hcreate , +.Nm hcreate_r , +.Nm hdestroy , +.Nm hdestroy_r , +.Nm hsearch , +.Nm hsearch_r .Nd manage hash search table .Sh LIBRARY .Lb libc @@ -40,16 +45,25 @@ .In search.h .Ft int .Fn hcreate "size_t nel" +.Ft int +.Fn hcreate_r "size_t nel" "struct hsearch_data *table" +.Ft void +.Fn hdestroy "void" .Ft void -.Fn hdestroy void +.Fn hdestroy_r "struct hsearch_data *table" .Ft ENTRY * .Fn hsearch "ENTRY item" "ACTION action" +.Ft int +.Fn hsearch_r "ENTRY item" "ACTION action" "ENTRY ** itemp" "struct hsearch_data *table" .Sh DESCRIPTION The .Fn hcreate , +.Fn hcreate_r , .Fn hdestroy , +.Fn hdestroy_r +.Fn hsearch , and -.Fn hsearch +.Fn hsearch_r functions manage hash search tables. .Pp The @@ -90,7 +104,7 @@ argument is a structure of type .Vt ENTRY (defined in the .In search.h -header) containing two pointers: +header) that contains two pointers: .Fa item.key points to the comparison key (a .Vt "char *" ) , @@ -136,21 +150,50 @@ is and .Fn hdestroy is called. +.Pp +The +.Fn hcreate_r , +.Fn hdestroy_r , +and +.Fn hsearch_r +functions are re-entrant versions of the above functions that can +operate on a table supplied by the user. +The +.Fn hsearch_r +function returns +.Dv 0 +if the action is +.Dv ENTER +and the element cannot be created, +.Dv 1 +otherwise. +If the element exists or can be created, it will be placed in +.Fa itemp , +otherwise +.Fa itemp +will be set to +.Dv NULL . .Sh RETURN VALUES The .Fn hcreate -function returns 0 if the table creation failed and the global variable +and +.Fn hcreate_r +functions return 0 if the table creation failed and the global variable .Va errno is set to indicate the error; otherwise, a non-zero value is returned. .Pp The .Fn hdestroy -function does not return a value. +and +.Fn hdestroy_r +functions return no value. .Pp The .Fn hsearch -function returns a +and +.Fn hsearch_r +functions return a .Dv NULL pointer if either the .Fa action @@ -223,15 +266,31 @@ main(void) .Sh ERRORS The .Fn hcreate -and +.Fn hcreate_r , .Fn hsearch -functions may fail if: +and +.Fn hsearch_r +functions will fail if: .Bl -tag -width Er .It Bq Er ENOMEM -Insufficient storage space is available. +Insufficient memory is available. .It Bq Er EINVAL A table already exists. .El +.Pp +The +.Fn hsearch +and +.Fn hsearch_r +functions will also fail if the action is +.Dv SEARCH +and the element is not found: +.Bl -tag -width Er +.It Bq Er ESRCH +The +.Fa item +given is not found. +.El .Sh SEE ALSO .Xr bsearch 3 , .Xr lsearch 3 , @@ -254,5 +313,15 @@ and .Fn hsearch functions first appeared in .At V . +The +.Fn hcreate_r , +.Fn hdestroy_r +and +.Fn hsearch_r +functions are +.Tn GNU +extensions. .Sh BUGS -The interface permits the use of only one hash table at a time. +The original, +.Pf non- Tn GNU +interface permits the use of only one hash table at a time. Modified: head/lib/libc/stdlib/hcreate.c ============================================================================== --- head/lib/libc/stdlib/hcreate.c Mon Jul 21 14:36:35 2014 (r268942) +++ head/lib/libc/stdlib/hcreate.c Mon Jul 21 15:22:48 2014 (r268943) @@ -1,4 +1,4 @@ -/* $NetBSD: hcreate.c,v 1.6 2008/07/21 12:05:43 lukem Exp $ */ +/* $NetBSD: hcreate.c,v 1.7 2011/09/14 23:33:51 christos Exp $ */ /* * Copyright (c) 2001 Christopher G. Demetriou @@ -49,7 +49,7 @@ #include #if 0 #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: hcreate.c,v 1.6 2008/07/21 12:05:43 lukem Exp $"); +__RCSID("$NetBSD: hcreate.c,v 1.7 2011/09/14 23:33:51 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #endif __FBSDID("$FreeBSD$"); @@ -84,20 +84,27 @@ SLIST_HEAD(internal_head, internal_entry /* Default hash function, from db/hash/hash_func.c */ extern u_int32_t (*__default_hash)(const void *, size_t); -static struct internal_head *htable; -static size_t htablesize; +static struct hsearch_data htable; int hcreate(size_t nel) { - size_t idx; - unsigned int p2; /* Make sure this is not called when a table already exists. */ - if (htable != NULL) { + if (htable.table != NULL) { errno = EINVAL; return 0; } + return hcreate_r(nel, &htable); +} + +int +hcreate_r(size_t nel, struct hsearch_data *head) +{ + struct internal_head *table; + size_t idx; + unsigned int p2; + void *p; /* If nel is too small, make it min sized. */ if (nel < MIN_BUCKETS) @@ -115,16 +122,19 @@ hcreate(size_t nel) } /* Allocate the table. */ - htablesize = nel; - htable = malloc(htablesize * sizeof htable[0]); - if (htable == NULL) { + head->size = nel; + head->filled = 0; + p = malloc(nel * sizeof table[0]); + if (p == NULL) { errno = ENOMEM; return 0; } + head->table = p; + table = p; /* Initialize it. */ - for (idx = 0; idx < htablesize; idx++) - SLIST_INIT(&htable[idx]); + for (idx = 0; idx < nel; idx++) + SLIST_INIT(&table[idx]); return 1; } @@ -132,54 +142,83 @@ hcreate(size_t nel) void hdestroy(void) { + hdestroy_r(&htable); +} + +void +hdestroy_r(struct hsearch_data *head) +{ struct internal_entry *ie; size_t idx; + void *p; + struct internal_head *table; - if (htable == NULL) + if (head == NULL) return; - for (idx = 0; idx < htablesize; idx++) { - while (!SLIST_EMPTY(&htable[idx])) { - ie = SLIST_FIRST(&htable[idx]); - SLIST_REMOVE_HEAD(&htable[idx], link); + p = head->table; + head->table = NULL; + table = p; + + for (idx = 0; idx < head->size; idx++) { + while (!SLIST_EMPTY(&table[idx])) { + ie = SLIST_FIRST(&table[idx]); + SLIST_REMOVE_HEAD(&table[idx], link); free(ie->ent.key); free(ie); } } - free(htable); - htable = NULL; + free(table); } ENTRY * hsearch(ENTRY item, ACTION action) { - struct internal_head *head; + ENTRY *ep; + (void)hsearch_r(item, action, &ep, &htable); + return ep; +} + +int +hsearch_r(ENTRY item, ACTION action, ENTRY **itemp, struct hsearch_data *head) +{ + struct internal_head *table, *chain; struct internal_entry *ie; uint32_t hashval; size_t len; + void *p; + + p = head->table; + table = p; len = strlen(item.key); hashval = (*__default_hash)(item.key, len); - head = &htable[hashval & (htablesize - 1)]; - ie = SLIST_FIRST(head); + chain = &table[hashval & (head->size - 1)]; + ie = SLIST_FIRST(chain); while (ie != NULL) { if (strcmp(ie->ent.key, item.key) == 0) break; ie = SLIST_NEXT(ie, link); } - if (ie != NULL) - return &ie->ent; - else if (action == FIND) - return NULL; + if (ie != NULL) { + *itemp = &ie->ent; + return 1; + } else if (action == FIND) { + *itemp = NULL; + errno = ESRCH; + return 1; + } ie = malloc(sizeof *ie); if (ie == NULL) - return NULL; + return 0; ie->ent.key = item.key; ie->ent.data = item.data; - SLIST_INSERT_HEAD(head, ie, link); - return &ie->ent; + SLIST_INSERT_HEAD(chain, ie, link); + *itemp = &ie->ent; + head->filled++; + return 1; } From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 15:26:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 156AE2DE; Mon, 21 Jul 2014 15:26:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01E5D21F0; Mon, 21 Jul 2014 15:26:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LFQqAU085127; Mon, 21 Jul 2014 15:26:52 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LFQq5L085126; Mon, 21 Jul 2014 15:26:52 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407211526.s6LFQq5L085126@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 21 Jul 2014 15:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268944 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 15:26:53 -0000 Author: pfg Date: Mon Jul 21 15:26:52 2014 New Revision: 268944 URL: http://svnweb.freebsd.org/changeset/base/268944 Log: Update license. NetBSD has removed the advertisement clause from this file. Obtained from: NetBSD (CVS rev. 1,8) Modified: head/lib/libc/stdlib/hcreate.c Modified: head/lib/libc/stdlib/hcreate.c ============================================================================== --- head/lib/libc/stdlib/hcreate.c Mon Jul 21 15:22:48 2014 (r268943) +++ head/lib/libc/stdlib/hcreate.c Mon Jul 21 15:26:52 2014 (r268944) @@ -12,12 +12,7 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the - * NetBSD Project. See http://www.NetBSD.org/ for - * information about NetBSD. - * 4. The name of the author may not be used to endorse or promote products + * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR @@ -49,7 +44,7 @@ #include #if 0 #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: hcreate.c,v 1.7 2011/09/14 23:33:51 christos Exp $"); +__RCSID("$NetBSD: hcreate.c,v 1.8 2011/09/17 16:54:39 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #endif __FBSDID("$FreeBSD$"); From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 15:44:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE434786; Mon, 21 Jul 2014 15:44:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB32B23E0; Mon, 21 Jul 2014 15:44:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LFixDw093411; Mon, 21 Jul 2014 15:44:59 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LFixKa093406; Mon, 21 Jul 2014 15:44:59 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407211544.s6LFixKa093406@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 21 Jul 2014 15:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268945 - in head: lib/libc/stdlib sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 15:45:00 -0000 Author: pfg Date: Mon Jul 21 15:44:59 2014 New Revision: 268945 URL: http://svnweb.freebsd.org/changeset/base/268945 Log: Fix hdestroy() compliance issue. The hcreate(3) implementation and related functions we inherited from NetBSD used to free() the key value, something that is not supported by the standard implementation. This would cause a segmentation fault when attempting to run the examples from the opengroup and linux manpages. NetBSD has added non-standard calls to provide the previous behaviour but hdestroy is not very commonly used so at this time it seems excessive to bring those to FreeBSD. Bump the __FreeBSD_version as this is an ABI change. Reference: http://bugs.dragonflybsd.org/issues/1398 MFC after: 2 weeks Modified: head/lib/libc/stdlib/hcreate.c head/sys/sys/param.h Modified: head/lib/libc/stdlib/hcreate.c ============================================================================== --- head/lib/libc/stdlib/hcreate.c Mon Jul 21 15:26:52 2014 (r268944) +++ head/lib/libc/stdlib/hcreate.c Mon Jul 21 15:44:59 2014 (r268945) @@ -159,7 +159,6 @@ hdestroy_r(struct hsearch_data *head) while (!SLIST_EMPTY(&table[idx])) { ie = SLIST_FIRST(&table[idx]); SLIST_REMOVE_HEAD(&table[idx], link); - free(ie->ent.key); free(ie); } } Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Jul 21 15:26:52 2014 (r268944) +++ head/sys/sys/param.h Mon Jul 21 15:44:59 2014 (r268945) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100027 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100028 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 16:21:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 523D3524; Mon, 21 Jul 2014 16:21:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24FE52723; Mon, 21 Jul 2014 16:21:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LGLIu5010806; Mon, 21 Jul 2014 16:21:18 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LGLIqC010805; Mon, 21 Jul 2014 16:21:18 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201407211621.s6LGLIqC010805@svn.freebsd.org> From: Ed Maste Date: Mon, 21 Jul 2014 16:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268946 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 16:21:18 -0000 Author: emaste Date: Mon Jul 21 16:21:17 2014 New Revision: 268946 URL: http://svnweb.freebsd.org/changeset/base/268946 Log: MFC syscons(4) man page updates: r268050: Add a vt(4) cross reference to syscons(4) r268169: Clarify the setting of syscons driver flags Submitted by: wblock r268215: Describe kern.vty sc/vt tunable in syscons(4) Reviewed by: wblock Modified: stable/10/share/man/man4/syscons.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/syscons.4 ============================================================================== --- stable/10/share/man/man4/syscons.4 Mon Jul 21 15:44:59 2014 (r268945) +++ stable/10/share/man/man4/syscons.4 Mon Jul 21 16:21:17 2014 (r268946) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 11, 2009 +.Dd July 21, 2014 .Dt SYSCONS 4 .Os .Sh NAME @@ -62,6 +62,10 @@ In .Pa /boot/device.hints : .Cd hint.sc.0.at="isa" .Cd hint.sc.0.vesa_mode=0x103 +.Pp +In +.Pa /boot/loader.conf : +.Cd kern.vty=sc .Sh DESCRIPTION The .Nm @@ -403,7 +407,9 @@ option too. The following driver flags can be used to control the .Nm driver. -They can be set either in +Driver flags can be set with the +.Cd hint.sc.0.flags +tunable, either in .Pa /boot/device.hints , or else at the loader prompt (see .Xr loader 8 ) . @@ -446,6 +452,26 @@ This option instructs the syscons driver for a keyboard device if it is not currently attached to one. Otherwise, the driver only probes for a keyboard once during bootup. .El +.Ss Loader Tunables +These settings can be entered at the +.Xr loader 8 +prompt or in +.Xr loader.conf 5 . +.Bl -tag -width indent +.It Va kern.vty +When both +.Nm +and +.Xr vt 4 +have been compiled into the kernel, the one to use for the system console can +be selected by setting this variable to +.Ql sc +or +.Ql vt . +If not set, +.Nm +provides the default system console. +.El .Sh FILES .Bl -tag -width /usr/share/syscons/xxxxyyyyzzz -compact .It Pa /dev/console @@ -533,6 +559,7 @@ to the kernel. .Xr splash 4 , .Xr ukbd 4 , .Xr vga 4 , +.Xr vt 4 , .Xr kbdmap 5 , .Xr rc.conf 5 , .Xr ttys 5 , From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 16:38:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0C46A46; Mon, 21 Jul 2014 16:38:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 944312930; Mon, 21 Jul 2014 16:38:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LGc6bw016505; Mon, 21 Jul 2014 16:38:06 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LGc6Zn016503; Mon, 21 Jul 2014 16:38:06 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201407211638.s6LGc6Zn016503@svn.freebsd.org> From: Ed Maste Date: Mon, 21 Jul 2014 16:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268947 - in head/sys/dev: drm2/i915 vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 16:38:06 -0000 Author: emaste Date: Mon Jul 21 16:38:05 2014 New Revision: 268947 URL: http://svnweb.freebsd.org/changeset/base/268947 Log: Hide syscons-specific workaround under DEV_SC This change is a bit ugly, but so is the coupling between the i915 driver and syscons. It isn't worth developing a more elegant solution only to support the legacy syscons console. Modified: head/sys/dev/drm2/i915/intel_fb.c head/sys/dev/vt/vt_core.c Modified: head/sys/dev/drm2/i915/intel_fb.c ============================================================================== --- head/sys/dev/drm2/i915/intel_fb.c Mon Jul 21 16:21:17 2014 (r268946) +++ head/sys/dev/drm2/i915/intel_fb.c Mon Jul 21 16:38:05 2014 (r268947) @@ -27,6 +27,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_syscons.h" #include #include #include @@ -216,7 +217,9 @@ static void intel_fbdev_destroy(struct d } } +#ifdef DEV_SC extern int sc_txtmouse_no_retrace_wait; +#endif int intel_fbdev_init(struct drm_device *dev) { @@ -240,7 +243,9 @@ int intel_fbdev_init(struct drm_device * drm_fb_helper_single_add_all_connectors(&ifbdev->helper); drm_fb_helper_initial_config(&ifbdev->helper, 32); +#ifdef DEV_SC sc_txtmouse_no_retrace_wait = 1; +#endif return 0; } Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Mon Jul 21 16:21:17 2014 (r268946) +++ head/sys/dev/vt/vt_core.c Mon Jul 21 16:38:05 2014 (r268947) @@ -111,9 +111,6 @@ const struct terminal_class vt_termclass #define VT_UNIT(vw) ((vw)->vw_device->vd_unit * VT_MAXWINDOWS + \ (vw)->vw_number) -/* XXX while syscons is here. */ -int sc_txtmouse_no_retrace_wait; - static SYSCTL_NODE(_kern, OID_AUTO, vt, CTLFLAG_RD, 0, "vt(9) parameters"); VT_SYSCTL_INT(enable_altgr, 1, "Enable AltGr key (Do not assume R.Alt as Alt)"); VT_SYSCTL_INT(debug, 0, "vt(9) debug level"); From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 16:53:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF5A81FD; Mon, 21 Jul 2014 16:53:11 +0000 (UTC) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A0042B91; Mon, 21 Jul 2014 16:53:11 +0000 (UTC) Received: from compute6.internal (compute6.nyi.mail.srv.osa [10.202.2.46]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 52983225C4; Mon, 21 Jul 2014 12:42:57 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Mon, 21 Jul 2014 12:42:57 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h= message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; s=mesmtp; bh=LDNj88XuCFsstpTo86XuhRuOmGw=; b=Yug1uWvsmNq0jW/U8X7T5JTpBsot JwKExLmiqtXCJ2NxEnkbXgOMIQibjggKiCo+nDQWe1i98KNikAWtiQRl9rH/H59I MD/yo2v8ha/yCEC668VcHoP4O2YuyW9jJz7kBToZ7KTuM+kNKPuUk3p/a+Ds4Uqs 1C89rykHIpD8sIw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=LDNj88XuCFsstpTo86XuhR uOmGw=; b=Q1veG5wUV6KruKSnvKMasFC+Mh4os6a9I7D4C5lfRLsF9qfcgjba3y rjaIyBVZWf7jqAHZTqfvw/Sr9szrQORanlanoeNGtySVuyptf/0tHdJTVVoOVHrU JgYmxttaElJ2YToTMJX7T+u68XKhOq+rZ4oxgx+qUOzXSQkcQEJ/E= X-Sasl-enc: hoy3SajW87lFjjlr7R/LFFqHZ6PtEJjV+wuj7uKd5ymL 1405960977 Received: from [192.168.1.66] (unknown [81.152.17.118]) by mail.messagingengine.com (Postfix) with ESMTPA id 84AB7680177; Mon, 21 Jul 2014 12:42:56 -0400 (EDT) Message-ID: <53CD430F.5040604@fastmail.net> Date: Mon, 21 Jul 2014 17:42:55 +0100 From: Bruce Simpson User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r268943 - in head: include lib/libc/stdlib References: <201407211522.s6LFMnQo084633@svn.freebsd.org> In-Reply-To: <201407211522.s6LFMnQo084633@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 16:53:11 -0000 On 21/07/2014 16:22, Pedro F. Giffuni wrote: > ] > Log: > Add re-entrant versions of the hash functions based on the GNU api. > What, if anything, can be done about qsort_r() API incompatibility? From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 17:18:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4F22C67; Mon, 21 Jul 2014 17:18:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2A8B2E4E; Mon, 21 Jul 2014 17:18:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LHI0es035171; Mon, 21 Jul 2014 17:18:00 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LHI0FF035170; Mon, 21 Jul 2014 17:18:00 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201407211718.s6LHI0FF035170@svn.freebsd.org> From: Ed Maste Date: Mon, 21 Jul 2014 17:18:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268948 - head/usr.bin/vtfontcvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 17:18:00 -0000 Author: emaste Date: Mon Jul 21 17:18:00 2014 New Revision: 268948 URL: http://svnweb.freebsd.org/changeset/base/268948 Log: Use the standard way of printing the usage string Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Mon Jul 21 16:38:05 2014 (r268947) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Mon Jul 21 17:18:00 2014 (r268948) @@ -91,7 +91,7 @@ static void usage(void) { - errx(1, + (void)fprintf(stderr, "usage: vtfontcvt [-w width] [-h height] [-v] normal.bdf [bold.bdf] out.fnt\n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 17:43:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01D613EE; Mon, 21 Jul 2014 17:43:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C997A20EF; Mon, 21 Jul 2014 17:43:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LHhbFj047590; Mon, 21 Jul 2014 17:43:37 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LHhbJd047589; Mon, 21 Jul 2014 17:43:37 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201407211743.s6LHhbJd047589@svn.freebsd.org> From: Ed Maste Date: Mon, 21 Jul 2014 17:43:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268949 - head/usr.bin/vtfontcvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 17:43:38 -0000 Author: emaste Date: Mon Jul 21 17:43:37 2014 New Revision: 268949 URL: http://svnweb.freebsd.org/changeset/base/268949 Log: Remove redundant return statement after errx MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Mon Jul 21 17:18:00 2014 (r268948) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Mon Jul 21 17:43:37 2014 (r268949) @@ -111,10 +111,8 @@ add_mapping(struct glyph *gl, unsigned i ml = &maps[map_idx]; if (TAILQ_LAST(ml, mapping_list) != NULL && - TAILQ_LAST(ml, mapping_list)->m_char >= c) { + TAILQ_LAST(ml, mapping_list)->m_char >= c) errx(1, "Bad ordering at character %u\n", c); - return (1); - } TAILQ_INSERT_TAIL(ml, mp, m_list); map_count[map_idx]++; @@ -134,11 +132,9 @@ dedup_mapping(unsigned int map_idx) TAILQ_FOREACH_SAFE(mp_bold, &maps[map_idx], m_list, mp_temp) { while (mp_normal->m_char < mp_bold->m_char) mp_normal = TAILQ_NEXT(mp_normal, m_list); - if (mp_bold->m_char != mp_normal->m_char) { + if (mp_bold->m_char != mp_normal->m_char) errx(1, "Character %u not in normal font!\n", mp_bold->m_char); - return (1); - } if (mp_bold->m_glyph != mp_normal->m_glyph) continue; @@ -211,11 +207,8 @@ parse_bitmap_line(uint8_t *left, uint8_t uint8_t *p; unsigned int i, subline; - if (dwidth != width && dwidth != width * 2) { - errx(1, - "Bitmap with unsupported width %u!\n", dwidth); - return (1); - } + if (dwidth != width && dwidth != width * 2) + errx(1, "Bitmap with unsupported width %u!\n", dwidth); /* Move pixel data right to simplify splitting double characters. */ line >>= (howmany(dwidth, 8) * 8) - dwidth; @@ -232,9 +225,7 @@ parse_bitmap_line(uint8_t *left, uint8_t *p++ = subline >> 8; *p = subline; } else { - errx(1, - "Unsupported wbytes %u!\n", wbytes); - return (1); + errx(1, "Unsupported wbytes %u!\n", wbytes); } line >>= width; @@ -265,10 +256,8 @@ parse_bdf(FILE *fp, unsigned int map_idx if (strncmp(ln, "BITMAP", 6) == 0 && (ln[6] == ' ' || ln[6] == '\0')) { for (i = 0; i < height; i++) { - if ((ln = fgetln(fp, &length)) == NULL) { + if ((ln = fgetln(fp, &length)) == NULL) errx(1, "Unexpected EOF!\n"); - return (1); - } ln[length - 1] = '\0'; sscanf(ln, "%x", &line); if (parse_bitmap_line(bytes + i * wbytes, @@ -528,10 +517,8 @@ main(int argc, char *argv[]) switch (ch) { case 'h': val = atoi(optarg); - if (val <= 0 || val > 128) { + if (val <= 0 || val > 128) errx(1, "Invalid height %d", val); - return (1); - } height = val; break; case 'v': From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 18:13:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F156DD27; Mon, 21 Jul 2014 18:13:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEC2223A4; Mon, 21 Jul 2014 18:13:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LIDEvQ061761; Mon, 21 Jul 2014 18:13:14 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LIDEcj061760; Mon, 21 Jul 2014 18:13:14 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201407211813.s6LIDEcj061760@svn.freebsd.org> From: Ed Maste Date: Mon, 21 Jul 2014 18:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268950 - stable/10/tools/tools/vt/mkkfont X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 18:13:15 -0000 Author: emaste Date: Mon Jul 21 18:13:14 2014 New Revision: 268950 URL: http://svnweb.freebsd.org/changeset/base/268950 Log: MFC r266847: Add missing , in converted font output Modified: stable/10/tools/tools/vt/mkkfont/mkkfont.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/tools/vt/mkkfont/mkkfont.c ============================================================================== --- stable/10/tools/tools/vt/mkkfont/mkkfont.c Mon Jul 21 17:43:37 2014 (r268949) +++ stable/10/tools/tools/vt/mkkfont/mkkfont.c Mon Jul 21 18:13:14 2014 (r268950) @@ -139,7 +139,7 @@ print_info(struct file_header *fh) else printf("\t\t\t\t NULL,\n"); } - printf("\t\t\t\t }\n"); + printf("\t\t\t\t },\n"); printf("\t.vf_map_count\t\t= { %u, %u, %u, %u },\n", be32toh(fh->map_count[0]), be32toh(fh->map_count[1]), From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 18:23:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 322D2F45; Mon, 21 Jul 2014 18:23:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F4472493; Mon, 21 Jul 2014 18:23:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LINm8i066303; Mon, 21 Jul 2014 18:23:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LINmqR066302; Mon, 21 Jul 2014 18:23:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201407211823.s6LINmqR066302@svn.freebsd.org> From: John Baldwin Date: Mon, 21 Jul 2014 18:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268951 - stable/10/usr.sbin/bhyvectl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 18:23:49 -0000 Author: jhb Date: Mon Jul 21 18:23:48 2014 New Revision: 268951 URL: http://svnweb.freebsd.org/changeset/base/268951 Log: MFC 264275: Explicitly initialize 'vmname' to NULL. Modified: stable/10/usr.sbin/bhyvectl/bhyvectl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyvectl/bhyvectl.c ============================================================================== --- stable/10/usr.sbin/bhyvectl/bhyvectl.c Mon Jul 21 18:13:14 2014 (r268950) +++ stable/10/usr.sbin/bhyvectl/bhyvectl.c Mon Jul 21 18:23:48 2014 (r268951) @@ -574,6 +574,7 @@ main(int argc, char *argv[]) }; vcpu = 0; + vmname = NULL; assert_lapic_lvt = -1; progname = basename(argv[0]); From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 18:26:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31DD015B; Mon, 21 Jul 2014 18:26:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EE8624B4; Mon, 21 Jul 2014 18:26:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LIQpHL066773; Mon, 21 Jul 2014 18:26:51 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LIQp8E066772; Mon, 21 Jul 2014 18:26:51 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201407211826.s6LIQp8E066772@svn.freebsd.org> From: John Baldwin Date: Mon, 21 Jul 2014 18:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268952 - stable/10/sys/amd64/vmm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 18:26:52 -0000 Author: jhb Date: Mon Jul 21 18:26:51 2014 New Revision: 268952 URL: http://svnweb.freebsd.org/changeset/base/268952 Log: MFC 264347: Account for the "plus 1" encoding of the CPUID Function 4 reported core per package and cache sharing values. Modified: stable/10/sys/amd64/vmm/x86.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/vmm/x86.c ============================================================================== --- stable/10/sys/amd64/vmm/x86.c Mon Jul 21 18:23:48 2014 (r268951) +++ stable/10/sys/amd64/vmm/x86.c Mon Jul 21 18:26:51 2014 (r268952) @@ -219,9 +219,18 @@ x86_emulate_cpuid(struct vm *vm, int vcp /* * Do not expose topology. + * + * The maximum number of processor cores in + * this physical processor package and the + * maximum number of threads sharing this + * cache are encoded with "plus 1" encoding. + * Adding one to the value in this register + * field to obtains the actual value. + * + * Therefore 0 for both indicates 1 core per + * package and no cache sharing. */ regs[0] &= 0xffff8000; - regs[0] |= 0x04008000; break; case CPUID_0000_0007: From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 18:51:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DB91D9F for ; Mon, 21 Jul 2014 18:51:53 +0000 (UTC) Received: from nm10-vm0.bullet.mail.bf1.yahoo.com (nm10-vm0.bullet.mail.bf1.yahoo.com [98.139.213.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F32E52741 for ; Mon, 21 Jul 2014 18:51:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1405968705; bh=6j7+hH4FrebC3NUgXIIOOr8Ga1aAuCHu8AkYtALA/4Y=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Message-Id:References:To:X-Mailer; b=GoLKGo+0ILX0UFS2WcxXFH5sNPOPGo+T2L6v95Ba/BKHOO30BGamBpz2sgAlzhlH5vGsr5s8QS5wqsD9b0SWdP9tNn/DJl0cumClChrU+qu/0Fq7IyNNbaGjVberYOWC1KjZiVx8CsH81yg4XUwHPM/v7jqOgciszSZ3kYv7fxLTw9V55nTp2p3dwaiYSej0Whv6AgXqZB2n8VRKRmJNyQHl8OoPVjR4p5rlnzjTmxhArmEeIwyCp3/D0veJWRpnQng6HHKB/W0cpiNcgsn8q1Hzf9WvELjLnqEND5AQhbJpfZaxULWjHtpDgrYuG0IN1cEaxfAJ0ZPPu33ggIpwmw== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=PZkqtwNxNJJZPivfOhFa7ntqaTJu9/dLKXnvRl7OWpAls+9/EQ+C7uKCfakG7r1NLzVU5nQQrMhL48LVebptveDTWrTtGMQIwXG+4bK1+FrzOYdE5Be7cvytq8zXDYRcusKCm4LViauAYAoED9OUwEQE2WNjF8eJ4pY4SvvvG6zj8M+KwAH3DHh8d3+y6vIcuALTbW1LpYAVzIGeJE3Y+yvOutqWq5MgsUFwso5boBjAHIhbecCzqa410JIJfLsf2Rjk62hEDIGnBF0H/AmiDEbEKrnxhIWMIxqCGLY6+RgCeo5iD1hET4S6UXrd6U3/URfh+ozPUMniPRC3UnPhag==; Received: from [98.139.212.150] by nm10.bullet.mail.bf1.yahoo.com with NNFMP; 21 Jul 2014 18:51:45 -0000 Received: from [68.142.230.65] by tm7.bullet.mail.bf1.yahoo.com with NNFMP; 21 Jul 2014 18:51:45 -0000 Received: from [127.0.0.1] by smtp222.mail.bf1.yahoo.com with NNFMP; 21 Jul 2014 18:51:45 -0000 X-Yahoo-Newman-Id: 206266.59062.bm@smtp222.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: ZdDJlBsVM1mulk3aC85cyuuPKX_DnbHeAYZCPFS5HTGvzJP j8FHxB811reSzD_1IrfVmBmzYysluQm.VWQgtfgJR6_55bRbbuX5o9TqRyFb 5jKHX95uEwJCEq64pwpTFY1GIBHyTlT6cw1cacXULmDHw4_YoLxkpNApzZni hnpLtgHNHVXbE.zjxDBQkrM3AHgl3ffzfUuC85C7OtYuejsFzHq1C3Ft5zwV mCEs04PjYvjLieztN0ypsVjAQqETsFGU6IZ5uAqpLD09l35_CTlsFtm9dln5 MqtdGPZYnZl.rRMcUJUsf5I_OBqWzRN2gwBsLze94NC1eilxE0pYtrXmkqUg NcdE7KwvmHiyHaZlzZ2MXdIwpQq92SaHBfEr3_Oewht4hXG87.zIqcAvPc.f E7rxu8og0nV4S4hPEYwUxc6wFNeRq9aDh1HtzCQzCua7ImFoBSu61smjAGQI T4lzooTf5wMlzxSl_wGe7ZosAtWwvku2QKsXSiULN0PGUPS.vnm_8yrfYK6B ud54e40RPtMz_enDX5mKBCDCqhRwLPk3_m04- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r268943 - in head: include lib/libc/stdlib From: Pedro Giffuni In-Reply-To: <53CD430F.5040604@fastmail.net> Date: Mon, 21 Jul 2014 13:51:18 -0500 Message-Id: <68E8EDB9-64DE-4037-9047-C8BEAD86801A@freebsd.org> References: <201407211522.s6LFMnQo084633@svn.freebsd.org> <53CD430F.5040604@fastmail.net> To: Bruce Simpson X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 18:51:53 -0000 Il giorno 21/lug/2014, alle ore 11:42, Bruce Simpson = ha scritto: > On 21/07/2014 16:22, Pedro F. Giffuni wrote: >> ] >> Log: >> Add re-entrant versions of the hash functions based on the GNU api. >> =20 > What, if anything, can be done about qsort_r() API incompatibility? qsort_r is non-standard and we did it first, plus we will want to stay = compatible with Apple :). I guess we could do some ugly parameter swapping in the case where = _GNU_SOURCE is defined, but I won=92t volunteer to do that. Pedro.= From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 19:08:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4B95382; Mon, 21 Jul 2014 19:08:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF5A92898; Mon, 21 Jul 2014 19:08:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LJ88D0086189; Mon, 21 Jul 2014 19:08:08 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LJ83SF086092; Mon, 21 Jul 2014 19:08:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201407211908.s6LJ83SF086092@svn.freebsd.org> From: John Baldwin Date: Mon, 21 Jul 2014 19:08:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268953 - in stable/10: lib/libvmmapi sys/amd64/vmm sys/amd64/vmm/intel sys/amd64/vmm/io sys/boot/userboot/userboot usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 19:08:09 -0000 Author: jhb Date: Mon Jul 21 19:08:02 2014 New Revision: 268953 URL: http://svnweb.freebsd.org/changeset/base/268953 Log: MFC 264353,264509,264768,264770,264825,264846,264988,265114,265165,265365, 265941,265951,266390,266550,266910: Various bhyve fixes: - Don't save host's return address in 'struct vmxctx'. - Permit non-32-bit accesses to local APIC registers. - Factor out common ioport handler code. - Use calloc() in favor of malloc + memset. - Change the vlapic timer frequency to be in the ballpark of contemporary hardware. - Allow the guest to read the TSC via MSR 0x10. - A VMCS is always inactive when it exits the vmx_run() loop. Remove redundant code and the misleading comment that suggest otherwise. - Ignore writes to microcode update MSR. This MSR is accessed by RHEL7 guest. Add KTR tracepoints to annotate wrmsr and rdmsr VM exits. - Provide an alias for the userboot console and name it 'comconsole'. - Use EV_ADD to create an mevent and EV_ENABLE to enable it. - abort(3) the process in response to a VMEXIT_ABORT. - Don't include the guest memory segments in the bhyve(8) process core dump. - Make the vmx asm code dtrace-fbt-friendly. - Allow vmx_getdesc() and vmx_setdesc() to be called for a vcpu that is in the VCPU_RUNNING state. - Enable VMX in the IA32_FEATURE_CONTROL MSR if it not enabled and the MSR isn't locked. Modified: stable/10/lib/libvmmapi/vmmapi.c stable/10/lib/libvmmapi/vmmapi.h stable/10/sys/amd64/vmm/intel/vmcs.c stable/10/sys/amd64/vmm/intel/vmcs.h stable/10/sys/amd64/vmm/intel/vmx.c stable/10/sys/amd64/vmm/intel/vmx.h stable/10/sys/amd64/vmm/intel/vmx_genassym.c stable/10/sys/amd64/vmm/intel/vmx_support.S stable/10/sys/amd64/vmm/io/vlapic.c stable/10/sys/amd64/vmm/vmm_ioport.c stable/10/sys/amd64/vmm/vmm_lapic.c stable/10/sys/boot/userboot/userboot/conf.c stable/10/sys/boot/userboot/userboot/userboot_cons.c stable/10/usr.sbin/bhyve/bhyve.8 stable/10/usr.sbin/bhyve/bhyverun.c stable/10/usr.sbin/bhyve/block_if.c stable/10/usr.sbin/bhyve/inout.c stable/10/usr.sbin/bhyve/mevent.c stable/10/usr.sbin/bhyve/pci_ahci.c stable/10/usr.sbin/bhyve/pci_emul.c stable/10/usr.sbin/bhyve/pci_passthru.c stable/10/usr.sbin/bhyve/pci_virtio_block.c stable/10/usr.sbin/bhyve/pci_virtio_net.c stable/10/usr.sbin/bhyve/pci_virtio_rnd.c stable/10/usr.sbin/bhyve/uart_emul.c stable/10/usr.sbin/bhyve/xmsr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libvmmapi/vmmapi.c ============================================================================== --- stable/10/lib/libvmmapi/vmmapi.c Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/lib/libvmmapi/vmmapi.c Mon Jul 21 19:08:02 2014 (r268953) @@ -57,6 +57,7 @@ struct vmctx { int fd; uint32_t lowmem_limit; enum vm_mmap_style vms; + int memflags; size_t lowmem; char *lowmem_addr; size_t highmem; @@ -101,6 +102,7 @@ vm_open(const char *name) assert(vm != NULL); vm->fd = -1; + vm->memflags = 0; vm->lowmem_limit = 3 * GB; vm->name = (char *)(vm + 1); strcpy(vm->name, name); @@ -180,10 +182,17 @@ vm_set_lowmem_limit(struct vmctx *ctx, u ctx->lowmem_limit = limit; } +void +vm_set_memflags(struct vmctx *ctx, int flags) +{ + + ctx->memflags = flags; +} + static int setup_memory_segment(struct vmctx *ctx, vm_paddr_t gpa, size_t len, char **addr) { - int error; + int error, mmap_flags; struct vm_memory_segment seg; /* @@ -195,8 +204,11 @@ setup_memory_segment(struct vmctx *ctx, seg.len = len; error = ioctl(ctx->fd, VM_MAP_MEMORY, &seg); if (error == 0 && addr != NULL) { - *addr = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, - ctx->fd, gpa); + mmap_flags = MAP_SHARED; + if ((ctx->memflags & VM_MEM_F_INCORE) == 0) + mmap_flags |= MAP_NOCORE; + *addr = mmap(NULL, len, PROT_READ | PROT_WRITE, mmap_flags, + ctx->fd, gpa); } return (error); } Modified: stable/10/lib/libvmmapi/vmmapi.h ============================================================================== --- stable/10/lib/libvmmapi/vmmapi.h Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/lib/libvmmapi/vmmapi.h Mon Jul 21 19:08:02 2014 (r268953) @@ -42,6 +42,8 @@ enum vm_mmap_style { VM_MMAP_SPARSE, /* mappings created on-demand */ }; +#define VM_MEM_F_INCORE 0x01 /* include guest memory in core file */ + int vm_create(const char *name); struct vmctx *vm_open(const char *name); void vm_destroy(struct vmctx *ctx); @@ -53,6 +55,7 @@ void *vm_map_gpa(struct vmctx *ctx, vm_p int vm_get_gpa_pmap(struct vmctx *, uint64_t gpa, uint64_t *pte, int *num); uint32_t vm_get_lowmem_limit(struct vmctx *ctx); void vm_set_lowmem_limit(struct vmctx *ctx, uint32_t limit); +void vm_set_memflags(struct vmctx *ctx, int flags); int vm_set_desc(struct vmctx *ctx, int vcpu, int reg, uint64_t base, uint32_t limit, uint32_t access); int vm_get_desc(struct vmctx *ctx, int vcpu, int reg, Modified: stable/10/sys/amd64/vmm/intel/vmcs.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmcs.c Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/sys/amd64/vmm/intel/vmcs.c Mon Jul 21 19:08:02 2014 (r268953) @@ -231,7 +231,7 @@ vmcs_setreg(struct vmcs *vmcs, int runni } int -vmcs_setdesc(struct vmcs *vmcs, int seg, struct seg_desc *desc) +vmcs_setdesc(struct vmcs *vmcs, int running, int seg, struct seg_desc *desc) { int error; uint32_t base, limit, access; @@ -240,7 +240,8 @@ vmcs_setdesc(struct vmcs *vmcs, int seg, if (error != 0) panic("vmcs_setdesc: invalid segment register %d", seg); - VMPTRLD(vmcs); + if (!running) + VMPTRLD(vmcs); if ((error = vmwrite(base, desc->base)) != 0) goto done; @@ -252,12 +253,13 @@ vmcs_setdesc(struct vmcs *vmcs, int seg, goto done; } done: - VMCLEAR(vmcs); + if (!running) + VMCLEAR(vmcs); return (error); } int -vmcs_getdesc(struct vmcs *vmcs, int seg, struct seg_desc *desc) +vmcs_getdesc(struct vmcs *vmcs, int running, int seg, struct seg_desc *desc) { int error; uint32_t base, limit, access; @@ -267,7 +269,8 @@ vmcs_getdesc(struct vmcs *vmcs, int seg, if (error != 0) panic("vmcs_getdesc: invalid segment register %d", seg); - VMPTRLD(vmcs); + if (!running) + VMPTRLD(vmcs); if ((error = vmread(base, &u64)) != 0) goto done; desc->base = u64; @@ -282,7 +285,8 @@ vmcs_getdesc(struct vmcs *vmcs, int seg, desc->access = u64; } done: - VMCLEAR(vmcs); + if (!running) + VMCLEAR(vmcs); return (error); } Modified: stable/10/sys/amd64/vmm/intel/vmcs.h ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmcs.h Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/sys/amd64/vmm/intel/vmcs.h Mon Jul 21 19:08:02 2014 (r268953) @@ -49,9 +49,9 @@ int vmcs_set_msr_save(struct vmcs *vmcs, int vmcs_init(struct vmcs *vmcs); int vmcs_getreg(struct vmcs *vmcs, int running, int ident, uint64_t *rv); int vmcs_setreg(struct vmcs *vmcs, int running, int ident, uint64_t val); -int vmcs_getdesc(struct vmcs *vmcs, int ident, +int vmcs_getdesc(struct vmcs *vmcs, int running, int ident, struct seg_desc *desc); -int vmcs_setdesc(struct vmcs *vmcs, int ident, +int vmcs_setdesc(struct vmcs *vmcs, int running, int ident, struct seg_desc *desc); static __inline uint64_t Modified: stable/10/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx.c Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/sys/amd64/vmm/intel/vmx.c Mon Jul 21 19:08:02 2014 (r268953) @@ -509,6 +509,15 @@ static void vmx_enable(void *arg __unused) { int error; + uint64_t feature_control; + + feature_control = rdmsr(MSR_IA32_FEATURE_CONTROL); + if ((feature_control & IA32_FEATURE_CONTROL_LOCK) == 0 || + (feature_control & IA32_FEATURE_CONTROL_VMX_EN) == 0) { + wrmsr(MSR_IA32_FEATURE_CONTROL, + feature_control | IA32_FEATURE_CONTROL_VMX_EN | + IA32_FEATURE_CONTROL_LOCK); + } load_cr4(rcr4() | CR4_VMXE); @@ -544,7 +553,7 @@ vmx_init(int ipinum) * are set (bits 0 and 2 respectively). */ feature_control = rdmsr(MSR_IA32_FEATURE_CONTROL); - if ((feature_control & IA32_FEATURE_CONTROL_LOCK) == 0 || + if ((feature_control & IA32_FEATURE_CONTROL_LOCK) == 1 && (feature_control & IA32_FEATURE_CONTROL_VMX_EN) == 0) { printf("vmx_init: VMX operation disabled by BIOS\n"); return (ENXIO); @@ -863,6 +872,11 @@ vmx_vminit(struct vm *vm, pmap_t pmap) * MSR_EFER is saved and restored in the guest VMCS area on a * VM exit and entry respectively. It is also restored from the * host VMCS area on a VM exit. + * + * The TSC MSR is exposed read-only. Writes are disallowed as that + * will impact the host TSC. + * XXX Writes would be implemented with a wrmsr trap, and + * then modifying the TSC offset in the VMCS. */ if (guest_msr_rw(vmx, MSR_GSBASE) || guest_msr_rw(vmx, MSR_FSBASE) || @@ -870,7 +884,8 @@ vmx_vminit(struct vm *vm, pmap_t pmap) guest_msr_rw(vmx, MSR_SYSENTER_ESP_MSR) || guest_msr_rw(vmx, MSR_SYSENTER_EIP_MSR) || guest_msr_rw(vmx, MSR_KGSBASE) || - guest_msr_rw(vmx, MSR_EFER)) + guest_msr_rw(vmx, MSR_EFER) || + guest_msr_ro(vmx, MSR_TSC)) panic("vmx_vminit: error setting guest msr access"); /* @@ -1829,6 +1844,7 @@ vmx_exit_process(struct vmx *vmx, int vc vmm_stat_incr(vmx->vm, vcpu, VMEXIT_RDMSR, 1); retu = false; ecx = vmxctx->guest_rcx; + VCPU_CTR1(vmx->vm, vcpu, "rdmsr 0x%08x", ecx); error = emulate_rdmsr(vmx->vm, vcpu, ecx, &retu); if (error) { vmexit->exitcode = VM_EXITCODE_RDMSR; @@ -1847,6 +1863,8 @@ vmx_exit_process(struct vmx *vmx, int vc eax = vmxctx->guest_rax; ecx = vmxctx->guest_rcx; edx = vmxctx->guest_rdx; + VCPU_CTR2(vmx->vm, vcpu, "wrmsr 0x%08x value 0x%016lx", + ecx, (uint64_t)edx << 32 | eax); error = emulate_wrmsr(vmx->vm, vcpu, ecx, (uint64_t)edx << 32 | eax, &retu); if (error) { @@ -2257,7 +2275,7 @@ vmx_run(void *arg, int vcpu, register_t static void vmx_vmcleanup(void *arg) { - int i, error; + int i; struct vmx *vmx = arg; if (apic_access_virtualization(vmx, 0)) @@ -2266,13 +2284,6 @@ vmx_vmcleanup(void *arg) for (i = 0; i < VM_MAXCPU; i++) vpid_free(vmx->state[i].vpid); - /* - * XXXSMP we also need to clear the VMCS active on the other vcpus. - */ - error = vmclear(&vmx->vmcs[0]); - if (error != 0) - panic("vmx_vmcleanup: vmclear error %d on vcpu 0", error); - free(vmx, M_VMX); return; @@ -2430,17 +2441,27 @@ vmx_setreg(void *arg, int vcpu, int reg, static int vmx_getdesc(void *arg, int vcpu, int reg, struct seg_desc *desc) { + int hostcpu, running; struct vmx *vmx = arg; - return (vmcs_getdesc(&vmx->vmcs[vcpu], reg, desc)); + running = vcpu_is_running(vmx->vm, vcpu, &hostcpu); + if (running && hostcpu != curcpu) + panic("vmx_getdesc: %s%d is running", vm_name(vmx->vm), vcpu); + + return (vmcs_getdesc(&vmx->vmcs[vcpu], running, reg, desc)); } static int vmx_setdesc(void *arg, int vcpu, int reg, struct seg_desc *desc) { + int hostcpu, running; struct vmx *vmx = arg; - return (vmcs_setdesc(&vmx->vmcs[vcpu], reg, desc)); + running = vcpu_is_running(vmx->vm, vcpu, &hostcpu); + if (running && hostcpu != curcpu) + panic("vmx_setdesc: %s%d is running", vm_name(vmx->vm), vcpu); + + return (vmcs_setdesc(&vmx->vmcs[vcpu], running, reg, desc)); } static int Modified: stable/10/sys/amd64/vmm/intel/vmx.h ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx.h Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/sys/amd64/vmm/intel/vmx.h Mon Jul 21 19:08:02 2014 (r268953) @@ -60,7 +60,6 @@ struct vmxctx { register_t host_rbp; register_t host_rsp; register_t host_rbx; - register_t host_rip; /* * XXX todo debug registers and fpu state */ @@ -68,7 +67,7 @@ struct vmxctx { int inst_fail_status; /* - * The pmap needs to be deactivated in vmx_exit_guest() + * The pmap needs to be deactivated in vmx_enter_guest() * so keep a copy of the 'pmap' in each vmxctx. */ struct pmap *pmap; @@ -122,10 +121,11 @@ CTASSERT((offsetof(struct vmx, pir_desc[ #define VMX_VMLAUNCH_ERROR 2 #define VMX_INVEPT_ERROR 3 int vmx_enter_guest(struct vmxctx *ctx, struct vmx *vmx, int launched); -void vmx_exit_guest(void); void vmx_call_isr(uintptr_t entry); u_long vmx_fix_cr0(u_long cr0); u_long vmx_fix_cr4(u_long cr4); +extern char vmx_exit_guest[]; + #endif Modified: stable/10/sys/amd64/vmm/intel/vmx_genassym.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx_genassym.c Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/sys/amd64/vmm/intel/vmx_genassym.c Mon Jul 21 19:08:02 2014 (r268953) @@ -65,7 +65,6 @@ ASSYM(VMXCTX_HOST_R12, offsetof(struct v ASSYM(VMXCTX_HOST_RBP, offsetof(struct vmxctx, host_rbp)); ASSYM(VMXCTX_HOST_RSP, offsetof(struct vmxctx, host_rsp)); ASSYM(VMXCTX_HOST_RBX, offsetof(struct vmxctx, host_rbx)); -ASSYM(VMXCTX_HOST_RIP, offsetof(struct vmxctx, host_rip)); ASSYM(VMXCTX_INST_FAIL_STATUS, offsetof(struct vmxctx, inst_fail_status)); ASSYM(VMXCTX_PMAP, offsetof(struct vmxctx, pmap)); Modified: stable/10/sys/amd64/vmm/intel/vmx_support.S ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx_support.S Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/sys/amd64/vmm/intel/vmx_support.S Mon Jul 21 19:08:02 2014 (r268953) @@ -37,6 +37,10 @@ #define LK #endif +/* Be friendly to DTrace FBT's prologue/epilogue pattern matching */ +#define VENTER push %rbp ; mov %rsp,%rbp +#define VLEAVE pop %rbp + /* * Assumes that %rdi holds a pointer to the 'vmxctx'. * @@ -72,8 +76,7 @@ * * Assumes that %rdi holds a pointer to the 'vmxctx'. */ -#define VMX_HOST_SAVE(tmpreg) \ - movq (%rsp), tmpreg; /* return address */ \ +#define VMX_HOST_SAVE \ movq %r15, VMXCTX_HOST_R15(%rdi); \ movq %r14, VMXCTX_HOST_R14(%rdi); \ movq %r13, VMXCTX_HOST_R13(%rdi); \ @@ -81,9 +84,8 @@ movq %rbp, VMXCTX_HOST_RBP(%rdi); \ movq %rsp, VMXCTX_HOST_RSP(%rdi); \ movq %rbx, VMXCTX_HOST_RBX(%rdi); \ - movq tmpreg, VMXCTX_HOST_RIP(%rdi) -#define VMX_HOST_RESTORE(tmpreg) \ +#define VMX_HOST_RESTORE \ movq VMXCTX_HOST_R15(%rdi), %r15; \ movq VMXCTX_HOST_R14(%rdi), %r14; \ movq VMXCTX_HOST_R13(%rdi), %r13; \ @@ -91,8 +93,6 @@ movq VMXCTX_HOST_RBP(%rdi), %rbp; \ movq VMXCTX_HOST_RSP(%rdi), %rsp; \ movq VMXCTX_HOST_RBX(%rdi), %rbx; \ - movq VMXCTX_HOST_RIP(%rdi), tmpreg; \ - movq tmpreg, (%rsp) /* return address */ /* * vmx_enter_guest(struct vmxctx *vmxctx, int launched) @@ -102,10 +102,11 @@ * Interrupts must be disabled on entry. */ ENTRY(vmx_enter_guest) + VENTER /* * Save host state before doing anything else. */ - VMX_HOST_SAVE(%r10) + VMX_HOST_SAVE /* * Activate guest pmap on this cpu. @@ -186,15 +187,18 @@ inst_error: movl PCPU(CPUID), %r10d LK btrl %r10d, PM_ACTIVE(%r11) - VMX_HOST_RESTORE(%r10) + VMX_HOST_RESTORE + VLEAVE ret -END(vmx_enter_guest) /* - * void vmx_exit_guest(void) - * %rsp points to the struct vmxctx + * Non-error VM-exit from the guest. Make this a label so it can + * be used by C code when setting up the VMCS. + * The VMCS-restored %rsp points to the struct vmxctx */ -ENTRY(vmx_exit_guest) + ALIGN_TEXT + .globl vmx_exit_guest +vmx_exit_guest: /* * Save guest state that is not automatically saved in the vmcs. */ @@ -226,15 +230,16 @@ ENTRY(vmx_exit_guest) movl PCPU(CPUID), %r10d LK btrl %r10d, PM_ACTIVE(%r11) - VMX_HOST_RESTORE(%r10) + VMX_HOST_RESTORE /* * This will return to the caller of 'vmx_enter_guest()' with a return * value of VMX_GUEST_VMEXIT. */ movl $VMX_GUEST_VMEXIT, %eax + VLEAVE ret -END(vmx_exit_guest) +END(vmx_enter_guest) /* * %rdi = interrupt handler entry point @@ -243,6 +248,7 @@ END(vmx_exit_guest) * instruction in Intel SDM, Vol 2. */ ENTRY(vmx_call_isr) + VENTER mov %rsp, %r11 /* save %rsp */ and $~0xf, %rsp /* align on 16-byte boundary */ pushq $KERNEL_SS /* %ss */ @@ -251,5 +257,6 @@ ENTRY(vmx_call_isr) pushq $KERNEL_CS /* %cs */ cli /* disable interrupts */ callq *%rdi /* push %rip and call isr */ + VLEAVE ret END(vmx_call_isr) Modified: stable/10/sys/amd64/vmm/io/vlapic.c ============================================================================== --- stable/10/sys/amd64/vmm/io/vlapic.c Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/sys/amd64/vmm/io/vlapic.c Mon Jul 21 19:08:02 2014 (r268953) @@ -70,7 +70,12 @@ __FBSDID("$FreeBSD$"); #define VLAPIC_TIMER_UNLOCK(vlapic) mtx_unlock_spin(&((vlapic)->timer_mtx)) #define VLAPIC_TIMER_LOCKED(vlapic) mtx_owned(&((vlapic)->timer_mtx)) -#define VLAPIC_BUS_FREQ tsc_freq +/* + * APIC timer frequency: + * - arbitrary but chosen to be in the ballpark of contemporary hardware. + * - power-of-two to avoid loss of precision when converted to a bintime. + */ +#define VLAPIC_BUS_FREQ (128 * 1024 * 1024) static __inline uint32_t vlapic_get_id(struct vlapic *vlapic) Modified: stable/10/sys/amd64/vmm/vmm_ioport.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_ioport.c Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/sys/amd64/vmm/vmm_ioport.c Mon Jul 21 19:08:02 2014 (r268953) @@ -69,18 +69,19 @@ emulate_ioport(struct vm *vm, int vcpuid if (handler == NULL) return (-1); + switch (vmexit->u.inout.bytes) { + case 1: + mask = 0xff; + break; + case 2: + mask = 0xffff; + break; + default: + mask = 0xffffffff; + break; + } + if (!vmexit->u.inout.in) { - switch (vmexit->u.inout.bytes) { - case 1: - mask = 0xff; - break; - case 2: - mask = 0xffff; - break; - default: - mask = 0xffffffff; - break; - } val = vmexit->u.inout.eax & mask; } @@ -88,17 +89,6 @@ emulate_ioport(struct vm *vm, int vcpuid vmexit->u.inout.port, vmexit->u.inout.bytes, &val); if (!error && vmexit->u.inout.in) { - switch (vmexit->u.inout.bytes) { - case 1: - mask = 0xff; - break; - case 2: - mask = 0xffff; - break; - default: - mask = 0xffffffff; - break; - } vmexit->u.inout.eax &= ~mask; vmexit->u.inout.eax |= val & mask; } Modified: stable/10/sys/amd64/vmm/vmm_lapic.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_lapic.c Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/sys/amd64/vmm/vmm_lapic.c Mon Jul 21 19:08:02 2014 (r268953) @@ -230,10 +230,12 @@ lapic_mmio_read(void *vm, int cpu, uint6 off = gpa - DEFAULT_APIC_BASE; /* - * Memory mapped local apic accesses must be 4 bytes wide and - * aligned on a 16-byte boundary. + * Memory mapped local apic accesses should be aligned on a + * 16-byte boundary. They are also suggested to be 4 bytes + * wide, alas not all OSes follow suggestions. */ - if (size != 4 || off & 0xf) + off &= ~3; + if (off & 0xf) return (EINVAL); vlapic = vm_lapic(vm, cpu); Modified: stable/10/sys/boot/userboot/userboot/conf.c ============================================================================== --- stable/10/sys/boot/userboot/userboot/conf.c Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/sys/boot/userboot/userboot/conf.c Mon Jul 21 19:08:02 2014 (r268953) @@ -97,8 +97,10 @@ struct file_format *file_formats[] = { * data structures from bootstrap.h as well. */ extern struct console userboot_console; +extern struct console userboot_comconsole; struct console *consoles[] = { &userboot_console, + &userboot_comconsole, NULL }; Modified: stable/10/sys/boot/userboot/userboot/userboot_cons.c ============================================================================== --- stable/10/sys/boot/userboot/userboot/userboot_cons.c Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/sys/boot/userboot/userboot/userboot_cons.c Mon Jul 21 19:08:02 2014 (r268953) @@ -33,8 +33,12 @@ __FBSDID("$FreeBSD$"); int console; +static struct console *userboot_comconsp; + static void userboot_cons_probe(struct console *cp); static int userboot_cons_init(int); +static void userboot_comcons_probe(struct console *cp); +static int userboot_comcons_init(int); static void userboot_cons_putchar(int); static int userboot_cons_getchar(void); static int userboot_cons_poll(void); @@ -50,6 +54,21 @@ struct console userboot_console = { userboot_cons_poll, }; +/* + * Provide a simple alias to allow loader scripts to set the + * console to comconsole without resulting in an error + */ +struct console userboot_comconsole = { + "comconsole", + "comconsole", + 0, + userboot_comcons_probe, + userboot_comcons_init, + userboot_cons_putchar, + userboot_cons_getchar, + userboot_cons_poll, +}; + static void userboot_cons_probe(struct console *cp) { @@ -65,6 +84,31 @@ userboot_cons_init(int arg) } static void +userboot_comcons_probe(struct console *cp) +{ + + /* + * Save the console pointer so the comcons_init routine + * can set the C_PRESENT* flags. They are not set + * here to allow the existing userboot console to + * be elected the default. + */ + userboot_comconsp = cp; +} + +static int +userboot_comcons_init(int arg) +{ + + /* + * Set the C_PRESENT* flags to allow the comconsole + * to be selected as the active console + */ + userboot_comconsp->c_flags |= (C_PRESENTIN | C_PRESENTOUT); + return (0); +} + +static void userboot_cons_putchar(int c) { Modified: stable/10/usr.sbin/bhyve/bhyve.8 ============================================================================== --- stable/10/usr.sbin/bhyve/bhyve.8 Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/usr.sbin/bhyve/bhyve.8 Mon Jul 21 19:08:02 2014 (r268953) @@ -32,7 +32,7 @@ .Nd "run a guest operating system inside a virtual machine" .Sh SYNOPSIS .Nm -.Op Fl aehwxAHPW +.Op Fl aehwxACHPW .Op Fl c Ar numcpus .Op Fl g Ar gdbport .Op Fl p Ar vcpu:hostcpu @@ -69,6 +69,8 @@ guests. .It Fl c Ar numcpus Number of guest virtual CPUs. The default is 1 and the maximum is 16. +.It Fl C +Include guest memory in core file. .It Fl H Yield the virtual CPU thread when a HLT instruction is detected. If this option is not specified, virtual CPUs will use 100% of a host CPU. Modified: stable/10/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.c Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/usr.sbin/bhyve/bhyverun.c Mon Jul 21 19:08:02 2014 (r268953) @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #define GUEST_NIO_PORT 0x488 /* guest upcalls via i/o port */ -#define VMEXIT_SWITCH 0 /* force vcpu switch in mux mode */ #define VMEXIT_CONTINUE 1 /* continue from next instruction */ #define VMEXIT_RESTART 2 /* restart current instruction */ #define VMEXIT_ABORT 3 /* abort the vm run loop */ @@ -135,6 +134,7 @@ usage(int code) " -A: create an ACPI table\n" " -g: gdb port\n" " -c: # cpus (default 1)\n" + " -C: include guest memory in core file\n" " -p: pin 'vcpu' to 'hostcpu'\n" " -H: vmexit from the guest on hlt\n" " -P: vmexit from the guest on pause\n" @@ -272,12 +272,6 @@ fbsdrun_deletecpu(struct vmctx *ctx, int } static int -vmexit_catch_inout(void) -{ - return (VMEXIT_ABORT); -} - -static int vmexit_handle_notify(struct vmctx *ctx, struct vm_exit *vme, int *pvcpu, uint32_t eax) { @@ -330,7 +324,7 @@ vmexit_inout(struct vmctx *ctx, struct v fprintf(stderr, "Unhandled %s%c 0x%04x\n", in ? "in" : "out", bytes == 1 ? 'b' : (bytes == 2 ? 'w' : 'l'), port); - return (vmexit_catch_inout()); + return (VMEXIT_ABORT); } } @@ -575,6 +569,8 @@ vm_loop(struct vmctx *ctx, int vcpu, uin assert(error == 0 || errno == EALREADY); rip = vmexit[vcpu].rip + vmexit[vcpu].inst_length; break; + case VMEXIT_ABORT: + abort(); default: exit(1); } @@ -647,19 +643,20 @@ int main(int argc, char *argv[]) { int c, error, gdb_port, err, bvmcons; - int max_vcpus, mptgen; + int dump_guest_memory, max_vcpus, mptgen; struct vmctx *ctx; uint64_t rip; size_t memsize; bvmcons = 0; + dump_guest_memory = 0; progname = basename(argv[0]); gdb_port = 0; guest_ncpus = 1; memsize = 256 * MB; mptgen = 1; - while ((c = getopt(argc, argv, "abehwxAHIPWYp:g:c:s:m:l:U:")) != -1) { + while ((c = getopt(argc, argv, "abehwxACHIPWYp:g:c:s:m:l:U:")) != -1) { switch (c) { case 'a': x2apic_mode = 0; @@ -679,6 +676,9 @@ main(int argc, char *argv[]) case 'c': guest_ncpus = atoi(optarg); break; + case 'C': + dump_guest_memory = 1; + break; case 'g': gdb_port = atoi(optarg); break; @@ -760,6 +760,8 @@ main(int argc, char *argv[]) fbsdrun_set_capabilities(ctx, BSP); + if (dump_guest_memory) + vm_set_memflags(ctx, VM_MEM_F_INCORE); err = vm_setup_memory(ctx, memsize, VM_MMAP_ALL); if (err) { fprintf(stderr, "Unable to setup memory (%d)\n", err); Modified: stable/10/usr.sbin/bhyve/block_if.c ============================================================================== --- stable/10/usr.sbin/bhyve/block_if.c Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/usr.sbin/bhyve/block_if.c Mon Jul 21 19:08:02 2014 (r268953) @@ -270,13 +270,12 @@ blockif_open(const char *optstr, const c assert(sectsz != 0); } - bc = malloc(sizeof(struct blockif_ctxt)); + bc = calloc(1, sizeof(struct blockif_ctxt)); if (bc == NULL) { close(fd); return (NULL); } - memset(bc, 0, sizeof(*bc)); bc->bc_magic = BLOCKIF_SIG; bc->bc_fd = fd; bc->bc_size = size; Modified: stable/10/usr.sbin/bhyve/inout.c ============================================================================== --- stable/10/usr.sbin/bhyve/inout.c Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/usr.sbin/bhyve/inout.c Mon Jul 21 19:08:02 2014 (r268953) @@ -107,18 +107,19 @@ emulate_inout(struct vmctx *ctx, int vcp if (strict && handler == default_inout) return (-1); + switch (bytes) { + case 1: + mask = 0xff; + break; + case 2: + mask = 0xffff; + break; + default: + mask = 0xffffffff; + break; + } + if (!in) { - switch (bytes) { - case 1: - mask = 0xff; - break; - case 2: - mask = 0xffff; - break; - default: - mask = 0xffffffff; - break; - } val = *eax & mask; } @@ -131,17 +132,6 @@ emulate_inout(struct vmctx *ctx, int vcp error = -1; if (!error && in) { - switch (bytes) { - case 1: - mask = 0xff; - break; - case 2: - mask = 0xffff; - break; - default: - mask = 0xffffffff; - break; - } *eax &= ~mask; *eax |= val & mask; } Modified: stable/10/usr.sbin/bhyve/mevent.c ============================================================================== --- stable/10/usr.sbin/bhyve/mevent.c Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/usr.sbin/bhyve/mevent.c Mon Jul 21 19:08:02 2014 (r268953) @@ -52,9 +52,10 @@ __FBSDID("$FreeBSD$"); #define MEVENT_MAX 64 -#define MEV_ENABLE 1 -#define MEV_DISABLE 2 -#define MEV_DEL_PENDING 3 +#define MEV_ADD 1 +#define MEV_ENABLE 2 +#define MEV_DISABLE 3 +#define MEV_DEL_PENDING 4 extern char *vmname; @@ -147,10 +148,11 @@ mevent_kq_flags(struct mevent *mevp) int ret; switch (mevp->me_state) { + case MEV_ADD: + ret = EV_ADD; /* implicitly enabled */ + break; case MEV_ENABLE: - ret = EV_ADD; - if (mevp->me_type == EVF_TIMER) - ret |= EV_ENABLE; + ret = EV_ENABLE; break; case MEV_DISABLE: ret = EV_DISABLE; @@ -158,6 +160,9 @@ mevent_kq_flags(struct mevent *mevp) case MEV_DEL_PENDING: ret = EV_DELETE; break; + default: + assert(0); + break; } return (ret); @@ -268,12 +273,11 @@ mevent_add(int tfd, enum ev_type type, /* * Allocate an entry, populate it, and add it to the change list. */ - mevp = malloc(sizeof(struct mevent)); + mevp = calloc(1, sizeof(struct mevent)); if (mevp == NULL) { goto exit; } - memset(mevp, 0, sizeof(struct mevent)); if (type == EVF_TIMER) { mevp->me_msecs = tfd; mevp->me_timid = mevent_timid++; @@ -285,7 +289,7 @@ mevent_add(int tfd, enum ev_type type, LIST_INSERT_HEAD(&change_head, mevp, me_list); mevp->me_cq = 1; - mevp->me_state = MEV_ENABLE; + mevp->me_state = MEV_ADD; mevent_notify(); exit: Modified: stable/10/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_ahci.c Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Mon Jul 21 19:08:02 2014 (r268953) @@ -1786,8 +1786,7 @@ pci_ahci_init(struct vmctx *ctx, struct dbg = fopen("/tmp/log", "w+"); #endif - sc = malloc(sizeof(struct pci_ahci_softc)); - memset(sc, 0, sizeof(struct pci_ahci_softc)); + sc = calloc(1, sizeof(struct pci_ahci_softc)); pi->pi_arg = sc; sc->asc_pi = pi; sc->ports = MAX_PORTS; Modified: stable/10/usr.sbin/bhyve/pci_emul.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_emul.c Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/usr.sbin/bhyve/pci_emul.c Mon Jul 21 19:08:02 2014 (r268953) @@ -705,8 +705,7 @@ pci_emul_init(struct vmctx *ctx, struct struct pci_devinst *pdi; int err; - pdi = malloc(sizeof(struct pci_devinst)); - bzero(pdi, sizeof(*pdi)); + pdi = calloc(1, sizeof(struct pci_devinst)); pdi->pi_vmctx = ctx; pdi->pi_bus = bus; @@ -798,8 +797,7 @@ pci_msix_table_init(struct pci_devinst * assert(table_entries <= MAX_MSIX_TABLE_ENTRIES); table_size = table_entries * MSIX_TABLE_ENTRY_SIZE; - pi->pi_msix.table = malloc(table_size); - bzero(pi->pi_msix.table, table_size); + pi->pi_msix.table = calloc(1, table_size); /* set mask bit of vector control register */ for (i = 0; i < table_entries; i++) @@ -1809,8 +1807,7 @@ pci_emul_dinit(struct vmctx *ctx, struct int error; struct pci_emul_dsoftc *sc; - sc = malloc(sizeof(struct pci_emul_dsoftc)); - memset(sc, 0, sizeof(struct pci_emul_dsoftc)); + sc = calloc(1, sizeof(struct pci_emul_dsoftc)); pi->pi_arg = sc; Modified: stable/10/usr.sbin/bhyve/pci_passthru.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_passthru.c Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/usr.sbin/bhyve/pci_passthru.c Mon Jul 21 19:08:02 2014 (r268953) @@ -232,8 +232,7 @@ cfginitmsi(struct passthru_softc *sc) /* Allocate the emulated MSI-X table array */ table_size = pi->pi_msix.table_count * MSIX_TABLE_ENTRY_SIZE; - pi->pi_msix.table = malloc(table_size); - bzero(pi->pi_msix.table, table_size); + pi->pi_msix.table = calloc(1, table_size); /* Mask all table entries */ for (i = 0; i < pi->pi_msix.table_count; i++) { @@ -574,8 +573,7 @@ passthru_init(struct vmctx *ctx, struct if (vm_assign_pptdev(ctx, bus, slot, func) != 0) goto done; - sc = malloc(sizeof(struct passthru_softc)); - memset(sc, 0, sizeof(struct passthru_softc)); + sc = calloc(1, sizeof(struct passthru_softc)); pi->pi_arg = sc; sc->psc_pi = pi; Modified: stable/10/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_block.c Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/usr.sbin/bhyve/pci_virtio_block.c Mon Jul 21 19:08:02 2014 (r268953) @@ -299,8 +299,7 @@ pci_vtblk_init(struct vmctx *ctx, struct assert(sectsz != 0); } - sc = malloc(sizeof(struct pci_vtblk_softc)); - memset(sc, 0, sizeof(struct pci_vtblk_softc)); + sc = calloc(1, sizeof(struct pci_vtblk_softc)); /* record fd of storage device/file */ sc->vbsc_fd = fd; Modified: stable/10/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_net.c Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/usr.sbin/bhyve/pci_virtio_net.c Mon Jul 21 19:08:02 2014 (r268953) @@ -513,8 +513,7 @@ pci_vtnet_init(struct vmctx *ctx, struct char *vtopts; int mac_provided; - sc = malloc(sizeof(struct pci_vtnet_softc)); - memset(sc, 0, sizeof(struct pci_vtnet_softc)); + sc = calloc(1, sizeof(struct pci_vtnet_softc)); pthread_mutex_init(&sc->vsc_mtx, NULL); Modified: stable/10/usr.sbin/bhyve/pci_virtio_rnd.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_rnd.c Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/usr.sbin/bhyve/pci_virtio_rnd.c Mon Jul 21 19:08:02 2014 (r268953) @@ -155,8 +155,7 @@ pci_vtrnd_init(struct vmctx *ctx, struct return (1); } - sc = malloc(sizeof(struct pci_vtrnd_softc)); - memset(sc, 0, sizeof(struct pci_vtrnd_softc)); + sc = calloc(1, sizeof(struct pci_vtrnd_softc)); vi_softc_linkup(&sc->vrsc_vs, &vtrnd_vi_consts, sc, pi, &sc->vrsc_vq); sc->vrsc_vs.vs_mtx = &sc->vrsc_mtx; Modified: stable/10/usr.sbin/bhyve/uart_emul.c ============================================================================== --- stable/10/usr.sbin/bhyve/uart_emul.c Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/usr.sbin/bhyve/uart_emul.c Mon Jul 21 19:08:02 2014 (r268953) @@ -594,8 +594,7 @@ uart_init(uart_intr_func_t intr_assert, { struct uart_softc *sc; - sc = malloc(sizeof(struct uart_softc)); - bzero(sc, sizeof(struct uart_softc)); + sc = calloc(1, sizeof(struct uart_softc)); sc->arg = arg; sc->intr_assert = intr_assert; Modified: stable/10/usr.sbin/bhyve/xmsr.c ============================================================================== --- stable/10/usr.sbin/bhyve/xmsr.c Mon Jul 21 18:26:51 2014 (r268952) +++ stable/10/usr.sbin/bhyve/xmsr.c Mon Jul 21 19:08:02 2014 (r268953) @@ -47,6 +47,8 @@ emulate_wrmsr(struct vmctx *ctx, int vcp case 0xd04: /* Sandy Bridge uncore PMC MSRs */ case 0xc24: return (0); + case 0x79: + return (0); /* IA32_BIOS_UPDT_TRIG MSR */ default: break; } From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 19:33:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2832EB82; Mon, 21 Jul 2014 19:33:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 094F82B2D; Mon, 21 Jul 2014 19:33:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LJX8jE099219; Mon, 21 Jul 2014 19:33:08 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LJX8l8099215; Mon, 21 Jul 2014 19:33:08 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201407211933.s6LJX8l8099215@svn.freebsd.org> From: Sean Bruno Date: Mon, 21 Jul 2014 19:33:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268954 - head/sys/dev/drm2/radeon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 19:33:09 -0000 Author: sbruno Date: Mon Jul 21 19:33:08 2014 New Revision: 268954 URL: http://svnweb.freebsd.org/changeset/base/268954 Log: Merge change from upstream linux kernel submitted by OpenBSD: drm/radeon: fix-up some float to fixed conversion thinkos Spotted by Brad Smith when porting to OpenBSD. Noticed-by: Brad Smith Signed-off-by: Alex Deucher ref: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=1cd73ff7 Remove #ifdef DUMBBELL_WIP in favor of upstream fix. Phabric: https://phabric.freebsd.org/D423 Reviewed by: dumbbell, jkim MFC after: 2 weeks Modified: head/sys/dev/drm2/radeon/rs690.c head/sys/dev/drm2/radeon/rv515.c Modified: head/sys/dev/drm2/radeon/rs690.c ============================================================================== --- head/sys/dev/drm2/radeon/rs690.c Mon Jul 21 19:08:02 2014 (r268953) +++ head/sys/dev/drm2/radeon/rs690.c Mon Jul 21 19:33:08 2014 (r268954) @@ -308,12 +308,11 @@ static void rs690_crtc_bandwidth_compute if (rdev->pm.max_bandwidth.full > rdev->pm.sideport_bandwidth.full && rdev->pm.sideport_bandwidth.full) rdev->pm.max_bandwidth = rdev->pm.sideport_bandwidth; -#ifdef DUMBBELL_WIP - read_delay_latency.full = dfixed_const(370 * 800 * 1000); -#endif /* DUMBBELL_WIP */ - read_delay_latency.full = UINT_MAX; - read_delay_latency.full = dfixed_div(read_delay_latency, - rdev->pm.igp_sideport_mclk); + read_delay_latency.full = dfixed_const(370 * 800); + a.full = dfixed_const(1000); + b.full = dfixed_div(rdev->pm.igp_sideport_mclk, a); + read_delay_latency.full = dfixed_div(read_delay_latency, b); + read_delay_latency.full = dfixed_mul(read_delay_latency, a); } else { if (rdev->pm.max_bandwidth.full > rdev->pm.k8_bandwidth.full && rdev->pm.k8_bandwidth.full) @@ -488,14 +487,10 @@ void rs690_bandwidth_update(struct radeo } if (wm0.priority_mark.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark.full; - if (dfixed_trunc(priority_mark02) < 0) - priority_mark02.full = 0; if (wm0.priority_mark_max.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark_max.full; if (wm1.priority_mark.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark.full; - if (dfixed_trunc(priority_mark12) < 0) - priority_mark12.full = 0; if (wm1.priority_mark_max.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark_max.full; d1mode_priority_a_cnt = dfixed_trunc(priority_mark02); @@ -526,8 +521,6 @@ void rs690_bandwidth_update(struct radeo } if (wm0.priority_mark.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark.full; - if (dfixed_trunc(priority_mark02) < 0) - priority_mark02.full = 0; if (wm0.priority_mark_max.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark_max.full; d1mode_priority_a_cnt = dfixed_trunc(priority_mark02); @@ -555,8 +548,6 @@ void rs690_bandwidth_update(struct radeo } if (wm1.priority_mark.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark.full; - if (dfixed_trunc(priority_mark12) < 0) - priority_mark12.full = 0; if (wm1.priority_mark_max.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark_max.full; d2mode_priority_a_cnt = dfixed_trunc(priority_mark12); Modified: head/sys/dev/drm2/radeon/rv515.c ============================================================================== --- head/sys/dev/drm2/radeon/rv515.c Mon Jul 21 19:08:02 2014 (r268953) +++ head/sys/dev/drm2/radeon/rv515.c Mon Jul 21 19:33:08 2014 (r268954) @@ -1087,14 +1087,10 @@ void rv515_bandwidth_avivo_update(struct } if (wm0.priority_mark.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark.full; - if (dfixed_trunc(priority_mark02) < 0) - priority_mark02.full = 0; if (wm0.priority_mark_max.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark_max.full; if (wm1.priority_mark.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark.full; - if (dfixed_trunc(priority_mark12) < 0) - priority_mark12.full = 0; if (wm1.priority_mark_max.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark_max.full; d1mode_priority_a_cnt = dfixed_trunc(priority_mark02); @@ -1125,8 +1121,6 @@ void rv515_bandwidth_avivo_update(struct } if (wm0.priority_mark.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark.full; - if (dfixed_trunc(priority_mark02) < 0) - priority_mark02.full = 0; if (wm0.priority_mark_max.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark_max.full; d1mode_priority_a_cnt = dfixed_trunc(priority_mark02); @@ -1154,8 +1148,6 @@ void rv515_bandwidth_avivo_update(struct } if (wm1.priority_mark.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark.full; - if (dfixed_trunc(priority_mark12) < 0) - priority_mark12.full = 0; if (wm1.priority_mark_max.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark_max.full; d2mode_priority_a_cnt = dfixed_trunc(priority_mark12); From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 20:08:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2BF088E3; Mon, 21 Jul 2014 20:08:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E2292E3D; Mon, 21 Jul 2014 20:08:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LK8rFv014473; Mon, 21 Jul 2014 20:08:53 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LK8rdx014471; Mon, 21 Jul 2014 20:08:53 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201407212008.s6LK8rdx014471@svn.freebsd.org> From: Sean Bruno Date: Mon, 21 Jul 2014 20:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268955 - stable/10/sys/dev/ciss X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 20:08:54 -0000 Author: sbruno Date: Mon Jul 21 20:08:53 2014 New Revision: 268955 URL: http://svnweb.freebsd.org/changeset/base/268955 Log: MFC r268017 and r268018 268017: Check return of cam_periph_find() before using it in a printf. 268018: Add detection for ciss(4) controllers that are set to non-raid JBOD mode. Modified: stable/10/sys/dev/ciss/ciss.c stable/10/sys/dev/ciss/cissreg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ciss/ciss.c ============================================================================== --- stable/10/sys/dev/ciss/ciss.c Mon Jul 21 19:33:08 2014 (r268954) +++ stable/10/sys/dev/ciss/ciss.c Mon Jul 21 20:08:53 2014 (r268955) @@ -1220,7 +1220,7 @@ ciss_identify_adapter(struct ciss_softc } /* sanity-check reply */ - if (!sc->ciss_id->big_map_supported) { + if (!(sc->ciss_id->controller_flags & CONTROLLER_FLAGS_BIG_MAP_SUPPORT)) { ciss_printf(sc, "adapter does not support BIG_MAP\n"); error = ENXIO; goto out; @@ -1250,7 +1250,7 @@ ciss_identify_adapter(struct ciss_softc sc->ciss_id->configured_logical_drives, (sc->ciss_id->configured_logical_drives == 1) ? "" : "s"); ciss_printf(sc, " firmware %4.4s\n", sc->ciss_id->running_firmware_revision); - ciss_printf(sc, " %d SCSI channels\n", sc->ciss_id->scsi_bus_count); + ciss_printf(sc, " %d SCSI channels\n", sc->ciss_id->scsi_chip_count); ciss_printf(sc, " signature '%.4s'\n", sc->ciss_cfg->signature); ciss_printf(sc, " valence %d\n", sc->ciss_cfg->valence); @@ -1274,6 +1274,10 @@ ciss_identify_adapter(struct ciss_softc ciss_printf(sc, " max logical logical volumes: %d\n", sc->ciss_cfg->max_logical_supported); ciss_printf(sc, " max physical disks supported: %d\n", sc->ciss_cfg->max_physical_supported); ciss_printf(sc, " max physical disks per logical volume: %d\n", sc->ciss_cfg->max_physical_per_logical); + ciss_printf(sc, " JBOD Support is %s\n", (sc->ciss_id->uiYetMoreControllerFlags & YMORE_CONTROLLER_FLAGS_JBOD_SUPPORTED) ? + "Available" : "Unavailable"); + ciss_printf(sc, " JBOD Mode is %s\n", (sc->ciss_id->PowerUPNvramFlags & PWR_UP_FLAG_JBOD_ENABLED) ? + "Enabled" : "Disabled"); } out: @@ -3387,25 +3391,28 @@ ciss_cam_complete_fixup(struct ciss_soft bus = cam_sim_bus(xpt_path_sim(csio->ccb_h.path)); /* - * Don't let hard drives be seen by the DA driver. They will still be - * attached by the PASS driver. + * If the controller is in JBOD mode, there are no logical volumes. + * Let the disks be probed and dealt with via CAM. Else, mask off + * the physical disks and setup the parts of the inq structure for + * the logical volume. swb */ - if (CISS_IS_PHYSICAL(bus)) { - if (SID_TYPE(inq) == T_DIRECT) - inq->device = (inq->device & 0xe0) | T_NODEVICE; - return; + if( !(sc->ciss_id->PowerUPNvramFlags & PWR_UP_FLAG_JBOD_ENABLED)){ + if (CISS_IS_PHYSICAL(bus)) { + if (SID_TYPE(inq) == T_DIRECT) + inq->device = (inq->device & 0xe0) | T_NODEVICE; + return; + } + cl = &sc->ciss_logical[bus][target]; + + padstr(inq->vendor, "HP", + SID_VENDOR_SIZE); + padstr(inq->product, + ciss_name_ldrive_org(cl->cl_ldrive->fault_tolerance), + SID_PRODUCT_SIZE); + padstr(inq->revision, + ciss_name_ldrive_status(cl->cl_lstatus->status), + SID_REVISION_SIZE); } - - cl = &sc->ciss_logical[bus][target]; - - padstr(inq->vendor, "HP", - SID_VENDOR_SIZE); - padstr(inq->product, - ciss_name_ldrive_org(cl->cl_ldrive->fault_tolerance), - SID_PRODUCT_SIZE); - padstr(inq->revision, - ciss_name_ldrive_status(cl->cl_lstatus->status), - SID_REVISION_SIZE); } } @@ -3429,13 +3436,17 @@ ciss_name_device(struct ciss_softc *sc, target, 0); if (status == CAM_REQ_CMP) { + mtx_lock(&sc->ciss_mtx); xpt_path_lock(path); periph = cam_periph_find(path, NULL); - sprintf(sc->ciss_logical[bus][target].cl_name, "%s%d", - periph->periph_name, periph->unit_number); xpt_path_unlock(path); + mtx_unlock(&sc->ciss_mtx); xpt_free_path(path); - return(0); + if (periph != NULL) { + sprintf(sc->ciss_logical[bus][target].cl_name, "%s%d", + periph->periph_name, periph->unit_number); + return(0); + } } sc->ciss_logical[bus][target].cl_name[0] = 0; return(ENOENT); Modified: stable/10/sys/dev/ciss/cissreg.h ============================================================================== --- stable/10/sys/dev/ciss/cissreg.h Mon Jul 21 19:33:08 2014 (r268954) +++ stable/10/sys/dev/ciss/cissreg.h Mon Jul 21 20:08:53 2014 (r268955) @@ -615,26 +615,124 @@ struct ciss_bmic_id_table { char running_firmware_revision[4]; char stored_firmware_revision[4]; u_int8_t hardware_revision; - u_int8_t res1[4]; + u_int8_t boot_block_revision[4]; u_int32_t deprecated_drive_present_map; u_int32_t deprecated_external_drive_present_map; u_int32_t board_id; - u_int8_t res2; + u_int8_t swapped_error_cable; u_int32_t deprecated_non_disk_map; - u_int8_t res3[5]; + u_int8_t bad_host_ram_addr; + u_int8_t cpu_revision; + u_int8_t res3[3]; char marketting_revision; - u_int8_t res4:3; - u_int8_t more_than_seven_supported:1; - u_int8_t res5:3; - u_int8_t big_map_supported:1; /* must be set! */ - u_int8_t res6[2]; - u_int8_t scsi_bus_count; - u_int32_t res7; + u_int8_t controller_flags; +#define CONTROLLER_FLAGS_FLASH_ROM_INSTALLED 0x01 +#define CONTROLLER_FLAGS_DIAGS_MODE_BIT 0x02 +#define CONTROLLER_FLAGS_EXPAND_32MB_FX 0x04 +#define CONTROLLER_FLAGS_MORE_THAN_7_SUPPORT 0x08 +#define CONTROLLER_FLAGS_DAISY_SUPPORT_BIT 0x10 +#define CONTROLLER_FLAGS_RES6 0x20 +#define CONTROLLER_FLAGS_RES7 0x40 +#define CONTROLLER_FLAGS_BIG_MAP_SUPPORT 0x80 + u_int8_t host_flags; +#define HOST_FLAGS_SDB_ASIC_WORK_AROUND 0x01 +#define HOST_FLAGS_PCI_DATA_BUS_PARITY_SUPPORT 0x02 +#define HOST_FLAGS_RES3 0x04 +#define HOST_FLAGS_RES4 0x08 +#define HOST_FLAGS_RES5 0x10 +#define HOST_FLAGS_RES6 0x20 +#define HOST_FLAGS_RES7 0x30 +#define HOST_FLAGS_RES8 0x40 + u_int8_t expand_disable_code; +#define EXPAND_DISABLE_NOT_NEEDED 0x01 +#define EXPAND_DISABLE_MISSING_CACHE_BOARD 0x02 +#define EXPAND_DISABLE_WCXC_FATAL_CACHE_BITS 0x04 +#define EXPAND_DISABLE_CACHE_PERM_DISABLED 0x08 +#define EXPAND_DISABLE_RAM_ALLOCATION_FAILED 0x10 +#define EXPAND_DISABLE_BATTEREIS_DISCHARGED 0x20 +#define EXPAND_DISABLE_RES7 0x40 +#define EXPAND_DISABLE_REBUILD_RUNNING 0x80 + u_int8_t scsi_chip_count; + u_int32_t maximum_blocks; u_int32_t controller_clock; u_int8_t drives_per_scsi_bus; u_int8_t big_drive_present_map[CISS_BIG_MAP_ENTRIES / 8]; u_int8_t big_external_drive_present_map[CISS_BIG_MAP_ENTRIES / 8]; u_int8_t big_non_disk_map[CISS_BIG_MAP_ENTRIES / 8]; + + u_int16_t task_flags; /* used for FW debugging */ + u_int8_t ICL_bus_map; /* Bitmap used for ICL between controllers */ + u_int8_t redund_ctlr_modes_support; /* See REDUNDANT MODE VALUES */ + u_int8_t curr_redund_ctlr_mode; + u_int8_t redund_ctlr_status; + u_int8_t redund_op_failure_code; + + u_int8_t unsupported_nile_bus; + u_int8_t host_i2c_autorev; + u_int8_t cpld_revision; + u_int8_t fibre_chip_count; + u_int8_t daughterboard_type; + u_int8_t more_swapped_config_cable_error; + + u_int8_t license_key_status; + u_int8_t access_module_status; + u_int8_t features_supported[12]; + u_int8_t rec_rom_inact_rev[4]; /* Recovery ROM inactive f/w revision */ + u_int8_t rec_rom_act_status; /* Recovery ROM flags */ + u_int8_t pci_to_pci_status; /* PCI to PCI bridge status */ + u_int32_t redundant_server_info; /* Reserved for future use */ + u_int8_t percent_write_cache; /* Percent of memory allocated to write cache */ + u_int16_t daughterboard_size_mb; /* Total size (MB) of cache board */ + u_int8_t cache_batter_count; /* Number of cache batteries */ + u_int16_t total_controller_mem_mb; /* Total size (MB) of atttached memory */ + u_int8_t more_controller_flags; /* Additional controller flags byte */ + u_int8_t x_board_host_i2c_rev; /* 2nd byte of 3 byte autorev field */ + u_int8_t battery_pic_rev; /* BBWC PIC revision */ +/* + * Below here I have no documentation on the rest of this data structure. It is + * inferred from the opensource cciss_vol_status application. I assume that this + * data strucutre is 512 bytes in total size, do not exceed it. + */ + u_int8_t bDdffVersion[4]; /* DDFF update engine version */ + u_int16_t usMaxLogicalUnits; /* Maximum logical units supported */ + u_int16_t usExtLogicalUnitCount; /* Big num configured logical units */ + u_int16_t usMaxPhysicalDevices; /* Maximum physical devices supported */ + u_int16_t usMaxPhyDrvPerLogicalUnit; /* Max physical drive per logical unit */ + u_int8_t bEnclosureCount; /* Number of attached enclosures */ + u_int8_t bExpanderCount; /* Number of expanders detected */ + u_int16_t usOffsetToEDPbitmap; /* Offset to extended drive present map*/ + u_int16_t usOffsetToEEDPbitmap; /* Offset to extended external drive present map */ + u_int16_t usOffsetToENDbitmap; /* Offset to extended non-disk map */ + u_int8_t bInternalPortStatus[8]; /* Internal port status bytes */ + u_int8_t bExternalPortStatus[8]; /* External port status bytes */ + u_int32_t uiYetMoreControllerFlags;/* Yet More Controller flags */ +#define YMORE_CONTROLLER_FLAGS_JBOD_SUPPORTED \ + ( 1 << 25 ) /* Controller has JBOD support */ + + u_int8_t bLastLockup; /* Last lockup code */ + u_int8_t bSlot; /* PCI slot according to option ROM*/ + u_int16_t usBuildNum; /* Build number */ + u_int32_t uiMaxSafeFullStripeSize; /* Maximum safe full stripe size */ + u_int32_t uiTotalLength; /* Total structure length */ + u_int8_t bVendorID[8]; /* Vendor ID */ + u_int8_t bProductID[16]; /* Product ID */ +/* + * These are even more obscure as they seem to only be available in cciss_vol_status + */ + u_int32_t ExtendedLastLockupCode; + u_int16_t MaxRaid; + u_int16_t MaxParity; + u_int16_t MaxADGStripSize; + u_int16_t YetMoreSwappedCables; + u_int8_t MaxDevicePaths; + u_int8_t PowerUPNvramFlags; +#define PWR_UP_FLAG_JBOD_ENABLED 0x08 /*JBOD mode is enabled, all RAID features off */ + + u_int16_t ZonedOffset; + u_int32_t FixedFieldsLength; + u_int8_t FWCompileTimeStamp[24]; + u_int32_t EvenMoreControllerFlags; + u_int8_t padding[240]; } __packed; /* CISS_BMIC_ID_PDRIVE */ From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 20:38:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9062A5B0; Mon, 21 Jul 2014 20:38:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6402820EA; Mon, 21 Jul 2014 20:38:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LKcM49028732; Mon, 21 Jul 2014 20:38:22 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LKcM9V028731; Mon, 21 Jul 2014 20:38:22 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201407212038.s6LKcM9V028731@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 21 Jul 2014 20:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268956 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 20:38:22 -0000 Author: np Date: Mon Jul 21 20:38:21 2014 New Revision: 268956 URL: http://svnweb.freebsd.org/changeset/base/268956 Log: MFC r268450 (by glebius). The leak affects stable/10 too. In several cases in ip_output() we obtain reference on ifa. Do not leak it. Modified: stable/10/sys/netinet/ip_output.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/ip_output.c ============================================================================== --- stable/10/sys/netinet/ip_output.c Mon Jul 21 20:08:53 2014 (r268955) +++ stable/10/sys/netinet/ip_output.c Mon Jul 21 20:38:21 2014 (r268956) @@ -135,6 +135,7 @@ ip_output(struct mbuf *m, struct mbuf *o struct rtentry *rte; /* cache for ro->ro_rt */ struct in_addr odst; struct m_tag *fwd_tag = NULL; + int have_ia_ref; #ifdef IPSEC int no_route_but_check_spd = 0; #endif @@ -200,6 +201,7 @@ ip_output(struct mbuf *m, struct mbuf *o gw = dst = (struct sockaddr_in *)&ro->ro_dst; again: ia = NULL; + have_ia_ref = 0; /* * If there is a cached route, * check that it is to the same destination @@ -237,6 +239,7 @@ again: error = ENETUNREACH; goto bad; } + have_ia_ref = 1; ip->ip_dst.s_addr = INADDR_BROADCAST; dst->sin_addr = ip->ip_dst; ifp = ia->ia_ifp; @@ -249,6 +252,7 @@ again: error = ENETUNREACH; goto bad; } + have_ia_ref = 1; ifp = ia->ia_ifp; ip->ip_ttl = 1; isbroadcast = in_broadcast(dst->sin_addr, ifp); @@ -260,6 +264,8 @@ again: */ ifp = imo->imo_multicast_ifp; IFP_TO_IA(ifp, ia); + if (ia) + have_ia_ref = 1; isbroadcast = 0; /* fool gcc */ } else { /* @@ -531,8 +537,11 @@ sendit: #endif error = netisr_queue(NETISR_IP, m); goto done; - } else + } else { + if (have_ia_ref) + ifa_free(&ia->ia_ifa); goto again; /* Redo the routing table lookup. */ + } } /* See if local, if yes, send it to netisr with IP_FASTFWD_OURS. */ @@ -561,6 +570,8 @@ sendit: m->m_flags |= M_SKIP_FIREWALL; m->m_flags &= ~M_IP_NEXTHOP; m_tag_delete(m, fwd_tag); + if (have_ia_ref) + ifa_free(&ia->ia_ifa); goto again; } @@ -671,6 +682,8 @@ passout: done: if (ro == &iproute) RO_RTFREE(ro); + if (have_ia_ref) + ifa_free(&ia->ia_ifa); return (error); bad: m_freem(m); From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 21:26:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0250FED; Mon, 21 Jul 2014 21:26:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E04225F3; Mon, 21 Jul 2014 21:26:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LLQAam053224; Mon, 21 Jul 2014 21:26:10 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LLQALu053223; Mon, 21 Jul 2014 21:26:10 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201407212126.s6LLQALu053223@svn.freebsd.org> From: Dimitry Andric Date: Mon, 21 Jul 2014 21:26:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268957 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 21:26:10 -0000 Author: dim Date: Mon Jul 21 21:26:10 2014 New Revision: 268957 URL: http://svnweb.freebsd.org/changeset/base/268957 Log: Run mtree for BSD.tests.dist during make xdev-install, if the tests are enabled (which they are in the default configuration). Otherwise, it will fail because ${XDDESTDIR}/usr/include/atf-c does not exist. MFC after: 3 days Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Jul 21 20:38:21 2014 (r268956) +++ head/Makefile.inc1 Mon Jul 21 21:26:10 2014 (r268957) @@ -1942,6 +1942,10 @@ _xi-mtree: -p ${XDDESTDIR}/usr >/dev/null mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ -p ${XDDESTDIR}/usr/include >/dev/null +.if ${MK_TESTS} != "no" + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ + -p ${XDDESTDIR}/usr >/dev/null +.endif .ORDER: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries xdev-install: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 22:08:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 354E151C; Mon, 21 Jul 2014 22:08:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 227FB29E3; Mon, 21 Jul 2014 22:08:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LM8pNl072374; Mon, 21 Jul 2014 22:08:51 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LM8oIp072366; Mon, 21 Jul 2014 22:08:50 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201407212208.s6LM8oIp072366@svn.freebsd.org> From: Peter Wemm Date: Mon, 21 Jul 2014 22:08:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r268958 - in vendor/serf/dist: . auth X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 22:08:51 -0000 Author: peter Date: Mon Jul 21 22:08:49 2014 New Revision: 268958 URL: http://svnweb.freebsd.org/changeset/base/268958 Log: Vendor import serf-1.3.6 + Revert r2319 from serf 1.3.5: this change was making serf call handle_response + multiple times in case of an error response, leading to unexpected behavior. Modified: vendor/serf/dist/CHANGES vendor/serf/dist/auth/auth.c vendor/serf/dist/outgoing.c vendor/serf/dist/serf.h Modified: vendor/serf/dist/CHANGES ============================================================================== --- vendor/serf/dist/CHANGES Mon Jul 21 21:26:10 2014 (r268957) +++ vendor/serf/dist/CHANGES Mon Jul 21 22:08:49 2014 (r268958) @@ -1,3 +1,7 @@ +Serf 1.3.6 [2014-06-09, from /tags/1.3.6, rxxxx] + Revert r2319 from serf 1.3.5: this change was making serf call handle_response + multiple times in case of an error response, leading to unexpected behavior. + Serf 1.3.5 [2014-04-27, from /tags/1.3.5, rxxxx] Fix issue #125: no reverse lookup during Negotiate authentication for proxies. Fix a crash caused by incorrect reuse of the ssltunnel CONNECT request (r2316) Modified: vendor/serf/dist/auth/auth.c ============================================================================== --- vendor/serf/dist/auth/auth.c Mon Jul 21 21:26:10 2014 (r268957) +++ vendor/serf/dist/auth/auth.c Mon Jul 21 22:08:49 2014 (r268958) @@ -408,7 +408,6 @@ apr_status_t serf__handle_auth_response( consider the reponse body as invalid and discard it. */ status = discard_body(response); *consumed_response = 1; - if (!APR_STATUS_IS_EOF(status)) { return status; } Modified: vendor/serf/dist/outgoing.c ============================================================================== --- vendor/serf/dist/outgoing.c Mon Jul 21 21:26:10 2014 (r268957) +++ vendor/serf/dist/outgoing.c Mon Jul 21 22:08:49 2014 (r268958) @@ -916,22 +916,21 @@ static apr_status_t handle_response(serf * themselves by not registering credential callbacks. */ if (request->conn->ctx->cred_cb) { - status = serf__handle_auth_response(&consumed_response, - request, - request->resp_bkt, - request->handler_baton, - pool); - - if (SERF_BUCKET_READ_ERROR(status)) { - /* Report the request as 'died'/'cancelled' to the application */ - (void)(*request->handler)(request, - NULL, - request->handler_baton, - pool); - } - - if (status) - return status; + status = serf__handle_auth_response(&consumed_response, + request, + request->resp_bkt, + request->handler_baton, + pool); + + /* If there was an error reading the response (maybe there wasn't + enough data available), don't bother passing the response to the + application. + + If the authentication was tried, but failed, pass the response + to the application, maybe it can do better. */ + if (status) { + return status; + } } if (!consumed_response) { Modified: vendor/serf/dist/serf.h ============================================================================== --- vendor/serf/dist/serf.h Mon Jul 21 21:26:10 2014 (r268957) +++ vendor/serf/dist/serf.h Mon Jul 21 22:08:49 2014 (r268958) @@ -1062,7 +1062,7 @@ void serf_debug__bucket_alloc_check( /* Version info */ #define SERF_MAJOR_VERSION 1 #define SERF_MINOR_VERSION 3 -#define SERF_PATCH_VERSION 5 +#define SERF_PATCH_VERSION 6 /* Version number string */ #define SERF_VERSION_STRING APR_STRINGIFY(SERF_MAJOR_VERSION) "." \ From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 22:09:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2287F64B; Mon, 21 Jul 2014 22:09:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAB3E29EB; Mon, 21 Jul 2014 22:09:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LM9Gam072510; Mon, 21 Jul 2014 22:09:16 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LM9GDq072509; Mon, 21 Jul 2014 22:09:16 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201407212209.s6LM9GDq072509@svn.freebsd.org> From: Peter Wemm Date: Mon, 21 Jul 2014 22:09:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r268959 - vendor/serf/serf-1.3.6 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 22:09:17 -0000 Author: peter Date: Mon Jul 21 22:09:16 2014 New Revision: 268959 URL: http://svnweb.freebsd.org/changeset/base/268959 Log: Tag serf-1.3.6 Added: vendor/serf/serf-1.3.6/ - copied from r268958, vendor/serf/dist/ From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 22:10:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B942D78A; Mon, 21 Jul 2014 22:10:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A65E129FD; Mon, 21 Jul 2014 22:10:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LMAUst074627; Mon, 21 Jul 2014 22:10:30 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LMAToP074623; Mon, 21 Jul 2014 22:10:29 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201407212210.s6LMAToP074623@svn.freebsd.org> From: Peter Wemm Date: Mon, 21 Jul 2014 22:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268960 - in head/contrib/serf: . auth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 22:10:30 -0000 Author: peter Date: Mon Jul 21 22:10:29 2014 New Revision: 268960 URL: http://svnweb.freebsd.org/changeset/base/268960 Log: Merge serf-1.3.6 + Revert r2319 from serf 1.3.5: this change was making serf call handle_response + multiple times in case of an error response, leading to unexpected behavior. Modified: head/contrib/serf/CHANGES head/contrib/serf/auth/auth.c head/contrib/serf/outgoing.c head/contrib/serf/serf.h Directory Properties: head/contrib/serf/ (props changed) Modified: head/contrib/serf/CHANGES ============================================================================== --- head/contrib/serf/CHANGES Mon Jul 21 22:09:16 2014 (r268959) +++ head/contrib/serf/CHANGES Mon Jul 21 22:10:29 2014 (r268960) @@ -1,3 +1,7 @@ +Serf 1.3.6 [2014-06-09, from /tags/1.3.6, rxxxx] + Revert r2319 from serf 1.3.5: this change was making serf call handle_response + multiple times in case of an error response, leading to unexpected behavior. + Serf 1.3.5 [2014-04-27, from /tags/1.3.5, rxxxx] Fix issue #125: no reverse lookup during Negotiate authentication for proxies. Fix a crash caused by incorrect reuse of the ssltunnel CONNECT request (r2316) Modified: head/contrib/serf/auth/auth.c ============================================================================== --- head/contrib/serf/auth/auth.c Mon Jul 21 22:09:16 2014 (r268959) +++ head/contrib/serf/auth/auth.c Mon Jul 21 22:10:29 2014 (r268960) @@ -408,7 +408,6 @@ apr_status_t serf__handle_auth_response( consider the reponse body as invalid and discard it. */ status = discard_body(response); *consumed_response = 1; - if (!APR_STATUS_IS_EOF(status)) { return status; } Modified: head/contrib/serf/outgoing.c ============================================================================== --- head/contrib/serf/outgoing.c Mon Jul 21 22:09:16 2014 (r268959) +++ head/contrib/serf/outgoing.c Mon Jul 21 22:10:29 2014 (r268960) @@ -916,22 +916,21 @@ static apr_status_t handle_response(serf * themselves by not registering credential callbacks. */ if (request->conn->ctx->cred_cb) { - status = serf__handle_auth_response(&consumed_response, - request, - request->resp_bkt, - request->handler_baton, - pool); - - if (SERF_BUCKET_READ_ERROR(status)) { - /* Report the request as 'died'/'cancelled' to the application */ - (void)(*request->handler)(request, - NULL, - request->handler_baton, - pool); - } - - if (status) - return status; + status = serf__handle_auth_response(&consumed_response, + request, + request->resp_bkt, + request->handler_baton, + pool); + + /* If there was an error reading the response (maybe there wasn't + enough data available), don't bother passing the response to the + application. + + If the authentication was tried, but failed, pass the response + to the application, maybe it can do better. */ + if (status) { + return status; + } } if (!consumed_response) { Modified: head/contrib/serf/serf.h ============================================================================== --- head/contrib/serf/serf.h Mon Jul 21 22:09:16 2014 (r268959) +++ head/contrib/serf/serf.h Mon Jul 21 22:10:29 2014 (r268960) @@ -1062,7 +1062,7 @@ void serf_debug__bucket_alloc_check( /* Version info */ #define SERF_MAJOR_VERSION 1 #define SERF_MINOR_VERSION 3 -#define SERF_PATCH_VERSION 5 +#define SERF_PATCH_VERSION 6 /* Version number string */ #define SERF_VERSION_STRING APR_STRINGIFY(SERF_MAJOR_VERSION) "." \ From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 22:21:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB500DCD; Mon, 21 Jul 2014 22:21:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A760E2B43; Mon, 21 Jul 2014 22:21:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LMLA7u080689; Mon, 21 Jul 2014 22:21:10 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LMLAst080686; Mon, 21 Jul 2014 22:21:10 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201407212221.s6LMLAst080686@svn.freebsd.org> From: Bryan Drewery Date: Mon, 21 Jul 2014 22:21:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268961 - in stable/10/sys: fs/nfsserver nfsserver X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 22:21:10 -0000 Author: bdrewery Date: Mon Jul 21 22:21:09 2014 New Revision: 268961 URL: http://svnweb.freebsd.org/changeset/base/268961 Log: MFC r268114: Change NFS readdir() to only ignore cookies preceding the given offset for UFS rather than for all but ZFS. Modified: stable/10/sys/fs/nfsserver/nfs_nfsdport.c stable/10/sys/nfsserver/nfs_serv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdport.c Mon Jul 21 22:10:29 2014 (r268960) +++ stable/10/sys/fs/nfsserver/nfs_nfsdport.c Mon Jul 21 22:21:09 2014 (r268961) @@ -1551,7 +1551,7 @@ nfsrvd_readdir(struct nfsrv_descript *nd u_long *cookies = NULL, *cookiep; struct uio io; struct iovec iv; - int not_zfs; + int is_ufs; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); @@ -1606,7 +1606,7 @@ nfsrvd_readdir(struct nfsrv_descript *nd nfsrv_postopattr(nd, getret, &at); goto out; } - not_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs"); + is_ufs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "ufs") == 0; MALLOC(rbuf, caddr_t, siz, M_TEMP, M_WAITOK); again: eofflag = 0; @@ -1686,12 +1686,10 @@ again: * skip over the records that precede the requested offset. This * requires the assumption that file offset cookies monotonically * increase. - * Since the offset cookies don't monotonically increase for ZFS, - * this is not done when ZFS is the file system. */ while (cpos < cend && ncookies > 0 && (dp->d_fileno == 0 || dp->d_type == DT_WHT || - (not_zfs != 0 && ((u_quad_t)(*cookiep)) <= toff))) { + (is_ufs == 1 && ((u_quad_t)(*cookiep)) <= toff))) { cpos += dp->d_reclen; dp = (struct dirent *)cpos; cookiep++; @@ -1804,7 +1802,7 @@ nfsrvd_readdirplus(struct nfsrv_descript struct uio io; struct iovec iv; struct componentname cn; - int at_root, needs_unbusy, not_zfs, supports_nfsv4acls; + int at_root, is_ufs, is_zfs, needs_unbusy, supports_nfsv4acls; struct mount *mp, *new_mp; uint64_t mounted_on_fileno; @@ -1884,7 +1882,8 @@ nfsrvd_readdirplus(struct nfsrv_descript nfsrv_postopattr(nd, getret, &at); goto out; } - not_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs"); + is_ufs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "ufs") == 0; + is_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs") == 0; MALLOC(rbuf, caddr_t, siz, M_TEMP, M_WAITOK); again: @@ -1957,12 +1956,10 @@ again: * skip over the records that precede the requested offset. This * requires the assumption that file offset cookies monotonically * increase. - * Since the offset cookies don't monotonically increase for ZFS, - * this is not done when ZFS is the file system. */ while (cpos < cend && ncookies > 0 && (dp->d_fileno == 0 || dp->d_type == DT_WHT || - (not_zfs != 0 && ((u_quad_t)(*cookiep)) <= toff) || + (is_ufs == 1 && ((u_quad_t)(*cookiep)) <= toff) || ((nd->nd_flag & ND_NFSV4) && ((dp->d_namlen == 1 && dp->d_name[0] == '.') || (dp->d_namlen==2 && dp->d_name[0]=='.' && dp->d_name[1]=='.'))))) { @@ -2004,7 +2001,7 @@ again: * This needs to be done here for NFSv4, since NFSv4 never does * a VFS_VGET() for "." or "..". */ - if (not_zfs == 0) { + if (is_zfs == 1) { r = VFS_VGET(mp, at.na_fileid, LK_SHARED, &nvp); if (r == EOPNOTSUPP) { usevget = 0; @@ -2153,7 +2150,7 @@ again: if (!r) r = nfsvno_getattr(nvp, nvap, nd->nd_cred, p, 1); - if (r == 0 && not_zfs == 0 && + if (r == 0 && is_zfs == 1 && nfsrv_enable_crossmntpt != 0 && (nd->nd_flag & ND_NFSV4) != 0 && nvp->v_type == VDIR && Modified: stable/10/sys/nfsserver/nfs_serv.c ============================================================================== --- stable/10/sys/nfsserver/nfs_serv.c Mon Jul 21 22:10:29 2014 (r268960) +++ stable/10/sys/nfsserver/nfs_serv.c Mon Jul 21 22:21:09 2014 (r268961) @@ -2627,7 +2627,7 @@ nfsrv_readdir(struct nfsrv_descript *nfs int v3 = (nfsd->nd_flag & ND_NFSV3); u_quad_t off, toff, verf; u_long *cookies = NULL, *cookiep; /* needs to be int64_t or off_t */ - int not_zfs; + int is_ufs; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); fhp = &nfh.fh_generic; @@ -2690,7 +2690,7 @@ nfsrv_readdir(struct nfsrv_descript *nfs error = 0; goto nfsmout; } - not_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs") != 0; + is_ufs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "ufs") == 0; VOP_UNLOCK(vp, 0); /* @@ -2777,12 +2777,10 @@ again: * skip over the records that precede the requested offset. This * requires the assumption that file offset cookies monotonically * increase. - * Since the offset cookies don't monotonically increase for ZFS, - * this is not done when ZFS is the file system. */ while (cpos < cend && ncookies > 0 && (dp->d_fileno == 0 || dp->d_type == DT_WHT || - (not_zfs != 0 && ((u_quad_t)(*cookiep)) <= toff))) { + (is_ufs == 1 && ((u_quad_t)(*cookiep)) <= toff))) { cpos += dp->d_reclen; dp = (struct dirent *)cpos; cookiep++; @@ -2928,7 +2926,7 @@ nfsrv_readdirplus(struct nfsrv_descript int usevget = 1; struct componentname cn; struct mount *mntp = NULL; - int not_zfs; + int is_ufs; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); vp_locked = 0; @@ -2988,7 +2986,7 @@ nfsrv_readdirplus(struct nfsrv_descript error = 0; goto nfsmout; } - not_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs") != 0; + is_ufs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "ufs") == 0; VOP_UNLOCK(vp, 0); vp_locked = 0; rbuf = malloc(siz, M_TEMP, M_WAITOK); @@ -3068,12 +3066,10 @@ again: * skip over the records that precede the requested offset. This * requires the assumption that file offset cookies monotonically * increase. - * Since the offset cookies don't monotonically increase for ZFS, - * this is not done when ZFS is the file system. */ while (cpos < cend && ncookies > 0 && (dp->d_fileno == 0 || dp->d_type == DT_WHT || - (not_zfs != 0 && ((u_quad_t)(*cookiep)) <= toff))) { + (is_ufs == 1 && ((u_quad_t)(*cookiep)) <= toff))) { cpos += dp->d_reclen; dp = (struct dirent *)cpos; cookiep++; From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 22:37:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD4DD50E; Mon, 21 Jul 2014 22:37:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9ED752C6A; Mon, 21 Jul 2014 22:37:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LMbYeH086534; Mon, 21 Jul 2014 22:37:34 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LMbYbp086531; Mon, 21 Jul 2014 22:37:34 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407212237.s6LMbYbp086531@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 21 Jul 2014 22:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268962 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 22:37:34 -0000 Author: pfg Date: Mon Jul 21 22:37:33 2014 New Revision: 268962 URL: http://svnweb.freebsd.org/changeset/base/268962 Log: MFC r268642: libc/gen: small updates to code originating at OpenBSD arc4random.c - CVS rev. 1.22 Change arc4random_uniform() to calculate ``2**32 % upper_bound'' as ``-upper_bound % upper_bound''. Simplifies the code and makes it the same on both ILP32 and LP64 architectures, and also slightly faster on LP64 architectures by using a 32-bit remainder instead of a 64-bit remainder. - CVS rev. 1.23 Spacing readpassphrase.c -CVS rev. v 1.24 most obvious unsigned char casts for ctype Obtained from: OpenBSD Modified: stable/10/lib/libc/gen/arc4random.c stable/10/lib/libc/gen/readpassphrase.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/arc4random.c ============================================================================== --- stable/10/lib/libc/gen/arc4random.c Mon Jul 21 22:21:09 2014 (r268961) +++ stable/10/lib/libc/gen/arc4random.c Mon Jul 21 22:37:33 2014 (r268962) @@ -1,4 +1,4 @@ -/* $OpenBSD: arc4random.c,v 1.22 2010/12/22 08:23:42 otto Exp $ */ +/* $OpenBSD: arc4random.c,v 1.24 2013/06/11 16:59:50 deraadt Exp $ */ /* * Copyright (c) 1996, David Mazieres @@ -182,8 +182,7 @@ arc4_stir_if_needed(void) { pid_t pid = getpid(); - if (arc4_count <= 0 || !rs_initialized || arc4_stir_pid != pid) - { + if (arc4_count <= 0 || !rs_initialized || arc4_stir_pid != pid) { arc4_stir_pid = pid; arc4_stir(); } @@ -276,18 +275,8 @@ arc4random_uniform(u_int32_t upper_bound if (upper_bound < 2) return 0; -#if (ULONG_MAX > 0xffffffffUL) - min = 0x100000000UL % upper_bound; -#else - /* Calculate (2**32 % upper_bound) avoiding 64-bit math */ - if (upper_bound > 0x80000000) - min = 1 + ~upper_bound; /* 2**32 - upper_bound */ - else { - /* (2**32 - (x * 2)) % x == 2**32 % x when x <= 2**31 */ - min = ((0xffffffff - (upper_bound * 2)) + 1) % upper_bound; - } -#endif - + /* 2**32 % x == (2**32 - x) % x */ + min = -upper_bound % upper_bound; /* * This could theoretically loop forever but each retry has * p > 0.5 (worst case, usually far better) of selecting a Modified: stable/10/lib/libc/gen/readpassphrase.c ============================================================================== --- stable/10/lib/libc/gen/readpassphrase.c Mon Jul 21 22:21:09 2014 (r268961) +++ stable/10/lib/libc/gen/readpassphrase.c Mon Jul 21 22:37:33 2014 (r268962) @@ -1,4 +1,4 @@ -/* $OpenBSD: readpassphrase.c,v 1.23 2010/05/14 13:30:34 millert Exp $ */ +/* $OpenBSD: readpassphrase.c,v 1.24 2013/11/24 23:51:29 deraadt Exp $ */ /* * Copyright (c) 2000-2002, 2007, 2010 @@ -122,11 +122,11 @@ restart: if (p < end) { if ((flags & RPP_SEVENBIT)) ch &= 0x7f; - if (isalpha(ch)) { + if (isalpha((unsigned char)ch)) { if ((flags & RPP_FORCELOWER)) - ch = (char)tolower(ch); + ch = (char)tolower((unsigned char)ch); if ((flags & RPP_FORCEUPPER)) - ch = (char)toupper(ch); + ch = (char)toupper((unsigned char)ch); } *p++ = ch; } From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 22:44:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7027674A; Mon, 21 Jul 2014 22:44:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5151A2CF8; Mon, 21 Jul 2014 22:44:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LMi7Jh090622; Mon, 21 Jul 2014 22:44:07 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LMi6lV090618; Mon, 21 Jul 2014 22:44:06 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407212244.s6LMi6lV090618@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 21 Jul 2014 22:44:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r268963 - stable/9/lib/libc/gen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 22:44:07 -0000 Author: pfg Date: Mon Jul 21 22:44:06 2014 New Revision: 268963 URL: http://svnweb.freebsd.org/changeset/base/268963 Log: MFC r268642: libc/gen: small updates to code originating at OpenBSD arc4random.c - CVS rev. 1.22 Change arc4random_uniform() to calculate ``2**32 % upper_bound'' as ``-upper_bound % upper_bound''. Simplifies the code and makes it the same on both ILP32 and LP64 architectures, and also slightly faster on LP64 architectures by using a 32-bit remainder instead of a 64-bit remainder. - CVS rev. 1.23 Spacing readpassphrase.c -CVS rev. v 1.24 most obvious unsigned char casts for ctype Obtained from: OpenBSD Modified: stable/9/lib/libc/gen/arc4random.c stable/9/lib/libc/gen/readpassphrase.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/arc4random.c ============================================================================== --- stable/9/lib/libc/gen/arc4random.c Mon Jul 21 22:37:33 2014 (r268962) +++ stable/9/lib/libc/gen/arc4random.c Mon Jul 21 22:44:06 2014 (r268963) @@ -1,4 +1,4 @@ -/* $OpenBSD: arc4random.c,v 1.22 2010/12/22 08:23:42 otto Exp $ */ +/* $OpenBSD: arc4random.c,v 1.24 2013/06/11 16:59:50 deraadt Exp $ */ /* * Copyright (c) 1996, David Mazieres @@ -182,8 +182,7 @@ arc4_stir_if_needed(void) { pid_t pid = getpid(); - if (arc4_count <= 0 || !rs_initialized || arc4_stir_pid != pid) - { + if (arc4_count <= 0 || !rs_initialized || arc4_stir_pid != pid) { arc4_stir_pid = pid; arc4_stir(); } @@ -276,18 +275,8 @@ arc4random_uniform(u_int32_t upper_bound if (upper_bound < 2) return 0; -#if (ULONG_MAX > 0xffffffffUL) - min = 0x100000000UL % upper_bound; -#else - /* Calculate (2**32 % upper_bound) avoiding 64-bit math */ - if (upper_bound > 0x80000000) - min = 1 + ~upper_bound; /* 2**32 - upper_bound */ - else { - /* (2**32 - (x * 2)) % x == 2**32 % x when x <= 2**31 */ - min = ((0xffffffff - (upper_bound * 2)) + 1) % upper_bound; - } -#endif - + /* 2**32 % x == (2**32 - x) % x */ + min = -upper_bound % upper_bound; /* * This could theoretically loop forever but each retry has * p > 0.5 (worst case, usually far better) of selecting a Modified: stable/9/lib/libc/gen/readpassphrase.c ============================================================================== --- stable/9/lib/libc/gen/readpassphrase.c Mon Jul 21 22:37:33 2014 (r268962) +++ stable/9/lib/libc/gen/readpassphrase.c Mon Jul 21 22:44:06 2014 (r268963) @@ -1,4 +1,4 @@ -/* $OpenBSD: readpassphrase.c,v 1.23 2010/05/14 13:30:34 millert Exp $ */ +/* $OpenBSD: readpassphrase.c,v 1.24 2013/11/24 23:51:29 deraadt Exp $ */ /* * Copyright (c) 2000-2002, 2007, 2010 @@ -122,11 +122,11 @@ restart: if (p < end) { if ((flags & RPP_SEVENBIT)) ch &= 0x7f; - if (isalpha(ch)) { + if (isalpha((unsigned char)ch)) { if ((flags & RPP_FORCELOWER)) - ch = (char)tolower(ch); + ch = (char)tolower((unsigned char)ch); if ((flags & RPP_FORCEUPPER)) - ch = (char)toupper(ch); + ch = (char)toupper((unsigned char)ch); } *p++ = ch; } From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 22:48:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 939099A1; Mon, 21 Jul 2014 22:48:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 754A62D28; Mon, 21 Jul 2014 22:48:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LMm0Hx091220; Mon, 21 Jul 2014 22:48:00 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LMlxtc091208; Mon, 21 Jul 2014 22:47:59 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407212247.s6LMlxtc091208@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 21 Jul 2014 22:47:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268964 - stable/10/lib/libc/stdlib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 22:48:00 -0000 Author: pfg Date: Mon Jul 21 22:47:59 2014 New Revision: 268964 URL: http://svnweb.freebsd.org/changeset/base/268964 Log: MFC r268644: libc/stdlib: Minor cleanups to code originating in NetBSD Mostly ANSIfication and typos. Obtained from: NetBSD Modified: stable/10/lib/libc/stdlib/hcreate.c stable/10/lib/libc/stdlib/tsearch.c stable/10/lib/libc/stdlib/twalk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdlib/hcreate.c ============================================================================== --- stable/10/lib/libc/stdlib/hcreate.c Mon Jul 21 22:44:06 2014 (r268963) +++ stable/10/lib/libc/stdlib/hcreate.c Mon Jul 21 22:47:59 2014 (r268964) @@ -1,4 +1,4 @@ -/* $NetBSD: hcreate.c,v 1.2 2001/02/19 21:26:04 ross Exp $ */ +/* $NetBSD: hcreate.c,v 1.6 2008/07/21 12:05:43 lukem Exp $ */ /* * Copyright (c) 2001 Christopher G. Demetriou @@ -15,7 +15,7 @@ * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed for the - * NetBSD Project. See http://www.netbsd.org/ for + * NetBSD Project. See http://www.NetBSD.org/ for * information about NetBSD. * 4. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. @@ -49,7 +49,7 @@ #include #if 0 #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: hcreate.c,v 1.2 2001/02/19 21:26:04 ross Exp $"); +__RCSID("$NetBSD: hcreate.c,v 1.6 2008/07/21 12:05:43 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ #endif __FBSDID("$FreeBSD$"); Modified: stable/10/lib/libc/stdlib/tsearch.c ============================================================================== --- stable/10/lib/libc/stdlib/tsearch.c Mon Jul 21 22:44:06 2014 (r268963) +++ stable/10/lib/libc/stdlib/tsearch.c Mon Jul 21 22:47:59 2014 (r268964) @@ -1,4 +1,4 @@ -/* $NetBSD: tsearch.c,v 1.3 1999/09/16 11:45:37 lukem Exp $ */ +/* $NetBSD: tsearch.c,v 1.7 2012/06/25 22:32:45 abs Exp $ */ /* * Tree search generalized from Knuth (6.2.2) Algorithm T just like @@ -14,7 +14,7 @@ #include #if 0 #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: tsearch.c,v 1.3 1999/09/16 11:45:37 lukem Exp $"); +__RCSID("$NetBSD: tsearch.c,v 1.7 2012/06/25 22:32:45 abs Exp $"); #endif /* LIBC_SCCS and not lint */ #endif __FBSDID("$FreeBSD$"); @@ -25,10 +25,8 @@ __FBSDID("$FreeBSD$"); /* find or insert datum into search tree */ void * -tsearch(vkey, vrootp, compar) - const void *vkey; /* key to be located */ - void **vrootp; /* address of tree root */ - int (*compar)(const void *, const void *); +tsearch(const void *vkey, void **vrootp, + int (*compar)(const void *, const void *)) { node_t *q; node_t **rootp = (node_t **)vrootp; @@ -50,8 +48,7 @@ tsearch(vkey, vrootp, compar) q = malloc(sizeof(node_t)); /* T5: key not found */ if (q != 0) { /* make new node */ *rootp = q; /* link new node to old */ - /* LINTED const castaway ok */ - q->key = (void *)vkey; /* initialize new node */ + q->key = __DECONST(void *, vkey);/* initialize new node */ q->llink = q->rlink = NULL; } return q; Modified: stable/10/lib/libc/stdlib/twalk.c ============================================================================== --- stable/10/lib/libc/stdlib/twalk.c Mon Jul 21 22:44:06 2014 (r268963) +++ stable/10/lib/libc/stdlib/twalk.c Mon Jul 21 22:47:59 2014 (r268964) @@ -1,4 +1,4 @@ -/* $NetBSD: twalk.c,v 1.1 1999/02/22 10:33:16 christos Exp $ */ +/* $NetBSD: twalk.c,v 1.4 2012/03/20 16:38:45 matt Exp $ */ /* * Tree search generalized from Knuth (6.2.2) Algorithm T just like @@ -14,7 +14,7 @@ #include #if 0 #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: twalk.c,v 1.1 1999/02/22 10:33:16 christos Exp $"); +__RCSID("$NetBSD: twalk.c,v 1.4 2012/03/20 16:38:45 matt Exp $"); #endif /* LIBC_SCCS and not lint */ #endif __FBSDID("$FreeBSD$"); @@ -23,15 +23,12 @@ __FBSDID("$FreeBSD$"); #include #include -static void trecurse(const node_t *, - void (*action)(const void *, VISIT, int), int level); +typedef void (*cmp_fn_t)(const void *, VISIT, int); /* Walk the nodes of a tree */ static void -trecurse(root, action, level) - const node_t *root; /* Root of the tree to be walked */ - void (*action)(const void *, VISIT, int); - int level; +trecurse(const node_t *root, /* Root of the tree to be walked */ + cmp_fn_t action, int level) { if (root->llink == NULL && root->rlink == NULL) @@ -49,9 +46,7 @@ trecurse(root, action, level) /* Walk the nodes of a tree */ void -twalk(vroot, action) - const void *vroot; /* Root of the tree to be walked */ - void (*action)(const void *, VISIT, int); +twalk(const void *vroot, cmp_fn_t action) /* Root of the tree to be walked */ { if (vroot != NULL && action != NULL) trecurse(vroot, action, 0); From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 22:48:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0691ADB; Mon, 21 Jul 2014 22:48:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D17C42D33; Mon, 21 Jul 2014 22:48:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LMmdwA091357; Mon, 21 Jul 2014 22:48:39 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LMmdaK091354; Mon, 21 Jul 2014 22:48:39 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407212248.s6LMmdaK091354@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 21 Jul 2014 22:48:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r268965 - stable/9/lib/libc/stdlib X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 22:48:40 -0000 Author: pfg Date: Mon Jul 21 22:48:38 2014 New Revision: 268965 URL: http://svnweb.freebsd.org/changeset/base/268965 Log: MFC r268644: libc/stdlib: Minor cleanups to code originating in NetBSD Mostly ANSIfication and typos. Obtained from: NetBSD Modified: stable/9/lib/libc/stdlib/hcreate.c stable/9/lib/libc/stdlib/tsearch.c stable/9/lib/libc/stdlib/twalk.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdlib/hcreate.c ============================================================================== --- stable/9/lib/libc/stdlib/hcreate.c Mon Jul 21 22:47:59 2014 (r268964) +++ stable/9/lib/libc/stdlib/hcreate.c Mon Jul 21 22:48:38 2014 (r268965) @@ -1,4 +1,4 @@ -/* $NetBSD: hcreate.c,v 1.2 2001/02/19 21:26:04 ross Exp $ */ +/* $NetBSD: hcreate.c,v 1.6 2008/07/21 12:05:43 lukem Exp $ */ /* * Copyright (c) 2001 Christopher G. Demetriou @@ -15,7 +15,7 @@ * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed for the - * NetBSD Project. See http://www.netbsd.org/ for + * NetBSD Project. See http://www.NetBSD.org/ for * information about NetBSD. * 4. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. @@ -49,7 +49,7 @@ #include #if 0 #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: hcreate.c,v 1.2 2001/02/19 21:26:04 ross Exp $"); +__RCSID("$NetBSD: hcreate.c,v 1.6 2008/07/21 12:05:43 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ #endif __FBSDID("$FreeBSD$"); Modified: stable/9/lib/libc/stdlib/tsearch.c ============================================================================== --- stable/9/lib/libc/stdlib/tsearch.c Mon Jul 21 22:47:59 2014 (r268964) +++ stable/9/lib/libc/stdlib/tsearch.c Mon Jul 21 22:48:38 2014 (r268965) @@ -1,4 +1,4 @@ -/* $NetBSD: tsearch.c,v 1.3 1999/09/16 11:45:37 lukem Exp $ */ +/* $NetBSD: tsearch.c,v 1.7 2012/06/25 22:32:45 abs Exp $ */ /* * Tree search generalized from Knuth (6.2.2) Algorithm T just like @@ -14,7 +14,7 @@ #include #if 0 #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: tsearch.c,v 1.3 1999/09/16 11:45:37 lukem Exp $"); +__RCSID("$NetBSD: tsearch.c,v 1.7 2012/06/25 22:32:45 abs Exp $"); #endif /* LIBC_SCCS and not lint */ #endif __FBSDID("$FreeBSD$"); @@ -25,10 +25,8 @@ __FBSDID("$FreeBSD$"); /* find or insert datum into search tree */ void * -tsearch(vkey, vrootp, compar) - const void *vkey; /* key to be located */ - void **vrootp; /* address of tree root */ - int (*compar)(const void *, const void *); +tsearch(const void *vkey, void **vrootp, + int (*compar)(const void *, const void *)) { node_t *q; node_t **rootp = (node_t **)vrootp; @@ -50,8 +48,7 @@ tsearch(vkey, vrootp, compar) q = malloc(sizeof(node_t)); /* T5: key not found */ if (q != 0) { /* make new node */ *rootp = q; /* link new node to old */ - /* LINTED const castaway ok */ - q->key = (void *)vkey; /* initialize new node */ + q->key = __DECONST(void *, vkey);/* initialize new node */ q->llink = q->rlink = NULL; } return q; Modified: stable/9/lib/libc/stdlib/twalk.c ============================================================================== --- stable/9/lib/libc/stdlib/twalk.c Mon Jul 21 22:47:59 2014 (r268964) +++ stable/9/lib/libc/stdlib/twalk.c Mon Jul 21 22:48:38 2014 (r268965) @@ -1,4 +1,4 @@ -/* $NetBSD: twalk.c,v 1.1 1999/02/22 10:33:16 christos Exp $ */ +/* $NetBSD: twalk.c,v 1.4 2012/03/20 16:38:45 matt Exp $ */ /* * Tree search generalized from Knuth (6.2.2) Algorithm T just like @@ -14,7 +14,7 @@ #include #if 0 #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: twalk.c,v 1.1 1999/02/22 10:33:16 christos Exp $"); +__RCSID("$NetBSD: twalk.c,v 1.4 2012/03/20 16:38:45 matt Exp $"); #endif /* LIBC_SCCS and not lint */ #endif __FBSDID("$FreeBSD$"); @@ -23,15 +23,12 @@ __FBSDID("$FreeBSD$"); #include #include -static void trecurse(const node_t *, - void (*action)(const void *, VISIT, int), int level); +typedef void (*cmp_fn_t)(const void *, VISIT, int); /* Walk the nodes of a tree */ static void -trecurse(root, action, level) - const node_t *root; /* Root of the tree to be walked */ - void (*action)(const void *, VISIT, int); - int level; +trecurse(const node_t *root, /* Root of the tree to be walked */ + cmp_fn_t action, int level) { if (root->llink == NULL && root->rlink == NULL) @@ -49,9 +46,7 @@ trecurse(root, action, level) /* Walk the nodes of a tree */ void -twalk(vroot, action) - const void *vroot; /* Root of the tree to be walked */ - void (*action)(const void *, VISIT, int); +twalk(const void *vroot, cmp_fn_t action) /* Root of the tree to be walked */ { if (vroot != NULL && action != NULL) trecurse(vroot, action, 0); From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 22:59:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA62DE61; Mon, 21 Jul 2014 22:59:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B64F2DF7; Mon, 21 Jul 2014 22:59:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LMxfdW096008; Mon, 21 Jul 2014 22:59:41 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LMxeEk096004; Mon, 21 Jul 2014 22:59:40 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407212259.s6LMxeEk096004@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 21 Jul 2014 22:59:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268966 - stable/10/usr.bin/grep X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 22:59:41 -0000 Author: pfg Date: Mon Jul 21 22:59:40 2014 New Revision: 268966 URL: http://svnweb.freebsd.org/changeset/base/268966 Log: MFC r268798, r268799, r268801: grep: Fix type. grep: fix some memory leaks. queue.c (CVS Rev. 1.4. 1.5) Fix memory leaks. NULL does not need a cast. grep.c (CVS Rev. 1.6) Use the more portable getline. Obtained from: NetBSD Modified: stable/10/usr.bin/grep/grep.c stable/10/usr.bin/grep/queue.c stable/10/usr.bin/grep/util.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/grep/grep.c ============================================================================== --- stable/10/usr.bin/grep/grep.c Mon Jul 21 22:48:38 2014 (r268965) +++ stable/10/usr.bin/grep/grep.c Mon Jul 21 22:59:40 2014 (r268966) @@ -1,4 +1,4 @@ -/* $NetBSD: grep.c,v 1.4 2011/02/16 01:31:33 joerg Exp $ */ +/* $NetBSD: grep.c,v 1.6 2011/04/18 03:48:23 joerg Exp $ */ /* $FreeBSD$ */ /* $OpenBSD: grep.c,v 1.42 2010/07/02 22:18:03 tedu Exp $ */ @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _WITH_GETLINE #include #include #include @@ -304,6 +305,7 @@ read_patterns(const char *fn) FILE *f; char *line; size_t len; + ssize_t rlen; if ((f = fopen(fn, "r")) == NULL) err(2, "%s", fn); @@ -311,8 +313,11 @@ read_patterns(const char *fn) fclose(f); return; } - while ((line = fgetln(f, &len)) != NULL) + len = 0; + line = NULL; + while ((rlen = getline(&line, &len, f)) != -1) add_pattern(line, line[0] == '\n' ? 0 : len); + free(line); if (ferror(f)) err(2, "%s", fn); fclose(f); Modified: stable/10/usr.bin/grep/queue.c ============================================================================== --- stable/10/usr.bin/grep/queue.c Mon Jul 21 22:48:38 2014 (r268965) +++ stable/10/usr.bin/grep/queue.c Mon Jul 21 22:59:40 2014 (r268966) @@ -1,4 +1,4 @@ -/* $NetBSD: queue.c,v 1.2 2011/02/16 01:31:33 joerg Exp $ */ +/* $NetBSD: queue.c,v 1.5 2011/08/31 16:24:57 plunky Exp $ */ /* $FreeBSD$ */ /*- @@ -68,8 +68,11 @@ enqueue(struct str *x) STAILQ_INSERT_TAIL(&queue, item, list); - if (++count > Bflag) - free(dequeue()); + if (++count > Bflag) { + item = dequeue(); + free(item->data.dat); + free(item); + } } static struct qentry * @@ -92,7 +95,8 @@ printqueue(void) struct qentry *item; while ((item = dequeue()) != NULL) { - printline(&item->data, '-', (regmatch_t *)NULL, 0); + printline(&item->data, '-', NULL, 0); + free(item->data.dat); free(item); } } @@ -102,6 +106,8 @@ clearqueue(void) { struct qentry *item; - while ((item = dequeue()) != NULL) + while ((item = dequeue()) != NULL) { + free(item->data.dat); free(item); + } } Modified: stable/10/usr.bin/grep/util.c ============================================================================== --- stable/10/usr.bin/grep/util.c Mon Jul 21 22:48:38 2014 (r268965) +++ stable/10/usr.bin/grep/util.c Mon Jul 21 22:59:40 2014 (r268966) @@ -302,7 +302,7 @@ procline(struct str *l, int nottext) r = REG_NOMATCH; /* Check for whole word match */ if (r == 0 && (wflag || fg_pattern[i].word)) { - wint_t wbegin, wend; + wchar_t wbegin, wend; wbegin = wend = L' '; if (pmatch.rm_so != 0 && From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 23:00:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06B5EFCE; Mon, 21 Jul 2014 23:00:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBF182E75; Mon, 21 Jul 2014 23:00:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LN0Rqm098115; Mon, 21 Jul 2014 23:00:27 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LN0RuV098108; Mon, 21 Jul 2014 23:00:27 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407212300.s6LN0RuV098108@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 21 Jul 2014 23:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r268967 - stable/9/usr.bin/grep X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 23:00:28 -0000 Author: pfg Date: Mon Jul 21 23:00:26 2014 New Revision: 268967 URL: http://svnweb.freebsd.org/changeset/base/268967 Log: MFC r268798, r268799, r268801: grep: Fix type. grep: fix some memory leaks. queue.c (CVS Rev. 1.4. 1.5) Fix memory leaks. NULL does not need a cast. grep.c (CVS Rev. 1.6) Use the more portable getline. Obtained from: NetBSD Modified: stable/9/usr.bin/grep/grep.c stable/9/usr.bin/grep/queue.c stable/9/usr.bin/grep/util.c Directory Properties: stable/9/usr.bin/grep/ (props changed) Modified: stable/9/usr.bin/grep/grep.c ============================================================================== --- stable/9/usr.bin/grep/grep.c Mon Jul 21 22:59:40 2014 (r268966) +++ stable/9/usr.bin/grep/grep.c Mon Jul 21 23:00:26 2014 (r268967) @@ -1,4 +1,4 @@ -/* $NetBSD: grep.c,v 1.4 2011/02/16 01:31:33 joerg Exp $ */ +/* $NetBSD: grep.c,v 1.6 2011/04/18 03:48:23 joerg Exp $ */ /* $FreeBSD$ */ /* $OpenBSD: grep.c,v 1.42 2010/07/02 22:18:03 tedu Exp $ */ @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _WITH_GETLINE #include #include #include @@ -303,6 +304,7 @@ read_patterns(const char *fn) FILE *f; char *line; size_t len; + ssize_t rlen; if ((f = fopen(fn, "r")) == NULL) err(2, "%s", fn); @@ -310,8 +312,11 @@ read_patterns(const char *fn) fclose(f); return; } - while ((line = fgetln(f, &len)) != NULL) + len = 0; + line = NULL; + while ((rlen = getline(&line, &len, f)) != -1) add_pattern(line, line[0] == '\n' ? 0 : len); + free(line); if (ferror(f)) err(2, "%s", fn); fclose(f); Modified: stable/9/usr.bin/grep/queue.c ============================================================================== --- stable/9/usr.bin/grep/queue.c Mon Jul 21 22:59:40 2014 (r268966) +++ stable/9/usr.bin/grep/queue.c Mon Jul 21 23:00:26 2014 (r268967) @@ -1,4 +1,4 @@ -/* $NetBSD: queue.c,v 1.2 2011/02/16 01:31:33 joerg Exp $ */ +/* $NetBSD: queue.c,v 1.5 2011/08/31 16:24:57 plunky Exp $ */ /* $FreeBSD$ */ /*- @@ -68,8 +68,11 @@ enqueue(struct str *x) STAILQ_INSERT_TAIL(&queue, item, list); - if (++count > Bflag) - free(dequeue()); + if (++count > Bflag) { + item = dequeue(); + free(item->data.dat); + free(item); + } } static struct qentry * @@ -92,7 +95,8 @@ printqueue(void) struct qentry *item; while ((item = dequeue()) != NULL) { - printline(&item->data, '-', (regmatch_t *)NULL, 0); + printline(&item->data, '-', NULL, 0); + free(item->data.dat); free(item); } } @@ -102,6 +106,8 @@ clearqueue(void) { struct qentry *item; - while ((item = dequeue()) != NULL) + while ((item = dequeue()) != NULL) { + free(item->data.dat); free(item); + } } Modified: stable/9/usr.bin/grep/util.c ============================================================================== --- stable/9/usr.bin/grep/util.c Mon Jul 21 22:59:40 2014 (r268966) +++ stable/9/usr.bin/grep/util.c Mon Jul 21 23:00:26 2014 (r268967) @@ -302,7 +302,7 @@ procline(struct str *l, int nottext) r = REG_NOMATCH; /* Check for whole word match */ if (r == 0 && (wflag || fg_pattern[i].word)) { - wint_t wbegin, wend; + wchar_t wbegin, wend; wbegin = wend = L' '; if (pmatch.rm_so != 0 && From owner-svn-src-all@FreeBSD.ORG Mon Jul 21 23:23:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 730156D0; Mon, 21 Jul 2014 23:23:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F53B2069; Mon, 21 Jul 2014 23:23:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LNNLPa009002; Mon, 21 Jul 2014 23:23:21 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LNNLdZ009000; Mon, 21 Jul 2014 23:23:21 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407212323.s6LNNLdZ009000@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 21 Jul 2014 23:23:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268968 - stable/10/sbin/fsck_msdosfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2014 23:23:21 -0000 Author: pfg Date: Mon Jul 21 23:23:20 2014 New Revision: 268968 URL: http://svnweb.freebsd.org/changeset/base/268968 Log: MFC r268632: fsck_msdosfs: Assorted fixes from other BSDs. When truncating cluster chains fix the length of the cluster head. http://marc.info/?t=140304310700005&r=1&w=2 Avoid infinite loops in cluster chain linked lists. http://marc.info/?l=openbsd-tech&m=140275150804337&w=2 Avoid off-by-one on FAT12 filesystems. http://marc.info/?l=openbsd-tech&m=140234174104724&w=2 Obtained from: NetBSD (from OpenBSD) Modified: stable/10/sbin/fsck_msdosfs/dir.c stable/10/sbin/fsck_msdosfs/fat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/fsck_msdosfs/dir.c ============================================================================== --- stable/10/sbin/fsck_msdosfs/dir.c Mon Jul 21 23:00:26 2014 (r268967) +++ stable/10/sbin/fsck_msdosfs/dir.c Mon Jul 21 23:23:20 2014 (r268968) @@ -419,13 +419,14 @@ checksize(struct bootblock *boot, struct fullpath(dir)); if (ask(1, "Drop superfluous clusters")) { cl_t cl; - u_int32_t sz = 0; + u_int32_t sz, len; - for (cl = dir->head; (sz += boot->ClusterSize) < - dir->size;) + for (cl = dir->head, len = sz = 0; + (sz += boot->ClusterSize) < dir->size; len++) cl = fat[cl].next; clearchain(boot, fat, fat[cl].next); fat[cl].next = CLUST_EOF; + fat[dir->head].length = len; return FSFATMOD; } else return FSERROR; Modified: stable/10/sbin/fsck_msdosfs/fat.c ============================================================================== --- stable/10/sbin/fsck_msdosfs/fat.c Mon Jul 21 23:00:26 2014 (r268967) +++ stable/10/sbin/fsck_msdosfs/fat.c Mon Jul 21 23:23:20 2014 (r268968) @@ -436,7 +436,15 @@ tryclear(struct bootblock *boot, struct clearchain(boot, fat, head); return FSFATMOD; } else if (ask(0, "Truncate")) { + uint32_t len; + cl_t p; + + for (p = head, len = 0; + p >= CLUST_FIRST && p < boot->NumClusters; + p = fat[p].next, len++) + continue; *truncp = CLUST_EOF; + fat[head].length = len; return FSFATMOD; } else return FSERROR; @@ -465,7 +473,8 @@ checkfat(struct bootblock *boot, struct /* follow the chain and mark all clusters on the way */ for (len = 0, p = head; - p >= CLUST_FIRST && p < boot->NumClusters; + p >= CLUST_FIRST && p < boot->NumClusters && + fat[p].head != head; p = fat[p].next) { fat[p].head = head; len++; @@ -486,10 +495,10 @@ checkfat(struct bootblock *boot, struct continue; /* follow the chain to its end (hopefully) */ - for (p = head; + for (len = fat[head].length, p = head; (n = fat[p].next) >= CLUST_FIRST && n < boot->NumClusters; p = n) - if (fat[n].head != head) + if (fat[n].head != head || len-- < 2) break; if (n >= CLUST_EOFS) continue; @@ -497,14 +506,20 @@ checkfat(struct bootblock *boot, struct if (n == CLUST_FREE || n >= CLUST_RSRVD) { pwarn("Cluster chain starting at %u ends with cluster marked %s\n", head, rsrvdcltype(n)); +clear: ret |= tryclear(boot, fat, head, &fat[p].next); continue; } if (n < CLUST_FIRST || n >= boot->NumClusters) { pwarn("Cluster chain starting at %u ends with cluster out of range (%u)\n", - head, n); - ret |= tryclear(boot, fat, head, &fat[p].next); - continue; + head, n); + goto clear; + } + if (head == fat[n].head) { + pwarn("Cluster chain starting at %u loops at cluster %u\n", + + head, p); + goto clear; } pwarn("Cluster chains starting at %u and %u are linked at cluster %u\n", head, fat[n].head, n); @@ -621,13 +636,15 @@ writefat(int fs, struct bootblock *boot, default: if (fat[cl].next == CLUST_FREE) boot->NumFree++; - if (cl + 1 < boot->NumClusters - && fat[cl + 1].next == CLUST_FREE) - boot->NumFree++; *p++ = (u_char)fat[cl].next; - *p++ = (u_char)((fat[cl].next >> 8) & 0xf) - |(u_char)(fat[cl+1].next << 4); - *p++ = (u_char)(fat[++cl].next >> 4); + *p = (u_char)((fat[cl].next >> 8) & 0xf); + cl++; + if (cl >= boot->NumClusters) + break; + if (fat[cl].next == CLUST_FREE) + boot->NumFree++; + *p++ |= (u_char)(fat[cl + 1].next << 4); + *p++ = (u_char)(fat[cl + 1].next >> 4); break; } } From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 00:33:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 77F9BF7B; Tue, 22 Jul 2014 00:33:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 648C92574; Tue, 22 Jul 2014 00:33:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M0XgGU040467; Tue, 22 Jul 2014 00:33:42 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M0XgKd040466; Tue, 22 Jul 2014 00:33:42 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201407220033.s6M0XgKd040466@svn.freebsd.org> From: Bryan Drewery Date: Tue, 22 Jul 2014 00:33:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268969 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 00:33:42 -0000 Author: bdrewery Date: Tue Jul 22 00:33:41 2014 New Revision: 268969 URL: http://svnweb.freebsd.org/changeset/base/268969 Log: MFC r268715,r268722: Document the 'show bio' command added in 2009. Also link 'show bio' to g_bio(9.) Modified: stable/10/share/man/man4/ddb.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/ddb.4 ============================================================================== --- stable/10/share/man/man4/ddb.4 Mon Jul 21 23:23:20 2014 (r268968) +++ stable/10/share/man/man4/ddb.4 Tue Jul 22 00:33:41 2014 (r268969) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 30, 2013 +.Dd July 15, 2014 .Dt DDB 4 .Os .Sh NAME @@ -584,17 +584,26 @@ Dump data about APIC IDT vector mappings Show breakpoints set with the "break" command. .\" .Pp -.It Ic show Cm buffer -Show buffer structure of +.It Ic show Cm bio Ar addr +Show information about the bio structure +.Vt struct bio +present at +.Ar addr . +See the +.Pa sys/bio.h +header file and +.Xr g_bio 9 +for more details on the exact meaning of the structure fields. +.\" +.Pp +.It Ic show Cm buffer Ar addr +Show information about the buf structure .Vt struct buf -type. -Such a structure is used within the -.Fx -kernel for the I/O subsystem -implementation. -For an exact interpretation of the output, please see the +present at +.Ar addr . +See the .Pa sys/buf.h -header file. +header file for more details on the exact meaning of the structure fields. .\" .Pp .It Ic show Cm cbstat From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 00:42:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11C491B1; Tue, 22 Jul 2014 00:42:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9538262B; Tue, 22 Jul 2014 00:42:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M0gtca044644; Tue, 22 Jul 2014 00:42:55 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M0gtmC044642; Tue, 22 Jul 2014 00:42:55 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201407220042.s6M0gtmC044642@svn.freebsd.org> From: "Simon J. Gerraty" Date: Tue, 22 Jul 2014 00:42:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268970 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 00:42:56 -0000 Author: sjg Date: Tue Jul 22 00:42:55 2014 New Revision: 268970 URL: http://svnweb.freebsd.org/changeset/base/268970 Log: bsd.lib.mk does not add OBJS etc to CLEANFILES so does not automatically get them flagged as .NOPATH. This hurts people who don't use obj dirs. Since its clean target seprate rm's for things, use NOPATH_FILES as list to collect things that need .NOPATH. bsd.obj.mk will add CLEANFILES to NOPATH_FILES and do the deed if needed. Reviewed by: sbruno Modified: head/share/mk/bsd.lib.mk head/share/mk/bsd.obj.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Tue Jul 22 00:33:41 2014 (r268969) +++ head/share/mk/bsd.lib.mk Tue Jul 22 00:42:55 2014 (r268970) @@ -160,6 +160,7 @@ LDFLAGS+= -L${_SHLIBDIRPREFIX}${LIBPRIVA .if defined(LIB) && !empty(LIB) || defined(SHLIB_NAME) OBJS+= ${SRCS:N*.h:R:S/$/.o/} +NOPATH_FILES+= ${OBJS} .endif .if defined(LIB) && !empty(LIB) @@ -181,6 +182,7 @@ lib${LIB}.a: ${OBJS} ${STATICOBJS} .if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) _LIBS+= lib${LIB}_p.a POBJS+= ${OBJS:.o=.po} ${STATICOBJS:.o=.po} +NOPATH_FILES+= ${POBJS} lib${LIB}_p.a: ${POBJS} @${ECHO} building profiled ${LIB} library @@ -196,6 +198,7 @@ lib${LIB}_p.a: ${POBJS} .if defined(SHLIB_NAME) || \ defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) SOBJS+= ${OBJS:.o=.So} +NOPATH_FILES+= ${SOBJS} .endif .if defined(SHLIB_NAME) @@ -254,6 +257,7 @@ lib${LIB}_pic.a: ${SOBJS} LINTLIB= llib-l${LIB}.ln _LIBS+= ${LINTLIB} LINTOBJS+= ${SRCS:M*.c:.c=.ln} +NOPATH_FILES+= ${LINTOBJS} ${LINTLIB}: ${LINTOBJS} @${ECHO} building lint library ${.TARGET} @@ -454,6 +458,10 @@ clean: .endif .endif +.if !empty(_LIBS) +NOPATH_FILES+= ${_LIBS} +.endif + .include .include Modified: head/share/mk/bsd.obj.mk ============================================================================== --- head/share/mk/bsd.obj.mk Tue Jul 22 00:33:41 2014 (r268969) +++ head/share/mk/bsd.obj.mk Tue Jul 22 00:42:55 2014 (r268970) @@ -119,8 +119,9 @@ cleanobj: clean cleandepend @if [ -L ${.CURDIR}/obj ]; then rm -f ${.CURDIR}/obj; fi # Tell bmake not to look for generated files via .PATH -.if !empty(CLEANFILES) -.NOPATH: ${CLEANFILES} +NOPATH_FILES+= ${CLEANFILES} +.if !empty(NOPATH_FILES) +.NOPATH: ${NOPATH_FILES} .endif .if !target(clean) From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 02:02:40 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 64715B65; Tue, 22 Jul 2014 02:02:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 451C02BF1; Tue, 22 Jul 2014 02:02:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M22eto080225; Tue, 22 Jul 2014 02:02:40 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M22d34080222; Tue, 22 Jul 2014 02:02:39 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201407220202.s6M22d34080222@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 22 Jul 2014 02:02:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268971 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 02:02:40 -0000 Author: np Date: Tue Jul 22 02:02:39 2014 New Revision: 268971 URL: http://svnweb.freebsd.org/changeset/base/268971 Log: Simplify r267600, there's no need to distinguish between allocated and inlined mbufs. MFC after: 1 week Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue Jul 22 00:42:55 2014 (r268970) +++ head/sys/dev/cxgbe/adapter.h Tue Jul 22 02:02:39 2014 (r268971) @@ -290,8 +290,7 @@ struct cluster_metadata { struct fl_sdesc { caddr_t cl; - uint8_t nimbuf; /* # of inline mbufs with ref on the cluster */ - uint8_t nembuf; /* # of allocated mbufs with ref */ + uint16_t nmbuf; /* # of driver originated mbufs with ref on cluster */ struct cluster_layout cll; }; Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Tue Jul 22 00:42:55 2014 (r268970) +++ head/sys/dev/cxgbe/t4_sge.c Tue Jul 22 02:02:39 2014 (r268971) @@ -1559,7 +1559,7 @@ get_scatter_segment(struct adapter *sc, /* copy data to mbuf */ bcopy(payload, mtod(m, caddr_t), len); - } else if (sd->nimbuf * MSIZE < cll->region1) { + } else if (sd->nmbuf * MSIZE < cll->region1) { /* * There's spare room in the cluster for an mbuf. Create one @@ -1567,14 +1567,14 @@ get_scatter_segment(struct adapter *sc, */ MPASS(clm != NULL); - m = (struct mbuf *)(sd->cl + sd->nimbuf * MSIZE); + m = (struct mbuf *)(sd->cl + sd->nmbuf * MSIZE); /* No bzero required */ if (m_init(m, NULL, 0, M_NOWAIT, MT_DATA, flags | M_NOFREE)) return (NULL); fl->mbuf_inlined++; m_extaddref(m, payload, padded_len, &clm->refcount, rxb_free, swz->zone, sd->cl); - sd->nimbuf++; + sd->nmbuf++; } else { @@ -1591,7 +1591,7 @@ get_scatter_segment(struct adapter *sc, if (clm != NULL) { m_extaddref(m, payload, padded_len, &clm->refcount, rxb_free, swz->zone, sd->cl); - sd->nembuf++; + sd->nmbuf++; } else { m_cljset(m, sd->cl, swz->type); sd->cl = NULL; /* consumed, not a recycle candidate */ @@ -3253,7 +3253,7 @@ refill_fl(struct adapter *sc, struct sge if (sd->cl != NULL) { - if (sd->nimbuf + sd->nembuf == 0) { + if (sd->nmbuf == 0) { /* * Fast recycle without involving any atomics on * the cluster's metadata (if the cluster has @@ -3312,8 +3312,7 @@ recycled: #endif clm->refcount = 1; } - sd->nimbuf = 0; - sd->nembuf = 0; + sd->nmbuf = 0; recycled_fast: fl->pending++; fl->needed--; @@ -3382,7 +3381,7 @@ free_fl_sdesc(struct adapter *sc, struct cll = &sd->cll; clm = cl_metadata(sc, fl, cll, sd->cl); - if (sd->nimbuf + sd->nembuf == 0 || + if (sd->nmbuf == 0 || (clm && atomic_fetchadd_int(&clm->refcount, -1) == 1)) { uma_zfree(sc->sge.sw_zone_info[cll->zidx].zone, sd->cl); } From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 03:14:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A546A494; Tue, 22 Jul 2014 03:14:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F4AC21E3; Tue, 22 Jul 2014 03:14:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M3EfdD012146; Tue, 22 Jul 2014 03:14:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M3EcJb012124; Tue, 22 Jul 2014 03:14:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201407220314.s6M3EcJb012124@svn.freebsd.org> From: John Baldwin Date: Tue, 22 Jul 2014 03:14:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268972 - in stable/10: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/io usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 03:14:41 -0000 Author: jhb Date: Tue Jul 22 03:14:37 2014 New Revision: 268972 URL: http://svnweb.freebsd.org/changeset/base/268972 Log: MFC 266125: Implement a PCI interrupt router to route PCI legacy INTx interrupts to the legacy 8259A PICs. Added: stable/10/usr.sbin/bhyve/pci_irq.c - copied unchanged from r266125, head/usr.sbin/bhyve/pci_irq.c stable/10/usr.sbin/bhyve/pci_irq.h - copied unchanged from r266125, head/usr.sbin/bhyve/pci_irq.h Modified: stable/10/lib/libvmmapi/vmmapi.c stable/10/lib/libvmmapi/vmmapi.h stable/10/sys/amd64/include/vmm.h stable/10/sys/amd64/include/vmm_dev.h stable/10/sys/amd64/vmm/io/vatpic.c stable/10/sys/amd64/vmm/io/vatpic.h stable/10/sys/amd64/vmm/vmm_dev.c stable/10/usr.sbin/bhyve/Makefile stable/10/usr.sbin/bhyve/acpi.c stable/10/usr.sbin/bhyve/acpi.h stable/10/usr.sbin/bhyve/bhyverun.c stable/10/usr.sbin/bhyve/mptbl.c stable/10/usr.sbin/bhyve/pci_emul.c stable/10/usr.sbin/bhyve/pci_emul.h stable/10/usr.sbin/bhyve/pci_lpc.c stable/10/usr.sbin/bhyve/pci_lpc.h stable/10/usr.sbin/bhyve/pm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libvmmapi/vmmapi.c ============================================================================== --- stable/10/lib/libvmmapi/vmmapi.c Tue Jul 22 02:02:39 2014 (r268971) +++ stable/10/lib/libvmmapi/vmmapi.c Tue Jul 22 03:14:37 2014 (r268972) @@ -507,6 +507,7 @@ int vm_isa_pulse_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq) { struct vm_isa_irq isa_irq; + bzero(&isa_irq, sizeof(struct vm_isa_irq)); isa_irq.atpic_irq = atpic_irq; isa_irq.ioapic_irq = ioapic_irq; @@ -515,6 +516,19 @@ vm_isa_pulse_irq(struct vmctx *ctx, int } int +vm_isa_set_irq_trigger(struct vmctx *ctx, int atpic_irq, + enum vm_intr_trigger trigger) +{ + struct vm_isa_irq_trigger isa_irq_trigger; + + bzero(&isa_irq_trigger, sizeof(struct vm_isa_irq_trigger)); + isa_irq_trigger.atpic_irq = atpic_irq; + isa_irq_trigger.trigger = trigger; + + return (ioctl(ctx->fd, VM_ISA_SET_IRQ_TRIGGER, &isa_irq_trigger)); +} + +int vm_inject_nmi(struct vmctx *ctx, int vcpu) { struct vm_nmi vmnmi; Modified: stable/10/lib/libvmmapi/vmmapi.h ============================================================================== --- stable/10/lib/libvmmapi/vmmapi.h Tue Jul 22 02:02:39 2014 (r268971) +++ stable/10/lib/libvmmapi/vmmapi.h Tue Jul 22 03:14:37 2014 (r268972) @@ -78,6 +78,8 @@ int vm_ioapic_pincount(struct vmctx *ctx int vm_isa_assert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); int vm_isa_deassert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); int vm_isa_pulse_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); +int vm_isa_set_irq_trigger(struct vmctx *ctx, int atpic_irq, + enum vm_intr_trigger trigger); int vm_inject_nmi(struct vmctx *ctx, int vcpu); int vm_capability_name2type(const char *capname); const char *vm_capability_type2name(int type); Modified: stable/10/sys/amd64/include/vmm.h ============================================================================== --- stable/10/sys/amd64/include/vmm.h Tue Jul 22 02:02:39 2014 (r268971) +++ stable/10/sys/amd64/include/vmm.h Tue Jul 22 03:14:37 2014 (r268972) @@ -301,6 +301,11 @@ enum x2apic_state { X2APIC_STATE_LAST }; +enum vm_intr_trigger { + EDGE_TRIGGER, + LEVEL_TRIGGER +}; + /* * The 'access' field has the format specified in Table 21-2 of the Intel * Architecture Manual vol 3b. Modified: stable/10/sys/amd64/include/vmm_dev.h ============================================================================== --- stable/10/sys/amd64/include/vmm_dev.h Tue Jul 22 02:02:39 2014 (r268971) +++ stable/10/sys/amd64/include/vmm_dev.h Tue Jul 22 03:14:37 2014 (r268972) @@ -84,6 +84,11 @@ struct vm_isa_irq { int ioapic_irq; }; +struct vm_isa_irq_trigger { + int atpic_irq; + enum vm_intr_trigger trigger; +}; + struct vm_capability { int cpuid; enum vm_cap_type captype; @@ -213,6 +218,7 @@ enum { IOCNUM_ISA_ASSERT_IRQ = 80, IOCNUM_ISA_DEASSERT_IRQ = 81, IOCNUM_ISA_PULSE_IRQ = 82, + IOCNUM_ISA_SET_IRQ_TRIGGER = 83, }; #define VM_RUN \ @@ -253,6 +259,8 @@ enum { _IOW('v', IOCNUM_ISA_DEASSERT_IRQ, struct vm_isa_irq) #define VM_ISA_PULSE_IRQ \ _IOW('v', IOCNUM_ISA_PULSE_IRQ, struct vm_isa_irq) +#define VM_ISA_SET_IRQ_TRIGGER \ + _IOW('v', IOCNUM_ISA_SET_IRQ_TRIGGER, struct vm_isa_irq_trigger) #define VM_SET_CAPABILITY \ _IOW('v', IOCNUM_SET_CAPABILITY, struct vm_capability) #define VM_GET_CAPABILITY \ Modified: stable/10/sys/amd64/vmm/io/vatpic.c ============================================================================== --- stable/10/sys/amd64/vmm/io/vatpic.c Tue Jul 22 02:02:39 2014 (r268971) +++ stable/10/sys/amd64/vmm/io/vatpic.c Tue Jul 22 03:14:37 2014 (r268972) @@ -446,6 +446,43 @@ vatpic_pulse_irq(struct vm *vm, int irq) return (vatpic_set_irqstate(vm, irq, IRQSTATE_PULSE)); } +int +vatpic_set_irq_trigger(struct vm *vm, int irq, enum vm_intr_trigger trigger) +{ + struct vatpic *vatpic; + + if (irq < 0 || irq > 15) + return (EINVAL); + + /* + * See comment in vatpic_elc_handler. These IRQs must be + * edge triggered. + */ + if (trigger == LEVEL_TRIGGER) { + switch (irq) { + case 0: + case 1: + case 2: + case 8: + case 13: + return (EINVAL); + } + } + + vatpic = vm_atpic(vm); + + VATPIC_LOCK(vatpic); + + if (trigger == LEVEL_TRIGGER) + vatpic->elc[irq >> 3] |= 1 << (irq & 0x7); + else + vatpic->elc[irq >> 3] &= ~(1 << (irq & 0x7)); + + VATPIC_UNLOCK(vatpic); + + return (0); +} + void vatpic_pending_intr(struct vm *vm, int *vecptr) { Modified: stable/10/sys/amd64/vmm/io/vatpic.h ============================================================================== --- stable/10/sys/amd64/vmm/io/vatpic.h Tue Jul 22 02:02:39 2014 (r268971) +++ stable/10/sys/amd64/vmm/io/vatpic.h Tue Jul 22 03:14:37 2014 (r268972) @@ -49,6 +49,7 @@ int vatpic_elc_handler(void *vm, int vcp int vatpic_assert_irq(struct vm *vm, int irq); int vatpic_deassert_irq(struct vm *vm, int irq); int vatpic_pulse_irq(struct vm *vm, int irq); +int vatpic_set_irq_trigger(struct vm *vm, int irq, enum vm_intr_trigger trigger); void vatpic_pending_intr(struct vm *vm, int *vecptr); void vatpic_intr_accepted(struct vm *vm, int vector); Modified: stable/10/sys/amd64/vmm/vmm_dev.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_dev.c Tue Jul 22 02:02:39 2014 (r268971) +++ stable/10/sys/amd64/vmm/vmm_dev.c Tue Jul 22 03:14:37 2014 (r268972) @@ -156,6 +156,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c struct vm_lapic_msi *vmmsi; struct vm_ioapic_irq *ioapic_irq; struct vm_isa_irq *isa_irq; + struct vm_isa_irq_trigger *isa_irq_trigger; struct vm_capability *vmcap; struct vm_pptdev *pptdev; struct vm_pptdev_mmio *pptmmio; @@ -346,6 +347,11 @@ vmmdev_ioctl(struct cdev *cdev, u_long c if (error == 0 && isa_irq->ioapic_irq != -1) error = vioapic_pulse_irq(sc->vm, isa_irq->ioapic_irq); break; + case VM_ISA_SET_IRQ_TRIGGER: + isa_irq_trigger = (struct vm_isa_irq_trigger *)data; + error = vatpic_set_irq_trigger(sc->vm, + isa_irq_trigger->atpic_irq, isa_irq_trigger->trigger); + break; case VM_MAP_MEMORY: seg = (struct vm_memory_segment *)data; error = vm_malloc(sc->vm, seg->gpa, seg->len); Modified: stable/10/usr.sbin/bhyve/Makefile ============================================================================== --- stable/10/usr.sbin/bhyve/Makefile Tue Jul 22 02:02:39 2014 (r268971) +++ stable/10/usr.sbin/bhyve/Makefile Tue Jul 22 03:14:37 2014 (r268972) @@ -23,6 +23,7 @@ SRCS= \ pci_ahci.c \ pci_emul.c \ pci_hostbridge.c \ + pci_irq.c \ pci_lpc.c \ pci_passthru.c \ pci_virtio_block.c \ Modified: stable/10/usr.sbin/bhyve/acpi.c ============================================================================== --- stable/10/usr.sbin/bhyve/acpi.c Tue Jul 22 02:02:39 2014 (r268971) +++ stable/10/usr.sbin/bhyve/acpi.c Tue Jul 22 03:14:37 2014 (r268972) @@ -704,7 +704,7 @@ basl_fwrite_dsdt(FILE *fp) dsdt_line("DefinitionBlock (\"bhyve_dsdt.aml\", \"DSDT\", 2," "\"BHYVE \", \"BVDSDT \", 0x00000001)"); dsdt_line("{"); - dsdt_line(" Name (_S5, Package (0x02)"); + dsdt_line(" Name (_S5, Package ()"); dsdt_line(" {"); dsdt_line(" 0x05,"); dsdt_line(" Zero,"); Modified: stable/10/usr.sbin/bhyve/acpi.h ============================================================================== --- stable/10/usr.sbin/bhyve/acpi.h Tue Jul 22 02:02:39 2014 (r268971) +++ stable/10/usr.sbin/bhyve/acpi.h Tue Jul 22 03:14:37 2014 (r268972) @@ -49,5 +49,6 @@ void dsdt_fixed_irq(uint8_t irq); void dsdt_fixed_mem32(uint32_t base, uint32_t length); void dsdt_indent(int levels); void dsdt_unindent(int levels); +void sci_init(struct vmctx *ctx); #endif /* _ACPI_H_ */ Modified: stable/10/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.c Tue Jul 22 02:02:39 2014 (r268971) +++ stable/10/usr.sbin/bhyve/bhyverun.c Tue Jul 22 03:14:37 2014 (r268972) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include "mevent.h" #include "mptbl.h" #include "pci_emul.h" +#include "pci_irq.h" #include "pci_lpc.h" #include "smbiostbl.h" #include "xmsr.h" @@ -770,9 +771,11 @@ main(int argc, char *argv[]) init_mem(); init_inout(); + pci_irq_init(ctx); ioapic_init(ctx); rtc_init(ctx); + sci_init(ctx); /* * Exit if a device emulation finds an error in it's initilization Modified: stable/10/usr.sbin/bhyve/mptbl.c ============================================================================== --- stable/10/usr.sbin/bhyve/mptbl.c Tue Jul 22 02:02:39 2014 (r268971) +++ stable/10/usr.sbin/bhyve/mptbl.c Tue Jul 22 03:14:37 2014 (r268972) @@ -210,7 +210,8 @@ mpt_count_ioint_entries(void) } static void -mpt_generate_pci_int(int bus, int slot, int pin, int ioapic_irq, void *arg) +mpt_generate_pci_int(int bus, int slot, int pin, int pirq_pin, int ioapic_irq, + void *arg) { int_entry_ptr *mpiep, mpie; Modified: stable/10/usr.sbin/bhyve/pci_emul.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_emul.c Tue Jul 22 02:02:39 2014 (r268971) +++ stable/10/usr.sbin/bhyve/pci_emul.c Tue Jul 22 03:14:37 2014 (r268972) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include "ioapic.h" #include "mem.h" #include "pci_emul.h" +#include "pci_irq.h" #include "pci_lpc.h" #define CONF1_ADDR_PORT 0x0cf8 @@ -81,6 +82,7 @@ struct funcinfo { struct intxinfo { int ii_count; + int ii_pirq_pin; int ii_ioapic_irq; }; @@ -113,6 +115,7 @@ static uint64_t pci_emul_membase64; #define PCI_EMUL_MEMLIMIT64 0xFD00000000UL static struct pci_devemu *pci_emul_finddev(char *name); +static void pci_lintr_route(struct pci_devinst *pi); static void pci_lintr_update(struct pci_devinst *pi); static struct mem_range pci_mem_hole; @@ -714,6 +717,7 @@ pci_emul_init(struct vmctx *ctx, struct pthread_mutex_init(&pdi->pi_lintr.lock, NULL); pdi->pi_lintr.pin = 0; pdi->pi_lintr.state = IDLE; + pdi->pi_lintr.pirq_pin = 0; pdi->pi_lintr.ioapic_irq = 0; pdi->pi_d = pde; snprintf(pdi->pi_name, PI_NAMESZ, "%s-pci-%d", pde->pe_emu, slot); @@ -1084,6 +1088,27 @@ init_pci(struct vmctx *ctx) } /* + * PCI backends are initialized before routing INTx interrupts + * so that LPC devices are able to reserve ISA IRQs before + * routing PIRQ pins. + */ + for (bus = 0; bus < MAXBUSES; bus++) { + if ((bi = pci_businfo[bus]) == NULL) + continue; + + for (slot = 0; slot < MAXSLOTS; slot++) { + si = &bi->slotinfo[slot]; + for (func = 0; func < MAXFUNCS; func++) { + fi = &si->si_funcs[func]; + if (fi->fi_devi == NULL) + continue; + pci_lintr_route(fi->fi_devi); + } + } + } + lpc_pirq_routed(); + + /* * The guest physical memory map looks like the following: * [0, lowmem) guest system memory * [lowmem, lowmem_limit) memory hole (may be absent) @@ -1110,19 +1135,36 @@ init_pci(struct vmctx *ctx) } static void -pci_prt_entry(int bus, int slot, int pin, int ioapic_irq, void *arg) +pci_apic_prt_entry(int bus, int slot, int pin, int pirq_pin, int ioapic_irq, + void *arg) { - int *count; - count = arg; - dsdt_line(" Package (0x04)"); + dsdt_line(" Package ()"); dsdt_line(" {"); dsdt_line(" 0x%X,", slot << 16 | 0xffff); dsdt_line(" 0x%02X,", pin - 1); dsdt_line(" Zero,"); dsdt_line(" 0x%X", ioapic_irq); - dsdt_line(" }%s", *count == 1 ? "" : ","); - (*count)--; + dsdt_line(" },"); +} + +static void +pci_pirq_prt_entry(int bus, int slot, int pin, int pirq_pin, int ioapic_irq, + void *arg) +{ + char *name; + + name = lpc_pirq_name(pirq_pin); + if (name == NULL) + return; + dsdt_line(" Package ()"); + dsdt_line(" {"); + dsdt_line(" 0x%X,", slot << 16 | 0xffff); + dsdt_line(" 0x%02X,", pin - 1); + dsdt_line(" %s,", name); + dsdt_line(" 0x00"); + dsdt_line(" },"); + free(name); } /* @@ -1135,7 +1177,7 @@ pci_bus_write_dsdt(int bus) struct businfo *bi; struct slotinfo *si; struct pci_devinst *pi; - int count, slot, func; + int count, func, slot; /* * If there are no devices on this 'bus' then just return. @@ -1150,9 +1192,6 @@ pci_bus_write_dsdt(int bus) return; } - dsdt_indent(1); - dsdt_line("Scope (_SB)"); - dsdt_line("{"); dsdt_line(" Device (PC%02X)", bus); dsdt_line(" {"); dsdt_line(" Name (_HID, EisaId (\"PNP0A03\"))"); @@ -1245,10 +1284,25 @@ pci_bus_write_dsdt(int bus) count = pci_count_lintr(bus); if (count != 0) { dsdt_indent(2); - dsdt_line("Name (_PRT, Package (0x%02X)", count); + dsdt_line("Name (PPRT, Package ()"); dsdt_line("{"); - pci_walk_lintr(bus, pci_prt_entry, &count); - dsdt_line("})"); + pci_walk_lintr(bus, pci_pirq_prt_entry, NULL); + dsdt_line("})"); + dsdt_line("Name (APRT, Package ()"); + dsdt_line("{"); + pci_walk_lintr(bus, pci_apic_prt_entry, NULL); + dsdt_line("})"); + dsdt_line("Method (_PRT, 0, NotSerialized)"); + dsdt_line("{"); + dsdt_line(" If (PICM)"); + dsdt_line(" {"); + dsdt_line(" Return (APRT)"); + dsdt_line(" }"); + dsdt_line(" Else"); + dsdt_line(" {"); + dsdt_line(" Return (PPRT)"); + dsdt_line(" }"); + dsdt_line("}"); dsdt_unindent(2); } @@ -1264,8 +1318,6 @@ pci_bus_write_dsdt(int bus) dsdt_unindent(2); done: dsdt_line(" }"); - dsdt_line("}"); - dsdt_unindent(1); } void @@ -1273,8 +1325,19 @@ pci_write_dsdt(void) { int bus; + dsdt_indent(1); + dsdt_line("Name (PICM, 0x00)"); + dsdt_line("Method (_PIC, 1, NotSerialized)"); + dsdt_line("{"); + dsdt_line(" Store (Arg0, PICM)"); + dsdt_line("}"); + dsdt_line(""); + dsdt_line("Scope (_SB)"); + dsdt_line("{"); for (bus = 0; bus < MAXBUSES; bus++) pci_bus_write_dsdt(bus); + dsdt_line("}"); + dsdt_unindent(1); } int @@ -1347,18 +1410,19 @@ pci_lintr_permitted(struct pci_devinst * (cmd & PCIM_CMD_INTxDIS))); } -int +void pci_lintr_request(struct pci_devinst *pi) { struct businfo *bi; struct slotinfo *si; - int bestpin, bestcount, irq, pin; + int bestpin, bestcount, pin; bi = pci_businfo[pi->pi_bus]; assert(bi != NULL); /* - * First, allocate a pin from our slot. + * Just allocate a pin from our slot. The pin will be + * assigned IRQs later when interrupts are routed. */ si = &bi->slotinfo[pi->pi_slot]; bestpin = 0; @@ -1370,26 +1434,43 @@ pci_lintr_request(struct pci_devinst *pi } } - /* - * Attempt to allocate an I/O APIC pin for this intpin. If - * 8259A support is added we will need a separate field to - * assign the intpin to an input pin on the PCI interrupt - * router. - */ - if (si->si_intpins[bestpin].ii_count == 0) { - irq = ioapic_pci_alloc_irq(); - if (irq < 0) - return (-1); - si->si_intpins[bestpin].ii_ioapic_irq = irq; - } else - irq = si->si_intpins[bestpin].ii_ioapic_irq; si->si_intpins[bestpin].ii_count++; - pi->pi_lintr.pin = bestpin + 1; - pi->pi_lintr.ioapic_irq = irq; - pci_set_cfgdata8(pi, PCIR_INTLINE, irq); pci_set_cfgdata8(pi, PCIR_INTPIN, bestpin + 1); - return (0); +} + +static void +pci_lintr_route(struct pci_devinst *pi) +{ + struct businfo *bi; + struct intxinfo *ii; + + if (pi->pi_lintr.pin == 0) + return; + + bi = pci_businfo[pi->pi_bus]; + assert(bi != NULL); + ii = &bi->slotinfo[pi->pi_slot].si_intpins[pi->pi_lintr.pin - 1]; + + /* + * Attempt to allocate an I/O APIC pin for this intpin if one + * is not yet assigned. + */ + if (ii->ii_ioapic_irq == 0) + ii->ii_ioapic_irq = ioapic_pci_alloc_irq(); + assert(ii->ii_ioapic_irq > 0); + + /* + * Attempt to allocate a PIRQ pin for this intpin if one is + * not yet assigned. + */ + if (ii->ii_pirq_pin == 0) + ii->ii_pirq_pin = pirq_alloc_pin(pi->pi_vmctx); + assert(ii->ii_pirq_pin > 0); + + pi->pi_lintr.ioapic_irq = ii->ii_ioapic_irq; + pi->pi_lintr.pirq_pin = ii->ii_pirq_pin; + pci_set_cfgdata8(pi, PCIR_INTLINE, pirq_irq(ii->ii_pirq_pin)); } void @@ -1402,8 +1483,7 @@ pci_lintr_assert(struct pci_devinst *pi) if (pi->pi_lintr.state == IDLE) { if (pci_lintr_permitted(pi)) { pi->pi_lintr.state = ASSERTED; - vm_ioapic_assert_irq(pi->pi_vmctx, - pi->pi_lintr.ioapic_irq); + pci_irq_assert(pi); } else pi->pi_lintr.state = PENDING; } @@ -1419,7 +1499,7 @@ pci_lintr_deassert(struct pci_devinst *p pthread_mutex_lock(&pi->pi_lintr.lock); if (pi->pi_lintr.state == ASSERTED) { pi->pi_lintr.state = IDLE; - vm_ioapic_deassert_irq(pi->pi_vmctx, pi->pi_lintr.ioapic_irq); + pci_irq_deassert(pi); } else if (pi->pi_lintr.state == PENDING) pi->pi_lintr.state = IDLE; pthread_mutex_unlock(&pi->pi_lintr.lock); @@ -1431,11 +1511,11 @@ pci_lintr_update(struct pci_devinst *pi) pthread_mutex_lock(&pi->pi_lintr.lock); if (pi->pi_lintr.state == ASSERTED && !pci_lintr_permitted(pi)) { - vm_ioapic_deassert_irq(pi->pi_vmctx, pi->pi_lintr.ioapic_irq); + pci_irq_deassert(pi); pi->pi_lintr.state = PENDING; } else if (pi->pi_lintr.state == PENDING && pci_lintr_permitted(pi)) { pi->pi_lintr.state = ASSERTED; - vm_ioapic_assert_irq(pi->pi_vmctx, pi->pi_lintr.ioapic_irq); + pci_irq_assert(pi); } pthread_mutex_unlock(&pi->pi_lintr.lock); } @@ -1475,7 +1555,8 @@ pci_walk_lintr(int bus, pci_lintr_cb cb, for (pin = 0; pin < 4; pin++) { ii = &si->si_intpins[pin]; if (ii->ii_count != 0) - cb(bus, slot, pin + 1, ii->ii_ioapic_irq, arg); + cb(bus, slot, pin + 1, ii->ii_pirq_pin, + ii->ii_ioapic_irq, arg); } } } @@ -1772,20 +1853,6 @@ INOUT_PORT(pci_cfgdata, CONF1_DATA_PORT+ INOUT_PORT(pci_cfgdata, CONF1_DATA_PORT+2, IOPORT_F_INOUT, pci_emul_cfgdata); INOUT_PORT(pci_cfgdata, CONF1_DATA_PORT+3, IOPORT_F_INOUT, pci_emul_cfgdata); -/* - * I/O ports to configure PCI IRQ routing. We ignore all writes to it. - */ -static int -pci_irq_port_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, - uint32_t *eax, void *arg) -{ - assert(in == 0); - return (0); -} -INOUT_PORT(pci_irq, 0xC00, IOPORT_F_OUT, pci_irq_port_handler); -INOUT_PORT(pci_irq, 0xC01, IOPORT_F_OUT, pci_irq_port_handler); -SYSRES_IO(0xC00, 2); - #define PCI_EMUL_TEST #ifdef PCI_EMUL_TEST /* Modified: stable/10/usr.sbin/bhyve/pci_emul.h ============================================================================== --- stable/10/usr.sbin/bhyve/pci_emul.h Tue Jul 22 02:02:39 2014 (r268971) +++ stable/10/usr.sbin/bhyve/pci_emul.h Tue Jul 22 03:14:37 2014 (r268972) @@ -120,6 +120,7 @@ struct pci_devinst { struct { int8_t pin; enum lintr_stat state; + int pirq_pin; int ioapic_irq; pthread_mutex_t lock; } pi_lintr; @@ -200,7 +201,8 @@ struct pciecap { uint16_t slot_status2; } __packed; -typedef void (*pci_lintr_cb)(int b, int s, int pin, int ioapic_irq, void *arg); +typedef void (*pci_lintr_cb)(int b, int s, int pin, int pirq_pin, + int ioapic_irq, void *arg); int init_pci(struct vmctx *ctx); void msicap_cfgwrite(struct pci_devinst *pi, int capoff, int offset, @@ -218,7 +220,7 @@ void pci_generate_msi(struct pci_devinst void pci_generate_msix(struct pci_devinst *pi, int msgnum); void pci_lintr_assert(struct pci_devinst *pi); void pci_lintr_deassert(struct pci_devinst *pi); -int pci_lintr_request(struct pci_devinst *pi); +void pci_lintr_request(struct pci_devinst *pi); int pci_msi_enabled(struct pci_devinst *pi); int pci_msix_enabled(struct pci_devinst *pi); int pci_msix_table_bar(struct pci_devinst *pi); Copied: stable/10/usr.sbin/bhyve/pci_irq.c (from r266125, head/usr.sbin/bhyve/pci_irq.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/bhyve/pci_irq.c Tue Jul 22 03:14:37 2014 (r268972, copy of r266125, head/usr.sbin/bhyve/pci_irq.c) @@ -0,0 +1,349 @@ +/*- + * Copyright (c) 2014 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. + */ + + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "acpi.h" +#include "inout.h" +#include "pci_emul.h" +#include "pci_irq.h" +#include "pci_lpc.h" + +/* + * Implement an 8 pin PCI interrupt router compatible with the router + * present on Intel's ICH10 chip. + */ + +/* Fields in each PIRQ register. */ +#define PIRQ_DIS 0x80 +#define PIRQ_IRQ 0x0f + +/* Only IRQs 3-7, 9-12, and 14-15 are permitted. */ +#define PERMITTED_IRQS 0xdef8 +#define IRQ_PERMITTED(irq) (((1U << (irq)) & PERMITTED_IRQS) != 0) + +/* IRQ count to disable an IRQ. */ +#define IRQ_DISABLED 0xff + +static struct pirq { + uint8_t reg; + int use_count; + int active_count; + pthread_mutex_t lock; +} pirqs[8]; + +static u_char irq_counts[16]; +static int pirq_cold = 1; + +/* + * Returns true if this pin is enabled with a valid IRQ. Setting the + * register to a reserved IRQ causes interrupts to not be asserted as + * if the pin was disabled. + */ +static bool +pirq_valid_irq(int reg) +{ + + if (reg & PIRQ_DIS) + return (false); + return (IRQ_PERMITTED(reg & PIRQ_IRQ)); +} + +uint8_t +pirq_read(int pin) +{ + + assert(pin > 0 && pin <= nitems(pirqs)); + return (pirqs[pin - 1].reg); +} + +void +pirq_write(struct vmctx *ctx, int pin, uint8_t val) +{ + struct pirq *pirq; + + assert(pin > 0 && pin <= nitems(pirqs)); + pirq = &pirqs[pin - 1]; + pthread_mutex_lock(&pirq->lock); + if (pirq->reg != (val & (PIRQ_DIS | PIRQ_IRQ))) { + if (pirq->active_count != 0 && pirq_valid_irq(pirq->reg)) + vm_isa_deassert_irq(ctx, pirq->reg & PIRQ_IRQ, -1); + pirq->reg = val & (PIRQ_DIS | PIRQ_IRQ); + if (pirq->active_count != 0 && pirq_valid_irq(pirq->reg)) + vm_isa_assert_irq(ctx, pirq->reg & PIRQ_IRQ, -1); + } + pthread_mutex_unlock(&pirq->lock); +} + +void +pci_irq_reserve(int irq) +{ + + assert(irq < nitems(irq_counts)); + assert(pirq_cold); + assert(irq_counts[irq] == 0 || irq_counts[irq] == IRQ_DISABLED); + irq_counts[irq] = IRQ_DISABLED; +} + +void +pci_irq_use(int irq) +{ + + assert(irq < nitems(irq_counts)); + assert(pirq_cold); + if (irq_counts[irq] != IRQ_DISABLED) + irq_counts[irq]++; +} + +void +pci_irq_init(struct vmctx *ctx) +{ + int i; + + for (i = 0; i < nitems(pirqs); i++) { + pirqs[i].reg = PIRQ_DIS; + pirqs[i].use_count = 0; + pirqs[i].active_count = 0; + pthread_mutex_init(&pirqs[i].lock, NULL); + } + for (i = 0; i < nitems(irq_counts); i++) { + if (IRQ_PERMITTED(i)) + irq_counts[i] = 0; + else + irq_counts[i] = IRQ_DISABLED; + } +} + +void +pci_irq_assert(struct pci_devinst *pi) +{ + struct pirq *pirq; + + if (pi->pi_lintr.pirq_pin > 0) { + assert(pi->pi_lintr.pirq_pin <= nitems(pirqs)); + pirq = &pirqs[pi->pi_lintr.pirq_pin - 1]; + pthread_mutex_lock(&pirq->lock); + pirq->active_count++; + if (pirq->active_count == 1 && pirq_valid_irq(pirq->reg)) { + vm_isa_assert_irq(pi->pi_vmctx, pirq->reg & PIRQ_IRQ, + pi->pi_lintr.ioapic_irq); + pthread_mutex_unlock(&pirq->lock); + return; + } + pthread_mutex_unlock(&pirq->lock); + } + vm_ioapic_assert_irq(pi->pi_vmctx, pi->pi_lintr.ioapic_irq); +} + +void +pci_irq_deassert(struct pci_devinst *pi) +{ + struct pirq *pirq; + + if (pi->pi_lintr.pirq_pin > 0) { + assert(pi->pi_lintr.pirq_pin <= nitems(pirqs)); + pirq = &pirqs[pi->pi_lintr.pirq_pin - 1]; + pthread_mutex_lock(&pirq->lock); + pirq->active_count--; + if (pirq->active_count == 0 && pirq_valid_irq(pirq->reg)) { + vm_isa_deassert_irq(pi->pi_vmctx, pirq->reg & PIRQ_IRQ, + pi->pi_lintr.ioapic_irq); + pthread_mutex_unlock(&pirq->lock); + return; + } + pthread_mutex_unlock(&pirq->lock); + } + vm_ioapic_deassert_irq(pi->pi_vmctx, pi->pi_lintr.ioapic_irq); +} + +int +pirq_alloc_pin(struct vmctx *ctx) +{ + int best_count, best_irq, best_pin, irq, pin; + + pirq_cold = 1; + + /* First, find the least-used PIRQ pin. */ + best_pin = 0; + best_count = pirqs[0].use_count; + for (pin = 1; pin < nitems(pirqs); pin++) { + if (pirqs[pin].use_count < best_count) { + best_pin = pin; + best_count = pirqs[pin].use_count; + } + } + pirqs[best_pin].use_count++; + + /* Second, route this pin to an IRQ. */ + if (pirqs[best_pin].reg == PIRQ_DIS) { + best_irq = -1; + best_count = 0; + for (irq = 0; irq < nitems(irq_counts); irq++) { + if (irq_counts[irq] == IRQ_DISABLED) + continue; + if (best_irq == -1 || irq_counts[irq] < best_count) { + best_irq = irq; + best_count = irq_counts[irq]; + } + } + assert(best_irq != 0); + irq_counts[best_irq]++; + pirqs[best_pin].reg = best_irq; + vm_isa_set_irq_trigger(ctx, best_irq, LEVEL_TRIGGER); + } + + return (best_pin + 1); +} + +int +pirq_irq(int pin) +{ + + if (pin == -1) + return (255); + assert(pin > 0 && pin <= nitems(pirqs)); + return (pirqs[pin - 1].reg & PIRQ_IRQ); +} + +/* XXX: Generate $PIR table. */ + +static void +pirq_dsdt(void) +{ + char *irq_prs, *old; + int irq, pin; + + irq_prs = NULL; + for (irq = 0; irq < nitems(irq_counts); irq++) { + if (!IRQ_PERMITTED(irq)) + continue; + if (irq_prs == NULL) + asprintf(&irq_prs, "%d", irq); + else { + old = irq_prs; + asprintf(&irq_prs, "%s,%d", old, irq); + free(old); + } + } + + /* + * A helper method to validate a link register's value. This + * duplicates pirq_valid_irq(). + */ + dsdt_line(""); + dsdt_line("Method (PIRV, 1, NotSerialized)"); + dsdt_line("{"); + dsdt_line(" If (And (Arg0, 0x%02X))", PIRQ_DIS); + dsdt_line(" {"); + dsdt_line(" Return (0x00)"); + dsdt_line(" }"); + dsdt_line(" And (Arg0, 0x%02X, Local0)", PIRQ_IRQ); + dsdt_line(" If (LLess (Local0, 0x03))"); + dsdt_line(" {"); + dsdt_line(" Return (0x00)"); + dsdt_line(" }"); + dsdt_line(" If (LEqual (Local0, 0x08))"); + dsdt_line(" {"); + dsdt_line(" Return (0x00)"); + dsdt_line(" }"); + dsdt_line(" If (LEqual (Local0, 0x0D))"); + dsdt_line(" {"); + dsdt_line(" Return (0x00)"); + dsdt_line(" }"); + dsdt_line(" Return (0x01)"); + dsdt_line("}"); + + for (pin = 0; pin < nitems(pirqs); pin++) { + dsdt_line(""); + dsdt_line("Device (LNK%c)", 'A' + pin); + dsdt_line("{"); + dsdt_line(" Name (_HID, EisaId (\"PNP0C0F\"))"); + dsdt_line(" Name (_UID, 0x%02X)", pin + 1); + dsdt_line(" Method (_STA, 0, NotSerialized)"); + dsdt_line(" {"); + dsdt_line(" If (PIRV (PIR%c))", 'A' + pin); + dsdt_line(" {"); + dsdt_line(" Return (0x0B)"); + dsdt_line(" }"); + dsdt_line(" Else"); + dsdt_line(" {"); + dsdt_line(" Return (0x09)"); + dsdt_line(" }"); + dsdt_line(" }"); + dsdt_line(" Name (_PRS, ResourceTemplate ()"); + dsdt_line(" {"); + dsdt_line(" IRQ (Level, ActiveLow, Shared, )"); + dsdt_line(" {%s}", irq_prs); + dsdt_line(" })"); + dsdt_line(" Name (CB%02X, ResourceTemplate ()", pin + 1); + dsdt_line(" {"); + dsdt_line(" IRQ (Level, ActiveLow, Shared, )"); + dsdt_line(" {}"); + dsdt_line(" })"); + dsdt_line(" CreateWordField (CB%02X, 0x01, CIR%c)", + pin + 1, 'A' + pin); + dsdt_line(" Method (_CRS, 0, NotSerialized)"); + dsdt_line(" {"); + dsdt_line(" And (PIR%c, 0x%02X, Local0)", 'A' + pin, + PIRQ_DIS | PIRQ_IRQ); + dsdt_line(" If (PIRV (Local0))"); + dsdt_line(" {"); + dsdt_line(" ShiftLeft (0x01, Local0, CIR%c)", 'A' + pin); + dsdt_line(" }"); + dsdt_line(" Else"); + dsdt_line(" {"); + dsdt_line(" Store (0x00, CIR%c)", 'A' + pin); + dsdt_line(" }"); + dsdt_line(" Return (CB%02X)", pin + 1); + dsdt_line(" }"); + dsdt_line(" Method (_DIS, 0, NotSerialized)"); + dsdt_line(" {"); + dsdt_line(" Store (0x80, PIR%c)", 'A' + pin); + dsdt_line(" }"); + dsdt_line(" Method (_SRS, 1, NotSerialized)"); + dsdt_line(" {"); + dsdt_line(" CreateWordField (Arg0, 0x01, SIR%c)", 'A' + pin); + dsdt_line(" FindSetRightBit (SIR%c, Local0)", 'A' + pin); + dsdt_line(" Store (Decrement (Local0), PIR%c)", 'A' + pin); + dsdt_line(" }"); + dsdt_line("}"); + } + free(irq_prs); +} +LPC_DSDT(pirq_dsdt); Copied: stable/10/usr.sbin/bhyve/pci_irq.h (from r266125, head/usr.sbin/bhyve/pci_irq.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/usr.sbin/bhyve/pci_irq.h Tue Jul 22 03:14:37 2014 (r268972, copy of r266125, head/usr.sbin/bhyve/pci_irq.h) @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2014 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$ + */ + +#ifndef __PCI_IRQ_H__ +#define __PCI_IRQ_H__ + +struct pci_devinst; + +void pci_irq_assert(struct pci_devinst *pi); +void pci_irq_deassert(struct pci_devinst *pi); +void pci_irq_init(struct vmctx *ctx); +void pci_irq_reserve(int irq); +void pci_irq_use(int irq); +int pirq_alloc_pin(struct vmctx *ctx); +int pirq_irq(int pin); +uint8_t pirq_read(int pin); +void pirq_write(struct vmctx *ctx, int pin, uint8_t val); + +#endif Modified: stable/10/usr.sbin/bhyve/pci_lpc.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_lpc.c Tue Jul 22 02:02:39 2014 (r268971) +++ stable/10/usr.sbin/bhyve/pci_lpc.c Tue Jul 22 03:14:37 2014 (r268972) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include "acpi.h" #include "inout.h" #include "pci_emul.h" +#include "pci_irq.h" #include "pci_lpc.h" #include "uart_emul.h" @@ -173,6 +174,7 @@ lpc_init(void) "LPC device %s\n", name); return (-1); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 03:59:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2EA10959; Tue, 22 Jul 2014 03:59:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19EF9252E; Tue, 22 Jul 2014 03:59:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M3xGX3029742; Tue, 22 Jul 2014 03:59:16 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M3xFB9029733; Tue, 22 Jul 2014 03:59:15 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201407220359.s6M3xFB9029733@svn.freebsd.org> From: Ruslan Bukin Date: Tue, 22 Jul 2014 03:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268973 - in head/sys/arm/freescale: imx vybrid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 03:59:16 -0000 Author: br Date: Tue Jul 22 03:59:14 2014 New Revision: 268973 URL: http://svnweb.freebsd.org/changeset/base/268973 Log: Rename i.MX I2C driver file. Added: head/sys/arm/freescale/imx/imx_i2c.c - copied unchanged from r268972, head/sys/arm/freescale/imx/i2c.c Deleted: head/sys/arm/freescale/imx/i2c.c Modified: head/sys/arm/freescale/imx/files.imx51 head/sys/arm/freescale/imx/files.imx53 head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/vybrid/vf_i2c.c Modified: head/sys/arm/freescale/imx/files.imx51 ============================================================================== --- head/sys/arm/freescale/imx/files.imx51 Tue Jul 22 03:14:37 2014 (r268972) +++ head/sys/arm/freescale/imx/files.imx51 Tue Jul 22 03:59:14 2014 (r268973) @@ -44,7 +44,7 @@ dev/usb/controller/ehci_imx.c optional arm/freescale/imx/imx_wdog.c optional imxwdt # i2c -arm/freescale/imx/i2c.c optional fsliic +arm/freescale/imx/imx_i2c.c optional fsliic # IPU - Image Processing Unit (frame buffer also) arm/freescale/imx/imx51_ipuv3.c optional sc Modified: head/sys/arm/freescale/imx/files.imx53 ============================================================================== --- head/sys/arm/freescale/imx/files.imx53 Tue Jul 22 03:14:37 2014 (r268972) +++ head/sys/arm/freescale/imx/files.imx53 Tue Jul 22 03:59:14 2014 (r268973) @@ -47,7 +47,7 @@ dev/usb/controller/ehci_imx.c optional arm/freescale/imx/imx_wdog.c optional imxwdt # i2c -arm/freescale/imx/i2c.c optional fsliic +arm/freescale/imx/imx_i2c.c optional fsliic # IPU - Image Processing Unit (frame buffer also) arm/freescale/imx/imx51_ipuv3.c optional sc Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Tue Jul 22 03:14:37 2014 (r268972) +++ head/sys/arm/freescale/imx/files.imx6 Tue Jul 22 03:59:14 2014 (r268973) @@ -52,5 +52,5 @@ arm/freescale/imx/imx6_usbphy.c optiona # #arm/freescale/imx/imx51_iomux.c optional iomux #dev/ata/chipsets/ata-fsl.c optional imxata -#arm/freescale/imx/i2c.c optional fsliic +#arm/freescale/imx/imx_i2c.c optional fsliic #arm/freescale/imx/imx51_ipuv3.c optional sc Copied: head/sys/arm/freescale/imx/imx_i2c.c (from r268972, head/sys/arm/freescale/imx/i2c.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx_i2c.c Tue Jul 22 03:59:14 2014 (r268973, copy of r268972, head/sys/arm/freescale/imx/i2c.c) @@ -0,0 +1,495 @@ +/*- + * Copyright (C) 2008-2009 Semihalf, Michal Hajduk + * Copyright (c) 2012, 2013 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by Oleksandr Rybalko + * under sponsorship from the FreeBSD Foundation. + * + * 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 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 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include "iicbus_if.h" + +#include +#include +#include +#include + +#define I2C_ADDR_REG 0x00 /* I2C slave address register */ +#define I2C_FDR_REG 0x04 /* I2C frequency divider register */ +#define I2C_CONTROL_REG 0x08 /* I2C control register */ +#define I2C_STATUS_REG 0x0C /* I2C status register */ +#define I2C_DATA_REG 0x10 /* I2C data register */ +#define I2C_DFSRR_REG 0x14 /* I2C Digital Filter Sampling rate */ + +#define I2CCR_MEN (1 << 7) /* Module enable */ +#define I2CCR_MSTA (1 << 5) /* Master/slave mode */ +#define I2CCR_MTX (1 << 4) /* Transmit/receive mode */ +#define I2CCR_TXAK (1 << 3) /* Transfer acknowledge */ +#define I2CCR_RSTA (1 << 2) /* Repeated START */ + +#define I2CSR_MCF (1 << 7) /* Data transfer */ +#define I2CSR_MASS (1 << 6) /* Addressed as a slave */ +#define I2CSR_MBB (1 << 5) /* Bus busy */ +#define I2CSR_MAL (1 << 4) /* Arbitration lost */ +#define I2CSR_SRW (1 << 2) /* Slave read/write */ +#define I2CSR_MIF (1 << 1) /* Module interrupt */ +#define I2CSR_RXAK (1 << 0) /* Received acknowledge */ + +#define I2C_BAUD_RATE_FAST 0x31 +#define I2C_BAUD_RATE_DEF 0x3F +#define I2C_DFSSR_DIV 0x10 + +#ifdef DEBUG +#define debugf(fmt, args...) do { printf("%s(): ", __func__); \ + printf(fmt,##args); } while (0) +#else +#define debugf(fmt, args...) +#endif + +struct i2c_softc { + device_t dev; + device_t iicbus; + struct resource *res; + struct mtx mutex; + int rid; + bus_space_handle_t bsh; + bus_space_tag_t bst; +}; + +static phandle_t i2c_get_node(device_t, device_t); +static int i2c_probe(device_t); +static int i2c_attach(device_t); + +static int i2c_repeated_start(device_t, u_char, int); +static int i2c_start(device_t, u_char, int); +static int i2c_stop(device_t); +static int i2c_reset(device_t, u_char, u_char, u_char *); +static int i2c_read(device_t, char *, int, int *, int, int); +static int i2c_write(device_t, const char *, int, int *, int); + +static device_method_t i2c_methods[] = { + DEVMETHOD(device_probe, i2c_probe), + DEVMETHOD(device_attach, i2c_attach), + + /* OFW methods */ + DEVMETHOD(ofw_bus_get_node, i2c_get_node), + + DEVMETHOD(iicbus_callback, iicbus_null_callback), + DEVMETHOD(iicbus_repeated_start, i2c_repeated_start), + DEVMETHOD(iicbus_start, i2c_start), + DEVMETHOD(iicbus_stop, i2c_stop), + DEVMETHOD(iicbus_reset, i2c_reset), + DEVMETHOD(iicbus_read, i2c_read), + DEVMETHOD(iicbus_write, i2c_write), + DEVMETHOD(iicbus_transfer, iicbus_transfer_gen), + + { 0, 0 } +}; + +static driver_t i2c_driver = { + "iichb", + i2c_methods, + sizeof(struct i2c_softc), +}; +static devclass_t i2c_devclass; + +DRIVER_MODULE(i2c, simplebus, i2c_driver, i2c_devclass, 0, 0); +DRIVER_MODULE(iicbus, i2c, iicbus_driver, iicbus_devclass, 0, 0); + +static phandle_t +i2c_get_node(device_t bus, device_t dev) +{ + /* + * Share controller node with iicbus device + */ + return ofw_bus_get_node(bus); +} + +static __inline void +i2c_write_reg(struct i2c_softc *sc, bus_size_t off, uint8_t val) +{ + + bus_space_write_1(sc->bst, sc->bsh, off, val); +} + +static __inline uint8_t +i2c_read_reg(struct i2c_softc *sc, bus_size_t off) +{ + + return (bus_space_read_1(sc->bst, sc->bsh, off)); +} + +static __inline void +i2c_flag_set(struct i2c_softc *sc, bus_size_t off, uint8_t mask) +{ + uint8_t status; + + status = i2c_read_reg(sc, off); + status |= mask; + i2c_write_reg(sc, off, status); +} + +/* Wait for transfer interrupt flag */ +static int +wait_for_iif(struct i2c_softc *sc) +{ + int retry; + + retry = 1000; + while (retry --) { + if (i2c_read_reg(sc, I2C_STATUS_REG) & I2CSR_MIF) + return (IIC_NOERR); + DELAY(10); + } + + return (IIC_ETIMEOUT); +} + +/* Wait for free bus */ +static int +wait_for_nibb(struct i2c_softc *sc) +{ + int retry; + + retry = 1000; + while (retry --) { + if ((i2c_read_reg(sc, I2C_STATUS_REG) & I2CSR_MBB) == 0) + return (IIC_NOERR); + DELAY(10); + } + + return (IIC_ETIMEOUT); +} + +/* Wait for transfer complete+interrupt flag */ +static int +wait_for_icf(struct i2c_softc *sc) +{ + int retry; + + retry = 1000; + while (retry --) { + + if ((i2c_read_reg(sc, I2C_STATUS_REG) & + (I2CSR_MCF|I2CSR_MIF)) == (I2CSR_MCF|I2CSR_MIF)) + return (IIC_NOERR); + DELAY(10); + } + + return (IIC_ETIMEOUT); +} + +static int +i2c_probe(device_t dev) +{ + struct i2c_softc *sc; + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "fsl,imx-i2c")) + return (ENXIO); + + sc = device_get_softc(dev); + sc->rid = 0; + + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->rid, + RF_ACTIVE); + if (sc->res == NULL) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + sc->bst = rman_get_bustag(sc->res); + sc->bsh = rman_get_bushandle(sc->res); + + /* Enable I2C */ + i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN); + bus_release_resource(dev, SYS_RES_MEMORY, sc->rid, sc->res); + device_set_desc(dev, "I2C bus controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +i2c_attach(device_t dev) +{ + struct i2c_softc *sc; + + sc = device_get_softc(dev); + sc->dev = dev; + sc->rid = 0; + + mtx_init(&sc->mutex, device_get_nameunit(dev), "I2C", MTX_DEF); + + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->rid, + RF_ACTIVE); + if (sc->res == NULL) { + device_printf(dev, "could not allocate resources"); + mtx_destroy(&sc->mutex); + return (ENXIO); + } + + sc->bst = rman_get_bustag(sc->res); + sc->bsh = rman_get_bushandle(sc->res); + + sc->iicbus = device_add_child(dev, "iicbus", -1); + if (sc->iicbus == NULL) { + device_printf(dev, "could not add iicbus child"); + mtx_destroy(&sc->mutex); + return (ENXIO); + } + + bus_generic_attach(dev); + return (IIC_NOERR); +} + +static int +i2c_repeated_start(device_t dev, u_char slave, int timeout) +{ + struct i2c_softc *sc; + int error; + + sc = device_get_softc(dev); + + mtx_lock(&sc->mutex); + + i2c_write_reg(sc, I2C_ADDR_REG, slave); + if ((i2c_read_reg(sc, I2C_STATUS_REG) & I2CSR_MBB) == 0) { + mtx_unlock(&sc->mutex); + return (IIC_EBUSBSY); + } + + /* Set repeated start condition */ + DELAY(10); + i2c_flag_set(sc, I2C_CONTROL_REG, I2CCR_RSTA); + DELAY(10); + /* Clear status */ + i2c_write_reg(sc, I2C_STATUS_REG, 0x0); + /* Write target address - LSB is R/W bit */ + i2c_write_reg(sc, I2C_DATA_REG, slave); + + error = wait_for_iif(sc); + + /* Clear status */ + i2c_write_reg(sc, I2C_STATUS_REG, 0x0); + + mtx_unlock(&sc->mutex); + + if (error) + return (error); + + return (IIC_NOERR); +} + +static int +i2c_start(device_t dev, u_char slave, int timeout) +{ + struct i2c_softc *sc; + int error; + + sc = device_get_softc(dev); + + mtx_lock(&sc->mutex); + i2c_write_reg(sc, I2C_ADDR_REG, slave); + if (i2c_read_reg(sc, I2C_STATUS_REG) & I2CSR_MBB) { + mtx_unlock(&sc->mutex); + return (IIC_EBUSBSY); + } + + /* Set start condition */ + i2c_write_reg(sc, I2C_CONTROL_REG, + I2CCR_MEN | I2CCR_MSTA | I2CCR_TXAK); + DELAY(100); + i2c_write_reg(sc, I2C_CONTROL_REG, + I2CCR_MEN | I2CCR_MSTA | I2CCR_MTX | I2CCR_TXAK); + /* Clear status */ + i2c_write_reg(sc, I2C_STATUS_REG, 0x0); + /* Write target address - LSB is R/W bit */ + i2c_write_reg(sc, I2C_DATA_REG, slave); + + error = wait_for_iif(sc); + + mtx_unlock(&sc->mutex); + if (error) + return (error); + + return (IIC_NOERR); +} + + +static int +i2c_stop(device_t dev) +{ + struct i2c_softc *sc; + + sc = device_get_softc(dev); + mtx_lock(&sc->mutex); + i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN | I2CCR_TXAK); + DELAY(100); + /* Reset controller if bus still busy after STOP */ + if (wait_for_nibb(sc) == IIC_ETIMEOUT) { + i2c_write_reg(sc, I2C_CONTROL_REG, 0); + DELAY(1000); + i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN | I2CCR_TXAK); + + i2c_write_reg(sc, I2C_STATUS_REG, 0x0); + } + mtx_unlock(&sc->mutex); + + return (IIC_NOERR); +} + +static int +i2c_reset(device_t dev, u_char speed, u_char addr, u_char *oldadr) +{ + struct i2c_softc *sc; + uint8_t baud_rate; + + sc = device_get_softc(dev); + + switch (speed) { + case IIC_FAST: + baud_rate = I2C_BAUD_RATE_FAST; + break; + case IIC_SLOW: + case IIC_UNKNOWN: + case IIC_FASTEST: + default: + baud_rate = I2C_BAUD_RATE_DEF; + break; + } + + mtx_lock(&sc->mutex); + i2c_write_reg(sc, I2C_CONTROL_REG, 0x0); + i2c_write_reg(sc, I2C_STATUS_REG, 0x0); + DELAY(1000); + + i2c_write_reg(sc, I2C_FDR_REG, 20); + i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN); + DELAY(1000); + i2c_write_reg(sc, I2C_STATUS_REG, 0x0); + mtx_unlock(&sc->mutex); + + return (IIC_NOERR); +} + +static int +i2c_read(device_t dev, char *buf, int len, int *read, int last, int delay) +{ + struct i2c_softc *sc; + int error, reg; + + sc = device_get_softc(dev); + *read = 0; + + mtx_lock(&sc->mutex); + + if (len) { + if (len == 1) + i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN | + I2CCR_MSTA | I2CCR_TXAK); + + else + i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN | + I2CCR_MSTA); + + /* dummy read */ + i2c_read_reg(sc, I2C_DATA_REG); + DELAY(1000); + } + + while (*read < len) { + error = wait_for_icf(sc); + if (error) { + mtx_unlock(&sc->mutex); + return (error); + } + i2c_write_reg(sc, I2C_STATUS_REG, 0x0); + if ((*read == len - 2) && last) { + /* NO ACK on last byte */ + i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN | + I2CCR_MSTA | I2CCR_TXAK); + } + + if ((*read == len - 1) && last) { + /* Transfer done, remove master bit */ + i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN | + I2CCR_TXAK); + } + + reg = i2c_read_reg(sc, I2C_DATA_REG); + *buf++ = reg; + (*read)++; + } + mtx_unlock(&sc->mutex); + + return (IIC_NOERR); +} + +static int +i2c_write(device_t dev, const char *buf, int len, int *sent, int timeout) +{ + struct i2c_softc *sc; + int error; + + sc = device_get_softc(dev); + *sent = 0; + + mtx_lock(&sc->mutex); + while (*sent < len) { + i2c_write_reg(sc, I2C_STATUS_REG, 0x0); + i2c_write_reg(sc, I2C_DATA_REG, *buf++); + + error = wait_for_iif(sc); + if (error) { + mtx_unlock(&sc->mutex); + return (error); + } + + (*sent)++; + } + mtx_unlock(&sc->mutex); + + return (IIC_NOERR); +} Modified: head/sys/arm/freescale/vybrid/vf_i2c.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_i2c.c Tue Jul 22 03:14:37 2014 (r268972) +++ head/sys/arm/freescale/vybrid/vf_i2c.c Tue Jul 22 03:59:14 2014 (r268973) @@ -30,7 +30,7 @@ */ /* - * This driver is based on the I2C driver for IMX (imx/i2c.c). + * This driver is based on the I2C driver for i.MX */ #include From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 04:37:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42E0EED6; Tue, 22 Jul 2014 04:37:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FC1D282E; Tue, 22 Jul 2014 04:37:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M4bmXd047650; Tue, 22 Jul 2014 04:37:48 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M4blHu047648; Tue, 22 Jul 2014 04:37:47 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201407220437.s6M4blHu047648@svn.freebsd.org> From: Sean Bruno Date: Tue, 22 Jul 2014 04:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268974 - in head/sys/boot: efi/libefi i386/libi386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 04:37:48 -0000 Author: sbruno Date: Tue Jul 22 04:37:47 2014 New Revision: 268974 URL: http://svnweb.freebsd.org/changeset/base/268974 Log: Supress clang warning for FreeBSD printf %b and %D formats MFC after: 2 weeks Modified: head/sys/boot/efi/libefi/Makefile head/sys/boot/i386/libi386/Makefile Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Tue Jul 22 03:59:14 2014 (r268973) +++ head/sys/boot/efi/libefi/Makefile Tue Jul 22 04:37:47 2014 (r268974) @@ -16,4 +16,8 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li # Pick up the bootstrap header for some interface items CFLAGS+= -I${.CURDIR}/../../common + +# Suppress warning from clang for FreeBSD %b and %D formats +CFLAGS+= -fformat-extensions + .include Modified: head/sys/boot/i386/libi386/Makefile ============================================================================== --- head/sys/boot/i386/libi386/Makefile Tue Jul 22 03:59:14 2014 (r268973) +++ head/sys/boot/i386/libi386/Makefile Tue Jul 22 04:37:47 2014 (r268974) @@ -55,6 +55,9 @@ CFLAGS+= -I${.CURDIR}/../../common -I${. # the location of libstand CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +# Suppress warning from clang for FreeBSD %b and %D formats +CFLAGS+= -fformat-extensions + .if ${MACHINE_CPUARCH} == "amd64" CLEANFILES+= machine machine: From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 04:38:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C1FFAF; Tue, 22 Jul 2014 04:38:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED5772838; Tue, 22 Jul 2014 04:38:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M4cSxk047783; Tue, 22 Jul 2014 04:38:28 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M4cSSr047782; Tue, 22 Jul 2014 04:38:28 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201407220438.s6M4cSSr047782@svn.freebsd.org> From: Sean Bruno Date: Tue, 22 Jul 2014 04:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268975 - head/sys/boot/amd64/boot1.efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 04:38:29 -0000 Author: sbruno Date: Tue Jul 22 04:38:28 2014 New Revision: 268975 URL: http://svnweb.freebsd.org/changeset/base/268975 Log: Remove boot1.efi during clean target. Modified: head/sys/boot/amd64/boot1.efi/Makefile Modified: head/sys/boot/amd64/boot1.efi/Makefile ============================================================================== --- head/sys/boot/amd64/boot1.efi/Makefile Tue Jul 22 04:37:47 2014 (r268974) +++ head/sys/boot/amd64/boot1.efi/Makefile Tue Jul 22 04:38:28 2014 (r268975) @@ -77,7 +77,7 @@ CLEANFILES= boot1.efifat beforedepend ${OBJS}: machine x86 -CLEANFILES+= machine x86 +CLEANFILES+= machine x86 boot1.efi machine: ln -sf ${.CURDIR}/../../../amd64/include machine From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 04:39:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB2441FF; Tue, 22 Jul 2014 04:39:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5A2E2846; Tue, 22 Jul 2014 04:39:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M4dI5g047912; Tue, 22 Jul 2014 04:39:18 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M4dHeV047899; Tue, 22 Jul 2014 04:39:17 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201407220439.s6M4dHeV047899@svn.freebsd.org> From: John Baldwin Date: Tue, 22 Jul 2014 04:39:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268976 - in stable/10: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 04:39:19 -0000 Author: jhb Date: Tue Jul 22 04:39:16 2014 New Revision: 268976 URL: http://svnweb.freebsd.org/changeset/base/268976 Log: MFC 266424,266476,266524,266573,266595,266626,266627,266633,266641,266642, 266708,266724,266934,266935,268521: Emulation of the "ins" and "outs" instructions. Various fixes for translating guest linear addresses to guest physical addresses. Modified: stable/10/lib/libvmmapi/vmmapi.c stable/10/lib/libvmmapi/vmmapi.h stable/10/sys/amd64/include/vmm.h stable/10/sys/amd64/include/vmm_dev.h stable/10/sys/amd64/include/vmm_instruction_emul.h stable/10/sys/amd64/vmm/intel/vmx.c stable/10/sys/amd64/vmm/vmm.c stable/10/sys/amd64/vmm/vmm_dev.c stable/10/sys/amd64/vmm/vmm_instruction_emul.c stable/10/sys/amd64/vmm/vmm_ioport.c stable/10/sys/amd64/vmm/vmm_ioport.h stable/10/sys/amd64/vmm/vmm_ktr.h stable/10/usr.sbin/bhyve/bhyverun.c stable/10/usr.sbin/bhyve/inout.c stable/10/usr.sbin/bhyve/inout.h stable/10/usr.sbin/bhyve/mem.c stable/10/usr.sbin/bhyve/pci_virtio_block.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libvmmapi/vmmapi.c ============================================================================== --- stable/10/lib/libvmmapi/vmmapi.c Tue Jul 22 04:38:28 2014 (r268975) +++ stable/10/lib/libvmmapi/vmmapi.c Tue Jul 22 04:39:16 2014 (r268976) @@ -33,8 +33,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include @@ -937,3 +939,107 @@ vm_get_hpet_capabilities(struct vmctx *c *capabilities = cap.capabilities; return (error); } + +static int +gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, + uint64_t gla, int prot, int *fault, uint64_t *gpa) +{ + struct vm_gla2gpa gg; + int error; + + bzero(&gg, sizeof(struct vm_gla2gpa)); + gg.vcpuid = vcpu; + gg.prot = prot; + gg.gla = gla; + gg.paging = *paging; + + error = ioctl(ctx->fd, VM_GLA2GPA, &gg); + if (error == 0) { + *fault = gg.fault; + *gpa = gg.gpa; + } + return (error); +} + +#ifndef min +#define min(a,b) (((a) < (b)) ? (a) : (b)) +#endif + +int +vm_gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, + uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt) +{ + uint64_t gpa; + int error, fault, i, n, off; + + for (i = 0; i < iovcnt; i++) { + iov[i].iov_base = 0; + iov[i].iov_len = 0; + } + + while (len) { + assert(iovcnt > 0); + error = gla2gpa(ctx, vcpu, paging, gla, prot, &fault, &gpa); + if (error) + return (-1); + if (fault) + return (1); + + off = gpa & PAGE_MASK; + n = min(len, PAGE_SIZE - off); + + iov->iov_base = (void *)gpa; + iov->iov_len = n; + iov++; + iovcnt--; + + gla += n; + len -= n; + } + return (0); +} + +void +vm_copyin(struct vmctx *ctx, int vcpu, struct iovec *iov, void *vp, size_t len) +{ + const char *src; + char *dst; + uint64_t gpa; + size_t n; + + dst = vp; + while (len) { + assert(iov->iov_len); + gpa = (uint64_t)iov->iov_base; + n = min(len, iov->iov_len); + src = vm_map_gpa(ctx, gpa, n); + bcopy(src, dst, n); + + iov++; + dst += n; + len -= n; + } +} + +void +vm_copyout(struct vmctx *ctx, int vcpu, const void *vp, struct iovec *iov, + size_t len) +{ + const char *src; + char *dst; + uint64_t gpa; + size_t n; + + src = vp; + while (len) { + assert(iov->iov_len); + gpa = (uint64_t)iov->iov_base; + n = min(len, iov->iov_len); + dst = vm_map_gpa(ctx, gpa, n); + bcopy(src, dst, n); + + iov++; + src += n; + len -= n; + } +} Modified: stable/10/lib/libvmmapi/vmmapi.h ============================================================================== --- stable/10/lib/libvmmapi/vmmapi.h Tue Jul 22 04:38:28 2014 (r268975) +++ stable/10/lib/libvmmapi/vmmapi.h Tue Jul 22 04:39:16 2014 (r268976) @@ -29,6 +29,7 @@ #ifndef _VMMAPI_H_ #define _VMMAPI_H_ +struct iovec; struct vmctx; enum x2apic_state; @@ -109,6 +110,18 @@ int vm_set_x2apic_state(struct vmctx *ct int vm_get_hpet_capabilities(struct vmctx *ctx, uint32_t *capabilities); +/* + * Translate the GLA range [gla,gla+len) into GPA segments in 'iov'. + * The 'iovcnt' should be big enough to accomodate all GPA segments. + * Returns 0 on success, 1 on a guest fault condition and -1 otherwise. + */ +int vm_gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, + uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt); +void vm_copyin(struct vmctx *ctx, int vcpu, struct iovec *guest_iov, + void *host_dst, size_t len); +void vm_copyout(struct vmctx *ctx, int vcpu, const void *host_src, + struct iovec *guest_iov, size_t len); + /* Reset vcpu register state */ int vcpu_reset(struct vmctx *ctx, int vcpu); Modified: stable/10/sys/amd64/include/vmm.h ============================================================================== --- stable/10/sys/amd64/include/vmm.h Tue Jul 22 04:38:28 2014 (r268975) +++ stable/10/sys/amd64/include/vmm.h Tue Jul 22 04:39:16 2014 (r268976) @@ -54,6 +54,7 @@ struct vmspace; struct vm_object; struct pmap; +enum vm_reg_name; enum x2apic_state; typedef int (*vmm_init_func_t)(int ipinum); @@ -236,10 +237,11 @@ int vm_exception_pending(struct vm *vm, void vm_inject_gp(struct vm *vm, int vcpuid); /* general protection fault */ void vm_inject_ud(struct vm *vm, int vcpuid); /* undefined instruction fault */ +void vm_inject_pf(struct vm *vm, int vcpuid, int error_code, uint64_t cr2); -#endif /* KERNEL */ +enum vm_reg_name vm_segment_name(int seg_encoding); -#include +#endif /* KERNEL */ #define VM_MAXCPU 16 /* maximum virtual cpus */ @@ -280,6 +282,7 @@ enum vm_reg_name { VM_REG_GUEST_IDTR, VM_REG_GUEST_GDTR, VM_REG_GUEST_EFER, + VM_REG_GUEST_CR2, VM_REG_LAST }; @@ -318,6 +321,76 @@ struct seg_desc { uint32_t limit; uint32_t access; }; +#define SEG_DESC_TYPE(desc) ((desc)->access & 0x001f) +#define SEG_DESC_PRESENT(desc) ((desc)->access & 0x0080) +#define SEG_DESC_DEF32(desc) ((desc)->access & 0x4000) +#define SEG_DESC_GRANULARITY(desc) ((desc)->access & 0x8000) +#define SEG_DESC_UNUSABLE(desc) ((desc)->access & 0x10000) + +enum vm_cpu_mode { + CPU_MODE_COMPATIBILITY, /* IA-32E mode (CS.L = 0) */ + CPU_MODE_64BIT, /* IA-32E mode (CS.L = 1) */ +}; + +enum vm_paging_mode { + PAGING_MODE_FLAT, + PAGING_MODE_32, + PAGING_MODE_PAE, + PAGING_MODE_64, +}; + +struct vm_guest_paging { + uint64_t cr3; + int cpl; + enum vm_cpu_mode cpu_mode; + enum vm_paging_mode paging_mode; +}; + +/* + * The data structures 'vie' and 'vie_op' are meant to be opaque to the + * consumers of instruction decoding. The only reason why their contents + * need to be exposed is because they are part of the 'vm_exit' structure. + */ +struct vie_op { + uint8_t op_byte; /* actual opcode byte */ + uint8_t op_type; /* type of operation (e.g. MOV) */ + uint16_t op_flags; +}; + +#define VIE_INST_SIZE 15 +struct vie { + uint8_t inst[VIE_INST_SIZE]; /* instruction bytes */ + uint8_t num_valid; /* size of the instruction */ + uint8_t num_processed; + + uint8_t rex_w:1, /* REX prefix */ + rex_r:1, + rex_x:1, + rex_b:1, + rex_present:1; + + uint8_t mod:2, /* ModRM byte */ + reg:4, + rm:4; + + uint8_t ss:2, /* SIB byte */ + index:4, + base:4; + + uint8_t disp_bytes; + uint8_t imm_bytes; + + uint8_t scale; + int base_register; /* VM_REG_GUEST_xyz */ + int index_register; /* VM_REG_GUEST_xyz */ + + int64_t displacement; /* optional addr displacement */ + int64_t immediate; /* optional immediate operand */ + + uint8_t decoded; /* set to 1 if successfully decoded */ + + struct vie_op op; /* opcode description */ +}; enum vm_exitcode { VM_EXITCODE_INOUT, @@ -335,22 +408,38 @@ enum vm_exitcode { VM_EXITCODE_RENDEZVOUS, VM_EXITCODE_IOAPIC_EOI, VM_EXITCODE_SUSPENDED, + VM_EXITCODE_INOUT_STR, VM_EXITCODE_MAX }; +struct vm_inout { + uint16_t bytes:3; /* 1 or 2 or 4 */ + uint16_t in:1; + uint16_t string:1; + uint16_t rep:1; + uint16_t port; + uint32_t eax; /* valid for out */ +}; + +struct vm_inout_str { + struct vm_inout inout; /* must be the first element */ + struct vm_guest_paging paging; + uint64_t rflags; + uint64_t cr0; + uint64_t index; + uint64_t count; /* rep=1 (%rcx), rep=0 (1) */ + int addrsize; + enum vm_reg_name seg_name; + struct seg_desc seg_desc; +}; + struct vm_exit { enum vm_exitcode exitcode; int inst_length; /* 0 means unknown */ uint64_t rip; union { - struct { - uint16_t bytes:3; /* 1 or 2 or 4 */ - uint16_t in:1; /* out is 0, in is 1 */ - uint16_t string:1; - uint16_t rep:1; - uint16_t port; - uint32_t eax; /* valid for out */ - } inout; + struct vm_inout inout; + struct vm_inout_str inout_str; struct { uint64_t gpa; int fault_type; @@ -358,9 +447,7 @@ struct vm_exit { struct { uint64_t gpa; uint64_t gla; - uint64_t cr3; - enum vie_cpu_mode cpu_mode; - enum vie_paging_mode paging_mode; + struct vm_guest_paging paging; struct vie vie; } inst_emul; /* Modified: stable/10/sys/amd64/include/vmm_dev.h ============================================================================== --- stable/10/sys/amd64/include/vmm_dev.h Tue Jul 22 04:38:28 2014 (r268975) +++ stable/10/sys/amd64/include/vmm_dev.h Tue Jul 22 04:39:16 2014 (r268976) @@ -168,6 +168,15 @@ struct vm_suspend { enum vm_suspend_how how; }; +struct vm_gla2gpa { + int vcpuid; /* inputs */ + int prot; /* PROT_READ or PROT_WRITE */ + uint64_t gla; + struct vm_guest_paging paging; + int fault; /* outputs */ + uint64_t gpa; +}; + enum { /* general routines */ IOCNUM_ABIVERS = 0, @@ -180,6 +189,7 @@ enum { IOCNUM_MAP_MEMORY = 10, IOCNUM_GET_MEMORY_SEG = 11, IOCNUM_GET_GPA_PMAP = 12, + IOCNUM_GLA2GPA = 13, /* register/state accessors */ IOCNUM_SET_REGISTER = 20, @@ -289,4 +299,6 @@ enum { _IOR('v', IOCNUM_GET_HPET_CAPABILITIES, struct vm_hpet_cap) #define VM_GET_GPA_PMAP \ _IOWR('v', IOCNUM_GET_GPA_PMAP, struct vm_gpa_pte) +#define VM_GLA2GPA \ + _IOWR('v', IOCNUM_GLA2GPA, struct vm_gla2gpa) #endif Modified: stable/10/sys/amd64/include/vmm_instruction_emul.h ============================================================================== --- stable/10/sys/amd64/include/vmm_instruction_emul.h Tue Jul 22 04:38:28 2014 (r268975) +++ stable/10/sys/amd64/include/vmm_instruction_emul.h Tue Jul 22 04:39:16 2014 (r268976) @@ -29,63 +29,7 @@ #ifndef _VMM_INSTRUCTION_EMUL_H_ #define _VMM_INSTRUCTION_EMUL_H_ -enum vie_cpu_mode { - CPU_MODE_COMPATIBILITY, /* IA-32E mode (CS.L = 0) */ - CPU_MODE_64BIT, /* IA-32E mode (CS.L = 1) */ -}; - -enum vie_paging_mode { - PAGING_MODE_FLAT, - PAGING_MODE_32, - PAGING_MODE_PAE, - PAGING_MODE_64, -}; - -/* - * The data structures 'vie' and 'vie_op' are meant to be opaque to the - * consumers of instruction decoding. The only reason why their contents - * need to be exposed is because they are part of the 'vm_exit' structure. - */ -struct vie_op { - uint8_t op_byte; /* actual opcode byte */ - uint8_t op_type; /* type of operation (e.g. MOV) */ - uint16_t op_flags; -}; - -#define VIE_INST_SIZE 15 -struct vie { - uint8_t inst[VIE_INST_SIZE]; /* instruction bytes */ - uint8_t num_valid; /* size of the instruction */ - uint8_t num_processed; - - uint8_t rex_w:1, /* REX prefix */ - rex_r:1, - rex_x:1, - rex_b:1, - rex_present:1; - - uint8_t mod:2, /* ModRM byte */ - reg:4, - rm:4; - - uint8_t ss:2, /* SIB byte */ - index:4, - base:4; - - uint8_t disp_bytes; - uint8_t imm_bytes; - - uint8_t scale; - int base_register; /* VM_REG_GUEST_xyz */ - int index_register; /* VM_REG_GUEST_xyz */ - - int64_t displacement; /* optional addr displacement */ - int64_t immediate; /* optional immediate operand */ - - uint8_t decoded; /* set to 1 if successfully decoded */ - - struct vie_op op; /* opcode description */ -}; +#include /* * Callback functions to read and write memory regions. @@ -111,6 +55,24 @@ int vmm_emulate_instruction(void *vm, in mem_region_read_t mrr, mem_region_write_t mrw, void *mrarg); +int vie_update_register(void *vm, int vcpuid, enum vm_reg_name reg, + uint64_t val, int size); + +/* + * Returns 1 if an alignment check exception should be injected and 0 otherwise. + */ +int vie_alignment_check(int cpl, int operand_size, uint64_t cr0, + uint64_t rflags, uint64_t gla); + +/* Returns 1 if the 'gla' is not canonical and 0 otherwise. */ +int vie_canonical_check(enum vm_cpu_mode cpu_mode, uint64_t gla); + +uint64_t vie_size2mask(int size); + +int vie_calculate_gla(enum vm_cpu_mode cpu_mode, enum vm_reg_name seg, + struct seg_desc *desc, uint64_t off, int length, int addrsize, int prot, + uint64_t *gla); + #ifdef _KERNEL /* * APIs to fetch and decode the instruction from nested page fault handler. @@ -118,8 +80,18 @@ int vmm_emulate_instruction(void *vm, in * 'vie' must be initialized before calling 'vmm_fetch_instruction()' */ int vmm_fetch_instruction(struct vm *vm, int cpuid, - uint64_t rip, int inst_length, uint64_t cr3, - enum vie_paging_mode paging_mode, struct vie *vie); + struct vm_guest_paging *guest_paging, + uint64_t rip, int inst_length, struct vie *vie); + +/* + * Translate the guest linear address 'gla' to a guest physical address. + * + * Returns 0 on success and '*gpa' contains the result of the translation. + * Returns 1 if an exception was injected into the guest. + * Returns -1 otherwise. + */ +int vmm_gla2gpa(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, + uint64_t gla, int prot, uint64_t *gpa); void vie_init(struct vie *vie); @@ -136,7 +108,7 @@ void vie_init(struct vie *vie); */ #define VIE_INVALID_GLA (1UL << 63) /* a non-canonical address */ int vmm_decode_instruction(struct vm *vm, int cpuid, uint64_t gla, - enum vie_cpu_mode cpu_mode, struct vie *vie); + enum vm_cpu_mode cpu_mode, struct vie *vie); #endif /* _KERNEL */ #endif /* _VMM_INSTRUCTION_EMUL_H_ */ Modified: stable/10/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx.c Tue Jul 22 04:38:28 2014 (r268975) +++ stable/10/sys/amd64/vmm/intel/vmx.c Tue Jul 22 04:39:16 2014 (r268976) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "vmm_host.h" #include "vmm_ioport.h" #include "vmm_ipi.h" @@ -185,6 +186,8 @@ SYSCTL_UINT(_hw_vmm_vmx, OID_AUTO, vpid_ */ #define APIC_ACCESS_ADDRESS 0xFFFFF000 +static int vmx_getdesc(void *arg, int vcpu, int reg, struct seg_desc *desc); +static int vmx_getreg(void *arg, int vcpu, int reg, uint64_t *retval); static void vmx_inject_pir(struct vlapic *vlapic); #ifdef KTR @@ -539,7 +542,7 @@ static int vmx_init(int ipinum) { int error, use_tpr_shadow; - uint64_t fixed0, fixed1, feature_control; + uint64_t basic, fixed0, fixed1, feature_control; uint32_t tmp, procbased2_vid_bits; /* CPUID.1:ECX[bit 5] must be 1 for processor to support VMX */ @@ -559,6 +562,17 @@ vmx_init(int ipinum) return (ENXIO); } + /* + * Verify capabilities MSR_VMX_BASIC: + * - bit 54 indicates support for INS/OUTS decoding + */ + basic = rdmsr(MSR_VMX_BASIC); + if ((basic & (1UL << 54)) == 0) { + printf("vmx_init: processor does not support desired basic " + "capabilities\n"); + return (EINVAL); + } + /* Check support for primary processor-based VM-execution controls */ error = vmx_set_ctlreg(MSR_VMX_PROCBASED_CTLS, MSR_VMX_TRUE_PROCBASED_CTLS, @@ -1539,7 +1553,19 @@ vmx_emulate_cr_access(struct vmx *vmx, i return (HANDLED); } -static enum vie_cpu_mode +/* + * From section "Guest Register State" in the Intel SDM: CPL = SS.DPL + */ +static int +vmx_cpl(void) +{ + uint32_t ssar; + + ssar = vmcs_read(VMCS_GUEST_SS_ACCESS_RIGHTS); + return ((ssar >> 5) & 0x3); +} + +static enum vm_cpu_mode vmx_cpu_mode(void) { @@ -1549,7 +1575,7 @@ vmx_cpu_mode(void) return (CPU_MODE_COMPATIBILITY); } -static enum vie_paging_mode +static enum vm_paging_mode vmx_paging_mode(void) { @@ -1563,6 +1589,89 @@ vmx_paging_mode(void) return (PAGING_MODE_PAE); } +static uint64_t +inout_str_index(struct vmx *vmx, int vcpuid, int in) +{ + uint64_t val; + int error; + enum vm_reg_name reg; + + reg = in ? VM_REG_GUEST_RDI : VM_REG_GUEST_RSI; + error = vmx_getreg(vmx, vcpuid, reg, &val); + KASSERT(error == 0, ("%s: vmx_getreg error %d", __func__, error)); + return (val); +} + +static uint64_t +inout_str_count(struct vmx *vmx, int vcpuid, int rep) +{ + uint64_t val; + int error; + + if (rep) { + error = vmx_getreg(vmx, vcpuid, VM_REG_GUEST_RCX, &val); + KASSERT(!error, ("%s: vmx_getreg error %d", __func__, error)); + } else { + val = 1; + } + return (val); +} + +static int +inout_str_addrsize(uint32_t inst_info) +{ + uint32_t size; + + size = (inst_info >> 7) & 0x7; + switch (size) { + case 0: + return (2); /* 16 bit */ + case 1: + return (4); /* 32 bit */ + case 2: + return (8); /* 64 bit */ + default: + panic("%s: invalid size encoding %d", __func__, size); + } +} + +static void +inout_str_seginfo(struct vmx *vmx, int vcpuid, uint32_t inst_info, int in, + struct vm_inout_str *vis) +{ + int error, s; + + if (in) { + vis->seg_name = VM_REG_GUEST_ES; + } else { + s = (inst_info >> 15) & 0x7; + vis->seg_name = vm_segment_name(s); + } + + error = vmx_getdesc(vmx, vcpuid, vis->seg_name, &vis->seg_desc); + KASSERT(error == 0, ("%s: vmx_getdesc error %d", __func__, error)); + + /* XXX modify svm.c to update bit 16 of seg_desc.access (unusable) */ +} + +static void +vmx_paging_info(struct vm_guest_paging *paging) +{ + paging->cr3 = vmcs_guest_cr3(); + paging->cpl = vmx_cpl(); + paging->cpu_mode = vmx_cpu_mode(); + paging->paging_mode = vmx_paging_mode(); +} + +static void +vmexit_inst_emul(struct vm_exit *vmexit, uint64_t gpa, uint64_t gla) +{ + vmexit->exitcode = VM_EXITCODE_INST_EMUL; + vmexit->u.inst_emul.gpa = gpa; + vmexit->u.inst_emul.gla = gla; + vmx_paging_info(&vmexit->u.inst_emul.paging); +} + static int ept_fault_type(uint64_t ept_qual) { @@ -1754,12 +1863,8 @@ vmx_handle_apic_access(struct vmx *vmx, } if (allowed) { - vmexit->exitcode = VM_EXITCODE_INST_EMUL; - vmexit->u.inst_emul.gpa = DEFAULT_APIC_BASE + offset; - vmexit->u.inst_emul.gla = VIE_INVALID_GLA; - vmexit->u.inst_emul.cr3 = vmcs_guest_cr3(); - vmexit->u.inst_emul.cpu_mode = vmx_cpu_mode(); - vmexit->u.inst_emul.paging_mode = vmx_paging_mode(); + vmexit_inst_emul(vmexit, DEFAULT_APIC_BASE + offset, + VIE_INVALID_GLA); } /* @@ -1776,10 +1881,12 @@ vmx_handle_apic_access(struct vmx *vmx, static int vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) { - int error, handled; + int error, handled, in; struct vmxctx *vmxctx; struct vlapic *vlapic; - uint32_t eax, ecx, edx, idtvec_info, idtvec_err, intr_info, reason; + struct vm_inout_str *vis; + uint32_t eax, ecx, edx, idtvec_info, idtvec_err, intr_info, inst_info; + uint32_t reason; uint64_t qual, gpa; bool retu; @@ -1936,15 +2043,22 @@ vmx_exit_process(struct vmx *vmx, int vc vmm_stat_incr(vmx->vm, vcpu, VMEXIT_INOUT, 1); vmexit->exitcode = VM_EXITCODE_INOUT; vmexit->u.inout.bytes = (qual & 0x7) + 1; - vmexit->u.inout.in = (qual & 0x8) ? 1 : 0; + vmexit->u.inout.in = in = (qual & 0x8) ? 1 : 0; vmexit->u.inout.string = (qual & 0x10) ? 1 : 0; vmexit->u.inout.rep = (qual & 0x20) ? 1 : 0; vmexit->u.inout.port = (uint16_t)(qual >> 16); vmexit->u.inout.eax = (uint32_t)(vmxctx->guest_rax); - error = emulate_ioport(vmx->vm, vcpu, vmexit); - if (error == 0) { - handled = 1; - vmxctx->guest_rax = vmexit->u.inout.eax; + if (vmexit->u.inout.string) { + inst_info = vmcs_read(VMCS_EXIT_INSTRUCTION_INFO); + vmexit->exitcode = VM_EXITCODE_INOUT_STR; + vis = &vmexit->u.inout_str; + vmx_paging_info(&vis->paging); + vis->rflags = vmcs_read(VMCS_GUEST_RFLAGS); + vis->cr0 = vmcs_read(VMCS_GUEST_CR0); + vis->index = inout_str_index(vmx, vcpu, in); + vis->count = inout_str_count(vmx, vcpu, vis->inout.rep); + vis->addrsize = inout_str_addrsize(inst_info); + inout_str_seginfo(vmx, vcpu, inst_info, in, vis); } break; case EXIT_REASON_CPUID: @@ -1990,12 +2104,7 @@ vmx_exit_process(struct vmx *vmx, int vc vmexit->u.paging.fault_type = ept_fault_type(qual); vmm_stat_incr(vmx->vm, vcpu, VMEXIT_NESTED_FAULT, 1); } else if (ept_emulation_fault(qual)) { - vmexit->exitcode = VM_EXITCODE_INST_EMUL; - vmexit->u.inst_emul.gpa = gpa; - vmexit->u.inst_emul.gla = vmcs_gla(); - vmexit->u.inst_emul.cr3 = vmcs_guest_cr3(); - vmexit->u.inst_emul.cpu_mode = vmx_cpu_mode(); - vmexit->u.inst_emul.paging_mode = vmx_paging_mode(); + vmexit_inst_emul(vmexit, gpa, vmcs_gla()); vmm_stat_incr(vmx->vm, vcpu, VMEXIT_INST_EMUL, 1); } /* @@ -2324,6 +2433,8 @@ vmxctx_regptr(struct vmxctx *vmxctx, int return (&vmxctx->guest_r14); case VM_REG_GUEST_R15: return (&vmxctx->guest_r15); + case VM_REG_GUEST_CR2: + return (&vmxctx->guest_cr2); default: break; } Modified: stable/10/sys/amd64/vmm/vmm.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm.c Tue Jul 22 04:38:28 2014 (r268975) +++ stable/10/sys/amd64/vmm/vmm.c Tue Jul 22 04:39:16 2014 (r268976) @@ -62,7 +62,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include "vmm_ioport.h" #include "vmm_ktr.h" #include "vmm_host.h" #include "vmm_mem.h" @@ -1131,34 +1133,33 @@ vm_handle_inst_emul(struct vm *vm, int v struct vie *vie; struct vcpu *vcpu; struct vm_exit *vme; - int error, inst_length; - uint64_t rip, gla, gpa, cr3; - enum vie_cpu_mode cpu_mode; - enum vie_paging_mode paging_mode; + uint64_t gla, gpa; + struct vm_guest_paging *paging; mem_region_read_t mread; mem_region_write_t mwrite; + int error; vcpu = &vm->vcpu[vcpuid]; vme = &vcpu->exitinfo; - rip = vme->rip; - inst_length = vme->inst_length; - gla = vme->u.inst_emul.gla; gpa = vme->u.inst_emul.gpa; - cr3 = vme->u.inst_emul.cr3; - cpu_mode = vme->u.inst_emul.cpu_mode; - paging_mode = vme->u.inst_emul.paging_mode; vie = &vme->u.inst_emul.vie; + paging = &vme->u.inst_emul.paging; vie_init(vie); /* Fetch, decode and emulate the faulting instruction */ - if (vmm_fetch_instruction(vm, vcpuid, rip, inst_length, cr3, - paging_mode, vie) != 0) + error = vmm_fetch_instruction(vm, vcpuid, paging, vme->rip, + vme->inst_length, vie); + if (error == 1) + return (0); /* Resume guest to handle page fault */ + else if (error == -1) return (EFAULT); + else if (error != 0) + panic("%s: vmm_fetch_instruction error %d", __func__, error); - if (vmm_decode_instruction(vm, vcpuid, gla, cpu_mode, vie) != 0) + if (vmm_decode_instruction(vm, vcpuid, gla, paging->cpu_mode, vie) != 0) return (EFAULT); /* return to userland unless this is an in-kernel emulated device */ @@ -1348,6 +1349,10 @@ restart: case VM_EXITCODE_INST_EMUL: error = vm_handle_inst_emul(vm, vcpuid, &retu); break; + case VM_EXITCODE_INOUT: + case VM_EXITCODE_INOUT_STR: + error = vm_handle_inout(vm, vcpuid, vme, &retu); + break; default: retu = true; /* handled in userland */ break; @@ -1430,6 +1435,25 @@ vm_inject_fault(struct vm *vm, int vcpui } void +vm_inject_pf(struct vm *vm, int vcpuid, int error_code, uint64_t cr2) +{ + struct vm_exception pf = { + .vector = IDT_PF, + .error_code_valid = 1, + .error_code = error_code + }; + int error; + + VCPU_CTR2(vm, vcpuid, "Injecting page fault: error_code %#x, cr2 %#lx", + error_code, cr2); + + error = vm_set_register(vm, vcpuid, VM_REG_GUEST_CR2, cr2); + KASSERT(error == 0, ("vm_set_register(cr2) error %d", error)); + + vm_inject_fault(vm, vcpuid, &pf); +} + +void vm_inject_gp(struct vm *vm, int vcpuid) { struct vm_exception gpf = { @@ -1856,3 +1880,20 @@ vm_atpit(struct vm *vm) { return (vm->vatpit); } + +enum vm_reg_name +vm_segment_name(int seg) +{ + static enum vm_reg_name seg_names[] = { + VM_REG_GUEST_ES, + VM_REG_GUEST_CS, + VM_REG_GUEST_SS, + VM_REG_GUEST_DS, + VM_REG_GUEST_FS, + VM_REG_GUEST_GS + }; + + KASSERT(seg >= 0 && seg < nitems(seg_names), + ("%s: invalid segment encoding %d", __func__, seg)); + return (seg_names[seg]); +} Modified: stable/10/sys/amd64/vmm/vmm_dev.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_dev.c Tue Jul 22 04:38:28 2014 (r268975) +++ stable/10/sys/amd64/vmm/vmm_dev.c Tue Jul 22 04:39:16 2014 (r268976) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "vmm_lapic.h" @@ -168,6 +169,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c struct vm_x2apic *x2apic; struct vm_gpa_pte *gpapte; struct vm_suspend *vmsuspend; + struct vm_gla2gpa *gg; sc = vmmdev_lookup2(cdev); if (sc == NULL) @@ -192,6 +194,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c case VM_PPTDEV_MSI: case VM_PPTDEV_MSIX: case VM_SET_X2APIC_STATE: + case VM_GLA2GPA: /* * XXX fragile, handle with care * Assumes that the first field of the ioctl data is the vcpu. @@ -415,6 +418,27 @@ vmmdev_ioctl(struct cdev *cdev, u_long c case VM_GET_HPET_CAPABILITIES: error = vhpet_getcap((struct vm_hpet_cap *)data); break; + case VM_GLA2GPA: { + CTASSERT(PROT_READ == VM_PROT_READ); + CTASSERT(PROT_WRITE == VM_PROT_WRITE); + CTASSERT(PROT_EXEC == VM_PROT_EXECUTE); + gg = (struct vm_gla2gpa *)data; + error = vmm_gla2gpa(sc->vm, gg->vcpuid, &gg->paging, gg->gla, + gg->prot, &gg->gpa); + KASSERT(error == 0 || error == 1 || error == -1, + ("%s: vmm_gla2gpa unknown error %d", __func__, error)); + if (error >= 0) { + /* + * error = 0: the translation was successful + * error = 1: a fault was injected into the guest + */ + gg->fault = error; + error = 0; + } else { + error = EFAULT; + } + break; + } default: error = ENOTTY; break; Modified: stable/10/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_instruction_emul.c Tue Jul 22 04:38:28 2014 (r268975) +++ stable/10/sys/amd64/vmm/vmm_instruction_emul.c Tue Jul 22 04:39:16 2014 (r268976) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -46,9 +47,15 @@ __FBSDID("$FreeBSD$"); #include +#include #include +#define KASSERT(exp,msg) assert((exp)) #endif /* _KERNEL */ +#include +#include +#include + /* struct vie_op.op_type */ enum { VIE_OP_TYPE_NONE = 0, @@ -205,7 +212,7 @@ vie_read_bytereg(void *vm, int vcpuid, s return (error); } -static int +int vie_update_register(void *vm, int vcpuid, enum vm_reg_name reg, uint64_t val, int size) { @@ -560,6 +567,155 @@ vmm_emulate_instruction(void *vm, int vc return (error); } +int +vie_alignment_check(int cpl, int size, uint64_t cr0, uint64_t rf, uint64_t gla) +{ + KASSERT(size == 1 || size == 2 || size == 4 || size == 8, + ("%s: invalid size %d", __func__, size)); + KASSERT(cpl >= 0 && cpl <= 3, ("%s: invalid cpl %d", __func__, cpl)); + + if (cpl != 3 || (cr0 & CR0_AM) == 0 || (rf & PSL_AC) == 0) + return (0); + + return ((gla & (size - 1)) ? 1 : 0); +} + +int +vie_canonical_check(enum vm_cpu_mode cpu_mode, uint64_t gla) +{ + uint64_t mask; + + if (cpu_mode != CPU_MODE_64BIT) + return (0); + + /* + * The value of the bit 47 in the 'gla' should be replicated in the + * most significant 16 bits. + */ + mask = ~((1UL << 48) - 1); + if (gla & (1UL << 47)) + return ((gla & mask) != mask); + else + return ((gla & mask) != 0); +} + +uint64_t +vie_size2mask(int size) +{ + KASSERT(size == 1 || size == 2 || size == 4 || size == 8, + ("vie_size2mask: invalid size %d", size)); + return (size2mask[size]); +} + +int +vie_calculate_gla(enum vm_cpu_mode cpu_mode, enum vm_reg_name seg, + struct seg_desc *desc, uint64_t offset, int length, int addrsize, + int prot, uint64_t *gla) +{ + uint64_t firstoff, low_limit, high_limit, segbase; + int glasize, type; + + KASSERT(seg >= VM_REG_GUEST_ES && seg <= VM_REG_GUEST_GS, + ("%s: invalid segment %d", __func__, seg)); + KASSERT(length == 1 || length == 2 || length == 4 || length == 8, + ("%s: invalid operand size %d", __func__, length)); + KASSERT((prot & ~(PROT_READ | PROT_WRITE)) == 0, + ("%s: invalid prot %#x", __func__, prot)); + + firstoff = offset; + if (cpu_mode == CPU_MODE_64BIT) { + KASSERT(addrsize == 4 || addrsize == 8, ("%s: invalid address " + "size %d for cpu_mode %d", __func__, addrsize, cpu_mode)); + glasize = 8; + } else { + KASSERT(addrsize == 2 || addrsize == 4, ("%s: invalid address " + "size %d for cpu mode %d", __func__, addrsize, cpu_mode)); + glasize = 4; + /* + * If the segment selector is loaded with a NULL selector + * then the descriptor is unusable and attempting to use + * it results in a #GP(0). + */ + if (SEG_DESC_UNUSABLE(desc)) + return (-1); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 04:39:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22B5E32E; Tue, 22 Jul 2014 04:39:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F58D2849; Tue, 22 Jul 2014 04:39:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M4dXIl048000; Tue, 22 Jul 2014 04:39:33 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M4dXdb047994; Tue, 22 Jul 2014 04:39:33 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201407220439.s6M4dXdb047994@svn.freebsd.org> From: Ruslan Bukin Date: Tue, 22 Jul 2014 04:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268977 - in head/sys: arm/conf arm/freescale/imx boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 04:39:34 -0000 Author: br Date: Tue Jul 22 04:39:32 2014 New Revision: 268977 URL: http://svnweb.freebsd.org/changeset/base/268977 Log: Enable Freescale i.MX I2C driver for i.MX6. Modified: head/sys/arm/conf/IMX6 head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/imx/imx_i2c.c head/sys/boot/fdt/dts/arm/imx6.dtsi Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Tue Jul 22 04:39:16 2014 (r268976) +++ head/sys/arm/conf/IMX6 Tue Jul 22 04:39:32 2014 (r268977) @@ -154,8 +154,8 @@ options FREEBSD_BOOT_LOADER # Process # SoC-specific devices device ffec # Freescale Fast Ethernet Controller -#device fsliic # Freescale i2c/iic (not ready yet) -#device iic # iic protocol -#device iicbus # iic bus +device fsliic # Freescale i2c/iic +device iic # iic protocol +device iicbus # iic bus #device imxwdt # Watchdog. WARNING: can't be disabled!!! Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Tue Jul 22 04:39:16 2014 (r268976) +++ head/sys/arm/freescale/imx/files.imx6 Tue Jul 22 04:39:32 2014 (r268977) @@ -27,6 +27,7 @@ arm/freescale/imx/imx6_pl310.c standard arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx_gpt.c standard arm/freescale/imx/imx_gpio.c optional gpio +arm/freescale/imx/imx_i2c.c optional fsliic # # Optional devices. @@ -52,5 +53,4 @@ arm/freescale/imx/imx6_usbphy.c optiona # #arm/freescale/imx/imx51_iomux.c optional iomux #dev/ata/chipsets/ata-fsl.c optional imxata -#arm/freescale/imx/imx_i2c.c optional fsliic #arm/freescale/imx/imx51_ipuv3.c optional sc Modified: head/sys/arm/freescale/imx/imx_i2c.c ============================================================================== --- head/sys/arm/freescale/imx/imx_i2c.c Tue Jul 22 04:39:16 2014 (r268976) +++ head/sys/arm/freescale/imx/imx_i2c.c Tue Jul 22 04:39:32 2014 (r268977) @@ -86,6 +86,12 @@ __FBSDID("$FreeBSD$"); #define debugf(fmt, args...) #endif +static struct ofw_compat_data compat_data[] = { + {"fsl,imx6q-i2c", 1}, + {"fsl,imx-i2c", 1}, + {NULL, 0} +}; + struct i2c_softc { device_t dev; device_t iicbus; @@ -227,7 +233,7 @@ i2c_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "fsl,imx-i2c")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); sc = device_get_softc(dev); @@ -246,7 +252,7 @@ i2c_probe(device_t dev) /* Enable I2C */ i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN); bus_release_resource(dev, SYS_RES_MEMORY, sc->rid, sc->res); - device_set_desc(dev, "I2C bus controller"); + device_set_desc(dev, "Freescale i.MX I2C bus controller"); return (BUS_PROBE_DEFAULT); } Modified: head/sys/boot/fdt/dts/arm/imx6.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/imx6.dtsi Tue Jul 22 04:39:16 2014 (r268976) +++ head/sys/boot/fdt/dts/arm/imx6.dtsi Tue Jul 22 04:39:32 2014 (r268977) @@ -338,6 +338,27 @@ reg = <0x02100000 0x00100000>; ranges; + i2c1: i2c@021a0000 { + compatible = "fsl,imx6q-i2c"; + reg = <0x021a0000 0x4000>; + interrupts = < 68 >; + status = "disabled"; + }; + + i2c2: i2c@021a4000 { + compatible = "fsl,imx6q-i2c"; + reg = <0x021a4000 0x4000>; + interrupts = < 69 >; + status = "disabled"; + }; + + i2c3: i2c@021ac000 { + compatible = "fsl,imx6q-i2c"; + reg = <0x021a8000 0x4000>; + interrupts = < 70 >; + status = "disabled"; + }; + fec1: ethernet@02188000 { compatible = "fsl,imx6q-fec"; reg = <0x02188000 0x4000>; From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 04:47:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 416384CA; Tue, 22 Jul 2014 04:47:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E71628EC; Tue, 22 Jul 2014 04:47:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M4lK9P052017; Tue, 22 Jul 2014 04:47:20 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M4lKVJ052016; Tue, 22 Jul 2014 04:47:20 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201407220447.s6M4lKVJ052016@svn.freebsd.org> From: Sean Bruno Date: Tue, 22 Jul 2014 04:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268978 - head/sys/boot/userboot/test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 04:47:20 -0000 Author: sbruno Date: Tue Jul 22 04:47:19 2014 New Revision: 268978 URL: http://svnweb.freebsd.org/changeset/base/268978 Log: copyin/copyout should return 0 if they are truly emulating copyin/copyout behavior. remove stray %s in printf rewrite printf to display 64bit type without warning. Modified: head/sys/boot/userboot/test/test.c Modified: head/sys/boot/userboot/test/test.c ============================================================================== --- head/sys/boot/userboot/test/test.c Tue Jul 22 04:39:32 2014 (r268977) +++ head/sys/boot/userboot/test/test.c Tue Jul 22 04:47:19 2014 (r268978) @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -292,6 +293,7 @@ test_copyin(void *arg, const void *from, if (to + size > image_size) size = image_size - to; memcpy(&image[to], from, size); + return(0); } int @@ -304,6 +306,7 @@ test_copyout(void *arg, uint64_t from, v if (from + size > image_size) size = image_size - from; memcpy(to, &image[from], size); + return(0); } void @@ -333,7 +336,7 @@ test_setgdt(void *arg, uint64_t v, size_ void test_exec(void *arg, uint64_t pc) { - printf("Execute at 0x%llx\n", pc); + printf("Execute at 0x%"PRIu64"\n", pc); test_exit(arg, 0); } @@ -411,7 +414,7 @@ void usage() { - printf("usage: %s [-d ] [-h \n"); + printf("usage: [-d ] [-h \n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 06:40:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5980527C; Tue, 22 Jul 2014 06:40:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46E3921EC; Tue, 22 Jul 2014 06:40:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M6eSGw004603; Tue, 22 Jul 2014 06:40:28 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M6eSKX004602; Tue, 22 Jul 2014 06:40:28 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407220640.s6M6eSKX004602@svn.freebsd.org> From: Xin LI Date: Tue, 22 Jul 2014 06:40:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268979 - head/libexec/save-entropy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 06:40:28 -0000 Author: delphij Date: Tue Jul 22 06:40:27 2014 New Revision: 268979 URL: http://svnweb.freebsd.org/changeset/base/268979 Log: Don't save entropy inside jails. As of r126744, we no longer feed the entropy device in jails upon start, and collecting them is no longer useful. PR: conf/126744 Submitted by: Eugene Grosbein (with minor changes) MFC after: 1 week Approved by: so (des) Modified: head/libexec/save-entropy/save-entropy.sh Modified: head/libexec/save-entropy/save-entropy.sh ============================================================================== --- head/libexec/save-entropy/save-entropy.sh Tue Jul 22 04:47:19 2014 (r268978) +++ head/libexec/save-entropy/save-entropy.sh Tue Jul 22 06:40:27 2014 (r268979) @@ -42,6 +42,8 @@ elif [ -r /etc/rc.conf ]; then . /etc/rc.conf 2>/dev/null fi +[ $(/sbin/sysctl -n security.jail.jailed) = 0 ] || exit 0 + case ${entropy_dir} in [Nn][Oo]) exit 0 From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 08:37:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E61F526; Tue, 22 Jul 2014 08:37:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B4392B9B; Tue, 22 Jul 2014 08:37:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M8b104057752; Tue, 22 Jul 2014 08:37:01 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M8b12u057751; Tue, 22 Jul 2014 08:37:01 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407220837.s6M8b12u057751@svn.freebsd.org> From: Xin LI Date: Tue, 22 Jul 2014 08:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268980 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 08:37:02 -0000 Author: delphij Date: Tue Jul 22 08:37:01 2014 New Revision: 268980 URL: http://svnweb.freebsd.org/changeset/base/268980 Log: Correct typo introduced with r268855. MFC after: 10 days X-MFC with: r268855 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Tue Jul 22 06:40:27 2014 (r268979) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Tue Jul 22 08:37:01 2014 (r268980) @@ -208,7 +208,7 @@ enum zio_flag { ZIO_FLAG_NOPWRITE = 1 << 26, ZIO_FLAG_REEXECUTED = 1 << 27, ZIO_FLAG_DELEGATED = 1 << 28, - ZIO_FLAG_QUEUE_IO_DONE = 1 << 28, + ZIO_FLAG_QUEUE_IO_DONE = 1 << 29, }; #define ZIO_FLAG_MUSTSUCCEED 0 From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 08:52:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE4C585A; Tue, 22 Jul 2014 08:52:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A21DB2CF7; Tue, 22 Jul 2014 08:52:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M8qneE066100; Tue, 22 Jul 2014 08:52:49 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M8qnNv066099; Tue, 22 Jul 2014 08:52:49 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201407220852.s6M8qnNv066099@svn.freebsd.org> From: Aleksandr Rybalko Date: Tue, 22 Jul 2014 08:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268981 - head/sys/dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 08:52:49 -0000 Author: ray Date: Tue Jul 22 08:52:49 2014 New Revision: 268981 URL: http://svnweb.freebsd.org/changeset/base/268981 Log: Remove #ifdef-s to reduce difference to upstream. Pointed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/drm2/drm_fb_helper.c Modified: head/sys/dev/drm2/drm_fb_helper.c ============================================================================== --- head/sys/dev/drm2/drm_fb_helper.c Tue Jul 22 08:37:01 2014 (r268980) +++ head/sys/dev/drm2/drm_fb_helper.c Tue Jul 22 08:52:49 2014 (r268981) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__FreeBSD__) struct vt_kms_softc { struct drm_fb_helper *fb_helper; struct task fb_mode_task; @@ -69,7 +68,6 @@ vt_kms_postswitch(void *arg) return (0); } -#endif static DRM_LIST_HEAD(kernel_fb_helper_list); @@ -934,10 +932,8 @@ int drm_fb_helper_single_fb_probe(struct struct fb_info *info; struct drm_fb_helper_surface_size sizes; int gamma_size = 0; -#if defined(__FreeBSD__) struct vt_kms_softc *sc; device_t kdev; -#endif memset(&sizes, 0, sizeof(struct drm_fb_helper_surface_size)); sizes.surface_depth = 24; @@ -1014,7 +1010,6 @@ int drm_fb_helper_single_fb_probe(struct if (new_fb < 0) return new_fb; -#if defined(__FreeBSD__) sc = malloc(sizeof(struct vt_kms_softc), DRM_MEM_KMS, M_WAITOK | M_ZERO); sc->fb_helper = fb_helper; @@ -1029,14 +1024,12 @@ int drm_fb_helper_single_fb_probe(struct info->fb_stride = fb_helper->fb->pitches[0]; info->fb_priv = sc; info->enter = &vt_kms_postswitch; -#endif /* set the fb pointer */ for (i = 0; i < fb_helper->crtc_count; i++) { fb_helper->crtc_info[i].mode_set.fb = fb_helper->fb; } -#if defined(__FreeBSD__) if (new_fb) { device_t fbd; int ret; @@ -1052,30 +1045,6 @@ int drm_fb_helper_single_fb_probe(struct DRM_ERROR("Failed to attach fbd device: %d\n", ret); #endif } -#else - if (new_fb) { - info->var.pixclock = 0; - if (register_framebuffer(info) < 0) { - return -EINVAL; - } - - printf("fb%d: %s frame buffer device\n", info->node, - info->fix.id); - - } else { - drm_fb_helper_set_par(info); - } - - /* Switch back to kernel console on panic */ - /* multi card linked list maybe */ - if (list_empty(&kernel_fb_helper_list)) { - printf("drm: registered panic notifier\n"); - atomic_notifier_chain_register(&panic_notifier_list, - &paniced); - } - if (new_fb) - list_add(&fb_helper->kernel_fb_list, &kernel_fb_helper_list); -#endif return 0; } From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 09:02:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C897AC76; Tue, 22 Jul 2014 09:02:23 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id 8C4272DCD; Tue, 22 Jul 2014 09:02:23 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id 7254C20E7088C; Tue, 22 Jul 2014 09:02:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: ** X-Spam-Status: No, score=2.2 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,HELO_NO_DOMAIN,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no version=3.3.1 Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTPS id 2731520E70886; Tue, 22 Jul 2014 09:02:11 +0000 (UTC) Message-ID: <6B8002A135E04714BC8E5F3B41DD2AFF@multiplay.co.uk> From: "Steven Hartland" To: "Xin LI" , , , References: <201407220837.s6M8b12u057751@svn.freebsd.org> Subject: Re: svn commit: r268980 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys Date: Tue, 22 Jul 2014 10:02:10 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 09:02:23 -0000 Nice catch, that could well be the cause of the "Solaris Assert/zio.c:2548" panics don't you think? Regards Steve ----- Original Message ----- From: "Xin LI" To: ; ; Sent: Tuesday, July 22, 2014 9:37 AM Subject: svn commit: r268980 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys > Author: delphij > Date: Tue Jul 22 08:37:01 2014 > New Revision: 268980 > URL: http://svnweb.freebsd.org/changeset/base/268980 > > Log: > Correct typo introduced with r268855. > > MFC after: 10 days > X-MFC with: r268855 > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Tue Jul 22 06:40:27 2014 (r268979) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Tue Jul 22 08:37:01 2014 (r268980) > @@ -208,7 +208,7 @@ enum zio_flag { > ZIO_FLAG_NOPWRITE = 1 << 26, > ZIO_FLAG_REEXECUTED = 1 << 27, > ZIO_FLAG_DELEGATED = 1 << 28, > - ZIO_FLAG_QUEUE_IO_DONE = 1 << 28, > + ZIO_FLAG_QUEUE_IO_DONE = 1 << 29, > }; > > #define ZIO_FLAG_MUSTSUCCEED 0 > > From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 12:00:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1F48A82; Tue, 22 Jul 2014 12:00:00 +0000 (UTC) Received: from mail-we0-x235.google.com (mail-we0-x235.google.com [IPv6:2a00:1450:400c:c03::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BEDDA2CE2; Tue, 22 Jul 2014 11:59:59 +0000 (UTC) Received: by mail-we0-f181.google.com with SMTP id k48so7721801wev.26 for ; Tue, 22 Jul 2014 04:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=QE/wyDuFBC0KG4lqOEGK6UWWd45Jno9jeX0x2GL5rks=; b=e/H7EXNRQpWZ6oN1M8IqZp52hYEhcBVHRIWZMuvnzVf8ML/++nze+GTL/Aknle8ruE PwNZPGMxRzdqDYp02qj4j0CWvu2lFvDjuKAUckRial6VBn9Aox+/bIZLXlKL8ukv1/Rb f7SiyTDnYFZmCqneL/R2rsqpcKGJYhlHRe6gzM1ukqVIEHmIBsEd8ugiUHQCaxzx/vFy CX3buLV985ZBhXj8HromVc9yM0elIQFAXRIPFmwODJFAjW1Y13esi4SDLNSYRJ7g8u1z /gVStcDKGmDRjdtl7ZQZ8LB5ujEpR3lN4t3Ooblbb17iXYQVyM+FonQx4Q6KEVCDZcvN 5Dbg== X-Received: by 10.180.95.166 with SMTP id dl6mr14296842wib.15.1406030397417; Tue, 22 Jul 2014 04:59:57 -0700 (PDT) Received: from [172.16.1.30] (39.Red-2-136-52.dynamicIP.rima-tde.net. [2.136.52.39]) by mx.google.com with ESMTPSA id wv8sm526262wjb.1.2014.07.22.04.59.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Jul 2014 04:59:56 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Message-ID: <53CE5238.5030106@FreeBSD.org> Date: Tue, 22 Jul 2014 13:59:52 +0200 From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r268158 - in head/sys: amd64/amd64 kern sys References: <201407021324.s62DOMfa065093@svn.freebsd.org> In-Reply-To: <201407021324.s62DOMfa065093@svn.freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 12:00:00 -0000 On 02/07/14 15:24, Ed Maste wrote: > Author: emaste > Date: Wed Jul 2 13:24:21 2014 > New Revision: 268158 > URL: http://svnweb.freebsd.org/changeset/base/268158 > > Log: > Prefer vt(4) for UEFI boot > > The UEFI framebuffer driver vt_efifb requires vt(4), so add a mechanism > for the startup routine to set the preferred console. This change is > ugly because console init happens very early in the boot, making a > cleaner interface difficult. This change is intended only to facilitate > the sc(4) / vt(4) transition, and can be reverted once vt(4) is the > default. > > Modified: > head/sys/amd64/amd64/machdep.c > head/sys/kern/kern_cons.c > head/sys/sys/cons.h > > Modified: head/sys/amd64/amd64/machdep.c > ============================================================================== > --- head/sys/amd64/amd64/machdep.c Wed Jul 2 13:09:26 2014 (r268157) > +++ head/sys/amd64/amd64/machdep.c Wed Jul 2 13:24:21 2014 (r268158) > @@ -1955,6 +1955,14 @@ hammer_time(u_int64_t modulep, u_int64_t > clock_init(); > > /* > + * Use vt(4) by default for UEFI boot (during the sc(4)/vt(4) > + * transition). > + */ > + if (preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP) != > + NULL) > + vty_set_preferred(VTY_VT); I think a kmdp != NULL check should be added here, because on Xen PVH guests kmdp == NULL. Roger. From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 13:58:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71C22800; Tue, 22 Jul 2014 13:58:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F90C28B1; Tue, 22 Jul 2014 13:58:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MDwYa5002042; Tue, 22 Jul 2014 13:58:34 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MDwYfG002041; Tue, 22 Jul 2014 13:58:34 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201407221358.s6MDwYfG002041@svn.freebsd.org> From: Ed Maste Date: Tue, 22 Jul 2014 13:58:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268982 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 13:58:34 -0000 Author: emaste Date: Tue Jul 22 13:58:33 2014 New Revision: 268982 URL: http://svnweb.freebsd.org/changeset/base/268982 Log: Don't pass null kmdp to preload_search_info On Xen PVH guests kmdp == NULL. Submitted by: royger MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Jul 22 08:52:49 2014 (r268981) +++ head/sys/amd64/amd64/machdep.c Tue Jul 22 13:58:33 2014 (r268982) @@ -1958,8 +1958,8 @@ hammer_time(u_int64_t modulep, u_int64_t * Use vt(4) by default for UEFI boot (during the sc(4)/vt(4) * transition). */ - if (preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP) != - NULL) + if (kmdp != NULL && preload_search_info(kmdp, + MODINFO_METADATA | MODINFOMD_EFI_MAP) != NULL) vty_set_preferred(VTY_VT); /* From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 16:10:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C38D9931; Tue, 22 Jul 2014 16:10:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1245275B; Tue, 22 Jul 2014 16:10:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MGAuRF065271; Tue, 22 Jul 2014 16:10:56 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MGAugj065254; Tue, 22 Jul 2014 16:10:56 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407221610.s6MGAugj065254@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 22 Jul 2014 16:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268983 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 16:10:56 -0000 Author: pfg Date: Tue Jul 22 16:10:56 2014 New Revision: 268983 URL: http://svnweb.freebsd.org/changeset/base/268983 Log: rewind: always clear error indicator. Required by POSIX: http://pubs.opengroup.org/onlinepubs/009695399/functions/rewind.html Obtained from: Apple Inc. (Libc 997.90.3) MFC after: 1 week Modified: head/lib/libc/stdio/rewind.c Modified: head/lib/libc/stdio/rewind.c ============================================================================== --- head/lib/libc/stdio/rewind.c Tue Jul 22 13:58:33 2014 (r268982) +++ head/lib/libc/stdio/rewind.c Tue Jul 22 16:10:56 2014 (r268983) @@ -53,9 +53,8 @@ rewind(FILE *fp) __sinit(); FLOCKFILE(fp); - if (_fseeko(fp, (off_t)0, SEEK_SET, 1) == 0) { - clearerr_unlocked(fp); + if (_fseeko(fp, (off_t)0, SEEK_SET, 1) == 0) errno = serrno; - } + clearerr_unlocked(fp); /* POSIX: clear stdio error regardless */ FUNLOCKFILE(fp); } From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 16:19:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33835DE1; Tue, 22 Jul 2014 16:19:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20C8627FD; Tue, 22 Jul 2014 16:19:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MGJ1LY068004; Tue, 22 Jul 2014 16:19:01 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MGJ10G068003; Tue, 22 Jul 2014 16:19:01 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407221619.s6MGJ10G068003@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 22 Jul 2014 16:19:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268984 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 16:19:02 -0000 Author: pfg Date: Tue Jul 22 16:19:01 2014 New Revision: 268984 URL: http://svnweb.freebsd.org/changeset/base/268984 Log: ftello: return 1 when seeking offset on an append stream. Obtained from: Apple Inc. (Libc 997.90.3) Phabric: D442 MFC after: 2 weeks Modified: head/lib/libc/stdio/ftell.c Modified: head/lib/libc/stdio/ftell.c ============================================================================== --- head/lib/libc/stdio/ftell.c Tue Jul 22 16:10:56 2014 (r268983) +++ head/lib/libc/stdio/ftell.c Tue Jul 22 16:19:01 2014 (r268984) @@ -97,6 +97,8 @@ _ftello(FILE *fp, fpos_t *offset) * Find offset of underlying I/O object, then * adjust for buffered bytes. */ + if (__sflush(fp)) /* may adjust seek offset on append stream */ + return (1); if (fp->_flags & __SOFF) pos = fp->_offset; else { From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 16:39:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10C479D6; Tue, 22 Jul 2014 16:39:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F20992A55; Tue, 22 Jul 2014 16:39:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MGdBpY077094; Tue, 22 Jul 2014 16:39:11 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MGdB3U077092; Tue, 22 Jul 2014 16:39:11 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407221639.s6MGdB3U077092@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 22 Jul 2014 16:39:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268985 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 16:39:12 -0000 Author: pfg Date: Tue Jul 22 16:39:11 2014 New Revision: 268985 URL: http://svnweb.freebsd.org/changeset/base/268985 Log: Mostly cosmetic cleanups. In fputs() avoid implcit casting on iov.iov_len. MFC after: 3 days Modified: head/lib/libc/stdio/fputs.c head/lib/libc/stdio/puts.c Modified: head/lib/libc/stdio/fputs.c ============================================================================== --- head/lib/libc/stdio/fputs.c Tue Jul 22 16:19:01 2014 (r268984) +++ head/lib/libc/stdio/fputs.c Tue Jul 22 16:39:11 2014 (r268985) @@ -55,7 +55,7 @@ fputs(const char * __restrict s, FILE * struct __siov iov; iov.iov_base = (void *)s; - iov.iov_len = uio.uio_resid = strlen(s); + uio.uio_resid = iov.iov_len = strlen(s); uio.uio_iov = &iov; uio.uio_iovcnt = 1; FLOCKFILE(fp); Modified: head/lib/libc/stdio/puts.c ============================================================================== --- head/lib/libc/stdio/puts.c Tue Jul 22 16:19:01 2014 (r268984) +++ head/lib/libc/stdio/puts.c Tue Jul 22 16:39:11 2014 (r268985) @@ -51,12 +51,12 @@ int puts(char const *s) { int retval; - size_t c = strlen(s); + size_t c; struct __suio uio; struct __siov iov[2]; iov[0].iov_base = (void *)s; - iov[0].iov_len = c; + iov[0].iov_len = c = strlen(s); iov[1].iov_base = "\n"; iov[1].iov_len = 1; uio.uio_resid = c + 1; From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 16:44:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53069D36 for ; Tue, 22 Jul 2014 16:44:49 +0000 (UTC) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com [209.85.217.169]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD6812B10 for ; Tue, 22 Jul 2014 16:44:48 +0000 (UTC) Received: by mail-lb0-f169.google.com with SMTP id s7so6256220lbd.14 for ; Tue, 22 Jul 2014 09:44:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=DoRe0Y0C72NGvWraBvzaDi4LuH2RBXEDmhsIlbk3+x0=; b=dURWl9EVlUHPvLpCbBC9HIsfk0x//fN+WFcBHqvrIN2jJEDowphEACcKxNRpMzJjbN JPvOixBwZ6R41T7Sjrl+IgSKx5XVT2rBAXtgBV+dtBI9BLfZ9IjMoofJGNVEwAfJ4iev 461lTNU1Rzgfn3iugqWitP4uwVijdDpn24FmAhCgBQEutME7LYZroJ6E5C6jkvlp4ED1 j0li4SdJ6XRbPbNpJ8Fnn7dZeC2isKSSHESh1twg3LACf4Mq8F6X30Tgg4Gej08aSEMh eA/7CfvQQH44+yTNaCBxwxG6pXg8Jos/hYlXwQB/0BEpUU/xAmfqjDSdi06HX74YSKvd NvFw== X-Gm-Message-State: ALoCoQl4H8HvJ8eGRwFwA9DOkBrJpAXRjf/0JsS2fEoArMZWECinLuUk6w22UrTkT8lyR6xv+4E8 X-Received: by 10.152.25.229 with SMTP id f5mr13472857lag.87.1406047486378; Tue, 22 Jul 2014 09:44:46 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id xm1sm1283864lbb.15.2014.07.22.09.44.45 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Jul 2014 09:44:45 -0700 (PDT) Message-ID: <53CE94F6.3090003@freebsd.org> Date: Tue, 22 Jul 2014 20:44:38 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r268984 - head/lib/libc/stdio References: <201407221619.s6MGJ10G068003@svn.freebsd.org> In-Reply-To: <201407221619.s6MGJ10G068003@svn.freebsd.org> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 16:44:49 -0000 Producing physical writes on ftell cause great performance degradation. You should check for __SAPP flag before calling sflush to do this only for append-mode files. On 22.07.2014 20:19, Pedro F. Giffuni wrote: > Author: pfg > Date: Tue Jul 22 16:19:01 2014 > New Revision: 268984 > URL: http://svnweb.freebsd.org/changeset/base/268984 > > Log: > ftello: return 1 when seeking offset on an append stream. > > Obtained from: Apple Inc. (Libc 997.90.3) > Phabric: D442 > MFC after: 2 weeks > > Modified: > head/lib/libc/stdio/ftell.c > > Modified: head/lib/libc/stdio/ftell.c > ============================================================================== > --- head/lib/libc/stdio/ftell.c Tue Jul 22 16:10:56 2014 (r268983) > +++ head/lib/libc/stdio/ftell.c Tue Jul 22 16:19:01 2014 (r268984) > @@ -97,6 +97,8 @@ _ftello(FILE *fp, fpos_t *offset) > * Find offset of underlying I/O object, then > * adjust for buffered bytes. > */ > + if (__sflush(fp)) /* may adjust seek offset on append stream */ > + return (1); > if (fp->_flags & __SOFF) > pos = fp->_offset; > else { > -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 16:56:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A48E023A; Tue, 22 Jul 2014 16:56:51 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id E647C2C40; Tue, 22 Jul 2014 16:56:50 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id CCA7E7280; Tue, 22 Jul 2014 16:56:49 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 4EF5395C; Tue, 22 Jul 2014 18:56:31 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Mateusz Guzik Subject: Re: svn commit: r268745 - in head/usr.bin: . timeout References: <201407160955.s6G9taro084054@svn.freebsd.org> <20140716102908.GA17076@dft-labs.eu> Date: Tue, 22 Jul 2014 18:56:31 +0200 In-Reply-To: <20140716102908.GA17076@dft-labs.eu> (Mateusz Guzik's message of "Wed, 16 Jul 2014 12:29:08 +0200") Message-ID: <86oawh5o3k.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 16:56:51 -0000 Mateusz Guzik writes: > Baptiste Daroussin writes: > > +static sig_atomic_t sig_chld =3D 0; > > +static sig_atomic_t sig_term =3D 0; > > +static sig_atomic_t sig_alrm =3D 0; > > +static sig_atomic_t sig_ign =3D 0; > No reason to se these explicitely to 0. They do however need to be volatile. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 17:08:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48EEE52F for ; Tue, 22 Jul 2014 17:08:18 +0000 (UTC) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com [209.85.217.178]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2E5C2D26 for ; Tue, 22 Jul 2014 17:08:17 +0000 (UTC) Received: by mail-lb0-f178.google.com with SMTP id c11so5359507lbj.37 for ; Tue, 22 Jul 2014 10:08:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=H7y5JUzll25UFuY4vrxkYp/iwWUzSSyPh3K1yLYiBQ0=; b=j8RcNlk4Vrfhc6XOzumzhZz9wi6xX07r+KfAdz8THfbdSK+jchLFEWXMrcdCHOvtTT LQlWQ3RUooyQul5j74DHZQ5PJjUrTX/aeIlYIJj6i2DwceqNLSdmNpSrKtBR/PdOt2KL 8AQD5JdNB/0jT6hsi+q4ejfvSYAnzgptshbyB7eqHyYT4D4lTuRRRiqJcstrg12w62AA csQ+OLbeAx3DypT5fZcHB1Dl7xEjQpFDa4/9qo+C5RBELlkAJxZH5iwuyje+bewceLUa y95S7pKUY0TmLvrRdc7WE6C05cWNti4eVDFaRIydAEJkiQkJDrvBj1E1Cg1jgAPC/cUo Ei+w== X-Gm-Message-State: ALoCoQmIc/Jen6HddofVZRT71IhkIrfdaJKP2JBSj/TIMXhUT7SfT5qfX8cJhlCr1iPw1vOpjsDJ X-Received: by 10.112.157.68 with SMTP id wk4mr13378712lbb.85.1406048895509; Tue, 22 Jul 2014 10:08:15 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id c7sm1349742lbd.37.2014.07.22.10.08.14 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Jul 2014 10:08:14 -0700 (PDT) Message-ID: <53CE9A77.4060000@freebsd.org> Date: Tue, 22 Jul 2014 21:08:07 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r268984 - head/lib/libc/stdio References: <201407221619.s6MGJ10G068003@svn.freebsd.org> <53CE94F6.3090003@freebsd.org> In-Reply-To: <53CE94F6.3090003@freebsd.org> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 17:08:18 -0000 On 22.07.2014 20:44, Andrey Chernov wrote: > Producing physical writes on ftell cause great performance degradation. > You should check for __SAPP flag before calling sflush to do this only > for append-mode files. BTW, I believe that sflush() should be completely eliminated even for _SAPP case. Something like that instead: if (fp->_flags & __SAPP) { pos = _sseek(fp, (fpos_t)0, SEEK_END); if (pos == -1) return (1); } else if (fp->_flags & __SOFF) pos = fp->_offset; else { pos = _sseek(fp, (fpos_t)0, SEEK_CUR); if (pos == -1) return (1); } > > On 22.07.2014 20:19, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Tue Jul 22 16:19:01 2014 >> New Revision: 268984 >> URL: http://svnweb.freebsd.org/changeset/base/268984 >> >> Log: >> ftello: return 1 when seeking offset on an append stream. >> >> Obtained from: Apple Inc. (Libc 997.90.3) >> Phabric: D442 >> MFC after: 2 weeks >> >> Modified: >> head/lib/libc/stdio/ftell.c >> >> Modified: head/lib/libc/stdio/ftell.c >> ============================================================================== >> --- head/lib/libc/stdio/ftell.c Tue Jul 22 16:10:56 2014 (r268983) >> +++ head/lib/libc/stdio/ftell.c Tue Jul 22 16:19:01 2014 (r268984) >> @@ -97,6 +97,8 @@ _ftello(FILE *fp, fpos_t *offset) >> * Find offset of underlying I/O object, then >> * adjust for buffered bytes. >> */ >> + if (__sflush(fp)) /* may adjust seek offset on append stream */ >> + return (1); >> if (fp->_flags & __SOFF) >> pos = fp->_offset; >> else { >> > > -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 17:30:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56CDBBD9; Tue, 22 Jul 2014 17:30:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 429302EFC; Tue, 22 Jul 2014 17:30:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MHU6VV099772; Tue, 22 Jul 2014 17:30:06 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MHU6Ej099771; Tue, 22 Jul 2014 17:30:06 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407221730.s6MHU6Ej099771@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 22 Jul 2014 17:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268986 - head/sys/geom/uzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 17:30:06 -0000 Author: marcel Date: Tue Jul 22 17:30:05 2014 New Revision: 268986 URL: http://svnweb.freebsd.org/changeset/base/268986 Log: In r264504, we prevented doing I/O for more than MAXPHYS by making the assumption that consumers would respect bio_completed and/or bio_resid to detect short reads. This assumption proved false and file corruption was the result. Create as many bios as we need to satisfy the original request. Check the cached chunk every time we need to do I/O to increase the hit rate. Obtained from: junipre Networks, Inc. MFC after: 1 week Modified: head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Tue Jul 22 16:39:11 2014 (r268985) +++ head/sys/geom/uzip/g_uzip.c Tue Jul 22 17:30:05 2014 (r268986) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2004 Max Khon + * Copyright (c) 2014 Juniper Networks, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -86,6 +87,8 @@ struct g_uzip_softc { int req_cached; /* cached requests */ }; +static void g_uzip_done(struct bio *bp); + static void g_uzip_softc_free(struct g_uzip_softc *sc, struct g_geom *gp) { @@ -120,213 +123,229 @@ z_free(void *nil, void *ptr) free(ptr, M_GEOM_UZIP); } +static int +g_uzip_cached(struct g_geom *gp, struct bio *bp) +{ + struct g_uzip_softc *sc; + off_t ofs; + size_t blk, blkofs, usz; + + sc = gp->softc; + ofs = bp->bio_offset + bp->bio_completed; + blk = ofs / sc->blksz; + mtx_lock(&sc->last_mtx); + if (blk == sc->last_blk) { + blkofs = ofs % sc->blksz; + usz = sc->blksz - blkofs; + if (bp->bio_resid < usz) + usz = bp->bio_resid; + memcpy(bp->bio_data + bp->bio_completed, sc->last_buf + blkofs, + usz); + sc->req_cached++; + mtx_unlock(&sc->last_mtx); + + DPRINTF(("%s/%s: %p: offset=%jd: got %jd bytes from cache\n", + __func__, gp->name, bp, (intmax_t)ofs, (intmax_t)usz)); + + bp->bio_completed += usz; + bp->bio_resid -= usz; + + if (bp->bio_resid == 0) { + g_io_deliver(bp, 0); + return (1); + } + } else + mtx_unlock(&sc->last_mtx); + + return (0); +} + +static int +g_uzip_request(struct g_geom *gp, struct bio *bp) +{ + struct g_uzip_softc *sc; + struct bio *bp2; + struct g_consumer *cp; + struct g_provider *pp; + off_t ofs; + size_t start_blk, end_blk; + + if (g_uzip_cached(gp, bp) != 0) + return (1); + + sc = gp->softc; + + bp2 = g_clone_bio(bp); + if (bp2 == NULL) { + g_io_deliver(bp, ENOMEM); + return (1); + } + bp2->bio_done = g_uzip_done; + + cp = LIST_FIRST(&gp->consumer); + pp = cp->provider; + + ofs = bp->bio_offset + bp->bio_completed; + start_blk = ofs / sc->blksz; + KASSERT(start_blk < sc->nblocks, ("start_blk out of range")); + end_blk = (ofs + bp->bio_resid + sc->blksz - 1) / sc->blksz; + KASSERT(end_blk <= sc->nblocks, ("end_blk out of range")); + + DPRINTF(("%s/%s: %p: start=%u (%jd), end=%u (%jd)\n", + __func__, gp->name, bp, + (u_int)start_blk, (intmax_t)sc->offsets[start_blk], + (u_int)end_blk, (intmax_t)sc->offsets[end_blk])); + + bp2->bio_offset = sc->offsets[start_blk] - + sc->offsets[start_blk] % pp->sectorsize; + while (1) { + bp2->bio_length = sc->offsets[end_blk] - bp2->bio_offset; + bp2->bio_length = (bp2->bio_length + pp->sectorsize - 1) / + pp->sectorsize * pp->sectorsize; + if (bp2->bio_length <= MAXPHYS) + break; + + end_blk--; + } + + bp2->bio_data = malloc(bp2->bio_length, M_GEOM_UZIP, M_NOWAIT); + if (bp2->bio_data == NULL) { + g_destroy_bio(bp2); + g_io_deliver(bp, ENOMEM); + return (1); + } + + DPRINTF(("%s/%s: %p: reading %jd bytes from offset %jd\n", + __func__, gp->name, bp, + (intmax_t)bp2->bio_length, (intmax_t)bp2->bio_offset)); + + g_io_request(bp2, cp); + return (0); +} + static void g_uzip_done(struct bio *bp) { - int err; - struct bio *bp2; z_stream zs; - struct g_provider *pp, *pp2; + struct bio *bp2; + struct g_provider *pp; struct g_consumer *cp; struct g_geom *gp; struct g_uzip_softc *sc; - off_t iolen, pos, upos; - uint32_t start_blk, i; - size_t bsize; + char *data, *data2; + off_t ofs; + size_t blk, blkofs, len, ulen; bp2 = bp->bio_parent; - pp = bp2->bio_to; - gp = pp->geom; - cp = LIST_FIRST(&gp->consumer); - pp2 = cp->provider; + gp = bp2->bio_to->geom; sc = gp->softc; - DPRINTF(("%s: done\n", gp->name)); + + cp = LIST_FIRST(&gp->consumer); + pp = cp->provider; bp2->bio_error = bp->bio_error; if (bp2->bio_error != 0) goto done; - /* - * Uncompress data. - */ + /* Make sure there's forward progress. */ + if (bp->bio_completed == 0) { + bp2->bio_error = ECANCELED; + goto done; + } + zs.zalloc = z_alloc; zs.zfree = z_free; - err = inflateInit(&zs); - if (err != Z_OK) { - bp2->bio_error = EIO; + if (inflateInit(&zs) != Z_OK) { + bp2->bio_error = EILSEQ; goto done; } - start_blk = bp2->bio_offset / sc->blksz; - bsize = pp2->sectorsize; - iolen = bp->bio_completed; - pos = sc->offsets[start_blk] % bsize; - upos = 0; - DPRINTF(("%s: done: start_blk %d, pos %jd, upos %jd, iolen %jd " - "(%jd, %d, %zd)\n", - gp->name, start_blk, (intmax_t)pos, (intmax_t)upos, - (intmax_t)iolen, (intmax_t)bp2->bio_offset, sc->blksz, bsize)); - for (i = start_blk; upos < bp2->bio_length; i++) { - off_t len, ulen, uoff; - - uoff = i == start_blk ? bp2->bio_offset % sc->blksz : 0; - ulen = MIN(sc->blksz - uoff, bp2->bio_length - upos); - len = sc->offsets[i + 1] - sc->offsets[i]; + ofs = bp2->bio_offset + bp2->bio_completed; + blk = ofs / sc->blksz; + blkofs = ofs % sc->blksz; + data = bp->bio_data + sc->offsets[blk] % pp->sectorsize; + data2 = bp2->bio_data + bp2->bio_completed; + while (bp->bio_completed && bp2->bio_resid) { + ulen = MIN(sc->blksz - blkofs, bp2->bio_resid); + len = sc->offsets[blk + 1] - sc->offsets[blk]; + DPRINTF(("%s/%s: %p/%ju: data2=%p, ulen=%u, data=%p, len=%u\n", + __func__, gp->name, gp, bp->bio_completed, + data2, (u_int)ulen, data, (u_int)len)); if (len == 0) { /* All zero block: no cache update */ - bzero(bp2->bio_data + upos, ulen); - upos += ulen; - bp2->bio_completed += ulen; - continue; - } - if (len > iolen) { - DPRINTF(("%s: done: early termination: len (%jd) > " - "iolen (%jd)\n", - gp->name, (intmax_t)len, (intmax_t)iolen)); - break; - } - zs.next_in = bp->bio_data + pos; - zs.avail_in = len; - zs.next_out = sc->last_buf; - zs.avail_out = sc->blksz; - mtx_lock(&sc->last_mtx); - err = inflate(&zs, Z_FINISH); - if (err != Z_STREAM_END) { - sc->last_blk = -1; + bzero(data2, ulen); + } else if (len <= bp->bio_completed) { + zs.next_in = data; + zs.avail_in = len; + zs.next_out = sc->last_buf; + zs.avail_out = sc->blksz; + mtx_lock(&sc->last_mtx); + if (inflate(&zs, Z_FINISH) != Z_STREAM_END) { + sc->last_blk = -1; + mtx_unlock(&sc->last_mtx); + inflateEnd(&zs); + bp2->bio_error = EILSEQ; + goto done; + } + sc->last_blk = blk; + memcpy(data2, sc->last_buf + blkofs, ulen); mtx_unlock(&sc->last_mtx); - DPRINTF(("%s: done: inflate failed (%jd + %jd -> %jd + %jd + %jd)\n", - gp->name, (intmax_t)pos, (intmax_t)len, - (intmax_t)uoff, (intmax_t)upos, (intmax_t)ulen)); - inflateEnd(&zs); - bp2->bio_error = EIO; - goto done; - } - sc->last_blk = i; - DPRINTF(("%s: done: inflated %jd + %jd -> %jd + %jd + %jd\n", - gp->name, (intmax_t)pos, (intmax_t)len, (intmax_t)uoff, - (intmax_t)upos, (intmax_t)ulen)); - memcpy(bp2->bio_data + upos, sc->last_buf + uoff, ulen); - mtx_unlock(&sc->last_mtx); + if (inflateReset(&zs) != Z_OK) { + inflateEnd(&zs); + bp2->bio_error = EILSEQ; + goto done; + } + data += len; + } else + break; - pos += len; - iolen -= len; - upos += ulen; + data2 += ulen; bp2->bio_completed += ulen; - err = inflateReset(&zs); - if (err != Z_OK) { - inflateEnd(&zs); - bp2->bio_error = EIO; - goto done; - } - } - err = inflateEnd(&zs); - if (err != Z_OK) { - bp2->bio_error = EIO; - goto done; + bp2->bio_resid -= ulen; + bp->bio_completed -= len; + blkofs = 0; + blk++; } + if (inflateEnd(&zs) != Z_OK) + bp2->bio_error = EILSEQ; + done: - /* - * Finish processing the request. - */ - DPRINTF(("%s: done: (%d, %jd, %ld)\n", - gp->name, bp2->bio_error, (intmax_t)bp2->bio_completed, - bp2->bio_resid)); + /* Finish processing the request. */ free(bp->bio_data, M_GEOM_UZIP); g_destroy_bio(bp); - g_io_deliver(bp2, bp2->bio_error); + if (bp2->bio_error != 0 || bp2->bio_resid == 0) + g_io_deliver(bp2, bp2->bio_error); + else + g_uzip_request(gp, bp2); } static void g_uzip_start(struct bio *bp) { - struct bio *bp2; - struct g_provider *pp, *pp2; + struct g_provider *pp; struct g_geom *gp; - struct g_consumer *cp; struct g_uzip_softc *sc; - uint32_t start_blk, end_blk; - size_t bsize; pp = bp->bio_to; gp = pp->geom; - DPRINTF(("%s: start (%d)\n", gp->name, bp->bio_cmd)); - if (bp->bio_cmd != BIO_READ) { - g_io_deliver(bp, EOPNOTSUPP); - return; - } + DPRINTF(("%s/%s: %p: cmd=%d, offset=%jd, length=%jd, buffer=%p\n", + __func__, gp->name, bp, bp->bio_cmd, (intmax_t)bp->bio_offset, + (intmax_t)bp->bio_length, bp->bio_data)); - cp = LIST_FIRST(&gp->consumer); - pp2 = cp->provider; sc = gp->softc; - - start_blk = bp->bio_offset / sc->blksz; - end_blk = (bp->bio_offset + bp->bio_length + sc->blksz - 1) / sc->blksz; - KASSERT(start_blk < sc->nblocks, ("start_blk out of range")); - KASSERT(end_blk <= sc->nblocks, ("end_blk out of range")); - sc->req_total++; - if (start_blk + 1 == end_blk) { - mtx_lock(&sc->last_mtx); - if (start_blk == sc->last_blk) { - off_t uoff; - - uoff = bp->bio_offset % sc->blksz; - KASSERT(bp->bio_length <= sc->blksz - uoff, - ("cached data error")); - memcpy(bp->bio_data, sc->last_buf + uoff, - bp->bio_length); - sc->req_cached++; - mtx_unlock(&sc->last_mtx); - DPRINTF(("%s: start: cached 0 + %jd, %jd + 0 + %jd\n", - gp->name, (intmax_t)bp->bio_length, (intmax_t)uoff, - (intmax_t)bp->bio_length)); - bp->bio_completed = bp->bio_length; - g_io_deliver(bp, 0); - return; - } - mtx_unlock(&sc->last_mtx); - } - - bp2 = g_clone_bio(bp); - if (bp2 == NULL) { - g_io_deliver(bp, ENOMEM); + if (bp->bio_cmd != BIO_READ) { + g_io_deliver(bp, EOPNOTSUPP); return; } - bp2->bio_done = g_uzip_done; - DPRINTF(("%s: start (%d..%d), %s: %d + %jd, %s: %d + %jd\n", - gp->name, start_blk, end_blk, - pp->name, pp->sectorsize, (intmax_t)pp->mediasize, - pp2->name, pp2->sectorsize, (intmax_t)pp2->mediasize)); - bsize = pp2->sectorsize; - bp2->bio_offset = sc->offsets[start_blk] - sc->offsets[start_blk] % bsize; - while (1) { - bp2->bio_length = sc->offsets[end_blk] - bp2->bio_offset; - bp2->bio_length = (bp2->bio_length + bsize - 1) / bsize * bsize; - if (bp2->bio_length < MAXPHYS) - break; - end_blk--; - DPRINTF(("%s: bio_length (%jd) > MAXPHYS: lowering end_blk " - "to %u\n", gp->name, (intmax_t)bp2->bio_length, end_blk)); - } - DPRINTF(("%s: start %jd + %jd -> %ju + %ju -> %jd + %jd\n", - gp->name, - (intmax_t)bp->bio_offset, (intmax_t)bp->bio_length, - (uintmax_t)sc->offsets[start_blk], - (uintmax_t)sc->offsets[end_blk] - sc->offsets[start_blk], - (intmax_t)bp2->bio_offset, (intmax_t)bp2->bio_length)); - bp2->bio_data = malloc(bp2->bio_length, M_GEOM_UZIP, M_NOWAIT); - if (bp2->bio_data == NULL) { - g_destroy_bio(bp2); - g_io_deliver(bp, ENOMEM); - return; - } + bp->bio_resid = bp->bio_length; + bp->bio_completed = 0; - g_io_request(bp2, cp); - DPRINTF(("%s: start ok\n", gp->name)); + g_uzip_request(gp, bp); } static void From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 17:42:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8AEE04E8 for ; Tue, 22 Jul 2014 17:42:51 +0000 (UTC) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E675D20A4 for ; Tue, 22 Jul 2014 17:42:50 +0000 (UTC) Received: by mail-lb0-f180.google.com with SMTP id v6so5911176lbi.25 for ; Tue, 22 Jul 2014 10:42:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=sEP8FK3/IytSD/lw18c36wnTbBARHlGVahTWGsazclI=; b=BVkphhA14n3oXFlE55iz3xckjOsH2nQgBzp3dwTeD9WZb+aWyvuNmfMmteSkpOl/p9 YYt+cF5kjROU/KaBY/ta5yWShtDsIC2wYQNf+feK9YgGbD/b0PPxMnMw/g/j/n6Zyi6Q OJc4urvdfegUCHBTEsK7A9gUuWY7wwMxZZRZiQAdj4+eYLJWZLYxchaQ4nV1wjPa85iS IFWQM7porroHrQoxlfa0YsTatH+JIXDDzW7Kyka1yYQlMozlYQMCMR/Mic88y3loO83L 3reXnPRvJEwiII+/R34INyBCgZ/j7VaxbNF7K4KkPIA2MM+oxp0910hTC6IX82JgMO7N vWCg== X-Gm-Message-State: ALoCoQly5CBtTLN3TXZmnsDf1DdEbLY5CoBEBpP6HB/F/Kb+4rYd5Qeevu1cbU7JB6fDjo+4oBsn X-Received: by 10.112.202.39 with SMTP id kf7mr34982350lbc.37.1406050962880; Tue, 22 Jul 2014 10:42:42 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id uo5sm1488403lbb.6.2014.07.22.10.42.42 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Jul 2014 10:42:42 -0700 (PDT) Message-ID: <53CEA28A.3040106@freebsd.org> Date: Tue, 22 Jul 2014 21:42:34 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r268984 - head/lib/libc/stdio References: <201407221619.s6MGJ10G068003@svn.freebsd.org> <53CE94F6.3090003@freebsd.org> <53CE9A77.4060000@freebsd.org> In-Reply-To: <53CE9A77.4060000@freebsd.org> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 17:42:51 -0000 On 22.07.2014 21:08, Andrey Chernov wrote: > On 22.07.2014 20:44, Andrey Chernov wrote: >> Producing physical writes on ftell cause great performance degradation. >> You should check for __SAPP flag before calling sflush to do this only >> for append-mode files. > > BTW, I believe that sflush() should be completely eliminated even for > _SAPP case. Something like that instead: Proper patch to the old version: --- ftell.c.bak 2014-07-22 21:25:46.000000000 +0400 +++ ftell.c 2014-07-22 21:28:01.000000000 +0400 @@ -118,6 +118,11 @@ if (HASUB(fp)) pos -= fp->_r; /* Can be negative at this point. */ } else if ((fp->_flags & __SWR) && fp->_p != NULL) { + if (fp->_flags & __SAPP) { + pos = _sseek(fp, (fpos_t)0, SEEK_END); + if (pos == -1) + return (1); + } /* * Writing. Any buffered characters cause the * position to be greater than that in the Forget the code below, it breaks reading: > if (fp->_flags & __SAPP) { > pos = _sseek(fp, (fpos_t)0, SEEK_END); > if (pos == -1) > return (1); > } else if (fp->_flags & __SOFF) > pos = fp->_offset; > else { > pos = _sseek(fp, (fpos_t)0, SEEK_CUR); > if (pos == -1) > return (1); > } > >> >> On 22.07.2014 20:19, Pedro F. Giffuni wrote: >>> Author: pfg >>> Date: Tue Jul 22 16:19:01 2014 >>> New Revision: 268984 >>> URL: http://svnweb.freebsd.org/changeset/base/268984 >>> >>> Log: >>> ftello: return 1 when seeking offset on an append stream. >>> >>> Obtained from: Apple Inc. (Libc 997.90.3) >>> Phabric: D442 >>> MFC after: 2 weeks >>> >>> Modified: >>> head/lib/libc/stdio/ftell.c >>> >>> Modified: head/lib/libc/stdio/ftell.c >>> ============================================================================== >>> --- head/lib/libc/stdio/ftell.c Tue Jul 22 16:10:56 2014 (r268983) >>> +++ head/lib/libc/stdio/ftell.c Tue Jul 22 16:19:01 2014 (r268984) >>> @@ -97,6 +97,8 @@ _ftello(FILE *fp, fpos_t *offset) >>> * Find offset of underlying I/O object, then >>> * adjust for buffered bytes. >>> */ >>> + if (__sflush(fp)) /* may adjust seek offset on append stream */ >>> + return (1); >>> if (fp->_flags & __SOFF) >>> pos = fp->_offset; >>> else { >>> >> >> > > -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 17:46:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9A756EA; Tue, 22 Jul 2014 17:46:25 +0000 (UTC) Received: from mail-qa0-x22c.google.com (mail-qa0-x22c.google.com [IPv6:2607:f8b0:400d:c00::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 667EA20D5; Tue, 22 Jul 2014 17:46:25 +0000 (UTC) Received: by mail-qa0-f44.google.com with SMTP id f12so6896071qad.17 for ; Tue, 22 Jul 2014 10:46:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=2fy8R9+jKN3aW2V3VtciuZTzS/yErvy1qqnmYv3X30U=; b=pv8ysDER1KxZn/+dZFa/BHE4bwJ635rWgc4xogk3Zvfll6zFeD0wYV5QT0zrhVUDkX PsNHY7yP34ZPR8v3YMyPqhMsKteIgqM1tF1Ckz8YWeVhZG2kIJn+iVQ34XkNAO0M7PyG bZbe3btYhfR/KFJceCa4lrP7jL8T8PF9vacvuR3WgbtJdydsMpTM0XaMxkgjsAuWFm93 rqUA/erIxnTZTpu7g8eLfIlsvxFj+k3uW9PfedfzHtb6QPE3tf8VLLk7WKPa1OJR7Oqs V9vfl5ZoYlkELTvLH2jbFCYMUzXxHOKvuTMF+HfTmsMoWd06IIkZVvSs7mjrJKc/DL0Z WPFQ== MIME-Version: 1.0 X-Received: by 10.224.171.197 with SMTP id i5mr59637428qaz.55.1406051184510; Tue, 22 Jul 2014 10:46:24 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.1.6 with HTTP; Tue, 22 Jul 2014 10:46:24 -0700 (PDT) In-Reply-To: <201407221730.s6MHU6Ej099771@svn.freebsd.org> References: <201407221730.s6MHU6Ej099771@svn.freebsd.org> Date: Tue, 22 Jul 2014 10:46:24 -0700 X-Google-Sender-Auth: StKa64ZlJ0UVQ5ypVcG0zQddoqc Message-ID: Subject: Re: svn commit: r268986 - head/sys/geom/uzip From: Adrian Chadd To: Marcel Moolenaar Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 17:46:26 -0000 Wait, which consumers failed that test? -a On 22 July 2014 10:30, Marcel Moolenaar wrote: > Author: marcel > Date: Tue Jul 22 17:30:05 2014 > New Revision: 268986 > URL: http://svnweb.freebsd.org/changeset/base/268986 > > Log: > In r264504, we prevented doing I/O for more than MAXPHYS by making > the assumption that consumers would respect bio_completed and/or > bio_resid to detect short reads. This assumption proved false and > file corruption was the result. > Create as many bios as we need to satisfy the original request. > Check the cached chunk every time we need to do I/O to increase the > hit rate. > > Obtained from: junipre Networks, Inc. > MFC after: 1 week > > Modified: > head/sys/geom/uzip/g_uzip.c > > Modified: head/sys/geom/uzip/g_uzip.c > ============================================================================== > --- head/sys/geom/uzip/g_uzip.c Tue Jul 22 16:39:11 2014 (r268985) > +++ head/sys/geom/uzip/g_uzip.c Tue Jul 22 17:30:05 2014 (r268986) > @@ -1,5 +1,6 @@ > /*- > * Copyright (c) 2004 Max Khon > + * Copyright (c) 2014 Juniper Networks, Inc. > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -86,6 +87,8 @@ struct g_uzip_softc { > int req_cached; /* cached requests */ > }; > > +static void g_uzip_done(struct bio *bp); > + > static void > g_uzip_softc_free(struct g_uzip_softc *sc, struct g_geom *gp) > { > @@ -120,213 +123,229 @@ z_free(void *nil, void *ptr) > free(ptr, M_GEOM_UZIP); > } > > +static int > +g_uzip_cached(struct g_geom *gp, struct bio *bp) > +{ > + struct g_uzip_softc *sc; > + off_t ofs; > + size_t blk, blkofs, usz; > + > + sc = gp->softc; > + ofs = bp->bio_offset + bp->bio_completed; > + blk = ofs / sc->blksz; > + mtx_lock(&sc->last_mtx); > + if (blk == sc->last_blk) { > + blkofs = ofs % sc->blksz; > + usz = sc->blksz - blkofs; > + if (bp->bio_resid < usz) > + usz = bp->bio_resid; > + memcpy(bp->bio_data + bp->bio_completed, sc->last_buf + blkofs, > + usz); > + sc->req_cached++; > + mtx_unlock(&sc->last_mtx); > + > + DPRINTF(("%s/%s: %p: offset=%jd: got %jd bytes from cache\n", > + __func__, gp->name, bp, (intmax_t)ofs, (intmax_t)usz)); > + > + bp->bio_completed += usz; > + bp->bio_resid -= usz; > + > + if (bp->bio_resid == 0) { > + g_io_deliver(bp, 0); > + return (1); > + } > + } else > + mtx_unlock(&sc->last_mtx); > + > + return (0); > +} > + > +static int > +g_uzip_request(struct g_geom *gp, struct bio *bp) > +{ > + struct g_uzip_softc *sc; > + struct bio *bp2; > + struct g_consumer *cp; > + struct g_provider *pp; > + off_t ofs; > + size_t start_blk, end_blk; > + > + if (g_uzip_cached(gp, bp) != 0) > + return (1); > + > + sc = gp->softc; > + > + bp2 = g_clone_bio(bp); > + if (bp2 == NULL) { > + g_io_deliver(bp, ENOMEM); > + return (1); > + } > + bp2->bio_done = g_uzip_done; > + > + cp = LIST_FIRST(&gp->consumer); > + pp = cp->provider; > + > + ofs = bp->bio_offset + bp->bio_completed; > + start_blk = ofs / sc->blksz; > + KASSERT(start_blk < sc->nblocks, ("start_blk out of range")); > + end_blk = (ofs + bp->bio_resid + sc->blksz - 1) / sc->blksz; > + KASSERT(end_blk <= sc->nblocks, ("end_blk out of range")); > + > + DPRINTF(("%s/%s: %p: start=%u (%jd), end=%u (%jd)\n", > + __func__, gp->name, bp, > + (u_int)start_blk, (intmax_t)sc->offsets[start_blk], > + (u_int)end_blk, (intmax_t)sc->offsets[end_blk])); > + > + bp2->bio_offset = sc->offsets[start_blk] - > + sc->offsets[start_blk] % pp->sectorsize; > + while (1) { > + bp2->bio_length = sc->offsets[end_blk] - bp2->bio_offset; > + bp2->bio_length = (bp2->bio_length + pp->sectorsize - 1) / > + pp->sectorsize * pp->sectorsize; > + if (bp2->bio_length <= MAXPHYS) > + break; > + > + end_blk--; > + } > + > + bp2->bio_data = malloc(bp2->bio_length, M_GEOM_UZIP, M_NOWAIT); > + if (bp2->bio_data == NULL) { > + g_destroy_bio(bp2); > + g_io_deliver(bp, ENOMEM); > + return (1); > + } > + > + DPRINTF(("%s/%s: %p: reading %jd bytes from offset %jd\n", > + __func__, gp->name, bp, > + (intmax_t)bp2->bio_length, (intmax_t)bp2->bio_offset)); > + > + g_io_request(bp2, cp); > + return (0); > +} > + > static void > g_uzip_done(struct bio *bp) > { > - int err; > - struct bio *bp2; > z_stream zs; > - struct g_provider *pp, *pp2; > + struct bio *bp2; > + struct g_provider *pp; > struct g_consumer *cp; > struct g_geom *gp; > struct g_uzip_softc *sc; > - off_t iolen, pos, upos; > - uint32_t start_blk, i; > - size_t bsize; > + char *data, *data2; > + off_t ofs; > + size_t blk, blkofs, len, ulen; > > bp2 = bp->bio_parent; > - pp = bp2->bio_to; > - gp = pp->geom; > - cp = LIST_FIRST(&gp->consumer); > - pp2 = cp->provider; > + gp = bp2->bio_to->geom; > sc = gp->softc; > - DPRINTF(("%s: done\n", gp->name)); > + > + cp = LIST_FIRST(&gp->consumer); > + pp = cp->provider; > > bp2->bio_error = bp->bio_error; > if (bp2->bio_error != 0) > goto done; > > - /* > - * Uncompress data. > - */ > + /* Make sure there's forward progress. */ > + if (bp->bio_completed == 0) { > + bp2->bio_error = ECANCELED; > + goto done; > + } > + > zs.zalloc = z_alloc; > zs.zfree = z_free; > - err = inflateInit(&zs); > - if (err != Z_OK) { > - bp2->bio_error = EIO; > + if (inflateInit(&zs) != Z_OK) { > + bp2->bio_error = EILSEQ; > goto done; > } > - start_blk = bp2->bio_offset / sc->blksz; > - bsize = pp2->sectorsize; > - iolen = bp->bio_completed; > - pos = sc->offsets[start_blk] % bsize; > - upos = 0; > - DPRINTF(("%s: done: start_blk %d, pos %jd, upos %jd, iolen %jd " > - "(%jd, %d, %zd)\n", > - gp->name, start_blk, (intmax_t)pos, (intmax_t)upos, > - (intmax_t)iolen, (intmax_t)bp2->bio_offset, sc->blksz, bsize)); > - for (i = start_blk; upos < bp2->bio_length; i++) { > - off_t len, ulen, uoff; > - > - uoff = i == start_blk ? bp2->bio_offset % sc->blksz : 0; > - ulen = MIN(sc->blksz - uoff, bp2->bio_length - upos); > - len = sc->offsets[i + 1] - sc->offsets[i]; > > + ofs = bp2->bio_offset + bp2->bio_completed; > + blk = ofs / sc->blksz; > + blkofs = ofs % sc->blksz; > + data = bp->bio_data + sc->offsets[blk] % pp->sectorsize; > + data2 = bp2->bio_data + bp2->bio_completed; > + while (bp->bio_completed && bp2->bio_resid) { > + ulen = MIN(sc->blksz - blkofs, bp2->bio_resid); > + len = sc->offsets[blk + 1] - sc->offsets[blk]; > + DPRINTF(("%s/%s: %p/%ju: data2=%p, ulen=%u, data=%p, len=%u\n", > + __func__, gp->name, gp, bp->bio_completed, > + data2, (u_int)ulen, data, (u_int)len)); > if (len == 0) { > /* All zero block: no cache update */ > - bzero(bp2->bio_data + upos, ulen); > - upos += ulen; > - bp2->bio_completed += ulen; > - continue; > - } > - if (len > iolen) { > - DPRINTF(("%s: done: early termination: len (%jd) > " > - "iolen (%jd)\n", > - gp->name, (intmax_t)len, (intmax_t)iolen)); > - break; > - } > - zs.next_in = bp->bio_data + pos; > - zs.avail_in = len; > - zs.next_out = sc->last_buf; > - zs.avail_out = sc->blksz; > - mtx_lock(&sc->last_mtx); > - err = inflate(&zs, Z_FINISH); > - if (err != Z_STREAM_END) { > - sc->last_blk = -1; > + bzero(data2, ulen); > + } else if (len <= bp->bio_completed) { > + zs.next_in = data; > + zs.avail_in = len; > + zs.next_out = sc->last_buf; > + zs.avail_out = sc->blksz; > + mtx_lock(&sc->last_mtx); > + if (inflate(&zs, Z_FINISH) != Z_STREAM_END) { > + sc->last_blk = -1; > + mtx_unlock(&sc->last_mtx); > + inflateEnd(&zs); > + bp2->bio_error = EILSEQ; > + goto done; > + } > + sc->last_blk = blk; > + memcpy(data2, sc->last_buf + blkofs, ulen); > mtx_unlock(&sc->last_mtx); > - DPRINTF(("%s: done: inflate failed (%jd + %jd -> %jd + %jd + %jd)\n", > - gp->name, (intmax_t)pos, (intmax_t)len, > - (intmax_t)uoff, (intmax_t)upos, (intmax_t)ulen)); > - inflateEnd(&zs); > - bp2->bio_error = EIO; > - goto done; > - } > - sc->last_blk = i; > - DPRINTF(("%s: done: inflated %jd + %jd -> %jd + %jd + %jd\n", > - gp->name, (intmax_t)pos, (intmax_t)len, (intmax_t)uoff, > - (intmax_t)upos, (intmax_t)ulen)); > - memcpy(bp2->bio_data + upos, sc->last_buf + uoff, ulen); > - mtx_unlock(&sc->last_mtx); > + if (inflateReset(&zs) != Z_OK) { > + inflateEnd(&zs); > + bp2->bio_error = EILSEQ; > + goto done; > + } > + data += len; > + } else > + break; > > - pos += len; > - iolen -= len; > - upos += ulen; > + data2 += ulen; > bp2->bio_completed += ulen; > - err = inflateReset(&zs); > - if (err != Z_OK) { > - inflateEnd(&zs); > - bp2->bio_error = EIO; > - goto done; > - } > - } > - err = inflateEnd(&zs); > - if (err != Z_OK) { > - bp2->bio_error = EIO; > - goto done; > + bp2->bio_resid -= ulen; > + bp->bio_completed -= len; > + blkofs = 0; > + blk++; > } > > + if (inflateEnd(&zs) != Z_OK) > + bp2->bio_error = EILSEQ; > + > done: > - /* > - * Finish processing the request. > - */ > - DPRINTF(("%s: done: (%d, %jd, %ld)\n", > - gp->name, bp2->bio_error, (intmax_t)bp2->bio_completed, > - bp2->bio_resid)); > + /* Finish processing the request. */ > free(bp->bio_data, M_GEOM_UZIP); > g_destroy_bio(bp); > - g_io_deliver(bp2, bp2->bio_error); > + if (bp2->bio_error != 0 || bp2->bio_resid == 0) > + g_io_deliver(bp2, bp2->bio_error); > + else > + g_uzip_request(gp, bp2); > } > > static void > g_uzip_start(struct bio *bp) > { > - struct bio *bp2; > - struct g_provider *pp, *pp2; > + struct g_provider *pp; > struct g_geom *gp; > - struct g_consumer *cp; > struct g_uzip_softc *sc; > - uint32_t start_blk, end_blk; > - size_t bsize; > > pp = bp->bio_to; > gp = pp->geom; > - DPRINTF(("%s: start (%d)\n", gp->name, bp->bio_cmd)); > > - if (bp->bio_cmd != BIO_READ) { > - g_io_deliver(bp, EOPNOTSUPP); > - return; > - } > + DPRINTF(("%s/%s: %p: cmd=%d, offset=%jd, length=%jd, buffer=%p\n", > + __func__, gp->name, bp, bp->bio_cmd, (intmax_t)bp->bio_offset, > + (intmax_t)bp->bio_length, bp->bio_data)); > > - cp = LIST_FIRST(&gp->consumer); > - pp2 = cp->provider; > sc = gp->softc; > - > - start_blk = bp->bio_offset / sc->blksz; > - end_blk = (bp->bio_offset + bp->bio_length + sc->blksz - 1) / sc->blksz; > - KASSERT(start_blk < sc->nblocks, ("start_blk out of range")); > - KASSERT(end_blk <= sc->nblocks, ("end_blk out of range")); > - > sc->req_total++; > - if (start_blk + 1 == end_blk) { > - mtx_lock(&sc->last_mtx); > - if (start_blk == sc->last_blk) { > - off_t uoff; > - > - uoff = bp->bio_offset % sc->blksz; > - KASSERT(bp->bio_length <= sc->blksz - uoff, > - ("cached data error")); > - memcpy(bp->bio_data, sc->last_buf + uoff, > - bp->bio_length); > - sc->req_cached++; > - mtx_unlock(&sc->last_mtx); > > - DPRINTF(("%s: start: cached 0 + %jd, %jd + 0 + %jd\n", > - gp->name, (intmax_t)bp->bio_length, (intmax_t)uoff, > - (intmax_t)bp->bio_length)); > - bp->bio_completed = bp->bio_length; > - g_io_deliver(bp, 0); > - return; > - } > - mtx_unlock(&sc->last_mtx); > - } > - > - bp2 = g_clone_bio(bp); > - if (bp2 == NULL) { > - g_io_deliver(bp, ENOMEM); > + if (bp->bio_cmd != BIO_READ) { > + g_io_deliver(bp, EOPNOTSUPP); > return; > } > - bp2->bio_done = g_uzip_done; > - DPRINTF(("%s: start (%d..%d), %s: %d + %jd, %s: %d + %jd\n", > - gp->name, start_blk, end_blk, > - pp->name, pp->sectorsize, (intmax_t)pp->mediasize, > - pp2->name, pp2->sectorsize, (intmax_t)pp2->mediasize)); > - bsize = pp2->sectorsize; > - bp2->bio_offset = sc->offsets[start_blk] - sc->offsets[start_blk] % bsize; > - while (1) { > - bp2->bio_length = sc->offsets[end_blk] - bp2->bio_offset; > - bp2->bio_length = (bp2->bio_length + bsize - 1) / bsize * bsize; > - if (bp2->bio_length < MAXPHYS) > - break; > > - end_blk--; > - DPRINTF(("%s: bio_length (%jd) > MAXPHYS: lowering end_blk " > - "to %u\n", gp->name, (intmax_t)bp2->bio_length, end_blk)); > - } > - DPRINTF(("%s: start %jd + %jd -> %ju + %ju -> %jd + %jd\n", > - gp->name, > - (intmax_t)bp->bio_offset, (intmax_t)bp->bio_length, > - (uintmax_t)sc->offsets[start_blk], > - (uintmax_t)sc->offsets[end_blk] - sc->offsets[start_blk], > - (intmax_t)bp2->bio_offset, (intmax_t)bp2->bio_length)); > - bp2->bio_data = malloc(bp2->bio_length, M_GEOM_UZIP, M_NOWAIT); > - if (bp2->bio_data == NULL) { > - g_destroy_bio(bp2); > - g_io_deliver(bp, ENOMEM); > - return; > - } > + bp->bio_resid = bp->bio_length; > + bp->bio_completed = 0; > > - g_io_request(bp2, cp); > - DPRINTF(("%s: start ok\n", gp->name)); > + g_uzip_request(gp, bp); > } > > static void > From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 17:48:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BFE9862; Tue, 22 Jul 2014 17:48:02 +0000 (UTC) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 056CF20E6; Tue, 22 Jul 2014 17:48:01 +0000 (UTC) Received: from rluna-sslvpn-nc.jnpr.net ([66.129.239.12]) (authenticated bits=0) by mail.xcllnt.net (8.14.9/8.14.9) with ESMTP id s6MHlqR2041353 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 22 Jul 2014 10:47:54 -0700 (PDT) (envelope-from marcel@xcllnt.net) Content-Type: multipart/signed; boundary="Apple-Mail=_F0EB4552-4C5B-41CF-AEC6-504DD2D4BCB4"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r268986 - head/sys/geom/uzip From: Marcel Moolenaar In-Reply-To: Date: Tue, 22 Jul 2014 10:47:46 -0700 Message-Id: References: <201407221730.s6MHU6Ej099771@svn.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1878.6) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Marcel Moolenaar , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 17:48:02 -0000 --Apple-Mail=_F0EB4552-4C5B-41CF-AEC6-504DD2D4BCB4 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On Jul 22, 2014, at 10:46 AM, Adrian Chadd wrote: > Wait, which consumers failed that test? geom_vfs I presume, because the file corruption is seen with UFS. -- Marcel Moolenaar marcel@xcllnt.net --Apple-Mail=_F0EB4552-4C5B-41CF-AEC6-504DD2D4BCB4 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iEYEARECAAYFAlPOo8MACgkQpgWlLWHuifa3xACfVT2gZqQ9Ynlu95u/XmuAqCJO JVcAn0cw/my+l8HpE6TZ7ooaAuekVqOv =3fIj -----END PGP SIGNATURE----- --Apple-Mail=_F0EB4552-4C5B-41CF-AEC6-504DD2D4BCB4-- From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 17:59:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DEE213F; Tue, 22 Jul 2014 17:59:35 +0000 (UTC) Received: from mail-qa0-x22a.google.com (mail-qa0-x22a.google.com [IPv6:2607:f8b0:400d:c00::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFEE421E6; Tue, 22 Jul 2014 17:59:34 +0000 (UTC) Received: by mail-qa0-f42.google.com with SMTP id j15so11221qaq.15 for ; Tue, 22 Jul 2014 10:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=oZzNmkLmuahjCN7FMH6bY8vGrZFMpad3W+c5HgF/Xz0=; b=QxBk9BxShDjhrzDen4PNKOKwQWr5JV49U/BnOFmTZwJt2MTnZMVj1IvKUgqHduTige zxXA59e/5cL+RrROe/5daIYDIHSUVqF6TNoiz52lxXubcBYfNdnzxDjk7Q30XOS+KQzH 5NqBVHrmjHVZM6EDD13lnaponIZsXzX5W67nXv+cEEp62/AnWAERWm0BLw/Z9DkSlIxz /z4NPzhyLhWy7VQsziL9XNVCRCpp0djjfpQ6zKaCdoPOkyitbfO/+rZS0HuEBElrZQz3 N47bh1bHopLZwzqIx8u7qLU9g/UABM61dhuUTEmCndQAgA02XjU1rRHYZi1MuA4GQFPN 2o+Q== MIME-Version: 1.0 X-Received: by 10.224.171.197 with SMTP id i5mr59779119qaz.55.1406051974077; Tue, 22 Jul 2014 10:59:34 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.1.6 with HTTP; Tue, 22 Jul 2014 10:59:34 -0700 (PDT) In-Reply-To: References: <201407221730.s6MHU6Ej099771@svn.freebsd.org> Date: Tue, 22 Jul 2014 10:59:34 -0700 X-Google-Sender-Auth: ivOo4cmZbcf3Z872D8k4KgEwsxQ Message-ID: Subject: Re: svn commit: r268986 - head/sys/geom/uzip From: Adrian Chadd To: Marcel Moolenaar Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Marcel Moolenaar , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 17:59:35 -0000 On 22 July 2014 10:47, Marcel Moolenaar wrote: > > On Jul 22, 2014, at 10:46 AM, Adrian Chadd wrote: > >> Wait, which consumers failed that test? > > geom_vfs I presume, because the file corruption is seen with UFS. Interesting. I wonder if this is about time we bit the bullet and compiled up GEOM modules in userland so we can run regression tests on things. -a From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 18:38:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 687D6FE3; Tue, 22 Jul 2014 18:38:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 549B82600; Tue, 22 Jul 2014 18:38:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MIc0t1032546; Tue, 22 Jul 2014 18:38:00 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MIc0i9032540; Tue, 22 Jul 2014 18:38:00 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407221838.s6MIc0i9032540@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 22 Jul 2014 18:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268987 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 18:38:00 -0000 Author: pfg Date: Tue Jul 22 18:37:59 2014 New Revision: 268987 URL: http://svnweb.freebsd.org/changeset/base/268987 Log: Revert r268984: Check for __SAPP flag before calling sflush. This avoids performance degradation compared to the previous approach. Submitted by: ache MFC after: 2 weeks Modified: head/lib/libc/stdio/ftell.c Modified: head/lib/libc/stdio/ftell.c ============================================================================== --- head/lib/libc/stdio/ftell.c Tue Jul 22 17:30:05 2014 (r268986) +++ head/lib/libc/stdio/ftell.c Tue Jul 22 18:37:59 2014 (r268987) @@ -97,8 +97,6 @@ _ftello(FILE *fp, fpos_t *offset) * Find offset of underlying I/O object, then * adjust for buffered bytes. */ - if (__sflush(fp)) /* may adjust seek offset on append stream */ - return (1); if (fp->_flags & __SOFF) pos = fp->_offset; else { @@ -120,6 +118,11 @@ _ftello(FILE *fp, fpos_t *offset) if (HASUB(fp)) pos -= fp->_r; /* Can be negative at this point. */ } else if ((fp->_flags & __SWR) && fp->_p != NULL) { + if (fp->_flags & __SAPP) { + pos = _sseek(fp, (fpos_t)0, SEEK_END); + if (pos == -1) + return (1); + } /* * Writing. Any buffered characters cause the * position to be greater than that in the From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 18:56:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4217738; Tue, 22 Jul 2014 18:56:22 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CC6F281A; Tue, 22 Jul 2014 18:56:22 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.82 (FreeBSD)) (envelope-from ) id 1X9fEZ-000OfQ-C1; Tue, 22 Jul 2014 22:56:19 +0400 Date: Tue, 22 Jul 2014 22:56:19 +0400 From: Slawa Olhovchenkov To: Marcel Moolenaar Subject: Re: svn commit: r268986 - head/sys/geom/uzip Message-ID: <20140722185619.GA94673@zxy.spb.ru> References: <201407221730.s6MHU6Ej099771@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201407221730.s6MHU6Ej099771@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 18:56:22 -0000 On Tue, Jul 22, 2014 at 05:30:06PM +0000, Marcel Moolenaar wrote: > Author: marcel > Date: Tue Jul 22 17:30:05 2014 > New Revision: 268986 > URL: http://svnweb.freebsd.org/changeset/base/268986 > > Log: > In r264504, we prevented doing I/O for more than MAXPHYS by making > the assumption that consumers would respect bio_completed and/or > bio_resid to detect short reads. This assumption proved false and > file corruption was the result. > Create as many bios as we need to satisfy the original request. > Check the cached chunk every time we need to do I/O to increase the > hit rate. Can you check other cases I/O for more than MAXPHYS? I think caused by incorrect partition scheme. From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 19:09:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80D78EC0 for ; Tue, 22 Jul 2014 19:09:01 +0000 (UTC) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 040A02958 for ; Tue, 22 Jul 2014 19:09:00 +0000 (UTC) Received: by mail-lb0-f177.google.com with SMTP id s7so78973lbd.22 for ; Tue, 22 Jul 2014 12:08:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=k+jpCkUZs1TGsEZtmtcwW3WMdu3GPjVIi3RIS4q7IRw=; b=k2OcLbf4K4rxuznhc+GHXCX/1PynqD7hmIMVcs6tYX4xE4U6YmU14YzDmfk+0heKyi HuxJkLXEabFoIg/doxCtCLDx3oSVhzskM+3V6uKX/cOizaklwSZoXmE5VbqNarHFwnps loBjf+xSkGCADVGZDmBeP92cnSkev3yKpdEEGkdFO9LydW8VWK61t14ceeWtuWzeb8A8 1yn5mzQu1mKFUZvrz2bDd7v73hYtf7bhlY8w7XcvmMeX/UVYz7eF+RvL7fYyolWGUjrb XegQBQaTfUJ7qfl+uZBhrtCos+WCJ3CoFllgf4CDtSoxfoxOAt9nxjgvk2B2UWm8tiyP +8+A== X-Gm-Message-State: ALoCoQldE07zaf/HeqW+pM4VGO0vuY77U+mkcNODWbEioZm4V2KaPY+IlGGWY+sH3ZPhBOkTU1zj X-Received: by 10.152.25.132 with SMTP id c4mr14371677lag.88.1406056133274; Tue, 22 Jul 2014 12:08:53 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id c7sm1752777lbd.37.2014.07.22.12.08.52 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Jul 2014 12:08:52 -0700 (PDT) Message-ID: <53CEB6BD.3000403@freebsd.org> Date: Tue, 22 Jul 2014 23:08:45 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r268987 - head/lib/libc/stdio References: <201407221838.s6MIc0i9032540@svn.freebsd.org> In-Reply-To: <201407221838.s6MIc0i9032540@svn.freebsd.org> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 19:09:01 -0000 On 22.07.2014 22:38, Pedro F. Giffuni wrote: > Author: pfg > Date: Tue Jul 22 18:37:59 2014 > New Revision: 268987 > URL: http://svnweb.freebsd.org/changeset/base/268987 > > Log: > Revert r268984: > Check for __SAPP flag before calling sflush. This avoids > performance degradation compared to the previous approach. Thanx. In this version sflush which doing physical write is never called, only _sseek (lseek) for __SAPP. Here is the test program, run it several times and notice ftell position increased from time to time (or not in our old version): #include int main(int argc, char *argv[]) { FILE *fp = fopen("testfile", "a"); rewind(fp); fwrite("1", 1, 1, fp); printf("%ld\n", ftell(fp)); fclose(fp); } It probably worth to be added to our test framework, but I completely unaware how to do it. > > Submitted by: ache > MFC after: 2 weeks > > Modified: > head/lib/libc/stdio/ftell.c > > Modified: head/lib/libc/stdio/ftell.c > ============================================================================== > --- head/lib/libc/stdio/ftell.c Tue Jul 22 17:30:05 2014 (r268986) > +++ head/lib/libc/stdio/ftell.c Tue Jul 22 18:37:59 2014 (r268987) > @@ -97,8 +97,6 @@ _ftello(FILE *fp, fpos_t *offset) > * Find offset of underlying I/O object, then > * adjust for buffered bytes. > */ > - if (__sflush(fp)) /* may adjust seek offset on append stream */ > - return (1); > if (fp->_flags & __SOFF) > pos = fp->_offset; > else { > @@ -120,6 +118,11 @@ _ftello(FILE *fp, fpos_t *offset) > if (HASUB(fp)) > pos -= fp->_r; /* Can be negative at this point. */ > } else if ((fp->_flags & __SWR) && fp->_p != NULL) { > + if (fp->_flags & __SAPP) { > + pos = _sseek(fp, (fpos_t)0, SEEK_END); > + if (pos == -1) > + return (1); > + } > /* > * Writing. Any buffered characters cause the > * position to be greater than that in the > -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 19:37:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C431F39; Tue, 22 Jul 2014 19:37:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77FC52C91; Tue, 22 Jul 2014 19:37:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MJbd4D060707; Tue, 22 Jul 2014 19:37:39 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MJbdSA060706; Tue, 22 Jul 2014 19:37:39 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201407221937.s6MJbdSA060706@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 22 Jul 2014 19:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268988 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 19:37:39 -0000 Author: pluknet Date: Tue Jul 22 19:37:38 2014 New Revision: 268988 URL: http://svnweb.freebsd.org/changeset/base/268988 Log: Grammar and spelling fixes. Modified: head/share/man/man4/ddb.4 Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Tue Jul 22 18:37:59 2014 (r268987) +++ head/share/man/man4/ddb.4 Tue Jul 22 19:37:38 2014 (r268988) @@ -1124,7 +1124,7 @@ abbreviations. .It Ic capture status .Nm supports a basic output capture facility, which can be used to retrieve the -results of debugging commands from userpsace using +results of debugging commands from userspace using .Xr sysctl 2 . .Ic capture on enables output capture; @@ -1429,7 +1429,7 @@ diagnose problems. Other bus' bridge chipsets may be able to generate NMI using bus specific methods. .Sh FILES -Header files mention in this manual page can be found below +Header files mentioned in this manual page can be found below .Pa /usr/include directory. .Pp From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 19:48:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B084A765; Tue, 22 Jul 2014 19:48:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C8D12DCE; Tue, 22 Jul 2014 19:48:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MJmLkJ065807; Tue, 22 Jul 2014 19:48:21 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MJmL8J065806; Tue, 22 Jul 2014 19:48:21 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201407221948.s6MJmL8J065806@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 22 Jul 2014 19:48:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268989 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 19:48:21 -0000 Author: np Date: Tue Jul 22 19:48:21 2014 New Revision: 268989 URL: http://svnweb.freebsd.org/changeset/base/268989 Log: Add missing newline to an error message. MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Tue Jul 22 19:37:38 2014 (r268988) +++ head/sys/dev/cxgbe/t4_sge.c Tue Jul 22 19:48:21 2014 (r268989) @@ -2939,7 +2939,7 @@ alloc_eq(struct adapter *sc, struct port } if (rc != 0) { device_printf(sc->dev, - "failed to allocate egress queue(%d): %d", + "failed to allocate egress queue(%d): %d\n", eq->flags & EQ_TYPEMASK, rc); } From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 19:54:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EEECB89; Tue, 22 Jul 2014 19:54:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AE172F2F; Tue, 22 Jul 2014 19:54:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MJsN2o069677; Tue, 22 Jul 2014 19:54:23 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MJsNK9069676; Tue, 22 Jul 2014 19:54:23 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201407221954.s6MJsNK9069676@svn.freebsd.org> From: Michael Tuexen Date: Tue, 22 Jul 2014 19:54:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268990 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 19:54:23 -0000 Author: tuexen Date: Tue Jul 22 19:54:22 2014 New Revision: 268990 URL: http://svnweb.freebsd.org/changeset/base/268990 Log: Cleanup the definition of two structures which are exposed to userland. Therefore no MFC. Modified: head/sys/netinet/sctp_uio.h Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Tue Jul 22 19:48:21 2014 (r268989) +++ head/sys/netinet/sctp_uio.h Tue Jul 22 19:54:22 2014 (r268990) @@ -323,7 +323,6 @@ struct sctp_paddr_change { uint32_t spc_state; uint32_t spc_error; sctp_assoc_t spc_assoc_id; - uint8_t spc_padding[4]; }; /* paddr state values */ @@ -346,7 +345,7 @@ struct sctp_remote_error { uint32_t sre_length; uint16_t sre_error; sctp_assoc_t sre_assoc_id; - uint8_t sre_data[4]; + uint8_t sre_data[]; }; /* data send failure event (deprecated) */ From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 19:55:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7C79CD8; Tue, 22 Jul 2014 19:55:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3ACF2F3E; Tue, 22 Jul 2014 19:55:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MJtP4S069937; Tue, 22 Jul 2014 19:55:25 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MJtPYt069936; Tue, 22 Jul 2014 19:55:25 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201407221955.s6MJtPYt069936@svn.freebsd.org> From: "Andrey A. Chernov" Date: Tue, 22 Jul 2014 19:55:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268991 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 19:55:26 -0000 Author: ache Date: Tue Jul 22 19:55:25 2014 New Revision: 268991 URL: http://svnweb.freebsd.org/changeset/base/268991 Log: Checking for __SAPP alone is not enough because it is emulated O_APPEND only, so works for only special fdopen() case. Add real O_APPEND too. Modified: head/lib/libc/stdio/ftell.c Modified: head/lib/libc/stdio/ftell.c ============================================================================== --- head/lib/libc/stdio/ftell.c Tue Jul 22 19:54:22 2014 (r268990) +++ head/lib/libc/stdio/ftell.c Tue Jul 22 19:55:25 2014 (r268991) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include #include #include #include "un-namespace.h" @@ -118,7 +119,7 @@ _ftello(FILE *fp, fpos_t *offset) if (HASUB(fp)) pos -= fp->_r; /* Can be negative at this point. */ } else if ((fp->_flags & __SWR) && fp->_p != NULL) { - if (fp->_flags & __SAPP) { + if (fp->_flags & (__SAPP|O_APPEND)) { pos = _sseek(fp, (fpos_t)0, SEEK_END); if (pos == -1) return (1); From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 20:13:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 408B518E; Tue, 22 Jul 2014 20:13:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C278211D; Tue, 22 Jul 2014 20:13:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MKDkdO079202; Tue, 22 Jul 2014 20:13:46 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MKDk68079201; Tue, 22 Jul 2014 20:13:46 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201407222013.s6MKDk68079201@svn.freebsd.org> From: "Andrey A. Chernov" Date: Tue, 22 Jul 2014 20:13:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268992 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 20:13:47 -0000 Author: ache Date: Tue Jul 22 20:13:46 2014 New Revision: 268992 URL: http://svnweb.freebsd.org/changeset/base/268992 Log: Back the whole change out until I figure out how to obtain O_APPEND, it can't be used in this field at all. Modified: head/lib/libc/stdio/ftell.c Modified: head/lib/libc/stdio/ftell.c ============================================================================== --- head/lib/libc/stdio/ftell.c Tue Jul 22 19:55:25 2014 (r268991) +++ head/lib/libc/stdio/ftell.c Tue Jul 22 20:13:46 2014 (r268992) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include -#include #include #include #include "un-namespace.h" @@ -119,11 +118,6 @@ _ftello(FILE *fp, fpos_t *offset) if (HASUB(fp)) pos -= fp->_r; /* Can be negative at this point. */ } else if ((fp->_flags & __SWR) && fp->_p != NULL) { - if (fp->_flags & (__SAPP|O_APPEND)) { - pos = _sseek(fp, (fpos_t)0, SEEK_END); - if (pos == -1) - return (1); - } /* * Writing. Any buffered characters cause the * position to be greater than that in the From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 20:32:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01D5E7A8; Tue, 22 Jul 2014 20:32:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1C852321; Tue, 22 Jul 2014 20:32:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MKWOoh088287; Tue, 22 Jul 2014 20:32:24 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MKWOd7088286; Tue, 22 Jul 2014 20:32:24 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201407222032.s6MKWOd7088286@svn.freebsd.org> From: Ian Lepore Date: Tue, 22 Jul 2014 20:32:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268993 - head/contrib/libstdc++/libsupc++ X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 20:32:25 -0000 Author: ian Date: Tue Jul 22 20:32:24 2014 New Revision: 268993 URL: http://svnweb.freebsd.org/changeset/base/268993 Log: Fix EABI unwind function declarations to match the function definitions. The mismatch was noticed by clang, when using it to compile the in-tree gcc and libstdc++. Modified: head/contrib/libstdc++/libsupc++/unwind-cxx.h Modified: head/contrib/libstdc++/libsupc++/unwind-cxx.h ============================================================================== --- head/contrib/libstdc++/libsupc++/unwind-cxx.h Tue Jul 22 20:13:46 2014 (r268992) +++ head/contrib/libstdc++/libsupc++/unwind-cxx.h Tue Jul 22 20:32:24 2014 (r268993) @@ -142,9 +142,9 @@ typedef enum { ctm_succeeded = 1, ctm_succeeded_with_ptr_to_base = 2 } __cxa_type_match_result; -extern "C" bool __cxa_type_match(_Unwind_Exception*, const std::type_info*, +extern "C" __cxa_type_match_result __cxa_type_match(_Unwind_Exception*, const std::type_info*, bool, void**); -extern "C" void __cxa_begin_cleanup (_Unwind_Exception*); +extern "C" bool __cxa_begin_cleanup (_Unwind_Exception*); extern "C" void __cxa_end_cleanup (void); #endif From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 20:49:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 733E9C72; Tue, 22 Jul 2014 20:49:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F65C247D; Tue, 22 Jul 2014 20:49:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MKnxkr093811; Tue, 22 Jul 2014 20:49:59 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MKnxfl093810; Tue, 22 Jul 2014 20:49:59 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201407222049.s6MKnxfl093810@svn.freebsd.org> From: Ian Lepore Date: Tue, 22 Jul 2014 20:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268994 - head/contrib/gcc/config/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 20:49:59 -0000 Author: ian Date: Tue Jul 22 20:49:58 2014 New Revision: 268994 URL: http://svnweb.freebsd.org/changeset/base/268994 Log: Add FreeBSD to the list of environments that needs to handle R_ARM_TARGET2 relocations in unwind data as pc-relative indirect references. MFC after: 1 week Modified: head/contrib/gcc/config/arm/unwind-arm.h Modified: head/contrib/gcc/config/arm/unwind-arm.h ============================================================================== --- head/contrib/gcc/config/arm/unwind-arm.h Tue Jul 22 20:32:24 2014 (r268993) +++ head/contrib/gcc/config/arm/unwind-arm.h Tue Jul 22 20:49:58 2014 (r268994) @@ -232,7 +232,7 @@ extern "C" { if (!tmp) return 0; -#if defined(linux) || defined(__NetBSD__) +#if defined(linux) || defined(__NetBSD__) || defined(__FreeBSD__) /* Pc-relative indirect. */ tmp += ptr; tmp = *(_Unwind_Word *) tmp; From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 22:16:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF31B671; Tue, 22 Jul 2014 22:16:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B08502D1D; Tue, 22 Jul 2014 22:16:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MMGOY8036780; Tue, 22 Jul 2014 22:16:24 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MMGOVA036774; Tue, 22 Jul 2014 22:16:24 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201407222216.s6MMGOVA036774@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 22 Jul 2014 22:16:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268995 - in head: . share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 22:16:24 -0000 Author: pluknet Date: Tue Jul 22 22:16:23 2014 New Revision: 268995 URL: http://svnweb.freebsd.org/changeset/base/268995 Log: s/PCBGROUPS/PCBGROUP/ manpage to match "options PCBGROUP". Added: head/share/man/man9/PCBGROUP.9 - copied, changed from r268994, head/share/man/man9/PCBGROUPS.9 Deleted: head/share/man/man9/PCBGROUPS.9 Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Jul 22 20:49:58 2014 (r268994) +++ head/ObsoleteFiles.inc Tue Jul 22 22:16:23 2014 (r268995) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20140723: renamed to PCBGROUP.9 +OLD_FILES+=usr/share/man/man9/PCBGROUPS.9.gz # 20140719: libsbuf version bump OLD_LIBS+=lib/libsbuf.so.6 # 20140718: Remove obsolete man pages Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Jul 22 20:49:58 2014 (r268994) +++ head/share/man/man9/Makefile Tue Jul 22 22:16:23 2014 (r268995) @@ -188,7 +188,7 @@ MAN= accept_filter.9 \ osd.9 \ panic.9 \ pbuf.9 \ - PCBGROUPS.9 \ + PCBGROUP.9 \ p_candebug.9 \ p_cansee.9 \ pci.9 \ Copied and modified: head/share/man/man9/PCBGROUP.9 (from r268994, head/share/man/man9/PCBGROUPS.9) ============================================================================== --- head/share/man/man9/PCBGROUPS.9 Tue Jul 22 20:49:58 2014 (r268994, copy source) +++ head/share/man/man9/PCBGROUP.9 Tue Jul 22 22:16:23 2014 (r268995) @@ -27,10 +27,10 @@ .\" $FreeBSD$ .\" .Dd July 18, 2014 -.Dt PCBGROUPS 9 +.Dt PCBGROUP 9 .Os .Sh NAME -.Nm PCBGROUPS +.Nm PCBGROUP .Nd Distributed Protocol Control Block Groups .Sh SYNOPSIS .Ft void @@ -58,16 +58,16 @@ .Fa "struct inpcbinfo *pcbinfo" "u_int hashtype" "uint32_t hash" .Fc .Pp -.Cd "options PCBGROUPS" +.Cd "options PCBGROUP" .Sh DESCRIPTION -PCBGROUPS, or "connection groups", are based on Willman, Rixner, and Cox's +PCBGROUP, or "connection groups", are based on Willman, Rixner, and Cox's 2006 USENIX paper, .Qo An Evaluation of Network Stack Parallelization Strategies in Modern Operating Systems .Qc . .Pp -The PCBGROUPS paper describes two main kind of connection groups. +The PCBGROUP paper describes two main kind of connection groups. The first, called ConnP-T, uses a pool of worker threads which implement the network stack. Serialization occurs when queuing work into and completing work from @@ -102,7 +102,7 @@ Connection establishment and teardown ca expensive than without connection groups, but that steady-state processing can be significantly faster. .Pp -Enabling PCBGROUPS in the kernel only provides the infrastructure +Enabling PCBGROUP in the kernel only provides the infrastructure required to create and manage multiple PCB groups. An implementation needs to fill in a few functions to provide PCB group hash information in order for PCBs to be placed in a PCB group. @@ -133,9 +133,9 @@ wildcard table. The PCBGROUP tables operate in conjunction with the normal single PCB list in a PCB info block. Thus, inserting and removing a PCB will still incur the same costs -as without PCBGROUPS. -A protocol which uses PCBGROUPS should fall back to the normal PCB list -lookup if a call to the PCBGROUPS layer does not yield a lookup hit. +as without PCBGROUP. +A protocol which uses PCBGROUP should fall back to the normal PCB list +lookup if a call to the PCBGROUP layer does not yield a lookup hit. .Ss Usage Initialize a PCBGROUP in a PCB info block .Pq Vt "struct pcbinfo" @@ -165,7 +165,7 @@ The PCB code in .Pa sys/netinet and .Pa sys/netinet6 -is aware of PCBGROUPS and will call into the PCBGROUPS code to do +is aware of PCBGROUP and will call into the PCBGROUP code to do PCBGROUP assignment and lookup, preferring a PCBGROUP lookup to the default global PCB info table. .Pp @@ -201,10 +201,10 @@ receive path in .Xr netisr 9 , .Xr RSS 9 .Sh HISTORY -PCBGROUPS first appeared in +PCBGROUP first appeared in .Fx 9.0 . .Pp -The PCBGROUPS implementation is inspired by Willman, Rixner, and Cox's +The PCBGROUP implementation is inspired by Willman, Rixner, and Cox's 2006 USENIX paper, .Qo An Evaluation of Network Stack Parallelization Strategies in Modern @@ -213,7 +213,7 @@ Operating Systems .Li http://www.ece.rice.edu/~willmann/pubs/paranet_usenix.pdf .Sh AUTHORS .An -nosplit -The PCBGROUPS implementation was written by +The PCBGROUP implementation was written by .An Robert N. M. Watson Aq Mt rwatson@FreeBSD.org under contract to Juniper Networks, Inc. .Pp @@ -224,12 +224,12 @@ The .Xr RSS 9 implementation currently uses .Ic #ifdef -blocks to tie into PCBGROUPS. +blocks to tie into PCBGROUP. This is a sign that a more abstract programming API is needed. .Pp -There is currently no support for re-balancing the PCBGROUPS assignment, +There is currently no support for re-balancing the PCBGROUP assignment, nor is there any support for overriding which PCBGROUP a socket/PCB should be in. .Pp -No statistics are kept to indicate how often PCBGROUPS lookups +No statistics are kept to indicate how often PCBGROUP lookups succeed or fail. From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 22:40:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 05360E42; Tue, 22 Jul 2014 22:40:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6DA82F48; Tue, 22 Jul 2014 22:39:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MMdxY2046336; Tue, 22 Jul 2014 22:39:59 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MMdx75046335; Tue, 22 Jul 2014 22:39:59 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201407222239.s6MMdx75046335@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 22 Jul 2014 22:39:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268996 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 22:40:00 -0000 Author: pluknet Date: Tue Jul 22 22:39:59 2014 New Revision: 268996 URL: http://svnweb.freebsd.org/changeset/base/268996 Log: Re-sort synopsis, add includes. Modified: head/share/man/man9/PCBGROUP.9 Modified: head/share/man/man9/PCBGROUP.9 ============================================================================== --- head/share/man/man9/PCBGROUP.9 Tue Jul 22 22:16:23 2014 (r268995) +++ head/share/man/man9/PCBGROUP.9 Tue Jul 22 22:39:59 2014 (r268996) @@ -26,13 +26,18 @@ .\" .\" $FreeBSD$ .\" -.Dd July 18, 2014 +.Dd July 23, 2014 .Dt PCBGROUP 9 .Os .Sh NAME .Nm PCBGROUP .Nd Distributed Protocol Control Block Groups .Sh SYNOPSIS +.Cd "options PCBGROUP" +.Pp +.In sys/param.h +.In netinet/in.h +.In netinet/in_pcb.h .Ft void .Fo in_pcbgroup_init .Fa "struct inpcbinfo *pcbinfo" "u_int hashfields" "int hash_nelements" @@ -53,12 +58,11 @@ .Fn in_pcbgroup_remove "struct inpcb *inp" .Ft int .Fn in_pcbgroup_enabled "struct inpcbinfo *pcbinfo" +.In netinet6/in6_pcb.h .Ft struct inpcbgroup * .Fo in6_pcbgroup_byhash .Fa "struct inpcbinfo *pcbinfo" "u_int hashtype" "uint32_t hash" .Fc -.Pp -.Cd "options PCBGROUP" .Sh DESCRIPTION PCBGROUP, or "connection groups", are based on Willman, Rixner, and Cox's 2006 USENIX paper, From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 22:49:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC8F8E8; Tue, 22 Jul 2014 22:49:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA2C02027; Tue, 22 Jul 2014 22:49:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MMnbhH050700; Tue, 22 Jul 2014 22:49:37 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MMnbNb050699; Tue, 22 Jul 2014 22:49:37 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201407222249.s6MMnbNb050699@svn.freebsd.org> From: "Andrey A. Chernov" Date: Tue, 22 Jul 2014 22:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268997 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 22:49:37 -0000 Author: ache Date: Tue Jul 22 22:49:37 2014 New Revision: 268997 URL: http://svnweb.freebsd.org/changeset/base/268997 Log: For "a"-mode files and rewind/fseek + fwrite combination return meaningful value now, like Apple does, but avoid their __sflush physical write performance degradation as much as possible. Modified: head/lib/libc/stdio/ftell.c Modified: head/lib/libc/stdio/ftell.c ============================================================================== --- head/lib/libc/stdio/ftell.c Tue Jul 22 22:39:59 2014 (r268996) +++ head/lib/libc/stdio/ftell.c Tue Jul 22 22:49:37 2014 (r268997) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include #include #include #include "un-namespace.h" @@ -87,6 +88,7 @@ _ftello(FILE *fp, fpos_t *offset) { fpos_t pos; size_t n; + int dflags; if (fp->_seek == NULL) { errno = ESPIPE; /* historic practice */ @@ -118,6 +120,22 @@ _ftello(FILE *fp, fpos_t *offset) if (HASUB(fp)) pos -= fp->_r; /* Can be negative at this point. */ } else if ((fp->_flags & __SWR) && fp->_p != NULL) { + dflags = 0; + if (fp->_flags & __SAPP) + dflags = O_APPEND; + else if (fp->_file != -1 && + (dflags = _fcntl(fp->_file, F_GETFL)) < 0) + return (1); + if ((dflags & O_APPEND) && + (pos = _sseek(fp, (fpos_t)0, SEEK_END)) == -1) { + if ((fp->_flags & __SOPT) || __sflush(fp) || + (pos = _sseek(fp, (fpos_t)0, SEEK_CUR)) == -1) + return (1); + else { + *offset = pos; + return (0); + } + } /* * Writing. Any buffered characters cause the * position to be greater than that in the From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 22:55:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 678CB317 for ; Tue, 22 Jul 2014 22:55:27 +0000 (UTC) Received: from nm15.bullet.mail.bf1.yahoo.com (nm15.bullet.mail.bf1.yahoo.com [98.139.212.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B0C120DE for ; Tue, 22 Jul 2014 22:55:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1406069719; bh=GlAV9l07dZDVb+Ms5aCfWJr7nfm4Jzcn+p0+ehr9/G8=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=hqD526gU42IFNSvounRn/aAzN3FvRojG0vzbDyl9Mu23LzIsM+onv3NopJJoCcCg8zQ+Hp+jUBFreb1VYzQLnq11GaHEJU+iujN1gnlv+pss851nmY6JnX/Fh9K40/4MIFuaBwtC9hP8ceR9V9k099Ywf9Zy7JlLZz/HM+30jXhRfasu3XpxiL3MBb5Nm3lG53Aw+Z0FRRV70Zv+rpemU0WAInQr3eESNpKuFM/gq6mFzPwWovkiT182ByhoSSYeXzfQqDWhbxt4/G7ujLYY7E8dYNorRMvBaCLOy1FPBIJLgqZXE2E6t5rvipDu2NgKSjrmAkpj6qQQzsNZXyyPNA== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=SwExRtRMFQpOY7OU4HdLiAatgYZktVTmH9NNoFcbgO3H4JgTd84go/rtZXBVbE+h/mvyg3WURMqKM93+IegjicfUTK81VwAQM+uyYP/eMVOUCWyKexUyv+cSCk209/BYzTAZaoAVgFVIHg97jYIBt26GCnUeArAuAYdH/SqofS9+aWICkfalJdO78ogPWpLoJM2q7NjKNAnlCfVAmqXn48EArVBUjuSqfC3rQQ7ArI7cibZ6a6JyFtzoZgMPv5s2ZD4CSkGXkTl7VUsBfHW0zhUxDK72BM2ND+dU9XzIpnWyMaMEdM/BEfrJWNLwWuL0KJ3jXvwgf7IY488cLZnxFA==; Received: from [98.139.215.143] by nm15.bullet.mail.bf1.yahoo.com with NNFMP; 22 Jul 2014 22:55:19 -0000 Received: from [68.142.230.72] by tm14.bullet.mail.bf1.yahoo.com with NNFMP; 22 Jul 2014 22:55:19 -0000 Received: from [127.0.0.1] by smtp229.mail.bf1.yahoo.com with NNFMP; 22 Jul 2014 22:55:19 -0000 X-Yahoo-Newman-Id: 45606.3751.bm@smtp229.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: MqHSaJIVM1nSIXgAwytp0b66CN9GqRm0qaDl9ThyuDc84Nf HAe70Qd7Y8.K4xa9UsomhyAYxKklamM90OnPDqCkcXICvqBKGZPHK8s8uWbd 6lrJ.I07mRmVkOSGWksD7F5l90ChbOme.1m5xABfDPTJPBeV.M9oAv37zjpT LyvuWEoD3oDLbG63dfeSwpX04diM9DHmtMqYWH9dFnmKm_bM5ABzEdv.N0Lh IPswiEuNeu9a2BRQhubGwbMNk0ZwQZeS8pqEyWHxmbWdpZ0Uaiin07Hr6JbI c2XgzygkEwmqekpo7IxM9WY.e.XfaLye4rHMH2LSjG1TXDSwxHuTkaQn7rKj MTk7Jc4o_Oe2b8G.DYbZkrUBtmxWlxiJbpIYfT01JvcvvCGNq5ZuMMVx9VA7 Ps3GvPPFJ7T61l6UyJfa0WaMEZjXkXZerS3LlEcxp2vHSXjNxEYe2qwwbYEU LSGSrDZYaDypg3CU7zczqjLkL2Cd9TGKXxTBAhc3kUot4vwQAOCdt8hbzdZ1 iy78KxI5aMhlBqL6GALa2YPAwofy2_X_hpvpWKcPJOR6oGbw1M5Qe9AYCKpl bbmCAEEQ4x2WOHERtL3RfzfMZpbrG.xmhVVbIX0qgws0Xa2SeX_KfzDJy8Bl 2 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <53CEEBE3.10807@freebsd.org> Date: Tue, 22 Jul 2014 17:55:31 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "Andrey A. Chernov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r268997 - head/lib/libc/stdio References: <201407222249.s6MMnbNb050699@svn.freebsd.org> In-Reply-To: <201407222249.s6MMnbNb050699@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 22:55:27 -0000 On 07/22/14 17:49, Andrey A. Chernov wrote: > Author: ache > Date: Tue Jul 22 22:49:37 2014 > New Revision: 268997 > URL: http://svnweb.freebsd.org/changeset/base/268997 > > Log: > For "a"-mode files and rewind/fseek + fwrite combination return meaningful > value now, like Apple does, but avoid their __sflush physical write > performance degradation as much as possible. Great ! Thank you !! Pedro. > Modified: > head/lib/libc/stdio/ftell.c > > Modified: head/lib/libc/stdio/ftell.c > ============================================================================== > --- head/lib/libc/stdio/ftell.c Tue Jul 22 22:39:59 2014 (r268996) > +++ head/lib/libc/stdio/ftell.c Tue Jul 22 22:49:37 2014 (r268997) > @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); > #include "namespace.h" > #include > #include > +#include > #include > #include > #include "un-namespace.h" > @@ -87,6 +88,7 @@ _ftello(FILE *fp, fpos_t *offset) > { > fpos_t pos; > size_t n; > + int dflags; > > if (fp->_seek == NULL) { > errno = ESPIPE; /* historic practice */ > @@ -118,6 +120,22 @@ _ftello(FILE *fp, fpos_t *offset) > if (HASUB(fp)) > pos -= fp->_r; /* Can be negative at this point. */ > } else if ((fp->_flags & __SWR) && fp->_p != NULL) { > + dflags = 0; > + if (fp->_flags & __SAPP) > + dflags = O_APPEND; > + else if (fp->_file != -1 && > + (dflags = _fcntl(fp->_file, F_GETFL)) < 0) > + return (1); > + if ((dflags & O_APPEND) && > + (pos = _sseek(fp, (fpos_t)0, SEEK_END)) == -1) { > + if ((fp->_flags & __SOPT) || __sflush(fp) || > + (pos = _sseek(fp, (fpos_t)0, SEEK_CUR)) == -1) > + return (1); > + else { > + *offset = pos; > + return (0); > + } > + } > /* > * Writing. Any buffered characters cause the > * position to be greater than that in the > From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 22:57:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 705F4567; Tue, 22 Jul 2014 22:57:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E56D2102; Tue, 22 Jul 2014 22:57:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MMvRtt054937; Tue, 22 Jul 2014 22:57:27 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MMvR4O054936; Tue, 22 Jul 2014 22:57:27 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201407222257.s6MMvR4O054936@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 22 Jul 2014 22:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268998 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 22:57:27 -0000 Author: gavin Date: Tue Jul 22 22:57:26 2014 New Revision: 268998 URL: http://svnweb.freebsd.org/changeset/base/268998 Log: /usr/bin/sendbug and the sendbug(1) man page were part of send-pr and are no longer installed since r267486. Add them to ObsoleteFiles.inc1, which should have been done in r267486. PR: 192010 Submitted by: Vick Khera Pointyhat to: gavin MFC after: 3 days Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Jul 22 22:49:37 2014 (r268997) +++ head/ObsoleteFiles.inc Tue Jul 22 22:57:26 2014 (r268998) @@ -83,8 +83,10 @@ OLD_FILES+=usr/share/examples/cvsup/stab OLD_FILES+=usr/share/examples/cvsup/standard-supfile OLD_DIRS+=usr/share/examples/cvsup # 20140614: send-pr removal +OLD_FILES+=usr/bin/sendbug OLD_FILES+=usr/share/info/send-pr.info.gz OLD_FILES+=usr/share/man/man1/send-pr.1.gz +OLD_FILES+=usr/share/man/man1/sendbug.1.gz OLD_FILES+=etc/gnats/freefall OLD_DIRS+=etc/gnats # 20140512: new clang import which bumps version from 3.4 to 3.4.1. From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 23:10:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BADD690F; Tue, 22 Jul 2014 23:10:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5CA52216; Tue, 22 Jul 2014 23:10:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MNAExE060368; Tue, 22 Jul 2014 23:10:14 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MNACJM060347; Tue, 22 Jul 2014 23:10:12 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201407222310.s6MNACJM060347@svn.freebsd.org> From: Devin Teske Date: Tue, 22 Jul 2014 23:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268999 - in head/usr.sbin/bsdconfig: examples include share share/media share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 23:10:14 -0000 Author: dteske Date: Tue Jul 22 23:10:12 2014 New Revision: 268999 URL: http://svnweb.freebsd.org/changeset/base/268999 Log: Add example script `add_some_packages.sh', demonstrating how to install a list of packages using the bsdconfig(8) API, providing dialog(8) based user experience (versus plain console output were you to use pkg(8) directly to install the same list of packages). Remove example script `browse_packages_ftp.sh', made obsolete because the digests.txz and packagesite.txz databases for pkg(8) are not available via FTP (HTTP only to pkg.freebsd.org SRV hosts). Update example script `browse_packages_http.sh', made to work with new pkg(8) demonstrating how to generate a local package repository. Fix a bug in `bsdconfig packages' where packages were listed twice. This fix requires pkg(8) version 1.2.7_4 or higher. NB: It is the introduction of pkg(8) 1.2.7_4 wherein I am also able to drastically reduce the generation time of package dependencies prior to the dialog display (by utilizing the new `-I' flag to pkg-rquery(8)). While here, fix a positional argument nit for f_index_initialize() of `packages/index.subr' include (the one and only argument is positional argument 1 to state the by-ref handle, indicating the variable to set in the caller's namespace; the nit I'm fixing here is that we were querying positional argument 2 for this information incorrectly; caused by a missing hunk back around SVN r257795). Fix a bug in sysrc(8) described by PR bin/187458 "sysrc(8) silently and unexpectedly bootstraps pkg". This was caused by an explicit entry in `/usr/share/bsdconfig/common.subr' (used by sysrc(8)) that called pkg(8) to populate the $PKG_ABI global (called in a way that allows implicit bootstrap of pkg(8)). The solution to which was to find every place in bsdconfig(8) that requires the $PKG_ABI global and add a layer of protection by way of introducing the new API call f_musthavepkg_init() (provided by new include, `/usr/share/bsdconfig/packages/musthavepkg.subr' intented to mirror `/usr/share/bsdconfig/mustberoot.subr'). When the $PKG_ABI global is required, you can use `f_musthavepkg_init' to cause graceful premature termination in the event that pkg(8) has not yet been bootstrapped, and thus cannot be used to populate $PKG_ABI. NB: If running interactively ($nonInteractive is NULL or unset), the f_musthavepkg_init() API call will attempt to bootstrap pkg(8), but only if the user chooses "Yes" to a Yes/No dialog confirming it is ok to bootstrap. While here, simplify an if-conditional in `media/http.subr' include to use sh(1) inline assignment-with-break. Also, fix a bug in `media/http.subr' and `media/httpproxy.subr' wherein the error messages for various HTTP failures were not finding their way to the console (needed to pass stdout to pass-thru descriptor). While here, remove the executable bit from `packages/categories.subr', `packages/index.subr', and `packages/packages.subr' includes. Fix issues where pkg(8) complains about PACKAGESITE being defined. Previously, we would set $PACKAGESITE and export it. Now we only set $PACKAGESITE for invocations of "pkg update" -- getting rid of all the spurious warnings about PACKAGESITE being deprecated (it's still used in the case of "pkg update" for simplicity versus having to configure a config-file). Remove the leading argument from invocations of f_index_initialize() in `packages/packages.subr' include. The leading argument no longer means what it used to, pre SVN r257995). PR: bin/187458 Reviewed by: nwhitehorn MFC after: 1 week X-MFC-to: stable/10, stable/9 Added: head/usr.sbin/bsdconfig/examples/add_some_packages.sh (contents, props changed) head/usr.sbin/bsdconfig/share/packages/musthavepkg.subr (contents, props changed) Deleted: head/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh Modified: head/usr.sbin/bsdconfig/examples/Makefile head/usr.sbin/bsdconfig/examples/browse_packages_http.sh head/usr.sbin/bsdconfig/include/messages.subr head/usr.sbin/bsdconfig/share/common.subr head/usr.sbin/bsdconfig/share/media/http.subr head/usr.sbin/bsdconfig/share/media/httpproxy.subr head/usr.sbin/bsdconfig/share/packages/Makefile head/usr.sbin/bsdconfig/share/packages/index.subr (contents, props changed) head/usr.sbin/bsdconfig/share/packages/packages.subr (contents, props changed) Directory Properties: head/usr.sbin/bsdconfig/share/packages/categories.subr (props changed) Modified: head/usr.sbin/bsdconfig/examples/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/examples/Makefile Tue Jul 22 22:57:26 2014 (r268998) +++ head/usr.sbin/bsdconfig/examples/Makefile Tue Jul 22 23:10:12 2014 (r268999) @@ -3,7 +3,7 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/examples/bsdconfig -FILES= browse_packages_ftp.sh browse_packages_http.sh bsdconfigrc +FILES= add_some_packages.sh browse_packages_http.sh bsdconfigrc beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Added: head/usr.sbin/bsdconfig/examples/add_some_packages.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/examples/add_some_packages.sh Tue Jul 22 23:10:12 2014 (r268999) @@ -0,0 +1,13 @@ +#!/bin/sh +# $FreeBSD$ +# +# This sample installs a short list of packages from the main HTTP site. +# +[ "$_SCRIPT_SUBR" ] || . /usr/share/bsdconfig/script.subr || exit 1 +nonInteractive=1 +_httpPath=http://pkg.freebsd.org +mediaSetHTTP +mediaOpen +for package in wget bash rsync; do + packageAdd +done Modified: head/usr.sbin/bsdconfig/examples/browse_packages_http.sh ============================================================================== --- head/usr.sbin/bsdconfig/examples/browse_packages_http.sh Tue Jul 22 22:57:26 2014 (r268998) +++ head/usr.sbin/bsdconfig/examples/browse_packages_http.sh Tue Jul 22 23:10:12 2014 (r268999) @@ -1,25 +1,32 @@ #!/bin/sh # $FreeBSD$ # -# This sample downloads the package INDEX file from HTTP to /tmp (if it doesn't -# already exist) and then displays the package configuration/management screen -# using the local INDEX file (results in faster browsing of packages from-start -# since the INDEX can be loaded from local media). +# This sample downloads the package digests.txz and packagesite.txz files from +# HTTP to /tmp (if they don't already exist) and then displays the package +# configuration/management screen using the local files (resulting in faster +# browsing of packages from-start since digests.txz/packagesite.txz can be +# loaded from local media). # -# NOTE: Packages cannot be installed unless staged to /tmp/packages/All +# NOTE: Packages cannot be installed unless staged to +# /tmp/packages/$PKG_ABI/All # -. /usr/share/bsdconfig/script.subr +[ "$_SCRIPT_SUBR" ] || . /usr/share/bsdconfig/script.subr || exit 1 nonInteractive=1 +f_musthavepkg_init # Make sure we have a usable pkg(8) with $PKG_ABI TMPDIR=/tmp -if [ ! -e "$TMPDIR/packages/INDEX" ]; then - [ -d "$TMPDIR/packages" ] || mkdir -p "$TMPDIR/packages" || exit 1 - _httpPath=http://ftp.freebsd.org - # For older releases, use http://ftp-archive.freebsd.org - mediaSetHTTP - mediaOpen - f_show_info "Downloading packages/INDEX from\n %s" "$_httpPath" - f_device_get device_media packages/INDEX > $TMPDIR/packages/INDEX -fi +PKGDIR=$TMPDIR/packages/$PKG_ABI +[ -d "$PKGDIR" ] || mkdir -p "$PKGDIR" || exit 1 +for file in digests.txz packagesite.txz; do + [ -s "$PKGDIR/$file" ] && continue + if [ ! "$HTTP_INITIALIZED" ]; then + _httpPath=http://pkg.freebsd.org + mediaSetHTTP + mediaOpen + fi + f_show_info "Downloading %s from\n %s" "$file" "$_httpPath" + f_device_get device_media "/$PKG_ABI/latest/$file" > $PKGDIR/$file || + exit 1 +done _directoryPath=$TMPDIR mediaSetDirectory configPackages Modified: head/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/include/messages.subr Tue Jul 22 22:57:26 2014 (r268998) +++ head/usr.sbin/bsdconfig/include/messages.subr Tue Jul 22 23:10:12 2014 (r268999) @@ -57,6 +57,7 @@ msg_back="Back" msg_becoming_root_via_sudo="Becoming root via sudo(8)..." msg_benchmarks_desc="Utilities for measuring system performance." msg_biology_desc="Software related to biology." +msg_bootstrapping_pkg="Bootstrapping pkg(8)..." msg_brazil="Brazil" msg_building_package_menus="Building package menu(s)..." msg_cad_desc="Computer Aided Design utilities." @@ -142,8 +143,6 @@ msg_generating_index_from_pkg_database=" msg_geography_desc="Geography-related software." msg_german_desc="Ported software for Germanic countries." msg_germany="Germany" -msg_getting_package_categories_via_pkg_rquery="Getting package categories via pkg-rquery(8)..." -msg_getting_package_dependencies_via_pkg_rquery="Getting package dependencies via pkg-rquery(8)\n(this can take a while)..." msg_gnome_desc="Components of the Gnome Desktop environment." msg_gnustep_desc="Software for GNUstep desktop environment." msg_graphics_desc="Graphics libraries and utilities." @@ -219,6 +218,7 @@ msg_misc_desc="Miscellaneous utilities." msg_missing_ftp_host_or_directory="Missing FTP host or directory specification. FTP media not initialized." msg_multimedia_desc="Multimedia software." msg_must_be_root_to_execute="%s: must be root to execute" +msg_must_have_pkg_to_execute="%s: must have pkg(8) to execute" msg_must_specify_a_host_name_of_some_sort="Must specify a host name of some sort!" msg_name_server="Name server" msg_net_desc="Networking utilities." @@ -274,6 +274,7 @@ msg_perl5_desc="Utilities/modules for th msg_permission_denied="%s: %s: Permission denied" msg_pkg_delete_failed="Warning: pkg-delete(8) of %s failed.\n Run with debugging for details." msg_pkg_install_apparently_did_not_like_the_package="pkg-install(8) apparently did not like the %s package." +msg_pkg_not_yet_installed_install_now="pkg(8) not yet installed. Install now?" msg_plan9_desc="Software from the Plan9 operating system." msg_please_check_the_url_and_try_again="No such directory: %s\nplease check the URL and try again.\n" msg_please_enter_password="Please enter your password for sudo(8):" @@ -376,15 +377,13 @@ msg_unable_to_get_proper_ftp_path="Unabl msg_unable_to_initialize_media_type_for_package_extract="Unable to initialize media type for package extract." msg_unable_to_make_directory_mountpoint="Unable to make %s directory mountpoint for %s!" msg_unable_to_open="Unable to open %s" -msg_unable_to_pkg_rquery_package_categories="Unable to pkg-rquery(8) package categories!" -msg_unable_to_pkg_rquery_package_dependencies="Unable to pkg-rquery(8) package dependencies!" msg_unable_to_update_pkg_from_selected_media="Unable to update pkg(8) from selected media." msg_uninstall="Uninstall" msg_uninstall_desc="Mark this package for deletion" msg_uninstalling_package_waiting_for_pkg_delete="Uninstalling %s package - waiting for pkg-delete(8)" msg_unknown="unknown" msg_unknown_user="Unknown user: %s" -msg_url_was_not_found="%s was not found, maybe directory or release-version are wrong?" +msg_url_was_not_found="%s was not found,\nmaybe directory or release-version are wrong?" msg_usa="USA" msg_usage="Usage" msg_usb="USB" Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Tue Jul 22 22:57:26 2014 (r268998) +++ head/usr.sbin/bsdconfig/share/common.subr Tue Jul 22 23:10:12 2014 (r268999) @@ -62,12 +62,6 @@ export UNAME_S="$( uname -s )" # Operati export UNAME_P="$( uname -p )" # Processor Architecture (i.e. i386) export UNAME_M="$( uname -m )" # Machine platform (i.e. i386) export UNAME_R="$( uname -r )" # Release Level (i.e. X.Y-RELEASE) -if [ ! "${PKG_ABI+set}" ]; then - export PKG_ABI="$( - ASSUME_ALWAYS_YES=1 pkg -vv 2> /dev/null | - awk '$1=="ABI"{print $3;exit}' - )" -fi # # Default behavior is to call f_debug_init() automatically when loaded. Modified: head/usr.sbin/bsdconfig/share/media/http.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/http.subr Tue Jul 22 22:57:26 2014 (r268998) +++ head/usr.sbin/bsdconfig/share/media/http.subr Tue Jul 22 23:10:12 2014 (r268999) @@ -515,10 +515,7 @@ f_media_init_http() fi esac - if [ $http_found -eq $SUCCESS ]; then - HTTP_INITIALIZED=YES - break - fi + [ $http_found -eq $SUCCESS ] && HTTP_INITIALIZED=YES break f_getvar $VAR_HTTP_PATH http_path f_show_msg "$msg_please_check_the_url_and_try_again" \ @@ -668,7 +665,7 @@ f_media_get_http() 44) f_show_msg "$msg_url_was_not_found" "$url" ;; 4) f_show_msg "$msg_client_error" ;; *) f_show_msg "$msg_error_when_requesting_url" "$url" ;; - esac + esac 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD return $FAILURE } Modified: head/usr.sbin/bsdconfig/share/media/httpproxy.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/httpproxy.subr Tue Jul 22 22:57:26 2014 (r268998) +++ head/usr.sbin/bsdconfig/share/media/httpproxy.subr Tue Jul 22 23:10:12 2014 (r268999) @@ -452,7 +452,7 @@ f_media_get_http_proxy() 44) f_show_msg "$msg_url_was_not_found" "$url" ;; 4) f_show_msg "$msg_client_error" ;; *) f_show_msg "$msg_error_when_requesting_url" "$url" ;; - esac + esac 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD return $FAILURE } Modified: head/usr.sbin/bsdconfig/share/packages/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/Makefile Tue Jul 22 22:57:26 2014 (r268998) +++ head/usr.sbin/bsdconfig/share/packages/Makefile Tue Jul 22 23:10:12 2014 (r268999) @@ -3,7 +3,7 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/bsdconfig/packages -FILES= categories.subr index.subr packages.subr +FILES= categories.subr index.subr musthavepkg.subr packages.subr beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Modified: head/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/index.subr Tue Jul 22 22:57:26 2014 (r268998) +++ head/usr.sbin/bsdconfig/share/packages/index.subr Tue Jul 22 23:10:12 2014 (r268999) @@ -33,6 +33,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" f_dprintf "%s: loading includes..." packages/index.subr f_include $BSDCFG_SHARE/device.subr f_include $BSDCFG_SHARE/media/common.subr +f_include $BSDCFG_SHARE/packages/musthavepkg.subr f_include $BSDCFG_SHARE/strings.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" @@ -53,27 +54,6 @@ SQLITE_REPO="/var/db/pkg/repo-packagesit # PACKAGES_INDEX_CACHEFILE="/var/run/bsdconfig/packages_INDEX.cache" -# -# INDEX format for FreeBSD-6.0 or higher: -# -# package|port-origin|install-prefix|comment|port-desc-file|maintainer| -# categories|build-deps|run-deps|www-site|reserve|reserve|reserve|disc -# -INDEX_FORMAT="%n-%v" # package -INDEX_FORMAT="$INDEX_FORMAT|/usr/ports/%o" # port-origin -INDEX_FORMAT="$INDEX_FORMAT|%p" # install-prefix -INDEX_FORMAT="$INDEX_FORMAT|%c" # comment -INDEX_FORMAT="$INDEX_FORMAT|/usr/ports/%o/pkg-descr" # port-desc-file -INDEX_FORMAT="$INDEX_FORMAT|%m" # maintainer -INDEX_FORMAT="$INDEX_FORMAT|@CATEGORIES@" # place-holder -INDEX_FORMAT="$INDEX_FORMAT|" # build-deps -INDEX_FORMAT="$INDEX_FORMAT|@RUNDEPS@" # place-holder -INDEX_FORMAT="$INDEX_FORMAT|%w" # www-site -INDEX_FORMAT="$INDEX_FORMAT|" # reserved -INDEX_FORMAT="$INDEX_FORMAT|" # reserved -INDEX_FORMAT="$INDEX_FORMAT|" # reserved -INDEX_FORMAT="$INDEX_FORMAT|" # disc - ############################################################ FUNCTIONS # f_index_initialize [$var_to_set] @@ -87,13 +67,16 @@ INDEX_FORMAT="$INDEX_FORMAT|" # disc f_index_initialize() { local __funcname=f_index_initialize - local __var_to_set="${2:-PACKAGE_INDEX}" + local __var_to_set="${1:-PACKAGE_INDEX}" [ "$_INDEX_INITTED" ] && return $SUCCESS # Got any media? f_media_verify || return $FAILURE + # Make sure we have a usable pkg(8) with $PKG_ABI + f_musthavepkg_init + # Does it move when you kick it? f_device_init device_media || return $FAILURE @@ -126,9 +109,10 @@ f_index_initialize() __site="file://$MOUNTPOINT/packages/$PKG_ABI" esac - export PACKAGESITE="$__site" - f_dprintf "PACKAGESITE=[%s]" "$PACKAGESITE" - if ! f_eval_catch $__funcname pkg "pkg update"; then + f_dprintf "PACKAGESITE=[%s]" "$__site" + if ! f_eval_catch $__funcname pkg \ + 'PACKAGESITE="%s" pkg update' "$__site" + then f_show_err "$msg_unable_to_update_pkg_from_selected_media" f_device_shutdown device_media return $FAILURE @@ -195,53 +179,8 @@ f_index_initialize() # If we reach this point, we need to generate the data from scratch # - f_show_info "$msg_getting_package_categories_via_pkg_rquery" - if ! eval "$( pkg rquery "%n-%v %C" | awk ' - { categories[$1] = categories[$1] " " $2 } - END { - for (package in categories) - { - cats = categories[package] - sub(/^ /, "", cats) - gsub(/[^[:alnum:]_]/, "_", package) - printf "local _%s_categories=\"%s\";\n", package, cats - } - }' )"; then - f_show_err "$msg_unable_to_pkg_rquery_package_dependencies" - f_device_shutdown device_media - return $FAILURE - fi - - f_show_info "$msg_getting_package_dependencies_via_pkg_rquery" - if ! eval "$( pkg rquery "%n-%v %dn-%dv" | awk ' - { rundeps[$1] = rundeps[$1] " " $2 } - END { - for (package in rundeps) - { - deps = rundeps[package] - sub(/^ /, "", deps) - gsub(/[^[:alnum:]_]/, "_", package) - printf "local _%s_rundeps=\"%s\";\n", package, deps - } - }' )"; then - f_show_err "$msg_unable_to_pkg_rquery_package_dependencies" - f_device_shutdown device_media - return $FAILURE - fi - f_show_info "$msg_generating_index_from_pkg_database" - eval "$__var_to_set"='$( pkg rquery "$INDEX_FORMAT" | - while read LINE; do - package="${LINE%%|*}"; - f_str2varname "$package" varpkg; - eval f_replaceall \"\$LINE\" \"\|@CATEGORIES@\|\" \ - \"\|\$_${varpkg}_categories\|\" LINE - eval f_replaceall \"\$LINE\" \"\|@RUNDEPS@\|\" \ - \"\|\$_${varpkg}_rundeps\|\" LINE - echo "$LINE" - done - )' # always returns true (status of last item in pipe-chain) - eval "$__var_to_set"='$( debug= f_getvar "$__var_to_set" | sort )' + eval "$__var_to_set"='$( pkg rquery -I | sort )' # # Attempt to create the persistant on-disk cache Added: head/usr.sbin/bsdconfig/share/packages/musthavepkg.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/share/packages/musthavepkg.subr Tue Jul 22 23:10:12 2014 (r268999) @@ -0,0 +1,87 @@ +if [ ! "$_PACKAGES_MUSTHAVEPKG_SUBR" ]; then _PACKAGES_MUSTHAVEPKG_SUBR=1 +# +# Copyright (c) 2014 Devin Teske +# 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$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." packages/musthavepkg.subr +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr + +############################################################ FUNCTIONS + +# f_musthavepkg_init +# +# Validate pkg(8) is installed and set $PKG_ABI global if not already set. +# Returns success unless pkg(8) is not installed and user refuses to install +# it (upon prompt when running interactively). +# +f_musthavepkg_init() +{ + local funcname=f_musthavepkg_init + local pkg_abi_awk='$1~/^ABI/{print $NF; exit}' + + if [ "$PKG_ABI" ]; then # Already set + f_dprintf "PKG_ABI=[%s]" "$PKG_ABI" + export PKG_ABI + f_quietly pkg -N -vv # return status (pkg(8) functional?) + return $? + fi + + # Attempt to get PKG_ABI without prematurely bootstrapping pkg(8) + if f_eval_catch -k PKG_ABI $funcname pkg \ + "pkg -N -vv | awk '%s'" "$pkg_abi_awk" + then + f_dprintf "PKG_ABI=[%s]" "$PKG_ABI" + export PKG_ABI + return $SUCCESS + fi + + # pkg(8) not yet bootstrapped; ask for permission unless nonInteractive + f_dialog_yesno "$msg_pkg_not_yet_installed_install_now" || + f_die 1 "$msg_must_have_pkg_to_execute" "$pgm" + + f_mustberoot_init # Have to be root to install pkg(8) + + # Bootstrap pkg(8) + f_dialog_info "$msg_bootstrapping_pkg" + f_eval_catch -k PKG_ABI $funcname pkg \ + "ASSUME_ALWAYS_YES=1 pkg -vv | awk '%s'" "$pkg_abi_awk" || + f_die 1 "$msg_must_have_pkg_to_execute" "$pgm" + + f_dprintf "PKG_ABI=[%s]" "$PKG_ABI" + export PKG_ABI + return $SUCCESS +} + +############################################################ MAIN + +f_dprintf "%s: Successfully loaded." packages/musthavepkg.subr + +fi # ! $_PACKAGES_MUSTHAVEPKG_SUBR Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Tue Jul 22 22:57:26 2014 (r268998) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Tue Jul 22 23:10:12 2014 (r268999) @@ -36,6 +36,7 @@ f_include $BSDCFG_SHARE/device.subr f_include $BSDCFG_SHARE/media/common.subr f_include $BSDCFG_SHARE/packages/categories.subr f_include $BSDCFG_SHARE/packages/index.subr +f_include $BSDCFG_SHARE/packages/musthavepkg.subr f_include $BSDCFG_SHARE/strings.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" @@ -662,7 +663,7 @@ f_package_review() f_package_config() { # Did we get an INDEX? - f_index_initialize packages/INDEX || return $FAILURE + f_index_initialize || return $FAILURE # Creates following variables (indirectly via f_index_read()) # CATEGORY_MENU_LIST _categories_{varpkg} _rundeps_{varpkg} # PACKAGE_CATEGORIES _npkgs @@ -839,7 +840,7 @@ f_package_add() { # Verify and initialize device media if-defined f_media_verify && f_device_init device_media && - f_index_initialize packages/INDEX + f_index_initialize } || return $FAILURE # Now we have (indirectly via f_index_read()): @@ -946,6 +947,8 @@ f_package_extract() local device="$1" name="$2" depended="$3" local devname= + f_musthavepkg_init # Make sure we have a usable pkg(8) with $PKG_ABI + $device get name devname f_dprintf "$funcname: device=[%s] name=[%s] depended=[%s]" \ "$devname" "$name" "$depended" @@ -1065,7 +1068,7 @@ f_package_delete() { # Verify and initialize device media if-defined f_media_verify && f_device_init device_media && - f_index_initialize packages/INDEX + f_index_initialize } || return $FAILURE # Now we have (indirectly via f_index_read()): From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 23:16:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43C26B1E; Tue, 22 Jul 2014 23:16:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DD0B22E2; Tue, 22 Jul 2014 23:16:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MNGU2I064487; Tue, 22 Jul 2014 23:16:30 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MNGSpt064478; Tue, 22 Jul 2014 23:16:28 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201407222316.s6MNGSpt064478@svn.freebsd.org> From: Ed Maste Date: Tue, 22 Jul 2014 23:16:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269000 - in stable/10/contrib/llvm: include/llvm lib/CodeGen/AsmPrinter patches tools/clang/lib/CodeGen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 23:16:30 -0000 Author: emaste Date: Tue Jul 22 23:16:28 2014 New Revision: 269000 URL: http://svnweb.freebsd.org/changeset/base/269000 Log: MFC debug info for variadic functions r264826: Merge LLVM r202188: Debug info: Support variadic functions. Variadic functions have an unspecified parameter tag after the last argument. In IR this is represented as an unspecified parameter in the subroutine type. Paired commit with CFE r202185. rdar://problem/13690847 This re-applies r202184 + a bugfix in DwarfDebug's argument handling. This merge includes a change to use the LLVM 3.4 API in lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp: DwarfUnit -> CompileUnit r264827: Merge Clang r202185: Debug info: Generate debug info for variadic functions. Paired commit with LLVM. rdar://problem/13690847 This merege includes changes to use the Clang 3.4 API (revisions 199686 and 200082) in lib/CodeGen/CGDebugInfo.cpp: getParamType -> getArgType getNumParams -> getNumArgs getReturnType -> getResultType r264828: Add patches corresponding to r264826 and r264827 Sponsored by: DARPA, AFRL Added: stable/10/contrib/llvm/patches/patch-r264826-llvm-r202188-variadic-fn-debug-info.diff - copied unchanged from r264828, head/contrib/llvm/patches/patch-r264826-llvm-r202188-variadic-fn-debug-info.diff stable/10/contrib/llvm/patches/patch-r264827-clang-r202185-variadic-fn-debug-info.diff - copied unchanged from r264828, head/contrib/llvm/patches/patch-r264827-clang-r202185-variadic-fn-debug-info.diff Modified: stable/10/contrib/llvm/include/llvm/DIBuilder.h stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/llvm/include/llvm/DIBuilder.h ============================================================================== --- stable/10/contrib/llvm/include/llvm/DIBuilder.h Tue Jul 22 23:10:12 2014 (r268999) +++ stable/10/contrib/llvm/include/llvm/DIBuilder.h Tue Jul 22 23:16:28 2014 (r269000) @@ -439,7 +439,7 @@ namespace llvm { /// through debug info anchors. void retainType(DIType T); - /// createUnspecifiedParameter - Create unspeicified type descriptor + /// createUnspecifiedParameter - Create unspecified type descriptor /// for a subroutine type. DIDescriptor createUnspecifiedParameter(); Modified: stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp ============================================================================== --- stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Tue Jul 22 23:10:12 2014 (r268999) +++ stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Tue Jul 22 23:16:28 2014 (r269000) @@ -1116,6 +1116,22 @@ void CompileUnit::constructTypeDIE(DIE & addSourceLine(&Buffer, DTy); } +/// constructSubprogramArguments - Construct function argument DIEs. +void CompileUnit::constructSubprogramArguments(DIE &Buffer, DIArray Args) { + for (unsigned i = 1, N = Args.getNumElements(); i < N; ++i) { + DIDescriptor Ty = Args.getElement(i); + if (Ty.isUnspecifiedParameter()) { + assert(i == N-1 && "ellipsis must be the last argument"); + createAndAddDIE(dwarf::DW_TAG_unspecified_parameters, Buffer); + } else { + DIE *Arg = createAndAddDIE(dwarf::DW_TAG_formal_parameter, Buffer); + addType(Arg, DIType(Ty)); + if (DIType(Ty).isArtificial()) + addFlag(Arg, dwarf::DW_AT_artificial); + } + } +} + /// Return true if the type is appropriately scoped to be contained inside /// its own type unit. static bool isTypeUnitScoped(DIType Ty, const DwarfDebug *DD) { @@ -1170,19 +1186,12 @@ void CompileUnit::constructTypeDIE(DIE & addType(&Buffer, RTy); bool isPrototyped = true; - // Add arguments. - for (unsigned i = 1, N = Elements.getNumElements(); i < N; ++i) { - DIDescriptor Ty = Elements.getElement(i); - if (Ty.isUnspecifiedParameter()) { - createAndAddDIE(dwarf::DW_TAG_unspecified_parameters, Buffer); - isPrototyped = false; - } else { - DIE *Arg = createAndAddDIE(dwarf::DW_TAG_formal_parameter, Buffer); - addType(Arg, DIType(Ty)); - if (DIType(Ty).isArtificial()) - addFlag(Arg, dwarf::DW_AT_artificial); - } - } + if (Elements.getNumElements() == 2 && + Elements.getElement(1).isUnspecifiedParameter()) + isPrototyped = false; + + constructSubprogramArguments(Buffer, Elements); + // Add prototype flag if we're dealing with a C language and the // function has been prototyped. uint16_t Language = getLanguage(); @@ -1475,13 +1484,7 @@ DIE *CompileUnit::getOrCreateSubprogramD // Add arguments. Do not add arguments for subprogram definition. They will // be handled while processing variables. - for (unsigned i = 1, N = Args.getNumElements(); i < N; ++i) { - DIE *Arg = createAndAddDIE(dwarf::DW_TAG_formal_parameter, *SPDie); - DIType ATy(Args.getElement(i)); - addType(Arg, ATy); - if (ATy.isArtificial()) - addFlag(Arg, dwarf::DW_AT_artificial); - } + constructSubprogramArguments(*SPDie, Args); } if (SP.isArtificial()) Modified: stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h ============================================================================== --- stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h Tue Jul 22 23:10:12 2014 (r268999) +++ stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h Tue Jul 22 23:16:28 2014 (r269000) @@ -342,6 +342,9 @@ public: void emitHeader(const MCSection *ASection, const MCSymbol *ASectionSym); private: + /// constructSubprogramArguments - Construct function argument DIEs. + void constructSubprogramArguments(DIE &Buffer, DIArray Args); + /// constructTypeDIE - Construct basic type die from DIBasicType. void constructTypeDIE(DIE &Buffer, DIBasicType BTy); Modified: stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp ============================================================================== --- stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Jul 22 23:10:12 2014 (r268999) +++ stable/10/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Jul 22 23:16:28 2014 (r269000) @@ -404,15 +404,21 @@ DIE *DwarfDebug::updateSubprogramScopeDI DIArray Args = SPTy.getTypeArray(); uint16_t SPTag = SPTy.getTag(); if (SPTag == dwarf::DW_TAG_subroutine_type) + // FIXME: Use DwarfUnit::constructSubprogramArguments() here. for (unsigned i = 1, N = Args.getNumElements(); i < N; ++i) { - DIE *Arg = - SPCU->createAndAddDIE(dwarf::DW_TAG_formal_parameter, *SPDie); DIType ATy(Args.getElement(i)); - SPCU->addType(Arg, ATy); - if (ATy.isArtificial()) - SPCU->addFlag(Arg, dwarf::DW_AT_artificial); - if (ATy.isObjectPointer()) - SPCU->addDIEEntry(SPDie, dwarf::DW_AT_object_pointer, Arg); + if (ATy.isUnspecifiedParameter()) { + assert(i == N-1 && "ellipsis must be the last argument"); + SPCU->createAndAddDIE(dwarf::DW_TAG_unspecified_parameters, *SPDie); + } else { + DIE *Arg = + SPCU->createAndAddDIE(dwarf::DW_TAG_formal_parameter, *SPDie); + SPCU->addType(Arg, ATy); + if (ATy.isArtificial()) + SPCU->addFlag(Arg, dwarf::DW_AT_artificial); + if (ATy.isObjectPointer()) + SPCU->addDIEEntry(SPDie, dwarf::DW_AT_object_pointer, Arg); + } } DIE *SPDeclDie = SPDie; SPDie = @@ -579,7 +585,7 @@ DIE *DwarfDebug::createScopeChildrenDIE( DIE *ObjectPointer = NULL; // Collect arguments for current function. - if (LScopes.isCurrentFunctionScope(Scope)) + if (LScopes.isCurrentFunctionScope(Scope)) { for (unsigned i = 0, N = CurrentFnArguments.size(); i < N; ++i) if (DbgVariable *ArgDV = CurrentFnArguments[i]) if (DIE *Arg = @@ -588,6 +594,16 @@ DIE *DwarfDebug::createScopeChildrenDIE( if (ArgDV->isObjectPointer()) ObjectPointer = Arg; } + // Create the unspecified parameter that marks a function as variadic. + DISubprogram SP(Scope->getScopeNode()); + assert(SP.Verify()); + DIArray FnArgs = SP.getType().getTypeArray(); + if (FnArgs.getElement(FnArgs.getNumElements()-1).isUnspecifiedParameter()) { + DIE *Ellipsis = new DIE(dwarf::DW_TAG_unspecified_parameters); + Children.push_back(Ellipsis); + } + } + // Collect lexical scope children first. const SmallVectorImpl &Variables =ScopeVariables.lookup(Scope); for (unsigned i = 0, N = Variables.size(); i < N; ++i) Copied: stable/10/contrib/llvm/patches/patch-r264826-llvm-r202188-variadic-fn-debug-info.diff (from r264828, head/contrib/llvm/patches/patch-r264826-llvm-r202188-variadic-fn-debug-info.diff) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/llvm/patches/patch-r264826-llvm-r202188-variadic-fn-debug-info.diff Tue Jul 22 23:16:28 2014 (r269000, copy of r264828, head/contrib/llvm/patches/patch-r264826-llvm-r202188-variadic-fn-debug-info.diff) @@ -0,0 +1,176 @@ +Merge LLVM r202188: + + Debug info: Support variadic functions. + Variadic functions have an unspecified parameter tag after the last + argument. In IR this is represented as an unspecified parameter in the + subroutine type. + + Paired commit with CFE r202185. + + rdar://problem/13690847 + + This re-applies r202184 + a bugfix in DwarfDebug's argument handling. + +This merge includes a change to use the LLVM 3.4 API in +lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp: + +DwarfUnit -> CompileUnit + +Sponsored by: DARPA, AFRL + +http://svnweb.freebsd.org/changeset/base/264826 + +Index: include/llvm/DIBuilder.h +=================================================================== +--- include/llvm/DIBuilder.h (revision 264825) ++++ include/llvm/DIBuilder.h (revision 264826) +@@ -439,7 +439,7 @@ + /// through debug info anchors. + void retainType(DIType T); + +- /// createUnspecifiedParameter - Create unspeicified type descriptor ++ /// createUnspecifiedParameter - Create unspecified type descriptor + /// for a subroutine type. + DIDescriptor createUnspecifiedParameter(); + +Index: lib/CodeGen/AsmPrinter/DwarfDebug.cpp +=================================================================== +--- lib/CodeGen/AsmPrinter/DwarfDebug.cpp (revision 264825) ++++ lib/CodeGen/AsmPrinter/DwarfDebug.cpp (revision 264826) +@@ -404,15 +404,21 @@ + DIArray Args = SPTy.getTypeArray(); + uint16_t SPTag = SPTy.getTag(); + if (SPTag == dwarf::DW_TAG_subroutine_type) ++ // FIXME: Use DwarfUnit::constructSubprogramArguments() here. + for (unsigned i = 1, N = Args.getNumElements(); i < N; ++i) { +- DIE *Arg = ++ DIType ATy(Args.getElement(i)); ++ if (ATy.isUnspecifiedParameter()) { ++ assert(i == N-1 && "ellipsis must be the last argument"); ++ SPCU->createAndAddDIE(dwarf::DW_TAG_unspecified_parameters, *SPDie); ++ } else { ++ DIE *Arg = + SPCU->createAndAddDIE(dwarf::DW_TAG_formal_parameter, *SPDie); +- DIType ATy(Args.getElement(i)); +- SPCU->addType(Arg, ATy); +- if (ATy.isArtificial()) +- SPCU->addFlag(Arg, dwarf::DW_AT_artificial); +- if (ATy.isObjectPointer()) +- SPCU->addDIEEntry(SPDie, dwarf::DW_AT_object_pointer, Arg); ++ SPCU->addType(Arg, ATy); ++ if (ATy.isArtificial()) ++ SPCU->addFlag(Arg, dwarf::DW_AT_artificial); ++ if (ATy.isObjectPointer()) ++ SPCU->addDIEEntry(SPDie, dwarf::DW_AT_object_pointer, Arg); ++ } + } + DIE *SPDeclDie = SPDie; + SPDie = +@@ -579,7 +585,7 @@ + DIE *ObjectPointer = NULL; + + // Collect arguments for current function. +- if (LScopes.isCurrentFunctionScope(Scope)) ++ if (LScopes.isCurrentFunctionScope(Scope)) { + for (unsigned i = 0, N = CurrentFnArguments.size(); i < N; ++i) + if (DbgVariable *ArgDV = CurrentFnArguments[i]) + if (DIE *Arg = +@@ -588,6 +594,16 @@ + if (ArgDV->isObjectPointer()) ObjectPointer = Arg; + } + ++ // Create the unspecified parameter that marks a function as variadic. ++ DISubprogram SP(Scope->getScopeNode()); ++ assert(SP.Verify()); ++ DIArray FnArgs = SP.getType().getTypeArray(); ++ if (FnArgs.getElement(FnArgs.getNumElements()-1).isUnspecifiedParameter()) { ++ DIE *Ellipsis = new DIE(dwarf::DW_TAG_unspecified_parameters); ++ Children.push_back(Ellipsis); ++ } ++ } ++ + // Collect lexical scope children first. + const SmallVectorImpl &Variables =ScopeVariables.lookup(Scope); + for (unsigned i = 0, N = Variables.size(); i < N; ++i) +Index: lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +=================================================================== +--- lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (revision 264825) ++++ lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (revision 264826) +@@ -1116,6 +1116,22 @@ + addSourceLine(&Buffer, DTy); + } + ++/// constructSubprogramArguments - Construct function argument DIEs. ++void CompileUnit::constructSubprogramArguments(DIE &Buffer, DIArray Args) { ++ for (unsigned i = 1, N = Args.getNumElements(); i < N; ++i) { ++ DIDescriptor Ty = Args.getElement(i); ++ if (Ty.isUnspecifiedParameter()) { ++ assert(i == N-1 && "ellipsis must be the last argument"); ++ createAndAddDIE(dwarf::DW_TAG_unspecified_parameters, Buffer); ++ } else { ++ DIE *Arg = createAndAddDIE(dwarf::DW_TAG_formal_parameter, Buffer); ++ addType(Arg, DIType(Ty)); ++ if (DIType(Ty).isArtificial()) ++ addFlag(Arg, dwarf::DW_AT_artificial); ++ } ++ } ++} ++ + /// Return true if the type is appropriately scoped to be contained inside + /// its own type unit. + static bool isTypeUnitScoped(DIType Ty, const DwarfDebug *DD) { +@@ -1170,19 +1186,12 @@ + addType(&Buffer, RTy); + + bool isPrototyped = true; +- // Add arguments. +- for (unsigned i = 1, N = Elements.getNumElements(); i < N; ++i) { +- DIDescriptor Ty = Elements.getElement(i); +- if (Ty.isUnspecifiedParameter()) { +- createAndAddDIE(dwarf::DW_TAG_unspecified_parameters, Buffer); +- isPrototyped = false; +- } else { +- DIE *Arg = createAndAddDIE(dwarf::DW_TAG_formal_parameter, Buffer); +- addType(Arg, DIType(Ty)); +- if (DIType(Ty).isArtificial()) +- addFlag(Arg, dwarf::DW_AT_artificial); +- } +- } ++ if (Elements.getNumElements() == 2 && ++ Elements.getElement(1).isUnspecifiedParameter()) ++ isPrototyped = false; ++ ++ constructSubprogramArguments(Buffer, Elements); ++ + // Add prototype flag if we're dealing with a C language and the + // function has been prototyped. + uint16_t Language = getLanguage(); +@@ -1475,13 +1484,7 @@ + + // Add arguments. Do not add arguments for subprogram definition. They will + // be handled while processing variables. +- for (unsigned i = 1, N = Args.getNumElements(); i < N; ++i) { +- DIE *Arg = createAndAddDIE(dwarf::DW_TAG_formal_parameter, *SPDie); +- DIType ATy(Args.getElement(i)); +- addType(Arg, ATy); +- if (ATy.isArtificial()) +- addFlag(Arg, dwarf::DW_AT_artificial); +- } ++ constructSubprogramArguments(*SPDie, Args); + } + + if (SP.isArtificial()) +Index: lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +=================================================================== +--- lib/CodeGen/AsmPrinter/DwarfCompileUnit.h (revision 264825) ++++ lib/CodeGen/AsmPrinter/DwarfCompileUnit.h (revision 264826) +@@ -342,6 +342,9 @@ + void emitHeader(const MCSection *ASection, const MCSymbol *ASectionSym); + + private: ++ /// constructSubprogramArguments - Construct function argument DIEs. ++ void constructSubprogramArguments(DIE &Buffer, DIArray Args); ++ + /// constructTypeDIE - Construct basic type die from DIBasicType. + void constructTypeDIE(DIE &Buffer, DIBasicType BTy); + Copied: stable/10/contrib/llvm/patches/patch-r264827-clang-r202185-variadic-fn-debug-info.diff (from r264828, head/contrib/llvm/patches/patch-r264827-clang-r202185-variadic-fn-debug-info.diff) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/llvm/patches/patch-r264827-clang-r202185-variadic-fn-debug-info.diff Tue Jul 22 23:16:28 2014 (r269000, copy of r264828, head/contrib/llvm/patches/patch-r264827-clang-r202185-variadic-fn-debug-info.diff) @@ -0,0 +1,74 @@ +Merge Clang r202185: + + Debug info: Generate debug info for variadic functions. + Paired commit with LLVM. + + rdar://problem/13690847 + +This merege includes changes to use the Clang 3.4 API (revisions +199686 and 200082) in lib/CodeGen/CGDebugInfo.cpp: + +getParamType -> getArgType +getNumParams -> getNumArgs +getReturnType -> getResultType + +Sponsored by: DARPA, AFRL + +http://svnweb.freebsd.org/changeset/base/264827 + +Index: tools/clang/lib/CodeGen/CGDebugInfo.cpp +=================================================================== +--- tools/clang/lib/CodeGen/CGDebugInfo.cpp (revision 264826) ++++ tools/clang/lib/CodeGen/CGDebugInfo.cpp (revision 264827) +@@ -37,7 +37,7 @@ + #include "llvm/IR/Module.h" + #include "llvm/Support/Dwarf.h" + #include "llvm/Support/FileSystem.h" +-#include "llvm/Support/Path.h" ++#include "llvm/Support/Path.h" + using namespace clang; + using namespace clang::CodeGen; + +@@ -342,9 +342,9 @@ + if (const FileEntry *MainFile = SM.getFileEntryForID(SM.getMainFileID())) { + MainFileDir = MainFile->getDir()->getName(); + if (MainFileDir != ".") { +- llvm::SmallString<1024> MainFileDirSS(MainFileDir); +- llvm::sys::path::append(MainFileDirSS, MainFileName); +- MainFileName = MainFileDirSS.str(); ++ llvm::SmallString<1024> MainFileDirSS(MainFileDir); ++ llvm::sys::path::append(MainFileDirSS, MainFileName); ++ MainFileName = MainFileDirSS.str(); + } + } + +@@ -760,6 +760,8 @@ + else if (const FunctionProtoType *FPT = dyn_cast(Ty)) { + for (unsigned i = 0, e = FPT->getNumArgs(); i != e; ++i) + EltTys.push_back(getOrCreateType(FPT->getArgType(i), Unit)); ++ if (FPT->isVariadic()) ++ EltTys.push_back(DBuilder.createUnspecifiedParameter()); + } + + llvm::DIArray EltTypeArray = DBuilder.getOrCreateArray(EltTys); +@@ -2420,6 +2422,20 @@ + llvm::DIArray EltTypeArray = DBuilder.getOrCreateArray(Elts); + return DBuilder.createSubroutineType(F, EltTypeArray); + } ++ ++ // Variadic function. ++ if (const FunctionDecl *FD = dyn_cast(D)) ++ if (FD->isVariadic()) { ++ SmallVector EltTys; ++ EltTys.push_back(getOrCreateType(FD->getResultType(), F)); ++ if (const FunctionProtoType *FPT = dyn_cast(FnType)) ++ for (unsigned i = 0, e = FPT->getNumArgs(); i != e; ++i) ++ EltTys.push_back(getOrCreateType(FPT->getArgType(i), F)); ++ EltTys.push_back(DBuilder.createUnspecifiedParameter()); ++ llvm::DIArray EltTypeArray = DBuilder.getOrCreateArray(EltTys); ++ return DBuilder.createSubroutineType(F, EltTypeArray); ++ } ++ + return llvm::DICompositeType(getOrCreateType(FnType, F)); + } + Modified: stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp ============================================================================== --- stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp Tue Jul 22 23:10:12 2014 (r268999) +++ stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp Tue Jul 22 23:16:28 2014 (r269000) @@ -37,7 +37,7 @@ #include "llvm/IR/Module.h" #include "llvm/Support/Dwarf.h" #include "llvm/Support/FileSystem.h" -#include "llvm/Support/Path.h" +#include "llvm/Support/Path.h" using namespace clang; using namespace clang::CodeGen; @@ -342,9 +342,9 @@ void CGDebugInfo::CreateCompileUnit() { if (const FileEntry *MainFile = SM.getFileEntryForID(SM.getMainFileID())) { MainFileDir = MainFile->getDir()->getName(); if (MainFileDir != ".") { - llvm::SmallString<1024> MainFileDirSS(MainFileDir); - llvm::sys::path::append(MainFileDirSS, MainFileName); - MainFileName = MainFileDirSS.str(); + llvm::SmallString<1024> MainFileDirSS(MainFileDir); + llvm::sys::path::append(MainFileDirSS, MainFileName); + MainFileName = MainFileDirSS.str(); } } @@ -760,6 +760,8 @@ llvm::DIType CGDebugInfo::CreateType(con else if (const FunctionProtoType *FPT = dyn_cast(Ty)) { for (unsigned i = 0, e = FPT->getNumArgs(); i != e; ++i) EltTys.push_back(getOrCreateType(FPT->getArgType(i), Unit)); + if (FPT->isVariadic()) + EltTys.push_back(DBuilder.createUnspecifiedParameter()); } llvm::DIArray EltTypeArray = DBuilder.getOrCreateArray(EltTys); @@ -2420,6 +2422,20 @@ llvm::DICompositeType CGDebugInfo::getOr llvm::DIArray EltTypeArray = DBuilder.getOrCreateArray(Elts); return DBuilder.createSubroutineType(F, EltTypeArray); } + + // Variadic function. + if (const FunctionDecl *FD = dyn_cast(D)) + if (FD->isVariadic()) { + SmallVector EltTys; + EltTys.push_back(getOrCreateType(FD->getResultType(), F)); + if (const FunctionProtoType *FPT = dyn_cast(FnType)) + for (unsigned i = 0, e = FPT->getNumArgs(); i != e; ++i) + EltTys.push_back(getOrCreateType(FPT->getArgType(i), F)); + EltTys.push_back(DBuilder.createUnspecifiedParameter()); + llvm::DIArray EltTypeArray = DBuilder.getOrCreateArray(EltTys); + return DBuilder.createSubroutineType(F, EltTypeArray); + } + return llvm::DICompositeType(getOrCreateType(FnType, F)); } From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 23:29:55 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA2A2FB1; Tue, 22 Jul 2014 23:29:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9753523D8; Tue, 22 Jul 2014 23:29:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MNTt1K069645; Tue, 22 Jul 2014 23:29:55 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MNTtLI069643; Tue, 22 Jul 2014 23:29:55 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407222329.s6MNTtLI069643@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 22 Jul 2014 23:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269001 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 23:29:55 -0000 Author: pfg Date: Tue Jul 22 23:29:54 2014 New Revision: 269001 URL: http://svnweb.freebsd.org/changeset/base/269001 Log: Avoid possible cast degradation. For consistency with r268985 for fputs.c, assign iov_len first, avoiding the cast to uio_resid (int in stdio) from degrading the value. We currently don't support lengths higher than INT_MAX so this change is little more than cosmetic. MFC after: 3 days Modified: head/lib/libc/stdio/fputws.c head/lib/libc/stdio/putw.c Modified: head/lib/libc/stdio/fputws.c ============================================================================== --- head/lib/libc/stdio/fputws.c Tue Jul 22 23:16:28 2014 (r269000) +++ head/lib/libc/stdio/fputws.c Tue Jul 22 23:29:54 2014 (r269001) @@ -67,7 +67,7 @@ fputws_l(const wchar_t * __restrict ws, &fp->_mbstate); if (nbytes == (size_t)-1) goto error; - iov.iov_len = uio.uio_resid = nbytes; + uio.uio_resid = iov.iov_len = nbytes; if (__sfvwrite(fp, &uio) != 0) goto error; } while (wsp != NULL); Modified: head/lib/libc/stdio/putw.c ============================================================================== --- head/lib/libc/stdio/putw.c Tue Jul 22 23:16:28 2014 (r269000) +++ head/lib/libc/stdio/putw.c Tue Jul 22 23:29:54 2014 (r269001) @@ -50,7 +50,7 @@ putw(int w, FILE *fp) struct __siov iov; iov.iov_base = &w; - iov.iov_len = uio.uio_resid = sizeof(w); + uio.uio_resid = iov.iov_len = sizeof(w); uio.uio_iov = &iov; uio.uio_iovcnt = 1; FLOCKFILE(fp); From owner-svn-src-all@FreeBSD.ORG Tue Jul 22 23:58:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5142F817; Tue, 22 Jul 2014 23:58:15 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 290F22624; Tue, 22 Jul 2014 23:58:14 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s6MNwEpc066803 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Jul 2014 16:58:14 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s6MNwDlF066802; Tue, 22 Jul 2014 16:58:13 -0700 (PDT) (envelope-from jmg) Date: Tue, 22 Jul 2014 16:58:13 -0700 From: John-Mark Gurney To: Adrian Chadd Subject: Re: svn commit: r268986 - head/sys/geom/uzip Message-ID: <20140722235813.GI43962@funkthat.com> References: <201407221730.s6MHU6Ej099771@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 22 Jul 2014 16:58:14 -0700 (PDT) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Marcel Moolenaar , "src-committers@freebsd.org" , Marcel Moolenaar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2014 23:58:15 -0000 Adrian Chadd wrote this message on Tue, Jul 22, 2014 at 10:59 -0700: > On 22 July 2014 10:47, Marcel Moolenaar wrote: > > > > On Jul 22, 2014, at 10:46 AM, Adrian Chadd wrote: > > > >> Wait, which consumers failed that test? > > > > geom_vfs I presume, because the file corruption is seen with UFS. > > Interesting. > > I wonder if this is about time we bit the bullet and compiled up GEOM > modules in userland so we can run regression tests on things. Or add proper KASSERTs... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@FreeBSD.ORG Wed Jul 23 00:35:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 790BFC43; Wed, 23 Jul 2014 00:35:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 635B22912; Wed, 23 Jul 2014 00:35:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6N0Z8Qf001984; Wed, 23 Jul 2014 00:35:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6N0Z6s7001973; Wed, 23 Jul 2014 00:35:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407230035.s6N0Z6s7001973@svn.freebsd.org> From: Xin LI Date: Wed, 23 Jul 2014 00:35:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r269002 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jul 2014 00:35:08 -0000 Author: delphij Date: Wed Jul 23 00:35:06 2014 New Revision: 269002 URL: http://svnweb.freebsd.org/changeset/base/269002 Log: MFC r268464: MFV r268452: Explicitly mark file removal transactions as "presumed to result in a net free of space" so they will not fail with ENOSPC. Illumos issue: 4950 files sometimes can't be removed from a full filesystem Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue Jul 22 23:29:54 2014 (r269001) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Wed Jul 23 00:35:06 2014 (r269002) @@ -673,6 +673,12 @@ dmu_free_long_range_impl(objset_t *os, d dmu_tx_t *tx = dmu_tx_create(os); dmu_tx_hold_free(tx, dn->dn_object, chunk_begin, chunk_end - chunk_begin); + + /* + * Mark this transaction as typically resulting in a net + * reduction in space used. + */ + dmu_tx_mark_netfree(tx); err = dmu_tx_assign(tx, TXG_WAIT); if (err) { dmu_tx_abort(tx); @@ -724,6 +730,7 @@ dmu_free_long_object(objset_t *os, uint6 tx = dmu_tx_create(os); dmu_tx_hold_bonus(tx, object); dmu_tx_hold_free(tx, object, 0, DMU_OBJECT_END); + dmu_tx_mark_netfree(tx); err = dmu_tx_assign(tx, TXG_WAIT); if (err == 0) { err = dmu_object_free(os, object, tx); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Tue Jul 22 23:29:54 2014 (r269001) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Wed Jul 23 00:35:06 2014 (r269002) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -583,6 +583,32 @@ dmu_tx_count_free(dmu_tx_hold_t *txh, ui txh->txh_space_tounref += unref; } +/* + * This function marks the transaction as being a "net free". The end + * result is that refquotas will be disabled for this transaction, and + * this transaction will be able to use half of the pool space overhead + * (see dsl_pool_adjustedsize()). Therefore this function should only + * be called for transactions that we expect will not cause a net increase + * in the amount of space used (but it's OK if that is occasionally not true). + */ +void +dmu_tx_mark_netfree(dmu_tx_t *tx) +{ + dmu_tx_hold_t *txh; + + txh = dmu_tx_hold_object_impl(tx, tx->tx_objset, + DMU_NEW_OBJECT, THT_FREE, 0, 0); + + /* + * Pretend that this operation will free 1GB of space. This + * should be large enough to cancel out the largest write. + * We don't want to use something like UINT64_MAX, because that would + * cause overflows when doing math with these values (e.g. in + * dmu_tx_try_assign()). + */ + txh->txh_space_tofree = txh->txh_space_tounref = 1024 * 1024 * 1024; +} + void dmu_tx_hold_free(dmu_tx_t *tx, uint64_t object, uint64_t off, uint64_t len) { Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Tue Jul 22 23:29:54 2014 (r269001) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Wed Jul 23 00:35:06 2014 (r269002) @@ -569,6 +569,7 @@ void dmu_tx_abort(dmu_tx_t *tx); int dmu_tx_assign(dmu_tx_t *tx, enum txg_how txg_how); void dmu_tx_wait(dmu_tx_t *tx); void dmu_tx_commit(dmu_tx_t *tx); +void dmu_tx_mark_netfree(dmu_tx_t *tx); /* * To register a commit callback, dmu_tx_callback_register() must be called. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Tue Jul 22 23:29:54 2014 (r269001) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Wed Jul 23 00:35:06 2014 (r269002) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. */ #include @@ -559,6 +559,7 @@ zfs_purgedir(znode_t *dzp) dmu_tx_hold_zap(tx, zfsvfs->z_unlinkedobj, FALSE, NULL); /* Is this really needed ? */ zfs_sa_upgrade_txholds(tx, xzp); + dmu_tx_mark_netfree(tx); error = dmu_tx_assign(tx, TXG_WAIT); if (error) { dmu_tx_abort(tx); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Jul 22 23:29:54 2014 (r269001) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jul 23 00:35:06 2014 (r269002) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ @@ -1558,7 +1558,7 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode * cr - credentials of caller. * flag - large file flag [UNUSED]. * ct - caller context - * vsecp - ACL to be set + * vsecp - ACL to be set * * OUT: vpp - vnode of created or trunc'd entry. * @@ -1840,7 +1840,7 @@ zfs_remove(vnode_t *dvp, char *name, cre zfsvfs_t *zfsvfs = dzp->z_zfsvfs; zilog_t *zilog; uint64_t acl_obj, xattr_obj; - uint64_t xattr_obj_unlinked = 0; + uint64_t xattr_obj_unlinked = 0; uint64_t obj = 0; zfs_dirlock_t *dl; dmu_tx_t *tx; @@ -1940,6 +1940,14 @@ top: /* charge as an update -- would be nice not to charge at all */ dmu_tx_hold_zap(tx, zfsvfs->z_unlinkedobj, FALSE, NULL); + /* + * Mark this transaction as typically resulting in a net free of + * space, unless object removal will be delayed indefinitely + * (due to active holds on the vnode due to the file being open). + */ + if (may_delete_now) + dmu_tx_mark_netfree(tx); + error = dmu_tx_assign(tx, waited ? TXG_WAITED : TXG_NOWAIT); if (error) { zfs_dirent_unlock(dl); @@ -1970,7 +1978,6 @@ top: } if (unlinked) { - /* * Hold z_lock so that we can make sure that the ACL obj * hasn't changed. Could have been deleted due to @@ -5039,13 +5046,13 @@ zfs_addmap(vnode_t *vp, offset_t off, st * last page is pushed. The problem occurs when the msync() call is omitted, * which by far the most common case: * - * open() - * mmap() - * - * munmap() - * close() - *