From owner-svn-src-head@freebsd.org Sun Nov 3 00:13:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6976D17BE3F; Sun, 3 Nov 2019 00:13:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475Gc41FMcz4Nbr; Sun, 3 Nov 2019 00:13:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DFC736BC; Sun, 3 Nov 2019 00:13:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA30DNt5010428; Sun, 3 Nov 2019 00:13:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA30DNo9010427; Sun, 3 Nov 2019 00:13:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201911030013.xA30DNo9010427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 3 Nov 2019 00:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354268 - head/sys/cam/ctl X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cam/ctl X-SVN-Commit-Revision: 354268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 00:13:24 -0000 Author: mav Date: Sun Nov 3 00:13:23 2019 New Revision: 354268 URL: https://svnweb.freebsd.org/changeset/base/354268 Log: Remove lock from CTL camsim frontend. CAM does not need a SIM lock for quite a while, and CTL never needed it. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_cam_sim.c Sat Nov 2 21:52:45 2019 (r354267) +++ head/sys/cam/ctl/ctl_frontend_cam_sim.c Sun Nov 3 00:13:23 2019 (r354268) @@ -46,12 +46,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include -#include #include #include +#include #include #include @@ -80,7 +77,6 @@ struct cfcs_softc { struct cam_sim *sim; struct cam_devq *devq; struct cam_path *path; - struct mtx lock; uint64_t wwnn; uint64_t wwpn; uint32_t cur_tag_num; @@ -135,7 +131,6 @@ cfcs_init(void) softc = &cfcs_softc; bzero(softc, sizeof(*softc)); - mtx_init(&softc->lock, "ctl2cam", NULL, MTX_DEF); port = &softc->port; port->frontend = &cfcs_frontend; @@ -155,7 +150,6 @@ cfcs_init(void) if (retval != 0) { printf("%s: ctl_port_register() failed with error %d!\n", __func__, retval); - mtx_destroy(&softc->lock); return (retval); } @@ -177,7 +171,6 @@ cfcs_init(void) softc->wwpn = port->wwpn; } - mtx_lock(&softc->lock); softc->devq = cam_simq_alloc(port->num_requested_ctl_io); if (softc->devq == NULL) { printf("%s: error allocating devq\n", __func__); @@ -186,7 +179,7 @@ cfcs_init(void) } softc->sim = cam_sim_alloc(cfcs_action, cfcs_poll, softc->port_name, - softc, /*unit*/ 0, &softc->lock, 1, + softc, /*unit*/ 0, NULL, 1, port->num_requested_ctl_io, softc->devq); if (softc->sim == NULL) { printf("%s: error allocating SIM\n", __func__); @@ -210,8 +203,6 @@ cfcs_init(void) goto bailout; } - mtx_unlock(&softc->lock); - return (retval); bailout: @@ -219,9 +210,6 @@ bailout: cam_sim_free(softc->sim, /*free_devq*/ TRUE); else if (softc->devq) cam_simq_free(softc->devq); - mtx_unlock(&softc->lock); - mtx_destroy(&softc->lock); - return (retval); } @@ -234,12 +222,9 @@ cfcs_shutdown(void) ctl_port_offline(port); - mtx_lock(&softc->lock); xpt_free_path(softc->path); xpt_bus_deregister(cam_sim_path(softc->sim)); cam_sim_free(softc->sim, /*free_devq*/ TRUE); - mtx_unlock(&softc->lock); - mtx_destroy(&softc->lock); if ((error = ctl_port_deregister(port)) != 0) printf("%s: cam_sim port deregistration failed\n", __func__); @@ -255,18 +240,15 @@ cfcs_poll(struct cam_sim *sim) static void cfcs_onoffline(void *arg, int online) { - struct cfcs_softc *softc; + struct cfcs_softc *softc = (struct cfcs_softc *)arg; union ccb *ccb; - softc = (struct cfcs_softc *)arg; - - mtx_lock(&softc->lock); softc->online = online; ccb = xpt_alloc_ccb_nowait(); if (ccb == NULL) { printf("%s: unable to allocate CCB for rescan\n", __func__); - goto bailout; + return; } if (xpt_create_path(&ccb->ccb_h.path, NULL, @@ -274,12 +256,9 @@ cfcs_onoffline(void *arg, int online) CAM_LUN_WILDCARD) != CAM_REQ_CMP) { printf("%s: can't allocate path for rescan\n", __func__); xpt_free_ccb(ccb); - goto bailout; + return; } xpt_rescan(ccb); - -bailout: - mtx_unlock(&softc->lock); } static void @@ -493,13 +472,13 @@ cfcs_done(union ctl_io *io) ccb->ccb_h.status |= CAM_REQ_CMP_ERR; break; } + ctl_free_io(io); if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP && (ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { xpt_freeze_devq(ccb->ccb_h.path, 1); ccb->ccb_h.status |= CAM_DEV_QFRZN; } xpt_done(ccb); - ctl_free_io(io); } void @@ -509,7 +488,6 @@ cfcs_action(struct cam_sim *sim, union ccb *ccb) int err; softc = (struct cfcs_softc *)cam_sim_softc(sim); - mtx_assert(&softc->lock, MA_OWNED); switch (ccb->ccb_h.func_code) { case XPT_SCSI_IO: { @@ -569,7 +547,7 @@ cfcs_action(struct cam_sim *sim, union ccb *ccb) * enough for now. Since we're using unsigned ints, * they'll just wrap around. */ - io->scsiio.tag_num = softc->cur_tag_num++; + io->scsiio.tag_num = atomic_fetchadd_32(&softc->cur_tag_num, 1); csio->tag_id = io->scsiio.tag_num; switch (csio->tag_action) { case CAM_TAG_ACTION_NONE: @@ -775,13 +753,13 @@ cfcs_action(struct cam_sim *sim, union ccb *ccb) cpi->target_sprt = 0; cpi->hba_misc = PIM_EXTLUNS; cpi->hba_eng_cnt = 0; - cpi->max_target = 1; + cpi->max_target = 0; cpi->max_lun = 1024; /* Do we really have a limit? */ cpi->maxio = 1024 * 1024; cpi->async_flags = 0; cpi->hpath_id = 0; - cpi->initiator_id = 0; + cpi->initiator_id = 1; strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strlcpy(cpi->hba_vid, "FreeBSD", HBA_IDLEN); From owner-svn-src-head@freebsd.org Sun Nov 3 01:26:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E02917E679; Sun, 3 Nov 2019 01:26:02 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475JCt3Yhjz4RQq; Sun, 3 Nov 2019 01:26:02 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59DCA447E; Sun, 3 Nov 2019 01:26:02 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA31Q2O2051376; Sun, 3 Nov 2019 01:26:02 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA31PkRR051360; Sun, 3 Nov 2019 01:25:46 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201911030125.xA31PkRR051360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 3 Nov 2019 01:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354269 - in head/contrib/sqlite3: . tea tea/generic X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in head/contrib/sqlite3: . tea tea/generic X-SVN-Commit-Revision: 354269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 01:26:02 -0000 Author: cy Date: Sun Nov 3 01:25:46 2019 New Revision: 354269 URL: https://svnweb.freebsd.org/changeset/base/354269 Log: MFV r354257: Update sqlite3-3.29.0 (3290000) --> sqlite3-3.30.1 (3300100) MFC after: 1 month Modified: head/contrib/sqlite3/Makefile.msc head/contrib/sqlite3/configure head/contrib/sqlite3/configure.ac head/contrib/sqlite3/shell.c head/contrib/sqlite3/sqlite3.c head/contrib/sqlite3/sqlite3.h head/contrib/sqlite3/sqlite3ext.h head/contrib/sqlite3/tea/configure head/contrib/sqlite3/tea/configure.ac head/contrib/sqlite3/tea/generic/tclsqlite3.c Directory Properties: head/contrib/sqlite3/ (props changed) Modified: head/contrib/sqlite3/Makefile.msc ============================================================================== --- head/contrib/sqlite3/Makefile.msc Sun Nov 3 00:13:23 2019 (r354268) +++ head/contrib/sqlite3/Makefile.msc Sun Nov 3 01:25:46 2019 (r354269) @@ -73,7 +73,7 @@ API_ARMOR = 0 !IFNDEF NO_WARN !IF $(USE_FULLWARN)!=0 NO_WARN = -wd4054 -wd4055 -wd4100 -wd4127 -wd4130 -wd4152 -wd4189 -wd4206 -NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4305 -wd4306 -wd4702 -wd4706 +NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4244 -wd4305 -wd4306 -wd4702 -wd4706 !ENDIF !ENDIF Modified: head/contrib/sqlite3/configure ============================================================================== --- head/contrib/sqlite3/configure Sun Nov 3 00:13:23 2019 (r354268) +++ head/contrib/sqlite3/configure Sun Nov 3 01:25:46 2019 (r354269) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.29.0. +# Generated by GNU Autoconf 2.69 for sqlite 3.30.1. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.29.0' -PACKAGE_STRING='sqlite 3.29.0' +PACKAGE_VERSION='3.30.1' +PACKAGE_STRING='sqlite 3.30.1' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.29.0 to adapt to many kinds of systems. +\`configure' configures sqlite 3.30.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1412,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.29.0:";; + short | recursive ) echo "Configuration of sqlite 3.30.1:";; esac cat <<\_ACEOF @@ -1537,7 +1537,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.29.0 +sqlite configure 3.30.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.29.0, which was +It was created by sqlite $as_me 3.30.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2818,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.29.0' + VERSION='3.30.1' cat >>confdefs.h <<_ACEOF @@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.29.0, which was +This file was extended by sqlite $as_me 3.30.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14495,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.29.0 +sqlite config.status 3.30.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: head/contrib/sqlite3/configure.ac ============================================================================== --- head/contrib/sqlite3/configure.ac Sun Nov 3 00:13:23 2019 (r354268) +++ head/contrib/sqlite3/configure.ac Sun Nov 3 01:25:46 2019 (r354269) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.29.0, http://www.sqlite.org) +AC_INIT(sqlite, 3.30.1, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) Modified: head/contrib/sqlite3/shell.c ============================================================================== --- head/contrib/sqlite3/shell.c Sun Nov 3 00:13:23 2019 (r354268) +++ head/contrib/sqlite3/shell.c Sun Nov 3 01:25:46 2019 (r354269) @@ -9801,12 +9801,12 @@ static void editFunc( } sz = sqlite3_value_bytes(argv[0]); if( bBin ){ - x = fwrite(sqlite3_value_blob(argv[0]), 1, sz, f); + x = fwrite(sqlite3_value_blob(argv[0]), 1, (size_t)sz, f); }else{ const char *z = (const char*)sqlite3_value_text(argv[0]); /* Remember whether or not the value originally contained \r\n */ if( z && strstr(z,"\r\n")!=0 ) hasCRNL = 1; - x = fwrite(sqlite3_value_text(argv[0]), 1, sz, f); + x = fwrite(sqlite3_value_text(argv[0]), 1, (size_t)sz, f); } fclose(f); f = 0; @@ -9834,12 +9834,12 @@ static void editFunc( fseek(f, 0, SEEK_END); sz = ftell(f); rewind(f); - p = sqlite3_malloc64( sz+(bBin==0) ); + p = sqlite3_malloc64( sz+1 ); if( p==0 ){ sqlite3_result_error_nomem(context); goto edit_func_end; } - x = fread(p, 1, sz, f); + x = fread(p, 1, (size_t)sz, f); fclose(f); f = 0; if( x!=sz ){ @@ -10311,7 +10311,8 @@ static void eqp_render_level(ShellState *p, int iEqpId for(pRow = eqp_next_row(p, iEqpId, 0); pRow; pRow = pNext){ pNext = eqp_next_row(p, iEqpId, pRow); z = pRow->zText; - utf8_printf(p->out, "%s%s%s\n", p->sGraph.zPrefix, pNext ? "|--" : "`--", z); + utf8_printf(p->out, "%s%s%s\n", p->sGraph.zPrefix, + pNext ? "|--" : "`--", z); if( n<(int)sizeof(p->sGraph.zPrefix)-7 ){ memcpy(&p->sGraph.zPrefix[n], pNext ? "| " : " ", 4); eqp_render_level(p, pRow->iEqpId); @@ -10502,7 +10503,7 @@ static int shell_callback( while( j>0 && IsSpace(z[j-1]) ){ j--; } z[j] = 0; if( strlen30(z)>=79 ){ - for(i=j=0; (c = z[i])!=0; i++){ /* Copy changes from z[i] back to z[j] */ + for(i=j=0; (c = z[i])!=0; i++){ /* Copy from z[i] back to z[j] */ if( c==cEnd ){ cEnd = 0; }else if( c=='"' || c=='\'' || c=='`' ){ @@ -11081,7 +11082,7 @@ static int display_stats( raw_printf(pArg->out, "Autoindex Inserts: %d\n", iCur); iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_VM_STEP, bReset); raw_printf(pArg->out, "Virtual Machine Steps: %d\n", iCur); - iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_REPREPARE, bReset); + iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_REPREPARE,bReset); raw_printf(pArg->out, "Reprepare operations: %d\n", iCur); iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_RUN, bReset); raw_printf(pArg->out, "Number of times run: %d\n", iCur); @@ -12004,20 +12005,20 @@ static const char *(azHelp[]) = { ".archive ... Manage SQL archives", " Each command must have exactly one of the following options:", " -c, --create Create a new archive", - " -u, --update Add files or update files with changed mtime", - " -i, --insert Like -u but always add even if mtime unchanged", + " -u, --update Add or update files with changed mtime", + " -i, --insert Like -u but always add even if unchanged", " -t, --list List contents of archive", " -x, --extract Extract files from archive", " Optional arguments:", " -v, --verbose Print each filename as it is processed", - " -f FILE, --file FILE Operate on archive FILE (default is current db)", - " -a FILE, --append FILE Operate on FILE opened using the apndvfs VFS", - " -C DIR, --directory DIR Change to directory DIR to read/extract files", + " -f FILE, --file FILE Use archive FILE (default is current db)", + " -a FILE, --append FILE Open FILE using the apndvfs VFS", + " -C DIR, --directory DIR Read/extract files from directory DIR", " -n, --dryrun Show the SQL that would have occurred", " Examples:", - " .ar -cf archive.sar foo bar # Create archive.sar from files foo and bar", - " .ar -tf archive.sar # List members of archive.sar", - " .ar -xvf archive.sar # Verbosely extract files from archive.sar", + " .ar -cf ARCHIVE foo bar # Create ARCHIVE from files foo and bar", + " .ar -tf ARCHIVE # List members of ARCHIVE", + " .ar -xvf ARCHIVE # Verbosely extract files from ARCHIVE", " See also:", " http://sqlite.org/cli.html#sqlar_archive_support", #endif @@ -12026,7 +12027,7 @@ static const char *(azHelp[]) = { #endif ".backup ?DB? FILE Backup DB (default \"main\") to FILE", " --append Use the appendvfs", - " --async Write to FILE without a journal and without fsync()", + " --async Write to FILE without journal and fsync()", ".bail on|off Stop after hitting an error. Default OFF", ".binary on|off Turn binary output on or off. Default OFF", ".cd DIRECTORY Change the working directory to DIRECTORY", @@ -12046,15 +12047,15 @@ static const char *(azHelp[]) = { " Other Modes:", #ifdef SQLITE_DEBUG " test Show raw EXPLAIN QUERY PLAN output", - " trace Like \"full\" but also enable \"PRAGMA vdbe_trace\"", + " trace Like \"full\" but enable \"PRAGMA vdbe_trace\"", #endif " trigger Like \"full\" but also show trigger bytecode", - ".excel Display the output of next command in a spreadsheet", + ".excel Display the output of next command in spreadsheet", ".exit ?CODE? Exit this program with return-code CODE", - ".expert EXPERIMENTAL. Suggest indexes for specified queries", + ".expert EXPERIMENTAL. Suggest indexes for queries", /* Because explain mode comes on automatically now, the ".explain" mode -** is removed from the help screen. It is still supported for legacy, however */ -/*".explain ?on|off|auto? Turn EXPLAIN output mode on or off or to automatic",*/ +** is removed from the help screen. It is still supported for legacy, however */ +/*".explain ?on|off|auto? Turn EXPLAIN output mode on or off",*/ ".filectrl CMD ... Run various sqlite3_file_control() operations", " Run \".filectrl\" with no arguments for details", ".fullschema ?--indent? Show schema and the content of sqlite_stat tables", @@ -12101,7 +12102,7 @@ static const char *(azHelp[]) = { " --append Use appendvfs to append database to the end of FILE", #ifdef SQLITE_ENABLE_DESERIALIZE " --deserialize Load into memory useing sqlite3_deserialize()", - " --hexdb Load the output of \"dbtotxt\" as an in-memory database", + " --hexdb Load the output of \"dbtotxt\" as an in-memory db", " --maxsize N Maximum size for --hexdb or --deserialized database", #endif " --new Initialize FILE to an empty database", @@ -12114,7 +12115,7 @@ static const char *(azHelp[]) = { " init Initialize the TEMP table that holds bindings", " list List the current parameter bindings", " set PARAMETER VALUE Given SQL parameter PARAMETER a value of VALUE", - " PARAMETER should start with '$', ':', '@', or '?'", + " PARAMETER should start with one of: $ : @ ?", " unset PARAMETER Remove PARAMETER from the binding table", ".print STRING... Print literal STRING", #ifndef SQLITE_OMIT_PROGRESS_CALLBACK @@ -12129,6 +12130,11 @@ static const char *(azHelp[]) = { ".read FILE Read input from FILE", #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB) ".recover Recover as much data as possible from corrupt db.", + " --freelist-corrupt Assume the freelist is corrupt", + " --recovery-db NAME Store recovery metadata in database file NAME", + " --lost-and-found TABLE Alternative name for the lost-and-found table", + " --no-rowids Do not attempt to recover rowid values", + " that are not also INTEGER PRIMARY KEYs", #endif ".restore ?DB? FILE Restore content of DB (default \"main\") from FILE", ".save FILE Write in-memory database into FILE", @@ -12160,7 +12166,7 @@ static const char *(azHelp[]) = { " Options:", " --schema Also hash the sqlite_master table", " --sha3-224 Use the sha3-224 algorithm", - " --sha3-256 Use the sha3-256 algorithm. This is the default.", + " --sha3-256 Use the sha3-256 algorithm (default)", " --sha3-384 Use the sha3-384 algorithm", " --sha3-512 Use the sha3-512 algorithm", " Any other argument is a LIKE pattern for tables to hash", @@ -12194,6 +12200,10 @@ static const char *(azHelp[]) = { " --row Trace each row (SQLITE_TRACE_ROW)", " --close Trace connection close (SQLITE_TRACE_CLOSE)", #endif /* SQLITE_OMIT_TRACE */ +#ifdef SQLITE_DEBUG + ".unmodule NAME ... Unregister virtual table modules", + " --allexcept Unregister everything except those named", +#endif ".vfsinfo ?AUX? Information about the top-level VFS", ".vfslist List all available VFSes", ".vfsname ?AUX? Print the name of the VFS stack", @@ -12436,6 +12446,8 @@ static unsigned char *readHexDb(ShellState *p, int *pn rc = sscanf(zLine, "| size %d pagesize %d", &n, &pgsz); if( rc!=2 ) goto readHexDb_error; if( n<0 ) goto readHexDb_error; + if( pgsz<512 || pgsz>65536 || (pgsz&(pgsz-1))!=0 ) goto readHexDb_error; + n = (n+pgsz-1)&~(pgsz-1); /* Round n up to the next multiple of pgsz */ a = sqlite3_malloc( n ? n : 1 ); if( a==0 ){ utf8_printf(stderr, "Out of memory!\n"); @@ -12521,6 +12533,23 @@ static void shellInt32( } /* +** Scalar function "shell_idquote(X)" returns string X quoted as an identifier, +** using "..." with internal double-quote characters doubled. +*/ +static void shellIdQuote( + sqlite3_context *context, + int argc, + sqlite3_value **argv +){ + const char *zName = (const char*)sqlite3_value_text(argv[0]); + UNUSED_PARAMETER(argc); + if( zName ){ + char *z = sqlite3_mprintf("\"%w\"", zName); + sqlite3_result_text(context, z, -1, sqlite3_free); + } +} + +/* ** Scalar function "shell_escape_crnl" used by the .recover command. ** The argument passed to this function is the output of built-in ** function quote(). If the first character of the input is "'", @@ -12696,6 +12725,8 @@ static void open_db(ShellState *p, int openFlags){ shellEscapeCrnl, 0, 0); sqlite3_create_function(p->db, "shell_int32", 2, SQLITE_UTF8, 0, shellInt32, 0, 0); + sqlite3_create_function(p->db, "shell_idquote", 1, SQLITE_UTF8, 0, + shellIdQuote, 0, 0); #ifndef SQLITE_NOHAVE_SYSTEM sqlite3_create_function(p->db, "edit", 1, SQLITE_UTF8, 0, editFunc, 0, 0); @@ -14043,7 +14074,7 @@ void shellReset( #endif /* !defined SQLITE_OMIT_VIRTUALTABLE */ #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_HAVE_ZLIB) -/********************************************************************************* +/****************************************************************************** ** The ".archive" or ".ar" command. */ /* @@ -14241,7 +14272,8 @@ static int arParseCommand( i = n; }else{ if( iArg>=(nArg-1) ){ - return arErrorMsg(pAr, "option requires an argument: %c",z[i]); + return arErrorMsg(pAr, "option requires an argument: %c", + z[i]); } zArg = azArg[++iArg]; } @@ -14629,10 +14661,10 @@ end_ar_transaction: ** Implementation of ".ar" dot command. */ static int arDotCommand( - ShellState *pState, /* Current shell tool state */ - int fromCmdLine, /* True if -A command-line option, not .ar cmd */ - char **azArg, /* Array of arguments passed to dot command */ - int nArg /* Number of entries in azArg[] */ + ShellState *pState, /* Current shell tool state */ + int fromCmdLine, /* True if -A command-line option, not .ar cmd */ + char **azArg, /* Array of arguments passed to dot command */ + int nArg /* Number of entries in azArg[] */ ){ ArCommand cmd; int rc; @@ -14732,7 +14764,7 @@ end_ar_command: return rc; } /* End of the ".archive" or ".ar" command logic -**********************************************************************************/ +*******************************************************************************/ #endif /* !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_HAVE_ZLIB) */ #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB) @@ -14874,6 +14906,10 @@ static RecoverTable *recoverNewTable( rc = sqlite3_open("", &dbtmp); if( rc==SQLITE_OK ){ + sqlite3_create_function(dbtmp, "shell_idquote", 1, SQLITE_UTF8, 0, + shellIdQuote, 0, 0); + } + if( rc==SQLITE_OK ){ rc = sqlite3_exec(dbtmp, "PRAGMA writable_schema = on", 0, 0, 0); } if( rc==SQLITE_OK ){ @@ -14929,18 +14965,18 @@ static RecoverTable *recoverNewTable( } } - pTab->zQuoted = shellMPrintf(&rc, "%Q", zName); + pTab->zQuoted = shellMPrintf(&rc, "\"%w\"", zName); pTab->azlCol = (char**)shellMalloc(&rc, sizeof(char*) * (nSqlCol+1)); pTab->nCol = nSqlCol; if( bIntkey ){ - pTab->azlCol[0] = shellMPrintf(&rc, "%Q", zPk); + pTab->azlCol[0] = shellMPrintf(&rc, "\"%w\"", zPk); }else{ pTab->azlCol[0] = shellMPrintf(&rc, ""); } i = 1; shellPreparePrintf(dbtmp, &rc, &pStmt, - "SELECT %Q || group_concat(name, ', ') " + "SELECT %Q || group_concat(shell_idquote(name), ', ') " " FILTER (WHERE cid!=%d) OVER (ORDER BY %s cid) " "FROM pragma_table_info(%Q)", bIntkey ? ", " : "", pTab->iPk, @@ -15054,7 +15090,7 @@ static RecoverTable *recoverOrphanTable( pTab = (RecoverTable*)shellMalloc(pRc, sizeof(RecoverTable)); if( pTab ){ - pTab->zQuoted = shellMPrintf(pRc, "%Q", zTab); + pTab->zQuoted = shellMPrintf(pRc, "\"%w\"", zTab); pTab->nCol = nCol; pTab->iPk = -2; if( nCol>0 ){ @@ -15103,6 +15139,7 @@ static int recoverDatabaseCmd(ShellState *pState, int RecoverTable *pOrphan = 0; int bFreelist = 1; /* 0 if --freelist-corrupt is specified */ + int bRowids = 1; /* 0 if --no-rowids */ for(i=1; iout, azArg[0]); return 1; } } @@ -15132,6 +15169,7 @@ static int recoverDatabaseCmd(ShellState *pState, int shellExecPrintf(pState->db, &rc, /* Attach an in-memory database named 'recovery'. Create an indexed ** cache of the sqlite_dbptr virtual table. */ + "PRAGMA writable_schema = on;" "ATTACH %Q AS recovery;" "DROP TABLE IF EXISTS recovery.dbptr;" "DROP TABLE IF EXISTS recovery.freelist;" @@ -15162,7 +15200,22 @@ static int recoverDatabaseCmd(ShellState *pState, int ); } + /* If this is an auto-vacuum database, add all pointer-map pages to + ** the freelist table. Do this regardless of whether or not + ** --freelist-corrupt was specified. */ shellExec(pState->db, &rc, + "WITH ptrmap(pgno) AS (" + " SELECT 2 WHERE shell_int32(" + " (SELECT data FROM sqlite_dbpage WHERE pgno=1), 13" + " )" + " UNION ALL " + " SELECT pgno+1+(SELECT page_size FROM pragma_page_size)/5 AS pp " + " FROM ptrmap WHERE pp<=(SELECT page_count FROM pragma_page_count)" + ")" + "REPLACE INTO recovery.freelist SELECT pgno FROM ptrmap" + ); + + shellExec(pState->db, &rc, "CREATE TABLE recovery.dbptr(" " pgno, child, PRIMARY KEY(child, pgno)" ") WITHOUT ROWID;" @@ -15210,7 +15263,7 @@ static int recoverDatabaseCmd(ShellState *pState, int " )" " SELECT pgno FROM p WHERE (parent IS NULL OR pgno = orig)" ") " - "FROM pages WHERE maxlen > 0 AND i NOT IN freelist;" + "FROM pages WHERE maxlen IS NOT NULL AND i NOT IN freelist;" "UPDATE recovery.map AS o SET intkey = (" " SELECT substr(data, 1, 1)==X'0D' FROM sqlite_dbpage WHERE pgno=o.pgno" ");" @@ -15235,6 +15288,11 @@ static int recoverDatabaseCmd(ShellState *pState, int ** CREATE TABLE statements that extracted from the existing schema. */ if( rc==SQLITE_OK ){ sqlite3_stmt *pStmt = 0; + /* ".recover" might output content in an order which causes immediate + ** foreign key constraints to be violated. So disable foreign-key + ** constraint enforcement to prevent problems when running the output + ** script. */ + raw_printf(pState->out, "PRAGMA foreign_keys=OFF;\n"); raw_printf(pState->out, "BEGIN;\n"); raw_printf(pState->out, "PRAGMA writable_schema = on;\n"); shellPrepare(pState->db, &rc, @@ -15265,8 +15323,12 @@ static int recoverDatabaseCmd(ShellState *pState, int shellPrepare(pState->db, &rc, "SELECT pgno FROM recovery.map WHERE root=?", &pPages ); + shellPrepare(pState->db, &rc, - "SELECT max(field), group_concat(shell_escape_crnl(quote(value)), ', ')" + "SELECT max(field), group_concat(shell_escape_crnl(quote" + "(case when (? AND field<0) then NULL else value end)" + "), ', ')" + ", min(field) " "FROM sqlite_dbdata WHERE pgno = ? AND field != ?" "GROUP BY cell", &pCells ); @@ -15285,6 +15347,7 @@ static int recoverDatabaseCmd(ShellState *pState, int int bNoop = 0; RecoverTable *pTab; + assert( bIntkey==0 || bIntkey==1 ); pTab = recoverFindTable(pState, &rc, iRoot, bIntkey, nCol, &bNoop); if( bNoop || rc ) continue; if( pTab==0 ){ @@ -15295,29 +15358,44 @@ static int recoverDatabaseCmd(ShellState *pState, int if( pTab==0 ) break; } - if( 0==sqlite3_stricmp(pTab->zQuoted, "'sqlite_sequence'") ){ + if( 0==sqlite3_stricmp(pTab->zQuoted, "\"sqlite_sequence\"") ){ raw_printf(pState->out, "DELETE FROM sqlite_sequence;\n"); } sqlite3_bind_int(pPages, 1, iRoot); - sqlite3_bind_int(pCells, 2, pTab->iPk); + if( bRowids==0 && pTab->iPk<0 ){ + sqlite3_bind_int(pCells, 1, 1); + }else{ + sqlite3_bind_int(pCells, 1, 0); + } + sqlite3_bind_int(pCells, 3, pTab->iPk); while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pPages) ){ int iPgno = sqlite3_column_int(pPages, 0); - sqlite3_bind_int(pCells, 1, iPgno); + sqlite3_bind_int(pCells, 2, iPgno); while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pCells) ){ int nField = sqlite3_column_int(pCells, 0); + int iMin = sqlite3_column_int(pCells, 2); const char *zVal = (const char*)sqlite3_column_text(pCells, 1); + RecoverTable *pTab2 = pTab; + if( pTab!=pOrphan && (iMin<0)!=bIntkey ){ + if( pOrphan==0 ){ + pOrphan = recoverOrphanTable(pState, &rc, zLostAndFound, nOrphan); + } + pTab2 = pOrphan; + if( pTab2==0 ) break; + } + nField = nField+1; - if( pTab==pOrphan ){ + if( pTab2==pOrphan ){ raw_printf(pState->out, "INSERT INTO %s VALUES(%d, %d, %d, %s%s%s);\n", - pTab->zQuoted, iRoot, iPgno, nField, - bIntkey ? "" : "NULL, ", zVal, pTab->azlCol[nField] + pTab2->zQuoted, iRoot, iPgno, nField, + iMin<0 ? "" : "NULL, ", zVal, pTab2->azlCol[nField] ); }else{ raw_printf(pState->out, "INSERT INTO %s(%s) VALUES( %s );\n", - pTab->zQuoted, pTab->azlCol[nField], zVal + pTab2->zQuoted, pTab2->azlCol[nField], zVal ); } } @@ -15376,7 +15454,7 @@ static int do_meta_command(char *zLine, ShellState *p) int nArg = 0; int n, c; int rc = 0; - char *azArg[50]; + char *azArg[52]; #ifndef SQLITE_OMIT_VIRTUALTABLE if( p->expert.pExpert ){ @@ -15386,7 +15464,7 @@ static int do_meta_command(char *zLine, ShellState *p) /* Parse the input line into tokens. */ - while( zLine[h] && nArgout, "ANALYZE sqlite_master;\n"); @@ -16615,12 +16693,8 @@ static int do_meta_command(char *zLine, ShellState *p) ** Clear all bind parameters by dropping the TEMP table that holds them. */ if( nArg==2 && strcmp(azArg[1],"clear")==0 ){ - int wrSchema = 0; - sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, -1, &wrSchema); - sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, 1, 0); sqlite3_exec(p->db, "DROP TABLE IF EXISTS temp.sqlite_parameters;", 0, 0, 0); - sqlite3_db_config(p->db, SQLITE_DBCONFIG_WRITABLE_SCHEMA, wrSchema, 0); }else /* .parameter list @@ -16933,7 +17007,7 @@ static int do_meta_command(char *zLine, ShellState *p) zDiv = " UNION ALL "; appendText(&sSelect, "SELECT shell_add_schema(sql,", 0); if( sqlite3_stricmp(zDb, "main")!=0 ){ - appendText(&sSelect, zDb, '"'); + appendText(&sSelect, zDb, '\''); }else{ appendText(&sSelect, "NULL", 0); } @@ -16942,15 +17016,16 @@ static int do_meta_command(char *zLine, ShellState *p) appendText(&sSelect, " AS snum, ", 0); appendText(&sSelect, zDb, '\''); appendText(&sSelect, " AS sname FROM ", 0); - appendText(&sSelect, zDb, '"'); + appendText(&sSelect, zDb, quoteChar(zDb)); appendText(&sSelect, ".sqlite_master", 0); } sqlite3_finalize(pStmt); -#ifdef SQLITE_INTROSPECTION_PRAGMAS +#ifndef SQLITE_OMIT_INTROSPECTION_PRAGMAS if( zName ){ appendText(&sSelect, " UNION ALL SELECT shell_module_schema(name)," - " 'table', name, name, name, 9e+99, 'main' FROM pragma_module_list", 0); + " 'table', name, name, name, 9e+99, 'main' FROM pragma_module_list", + 0); } #endif appendText(&sSelect, ") WHERE ", 0); @@ -17049,7 +17124,8 @@ static int do_meta_command(char *zLine, ShellState *p) if( pSession->p==0 ) goto session_not_open; out = fopen(azCmd[1], "wb"); if( out==0 ){ - utf8_printf(stderr, "ERROR: cannot open \"%s\" for writing\n", azCmd[1]); + utf8_printf(stderr, "ERROR: cannot open \"%s\" for writing\n", + azCmd[1]); }else{ int szChng; void *pChng; @@ -17370,8 +17446,7 @@ static int do_meta_command(char *zLine, ShellState *p) { utf8_printf(stderr, "Unknown option \"%s\" on \"%s\"\n", azArg[i], azArg[0]); - raw_printf(stderr, "Should be one of: --schema" - " --sha3-224 --sha3-256 --sha3-384 --sha3-512\n"); + showHelp(p->out, azArg[0]); rc = 1; goto meta_command_exit; } @@ -17417,8 +17492,7 @@ static int do_meta_command(char *zLine, ShellState *p) }else if( strcmp(zTab, "sqlite_stat1")==0 ){ appendText(&sQuery,"SELECT tbl,idx,stat FROM sqlite_stat1" " ORDER BY tbl,idx;", 0); - }else if( strcmp(zTab, "sqlite_stat3")==0 - || strcmp(zTab, "sqlite_stat4")==0 ){ + }else if( strcmp(zTab, "sqlite_stat4")==0 ){ appendText(&sQuery, "SELECT * FROM ", 0); appendText(&sQuery, zTab, 0); appendText(&sQuery, " ORDER BY tbl, idx, rowid;\n", 0); @@ -17650,25 +17724,26 @@ static int do_meta_command(char *zLine, ShellState *p) int ctrlCode; /* Integer code for that option */ const char *zUsage; /* Usage notes */ } aCtrl[] = { - { "always", SQLITE_TESTCTRL_ALWAYS, "BOOLEAN" }, - { "assert", SQLITE_TESTCTRL_ASSERT, "BOOLEAN" }, - /*{ "benign_malloc_hooks",SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS, "" },*/ - /*{ "bitvec_test", SQLITE_TESTCTRL_BITVEC_TEST, "" },*/ - { "byteorder", SQLITE_TESTCTRL_BYTEORDER, "" }, - /*{ "fault_install", SQLITE_TESTCTRL_FAULT_INSTALL, "" }, */ - { "imposter", SQLITE_TESTCTRL_IMPOSTER, "SCHEMA ON/OFF ROOTPAGE"}, - { "internal_functions", SQLITE_TESTCTRL_INTERNAL_FUNCTIONS, "BOOLEAN" }, - { "localtime_fault", SQLITE_TESTCTRL_LOCALTIME_FAULT,"BOOLEAN" }, - { "never_corrupt", SQLITE_TESTCTRL_NEVER_CORRUPT, "BOOLEAN" }, - { "optimizations", SQLITE_TESTCTRL_OPTIMIZATIONS, "DISABLE-MASK" }, + { "always", SQLITE_TESTCTRL_ALWAYS, "BOOLEAN" }, + { "assert", SQLITE_TESTCTRL_ASSERT, "BOOLEAN" }, + /*{ "benign_malloc_hooks",SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS, "" },*/ + /*{ "bitvec_test", SQLITE_TESTCTRL_BITVEC_TEST, "" },*/ + { "byteorder", SQLITE_TESTCTRL_BYTEORDER, "" }, + { "extra_schema_checks",SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS,"BOOLEAN" }, + /*{ "fault_install", SQLITE_TESTCTRL_FAULT_INSTALL, "" },*/ + { "imposter", SQLITE_TESTCTRL_IMPOSTER, "SCHEMA ON/OFF ROOTPAGE"}, + { "internal_functions", SQLITE_TESTCTRL_INTERNAL_FUNCTIONS, "BOOLEAN" }, + { "localtime_fault", SQLITE_TESTCTRL_LOCALTIME_FAULT,"BOOLEAN" }, + { "never_corrupt", SQLITE_TESTCTRL_NEVER_CORRUPT, "BOOLEAN" }, + { "optimizations", SQLITE_TESTCTRL_OPTIMIZATIONS, "DISABLE-MASK" }, #ifdef YYCOVERAGE - { "parser_coverage", SQLITE_TESTCTRL_PARSER_COVERAGE, "" }, + { "parser_coverage", SQLITE_TESTCTRL_PARSER_COVERAGE, "" }, #endif - { "pending_byte", SQLITE_TESTCTRL_PENDING_BYTE, "OFFSET " }, - { "prng_reset", SQLITE_TESTCTRL_PRNG_RESET, "" }, - { "prng_restore", SQLITE_TESTCTRL_PRNG_RESTORE, "" }, - { "prng_save", SQLITE_TESTCTRL_PRNG_SAVE, "" }, - { "reserve", SQLITE_TESTCTRL_RESERVE, "BYTES-OF-RESERVE" }, + { "pending_byte", SQLITE_TESTCTRL_PENDING_BYTE, "OFFSET " }, + { "prng_restore", SQLITE_TESTCTRL_PRNG_RESTORE, "" }, + { "prng_save", SQLITE_TESTCTRL_PRNG_SAVE, "" }, + { "prng_seed", SQLITE_TESTCTRL_PRNG_SEED, "SEED ?db?" }, + { "reserve", SQLITE_TESTCTRL_RESERVE, "BYTES-OF-RESERVE"}, }; int testctrl = -1; int iCtrl = -1; @@ -17749,6 +17824,27 @@ static int do_meta_command(char *zLine, ShellState *p) } break; + /* sqlite3_test_control(int, int, sqlite3*) */ + case SQLITE_TESTCTRL_PRNG_SEED: + if( nArg==3 || nArg==4 ){ + int ii = (int)integerValue(azArg[2]); + sqlite3 *db; + if( ii==0 && strcmp(azArg[2],"random")==0 ){ + sqlite3_randomness(sizeof(ii),&ii); + printf("-- random seed: %d\n", ii); + } + if( nArg==3 ){ + db = 0; + }else{ + db = p->db; + /* Make sure the schema has been loaded */ + sqlite3_table_column_metadata(db, 0, "x", 0, 0, 0, 0, 0, 0); + } + rc2 = sqlite3_test_control(testctrl, ii, db); + isOk = 3; + } + break; + /* sqlite3_test_control(int, int) */ case SQLITE_TESTCTRL_ASSERT: case SQLITE_TESTCTRL_ALWAYS: @@ -17790,7 +17886,7 @@ static int do_meta_command(char *zLine, ShellState *p) } } if( isOk==0 && iCtrl>=0 ){ - utf8_printf(p->out, "Usage: .testctrl %s %s\n", zCmd, aCtrl[iCtrl].zUsage); + utf8_printf(p->out, "Usage: .testctrl %s %s\n", zCmd,aCtrl[iCtrl].zUsage); rc = 1; }else if( isOk==1 ){ raw_printf(p->out, "%d\n", rc2); @@ -17868,6 +17964,31 @@ static int do_meta_command(char *zLine, ShellState *p) }else #endif /* !defined(SQLITE_OMIT_TRACE) */ +#if defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_VIRTUALTABLE) + if( c=='u' && strncmp(azArg[0], "unmodule", n)==0 ){ + int ii; + int lenOpt; + char *zOpt; + if( nArg<2 ){ + raw_printf(stderr, "Usage: .unmodule [--allexcept] NAME ...\n"); + rc = 1; + goto meta_command_exit; + } + open_db(p, 0); + zOpt = azArg[1]; + if( zOpt[0]=='-' && zOpt[1]=='-' && zOpt[2]!=0 ) zOpt++; + lenOpt = (int)strlen(zOpt); + if( lenOpt>=3 && strncmp(zOpt, "-allexcept",lenOpt)==0 ){ + assert( azArg[nArg]==0 ); + sqlite3_drop_modules(p->db, nArg>2 ? (const char**)(azArg+2) : 0); + }else{ + for(ii=1; iidb, azArg[ii], 0, 0); + } + } + }else +#endif + #if SQLITE_USER_AUTHENTICATION if( c=='u' && strncmp(azArg[0], "user", n)==0 ){ if( nArg<2 ){ @@ -17882,7 +18003,8 @@ static int do_meta_command(char *zLine, ShellState *p) rc = 1; goto meta_command_exit; } - rc = sqlite3_user_authenticate(p->db, azArg[2], azArg[3], strlen30(azArg[3])); + rc = sqlite3_user_authenticate(p->db, azArg[2], azArg[3], + strlen30(azArg[3])); if( rc ){ utf8_printf(stderr, "Authentication failed for user %s\n", azArg[2]); rc = 1; Modified: head/contrib/sqlite3/sqlite3.c ============================================================================== --- head/contrib/sqlite3/sqlite3.c Sun Nov 3 00:13:23 2019 (r354268) +++ head/contrib/sqlite3/sqlite3.c Sun Nov 3 01:25:46 2019 (r354269) @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.29.0. By combining all the individual C code files into this +** version 3.30.1. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -331,8 +331,6 @@ static const char * const sqlite3azCompileOpt[] = { #endif #if defined(SQLITE_ENABLE_STAT4) "ENABLE_STAT4", -#elif defined(SQLITE_ENABLE_STAT3) - "ENABLE_STAT3", #endif #if SQLITE_ENABLE_STMTVTAB "ENABLE_STMTVTAB", @@ -1167,9 +1165,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.29.0" -#define SQLITE_VERSION_NUMBER 3029000 -#define SQLITE_SOURCE_ID "2019-07-10 17:32:03 fc82b73eaac8b36950e527f12c4b5dc1e147e6f4ad2217ae43ad82882a88bfa6" +#define SQLITE_VERSION "3.30.1" +#define SQLITE_VERSION_NUMBER 3030001 +#define SQLITE_SOURCE_ID "2019-10-10 20:19:45 18db032d058f1436ce3dea84081f4ee5a0f2259ad97301d43c426bc7f3df1b0b" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -3137,6 +3135,17 @@ struct sqlite3_mem_methods { ** following this call. The second parameter may be a NULL pointer, in ** which case the trigger setting is not reported back. ** +** [[SQLITE_DBCONFIG_ENABLE_VIEW]] +**
SQLITE_DBCONFIG_ENABLE_VIEW
+**
^This option is used to enable or disable [CREATE VIEW | views]. +** There should be two additional arguments. +** The first argument is an integer which is 0 to disable views, +** positive to enable views or negative to leave the setting unchanged. +** The second parameter is a pointer to an integer into which +** is written 0 or 1 to indicate whether views are disabled or enabled +** following this call. The second parameter may be a NULL pointer, in +** which case the view setting is not reported back.
+** ** [[SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER]] **
SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
**
^This option is used to enable or disable the @@ -3309,7 +3318,8 @@ struct sqlite3_mem_methods { #define SQLITE_DBCONFIG_LEGACY_ALTER_TABLE 1012 /* int int* */ #define SQLITE_DBCONFIG_DQS_DML 1013 /* int int* */ #define SQLITE_DBCONFIG_DQS_DDL 1014 /* int int* */ -#define SQLITE_DBCONFIG_MAX 1014 /* Largest DBCONFIG */ +#define SQLITE_DBCONFIG_ENABLE_VIEW 1015 /* int int* */ +#define SQLITE_DBCONFIG_MAX 1015 /* Largest DBCONFIG */ /* ** CAPI3REF: Enable Or Disable Extended Result Codes @@ -4858,7 +4868,7 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int new ** ^The specific value of WHERE-clause [parameter] might influence the ** choice of query plan if the parameter is the left-hand side of a [LIKE] ** or [GLOB] operator or if the parameter is compared to an indexed column -** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled. +** and the [SQLITE_ENABLE_STAT4] compile-time option is enabled. ** ** ** @@ -5893,6 +5903,12 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); ** perform additional optimizations on deterministic functions, so use ** of the [SQLITE_DETERMINISTIC] flag is recommended where possible. ** +** ^The fourth parameter may also optionally include the [SQLITE_DIRECTONLY] +** flag, which if present prevents the function from being invoked from +** within VIEWs or TRIGGERs. For security reasons, the [SQLITE_DIRECTONLY] +** flag is recommended for any application-defined SQL function that has +** side-effects. +** ** ^(The fifth parameter is an arbitrary pointer. The implementation of the ** function can gain access to this pointer using [sqlite3_user_data()].)^ ** @@ -6009,8 +6025,30 @@ SQLITE_API int sqlite3_create_window_function( ** [SQLITE_UTF8 | preferred text encoding] as the fourth argument ** to [sqlite3_create_function()], [sqlite3_create_function16()], or ** [sqlite3_create_function_v2()]. +** +** The SQLITE_DETERMINISTIC flag means that the new function will always +** maps the same inputs into the same output. The abs() function is +** deterministic, for example, but randomblob() is not. +** +** The SQLITE_DIRECTONLY flag means that the function may only be invoked +** from top-level SQL, and cannot be used in VIEWs or TRIGGERs. This is +** a security feature which is recommended for all +** [application-defined SQL functions] that have side-effects. This flag +** prevents an attacker from adding triggers and views to a schema then +** tricking a high-privilege application into causing unintended side-effects +** while performing ordinary queries. +** +** The SQLITE_SUBTYPE flag indicates to SQLite that a function may call +** [sqlite3_value_subtype()] to inspect the sub-types of its arguments. +** Specifying this flag makes no difference for scalar or aggregate user +** functions. However, if it is not specified for a user-defined window +** function, then any sub-types belonging to arguments passed to the window +** function may be discarded before the window function is called (i.e. +** sqlite3_value_subtype() will always return 0). */ -#define SQLITE_DETERMINISTIC 0x800 +#define SQLITE_DETERMINISTIC 0x000000800 +#define SQLITE_DIRECTONLY 0x000080000 +#define SQLITE_SUBTYPE 0x000100000 /* ** CAPI3REF: Deprecated Functions @@ -7656,6 +7694,12 @@ struct sqlite3_index_info { ** ^The sqlite3_create_module() ** interface is equivalent to sqlite3_create_module_v2() with a NULL ** destructor. +** +** ^If the third parameter (the pointer to the sqlite3_module object) is +** NULL then no new module is create and any existing modules with the +** same name are dropped. +** +** See also: [sqlite3_drop_modules()] */ SQLITE_API int sqlite3_create_module( sqlite3 *db, /* SQLite connection to register module with */ @@ -7672,6 +7716,23 @@ SQLITE_API int sqlite3_create_module_v2( ); /* +** CAPI3REF: Remove Unnecessary Virtual Table Implementations +** METHOD: sqlite3 +** +** ^The sqlite3_drop_modules(D,L) interface removes all virtual +** table modules from database connection D except those named on list L. +** The L parameter must be either NULL or a pointer to an array of pointers +** to strings where the array is terminated by a single NULL pointer. +** ^If the L parameter is NULL, then all virtual table modules are removed. +** +** See also: [sqlite3_create_module()] +*/ +SQLITE_API int sqlite3_drop_modules( + sqlite3 *db, /* Remove modules from this connection */ + const char **azKeep /* Except, do not remove the ones named here */ +); + +/* ** CAPI3REF: Virtual Table Instance Object ** KEYWORDS: sqlite3_vtab ** @@ -8379,7 +8440,7 @@ SQLITE_API int sqlite3_test_control(int op, ...); #define SQLITE_TESTCTRL_FIRST 5 #define SQLITE_TESTCTRL_PRNG_SAVE 5 #define SQLITE_TESTCTRL_PRNG_RESTORE 6 -#define SQLITE_TESTCTRL_PRNG_RESET 7 +#define SQLITE_TESTCTRL_PRNG_RESET 7 /* NOT USED */ #define SQLITE_TESTCTRL_BITVEC_TEST 8 #define SQLITE_TESTCTRL_FAULT_INSTALL 9 #define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS 10 @@ -8402,7 +8463,9 @@ SQLITE_API int sqlite3_test_control(int op, ...); #define SQLITE_TESTCTRL_IMPOSTER 25 #define SQLITE_TESTCTRL_PARSER_COVERAGE 26 #define SQLITE_TESTCTRL_RESULT_INTREAL 27 -#define SQLITE_TESTCTRL_LAST 27 /* Largest TESTCTRL */ +#define SQLITE_TESTCTRL_PRNG_SEED 28 +#define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29 +#define SQLITE_TESTCTRL_LAST 29 /* Largest TESTCTRL */ /* ** CAPI3REF: SQL Keyword Checking @@ -13099,15 +13162,15 @@ struct fts5_api { ** So we have to define the macros in different ways depending on the ** compiler. */ -#if defined(__PTRDIFF_TYPE__) /* This case should work for GCC */ +#if defined(HAVE_STDINT_H) /* Use this case if we have ANSI headers */ +# define SQLITE_INT_TO_PTR(X) ((void*)(intptr_t)(X)) +# define SQLITE_PTR_TO_INT(X) ((int)(intptr_t)(X)) +#elif defined(__PTRDIFF_TYPE__) /* This case should work for GCC */ # define SQLITE_INT_TO_PTR(X) ((void*)(__PTRDIFF_TYPE__)(X)) # define SQLITE_PTR_TO_INT(X) ((int)(__PTRDIFF_TYPE__)(X)) #elif !defined(__GNUC__) /* Works for compilers other than LLVM */ # define SQLITE_INT_TO_PTR(X) ((void*)&((char*)0)[X]) # define SQLITE_PTR_TO_INT(X) ((int)(((char*)X)-(char*)0)) -#elif defined(HAVE_STDINT_H) /* Use this case if we have ANSI headers */ -# define SQLITE_INT_TO_PTR(X) ((void*)(intptr_t)(X)) -# define SQLITE_PTR_TO_INT(X) ((int)(intptr_t)(X)) #else /* Generates a warning - but it always works */ # define SQLITE_INT_TO_PTR(X) ((void*)(X)) # define SQLITE_PTR_TO_INT(X) ((int)(X)) @@ -13597,100 +13660,103 @@ SQLITE_PRIVATE void sqlite3HashClear(Hash*); #define TK_VIEW 79 #define TK_VIRTUAL 80 #define TK_WITH 81 -#define TK_CURRENT 82 -#define TK_FOLLOWING 83 -#define TK_PARTITION 84 -#define TK_PRECEDING 85 -#define TK_RANGE 86 -#define TK_UNBOUNDED 87 -#define TK_EXCLUDE 88 -#define TK_GROUPS 89 -#define TK_OTHERS 90 -#define TK_TIES 91 -#define TK_REINDEX 92 -#define TK_RENAME 93 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Nov 3 01:52:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6EF0917FB7D; Sun, 3 Nov 2019 01:52:51 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475Jpq2KCNz4TWs; Sun, 3 Nov 2019 01:52:51 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32A7849F6; Sun, 3 Nov 2019 01:52:51 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA31qouU069806; Sun, 3 Nov 2019 01:52:50 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA31qobW069805; Sun, 3 Nov 2019 01:52:50 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <201911030152.xA31qobW069805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Sun, 3 Nov 2019 01:52:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354270 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 354270 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 01:52:51 -0000 Author: bdragon Date: Sun Nov 3 01:52:50 2019 New Revision: 354270 URL: https://svnweb.freebsd.org/changeset/base/354270 Log: powerpc: Fix incorrect disassembly of the cntlzw instruction in ddb. Noticed while comparing disassembly between ddb and objdump. Approved by: jhibbits (mentor) Differential Revision: https://reviews.freebsd.org/D22121 Modified: head/sys/powerpc/powerpc/db_disasm.c Modified: head/sys/powerpc/powerpc/db_disasm.c ============================================================================== --- head/sys/powerpc/powerpc/db_disasm.c Sun Nov 3 01:25:46 2019 (r354269) +++ head/sys/powerpc/powerpc/db_disasm.c Sun Nov 3 01:52:50 2019 (r354270) @@ -224,7 +224,7 @@ const struct opcode opcodes_1f[] = { { "ldx", 0xfc0007fe, 0x7c00002a, Op_D | Op_A | Op_B }, { "lwzx", 0xfc0007fe, 0x7c00002e, Op_D | Op_A | Op_B }, { "slw", 0xfc0007fe, 0x7c000030, Op_D | Op_A | Op_B | Op_Rc }, - { "cntlzw", 0xfc0007fe, 0x7c000034, Op_D | Op_A | Op_Rc }, + { "cntlzw", 0xfc0007fe, 0x7c000034, Op_S | Op_A | Op_Rc }, { "sld", 0xfc0007fe, 0x7c000036, Op_D | Op_A | Op_B | Op_Rc }, { "and", 0xfc0007fe, 0x7c000038, Op_D | Op_A | Op_B | Op_Rc }, { "cmplw", 0xfc2007fe, 0x7c000040, Op_crfD | Op_A | Op_B }, From owner-svn-src-head@freebsd.org Sun Nov 3 02:18:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D011A1A18AB; Sun, 3 Nov 2019 02:18:45 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475KNj592fz4Vjs; Sun, 3 Nov 2019 02:18:45 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94B154D9E; Sun, 3 Nov 2019 02:18:45 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA32Ijrp081665; Sun, 3 Nov 2019 02:18:45 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA32IjPa081664; Sun, 3 Nov 2019 02:18:45 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <201911030218.xA32IjPa081664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Sun, 3 Nov 2019 02:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354272 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 354272 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 02:18:45 -0000 Author: bdragon Date: Sun Nov 3 02:18:45 2019 New Revision: 354272 URL: https://svnweb.freebsd.org/changeset/base/354272 Log: powerpc: Add display of raw instruction values to x/I in ddb. The "alternate format" character 'I' previously had the same behavior as the "display as an instruction" character 'i'. With this change, it will now prefix each disassembled instruction with the raw hex value. As PowerPC instructions are always 32 bits and always aligned, and there are no alternate modes that would affect instruction decoding or display, this seemed to me to be the obvious interpretation of "alternate format". Approved by: jhibbits (mentor) Differential Revision: https://reviews.freebsd.org/D22223 Modified: head/sys/powerpc/powerpc/db_disasm.c Modified: head/sys/powerpc/powerpc/db_disasm.c ============================================================================== --- head/sys/powerpc/powerpc/db_disasm.c Sun Nov 3 02:17:35 2019 (r354271) +++ head/sys/powerpc/powerpc/db_disasm.c Sun Nov 3 02:18:45 2019 (r354272) @@ -1073,6 +1073,8 @@ db_disasm(db_addr_t loc, bool extended) int class; instr_t opcode; opcode = *(instr_t *)(loc); + if (extended) + db_printf("|%08x| ", opcode); class = opcode >> 26; (opcodes_base[class])(opcode, loc); From owner-svn-src-head@freebsd.org Sun Nov 3 03:23:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C87001A3A3A; Sun, 3 Nov 2019 03:23:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475LqM5byJz4ZPQ; Sun, 3 Nov 2019 03:23:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2EDE5A7B; Sun, 3 Nov 2019 03:23:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA33NR76024305; Sun, 3 Nov 2019 03:23:27 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA33NRG6024304; Sun, 3 Nov 2019 03:23:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911030323.xA33NRG6024304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 3 Nov 2019 03:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354276 - in head/sys: contrib/dev/iwm modules/iwmfw/iwm9000fw modules/iwmfw/iwm9260fw X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: contrib/dev/iwm modules/iwmfw/iwm9000fw modules/iwmfw/iwm9260fw X-SVN-Commit-Revision: 354276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 03:23:27 -0000 Author: markj Date: Sun Nov 3 03:23:27 2019 New Revision: 354276 URL: https://svnweb.freebsd.org/changeset/base/354276 Log: Downgrade the firmware images imported in r354201. Version 43 requires further modifications to iwm(4), and this was not caught in some initial testing. Version 34 works and is the version available on Intel's web site. MFC with: r354201 Sponsored by: The FreeBSD Foundation Added: head/sys/contrib/dev/iwm/iwm-9000-34.fw.uu head/sys/contrib/dev/iwm/iwm-9260-34.fw.uu Deleted: head/sys/contrib/dev/iwm/iwm-9000-43.fw.uu head/sys/contrib/dev/iwm/iwm-9260-43.fw.uu Modified: head/sys/modules/iwmfw/iwm9000fw/Makefile head/sys/modules/iwmfw/iwm9260fw/Makefile Added: head/sys/contrib/dev/iwm/iwm-9000-34.fw.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/iwm/iwm-9000-34.fw.uu Sun Nov 3 03:23:27 2019 (r354276) @@ -0,0 +1,59521 @@ +begin 644 iwm-9000-34.fw.uu +M`````$E73`I.+W)E;&5A````"`````````!_,\^='@````@````!```` +M9@(``!X````(`````@```-]N$P`>````"`````,`````````'````!`````` +M````````````````````&P````0````"````(`````0`````L`,`,P````P` +M``````````"```"``0`S````#`````$``````(@``(```#,````,`````@`` +M````0```\`@`$P```+P"````0$``!@```*$```````$``````(:````H`A@@ +M!N0!`$````!``````0```!$;4+H````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````=MVF>*UJ,X$=>E_#W#VH;^Y5X_")L7/N5&48I:=UN +M=OPMR]FQQ%&!P_PF,A#PO7[_+OHX#*W0W$5"LNL7A_V-1"Y%N?O6$_R?,_,Q +MH7!AQ7JCM2"8+L(&I4Q2(YO'@MBVP2/M6BT*$ +MWS3'.%W">-0+NW6P<'ZIQ_]GT*9T>$%]>%ZQ9J`9P0 +MD=26W:3.O3:.C=I+DJBO!S/(O!91O.M[V6-#)B#L6&0TXBL7=G +M9X@.6_26K`M&JWRN,LXA-S@-"P]LO+"VZ$AKL6>KEOQ4%O13B:NU[Q46=^"W +M53'<&XEQ<\.SX^^YYN:99<,S0`\/ST$+DA.L\KJVKUNMF*Y1IVLR!9IWZ@N^ +M>TMC(Y6^OR01P3]2J%J%:MSKO&%[-JGYNT7L'FGZ:NI0O'"/,A.C%?92ZZ:< +MPL==[*>`XX"8_;]G*S4?%%(NAS/M"!;>H?\0=P!&(!^$8'P`( +M8@``&R4!`!LD```%)0$`!20`"`4Y`0`%8H@@P!$"``4D``@%.0$`!6*,(,`1 +M!``%)``(!3D!``5BD"#`$0@`!20`"`4Y`0`%8I0@P!$0``4D``@%.0$`!6*8 +M(,`1(``%)``(!3D!``5BG"#`$4``!20`"`4Y`0`%8J`@P!$```@E```()(@' +MX1F$!^$9/`?`$@$`&W`#``!AZ!W`$!``&S#H'<`1+`?`$@$`&W`%``!A#QP= +M(@0`'2;H'<`0`0`;,.@=P!&V#P!A```;)(``&R7D'<`1"`!?<`D``&'0!L`2 +M``D;*,P&@($``,`7U`;`$@`)&RC(!H"!``#`%Z@/`&',!L`2X`:`@0``P!?( +M!L`2W`:`@0``P!>A#P!A```;)``!&R7D'<`1"`!?<)P/`&$```4EX@0%)-0& +MP!(`"1LH``4;*=P&@($``,`7T`;`$@`)&R@`!1LIX`:`@0``P!>/#P!A```; +M)``"&R7D'<`1"`!?<`P``&'8'<`0__\;,]@=P!'.[@TE@ID-)`\--R)L(,`0 +M#QLW(O__#24._PTD#PTW(GX/`&'8'<`0```;,=@=P!'.[@TE@ID-)`\--R)L +M(,`0#QLW(O__#26._PTD#PTW(G(/`&$```!A```;(S@XP!$```!AW!W`$``` +M'20````A`0`3(P3\S1$#`!,D!"#,$>P*P!),(@=P!#F_Q,R__\3,^@=P!$```$D"``!)0\!8R(!`%(D"``';@(` +M`&$``!4D````(0X``&'H'<`0$/@!)/__`24``1,Y#Q,!(BP'P!(``1,XZ!W` +M$0$`4B1X1<`0`0`3<`(``&$(`&0QX0\`8>0*P!(!`!-N1@``8<[N#24!@`TD +M#PTW(@]<-R(L#("!``#`%@8!$V($",`0!``39`]<`"(*``!```8``*P!(``,T1 +M#TT3(@00Q1$"`!,D\!S`$0$`$R3L',`1```3)'``$R40',`1```3(^`[[ZMWN^^K=[O +MOJW>[[ZMWN^^K=[OOJW>[[ZMWN^^K=[OOJW>```````````````````````` +M````````````````````````X@0``-`'``````````````$!`0$!`0$!O1\` +M`&,N``#_____``````````````````````(`````````,@`````````````` +M```````````(```````````````````````````````````````````````` +M`````````````````````````````````````````````````````0`````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````S +M$`(`$1`````````````````@```````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````$0`@``````````````````````````````````\#(`````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````#0XL+ +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````V'D```4```($````\$Z````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````@``````````````````````````````````````````````````` +M``````````````````````````````````````````````````9D```````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````````````IQ +MR;Z\```````````````````````````````````````````````````````` +M`````````````````/]_````````_W\```````#_?P```````/]_```````` +M_W\```````#_?P```````/]_````````_W\```````#_?P````#_?P`````` +M``````````$```````````````````````````````8``````````````"3@ +M@-(5T@S2%=$3T1+1$-(1TA31@](0T1'1"1$1$0[2`.`!T!+2$])0T`1#`40/ +MT`""(($IX`;0`````#\`/P``````/P`_```````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````"8'@````"<'@````"D'@````"H'@````#`'@````"X'@`` +M``"\'@``````'0`````@'0````!`'0````!@'0````"`'0````"@'0````#` +M'0````#@'0`````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````````````````````$`@` +M``#_`P#L"0```/\%`'`(````_RT`3`@```#_/0"X!P```/\$`-P'````_R4` +M,`@```#_/``8R````/_=```)````_TP`U`D```#_(@"4"````/\F`'0)```` +M_R@`],<````@``#X!P```/\'`"@)````_R`````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````0````$````````````````````````````````````````` +M``````````````````````````````````````````````````````$````" +M`````P````````#_````_P```/\```#_```````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````!,"*``2`B@ +M`$0(H`"0"8`````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````````````\` +M#P`/``\`#P`/``\`#P`````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````)@`````!)@`````*)@`````+)@`````#)@`````()@` +M`````0`````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````@```````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````!``$``````,``D`#0```````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````0$(/`,#&+0`#S@,4`P```````````````````)!9`0`%```` +M`````/!.@`````````````````"L6`$`!0````````#P3H``D%D!`*Q8`0`< +M60$`J%@!`.18`0`````````````````````````````````````````````` +M```````````````````!_P`````````````````````````````````````` +M`````````````?\```````````````````````````````````D````-```` +M```````````````````````````````````````````````````````````` +M``````````'_```````````````````````````````````````````````` +M```!_P``````````````````````````````````"0````T````````````` +M```````````````````````````````````````````````````````````` +M`?\```````````````````````````````````````````````````'_```` +M```````````````````````````````)````#0`````````````````````` +M```````````````````````````````````````````````````!_P`````` +M`````````````````````````````````````````````?\````````````` +M``````````````````````D````-````````````````````!`````````#_ +M____6!&`````````````````````````$````-````!`````P`````````!@ +M`@``X`(``-`!``"``0``@````$````!@`````````*`!``#@`@``T`$`@``` +M```````````````````"````````````````````_P``````````@``````` +M_P```````````@```````````````````/\``````````(```````/\````` +M``````(```````````````````#_``````````"```````#_```````````" +M````````````````````_P``````````@```````_P```````````@`````` +M`````````````/\``````````(```````/\```````````(````````````` +M``````#_``````````"```````#_```````````"```````````````````` +M_P``````````@```````_P```````````@```````````````````/\````` +M`````(```````/\```````````(```````````````````#_``````````"` +M``````#_```````````"````````````````````_P``````````@``````` +M_P```````````@```````````````````/\``````````(```````/\````` +M``````(```````````````````#_``````````"```````#_```````````" +M````````````````````_P``````````@```````_P```````````@`````` +M`````````````/\``````````(```````/\```````````(````````````` +M``````#_``````````"```````#_```````````"```````````````````` +M_P``````````@```````_P`````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````8(*``'""@`"@@H``L(*`` +M.""@`"`@H``D(*``,""@`#0@H``\(*``0"&@`$0AH`!H(:``;"&@`'@AH`!( +M(:``3"&@`'`AH`!T(:``?"&@````````````_P`````````````````````` +M``#_`````````````````````````/\`````````````````````````_P`` +M``````````````````````````````````````````````````````!$(``` +M!0````0```#P3H``\$Z``/!.@`"`(:``M""@`&P@H```,````'`````````` +M````%$^``!1/@`"`(:``I""@`#@@H``!````!P``````````````.$^``#A/ +M@`"`(:``J""@`#P@H``0````.```````````````7$^``%Q/@`"`(:``K""@ +M`'@AH`!``0``P`$`````````````@$^``(!/@`"`(:``L""@`'PAH```#``` +M``X`````````````_P```/\````````````````````````````````````` +M````````````````````````````````````````````````````_P`````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``#__P``__\````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````'``P`#``(``4``P`!H`! +M``(`"(````````````L`(``@``L`"P`+``:``0`"``B````````````*``H` +M"@`*``D`"P`&@`$``@`(@``````````#`````@````````````````````8` +M````````!@````(!``"````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````/\`````````````````````````````````````````6%0!`!!4`0"P +M5`$`9%8!``16`0`,50$`G%4!`-!5`0#D4P$`````````````````3$4```4` +M```$````\$Z``````````````````/Q>```%````!````/!.@``````````` +M``````"`8```!0````0```#P3H`````````````````````````````````` +M`````````````````````````````@(``@("``("`@`"`@("``````0%!00" +M`@``!``'!P<'!P<````````````(+IZ>-D6>GIZ>GHF>;W="9Y>!3)Z>GIZ> +M15]%&9Z/CT)^GIY%16QL;```!`4%!`("``!R96%D(&UE;6]R>2!B;&]C:SH@ +M4D9(7T=%3E]#1D<`2!B;&]C:SH@4D9(7U%?55)"1$-"7U=)1%@`@`X`!X`$`!R`#H`'@`"`P0%``#@(@0` +MI448`,KT)P#*]"<`.@$"`=4`WP`Z`:(`=0!_`,H!2@'B`/D`R@'J`((`F0`! +M`P\'?'Q\?&=G9V<%!0H*``````H4-VYJ`1H!V0#H`&H!N@!Y`(@`=-%%%^BB +MBRX0&*``#!B@``@0$`(0"```$!F@``P9H``0&$`&$"```#``"``-#0T-#@X. +M#@X/#P\/#Q`0$!`1$1$1$A(2$A,3$Q,4%!05%145%A86%Q<7&!@8&1D:&AH; +M&QL<'!T='1X>'Q\@("$A(B(C(R0D)24F)BWQ^@(*$AHB*C(Z0DI26F)J=GZ&CIJBKK;"RM;>Z +MO<#"Q0` +MF`#D`)@`Y`"8`-P"W`)N`=P";@'H`6X!]`!N`?0`;@'T`+(%L@79`K(%V0+, +M`]D"Y@'9`N8!V0+F`40!1`'F`40!Y@&P`>8!'`+F`1P"Y@$<`H@"B`+,`X@" +MS`-@`\P#.`3,`S@$S`,X!,P#S`.R!$AX2'@`!`@$#!@````0(!!`0```H`"@`,``L`"P`*``\`#0`+``L`#P` +M-``P`"P`5`!$`'__!P\?/P$#!0`'`@,$!@8-!04)"0D)"0D)"0D!!P\?/W__ +M____________````@%55554```!`T%Y">V@OH3V:'Q8IM)?0'CB.XS@PG'<1P'`0$!`0$!`0%!P0$!`0$!`0$!0<$! +M`0$!`0$!`4%!`0$!`0$!`0%!P0$!`0$!`0$!04$!`0$!`0$!`4%!`0$!`0$! +M`0%!00$!`0$!`0$!0D)!04%!04%!04%!04%!04%!04)"0D%!04%!0L)"0D-! +M04%!0D)"0T-#04%!04%!04)"0D%!04%"0D)#0T-!04%"0D-#1$3$04%"0D-$ +M1,1&1@$"`P29F0,`G=B)G4[LQ$XT2(,T)W9B)QJD01H3.[$3$1B!$0_\P`\- +MTB`-"[W0"S0`:`!H`-``T``X`3@!.`&@`:`!;`#8`-@`L`&P`8@"B`*(`F`# +M8`/J`-0!U`&H`Z@#?`5\!7P%4`=0!]0!J`.H`U`'4`?X"O@*^`J@#J`.&@`T +M`$X`:`"<`-``Z@`$`3@!6P&&`;$!-@!L`*(`V`!$`;`!Y@$<`H@"T`(J`X0# +M=0#J`%\!U`&^`J@#'022!'P%&`;;!IX'Z@#4`;X"J`-\!5`'.@@D"?@*,`RV +M#3P/"0D%!0D)#0T%!@$"`P0``)*-C(J*BHF(B(B2BHB'AX:&AH:&CHF(AX:& +MAH6%A9*.C8R,C(R,C(PM+34V-S@^0D9&+3,U.S]`0$='1S(V.#HZ04!'1T<] +M/CY(2$=*4%!0#0\%!PD+`0,H`"@`-``P`"P`+`!$`#P`5555`4MH+P%5554% +MXSB.`ZJJJ@)Q',GI[?'Q]?7U^?GY^ +M?W]_?W]_?W^`!`P,"!04!`1`````@``````!`````@````0```!```!````` +M0````#0#4`-[`[H#%02;!/0$_@,?!$@$@P3;!&(%NP6Z!NP&.`>Q!W@(FPE: +M"J$'WP'@<```(``@8&!@8&!@8&!@0`````!O8& +M]O;V&P`(6QM;(0`````````!`````0```````````````0`````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````!%R!``0````$````!`````0````$```````````````````````````` +M``````````````````````````````````````````````\`"``&``,``P`` +M```1`!````````````````````````````$``````````````$`````````` +M```````````!````````$`````!``````````````````````0```,R%@``` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````%]?8@`````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````````````#_ +M______\````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``#_______\````````````````````````````````````````````````` +M`````````@`0`````$`````````````````````!````V'B````````````` +M`````````````````````````````0$"`0("`P$"`@,"`P,$``()`0,```#P +M10(`9$$"`"SX`@`L^`(`+/@"`"SX`@`L^`(`^$<"`%CX`@!81P(`+/@"`"SX +M`@`L^`(`+/@"`"SX`@`L^`(`+/@"`"SX`@`L^`(`!````"SX`@`L^`(`+/@" +M`"SX`@`L^`(`+/@"`"SX`@`L^`(```````\`/P`"````#P`_``(````/`#\` +M`@````\`/P`"````#P`_``(@```````````$"`P,````````!`@,#``````` +M``0(#`P````````$"`P,!@`-`$(`8P"&`*``_P```*JJJJJJJJJJJJJJ[JJJ +MJJHH_P#,JJH``*JJ`,RJJ@```$``P`!``,``4`#P`%``\``````````````` +M`````````````````````````````````````````````````*JJJJJJJJJJ +MJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ``````````````````````!L;6YO +M<'%R+<"``"E10`@Q$4`+/@"`"SX`@`L^`(` +M$````%B@10#8K$4`,*U%`*3#10`L^`(`+/@"`(2?10`0GT4`+/@"`"SX`@`L +M^`(`+/@"`"SX`@`L^`(`+/@"`%3X`@!8^`(`,/@"`"SX`@`L^`(`+/@"`"SX +M`@`L^`(`+/@"`"SX`@`L^`(`+/@"``0````L^`(`+/@"`"SX`@`L^`(````` +M`````````````````!A,1@!4048`H#Y&`+!(1@`L2T8`K#]&`$!01@`,2$8` +M6/@"`&A"1@"0148`S$=&`*1"1@`H1$8`0$E&`/A01@!<2$8`W$I&`&!"1@`( +M`0``+/@"`"SX`@`L^`(`+/@"``1!1@!02T8`+/@"`"SX`@`!`04!`P$!`0@! +M`@$(``@``0$#`0$!`P`#`0(!!0$!`00````0!48`+/@"`(`!1@`L!$8`+/@" +M`#`"1@`D!D8`!`1&`%CX`@`P^`(`+/@"`"SX`@!<`D8`1`-&`"SX`@`L^`(` +M+/@"`"SX`@`L^`(`$````"SX`@`L^`(`+/@"`"SX`@`L^`(`+/@"`"SX`@#\ +M`D8```````\`/P`!````#P`_``$````/`#\``0````\`/P`!````#P`_``$` +M```"`````@````8````&````!0````4````$````!`````,````#`````0`` +M`````````````````*!)10!T244`<$E%`)A)10"<244`+/@"`"SX`@"4244` +M6/@"`)!)10`L^`(`+/@"`"SX`@`L^`(`+/@"`"SX`@`L^`(`+/@"`"SX`@`0 +M````+/@"````````````+/@"```````````````````````L^`(`+/@"`.P] +M1@`D/D8`=#Y&`"SX`@`L^`(`5/@"`%CX`@`P^`(`+/@"`"SX`@`L^`(`+/@" +M`"SX`@`L^`(`+/@"`"SX`@`L^`(`$````"SX`@`L^`(`+/@"`"SX`@`L^`(` +M+/@"`"SX`@`L^`(``.<0YR#G,.<`[Q#O(.\P[P#B`.,`Y`#E`.H`ZP#L`.TL +M^`(`+/@"`%121@`L^`(`+/@"`%A21@`L^`(`5/@"`%CX`@`P^`(`+/@"`"SX +M`@`L^`(`+/@"`"SX`@`L^`(`+/@"`"SX`@`L^`(`$````"SX`@`L^`(`+/@" +M`"SX`@`L^`(`+/@"`"SX`@`L^`(``0$!``(```"<_QC\``!D`&(```!O`&,` +ML`1P`&T`T`=Q`&\`H`]R`'$`0!]S`'(`$"=T`',`X"YU`&``F#H``)69G:&E +M````_T%55555`0````("`B````"`B(B(B```$0```#16`@`#````?'8"``$` +M```D,0,``````-2I`@`8````)(,"``P```!@?@(`'````(Q?`@`$````,)0` +M`!,```#86P(`&P```!Q7`@`1````<%8"`!@```!`A0(`&0```-"9`@`:```` +M/*,"``<````PB@(``P```"AY`@`,````-($"``0```"$G0``-*D"`#A7`@#D +M5@(`N)H"`-RC`@#47P(`2'T"`/B'`@`X6@(`L)0``*1V`@#46@(`!C!0<(2A +M```&,`````#__P`!`/\```$$```$_P``_@`!`/\!`0((`P$#"0,!`03_`0`& +M"`$!!P$!`0`"`0`!!`(`_P8"`P7_`@("!P("`P<"`@3_`@(``@(``00"`0?_ +M`@`&"`,`__\#`P0%`P(#_P,!!_\#``8(`P,``@,``00``@`````%_P```?\" +M`/\"`@,%_P(`!@$"``$!`P#_`P,#!00#`0/_`P("!0,`!@$#``$!`0#_!P$! +M!P8!`07_`00!_P$#"`@$`/\)!`0%_P0`"`H$!`/_)````"@````L````,``` +M`#0````X````/````$````!$````2````$P```!0````5````%@```!<```` +M8````&0```!H````;````'````!T````>````'P```"`````A````(@```", +M````D````)4```"9````G0```*$```"E````J0```*T```"Q````*@```#H` +M``!*````6@```&H```!Z````B@```)L```"K`````@````0````&`````P`` +M``L````3````&P```",````K````,P```#H```!"`````0`````````$```` +M!0``````````````````````_P```/X!```"_P```_\``0#_`0`!`@$"`O\" +M`/\#`@#^!`(``_\```````````````"@;44`"@````0```#P3H`````````` +M````````M&U%``H````$````\$Z````````````````````````````````` +M```````````````````````>````'H@>B%H```!6````5HA6B`(!``"J```` +MJHBJB/X!``","@``5(Q4C*0?```````````````````H"@(`"@````0```#P +M3H``````````````````K`H"``4````$````\$Z``````````````````-2[ +M10`DOD4`4+U%`-B]10!(N44`'+E%`/`T10#8N$4`C#5%``@S10!@,T4`!$T" +M````````````````````````````````````_PD```#_```'_P`!"0H```K_ +M`0#_!@$"```!`P'_`0,"_P$#`_\!`0W_`0$$_P$"!0`!`0O_`0(,_P$$!@@! +M`0?_`0`(_P$`"O\"`@#_`@,!_P(#`O\"`P/_`@$-`0(!!`$"`@4``@$+`0(" +M#`$"!`8(`@('``(`"`$"``H!`P#_`@,#`/\#`P'_`P,"_P,#`P0#`00%`P$- +M!P,"!0`#`0L%`P(,!0,$!@@#`P?_`P`(!0,`"@4#`/X#!`0`_P0$`?\$!`+_ +M!`0#_P0$#?\$!`3_!`0%_P0$"_\$!`S_!`0&"`0$!P@$``C_!``*_P`````` +M``````#_`````0,``@("``,``@``!?\```;_```$_P``!P0```S_`0#_`0$! +M``,!`@$"`0("`@$`!/\!`0<$`0`,_P("``4"`@(%`@`%_P(`!O\"`@0%`@(' +M!0(#"@("`@D"`@`(_P(`#`4#`P`%`P,!!0,#`@4#`07_`P`&_P,#!`4#`P<% +M`P()`@,#"@(#``L#`P`(_P,`#`4``````!```/8/``#8#P``I@\``&$/```) +M#P``G0X``"`.``"1#0``\0P``$$,``"""P``M`H``-D)``#R"`````@```,' +M``#^!0``\00``-X#``#'`@``K`$``(X```````````````````````````$` +M```!```````````````!`````0````$```````````````$``!CA@``>``'4 +MY@(``0`$T.4"``$`!````/!#@``0``&H#H```@`!``"```$` +M`SA\@``!``&DX(```0`#J."```$``Z3F`@`"``0``"`````@```````````` +M`````````````(A>`P`%```"!````/!.@`#_`````'F``+SK@``````````` +M````````````````````````````````````````````U0#6``$`+0"`!Q`* +M_0#^`"8`@0J""J$(,0L``/\````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````"DJ@(`,S,#````!``R +M504````(`*NJ"@````P`S@````````1J`````` +M``0\H```````"#R@```````8/*```````!P\H```````(#R@```````D/*`` +M`````"@\H```````+#R@```````P/*```````#0\H```````.#R@```````\ +M/*```````$`\H```````1#R@``````!(/*```````$P\H```````4#R@```` +M``!4/*```````%@\H```````7#R@``````!@/*```````&0\H```````:#R@ +M``````!\/*```````'@\H````````````````````````````)C=`0!0W0$` +M`````.A[@`#H>X```````````````````````````````````````,#!@`#` +MP8``P,&``,#!@``````````````````````````````````````````````` +M``#^RJVK`````````````````````"`"`````"$"`````"("`````","```` +M`"0"`````"4"`````"($`````",$`````"0$`````"4$`````"8$`````"<$ +M`````"@$`````"D$`````"H$`````"L$`````"P$`````"T$`````"X$```` +M`"\$`````#`$`````#$$``````D$`````!<``0```!@P8,`````````````` +M`````````````*!O10`*`````````/!.@`````````````````````````#_ +M```!`_\```D!```*_P`#!`(```#_``#^`P$`_P0!`0D%`0$*!0$``?\!`P0" +M`0$"_P$!"/\!``#_`0#^!@(`_P<"`@D(`@(*"`("!PD"``'_`@$#_P(#!`H" +M`@+_`@``"P,#"0P#`PH,`P0%#0,#`@X#```/!`#_$`0$"1$$!`H1!`(&_P0" +M`A($!`C_!```_P0`_A,```````````````#X)$4`"@````````#P3H`````` +M``````#4.D4`8#M%`/0A10!8.T4`O&Y%`"AO10`0;T4`,")%`&PC10#$(D4` +M)")%`&0C10`8(D4``")%``@B10`0(D4`C&M%`/AK10#$:T4`O&M%`/______ +M______________\$````________________`P```/____\``````````/__ +M__\``````````/____\```````````,````0`````P```/\```#_````_P`` +M`/\````#```````````````````````````````````````````````````` +M````````````````_P```/\````>```````````````````````````````` +M``````````````````````````````````````````````!D````9````&0` +M``!D````R````)`!``#H`P``T`<```#_`````````````/\`````!@$#`@`` +M```````#0>```` +M`#@>`````#P>`````$P>`````%`>`````%0>`````%@>`````%P>`````&0> +M`````'@>`````'P>`````(P>`````)`>`````)0>`````)@>`````)P>```` +M`*`>`````,`>`````,0>`````-`>`````-0>``````0?`````-P>`````'0? +M`````'@?`````'P?`````/@?`````"8`````````````````````````$``` +M`!\````````````````````````````````````````````````````````` +M````````````````````````````````$``````````````````````````` +M```````````````0```````````````4```````````````E````Y?____G_ +M__\O````W?____C___\```````````$````````````````````````````` +M`````````````````````````````````````````````````/\````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````/SP```````````````````,`````````_P`````` +M````````````````````````````````````````__\````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````( +M`````````````````````````````````````````````````````````/__ +M________````````````````C`0"``H````$````\$Z`````````````Z`8" +M```(`@`X!P(`0`8"`#`(`@#$!P(`E`8"`/`%`@```0````$$`0$!``(!`0$# +M`0`"!P$!!`0!`04%`0(#_P(!`08"``('B!,````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``#_____```````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````(`````````````````` +M````````_____P`````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````"````````````` +M`````````````/____\````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````````````````@``````` +M``````````````````#_____```````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````````````````````(`` +M````````````````````````_____P`````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``"``````````````````````````/\````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Nov 3 09:14:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7AABB1AD696; Sun, 3 Nov 2019 09:14:30 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475VcQ2b5yz3N77; Sun, 3 Nov 2019 09:14:30 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BBE198FC; Sun, 3 Nov 2019 09:14:30 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA39EU7o030084; Sun, 3 Nov 2019 09:14:30 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA39EUxj030083; Sun, 3 Nov 2019 09:14:30 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911030914.xA39EUxj030083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 3 Nov 2019 09:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354278 - head/stand/userboot/test X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/userboot/test X-SVN-Commit-Revision: 354278 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 09:14:30 -0000 Author: tsoome Date: Sun Nov 3 09:14:29 2019 New Revision: 354278 URL: https://svnweb.freebsd.org/changeset/base/354278 Log: loader: userboot/test should accept more than one disk allow to specify multiple -d options, test -d disk1 -d disk2 .. Modified: head/stand/userboot/test/test.c Modified: head/stand/userboot/test/test.c ============================================================================== --- head/stand/userboot/test/test.c Sun Nov 3 07:11:09 2019 (r354277) +++ head/stand/userboot/test/test.c Sun Nov 3 09:14:29 2019 (r354278) @@ -50,10 +50,11 @@ char *host_base = NULL; struct termios term, oldterm; char *image; size_t image_size; -int disk_fd = -1; uint64_t regs[16]; uint64_t pc; +int *disk_fd; +int disk_index = -1; void test_exit(void *arg, int v); @@ -245,9 +246,9 @@ test_diskread(void *arg, int unit, uint64_t offset, vo { ssize_t n; - if (unit != 0 || disk_fd == -1) + if (unit > disk_index || disk_fd[unit] == -1) return (EIO); - n = pread(disk_fd, dst, size, offset); + n = pread(disk_fd[unit], dst, size, offset); if (n < 0) return (errno); *resid_return = size - n; @@ -259,14 +260,14 @@ test_diskioctl(void *arg, int unit, u_long cmd, void * { struct stat sb; - if (unit != 0 || disk_fd == -1) + if (unit > disk_index || disk_fd[unit] == -1) return (EBADF); switch (cmd) { case DIOCGSECTORSIZE: *(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); @@ -424,7 +425,6 @@ main(int argc, char** argv) void *h; void (*func)(struct loader_callbacks *, void *, int, int) __dead2; int opt; - char *disk_image = NULL; const char *userboot_obj = "/boot/userboot.so"; while ((opt = getopt(argc, argv, "b:d:h:")) != -1) { @@ -434,7 +434,12 @@ main(int argc, char** argv) break; case 'd': - disk_image = optarg; + disk_index++; + disk_fd = reallocarray(disk_fd, disk_index + 1, + sizeof (int)); + disk_fd[disk_index] = open(optarg, O_RDONLY); + if (disk_fd[disk_index] < 0) + err(1, "Can't open disk image '%s'", optarg); break; case 'h': @@ -459,11 +464,6 @@ main(int argc, char** argv) image_size = 128*1024*1024; image = malloc(image_size); - if (disk_image) { - disk_fd = open(disk_image, O_RDONLY); - if (disk_fd < 0) - err(1, "Can't open disk image '%s'", disk_image); - } tcgetattr(0, &term); oldterm = term; @@ -471,5 +471,5 @@ main(int argc, char** argv) term.c_lflag &= ~(ICANON|ECHO); tcsetattr(0, TCSAFLUSH, &term); - func(&cb, NULL, USERBOOT_VERSION_3, disk_fd >= 0); + func(&cb, NULL, USERBOOT_VERSION_3, disk_index + 1); } From owner-svn-src-head@freebsd.org Sun Nov 3 11:09:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D3E81B091D; Sun, 3 Nov 2019 11:09:07 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475Y8f6X21z4070; Sun, 3 Nov 2019 11:09:06 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C387AAC98; Sun, 3 Nov 2019 11:09:06 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3B96oF096782; Sun, 3 Nov 2019 11:09:06 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3B961F096781; Sun, 3 Nov 2019 11:09:06 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911031109.xA3B961F096781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 3 Nov 2019 11:09:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354279 - in head: stand/libsa/zfs sys/cddl/boot/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head: stand/libsa/zfs sys/cddl/boot/zfs X-SVN-Commit-Revision: 354279 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 11:09:07 -0000 Author: tsoome Date: Sun Nov 3 11:09:06 2019 New Revision: 354279 URL: https://svnweb.freebsd.org/changeset/base/354279 Log: loader: calculate physical vdev psize from asize Since physical device asize is calculated from psize and the asize is stored in pool label, we can use asize to set the value of psize, which is used to calculate the location of the pool labels. MFC after: 1 week Modified: head/stand/libsa/zfs/zfsimpl.c head/sys/cddl/boot/zfs/zfsimpl.h Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Sun Nov 3 09:14:29 2019 (r354278) +++ head/stand/libsa/zfs/zfsimpl.c Sun Nov 3 11:09:06 2019 (r354279) @@ -1102,7 +1102,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde vdev_t **vdevp, int is_newer) { int rc; - uint64_t guid, id, ashift, nparity; + uint64_t guid, id, ashift, asize, nparity; const char *type; const char *path; vdev_t *vdev, *kid; @@ -1181,6 +1181,11 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde } else { vdev->v_ashift = 0; } + if (nvlist_find(nvlist, ZPOOL_CONFIG_ASIZE, + DATA_TYPE_UINT64, NULL, &asize) == 0) { + vdev->v_psize = asize + + VDEV_LABEL_START_SIZE + VDEV_LABEL_END_SIZE; + } if (nvlist_find(nvlist, ZPOOL_CONFIG_NPARITY, DATA_TYPE_UINT64, NULL, &nparity) == 0) { vdev->v_nparity = nparity; @@ -1547,7 +1552,6 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s uint64_t guid; uint64_t best_txg = 0; uint64_t pool_txg, pool_guid; - uint64_t psize; const char *pool_name; const unsigned char *vdevs; const unsigned char *features; @@ -1562,17 +1566,17 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s memset(&vtmp, 0, sizeof(vtmp)); vtmp.v_phys_read = _read; vtmp.v_read_priv = read_priv; - psize = P2ALIGN(ldi_get_size(read_priv), + vtmp.v_psize = P2ALIGN(ldi_get_size(read_priv), (uint64_t)sizeof (vdev_label_t)); /* Test for minimum pool size. */ - if (psize < SPA_MINDEVSIZE) + if (vtmp.v_psize < SPA_MINDEVSIZE) return (EIO); tmp_label = zfs_alloc(sizeof(vdev_phys_t)); for (l = 0; l < VDEV_LABELS; l++) { - off = vdev_label_offset(psize, l, + off = vdev_label_offset(vtmp.v_psize, l, offsetof(vdev_label_t, vl_vdev_phys)); BP_ZERO(&bp); @@ -1595,8 +1599,20 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s continue; if (best_txg <= pool_txg) { + uint64_t asize; + best_txg = pool_txg; memcpy(vdev_label, tmp_label, sizeof (vdev_phys_t)); + + /* + * Use asize from pool config. We need this + * because we can get bad value from BIOS. + */ + if (nvlist_find(nvlist, ZPOOL_CONFIG_ASIZE, + DATA_TYPE_UINT64, NULL, &asize) == 0) { + vtmp.v_psize = asize + + VDEV_LABEL_START_SIZE + VDEV_LABEL_END_SIZE; + } } } @@ -1716,6 +1732,7 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s vdev->v_phys_read = _read; vdev->v_read_priv = read_priv; vdev->v_state = VDEV_STATE_HEALTHY; + vdev->v_psize = vtmp.v_psize; } else { printf("ZFS: inconsistent nvlist contents\n"); return (EIO); @@ -1735,7 +1752,7 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s up = (const struct uberblock *)upbuf; for (l = 0; l < VDEV_LABELS; l++) { for (i = 0; i < VDEV_UBERBLOCK_COUNT(vdev); i++) { - off = vdev_label_offset(psize, l, + off = vdev_label_offset(vdev->v_psize, l, VDEV_UBERBLOCK_OFFSET(vdev, i)); BP_ZERO(&bp); DVA_SET_OFFSET(&bp.blk_dva[0], off); Modified: head/sys/cddl/boot/zfs/zfsimpl.h ============================================================================== --- head/sys/cddl/boot/zfs/zfsimpl.h Sun Nov 3 09:14:29 2019 (r354278) +++ head/sys/cddl/boot/zfs/zfsimpl.h Sun Nov 3 11:09:06 2019 (r354279) @@ -1660,7 +1660,8 @@ typedef struct vdev { vdev_list_t v_children; /* children of this vdev */ const char *v_name; /* vdev name */ uint64_t v_guid; /* vdev guid */ - int v_id; /* index in parent */ + uint64_t v_id; /* index in parent */ + uint64_t v_psize; /* physical device capacity */ int v_ashift; /* offset to block shift */ int v_nparity; /* # parity for raidz */ struct vdev *v_top; /* parent vdev */ From owner-svn-src-head@freebsd.org Sun Nov 3 11:51:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE5521B1CA0; Sun, 3 Nov 2019 11:51:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475Z622xPTz42MK; Sun, 3 Nov 2019 11:51:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49B70B54B; Sun, 3 Nov 2019 11:51:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3Bpsgk022295; Sun, 3 Nov 2019 11:51:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3Bps3a022294; Sun, 3 Nov 2019 11:51:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201911031151.xA3Bps3a022294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 3 Nov 2019 11:51:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354280 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 354280 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 11:51:54 -0000 Author: kib Date: Sun Nov 3 11:51:53 2019 New Revision: 354280 URL: https://svnweb.freebsd.org/changeset/base/354280 Log: amd64 ddb: Add printing of kernel/user and saved user %cr3 values from pcpu. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/db_interface.c Modified: head/sys/amd64/amd64/db_interface.c ============================================================================== --- head/sys/amd64/amd64/db_interface.c Sun Nov 3 11:09:06 2019 (r354279) +++ head/sys/amd64/amd64/db_interface.c Sun Nov 3 11:51:53 2019 (r354280) @@ -101,6 +101,9 @@ db_show_mdpcpu(struct pcpu *pc) db_printf("tssp = %p\n", pc->pc_tssp); db_printf("commontssp = %p\n", pc->pc_commontssp); db_printf("rsp0 = 0x%lx\n", pc->pc_rsp0); + db_printf("kcr3 = 0x%lx\n", pc->pc_kcr3); + db_printf("ucr3 = 0x%lx\n", pc->pc_ucr3); + db_printf("scr3 = 0x%lx\n", pc->pc_saved_ucr3); db_printf("gs32p = %p\n", pc->pc_gs32p); db_printf("ldt = %p\n", pc->pc_ldt); db_printf("tss = %p\n", pc->pc_tss); From owner-svn-src-head@freebsd.org Sun Nov 3 11:52:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3EBF1B1D82; Sun, 3 Nov 2019 11:52:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475Z773wSzz42dV; Sun, 3 Nov 2019 11:52:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A04BB597; Sun, 3 Nov 2019 11:52:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3BqpcI026636; Sun, 3 Nov 2019 11:52:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3Bqpxd026635; Sun, 3 Nov 2019 11:52:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201911031152.xA3Bqpxd026635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 3 Nov 2019 11:52:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354281 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 354281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 11:52:51 -0000 Author: kib Date: Sun Nov 3 11:52:50 2019 New Revision: 354281 URL: https://svnweb.freebsd.org/changeset/base/354281 Log: amd64: Store %cr3 into pcpu saved_ucr3 on double fault. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/exception.S Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Sun Nov 3 11:51:53 2019 (r354280) +++ head/sys/amd64/amd64/exception.S Sun Nov 3 11:52:50 2019 (r354281) @@ -349,6 +349,8 @@ IDTVEC(dblfault) jz 1f /* already running with kernel GS.base */ swapgs 1: lfence + movq %cr3,%rax + movq %rax,PCPU(SAVED_UCR3) movq PCPU(KCR3),%rax cmpq $~0,%rax je 2f From owner-svn-src-head@freebsd.org Sun Nov 3 13:03:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FF791B45BA; Sun, 3 Nov 2019 13:03:48 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475bj00vBBz46YX; Sun, 3 Nov 2019 13:03:48 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02EE6C3B6; Sun, 3 Nov 2019 13:03:48 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3D3lCl068261; Sun, 3 Nov 2019 13:03:47 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3D3lJp068260; Sun, 3 Nov 2019 13:03:47 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911031303.xA3D3lJp068260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 3 Nov 2019 13:03:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354282 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 354282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 13:03:48 -0000 Author: tsoome Date: Sun Nov 3 13:03:47 2019 New Revision: 354282 URL: https://svnweb.freebsd.org/changeset/base/354282 Log: loader: should check malloc in zfs_dev_open malloc can return NULL. Modified: head/stand/libsa/zfs/zfs.c Modified: head/stand/libsa/zfs/zfs.c ============================================================================== --- head/stand/libsa/zfs/zfs.c Sun Nov 3 11:52:50 2019 (r354281) +++ head/stand/libsa/zfs/zfs.c Sun Nov 3 13:03:47 2019 (r354282) @@ -669,6 +669,8 @@ zfs_dev_open(struct open_file *f, ...) if (!spa) return (ENXIO); mount = malloc(sizeof(*mount)); + if (mount == NULL) + return (ENOMEM); rv = zfs_mount(spa, dev->root_guid, mount); if (rv != 0) { free(mount); From owner-svn-src-head@freebsd.org Sun Nov 3 13:25:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FE0B1B4E71; Sun, 3 Nov 2019 13:25:48 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475cBN0zstz47rM; Sun, 3 Nov 2019 13:25:48 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06570C75B; Sun, 3 Nov 2019 13:25:48 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3DPlff080389; Sun, 3 Nov 2019 13:25:47 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3DPl3B080386; Sun, 3 Nov 2019 13:25:47 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911031325.xA3DPl3B080386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 3 Nov 2019 13:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head: stand/libsa/zfs sys/cddl/boot/zfs X-SVN-Commit-Revision: 354283 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 13:25:48 -0000 Author: tsoome Date: Sun Nov 3 13:25:47 2019 New Revision: 354283 URL: https://svnweb.freebsd.org/changeset/base/354283 Log: loader: we do not support booting from pool with log device If pool has log device, stop there and tell about it. Modified: head/stand/libsa/zfs/zfs.c head/stand/libsa/zfs/zfsimpl.c head/sys/cddl/boot/zfs/zfsimpl.h Modified: head/stand/libsa/zfs/zfs.c ============================================================================== --- head/stand/libsa/zfs/zfs.c Sun Nov 3 13:03:47 2019 (r354282) +++ head/stand/libsa/zfs/zfs.c Sun Nov 3 13:25:47 2019 (r354283) @@ -668,6 +668,11 @@ zfs_dev_open(struct open_file *f, ...) spa = spa_find_by_guid(dev->pool_guid); if (!spa) return (ENXIO); + if (spa->spa_with_log) { + printf("Reading pool %s is not supported due to log device.\n", + spa->spa_name); + return (ENXIO); + } mount = malloc(sizeof(*mount)); if (mount == NULL) return (ENOMEM); Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Sun Nov 3 13:03:47 2019 (r354282) +++ head/stand/libsa/zfs/zfsimpl.c Sun Nov 3 13:25:47 2019 (r354283) @@ -1109,6 +1109,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde const unsigned char *kids; int nkids, i, is_new; uint64_t is_offline, is_faulted, is_degraded, is_removed, isnt_present; + uint64_t is_log; if (nvlist_find(nvlist, ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64, NULL, &guid) @@ -1132,17 +1133,20 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde } is_offline = is_removed = is_faulted = is_degraded = isnt_present = 0; + is_log = 0; nvlist_find(nvlist, ZPOOL_CONFIG_OFFLINE, DATA_TYPE_UINT64, NULL, - &is_offline); + &is_offline); nvlist_find(nvlist, ZPOOL_CONFIG_REMOVED, DATA_TYPE_UINT64, NULL, - &is_removed); + &is_removed); nvlist_find(nvlist, ZPOOL_CONFIG_FAULTED, DATA_TYPE_UINT64, NULL, - &is_faulted); + &is_faulted); nvlist_find(nvlist, ZPOOL_CONFIG_DEGRADED, DATA_TYPE_UINT64, NULL, - &is_degraded); + &is_degraded); nvlist_find(nvlist, ZPOOL_CONFIG_NOT_PRESENT, DATA_TYPE_UINT64, NULL, - &isnt_present); + &isnt_present); + nvlist_find(nvlist, ZPOOL_CONFIG_IS_LOG, DATA_TYPE_UINT64, NULL, + &is_log); vdev = vdev_find(guid); if (!vdev) { @@ -1217,6 +1221,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde return (ENOMEM); vdev->v_name = name; } + vdev->v_islog = is_log == 1; } else { is_new = 0; } @@ -1433,6 +1438,12 @@ vdev_status(vdev_t *vdev, int indent) { vdev_t *kid; int ret; + + if (vdev->v_islog) { + (void)pager_output(" logs\n"); + indent++; + } + ret = print_state(indent, vdev->v_name, vdev->v_state); if (ret != 0) return (ret); @@ -1737,6 +1748,12 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s printf("ZFS: inconsistent nvlist contents\n"); return (EIO); } + + /* + * We do not support reading pools with log device. + */ + if (vdev->v_islog) + spa->spa_with_log = vdev->v_islog; /* * Re-evaluate top-level vdev state. Modified: head/sys/cddl/boot/zfs/zfsimpl.h ============================================================================== --- head/sys/cddl/boot/zfs/zfsimpl.h Sun Nov 3 13:03:47 2019 (r354282) +++ head/sys/cddl/boot/zfs/zfsimpl.h Sun Nov 3 13:25:47 2019 (r354283) @@ -1670,6 +1670,7 @@ typedef struct vdev { vdev_phys_read_t *v_phys_read; /* read from raw leaf vdev */ vdev_read_t *v_read; /* read from vdev */ void *v_read_priv; /* private data for read function */ + boolean_t v_islog; struct spa *spa; /* link to spa */ /* * Values stored in the config for an indirect or removing vdev. @@ -1694,6 +1695,7 @@ typedef struct spa { zio_cksum_salt_t spa_cksum_salt; /* secret salt for cksum */ void *spa_cksum_tmpls[ZIO_CHECKSUM_FUNCTIONS]; int spa_inited; /* initialized */ + boolean_t spa_with_log; /* this pool has log */ } spa_t; /* IO related arguments. */ From owner-svn-src-head@freebsd.org Sun Nov 3 14:36:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ACC1E1B6D10; Sun, 3 Nov 2019 14:36:17 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475dlj45tzz4C9K; Sun, 3 Nov 2019 14:36:17 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B8C9D3C4; Sun, 3 Nov 2019 14:36:17 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3EaHO4022033; Sun, 3 Nov 2019 14:36:17 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3EaHdf022032; Sun, 3 Nov 2019 14:36:17 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911031436.xA3EaHdf022032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 3 Nov 2019 14:36:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354284 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 354284 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 14:36:17 -0000 Author: tsoome Date: Sun Nov 3 14:36:16 2019 New Revision: 354284 URL: https://svnweb.freebsd.org/changeset/base/354284 Log: loader: zfs.c is missing malloc checks, fix it malloc() can return NULL, we need to check the return value. Modified: head/stand/libsa/zfs/zfs.c Modified: head/stand/libsa/zfs/zfs.c ============================================================================== --- head/stand/libsa/zfs/zfs.c Sun Nov 3 13:25:47 2019 (r354283) +++ head/stand/libsa/zfs/zfs.c Sun Nov 3 14:36:16 2019 (r354284) @@ -110,9 +110,10 @@ zfs_open(const char *upath, struct open_file *f) return (EINVAL); /* allocate file system specific data structure */ - fp = malloc(sizeof(struct file)); - bzero(fp, sizeof(struct file)); - f->f_fsdata = (void *)fp; + fp = calloc(1, sizeof(struct file)); + if (fp == NULL) + return (ENOMEM); + f->f_fsdata = fp; rc = zfs_lookup(mount, upath, &fp->f_dnode); fp->f_seekp = 0; @@ -129,9 +130,7 @@ zfs_close(struct open_file *f) struct file *fp = (struct file *)f->f_fsdata; dnode_cache_obj = NULL; - f->f_fsdata = (void *)0; - if (fp == (struct file *)0) - return (0); + f->f_fsdata = NULL; free(fp); return (0); @@ -250,7 +249,9 @@ zfs_readdir(struct open_file *f, struct dirent *d) return (rc); fp->f_seekp = bsize; - fp->f_zap_leaf = (zap_leaf_phys_t *)malloc(bsize); + fp->f_zap_leaf = malloc(bsize); + if (fp->f_zap_leaf == NULL) + return (ENOMEM); rc = dnode_read(spa, &fp->f_dnode, fp->f_seekp, fp->f_zap_leaf, @@ -675,8 +676,9 @@ zfs_dev_open(struct open_file *f, ...) } mount = malloc(sizeof(*mount)); if (mount == NULL) - return (ENOMEM); - rv = zfs_mount(spa, dev->root_guid, mount); + rv = ENOMEM; + else + rv = zfs_mount(spa, dev->root_guid, mount); if (rv != 0) { free(mount); return (rv); From owner-svn-src-head@freebsd.org Sun Nov 3 15:42:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8DE3B178611; Sun, 3 Nov 2019 15:42:10 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475gCk3HJ2z4Gtk; Sun, 3 Nov 2019 15:42:10 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54588DFF3; Sun, 3 Nov 2019 15:42:10 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3FgAuu061990; Sun, 3 Nov 2019 15:42:10 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3Fg8pq061983; Sun, 3 Nov 2019 15:42:08 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201911031542.xA3Fg8pq061983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 3 Nov 2019 15:42:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354285 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 354285 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 15:42:10 -0000 Author: andrew Date: Sun Nov 3 15:42:08 2019 New Revision: 354285 URL: https://svnweb.freebsd.org/changeset/base/354285 Log: Add support for setting hardware breakpoints from ptrace on arm64. Implement get/fill_dbregs on arm64. This is used by ptrace with the PT_GETDBREGS and PT_SETDBREGS requests. It allows userspace to set hardware breakpoints. The struct dbreg is based on Linux to ease adding hardware breakpoint support to debuggers. Reviewed by: jhb Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22195 Modified: head/sys/arm64/arm64/debug_monitor.c head/sys/arm64/arm64/exception.S head/sys/arm64/arm64/identcpu.c head/sys/arm64/arm64/machdep.c head/sys/arm64/arm64/trap.c head/sys/arm64/include/armreg.h head/sys/arm64/include/pcb.h head/sys/arm64/include/reg.h Modified: head/sys/arm64/arm64/debug_monitor.c ============================================================================== --- head/sys/arm64/arm64/debug_monitor.c Sun Nov 3 14:36:16 2019 (r354284) +++ head/sys/arm64/arm64/debug_monitor.c Sun Nov 3 15:42:08 2019 (r354285) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -59,6 +60,10 @@ static struct debug_monitor_state kernel_monitor = { .dbg_flags = DBGMON_KERNEL }; +/* Called from the exception handlers */ +void dbg_monitor_enter(struct thread *); +void dbg_monitor_exit(struct thread *, struct trapframe *); + /* Watchpoints/breakpoints control register bitfields */ #define DBG_WATCH_CTRL_LEN_1 (0x1 << 5) #define DBG_WATCH_CTRL_LEN_2 (0x3 << 5) @@ -496,4 +501,58 @@ dbg_monitor_init(void) } dbg_enable(); +} + +void +dbg_monitor_enter(struct thread *thread) +{ + int i; + + if ((kernel_monitor.dbg_flags & DBGMON_ENABLED) != 0) { + /* Install the kernel version of the registers */ + dbg_register_sync(&kernel_monitor); + } else if ((thread->td_pcb->pcb_dbg_regs.dbg_flags & DBGMON_ENABLED) != 0) { + /* Disable the user breakpoints until we return to userspace */ + for (i = 0; i < dbg_watchpoint_num; i++) { + dbg_wb_write_reg(DBG_REG_BASE_WCR, i, 0); + dbg_wb_write_reg(DBG_REG_BASE_WVR, i, 0); + } + + for (i = 0; i < dbg_breakpoint_num; ++i) { + dbg_wb_write_reg(DBG_REG_BASE_BCR, i, 0); + dbg_wb_write_reg(DBG_REG_BASE_BVR, i, 0); + } + WRITE_SPECIALREG(mdscr_el1, + READ_SPECIALREG(mdscr_el1) & + ~(DBG_MDSCR_MDE | DBG_MDSCR_KDE)); + isb(); + } +} + +void +dbg_monitor_exit(struct thread *thread, struct trapframe *frame) +{ + int i; + + frame->tf_spsr |= PSR_D; + if ((thread->td_pcb->pcb_dbg_regs.dbg_flags & DBGMON_ENABLED) != 0) { + /* Install the kernel version of the registers */ + dbg_register_sync(&thread->td_pcb->pcb_dbg_regs); + frame->tf_spsr &= ~PSR_D; + } else if ((kernel_monitor.dbg_flags & DBGMON_ENABLED) != 0) { + /* Disable the user breakpoints until we return to userspace */ + for (i = 0; i < dbg_watchpoint_num; i++) { + dbg_wb_write_reg(DBG_REG_BASE_WCR, i, 0); + dbg_wb_write_reg(DBG_REG_BASE_WVR, i, 0); + } + + for (i = 0; i < dbg_breakpoint_num; ++i) { + dbg_wb_write_reg(DBG_REG_BASE_BCR, i, 0); + dbg_wb_write_reg(DBG_REG_BASE_BVR, i, 0); + } + WRITE_SPECIALREG(mdscr_el1, + READ_SPECIALREG(mdscr_el1) & + ~(DBG_MDSCR_MDE | DBG_MDSCR_KDE)); + isb(); + } } Modified: head/sys/arm64/arm64/exception.S ============================================================================== --- head/sys/arm64/arm64/exception.S Sun Nov 3 14:36:16 2019 (r354284) +++ head/sys/arm64/arm64/exception.S Sun Nov 3 15:42:08 2019 (r354285) @@ -73,6 +73,9 @@ __FBSDID("$FreeBSD$"); mov w0, #1 blr x1 1: + + ldr x0, [x18, #(PC_CURTHREAD)] + bl dbg_monitor_enter .endif msr daifclr, #8 /* Enable the debug exception */ .endm @@ -87,6 +90,10 @@ __FBSDID("$FreeBSD$"); msr daifset, #10 .endif .if \el == 0 + ldr x0, [x18, #PC_CURTHREAD] + mov x1, sp + bl dbg_monitor_exit + /* Remove the SSBD (CVE-2018-3639) workaround if needed */ ldr x1, [x18, #PC_SSBD] cbz x1, 1f Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Sun Nov 3 14:36:16 2019 (r354284) +++ head/sys/arm64/arm64/identcpu.c Sun Nov 3 15:42:08 2019 (r354285) @@ -320,7 +320,7 @@ static struct mrs_field id_aa64dfr0_fields[] = { MRS_FIELD(ID_AA64DFR0, CTX_CMPs, false, MRS_EXACT, id_aa64dfr0_ctx_cmps), MRS_FIELD(ID_AA64DFR0, WRPs, false, MRS_EXACT, id_aa64dfr0_wrps), - MRS_FIELD(ID_AA64DFR0, BRPs, false, MRS_EXACT, id_aa64dfr0_brps), + MRS_FIELD(ID_AA64DFR0, BRPs, false, MRS_LOWER, id_aa64dfr0_brps), MRS_FIELD(ID_AA64DFR0, PMUVer, false, MRS_EXACT, id_aa64dfr0_pmuver), MRS_FIELD(ID_AA64DFR0, TraceVer, false, MRS_EXACT, id_aa64dfr0_tracever), Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Sun Nov 3 14:36:16 2019 (r354284) +++ head/sys/arm64/arm64/machdep.c Sun Nov 3 15:42:08 2019 (r354285) @@ -281,17 +281,60 @@ set_fpregs(struct thread *td, struct fpreg *regs) int fill_dbregs(struct thread *td, struct dbreg *regs) { + struct debug_monitor_state *monitor; + int count, i; + uint8_t debug_ver, nbkpts; - printf("ARM64TODO: fill_dbregs"); - return (EDOOFUS); + memset(regs, 0, sizeof(*regs)); + + extract_user_id_field(ID_AA64DFR0_EL1, ID_AA64DFR0_DebugVer_SHIFT, + &debug_ver); + extract_user_id_field(ID_AA64DFR0_EL1, ID_AA64DFR0_BRPs_SHIFT, + &nbkpts); + + /* + * The BRPs field contains the number of breakpoints - 1. Armv8-A + * allows the hardware to provide 2-16 breakpoints so this won't + * overflow an 8 bit value. + */ + count = nbkpts + 1; + + regs->db_info = debug_ver; + regs->db_info <<= 8; + regs->db_info |= count; + + monitor = &td->td_pcb->pcb_dbg_regs; + if ((monitor->dbg_flags & DBGMON_ENABLED) != 0) { + for (i = 0; i < count; i++) { + regs->db_regs[i].dbr_addr = monitor->dbg_bvr[i]; + regs->db_regs[i].dbr_ctrl = monitor->dbg_bcr[i]; + } + } + + return (0); } int set_dbregs(struct thread *td, struct dbreg *regs) { + struct debug_monitor_state *monitor; + int count; + int i; - printf("ARM64TODO: set_dbregs"); - return (EDOOFUS); + monitor = &td->td_pcb->pcb_dbg_regs; + count = 0; + monitor->dbg_enable_count = 0; + for (i = 0; i < DBG_BRP_MAX; i++) { + /* TODO: Check these values */ + monitor->dbg_bvr[i] = regs->db_regs[i].dbr_addr; + monitor->dbg_bcr[i] = regs->db_regs[i].dbr_ctrl; + if ((monitor->dbg_bcr[i] & 1) != 0) + monitor->dbg_enable_count++; + } + if (monitor->dbg_enable_count > 0) + monitor->dbg_flags |= DBGMON_ENABLED; + + return (0); } #ifdef COMPAT_FREEBSD32 Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Sun Nov 3 14:36:16 2019 (r354284) +++ head/sys/arm64/arm64/trap.c Sun Nov 3 15:42:08 2019 (r354285) @@ -482,6 +482,7 @@ do_el0_sync(struct thread *td, struct trapframe *frame call_trapsignal(td, SIGBUS, BUS_ADRALN, (void *)frame->tf_elr); userret(td, frame); break; + case EXCP_BRKPT_EL0: case EXCP_BRK: call_trapsignal(td, SIGTRAP, TRAP_BRKPT, (void *)frame->tf_elr); userret(td, frame); Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Sun Nov 3 14:36:16 2019 (r354284) +++ head/sys/arm64/include/armreg.h Sun Nov 3 15:42:08 2019 (r354285) @@ -163,6 +163,7 @@ #define EXCP_SP_ALIGN 0x26 /* SP slignment fault */ #define EXCP_TRAP_FP 0x2c /* Trapped FP exception */ #define EXCP_SERROR 0x2f /* SError interrupt */ +#define EXCP_BRKPT_EL0 0x30 /* Hardware breakpoint, from same EL */ #define EXCP_SOFTSTP_EL0 0x32 /* Software Step, from lower EL */ #define EXCP_SOFTSTP_EL1 0x33 /* Software Step, from same EL */ #define EXCP_WATCHPT_EL1 0x35 /* Watchpoint, from same EL */ Modified: head/sys/arm64/include/pcb.h ============================================================================== --- head/sys/arm64/include/pcb.h Sun Nov 3 14:36:16 2019 (r354284) +++ head/sys/arm64/include/pcb.h Sun Nov 3 15:42:08 2019 (r354285) @@ -31,6 +31,7 @@ #ifndef LOCORE +#include #include struct trapframe; @@ -66,6 +67,8 @@ struct pcb { * Place last to simplify the asm to access the rest if the struct. */ struct vfpstate pcb_fpustate; + + struct debug_monitor_state pcb_dbg_regs; }; #ifdef _KERNEL Modified: head/sys/arm64/include/reg.h ============================================================================== --- head/sys/arm64/include/reg.h Sun Nov 3 14:36:16 2019 (r354284) +++ head/sys/arm64/include/reg.h Sun Nov 3 15:42:08 2019 (r354285) @@ -60,7 +60,14 @@ struct fpreg32 { }; struct dbreg { - int dummy; + uint32_t db_info; + uint32_t db_pad; + + struct { + uint64_t dbr_addr; + uint32_t dbr_ctrl; + uint32_t dbr_pad; + } db_regs[16]; }; struct dbreg32 { From owner-svn-src-head@freebsd.org Sun Nov 3 17:42:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7385317DB71; Sun, 3 Nov 2019 17:42:50 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475jtx1Gt1z3CCt; Sun, 3 Nov 2019 17:42:48 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf1-f51.google.com with SMTP id y127so10532386lfc.0; Sun, 03 Nov 2019 09:42:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=e+zRV3ljPagJRtbpi2ebqnRMQNvzP6j1m6f5NKgYE6w=; b=ltJWTq0V6wK7mEv4Ctn563dvmU9RiPPrzGa2WtprEyiW9kRRaaEODv5ptEDKgkfkXW 4e3tflWB/oLMAseTubzGBLXC4c3NxHFwjktHxtyI9E52fxqeaMcOD3Vfnd7PWuJZ5n0m pUmson8XocnzA0UZ8ipaoGKQ1mfx/UHJZl71K1n4chLmQbxH25Q0yN+dz4fhrnH4ai+F zjTXcAiil2E+bafQH1/VwVhJghNi7vO44rfYRPMLeIECnJQQRRenUXoJxvrhFKiJqHx0 /cBSxTFBdA8h37LcopuX6VOsWYR9EaT6rnsKuTGJHAZUNotS/lVT7nKY9R817zpFadVP YsaQ== X-Gm-Message-State: APjAAAVupNVmcL5jcH9XPD+Cuzpb+2jd97k6P0C8pl+zFEmnMlQPLwPn lgCq8gsw/9WGZ8RHxu5tNI5YqSX65Xw= X-Google-Smtp-Source: APXvYqxYUD1IbydmcbAy3ru59n3jz8N4fZ37kVY4sVoWAa68km/sLt3QO483j8vnSjLnyoyfzTvAng== X-Received: by 2002:ac2:5496:: with SMTP id t22mr12079074lfk.31.1572802966896; Sun, 03 Nov 2019 09:42:46 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id 190sm7020196ljj.72.2019.11.03.09.42.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 03 Nov 2019 09:42:45 -0800 (PST) Subject: Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs To: Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201911031325.xA3DPl3B080386@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <276a3efd-da6c-69ca-cc4f-51c9a5b77696@FreeBSD.org> Date: Sun, 3 Nov 2019 19:42:45 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <201911031325.xA3DPl3B080386@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 475jtx1Gt1z3CCt X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.167.51 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-3.17 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-1.17)[ip: (-0.55), ipnet: 209.85.128.0/17(-3.20), asn: 15169(-2.03), country: US(-0.05)]; RCVD_IN_DNSWL_NONE(0.00)[51.167.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[51.167.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[96.151.72.93.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 17:42:50 -0000 On 03/11/2019 15:25, Toomas Soome wrote: > Author: tsoome > Date: Sun Nov 3 13:25:47 2019 > New Revision: 354283 > URL: https://svnweb.freebsd.org/changeset/base/354283 > > Log: > loader: we do not support booting from pool with log device > > If pool has log device, stop there and tell about it. Why? > Modified: > head/stand/libsa/zfs/zfs.c > head/stand/libsa/zfs/zfsimpl.c > head/sys/cddl/boot/zfs/zfsimpl.h -- Andriy Gapon From owner-svn-src-head@freebsd.org Sun Nov 3 17:45:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DE9A17DC36; Sun, 3 Nov 2019 17:45:34 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475jy60m2zz3CP3; Sun, 3 Nov 2019 17:45:34 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1ADFF6A4; Sun, 3 Nov 2019 17:45:33 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3HjXd6051384; Sun, 3 Nov 2019 17:45:33 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3HjVeV051369; Sun, 3 Nov 2019 17:45:31 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201911031745.xA3HjVeV051369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 3 Nov 2019 17:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354286 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 354286 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 17:45:34 -0000 Author: alc Date: Sun Nov 3 17:45:30 2019 New Revision: 354286 URL: https://svnweb.freebsd.org/changeset/base/354286 Log: Utilize ASIDs to reduce both the direct and indirect costs of context switching. The indirect costs being unnecessary TLB misses that are incurred when ASIDs are not used. In fact, currently, when we perform a context switch on one processor, we issue a broadcast TLB invalidation that flushes the TLB contents on every processor. Mark all user-space ("ttbr0") page table entries with the non-global flag so that they are cached in the TLB under their ASID. Correct an error in pmap_pinit0(). The pointer to the root of the page table was being initialized to the root of the kernel-space page table rather than a user-space page table. However, the root of the page table that was being cached in process 0's md_l0addr field correctly pointed to a user-space page table. As long as ASIDs weren't being used, this was harmless, except that it led to some unnecessary page table switches in pmap_switch(). Specifically, other kernel processes besides process 0 would have their md_l0addr field set to the root of the kernel-space page table, and so pmap_switch() would actually change page tables when switching between process 0 and other kernel processes. Implement a workaround for Cavium erratum 27456 affecting ThunderX machines. (I would like to thank andrew@ for providing the code to detect the affected machines.) Address integer overflow in the definition of TCR_ASID_16. Setup TCR according to the PARange and ASIDBits fields from ID_AA64MMFR0_EL1. Previously, TCR_ASID_16 was unconditionally set. Modify build_l1_block_pagetable so that lower attributes, such as ATTR_nG, can be specified as a parameter. Eliminate some unused code. Earlier versions were tested to varying degrees by: andrew, emaste, markj MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D21922 Modified: head/sys/arm64/arm64/cpu_errata.c head/sys/arm64/arm64/cpufunc_asm.S head/sys/arm64/arm64/efirt_machdep.c head/sys/arm64/arm64/genassym.c head/sys/arm64/arm64/locore.S head/sys/arm64/arm64/machdep.c head/sys/arm64/arm64/mp_machdep.c head/sys/arm64/arm64/pmap.c head/sys/arm64/arm64/vm_machdep.c head/sys/arm64/include/armreg.h head/sys/arm64/include/cpufunc.h head/sys/arm64/include/pcpu.h head/sys/arm64/include/pmap.h head/sys/arm64/include/proc.h Modified: head/sys/arm64/arm64/cpu_errata.c ============================================================================== --- head/sys/arm64/arm64/cpu_errata.c Sun Nov 3 15:42:08 2019 (r354285) +++ head/sys/arm64/arm64/cpu_errata.c Sun Nov 3 17:45:30 2019 (r354286) @@ -59,6 +59,7 @@ static enum { static cpu_quirk_install install_psci_bp_hardening; static cpu_quirk_install install_ssbd_workaround; +static cpu_quirk_install install_thunderx_bcast_tlbi_workaround; static struct cpu_quirks cpu_quirks[] = { { @@ -92,6 +93,18 @@ static struct cpu_quirks cpu_quirks[] = { .midr_value = 0, .quirk_install = install_ssbd_workaround, }, + { + .midr_mask = CPU_IMPL_MASK | CPU_PART_MASK, + .midr_value = + CPU_ID_RAW(CPU_IMPL_CAVIUM, CPU_PART_THUNDERX, 0, 0), + .quirk_install = install_thunderx_bcast_tlbi_workaround, + }, + { + .midr_mask = CPU_IMPL_MASK | CPU_PART_MASK, + .midr_value = + CPU_ID_RAW(CPU_IMPL_CAVIUM, CPU_PART_THUNDERX_81XX, 0, 0), + .quirk_install = install_thunderx_bcast_tlbi_workaround, + }, }; static void @@ -135,6 +148,30 @@ install_ssbd_workaround(void) default: PCPU_SET(ssbd, smccc_arch_workaround_2); break; + } +} + +/* + * Workaround Cavium erratum 27456. + * + * Invalidate the local icache when changing address spaces. + */ +static void +install_thunderx_bcast_tlbi_workaround(void) +{ + u_int midr; + + midr = get_midr(); + if (CPU_PART(midr) == CPU_PART_THUNDERX_81XX) + PCPU_SET(bcast_tlbi_workaround, 1); + else if (CPU_PART(midr) == CPU_PART_THUNDERX) { + if (CPU_VAR(midr) == 0) { + /* ThunderX 1.x */ + PCPU_SET(bcast_tlbi_workaround, 1); + } else if (CPU_VAR(midr) == 1 && CPU_REV(midr) <= 1) { + /* ThunderX 2.0 - 2.1 */ + PCPU_SET(bcast_tlbi_workaround, 1); + } } } Modified: head/sys/arm64/arm64/cpufunc_asm.S ============================================================================== --- head/sys/arm64/arm64/cpufunc_asm.S Sun Nov 3 15:42:08 2019 (r354285) +++ head/sys/arm64/arm64/cpufunc_asm.S Sun Nov 3 17:45:30 2019 (r354286) @@ -93,14 +93,6 @@ END(arm64_nullop) * Generic functions to read/modify/write the internal coprocessor registers */ -ENTRY(arm64_setttb) - dsb ish - msr ttbr0_el1, x0 - dsb ish - isb - ret -END(arm64_setttb) - ENTRY(arm64_tlb_flushID) dsb ishst #ifdef SMP Modified: head/sys/arm64/arm64/efirt_machdep.c ============================================================================== --- head/sys/arm64/arm64/efirt_machdep.c Sun Nov 3 15:42:08 2019 (r354285) +++ head/sys/arm64/arm64/efirt_machdep.c Sun Nov 3 17:45:30 2019 (r354286) @@ -62,9 +62,9 @@ __FBSDID("$FreeBSD$"); #include static vm_object_t obj_1t1_pt; -static vm_page_t efi_l0_page; -static pd_entry_t *efi_l0; static vm_pindex_t efi_1t1_idx; +static pd_entry_t *efi_l0; +static uint64_t efi_ttbr0; void efi_destroy_1t1_map(void) @@ -81,8 +81,9 @@ efi_destroy_1t1_map(void) } obj_1t1_pt = NULL; + efi_1t1_idx = 0; efi_l0 = NULL; - efi_l0_page = NULL; + efi_ttbr0 = 0; } static vm_page_t @@ -164,6 +165,7 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int struct efi_md *p; pt_entry_t *l3, l3_attr; vm_offset_t va; + vm_page_t efi_l0_page; uint64_t idx; int i, mode; @@ -172,10 +174,11 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int L0_ENTRIES * Ln_ENTRIES * Ln_ENTRIES * Ln_ENTRIES, VM_PROT_ALL, 0, NULL); VM_OBJECT_WLOCK(obj_1t1_pt); - efi_1t1_idx = 0; efi_l0_page = efi_1t1_page(); VM_OBJECT_WUNLOCK(obj_1t1_pt); efi_l0 = (pd_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(efi_l0_page)); + efi_ttbr0 = ASID_TO_OPERAND(ASID_RESERVED_FOR_EFI) | + VM_PAGE_TO_PHYS(efi_l0_page); for (i = 0, p = map; i < ndesc; i++, p = efi_next_descriptor(p, descsz)) { @@ -213,7 +216,7 @@ efi_create_1t1_map(struct efi_md *map, int ndesc, int printf("MAP %lx mode %x pages %lu\n", p->md_phys, mode, p->md_pages); l3_attr = ATTR_DEFAULT | ATTR_IDX(mode) | ATTR_AP(ATTR_AP_RW) | - L3_PAGE; + ATTR_nG | L3_PAGE; if (mode == VM_MEMATTR_DEVICE || p->md_attr & EFI_MD_ATTR_XP) l3_attr |= ATTR_UXN | ATTR_PXN; @@ -236,42 +239,37 @@ int efi_arch_enter(void) { - __asm __volatile( - "msr ttbr0_el1, %0 \n" - "isb \n" - "dsb ishst \n" - "tlbi vmalle1is \n" - "dsb ish \n" - "isb \n" - : : "r"(VM_PAGE_TO_PHYS(efi_l0_page))); + CRITICAL_ASSERT(curthread); + /* + * Temporarily switch to EFI's page table. However, we leave curpmap + * unchanged in order to prevent its ASID from being reclaimed before + * we switch back to its page table in efi_arch_leave(). + */ + set_ttbr0(efi_ttbr0); + if (PCPU_GET(bcast_tlbi_workaround) != 0) + invalidate_local_icache(); + return (0); } void efi_arch_leave(void) { - struct thread *td; /* * Restore the pcpu pointer. Some UEFI implementations trash it and * we don't store it before calling into them. To fix this we need * to restore it after returning to the kernel context. As reading - * curthread will access x18 we need to restore it before loading - * the thread pointer. + * curpmap will access x18 we need to restore it before loading + * the pmap pointer. */ __asm __volatile( "mrs x18, tpidr_el1 \n" ); - td = curthread; - __asm __volatile( - "msr ttbr0_el1, %0 \n" - "isb \n" - "dsb ishst \n" - "tlbi vmalle1is \n" - "dsb ish \n" - "isb \n" - : : "r"(td->td_proc->p_md.md_l0addr)); + set_ttbr0(pmap_to_ttbr0(PCPU_GET(curpmap))); + if (PCPU_GET(bcast_tlbi_workaround) != 0) + invalidate_local_icache(); } int Modified: head/sys/arm64/arm64/genassym.c ============================================================================== --- head/sys/arm64/arm64/genassym.c Sun Nov 3 15:42:08 2019 (r354285) +++ head/sys/arm64/arm64/genassym.c Sun Nov 3 17:45:30 2019 (r354286) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include ASSYM(TDF_ASTPENDING, TDF_ASTPENDING); ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED); @@ -53,9 +52,6 @@ ASSYM(PCB_SP, offsetof(struct pcb, pcb_sp)); ASSYM(PCB_TPIDRRO, offsetof(struct pcb, pcb_tpidrro_el0)); ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); ASSYM(PCB_FLAGS, offsetof(struct pcb, pcb_flags)); - -ASSYM(P_MD, offsetof(struct proc, p_md)); -ASSYM(MD_L0ADDR, offsetof(struct mdproc, md_l0addr)); ASSYM(SF_UC, offsetof(struct sigframe, sf_uc)); Modified: head/sys/arm64/arm64/locore.S ============================================================================== --- head/sys/arm64/arm64/locore.S Sun Nov 3 15:42:08 2019 (r354285) +++ head/sys/arm64/arm64/locore.S Sun Nov 3 17:45:30 2019 (r354286) @@ -392,14 +392,15 @@ create_pagetables: bl link_l0_pagetable /* - * Build the TTBR0 maps. + * Build the TTBR0 maps. As TTBR0 maps, they must specify ATTR_nG. + * They are only needed early on, so the VA = PA map is uncached. */ add x27, x24, #PAGE_SIZE mov x6, x27 /* The initial page table */ #if defined(SOCDEV_PA) && defined(SOCDEV_VA) /* Create a table for the UART */ - mov x7, #DEVICE_MEM + mov x7, #(ATTR_nG | ATTR_IDX(DEVICE_MEM)) mov x8, #(SOCDEV_VA) /* VA start */ mov x9, #(SOCDEV_PA) /* PA start */ mov x10, #1 @@ -407,7 +408,7 @@ create_pagetables: #endif /* Create the VA = PA map */ - mov x7, #NORMAL_UNCACHED /* Uncached as it's only needed early on */ + mov x7, #(ATTR_nG | ATTR_IDX(NORMAL_UNCACHED)) mov x9, x27 mov x8, x9 /* VA start (== PA start) */ mov x10, #1 @@ -497,7 +498,7 @@ link_l1_pagetable: /* * Builds count 1 GiB page table entry * x6 = L1 table - * x7 = Type (0 = Device, 1 = Normal) + * x7 = Variable lower block attributes * x8 = VA start * x9 = PA start (trashed) * x10 = Entry count @@ -512,8 +513,7 @@ build_l1_block_pagetable: and x11, x11, #Ln_ADDR_MASK /* Build the L1 block entry */ - lsl x12, x7, #2 - orr x12, x12, #L1_BLOCK + orr x12, x7, #L1_BLOCK orr x12, x12, #(ATTR_AF) #ifdef SMP orr x12, x12, ATTR_SH(ATTR_SH_IS) @@ -599,11 +599,17 @@ start_mmu: msr mair_el1, x2 /* - * Setup TCR according to PARange bits from ID_AA64MMFR0_EL1. + * Setup TCR according to the PARange and ASIDBits fields + * from ID_AA64MMFR0_EL1. More precisely, set TCR_EL1.AS + * to 1 only if the ASIDBits field equals 0b0010. */ ldr x2, tcr mrs x3, id_aa64mmfr0_el1 bfi x2, x3, #32, #3 + and x3, x3, #0xF0 + cmp x3, #0x20 + cset x3, eq + bfi x2, x3, #36, #1 msr tcr_el1, x2 /* Setup SCTLR */ @@ -624,7 +630,7 @@ mair: MAIR_ATTR(MAIR_NORMAL_WB, 2) | \ MAIR_ATTR(MAIR_NORMAL_WT, 3) tcr: - .quad (TCR_TxSZ(64 - VIRT_BITS) | TCR_ASID_16 | TCR_TG1_4K | \ + .quad (TCR_TxSZ(64 - VIRT_BITS) | TCR_TG1_4K | \ TCR_CACHE_ATTRS | TCR_SMP_ATTRS) sctlr_set: /* Bits to set */ Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Sun Nov 3 15:42:08 2019 (r354285) +++ head/sys/arm64/arm64/machdep.c Sun Nov 3 17:45:30 2019 (r354286) @@ -797,9 +797,6 @@ init_proc0(vm_offset_t kstack) thread0.td_pcb->pcb_vfpcpu = UINT_MAX; thread0.td_frame = &proc0_tf; pcpup->pc_curpcb = thread0.td_pcb; - - /* Set the base address of translation table 0. */ - thread0.td_proc->p_md.md_l0addr = READ_SPECIALREG(ttbr0_el1); } typedef struct { Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Sun Nov 3 15:42:08 2019 (r354285) +++ head/sys/arm64/arm64/mp_machdep.c Sun Nov 3 17:45:30 2019 (r354286) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -192,6 +193,7 @@ void init_secondary(uint64_t cpu) { struct pcpu *pcpup; + pmap_t pmap0; pcpup = &__pcpu[cpu]; /* @@ -210,6 +212,12 @@ init_secondary(uint64_t cpu) KASSERT(PCPU_GET(idlethread) != NULL, ("no idle thread")); pcpup->pc_curthread = pcpup->pc_idlethread; pcpup->pc_curpcb = pcpup->pc_idlethread->td_pcb; + + /* Initialize curpmap to match TTBR0's current setting. */ + pmap0 = vmspace_pmap(&vmspace0); + KASSERT(pmap_to_ttbr0(pmap0) == READ_SPECIALREG(ttbr0_el1), + ("pmap0 doesn't match cpu %ld's ttbr0", cpu)); + pcpup->pc_curpmap = pmap0; /* * Identify current CPU. This is necessary to setup Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Sun Nov 3 15:42:08 2019 (r354285) +++ head/sys/arm64/arm64/pmap.c Sun Nov 3 17:45:30 2019 (r354286) @@ -113,6 +113,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -276,6 +277,48 @@ static u_int physmap_idx; static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); +/* + * This ASID allocator uses a bit vector ("asid_set") to remember which ASIDs + * that it has currently allocated to a pmap, a cursor ("asid_next") to + * optimize its search for a free ASID in the bit vector, and an epoch number + * ("asid_epoch") to indicate when it has reclaimed all previously allocated + * ASIDs that are not currently active on a processor. + * + * The current epoch number is always in the range [0, INT_MAX). Negative + * numbers and INT_MAX are reserved for special cases that are described + * below. + */ +static SYSCTL_NODE(_vm_pmap, OID_AUTO, asid, CTLFLAG_RD, 0, "ASID allocator"); +static int asid_bits; +SYSCTL_INT(_vm_pmap_asid, OID_AUTO, bits, CTLFLAG_RD, &asid_bits, 0, + "The number of bits in an ASID"); +static bitstr_t *asid_set; +static int asid_set_size; +static int asid_next; +SYSCTL_INT(_vm_pmap_asid, OID_AUTO, next, CTLFLAG_RD, &asid_next, 0, + "The last allocated ASID plus one"); +static int asid_epoch; +SYSCTL_INT(_vm_pmap_asid, OID_AUTO, epoch, CTLFLAG_RD, &asid_epoch, 0, + "The current epoch number"); +static struct mtx asid_set_mutex; + +/* + * A pmap's cookie encodes an ASID and epoch number. Cookies for reserved + * ASIDs have a negative epoch number, specifically, INT_MIN. Cookies for + * dynamically allocated ASIDs have a non-negative epoch number. + * + * An invalid ASID is represented by -1. + * + * There are two special-case cookie values: (1) COOKIE_FROM(-1, INT_MIN), + * which indicates that an ASID should never be allocated to the pmap, and + * (2) COOKIE_FROM(-1, INT_MAX), which indicates that an ASID should be + * allocated when the pmap is next activated. + */ +#define COOKIE_FROM(asid, epoch) ((long)((u_int)(asid) | \ + ((u_long)(epoch) << 32))) +#define COOKIE_TO_ASID(cookie) ((int)(cookie)) +#define COOKIE_TO_EPOCH(cookie) ((int)((u_long)(cookie) >> 32)) + static int superpages_enabled = 1; SYSCTL_INT(_vm_pmap, OID_AUTO, superpages_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &superpages_enabled, 0, @@ -295,6 +338,8 @@ static void pmap_pvh_free(struct md_page *pvh, pmap_t static pv_entry_t pmap_pvh_remove(struct md_page *pvh, pmap_t pmap, vm_offset_t va); +static bool pmap_activate_int(pmap_t pmap); +static void pmap_alloc_asid(pmap_t pmap); static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode); static pt_entry_t *pmap_demote_l1(pmap_t pmap, pt_entry_t *l1, vm_offset_t va); static pt_entry_t *pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, @@ -308,6 +353,7 @@ static int pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, pd_entry_t l1e, struct spglist *free, struct rwlock **lockp); static int pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t sva, pd_entry_t l2e, struct spglist *free, struct rwlock **lockp); +static void pmap_reset_asid_set(void); static boolean_t pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va, vm_page_t m, struct rwlock **lockp); @@ -786,6 +832,10 @@ pmap_bootstrap(vm_offset_t l0pt, vm_offset_t l1pt, vm_ uint64_t kern_delta; int i; + /* Verify that the ASID is set through TTBR0. */ + KASSERT((READ_SPECIALREG(tcr_el1) & TCR_A1) == 0, + ("pmap_bootstrap: TCR_EL1.A1 != 0")); + kern_delta = KERNBASE - kernstart; printf("pmap_bootstrap %lx %lx %lx\n", l1pt, kernstart, kernlen); @@ -795,6 +845,8 @@ pmap_bootstrap(vm_offset_t l0pt, vm_offset_t l1pt, vm_ /* Set this early so we can use the pagetable walking functions */ kernel_pmap_store.pm_l0 = (pd_entry_t *)l0pt; PMAP_LOCK_INIT(kernel_pmap); + kernel_pmap->pm_l0_paddr = l0pt - kern_delta; + kernel_pmap->pm_cookie = COOKIE_FROM(-1, INT_MIN); /* Assume the address we were loaded to is a valid physical address */ min_pa = KERNBASE - kern_delta; @@ -908,6 +960,11 @@ pmap_init(void) int i, pv_npg; /* + * Determine whether an ASID is 8 or 16 bits in size. + */ + asid_bits = (READ_SPECIALREG(tcr_el1) & TCR_ASID_16) != 0 ? 16 : 8; + + /* * Are large page mappings enabled? */ TUNABLE_INT_FETCH("vm.pmap.superpages_enabled", &superpages_enabled); @@ -918,6 +975,18 @@ pmap_init(void) } /* + * Initialize the ASID allocator. At this point, we are still too + * early in the overall initialization process to use bit_alloc(). + */ + asid_set_size = 1 << asid_bits; + asid_set = (bitstr_t *)kmem_malloc(bitstr_size(asid_set_size), + M_WAITOK | M_ZERO); + for (i = 0; i < ASID_FIRST_AVAILABLE; i++) + bit_set(asid_set, i); + asid_next = ASID_FIRST_AVAILABLE; + mtx_init(&asid_set_mutex, "asid set", NULL, MTX_SPIN); + + /* * Initialize the pv chunk list mutex. */ mtx_init(&pv_chunks_mutex, "pmap pv chunk list", NULL, MTX_DEF); @@ -971,30 +1040,42 @@ SYSCTL_ULONG(_vm_pmap_l2, OID_AUTO, promotions, CTLFLA static __inline void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { + uint64_t r; sched_pin(); - __asm __volatile( - "dsb ishst \n" - "tlbi vaae1is, %0 \n" - "dsb ish \n" - "isb \n" - : : "r"(va >> PAGE_SHIFT)); + dsb(ishst); + if (pmap == kernel_pmap) { + r = atop(va); + __asm __volatile("tlbi vaae1is, %0" : : "r" (r)); + } else { + r = ASID_TO_OPERAND(COOKIE_TO_ASID(pmap->pm_cookie)) | atop(va); + __asm __volatile("tlbi vae1is, %0" : : "r" (r)); + } + dsb(ish); + isb(); sched_unpin(); } static __inline void pmap_invalidate_range_nopin(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { - vm_offset_t addr; + uint64_t end, r, start; dsb(ishst); - for (addr = sva; addr < eva; addr += PAGE_SIZE) { - __asm __volatile( - "tlbi vaae1is, %0" : : "r"(addr >> PAGE_SHIFT)); + if (pmap == kernel_pmap) { + start = atop(sva); + end = atop(eva); + for (r = start; r < end; r++) + __asm __volatile("tlbi vaae1is, %0" : : "r" (r)); + } else { + start = end = ASID_TO_OPERAND(COOKIE_TO_ASID(pmap->pm_cookie)); + start |= atop(sva); + end |= atop(eva); + for (r = start; r < end; r++) + __asm __volatile("tlbi vae1is, %0" : : "r" (r)); } - __asm __volatile( - "dsb ish \n" - "isb \n"); + dsb(ish); + isb(); } static __inline void @@ -1009,13 +1090,18 @@ pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm static __inline void pmap_invalidate_all(pmap_t pmap) { + uint64_t r; sched_pin(); - __asm __volatile( - "dsb ishst \n" - "tlbi vmalle1is \n" - "dsb ish \n" - "isb \n"); + dsb(ishst); + if (pmap == kernel_pmap) { + __asm __volatile("tlbi vmalle1is"); + } else { + r = ASID_TO_OPERAND(COOKIE_TO_ASID(pmap->pm_cookie)); + __asm __volatile("tlbi aside1is, %0" : : "r" (r)); + } + dsb(ish); + isb(); sched_unpin(); } @@ -1446,14 +1532,17 @@ pmap_pinit0(pmap_t pmap) PMAP_LOCK_INIT(pmap); bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); - pmap->pm_l0 = kernel_pmap->pm_l0; + pmap->pm_l0_paddr = READ_SPECIALREG(ttbr0_el1); + pmap->pm_l0 = (pd_entry_t *)PHYS_TO_DMAP(pmap->pm_l0_paddr); pmap->pm_root.rt_root = 0; + pmap->pm_cookie = COOKIE_FROM(ASID_RESERVED_FOR_PID_0, INT_MIN); + + PCPU_SET(curpmap, pmap); } int pmap_pinit(pmap_t pmap) { - vm_paddr_t l0phys; vm_page_t l0pt; /* @@ -1463,14 +1552,15 @@ pmap_pinit(pmap_t pmap) VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) vm_wait(NULL); - l0phys = VM_PAGE_TO_PHYS(l0pt); - pmap->pm_l0 = (pd_entry_t *)PHYS_TO_DMAP(l0phys); + pmap->pm_l0_paddr = VM_PAGE_TO_PHYS(l0pt); + pmap->pm_l0 = (pd_entry_t *)PHYS_TO_DMAP(pmap->pm_l0_paddr); if ((l0pt->flags & PG_ZERO) == 0) pagezero(pmap->pm_l0); pmap->pm_root.rt_root = 0; bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); + pmap->pm_cookie = COOKIE_FROM(-1, INT_MAX); return (1); } @@ -1712,6 +1802,7 @@ void pmap_release(pmap_t pmap) { vm_page_t m; + int asid; KASSERT(pmap->pm_stats.resident_count == 0, ("pmap_release: pmap resident count %ld != 0", @@ -1719,8 +1810,16 @@ pmap_release(pmap_t pmap) KASSERT(vm_radix_is_empty(&pmap->pm_root), ("pmap_release: pmap has reserved page table page(s)")); - m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_l0)); + mtx_lock_spin(&asid_set_mutex); + if (COOKIE_TO_EPOCH(pmap->pm_cookie) == asid_epoch) { + asid = COOKIE_TO_ASID(pmap->pm_cookie); + KASSERT(asid >= ASID_FIRST_AVAILABLE && asid < asid_set_size, + ("pmap_release: pmap cookie has out-of-range asid")); + bit_clear(asid_set, asid); + } + mtx_unlock_spin(&asid_set_mutex); + m = PHYS_TO_VM_PAGE(pmap->pm_l0_paddr); vm_page_unwire_noq(m); vm_page_free_zero(m); } @@ -3198,6 +3297,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v new_l3 |= ATTR_AP(ATTR_AP_USER) | ATTR_PXN; else new_l3 |= ATTR_UXN; + if (pmap != kernel_pmap) + new_l3 |= ATTR_nG; if ((m->oflags & VPO_UNMANAGED) == 0) { new_l3 |= ATTR_SW_MANAGED; if ((prot & VM_PROT_WRITE) != 0) { @@ -3462,6 +3563,8 @@ pmap_enter_2mpage(pmap_t pmap, vm_offset_t va, vm_page new_l2 |= ATTR_AP(ATTR_AP_USER) | ATTR_PXN; else new_l2 |= ATTR_UXN; + if (pmap != kernel_pmap) + new_l2 |= ATTR_nG; return (pmap_enter_l2(pmap, va, new_l2, PMAP_ENTER_NOSLEEP | PMAP_ENTER_NOREPLACE | PMAP_ENTER_NORECLAIM, NULL, lockp) == KERN_SUCCESS); @@ -3762,6 +3865,8 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v l3_val |= ATTR_AP(ATTR_AP_USER) | ATTR_PXN; else l3_val |= ATTR_UXN; + if (pmap != kernel_pmap) + l3_val |= ATTR_nG; /* * Now validate mapping with RO protection @@ -4299,6 +4404,8 @@ pmap_remove_pages(pmap_t pmap) int allfree, field, freed, idx, lvl; vm_paddr_t pa; + KASSERT(pmap == PCPU_GET(curpmap), ("non-current pmap %p", pmap)); + lock = NULL; SLIST_INIT(&free); @@ -5671,24 +5778,134 @@ pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t return (val); } +/* + * Garbage collect every ASID that is neither active on a processor nor + * reserved. + */ +static void +pmap_reset_asid_set(void) +{ + pmap_t pmap; + int asid, cpuid, epoch; + + mtx_assert(&asid_set_mutex, MA_OWNED); + + /* + * Ensure that the store to asid_epoch is globally visible before the + * loads from pc_curpmap are performed. + */ + epoch = asid_epoch + 1; + if (epoch == INT_MAX) + epoch = 0; + asid_epoch = epoch; + dsb(ishst); + __asm __volatile("tlbi vmalle1is"); + dsb(ish); + bit_nclear(asid_set, ASID_FIRST_AVAILABLE, asid_set_size - 1); + CPU_FOREACH(cpuid) { + if (cpuid == curcpu) + continue; + pmap = pcpu_find(cpuid)->pc_curpmap; + asid = COOKIE_TO_ASID(pmap->pm_cookie); + if (asid == -1) + continue; + bit_set(asid_set, asid); + pmap->pm_cookie = COOKIE_FROM(asid, epoch); + } +} + +/* + * Allocate a new ASID for the specified pmap. + */ +static void +pmap_alloc_asid(pmap_t pmap) +{ + int new_asid; + + mtx_lock_spin(&asid_set_mutex); + + /* + * While this processor was waiting to acquire the asid set mutex, + * pmap_reset_asid_set() running on another processor might have + * updated this pmap's cookie to the current epoch. In which case, we + * don't need to allocate a new ASID. + */ + if (COOKIE_TO_EPOCH(pmap->pm_cookie) == asid_epoch) + goto out; + + bit_ffc_at(asid_set, asid_next, asid_set_size, &new_asid); + if (new_asid == -1) { + bit_ffc_at(asid_set, ASID_FIRST_AVAILABLE, asid_next, + &new_asid); + if (new_asid == -1) { + pmap_reset_asid_set(); + bit_ffc_at(asid_set, ASID_FIRST_AVAILABLE, + asid_set_size, &new_asid); + KASSERT(new_asid != -1, ("ASID allocation failure")); + } + } + bit_set(asid_set, new_asid); + asid_next = new_asid + 1; + pmap->pm_cookie = COOKIE_FROM(new_asid, asid_epoch); +out: + mtx_unlock_spin(&asid_set_mutex); +} + +/* + * Compute the value that should be stored in ttbr0 to activate the specified + * pmap. This value may change from time to time. + */ +uint64_t +pmap_to_ttbr0(pmap_t pmap) +{ + + return (ASID_TO_OPERAND(COOKIE_TO_ASID(pmap->pm_cookie)) | + pmap->pm_l0_paddr); +} + +static bool +pmap_activate_int(pmap_t pmap) +{ + int epoch; + + KASSERT(PCPU_GET(curpmap) != NULL, ("no active pmap")); + KASSERT(pmap != kernel_pmap, ("kernel pmap activation")); + if (pmap == PCPU_GET(curpmap)) + return (false); + + /* + * Ensure that the store to curpmap is globally visible before the + * load from asid_epoch is performed. + */ + PCPU_SET(curpmap, pmap); + dsb(ish); + epoch = COOKIE_TO_EPOCH(pmap->pm_cookie); + if (epoch >= 0 && epoch != asid_epoch) + pmap_alloc_asid(pmap); + + set_ttbr0(pmap_to_ttbr0(pmap)); + if (PCPU_GET(bcast_tlbi_workaround) != 0) + invalidate_local_icache(); + return (true); +} + void pmap_activate(struct thread *td) { pmap_t pmap; - critical_enter(); pmap = vmspace_pmap(td->td_proc->p_vmspace); - td->td_proc->p_md.md_l0addr = vtophys(pmap->pm_l0); - __asm __volatile( - "msr ttbr0_el1, %0 \n" - "isb \n" - : : "r"(td->td_proc->p_md.md_l0addr)); - pmap_invalidate_all(pmap); + critical_enter(); + (void)pmap_activate_int(pmap); critical_exit(); } +/* + * To eliminate the unused parameter "old", we would have to add an instruction + * to cpu_switch(). + */ struct pcb * -pmap_switch(struct thread *old, struct thread *new) +pmap_switch(struct thread *old __unused, struct thread *new) { pcpu_bp_harden bp_harden; struct pcb *pcb; @@ -5705,20 +5922,7 @@ pmap_switch(struct thread *old, struct thread *new) * to a user process. */ - if (old == NULL || - old->td_proc->p_md.md_l0addr != new->td_proc->p_md.md_l0addr) { - __asm __volatile( - /* Switch to the new pmap */ - "msr ttbr0_el1, %0 \n" - "isb \n" - - /* Invalidate the TLB */ - "dsb ishst \n" - "tlbi vmalle1is \n" - "dsb ish \n" - "isb \n" - : : "r"(new->td_proc->p_md.md_l0addr)); - + if (pmap_activate_int(vmspace_pmap(new->td_proc->p_vmspace))) { /* * Stop userspace from training the branch predictor against * other processes. This will call into a CPU specific Modified: head/sys/arm64/arm64/vm_machdep.c ============================================================================== --- head/sys/arm64/arm64/vm_machdep.c Sun Nov 3 15:42:08 2019 (r354285) +++ head/sys/arm64/arm64/vm_machdep.c Sun Nov 3 17:45:30 2019 (r354286) @@ -91,9 +91,6 @@ cpu_fork(struct thread *td1, struct proc *p2, struct t td2->td_pcb = pcb2; bcopy(td1->td_pcb, pcb2, sizeof(*pcb2)); - td2->td_proc->p_md.md_l0addr = - vtophys(vmspace_pmap(td2->td_proc->p_vmspace)->pm_l0); - tf = (struct trapframe *)STACKALIGN((struct trapframe *)pcb2 - 1); bcopy(td1->td_frame, tf, sizeof(*tf)); tf->tf_x[0] = 0; Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Sun Nov 3 15:42:08 2019 (r354285) +++ head/sys/arm64/include/armreg.h Sun Nov 3 17:45:30 2019 (r354286) @@ -619,7 +619,7 @@ #define PSR_FLAGS 0xf0000000 /* TCR_EL1 - Translation Control Register */ -#define TCR_ASID_16 (1 << 36) +#define TCR_ASID_16 (0x1UL << 36) #define TCR_IPS_SHIFT 32 #define TCR_IPS_32BIT (0 << TCR_IPS_SHIFT) @@ -640,6 +640,8 @@ #define TCR_ORGN1_WBWA (0x1UL << TCR_ORGN1_SHIFT) #define TCR_IRGN1_SHIFT 24 #define TCR_IRGN1_WBWA (0x1UL << TCR_IRGN1_SHIFT) +#define TCR_A1_SHIFT 22 +#define TCR_A1 (0x1UL << TCR_A1_SHIFT) #define TCR_SH0_SHIFT 12 #define TCR_SH0_IS (0x3UL << TCR_SH0_SHIFT) #define TCR_ORGN0_SHIFT 10 Modified: head/sys/arm64/include/cpufunc.h ============================================================================== --- head/sys/arm64/include/cpufunc.h Sun Nov 3 15:42:08 2019 (r354285) +++ head/sys/arm64/include/cpufunc.h Sun Nov 3 17:45:30 2019 (r354286) @@ -178,6 +178,27 @@ clrex(void) __asm __volatile("clrex" : : : "memory"); } +static __inline void +set_ttbr0(uint64_t ttbr0) +{ + + __asm __volatile( + "msr ttbr0_el1, %0 \n" + "isb \n" + : + : "r" (ttbr0)); +} + +static __inline void +invalidate_local_icache(void) +{ + + __asm __volatile( + "ic iallu \n" + "dsb nsh \n" + "isb \n"); +} + extern int64_t dcache_line_size; extern int64_t icache_line_size; extern int64_t idcache_line_size; @@ -185,7 +206,6 @@ extern int64_t dczva_line_size; #define cpu_nullop() arm64_nullop() #define cpufunc_nullop() arm64_nullop() -#define cpu_setttb(a) arm64_setttb(a) #define cpu_tlb_flushID() arm64_tlb_flushID() @@ -198,7 +218,6 @@ extern int64_t dczva_line_size; #define cpu_icache_sync_range_checked(a, s) arm64_icache_sync_range_checked((a), (s)) void arm64_nullop(void); -void arm64_setttb(vm_offset_t); void arm64_tlb_flushID(void); void arm64_icache_sync_range(vm_offset_t, vm_size_t); int arm64_icache_sync_range_checked(vm_offset_t, vm_size_t); Modified: head/sys/arm64/include/pcpu.h ============================================================================== --- head/sys/arm64/include/pcpu.h Sun Nov 3 15:42:08 2019 (r354285) +++ head/sys/arm64/include/pcpu.h Sun Nov 3 17:45:30 2019 (r354286) @@ -40,12 +40,14 @@ typedef int (*pcpu_ssbd)(int); struct debug_monitor_state; #define PCPU_MD_FIELDS \ - u_int pc_acpi_id; /* ACPI CPU id */ \ - u_int pc_midr; /* stored MIDR value */ \ + u_int pc_acpi_id; /* ACPI CPU id */ \ + u_int pc_midr; /* stored MIDR value */ \ uint64_t pc_clock; \ pcpu_bp_harden pc_bp_harden; \ pcpu_ssbd pc_ssbd; \ - char __pad[225] + struct pmap *pc_curpmap; \ + u_int pc_bcast_tlbi_workaround; \ + char __pad[213] #ifdef _KERNEL Modified: head/sys/arm64/include/pmap.h ============================================================================== --- head/sys/arm64/include/pmap.h Sun Nov 3 15:42:08 2019 (r354285) +++ head/sys/arm64/include/pmap.h Sun Nov 3 17:45:30 2019 (r354286) @@ -79,10 +79,12 @@ struct pv_addr { struct pmap { struct mtx pm_mtx; - struct pmap_statistics pm_stats; /* pmap statictics */ + struct pmap_statistics pm_stats; /* pmap statistics */ + vm_paddr_t pm_l0_paddr; pd_entry_t *pm_l0; TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */ struct vm_radix pm_root; /* spare page table pages */ + long pm_cookie; /* encodes the pmap's ASID */ }; typedef struct pmap *pmap_t; @@ -132,6 +134,15 @@ extern struct pmap kernel_pmap_store; #define PMAP_TRYLOCK(pmap) mtx_trylock(&(pmap)->pm_mtx) #define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx) +#define ASID_RESERVED_FOR_PID_0 0 +#define ASID_RESERVED_FOR_EFI 1 +#define ASID_FIRST_AVAILABLE (ASID_RESERVED_FOR_EFI + 1) +#define ASID_TO_OPERAND_SHIFT 48 +#define ASID_TO_OPERAND(asid) ({ \ + KASSERT((asid) != -1, ("invalid ASID")); \ + (uint64_t)(asid) << ASID_TO_OPERAND_SHIFT; \ +}) + extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; @@ -152,6 +163,7 @@ void pmap_kremove_device(vm_offset_t, vm_size_t); void *pmap_mapdev_attr(vm_offset_t pa, vm_size_t size, vm_memattr_t ma); bool pmap_page_is_mapped(vm_page_t m); bool pmap_ps_enabled(pmap_t pmap); +uint64_t pmap_to_ttbr0(pmap_t pmap); void *pmap_mapdev(vm_offset_t, vm_size_t); void *pmap_mapbios(vm_paddr_t, vm_size_t); Modified: head/sys/arm64/include/proc.h ============================================================================== --- head/sys/arm64/include/proc.h Sun Nov 3 15:42:08 2019 (r354285) +++ head/sys/arm64/include/proc.h Sun Nov 3 17:45:30 2019 (r354286) @@ -40,7 +40,7 @@ struct mdthread { }; struct mdproc { - vm_offset_t md_l0addr; + long md_dummy; }; #define KINFO_PROC_SIZE 1088 From owner-svn-src-head@freebsd.org Sun Nov 3 18:53:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 14A6017F6EF; Sun, 3 Nov 2019 18:53:43 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475lSk6pj7z3HGk; Sun, 3 Nov 2019 18:53:42 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD12E1832F; Sun, 3 Nov 2019 18:53:42 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3IrgDI092763; Sun, 3 Nov 2019 18:53:42 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3IrgIU092762; Sun, 3 Nov 2019 18:53:42 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201911031853.xA3IrgIU092762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 3 Nov 2019 18:53:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354287 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 354287 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 18:53:43 -0000 Author: vmaffione Date: Sun Nov 3 18:53:42 2019 New Revision: 354287 URL: https://svnweb.freebsd.org/changeset/base/354287 Log: bhyve: fix mistake introduced by r352841 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20973 Modified: head/usr.sbin/bhyve/net_backends.c Modified: head/usr.sbin/bhyve/net_backends.c ============================================================================== --- head/usr.sbin/bhyve/net_backends.c Sun Nov 3 17:45:30 2019 (r354286) +++ head/usr.sbin/bhyve/net_backends.c Sun Nov 3 18:53:42 2019 (r354287) @@ -860,12 +860,12 @@ void netbe_rx_disable(struct net_backend *be) { - return be->recv_enable(be); + return be->recv_disable(be); } void netbe_rx_enable(struct net_backend *be) { - return be->recv_disable(be); + return be->recv_enable(be); } From owner-svn-src-head@freebsd.org Sun Nov 3 18:59:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 998A617F88A for ; Sun, 3 Nov 2019 18:59:41 +0000 (UTC) (envelope-from tsoome@me.com) Received: from pv50p00im-zteg10011401.me.com (pv50p00im-zteg10011401.me.com [17.58.6.41]) (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 475lbc6MgGz3HR0 for ; Sun, 3 Nov 2019 18:59:40 +0000 (UTC) (envelope-from tsoome@me.com) Received: from nazgul.lan (148-52-235-80.sta.estpak.ee [80.235.52.148]) by pv50p00im-zteg10011401.me.com (Postfix) with ESMTPSA id D63BF901008; Sun, 3 Nov 2019 18:59:36 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3594.4.19\)) Subject: Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs From: Toomas Soome In-Reply-To: <276a3efd-da6c-69ca-cc4f-51c9a5b77696@FreeBSD.org> Date: Sun, 3 Nov 2019 20:59:34 +0200 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <25055587-72FD-47BE-946D-4A0D2D70B2EF@me.com> References: <201911031325.xA3DPl3B080386@repo.freebsd.org> <276a3efd-da6c-69ca-cc4f-51c9a5b77696@FreeBSD.org> To: Andriy Gapon , Alexander Motin X-Mailer: Apple Mail (2.3594.4.19) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-11-03_13:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=630 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1911030199 X-Rspamd-Queue-Id: 475lbc6MgGz3HR0 X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.60 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:17.58.0.0/16]; FREEMAIL_FROM(0.00)[me.com]; MV_CASE(0.50)[]; RCPT_COUNT_FIVE(0.00)[5]; DKIM_TRACE(0.00)[me.com:+]; DMARC_POLICY_ALLOW(-0.50)[me.com,quarantine]; RECEIVED_SPAMHAUS_PBL(0.00)[148.52.235.80.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; RCVD_IN_DNSWL_LOW(-0.10)[41.6.58.17.list.dnswl.org : 127.0.5.1]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:714, ipnet:17.58.0.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[me.com]; R_DKIM_ALLOW(-0.20)[me.com:s=1a1hai]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (-5.13), ipnet: 17.58.0.0/20(-2.50), asn: 714(-2.56), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; DWL_DNSWL_LOW(-1.00)[me.com.dwl.dnswl.org : 127.0.5.1]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 18:59:41 -0000 > On 3. Nov 2019, at 19:42, Andriy Gapon wrote: >=20 > On 03/11/2019 15:25, Toomas Soome wrote: >> Author: tsoome >> Date: Sun Nov 3 13:25:47 2019 >> New Revision: 354283 >> URL: https://svnweb.freebsd.org/changeset/base/354283 >>=20 >> Log: >> loader: we do not support booting from pool with log device >>=20 >> If pool has log device, stop there and tell about it. >=20 > Why? >=20 because it is not implemented? We already return EIO from vdev_probe() = for LOG device. I mean I does not have to stay this way, but also we = have some weird unexplained error cases=E2=80=A6=20 anyhow, it is trivial to undo the disable, and definitely open to ideas = about handling the reading the log. rgds, toomas= From owner-svn-src-head@freebsd.org Sun Nov 3 19:02:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 01EC317FAEE; Sun, 3 Nov 2019 19:02:34 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475lfx68mKz3Hq1; Sun, 3 Nov 2019 19:02:33 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7CB3184EA; Sun, 3 Nov 2019 19:02:33 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3J2XIm098576; Sun, 3 Nov 2019 19:02:33 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3J2WA1098571; Sun, 3 Nov 2019 19:02:32 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201911031902.xA3J2WA1098571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Sun, 3 Nov 2019 19:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354288 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 354288 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 19:02:34 -0000 Author: vmaffione Date: Sun Nov 3 19:02:32 2019 New Revision: 354288 URL: https://svnweb.freebsd.org/changeset/base/354288 Log: bhyve: add backend rx backpressure to virtio-net If a VM is flooded with more ingress packets than the guest OS can handle, the current virtio-net code will keep reading those packets and drop most of them as no space is available in the receive queue. This is an undesirable receive livelock, which is a waste of CPU and memory resources and potentially opens to DoS attacks. With this change, virtio-net uses the new netbe_rx_disable() function to disable ingress operation in the backend while the guest is short on RX buffers. Once the guest makes more buffers available to the RX virtqueue, ingress operation is enabled again by calling netbe_rx_enable(). Reviewed by: bryanv, jhb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20987 Modified: head/usr.sbin/bhyve/mevent.c head/usr.sbin/bhyve/mevent.h head/usr.sbin/bhyve/net_backends.c head/usr.sbin/bhyve/pci_e82545.c head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/mevent.c ============================================================================== --- head/usr.sbin/bhyve/mevent.c Sun Nov 3 18:53:42 2019 (r354287) +++ head/usr.sbin/bhyve/mevent.c Sun Nov 3 19:02:32 2019 (r354288) @@ -321,6 +321,14 @@ mevent_add(int tfd, enum ev_type type, return mevent_add_state(tfd, type, func, param, MEV_ADD); } +struct mevent * +mevent_add_disabled(int tfd, enum ev_type type, + void (*func)(int, enum ev_type, void *), void *param) +{ + + return mevent_add_state(tfd, type, func, param, MEV_ADD_DISABLED); +} + static int mevent_update(struct mevent *evp, int newstate) { Modified: head/usr.sbin/bhyve/mevent.h ============================================================================== --- head/usr.sbin/bhyve/mevent.h Sun Nov 3 18:53:42 2019 (r354287) +++ head/usr.sbin/bhyve/mevent.h Sun Nov 3 19:02:32 2019 (r354288) @@ -43,6 +43,9 @@ struct mevent; struct mevent *mevent_add(int fd, enum ev_type type, void (*func)(int, enum ev_type, void *), void *param); +struct mevent *mevent_add_disabled(int fd, enum ev_type type, + void (*func)(int, enum ev_type, void *), + void *param); int mevent_enable(struct mevent *evp); int mevent_disable(struct mevent *evp); int mevent_delete(struct mevent *evp); Modified: head/usr.sbin/bhyve/net_backends.c ============================================================================== --- head/usr.sbin/bhyve/net_backends.c Sun Nov 3 18:53:42 2019 (r354287) +++ head/usr.sbin/bhyve/net_backends.c Sun Nov 3 19:02:32 2019 (r354288) @@ -220,7 +220,7 @@ tap_init(struct net_backend *be, const char *devname, errx(EX_OSERR, "Unable to apply rights for sandbox"); #endif - priv->mevp = mevent_add(be->fd, EVF_READ, cb, param); + priv->mevp = mevent_add_disabled(be->fd, EVF_READ, cb, param); if (priv->mevp == NULL) { WPRINTF(("Could not register event\n")); goto error; @@ -432,7 +432,7 @@ netmap_init(struct net_backend *be, const char *devnam priv->cb_param = param; be->fd = priv->nmd->fd; - priv->mevp = mevent_add(be->fd, EVF_READ, cb, param); + priv->mevp = mevent_add_disabled(be->fd, EVF_READ, cb, param); if (priv->mevp == NULL) { WPRINTF(("Could not register event\n")); return (-1); Modified: head/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- head/usr.sbin/bhyve/pci_e82545.c Sun Nov 3 18:53:42 2019 (r354287) +++ head/usr.sbin/bhyve/pci_e82545.c Sun Nov 3 19:02:32 2019 (r354288) @@ -2351,6 +2351,8 @@ e82545_init(struct vmctx *ctx, struct pci_devinst *pi, net_genmac(pi, sc->esc_mac.octet); } + netbe_rx_enable(sc->esc_be); + /* H/w initiated reset */ e82545_reset(sc, 0); Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Sun Nov 3 18:53:42 2019 (r354287) +++ head/usr.sbin/bhyve/pci_virtio_net.c Sun Nov 3 19:02:32 2019 (r354288) @@ -101,7 +101,6 @@ struct pci_vtnet_softc { net_backend_t *vsc_be; - int vsc_rx_ready; int resetting; /* protected by tx_mtx */ uint64_t vsc_features; /* negotiated features */ @@ -156,7 +155,6 @@ pci_vtnet_reset(void *vsc) pthread_mutex_lock(&sc->tx_mtx); } - sc->vsc_rx_ready = 0; sc->rx_merge = 1; sc->rx_vhdrlen = sizeof(struct virtio_net_rxhdr); @@ -180,30 +178,29 @@ pci_vtnet_rx(struct pci_vtnet_softc *sc) int len, n; uint16_t idx; - if (!sc->vsc_rx_ready) { - /* - * The rx ring has not yet been set up. - * Drop the packet and try later. - */ - netbe_rx_discard(sc->vsc_be); - return; - } - - /* - * Check for available rx buffers - */ vq = &sc->vsc_queues[VTNET_RXQ]; - if (!vq_has_descs(vq)) { + for (;;) { /* - * No available rx buffers. Drop the packet and try later. - * Interrupt on empty, if that's negotiated. + * Check for available rx buffers. */ - netbe_rx_discard(sc->vsc_be); - vq_endchains(vq, /*used_all_avail=*/1); - return; - } + if (!vq_has_descs(vq)) { + /* No rx buffers. Enable RX kicks and double check. */ + vq_kick_enable(vq); + if (!vq_has_descs(vq)) { + /* + * Still no buffers. Interrupt if needed + * (including for NOTIFY_ON_EMPTY), and + * disable the backend until the next kick. + */ + vq_endchains(vq, /*used_all_avail=*/1); + netbe_rx_disable(sc->vsc_be); + return; + } - do { + /* More rx buffers found, so keep going. */ + vq_kick_disable(vq); + } + /* * Get descriptor chain. */ @@ -215,7 +212,8 @@ pci_vtnet_rx(struct pci_vtnet_softc *sc) if (len <= 0) { /* * No more packets (len == 0), or backend errored - * (err < 0). Return unused available buffers. + * (err < 0). Return unused available buffers + * and stop. */ vq_retchain(vq); /* Interrupt if needed/appropriate and stop. */ @@ -225,10 +223,8 @@ pci_vtnet_rx(struct pci_vtnet_softc *sc) /* Publish the info to the guest */ vq_relchain(vq, idx, (uint32_t)len); - } while (vq_has_descs(vq)); + } - /* Interrupt if needed, including for NOTIFY_ON_EMPTY. */ - vq_endchains(vq, /*used_all_avail=*/1); } /* @@ -254,13 +250,11 @@ pci_vtnet_ping_rxq(void *vsc, struct vqueue_info *vq) struct pci_vtnet_softc *sc = vsc; /* - * A qnotify means that the rx process can now begin + * A qnotify means that the rx process can now begin. */ pthread_mutex_lock(&sc->rx_mtx); - if (sc->vsc_rx_ready == 0) { - sc->vsc_rx_ready = 1; - vq_kick_disable(vq); - } + vq_kick_disable(vq); + netbe_rx_enable(sc->vsc_be); pthread_mutex_unlock(&sc->rx_mtx); } From owner-svn-src-head@freebsd.org Sun Nov 3 19:33:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 92B851A11F9; Sun, 3 Nov 2019 19:33:50 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475mM234Npz46ZZ; Sun, 3 Nov 2019 19:33:50 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CE1118A55; Sun, 3 Nov 2019 19:33:50 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3JXoEQ017182; Sun, 3 Nov 2019 19:33:50 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3JXoNn017181; Sun, 3 Nov 2019 19:33:50 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201911031933.xA3JXoNn017181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sun, 3 Nov 2019 19:33:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354289 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 354289 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 19:33:50 -0000 Author: cem Date: Sun Nov 3 19:33:49 2019 New Revision: 354289 URL: https://svnweb.freebsd.org/changeset/base/354289 Log: armv6: Switch to LLD by default This could just be ${__TT} == "arm", except armv5 isn't slated for death until EOY. arm tinderbox builds. Let's see what else shakes out. Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sun Nov 3 19:02:32 2019 (r354288) +++ head/share/mk/src.opts.mk Sun Nov 3 19:33:49 2019 (r354289) @@ -335,8 +335,8 @@ __DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND .else __DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND .endif -.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "armv7" || \ - ${__T} == "i386" +.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "armv6" || \ + ${__T} == "armv7" || ${__T} == "i386" __DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD .else __DEFAULT_NO_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD From owner-svn-src-head@freebsd.org Sun Nov 3 19:36:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1EAF1A1246; Sun, 3 Nov 2019 19:36:34 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475mQB5S4Bz49wf; Sun, 3 Nov 2019 19:36:34 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B54818A57; Sun, 3 Nov 2019 19:36:34 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3JaY8n017353; Sun, 3 Nov 2019 19:36:34 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3JaYrH017352; Sun, 3 Nov 2019 19:36:34 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201911031936.xA3JaYrH017352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sun, 3 Nov 2019 19:36:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354290 - head X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 354290 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 19:36:35 -0000 Author: cem Date: Sun Nov 3 19:36:34 2019 New Revision: 354290 URL: https://svnweb.freebsd.org/changeset/base/354290 Log: Take arm.arm (armv5) out of universe It's on the chopping block in two months, the CI tinderbox doesn't bother with it anymore either, and buildworld fails today due to an issue linking clang. It's not worth investigating and it just eats up CPU cycles running universe builds. Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sun Nov 3 19:33:49 2019 (r354289) +++ head/Makefile Sun Nov 3 19:36:34 2019 (r354290) @@ -496,7 +496,8 @@ _OBSOLETE_GCC_TARGETS+=powerpc .endif TARGETS?=amd64 arm arm64 i386 riscv ${_OBSOLETE_GCC_TARGETS} _UNIVERSE_TARGETS= ${TARGETS} -TARGET_ARCHES_arm?= arm armv6 armv7 +# arm (armv5) excluded due to broken buildworld +TARGET_ARCHES_arm?= armv6 armv7 TARGET_ARCHES_arm64?= aarch64 TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32 mipselhf mipshf mips64elhf mips64hf TARGET_ARCHES_powerpc?= powerpc powerpc64 powerpcspe From owner-svn-src-head@freebsd.org Sun Nov 3 20:39:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E4481A209B; Sun, 3 Nov 2019 20:39:48 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475nq76gBzz3G6B; Sun, 3 Nov 2019 20:39:47 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C44F2194E0; Sun, 3 Nov 2019 20:39:47 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3KdliA053175; Sun, 3 Nov 2019 20:39:47 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3KdktH053170; Sun, 3 Nov 2019 20:39:46 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032039.xA3KdktH053170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 20:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354291 - in head/sys/dev: chromebook_platform ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in head/sys/dev: chromebook_platform ichiic X-SVN-Commit-Revision: 354291 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 20:39:48 -0000 Author: wulf Date: Sun Nov 3 20:39:46 2019 New Revision: 354291 URL: https://svnweb.freebsd.org/changeset/base/354291 Log: [ig4] Give common name to PCI and ACPI device drivers They share common device driver code with different bus attachments This commit starts a bunch of changes which have following properties: Reviewed by: imp (previous version) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D22016 Modified: head/sys/dev/chromebook_platform/chromebook_platform.c head/sys/dev/ichiic/ig4_acpi.c head/sys/dev/ichiic/ig4_iic.c head/sys/dev/ichiic/ig4_pci.c head/sys/dev/ichiic/ig4_var.h Modified: head/sys/dev/chromebook_platform/chromebook_platform.c ============================================================================== --- head/sys/dev/chromebook_platform/chromebook_platform.c Sun Nov 3 19:36:34 2019 (r354290) +++ head/sys/dev/chromebook_platform/chromebook_platform.c Sun Nov 3 20:39:46 2019 (r354291) @@ -69,7 +69,7 @@ chromebook_i2c_identify(driver_t *driver, device_t bus * See http://lxr.free-electrons.com/source/drivers/platform/chrome/chromeos_laptop.c */ controller = device_get_parent(bus); - if (strcmp(device_get_name(controller), "ig4iic_pci") != 0) + if (strcmp(device_get_name(controller), "ig4iic") != 0) return; for (i = 0; i < nitems(slaves); i++) { Modified: head/sys/dev/ichiic/ig4_acpi.c ============================================================================== --- head/sys/dev/ichiic/ig4_acpi.c Sun Nov 3 19:36:34 2019 (r354290) +++ head/sys/dev/ichiic/ig4_acpi.c Sun Nov 3 20:39:46 2019 (r354291) @@ -163,15 +163,10 @@ static device_method_t ig4iic_acpi_methods[] = { }; static driver_t ig4iic_acpi_driver = { - "ig4iic_acpi", + "ig4iic", ig4iic_acpi_methods, sizeof(struct ig4iic_softc), }; -static devclass_t ig4iic_acpi_devclass; -DRIVER_MODULE(ig4iic_acpi, acpi, ig4iic_acpi_driver, ig4iic_acpi_devclass, 0, 0); - -MODULE_DEPEND(ig4iic_acpi, acpi, 1, 1, 1); -MODULE_DEPEND(ig4iic_acpi, pci, 1, 1, 1); -MODULE_DEPEND(ig4iic_acpi, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); -MODULE_VERSION(ig4iic_acpi, 1); +DRIVER_MODULE(ig4iic, acpi, ig4iic_acpi_driver, ig4iic_devclass, 0, 0); +MODULE_DEPEND(ig4iic, acpi, 1, 1, 1); Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 19:36:34 2019 (r354290) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:39:46 2019 (r354291) @@ -797,5 +797,8 @@ ig4iic_dump(ig4iic_softc_t *sc) } #undef REGDUMP -DRIVER_MODULE(iicbus, ig4iic_acpi, iicbus_driver, iicbus_devclass, NULL, NULL); -DRIVER_MODULE(iicbus, ig4iic_pci, iicbus_driver, iicbus_devclass, NULL, NULL); +devclass_t ig4iic_devclass; + +DRIVER_MODULE(iicbus, ig4iic, iicbus_driver, iicbus_devclass, NULL, NULL); +MODULE_DEPEND(ig4iic, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); +MODULE_VERSION(ig4iic, 1); Modified: head/sys/dev/ichiic/ig4_pci.c ============================================================================== --- head/sys/dev/ichiic/ig4_pci.c Sun Nov 3 19:36:34 2019 (r354290) +++ head/sys/dev/ichiic/ig4_pci.c Sun Nov 3 20:39:46 2019 (r354291) @@ -220,17 +220,13 @@ static device_method_t ig4iic_pci_methods[] = { }; static driver_t ig4iic_pci_driver = { - "ig4iic_pci", + "ig4iic", ig4iic_pci_methods, sizeof(struct ig4iic_softc) }; -static devclass_t ig4iic_pci_devclass; - -DRIVER_MODULE_ORDERED(ig4iic_pci, pci, ig4iic_pci_driver, ig4iic_pci_devclass, 0, 0, +DRIVER_MODULE_ORDERED(ig4iic, pci, ig4iic_pci_driver, ig4iic_devclass, 0, 0, SI_ORDER_ANY); -MODULE_DEPEND(ig4iic_pci, pci, 1, 1, 1); -MODULE_DEPEND(ig4iic_pci, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); -MODULE_VERSION(ig4iic_pci, 1); -MODULE_PNP_INFO("W32:vendor/device", pci, ig4iic_pci, ig4iic_pci_devices, +MODULE_DEPEND(ig4iic, pci, 1, 1, 1); +MODULE_PNP_INFO("W32:vendor/device", pci, ig4iic, ig4iic_pci_devices, nitems(ig4iic_pci_devices)); Modified: head/sys/dev/ichiic/ig4_var.h ============================================================================== --- head/sys/dev/ichiic/ig4_var.h Sun Nov 3 19:36:34 2019 (r354290) +++ head/sys/dev/ichiic/ig4_var.h Sun Nov 3 20:39:46 2019 (r354291) @@ -101,6 +101,8 @@ struct ig4iic_softc { typedef struct ig4iic_softc ig4iic_softc_t; +extern devclass_t ig4iic_devclass; + /* Attach/Detach called from ig4iic_pci_*() */ int ig4iic_attach(ig4iic_softc_t *sc); int ig4iic_detach(ig4iic_softc_t *sc); From owner-svn-src-head@freebsd.org Sun Nov 3 20:39:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBD0A1A20CA for ; Sun, 3 Nov 2019 20:39:53 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475nqD6Bljz3GMX for ; Sun, 3 Nov 2019 20:39:52 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-il1-x12c.google.com with SMTP id z10so13016875ilo.8 for ; Sun, 03 Nov 2019 12:39:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6Qi8U1b2F/Zv7jQ1j5e7o+v8JOtLH4fA3sO36zkP1jY=; b=JvjxWE1fy6RNO3+yesZFFVbYIegGrzFYRiqPTyvixD8UoXo7bfGjqbsilcRfNTiT3/ +j6uW4BYFt1TuB79JzxjAP1ELmkb5a2oXmXSxqVtwW5vIYby6FzlabZJeyjb3mgPVbsu SD3IIJ7X8W7wUozCh5muRn/USstlUh1xOtnuI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6Qi8U1b2F/Zv7jQ1j5e7o+v8JOtLH4fA3sO36zkP1jY=; b=SFUlZQPgymw8xz3vqUf+YEQrNr8tm3cZxixNG4NRYpshYq6rsudJz1xujQU4kQmTJA 3Bn5T4RCO5aaEHTmjBCIrOXIAo6pkAdiuQUa24BFVoO/6f6zHChTSQgs8Jm7R95d2ux1 IBIITE9VbDPHS2RvsDfg2cIr25SnUegiTiq/OrEkTm9pO4hSDXmtwYjs9qMn/deoW3jt 3+nQ8bizy2Gs4FEmcT8Wx8xPUnhRMSVlJDCiDhtRwMbS6orGKHDpPSl+sRlALxGtiNwD aNKS0lqFJ8faOwnl5M1+BZUcmWTnIGi35fzatZIJeac9qdUePp/dH6el5MZfqrabDAZ7 zd5w== X-Gm-Message-State: APjAAAWDqb6e6lM/bnrh9mTOTdl0kpggJ3qBmJP0d5JAmlzlUogu1CA1 mSwgZA2WNZRAA58gvzSPKlHzjpgbQny5nQknMejvrw== X-Google-Smtp-Source: APXvYqyJC4DMFHR9h/zD9OozVG4AkJVb7v2OOvSCmq7ts8Mp7RvoJXnZ9WUna/c+g/def+Pb+y5UARKZQcQpiJqAq18= X-Received: by 2002:a92:d0a:: with SMTP id 10mr25367483iln.238.1572813591476; Sun, 03 Nov 2019 12:39:51 -0800 (PST) MIME-Version: 1.0 References: <201911031325.xA3DPl3B080386@repo.freebsd.org> <276a3efd-da6c-69ca-cc4f-51c9a5b77696@FreeBSD.org> In-Reply-To: <276a3efd-da6c-69ca-cc4f-51c9a5b77696@FreeBSD.org> From: Kevin Bowling Date: Sun, 3 Nov 2019 13:39:40 -0700 Message-ID: Subject: Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs To: Andriy Gapon Cc: Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 475nqD6Bljz3GMX X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none (invalid DKIM record) header.d=kev009.com header.s=google header.b=JvjxWE1f; dmarc=none; spf=pass (mx1.freebsd.org: domain of kevin.bowling@kev009.com designates 2607:f8b0:4864:20::12c as permitted sender) smtp.mailfrom=kevin.bowling@kev009.com X-Spamd-Result: default: False [-5.05 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[kev009.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[kev009.com:~]; RCVD_IN_DNSWL_NONE(0.00)[c.2.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_DKIM_PERMFAIL(0.00)[kev009.com:s=google]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-2.75)[ip: (-9.28), ipnet: 2607:f8b0::/32(-2.38), asn: 15169(-2.03), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 20:39:53 -0000 I believe this is/was a common configuration, at least the few spinning disk based systems I have left have a slog. On Sun, Nov 3, 2019 at 10:55 AM Andriy Gapon wrote: > > On 03/11/2019 15:25, Toomas Soome wrote: > > Author: tsoome > > Date: Sun Nov 3 13:25:47 2019 > > New Revision: 354283 > > URL: https://svnweb.freebsd.org/changeset/base/354283 > > > > Log: > > loader: we do not support booting from pool with log device > > > > If pool has log device, stop there and tell about it. > > Why? > > > Modified: > > head/stand/libsa/zfs/zfs.c > > head/stand/libsa/zfs/zfsimpl.c > > head/sys/cddl/boot/zfs/zfsimpl.h > > > > -- > Andriy Gapon > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Sun Nov 3 20:40:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9CD4B1A2286; Sun, 3 Nov 2019 20:40:56 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475nrS30yGz3JcM; Sun, 3 Nov 2019 20:40:56 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BBD719511; Sun, 3 Nov 2019 20:40:56 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3KeuTU053307; Sun, 3 Nov 2019 20:40:56 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3Keu1N053306; Sun, 3 Nov 2019 20:40:56 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032040.xA3Keu1N053306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 20:40:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354292 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354292 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 20:40:56 -0000 Author: wulf Date: Sun Nov 3 20:40:55 2019 New Revision: 354292 URL: https://svnweb.freebsd.org/changeset/base/354292 Log: [ig4] Handle controller startup errors Fail the attach on controller startup errors. For some reason the dell xps 13 says there's I2C controller, but the controller appears to be permanente disabled and will refuse to enable. Obtained from: DragonflyBSD (509820b) Modified: head/sys/dev/ichiic/ig4_iic.c Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:39:46 2019 (r354291) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:40:55 2019 (r354292) @@ -629,10 +629,18 @@ ig4iic_attach(ig4iic_softc_t *sc) #endif mtx_lock(&sc->io_lock); - if (set_controller(sc, 0)) + if (set_controller(sc, 0)) { device_printf(sc->dev, "controller error during attach-1\n"); - if (set_controller(sc, IG4_I2C_ENABLE)) + mtx_unlock(&sc->io_lock); + error = ENXIO; + goto done; + } + if (set_controller(sc, IG4_I2C_ENABLE)) { device_printf(sc->dev, "controller error during attach-2\n"); + mtx_unlock(&sc->io_lock); + error = ENXIO; + goto done; + } mtx_unlock(&sc->io_lock); error = bus_setup_intr(sc->dev, sc->intr_res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, ig4iic_intr, sc, &sc->intr_handle); From owner-svn-src-head@freebsd.org Sun Nov 3 20:42:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA90C1A22ED; Sun, 3 Nov 2019 20:42:05 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475nsn5V1Jz3MS6; Sun, 3 Nov 2019 20:42:05 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A135B1967B; Sun, 3 Nov 2019 20:42:05 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3Kg5wt057921; Sun, 3 Nov 2019 20:42:05 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3Kg5km057919; Sun, 3 Nov 2019 20:42:05 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032042.xA3Kg5km057919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 20:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354293 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354293 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 20:42:05 -0000 Author: wulf Date: Sun Nov 3 20:42:04 2019 New Revision: 354293 URL: https://svnweb.freebsd.org/changeset/base/354293 Log: [ig4] Only enable interrupts when we want them. Otherwise keep mask at 0. This avoids possible interrupt storms, depending on the state of the I2C controller before the driver attached. During attaching this clears the interrupt mask. Revert r338215 as this change makes it no-op. Obtained from: DragonflyBSD (d7c8555) Modified: head/sys/dev/ichiic/ig4_acpi.c head/sys/dev/ichiic/ig4_iic.c head/sys/dev/ichiic/ig4_var.h Modified: head/sys/dev/ichiic/ig4_acpi.c ============================================================================== --- head/sys/dev/ichiic/ig4_acpi.c Sun Nov 3 20:40:55 2019 (r354292) +++ head/sys/dev/ichiic/ig4_acpi.c Sun Nov 3 20:42:04 2019 (r354293) @@ -69,18 +69,15 @@ static int ig4iic_acpi_probe(device_t dev) { ig4iic_softc_t *sc; - char *hid; int rv; sc = device_get_softc(dev); if (acpi_disabled("ig4iic")) return (ENXIO); - rv = ACPI_ID_PROBE(device_get_parent(dev), dev, ig4iic_ids, &hid); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, ig4iic_ids, NULL); if (rv > 0) return (rv); - if (strcmp("AMDI0010", hid) == 0) - sc->access_intr_mask = 1; device_set_desc(dev, "Designware I2C Controller"); return (rv); } Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:40:55 2019 (r354292) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:42:04 2019 (r354293) @@ -98,6 +98,15 @@ reg_read(ig4iic_softc_t *sc, uint32_t reg) return (value); } +static void +set_intr_mask(ig4iic_softc_t *sc, uint32_t val) +{ + if (sc->intr_mask != val) { + reg_write(sc, IG4_REG_INTR_MASK, val); + sc->intr_mask = val; + } +} + /* * Enable or disable the controller and wait for the controller to acknowledge * the state change. @@ -113,12 +122,9 @@ set_controller(ig4iic_softc_t *sc, uint32_t ctl) * When the controller is enabled, interrupt on STOP detect * or receive character ready and clear pending interrupts. */ - if (ctl & IG4_I2C_ENABLE) { - reg_write(sc, IG4_REG_INTR_MASK, IG4_INTR_STOP_DET | - IG4_INTR_RX_FULL); + set_intr_mask(sc, 0); + if (ctl & IG4_I2C_ENABLE) reg_read(sc, IG4_REG_CLR_INTR); - } else - reg_write(sc, IG4_REG_INTR_MASK, 0); reg_write(sc, IG4_REG_I2C_EN, ctl); error = IIC_ETIMEOUT; @@ -196,8 +202,10 @@ wait_status(ig4iic_softc_t *sc, uint32_t status) * work, otherwise poll with the lock held. */ if (status & IG4_STATUS_RX_NOTEMPTY) { + set_intr_mask(sc, IG4_INTR_STOP_DET | IG4_INTR_RX_FULL); mtx_sleep(sc, &sc->io_lock, 0, "i2cwait", (hz + 99) / 100); /* sleep up to 10ms */ + set_intr_mask(sc, 0); count_us += 10000; } else { DELAY(25); @@ -579,6 +587,10 @@ ig4iic_attach(ig4iic_softc_t *sc) v = reg_read(sc, IG4_REG_SS_SCL_LCNT); reg_write(sc, IG4_REG_FS_SCL_LCNT, v); + reg_read(sc, IG4_REG_CLR_INTR); + reg_write(sc, IG4_REG_INTR_MASK, 0); + sc->intr_mask = 0; + /* * Program based on a 25000 Hz clock. This is a bit of a * hack (obviously). The defaults are 400 and 470 for standard @@ -725,7 +737,7 @@ ig4iic_intr(void *cookie) uint32_t status; mtx_lock(&sc->io_lock); -/* reg_write(sc, IG4_REG_INTR_MASK, IG4_INTR_STOP_DET);*/ + set_intr_mask(sc, 0); reg_read(sc, IG4_REG_CLR_INTR); status = reg_read(sc, IG4_REG_I2C_STA); while (status & IG4_STATUS_RX_NOTEMPTY) { @@ -733,18 +745,6 @@ ig4iic_intr(void *cookie) (uint8_t)reg_read(sc, IG4_REG_DATA_CMD); ++sc->rnext; status = reg_read(sc, IG4_REG_I2C_STA); - } - - /* - * Workaround to trigger pending interrupt if IG4_REG_INTR_STAT - * is changed after clearing it - */ - if (sc->access_intr_mask != 0) { - status = reg_read(sc, IG4_REG_INTR_MASK); - if (status != 0) { - reg_write(sc, IG4_REG_INTR_MASK, 0); - reg_write(sc, IG4_REG_INTR_MASK, status); - } } wakeup(sc); Modified: head/sys/dev/ichiic/ig4_var.h ============================================================================== --- head/sys/dev/ichiic/ig4_var.h Sun Nov 3 20:40:55 2019 (r354292) +++ head/sys/dev/ichiic/ig4_var.h Sun Nov 3 20:42:04 2019 (r354293) @@ -65,6 +65,7 @@ struct ig4iic_softc { int rnext; int rpos; char rbuf[IG4_RBUFSIZE]; + uint32_t intr_mask; int error; uint8_t last_slave; int platform_attached : 1; @@ -72,7 +73,6 @@ struct ig4iic_softc { int slave_valid : 1; int read_started : 1; int write_started : 1; - int access_intr_mask : 1; /* * Locking semantics: From owner-svn-src-head@freebsd.org Sun Nov 3 20:43:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E75621A2311; Sun, 3 Nov 2019 20:43:02 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475ntt5LqKz3Pdj; Sun, 3 Nov 2019 20:43:02 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B42E196A6; Sun, 3 Nov 2019 20:43:02 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3Kh2jo058714; Sun, 3 Nov 2019 20:43:02 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3Kh2hd058713; Sun, 3 Nov 2019 20:43:02 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032043.xA3Kh2hd058713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 20:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354294 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354294 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 20:43:03 -0000 Author: wulf Date: Sun Nov 3 20:43:02 2019 New Revision: 354294 URL: https://svnweb.freebsd.org/changeset/base/354294 Log: [ig4] Drop driver's internal RX FIFO There is no need to read all controller's RX FIFO data to clear RX_FULL bit in interrupt handler as interrupts are masked permanently since previous commit. Modified: head/sys/dev/ichiic/ig4_iic.c head/sys/dev/ichiic/ig4_var.h Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:42:04 2019 (r354293) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:43:02 2019 (r354294) @@ -168,17 +168,6 @@ wait_status(ig4iic_softc_t *sc, uint32_t status) } /* - * When waiting for receive data break-out if the interrupt - * loaded data into the FIFO. - */ - if (status & IG4_STATUS_RX_NOTEMPTY) { - if (sc->rpos != sc->rnext) { - error = 0; - break; - } - } - - /* * When waiting for the transmit FIFO to become empty, * reset the timeout if we see a change in the transmit * FIFO level as progress is being made. @@ -217,25 +206,6 @@ wait_status(ig4iic_softc_t *sc, uint32_t status) } /* - * Read I2C data. The data might have already been read by - * the interrupt code, otherwise it is sitting in the data - * register. - */ -static uint8_t -data_read(ig4iic_softc_t *sc) -{ - uint8_t c; - - if (sc->rpos == sc->rnext) { - c = (uint8_t)reg_read(sc, IG4_REG_DATA_CMD); - } else { - c = sc->rbuf[sc->rpos & IG4_RBUFMASK]; - ++sc->rpos; - } - return (c); -} - -/* * Set the slave address. The controller must be disabled when * changing the address. * @@ -334,7 +304,7 @@ ig4iic_read(ig4iic_softc_t *sc, uint8_t *buf, uint16_t error = wait_status(sc, IG4_STATUS_RX_NOTEMPTY); if (error) break; - buf[i] = data_read(sc); + buf[i] = (uint8_t)reg_read(sc, IG4_REG_DATA_CMD); } (void)reg_read(sc, IG4_REG_TX_ABRT_SOURCE); @@ -455,16 +425,6 @@ ig4iic_transfer(device_t dev, struct iic_msg *msgs, ui */ reg_read(sc, IG4_REG_CLR_TX_ABORT); - /* - * Clean out any previously received data. - */ - if (sc->rpos != sc->rnext && bootverbose) { - device_printf(sc->dev, "discarding %d bytes of spurious data\n", - sc->rnext - sc->rpos); - } - sc->rpos = 0; - sc->rnext = 0; - rpstart = false; error = 0; for (i = 0; i < nmsgs; i++) { @@ -734,19 +694,10 @@ static void ig4iic_intr(void *cookie) { ig4iic_softc_t *sc = cookie; - uint32_t status; mtx_lock(&sc->io_lock); set_intr_mask(sc, 0); reg_read(sc, IG4_REG_CLR_INTR); - status = reg_read(sc, IG4_REG_I2C_STA); - while (status & IG4_STATUS_RX_NOTEMPTY) { - sc->rbuf[sc->rnext & IG4_RBUFMASK] = - (uint8_t)reg_read(sc, IG4_REG_DATA_CMD); - ++sc->rnext; - status = reg_read(sc, IG4_REG_I2C_STA); - } - wakeup(sc); mtx_unlock(&sc->io_lock); } Modified: head/sys/dev/ichiic/ig4_var.h ============================================================================== --- head/sys/dev/ichiic/ig4_var.h Sun Nov 3 20:42:04 2019 (r354293) +++ head/sys/dev/ichiic/ig4_var.h Sun Nov 3 20:43:02 2019 (r354294) @@ -43,9 +43,6 @@ #include "pci_if.h" #include "iicbus_if.h" -#define IG4_RBUFSIZE 128 -#define IG4_RBUFMASK (IG4_RBUFSIZE - 1) - enum ig4_op { IG4_IDLE, IG4_READ, IG4_WRITE }; enum ig4_vers { IG4_HASWELL, IG4_ATOM, IG4_SKYLAKE, IG4_APL }; @@ -62,9 +59,6 @@ struct ig4iic_softc { enum ig4_vers version; enum ig4_op op; int cmd; - int rnext; - int rpos; - char rbuf[IG4_RBUFSIZE]; uint32_t intr_mask; int error; uint8_t last_slave; @@ -81,19 +75,6 @@ struct ig4iic_softc { * with the controller acquire an exclusive lock on call_lock * to prevent interleaving of calls to the interface and a lock on * io_lock right afterwards, to synchronize controller I/O activity. - * - * The interrupt handler can only read data while no iicbus call - * is in progress or while io_lock is dropped during mtx_sleep in - * wait_status and set_controller. It is safe to drop io_lock in those - * places, because the interrupt handler only accesses those registers: - * - * - IG4_REG_I2C_STA (I2C Status) - * - IG4_REG_DATA_CMD (Data Buffer and Command) - * - IG4_REG_CLR_INTR (Clear Interrupt) - * - * Locking outside of those places is required to make the content - * of rpos/rnext predictable (e.g. whenever data_read is called and in - * ig4iic_transfer). */ struct sx call_lock; struct mtx io_lock; From owner-svn-src-head@freebsd.org Sun Nov 3 20:44:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 074D41A2343; Sun, 3 Nov 2019 20:44:17 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475nwJ6MHMz3xVB; Sun, 3 Nov 2019 20:44:16 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD86F196A7; Sun, 3 Nov 2019 20:44:16 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3KiG6J058833; Sun, 3 Nov 2019 20:44:16 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3KiGTb058832; Sun, 3 Nov 2019 20:44:16 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032044.xA3KiGTb058832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 20:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354295 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 20:44:17 -0000 Author: wulf Date: Sun Nov 3 20:44:16 2019 New Revision: 354295 URL: https://svnweb.freebsd.org/changeset/base/354295 Log: [ig4] Do not wait for interrupts in set_controller() routine Specs shows no dedicated interrupt firing on disable of the controller. Remove io lock acquisitions around set_controller() calls as they are not needed anymore. Modified: head/sys/dev/ichiic/ig4_iic.c Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:43:02 2019 (r354294) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:44:16 2019 (r354295) @@ -135,10 +135,7 @@ set_controller(ig4iic_softc_t *sc, uint32_t ctl) error = 0; break; } - if (cold) - DELAY(1000); - else - mtx_sleep(sc, &sc->io_lock, 0, "i2cslv", 1); + pause("i2cslv", 1); } return (error); } @@ -600,20 +597,16 @@ ig4iic_attach(ig4iic_softc_t *sc) } #endif - mtx_lock(&sc->io_lock); if (set_controller(sc, 0)) { device_printf(sc->dev, "controller error during attach-1\n"); - mtx_unlock(&sc->io_lock); error = ENXIO; goto done; } if (set_controller(sc, IG4_I2C_ENABLE)) { device_printf(sc->dev, "controller error during attach-2\n"); - mtx_unlock(&sc->io_lock); error = ENXIO; goto done; } - mtx_unlock(&sc->io_lock); error = bus_setup_intr(sc->dev, sc->intr_res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, ig4iic_intr, sc, &sc->intr_handle); if (error) { From owner-svn-src-head@freebsd.org Sun Nov 3 20:45:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E84B81A2377; Sun, 3 Nov 2019 20:45:25 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475nxd5mzjz4178; Sun, 3 Nov 2019 20:45:25 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA6EF196A8; Sun, 3 Nov 2019 20:45:25 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3KjPHh058947; Sun, 3 Nov 2019 20:45:25 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3KjPaX058945; Sun, 3 Nov 2019 20:45:25 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032045.xA3KjPaX058945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 20:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354296 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354296 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 20:45:26 -0000 Author: wulf Date: Sun Nov 3 20:45:25 2019 New Revision: 354296 URL: https://svnweb.freebsd.org/changeset/base/354296 Log: [ig4] Reduce scope of io_lock Now io_lock is used as condition variable to synchronize active process with the interrupt handler. It is not used for tasks other than waiting for interrupt and passing parameters to and from it's handler. Modified: head/sys/dev/ichiic/ig4_iic.c head/sys/dev/ichiic/ig4_var.h Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:44:16 2019 (r354295) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:45:25 2019 (r354296) @@ -188,10 +188,12 @@ wait_status(ig4iic_softc_t *sc, uint32_t status) * work, otherwise poll with the lock held. */ if (status & IG4_STATUS_RX_NOTEMPTY) { + mtx_lock(&sc->io_lock); set_intr_mask(sc, IG4_INTR_STOP_DET | IG4_INTR_RX_FULL); mtx_sleep(sc, &sc->io_lock, 0, "i2cwait", (hz + 99) / 100); /* sleep up to 10ms */ set_intr_mask(sc, 0); + mtx_unlock(&sc->io_lock); count_us += 10000; } else { DELAY(25); @@ -405,7 +407,6 @@ ig4iic_transfer(device_t dev, struct iic_msg *msgs, ui } sx_xlock(&sc->call_lock); - mtx_lock(&sc->io_lock); /* Debugging - dump registers. */ if (ig4_dump) { @@ -453,7 +454,6 @@ ig4iic_transfer(device_t dev, struct iic_msg *msgs, ui rpstart = !stop; } - mtx_unlock(&sc->io_lock); sx_unlock(&sc->call_lock); return (error); } @@ -464,7 +464,6 @@ ig4iic_reset(device_t dev, u_char speed, u_char addr, ig4iic_softc_t *sc = device_get_softc(dev); sx_xlock(&sc->call_lock); - mtx_lock(&sc->io_lock); /* TODO handle speed configuration? */ if (oldaddr != NULL) @@ -473,7 +472,6 @@ ig4iic_reset(device_t dev, u_char speed, u_char addr, if (addr == IIC_UNKNOWN) sc->slave_valid = false; - mtx_unlock(&sc->io_lock); sx_unlock(&sc->call_lock); return (0); } @@ -664,14 +662,12 @@ ig4iic_detach(ig4iic_softc_t *sc) bus_teardown_intr(sc->dev, sc->intr_res, sc->intr_handle); sx_xlock(&sc->call_lock); - mtx_lock(&sc->io_lock); sc->iicbus = NULL; sc->intr_handle = NULL; reg_write(sc, IG4_REG_INTR_MASK, 0); set_controller(sc, 0); - mtx_unlock(&sc->io_lock); sx_xunlock(&sc->call_lock); mtx_destroy(&sc->io_lock); Modified: head/sys/dev/ichiic/ig4_var.h ============================================================================== --- head/sys/dev/ichiic/ig4_var.h Sun Nov 3 20:44:16 2019 (r354295) +++ head/sys/dev/ichiic/ig4_var.h Sun Nov 3 20:45:25 2019 (r354296) @@ -73,8 +73,12 @@ struct ig4iic_softc { * * Functions implementing the icbus interface that interact * with the controller acquire an exclusive lock on call_lock - * to prevent interleaving of calls to the interface and a lock on - * io_lock right afterwards, to synchronize controller I/O activity. + * to prevent interleaving of calls to the interface. + * + * io_lock is used as condition variable to synchronize active process + * with the interrupt handler. It should not be used for tasks other + * than waiting for interrupt and passing parameters to and from + * it's handler. */ struct sx call_lock; struct mtx io_lock; From owner-svn-src-head@freebsd.org Sun Nov 3 20:46:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 048271A239A; Sun, 3 Nov 2019 20:46:21 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475nyh65zgz43Jt; Sun, 3 Nov 2019 20:46:20 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6091196A9; Sun, 3 Nov 2019 20:46:20 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3KkKCY059029; Sun, 3 Nov 2019 20:46:20 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3KkKaD059028; Sun, 3 Nov 2019 20:46:20 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032046.xA3KkKaD059028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 20:46:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354297 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354297 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 20:46:21 -0000 Author: wulf Date: Sun Nov 3 20:46:20 2019 New Revision: 354297 URL: https://svnweb.freebsd.org/changeset/base/354297 Log: [ig4] Ignore stray interrupts Modified: head/sys/dev/ichiic/ig4_iic.c Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:45:25 2019 (r354296) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:46:20 2019 (r354297) @@ -685,9 +685,12 @@ ig4iic_intr(void *cookie) ig4iic_softc_t *sc = cookie; mtx_lock(&sc->io_lock); - set_intr_mask(sc, 0); - reg_read(sc, IG4_REG_CLR_INTR); - wakeup(sc); + /* Ignore stray interrupts */ + if (sc->intr_mask != 0 && reg_read(sc, IG4_REG_INTR_STAT) != 0) { + set_intr_mask(sc, 0); + reg_read(sc, IG4_REG_CLR_INTR); + wakeup(sc); + } mtx_unlock(&sc->io_lock); } From owner-svn-src-head@freebsd.org Sun Nov 3 20:47:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD14A1A23DD; Sun, 3 Nov 2019 20:47:49 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475p0P5NFDz46wj; Sun, 3 Nov 2019 20:47:49 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D5FB196AB; Sun, 3 Nov 2019 20:47:49 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3Klns8059138; Sun, 3 Nov 2019 20:47:49 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3KlnFQ059137; Sun, 3 Nov 2019 20:47:49 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032047.xA3KlnFQ059137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 20:47:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354298 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354298 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 20:47:49 -0000 Author: wulf Date: Sun Nov 3 20:47:49 2019 New Revision: 354298 URL: https://svnweb.freebsd.org/changeset/base/354298 Log: [ig4] We actually need to set the Rx threshold register one smaller. Setting the IG4_REG_RX_TL register to 1 was actually generating an interrupt after 2 bytes were available in the Rx fifo. We need to set the register to 0 to get an interrupt for 1 byte already. Obtained from: DragonflyBSD (02f0bf2) Modified: head/sys/dev/ichiic/ig4_iic.c Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:46:20 2019 (r354297) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:47:49 2019 (r354298) @@ -567,7 +567,7 @@ ig4iic_attach(ig4iic_softc_t *sc) * * See ig4_var.h for details on interrupt handler synchronization. */ - reg_write(sc, IG4_REG_RX_TL, 1); + reg_write(sc, IG4_REG_RX_TL, 0); reg_write(sc, IG4_REG_CTL, IG4_CTL_MASTER | From owner-svn-src-head@freebsd.org Sun Nov 3 20:49:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 49DF91A2416; Sun, 3 Nov 2019 20:49:05 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475p1s0dL3z4BRc; Sun, 3 Nov 2019 20:49:05 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ECDF3196AE; Sun, 3 Nov 2019 20:49:04 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3Kn4Rv059234; Sun, 3 Nov 2019 20:49:04 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3Kn4kO059233; Sun, 3 Nov 2019 20:49:04 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032049.xA3Kn4kO059233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 20:49:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354299 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354299 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 20:49:05 -0000 Author: wulf Date: Sun Nov 3 20:49:04 2019 New Revision: 354299 URL: https://svnweb.freebsd.org/changeset/base/354299 Log: [ig4] Stop I2C controller after checking that it's kind of functional. Obtained from: DragonfliBSD (0b3eedb) Modified: head/sys/dev/ichiic/ig4_iic.c Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:47:49 2019 (r354298) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:49:04 2019 (r354299) @@ -605,6 +605,11 @@ ig4iic_attach(ig4iic_softc_t *sc) error = ENXIO; goto done; } + if (set_controller(sc, 0)) { + device_printf(sc->dev, "controller error during attach-3\n"); + error = ENXIO; + goto done; + } error = bus_setup_intr(sc->dev, sc->intr_res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, ig4iic_intr, sc, &sc->intr_handle); if (error) { From owner-svn-src-head@freebsd.org Sun Nov 3 20:50:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F33C1A2459; Sun, 3 Nov 2019 20:50:07 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475p325pVvz4DgZ; Sun, 3 Nov 2019 20:50:06 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB3FE196B3; Sun, 3 Nov 2019 20:50:06 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3Ko65e059363; Sun, 3 Nov 2019 20:50:06 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3Ko6tr059362; Sun, 3 Nov 2019 20:50:06 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032050.xA3Ko6tr059362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 20:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354300 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354300 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 20:50:07 -0000 Author: wulf Date: Sun Nov 3 20:50:06 2019 New Revision: 354300 URL: https://svnweb.freebsd.org/changeset/base/354300 Log: [ig4] disable controller before initialization of clock counters It is required by controller specifications. Modified: head/sys/dev/ichiic/ig4_iic.c Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:49:04 2019 (r354299) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:50:06 2019 (r354300) @@ -531,6 +531,13 @@ ig4iic_attach(ig4iic_softc_t *sc) goto done; } } + + if (set_controller(sc, 0)) { + device_printf(sc->dev, "controller error during attach-1\n"); + error = ENXIO; + goto done; + } + v = reg_read(sc, IG4_REG_SS_SCL_HCNT); v = reg_read(sc, IG4_REG_SS_SCL_LCNT); v = reg_read(sc, IG4_REG_FS_SCL_HCNT); @@ -595,11 +602,6 @@ ig4iic_attach(ig4iic_softc_t *sc) } #endif - if (set_controller(sc, 0)) { - device_printf(sc->dev, "controller error during attach-1\n"); - error = ENXIO; - goto done; - } if (set_controller(sc, IG4_I2C_ENABLE)) { device_printf(sc->dev, "controller error during attach-2\n"); error = ENXIO; From owner-svn-src-head@freebsd.org Sun Nov 3 20:51:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE83A1A25B1; Sun, 3 Nov 2019 20:51:22 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475p4V4Z0Nz4Hh0; Sun, 3 Nov 2019 20:51:22 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 819A5197ED; Sun, 3 Nov 2019 20:51:22 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3KpM9V060161; Sun, 3 Nov 2019 20:51:22 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3KpM00060160; Sun, 3 Nov 2019 20:51:22 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032051.xA3KpM00060160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 20:51:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354301 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 20:51:22 -0000 Author: wulf Date: Sun Nov 3 20:51:22 2019 New Revision: 354301 URL: https://svnweb.freebsd.org/changeset/base/354301 Log: [ig4] Add support for polled mode Currently ig4 internally depends on it's own interrupts and uses mtx_sleep() to wait for them. That means it can not be used from any context where sleeping is disallowed e.g. on cold boot, from DDB/KDB, from other device driver's interrupt handlers and so on. This change replaces sleeps with busy loops in cold boot and DDB cases. Modified: head/sys/dev/ichiic/ig4_iic.c Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:50:06 2019 (r354300) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:51:22 2019 (r354301) @@ -48,8 +48,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include @@ -70,6 +72,8 @@ __FBSDID("$FreeBSD$"); #define TRANS_PCALL 2 #define TRANS_BLOCK 3 +#define DO_POLL(sc) (cold || kdb_active || SCHEDULER_STOPPED()) + static void ig4iic_start(void *xdev); static void ig4iic_intr(void *cookie); static void ig4iic_dump(ig4iic_softc_t *sc); @@ -187,7 +191,7 @@ wait_status(ig4iic_softc_t *sc, uint32_t status) * When waiting for receive data let the interrupt do its * work, otherwise poll with the lock held. */ - if (status & IG4_STATUS_RX_NOTEMPTY) { + if ((status & IG4_STATUS_RX_NOTEMPTY) && !DO_POLL(sc)) { mtx_lock(&sc->io_lock); set_intr_mask(sc, IG4_INTR_STOP_DET | IG4_INTR_RX_FULL); mtx_sleep(sc, &sc->io_lock, 0, "i2cwait", From owner-svn-src-head@freebsd.org Sun Nov 3 20:53:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC9761A2604; Sun, 3 Nov 2019 20:53:14 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475p6f4yQZz4MkP; Sun, 3 Nov 2019 20:53:14 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E7C01986B; Sun, 3 Nov 2019 20:53:14 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3KrEnO065049; Sun, 3 Nov 2019 20:53:14 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3KrDLq065045; Sun, 3 Nov 2019 20:53:13 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032053.xA3KrDLq065045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 20:53:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354302 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 20:53:14 -0000 Author: wulf Date: Sun Nov 3 20:53:13 2019 New Revision: 354302 URL: https://svnweb.freebsd.org/changeset/base/354302 Log: [ig4] Allow enabling of polled mode from iicbus allocation callback If controller is allocated with IIC_NOWAIT option ig4 enables polled mode for a period of allocation that makes possible to start I2C transfers from the contexts where sleeping is not allowed e.g. from ithreads or callouts. Modified: head/sys/dev/ichiic/ig4_acpi.c head/sys/dev/ichiic/ig4_iic.c head/sys/dev/ichiic/ig4_pci.c head/sys/dev/ichiic/ig4_var.h Modified: head/sys/dev/ichiic/ig4_acpi.c ============================================================================== --- head/sys/dev/ichiic/ig4_acpi.c Sun Nov 3 20:51:22 2019 (r354301) +++ head/sys/dev/ichiic/ig4_acpi.c Sun Nov 3 20:53:13 2019 (r354302) @@ -154,7 +154,7 @@ static device_method_t ig4iic_acpi_methods[] = { /* iicbus interface */ DEVMETHOD(iicbus_transfer, ig4iic_transfer), DEVMETHOD(iicbus_reset, ig4iic_reset), - DEVMETHOD(iicbus_callback, iicbus_null_callback), + DEVMETHOD(iicbus_callback, ig4iic_callback), DEVMETHOD_END }; Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:51:22 2019 (r354301) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:53:13 2019 (r354302) @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); #define TRANS_PCALL 2 #define TRANS_BLOCK 3 -#define DO_POLL(sc) (cold || kdb_active || SCHEDULER_STOPPED()) +#define DO_POLL(sc) (cold || kdb_active || SCHEDULER_STOPPED() || sc->poll) static void ig4iic_start(void *xdev); static void ig4iic_intr(void *cookie); @@ -350,6 +350,7 @@ ig4iic_transfer(device_t dev, struct iic_msg *msgs, ui int unit; bool rpstart; bool stop; + bool allocated; /* * The hardware interface imposes limits on allowed I2C messages. @@ -410,7 +411,10 @@ ig4iic_transfer(device_t dev, struct iic_msg *msgs, ui return (IIC_ENOTSUPP); } - sx_xlock(&sc->call_lock); + /* Check if device is already allocated with iicbus_request_bus() */ + allocated = sx_xlocked(&sc->call_lock) != 0; + if (!allocated) + sx_xlock(&sc->call_lock); /* Debugging - dump registers. */ if (ig4_dump) { @@ -458,7 +462,8 @@ ig4iic_transfer(device_t dev, struct iic_msg *msgs, ui rpstart = !stop; } - sx_unlock(&sc->call_lock); + if (!allocated) + sx_unlock(&sc->call_lock); return (error); } @@ -466,8 +471,11 @@ int ig4iic_reset(device_t dev, u_char speed, u_char addr, u_char *oldaddr) { ig4iic_softc_t *sc = device_get_softc(dev); + bool allocated; - sx_xlock(&sc->call_lock); + allocated = sx_xlocked(&sc->call_lock) != 0; + if (!allocated) + sx_xlock(&sc->call_lock); /* TODO handle speed configuration? */ if (oldaddr != NULL) @@ -476,8 +484,41 @@ ig4iic_reset(device_t dev, u_char speed, u_char addr, if (addr == IIC_UNKNOWN) sc->slave_valid = false; - sx_unlock(&sc->call_lock); + if (!allocated) + sx_unlock(&sc->call_lock); return (0); +} + +int +ig4iic_callback(device_t dev, int index, caddr_t data) +{ + ig4iic_softc_t *sc = device_get_softc(dev); + int error = 0; + int how; + + switch (index) { + case IIC_REQUEST_BUS: + /* force polling if ig4iic is requested with IIC_DONTWAIT */ + how = *(int *)data; + if ((how & IIC_WAIT) == 0) { + if (sx_try_xlock(&sc->call_lock) == 0) + error = IIC_EBUSBSY; + else + sc->poll = true; + } else + sx_xlock(&sc->call_lock); + break; + + case IIC_RELEASE_BUS: + sc->poll = false; + sx_unlock(&sc->call_lock); + break; + + default: + error = errno2iic(EINVAL); + } + + return (error); } /* Modified: head/sys/dev/ichiic/ig4_pci.c ============================================================================== --- head/sys/dev/ichiic/ig4_pci.c Sun Nov 3 20:51:22 2019 (r354301) +++ head/sys/dev/ichiic/ig4_pci.c Sun Nov 3 20:53:13 2019 (r354302) @@ -214,7 +214,7 @@ static device_method_t ig4iic_pci_methods[] = { DEVMETHOD(iicbus_transfer, ig4iic_transfer), DEVMETHOD(iicbus_reset, ig4iic_reset), - DEVMETHOD(iicbus_callback, iicbus_null_callback), + DEVMETHOD(iicbus_callback, ig4iic_callback), DEVMETHOD_END }; Modified: head/sys/dev/ichiic/ig4_var.h ============================================================================== --- head/sys/dev/ichiic/ig4_var.h Sun Nov 3 20:51:22 2019 (r354301) +++ head/sys/dev/ichiic/ig4_var.h Sun Nov 3 20:53:13 2019 (r354302) @@ -67,6 +67,7 @@ struct ig4iic_softc { int slave_valid : 1; int read_started : 1; int write_started : 1; + int poll: 1; /* * Locking semantics: @@ -95,5 +96,6 @@ int ig4iic_detach(ig4iic_softc_t *sc); /* iicbus methods */ extern iicbus_transfer_t ig4iic_transfer; extern iicbus_reset_t ig4iic_reset; +extern iicbus_callback_t ig4iic_callback; #endif /* _ICHIIC_IG4_VAR_H_ */ From owner-svn-src-head@freebsd.org Sun Nov 3 20:54:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC4921A2624; Sun, 3 Nov 2019 20:54:18 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475p7t3zdhz4QGZ; Sun, 3 Nov 2019 20:54:18 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D5ED1986D; Sun, 3 Nov 2019 20:54:18 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3KsIqc065139; Sun, 3 Nov 2019 20:54:18 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3KsImx065137; Sun, 3 Nov 2019 20:54:18 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032054.xA3KsImx065137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 20:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354303 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 20:54:18 -0000 Author: wulf Date: Sun Nov 3 20:54:17 2019 New Revision: 354303 URL: https://svnweb.freebsd.org/changeset/base/354303 Log: [ig4] Do not wait until interrupts are enabled at attach stage as the driver is fully functional on a cold boot through utilization of polled mode. As a side effect, ig4 children probe and attach methods can be called earlier in the boot sequence, so now it is up to the child drivers to wait for a kernel initialization completion if it is required. Modified: head/sys/dev/ichiic/ig4_iic.c head/sys/dev/ichiic/ig4_var.h Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:53:13 2019 (r354302) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:54:17 2019 (r354303) @@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$"); #define DO_POLL(sc) (cold || kdb_active || SCHEDULER_STOPPED() || sc->poll) -static void ig4iic_start(void *xdev); static void ig4iic_intr(void *cookie); static void ig4iic_dump(ig4iic_softc_t *sc); @@ -664,38 +663,14 @@ ig4iic_attach(ig4iic_softc_t *sc) "Unable to setup irq: error %d\n", error); } - sc->enum_hook.ich_func = ig4iic_start; - sc->enum_hook.ich_arg = sc->dev; - - /* - * We have to wait until interrupts are enabled. I2C read and write - * only works if the interrupts are available. - */ - if (config_intrhook_establish(&sc->enum_hook) != 0) - error = ENOMEM; - else - error = 0; - -done: - return (error); -} - -void -ig4iic_start(void *xdev) -{ - int error; - ig4iic_softc_t *sc; - device_t dev = (device_t)xdev; - - sc = device_get_softc(dev); - - config_intrhook_disestablish(&sc->enum_hook); - error = bus_generic_attach(sc->dev); if (error) { device_printf(sc->dev, "failed to attach child: error %d\n", error); } + +done: + return (error); } int Modified: head/sys/dev/ichiic/ig4_var.h ============================================================================== --- head/sys/dev/ichiic/ig4_var.h Sun Nov 3 20:53:13 2019 (r354302) +++ head/sys/dev/ichiic/ig4_var.h Sun Nov 3 20:54:17 2019 (r354303) @@ -48,7 +48,6 @@ enum ig4_vers { IG4_HASWELL, IG4_ATOM, IG4_SKYLAKE, IG struct ig4iic_softc { device_t dev; - struct intr_config_hook enum_hook; device_t iicbus; struct resource *regs_res; int regs_rid; From owner-svn-src-head@freebsd.org Sun Nov 3 20:55:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A30F81A2657; Sun, 3 Nov 2019 20:55:29 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475p9F3lvdz4Tg6; Sun, 3 Nov 2019 20:55:29 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 64E891986F; Sun, 3 Nov 2019 20:55:29 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3KtTid065271; Sun, 3 Nov 2019 20:55:29 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3KtTbL065270; Sun, 3 Nov 2019 20:55:29 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032055.xA3KtTbL065270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 20:55:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354304 - head/sys/dev/cyapa X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/cyapa X-SVN-Commit-Revision: 354304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 20:55:29 -0000 Author: wulf Date: Sun Nov 3 20:55:28 2019 New Revision: 354304 URL: https://svnweb.freebsd.org/changeset/base/354304 Log: [cyapa] Postpone start of the polling thread until sleep is available After recent ig4 changes cyapa driver can be attached before timers initialization is completed. Start polling thread from config_intrhook to avoid busy loops in that case. Modified: head/sys/dev/cyapa/cyapa.c Modified: head/sys/dev/cyapa/cyapa.c ============================================================================== --- head/sys/dev/cyapa/cyapa.c Sun Nov 3 20:54:17 2019 (r354303) +++ head/sys/dev/cyapa/cyapa.c Sun Nov 3 20:55:28 2019 (r354304) @@ -152,6 +152,7 @@ struct cyapa_softc { struct cdev *devnode; struct selinfo selinfo; struct mtx mutex; + struct intr_config_hook intr_hook; int cap_resx; int cap_resy; @@ -419,6 +420,27 @@ done: return (error); } +/* + * Start the polling thread + */ +static void +cyapa_start(void *xdev) +{ + struct cyapa_softc *sc; + device_t dev = xdev; + + sc = device_get_softc(dev); + + config_intrhook_disestablish(&sc->intr_hook); + + /* Setup input event tracking */ + cyapa_set_power_mode(sc, CMD_POWER_MODE_IDLE); + + /* Start the polling thread */ + kthread_add(cyapa_poll_thread, sc, NULL, NULL, + 0, 0, "cyapa-poll"); +} + static int cyapa_probe(device_t); static int cyapa_attach(device_t); static int cyapa_detach(device_t); @@ -536,12 +558,14 @@ cyapa_attach(device_t dev) sc->mode.level = 0; sc->mode.packetsize = MOUSE_PS2_PACKETSIZE; - /* Setup input event tracking */ - cyapa_set_power_mode(sc, CMD_POWER_MODE_IDLE); + sc->intr_hook.ich_func = cyapa_start; + sc->intr_hook.ich_arg = sc->dev; - /* Start the polling thread */ - kthread_add(cyapa_poll_thread, sc, NULL, NULL, - 0, 0, "cyapa-poll"); + /* Postpone start of the polling thread until sleep is available */ + if (config_intrhook_establish(&sc->intr_hook) != 0) { + mtx_destroy(&sc->mutex); + return (ENOMEM); + } sc->devnode = make_dev(&cyapa_cdevsw, unit, UID_ROOT, GID_WHEEL, 0600, "cyapa%d", unit); From owner-svn-src-head@freebsd.org Sun Nov 3 20:56:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE6FF1A2678; Sun, 3 Nov 2019 20:56:53 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475pBs5y4Sz4Y2Z; Sun, 3 Nov 2019 20:56:53 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B000F19871; Sun, 3 Nov 2019 20:56:53 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3KurV9065374; Sun, 3 Nov 2019 20:56:53 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3KurkB065373; Sun, 3 Nov 2019 20:56:53 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032056.xA3KurkB065373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 20:56:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354305 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354305 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 20:56:54 -0000 Author: wulf Date: Sun Nov 3 20:56:53 2019 New Revision: 354305 URL: https://svnweb.freebsd.org/changeset/base/354305 Log: [ig4] dump IG4_REG_COMP_PARAM1 and IG4_REG_COMP_VER registers unconditionally They appeared to be supported (although undocumented) on SkyLakes+ too. Modified: head/sys/dev/ichiic/ig4_iic.c head/sys/dev/ichiic/ig4_reg.h Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:55:28 2019 (r354304) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:56:53 2019 (r354305) @@ -751,10 +751,8 @@ ig4iic_dump(ig4iic_softc_t *sc) REGDUMP(sc, IG4_REG_DMA_RDLR); REGDUMP(sc, IG4_REG_SDA_SETUP); REGDUMP(sc, IG4_REG_ENABLE_STATUS); - if (sc->version == IG4_HASWELL || sc->version == IG4_ATOM) { - REGDUMP(sc, IG4_REG_COMP_PARAM1); - REGDUMP(sc, IG4_REG_COMP_VER); - } + REGDUMP(sc, IG4_REG_COMP_PARAM1); + REGDUMP(sc, IG4_REG_COMP_VER); if (sc->version == IG4_ATOM) { REGDUMP(sc, IG4_REG_COMP_TYPE); REGDUMP(sc, IG4_REG_CLK_PARMS); Modified: head/sys/dev/ichiic/ig4_reg.h ============================================================================== --- head/sys/dev/ichiic/ig4_reg.h Sun Nov 3 20:55:28 2019 (r354304) +++ head/sys/dev/ichiic/ig4_reg.h Sun Nov 3 20:56:53 2019 (r354305) @@ -112,7 +112,7 @@ #define IG4_REG_SDA_SETUP 0x0094 /* RW SDA Setup */ #define IG4_REG_ACK_GENERAL_CALL 0x0098 /* RW I2C ACK General Call */ #define IG4_REG_ENABLE_STATUS 0x009C /* RO Enable Status */ -/* Available at least on Atom SoCs and Haswell mobile. */ +/* Available at least on Atom SoCs, Haswell mobile and some Skylakes. */ #define IG4_REG_COMP_PARAM1 0x00F4 /* RO Component Parameter */ #define IG4_REG_COMP_VER 0x00F8 /* RO Component Version */ /* Available at least on Atom SoCs */ From owner-svn-src-head@freebsd.org Sun Nov 3 20:58:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67BC41A26A9; Sun, 3 Nov 2019 20:58:00 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475pD81pm6z4cHQ; Sun, 3 Nov 2019 20:58:00 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2304819872; Sun, 3 Nov 2019 20:58:00 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3Kw074065470; Sun, 3 Nov 2019 20:58:00 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3Kvxf8065462; Sun, 3 Nov 2019 20:57:59 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032057.xA3Kvxf8065462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 20:57:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354306 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 20:58:00 -0000 Author: wulf Date: Sun Nov 3 20:57:59 2019 New Revision: 354306 URL: https://svnweb.freebsd.org/changeset/base/354306 Log: [ig4] Set clock registers based on controller model IC clock rates are varied between different controller models so we have to adjust timing registers in each case individually. Borrow intresting constants and formulas from Intel specs, i2c-designware and lpss_intel drivers and apply them to FreeBSD supported controller models. Implement fetching of timing data via ACPI methods execution if available. Modified: head/sys/dev/ichiic/ig4_iic.c head/sys/dev/ichiic/ig4_reg.h head/sys/dev/ichiic/ig4_var.h Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:56:53 2019 (r354305) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:57:59 2019 (r354306) @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); * See ig4_var.h for locking semantics. */ +#include "opt_acpi.h" + #include #include #include @@ -60,6 +62,12 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef DEV_ACPI +#include +#include +#include +#endif + #include #include #include @@ -74,6 +82,43 @@ __FBSDID("$FreeBSD$"); #define DO_POLL(sc) (cold || kdb_active || SCHEDULER_STOPPED() || sc->poll) +/* + * tLOW, tHIGH periods of the SCL clock and maximal falling time of both + * lines are taken from I2C specifications. + */ +#define IG4_SPEED_STD_THIGH 4000 /* nsec */ +#define IG4_SPEED_STD_TLOW 4700 /* nsec */ +#define IG4_SPEED_STD_TF_MAX 300 /* nsec */ +#define IG4_SPEED_FAST_THIGH 600 /* nsec */ +#define IG4_SPEED_FAST_TLOW 1300 /* nsec */ +#define IG4_SPEED_FAST_TF_MAX 300 /* nsec */ + +/* + * Ig4 hardware parameters except Haswell are taken from intel_lpss driver + */ +static const struct ig4_hw ig4iic_hw[] = { + [IG4_HASWELL] = { + .ic_clock_rate = 100, /* MHz */ + .sda_hold_time = 90, /* nsec */ + }, + [IG4_ATOM] = { + .ic_clock_rate = 100, + .sda_fall_time = 280, + .scl_fall_time = 240, + .sda_hold_time = 60, + }, + [IG4_SKYLAKE] = { + .ic_clock_rate = 120, + .sda_hold_time = 230, + }, + [IG4_APL] = { + .ic_clock_rate = 133, + .sda_fall_time = 171, + .scl_fall_time = 208, + .sda_hold_time = 207, + }, +}; + static void ig4iic_intr(void *cookie); static void ig4iic_dump(ig4iic_softc_t *sc); @@ -82,6 +127,17 @@ SYSCTL_INT(_debug, OID_AUTO, ig4_dump, CTLFLAG_RW, &ig4_dump, 0, "Dump controller registers"); /* + * Clock registers initialization control + * 0 - Try read clock registers from ACPI and fallback to p.1. + * 1 - Calculate values based on controller type (IC clock rate). + * 2 - Use values inherited from DragonflyBSD driver (old behavior). + * 3 - Keep clock registers intact. + */ +static int ig4_timings; +SYSCTL_INT(_debug, OID_AUTO, ig4_timings, CTLFLAG_RDTUN, &ig4_timings, 0, + "Controller timings 0=ACPI, 1=predefined, 2=legacy, 3=do not change"); + +/* * Low-level inline support functions */ static __inline void @@ -521,6 +577,166 @@ ig4iic_callback(device_t dev, int index, caddr_t data) } /* + * Clock register values can be calculated with following rough equations: + * SCL_HCNT = ceil(IC clock rate * tHIGH) + * SCL_LCNT = ceil(IC clock rate * tLOW) + * SDA_HOLD = ceil(IC clock rate * SDA hold time) + * Precise equations take signal's falling, rising and spike suppression + * times in to account. They can be found in Synopsys or Intel documentation. + * + * Here we snarf formulas and defaults from Linux driver to be able to use + * timing values provided by Intel LPSS driver "as is". + */ +static int +ig4iic_clk_params(const struct ig4_hw *hw, int speed, + uint16_t *scl_hcnt, uint16_t *scl_lcnt, uint16_t *sda_hold) +{ + uint32_t thigh, tlow, tf_max; /* nsec */ + uint32_t sda_fall_time; /* nsec */ + uint32_t scl_fall_time; /* nsec */ + + switch (speed) { + case IG4_CTL_SPEED_STD: + thigh = IG4_SPEED_STD_THIGH; + tlow = IG4_SPEED_STD_TLOW; + tf_max = IG4_SPEED_STD_TF_MAX; + break; + + case IG4_CTL_SPEED_FAST: + thigh = IG4_SPEED_FAST_THIGH; + tlow = IG4_SPEED_FAST_TLOW; + tf_max = IG4_SPEED_FAST_TF_MAX; + break; + + default: + return (EINVAL); + } + + /* Use slowest falling time defaults to be on the safe side */ + sda_fall_time = hw->sda_fall_time == 0 ? tf_max : hw->sda_fall_time; + *scl_hcnt = (uint16_t) + ((hw->ic_clock_rate * (thigh + sda_fall_time) + 500) / 1000 - 3); + + scl_fall_time = hw->scl_fall_time == 0 ? tf_max : hw->scl_fall_time; + *scl_lcnt = (uint16_t) + ((hw->ic_clock_rate * (tlow + scl_fall_time) + 500) / 1000 - 1); + + /* + * There is no "known good" default value for tHD;DAT so keep SDA_HOLD + * intact if sda_hold_time value is not provided. + */ + if (hw->sda_hold_time != 0) + *sda_hold = (uint16_t) + ((hw->ic_clock_rate * hw->sda_hold_time + 500) / 1000); + + return (0); +} + +#ifdef DEV_ACPI +static ACPI_STATUS +ig4iic_acpi_params(ACPI_HANDLE handle, char *method, + uint16_t *scl_hcnt, uint16_t *scl_lcnt, uint16_t *sda_hold) +{ + ACPI_BUFFER buf; + ACPI_OBJECT *obj, *elems; + ACPI_STATUS status; + + buf.Pointer = NULL; + buf.Length = ACPI_ALLOCATE_BUFFER; + + status = AcpiEvaluateObject(handle, method, NULL, &buf); + if (ACPI_FAILURE(status)) + return (status); + + status = AE_TYPE; + obj = (ACPI_OBJECT *)buf.Pointer; + if (obj->Type == ACPI_TYPE_PACKAGE && obj->Package.Count == 3) { + elems = obj->Package.Elements; + *scl_hcnt = elems[0].Integer.Value & IG4_SCL_CLOCK_MASK; + *scl_lcnt = elems[1].Integer.Value & IG4_SCL_CLOCK_MASK; + *sda_hold = elems[2].Integer.Value & IG4_SDA_TX_HOLD_MASK; + status = AE_OK; + } + + AcpiOsFree(obj); + + return (status); +} +#endif /* DEV_ACPI */ + +static void +ig4iic_get_config(ig4iic_softc_t *sc) +{ + const struct ig4_hw *hw; +#ifdef DEV_ACPI + ACPI_HANDLE handle; +#endif + /* Fetch default hardware config from controller */ + sc->cfg.version = reg_read(sc, IG4_REG_COMP_VER); + sc->cfg.bus_speed = reg_read(sc, IG4_REG_CTL) & IG4_CTL_SPEED_MASK; + sc->cfg.ss_scl_hcnt = + reg_read(sc, IG4_REG_SS_SCL_HCNT) & IG4_SCL_CLOCK_MASK; + sc->cfg.ss_scl_lcnt = + reg_read(sc, IG4_REG_SS_SCL_LCNT) & IG4_SCL_CLOCK_MASK; + sc->cfg.fs_scl_hcnt = + reg_read(sc, IG4_REG_FS_SCL_HCNT) & IG4_SCL_CLOCK_MASK; + sc->cfg.fs_scl_lcnt = + reg_read(sc, IG4_REG_FS_SCL_LCNT) & IG4_SCL_CLOCK_MASK; + sc->cfg.ss_sda_hold = sc->cfg.fs_sda_hold = + reg_read(sc, IG4_REG_SDA_HOLD) & IG4_SDA_TX_HOLD_MASK; + + if (sc->cfg.bus_speed != IG4_CTL_SPEED_STD) + sc->cfg.bus_speed = IG4_CTL_SPEED_FAST; + + /* Override hardware config with IC_clock-based counter values */ + if (ig4_timings < 2 && sc->version < nitems(ig4iic_hw)) { + hw = &ig4iic_hw[sc->version]; + sc->cfg.bus_speed = IG4_CTL_SPEED_FAST; + ig4iic_clk_params(hw, IG4_CTL_SPEED_STD, &sc->cfg.ss_scl_hcnt, + &sc->cfg.ss_scl_lcnt, &sc->cfg.ss_sda_hold); + ig4iic_clk_params(hw, IG4_CTL_SPEED_FAST, &sc->cfg.fs_scl_hcnt, + &sc->cfg.fs_scl_lcnt, &sc->cfg.fs_sda_hold); + } else if (ig4_timings == 2) { + /* + * Timings of original ig4 driver: + * Program based on a 25000 Hz clock. This is a bit of a + * hack (obviously). The defaults are 400 and 470 for standard + * and 60 and 130 for fast. The defaults for standard fail + * utterly (presumably cause an abort) because the clock time + * is ~18.8ms by default. This brings it down to ~4ms. + */ + sc->cfg.bus_speed = IG4_CTL_SPEED_STD; + sc->cfg.ss_scl_hcnt = sc->cfg.fs_scl_hcnt = 100; + sc->cfg.ss_scl_lcnt = sc->cfg.fs_scl_lcnt = 125; + if (sc->version == IG4_SKYLAKE) + sc->cfg.ss_sda_hold = sc->cfg.fs_sda_hold = 28; + } + +#ifdef DEV_ACPI + /* Evaluate SSCN and FMCN ACPI methods to fetch timings */ + if (ig4_timings == 0 && (handle = acpi_get_handle(sc->dev)) != NULL) { + ig4iic_acpi_params(handle, "SSCN", &sc->cfg.ss_scl_hcnt, + &sc->cfg.ss_scl_lcnt, &sc->cfg.ss_sda_hold); + ig4iic_acpi_params(handle, "FMCN", &sc->cfg.fs_scl_hcnt, + &sc->cfg.fs_scl_lcnt, &sc->cfg.fs_sda_hold); + } +#endif + + if (bootverbose) { + device_printf(sc->dev, "Controller parameters:\n"); + printf(" Speed: %s\n", + sc->cfg.bus_speed == IG4_CTL_SPEED_STD ? "Std" : "Fast"); + printf(" Regs: HCNT :LCNT :SDAHLD\n"); + printf(" Std: 0x%04hx:0x%04hx:0x%04hx\n", + sc->cfg.ss_scl_hcnt, sc->cfg.ss_scl_lcnt, + sc->cfg.ss_sda_hold); + printf(" Fast: 0x%04hx:0x%04hx:0x%04hx\n", + sc->cfg.fs_scl_hcnt, sc->cfg.fs_scl_lcnt, + sc->cfg.fs_sda_hold); + } +} + +/* * Called from ig4iic_pci_attach/detach() */ int @@ -532,6 +748,8 @@ ig4iic_attach(ig4iic_softc_t *sc) mtx_init(&sc->io_lock, "IG4 I/O lock", NULL, MTX_DEF); sx_init(&sc->call_lock, "IG4 call lock"); + ig4iic_get_config(sc); + v = reg_read(sc, IG4_REG_DEVIDLE_CTRL); if (sc->version == IG4_SKYLAKE && (v & IG4_RESTORE_REQUIRED) ) { reg_write(sc, IG4_REG_DEVIDLE_CTRL, IG4_DEVICE_IDLE | IG4_RESTORE_REQUIRED); @@ -582,34 +800,17 @@ ig4iic_attach(ig4iic_softc_t *sc) goto done; } - v = reg_read(sc, IG4_REG_SS_SCL_HCNT); - v = reg_read(sc, IG4_REG_SS_SCL_LCNT); - v = reg_read(sc, IG4_REG_FS_SCL_HCNT); - v = reg_read(sc, IG4_REG_FS_SCL_LCNT); - v = reg_read(sc, IG4_REG_SDA_HOLD); - - v = reg_read(sc, IG4_REG_SS_SCL_HCNT); - reg_write(sc, IG4_REG_FS_SCL_HCNT, v); - v = reg_read(sc, IG4_REG_SS_SCL_LCNT); - reg_write(sc, IG4_REG_FS_SCL_LCNT, v); - reg_read(sc, IG4_REG_CLR_INTR); reg_write(sc, IG4_REG_INTR_MASK, 0); sc->intr_mask = 0; - /* - * Program based on a 25000 Hz clock. This is a bit of a - * hack (obviously). The defaults are 400 and 470 for standard - * and 60 and 130 for fast. The defaults for standard fail - * utterly (presumably cause an abort) because the clock time - * is ~18.8ms by default. This brings it down to ~4ms (for now). - */ - reg_write(sc, IG4_REG_SS_SCL_HCNT, 100); - reg_write(sc, IG4_REG_SS_SCL_LCNT, 125); - reg_write(sc, IG4_REG_FS_SCL_HCNT, 100); - reg_write(sc, IG4_REG_FS_SCL_LCNT, 125); - if (sc->version == IG4_SKYLAKE) - reg_write(sc, IG4_REG_SDA_HOLD, 28); + reg_write(sc, IG4_REG_SS_SCL_HCNT, sc->cfg.ss_scl_hcnt); + reg_write(sc, IG4_REG_SS_SCL_LCNT, sc->cfg.ss_scl_lcnt); + reg_write(sc, IG4_REG_FS_SCL_HCNT, sc->cfg.fs_scl_hcnt); + reg_write(sc, IG4_REG_FS_SCL_LCNT, sc->cfg.fs_scl_lcnt); + reg_write(sc, IG4_REG_SDA_HOLD, + (sc->cfg.bus_speed & IG4_CTL_SPEED_MASK) == IG4_CTL_SPEED_STD ? + sc->cfg.ss_sda_hold : sc->cfg.fs_sda_hold); /* * Use a threshold of 1 so we get interrupted on each character, @@ -624,7 +825,7 @@ ig4iic_attach(ig4iic_softc_t *sc) IG4_CTL_MASTER | IG4_CTL_SLAVE_DISABLE | IG4_CTL_RESTARTEN | - IG4_CTL_SPEED_STD); + (sc->cfg.bus_speed & IG4_CTL_SPEED_MASK)); sc->iicbus = device_add_child(sc->dev, "iicbus", -1); if (sc->iicbus == NULL) { Modified: head/sys/dev/ichiic/ig4_reg.h ============================================================================== --- head/sys/dev/ichiic/ig4_reg.h Sun Nov 3 20:56:53 2019 (r354305) +++ head/sys/dev/ichiic/ig4_reg.h Sun Nov 3 20:57:59 2019 (r354306) @@ -154,9 +154,12 @@ #define IG4_CTL_SLAVE_DISABLE 0x0040 /* snarfed from linux */ #define IG4_CTL_RESTARTEN 0x0020 /* Allow Restart when master */ #define IG4_CTL_10BIT 0x0010 /* ctlr accepts 10-bit addresses */ +#define IG4_CTL_SPEED_MASK 0x0006 /* speed at which the I2C operates */ +#define IG4_CTL_MASTER 0x0001 /* snarfed from linux */ + +#define IG4_CTL_SPEED_HIGH 0x0006 /* snarfed from linux */ #define IG4_CTL_SPEED_FAST 0x0004 /* snarfed from linux */ #define IG4_CTL_SPEED_STD 0x0002 /* snarfed from linux */ -#define IG4_CTL_MASTER 0x0001 /* snarfed from linux */ /* * TAR_ADD - Target Address Register 22.2.2 @@ -413,7 +416,7 @@ * * Set the SDA hold time length register in I2C clocks. */ -#define IG4_SDA_HOLD_MASK 0x00FF +#define IG4_SDA_TX_HOLD_MASK 0x0000FFFF /* * TX_ABRT_SOURCE- (RO) Transmit Abort Source Register 22.2.27 Modified: head/sys/dev/ichiic/ig4_var.h ============================================================================== --- head/sys/dev/ichiic/ig4_var.h Sun Nov 3 20:56:53 2019 (r354305) +++ head/sys/dev/ichiic/ig4_var.h Sun Nov 3 20:57:59 2019 (r354306) @@ -46,6 +46,24 @@ enum ig4_op { IG4_IDLE, IG4_READ, IG4_WRITE }; enum ig4_vers { IG4_HASWELL, IG4_ATOM, IG4_SKYLAKE, IG4_APL }; +struct ig4_hw { + uint32_t ic_clock_rate; /* MHz */ + uint32_t sda_fall_time; /* nsec */ + uint32_t scl_fall_time; /* nsec */ + uint32_t sda_hold_time; /* nsec */ +}; + +struct ig4_cfg { + uint32_t version; + uint32_t bus_speed; + uint16_t ss_scl_hcnt; + uint16_t ss_scl_lcnt; + uint16_t ss_sda_hold; + uint16_t fs_scl_hcnt; + uint16_t fs_scl_lcnt; + uint16_t fs_sda_hold; +}; + struct ig4iic_softc { device_t dev; device_t iicbus; @@ -57,6 +75,7 @@ struct ig4iic_softc { int intr_type; enum ig4_vers version; enum ig4_op op; + struct ig4_cfg cfg; int cmd; uint32_t intr_mask; int error; From owner-svn-src-head@freebsd.org Sun Nov 3 20:59:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B5D81A26CE; Sun, 3 Nov 2019 20:59:05 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475pFP0k1xz4fJ7; Sun, 3 Nov 2019 20:59:05 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F01D619874; Sun, 3 Nov 2019 20:59:04 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3Kx4rS065561; Sun, 3 Nov 2019 20:59:04 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3Kx4WA065557; Sun, 3 Nov 2019 20:59:04 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032059.xA3Kx4WA065557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 20:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354307 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354307 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 20:59:05 -0000 Author: wulf Date: Sun Nov 3 20:59:04 2019 New Revision: 354307 URL: https://svnweb.freebsd.org/changeset/base/354307 Log: [ig4] Implement burst mode for data reads In this mode DATA_CMD register reads and writes are performed in TX/RX FIFO-sized bursts to increase I2C bus utilization. That reduces read time from 60us to 30us per byte when read data is fit in to RX FIFO buffer in FAST speed mode in my setup. Modified: head/sys/dev/ichiic/ig4_iic.c head/sys/dev/ichiic/ig4_reg.h head/sys/dev/ichiic/ig4_var.h Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:57:59 2019 (r354306) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:59:04 2019 (r354307) @@ -100,12 +100,16 @@ static const struct ig4_hw ig4iic_hw[] = { [IG4_HASWELL] = { .ic_clock_rate = 100, /* MHz */ .sda_hold_time = 90, /* nsec */ + .txfifo_depth = 32, + .rxfifo_depth = 32, }, [IG4_ATOM] = { .ic_clock_rate = 100, .sda_fall_time = 280, .scl_fall_time = 240, .sda_hold_time = 60, + .txfifo_depth = 32, + .rxfifo_depth = 32, }, [IG4_SKYLAKE] = { .ic_clock_rate = 120, @@ -330,41 +334,67 @@ ig4iic_xfer_start(ig4iic_softc_t *sc, uint16_t slave) return (0); } +/* + * Amount of unread data before next burst to get better I2C bus utilization. + * 2 bytes is enough in FAST mode. 8 bytes is better in FAST+ and HIGH modes. + * Intel-recommended value is 16 for DMA transfers with 64-byte depth FIFOs. + */ +#define IG4_FIFO_LOWAT 2 + static int ig4iic_read(ig4iic_softc_t *sc, uint8_t *buf, uint16_t len, bool repeated_start, bool stop) { uint32_t cmd; - uint16_t i; + int requested = 0; + int received = 0; + int burst, target, lowat = 0; int error; if (len == 0) return (0); - cmd = IG4_DATA_COMMAND_RD; - cmd |= repeated_start ? IG4_DATA_RESTART : 0; - cmd |= stop && len == 1 ? IG4_DATA_STOP : 0; - - /* Issue request for the first byte (could be last as well). */ - reg_write(sc, IG4_REG_DATA_CMD, cmd); - - for (i = 0; i < len; i++) { - /* - * Maintain a pipeline by queueing the allowance for the next - * read before waiting for the current read. - */ - cmd = IG4_DATA_COMMAND_RD; - if (i < len - 1) { + while (received < len) { + burst = sc->cfg.txfifo_depth - + (reg_read(sc, IG4_REG_TXFLR) & IG4_FIFOLVL_MASK); + /* Ensure we have enough free space in RXFIFO */ + burst = MIN(burst, sc->cfg.rxfifo_depth - lowat); + if (burst <= 0) { + error = wait_status(sc, IG4_STATUS_TX_NOTFULL); + if (error) + break; + burst = 1; + } + target = MIN(requested + burst, (int)len); + while (requested < target) { cmd = IG4_DATA_COMMAND_RD; - cmd |= stop && i == len - 2 ? IG4_DATA_STOP : 0; + if (repeated_start && requested == 0) + cmd |= IG4_DATA_RESTART; + if (stop && requested == len - 1) + cmd |= IG4_DATA_STOP; reg_write(sc, IG4_REG_DATA_CMD, cmd); + requested++; } - error = wait_status(sc, IG4_STATUS_RX_NOTEMPTY); - if (error) - break; - buf[i] = (uint8_t)reg_read(sc, IG4_REG_DATA_CMD); + /* Leave some data queued to maintain the hardware pipeline */ + lowat = 0; + if (requested != len && requested - received > IG4_FIFO_LOWAT) + lowat = IG4_FIFO_LOWAT; + /* After TXFLR fills up, clear it by reading available data */ + while (received < requested - lowat) { + burst = MIN((int)len - received, + reg_read(sc, IG4_REG_RXFLR) & IG4_FIFOLVL_MASK); + if (burst > 0) { + while (burst--) + buf[received++] = 0xFF & + reg_read(sc, IG4_REG_DATA_CMD); + } else { + error = wait_status(sc, IG4_STATUS_RX_NOTEMPTY); + if (error) + goto out; + } + } } - +out: (void)reg_read(sc, IG4_REG_TX_ABRT_SOURCE); return (error); } @@ -668,6 +698,7 @@ static void ig4iic_get_config(ig4iic_softc_t *sc) { const struct ig4_hw *hw; + uint32_t v; #ifdef DEV_ACPI ACPI_HANDLE handle; #endif @@ -688,6 +719,32 @@ ig4iic_get_config(ig4iic_softc_t *sc) if (sc->cfg.bus_speed != IG4_CTL_SPEED_STD) sc->cfg.bus_speed = IG4_CTL_SPEED_FAST; + /* REG_COMP_PARAM1 is not documented in latest Intel specs */ + if (sc->version == IG4_HASWELL || sc->version == IG4_ATOM) { + v = reg_read(sc, IG4_REG_COMP_PARAM1); + if (IG4_PARAM1_TXFIFO_DEPTH(v) != 0) + sc->cfg.txfifo_depth = IG4_PARAM1_TXFIFO_DEPTH(v); + if (IG4_PARAM1_RXFIFO_DEPTH(v) != 0) + sc->cfg.rxfifo_depth = IG4_PARAM1_RXFIFO_DEPTH(v); + } else { + /* + * Hardware does not allow FIFO Threshold Levels value to be + * set larger than the depth of the buffer. If an attempt is + * made to do that, the actual value set will be the maximum + * depth of the buffer. + */ + v = reg_read(sc, IG4_REG_TX_TL); + reg_write(sc, IG4_REG_TX_TL, v | IG4_FIFO_MASK); + sc->cfg.txfifo_depth = + (reg_read(sc, IG4_REG_TX_TL) & IG4_FIFO_MASK) + 1; + reg_write(sc, IG4_REG_TX_TL, v); + v = reg_read(sc, IG4_REG_RX_TL); + reg_write(sc, IG4_REG_RX_TL, v | IG4_FIFO_MASK); + sc->cfg.rxfifo_depth = + (reg_read(sc, IG4_REG_RX_TL) & IG4_FIFO_MASK) + 1; + reg_write(sc, IG4_REG_RX_TL, v); + } + /* Override hardware config with IC_clock-based counter values */ if (ig4_timings < 2 && sc->version < nitems(ig4iic_hw)) { hw = &ig4iic_hw[sc->version]; @@ -696,6 +753,10 @@ ig4iic_get_config(ig4iic_softc_t *sc) &sc->cfg.ss_scl_lcnt, &sc->cfg.ss_sda_hold); ig4iic_clk_params(hw, IG4_CTL_SPEED_FAST, &sc->cfg.fs_scl_hcnt, &sc->cfg.fs_scl_lcnt, &sc->cfg.fs_sda_hold); + if (hw->txfifo_depth != 0) + sc->cfg.txfifo_depth = hw->txfifo_depth; + if (hw->rxfifo_depth != 0) + sc->cfg.rxfifo_depth = hw->rxfifo_depth; } else if (ig4_timings == 2) { /* * Timings of original ig4 driver: @@ -733,6 +794,8 @@ ig4iic_get_config(ig4iic_softc_t *sc) printf(" Fast: 0x%04hx:0x%04hx:0x%04hx\n", sc->cfg.fs_scl_hcnt, sc->cfg.fs_scl_lcnt, sc->cfg.fs_sda_hold); + printf(" FIFO: RX:0x%04x: TX:0x%04x\n", + sc->cfg.rxfifo_depth, sc->cfg.txfifo_depth); } } Modified: head/sys/dev/ichiic/ig4_reg.h ============================================================================== --- head/sys/dev/ichiic/ig4_reg.h Sun Nov 3 20:57:59 2019 (r354306) +++ head/sys/dev/ichiic/ig4_reg.h Sun Nov 3 20:59:04 2019 (r354307) @@ -409,7 +409,7 @@ * FIFOs. Note that for some reason the mask is 9 bits instead of * the 8 bits the fill level controls. */ -#define IG4_FIFOLVL_MASK 0x001F +#define IG4_FIFOLVL_MASK 0x01FF /* * SDA_HOLD - (RW) SDA Hold Time Length Register 22.2.26 @@ -533,8 +533,8 @@ * * DATAW - Indicates the internal bus width in bits. */ -#define IG4_PARAM1_TXFIFO_DEPTH(v) (((v) >> 16) & 0xFF) -#define IG4_PARAM1_RXFIFO_DEPTH(v) (((v) >> 8) & 0xFF) +#define IG4_PARAM1_TXFIFO_DEPTH(v) ((((v) >> 16) & 0xFF) + 1) +#define IG4_PARAM1_RXFIFO_DEPTH(v) ((((v) >> 8) & 0xFF) + 1) #define IG4_PARAM1_CONFIG_VALID 0x00000080 #define IG4_PARAM1_CONFIG_HASDMA 0x00000040 #define IG4_PARAM1_CONFIG_INTR_IO 0x00000020 Modified: head/sys/dev/ichiic/ig4_var.h ============================================================================== --- head/sys/dev/ichiic/ig4_var.h Sun Nov 3 20:57:59 2019 (r354306) +++ head/sys/dev/ichiic/ig4_var.h Sun Nov 3 20:59:04 2019 (r354307) @@ -51,6 +51,8 @@ struct ig4_hw { uint32_t sda_fall_time; /* nsec */ uint32_t scl_fall_time; /* nsec */ uint32_t sda_hold_time; /* nsec */ + int txfifo_depth; + int rxfifo_depth; }; struct ig4_cfg { @@ -62,6 +64,8 @@ struct ig4_cfg { uint16_t fs_scl_hcnt; uint16_t fs_scl_lcnt; uint16_t fs_sda_hold; + int txfifo_depth; + int rxfifo_depth; }; struct ig4iic_softc { From owner-svn-src-head@freebsd.org Sun Nov 3 21:00:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B7921A2A88; Sun, 3 Nov 2019 21:00:57 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475pHY2qDsz3GvY; Sun, 3 Nov 2019 21:00:57 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 366C319980; Sun, 3 Nov 2019 21:00:57 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3L0vQP066514; Sun, 3 Nov 2019 21:00:57 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3L0uoM066509; Sun, 3 Nov 2019 21:00:56 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032100.xA3L0uoM066509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 21:00:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354308 - in head/sys/dev: ichiic iicbus X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in head/sys/dev: ichiic iicbus X-SVN-Commit-Revision: 354308 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 21:00:57 -0000 Author: wulf Date: Sun Nov 3 21:00:55 2019 New Revision: 354308 URL: https://svnweb.freebsd.org/changeset/base/354308 Log: [ig4] Add suspend/resume support That is done with re-execution of controller initialization procedure from resume handler. PR: 238037 Modified: head/sys/dev/ichiic/ig4_acpi.c head/sys/dev/ichiic/ig4_iic.c head/sys/dev/ichiic/ig4_pci.c head/sys/dev/ichiic/ig4_var.h head/sys/dev/iicbus/iicbus.c Modified: head/sys/dev/ichiic/ig4_acpi.c ============================================================================== --- head/sys/dev/ichiic/ig4_acpi.c Sun Nov 3 20:59:04 2019 (r354307) +++ head/sys/dev/ichiic/ig4_acpi.c Sun Nov 3 21:00:55 2019 (r354308) @@ -145,11 +145,29 @@ ig4iic_acpi_detach(device_t dev) return (0); } +static int +ig4iic_acpi_suspend(device_t dev) +{ + ig4iic_softc_t *sc = device_get_softc(dev); + + return (ig4iic_suspend(sc)); +} + +static int +ig4iic_acpi_resume(device_t dev) +{ + ig4iic_softc_t *sc = device_get_softc(dev); + + return (ig4iic_resume(sc)); +} + static device_method_t ig4iic_acpi_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ig4iic_acpi_probe), DEVMETHOD(device_attach, ig4iic_acpi_attach), DEVMETHOD(device_detach, ig4iic_acpi_detach), + DEVMETHOD(device_suspend, ig4iic_acpi_suspend), + DEVMETHOD(device_resume, ig4iic_acpi_resume), /* iicbus interface */ DEVMETHOD(iicbus_transfer, ig4iic_transfer), Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 20:59:04 2019 (r354307) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:00:55 2019 (r354308) @@ -799,20 +799,11 @@ ig4iic_get_config(ig4iic_softc_t *sc) } } -/* - * Called from ig4iic_pci_attach/detach() - */ -int -ig4iic_attach(ig4iic_softc_t *sc) +static int +ig4iic_set_config(ig4iic_softc_t *sc) { - int error; uint32_t v; - mtx_init(&sc->io_lock, "IG4 I/O lock", NULL, MTX_DEF); - sx_init(&sc->call_lock, "IG4 call lock"); - - ig4iic_get_config(sc); - v = reg_read(sc, IG4_REG_DEVIDLE_CTRL); if (sc->version == IG4_SKYLAKE && (v & IG4_RESTORE_REQUIRED) ) { reg_write(sc, IG4_REG_DEVIDLE_CTRL, IG4_DEVICE_IDLE | IG4_RESTORE_REQUIRED); @@ -851,16 +842,13 @@ ig4iic_attach(ig4iic_softc_t *sc) if (sc->version == IG4_HASWELL || sc->version == IG4_ATOM) { v = reg_read(sc, IG4_REG_COMP_VER); - if (v < IG4_COMP_MIN_VER) { - error = ENXIO; - goto done; - } + if (v < IG4_COMP_MIN_VER) + return(ENXIO); } if (set_controller(sc, 0)) { device_printf(sc->dev, "controller error during attach-1\n"); - error = ENXIO; - goto done; + return (ENXIO); } reg_read(sc, IG4_REG_CLR_INTR); @@ -890,6 +878,26 @@ ig4iic_attach(ig4iic_softc_t *sc) IG4_CTL_RESTARTEN | (sc->cfg.bus_speed & IG4_CTL_SPEED_MASK)); + return (0); +} + +/* + * Called from ig4iic_pci_attach/detach() + */ +int +ig4iic_attach(ig4iic_softc_t *sc) +{ + int error; + + mtx_init(&sc->io_lock, "IG4 I/O lock", NULL, MTX_DEF); + sx_init(&sc->call_lock, "IG4 call lock"); + + ig4iic_get_config(sc); + + error = ig4iic_set_config(sc); + if (error) + goto done; + sc->iicbus = device_add_child(sc->dev, "iicbus", -1); if (sc->iicbus == NULL) { device_printf(sc->dev, "iicbus driver not found\n"); @@ -965,6 +973,49 @@ ig4iic_detach(ig4iic_softc_t *sc) sx_destroy(&sc->call_lock); return (0); +} + +int +ig4iic_suspend(ig4iic_softc_t *sc) +{ + int error; + + /* suspend all children */ + error = bus_generic_suspend(sc->dev); + + sx_xlock(&sc->call_lock); + set_controller(sc, 0); + if (sc->version == IG4_SKYLAKE) { + /* + * Place the device in the idle state, just to be safe + */ + reg_write(sc, IG4_REG_DEVIDLE_CTRL, IG4_DEVICE_IDLE); + /* + * Controller can become dysfunctional if I2C lines are pulled + * down when suspend procedure turns off power to I2C device. + * Place device in the reset state to avoid this. + */ + reg_write(sc, IG4_REG_RESETS_SKL, IG4_RESETS_ASSERT_SKL); + } + sx_xunlock(&sc->call_lock); + + return (error); +} + +int ig4iic_resume(ig4iic_softc_t *sc) +{ + int error; + + sx_xlock(&sc->call_lock); + if (ig4iic_set_config(sc)) + device_printf(sc->dev, "controller error during resume\n"); + /* Force setting of the target address on the next transfer */ + sc->slave_valid = 0; + sx_xunlock(&sc->call_lock); + + error = bus_generic_resume(sc->dev); + + return (error); } /* Modified: head/sys/dev/ichiic/ig4_pci.c ============================================================================== --- head/sys/dev/ichiic/ig4_pci.c Sun Nov 3 20:59:04 2019 (r354307) +++ head/sys/dev/ichiic/ig4_pci.c Sun Nov 3 21:00:55 2019 (r354308) @@ -206,11 +206,29 @@ ig4iic_pci_detach(device_t dev) return (0); } +static int +ig4iic_pci_suspend(device_t dev) +{ + ig4iic_softc_t *sc = device_get_softc(dev); + + return (ig4iic_suspend(sc)); +} + +static int +ig4iic_pci_resume(device_t dev) +{ + ig4iic_softc_t *sc = device_get_softc(dev); + + return (ig4iic_resume(sc)); +} + static device_method_t ig4iic_pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ig4iic_pci_probe), DEVMETHOD(device_attach, ig4iic_pci_attach), DEVMETHOD(device_detach, ig4iic_pci_detach), + DEVMETHOD(device_suspend, ig4iic_pci_suspend), + DEVMETHOD(device_resume, ig4iic_pci_resume), DEVMETHOD(iicbus_transfer, ig4iic_transfer), DEVMETHOD(iicbus_reset, ig4iic_reset), Modified: head/sys/dev/ichiic/ig4_var.h ============================================================================== --- head/sys/dev/ichiic/ig4_var.h Sun Nov 3 20:59:04 2019 (r354307) +++ head/sys/dev/ichiic/ig4_var.h Sun Nov 3 21:00:55 2019 (r354308) @@ -114,6 +114,8 @@ extern devclass_t ig4iic_devclass; /* Attach/Detach called from ig4iic_pci_*() */ int ig4iic_attach(ig4iic_softc_t *sc); int ig4iic_detach(ig4iic_softc_t *sc); +int ig4iic_suspend(ig4iic_softc_t *sc); +int ig4iic_resume(ig4iic_softc_t *sc); /* iicbus methods */ extern iicbus_transfer_t ig4iic_transfer; Modified: head/sys/dev/iicbus/iicbus.c ============================================================================== --- head/sys/dev/iicbus/iicbus.c Sun Nov 3 20:59:04 2019 (r354307) +++ head/sys/dev/iicbus/iicbus.c Sun Nov 3 21:00:55 2019 (r354308) @@ -330,6 +330,8 @@ static device_method_t iicbus_methods[] = { DEVMETHOD(device_probe, iicbus_probe), DEVMETHOD(device_attach, iicbus_attach), DEVMETHOD(device_detach, iicbus_detach), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), /* bus interface */ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), From owner-svn-src-head@freebsd.org Sun Nov 3 21:01:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F48D1A2C5E; Sun, 3 Nov 2019 21:01:54 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475pJf1W5vz3LYg; Sun, 3 Nov 2019 21:01:54 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 173E119A1E; Sun, 3 Nov 2019 21:01:54 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3L1ruK069197; Sun, 3 Nov 2019 21:01:53 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3L1rPJ069195; Sun, 3 Nov 2019 21:01:53 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032101.xA3L1rPJ069195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 21:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354309 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354309 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 21:01:54 -0000 Author: wulf Date: Sun Nov 3 21:01:53 2019 New Revision: 354309 URL: https://svnweb.freebsd.org/changeset/base/354309 Log: [ig4] Remove dead code inherited from DragonflyBSD Modified: head/sys/dev/ichiic/ig4_iic.c head/sys/dev/ichiic/ig4_var.h Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:00:55 2019 (r354308) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:01:53 2019 (r354309) @@ -68,18 +68,12 @@ __FBSDID("$FreeBSD$"); #include #endif -#include -#include #include #include #include #include -#define TRANS_NORMAL 1 -#define TRANS_PCALL 2 -#define TRANS_BLOCK 3 - #define DO_POLL(sc) (cold || kdb_active || SCHEDULER_STOPPED() || sc->poll) /* @@ -290,21 +284,7 @@ set_slave_addr(ig4iic_softc_t *sc, uint8_t slave) /* * Wait for TXFIFO to drain before disabling the controller. - * - * If a write message has not been completed it's really a - * programming error, but for now in that case issue an extra - * byte + STOP. - * - * If a read message has not been completed it's also a programming - * error, for now just ignore it. */ - wait_status(sc, IG4_STATUS_TX_NOTFULL); - if (sc->write_started) { - reg_write(sc, IG4_REG_DATA_CMD, IG4_DATA_STOP); - sc->write_started = 0; - } - if (sc->read_started) - sc->read_started = 0; wait_status(sc, IG4_STATUS_TX_EMPTY); set_controller(sc, 0); Modified: head/sys/dev/ichiic/ig4_var.h ============================================================================== --- head/sys/dev/ichiic/ig4_var.h Sun Nov 3 21:00:55 2019 (r354308) +++ head/sys/dev/ichiic/ig4_var.h Sun Nov 3 21:01:53 2019 (r354309) @@ -43,7 +43,6 @@ #include "pci_if.h" #include "iicbus_if.h" -enum ig4_op { IG4_IDLE, IG4_READ, IG4_WRITE }; enum ig4_vers { IG4_HASWELL, IG4_ATOM, IG4_SKYLAKE, IG4_APL }; struct ig4_hw { @@ -78,17 +77,12 @@ struct ig4iic_softc { void *intr_handle; int intr_type; enum ig4_vers version; - enum ig4_op op; struct ig4_cfg cfg; - int cmd; uint32_t intr_mask; - int error; uint8_t last_slave; int platform_attached : 1; int use_10bit : 1; int slave_valid : 1; - int read_started : 1; - int write_started : 1; int poll: 1; /* From owner-svn-src-head@freebsd.org Sun Nov 3 21:03:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C29321A2C95; Sun, 3 Nov 2019 21:03:08 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475pL448h0z3QPB; Sun, 3 Nov 2019 21:03:08 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72FD219B77; Sun, 3 Nov 2019 21:03:08 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3L38r2071749; Sun, 3 Nov 2019 21:03:08 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3L38F2071748; Sun, 3 Nov 2019 21:03:08 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032103.xA3L38F2071748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 21:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354310 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354310 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 21:03:08 -0000 Author: wulf Date: Sun Nov 3 21:03:07 2019 New Revision: 354310 URL: https://svnweb.freebsd.org/changeset/base/354310 Log: [ig4] Rewrite ig4iic_write routine to use TX_EMPTY status flag rather than TX_NOTFULL. It makes possible interrupt utilization while waiting for empty space in TX FIFO. Modified: head/sys/dev/ichiic/ig4_iic.c Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:01:53 2019 (r354309) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:03:07 2019 (r354310) @@ -384,21 +384,31 @@ ig4iic_write(ig4iic_softc_t *sc, uint8_t *buf, uint16_ bool repeated_start, bool stop) { uint32_t cmd; - uint16_t i; + int sent = 0; + int burst, target; int error; if (len == 0) return (0); - cmd = repeated_start ? IG4_DATA_RESTART : 0; - for (i = 0; i < len; i++) { - error = wait_status(sc, IG4_STATUS_TX_NOTFULL); - if (error) - break; - cmd |= buf[i]; - cmd |= stop && i == len - 1 ? IG4_DATA_STOP : 0; - reg_write(sc, IG4_REG_DATA_CMD, cmd); - cmd = 0; + while (sent < len) { + burst = sc->cfg.txfifo_depth - + (reg_read(sc, IG4_REG_TXFLR) & IG4_FIFOLVL_MASK); + target = MIN(sent + burst, (int)len); + while(sent < target) { + cmd = buf[sent]; + if (repeated_start && sent == 0) + cmd |= IG4_DATA_RESTART; + if (stop && sent == len - 1) + cmd |= IG4_DATA_STOP; + reg_write(sc, IG4_REG_DATA_CMD, cmd); + sent++; + } + if (sent < len) { + error = wait_status(sc, IG4_STATUS_TX_EMPTY); + if (error) + break; + } } (void)reg_read(sc, IG4_REG_TX_ABRT_SOURCE); From owner-svn-src-head@freebsd.org Sun Nov 3 21:03:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B40261A2CE3; Sun, 3 Nov 2019 21:03:55 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475pLz4DmJz3xMH; Sun, 3 Nov 2019 21:03:55 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75D5319B82; Sun, 3 Nov 2019 21:03:55 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3L3td5071823; Sun, 3 Nov 2019 21:03:55 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3L3t0H071822; Sun, 3 Nov 2019 21:03:55 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032103.xA3L3t0H071822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 21:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354311 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354311 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 21:03:55 -0000 Author: wulf Date: Sun Nov 3 21:03:55 2019 New Revision: 354311 URL: https://svnweb.freebsd.org/changeset/base/354311 Log: [ig4] Convert last remaining usage of TX_NOTFULL status to TX_EMPTY in ig4iic_read routine. It makes possible interrupt utilization while waiting for empty space in TX FIFO. Modified: head/sys/dev/ichiic/ig4_iic.c Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:03:07 2019 (r354310) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:03:55 2019 (r354311) @@ -337,14 +337,14 @@ ig4iic_read(ig4iic_softc_t *sc, uint8_t *buf, uint16_t while (received < len) { burst = sc->cfg.txfifo_depth - (reg_read(sc, IG4_REG_TXFLR) & IG4_FIFOLVL_MASK); - /* Ensure we have enough free space in RXFIFO */ - burst = MIN(burst, sc->cfg.rxfifo_depth - lowat); if (burst <= 0) { - error = wait_status(sc, IG4_STATUS_TX_NOTFULL); + error = wait_status(sc, IG4_STATUS_TX_EMPTY); if (error) break; - burst = 1; + burst = sc->cfg.txfifo_depth; } + /* Ensure we have enough free space in RXFIFO */ + burst = MIN(burst, sc->cfg.rxfifo_depth - lowat); target = MIN(requested + burst, (int)len); while (requested < target) { cmd = IG4_DATA_COMMAND_RD; From owner-svn-src-head@freebsd.org Sun Nov 3 21:04:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8A411A2D0B; Sun, 3 Nov 2019 21:04:51 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475pN344Scz427f; Sun, 3 Nov 2019 21:04:51 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EDFB19B83; Sun, 3 Nov 2019 21:04:51 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3L4ptq071906; Sun, 3 Nov 2019 21:04:51 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3L4p5I071905; Sun, 3 Nov 2019 21:04:51 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032104.xA3L4p5I071905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 21:04:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354312 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354312 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 21:04:51 -0000 Author: wulf Date: Sun Nov 3 21:04:51 2019 New Revision: 354312 URL: https://svnweb.freebsd.org/changeset/base/354312 Log: [ig4] Use interrupts for waiting for empty TX FIFO Modified: head/sys/dev/ichiic/ig4_iic.c Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:03:55 2019 (r354311) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:04:51 2019 (r354312) @@ -252,6 +252,14 @@ wait_status(ig4iic_softc_t *sc, uint32_t status) set_intr_mask(sc, 0); mtx_unlock(&sc->io_lock); count_us += 10000; + } else if ((status & IG4_STATUS_TX_EMPTY) && !DO_POLL(sc)) { + mtx_lock(&sc->io_lock); + set_intr_mask(sc, IG4_INTR_TX_EMPTY); + mtx_sleep(sc, &sc->io_lock, 0, "i2cwait", + (hz + 99) / 100); /* sleep up to 10ms */ + set_intr_mask(sc, 0); + mtx_unlock(&sc->io_lock); + count_us += 10000; } else { DELAY(25); count_us += 25; @@ -861,6 +869,7 @@ ig4iic_set_config(ig4iic_softc_t *sc) * See ig4_var.h for details on interrupt handler synchronization. */ reg_write(sc, IG4_REG_RX_TL, 0); + reg_write(sc, IG4_REG_TX_TL, 0); reg_write(sc, IG4_REG_CTL, IG4_CTL_MASTER | From owner-svn-src-head@freebsd.org Sun Nov 3 21:06:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ABEAF1A2D3C; Sun, 3 Nov 2019 21:06:06 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475pPV4320z45Tp; Sun, 3 Nov 2019 21:06:06 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F7A019B85; Sun, 3 Nov 2019 21:06:06 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3L66Ul072019; Sun, 3 Nov 2019 21:06:06 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3L666M072018; Sun, 3 Nov 2019 21:06:06 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032106.xA3L666M072018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 21:06:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354313 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354313 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 21:06:06 -0000 Author: wulf Date: Sun Nov 3 21:06:06 2019 New Revision: 354313 URL: https://svnweb.freebsd.org/changeset/base/354313 Log: [ig4] Convert polling loop from status-based to interrupt-based INTR_STAT register exposes more useful informaton then STA register does e.g. it exposes error and I2C bus STOP conditions. Make it a main source of I2C transfer state. Modified: head/sys/dev/ichiic/ig4_iic.c Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:04:51 2019 (r354312) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:06:06 2019 (r354313) @@ -198,10 +198,10 @@ set_controller(ig4iic_softc_t *sc, uint32_t ctl) } /* - * Wait up to 25ms for the requested status using a 25uS polling loop. + * Wait up to 25ms for the requested interrupt using a 25uS polling loop. */ static int -wait_status(ig4iic_softc_t *sc, uint32_t status) +wait_intr(ig4iic_softc_t *sc, uint32_t intr) { uint32_t v; int error; @@ -215,8 +215,8 @@ wait_status(ig4iic_softc_t *sc, uint32_t status) /* * Check requested status */ - v = reg_read(sc, IG4_REG_I2C_STA); - if (v & status) { + v = reg_read(sc, IG4_REG_RAW_INTR_STAT); + if (v & intr) { error = 0; break; } @@ -226,7 +226,7 @@ wait_status(ig4iic_softc_t *sc, uint32_t status) * reset the timeout if we see a change in the transmit * FIFO level as progress is being made. */ - if (status & IG4_STATUS_TX_EMPTY) { + if (intr & IG4_INTR_TX_EMPTY) { v = reg_read(sc, IG4_REG_TXFLR) & IG4_FIFOLVL_MASK; if (txlvl != v) { txlvl = v; @@ -241,25 +241,16 @@ wait_status(ig4iic_softc_t *sc, uint32_t status) break; /* - * When waiting for receive data let the interrupt do its - * work, otherwise poll with the lock held. + * When polling is not requested let the interrupt do its work. */ - if ((status & IG4_STATUS_RX_NOTEMPTY) && !DO_POLL(sc)) { + if (!DO_POLL(sc)) { mtx_lock(&sc->io_lock); - set_intr_mask(sc, IG4_INTR_STOP_DET | IG4_INTR_RX_FULL); + set_intr_mask(sc, intr); mtx_sleep(sc, &sc->io_lock, 0, "i2cwait", (hz + 99) / 100); /* sleep up to 10ms */ set_intr_mask(sc, 0); mtx_unlock(&sc->io_lock); count_us += 10000; - } else if ((status & IG4_STATUS_TX_EMPTY) && !DO_POLL(sc)) { - mtx_lock(&sc->io_lock); - set_intr_mask(sc, IG4_INTR_TX_EMPTY); - mtx_sleep(sc, &sc->io_lock, 0, "i2cwait", - (hz + 99) / 100); /* sleep up to 10ms */ - set_intr_mask(sc, 0); - mtx_unlock(&sc->io_lock); - count_us += 10000; } else { DELAY(25); count_us += 25; @@ -293,7 +284,7 @@ set_slave_addr(ig4iic_softc_t *sc, uint8_t slave) /* * Wait for TXFIFO to drain before disabling the controller. */ - wait_status(sc, IG4_STATUS_TX_EMPTY); + wait_intr(sc, IG4_INTR_TX_EMPTY); set_controller(sc, 0); ctl = reg_read(sc, IG4_REG_CTL); @@ -346,7 +337,7 @@ ig4iic_read(ig4iic_softc_t *sc, uint8_t *buf, uint16_t burst = sc->cfg.txfifo_depth - (reg_read(sc, IG4_REG_TXFLR) & IG4_FIFOLVL_MASK); if (burst <= 0) { - error = wait_status(sc, IG4_STATUS_TX_EMPTY); + error = wait_intr(sc, IG4_INTR_TX_EMPTY); if (error) break; burst = sc->cfg.txfifo_depth; @@ -376,7 +367,7 @@ ig4iic_read(ig4iic_softc_t *sc, uint8_t *buf, uint16_t buf[received++] = 0xFF & reg_read(sc, IG4_REG_DATA_CMD); } else { - error = wait_status(sc, IG4_STATUS_RX_NOTEMPTY); + error = wait_intr(sc, IG4_INTR_RX_FULL); if (error) goto out; } @@ -413,7 +404,7 @@ ig4iic_write(ig4iic_softc_t *sc, uint8_t *buf, uint16_ sent++; } if (sent < len) { - error = wait_status(sc, IG4_STATUS_TX_EMPTY); + error = wait_intr(sc, IG4_INTR_TX_EMPTY); if (error) break; } From owner-svn-src-head@freebsd.org Sun Nov 3 21:07:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D8BF1A2D5C; Sun, 3 Nov 2019 21:07:13 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475pQn32Lxz49gM; Sun, 3 Nov 2019 21:07:13 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C07319B86; Sun, 3 Nov 2019 21:07:13 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3L7D97072119; Sun, 3 Nov 2019 21:07:13 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3L7CqC072117; Sun, 3 Nov 2019 21:07:12 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032107.xA3L7CqC072117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 21:07:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354314 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 21:07:13 -0000 Author: wulf Date: Sun Nov 3 21:07:12 2019 New Revision: 354314 URL: https://svnweb.freebsd.org/changeset/base/354314 Log: [ig4] Improve error detection Handle error bits of INTR_STAT and TX_ABORT registers. Move interrupt clearing from interrupt handler to polling loop to get common execution path with polled mode. Do not clear interrupts with reading of IG4_REG_CLR_INTR register as interrupts, triggered during the period from reg_read(IG4_REG_INTR_STAT) to reg_read(IG4_REG_CLR_INTR) will be missed. Instead, read each IG4_REG_CLR_* register separately. Modified: head/sys/dev/ichiic/ig4_iic.c head/sys/dev/ichiic/ig4_reg.h Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:06:06 2019 (r354313) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:07:12 2019 (r354314) @@ -164,6 +164,55 @@ set_intr_mask(ig4iic_softc_t *sc, uint32_t val) } } +static int +intrstat2iic(ig4iic_softc_t *sc, uint32_t val) +{ + uint32_t src; + + if (val & IG4_INTR_RX_UNDER) + reg_read(sc, IG4_REG_CLR_RX_UNDER); + if (val & IG4_INTR_RX_OVER) + reg_read(sc, IG4_REG_CLR_RX_OVER); + if (val & IG4_INTR_TX_OVER) + reg_read(sc, IG4_REG_CLR_TX_OVER); + + if (val & IG4_INTR_TX_ABRT) { + src = reg_read(sc, IG4_REG_TX_ABRT_SOURCE); + reg_read(sc, IG4_REG_CLR_TX_ABORT); + /* User-requested abort. Not really a error */ + if (src & IG4_ABRTSRC_TRANSFER) + return (IIC_ESTATUS); + /* Master has lost arbitration */ + if (src & IG4_ABRTSRC_ARBLOST) + return (IIC_EBUSBSY); + /* Did not receive an acknowledge from the remote slave */ + if (src & (IG4_ABRTSRC_TXNOACK_ADDR7 | + IG4_ABRTSRC_TXNOACK_ADDR10_1 | + IG4_ABRTSRC_TXNOACK_ADDR10_2 | + IG4_ABRTSRC_TXNOACK_DATA | + IG4_ABRTSRC_GENCALL_NOACK)) + return (IIC_ENOACK); + /* Programming errors */ + if (src & (IG4_ABRTSRC_GENCALL_READ | + IG4_ABRTSRC_NORESTART_START | + IG4_ABRTSRC_NORESTART_10)) + return (IIC_ENOTSUPP); + /* Other errors */ + if (src & IG4_ABRTSRC_ACKED_START) + return (IIC_EBUSERR); + } + /* + * TX_OVER, RX_OVER and RX_UNDER are caused by wrong RX/TX FIFO depth + * detection or driver's read/write pipelining errors. + */ + if (val & (IG4_INTR_TX_OVER | IG4_INTR_RX_OVER)) + return (IIC_EOVERFLOW); + if (val & IG4_INTR_RX_UNDER) + return (IIC_EUNDERFLOW); + + return (IIC_NOERR); +} + /* * Enable or disable the controller and wait for the controller to acknowledge * the state change. @@ -209,17 +258,14 @@ wait_intr(ig4iic_softc_t *sc, uint32_t intr) u_int count_us = 0; u_int limit_us = 25000; /* 25ms */ - error = IIC_ETIMEOUT; - for (;;) { /* * Check requested status */ v = reg_read(sc, IG4_REG_RAW_INTR_STAT); - if (v & intr) { - error = 0; + error = intrstat2iic(sc, v & IG4_INTR_ERR_MASK); + if (error || (v & intr)) break; - } /* * When waiting for the transmit FIFO to become empty, @@ -237,15 +283,17 @@ wait_intr(ig4iic_softc_t *sc, uint32_t intr) /* * Stop if we've run out of time. */ - if (count_us >= limit_us) + if (count_us >= limit_us) { + error = IIC_ETIMEOUT; break; + } /* * When polling is not requested let the interrupt do its work. */ if (!DO_POLL(sc)) { mtx_lock(&sc->io_lock); - set_intr_mask(sc, intr); + set_intr_mask(sc, intr | IG4_INTR_ERR_MASK); mtx_sleep(sc, &sc->io_lock, 0, "i2cwait", (hz + 99) / 100); /* sleep up to 10ms */ set_intr_mask(sc, 0); @@ -307,9 +355,17 @@ set_slave_addr(ig4iic_softc_t *sc, uint8_t slave) * IICBUS API FUNCTIONS */ static int -ig4iic_xfer_start(ig4iic_softc_t *sc, uint16_t slave) +ig4iic_xfer_start(ig4iic_softc_t *sc, uint16_t slave, bool repeated_start) { set_slave_addr(sc, slave >> 1); + + if (!repeated_start) { + /* + * Clear any previous TX/RX FIFOs overflow/underflow bits. + */ + reg_read(sc, IG4_REG_CLR_INTR); + } + return (0); } @@ -374,7 +430,6 @@ ig4iic_read(ig4iic_softc_t *sc, uint8_t *buf, uint16_t } } out: - (void)reg_read(sc, IG4_REG_TX_ABRT_SOURCE); return (error); } @@ -410,7 +465,6 @@ ig4iic_write(ig4iic_softc_t *sc, uint8_t *buf, uint16_ } } - (void)reg_read(sc, IG4_REG_TX_ABRT_SOURCE); return (error); } @@ -509,7 +563,7 @@ ig4iic_transfer(device_t dev, struct iic_msg *msgs, ui error = 0; for (i = 0; i < nmsgs; i++) { if ((msgs[i].flags & IIC_M_NOSTART) == 0) { - error = ig4iic_xfer_start(sc, msgs[i].slave); + error = ig4iic_xfer_start(sc, msgs[i].slave, rpstart); } else { if (!sc->slave_valid || (msgs[i].slave >> 1) != sc->last_slave) { @@ -1019,8 +1073,8 @@ ig4iic_intr(void *cookie) mtx_lock(&sc->io_lock); /* Ignore stray interrupts */ if (sc->intr_mask != 0 && reg_read(sc, IG4_REG_INTR_STAT) != 0) { + /* Interrupt bits are cleared in wait_intr() loop */ set_intr_mask(sc, 0); - reg_read(sc, IG4_REG_CLR_INTR); wakeup(sc); } mtx_unlock(&sc->io_lock); Modified: head/sys/dev/ichiic/ig4_reg.h ============================================================================== --- head/sys/dev/ichiic/ig4_reg.h Sun Nov 3 21:06:06 2019 (r354313) +++ head/sys/dev/ichiic/ig4_reg.h Sun Nov 3 21:07:12 2019 (r354314) @@ -328,6 +328,9 @@ #define IG4_INTR_RX_OVER 0x0002 #define IG4_INTR_RX_UNDER 0x0001 +#define IG4_INTR_ERR_MASK (IG4_INTR_TX_ABRT | IG4_INTR_TX_OVER | \ + IG4_INTR_RX_OVER | IG4_INTR_RX_UNDER) + /* * RX_TL - (RW) Receive FIFO Threshold Register 22.2.11 * TX_TL - (RW) Transmit FIFO Threshold Register 22.2.12 @@ -435,8 +438,8 @@ #define IG4_ABRTSRC_NORESTART_10 0x00000400 /* RESTART disabled */ #define IG4_ABRTSRC_NORESTART_START 0x00000200 /* RESTART disabled */ #define IG4_ABRTSRC_ACKED_START 0x00000080 /* Improper acked START */ -#define IG4_ABRTSRC_GENCALL_NOACK 0x00000020 /* Improper GENCALL */ -#define IG4_ABRTSRC_GENCALL_READ 0x00000010 /* Nobody acked GENCALL */ +#define IG4_ABRTSRC_GENCALL_READ 0x00000020 /* Improper GENCALL */ +#define IG4_ABRTSRC_GENCALL_NOACK 0x00000010 /* Nobody acked GENCALL */ #define IG4_ABRTSRC_TXNOACK_DATA 0x00000008 /* data phase no ACK */ #define IG4_ABRTSRC_TXNOACK_ADDR10_2 0x00000004 /* addr10/1 phase no ACK */ #define IG4_ABRTSRC_TXNOACK_ADDR10_1 0x00000002 /* addr10/2 phase no ACK */ From owner-svn-src-head@freebsd.org Sun Nov 3 21:08:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 87D691A2F72; Sun, 3 Nov 2019 21:08:27 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475pSC2rgnz4FlN; Sun, 3 Nov 2019 21:08:27 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 458C319B87; Sun, 3 Nov 2019 21:08:27 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3L8RPN072215; Sun, 3 Nov 2019 21:08:27 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3L8Quq072214; Sun, 3 Nov 2019 21:08:26 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032108.xA3L8Quq072214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 21:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354315 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 21:08:27 -0000 Author: wulf Date: Sun Nov 3 21:08:26 2019 New Revision: 354315 URL: https://svnweb.freebsd.org/changeset/base/354315 Log: [ig4] Set STOP condition and flush TX/RX FIFOs on error if controller has not it done for us yet. Reset controller when transfer abort is failed. Modified: head/sys/dev/ichiic/ig4_iic.c head/sys/dev/ichiic/ig4_reg.h Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:07:12 2019 (r354314) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:08:26 2019 (r354315) @@ -117,6 +117,7 @@ static const struct ig4_hw ig4iic_hw[] = { }, }; +static int ig4iic_set_config(ig4iic_softc_t *sc, bool reset); static void ig4iic_intr(void *cookie); static void ig4iic_dump(ig4iic_softc_t *sc); @@ -272,7 +273,7 @@ wait_intr(ig4iic_softc_t *sc, uint32_t intr) * reset the timeout if we see a change in the transmit * FIFO level as progress is being made. */ - if (intr & IG4_INTR_TX_EMPTY) { + if (intr & (IG4_INTR_TX_EMPTY | IG4_INTR_STOP_DET)) { v = reg_read(sc, IG4_REG_TXFLR) & IG4_FIFOLVL_MASK; if (txlvl != v) { txlvl = v; @@ -369,6 +370,34 @@ ig4iic_xfer_start(ig4iic_softc_t *sc, uint16_t slave, return (0); } +static bool +ig4iic_xfer_is_started(ig4iic_softc_t *sc) +{ + /* + * It requires that no IG4_REG_CLR_INTR or IG4_REG_CLR_START/STOP_DET + * register reads is issued after START condition. + */ + return ((reg_read(sc, IG4_REG_RAW_INTR_STAT) & + (IG4_INTR_START_DET | IG4_INTR_STOP_DET)) == IG4_INTR_START_DET); +} + +static int +ig4iic_xfer_abort(ig4iic_softc_t *sc) +{ + int error; + + /* Request send of STOP condition and flush of TX FIFO */ + set_controller(sc, IG4_I2C_ABORT | IG4_I2C_ENABLE); + /* + * Wait for the TX_ABRT interrupt with ABRTSRC_TRANSFER + * bit set in TX_ABRT_SOURCE register. + */ + error = wait_intr(sc, IG4_INTR_STOP_DET); + set_controller(sc, IG4_I2C_ENABLE); + + return (error == IIC_ESTATUS ? 0 : error); +} + /* * Amount of unread data before next burst to get better I2C bus utilization. * 2 bytes is enough in FAST mode. 8 bytes is better in FAST+ and HIGH modes. @@ -584,8 +613,27 @@ ig4iic_transfer(device_t dev, struct iic_msg *msgs, ui else error = ig4iic_write(sc, msgs[i].buf, msgs[i].len, rpstart, stop); - if (error != 0) + + if (error != 0) { + /* + * Send STOP condition if it's not done yet and flush + * both FIFOs. Do a controller soft reset if transfer + * abort is failed. + */ + if (ig4iic_xfer_is_started(sc) && + ig4iic_xfer_abort(sc) != 0) { + device_printf(sc->dev, "Failed to abort " + "transfer. Do the controller reset.\n"); + ig4iic_set_config(sc, true); + } else { + while (reg_read(sc, IG4_REG_I2C_STA) & + IG4_STATUS_RX_NOTEMPTY) + reg_read(sc, IG4_REG_DATA_CMD); + reg_read(sc, IG4_REG_TX_ABRT_SOURCE); + reg_read(sc, IG4_REG_CLR_INTR); + } break; + } rpstart = !stop; } @@ -843,7 +891,7 @@ ig4iic_get_config(ig4iic_softc_t *sc) } static int -ig4iic_set_config(ig4iic_softc_t *sc) +ig4iic_set_config(ig4iic_softc_t *sc, bool reset) { uint32_t v; @@ -851,10 +899,16 @@ ig4iic_set_config(ig4iic_softc_t *sc) if (sc->version == IG4_SKYLAKE && (v & IG4_RESTORE_REQUIRED) ) { reg_write(sc, IG4_REG_DEVIDLE_CTRL, IG4_DEVICE_IDLE | IG4_RESTORE_REQUIRED); reg_write(sc, IG4_REG_DEVIDLE_CTRL, 0); + pause("i2crst", 1); + reset = true; + } + if ((sc->version == IG4_HASWELL || sc->version == IG4_ATOM) && reset) { + reg_write(sc, IG4_REG_RESETS_HSW, IG4_RESETS_ASSERT_HSW); + reg_write(sc, IG4_REG_RESETS_HSW, IG4_RESETS_DEASSERT_HSW); + } else if (sc->version == IG4_SKYLAKE && reset) { reg_write(sc, IG4_REG_RESETS_SKL, IG4_RESETS_ASSERT_SKL); reg_write(sc, IG4_REG_RESETS_SKL, IG4_RESETS_DEASSERT_SKL); - DELAY(1000); } if (sc->version == IG4_ATOM) @@ -922,6 +976,9 @@ ig4iic_set_config(ig4iic_softc_t *sc) IG4_CTL_RESTARTEN | (sc->cfg.bus_speed & IG4_CTL_SPEED_MASK)); + /* Force setting of the target address on the next transfer */ + sc->slave_valid = 0; + return (0); } @@ -938,7 +995,7 @@ ig4iic_attach(ig4iic_softc_t *sc) ig4iic_get_config(sc); - error = ig4iic_set_config(sc); + error = ig4iic_set_config(sc, false); if (error) goto done; @@ -949,19 +1006,6 @@ ig4iic_attach(ig4iic_softc_t *sc) goto done; } -#if 0 - /* - * Don't do this, it blows up the PCI config - */ - if (sc->version == IG4_HASWELL || sc->version == IG4_ATOM) { - reg_write(sc, IG4_REG_RESETS_HSW, IG4_RESETS_ASSERT_HSW); - reg_write(sc, IG4_REG_RESETS_HSW, IG4_RESETS_DEASSERT_HSW); - } else if (sc->version = IG4_SKYLAKE) { - reg_write(sc, IG4_REG_RESETS_SKL, IG4_RESETS_ASSERT_SKL); - reg_write(sc, IG4_REG_RESETS_SKL, IG4_RESETS_DEASSERT_SKL); - } -#endif - if (set_controller(sc, IG4_I2C_ENABLE)) { device_printf(sc->dev, "controller error during attach-2\n"); error = ENXIO; @@ -1051,10 +1095,8 @@ int ig4iic_resume(ig4iic_softc_t *sc) int error; sx_xlock(&sc->call_lock); - if (ig4iic_set_config(sc)) + if (ig4iic_set_config(sc, sc->version == IG4_SKYLAKE)) device_printf(sc->dev, "controller error during resume\n"); - /* Force setting of the target address on the next transfer */ - sc->slave_valid = 0; sx_xunlock(&sc->call_lock); error = bus_generic_resume(sc->dev); Modified: head/sys/dev/ichiic/ig4_reg.h ============================================================================== --- head/sys/dev/ichiic/ig4_reg.h Sun Nov 3 21:07:12 2019 (r354314) +++ head/sys/dev/ichiic/ig4_reg.h Sun Nov 3 21:08:26 2019 (r354315) @@ -383,7 +383,9 @@ * I2C_EN - (RW) I2C Enable Register 22.2.22 * * ABORT Software can abort an I2C transfer by setting this - * bit. Hardware will clear the bit once the STOP has + * bit. In response, the controller issues the STOP + * condition over the I2C bus, followed by TX FIFO flush. + * Hardware will clear the bit once the STOP has * been detected. This bit can only be set while the * I2C interface is enabled. * From owner-svn-src-head@freebsd.org Sun Nov 3 21:10:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3A6C1A2FBD; Sun, 3 Nov 2019 21:10:48 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475pVw1gG2z4MJk; Sun, 3 Nov 2019 21:10:48 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C9A219BA0; Sun, 3 Nov 2019 21:10:48 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3LAlsv072391; Sun, 3 Nov 2019 21:10:47 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3LAlts072390; Sun, 3 Nov 2019 21:10:47 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032110.xA3LAlts072390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 21:10:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354316 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354316 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 21:10:48 -0000 Author: wulf Date: Sun Nov 3 21:10:47 2019 New Revision: 354316 URL: https://svnweb.freebsd.org/changeset/base/354316 Log: [ig4] On SkyLake controllers issue reset on attach unconditionally. It is very helpful during debugging of I2C issues. It is done only for SkyLakes due to lack of testing on other hardware. Modified: head/sys/dev/ichiic/ig4_iic.c Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:08:26 2019 (r354315) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:10:47 2019 (r354316) @@ -995,7 +995,7 @@ ig4iic_attach(ig4iic_softc_t *sc) ig4iic_get_config(sc); - error = ig4iic_set_config(sc, false); + error = ig4iic_set_config(sc, sc->version == IG4_SKYLAKE); if (error) goto done; From owner-svn-src-head@freebsd.org Sun Nov 3 21:13:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC5911A313B; Sun, 3 Nov 2019 21:13:00 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475pYS3kc8z4WCW; Sun, 3 Nov 2019 21:13:00 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 64D0219D3E; Sun, 3 Nov 2019 21:13:00 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3LD0Db077728; Sun, 3 Nov 2019 21:13:00 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3LD0FU077727; Sun, 3 Nov 2019 21:13:00 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032113.xA3LD0FU077727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 21:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354317 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354317 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 21:13:00 -0000 Author: wulf Date: Sun Nov 3 21:12:59 2019 New Revision: 354317 URL: https://svnweb.freebsd.org/changeset/base/354317 Log: [ig4] wait for bus stop condition after stop command issued It gives better error detection and ig4 driver's lock coverage in a pipelined write case Modified: head/sys/dev/ichiic/ig4_iic.c Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:10:47 2019 (r354316) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:12:59 2019 (r354317) @@ -362,7 +362,8 @@ ig4iic_xfer_start(ig4iic_softc_t *sc, uint16_t slave, if (!repeated_start) { /* - * Clear any previous TX/RX FIFOs overflow/underflow bits. + * Clear any previous TX/RX FIFOs overflow/underflow bits + * and I2C bus STOP condition. */ reg_read(sc, IG4_REG_CLR_INTR); } @@ -613,6 +614,13 @@ ig4iic_transfer(device_t dev, struct iic_msg *msgs, ui else error = ig4iic_write(sc, msgs[i].buf, msgs[i].len, rpstart, stop); + + /* Wait for error or stop condition occurred on the I2C bus */ + if (stop && error == 0) { + error = wait_intr(sc, IG4_INTR_STOP_DET); + if (error == 0) + reg_read(sc, IG4_REG_CLR_INTR); + } if (error != 0) { /* From owner-svn-src-head@freebsd.org Sun Nov 3 21:14:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5BFE1A316C; Sun, 3 Nov 2019 21:14:09 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475pZn3nTLz4ZCS; Sun, 3 Nov 2019 21:14:09 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6505F19D3F; Sun, 3 Nov 2019 21:14:09 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3LE9rr077820; Sun, 3 Nov 2019 21:14:09 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3LE9xI077819; Sun, 3 Nov 2019 21:14:09 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032114.xA3LE9xI077819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 21:14:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354318 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354318 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 21:14:09 -0000 Author: wulf Date: Sun Nov 3 21:14:08 2019 New Revision: 354318 URL: https://svnweb.freebsd.org/changeset/base/354318 Log: [ig4] Minor improvement of write pipelining With leaving some data queued in the TX FIFO at the end of write cycle. Modified: head/sys/dev/ichiic/ig4_iic.c Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:12:59 2019 (r354317) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:14:08 2019 (r354318) @@ -471,6 +471,7 @@ ig4iic_write(ig4iic_softc_t *sc, uint8_t *buf, uint16_ int sent = 0; int burst, target; int error; + bool lowat_set = false; if (len == 0) return (0); @@ -479,6 +480,11 @@ ig4iic_write(ig4iic_softc_t *sc, uint8_t *buf, uint16_ burst = sc->cfg.txfifo_depth - (reg_read(sc, IG4_REG_TXFLR) & IG4_FIFOLVL_MASK); target = MIN(sent + burst, (int)len); + /* Leave some data queued to maintain the hardware pipeline */ + if (!lowat_set && target != len) { + lowat_set = true; + reg_write(sc, IG4_REG_TX_TL, IG4_FIFO_LOWAT); + } while(sent < target) { cmd = buf[sent]; if (repeated_start && sent == 0) @@ -494,6 +500,8 @@ ig4iic_write(ig4iic_softc_t *sc, uint8_t *buf, uint16_ break; } } + if (lowat_set) + reg_write(sc, IG4_REG_TX_TL, 0); return (error); } From owner-svn-src-head@freebsd.org Sun Nov 3 21:15:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D620E1A328F; Sun, 3 Nov 2019 21:15:02 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475pbp2H8mz4cBv; Sun, 3 Nov 2019 21:15:02 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C2D719D41; Sun, 3 Nov 2019 21:15:02 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3LF1RU077910; Sun, 3 Nov 2019 21:15:01 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3LF1A6077908; Sun, 3 Nov 2019 21:15:01 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032115.xA3LF1A6077908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 21:15:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354319 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354319 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 21:15:02 -0000 Author: wulf Date: Sun Nov 3 21:15:01 2019 New Revision: 354319 URL: https://svnweb.freebsd.org/changeset/base/354319 Log: [ig4] Add generic resource methods to bus interface That allows ig4 children to allocate IRQs Modified: head/sys/dev/ichiic/ig4_acpi.c head/sys/dev/ichiic/ig4_pci.c Modified: head/sys/dev/ichiic/ig4_acpi.c ============================================================================== --- head/sys/dev/ichiic/ig4_acpi.c Sun Nov 3 21:14:08 2019 (r354318) +++ head/sys/dev/ichiic/ig4_acpi.c Sun Nov 3 21:15:01 2019 (r354319) @@ -169,6 +169,17 @@ static device_method_t ig4iic_acpi_methods[] = { DEVMETHOD(device_suspend, ig4iic_acpi_suspend), DEVMETHOD(device_resume, ig4iic_acpi_resume), + /* Bus interface */ + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), + DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), + DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + /* iicbus interface */ DEVMETHOD(iicbus_transfer, ig4iic_transfer), DEVMETHOD(iicbus_reset, ig4iic_reset), Modified: head/sys/dev/ichiic/ig4_pci.c ============================================================================== --- head/sys/dev/ichiic/ig4_pci.c Sun Nov 3 21:14:08 2019 (r354318) +++ head/sys/dev/ichiic/ig4_pci.c Sun Nov 3 21:15:01 2019 (r354319) @@ -230,6 +230,18 @@ static device_method_t ig4iic_pci_methods[] = { DEVMETHOD(device_suspend, ig4iic_pci_suspend), DEVMETHOD(device_resume, ig4iic_pci_resume), + /* Bus interface */ + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), + DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), + DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + + /* iicbus interface */ DEVMETHOD(iicbus_transfer, ig4iic_transfer), DEVMETHOD(iicbus_reset, ig4iic_reset), DEVMETHOD(iicbus_callback, ig4iic_callback), From owner-svn-src-head@freebsd.org Sun Nov 3 21:16:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA3541A335C; Sun, 3 Nov 2019 21:16:07 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475pd34mlVz4h35; Sun, 3 Nov 2019 21:16:07 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87C9C19D42; Sun, 3 Nov 2019 21:16:07 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3LG7Ju078016; Sun, 3 Nov 2019 21:16:07 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3LG6QB078013; Sun, 3 Nov 2019 21:16:06 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032116.xA3LG6QB078013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 21:16:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354320 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 21:16:07 -0000 Author: wulf Date: Sun Nov 3 21:16:06 2019 New Revision: 354320 URL: https://svnweb.freebsd.org/changeset/base/354320 Log: [ig4] Add support for CannonLake controllers They are clocked at 216MHz rate, much higher than previous models. PR: 240485 Submitted by: Neel Chauhan Modified: head/sys/dev/ichiic/ig4_iic.c head/sys/dev/ichiic/ig4_pci.c head/sys/dev/ichiic/ig4_reg.h head/sys/dev/ichiic/ig4_var.h Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:15:01 2019 (r354319) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:16:06 2019 (r354320) @@ -115,6 +115,10 @@ static const struct ig4_hw ig4iic_hw[] = { .scl_fall_time = 208, .sda_hold_time = 207, }, + [IG4_CANNONLAKE] = { + .ic_clock_rate = 216, + .sda_hold_time = 230, + }, }; static int ig4iic_set_config(ig4iic_softc_t *sc, bool reset); @@ -912,7 +916,7 @@ ig4iic_set_config(ig4iic_softc_t *sc, bool reset) uint32_t v; v = reg_read(sc, IG4_REG_DEVIDLE_CTRL); - if (sc->version == IG4_SKYLAKE && (v & IG4_RESTORE_REQUIRED) ) { + if (IG4_HAS_ADDREGS(sc->version) && (v & IG4_RESTORE_REQUIRED)) { reg_write(sc, IG4_REG_DEVIDLE_CTRL, IG4_DEVICE_IDLE | IG4_RESTORE_REQUIRED); reg_write(sc, IG4_REG_DEVIDLE_CTRL, 0); pause("i2crst", 1); @@ -922,7 +926,7 @@ ig4iic_set_config(ig4iic_softc_t *sc, bool reset) if ((sc->version == IG4_HASWELL || sc->version == IG4_ATOM) && reset) { reg_write(sc, IG4_REG_RESETS_HSW, IG4_RESETS_ASSERT_HSW); reg_write(sc, IG4_REG_RESETS_HSW, IG4_RESETS_DEASSERT_HSW); - } else if (sc->version == IG4_SKYLAKE && reset) { + } else if (IG4_HAS_ADDREGS(sc->version) && reset) { reg_write(sc, IG4_REG_RESETS_SKL, IG4_RESETS_ASSERT_SKL); reg_write(sc, IG4_REG_RESETS_SKL, IG4_RESETS_DEASSERT_SKL); } @@ -948,7 +952,7 @@ ig4iic_set_config(ig4iic_softc_t *sc, bool reset) if (sc->version == IG4_HASWELL) { v = reg_read(sc, IG4_REG_SW_LTR_VALUE); v = reg_read(sc, IG4_REG_AUTO_LTR_VALUE); - } else if (sc->version == IG4_SKYLAKE) { + } else if (IG4_HAS_ADDREGS(sc->version)) { v = reg_read(sc, IG4_REG_ACTIVE_LTR_VALUE); v = reg_read(sc, IG4_REG_IDLE_LTR_VALUE); } @@ -1011,7 +1015,7 @@ ig4iic_attach(ig4iic_softc_t *sc) ig4iic_get_config(sc); - error = ig4iic_set_config(sc, sc->version == IG4_SKYLAKE); + error = ig4iic_set_config(sc, IG4_HAS_ADDREGS(sc->version)); if (error) goto done; @@ -1089,7 +1093,7 @@ ig4iic_suspend(ig4iic_softc_t *sc) sx_xlock(&sc->call_lock); set_controller(sc, 0); - if (sc->version == IG4_SKYLAKE) { + if (IG4_HAS_ADDREGS(sc->version)) { /* * Place the device in the idle state, just to be safe */ @@ -1111,7 +1115,7 @@ int ig4iic_resume(ig4iic_softc_t *sc) int error; sx_xlock(&sc->call_lock); - if (ig4iic_set_config(sc, sc->version == IG4_SKYLAKE)) + if (ig4iic_set_config(sc, IG4_HAS_ADDREGS(sc->version))) device_printf(sc->dev, "controller error during resume\n"); sx_xunlock(&sc->call_lock); @@ -1183,7 +1187,7 @@ ig4iic_dump(ig4iic_softc_t *sc) if (sc->version == IG4_HASWELL) { REGDUMP(sc, IG4_REG_SW_LTR_VALUE); REGDUMP(sc, IG4_REG_AUTO_LTR_VALUE); - } else if (sc->version == IG4_SKYLAKE) { + } else if (IG4_HAS_ADDREGS(sc->version)) { REGDUMP(sc, IG4_REG_ACTIVE_LTR_VALUE); REGDUMP(sc, IG4_REG_IDLE_LTR_VALUE); } Modified: head/sys/dev/ichiic/ig4_pci.c ============================================================================== --- head/sys/dev/ichiic/ig4_pci.c Sun Nov 3 21:15:01 2019 (r354319) +++ head/sys/dev/ichiic/ig4_pci.c Sun Nov 3 21:16:06 2019 (r354320) @@ -90,6 +90,16 @@ static int ig4iic_pci_detach(device_t dev); #define PCI_CHIP_APL_I2C_5 0x5ab68086 #define PCI_CHIP_APL_I2C_6 0x5ab88086 #define PCI_CHIP_APL_I2C_7 0x5aba8086 +#define PCI_CHIP_CANNONLAKE_LP_I2C_0 0x9dc58086 +#define PCI_CHIP_CANNONLAKE_LP_I2C_1 0x9dc68086 +#define PCI_CHIP_CANNONLAKE_LP_I2C_2 0x9de88086 +#define PCI_CHIP_CANNONLAKE_LP_I2C_3 0x9de98086 +#define PCI_CHIP_CANNONLAKE_LP_I2C_4 0x9dea8086 +#define PCI_CHIP_CANNONLAKE_LP_I2C_5 0x9deb8086 +#define PCI_CHIP_CANNONLAKE_H_I2C_0 0xa3688086 +#define PCI_CHIP_CANNONLAKE_H_I2C_1 0xa3698086 +#define PCI_CHIP_CANNONLAKE_H_I2C_2 0xa36a8086 +#define PCI_CHIP_CANNONLAKE_H_I2C_3 0xa36b8086 struct ig4iic_pci_device { uint32_t devid; @@ -121,7 +131,17 @@ static struct ig4iic_pci_device ig4iic_pci_devices[] = { PCI_CHIP_APL_I2C_4, "Intel Apollo Lake I2C Controller-4", IG4_APL}, { PCI_CHIP_APL_I2C_5, "Intel Apollo Lake I2C Controller-5", IG4_APL}, { PCI_CHIP_APL_I2C_6, "Intel Apollo Lake I2C Controller-6", IG4_APL}, - { PCI_CHIP_APL_I2C_7, "Intel Apollo Lake I2C Controller-7", IG4_APL} + { PCI_CHIP_APL_I2C_7, "Intel Apollo Lake I2C Controller-7", IG4_APL}, + { PCI_CHIP_CANNONLAKE_LP_I2C_0, "Intel Cannon Lake-LP I2C Controller-0", IG4_CANNONLAKE}, + { PCI_CHIP_CANNONLAKE_LP_I2C_1, "Intel Cannon Lake-LP I2C Controller-1", IG4_CANNONLAKE}, + { PCI_CHIP_CANNONLAKE_LP_I2C_2, "Intel Cannon Lake-LP I2C Controller-2", IG4_CANNONLAKE}, + { PCI_CHIP_CANNONLAKE_LP_I2C_3, "Intel Cannon Lake-LP I2C Controller-3", IG4_CANNONLAKE}, + { PCI_CHIP_CANNONLAKE_LP_I2C_4, "Intel Cannon Lake-LP I2C Controller-4", IG4_CANNONLAKE}, + { PCI_CHIP_CANNONLAKE_LP_I2C_5, "Intel Cannon Lake-LP I2C Controller-5", IG4_CANNONLAKE}, + { PCI_CHIP_CANNONLAKE_H_I2C_0, "Intel Cannon Lake-H I2C Controller-0", IG4_CANNONLAKE}, + { PCI_CHIP_CANNONLAKE_H_I2C_1, "Intel Cannon Lake-H I2C Controller-1", IG4_CANNONLAKE}, + { PCI_CHIP_CANNONLAKE_H_I2C_2, "Intel Cannon Lake-H I2C Controller-2", IG4_CANNONLAKE}, + { PCI_CHIP_CANNONLAKE_H_I2C_3, "Intel Cannon Lake-H I2C Controller-3", IG4_CANNONLAKE}, }; static int Modified: head/sys/dev/ichiic/ig4_reg.h ============================================================================== --- head/sys/dev/ichiic/ig4_reg.h Sun Nov 3 21:15:01 2019 (r354319) +++ head/sys/dev/ichiic/ig4_reg.h Sun Nov 3 21:16:06 2019 (r354320) @@ -117,7 +117,7 @@ #define IG4_REG_COMP_VER 0x00F8 /* RO Component Version */ /* Available at least on Atom SoCs */ #define IG4_REG_COMP_TYPE 0x00FC /* RO Probe width/endian? (linux) */ -/* Available on Skylake-U/Y and Kaby Lake-U/Y */ +/* 0x200-0x2FF - Additional registers available on Skylake-U/Y and others */ #define IG4_REG_RESETS_SKL 0x0204 /* RW Reset Register */ #define IG4_REG_ACTIVE_LTR_VALUE 0x0210 /* RW Active LTR Value */ #define IG4_REG_IDLE_LTR_VALUE 0x0214 /* RW Idle LTR Value */ Modified: head/sys/dev/ichiic/ig4_var.h ============================================================================== --- head/sys/dev/ichiic/ig4_var.h Sun Nov 3 21:15:01 2019 (r354319) +++ head/sys/dev/ichiic/ig4_var.h Sun Nov 3 21:16:06 2019 (r354320) @@ -43,7 +43,10 @@ #include "pci_if.h" #include "iicbus_if.h" -enum ig4_vers { IG4_HASWELL, IG4_ATOM, IG4_SKYLAKE, IG4_APL }; +enum ig4_vers { IG4_HASWELL, IG4_ATOM, IG4_SKYLAKE, IG4_APL, IG4_CANNONLAKE }; +/* Controller has additional registers */ +#define IG4_HAS_ADDREGS(vers) ((vers) == IG4_SKYLAKE || \ + (vers) == IG4_CANNONLAKE) struct ig4_hw { uint32_t ic_clock_rate; /* MHz */ From owner-svn-src-head@freebsd.org Sun Nov 3 21:17:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F1991A342B; Sun, 3 Nov 2019 21:17:02 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475pf633Yxz4hZ6; Sun, 3 Nov 2019 21:17:02 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DA4719D4C; Sun, 3 Nov 2019 21:17:02 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3LH2Pu078113; Sun, 3 Nov 2019 21:17:02 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3LH2nX078112; Sun, 3 Nov 2019 21:17:02 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032117.xA3LH2nX078112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 21:17:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354321 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354321 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 21:17:02 -0000 Author: wulf Date: Sun Nov 3 21:17:01 2019 New Revision: 354321 URL: https://svnweb.freebsd.org/changeset/base/354321 Log: [ig4] Enable additional registers support on Appolo Lake controllers To be inline with intel-lpss Linux driver Modified: head/sys/dev/ichiic/ig4_var.h Modified: head/sys/dev/ichiic/ig4_var.h ============================================================================== --- head/sys/dev/ichiic/ig4_var.h Sun Nov 3 21:16:06 2019 (r354320) +++ head/sys/dev/ichiic/ig4_var.h Sun Nov 3 21:17:01 2019 (r354321) @@ -46,7 +46,7 @@ enum ig4_vers { IG4_HASWELL, IG4_ATOM, IG4_SKYLAKE, IG4_APL, IG4_CANNONLAKE }; /* Controller has additional registers */ #define IG4_HAS_ADDREGS(vers) ((vers) == IG4_SKYLAKE || \ - (vers) == IG4_CANNONLAKE) + (vers) == IG4_APL || (vers) == IG4_CANNONLAKE) struct ig4_hw { uint32_t ic_clock_rate; /* MHz */ From owner-svn-src-head@freebsd.org Sun Nov 3 21:17:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC8101A3500; Sun, 3 Nov 2019 21:17:51 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475pg32rppz4hhq; Sun, 3 Nov 2019 21:17:51 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 46BBA19D4D; Sun, 3 Nov 2019 21:17:51 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3LHpxu078187; Sun, 3 Nov 2019 21:17:51 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3LHpKK078186; Sun, 3 Nov 2019 21:17:51 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911032117.xA3LHpKK078186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 3 Nov 2019 21:17:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354322 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354322 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 21:17:51 -0000 Author: wulf Date: Sun Nov 3 21:17:50 2019 New Revision: 354322 URL: https://svnweb.freebsd.org/changeset/base/354322 Log: [ig4] Convert ithread interrupt handler to filter based one. Modified: head/sys/dev/ichiic/ig4_iic.c Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:17:01 2019 (r354321) +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:17:50 2019 (r354322) @@ -122,7 +122,7 @@ static const struct ig4_hw ig4iic_hw[] = { }; static int ig4iic_set_config(ig4iic_softc_t *sc, bool reset); -static void ig4iic_intr(void *cookie); +static driver_filter_t ig4iic_intr; static void ig4iic_dump(ig4iic_softc_t *sc); static int ig4_dump; @@ -297,12 +297,12 @@ wait_intr(ig4iic_softc_t *sc, uint32_t intr) * When polling is not requested let the interrupt do its work. */ if (!DO_POLL(sc)) { - mtx_lock(&sc->io_lock); + mtx_lock_spin(&sc->io_lock); set_intr_mask(sc, intr | IG4_INTR_ERR_MASK); - mtx_sleep(sc, &sc->io_lock, 0, "i2cwait", + msleep_spin(sc, &sc->io_lock, "i2cwait", (hz + 99) / 100); /* sleep up to 10ms */ set_intr_mask(sc, 0); - mtx_unlock(&sc->io_lock); + mtx_unlock_spin(&sc->io_lock); count_us += 10000; } else { DELAY(25); @@ -1010,7 +1010,7 @@ ig4iic_attach(ig4iic_softc_t *sc) { int error; - mtx_init(&sc->io_lock, "IG4 I/O lock", NULL, MTX_DEF); + mtx_init(&sc->io_lock, "IG4 I/O lock", NULL, MTX_SPIN); sx_init(&sc->call_lock, "IG4 call lock"); ig4iic_get_config(sc); @@ -1037,7 +1037,7 @@ ig4iic_attach(ig4iic_softc_t *sc) goto done; } error = bus_setup_intr(sc->dev, sc->intr_res, INTR_TYPE_MISC | INTR_MPSAFE, - NULL, ig4iic_intr, sc, &sc->intr_handle); + ig4iic_intr, NULL, sc, &sc->intr_handle); if (error) { device_printf(sc->dev, "Unable to setup irq: error %d\n", error); @@ -1127,19 +1127,23 @@ int ig4iic_resume(ig4iic_softc_t *sc) /* * Interrupt Operation, see ig4_var.h for locking semantics. */ -static void +static int ig4iic_intr(void *cookie) { ig4iic_softc_t *sc = cookie; + int retval = FILTER_STRAY; - mtx_lock(&sc->io_lock); + mtx_lock_spin(&sc->io_lock); /* Ignore stray interrupts */ if (sc->intr_mask != 0 && reg_read(sc, IG4_REG_INTR_STAT) != 0) { /* Interrupt bits are cleared in wait_intr() loop */ set_intr_mask(sc, 0); wakeup(sc); + retval = FILTER_HANDLED; } - mtx_unlock(&sc->io_lock); + mtx_unlock_spin(&sc->io_lock); + + return (retval); } #define REGDUMP(sc, reg) \ From owner-svn-src-head@freebsd.org Sun Nov 3 21:19:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB9F21A3694; Sun, 3 Nov 2019 21:19:52 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475pjN5t0wz4hww; Sun, 3 Nov 2019 21:19:52 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE22E19D50; Sun, 3 Nov 2019 21:19:52 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3LJqBH078314; Sun, 3 Nov 2019 21:19:52 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3LJqFb078312; Sun, 3 Nov 2019 21:19:52 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911032119.xA3LJqFb078312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 3 Nov 2019 21:19:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354323 - in head: stand/libsa/zfs sys/cddl/boot/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head: stand/libsa/zfs sys/cddl/boot/zfs X-SVN-Commit-Revision: 354323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 21:19:52 -0000 Author: tsoome Date: Sun Nov 3 21:19:52 2019 New Revision: 354323 URL: https://svnweb.freebsd.org/changeset/base/354323 Log: loader: factor out label and uberblock load from vdev_probe, add MMP checks Clean up the label read. Modified: head/stand/libsa/zfs/zfsimpl.c head/sys/cddl/boot/zfs/zfsimpl.h Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Sun Nov 3 21:17:50 2019 (r354322) +++ head/stand/libsa/zfs/zfsimpl.c Sun Nov 3 21:19:52 2019 (r354323) @@ -1549,71 +1549,104 @@ vdev_label_offset(uint64_t psize, int l, uint64_t offs } static int -vdev_probe(vdev_phys_read_t *_read, void *read_priv, spa_t **spap) +vdev_uberblock_compare(const uberblock_t *ub1, const uberblock_t *ub2) { - vdev_t vtmp; - vdev_phys_t *vdev_label = (vdev_phys_t *) zap_scratch; - vdev_phys_t *tmp_label; - spa_t *spa; - vdev_t *vdev, *top_vdev, *pool_vdev; - off_t off; + unsigned int seq1 = 0; + unsigned int seq2 = 0; + int cmp = AVL_CMP(ub1->ub_txg, ub2->ub_txg); + + if (cmp != 0) + return (cmp); + + cmp = AVL_CMP(ub1->ub_timestamp, ub2->ub_timestamp); + if (cmp != 0) + return (cmp); + + if (MMP_VALID(ub1) && MMP_SEQ_VALID(ub1)) + seq1 = MMP_SEQ(ub1); + + if (MMP_VALID(ub2) && MMP_SEQ_VALID(ub2)) + seq2 = MMP_SEQ(ub2); + + return (AVL_CMP(seq1, seq2)); +} + +static int +uberblock_verify(uberblock_t *ub) +{ + if (ub->ub_magic == BSWAP_64((uint64_t)UBERBLOCK_MAGIC)) { + byteswap_uint64_array(ub, sizeof (uberblock_t)); + } + + if (ub->ub_magic != UBERBLOCK_MAGIC || + !SPA_VERSION_IS_SUPPORTED(ub->ub_version)) + return (EINVAL); + + return (0); +} + +static int +vdev_label_read(vdev_t *vd, int l, void *buf, uint64_t offset, + size_t size) +{ blkptr_t bp; - const unsigned char *nvlist = NULL; - uint64_t val; - uint64_t guid; - uint64_t best_txg = 0; - uint64_t pool_txg, pool_guid; - const char *pool_name; - const unsigned char *vdevs; - const unsigned char *features; - int i, l, rc, is_newer; - char *upbuf; - const struct uberblock *up; + off_t off; - /* - * Load the vdev label and figure out which - * uberblock is most current. - */ - memset(&vtmp, 0, sizeof(vtmp)); - vtmp.v_phys_read = _read; - vtmp.v_read_priv = read_priv; - vtmp.v_psize = P2ALIGN(ldi_get_size(read_priv), - (uint64_t)sizeof (vdev_label_t)); + off = vdev_label_offset(vd->v_psize, l, offset); - /* Test for minimum pool size. */ - if (vtmp.v_psize < SPA_MINDEVSIZE) - return (EIO); + BP_ZERO(&bp); + BP_SET_LSIZE(&bp, size); + BP_SET_PSIZE(&bp, size); + BP_SET_CHECKSUM(&bp, ZIO_CHECKSUM_LABEL); + BP_SET_COMPRESS(&bp, ZIO_COMPRESS_OFF); + DVA_SET_OFFSET(BP_IDENTITY(&bp), off); + ZIO_SET_CHECKSUM(&bp.blk_cksum, off, 0, 0, 0); - tmp_label = zfs_alloc(sizeof(vdev_phys_t)); + return (vdev_read_phys(vd, &bp, buf, off, size)); +} - for (l = 0; l < VDEV_LABELS; l++) { - off = vdev_label_offset(vtmp.v_psize, l, - offsetof(vdev_label_t, vl_vdev_phys)); +static unsigned char * +vdev_label_read_config(vdev_t *vd, uint64_t txg) +{ + vdev_phys_t *label; + uint64_t best_txg = 0; + uint64_t label_txg = 0; + uint64_t asize; + unsigned char *nvl; + size_t nvl_size; + int error; - BP_ZERO(&bp); - BP_SET_LSIZE(&bp, sizeof(vdev_phys_t)); - BP_SET_PSIZE(&bp, sizeof(vdev_phys_t)); - BP_SET_CHECKSUM(&bp, ZIO_CHECKSUM_LABEL); - BP_SET_COMPRESS(&bp, ZIO_COMPRESS_OFF); - DVA_SET_OFFSET(BP_IDENTITY(&bp), off); - ZIO_SET_CHECKSUM(&bp.blk_cksum, off, 0, 0, 0); + label = malloc(sizeof (vdev_phys_t)); + if (label == NULL) + return (NULL); - if (vdev_read_phys(&vtmp, &bp, tmp_label, off, 0)) - continue; + nvl_size = VDEV_PHYS_SIZE - sizeof (zio_eck_t) - 4; + nvl = malloc(nvl_size); + if (nvl == NULL) { + free(label); + return (NULL); + } - if (tmp_label->vp_nvlist[0] != NV_ENCODE_XDR) + for (int l = 0; l < VDEV_LABELS; l++) { + const unsigned char *nvlist; + + if (vdev_label_read(vd, l, label, + offsetof(vdev_label_t, vl_vdev_phys), + sizeof (vdev_phys_t))) continue; - nvlist = (const unsigned char *) tmp_label->vp_nvlist + 4; - if (nvlist_find(nvlist, ZPOOL_CONFIG_POOL_TXG, - DATA_TYPE_UINT64, NULL, &pool_txg) != 0) + if (label->vp_nvlist[0] != NV_ENCODE_XDR) continue; - if (best_txg <= pool_txg) { - uint64_t asize; + nvlist = (const unsigned char *) label->vp_nvlist + 4; + error = nvlist_find(nvlist, ZPOOL_CONFIG_POOL_TXG, + DATA_TYPE_UINT64, NULL, &label_txg); + if (error != 0 || label_txg == 0) + return (nvl); - best_txg = pool_txg; - memcpy(vdev_label, tmp_label, sizeof (vdev_phys_t)); + if (label_txg <= txg && label_txg > best_txg) { + best_txg = label_txg; + memcpy(nvl, nvlist, nvl_size); /* * Use asize from pool config. We need this @@ -1621,30 +1654,87 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s */ if (nvlist_find(nvlist, ZPOOL_CONFIG_ASIZE, DATA_TYPE_UINT64, NULL, &asize) == 0) { - vtmp.v_psize = asize + + vd->v_psize = asize + VDEV_LABEL_START_SIZE + VDEV_LABEL_END_SIZE; } } } - zfs_free(tmp_label, sizeof (vdev_phys_t)); + if (best_txg == 0) { + free(nvl); + nvl = NULL; + } + return (nvl); +} - if (best_txg == 0) +static void +vdev_uberblock_load(vdev_t *vd, uberblock_t *ub) +{ + uberblock_t *buf; + + buf = malloc(VDEV_UBERBLOCK_SIZE(vd)); + if (buf == NULL) + return; + + for (int l = 0; l < VDEV_LABELS; l++) { + for (int n = 0; n < VDEV_UBERBLOCK_COUNT(vd); n++) { + if (vdev_label_read(vd, l, buf, + VDEV_UBERBLOCK_OFFSET(vd, n), + VDEV_UBERBLOCK_SIZE(vd))) + continue; + if (uberblock_verify(buf) != 0) + continue; + + if (vdev_uberblock_compare(buf, ub) > 0) + *ub = *buf; + } + } + free(buf); +} + +static int +vdev_probe(vdev_phys_read_t *_read, void *read_priv, spa_t **spap) +{ + vdev_t vtmp; + spa_t *spa; + vdev_t *vdev, *top_vdev, *pool_vdev; + unsigned char *nvlist; + uint64_t val; + uint64_t guid; + uint64_t pool_txg, pool_guid; + const char *pool_name; + const unsigned char *vdevs; + const unsigned char *features; + int rc, is_newer; + + /* + * Load the vdev label and figure out which + * uberblock is most current. + */ + memset(&vtmp, 0, sizeof(vtmp)); + vtmp.v_phys_read = _read; + vtmp.v_read_priv = read_priv; + vtmp.v_psize = P2ALIGN(ldi_get_size(read_priv), + (uint64_t)sizeof (vdev_label_t)); + + /* Test for minimum device size. */ + if (vtmp.v_psize < SPA_MINDEVSIZE) return (EIO); - if (vdev_label->vp_nvlist[0] != NV_ENCODE_XDR) + nvlist = vdev_label_read_config(&vtmp, UINT64_MAX); + if (nvlist == NULL) return (EIO); - nvlist = (const unsigned char *) vdev_label->vp_nvlist + 4; - if (nvlist_find(nvlist, ZPOOL_CONFIG_VERSION, DATA_TYPE_UINT64, NULL, &val) != 0) { + free(nvlist); return (EIO); } if (!SPA_VERSION_IS_SUPPORTED(val)) { printf("ZFS: unsupported ZFS version %u (should be %u)\n", (unsigned) val, (unsigned) SPA_VERSION); + free(nvlist); return (EIO); } @@ -1652,16 +1742,19 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s if (nvlist_find(nvlist, ZPOOL_CONFIG_FEATURES_FOR_READ, DATA_TYPE_NVLIST, NULL, &features) == 0 && nvlist_check_features_for_read(features) != 0) { + free(nvlist); return (EIO); } if (nvlist_find(nvlist, ZPOOL_CONFIG_POOL_STATE, DATA_TYPE_UINT64, NULL, &val) != 0) { + free(nvlist); return (EIO); } if (val == POOL_STATE_DESTROYED) { /* We don't boot only from destroyed pools. */ + free(nvlist); return (EIO); } @@ -1675,12 +1768,13 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s * Cache and spare devices end up here - just ignore * them. */ - /*printf("ZFS: can't find pool details\n");*/ + free(nvlist); return (EIO); } if (nvlist_find(nvlist, ZPOOL_CONFIG_IS_LOG, DATA_TYPE_UINT64, NULL, &val) == 0 && val != 0) { + free(nvlist); return (EIO); } @@ -1690,8 +1784,10 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s spa = spa_find_by_guid(pool_guid); if (spa == NULL) { spa = spa_create(pool_guid, pool_name); - if (spa == NULL) + if (spa == NULL) { + free(nvlist); return (ENOMEM); + } } if (pool_txg > spa->spa_txg) { spa->spa_txg = pool_txg; @@ -1708,18 +1804,24 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s */ if (nvlist_find(nvlist, ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64, NULL, &guid) != 0) { + free(nvlist); return (EIO); } vdev = vdev_find(guid); - if (vdev && vdev->v_phys_read) /* Has this vdev already been inited? */ + /* Has this vdev already been inited? */ + if (vdev && vdev->v_phys_read) { + free(nvlist); return (EIO); + } if (nvlist_find(nvlist, ZPOOL_CONFIG_VDEV_TREE, DATA_TYPE_NVLIST, NULL, &vdevs)) { + free(nvlist); return (EIO); } rc = vdev_init_from_nvlist(vdevs, NULL, &top_vdev, is_newer); + free(nvlist); if (rc != 0) return (rc); @@ -1729,6 +1831,7 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s STAILQ_FOREACH(pool_vdev, &spa->spa_vdevs, v_childlink) if (top_vdev == pool_vdev) break; + if (!pool_vdev && top_vdev) { top_vdev->spa = spa; STAILQ_INSERT_TAIL(&spa->spa_vdevs, top_vdev, v_childlink); @@ -1765,36 +1868,7 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s * the best uberblock and then we can actually access * the contents of the pool. */ - upbuf = zfs_alloc(VDEV_UBERBLOCK_SIZE(vdev)); - up = (const struct uberblock *)upbuf; - for (l = 0; l < VDEV_LABELS; l++) { - for (i = 0; i < VDEV_UBERBLOCK_COUNT(vdev); i++) { - off = vdev_label_offset(vdev->v_psize, l, - VDEV_UBERBLOCK_OFFSET(vdev, i)); - BP_ZERO(&bp); - DVA_SET_OFFSET(&bp.blk_dva[0], off); - BP_SET_LSIZE(&bp, VDEV_UBERBLOCK_SIZE(vdev)); - BP_SET_PSIZE(&bp, VDEV_UBERBLOCK_SIZE(vdev)); - BP_SET_CHECKSUM(&bp, ZIO_CHECKSUM_LABEL); - BP_SET_COMPRESS(&bp, ZIO_COMPRESS_OFF); - ZIO_SET_CHECKSUM(&bp.blk_cksum, off, 0, 0, 0); - - if (vdev_read_phys(vdev, &bp, upbuf, off, 0)) - continue; - - if (up->ub_magic != UBERBLOCK_MAGIC) - continue; - if (up->ub_txg < spa->spa_txg) - continue; - if (up->ub_txg > spa->spa_uberblock.ub_txg || - (up->ub_txg == spa->spa_uberblock.ub_txg && - up->ub_timestamp > - spa->spa_uberblock.ub_timestamp)) { - spa->spa_uberblock = *up; - } - } - } - zfs_free(upbuf, VDEV_UBERBLOCK_SIZE(vdev)); + vdev_uberblock_load(vdev, &spa->spa_uberblock); vdev->spa = spa; if (spap != NULL) Modified: head/sys/cddl/boot/zfs/zfsimpl.h ============================================================================== --- head/sys/cddl/boot/zfs/zfsimpl.h Sun Nov 3 21:17:50 2019 (r354322) +++ head/sys/cddl/boot/zfs/zfsimpl.h Sun Nov 3 21:19:52 2019 (r354323) @@ -63,6 +63,14 @@ #define _NOTE(s) +/* + * AVL comparator helpers + */ +#define AVL_ISIGN(a) (((a) > 0) - ((a) < 0)) +#define AVL_CMP(a, b) (((a) > (b)) - ((a) < (b))) +#define AVL_PCMP(a, b) \ + (((uintptr_t)(a) > (uintptr_t)(b)) - ((uintptr_t)(a) < (uintptr_t)(b))) + typedef enum { B_FALSE, B_TRUE } boolean_t; /* CRC64 table */ @@ -490,8 +498,16 @@ typedef struct zio_gbh { #define VDEV_PHYS_SIZE (112 << 10) #define VDEV_UBERBLOCK_RING (128 << 10) +/* + * MMP blocks occupy the last MMP_BLOCKS_PER_LABEL slots in the uberblock + * ring when MMP is enabled. + */ +#define MMP_BLOCKS_PER_LABEL 1 + +/* The largest uberblock we support is 8k. */ +#define MAX_UBERBLOCK_SHIFT (13) #define VDEV_UBERBLOCK_SHIFT(vd) \ - MAX((vd)->v_top->v_ashift, UBERBLOCK_SHIFT) + MIN(MAX((vd)->v_top->v_ashift, UBERBLOCK_SHIFT), MAX_UBERBLOCK_SHIFT) #define VDEV_UBERBLOCK_COUNT(vd) \ (VDEV_UBERBLOCK_RING >> VDEV_UBERBLOCK_SHIFT(vd)) #define VDEV_UBERBLOCK_OFFSET(vd, n) \ @@ -841,14 +857,88 @@ typedef enum pool_state { #define UBERBLOCK_MAGIC 0x00bab10c /* oo-ba-bloc! */ #define UBERBLOCK_SHIFT 10 /* up to 1K */ -struct uberblock { +#define MMP_MAGIC 0xa11cea11 /* all-see-all */ + +#define MMP_INTERVAL_VALID_BIT 0x01 +#define MMP_SEQ_VALID_BIT 0x02 +#define MMP_FAIL_INT_VALID_BIT 0x04 + +#define MMP_VALID(ubp) (ubp->ub_magic == UBERBLOCK_MAGIC && \ + ubp->ub_mmp_magic == MMP_MAGIC) +#define MMP_INTERVAL_VALID(ubp) (MMP_VALID(ubp) && (ubp->ub_mmp_config & \ + MMP_INTERVAL_VALID_BIT)) +#define MMP_SEQ_VALID(ubp) (MMP_VALID(ubp) && (ubp->ub_mmp_config & \ + MMP_SEQ_VALID_BIT)) +#define MMP_FAIL_INT_VALID(ubp) (MMP_VALID(ubp) && (ubp->ub_mmp_config & \ + MMP_FAIL_INT_VALID_BIT)) + +#define MMP_INTERVAL(ubp) ((ubp->ub_mmp_config & 0x00000000FFFFFF00) \ + >> 8) +#define MMP_SEQ(ubp) ((ubp->ub_mmp_config & 0x0000FFFF00000000) \ + >> 32) +#define MMP_FAIL_INT(ubp) ((ubp->ub_mmp_config & 0xFFFF000000000000) \ + >> 48) + +typedef struct uberblock { uint64_t ub_magic; /* UBERBLOCK_MAGIC */ uint64_t ub_version; /* SPA_VERSION */ uint64_t ub_txg; /* txg of last sync */ uint64_t ub_guid_sum; /* sum of all vdev guids */ uint64_t ub_timestamp; /* UTC time of last sync */ blkptr_t ub_rootbp; /* MOS objset_phys_t */ -}; + /* highest SPA_VERSION supported by software that wrote this txg */ + uint64_t ub_software_version; + /* Maybe missing in uberblocks we read, but always written */ + uint64_t ub_mmp_magic; + /* + * If ub_mmp_delay == 0 and ub_mmp_magic is valid, MMP is off. + * Otherwise, nanosec since last MMP write. + */ + uint64_t ub_mmp_delay; + + /* + * The ub_mmp_config contains the multihost write interval, multihost + * fail intervals, sequence number for sub-second granularity, and + * valid bit mask. This layout is as follows: + * + * 64 56 48 40 32 24 16 8 0 + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * 0 | Fail Intervals| Seq | Write Interval (ms) | VALID | + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * + * This allows a write_interval of (2^24/1000)s, over 4.5 hours + * + * VALID Bits: + * - 0x01 - Write Interval (ms) + * - 0x02 - Sequence number exists + * - 0x04 - Fail Intervals + * - 0xf8 - Reserved + */ + uint64_t ub_mmp_config; + + /* + * ub_checkpoint_txg indicates two things about the current uberblock: + * + * 1] If it is not zero then this uberblock is a checkpoint. If it is + * zero, then this uberblock is not a checkpoint. + * + * 2] On checkpointed uberblocks, the value of ub_checkpoint_txg is + * the ub_txg that the uberblock had at the time we moved it to + * the MOS config. + * + * The field is set when we checkpoint the uberblock and continues to + * hold that value even after we've rewound (unlike the ub_txg that + * is reset to a higher value). + * + * Besides checks used to determine whether we are reopening the + * pool from a checkpointed uberblock [see spa_ld_select_uberblock()], + * the value of the field is used to determine which ZIL blocks have + * been allocated according to the ms_sm when we are rewinding to a + * checkpoint. Specifically, if blk_birth > ub_checkpoint_txg, then + * the ZIL block is not allocated [see uses of spa_min_claim_txg()]. + */ + uint64_t ub_checkpoint_txg; +} uberblock_t; /* * Flags. From owner-svn-src-head@freebsd.org Sun Nov 3 21:32:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94C161A45FC for ; Sun, 3 Nov 2019 21:32:48 +0000 (UTC) (envelope-from tsoome@me.com) Received: from pv50p00im-ztdg10022001.me.com (pv50p00im-ztdg10022001.me.com [17.58.6.58]) (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 475q0H5ychz4k5K for ; Sun, 3 Nov 2019 21:32:47 +0000 (UTC) (envelope-from tsoome@me.com) Received: from nazgul.lan (148-52-235-80.sta.estpak.ee [80.235.52.148]) by pv50p00im-ztdg10022001.me.com (Postfix) with ESMTPSA id E9E58A04BE; Sun, 3 Nov 2019 21:32:43 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3594.4.19\)) Subject: Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs From: Toomas Soome In-Reply-To: Date: Sun, 3 Nov 2019 23:32:41 +0200 Cc: Andriy Gapon , Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <51E88C9A-CA94-4503-85F7-8BCD57C00961@me.com> References: <201911031325.xA3DPl3B080386@repo.freebsd.org> <276a3efd-da6c-69ca-cc4f-51c9a5b77696@FreeBSD.org> To: Kevin Bowling X-Mailer: Apple Mail (2.3594.4.19) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-11-03_14:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 mlxscore=0 mlxlogscore=879 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1911030224 X-Rspamd-Queue-Id: 475q0H5ychz4k5K X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.60 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:17.58.0.0/16]; FREEMAIL_FROM(0.00)[me.com]; MV_CASE(0.50)[]; RCPT_COUNT_FIVE(0.00)[6]; DKIM_TRACE(0.00)[me.com:+]; DMARC_POLICY_ALLOW(-0.50)[me.com,quarantine]; RECEIVED_SPAMHAUS_PBL(0.00)[148.52.235.80.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; RCVD_IN_DNSWL_LOW(-0.10)[58.6.58.17.list.dnswl.org : 127.0.5.1]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:714, ipnet:17.58.0.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[me.com]; R_DKIM_ALLOW(-0.20)[me.com:s=1a1hai]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (-4.76), ipnet: 17.58.0.0/20(-2.49), asn: 714(-2.56), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; DWL_DNSWL_LOW(-1.00)[me.com.dwl.dnswl.org : 127.0.5.1]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 21:32:48 -0000 > On 3. Nov 2019, at 22:39, Kevin Bowling = wrote: >=20 > I believe this is/was a common configuration, at least the few > spinning disk based systems I have left have a slog. >=20 On boot pool? um. well, I=E2=80=99ll kick out that return then. rgds, toomas > On Sun, Nov 3, 2019 at 10:55 AM Andriy Gapon wrote: >>=20 >> On 03/11/2019 15:25, Toomas Soome wrote: >>> Author: tsoome >>> Date: Sun Nov 3 13:25:47 2019 >>> New Revision: 354283 >>> URL: https://svnweb.freebsd.org/changeset/base/354283 >>>=20 >>> Log: >>> loader: we do not support booting from pool with log device >>>=20 >>> If pool has log device, stop there and tell about it. >>=20 >> Why? >>=20 >>> Modified: >>> head/stand/libsa/zfs/zfs.c >>> head/stand/libsa/zfs/zfsimpl.c >>> head/sys/cddl/boot/zfs/zfsimpl.h >>=20 >>=20 >>=20 >> -- >> Andriy Gapon >> _______________________________________________ >> svn-src-head@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-head >> To unsubscribe, send any mail to = "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Sun Nov 3 21:36:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 693701A4CA4; Sun, 3 Nov 2019 21:36:30 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475q4Z24xSz4kf9; Sun, 3 Nov 2019 21:36:30 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C0491A0CE; Sun, 3 Nov 2019 21:36:30 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3LaUvo090048; Sun, 3 Nov 2019 21:36:30 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3LaUcq090047; Sun, 3 Nov 2019 21:36:30 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911032136.xA3LaUcq090047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 3 Nov 2019 21:36:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354324 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 354324 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 21:36:30 -0000 Author: tsoome Date: Sun Nov 3 21:36:29 2019 New Revision: 354324 URL: https://svnweb.freebsd.org/changeset/base/354324 Log: loader: allow booting from pool with log device Apparently people are using log with boot pool, so we can not just error out there. Still we will need to investigate how to handle log properly. Modified: head/stand/libsa/zfs/zfs.c Modified: head/stand/libsa/zfs/zfs.c ============================================================================== --- head/stand/libsa/zfs/zfs.c Sun Nov 3 21:19:52 2019 (r354323) +++ head/stand/libsa/zfs/zfs.c Sun Nov 3 21:36:29 2019 (r354324) @@ -669,11 +669,14 @@ zfs_dev_open(struct open_file *f, ...) spa = spa_find_by_guid(dev->pool_guid); if (!spa) return (ENXIO); +#if 0 + /* Apparently too many are using slog with boot pool. */ if (spa->spa_with_log) { printf("Reading pool %s is not supported due to log device.\n", spa->spa_name); return (ENXIO); } +#endif mount = malloc(sizeof(*mount)); if (mount == NULL) rv = ENOMEM; From owner-svn-src-head@freebsd.org Sun Nov 3 21:56:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F89B1A696D; Sun, 3 Nov 2019 21:56:52 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475qX270Q6z4n8T; Sun, 3 Nov 2019 21:56:50 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f174.google.com with SMTP id g3so9360400ljl.11; Sun, 03 Nov 2019 13:56:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=X6EIcKYz2MbF9y+2pAywOP4PeJptNbgMjfGyUJFmxnE=; b=NF2JkBopsdKp1huusHnm/Ff4dk0fpFdyl+bdD9aIM7VHyFhlO8M8zOaTV7sEC04KeO SlZycDyL5NEntXmUlHLnDZJm265wBxiR+knG37s7L+EgLdPUNDF7Gbr5opZft/lL6/Ki dvEp/osxgDOeggs8IVUFcVZcAAm26NhQBqgdSBf4sl6+IxTwzr/mMsDD5/6yB+Q7AxI5 O4GV2MZ1mGPR2xpJTa5bpkNziJDzjfLfojzayf71zN5KowpZVTpgzc63KAhVyo6qFtfL rpw49QaydGCVNe7Aip6n5yQCSfzUjBzYcK3qmJj/MZPvZE0rbvlJX1LB4UrtcMb9tuyd Fkmg== X-Gm-Message-State: APjAAAUrWc1PTX2S7qvEu+y9iCpYzRyFM9IK9L+49JeoZR102dpfrbDw Gp8Q8wn7mb/PM1P78z7i1KEAMGnWcfw= X-Google-Smtp-Source: APXvYqzbOQZqgv/SvppeEnufsvgGUjfGM9jpgmswPvmJohenIlvNNVh86ZJOruO8uAzGFN7ryh1LxQ== X-Received: by 2002:a2e:7204:: with SMTP id n4mr8298399ljc.139.1572818208849; Sun, 03 Nov 2019 13:56:48 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id y6sm6352855lfj.75.2019.11.03.13.56.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 03 Nov 2019 13:56:48 -0800 (PST) Subject: Re: svn commit: r354324 - head/stand/libsa/zfs To: Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201911032136.xA3LaUcq090047@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: Date: Sun, 3 Nov 2019 23:56:47 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <201911032136.xA3LaUcq090047@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 475qX270Q6z4n8T X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.208.174 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-3.14 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-1.14)[ip: (-0.43), ipnet: 209.85.128.0/17(-3.20), asn: 15169(-2.03), country: US(-0.05)]; RCVD_IN_DNSWL_NONE(0.00)[174.208.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[174.208.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[96.151.72.93.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 21:56:52 -0000 On 03/11/2019 23:36, Toomas Soome wrote: > Author: tsoome > Date: Sun Nov 3 21:36:29 2019 > New Revision: 354324 > URL: https://svnweb.freebsd.org/changeset/base/354324 > > Log: > loader: allow booting from pool with log device > > Apparently people are using log with boot pool, so we can not just > error out there. Still we will need to investigate how to handle > log properly. Toomas, I still don't understand your concern here. It's true that we do not support reading from a log device, but as far as I can recall, we do not attempt to read / apply ZIL in the boot code at all. So in my understanding, whether a pool has a log or device or not should be completely irrelevant. -- Andriy Gapon From owner-svn-src-head@freebsd.org Sun Nov 3 21:57:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D674D1A6A6D for ; Sun, 3 Nov 2019 21:57:35 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475qXv1LlLz4nPg for ; Sun, 3 Nov 2019 21:57:35 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-io1-xd35.google.com with SMTP id 1so16359489iou.4 for ; Sun, 03 Nov 2019 13:57:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mRpy4P9QLGnNYC2lWVv8OUnizWNKAKUAgd2DK18Bs4Y=; b=cE+4ZBr1vhdLn37wIiBMMylBzl67RsgVZc3BNcqno9D50+QkGNlyAqSFceIhifu+p2 lCjbu7rRxFjC1kJ/oV5La2kuN5tVC4VUFasCRagCjoy3AHF4qrRTB3hpYnOrQ3H3PQaN B/HjkxtslJoGYacdGzEr4benaYLgx81L594QU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mRpy4P9QLGnNYC2lWVv8OUnizWNKAKUAgd2DK18Bs4Y=; b=NYO1Qq8fKVPGTDGK+aAxUGG1rbiGOyzZC65vhA9NLmSP8q+Z3XSzAGWrD45+BATmFI Ygh0oBF9y84GHc46oG/+pBmUYb/jwSRBxvhvIyz00FW3roLC+xftV1ZT4HrdFijaOgvb td/HPAsv2xhs1xvAnVA4ROBvriC47Dpjv0ApaWtYaucuKAJhcnpxtnyAMrJanH2Trbza hyVmzrsm0eBm6WaMLYt0VTHnB7CjTOKSpt9o2viHYn5o0c3eNE7Az0QpnfOWcO79UvJ/ ldLzrg8usr6a39UewEaqlV1WYIShE9UMzKWrKNjxno0e+AWb4vI90U0h4kWsyI3TAmkO xxVw== X-Gm-Message-State: APjAAAVUW8xYNQ3N71CmoKPweA2ZHAij6P2lyxXKdQFpW15WxssBerhg scRSY7N1E5kslb/pjnrqebH1GA2+iqLyjTb54cbEFw== X-Google-Smtp-Source: APXvYqwNijrL6D4XvOMBmNH62DFZYgN7SG5mSRb+sdA5xk4Rkt692aQMfDO4bXhqAK8bMLo5ki7iLUAKoiK63i2n6nc= X-Received: by 2002:a05:6602:198:: with SMTP id m24mr6967528ioo.238.1572818253402; Sun, 03 Nov 2019 13:57:33 -0800 (PST) MIME-Version: 1.0 References: <201911031325.xA3DPl3B080386@repo.freebsd.org> <276a3efd-da6c-69ca-cc4f-51c9a5b77696@FreeBSD.org> <51E88C9A-CA94-4503-85F7-8BCD57C00961@me.com> In-Reply-To: <51E88C9A-CA94-4503-85F7-8BCD57C00961@me.com> From: Kevin Bowling Date: Sun, 3 Nov 2019 14:57:22 -0700 Message-ID: Subject: Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs To: Toomas Soome Cc: Andriy Gapon , Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 475qXv1LlLz4nPg X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none (invalid DKIM record) header.d=kev009.com header.s=google header.b=cE+4ZBr1; dmarc=none; spf=pass (mx1.freebsd.org: domain of kevin.bowling@kev009.com designates 2607:f8b0:4864:20::d35 as permitted sender) smtp.mailfrom=kevin.bowling@kev009.com X-Spamd-Result: default: False [-4.40 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[kev009.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[kev009.com:~]; RCVD_IN_DNSWL_NONE(0.00)[5.3.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_DKIM_PERMFAIL(0.00)[kev009.com:s=google]; FREEMAIL_TO(0.00)[me.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.10)[ip: (-6.03), ipnet: 2607:f8b0::/32(-2.38), asn: 15169(-2.03), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 21:57:35 -0000 Yes, some systems with two disks in a mirror and an ssd as slog. What are you trying to guard against? I have never seen an issue but would like to be aware of potential problems with that system. On Sun, Nov 3, 2019 at 2:32 PM Toomas Soome wrote: > > > > On 3. Nov 2019, at 22:39, Kevin Bowling > wrote: > > > > I believe this is/was a common configuration, at least the few > > spinning disk based systems I have left have a slog. > > > > On boot pool? um. well, I=E2=80=99ll kick out that return then. > > rgds, > toomas > > > On Sun, Nov 3, 2019 at 10:55 AM Andriy Gapon wrote: > >> > >> On 03/11/2019 15:25, Toomas Soome wrote: > >>> Author: tsoome > >>> Date: Sun Nov 3 13:25:47 2019 > >>> New Revision: 354283 > >>> URL: https://svnweb.freebsd.org/changeset/base/354283 > >>> > >>> Log: > >>> loader: we do not support booting from pool with log device > >>> > >>> If pool has log device, stop there and tell about it. > >> > >> Why? > >> > >>> Modified: > >>> head/stand/libsa/zfs/zfs.c > >>> head/stand/libsa/zfs/zfsimpl.c > >>> head/sys/cddl/boot/zfs/zfsimpl.h > >> > >> > >> > >> -- > >> Andriy Gapon > >> _______________________________________________ > >> svn-src-head@freebsd.org mailing list > >> https://lists.freebsd.org/mailman/listinfo/svn-src-head > >> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org= " > > From owner-svn-src-head@freebsd.org Sun Nov 3 22:02:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F5D61A77AB; Sun, 3 Nov 2019 22:02:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 475qfZ0yXFz4pKV; Sun, 3 Nov 2019 22:02:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id xA3M2MP3033742 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 4 Nov 2019 00:02:25 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua xA3M2MP3033742 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id xA3M2Mjl033741; Mon, 4 Nov 2019 00:02:22 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 4 Nov 2019 00:02:22 +0200 From: Konstantin Belousov To: Vladimir Kondratyev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r354322 - head/sys/dev/ichiic Message-ID: <20191103220222.GX73312@kib.kiev.ua> References: <201911032117.xA3LHpKK078186@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201911032117.xA3LHpKK078186@repo.freebsd.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 475qfZ0yXFz4pKV X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 22:02:30 -0000 On Sun, Nov 03, 2019 at 09:17:51PM +0000, Vladimir Kondratyev wrote: > Author: wulf > Date: Sun Nov 3 21:17:50 2019 > New Revision: 354322 > URL: https://svnweb.freebsd.org/changeset/base/354322 > > Log: > [ig4] Convert ithread interrupt handler to filter based one. And why ? You need some reason to use filters/spinlocks, otherwise it only taxes system latency. From owner-svn-src-head@freebsd.org Sun Nov 3 22:17:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F06D1A965D; Sun, 3 Nov 2019 22:17:50 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475r0G25GMz4r7X; Sun, 3 Nov 2019 22:17:50 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26D3B1A818; Sun, 3 Nov 2019 22:17:50 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA3MHo4U019965; Sun, 3 Nov 2019 22:17:50 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA3MHnro019964; Sun, 3 Nov 2019 22:17:49 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201911032217.xA3MHnro019964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 3 Nov 2019 22:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354325 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 354325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 22:17:50 -0000 Author: andrew Date: Sun Nov 3 22:17:49 2019 New Revision: 354325 URL: https://svnweb.freebsd.org/changeset/base/354325 Log: Move the struct debug_monitor_state out of _KERNEL. Some userland libraries incude machine/pcb.h and this needs the full definition of struct debug_monitor_state. To allow this to work move stuct debug_monitor_state out of the _KERNEL guard. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/include/debug_monitor.h Modified: head/sys/arm64/include/debug_monitor.h ============================================================================== --- head/sys/arm64/include/debug_monitor.h Sun Nov 3 21:36:29 2019 (r354324) +++ head/sys/arm64/include/debug_monitor.h Sun Nov 3 22:17:49 2019 (r354325) @@ -32,8 +32,6 @@ #ifndef _MACHINE_DEBUG_MONITOR_H_ #define _MACHINE_DEBUG_MONITOR_H_ -#ifdef _KERNEL - #define DBG_BRP_MAX 16 #define DBG_WRP_MAX 16 @@ -47,6 +45,8 @@ struct debug_monitor_state { uint64_t dbg_wcr[DBG_WRP_MAX]; uint64_t dbg_wvr[DBG_WRP_MAX]; }; + +#ifdef _KERNEL enum dbg_access_t { HW_BREAKPOINT_X = 0, From owner-svn-src-head@freebsd.org Sun Nov 3 22:46:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B9841AA630; Sun, 3 Nov 2019 22:46:47 +0000 (UTC) (envelope-from vladimir@kondratyev.su) Received: from corp.infotel.ru (corp.infotel.ru [195.170.219.3]) by mx1.freebsd.org (Postfix) with ESMTP id 475rdd00cCz4syM; Sun, 3 Nov 2019 22:46:44 +0000 (UTC) (envelope-from vladimir@kondratyev.su) Received: from corp (corp.infotel.ru [195.170.219.3]) by corp.infotel.ru (Postfix) with ESMTP id 936256E499; Mon, 4 Nov 2019 01:46:37 +0300 (MSK) X-Virus-Scanned: amavisd-new at corp.infotel.ru Received: from corp.infotel.ru ([195.170.219.3]) by corp (corp.infotel.ru [195.170.219.3]) (amavisd-new, port 10024) with ESMTP id h0YruLfpf1xF; Mon, 4 Nov 2019 01:46:37 +0300 (MSK) Received: from mail.cicgroup.ru (unknown [195.170.219.74]) by corp.infotel.ru (Postfix) with ESMTP id 068CC6E492; Mon, 4 Nov 2019 01:46:37 +0300 (MSK) Received: from mail.cicgroup.ru (localhost [127.0.0.1]) by mail.cicgroup.ru (Postfix) with ESMTP id B915B422123; Mon, 4 Nov 2019 01:46:36 +0300 (MSK) X-Virus-Scanned: amavisd-new at cicgroup.ru Received: from mail.cicgroup.ru ([127.0.0.1]) by mail.cicgroup.ru (mail.cicgroup.ru [127.0.0.1]) (amavisd-new, port 10024) with SMTP id OACSyxQR3AJe; Mon, 4 Nov 2019 01:46:34 +0300 (MSK) Received: from [192.168.0.30] (gateway [10.0.2.2]) by mail.cicgroup.ru (Postfix) with ESMTPA id DA37B422122; Mon, 4 Nov 2019 01:46:33 +0300 (MSK) Subject: Re: svn commit: r354322 - head/sys/dev/ichiic To: Konstantin Belousov , Vladimir Kondratyev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201911032117.xA3LHpKK078186@repo.freebsd.org> <20191103220222.GX73312@kib.kiev.ua> From: Vladimir Kondratyev Autocrypt: addr=vladimir@kondratyev.su; prefer-encrypt=mutual; keydata= mQENBFkI9Y8BCAC44UZYE8ZswFr/LHNHutuCmrbfP0j6jYl6zkW9VeM3cXVDjDsL3h9JhEFH zF9Or0muwHjspNuVdP2ot9vH8FCGAGEYS/GrzEEKxj4yoxAZxWnGUwzFiaf8fCtlrq5D9vOd /HSm6tb5YbcC/t/46hSwyPZ4i07rtsxmeozrKNx9H2gkcY0/AfmZ+UxY90/cj/F3aNk4wYLH gC95N99jaZvwPFX8wW5k++YaThXo8TNGQaxmC28cFFPdc1qICYdzYxS7kbTlGKp37lWmV9Z6 FursbfIkJZ7Rzw7NjGGijj4XjKif91ZwQNz/BfO58xrookQCibVCJ3JKcZo4NZ7rWTWlABEB AAG0LFZsYWRpbWlyIEtvbmRyYXR5ZXYgPHZsYWRpbWlyQGtvbmRyYXR5ZXYuc3U+iQFUBBMB CgA+FiEEkwnJqomIwH/siVElg2u+IHApX3UFAlkJEuQCGwMFCQWjmoAFCwkIBwMFFQoJCAsF FgMCAQACHgECF4AACgkQg2u+IHApX3Wsmwf/bSUJeS0KXHQHH/XZwaqi0CfWxifrWfC+K62O DVA5TZZfZTs8h4Pov2DBvgx/DaQIVXeZazDPZho4v5SCrSulv//gboO6iN/7ZVnSRwQfyOp+ xnXLOzjC4mv4GjYc5sILJWQbWF4UPBGrBiFjtWrYjrRwVE6o/ThEXP92uu7suS2+U+f0zBh+ NZpJdf1T6EUN/dn8QLCyASNW1uYXzQ//5kTFc3ECC0VXzTnCZ7WWzkEOMbaVOwR25K5hCrg/ e41zrGlq8xLQhnXje+ZvG5DZkWKiZ0hUrB7nA8RLOVN6I1rzqStQjYxQuQqGu0Om/Bv6Rp+t AwEaLQdYOdXEyMZRe7kBDQRZCPWPAQgAt5NVWoIBXPqs/lo3w3JxUZ2f2R1bTqdWNBHlKI1Y r6WDHSMWT9WM/vycZSG5N6a051ZGhyPS6LNoxxqokYwgLr9VMsBTS7pA8Nx8hzyjIAAYCQqX 2tluX2FzvcJUaEZDo3pt93IpHzvf924A1nvxP4n9NyfTu4GBZ+07sBJEploKugmAVIzXD1m6 zr1xeo6LF5Adz1b0WP2cU88gv66FiuZp9Cj6DTGdIta6hQqAtrBxINVd5XR99eXrZ0+YSiIi 7ywa3dDti8NXwkZkn4pGPDkCjb34PL1kdoD/yOCpp9yAdflF8T8KObjWuivnAMOYfmGGN30n nhh8Ub9n2DVw7wARAQABiQE8BBgBCgAmFiEEkwnJqomIwH/siVElg2u+IHApX3UFAlkI9Y8C GwwFCQWjmoAACgkQg2u+IHApX3XzJggAs8Hiu/YeLfmZYp/57eaK/BrtW5TeLrKd5x4knFkY dxWOJ7ZJIIr7fhUH9OZKyAMYPzJaWuxhAuDIZiH39MZFnAhx6LnycCIQMY6CP4gJ8Y2ssvf7 eNcFRqL1xvEmAELMC5HtpnLp914xlYkBoqcU2rH7X0Qza4GvafQHHVrjc+DqqKbF6YjPsEew Fp4mqvvIxi71UiWy95q0x8tC3Cbm5hUCl2i5nl0iaWNNMkuh6is+jLJZ9W5CfEPcp+W2Vekd UTm4zN0+uaR7br3Lr3GbBJPlLHrH1haK6nJmyfVzf1MbK8wqIHiH1wWmIxC96QHKCEzRDjdf IVYGqb/YykLjBw== Message-ID: Date: Mon, 4 Nov 2019 01:46:14 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <20191103220222.GX73312@kib.kiev.ua> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 475rdd00cCz4syM X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of vladimir@kondratyev.su has no SPF policy when checking 195.170.219.3) smtp.mailfrom=vladimir@kondratyev.su X-Spamd-Result: default: False [0.51 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.69)[-0.686,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[kondratyev.su]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.19)[0.191,0]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8299, ipnet:195.170.192.0/19, country:RU]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.00)[country: RU(0.01)] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 22:46:47 -0000 On 04.11.2019 01:02, Konstantin Belousov wrote: > On Sun, Nov 03, 2019 at 09:17:51PM +0000, Vladimir Kondratyev wrote: >> Author: wulf >> Date: Sun Nov 3 21:17:50 2019 >> New Revision: 354322 >> URL: https://svnweb.freebsd.org/changeset/base/354322 >> >> Log: >> [ig4] Convert ithread interrupt handler to filter based one. > And why ? > > You need some reason to use filters/spinlocks, otherwise it only > taxes system latency. The only thing ig4 interrupt handler does is a waking up the user thread, so postponing it to ithread looks like a wasting of CPU cycles. Spinlock here is acting as condition variable not as a data protection lock. It is taken around msleep(). I can replace it with cv_* calls if current usage confuses someone Ig4 access is serialized with sx lock so it is impossible to get any congestion on spinlock From owner-svn-src-head@freebsd.org Sun Nov 3 22:48:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4FDBD1AA676 for ; Sun, 3 Nov 2019 22:48:01 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 475rg46S89z4t6k for ; Sun, 3 Nov 2019 22:48:00 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1572821279; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=kiPpHX5no+Ne1u1b4u88fzRluOErREfPq1hEEiDoRIYMIMyUh4pPoBEAJguWcb6fgLHXsPvLNt1Ov 5b29LipZ1qEIGZ5TSl7mapgiZDiBje/lM5Wggc3lZTJJMTXnuqOm2q+CwNWgC/2ZKrnSIY8SrJqjNm EqEJkZW4Dh3bV8wBwMttcqJ5NAZGB1jgBtZNTSATJ+ATmxBiMkizqpfxhry1cL886o0C60t2/uhyW+ AxWoYHQUeP9TGmgVRdY729cM1dShgB1iIxx8YEKWVIUx06olWH5+bPYhZmTDEte5T1gL8ozrOV35uw qEm9Bq9JFn+Zpsxs2ttrkJBis00e5TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=wYH1OUZ4LmWdsJoZ82b4+pyeA6hILXZNYw/hfWN+Gvk=; b=PCNPjBvgZVGIQt2vDJ2nhZhxD0m1mgtVLiiOHrxZb0u/SjTCrdHC5frcgNSevlVDx0Mt3+YzclYPJ gwj7Z848C2GOvv8d58rygdaJe8qoJuIofTcJHHgOP2wg/4BeQ72wol3CqHE0/69W/2vUZXkJx/F7EX Ia56f4Mso6qf3jUHIG4FFA3+KFig+tHmLbf/g5XcWOS/s5LnybCWNmJa9eV9r0g2FsGLr8m2E08xxp QkMH9vGWvci/Z5zAeXHPAL60pOH18VSxN8iaib5ZmCITk6MRqL+jRPkHqtC/omo4Mnf8GInN0k3xfa vgdvsd3KdYTdQ3myBpCMViO+jR8whIQ== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=wYH1OUZ4LmWdsJoZ82b4+pyeA6hILXZNYw/hfWN+Gvk=; b=sE9fklTfrF8j+HKAs92KUC4Sn5/Af8dWJpC36rLOEx1+MaaxN12WutluqhnZ6EaVQwUQHww+g8toF LqYSpyh06CRETXkgchRsaOajqmlnkCSmAGq3kDv59vjkMJQVJZbtXHgk3UTv6UNDoIZyLvyL5zMnVL xq6ufiR6aLKR+CUQkj+cqi0owNAFNOFpl6sQ21ZEG5rUfZiSu4NU+SVhGQRJWGEqakaC2dwyTp0OxZ AMR50RLfJyQeq5sP71g/5vrDj6tuN4MFHwc+aWGG9UWB5KI6eoq8Lj2ruxW0+0RCy/Sy1eDgCnDx5l PHq4qsIDBjvnEZ2dtggUN978L3FZ/tw== X-MHO-RoutePath: aGlwcGll X-MHO-User: fa5cfedc-fe8b-11e9-b80b-052b4a66b6b2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id fa5cfedc-fe8b-11e9-b80b-052b4a66b6b2; Sun, 03 Nov 2019 22:47:58 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id xA3MluBA085719; Sun, 3 Nov 2019 15:47:56 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r354322 - head/sys/dev/ichiic From: Ian Lepore To: Vladimir Kondratyev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 03 Nov 2019 15:47:56 -0700 In-Reply-To: <201911032117.xA3LHpKK078186@repo.freebsd.org> References: <201911032117.xA3LHpKK078186@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 475rg46S89z4t6k X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.99 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.992,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 22:48:01 -0000 On Sun, 2019-11-03 at 21:17 +0000, Vladimir Kondratyev wrote: > Author: wulf > Date: Sun Nov 3 21:17:50 2019 > New Revision: 354322 > URL: https://svnweb.freebsd.org/changeset/base/354322 > > Log: > [ig4] Convert ithread interrupt handler to filter based one. > This doesn't seem like a very good idea. I2c comms is way too slow to benefit from handling the interrupt in the primary interrupt context. All it will accomplish is to make other (perhaps more time-critical) interrupts wait for service while this handler runs (although, admittedly, this handler doesn't do much more than a couple register accesses and a wakeup()). -- Ian > Modified: > head/sys/dev/ichiic/ig4_iic.c > > Modified: head/sys/dev/ichiic/ig4_iic.c > ===================================================================== > ========= > --- head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:17:01 2019 (r354 > 321) > +++ head/sys/dev/ichiic/ig4_iic.c Sun Nov 3 21:17:50 2019 (r354 > 322) > @@ -122,7 +122,7 @@ static const struct ig4_hw ig4iic_hw[] = { > }; > > static int ig4iic_set_config(ig4iic_softc_t *sc, bool reset); > -static void ig4iic_intr(void *cookie); > +static driver_filter_t ig4iic_intr; > static void ig4iic_dump(ig4iic_softc_t *sc); > > static int ig4_dump; > @@ -297,12 +297,12 @@ wait_intr(ig4iic_softc_t *sc, uint32_t intr) > * When polling is not requested let the interrupt do > its work. > */ > if (!DO_POLL(sc)) { > - mtx_lock(&sc->io_lock); > + mtx_lock_spin(&sc->io_lock); > set_intr_mask(sc, intr | IG4_INTR_ERR_MASK); > - mtx_sleep(sc, &sc->io_lock, 0, "i2cwait", > + msleep_spin(sc, &sc->io_lock, "i2cwait", > (hz + 99) / 100); /* sleep up to 10ms > */ > set_intr_mask(sc, 0); > - mtx_unlock(&sc->io_lock); > + mtx_unlock_spin(&sc->io_lock); > count_us += 10000; > } else { > DELAY(25); > @@ -1010,7 +1010,7 @@ ig4iic_attach(ig4iic_softc_t *sc) > { > int error; > > - mtx_init(&sc->io_lock, "IG4 I/O lock", NULL, MTX_DEF); > + mtx_init(&sc->io_lock, "IG4 I/O lock", NULL, MTX_SPIN); > sx_init(&sc->call_lock, "IG4 call lock"); > > ig4iic_get_config(sc); > @@ -1037,7 +1037,7 @@ ig4iic_attach(ig4iic_softc_t *sc) > goto done; > } > error = bus_setup_intr(sc->dev, sc->intr_res, INTR_TYPE_MISC | > INTR_MPSAFE, > - NULL, ig4iic_intr, sc, &sc- > >intr_handle); > + ig4iic_intr, NULL, sc, &sc- > >intr_handle); > if (error) { > device_printf(sc->dev, > "Unable to setup irq: error %d\n", > error); > @@ -1127,19 +1127,23 @@ int ig4iic_resume(ig4iic_softc_t *sc) > /* > * Interrupt Operation, see ig4_var.h for locking semantics. > */ > -static void > +static int > ig4iic_intr(void *cookie) > { > ig4iic_softc_t *sc = cookie; > + int retval = FILTER_STRAY; > > - mtx_lock(&sc->io_lock); > + mtx_lock_spin(&sc->io_lock); > /* Ignore stray interrupts */ > if (sc->intr_mask != 0 && reg_read(sc, IG4_REG_INTR_STAT) != 0) > { > /* Interrupt bits are cleared in wait_intr() loop */ > set_intr_mask(sc, 0); > wakeup(sc); > + retval = FILTER_HANDLED; > } > - mtx_unlock(&sc->io_lock); > + mtx_unlock_spin(&sc->io_lock); > + > + return (retval); > } > > #define REGDUMP(sc, reg) \ From owner-svn-src-head@freebsd.org Sun Nov 3 22:59:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8FFE51AAB9E; Sun, 3 Nov 2019 22:59:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 475rwJ3zT4z4v8X; Sun, 3 Nov 2019 22:59:28 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id xA3MxLvH046748 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 4 Nov 2019 00:59:24 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua xA3MxLvH046748 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id xA3MxLle046747; Mon, 4 Nov 2019 00:59:21 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 4 Nov 2019 00:59:21 +0200 From: Konstantin Belousov To: Vladimir Kondratyev Cc: Vladimir Kondratyev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r354322 - head/sys/dev/ichiic Message-ID: <20191103225921.GZ73312@kib.kiev.ua> References: <201911032117.xA3LHpKK078186@repo.freebsd.org> <20191103220222.GX73312@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 475rwJ3zT4z4v8X X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_FIVE(0.00)[5]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(0.00)[ip: (-2.64), ipnet: 2001:470::/32(-4.61), asn: 6939(-3.47), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 22:59:29 -0000 On Mon, Nov 04, 2019 at 01:46:14AM +0300, Vladimir Kondratyev wrote: > On 04.11.2019 01:02, Konstantin Belousov wrote: > > On Sun, Nov 03, 2019 at 09:17:51PM +0000, Vladimir Kondratyev wrote: > >> Author: wulf > >> Date: Sun Nov 3 21:17:50 2019 > >> New Revision: 354322 > >> URL: https://svnweb.freebsd.org/changeset/base/354322 > >> > >> Log: > >> [ig4] Convert ithread interrupt handler to filter based one. > > And why ? > > > > You need some reason to use filters/spinlocks, otherwise it only > > taxes system latency. > > > The only thing ig4 interrupt handler does is a waking up the user > thread, so postponing it to ithread looks like a wasting of CPU cycles. > > Spinlock here is acting as condition variable not as a data protection > lock. It is taken around msleep(). I can replace it with cv_* calls if > current usage confuses someone > > Ig4 access is serialized with sx lock so it is impossible to get any > congestion on spinlock > You need to lock the same spinlock in the sleeping thread and in the interrupt context. I do not remember why these drivers ended up using sx for their main data synchronization, I suspect it was due to copyouts. From owner-svn-src-head@freebsd.org Sun Nov 3 22:59:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60D321AAC16 for ; Sun, 3 Nov 2019 22:59:59 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475rwt2vDsz4vHM for ; Sun, 3 Nov 2019 22:59:58 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by mail-il1-x131.google.com with SMTP id w1so4341993ilq.11 for ; Sun, 03 Nov 2019 14:59:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8UG2nfnZ87FGKXSEfDE4GMCXPkCUGRy9EvCf42Q3MAg=; b=JHcVvw+u2gcu7+/UwPP1Q4TmPUoNX843/MhsWwjHfj2lNWgUnNWBJo0Ki9pbhmeR8A jD3WRwiAQ9oaON9/y7Ch9VzVKFcgQ7yMFqlhJh5OFnDDD4CzS1voGbXJuSa37+zNuxfM 9JNuZLvkAhrQPJ43nltuWxYJG9p+ih+eEBCT0CYzONfHeaBLw65Lb+d9nfY4xP7u86C2 fR4I8siVFollNBTVPy9RjO6dmFC+cm78EyGAxOHptEP8bVsopYqDsOXLNIsFO9UpzUsp ku3TjMLnW9Xg8ngopSuHuWIccbbxULYW8qagh/6lE25cApOx0YtDRLWtdDvKKT9vQJDS 3vKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8UG2nfnZ87FGKXSEfDE4GMCXPkCUGRy9EvCf42Q3MAg=; b=P0tvuIS5tgBDiSd2QACcAluHYkLuFnzUJwo5o3LYrHG+3SkqFe+dCCVQx1EI9keGtK 8CVXZPzoKGRfBZQdHmjgmtfxRhKS7anIn3yG6S4LsOSTKqf1C7do23YeSgO5GiS8qb+W Vcn2Z9bsxuRVPxRuksj69C8zRPD44z1hT/5jfKn+syGAvUWU9i5oYJMzgIC57yb130uu FD82NGjueCwKe/RGTzYR56xROx96ZZqCxynuJ7iQKybmqOKztM6KHE9E9JTxy+TegxDU wmDQKCkH+96fSqiJKNChIlUpE5Rf40MCVSU+Ag1TL6GdFFxfyh5j0R5oEPRxlKr9q2oE p4OA== X-Gm-Message-State: APjAAAUa4VAAOx1esS2g0HClLVFMlGzTuLFjgyhbfZwfymhe/2yFcGk6 xZVmN+hM2KYw5rTZKsZiGCwZT4Yp/r8OONNtL/lFPQ/X X-Google-Smtp-Source: APXvYqyBEzTTrRcPjqpSUg0PpMiCGR4Vg8qjjFs5EJv8NXqUMCd7YLivcis5fQDb3U4e+iaPIBFDc7K0At+YrxpRnHk= X-Received: by 2002:a92:5c5d:: with SMTP id q90mr26480746ilb.22.1572821997071; Sun, 03 Nov 2019 14:59:57 -0800 (PST) MIME-Version: 1.0 References: <201911031325.xA3DPl3B080386@repo.freebsd.org> In-Reply-To: <201911031325.xA3DPl3B080386@repo.freebsd.org> From: Steven Hartland Date: Sun, 3 Nov 2019 22:59:46 +0000 Message-ID: Subject: Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs To: Toomas Soome Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 475rwt2vDsz4vHM X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=multiplay-co-uk.20150623.gappssmtp.com header.s=20150623 header.b=JHcVvw+u; dmarc=pass (policy=none) header.from=multiplay.co.uk; spf=pass (mx1.freebsd.org: domain of steven@multiplay.co.uk designates 2607:f8b0:4864:20::131 as permitted sender) smtp.mailfrom=steven@multiplay.co.uk X-Spamd-Result: default: False [-4.07 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[multiplay-co-uk.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; TO_DN_SOME(0.00)[]; URI_COUNT_ODD(1.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[multiplay-co-uk.20150623.gappssmtp.com:+]; MIME_BASE64_TEXT(0.10)[]; RCVD_IN_DNSWL_NONE(0.00)[1.3.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; DMARC_POLICY_ALLOW(-0.50)[multiplay.co.uk,none]; FORGED_SENDER(0.30)[steven.hartland@multiplay.co.uk,steven@multiplay.co.uk]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.47)[ip: (-7.90), ipnet: 2607:f8b0::/32(-2.38), asn: 15169(-2.03), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[steven.hartland@multiplay.co.uk,steven@multiplay.co.uk]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 22:59:59 -0000 Pretty sure we had at least two systems using root with log just fine, so would be interested to know why this isn=E2=80=99t supported anymore? On Sun, 3 Nov 2019 at 13:26, Toomas Soome wrote: > Author: tsoome > Date: Sun Nov 3 13:25:47 2019 > New Revision: 354283 > URL: https://svnweb.freebsd.org/changeset/base/354283 > > Log: > loader: we do not support booting from pool with log device > > If pool has log device, stop there and tell about it. > > Modified: > head/stand/libsa/zfs/zfs.c > head/stand/libsa/zfs/zfsimpl.c > head/sys/cddl/boot/zfs/zfsimpl.h > > Modified: head/stand/libsa/zfs/zfs.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/stand/libsa/zfs/zfs.c Sun Nov 3 13:03:47 2019 (r354282) > +++ head/stand/libsa/zfs/zfs.c Sun Nov 3 13:25:47 2019 (r354283) > @@ -668,6 +668,11 @@ zfs_dev_open(struct open_file *f, ...) > spa =3D spa_find_by_guid(dev->pool_guid); > if (!spa) > return (ENXIO); > + if (spa->spa_with_log) { > + printf("Reading pool %s is not supported due to log > device.\n", > + spa->spa_name); > + return (ENXIO); > + } > mount =3D malloc(sizeof(*mount)); > if (mount =3D=3D NULL) > return (ENOMEM); > > Modified: head/stand/libsa/zfs/zfsimpl.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/stand/libsa/zfs/zfsimpl.c Sun Nov 3 13:03:47 2019 > (r354282) > +++ head/stand/libsa/zfs/zfsimpl.c Sun Nov 3 13:25:47 2019 > (r354283) > @@ -1109,6 +1109,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist, > vde > const unsigned char *kids; > int nkids, i, is_new; > uint64_t is_offline, is_faulted, is_degraded, is_removed, > isnt_present; > + uint64_t is_log; > > if (nvlist_find(nvlist, ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64, > NULL, &guid) > @@ -1132,17 +1133,20 @@ vdev_init_from_nvlist(const unsigned char *nvlist= , > vde > } > > is_offline =3D is_removed =3D is_faulted =3D is_degraded =3D isnt= _present > =3D 0; > + is_log =3D 0; > > nvlist_find(nvlist, ZPOOL_CONFIG_OFFLINE, DATA_TYPE_UINT64, NULL, > - &is_offline); > + &is_offline); > nvlist_find(nvlist, ZPOOL_CONFIG_REMOVED, DATA_TYPE_UINT64, NULL, > - &is_removed); > + &is_removed); > nvlist_find(nvlist, ZPOOL_CONFIG_FAULTED, DATA_TYPE_UINT64, NULL, > - &is_faulted); > + &is_faulted); > nvlist_find(nvlist, ZPOOL_CONFIG_DEGRADED, DATA_TYPE_UINT64, NULL= , > - &is_degraded); > + &is_degraded); > nvlist_find(nvlist, ZPOOL_CONFIG_NOT_PRESENT, DATA_TYPE_UINT64, > NULL, > - &isnt_present); > + &isnt_present); > + nvlist_find(nvlist, ZPOOL_CONFIG_IS_LOG, DATA_TYPE_UINT64, NULL, > + &is_log); > > vdev =3D vdev_find(guid); > if (!vdev) { > @@ -1217,6 +1221,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist, > vde > return (ENOMEM); > vdev->v_name =3D name; > } > + vdev->v_islog =3D is_log =3D=3D 1; > } else { > is_new =3D 0; > } > @@ -1433,6 +1438,12 @@ vdev_status(vdev_t *vdev, int indent) > { > vdev_t *kid; > int ret; > + > + if (vdev->v_islog) { > + (void)pager_output(" logs\n"); > + indent++; > + } > + > ret =3D print_state(indent, vdev->v_name, vdev->v_state); > if (ret !=3D 0) > return (ret); > @@ -1737,6 +1748,12 @@ vdev_probe(vdev_phys_read_t *_read, void > *read_priv, s > printf("ZFS: inconsistent nvlist contents\n"); > return (EIO); > } > + > + /* > + * We do not support reading pools with log device. > + */ > + if (vdev->v_islog) > + spa->spa_with_log =3D vdev->v_islog; > > /* > * Re-evaluate top-level vdev state. > > Modified: head/sys/cddl/boot/zfs/zfsimpl.h > > =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/sys/cddl/boot/zfs/zfsimpl.h Sun Nov 3 13:03:47 2019 > (r354282) > +++ head/sys/cddl/boot/zfs/zfsimpl.h Sun Nov 3 13:25:47 2019 > (r354283) > @@ -1670,6 +1670,7 @@ typedef struct vdev { > vdev_phys_read_t *v_phys_read; /* read from raw leaf vdev */ > vdev_read_t *v_read; /* read from vdev */ > void *v_read_priv; /* private data for read function > */ > + boolean_t v_islog; > struct spa *spa; /* link to spa */ > /* > * Values stored in the config for an indirect or removing vdev. > @@ -1694,6 +1695,7 @@ typedef struct spa { > zio_cksum_salt_t spa_cksum_salt; /* secret salt for cksum = */ > void *spa_cksum_tmpls[ZIO_CHECKSUM_FUNCTIONS]; > int spa_inited; /* initialized */ > + boolean_t spa_with_log; /* this pool has log */ > } spa_t; > > /* IO related arguments. */ > From owner-svn-src-head@freebsd.org Sun Nov 3 23:31:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68FC61AB927; Sun, 3 Nov 2019 23:31:00 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475sch2Cmdz3CSp; Sun, 3 Nov 2019 23:31:00 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (unknown [IPv6:2601:641:300:6e9f:7139:e5f8:3da1:d5af]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id 6C67D16D25; Sun, 3 Nov 2019 23:30:59 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.1e.0.191013 Date: Sun, 03 Nov 2019 15:30:55 -0800 Subject: Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs From: Ravi Pokala To: Toomas Soome , , , Message-ID: Thread-Topic: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs References: <201911031325.xA3DPl3B080386@repo.freebsd.org> In-Reply-To: <201911031325.xA3DPl3B080386@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Nov 2019 23:31:00 -0000 Uh.... I've had a log device in my boot-pool for months, and have booted without i= ssue: [threepio:~] rpokala% zpool status zroot pool: zroot state: ONLINE scan: scrub repaired 0 in 0 days 00:04:36 with 0 errors on Mon Oct 28= 03:10:59 2019 config: NAME STATE READ WRITE CKSUM zroot ONLINE 0 0 0 nvd1p4 ONLINE 0 0 0 logs nvd0p1 ONLINE 0 0 0 errors: No known data errors -Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: on behalf of Toomas Soome Date: 2019-11-03, Sunday at 05:25 To: , , Subject: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs Author: tsoome Date: Sun Nov 3 13:25:47 2019 New Revision: 354283 URL: https://svnweb.freebsd.org/changeset/base/354283 =20 Log: loader: we do not support booting from pool with log device =20 If pool has log device, stop there and tell about it. =20 Modified: head/stand/libsa/zfs/zfs.c head/stand/libsa/zfs/zfsimpl.c head/sys/cddl/boot/zfs/zfsimpl.h =20 Modified: head/stand/libsa/zfs/zfs.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/stand/libsa/zfs/zfs.c Sun Nov 3 13:03:47 2019 (r354282) +++ head/stand/libsa/zfs/zfs.c Sun Nov 3 13:25:47 2019 (r354283) @@ -668,6 +668,11 @@ zfs_dev_open(struct open_file *f, ...) spa =3D spa_find_by_guid(dev->pool_guid); if (!spa) return (ENXIO); + if (spa->spa_with_log) { + printf("Reading pool %s is not supported due to log device.\n", + spa->spa_name); + return (ENXIO); + } mount =3D malloc(sizeof(*mount)); if (mount =3D=3D NULL) return (ENOMEM); =20 Modified: head/stand/libsa/zfs/zfsimpl.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/stand/libsa/zfs/zfsimpl.c Sun Nov 3 13:03:47 2019 (r354282) +++ head/stand/libsa/zfs/zfsimpl.c Sun Nov 3 13:25:47 2019 (r354283) @@ -1109,6 +1109,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist= , vde const unsigned char *kids; int nkids, i, is_new; uint64_t is_offline, is_faulted, is_degraded, is_removed, isnt_presen= t; + uint64_t is_log; =20 if (nvlist_find(nvlist, ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64, NULL, &guid) @@ -1132,17 +1133,20 @@ vdev_init_from_nvlist(const unsigned char *nvli= st, vde } =20 is_offline =3D is_removed =3D is_faulted =3D is_degraded =3D isnt_present =3D 0= ; + is_log =3D 0; =20 nvlist_find(nvlist, ZPOOL_CONFIG_OFFLINE, DATA_TYPE_UINT64, NULL, - &is_offline); + &is_offline); nvlist_find(nvlist, ZPOOL_CONFIG_REMOVED, DATA_TYPE_UINT64, NULL, - &is_removed); + &is_removed); nvlist_find(nvlist, ZPOOL_CONFIG_FAULTED, DATA_TYPE_UINT64, NULL, - &is_faulted); + &is_faulted); nvlist_find(nvlist, ZPOOL_CONFIG_DEGRADED, DATA_TYPE_UINT64, NULL, - &is_degraded); + &is_degraded); nvlist_find(nvlist, ZPOOL_CONFIG_NOT_PRESENT, DATA_TYPE_UINT64, NULL, - &isnt_present); + &isnt_present); + nvlist_find(nvlist, ZPOOL_CONFIG_IS_LOG, DATA_TYPE_UINT64, NULL, + &is_log); =20 vdev =3D vdev_find(guid); if (!vdev) { @@ -1217,6 +1221,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist= , vde return (ENOMEM); vdev->v_name =3D name; } + vdev->v_islog =3D is_log =3D=3D 1; } else { is_new =3D 0; } @@ -1433,6 +1438,12 @@ vdev_status(vdev_t *vdev, int indent) { vdev_t *kid; int ret; + + if (vdev->v_islog) { + (void)pager_output(" logs\n"); + indent++; + } + ret =3D print_state(indent, vdev->v_name, vdev->v_state); if (ret !=3D 0) return (ret); @@ -1737,6 +1748,12 @@ vdev_probe(vdev_phys_read_t *_read, void *read_p= riv, s printf("ZFS: inconsistent nvlist contents\n"); return (EIO); } + + /* + * We do not support reading pools with log device. + */ + if (vdev->v_islog) + spa->spa_with_log =3D vdev->v_islog; =20 /* * Re-evaluate top-level vdev state. =20 Modified: head/sys/cddl/boot/zfs/zfsimpl.h =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/sys/cddl/boot/zfs/zfsimpl.h Sun Nov 3 13:03:47 2019 (r354282) +++ head/sys/cddl/boot/zfs/zfsimpl.h Sun Nov 3 13:25:47 2019 (r354283) @@ -1670,6 +1670,7 @@ typedef struct vdev { vdev_phys_read_t *v_phys_read; /* read from raw leaf vdev */ vdev_read_t *v_read; /* read from vdev */ void *v_read_priv; /* private data for read function */ + boolean_t v_islog; struct spa *spa; /* link to spa */ /* * Values stored in the config for an indirect or removing vdev. @@ -1694,6 +1695,7 @@ typedef struct spa { zio_cksum_salt_t spa_cksum_salt; /* secret salt for cksum */ void *spa_cksum_tmpls[ZIO_CHECKSUM_FUNCTIONS]; int spa_inited; /* initialized */ + boolean_t spa_with_log; /* this pool has log */ } spa_t; =20 /* IO related arguments. */ =20 From owner-svn-src-head@freebsd.org Mon Nov 4 00:35:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8DD481AD819; Mon, 4 Nov 2019 00:35:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475v3K3GBzz3GcN; Mon, 4 Nov 2019 00:35:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C4011C114; Mon, 4 Nov 2019 00:35:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA40Zfxd003049; Mon, 4 Nov 2019 00:35:41 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA40ZfRX003048; Mon, 4 Nov 2019 00:35:41 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201911040035.xA40ZfRX003048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 4 Nov 2019 00:35:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354326 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 354326 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2019 00:35:41 -0000 Author: jhibbits Date: Mon Nov 4 00:35:40 2019 New Revision: 354326 URL: https://svnweb.freebsd.org/changeset/base/354326 Log: powerpc/pmap: Make use of tlb1_mapin_region in pmap_mapdev_attr() tlb1_mapin_region() and pmap_mapdev_attr() do roughly the same thing -- map a chunk of physical address space(memory or MMIO) into virtual, but do it in differing ways. Unify the code, settling on pmap_mapdev_attr()'s algorithm, to simplify and unify the logic. This fixes a bug with growing the kernel mappings in mmu_booke_bootstrap(), where part of the mapping was not getting done, leading to a hang when the unmapped VAs were accessed. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sun Nov 3 22:17:49 2019 (r354325) +++ head/sys/powerpc/booke/pmap.c Mon Nov 4 00:35:40 2019 (r354326) @@ -237,11 +237,11 @@ static void tlb_print_entry(int, uint32_t, uint32_t, u static void tlb1_read_entry(tlb_entry_t *, unsigned int); static void tlb1_write_entry(tlb_entry_t *, unsigned int); static int tlb1_iomapped(int, vm_paddr_t, vm_size_t, vm_offset_t *); -static vm_size_t tlb1_mapin_region(vm_offset_t, vm_paddr_t, vm_size_t); +static vm_size_t tlb1_mapin_region(vm_offset_t, vm_paddr_t, vm_size_t, int); static vm_size_t tsize2size(unsigned int); static unsigned int size2tsize(vm_size_t); -static unsigned int ilog2(unsigned long); +static unsigned long ilog2(unsigned long); static void set_mas4_defaults(void); @@ -1619,10 +1619,16 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_o debugf(" kernel pdir at 0x%"PRI0ptrX" end = 0x%"PRI0ptrX"\n", kernel_pdir, data_end); + /* Pre-round up to 1MB. This wastes some space, but saves TLB entries */ + data_end = roundup2(data_end, 1 << 20); debugf(" data_end: 0x%"PRI0ptrX"\n", data_end); + debugf(" kernstart: %p\n", kernstart); + debugf(" kernsize: %lx\n", kernsize); + if (data_end - kernstart > kernsize) { kernsize += tlb1_mapin_region(kernstart + kernsize, - kernload + kernsize, (data_end - kernstart) - kernsize); + kernload + kernsize, (data_end - kernstart) - kernsize, + _TLB_ENTRY_MEM); } data_end = kernstart + kernsize; debugf(" updated data_end: 0x%"PRI0ptrX"\n", data_end); @@ -1819,7 +1825,7 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_o * Round so it fits into a single mapping. */ tlb1_mapin_region(DMAP_BASE_ADDRESS, 0, - phys_avail[i + 1]); + phys_avail[i + 1], _TLB_ENTRY_MEM); #endif /*******************************************************/ @@ -3500,30 +3506,8 @@ mmu_booke_mapdev_attr(mmu_t mmu, vm_paddr_t pa, vm_siz #endif res = (void *)va; - do { - sz = 1 << (ilog2(size) & ~1); - /* Align size to PA */ - if (pa % sz != 0) { - do { - sz >>= 2; - } while (pa % sz != 0); - } - /* Now align from there to VA */ - if (va % sz != 0) { - do { - sz >>= 2; - } while (va % sz != 0); - } - if (bootverbose) - printf("Wiring VA=%p to PA=%jx (size=%lx)\n", - (void *)va, (uintmax_t)pa, (long)sz); - if (tlb1_set_entry(va, pa, sz, - _TLB_ENTRY_SHARED | tlb_calc_wimg(pa, ma)) < 0) - return (NULL); - size -= sz; - pa += sz; - va += sz; - } while (size > 0); + if (tlb1_mapin_region(va, pa, size, tlb_calc_wimg(pa, ma)) != size) + return (NULL); return (res); } @@ -3864,7 +3848,7 @@ tlb1_write_entry(tlb_entry_t *e, unsigned int idx) /* * Return the largest uint value log such that 2^log <= num. */ -static unsigned int +static unsigned long ilog2(unsigned long num) { long lz; @@ -3952,69 +3936,49 @@ tlb1_set_entry(vm_offset_t va, vm_paddr_t pa, vm_size_ } /* - * Map in contiguous RAM region into the TLB1 using maximum of - * KERNEL_REGION_MAX_TLB_ENTRIES entries. - * - * If necessary round up last entry size and return total size - * used by all allocated entries. + * Map in contiguous RAM region into the TLB1. */ -vm_size_t -tlb1_mapin_region(vm_offset_t va, vm_paddr_t pa, vm_size_t size) +static vm_size_t +tlb1_mapin_region(vm_offset_t va, vm_paddr_t pa, vm_size_t size, int wimge) { - vm_size_t pgs[KERNEL_REGION_MAX_TLB_ENTRIES]; - vm_size_t mapped, pgsz, base, mask; - int idx, nents; + vm_offset_t base; + vm_size_t mapped, sz, ssize; - /* Round up to the next 1M */ - size = roundup2(size, 1 << 20); - mapped = 0; - idx = 0; base = va; - pgsz = 64*1024*1024; - while (mapped < size) { - while (mapped < size && idx < KERNEL_REGION_MAX_TLB_ENTRIES) { - while (pgsz > (size - mapped)) - pgsz >>= 2; - pgs[idx++] = pgsz; - mapped += pgsz; - } + ssize = size; - /* We under-map. Correct for this. */ - if (mapped < size) { - while (pgs[idx - 1] == pgsz) { - idx--; - mapped -= pgsz; - } - /* XXX We may increase beyond out starting point. */ - pgsz <<= 2; - pgs[idx++] = pgsz; - mapped += pgsz; + while (size > 0) { + sz = 1UL << (ilog2(size) & ~1); + /* Align size to PA */ + if (pa % sz != 0) { + do { + sz >>= 2; + } while (pa % sz != 0); } + /* Now align from there to VA */ + if (va % sz != 0) { + do { + sz >>= 2; + } while (va % sz != 0); + } + /* Now align from there to VA */ + if (bootverbose) + printf("Wiring VA=%p to PA=%jx (size=%lx)\n", + (void *)va, (uintmax_t)pa, (long)sz); + if (tlb1_set_entry(va, pa, sz, + _TLB_ENTRY_SHARED | wimge) < 0) + return (mapped); + size -= sz; + pa += sz; + va += sz; } - nents = idx; - mask = pgs[0] - 1; - /* Align address to the boundary */ - if (va & mask) { - va = (va + mask) & ~mask; - pa = (pa + mask) & ~mask; - } - - for (idx = 0; idx < nents; idx++) { - pgsz = pgs[idx]; - debugf("%u: %jx -> %jx, size=%jx\n", idx, (uintmax_t)pa, - (uintmax_t)va, (uintmax_t)pgsz); - tlb1_set_entry(va, pa, pgsz, - _TLB_ENTRY_SHARED | _TLB_ENTRY_MEM); - pa += pgsz; - va += pgsz; - } - mapped = (va - base); if (bootverbose) printf("mapped size 0x%"PRIxPTR" (wasted space 0x%"PRIxPTR")\n", - mapped, mapped - size); + mapped, mapped - ssize); + return (mapped); } From owner-svn-src-head@freebsd.org Mon Nov 4 01:19:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 847891AE59B; Mon, 4 Nov 2019 01:19:20 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "anubis.delphij.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475w1h201Wz3J2t; Mon, 4 Nov 2019 01:19:19 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from p51.home.us.delphij.net (unknown [IPv6:2601:646:8600:d04a:e670:b8ff:fe5c:4e69]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 08D5930043; Sun, 3 Nov 2019 17:19:11 -0800 (PST) Reply-To: d@delphij.net To: Ravi Pokala , Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201911031325.xA3DPl3B080386@repo.freebsd.org> From: Xin Li Autocrypt: addr=delphij@delphij.net; keydata= mQINBFuSR4oBEACvvEgwRIHs6IcSP/yaDtySF78Ji3rP29qdiQsxhMsOtvtffdbS56VApIWO UFb3/iN2gA8HwLvrmjijN0HEoLVX7na1WARmxRYzQMtApsZIUTtx7hnUYlsi2F5odZa6CDW9 a954DLRzYxiUwYDcu5Zjl9bglK1H8e/N9uC0Vuigr4teWfh86brzOyf819QzwFVYfMIK4ihw QGwMvTzbyVuCFy+LENkmcVYni70oQy6rZ5ktSuYbuOFvu7inRRfhSWPHziV7k+bW88sJ7xhv lBlegcnhkSudWX2M8tZ3MO1PJOcyys0CJlsBY5Weiog2lIPi05h/E9pZ9mc1Vud17iqDaL6w RaggOUhuPfDGCdO5ro82W4BZGeQMRnRF5Ntk+t2ShIH4nn3xRLV0E5nziCiKlgiMqOrz/ZTL QTVbHrCuiwD+fSK14y0oHbkOLYTYLlgh1JbwfY2Ty7elOYiWzyeJ7sJh2dF91NSEneWIOys3 mBpuvtU3nSzzTvAB48VV+Nbg1CpIOgNlPjj7uhIum/Z/VjUaJEyaLpTIRh0MVJVcbP7hXSqZ NA35EEZZVnWEOYdycm4CmEdeNPWkrAf2Ya77iR5VLGypwMlsUMQPh+sKVWDD38M8stFGBBNm d01Hi74Bsq5hKan654dOqMt5eYklrVj0ucMzFQtus7oE502UswARAQABtBxYaW4gTEkgPGRl bHBoaWpAZGVscGhpai5uZXQ+iQJUBBMBCgA+FiEEceNg5NEMZIki80nQQHl/fJX0g08FAluS R/YCGwMFCQmuhAAFCwkIBwMFFQoJCAsFFgIDAQACHgECF4AACgkQQHl/fJX0g0+2Og//bWpE F2V5/M5l6YW1T8oLcT9rIOH6oq9M0LMNRgFeiNNnilGIeeIgtOGBRueG4CZiZAvsRPJkrO70 1R2SrdkCIvwGUzUAxx1NfBWb+vgm4fgkW/MotGonceM5v0qfSKKXasWvDctkK28aG+IoQzmi FjXNW4+ju4zeQFYwD4ZDWqw9MqO0hVb24uW3dxtQhbfmOLgJ/PEDMQaFuANbW1c+iR0BQA3D Go/EeMY4kpN8on6Aqt/S/4JVltudfQ9OXdjQsC7netSaB9K3mHGt9aKAAB7RzlRY00DKkYS/ /eQwLzGPmK7yX13M68mMDjBs6mIR8t/E1S5OdBNhHRPNPlEbwugR4KaiCsN5yqzJoSV99fKY z2VyxjWPaG8yhHE+jmKUgIBKTfFUQEfkriQR4EASoeJ+soaMTiFDBij1Zw5n3ndLRFMB1ZCl fZLER36mAgW4m4kP83TWnDiJLxOxSOxifV8HpTFjff902H85cybg9KMwrfPDr6W19GGk5Vo1 fkza5krRMGbKWb7+74Evusi0ZxJLIOFwp5Y8eVqUMZaAD3f1ZX1M3pgXOp20QgAy+2KvMHij rLa4q+tMGRzYYD1BnFVSVdXAX5VOoTmHBcDz67DkuRwk2Byp1sgd407oEOmSwrNJlKS0TPCm xUJ2fdSQF+1/MMSRfee49vtMvz7cOrC5Ag0EW5JHigEQANiBmIFAfRNH3nzYNWC0yC+tfx3z sUwAsH1VaBM/cTib+yKtbBOSIlXWjJZWX3MHwoI/1LeGghB2mxkkX1L0pJ/vj1eXNR+sFZ32 0pYcl61Fxg/5fioG4QDTM4i3i7NR5PxDnc6UVaynSlII93DedRhZ1ROtdn4vyMgzsDiqhbL7 BthDOt5KxjqdRk4qRPSw7BovEqZLOcG5IJtf/zZUzRbM7SBljEbOAfekDGx1Br+RrYSD7/Ef Pwwzou9T8315IpBpIHyQF/dZNk3iFiB9Ed5CA71ZRYV5YoLWE9lL0j9kxOLQ5vHnX3mVq7QZ Bc7nzwZ6UhQgYmrG5+RWvuiPpGwvDRIsugJUGXucYkAQh5kuNblmkwpv6u9rNMjCNbzAylOa qdogra5EW+RUSbRz0b4iIr8nnZeAlh7BihCe7JjOwbDjoBEEEtSfVc4hD/LENqpcYVrChphf aOLB9YIXhnVDTVvMc9OklWT/81HzAaDQqOQCzEfY92199Ct9/CwRoQ2OpO8TO5+8A7b9Nb33 nmxMn09mb48ruRacMrfHxCWbgU4w9SEfbip4GcS5wGG6yTC+hw55Iwnnwus40NrJ0GEr8a4r cdsLbkvlyoNHB8ZGgyJ4aFCQ1V4qE1BnlTk7Z8BYBUkJM1odPSkVvHpCnMUjVpJ3hEOC+73Z YH1dh7lZABEBAAGJAjwEGAEKACYWIQRx42Dk0QxkiSLzSdBAeX98lfSDTwUCW5JHigIbDAUJ Ca6EAAAKCRBAeX98lfSDTz8DEACMh3poeUb+gWNF4RWFZuLteZVo0+E1JLYXQkmtrRBLXviP +Qy0pXyFAVxLM4hNIBoIDYfK9BcwrBYf7AwSKrH0GiNwFpgHCkbZd6qoZy2gB+adTnCpVCTJ KJetsH/8awkrChJWMK0ckGf3EeWMPvawG7kW7FBz70NYEZ0pOMiaEZNVtzD3wwbYWUiDFYth 83XGglOExg+1ShTW5XjQPRrdyJAO+aUW4o3lVjfyUJXMgI4rmhMiLVm06GuNrbpKIF0s+4Vd jQAjhrDQjfoXi9CkfsA/cONseuHNv1JGj3RqHiqHJq1dbrpodXp925zGDAnUGxCOBPoFopAH gVzR89GTut059GpwqsddZmU6y7rqifuam/ekJ+QRwc16vgt7pHqCrTY8WPxRZr2UpFU1wlTo COdeiFep1gq1F9jzFjJnoMaAdmC6k7bgAA+RQusOgIhJL0jIej7DoAHxmxFFCfRy+lDtpXwF gQ8HMvzHI65QWmQnMo7s6SQH/ZH5s1yR6SJq8+3lDz+dCuT42qJVqIPVvxd10LW0FNN+t7HF eLadU6ekSgD13/EYMYXlvNHkw7dAItSDxIzgRyykLz0bCU9xwNWoS4Z43+ifF9anJ+uR0ltW El1j++h6ZrD3LLuCgJIt1so0m49GzdcSpOI7LCwMlacyvafiEyjUn+tSNDsnfw== Organization: The FreeBSD Project Subject: Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs Message-ID: <61bed957-a0c5-bb95-8138-13d00df9d44f@delphij.net> Date: Sun, 3 Nov 2019 17:19:03 -0800 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="1Ml20wRaSfzcucOS3LgU7nPfd3XfKe7Dv" X-Rspamd-Queue-Id: 475w1h201Wz3J2t X-Spamd-Bar: ----- X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.994,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2019 01:19:20 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1Ml20wRaSfzcucOS3LgU7nPfd3XfKe7Dv Content-Type: multipart/mixed; boundary="2UUtBCh5AT5UmyB9XvkIYRjoIhlAN89vO"; protected-headers="v1" From: Xin Li Reply-To: d@delphij.net To: Ravi Pokala , Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <61bed957-a0c5-bb95-8138-13d00df9d44f@delphij.net> Subject: Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs References: <201911031325.xA3DPl3B080386@repo.freebsd.org> In-Reply-To: --2UUtBCh5AT5UmyB9XvkIYRjoIhlAN89vO Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable (chosen a random message) On 2019-11-03 15:30, Ravi Pokala wrote: > Uh.... >=20 > I've had a log device in my boot-pool for months, and have booted witho= ut issue: >=20 > [threepio:~] rpokala% zpool status zroot > pool: zroot > state: ONLINE > scan: scrub repaired 0 in 0 days 00:04:36 with 0 errors on Mon Oc= t 28 03:10:59 2019 > config: >=20 > NAME STATE READ WRITE CKSUM > zroot ONLINE 0 0 0 > nvd1p4 ONLINE 0 0 0 > logs > nvd0p1 ONLINE 0 0 0 >=20 > errors: No known data errors This is not supported, and it's not trivial to support it, because in order to support it, the bootloader would have to know how to replay zilogs, which would add quite a lot of code to it. It's unlikely that you actually hit a problem, however, because the critical contents to boot the system is rarely written to, and as a result it's quite likely that the readable, consistent state of your /boot/ is good enough to boot the system. That's said, it's still because you were lucky, and the code was not designed to work that way...= Cheers, --2UUtBCh5AT5UmyB9XvkIYRjoIhlAN89vO-- --1Ml20wRaSfzcucOS3LgU7nPfd3XfKe7Dv Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.2.17 (FreeBSD) iQIzBAEBCgAdFiEEceNg5NEMZIki80nQQHl/fJX0g08FAl2/fIwACgkQQHl/fJX0 g0+GTA/8CqC8u5dDZJVA10LrU6KpQqZqx9ZuTm8o3Kdgm+lei+MMMMKYlng5ugBc iW8ko8k1ElIPk8BuYqnv0F3r6IoHxIU7Wn9vQK9DqVl3R+QDR9OdgZOLrTu5zJhG q3tDyQ0fHFPtmOaKJJcnu/d8qZZMZXPiMCAk+3ZbjskmVlDqhOwHMSF4NuX+wuFW pJo6c0u79VedvU3wBdDcCv1Y4X4Sjq08pcdLOV7iaG/O/JPP66nLyfrWrY1SLzGp eNJ0h8DgHVdbsgf4MyuwMVkb0MMNQx8juXEk+ovKJaZkwFwswLfyG6fOeAWyr6IH O0Iolm3ocCnYyncKM63BoEkatosLl75vet9ke1gRpxEWB+NXHQOKgbMEiPWsReVQ wOFN2VgoT8M0zB8u3WexZuIoUMY76s8KVL/ND3kBP/fSE85CXyiWY2nR7Q/WuDBf 9DSakJckexaGG6uPnrmkvBFN7eFsLQG7s4sir9TA3k1ET0rILO5SOoD8/A9ZrQXi Coc8ZvmZVV35RGSMZzaixuVKXGsaihfd84b4lmkTDmf4MVnct1nKuet1D6D0Td15 Y1+Fq+cLIHL9wggUoRquKMdzsbjg4lHKAWvw7D07MEf6FQkPBQgY158GBV+sRFTh 6BRWW0negOkmXUlmJeSsgqhv/uGDxwq6XoJPO3wzERa7+1QNIys= =PQAz -----END PGP SIGNATURE----- --1Ml20wRaSfzcucOS3LgU7nPfd3XfKe7Dv-- From owner-svn-src-head@freebsd.org Mon Nov 4 01:31:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 544A91AEC2E; Mon, 4 Nov 2019 01:31:24 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "anubis.delphij.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475wHb226pz3JcY; Mon, 4 Nov 2019 01:31:22 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from p51.home.us.delphij.net (unknown [IPv6:2601:646:8600:d04a:e670:b8ff:fe5c:4e69]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 011E430077; Sun, 3 Nov 2019 17:31:20 -0800 (PST) Reply-To: d@delphij.net To: Toomas Soome , Kevin Bowling Cc: Andriy Gapon , Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201911031325.xA3DPl3B080386@repo.freebsd.org> <276a3efd-da6c-69ca-cc4f-51c9a5b77696@FreeBSD.org> <51E88C9A-CA94-4503-85F7-8BCD57C00961@me.com> From: Xin Li Autocrypt: addr=delphij@delphij.net; keydata= mQINBFuSR4oBEACvvEgwRIHs6IcSP/yaDtySF78Ji3rP29qdiQsxhMsOtvtffdbS56VApIWO UFb3/iN2gA8HwLvrmjijN0HEoLVX7na1WARmxRYzQMtApsZIUTtx7hnUYlsi2F5odZa6CDW9 a954DLRzYxiUwYDcu5Zjl9bglK1H8e/N9uC0Vuigr4teWfh86brzOyf819QzwFVYfMIK4ihw QGwMvTzbyVuCFy+LENkmcVYni70oQy6rZ5ktSuYbuOFvu7inRRfhSWPHziV7k+bW88sJ7xhv lBlegcnhkSudWX2M8tZ3MO1PJOcyys0CJlsBY5Weiog2lIPi05h/E9pZ9mc1Vud17iqDaL6w RaggOUhuPfDGCdO5ro82W4BZGeQMRnRF5Ntk+t2ShIH4nn3xRLV0E5nziCiKlgiMqOrz/ZTL QTVbHrCuiwD+fSK14y0oHbkOLYTYLlgh1JbwfY2Ty7elOYiWzyeJ7sJh2dF91NSEneWIOys3 mBpuvtU3nSzzTvAB48VV+Nbg1CpIOgNlPjj7uhIum/Z/VjUaJEyaLpTIRh0MVJVcbP7hXSqZ NA35EEZZVnWEOYdycm4CmEdeNPWkrAf2Ya77iR5VLGypwMlsUMQPh+sKVWDD38M8stFGBBNm d01Hi74Bsq5hKan654dOqMt5eYklrVj0ucMzFQtus7oE502UswARAQABtBxYaW4gTEkgPGRl bHBoaWpAZGVscGhpai5uZXQ+iQJUBBMBCgA+FiEEceNg5NEMZIki80nQQHl/fJX0g08FAluS R/YCGwMFCQmuhAAFCwkIBwMFFQoJCAsFFgIDAQACHgECF4AACgkQQHl/fJX0g0+2Og//bWpE F2V5/M5l6YW1T8oLcT9rIOH6oq9M0LMNRgFeiNNnilGIeeIgtOGBRueG4CZiZAvsRPJkrO70 1R2SrdkCIvwGUzUAxx1NfBWb+vgm4fgkW/MotGonceM5v0qfSKKXasWvDctkK28aG+IoQzmi FjXNW4+ju4zeQFYwD4ZDWqw9MqO0hVb24uW3dxtQhbfmOLgJ/PEDMQaFuANbW1c+iR0BQA3D Go/EeMY4kpN8on6Aqt/S/4JVltudfQ9OXdjQsC7netSaB9K3mHGt9aKAAB7RzlRY00DKkYS/ /eQwLzGPmK7yX13M68mMDjBs6mIR8t/E1S5OdBNhHRPNPlEbwugR4KaiCsN5yqzJoSV99fKY z2VyxjWPaG8yhHE+jmKUgIBKTfFUQEfkriQR4EASoeJ+soaMTiFDBij1Zw5n3ndLRFMB1ZCl fZLER36mAgW4m4kP83TWnDiJLxOxSOxifV8HpTFjff902H85cybg9KMwrfPDr6W19GGk5Vo1 fkza5krRMGbKWb7+74Evusi0ZxJLIOFwp5Y8eVqUMZaAD3f1ZX1M3pgXOp20QgAy+2KvMHij rLa4q+tMGRzYYD1BnFVSVdXAX5VOoTmHBcDz67DkuRwk2Byp1sgd407oEOmSwrNJlKS0TPCm xUJ2fdSQF+1/MMSRfee49vtMvz7cOrC5Ag0EW5JHigEQANiBmIFAfRNH3nzYNWC0yC+tfx3z sUwAsH1VaBM/cTib+yKtbBOSIlXWjJZWX3MHwoI/1LeGghB2mxkkX1L0pJ/vj1eXNR+sFZ32 0pYcl61Fxg/5fioG4QDTM4i3i7NR5PxDnc6UVaynSlII93DedRhZ1ROtdn4vyMgzsDiqhbL7 BthDOt5KxjqdRk4qRPSw7BovEqZLOcG5IJtf/zZUzRbM7SBljEbOAfekDGx1Br+RrYSD7/Ef Pwwzou9T8315IpBpIHyQF/dZNk3iFiB9Ed5CA71ZRYV5YoLWE9lL0j9kxOLQ5vHnX3mVq7QZ Bc7nzwZ6UhQgYmrG5+RWvuiPpGwvDRIsugJUGXucYkAQh5kuNblmkwpv6u9rNMjCNbzAylOa qdogra5EW+RUSbRz0b4iIr8nnZeAlh7BihCe7JjOwbDjoBEEEtSfVc4hD/LENqpcYVrChphf aOLB9YIXhnVDTVvMc9OklWT/81HzAaDQqOQCzEfY92199Ct9/CwRoQ2OpO8TO5+8A7b9Nb33 nmxMn09mb48ruRacMrfHxCWbgU4w9SEfbip4GcS5wGG6yTC+hw55Iwnnwus40NrJ0GEr8a4r cdsLbkvlyoNHB8ZGgyJ4aFCQ1V4qE1BnlTk7Z8BYBUkJM1odPSkVvHpCnMUjVpJ3hEOC+73Z YH1dh7lZABEBAAGJAjwEGAEKACYWIQRx42Dk0QxkiSLzSdBAeX98lfSDTwUCW5JHigIbDAUJ Ca6EAAAKCRBAeX98lfSDTz8DEACMh3poeUb+gWNF4RWFZuLteZVo0+E1JLYXQkmtrRBLXviP +Qy0pXyFAVxLM4hNIBoIDYfK9BcwrBYf7AwSKrH0GiNwFpgHCkbZd6qoZy2gB+adTnCpVCTJ KJetsH/8awkrChJWMK0ckGf3EeWMPvawG7kW7FBz70NYEZ0pOMiaEZNVtzD3wwbYWUiDFYth 83XGglOExg+1ShTW5XjQPRrdyJAO+aUW4o3lVjfyUJXMgI4rmhMiLVm06GuNrbpKIF0s+4Vd jQAjhrDQjfoXi9CkfsA/cONseuHNv1JGj3RqHiqHJq1dbrpodXp925zGDAnUGxCOBPoFopAH gVzR89GTut059GpwqsddZmU6y7rqifuam/ekJ+QRwc16vgt7pHqCrTY8WPxRZr2UpFU1wlTo COdeiFep1gq1F9jzFjJnoMaAdmC6k7bgAA+RQusOgIhJL0jIej7DoAHxmxFFCfRy+lDtpXwF gQ8HMvzHI65QWmQnMo7s6SQH/ZH5s1yR6SJq8+3lDz+dCuT42qJVqIPVvxd10LW0FNN+t7HF eLadU6ekSgD13/EYMYXlvNHkw7dAItSDxIzgRyykLz0bCU9xwNWoS4Z43+ifF9anJ+uR0ltW El1j++h6ZrD3LLuCgJIt1so0m49GzdcSpOI7LCwMlacyvafiEyjUn+tSNDsnfw== Organization: The FreeBSD Project Subject: Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs Message-ID: <0cb52df0-9128-b3d7-8b56-7ac583b9ad62@delphij.net> Date: Sun, 3 Nov 2019 17:31:16 -0800 MIME-Version: 1.0 In-Reply-To: <51E88C9A-CA94-4503-85F7-8BCD57C00961@me.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ABPXx8qtSk9ArSkQ27f9M4YMTPmsizUmj" X-Rspamd-Queue-Id: 475wHb226pz3JcY X-Spamd-Bar: ------- X-Spamd-Result: default: False [-7.54 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[d@delphij.net]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; HAS_ATTACHMENT(0.00)[]; HAS_ORG_HEADER(0.00)[]; DKIM_TRACE(0.00)[delphij.net:+]; DMARC_POLICY_ALLOW(-0.50)[delphij.net,reject]; RCPT_COUNT_SEVEN(0.00)[7]; SIGNED_PGP(-2.00)[]; FREEMAIL_TO(0.00)[me.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~]; IP_SCORE(-2.44)[ip: (-9.89), ipnet: 64.62.128.0/18(1.21), asn: 6939(-3.47), country: US(-0.05)]; ASN(0.00)[asn:6939, ipnet:64.62.128.0/18, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[delphij.net:s=m7e2]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; REPLYTO_DOM_EQ_FROM_DOM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2019 01:31:24 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ABPXx8qtSk9ArSkQ27f9M4YMTPmsizUmj Content-Type: multipart/mixed; boundary="yuX5ogQ27Ef5KKkIqDmBNGdKzOtKuoEQr"; protected-headers="v1" From: Xin Li Reply-To: d@delphij.net To: Toomas Soome , Kevin Bowling Cc: Andriy Gapon , Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <0cb52df0-9128-b3d7-8b56-7ac583b9ad62@delphij.net> Subject: Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs References: <201911031325.xA3DPl3B080386@repo.freebsd.org> <276a3efd-da6c-69ca-cc4f-51c9a5b77696@FreeBSD.org> <51E88C9A-CA94-4503-85F7-8BCD57C00961@me.com> In-Reply-To: <51E88C9A-CA94-4503-85F7-8BCD57C00961@me.com> --yuX5ogQ27Ef5KKkIqDmBNGdKzOtKuoEQr Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2019-11-03 13:32, Toomas Soome wrote: >=20 >=20 >> On 3. Nov 2019, at 22:39, Kevin Bowling wro= te: >> >> I believe this is/was a common configuration, at least the few >> spinning disk based systems I have left have a slog. >> >=20 > On boot pool? um. well, I=E2=80=99ll kick out that return then. I think it's fine to simply ignore the log in loader, because it's a read-only consumer. The full-featured kernel ZFS code would skip replaying the log when importing read-only, in that case we might see some outdated data, but it's still guaranteed to be consistent by ZFS. Cheers, >=20 > rgds, > toomas >=20 >> On Sun, Nov 3, 2019 at 10:55 AM Andriy Gapon wrote: >>> >>> On 03/11/2019 15:25, Toomas Soome wrote: >>>> Author: tsoome >>>> Date: Sun Nov 3 13:25:47 2019 >>>> New Revision: 354283 >>>> URL: https://svnweb.freebsd.org/changeset/base/354283 >>>> >>>> Log: >>>> loader: we do not support booting from pool with log device >>>> >>>> If pool has log device, stop there and tell about it. >>> >>> Why? >>> >>>> Modified: >>>> head/stand/libsa/zfs/zfs.c >>>> head/stand/libsa/zfs/zfsimpl.c >>>> head/sys/cddl/boot/zfs/zfsimpl.h >>> >>> >>> >>> -- >>> Andriy Gapon >>> _______________________________________________ >>> svn-src-head@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/svn-src-head >>> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.or= g" >=20 --yuX5ogQ27Ef5KKkIqDmBNGdKzOtKuoEQr-- --ABPXx8qtSk9ArSkQ27f9M4YMTPmsizUmj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.2.17 (FreeBSD) iQIzBAEBCgAdFiEEceNg5NEMZIki80nQQHl/fJX0g08FAl2/f2QACgkQQHl/fJX0 g0/0yxAArGEiseHZH0lZvRIc/fuyARzAofV+MYUvG7vVBLsUStlTUVBYmFvyyb4I Zbx5LB1RYTGojIEEg61E/5NXCaXzOBYcGJhNX3cdLSBnP9dPM7W+0xgalqNsVUK4 aM83FXYSEXFneivC3jBn+Oq++gLysNnCX0P7ldbFbZzKHtOndySwvmAhv2zSL3kV OZ6KUwCf8cYHdsw1Ah7adtOMzK1x+T9iNrZ7KTUeWHgnEvN553azjJQRF+58XyZ3 UHKAb1ATH4b3l5V0ZpqxJhj68GUMJuzOgMP2/4q6Co2wYDLfvsakpFHc3fo6ryOz Id+6qfDbAXEU/rPbfRPXoLz7knXU7eDaosMZoMNNWk2W3sqzLmmwrDmmcZKQQEig uVGtu5xyq4jNIf1ANBhN2/NwoaMXuUfrefF0q/yJHANQMdQVFJ511ZWU/U5n76jf LQSzU5cidj/FD5DnxrGEaaMCd1tsZKeywWPFVCYuQ8e7qjHGd1iW9JNmWyN4NJsQ ot6jbUbeKlid/7TuTP5ombn4vrhtWJIeRY3kNd06u8kuF+XInV60tlIu0kbwnFO+ t8P3UDaRyjX28CH1aMVF73qHNqLaW3qN3kNsoN3o9vP8b5Om9tn+TbgN4TO07AAR uhPwYYQyC7ywhAhvzflUl6+XXbJf4ibYt4TBldJojH1VBHwV+ww= =deBN -----END PGP SIGNATURE----- --ABPXx8qtSk9ArSkQ27f9M4YMTPmsizUmj-- From owner-svn-src-head@freebsd.org Mon Nov 4 01:43:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 739651AF119; Mon, 4 Nov 2019 01:43:10 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475wY91B5xz3KHf; Mon, 4 Nov 2019 01:43:08 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-il1-x143.google.com with SMTP id d83so13383500ilk.7; Sun, 03 Nov 2019 17:43:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:autocrypt:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=kCRKN522t0CLu3GFEWQ5fvwCmv+dXepLVZCjHByMgvM=; b=COe8Rprcd4GoMZkJ3CMNjS3HEHacOZofAkGTkRq7Zg9utEXlriPUbDAafUBIDAq93W YS178GamXu1WxV7K46Cz3WrvKXQ/HwTa3ERh+F+zBonoTvNrAWZzPSUZjdyfXpaqaJzx VA9uuuklCD5dZSqIc2S+Xpb1KoaNWUfqt8mdX8xv/WPGG0iz6Q8O2Iat3KncuJyqjpjs Z9C/BaGbRJuBhLqFWiXIgL9nMbDOkGgRrq1Ht0wEyoCjfDCBdrYpYrhRvRw/14pmN8Ei kXghJ1rzZnY0Nglq4vNlQnEK6kJOpdgtJ8gWcOd8I8/djymkbMhjL76zFD9TTLGckIJi tqpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=kCRKN522t0CLu3GFEWQ5fvwCmv+dXepLVZCjHByMgvM=; b=qDKccSLv7iA2CKJu9CKgmsAQLeNqtE96I6CaYcMi96MZutIrbmgT2hKTRE24gNjEjq 9oIfPaGC3izCgOJGUqrfv0q4SeSnZWOcM/cQWQQ//rLzv2nAwcvWx1ab1CqaVdATa2q7 vALBOeLOXysEJGB6JsmaDxlx/ho+gfGYW8ypH3re3tly6lbIm42mKOlSaxa9645QeNbB rIi9IsoKo+MomZEMLSdpnX7pD/iT8Aj48wIiJsMY3C38smex0BgbsIr0Q63RJbBXTvmQ OARQrC3J2cWt/tK8MHgdQMnAL61TYjBhGJ7WMmoytQ97oooG3D2WWOhsrPfJ61YMeStw BroA== X-Gm-Message-State: APjAAAX2aMMib7xyHhovajYofWr5P3fi3wEHg9S12sskyJ57+vC5YKm7 tFNmT2nuDBF9BWv8JYFEGyyh7beS X-Google-Smtp-Source: APXvYqzCoyGrOrVaIggjTen68sODxddT3dU1NEzQrXmR8QyxNC8N9NFAtp7HqwcK4TPZRUjxb8nm7w== X-Received: by 2002:a92:1b4c:: with SMTP id b73mr25946005ilb.207.1572831787773; Sun, 03 Nov 2019 17:43:07 -0800 (PST) Received: from spectre.mavhome.dp.ua ([75.104.85.209]) by smtp.gmail.com with ESMTPSA id b11sm858263ios.43.2019.11.03.17.43.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 03 Nov 2019 17:43:07 -0800 (PST) Subject: Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs To: d@delphij.net, Ravi Pokala , Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201911031325.xA3DPl3B080386@repo.freebsd.org> <61bed957-a0c5-bb95-8138-13d00df9d44f@delphij.net> From: Alexander Motin Autocrypt: addr=mavbsd@gmail.com; prefer-encrypt=mutual; keydata= mQENBFOzxAwBCADkPrax0pI2W/ig0CK9nRJJwsHitAGEZ2HZiFEuti+6/4UVxj81yr4ak/4g 9bKUyC7rMEAp/ZHNhd+MFCPAAcHPvtovnfykqE/vuosCS3wlSLloix2iKVLks0CwbLHGAyne 46lTQW74Xl/33c3W1Z6d8jD9gVFT/xaVzZ0U9xdzOmsYAZaAj4ki0tuxO9F7L+ct9grRe7iP g8t9hai7BL4ee3VRwk2JXnKb7UvBiVITKYWKz1jRvZIrjPokgEcCLOSlv7x/1kjuFnj3xWZU 7HSFFT8J93epBbrSSCsYsppIk2fZH41kaaFXsMQfTPH8wkeM6qwrvOh4HiQM08R+9tThABEB AAG0IkFsZXhhbmRlciBNb3RpbiA8bWF2YnNkQGdtYWlsLmNvbT6JAVQEEwEKAD4CGwMFCwkI BwMFFQoJCAsFFgMCAQACHgECF4AWIQTpjPPE5pzDzQ5XnVWDGMOVW6sifwUCWWDCtwUJDTHM ogAKCRCDGMOVW6sif7nYB/9TpvgdnxMVBT9aPaaGrFOToI8lV5eCUIB3ot6+VbfeMam0nkFZ GGoaXvDMdIf++1jFADTP+hcl1fIrrH1uy2ZS1tDu3Ngd6BUCAcHcbFEqEZnCwzQTkULHbYGJ pHxKAvQYIvrOTpBb4IBHBO44lOVC21VYj8ii6hTr1ACqYa4SbIaQobByWkWErHNGN9A64LFS rbir4mXJ0Bo0vgfj3jtoGEV8RrbYseYBR2NOaw+1GjRMjoJxyTMgU1XNDZHAVGHiw/KG2cR8 EH4rqj47fLWJLWZy/ffUsWmqDnWvqswbzZjQXT8B4Yls9aqum5pykoNKtbAFT8Xpb/Y9RE1s nkXTuQENBFOzxAwBCADmYFn9nCSLvufCMz9nZFxP7q497a+Dqqwf8hxllH+9S8+g9BYumQF4 A7ZnBSxj3zMlriwL0jPsZqILpO8wuIUQWL0MnJiIbqgatYztVqf2fpaaDzP9XA2C5/BZb5iP 3ONDIVGYd+OQwOI2FlmmTY0B1FlUNXz3+feb3VVTD0/2mxPBOQ2hen0pEZqhU5n2EZH27d8r VPDXVGqQ3CVWO3BD9pyQVTWT5ziDm0f2SIEsY46xuaN+Ml6KnrqfCb8BL/vzcpc87slxGUdR HRCM0P2tZ4f9I+DV7c2RKiluGk1pZkqm+sDfI4dTkjjqpGLH5xN538XGW8YuCEaDUGJZufUf ABEBAAGJATwEGAEKACYCGwwWIQTpjPPE5pzDzQ5XnVWDGMOVW6sifwUCWWDC2AUJDTHMzAAK CRCDGMOVW6sif06oB/0UBwpZL3nBNNutpcCqD/5tDIeCOUy0YKCSZ/EuxtQZ6qIWCZIi6gOs Xurqxg+zqnTQJddlG641m3SVfs73mt7yaDODGbmImKxml1scxV6liXD8DFPbAIfDEYIR7rgu b4D2+OU537cPf/p9IvBn1YUITqnqVBnUIODT3F74kpKAL4oOqafS3MYrJ9IK6FECrdeRnLEv WHEFoN4/R54qXOjLuNeh1/fBW9ddzRyanNoHkxy5EcrgRTqMiKgejfRio8zgCM8cbFXZfU3r 8BrK6eDOP0Rc1m0oLGzp2xO+OeJZrlWRn0XhI51JvER6fUNlFil5ad3sZWY7zqf7lRKQoJc+ tCJBbGV4YW5kZXIgTW90aW4gPG1hdmJzZEBnbWFpbC5jb20+uQENBFOzxAwBCADmYFn9nCSL vufCMz9nZFxP7q497a+Dqqwf8hxllH+9S8+g9BYumQF4A7ZnBSxj3zMlriwL0jPsZqILpO8w uIUQWL0MnJiIbqgatYztVqf2fpaaDzP9XA2C5/BZb5iP3ONDIVGYd+OQwOI2FlmmTY0B1FlU NXz3+feb3VVTD0/2mxPBOQ2hen0pEZqhU5n2EZH27d8rVPDXVGqQ3CVWO3BD9pyQVTWT5ziD m0f2SIEsY46xuaN+Ml6KnrqfCb8BL/vzcpc87slxGUdRHRCM0P2tZ4f9I+DV7c2RKiluGk1p Zkqm+sDfI4dTkjjqpGLH5xN538XGW8YuCEaDUGJZufUfABEBAAGJATwEGAEKACYCGwwWIQTp jPPE5pzDzQ5XnVWDGMOVW6sifwUCWWDC2AUJDTHMzAAKCRCDGMOVW6sif06oB/0UBwpZL3nB NNutpcCqD/5tDIeCOUy0YKCSZ/EuxtQZ6qIWCZIi6gOsXurqxg+zqnTQJddlG641m3SVfs73 mt7yaDODGbmImKxml1scxV6liXD8DFPbAIfDEYIR7rgub4D2+OU537cPf/p9IvBn1YUITqnq VBnUIODT3F74kpKAL4oOqafS3MYrJ9IK6FECrdeRnLEvWHEFoN4/R54qXOjLuNeh1/fBW9dd zRyanNoHkxy5EcrgRTqMiKgejfRio8zgCM8cbFXZfU3r8BrK6eDOP0Rc1m0oLGzp2xO+OeJZ rlWRn0XhI51JvER6fUNlFil5ad3sZWY7zqf7lRKQoJc+ Message-ID: Date: Sun, 3 Nov 2019 20:42:53 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.0 MIME-Version: 1.0 In-Reply-To: <61bed957-a0c5-bb95-8138-13d00df9d44f@delphij.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 475wY91B5xz3KHf X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=COe8Rprc; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mavbsd@gmail.com designates 2607:f8b0:4864:20::143 as permitted sender) smtp.mailfrom=mavbsd@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RECEIVED_SPAMHAUS_PBL(0.00)[209.85.104.75.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (1.85), ipnet: 2607:f8b0::/32(-2.38), asn: 15169(-2.03), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[3.4.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2019 01:43:10 -0000 On 03.11.2019 20:19, Xin Li wrote: > On 2019-11-03 15:30, Ravi Pokala wrote: >> Uh.... >> >> I've had a log device in my boot-pool for months, and have booted without issue: >> >> [threepio:~] rpokala% zpool status zroot >> pool: zroot >> state: ONLINE >> scan: scrub repaired 0 in 0 days 00:04:36 with 0 errors on Mon Oct 28 03:10:59 2019 >> config: >> >> NAME STATE READ WRITE CKSUM >> zroot ONLINE 0 0 0 >> nvd1p4 ONLINE 0 0 0 >> logs >> nvd0p1 ONLINE 0 0 0 >> >> errors: No known data errors > > > This is not supported, and it's not trivial to support it, because in > order to support it, the bootloader would have to know how to replay > zilogs, which would add quite a lot of code to it. The issue with ZIL not being replayed in case of read-only mount has nothing to do with the fact of SLOG device presence. The issue is the same when ZIL resides on the main disks of the pool. So while everything else you said is right, I see no any reason to ban pools with SLOG devices in this context. -- Alexander Motin From owner-svn-src-head@freebsd.org Mon Nov 4 02:29:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4FC291B0210; Mon, 4 Nov 2019 02:29:59 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475xbC1Kfpz3LgT; Mon, 4 Nov 2019 02:29:59 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C8391D4A7; Mon, 4 Nov 2019 02:29:59 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA42Tw65067401; Mon, 4 Nov 2019 02:29:58 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA42Tw98067400; Mon, 4 Nov 2019 02:29:58 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201911040229.xA42Tw98067400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Mon, 4 Nov 2019 02:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354327 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 354327 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2019 02:29:59 -0000 Author: wulf Date: Mon Nov 4 02:29:58 2019 New Revision: 354327 URL: https://svnweb.freebsd.org/changeset/base/354327 Log: [ig4] Try to workaround MIPS namespace pollution issue Modified: head/sys/dev/ichiic/ig4_iic.c Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Mon Nov 4 00:35:40 2019 (r354326) +++ head/sys/dev/ichiic/ig4_iic.c Mon Nov 4 02:29:58 2019 (r354327) @@ -161,7 +161,7 @@ reg_read(ig4iic_softc_t *sc, uint32_t reg) } static void -set_intr_mask(ig4iic_softc_t *sc, uint32_t val) +ig4iic_set_intr_mask(ig4iic_softc_t *sc, uint32_t val) { if (sc->intr_mask != val) { reg_write(sc, IG4_REG_INTR_MASK, val); @@ -233,7 +233,7 @@ set_controller(ig4iic_softc_t *sc, uint32_t ctl) * When the controller is enabled, interrupt on STOP detect * or receive character ready and clear pending interrupts. */ - set_intr_mask(sc, 0); + ig4iic_set_intr_mask(sc, 0); if (ctl & IG4_I2C_ENABLE) reg_read(sc, IG4_REG_CLR_INTR); @@ -298,10 +298,10 @@ wait_intr(ig4iic_softc_t *sc, uint32_t intr) */ if (!DO_POLL(sc)) { mtx_lock_spin(&sc->io_lock); - set_intr_mask(sc, intr | IG4_INTR_ERR_MASK); + ig4iic_set_intr_mask(sc, intr | IG4_INTR_ERR_MASK); msleep_spin(sc, &sc->io_lock, "i2cwait", (hz + 99) / 100); /* sleep up to 10ms */ - set_intr_mask(sc, 0); + ig4iic_set_intr_mask(sc, 0); mtx_unlock_spin(&sc->io_lock); count_us += 10000; } else { @@ -1137,7 +1137,7 @@ ig4iic_intr(void *cookie) /* Ignore stray interrupts */ if (sc->intr_mask != 0 && reg_read(sc, IG4_REG_INTR_STAT) != 0) { /* Interrupt bits are cleared in wait_intr() loop */ - set_intr_mask(sc, 0); + ig4iic_set_intr_mask(sc, 0); wakeup(sc); retval = FILTER_HANDLED; } From owner-svn-src-head@freebsd.org Mon Nov 4 03:07:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B5E11B0E9C; Mon, 4 Nov 2019 03:07:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 475yPz3fBPz3NWN; Mon, 4 Nov 2019 03:07:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E7071DC6F; Mon, 4 Nov 2019 03:07:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA4373Ul092100; Mon, 4 Nov 2019 03:07:03 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA4372FJ092095; Mon, 4 Nov 2019 03:07:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201911040307.xA4372FJ092095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 4 Nov 2019 03:07:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354328 - in head/usr.bin/patch: . tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/usr.bin/patch: . tests X-SVN-Commit-Revision: 354328 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2019 03:07:03 -0000 Author: kevans Date: Mon Nov 4 03:07:01 2019 New Revision: 354328 URL: https://svnweb.freebsd.org/changeset/base/354328 Log: patch(1): give /dev/null patches special treatment We have a bad habit of duplicating contents of files that are sourced from /dev/null and applied more than once... take the more sane (in most ways) GNU route and complain if the file exists and offer reversal options. This still falls short a little bit as selecting "don't reverse, apply anyway" will still give you duplicated file contents. There's probably other issues as well, but awareness is the first step to happiness. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D21535 Modified: head/usr.bin/patch/patch.1 head/usr.bin/patch/patch.c head/usr.bin/patch/pch.c head/usr.bin/patch/pch.h head/usr.bin/patch/tests/unified_patch_test.sh head/usr.bin/patch/util.c Modified: head/usr.bin/patch/patch.1 ============================================================================== --- head/usr.bin/patch/patch.1 Mon Nov 4 02:29:58 2019 (r354327) +++ head/usr.bin/patch/patch.1 Mon Nov 4 03:07:01 2019 (r354328) @@ -21,7 +21,7 @@ .\" .\" $OpenBSD: patch.1,v 1.27 2014/04/15 06:26:54 jmc Exp $ .\" $FreeBSD$ -.Dd August 15, 2015 +.Dd November 3, 2019 .Dt PATCH 1 .Os .Sh NAME @@ -559,8 +559,10 @@ option as needed. .Pp Third, you can create a file by sending out a diff that compares a null file to the file you want to create. -This will only work if the file you want to create does not exist already in -the target directory. +If the file you want to create already exists in the target directory when the +diff is applied, then +.Nm +will identify the patch as potentially reversed and offer to reverse the patch. .Pp Fourth, take care not to send out reversed patches, since it makes people wonder whether they already applied the patch. Modified: head/usr.bin/patch/patch.c ============================================================================== --- head/usr.bin/patch/patch.c Mon Nov 4 02:29:58 2019 (r354327) +++ head/usr.bin/patch/patch.c Mon Nov 4 03:07:01 2019 (r354328) @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -103,6 +104,7 @@ static void dump_line(LINENUM, bool); static bool patch_match(LINENUM, LINENUM, LINENUM); static bool similar(const char *, const char *, int); static void usage(void); +static bool handle_creation(bool, bool *); /* true if -E was specified on command line. */ static bool remove_empty_files = false; @@ -147,8 +149,10 @@ static char end_defined[128]; int main(int argc, char *argv[]) { + struct stat statbuf; int error = 0, hunk, failed, i, fd; - bool patch_seen, reverse_seen; + bool out_creating, out_existed, patch_seen, remove_file; + bool reverse_seen; LINENUM where = 0, newwhere, fuzz, mymaxfuzz; const char *tmpdir; char *v; @@ -219,6 +223,12 @@ main(int argc, char *argv[]) reinitialize_almost_everything()) { /* for each patch in patch file */ + if (source_file != NULL && (diff_type == CONTEXT_DIFF || + diff_type == NEW_CONTEXT_DIFF || + diff_type == UNI_DIFF)) + out_creating = strcmp(source_file, _PATH_DEVNULL) == 0; + else + out_creating = false; patch_seen = true; warn_on_invalid_line = true; @@ -226,6 +236,19 @@ main(int argc, char *argv[]) if (outname == NULL) outname = xstrdup(filearg[0]); + /* + * At this point, we know if we're supposed to be creating the + * file and we know if we should be trying to handle a conflict + * between the patch and the file already existing. We defer + * handling it until hunk processing because we want to swap + * the hunk if they opt to reverse it, but we want to make sure + * we *can* swap the hunk without running into memory issues + * before we offer it. We also want to be verbose if flags or + * user decision cause us to skip -- this is explained a little + * more later. + */ + out_existed = stat(outname, &statbuf) == 0; + /* for ed script just up and do it and exit */ if (diff_type == ED_DIFF) { do_ed_script(); @@ -252,9 +275,28 @@ main(int argc, char *argv[]) failed = 0; reverse_seen = false; out_of_mem = false; + remove_file = false; while (another_hunk()) { + assert(!out_creating || hunk == 0); hunk++; fuzz = 0; + + /* + * There are only three cases in handle_creation() that + * results in us skipping hunk location, in order: + * + * 1.) Potentially reversed but -f/--force'd, + * 2.) Potentially reversed but -N/--forward'd + * 3.) Reversed and the user's opted to not apply it. + * + * In all three cases, we still want to inform the user + * that we're ignoring it in the standard way, which is + * also tied to this hunk processing loop. + */ + if (out_creating) + reverse_seen = handle_creation(out_existed, + &remove_file); + mymaxfuzz = pch_context(); if (maxfuzz < mymaxfuzz) mymaxfuzz = maxfuzz; @@ -372,7 +414,6 @@ main(int argc, char *argv[]) /* and put the output where desired */ ignore_signals(); if (!skip_rest_of_patch) { - struct stat statbuf; char *realout = outname; if (!check_only) { @@ -383,7 +424,18 @@ main(int argc, char *argv[]) } else chmod(outname, filemode); - if (remove_empty_files && + /* + * remove_file is a per-patch flag indicating + * whether it's OK to remove the empty file. + * This is specifically set when we're reversing + * the creation of a file and it ends up empty. + * This is an exception to the global policy + * (remove_empty_files) because the user would + * likely not expect the reverse of file + * creation to leave an empty file laying + * around. + */ + if ((remove_empty_files || remove_file) && stat(realout, &statbuf) == 0 && statbuf.st_size == 0) { if (verbose) @@ -444,6 +496,9 @@ reinitialize_almost_everything(void) filearg[0] = NULL; } + free(source_file); + source_file = NULL; + free(outname); outname = NULL; @@ -1083,4 +1138,85 @@ similar(const char *a, const char *b, int len) } return true; /* actually, this is not reached */ /* since there is always a \n */ +} + +static bool +handle_creation(bool out_existed, bool *remove) +{ + bool reverse_seen; + + reverse_seen = false; + if (reverse && out_existed) { + /* + * If the patch creates the file and we're reversing the patch, + * then we need to indicate to the patch processor that it's OK + * to remove this file. + */ + *remove = true; + } else if (!reverse && out_existed) { + /* + * Otherwise, we need to blow the horn because the patch appears + * to be reversed/already applied. For non-batch jobs, we'll + * prompt to figure out what we should be trying to do to raise + * awareness of the issue. batch (-t) processing suppresses the + * questions and just assumes that we're reversed if it looks + * like we are, which is always the case if we've reached this + * branch. + */ + if (force) { + skip_rest_of_patch = true; + return (false); + } + if (noreverse) { + /* If -N is supplied, however, we bail out/ignore. */ + say("Ignoring previously applied (or reversed) patch.\n"); + skip_rest_of_patch = true; + return (false); + } + + /* Unreversed... suspicious if the file existed. */ + if (!pch_swap()) + fatal("lost hunk on alloc error!\n"); + + reverse = !reverse; + + if (batch) { + if (verbose) + say("Patch creates file that already exists, %s %seversed", + reverse ? "Assuming" : "Ignoring", + reverse ? "R" : "Unr"); + } else { + ask("Patch creates file that already exists! %s -R? [y] ", + reverse ? "Assume" : "Ignore"); + + if (*buf == 'n') { + ask("Apply anyway? [n]"); + if (*buf != 'y') + /* Don't apply; error out. */ + skip_rest_of_patch = true; + else + /* Attempt to apply. */ + reverse_seen = true; + reverse = !reverse; + if (!pch_swap()) + fatal("lost hunk on alloc error!\n"); + } else { + /* + * They've opted to assume -R; effectively the + * same as the first branch in this function, + * but the decision is here rather than in a + * prior patch/hunk as in that branch. + */ + *remove = true; + } + } + } + + /* + * The return value indicates if we offered a chance to reverse but the + * user declined. This keeps the main patch processor in the loop since + * we've taken this out of the normal flow of hunk processing to + * simplify logic a little bit. + */ + return (reverse_seen); } Modified: head/usr.bin/patch/pch.c ============================================================================== --- head/usr.bin/patch/pch.c Mon Nov 4 02:29:58 2019 (r354327) +++ head/usr.bin/patch/pch.c Mon Nov 4 03:07:01 2019 (r354328) @@ -70,6 +70,8 @@ static LINENUM p_bfake = -1; /* beg of faked up lines static FILE *pfp = NULL; /* patch file pointer */ static char *bestguess = NULL; /* guess at correct filename */ +char *source_file; + static void grow_hunkmax(void); static int intuit_diff_type(void); static void next_intuit_at(off_t, LINENUM); @@ -218,7 +220,12 @@ there_is_another_patch(void) bestguess = xstrdup(buf); filearg[0] = fetchname(buf, &exists, 0); } - if (!exists) { + /* + * fetchname can now return buf = NULL, exists = true, to + * indicate to the caller that /dev/null was specified. Retain + * previous behavior for now until this can be better evaluted. + */ + if (filearg[0] == NULL || !exists) { int def_skip = *bestguess == '\0'; ask("No file found--skip this patch? [%c] ", def_skip ? 'y' : 'n'); @@ -402,6 +409,24 @@ scan_exit: struct file_name tmp = names[OLD_FILE]; names[OLD_FILE] = names[NEW_FILE]; names[NEW_FILE] = tmp; + } + + /* Invalidated */ + free(source_file); + source_file = NULL; + + if (retval != 0) { + /* + * If we've successfully determined a diff type, stored in + * retval, path == NULL means _PATH_DEVNULL if exists is set. + * Explicitly specify it here to make it easier to detect later + * on that we're actually creating a file and not that we've + * just goofed something up. + */ + if (names[OLD_FILE].path != NULL) + source_file = xstrdup(names[OLD_FILE].path); + else if (names[OLD_FILE].exists) + source_file = xstrdup(_PATH_DEVNULL); } if (filearg[0] == NULL) { if (posix) Modified: head/usr.bin/patch/pch.h ============================================================================== --- head/usr.bin/patch/pch.h Mon Nov 4 02:29:58 2019 (r354327) +++ head/usr.bin/patch/pch.h Mon Nov 4 03:07:01 2019 (r354328) @@ -37,6 +37,8 @@ struct file_name { bool exists; }; +extern char *source_file; + void re_patch(void); void open_patch_file(const char *); void set_hunkmax(void); Modified: head/usr.bin/patch/tests/unified_patch_test.sh ============================================================================== --- head/usr.bin/patch/tests/unified_patch_test.sh Mon Nov 4 02:29:58 2019 (r354327) +++ head/usr.bin/patch/tests/unified_patch_test.sh Mon Nov 4 03:07:01 2019 (r354328) @@ -103,26 +103,27 @@ file_creation_body() # contents as many times as you apply the diff. It should instead detect that # a source of /dev/null creates the file, so it shouldn't exist. Furthermore, # the reverse of creation is deletion -- hence the next test, which ensures that -# the file is removed if it's empty once the patch is reversed. +# the file is removed if it's empty once the patch is reversed. The size checks +# are scattered throughout to make sure that we didn't get some kind of false +# error, and the first size check is merely a sanity check that should be +# trivially true as this is executed in a sandbox. atf_test_case file_nodupe file_nodupe_body() { - # WIP - atf_expect_fail "patch(1) erroneously duplicates created files" echo "x" > foo diff -u /dev/null foo > foo.diff - atf_check -x "patch -s < foo.diff" - atf_check -s not-exit:0 -x "patch -fs < foo.diff" + atf_check -o inline:"2\n" stat -f "%z" foo + atf_check -s not-exit:0 -o ignore -x "patch -Ns < foo.diff" + atf_check -o inline:"2\n" stat -f "%z" foo + atf_check -s not-exit:0 -o ignore -x "patch -fs < foo.diff" + atf_check -o inline:"2\n" stat -f "%z" foo } atf_test_case file_removal file_removal_body() { - - # WIP - atf_expect_fail "patch(1) does not yet recognize /dev/null as creation" echo "x" > foo diff -u /dev/null foo > foo.diff Modified: head/usr.bin/patch/util.c ============================================================================== --- head/usr.bin/patch/util.c Mon Nov 4 02:29:58 2019 (r354327) +++ head/usr.bin/patch/util.c Mon Nov 4 03:07:01 2019 (r354328) @@ -366,8 +366,10 @@ fetchname(const char *at, bool *exists, int strip_lead say("fetchname %s %d\n", at, strip_leading); #endif /* So files can be created by diffing against /dev/null. */ - if (strnEQ(at, _PATH_DEVNULL, sizeof(_PATH_DEVNULL) - 1)) + if (strnEQ(at, _PATH_DEVNULL, sizeof(_PATH_DEVNULL) - 1)) { + *exists = true; return NULL; + } name = fullname = t = savestr(at); tab = strchr(t, '\t') != NULL; From owner-svn-src-head@freebsd.org Mon Nov 4 06:31:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E30A01B4421 for ; Mon, 4 Nov 2019 06:31:07 +0000 (UTC) (envelope-from tsoome@me.com) Received: from mr85p00im-zteg06023901.me.com (mr85p00im-zteg06023901.me.com [17.58.23.192]) (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 4762xR285xz41YR for ; Mon, 4 Nov 2019 06:31:07 +0000 (UTC) (envelope-from tsoome@me.com) Received: from nazgul.lan (148-52-235-80.sta.estpak.ee [80.235.52.148]) by mr85p00im-zteg06023901.me.com (Postfix) with ESMTPSA id C0909960AA9; Mon, 4 Nov 2019 06:31:03 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3594.4.19\)) Subject: Re: svn commit: r354283 - in head: stand/libsa/zfs sys/cddl/boot/zfs From: Toomas Soome In-Reply-To: Date: Mon, 4 Nov 2019 08:31:01 +0200 Cc: d@delphij.net, Ravi Pokala , Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201911031325.xA3DPl3B080386@repo.freebsd.org> <61bed957-a0c5-bb95-8138-13d00df9d44f@delphij.net> To: Alexander Motin X-Mailer: Apple Mail (2.3594.4.19) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-11-04_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 mlxscore=0 mlxlogscore=906 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1911040062 X-Rspamd-Queue-Id: 4762xR285xz41YR X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.60 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[me.com]; R_SPF_ALLOW(-0.20)[+ip4:17.58.0.0/16:c]; MV_CASE(0.50)[]; DKIM_TRACE(0.00)[me.com:+]; DMARC_POLICY_ALLOW(-0.50)[me.com,quarantine]; RCPT_COUNT_SEVEN(0.00)[7]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_IN_DNSWL_LOW(-0.10)[192.23.58.17.list.dnswl.org : 127.0.5.1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[me.com]; ASN(0.00)[asn:714, ipnet:17.58.16.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[148.52.235.80.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[me.com:s=1a1hai]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (-2.89), ipnet: 17.58.16.0/20(-1.78), asn: 714(-2.55), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; DWL_DNSWL_LOW(-1.00)[me.com.dwl.dnswl.org : 127.0.5.1]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2019 06:31:07 -0000 > On 4. Nov 2019, at 03:42, Alexander Motin wrote: >=20 > On 03.11.2019 20:19, Xin Li wrote: >> On 2019-11-03 15:30, Ravi Pokala wrote: >>> Uh.... >>>=20 >>> I've had a log device in my boot-pool for months, and have booted = without issue: >>>=20 >>> [threepio:~] rpokala% zpool status zroot >>> pool: zroot >>> state: ONLINE >>> scan: scrub repaired 0 in 0 days 00:04:36 with 0 errors on Mon = Oct 28 03:10:59 2019 >>> config: >>>=20 >>> NAME STATE READ WRITE CKSUM >>> zroot ONLINE 0 0 0 >>> nvd1p4 ONLINE 0 0 0 >>> logs >>> nvd0p1 ONLINE 0 0 0 >>>=20 >>> errors: No known data errors >>=20 >>=20 >> This is not supported, and it's not trivial to support it, because in >> order to support it, the bootloader would have to know how to replay >> zilogs, which would add quite a lot of code to it. >=20 > The issue with ZIL not being replayed in case of read-only mount has > nothing to do with the fact of SLOG device presence. The issue is the > same when ZIL resides on the main disks of the pool. So while > everything else you said is right, I see no any reason to ban pools = with > SLOG devices in this context. >=20 Yep, indeed. I got myself confused from the fact we return EIO for log = device. So a bit more cleanup is in order. However, the big question there is not about how recent update the boot = files have. To read out the boot files, we need a bit of processing done = and to understand if those structures are consistent or not. But as I = wrote before, thats something to be investigated. rgds, toomas From owner-svn-src-head@freebsd.org Mon Nov 4 12:20:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7216617F4B2; Mon, 4 Nov 2019 12:20:20 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476BhN2VR3z4NRk; Mon, 4 Nov 2019 12:20:20 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3967323E5A; Mon, 4 Nov 2019 12:20:20 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA4CKKub018090; Mon, 4 Nov 2019 12:20:20 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA4CKJ65018088; Mon, 4 Nov 2019 12:20:19 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911041220.xA4CKJ65018088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 4 Nov 2019 12:20:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354332 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 354332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2019 12:20:20 -0000 Author: tsoome Date: Mon Nov 4 12:20:19 2019 New Revision: 354332 URL: https://svnweb.freebsd.org/changeset/base/354332 Log: loader: show APFS partition type name Add small visual aid in lsdev output. Modified: head/stand/common/part.c head/stand/common/part.h Modified: head/stand/common/part.c ============================================================================== --- head/stand/common/part.c Mon Nov 4 09:49:58 2019 (r354331) +++ head/stand/common/part.c Mon Nov 4 12:20:19 2019 (r354332) @@ -60,6 +60,7 @@ static const uuid_t gpt_uuid_freebsd_boot = GPT_ENT_TY static const uuid_t gpt_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP; static const uuid_t gpt_uuid_freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS; static const uuid_t gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM; +static const uuid_t gpt_uuid_apple_apfs = GPT_ENT_TYPE_APPLE_APFS; #endif struct pentry { @@ -98,6 +99,7 @@ static struct parttypes { { PART_LINUX_SWAP, "Linux swap" }, { PART_DOS, "DOS/Windows" }, { PART_ISO9660, "ISO9660" }, + { PART_APFS, "APFS" }, }; const char * @@ -141,6 +143,8 @@ gpt_parttype(uuid_t type) return (PART_FREEBSD_VINUM); else if (uuid_equal(&type, &gpt_uuid_freebsd, NULL)) return (PART_FREEBSD); + else if (uuid_equal(&type, &gpt_uuid_apple_apfs, NULL)) + return (PART_APFS); return (PART_UNKNOWN); } Modified: head/stand/common/part.h ============================================================================== --- head/stand/common/part.h Mon Nov 4 09:49:58 2019 (r354331) +++ head/stand/common/part.h Mon Nov 4 12:20:19 2019 (r354332) @@ -52,7 +52,8 @@ enum partition_type { PART_LINUX, PART_LINUX_SWAP, PART_DOS, - PART_ISO9660 + PART_ISO9660, + PART_APFS }; struct ptable_entry { From owner-svn-src-head@freebsd.org Mon Nov 4 13:30:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 507541A22FF; Mon, 4 Nov 2019 13:30:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476DFW1W6tz3D1M; Mon, 4 Nov 2019 13:30:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 181B224AC4; Mon, 4 Nov 2019 13:30:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA4DUciX059743; Mon, 4 Nov 2019 13:30:38 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA4DUbnB059737; Mon, 4 Nov 2019 13:30:37 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201911041330.xA4DUbnB059737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 4 Nov 2019 13:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354333 - in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Commit-Revision: 354333 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2019 13:30:39 -0000 Author: avg Date: Mon Nov 4 13:30:37 2019 New Revision: 354333 URL: https://svnweb.freebsd.org/changeset/base/354333 Log: zfs: enable SPA_PROCESS on the kernel side The purpose of this change is to group kernelthreads specific to a particular ZFS pool under a kernel process. There can be many dozens of threads per pool. This change improves observability of those threads. This change consists of several subchanges: 1. illumos taskq_create_proc can now pass its process parameter to taskqueue. Also, use zfsproc instead of NULL for taskq_create. Caveat: zfsproc might not be initialized yet. But in that case it is still NULL, so not worse than before. 2. illumos sys/proc.h: kthread id is stored in t_did field, not t_tid. 3. zfs: enable SPA_PROCESS on the kernel side. The change is a bit hairy as newproc() is implemented privately to spa.c. I couldn't think of a better way to populate process name than to poke inside the argument for the process routine. 4. illumos thread_create: allow assigning thread to process other than zfsproc. 5. zfs: expose spa_proc to other users, assign sync and quiesce threads to it. Pool-specific threads created using (relatively new) zthr mechanism are still assigned to the zfskern process rather than to a respective zpool-xxx process. I am going to address this a bit later. Reviewed by: no one MFC after: 5 weeks Relnotes: perhaps Differential Revision: https://reviews.freebsd.org/D9720 Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c head/sys/cddl/compat/opensolaris/sys/proc.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Mon Nov 4 12:20:19 2019 (r354332) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Mon Nov 4 13:30:37 2019 (r354333) @@ -62,9 +62,9 @@ system_taskq_fini(void *arg) } SYSUNINIT(system_taskq_fini, SI_SUB_CONFIGURE, SI_ORDER_ANY, system_taskq_fini, NULL); -taskq_t * -taskq_create(const char *name, int nthreads, pri_t pri, int minalloc __unused, - int maxalloc __unused, uint_t flags) +static taskq_t * +taskq_create_impl(const char *name, int nthreads, pri_t pri, proc_t *proc, + uint_t flags) { taskq_t *tq; @@ -74,17 +74,24 @@ taskq_create(const char *name, int nthreads, pri_t pri tq = kmem_alloc(sizeof(*tq), KM_SLEEP); tq->tq_queue = taskqueue_create(name, M_WAITOK, taskqueue_thread_enqueue, &tq->tq_queue); - (void) taskqueue_start_threads(&tq->tq_queue, nthreads, pri, "%s", name); + (void) taskqueue_start_threads_in_proc(&tq->tq_queue, nthreads, pri, + proc, "%s", name); return ((taskq_t *)tq); } taskq_t * -taskq_create_proc(const char *name, int nthreads, pri_t pri, int minalloc, - int maxalloc, proc_t *proc __unused, uint_t flags) +taskq_create(const char *name, int nthreads, pri_t pri, int minalloc __unused, + int maxalloc __unused, uint_t flags) { + return (taskq_create_impl(name, nthreads, pri, zfsproc, flags)); +} - return (taskq_create(name, nthreads, pri, minalloc, maxalloc, flags)); +taskq_t * +taskq_create_proc(const char *name, int nthreads, pri_t pri, int minalloc, + int maxalloc, proc_t *proc, uint_t flags) +{ + return (taskq_create_impl(name, nthreads, pri, proc, flags)); } void Modified: head/sys/cddl/compat/opensolaris/sys/proc.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/proc.h Mon Nov 4 12:20:19 2019 (r354332) +++ head/sys/cddl/compat/opensolaris/sys/proc.h Mon Nov 4 13:30:37 2019 (r354333) @@ -47,12 +47,13 @@ #define maxclsyspri PVM #define max_ncpus (mp_maxid + 1) #define boot_max_ncpus (mp_maxid + 1) +#define syscid 1 #define TS_RUN 0 #define p0 proc0 -#define t_tid td_tid +#define t_did td_tid typedef short pri_t; typedef struct thread _kthread; @@ -67,6 +68,7 @@ do_thread_create(caddr_t stk, size_t stksize, void (*p size_t len, proc_t *pp, int state, pri_t pri) { kthread_t *td = NULL; + proc_t **ppp; int error; /* @@ -75,9 +77,13 @@ do_thread_create(caddr_t stk, size_t stksize, void (*p ASSERT(stk == NULL); ASSERT(len == 0); ASSERT(state == TS_RUN); - ASSERT(pp == &p0); + ASSERT(pp != NULL); - error = kproc_kthread_add(proc, arg, &zfsproc, &td, RFSTOPPED, + if (pp == &p0) + ppp = &zfsproc; + else + ppp = &pp; + error = kproc_kthread_add(proc, arg, ppp, &td, RFSTOPPED, stksize / PAGE_SIZE, "zfskern", "solthread %p", proc); if (error == 0) { thread_lock(td); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Nov 4 12:20:19 2019 (r354332) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Nov 4 13:30:37 2019 (r354333) @@ -176,7 +176,11 @@ boolean_t zio_taskq_sysdc = B_TRUE; /* use SDC schedul uint_t zio_taskq_basedc = 80; /* base duty cycle */ #endif +#ifdef _KERNEL +#define SPA_PROCESS +#endif boolean_t spa_create_process = B_TRUE; /* no process ==> no sysdc */ + extern int zfs_sync_pass_deferred_free; /* @@ -1090,23 +1094,49 @@ spa_create_zio_taskqs(spa_t *spa) } } -#ifdef _KERNEL #ifdef SPA_PROCESS +static int +newproc(void (*pc)(void *), void *arg, id_t cid, int pri, + void **ct, pid_t pid) +{ + va_list ap; + spa_t *spa = (spa_t *)arg; /* XXX */ + struct proc *newp; + struct thread *td; + int error; + + ASSERT(ct == NULL); + ASSERT(pid == 0); + ASSERT(cid == syscid); + + error = kproc_create(pc, arg, &newp, 0, 0, "zpool-%s", spa->spa_name); + if (error != 0) + return (error); + td = FIRST_THREAD_IN_PROC(newp); + thread_lock(td); + sched_prio(td, pri); + thread_unlock(td); + return (0); +} + static void spa_thread(void *arg) { callb_cpr_t cprinfo; spa_t *spa = arg; +#ifdef illumos user_t *pu = PTOU(curproc); - +#endif CALLB_CPR_INIT(&cprinfo, &spa->spa_proc_lock, callb_generic_cpr, spa->spa_name); ASSERT(curproc != &p0); +#ifdef illumos (void) snprintf(pu->u_psargs, sizeof (pu->u_psargs), "zpool-%s", spa->spa_name); (void) strlcpy(pu->u_comm, pu->u_psargs, sizeof (pu->u_comm)); +#endif #ifdef PSRSET_BIND /* bind this thread to the requested psrset */ @@ -1160,11 +1190,14 @@ spa_thread(void *arg) cv_broadcast(&spa->spa_proc_cv); CALLB_CPR_EXIT(&cprinfo); /* drops spa_proc_lock */ +#ifdef illumos mutex_enter(&curproc->p_lock); lwp_exit(); +#else + kthread_exit(); +#endif } #endif /* SPA_PROCESS */ -#endif /* * Activate an uninitialized pool. @@ -1211,7 +1244,9 @@ spa_activate(spa_t *spa, int mode) mutex_exit(&spa->spa_proc_lock); /* If we didn't create a process, we need to create our taskqs. */ +#ifndef SPA_PROCESS ASSERT(spa->spa_proc == &p0); +#endif /* SPA_PROCESS */ if (spa->spa_proc == &p0) { spa_create_zio_taskqs(spa); } @@ -1315,6 +1350,7 @@ spa_deactivate(spa_t *spa) mutex_exit(&spa->spa_proc_lock); #ifdef SPA_PROCESS +#ifdef illumos /* * We want to make sure spa_thread() has actually exited the ZFS * module, so that the module can't be unloaded out from underneath @@ -1324,6 +1360,7 @@ spa_deactivate(spa_t *spa) thread_join(spa->spa_did); spa->spa_did = 0; } +#endif #endif /* SPA_PROCESS */ } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Nov 4 12:20:19 2019 (r354332) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Nov 4 13:30:37 2019 (r354333) @@ -1935,6 +1935,12 @@ spa_deadman_synctime(spa_t *spa) return (spa->spa_deadman_synctime); } +struct proc * +spa_proc(spa_t *spa) +{ + return (spa->spa_proc); +} + uint64_t dva_get_dsize_sync(spa_t *spa, const dva_t *dva) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Nov 4 12:20:19 2019 (r354332) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Nov 4 13:30:37 2019 (r354333) @@ -833,6 +833,7 @@ extern uint64_t spa_bootfs(spa_t *spa); extern uint64_t spa_delegation(spa_t *spa); extern objset_t *spa_meta_objset(spa_t *spa); extern uint64_t spa_deadman_synctime(spa_t *spa); +extern struct proc *spa_proc(spa_t *spa); extern uint64_t spa_dirty_data(spa_t *spa); /* Miscellaneous support routines */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Mon Nov 4 12:20:19 2019 (r354332) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Mon Nov 4 13:30:37 2019 (r354333) @@ -209,7 +209,7 @@ txg_sync_start(dsl_pool_t *dp) tx->tx_threads = 2; tx->tx_quiesce_thread = thread_create(NULL, 0, txg_quiesce_thread, - dp, 0, &p0, TS_RUN, minclsyspri); + dp, 0, spa_proc(dp->dp_spa), TS_RUN, minclsyspri); /* * The sync thread can need a larger-than-default stack size on @@ -217,7 +217,7 @@ txg_sync_start(dsl_pool_t *dp) * scrub_visitbp() recursion. */ tx->tx_sync_thread = thread_create(NULL, 32<<10, txg_sync_thread, - dp, 0, &p0, TS_RUN, minclsyspri); + dp, 0, spa_proc(dp->dp_spa), TS_RUN, minclsyspri); mutex_exit(&tx->tx_sync_lock); } From owner-svn-src-head@freebsd.org Mon Nov 4 13:46:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 03B361A2D7D; Mon, 4 Nov 2019 13:46:22 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476Dbd69N7z3FJj; Mon, 4 Nov 2019 13:46:21 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AECD824E91; Mon, 4 Nov 2019 13:46:21 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA4DkLLA071398; Mon, 4 Nov 2019 13:46:21 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA4DkLru071397; Mon, 4 Nov 2019 13:46:21 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201911041346.xA4DkLru071397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 4 Nov 2019 13:46:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354334 - head X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 354334 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2019 13:46:22 -0000 Author: cy Date: Mon Nov 4 13:46:21 2019 New Revision: 354334 URL: https://svnweb.freebsd.org/changeset/base/354334 Log: Document contrib updates: r354269: sqlite3 is updated to sqlite3-3.30.1. r351397: WPA is updated from 2.8 to 2.9. Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Mon Nov 4 13:30:37 2019 (r354333) +++ head/RELNOTES Mon Nov 4 13:46:21 2019 (r354334) @@ -10,6 +10,9 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r354269: + sqlite3 is updated to sqlite3-3.30.1. + r352668: cron(8) now supports the -n (suppress mail on succesful run) and -q (suppress logging of command execution) options in the crontab format. @@ -23,6 +26,9 @@ r351522: Add kernel-side support for in-kernel Transport Layer Security (KTLS). KTLS permits using sendfile(2) over sockets using TLS. + +r351397: + WPA is updated from 2.8 to 2.9. r351361: Add probes for lockmgr(9) to the lockstat DTrace provider, add From owner-svn-src-head@freebsd.org Mon Nov 4 14:19:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94B201A3DFF; Mon, 4 Nov 2019 14:19:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476FKV2439z3Hhm; Mon, 4 Nov 2019 14:19:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 272B5253FF; Mon, 4 Nov 2019 14:19:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA4EJ9Zb089334; Mon, 4 Nov 2019 14:19:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA4EJ9Xe089331; Mon, 4 Nov 2019 14:19:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201911041419.xA4EJ9Xe089331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 4 Nov 2019 14:19:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354335 - in head/sys: compat/linuxkpi/common/include/linux sys X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux sys X-SVN-Commit-Revision: 354335 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2019 14:19:10 -0000 Author: hselasky Date: Mon Nov 4 14:19:09 2019 New Revision: 354335 URL: https://svnweb.freebsd.org/changeset/base/354335 Log: Enable device class group attributes in the LinuxKPI. Bump the __FreeBSD_version to force recompilation of external kernel modules due to structure change. Differential Revision: https://reviews.freebsd.org/D21564 Submitted by: Greg V MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/device.h head/sys/compat/linuxkpi/common/include/linux/sysfs.h head/sys/sys/param.h Modified: head/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/device.h Mon Nov 4 13:46:21 2019 (r354334) +++ head/sys/compat/linuxkpi/common/include/linux/device.h Mon Nov 4 14:19:09 2019 (r354335) @@ -54,6 +54,7 @@ struct class { struct kobject kobj; devclass_t bsdclass; const struct dev_pm_ops *pm; + const struct attribute_group **dev_groups; void (*class_release)(struct class *class); void (*dev_release)(struct device *dev); char * (*devnode)(struct device *dev, umode_t *mode); @@ -424,6 +425,8 @@ done: kobject_init(&dev->kobj, &linux_dev_ktype); kobject_add(&dev->kobj, &dev->class->kobj, dev_name(dev)); + sysfs_create_groups(&dev->kobj, dev->class->dev_groups); + return (0); } @@ -431,6 +434,8 @@ static inline void device_unregister(struct device *dev) { device_t bsddev; + + sysfs_remove_groups(&dev->kobj, dev->class->dev_groups); bsddev = dev->bsddev; dev->bsddev = NULL; Modified: head/sys/compat/linuxkpi/common/include/linux/sysfs.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/sysfs.h Mon Nov 4 13:46:21 2019 (r354334) +++ head/sys/compat/linuxkpi/common/include/linux/sysfs.h Mon Nov 4 14:19:09 2019 (r354335) @@ -62,12 +62,13 @@ struct attribute_group { #define ATTRIBUTE_GROUPS(_name) \ static struct attribute_group _name##_group = { \ + .name = __stringify(_name), \ .attrs = _name##_attrs, \ }; \ - static struct attribute_group *_name##_groups[] = { \ + static const struct attribute_group *_name##_groups[] = { \ &_name##_group, \ NULL, \ - }; + } /* * Handle our generic '\0' terminated 'C' string. @@ -210,12 +211,25 @@ sysfs_create_groups(struct kobject *kobj, const struct int error = 0; int i; + if (grps == NULL) + goto done; for (i = 0; grps[i] && !error; i++) error = sysfs_create_group(kobj, grps[i]); while (error && --i >= 0) sysfs_remove_group(kobj, grps[i]); - +done: return (error); +} + +static inline void +sysfs_remove_groups(struct kobject *kobj, const struct attribute_group **grps) +{ + int i; + + if (grps == NULL) + return; + for (i = 0; grps[i]; i++) + sysfs_remove_group(kobj, grps[i]); } static inline int Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Nov 4 13:46:21 2019 (r354334) +++ head/sys/sys/param.h Mon Nov 4 14:19:09 2019 (r354335) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300054 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300055 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Mon Nov 4 17:35:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9121A1AA0E9; Mon, 4 Nov 2019 17:35:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476KhB3LmXz46WZ; Mon, 4 Nov 2019 17:35:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 523ED2784D; Mon, 4 Nov 2019 17:35:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA4HZcmm017385; Mon, 4 Nov 2019 17:35:38 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA4HZcM6017384; Mon, 4 Nov 2019 17:35:38 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911041735.xA4HZcM6017384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 4 Nov 2019 17:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354336 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 354336 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2019 17:35:38 -0000 Author: glebius Date: Mon Nov 4 17:35:37 2019 New Revision: 354336 URL: https://svnweb.freebsd.org/changeset/base/354336 Log: In nd6_timer() enter the network epoch earlier. The defrouter_del() may call into leaf functions that require epoch. Since the function is already run in non-sleepable context, it should be safe to cover it whole with epoch. Reported by: syzcaller Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon Nov 4 14:19:09 2019 (r354335) +++ head/sys/netinet6/nd6.c Mon Nov 4 17:35:37 2019 (r354336) @@ -918,6 +918,7 @@ nd6_timer(void *arg) defrouter_unlink(dr, &drq); ND6_WUNLOCK(); + NET_EPOCH_ENTER(et); while ((dr = TAILQ_FIRST(&drq)) != NULL) { TAILQ_REMOVE(&drq, dr, dr_entry); defrouter_del(dr); @@ -931,7 +932,6 @@ nd6_timer(void *arg) * * XXXRW: in6_ifaddrhead locking. */ - NET_EPOCH_ENTER(et); addrloop: CK_STAILQ_FOREACH_SAFE(ia6, &V_in6_ifaddrhead, ia_link, nia6) { /* check address lifetime */ From owner-svn-src-head@freebsd.org Mon Nov 4 19:30:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0AFE11ADDE0; Mon, 4 Nov 2019 19:30:20 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476NDW6R5gz4F81; Mon, 4 Nov 2019 19:30:19 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB9A5D08; Mon, 4 Nov 2019 19:30:19 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA4JUJPU083720; Mon, 4 Nov 2019 19:30:19 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA4JUJCI083719; Mon, 4 Nov 2019 19:30:19 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201911041930.xA4JUJCI083719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Mon, 4 Nov 2019 19:30:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354338 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 354338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2019 19:30:20 -0000 Author: gallatin Date: Mon Nov 4 19:30:19 2019 New Revision: 354338 URL: https://svnweb.freebsd.org/changeset/base/354338 Log: Add tunable to allow interrupts on hyperthreaded cores Enabling interrupts on htt cores has benefits to workloads which are primarily interrupt driven by increasing the logical cores available for interrupt handling. The tunable is named machdep.hyperthreading_intr_allowed Reviewed by: kib, jhb Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D22233 Modified: head/sys/x86/x86/mp_x86.c Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Mon Nov 4 18:34:29 2019 (r354337) +++ head/sys/x86/x86/mp_x86.c Mon Nov 4 19:30:19 2019 (r354338) @@ -144,6 +144,11 @@ static int hyperthreading_allowed = 1; SYSCTL_INT(_machdep, OID_AUTO, hyperthreading_allowed, CTLFLAG_RDTUN, &hyperthreading_allowed, 0, "Use Intel HTT logical CPUs"); +static int hyperthreading_intr_allowed = 0; +SYSCTL_INT(_machdep, OID_AUTO, hyperthreading_intr_allowed, CTLFLAG_RDTUN, + &hyperthreading_intr_allowed, 0, + "Allow interrupts on HTT logical CPUs"); + static struct topo_node topo_root; static int pkg_id_shift; @@ -1121,7 +1126,8 @@ set_interrupt_apic_ids(void) continue; /* Don't let hyperthreads service interrupts. */ - if (cpu_info[apic_id].cpu_hyperthread) + if (cpu_info[apic_id].cpu_hyperthread && + !hyperthreading_intr_allowed) continue; intr_add_cpu(i); From owner-svn-src-head@freebsd.org Mon Nov 4 19:38:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 637321AE457; Mon, 4 Nov 2019 19:38:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476NPX1y6pz4Fpq; Mon, 4 Nov 2019 19:38:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C421F02; Mon, 4 Nov 2019 19:38:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA4Jc7db089236; Mon, 4 Nov 2019 19:38:07 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA4Jc7G5089235; Mon, 4 Nov 2019 19:38:07 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201911041938.xA4Jc7G5089235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 4 Nov 2019 19:38:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354339 - head/contrib/llvm/lib/Target/PowerPC X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/lib/Target/PowerPC X-SVN-Commit-Revision: 354339 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2019 19:38:08 -0000 Author: dim Date: Mon Nov 4 19:38:07 2019 New Revision: 354339 URL: https://svnweb.freebsd.org/changeset/base/354339 Log: Merge commit 97e362607 from llvm git (by Nemanja Ivanovic): [PowerPC] Do not emit HW loop if the body contains calls to lrint/lround These two intrinsics are lowered to calls so should prevent the formation of CTR loops. In a subsequent patch, we will handle all currently known intrinsics and prevent the formation of HW loops if any unknown intrinsics are encountered. Differential revision: https://reviews.llvm.org/D68841 This should fix an "invalid CRT loop" assertion when building the www/node port for powerpc64. Requested by: Alfredo Dal'Ava Júnior MFC after: 1 month X-MFC-With: r353358 Modified: head/contrib/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp Modified: head/contrib/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp Mon Nov 4 19:30:19 2019 (r354338) +++ head/contrib/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp Mon Nov 4 19:38:07 2019 (r354339) @@ -331,8 +331,12 @@ bool PPCTTIImpl::mightUseCTR(BasicBlock *BB, case Intrinsic::ceil: Opcode = ISD::FCEIL; break; case Intrinsic::trunc: Opcode = ISD::FTRUNC; break; case Intrinsic::rint: Opcode = ISD::FRINT; break; + case Intrinsic::lrint: Opcode = ISD::LRINT; break; + case Intrinsic::llrint: Opcode = ISD::LLRINT; break; case Intrinsic::nearbyint: Opcode = ISD::FNEARBYINT; break; case Intrinsic::round: Opcode = ISD::FROUND; break; + case Intrinsic::lround: Opcode = ISD::LROUND; break; + case Intrinsic::llround: Opcode = ISD::LLROUND; break; case Intrinsic::minnum: Opcode = ISD::FMINNUM; break; case Intrinsic::maxnum: Opcode = ISD::FMAXNUM; break; case Intrinsic::umul_with_overflow: Opcode = ISD::UMULO; break; From owner-svn-src-head@freebsd.org Mon Nov 4 21:06:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 81BE81B0446; Mon, 4 Nov 2019 21:06:07 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476QM32t4Bz4LJn; Mon, 4 Nov 2019 21:06:07 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42E791F1A; Mon, 4 Nov 2019 21:06:07 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA4L67Fo044664; Mon, 4 Nov 2019 21:06:07 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA4L67pP044663; Mon, 4 Nov 2019 21:06:07 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201911042106.xA4L67pP044663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 4 Nov 2019 21:06:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354340 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 354340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2019 21:06:07 -0000 Author: brooks Date: Mon Nov 4 21:06:06 2019 New Revision: 354340 URL: https://svnweb.freebsd.org/changeset/base/354340 Log: Remove an outdated assertion. The exclusive lock assertion became incorrect due to changes in lock scope in r354155. Discussed with: jeffr Sponsored by: DARPA, AFRL Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Mon Nov 4 19:38:07 2019 (r354339) +++ head/sys/mips/mips/pmap.c Mon Nov 4 21:06:06 2019 (r354340) @@ -3093,7 +3093,6 @@ pmap_clear_modify(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_clear_modify: page %p is not managed", m)); - VM_OBJECT_ASSERT_WLOCKED(m->object); vm_page_assert_busied(m); if (!pmap_page_is_write_mapped(m)) From owner-svn-src-head@freebsd.org Mon Nov 4 21:23:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0609B1B0ADF; Mon, 4 Nov 2019 21:23:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476Ql65P1Zz4MT4; Mon, 4 Nov 2019 21:23:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C2C222B9; Mon, 4 Nov 2019 21:23:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA4LNU4S058921; Mon, 4 Nov 2019 21:23:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA4LNU0f058920; Mon, 4 Nov 2019 21:23:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911042123.xA4LNU0f058920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 4 Nov 2019 21:23:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354341 - head/sys/arm64/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm64/linux X-SVN-Commit-Revision: 354341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2019 21:23:31 -0000 Author: emaste Date: Mon Nov 4 21:23:30 2019 New Revision: 354341 URL: https://svnweb.freebsd.org/changeset/base/354341 Log: arm64 linuxulator: default to RW stack (no X) This matches Linux's default arm64 data / stack permissions. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/linux/linux_sysvec.c Modified: head/sys/arm64/linux/linux_sysvec.c ============================================================================== --- head/sys/arm64/linux/linux_sysvec.c Mon Nov 4 21:06:06 2019 (r354340) +++ head/sys/arm64/linux/linux_sysvec.c Mon Nov 4 21:23:30 2019 (r354341) @@ -371,7 +371,7 @@ struct sysentvec elf_linux_sysvec = { .sv_maxuser = VM_MAXUSER_ADDRESS, .sv_usrstack = USRSTACK, .sv_psstrings = PS_STRINGS, /* XXX */ - .sv_stackprot = VM_PROT_ALL, /* XXX */ + .sv_stackprot = VM_PROT_READ | VM_PROT_WRITE, .sv_copyout_strings = linux_copyout_strings, .sv_setregs = linux_exec_setregs, .sv_fixlimit = NULL, From owner-svn-src-head@freebsd.org Mon Nov 4 22:52:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 546291B2BCC; Mon, 4 Nov 2019 22:52:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476SjH1c2qz4S2D; Mon, 4 Nov 2019 22:52:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AD6D331E; Mon, 4 Nov 2019 22:52:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA4Mq2Pu012803; Mon, 4 Nov 2019 22:52:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA4Mq2HF012802; Mon, 4 Nov 2019 22:52:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911042252.xA4Mq2HF012802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 4 Nov 2019 22:52:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354342 - head/lib/libpmc/pmu-events X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libpmc/pmu-events X-SVN-Commit-Revision: 354342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2019 22:52:03 -0000 Author: emaste Date: Mon Nov 4 22:52:02 2019 New Revision: 354342 URL: https://svnweb.freebsd.org/changeset/base/354342 Log: libpmc: jevents: handle empty descriptoin PR: 241258 Reported by: sigsys @ gmail.com Obtained from: github.com/andikleen/pmu-tools commit bb3c77ed61 MFC after: 3 days Modified: head/lib/libpmc/pmu-events/jevents.c Modified: head/lib/libpmc/pmu-events/jevents.c ============================================================================== --- head/lib/libpmc/pmu-events/jevents.c Mon Nov 4 21:23:30 2019 (r354341) +++ head/lib/libpmc/pmu-events/jevents.c Mon Nov 4 22:52:02 2019 (r354342) @@ -122,7 +122,7 @@ static void fixdesc(char *s) --e; while (e >= s && isspace(*e)) --e; - if (*e == '.') + if (e >= s && *e == '.') *e = 0; } From owner-svn-src-head@freebsd.org Mon Nov 4 22:57:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B925D1B2FCF; Mon, 4 Nov 2019 22:57:39 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476Sql4WMxz4STK; Mon, 4 Nov 2019 22:57:39 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E4B33372; Mon, 4 Nov 2019 22:57:39 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA4MvdHn016311; Mon, 4 Nov 2019 22:57:39 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA4MvaBV016297; Mon, 4 Nov 2019 22:57:36 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201911042257.xA4MvaBV016297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Mon, 4 Nov 2019 22:57:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354343 - in head/sys/dev: e1000 oce X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in head/sys/dev: e1000 oce X-SVN-Commit-Revision: 354343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2019 22:57:39 -0000 Author: erj Date: Mon Nov 4 22:57:36 2019 New Revision: 354343 URL: https://svnweb.freebsd.org/changeset/base/354343 Log: net: prefer ETHER_ADDR_LEN over ETH_ADDR_LEN A couple of drivers and one place in if.c use ETH_ADDR_LEN, even though net/ethernet.h provides an equivalent ETHER_ADDR_LEN definition. Cleanup all of the locations which refer to ETH_ADDR_LEN to use the standard ETHER_ADDR_LEN instead. Signed-off-by: Jacob Keller Submitted by: Jacob Keller Reviewed by: erj@, jpaetzel@ Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D21239 Modified: head/sys/dev/e1000/e1000_82540.c head/sys/dev/e1000/e1000_82541.c head/sys/dev/e1000/e1000_82542.c head/sys/dev/e1000/e1000_82543.c head/sys/dev/e1000/e1000_defines.h head/sys/dev/e1000/e1000_hw.h head/sys/dev/e1000/e1000_ich8lan.c head/sys/dev/e1000/e1000_mac.c head/sys/dev/e1000/e1000_nvm.c head/sys/dev/e1000/e1000_vf.c head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_em.h head/sys/dev/oce/oce_hw.c head/sys/dev/oce/oce_if.h Modified: head/sys/dev/e1000/e1000_82540.c ============================================================================== --- head/sys/dev/e1000/e1000_82540.c Mon Nov 4 22:52:02 2019 (r354342) +++ head/sys/dev/e1000/e1000_82540.c Mon Nov 4 22:57:36 2019 (r354343) @@ -696,7 +696,7 @@ s32 e1000_read_mac_addr_82540(struct e1000_hw *hw) DEBUGFUNC("e1000_read_mac_addr"); - for (i = 0; i < ETH_ADDR_LEN; i += 2) { + for (i = 0; i < ETHER_ADDR_LEN; i += 2) { offset = i >> 1; ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data); if (ret_val) { @@ -711,7 +711,7 @@ s32 e1000_read_mac_addr_82540(struct e1000_hw *hw) if (hw->bus.func == E1000_FUNC_1) hw->mac.perm_addr[5] ^= 1; - for (i = 0; i < ETH_ADDR_LEN; i++) + for (i = 0; i < ETHER_ADDR_LEN; i++) hw->mac.addr[i] = hw->mac.perm_addr[i]; out: Modified: head/sys/dev/e1000/e1000_82541.c ============================================================================== --- head/sys/dev/e1000/e1000_82541.c Mon Nov 4 22:52:02 2019 (r354342) +++ head/sys/dev/e1000/e1000_82541.c Mon Nov 4 22:57:36 2019 (r354343) @@ -1285,7 +1285,7 @@ static s32 e1000_read_mac_addr_82541(struct e1000_hw * DEBUGFUNC("e1000_read_mac_addr"); - for (i = 0; i < ETH_ADDR_LEN; i += 2) { + for (i = 0; i < ETHER_ADDR_LEN; i += 2) { offset = i >> 1; ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data); if (ret_val) { @@ -1296,7 +1296,7 @@ static s32 e1000_read_mac_addr_82541(struct e1000_hw * hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8); } - for (i = 0; i < ETH_ADDR_LEN; i++) + for (i = 0; i < ETHER_ADDR_LEN; i++) hw->mac.addr[i] = hw->mac.perm_addr[i]; out: Modified: head/sys/dev/e1000/e1000_82542.c ============================================================================== --- head/sys/dev/e1000/e1000_82542.c Mon Nov 4 22:52:02 2019 (r354342) +++ head/sys/dev/e1000/e1000_82542.c Mon Nov 4 22:57:36 2019 (r354343) @@ -573,7 +573,7 @@ s32 e1000_read_mac_addr_82542(struct e1000_hw *hw) DEBUGFUNC("e1000_read_mac_addr"); - for (i = 0; i < ETH_ADDR_LEN; i += 2) { + for (i = 0; i < ETHER_ADDR_LEN; i += 2) { offset = i >> 1; ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data); if (ret_val) { @@ -584,7 +584,7 @@ s32 e1000_read_mac_addr_82542(struct e1000_hw *hw) hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8); } - for (i = 0; i < ETH_ADDR_LEN; i++) + for (i = 0; i < ETHER_ADDR_LEN; i++) hw->mac.addr[i] = hw->mac.perm_addr[i]; out: Modified: head/sys/dev/e1000/e1000_82543.c ============================================================================== --- head/sys/dev/e1000/e1000_82543.c Mon Nov 4 22:52:02 2019 (r354342) +++ head/sys/dev/e1000/e1000_82543.c Mon Nov 4 22:57:36 2019 (r354343) @@ -1574,7 +1574,7 @@ s32 e1000_read_mac_addr_82543(struct e1000_hw *hw) DEBUGFUNC("e1000_read_mac_addr"); - for (i = 0; i < ETH_ADDR_LEN; i += 2) { + for (i = 0; i < ETHER_ADDR_LEN; i += 2) { offset = i >> 1; ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data); if (ret_val) { @@ -1589,7 +1589,7 @@ s32 e1000_read_mac_addr_82543(struct e1000_hw *hw) if (hw->bus.func == E1000_FUNC_1) hw->mac.perm_addr[5] ^= 1; - for (i = 0; i < ETH_ADDR_LEN; i++) + for (i = 0; i < ETHER_ADDR_LEN; i++) hw->mac.addr[i] = hw->mac.perm_addr[i]; out: Modified: head/sys/dev/e1000/e1000_defines.h ============================================================================== --- head/sys/dev/e1000/e1000_defines.h Mon Nov 4 22:52:02 2019 (r354342) +++ head/sys/dev/e1000/e1000_defines.h Mon Nov 4 22:57:36 2019 (r354343) @@ -1206,10 +1206,6 @@ #define PCIE_LINK_SPEED_5000 0x02 #define PCIE_DEVICE_CONTROL2_16ms 0x0005 -#ifndef ETH_ADDR_LEN -#define ETH_ADDR_LEN 6 -#endif - #define PHY_REVISION_MASK 0xFFFFFFF0 #define MAX_PHY_REG_ADDRESS 0x1F /* 5 bit address bus (0-0x1F) */ #define MAX_PHY_MULTI_PAGE_REG 0xF Modified: head/sys/dev/e1000/e1000_hw.h ============================================================================== --- head/sys/dev/e1000/e1000_hw.h Mon Nov 4 22:52:02 2019 (r354342) +++ head/sys/dev/e1000/e1000_hw.h Mon Nov 4 22:57:36 2019 (r354343) @@ -785,8 +785,8 @@ struct e1000_nvm_operations { struct e1000_mac_info { struct e1000_mac_operations ops; - u8 addr[ETH_ADDR_LEN]; - u8 perm_addr[ETH_ADDR_LEN]; + u8 addr[ETHER_ADDR_LEN]; + u8 perm_addr[ETHER_ADDR_LEN]; enum e1000_mac_type type; Modified: head/sys/dev/e1000/e1000_ich8lan.c ============================================================================== --- head/sys/dev/e1000/e1000_ich8lan.c Mon Nov 4 22:52:02 2019 (r354342) +++ head/sys/dev/e1000/e1000_ich8lan.c Mon Nov 4 22:57:36 2019 (r354343) @@ -2780,7 +2780,7 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw * SHRAL/H) and initial CRC values to the MAC */ for (i = 0; i < hw->mac.rar_entry_count; i++) { - u8 mac_addr[ETH_ADDR_LEN] = {0}; + u8 mac_addr[ETHER_ADDR_LEN] = {0}; u32 addr_high, addr_low; addr_high = E1000_READ_REG(hw, E1000_RAH(i)); Modified: head/sys/dev/e1000/e1000_mac.c ============================================================================== --- head/sys/dev/e1000/e1000_mac.c Mon Nov 4 22:52:02 2019 (r354342) +++ head/sys/dev/e1000/e1000_mac.c Mon Nov 4 22:57:36 2019 (r354343) @@ -371,7 +371,7 @@ void e1000_write_vfta_generic(struct e1000_hw *hw, u32 void e1000_init_rx_addrs_generic(struct e1000_hw *hw, u16 rar_count) { u32 i; - u8 mac_addr[ETH_ADDR_LEN] = {0}; + u8 mac_addr[ETHER_ADDR_LEN] = {0}; DEBUGFUNC("e1000_init_rx_addrs_generic"); @@ -403,7 +403,7 @@ s32 e1000_check_alt_mac_addr_generic(struct e1000_hw * u32 i; s32 ret_val; u16 offset, nvm_alt_mac_addr_offset, nvm_data; - u8 alt_mac_addr[ETH_ADDR_LEN]; + u8 alt_mac_addr[ETHER_ADDR_LEN]; DEBUGFUNC("e1000_check_alt_mac_addr_generic"); @@ -440,7 +440,7 @@ s32 e1000_check_alt_mac_addr_generic(struct e1000_hw * if (hw->bus.func == E1000_FUNC_3) nvm_alt_mac_addr_offset += E1000_ALT_MAC_ADDRESS_OFFSET_LAN3; - for (i = 0; i < ETH_ADDR_LEN; i += 2) { + for (i = 0; i < ETHER_ADDR_LEN; i += 2) { offset = nvm_alt_mac_addr_offset + (i >> 1); ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data); if (ret_val) { @@ -604,7 +604,7 @@ void e1000_update_mc_addr_list_generic(struct e1000_hw hash_bit = hash_value & 0x1F; hw->mac.mta_shadow[hash_reg] |= (1 << hash_bit); - mc_addr_list += (ETH_ADDR_LEN); + mc_addr_list += (ETHER_ADDR_LEN); } /* replace the entire MTA table */ Modified: head/sys/dev/e1000/e1000_nvm.c ============================================================================== --- head/sys/dev/e1000/e1000_nvm.c Mon Nov 4 22:52:02 2019 (r354342) +++ head/sys/dev/e1000/e1000_nvm.c Mon Nov 4 22:57:36 2019 (r354343) @@ -1143,7 +1143,7 @@ s32 e1000_read_mac_addr_generic(struct e1000_hw *hw) for (i = 0; i < E1000_RAH_MAC_ADDR_LEN; i++) hw->mac.perm_addr[i+4] = (u8)(rar_high >> (i*8)); - for (i = 0; i < ETH_ADDR_LEN; i++) + for (i = 0; i < ETHER_ADDR_LEN; i++) hw->mac.addr[i] = hw->mac.perm_addr[i]; return E1000_SUCCESS; Modified: head/sys/dev/e1000/e1000_vf.c ============================================================================== --- head/sys/dev/e1000/e1000_vf.c Mon Nov 4 22:52:02 2019 (r354342) +++ head/sys/dev/e1000/e1000_vf.c Mon Nov 4 22:57:36 2019 (r354343) @@ -431,7 +431,7 @@ void e1000_update_mc_addr_list_vf(struct e1000_hw *hw, hash_value = e1000_hash_mc_addr_vf(hw, mc_addr_list); DEBUGOUT1("Hash value = 0x%03X\n", hash_value); hash_list[i] = hash_value & 0x0FFF; - mc_addr_list += ETH_ADDR_LEN; + mc_addr_list += ETHER_ADDR_LEN; } e1000_write_msg_read_ack(hw, msgbuf, E1000_VFMAILBOX_SIZE); @@ -517,7 +517,7 @@ static s32 e1000_read_mac_addr_vf(struct e1000_hw *hw) { int i; - for (i = 0; i < ETH_ADDR_LEN; i++) + for (i = 0; i < ETHER_ADDR_LEN; i++) hw->mac.addr[i] = hw->mac.perm_addr[i]; return E1000_SUCCESS; Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Mon Nov 4 22:52:02 2019 (r354342) +++ head/sys/dev/e1000/if_em.c Mon Nov 4 22:57:36 2019 (r354343) @@ -1002,7 +1002,7 @@ em_if_attach_pre(if_ctx_t ctx) hw->mac.report_tx_early = 1; /* Allocate multicast array memory. */ - adapter->mta = malloc(sizeof(u8) * ETH_ADDR_LEN * + adapter->mta = malloc(sizeof(u8) * ETHER_ADDR_LEN * MAX_NUM_MULTICAST_ADDRESSES, M_DEVBUF, M_NOWAIT); if (adapter->mta == NULL) { device_printf(dev, "Can not allocate multicast setup array\n"); @@ -1672,7 +1672,7 @@ em_copy_maddr(void *arg, struct sockaddr_dl *sdl, u_in if (cnt == MAX_NUM_MULTICAST_ADDRESSES) return (1); - bcopy(LLADDR(sdl), &mta[cnt * ETH_ADDR_LEN], ETH_ADDR_LEN); + bcopy(LLADDR(sdl), &mta[cnt * ETHER_ADDR_LEN], ETHER_ADDR_LEN); return (1); } @@ -1696,7 +1696,7 @@ em_if_multi_set(if_ctx_t ctx) IOCTL_DEBUGOUT("em_set_multi: begin"); mta = adapter->mta; - bzero(mta, sizeof(u8) * ETH_ADDR_LEN * MAX_NUM_MULTICAST_ADDRESSES); + bzero(mta, sizeof(u8) * ETHER_ADDR_LEN * MAX_NUM_MULTICAST_ADDRESSES); if (adapter->hw.mac.type == e1000_82542 && adapter->hw.revision_id == E1000_REVISION_2) { Modified: head/sys/dev/e1000/if_em.h ============================================================================== --- head/sys/dev/e1000/if_em.h Mon Nov 4 22:52:02 2019 (r354342) +++ head/sys/dev/e1000/if_em.h Mon Nov 4 22:57:36 2019 (r354343) @@ -340,7 +340,6 @@ #define EM_MSIX_MASK 0x01F00000 /* For 82574 use */ #define EM_MSIX_LINK 0x01000000 /* For 82574 use */ #define ETH_ZLEN 60 -#define ETH_ADDR_LEN 6 #define EM_CSUM_OFFLOAD (CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP) /* Offload bits in mbuf flag */ #define IGB_CSUM_OFFLOAD (CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP | \ CSUM_IP_SCTP | CSUM_IP6_UDP | CSUM_IP6_TCP | \ Modified: head/sys/dev/oce/oce_hw.c ============================================================================== --- head/sys/dev/oce/oce_hw.c Mon Nov 4 22:52:02 2019 (r354342) +++ head/sys/dev/oce/oce_hw.c Mon Nov 4 22:57:36 2019 (r354343) @@ -553,7 +553,7 @@ oce_copy_maddr(void *arg, struct sockaddr_dl *sdl, u_i return (0); bcopy(LLADDR(sdl), &req->params.req.mac[req->params.req.num_mac++], - ETH_ADDR_LEN); + ETHER_ADDR_LEN); return (1); } Modified: head/sys/dev/oce/oce_if.h ============================================================================== --- head/sys/dev/oce/oce_if.h Mon Nov 4 22:52:02 2019 (r354342) +++ head/sys/dev/oce/oce_if.h Mon Nov 4 22:57:36 2019 (r354343) @@ -200,7 +200,6 @@ extern int mp_ncpus; /* system's total active cpu co #define OCE_IF_CAPABILITIES_NONE 0 -#define ETH_ADDR_LEN 6 #define MAX_VLANFILTER_SIZE 64 #define MAX_VLANS 4096 From owner-svn-src-head@freebsd.org Mon Nov 4 23:06:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F2AA91B338A; Mon, 4 Nov 2019 23:06:57 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476T2T680Bz4T2n; Mon, 4 Nov 2019 23:06:57 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1D6C371B; Mon, 4 Nov 2019 23:06:57 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA4N6vAM021926; Mon, 4 Nov 2019 23:06:57 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA4N6vFa021925; Mon, 4 Nov 2019 23:06:57 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201911042306.xA4N6vFa021925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Mon, 4 Nov 2019 23:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354344 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 354344 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2019 23:06:58 -0000 Author: erj Date: Mon Nov 4 23:06:57 2019 New Revision: 354344 URL: https://svnweb.freebsd.org/changeset/base/354344 Log: iflib: properly release memory allocated for DMA DMA memory allocations using the bus_dma.h interface are not properly released in all cases for both Tx and Rx. This causes ~448 bytes of M_DEVBUF allocations to be leaked. First, the DMA maps for Rx are not properly destroyed. A slight attempt is made in iflib_fl_bufs_free to destroy the maps if we're detaching. However, this function may not be reliably called during detach. Indeed, there is a comment "asking" if this should be moved out. Fix this by moving the bus_dmamap_destroy call into iflib_rx_sds_free, where we already sync and unload the DMA. Second, the DMA tag associated with the ifr_ifdi descriptor DMA is not released properly anywhere. Add a call to iflib_dma_free in iflib_rx_structures_free. Third, use of NULL as a canary value on the map pointer returned by bus_dmamap_create is not valid. On some platforms, notably x86, this value may be NULL. In this case, we fail to properly release the related resources. Remove the NULL checks on map values in both iflib_fl_bufs_free and iflib_txsd_destroy. With all of these fixes applied, the leaks to M_DEVBUF are squelched, and iflib drivers now seem to properly cleanup when detaching. Signed-off-by: Jacob Keller Submitted by: Jacob Keller Reviewed by: erj@, gallatin@ MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D22203 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Mon Nov 4 22:57:36 2019 (r354343) +++ head/sys/net/iflib.c Mon Nov 4 23:06:57 2019 (r354344) @@ -1696,20 +1696,16 @@ iflib_txsd_destroy(if_ctx_t ctx, iflib_txq_t txq, int { bus_dmamap_t map; - map = NULL; - if (txq->ift_sds.ifsd_map != NULL) + if (txq->ift_sds.ifsd_map != NULL) { map = txq->ift_sds.ifsd_map[i]; - if (map != NULL) { bus_dmamap_sync(txq->ift_buf_tag, map, BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(txq->ift_buf_tag, map); bus_dmamap_destroy(txq->ift_buf_tag, map); txq->ift_sds.ifsd_map[i] = NULL; } - map = NULL; - if (txq->ift_sds.ifsd_tso_map != NULL) + if (txq->ift_sds.ifsd_tso_map != NULL) { map = txq->ift_sds.ifsd_tso_map[i]; - if (map != NULL) { bus_dmamap_sync(txq->ift_tso_buf_tag, map, BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(txq->ift_tso_buf_tag, map); @@ -2120,9 +2116,6 @@ iflib_fl_bufs_free(iflib_fl_t fl) bus_dmamap_unload(fl->ifl_buf_tag, sd_map); if (*sd_cl != NULL) uma_zfree(fl->ifl_zone, *sd_cl); - // XXX: Should this get moved out? - if (iflib_in_detach(fl->ifl_rxq->ifr_ctx)) - bus_dmamap_destroy(fl->ifl_buf_tag, sd_map); if (*sd_m != NULL) { m_init(*sd_m, M_NOWAIT, MT_DATA, 0); uma_zfree(zone_mbuf, *sd_m); @@ -2210,9 +2203,6 @@ iflib_rx_sds_free(iflib_rxq_t rxq) if (fl->ifl_buf_tag != NULL) { if (fl->ifl_sds.ifsd_map != NULL) { for (j = 0; j < fl->ifl_size; j++) { - if (fl->ifl_sds.ifsd_map[j] == - NULL) - continue; bus_dmamap_sync( fl->ifl_buf_tag, fl->ifl_sds.ifsd_map[j], @@ -2220,6 +2210,9 @@ iflib_rx_sds_free(iflib_rxq_t rxq) bus_dmamap_unload( fl->ifl_buf_tag, fl->ifl_sds.ifsd_map[j]); + bus_dmamap_destroy( + fl->ifl_buf_tag, + fl->ifl_sds.ifsd_map[j]); } } bus_dma_tag_destroy(fl->ifl_buf_tag); @@ -5735,9 +5728,12 @@ static void iflib_rx_structures_free(if_ctx_t ctx) { iflib_rxq_t rxq = ctx->ifc_rxqs; - int i; + if_shared_ctx_t sctx = ctx->ifc_sctx; + int i, j; for (i = 0; i < ctx->ifc_softc_ctx.isc_nrxqsets; i++, rxq++) { + for (j = 0; j < sctx->isc_nrxqs; j++) + iflib_dma_free(&rxq->ifr_ifdi[j]); iflib_rx_sds_free(rxq); #if defined(INET6) || defined(INET) if (if_getcapabilities(ctx->ifc_ifp) & IFCAP_LRO) From owner-svn-src-head@freebsd.org Tue Nov 5 00:12:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C65A11B4D17; Tue, 5 Nov 2019 00:12:22 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476VTy4ZZWz4X7X; Tue, 5 Nov 2019 00:12:22 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8073F4492; Tue, 5 Nov 2019 00:12:22 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA50CM44063398; Tue, 5 Nov 2019 00:12:22 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA50CLst063394; Tue, 5 Nov 2019 00:12:21 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201911050012.xA50CLst063394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Tue, 5 Nov 2019 00:12:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354345 - in head/sys: dev/usb/net net X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in head/sys: dev/usb/net net X-SVN-Commit-Revision: 354345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2019 00:12:22 -0000 Author: erj Date: Tue Nov 5 00:12:21 2019 New Revision: 354345 URL: https://svnweb.freebsd.org/changeset/base/354345 Log: net: add ETHER_IS_ZERO macro similar to ETHER_IS_BROADCAST Some places in network code may need to verify that an ethernet address is not the 'zero' address. Provide a standard macro ETHER_IS_ZERO for this purpose, similar to the ETHER_IS_BROADCAST macro already available. This patch also removes previous ETHER_IS_ZERO definitions in several USB ethernet drivers, in favor of this centrally-located macro. Signed-off-by: Jacob Keller Submitted by: Jacob Keller Reviewed by: erj@ Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D21240 Modified: head/sys/dev/usb/net/if_muge.c head/sys/dev/usb/net/if_smsc.c head/sys/dev/usb/net/if_ure.c head/sys/net/ethernet.h Modified: head/sys/dev/usb/net/if_muge.c ============================================================================== --- head/sys/dev/usb/net/if_muge.c Mon Nov 4 23:06:57 2019 (r354344) +++ head/sys/dev/usb/net/if_muge.c Tue Nov 5 00:12:21 2019 (r354345) @@ -157,9 +157,6 @@ do { \ #define muge_err_printf(sc, fmt, args...) \ device_printf((sc)->sc_ue.ue_dev, "error: " fmt, ##args) -#define ETHER_IS_ZERO(addr) \ - (!(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5])) - #define ETHER_IS_VALID(addr) \ (!ETHER_IS_MULTICAST(addr) && !ETHER_IS_ZERO(addr)) Modified: head/sys/dev/usb/net/if_smsc.c ============================================================================== --- head/sys/dev/usb/net/if_smsc.c Mon Nov 4 23:06:57 2019 (r354344) +++ head/sys/dev/usb/net/if_smsc.c Tue Nov 5 00:12:21 2019 (r354345) @@ -171,9 +171,6 @@ static const struct usb_device_id smsc_devs[] = { device_printf((sc)->sc_ue.ue_dev, "error: " fmt, ##args) -#define ETHER_IS_ZERO(addr) \ - (!(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5])) - #define ETHER_IS_VALID(addr) \ (!ETHER_IS_MULTICAST(addr) && !ETHER_IS_ZERO(addr)) Modified: head/sys/dev/usb/net/if_ure.c ============================================================================== --- head/sys/dev/usb/net/if_ure.c Mon Nov 4 23:06:57 2019 (r354344) +++ head/sys/dev/usb/net/if_ure.c Tue Nov 5 00:12:21 2019 (r354345) @@ -68,9 +68,6 @@ SYSCTL_INT(_hw_usb_ure, OID_AUTO, debug, CTLFLAG_RWTUN "Debug level"); #endif -#define ETHER_IS_ZERO(addr) \ - (!(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5])) - /* * Various supported device vendors/products. */ Modified: head/sys/net/ethernet.h ============================================================================== --- head/sys/net/ethernet.h Mon Nov 4 23:06:57 2019 (r354344) +++ head/sys/net/ethernet.h Tue Nov 5 00:12:21 2019 (r354345) @@ -74,6 +74,9 @@ struct ether_addr { #define ETHER_IS_BROADCAST(addr) \ (((addr)[0] & (addr)[1] & (addr)[2] & \ (addr)[3] & (addr)[4] & (addr)[5]) == 0xff) +#define ETHER_IS_ZERO(addr) \ + (((addr)[0] | (addr)[1] | (addr)[2] | \ + (addr)[3] | (addr)[4] | (addr)[5]) == 0x00) /* * 802.1q Virtual LAN header. From owner-svn-src-head@freebsd.org Tue Nov 5 02:30:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 008231B9951; Tue, 5 Nov 2019 02:30:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476YYY6C2Pz4g86; Tue, 5 Nov 2019 02:30:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8B9C5CD8; Tue, 5 Nov 2019 02:30:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA52UfNx041543; Tue, 5 Nov 2019 02:30:41 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA52UfDE041542; Tue, 5 Nov 2019 02:30:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201911050230.xA52UfDE041542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 5 Nov 2019 02:30:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354346 - in head: release/picobsd share/man/man8 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: release/picobsd share/man/man8 X-SVN-Commit-Revision: 354346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2019 02:30:42 -0000 Author: kevans Date: Tue Nov 5 02:30:41 2019 New Revision: 354346 URL: https://svnweb.freebsd.org/changeset/base/354346 Log: Remove picobsd build scripts and the remaining tinyware Postings were sent to -arch@ on 2019/09/13 and 2019/10/01, proposing and confirming a removal of these scripts on 2019/10/31, due to significant work needed to bring this into the modern world and nobody having done this work in the past couple of years. No objections or proposed work was raised in response to these postings. The tinyware may see a resurrection into a separate repo for archival purposes if any users of it show interest in doing so. MFC after: never Deleted: head/release/picobsd/ head/share/man/man8/picobsd.8 Modified: head/share/man/man8/Makefile head/share/man/man8/nanobsd.8 Modified: head/share/man/man8/Makefile ============================================================================== --- head/share/man/man8/Makefile Tue Nov 5 00:12:21 2019 (r354345) +++ head/share/man/man8/Makefile Tue Nov 5 02:30:41 2019 (r354346) @@ -9,7 +9,6 @@ MAN= \ diskless.8 \ intro.8 \ nanobsd.8 \ - picobsd.8 \ rc.8 \ rc.sendmail.8 \ rc.subr.8 \ Modified: head/share/man/man8/nanobsd.8 ============================================================================== --- head/share/man/man8/nanobsd.8 Tue Nov 5 00:12:21 2019 (r354345) +++ head/share/man/man8/nanobsd.8 Tue Nov 5 02:30:41 2019 (r354346) @@ -339,8 +339,7 @@ customize_cmd cust_etc_size .Sh SEE ALSO .Xr make.conf 5 , .Xr boot 8 , -.Xr boot0cfg 8 , -.Xr picobsd 8 +.Xr boot0cfg 8 .Sh HISTORY The .Nm From owner-svn-src-head@freebsd.org Tue Nov 5 03:20:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 646E41BB490; Tue, 5 Nov 2019 03:20:42 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476ZgG1y70z3FXN; Tue, 5 Nov 2019 03:20:42 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 264626699; Tue, 5 Nov 2019 03:20:42 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA53Kg6H072901; Tue, 5 Nov 2019 03:20:42 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA53Keqi072895; Tue, 5 Nov 2019 03:20:40 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201911050320.xA53Keqi072895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 5 Nov 2019 03:20:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354347 - in head: contrib/compiler-rt/lib/builtins contrib/libunwind/include lib/libcompiler_rt lib/libgcc_s lib/libgcc_s/arm X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: contrib/compiler-rt/lib/builtins contrib/libunwind/include lib/libcompiler_rt lib/libgcc_s lib/libgcc_s/arm X-SVN-Commit-Revision: 354347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2019 03:20:42 -0000 Author: cem Date: Tue Nov 5 03:20:40 2019 New Revision: 354347 URL: https://svnweb.freebsd.org/changeset/base/354347 Log: Fix llvm-libunwind userspace build on ARM GCC's libgcc exports a few ARM-specific symbols for ARM EABI, AEABI, or EHABI or whatever it's called. Export the same ones from LLVM-libunwind's libgcc_s, on ARM. As part of this, convert libgcc_s from a direct Version.map to one constructed from component Symbol.map files. This allows the ARM-specific Symbol.map to be included only on ARM. Fix ARM-only oddities in struct name/aliases in LLVM-libunwind to match non-ARM definitions and ARM-specific expectations in libcxxrt / libcompiler_rt. No functional change intended for non-ARM architectures. This commit does not actually flip the switch for ARM defaults from libgcc to llvm-libunwind, but makes it possible (to compile, anyway). Added: head/lib/libgcc_s/Symbol.map - copied, changed from r354346, head/lib/libgcc_s/Version.map head/lib/libgcc_s/Versions.def (contents, props changed) head/lib/libgcc_s/arm/ head/lib/libgcc_s/arm/Symbol.map (contents, props changed) Deleted: head/lib/libgcc_s/Version.map Modified: head/contrib/compiler-rt/lib/builtins/gcc_personality_v0.c head/contrib/libunwind/include/unwind.h head/lib/libcompiler_rt/Makefile head/lib/libgcc_s/Makefile Modified: head/contrib/compiler-rt/lib/builtins/gcc_personality_v0.c ============================================================================== --- head/contrib/compiler-rt/lib/builtins/gcc_personality_v0.c Tue Nov 5 02:30:41 2019 (r354346) +++ head/contrib/compiler-rt/lib/builtins/gcc_personality_v0.c Tue Nov 5 03:20:40 2019 (r354347) @@ -9,8 +9,23 @@ #include "int_lib.h" #include +/* + * XXX On FreeBSD, this file is compiled into three libraries: + * - libcompiler_rt + * - libgcc_eh + * - libgcc_s + * + * In the former, the include path points to the contrib/libcxxrt/unwind-arm.h + * copy of unwind.h. In the latter, the include path points to the + * contrib/libunwind/include/unwind.h header (LLVM libunwind). + * + * Neither (seemingly redundant) variant of unwind.h needs the redefinitions + * provided in the "helpful" header below, and libcxxrt's unwind-arm.h provides + * *no* useful distinguishing macros, so just forcibly disable the helper + * header on FreeBSD. + */ #if defined(__arm__) && !defined(__ARM_DWARF_EH__) && \ - !defined(__USING_SJLJ_EXCEPTIONS__) + !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__FreeBSD__) // When building with older compilers (e.g. clang <3.9), it is possible that we // have a version of unwind.h which does not provide the EHABI declarations // which are quired for the C personality to conform to the specification. In Modified: head/contrib/libunwind/include/unwind.h ============================================================================== --- head/contrib/libunwind/include/unwind.h Tue Nov 5 02:30:41 2019 (r354346) +++ head/contrib/libunwind/include/unwind.h Tue Nov 5 03:20:40 2019 (r354347) @@ -66,12 +66,16 @@ static const _Unwind_State _US_ACTION_MASK static const _Unwind_State _US_FORCE_UNWIND = 8; typedef uint32_t _Unwind_EHT_Header; +/* + * gcc_personality_v0 references 'struct _Unwind_Exception' all over the place. + * Nothing in libunwind cares about 'struct _Unwind_Control_Block,' so make it + * the alias of struct _Unwind_Exception, instead of the other way around. + */ +struct _Unwind_Exception; +typedef struct _Unwind_Exception _Unwind_Exception; +typedef struct _Unwind_Exception _Unwind_Control_Block; /* Alias */ -struct _Unwind_Control_Block; -typedef struct _Unwind_Control_Block _Unwind_Control_Block; -typedef struct _Unwind_Control_Block _Unwind_Exception; /* Alias */ - -struct _Unwind_Control_Block { +struct _Unwind_Exception { uint64_t exception_class; void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block*); Modified: head/lib/libcompiler_rt/Makefile ============================================================================== --- head/lib/libcompiler_rt/Makefile Tue Nov 5 02:30:41 2019 (r354346) +++ head/lib/libcompiler_rt/Makefile Tue Nov 5 03:20:40 2019 (r354347) @@ -12,10 +12,6 @@ CFLAGS+= -fvisibility=hidden CFLAGS+= -DVISIBILITY_HIDDEN CFLAGS+= -I${SRCTOP}/contrib/libcxxrt -.if ${COMPILER_TYPE} == "clang" -CWARNFLAGS.gcc_personality_v0.c+= -Wno-typedef-redefinition -.endif - # gcc has incompatible internal declarations for __divtc3 and __multc3, but has # no option to silence its warning, so make warnings non-fatal. NO_WERROR.gcc= Modified: head/lib/libgcc_s/Makefile ============================================================================== --- head/lib/libgcc_s/Makefile Tue Nov 5 02:30:41 2019 (r354346) +++ head/lib/libgcc_s/Makefile Tue Nov 5 03:20:40 2019 (r354347) @@ -4,12 +4,22 @@ PACKAGE= clibs SHLIB_NAME= libgcc_s.so.1 SHLIBDIR?= /lib +.include + MK_SSP= no WARNS?= 2 LDFLAGS+= -nodefaultlibs LIBADD+= c -VERSION_MAP= ${.CURDIR}/Version.map + +.if ${MK_SYMVER} == "yes" +VERSION_DEF= ${.CURDIR}/Versions.def +SYMBOL_MAPS= ${.CURDIR}/Symbol.map +# Export ARM AEABI unwind routines needed by libc and libthr. +.if exists(${.CURDIR}/${MACHINE_CPUARCH}/Symbol.map) +SYMBOL_MAPS+= ${.CURDIR}/${MACHINE_CPUARCH}/Symbol.map +.endif +.endif .include "../libcompiler_rt/Makefile.inc" .include "../libgcc_eh/Makefile.inc" Copied and modified: head/lib/libgcc_s/Symbol.map (from r354346, head/lib/libgcc_s/Version.map) ============================================================================== --- head/lib/libgcc_s/Version.map Tue Nov 5 02:30:41 2019 (r354346, copy source) +++ head/lib/libgcc_s/Symbol.map Tue Nov 5 03:20:40 2019 (r354347) @@ -3,7 +3,6 @@ */ GCC_3.0 { -global: __absvdi2; __absvsi2; __addvdi3; @@ -84,8 +83,6 @@ global: _Unwind_Resume; _Unwind_SetGR; _Unwind_SetIP; -local: - *; }; GCC_3.3 { @@ -93,11 +90,11 @@ GCC_3.3 { _Unwind_FindEnclosingFunction; _Unwind_GetCFA; _Unwind_Resume_or_Rethrow; -} GCC_3.0; +}; GCC_3.3.1 { __gcc_personality_v0; -} GCC_3.3; +}; GCC_3.4 { __clzdi2; @@ -112,11 +109,11 @@ GCC_3.4 { __popcountdi2; __popcountsi2; __popcountti2; -} GCC_3.3.1; +}; GCC_3.4.2 { __enable_execute_stack; -} GCC_3.4; +}; GCC_3.4.4 { __absvti2; @@ -124,7 +121,7 @@ GCC_3.4.4 { __mulvti3; __negvti2; __subvti3; -} GCC_3.4.2; +}; GCC_4.0.0 { __divdc3; @@ -136,7 +133,7 @@ GCC_4.0.0 { __powidf2; __powisf2; __powixf2; -} GCC_3.4.4; +}; GCC_4.2.0 { __floatundidf; @@ -146,9 +143,9 @@ GCC_4.2.0 { __floatuntisf; __floatuntixf; _Unwind_GetIPInfo; -} GCC_4.0.0; +}; GCC_4.3.0 { __bswapdi2; __bswapsi2; -} GCC_4.2.0; +}; Added: head/lib/libgcc_s/Versions.def ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libgcc_s/Versions.def Tue Nov 5 03:20:40 2019 (r354347) @@ -0,0 +1,31 @@ +# $FreeBSD$ + +GCC_3.0 { +}; + +GCC_3.3 { +} GCC_3.0; + +GCC_3.3.1 { +} GCC_3.3; + +GCC_3.4 { +} GCC_3.3.1; + +GCC_3.4.2 { +} GCC_3.4; + +GCC_3.4.4 { +} GCC_3.4.2; + +GCC_3.5 { +} GCC_3.4.4; + +GCC_4.0.0 { +} GCC_3.5; + +GCC_4.2.0 { +} GCC_4.0.0; + +GCC_4.3.0 { +} GCC_4.2.0; Added: head/lib/libgcc_s/arm/Symbol.map ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libgcc_s/arm/Symbol.map Tue Nov 5 03:20:40 2019 (r354347) @@ -0,0 +1,12 @@ +/* + * $FreeBSD$ + */ + +GCC_3.5 { + _Unwind_VRS_Get; + _Unwind_VRS_Set; + __aeabi_unwind_cpp_pr0; + __aeabi_unwind_cpp_pr1; + __aeabi_unwind_cpp_pr2; + __gnu_unwind_frame; +}; From owner-svn-src-head@freebsd.org Tue Nov 5 03:22:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78E0A1BB69A; Tue, 5 Nov 2019 03:22:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476Zj42hDXz3Fnk; Tue, 5 Nov 2019 03:22:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F5F4683F; Tue, 5 Nov 2019 03:22:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA53MGxV075381; Tue, 5 Nov 2019 03:22:16 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA53MGp3075380; Tue, 5 Nov 2019 03:22:16 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201911050322.xA53MGp3075380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 5 Nov 2019 03:22:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354348 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 354348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2019 03:22:16 -0000 Author: cem Date: Tue Nov 5 03:22:15 2019 New Revision: 354348 URL: https://svnweb.freebsd.org/changeset/base/354348 Log: armv6, armv7: Switch to llvm-libunwind by default This could just be ${__TT} == "arm", except armv5 isn't slated for death until EOY. arm tinderbox builds. Let's see what else shakes out. Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Tue Nov 5 03:20:40 2019 (r354347) +++ head/share/mk/src.opts.mk Tue Nov 5 03:22:15 2019 (r354348) @@ -329,8 +329,9 @@ BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GCC GCC_BO .if ${__T:Mriscv*} != "" BROKEN_OPTIONS+=OFED .endif -.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \ - ${__T:Mriscv*} != "" || ${__TT} == "mips" +.if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "armv6" || \ + ${__T} == "armv7" || ${__T} == "i386" || ${__T:Mriscv*} != "" || \ + ${__TT} == "mips" __DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND .else __DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND From owner-svn-src-head@freebsd.org Tue Nov 5 06:34:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 777321BFF4C; Tue, 5 Nov 2019 06:34:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476fyj2Zmhz3PND; Tue, 5 Nov 2019 06:34:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C76F8A1A; Tue, 5 Nov 2019 06:34:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA56YLTw089953; Tue, 5 Nov 2019 06:34:21 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA56YKQ4089951; Tue, 5 Nov 2019 06:34:20 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201911050634.xA56YKQ4089951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 5 Nov 2019 06:34:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354349 - head/sys/dev/ixgbe X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/ixgbe X-SVN-Commit-Revision: 354349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2019 06:34:21 -0000 Author: avg Date: Tue Nov 5 06:34:20 2019 New Revision: 354349 URL: https://svnweb.freebsd.org/changeset/base/354349 Log: if_ixv: disable RSS configuration on 82599 and X540 VFs It is reported that those VFs share their RSS configuration with PF and, thus, they cannot be configured independently. Also: - add missing opt_rss.h to if_ixv.c, otherwise RSS kernel option could not be seen - do not enable IXGBE_FEATURE_RSS on the older VFs - set flowid / hash type to M_HASHTYPE_NONE or M_HASHTYPE_OPAQUE_HASH (based on what the hardware reports) if IXGBE_FEATURE_RSS is not set Reviewed by: nobody MFC after: 4 weeks Sponsored by: Panzura Differential Revision: https://reviews.freebsd.org/D21705 Modified: head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ixgbe/ix_txrx.c Modified: head/sys/dev/ixgbe/if_ixv.c ============================================================================== --- head/sys/dev/ixgbe/if_ixv.c Tue Nov 5 03:22:15 2019 (r354348) +++ head/sys/dev/ixgbe/if_ixv.c Tue Nov 5 06:34:20 2019 (r354349) @@ -35,6 +35,7 @@ #include "opt_inet.h" #include "opt_inet6.h" +#include "opt_rss.h" #include "ixgbe.h" #include "ifdi_if.h" @@ -1454,7 +1455,12 @@ ixv_initialize_receive_units(if_ctx_t ctx) scctx->isc_nrxd[0] - 1); } - ixv_initialize_rss_mapping(adapter); + /* + * Do not touch RSS and RETA settings for older hardware + * as those are shared among PF and all VF. + */ + if (adapter->hw.mac.type >= ixgbe_mac_X550_vf) + ixv_initialize_rss_mapping(adapter); } /* ixv_initialize_receive_units */ /************************************************************************ @@ -1889,7 +1895,6 @@ ixv_init_device_features(struct adapter *adapter) { adapter->feat_cap = IXGBE_FEATURE_NETMAP | IXGBE_FEATURE_VF - | IXGBE_FEATURE_RSS | IXGBE_FEATURE_LEGACY_TX; /* A tad short on feature flags for VFs, atm. */ @@ -1902,6 +1907,7 @@ ixv_init_device_features(struct adapter *adapter) case ixgbe_mac_X550EM_x_vf: case ixgbe_mac_X550EM_a_vf: adapter->feat_cap |= IXGBE_FEATURE_NEEDS_CTXD; + adapter->feat_cap |= IXGBE_FEATURE_RSS; break; default: break; Modified: head/sys/dev/ixgbe/ix_txrx.c ============================================================================== --- head/sys/dev/ixgbe/ix_txrx.c Tue Nov 5 03:22:15 2019 (r354348) +++ head/sys/dev/ixgbe/ix_txrx.c Tue Nov 5 06:34:20 2019 (r354349) @@ -464,6 +464,12 @@ ixgbe_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) ri->iri_flowid = le32toh(rxd->wb.lower.hi_dword.rss); ri->iri_rsstype = ixgbe_determine_rsstype(pkt_info); + if ((adapter->feat_en & IXGBE_FEATURE_RSS) == 0) { + if (ri->iri_rsstype == M_HASHTYPE_OPAQUE) + ri->iri_rsstype = M_HASHTYPE_NONE; + else + ri->iri_rsstype = M_HASHTYPE_OPAQUE_HASH; + } ri->iri_vtag = vtag; ri->iri_nfrags = i; if (vtag) From owner-svn-src-head@freebsd.org Tue Nov 5 08:53:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B13AA17CE93; Tue, 5 Nov 2019 08:53:40 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476k3S43r1z428x; Tue, 5 Nov 2019 08:53:40 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F25EA352; Tue, 5 Nov 2019 08:53:40 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA58reE3073237; Tue, 5 Nov 2019 08:53:40 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA58re6X073236; Tue, 5 Nov 2019 08:53:40 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201911050853.xA58re6X073236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Tue, 5 Nov 2019 08:53:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354356 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: maxim X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 354356 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2019 08:53:40 -0000 Author: maxim Date: Tue Nov 5 08:53:40 2019 New Revision: 354356 URL: https://svnweb.freebsd.org/changeset/base/354356 Log: o OpenBSD 6.6 and FreeBSD 12.1 releases added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Tue Nov 5 07:13:07 2019 (r354355) +++ head/share/misc/bsd-family-tree Tue Nov 5 08:53:40 2019 (r354356) @@ -394,13 +394,17 @@ FreeBSD 5.2 | | | | | | | | | DragonFly 5.4.0 *--FreeBSD | | | v | | | 12.0 | | | | DragonFly 5.4.1 - | | | | OpenBSD 6.5 | - | | | | | | - | | | NetBSD | | - | | | 8.1 | DragonFly 5.6 + | | | | | OpenBSD 6.5 | + | | | | | | | + | | | | NetBSD | | + | | | | 8.1 | DragonFly 5.6 + | | | | | | + | | | | | DragonFly 5.6.1 + | FreeBSD | | OpenBSD 6.6 | + | 12.1 | | | | + | | | | | | + | v | | | | | | | | | - | | | | DragonFly 5.6.1 - | | | | | FreeBSD 13 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | v v v v v @@ -786,6 +790,8 @@ OpenBSD 6.5 2019-05-01 [OBD] NetBSD 8.1 2019-06-04 [NBD] DragonFly 5.6 2019-06-17 [DFB] DragonFly 5.6.1 2019-06-19 [DFB] +OpenBSD 6.6 2019-10-17 [OBD] +FreeBSD 12.1 2019-11-04 [FBD] Bibliography ------------------------ From owner-svn-src-head@freebsd.org Tue Nov 5 10:53:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A65251A2437; Tue, 5 Nov 2019 10:53:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476mkD3x2Kz48hG; Tue, 5 Nov 2019 10:53:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A554B8E2; Tue, 5 Nov 2019 10:53:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA5AruFJ044830; Tue, 5 Nov 2019 10:53:56 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA5Arutf044828; Tue, 5 Nov 2019 10:53:56 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201911051053.xA5Arutf044828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 5 Nov 2019 10:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354357 - head/tests/sys/netinet6/frag6 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/tests/sys/netinet6/frag6 X-SVN-Commit-Revision: 354357 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2019 10:53:56 -0000 Author: bz Date: Tue Nov 5 10:53:55 2019 New Revision: 354357 URL: https://svnweb.freebsd.org/changeset/base/354357 Log: frag6 tests: set end to catch timeout as error There are times when we have to wait for reply packets. There are either an ICMPv6 (error) reply or the expiration timeout. In these cases synchonous ICMPv6 replies should arrive, always, unless the packet is lost. Due to errors experienced with the test software sending an invlaid request on at least i386 (*) these packets are not generated. That means we are waiting for a long time for the replies or even timeout the test case. Manually set the "End" flag on these test cases as well, so they do fail rather than timeout as the sniffer timeout happens. This improves debugging options, reflects the error properly, and saves time on each test suit run. (*) The real cause for that is still to be found (see the referenced PRs) PR: 241493, 239380 MFC after: 2 weeks Sponsored by: Netflix Modified: head/tests/sys/netinet6/frag6/frag6_02.py head/tests/sys/netinet6/frag6/frag6_04.py Modified: head/tests/sys/netinet6/frag6/frag6_02.py ============================================================================== --- head/tests/sys/netinet6/frag6/frag6_02.py Tue Nov 5 08:53:40 2019 (r354356) +++ head/tests/sys/netinet6/frag6/frag6_02.py Tue Nov 5 10:53:55 2019 (r354357) @@ -98,6 +98,7 @@ def main(): sp.sendp(ip6f01, iface=args.sendif[0], verbose=False) sleep(0.10) + sniffer.setEnd() sniffer.join() if not sniffer.foundCorrectPacket: sys.exit(1) Modified: head/tests/sys/netinet6/frag6/frag6_04.py ============================================================================== --- head/tests/sys/netinet6/frag6/frag6_04.py Tue Nov 5 08:53:40 2019 (r354356) +++ head/tests/sys/netinet6/frag6/frag6_04.py Tue Nov 5 10:53:55 2019 (r354357) @@ -95,6 +95,7 @@ def main(): sp.sendp(ip6f01, iface=args.sendif[0], verbose=False) sleep(0.10) + sniffer.setEnd() sniffer.join() if not sniffer.foundCorrectPacket: sys.exit(1) From owner-svn-src-head@freebsd.org Tue Nov 5 10:59:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B9EF11A2665; Tue, 5 Nov 2019 10:59:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476mrk4Rc8z48tQ; Tue, 5 Nov 2019 10:59:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61B21B8F5; Tue, 5 Nov 2019 10:59:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA5AxYEf045161; Tue, 5 Nov 2019 10:59:34 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA5AxXw2045159; Tue, 5 Nov 2019 10:59:33 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201911051059.xA5AxXw2045159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 5 Nov 2019 10:59:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354358 - head/tests/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/tests/sys/netinet6 X-SVN-Commit-Revision: 354358 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2019 10:59:34 -0000 Author: bz Date: Tue Nov 5 10:59:33 2019 New Revision: 354358 URL: https://svnweb.freebsd.org/changeset/base/354358 Log: ip6 tests: Add very simplistic extension header tests Add a simple test case which can exercise some of the IPv6 extension header code paths. At the moment only a small set of extension headers is implemented and no options to the ones which take them. Also implements a "bad" case to make sure that error handling works. The tests were used to test m_pullup() changes to the code paths while removing the KAME PULLDOWN_TEST cases and related macros. MFC after: 3 weeks Sponsored by: Netflix Added: head/tests/sys/netinet6/exthdr.py (contents, props changed) head/tests/sys/netinet6/exthdr.sh (contents, props changed) Modified: head/tests/sys/netinet6/Makefile Modified: head/tests/sys/netinet6/Makefile ============================================================================== --- head/tests/sys/netinet6/Makefile Tue Nov 5 10:53:55 2019 (r354357) +++ head/tests/sys/netinet6/Makefile Tue Nov 5 10:59:33 2019 (r354358) @@ -1,6 +1,16 @@ # $FreeBSD$ +PACKAGE= tests + TESTSDIR= ${TESTSBASE}/sys/netinet6 +FILESDIR= ${TESTSDIR} + +ATF_TESTS_SH= \ + exthdr + +${PACKAGE}FILES+= exthdr.py + +${PACKAGE}FILESMODE_exthdr.py= 0555 TESTS_SUBDIRS+= frag6 Added: head/tests/sys/netinet6/exthdr.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netinet6/exthdr.py Tue Nov 5 10:59:33 2019 (r354358) @@ -0,0 +1,273 @@ +#!/usr/bin/env python +#- +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2019 Netflix, Inc. +# +# 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$ +# + +import argparse +import scapy.all as sp +import socket +import sys +import frag6.sniffer as Sniffer +from time import sleep + +def check_icmp6_error_dst_unreach_noport(args, packet): + ip6 = packet.getlayer(sp.IPv6) + if not ip6: + return False + oip6 = sp.IPv6(src=args.src[0], dst=args.to[0]) + if ip6.dst != oip6.src: + return False + icmp6 = packet.getlayer(sp.ICMPv6DestUnreach) + if not icmp6: + return False + # ICMP6_DST_UNREACH_NOPORT 4 + if icmp6.code != 4: + return False + # Should we check the payload as well? + # We are running in a very isolated environment and nothing else + # should trigger an ICMPv6 Dest Unreach / Port Unreach so leave it. + #icmp6.display() + return True + +def check_icmp6_error_paramprob_header(args, packet): + ip6 = packet.getlayer(sp.IPv6) + if not ip6: + return False + oip6 = sp.IPv6(src=args.src[0], dst=args.to[0]) + if ip6.dst != oip6.src: + return False + icmp6 = packet.getlayer(sp.ICMPv6ParamProblem) + if not icmp6: + return False + # ICMP6_PARAMPROB_HEADER 0 + if icmp6.code != 0: + return False + # Should we check the payload as well? + # We are running in a very isolated environment and nothing else + # should trigger an ICMPv6 Param Prob so leave it. + #icmp6.display() + return True + +def check_tcp_rst(args, packet): + ip6 = packet.getlayer(sp.IPv6) + if not ip6: + return False + oip6 = sp.IPv6(src=args.src[0], dst=args.to[0]) + if ip6.dst != oip6.src: + return False + tcp = packet.getlayer(sp.TCP) + if not tcp: + return False + # Is TCP RST? + if tcp.flags & 0x04: + #tcp.display() + return True + return False + +def addExt(ext, h): + if h is None: + return ext + if ext is None: + ext = h + else: + ext = ext / h + return ext + +def getExtHdrs(args): + ext = None + + # XXX-TODO Try to put them in an order which could make sense + # in real life packets and according to the RFCs. + if args.hbh: + hbh = sp.IPv6ExtHdrHopByHop(options = \ + sp.PadN(optdata="\x00\x00\x00\x00\x00\x00")) + ext = addExt(ext, hbh) + + if args.rh: + rh = sp.IPv6ExtHdrRouting(type = 0) + ext = addExt(ext, rh) + + if args.frag6: + frag6 = sp.IPv6ExtHdrFragment(offset=0, m=0, id=0x1234) + ext = addExt(ext, frag6) + + if args.esp: + # XXX TODO + esp = None + ext = addExt(ext, esp) + + if args.ah: + # XXX TODO + ah = None + ext = addExt(ext, ah) + + if args.dest: + dest = sp.IPv6ExtHdrDestOpt(options = \ + sp.PadN(optdata="\x00\x00\x00\x00\x00\x00")) + ext = addExt(ext, dest) + + if args.mobi: + # XXX TODO + mobi = None + ext = addExt(ext, mobi) + + if args.hip: + # XXX TODO + hip = None + ext = addExt(ext, hip) + + if args.shim6: + # XXX TODO + shim6 = None + ext = addExt(ext, shim6) + + if args.proto253: + # XXX TODO + tft = None + ext = addExt(ext, tft) + + if args.proto254: + # XXX TODO + tff = None + ext = addExt(ext, tff) + + if args.hbhbad: + hbhbad = sp.IPv6ExtHdrHopByHop(options = \ + sp.PadN(optdata="\x00\x00\x00\x00\x00\x00")) + ext = addExt(ext, hbhbad) + + return ext + +def main(): + parser = argparse.ArgumentParser("exthdr.py", + description="IPv6 extension header test tool") + parser.add_argument('--sendif', nargs=1, + required=True, + help='The interface through which the packet will be sent') + parser.add_argument('--recvif', nargs=1, + required=True, + help='The interface on which to check for the packet') + parser.add_argument('--src', nargs=1, + required=True, + help='The source IP address') + parser.add_argument('--to', nargs=1, + required=True, + help='The destination IP address') + parser.add_argument('--debug', + required=False, action='store_true', + help='Enable test debugging') + # Extension Headers + # See https://www.iana.org/assignments/ipv6-parameters/ipv6-parameters.xhtml + parser.add_argument('--hbh', + required=False, action='store_true', + help='Add IPv6 Hop-by-Hop Option') + parser.add_argument('--hbhbad', + required=False, action='store_true', + help='Add IPv6 Hop-by-Hop Option at an invalid position') + parser.add_argument('--rh', + required=False, action='store_true', + help='Add Routing Header for IPv6') + parser.add_argument('--frag6', + required=False, action='store_true', + help='Add Fragment Header for IPv6') + parser.add_argument('--esp', + required=False, action='store_true', + help='Add Encapsulating Security Payload') + parser.add_argument('--ah', + required=False, action='store_true', + help='Add Authentication Header') + parser.add_argument('--dest', + required=False, action='store_true', + help='Add Destination Options for IPv6') + parser.add_argument('--mobi', + required=False, action='store_true', + help='Add Mobility Header') + parser.add_argument('--hip', + required=False, action='store_true', + help='Add Host Identity Protocol') + parser.add_argument('--shim6', + required=False, action='store_true', + help='Add Shim6 Protocol') + parser.add_argument('--proto253', + required=False, action='store_true', + help='Use for experimentation and testing (253)') + parser.add_argument('--proto254', + required=False, action='store_true', + help='Use for experimentation and testing (254)') + + args = parser.parse_args() + + if args.hbhbad: + ok = 0 + else: + ok = 1 + + ######################################################################## + # + # Send IPv6 packets with one or more extension headers (combinations + # mmight not always make sense depending what user tells us). + # We are trying to cover the basic loop and passing mbufs on + # and making sure m_pullup() works. + # Try for at least UDP and TCP upper layer payloads. + # + # Expectations: no panics + # We are not testing for any other outcome here. + # + data = "6" * 88 + udp = sp.UDP(dport=3456, sport=6543) / data + tcp = sp.TCP(dport=4567, sport=7654) + ip6 = sp.Ether() / sp.IPv6(src=args.src[0], dst=args.to[0]) + for ulp in [ udp, tcp ]: + ext = getExtHdrs(args) + if ext is not None: + pkt = ip6 / ext / ulp + else: + pkt = ip6 / ulp + if args.debug : + pkt.display() + if not ok: + sc = check_icmp6_error_paramprob_header; + elif ulp == udp: + sc = check_icmp6_error_dst_unreach_noport; + elif ulp == tcp: + sc = check_tcp_rst; + else: + sys.exit(2) + # Start sniffing on recvif + sniffer = Sniffer.Sniffer(args, sc) + sp.sendp(pkt, iface=args.sendif[0], verbose=False) + sleep(0.10) + sniffer.setEnd() + sniffer.join() + if not sniffer.foundCorrectPacket: + sys.exit(not ok) + + sys.exit(0) + +if __name__ == '__main__': + main() Added: head/tests/sys/netinet6/exthdr.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netinet6/exthdr.sh Tue Nov 5 10:59:33 2019 (r354358) @@ -0,0 +1,124 @@ +# $FreeBSD$ +#- +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2019 Netflix, Inc. +# +# 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. +# + +. $(atf_get_srcdir)/../common/vnet.subr + +atf_test_case "exthdr" "cleanup" +exthdr_head() { + + atf_set descr 'Test IPv6 fragmentation code' + atf_set require.user root + atf_set require.progs scapy +} + +exthdr_body() { + + ids=65533 + id=`printf "%x" ${ids}` + if [ $$ -gt 65535 ]; then + xl=`printf "%x" $(($$ - 65535))` + yl="1" + else + xl=`printf "%x" $$` + yl="" + fi + + vnet_init + + ip6a="2001:db8:6666:0000:${yl}:${id}:1:${xl}" + ip6b="2001:db8:6666:0000:${yl}:${id}:2:${xl}" + + epair=$(vnet_mkepair) + ifconfig ${epair}a mtu 131071 up + ifconfig ${epair}a inet6 ${ip6a}/64 + + jname="v6t-${id}-${yl}-${xl}" + vnet_mkjail ${jname} ${epair}b + jexec ${jname} ifconfig ${epair}b mtu 131071 up + jexec ${jname} ifconfig ${epair}b inet6 ${ip6b}/64 + + # Let IPv6 ND do its thing. + #ping6 -q -c 1 ff02::1%${epair}a + #ping6 -q -c 1 ${ip6b} + sleep 3 + + # Clear statistics. + jexec ${jname} netstat -z -s > /dev/null + + # Run fragment tests. + pyname=$(atf_get ident) + pyname=${pyname%*_[0-9]} + + atf_check -s exit:0 $(atf_get_srcdir)/${pyname}.py \ + --sendif ${epair}a --recvif ${epair}a \ + --src ${ip6a} --to ${ip6b} + + atf_check -s exit:0 $(atf_get_srcdir)/${pyname}.py \ + --sendif ${epair}a --recvif ${epair}a \ + --src ${ip6a} --to ${ip6b} \ + --hbh + + atf_check -s exit:0 $(atf_get_srcdir)/${pyname}.py \ + --sendif ${epair}a --recvif ${epair}a \ + --src ${ip6a} --to ${ip6b} \ + --rh + + atf_check -s exit:0 $(atf_get_srcdir)/${pyname}.py \ + --sendif ${epair}a --recvif ${epair}a \ + --src ${ip6a} --to ${ip6b} \ + --frag6 + + atf_check -s exit:0 $(atf_get_srcdir)/${pyname}.py \ + --sendif ${epair}a --recvif ${epair}a \ + --src ${ip6a} --to ${ip6b} \ + --dest + + atf_check -s exit:0 $(atf_get_srcdir)/${pyname}.py \ + --sendif ${epair}a --recvif ${epair}a \ + --src ${ip6a} --to ${ip6b} \ + --hbh --dest + + atf_check -s exit:1 $(atf_get_srcdir)/${pyname}.py \ + --sendif ${epair}a --recvif ${epair}a \ + --src ${ip6a} --to ${ip6b} \ + --dest --hbhbad + +} + +exthdr_cleanup() { + + vnet_cleanup +} + +atf_init_test_cases() +{ + + atf_add_test_case "exthdr" +} + +# end From owner-svn-src-head@freebsd.org Tue Nov 5 13:14:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5B861A6D2E; Tue, 5 Nov 2019 13:14:03 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::602]) (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 476qqv3rsvz4J8g; Tue, 5 Nov 2019 13:14:03 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback29j.mail.yandex.net (mxback29j.mail.yandex.net [IPv6:2a02:6b8:0:1619::229]) by forward102o.mail.yandex.net (Yandex) with ESMTP id A44B96680A11; Tue, 5 Nov 2019 16:13:59 +0300 (MSK) Received: from sas1-e6a95a338f12.qloud-c.yandex.net (sas1-e6a95a338f12.qloud-c.yandex.net [2a02:6b8:c08:37a4:0:640:e6a9:5a33]) by mxback29j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id A7DvGFdAf4-Dx6m4t7B; Tue, 05 Nov 2019 16:13:59 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1572959639; bh=IUTD3AU29O+hu/jm3lLgn3Cq5CTb6vJCA9nH7tE52to=; h=In-Reply-To:From:Date:References:To:Subject:Message-ID; b=blM4M/uXAIZQl20/wbEdJAp5scMf9j6mmDlhle87/GQn24Ahxomh469EeUF9itnYG tcBV4jOE+Cm9RvMZf3AYpL/+e5Z45hBi4iCBwjhWLQQyws5wvShweCcWPmko51x3Fk zJykTUAQteZvPkYIi71tMB/XcJnR5KcxtKO0VKL0= Received: by sas1-e6a95a338f12.qloud-c.yandex.net (nwsmtp/Yandex) with ESMTPSA id 50vxwinftq-Dw0SmfYv; Tue, 05 Nov 2019 16:13:59 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Subject: Re: svn commit: r354333 - in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201911041330.xA4DUbnB059737@repo.freebsd.org> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= mQENBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAG0JUFuZHJleSBWLiBFbHN1a292IDxidTdjaGVyQHlhbmRleC5ydT6JATgEEwECACIFAkwB F1kCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEAHF6gQQyKF6qmYIAI6ekfm1VA4T vqankI1ISE6ku4jV7UlpIQlEbE7/8n3Zd6teJ+pGOQhN5qk8QE7utdPdbktAzi+x7LIJVzUw 4TywZLXGrkP7VKYkfg6oyCGyzITghefQeJtr2TN4hYCkzPWpylkue8MtmqfZv/6royqwTbN+ +E09FQNvTgRUYJYTeQ1qOsxNRycwvw3dr2rOfuxShbzaHBB1pBIjGrMg8fC5pd65ACH5zuFV A0CoTNGMDrEZSfBkTW604UUHFFXeCoC3dwDZRKOWJ3GmMXns65Ai5YkA63BSHEE1Qle3VBhd cG1w0CB5FBV3pB27UVnf0jEbysrDqW4qN7XMRFSWNAy5AQ0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAYkBHwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <29fe0e3e-44a6-5197-8252-f0ee3d12e743@yandex.ru> Date: Tue, 5 Nov 2019 16:13:03 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <201911041330.xA4DUbnB059737@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="JUIUvU2eZtR816nFOVzrWk73B6jneKbrF" X-Rspamd-Queue-Id: 476qqv3rsvz4J8g X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.98 / 15.00]; NEURAL_HAM_MEDIUM(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2019 13:14:03 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --JUIUvU2eZtR816nFOVzrWk73B6jneKbrF Content-Type: multipart/mixed; boundary="JLyE7F5K2mUOE9jnMteIOEZ5kAAdmcmbx"; protected-headers="v1" From: "Andrey V. Elsukov" To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <29fe0e3e-44a6-5197-8252-f0ee3d12e743@yandex.ru> Subject: Re: svn commit: r354333 - in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys References: <201911041330.xA4DUbnB059737@repo.freebsd.org> In-Reply-To: <201911041330.xA4DUbnB059737@repo.freebsd.org> --JLyE7F5K2mUOE9jnMteIOEZ5kAAdmcmbx Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 04.11.2019 16:30, Andriy Gapon wrote: > Author: avg > Date: Mon Nov 4 13:30:37 2019 > New Revision: 354333 > URL: https://svnweb.freebsd.org/changeset/base/354333 >=20 > Log: > zfs: enable SPA_PROCESS on the kernel side > =20 > The purpose of this change is to group kernelthreads specific to a > particular ZFS pool under a kernel process. There can be many dozens= of > threads per pool. This change improves observability of those thread= s. > =20 > This change consists of several subchanges: > 1. illumos taskq_create_proc can now pass its process parameter to > taskqueue. Also, use zfsproc instead of NULL for taskq_create. Cave= at: > zfsproc might not be initialized yet. But in that case it is still N= ULL, > so not worse than before. This commit probably breaks dtrace module loading: link_elf_obj: symbol zfsproc undefined linker_load_file: /boot/kernel/dtrace.ko - unsupported file type KLD dtraceall.ko: depends on dtrace - not available or version mismatch linker_load_file: /boot/kernel/dtraceall.ko - unsupported file type Does it works for you and this is my local problem? --=20 WBR, Andrey V. Elsukov --JLyE7F5K2mUOE9jnMteIOEZ5kAAdmcmbx-- --JUIUvU2eZtR816nFOVzrWk73B6jneKbrF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAl3BdV8ACgkQAcXqBBDI oXreEQf+M2cLsKDvWM2pd3Dx5NZfxvJBATpJAN/pIUP7G5g9PiRgT9XedGVUQhi7 fph8XruKIpAwLAqld3ggejhtWR/l7N6PuOJ5/RWehEic1wzGipp9tO6TJKzh4kjq PtnWGoulomsHKWSRLQkuotDx1u/iuNiDnqkeQ1HrtweMkzwj5WbO1Vx7h+bzeM1v h0Pskr43GL5mNw3qdUsDCVia1Ma16gHnSpVb52BQCQHufEBD+eAwMQ7cfe2veTug cZxlcGBddBoS5G2Axn9/E19L3wHfZVCqjWMlgIlQnaL2UIqclWT+inahaGMLZaRF kJJKvA5wm5FMi9oxUdIf7YPfdgHdfA== =YzlS -----END PGP SIGNATURE----- --JUIUvU2eZtR816nFOVzrWk73B6jneKbrF-- From owner-svn-src-head@freebsd.org Tue Nov 5 13:39:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF4121A7CEF; Tue, 5 Nov 2019 13:39:53 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476rPh5GRyz4KXH; Tue, 5 Nov 2019 13:39:52 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f193.google.com with SMTP id n21so8255328ljg.12; Tue, 05 Nov 2019 05:39:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=OvRM6os54a0cGtev6IQV5mh/woIWtu4sSdQbCotDnPw=; b=a9HllqqXO+pwXcLbRfKvqNmwtURIlhlL6DesNEkbgVvqkBvAfoiPlZKgJDA6f67swM iEiRa6QI+LJAKIjVsd56i0Hd6RYX3k/mV/1s1u8Xw8c/lcmy8n5cAwMbInRfDtIQD9Ea jMTvq6C4jX7OFOiQKrYBZAhxqMrC/H4dwaJBjSg+vl6G34i+FKpUlLJSK+YjT4vVHTdQ SR8m4GEV5wBOdlt1nnsctKWB4Ptj2R5bPSh38lLL2ow3zZo0BjF1KOonr8DQHBAzn285 0TN0YkZwmL5vstTGVmfYPnKhr+Ml6AlMJ5tEqe2tOMT/9reQiyz1vA0eMf1Ilqpzb0A3 XBbw== X-Gm-Message-State: APjAAAWzgoWZK5v+2AdR43T2rVay6WJz5c+Je8aS+nkk6tnBsFpmx5Oq M/VUJ43NdPwoEHTCe99NTWgEIxb5bIA= X-Google-Smtp-Source: APXvYqyIecSy4KVb9N3GryQy+poE2z3fXl4v81rT7fqsDazOanbXlqMH3/1C8bWdI0zwCeOUD6slEA== X-Received: by 2002:a2e:890e:: with SMTP id d14mr11601498lji.6.1572961190491; Tue, 05 Nov 2019 05:39:50 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id u2sm3449329ljg.34.2019.11.05.05.39.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Nov 2019 05:39:49 -0800 (PST) Subject: Re: svn commit: r354333 - in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys To: "Andrey V. Elsukov" , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201911041330.xA4DUbnB059737@repo.freebsd.org> <29fe0e3e-44a6-5197-8252-f0ee3d12e743@yandex.ru> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: Date: Tue, 5 Nov 2019 15:39:48 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <29fe0e3e-44a6-5197-8252-f0ee3d12e743@yandex.ru> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 476rPh5GRyz4KXH X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.208.193 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-3.13 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[FreeBSD.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[193.208.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; IP_SCORE(-1.13)[ip: (-0.39), ipnet: 209.85.128.0/17(-3.20), asn: 15169(-2.02), country: US(-0.05)]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; FREEMAIL_TO(0.00)[yandex.ru]; RWL_MAILSPIKE_POSSIBLE(0.00)[193.208.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[96.151.72.93.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2019 13:39:53 -0000 On 05/11/2019 15:13, Andrey V. Elsukov wrote: > On 04.11.2019 16:30, Andriy Gapon wrote: >> Author: avg >> Date: Mon Nov 4 13:30:37 2019 >> New Revision: 354333 >> URL: https://svnweb.freebsd.org/changeset/base/354333 >> >> Log: >> zfs: enable SPA_PROCESS on the kernel side >> >> The purpose of this change is to group kernelthreads specific to a >> particular ZFS pool under a kernel process. There can be many dozens of >> threads per pool. This change improves observability of those threads. >> >> This change consists of several subchanges: >> 1. illumos taskq_create_proc can now pass its process parameter to >> taskqueue. Also, use zfsproc instead of NULL for taskq_create. Caveat: >> zfsproc might not be initialized yet. But in that case it is still NULL, >> so not worse than before. > This commit probably breaks dtrace module loading: > > link_elf_obj: symbol zfsproc undefined > linker_load_file: /boot/kernel/dtrace.ko - unsupported file type > KLD dtraceall.ko: depends on dtrace - not available or version mismatch > linker_load_file: /boot/kernel/dtraceall.ko - unsupported file type > > Does it works for you and this is my local problem? I am seeing this too on a cleanly installed system with GENERIC. Maybe I didn't see the problem earlier because I have ZFS in kernel... Anyway, I am working on a fix. -- Andriy Gapon From owner-svn-src-head@freebsd.org Tue Nov 5 14:35:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7816D1A96EF; Tue, 5 Nov 2019 14:35:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476sdJ2fLtz4NYF; Tue, 5 Nov 2019 14:35:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F0C0E25A; Tue, 5 Nov 2019 14:35:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA5EZ0nl074479; Tue, 5 Nov 2019 14:35:00 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA5EYxwx074461; Tue, 5 Nov 2019 14:34:59 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201911051434.xA5EYxwx074461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 5 Nov 2019 14:34:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354359 - in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 354359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2019 14:35:00 -0000 Author: avg Date: Tue Nov 5 14:34:59 2019 New Revision: 354359 URL: https://svnweb.freebsd.org/changeset/base/354359 Log: fix up r354333, make zfsproc visible to dtrace, rename to system_proc I overlooked the fact that zfsproc is required by dtrace modules that use illumos compatible taskq KPI. So, move the symbol definition to the opensolaris module that provides compatibility support for both ZFS and DTrace. Also, rename zfsproc to system_proc to reflect that it is not specific to ZFS. Reported by: ae MFC after: 5 weeks X-MFC with: ae Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c head/sys/cddl/compat/opensolaris/sys/proc.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Tue Nov 5 10:59:33 2019 (r354358) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Tue Nov 5 14:34:59 2019 (r354359) @@ -42,6 +42,8 @@ static uma_zone_t taskq_zone; taskq_t *system_taskq = NULL; +struct proc *system_proc; + static void system_taskq_init(void *arg) { @@ -84,7 +86,7 @@ taskq_t * taskq_create(const char *name, int nthreads, pri_t pri, int minalloc __unused, int maxalloc __unused, uint_t flags) { - return (taskq_create_impl(name, nthreads, pri, zfsproc, flags)); + return (taskq_create_impl(name, nthreads, pri, system_proc, flags)); } taskq_t * Modified: head/sys/cddl/compat/opensolaris/sys/proc.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/proc.h Tue Nov 5 10:59:33 2019 (r354358) +++ head/sys/cddl/compat/opensolaris/sys/proc.h Tue Nov 5 14:34:59 2019 (r354359) @@ -61,7 +61,7 @@ typedef struct thread kthread_t; typedef struct thread *kthread_id_t; typedef struct proc proc_t; -extern struct proc *zfsproc; +extern struct proc *system_proc; static __inline kthread_t * do_thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg, @@ -80,7 +80,7 @@ do_thread_create(caddr_t stk, size_t stksize, void (*p ASSERT(pp != NULL); if (pp == &p0) - ppp = &zfsproc; + ppp = &system_proc; else ppp = &pp; error = kproc_kthread_add(proc, arg, ppp, &td, RFSTOPPED, Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Nov 5 10:59:33 2019 (r354358) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Nov 5 14:34:59 2019 (r354359) @@ -7098,7 +7098,6 @@ zfsdev_fini(void) } static struct root_hold_token *zfs_root_token; -struct proc *zfsproc; #ifdef illumos int Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Tue Nov 5 10:59:33 2019 (r354358) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Tue Nov 5 14:34:59 2019 (r354359) @@ -2685,7 +2685,7 @@ zvol_geom_run(zvol_state_t *zv) pp = zv->zv_provider; g_error_provider(pp, 0); - kproc_kthread_add(zvol_geom_worker, zv, &zfsproc, NULL, 0, 0, + kproc_kthread_add(zvol_geom_worker, zv, &system_proc, NULL, 0, 0, "zfskern", "zvol %s", pp->name + sizeof(ZVOL_DRIVER)); } From owner-svn-src-head@freebsd.org Tue Nov 5 14:36:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 463131A981F; Tue, 5 Nov 2019 14:36:43 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476sgG2FPjz4NqF; Tue, 5 Nov 2019 14:36:42 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f195.google.com with SMTP id y23so11199662ljh.10; Tue, 05 Nov 2019 06:36:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=UN9XHKsSSLL1o27GbBkTUN2qrJTc78pBU0IA+xLViAQ=; b=VRMXmdtodB0JV+FrK+rB9bugArZq2akJKCZaSU75MWUxwWInLr2k3YY1QD9MKT/E55 bllZkD8VOHGSiEa0KyjokhsX6k1/8bBsi09Tao0w05b94wLK/YlUG5PhHVXq2PQFr7sC sMCVf8cLmtypfB1yXStxi3oH5U6aaPBONvalgVV5MoXBVG8cni5iayFlXWqL20xml4Ds BK2UPmHgIBrSCTfvHoVHBFvZPDkXHVILQqkVt7xjX1t8U9btlAi4UDHKNJFRweeJtvXZ aj8WC69RyrA65tnRmEgzj4rXCmKqUaWDxTH5CnvXEn1ayExyqw0J59kGzubpH+VrtBv5 U1qg== X-Gm-Message-State: APjAAAWDWC5MJHgYDTKAOCWD9rtsMinnVabeGy7Rtc5diWHgtA4Zqcye Y3gMorJPtGHt640Keoz/uB80rizeDsA= X-Google-Smtp-Source: APXvYqxTFrtyI391euDmcwR0ETMHrtWcz5GeKkFfhVHCNArqLmekfTz4SEn1cFViXSBMKTQWZ5j0Jw== X-Received: by 2002:a2e:6a10:: with SMTP id f16mr3412208ljc.100.1572964599967; Tue, 05 Nov 2019 06:36:39 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id z17sm3178779ljz.30.2019.11.05.06.36.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Nov 2019 06:36:38 -0800 (PST) Subject: Re: svn commit: r354333 - in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys To: "Andrey V. Elsukov" , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201911041330.xA4DUbnB059737@repo.freebsd.org> <29fe0e3e-44a6-5197-8252-f0ee3d12e743@yandex.ru> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <170c52c8-8ef8-55e2-7e1a-a8b20f647941@FreeBSD.org> Date: Tue, 5 Nov 2019 16:36:38 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 476sgG2FPjz4NqF X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.208.195 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-3.09 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[FreeBSD.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[195.208.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; IP_SCORE(-1.09)[ip: (-0.19), ipnet: 209.85.128.0/17(-3.20), asn: 15169(-2.02), country: US(-0.05)]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; FREEMAIL_TO(0.00)[yandex.ru]; RWL_MAILSPIKE_POSSIBLE(0.00)[195.208.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[96.151.72.93.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2019 14:36:43 -0000 On 05/11/2019 15:39, Andriy Gapon wrote: > On 05/11/2019 15:13, Andrey V. Elsukov wrote: >> On 04.11.2019 16:30, Andriy Gapon wrote: >>> Author: avg >>> Date: Mon Nov 4 13:30:37 2019 >>> New Revision: 354333 >>> URL: https://svnweb.freebsd.org/changeset/base/354333 >>> >>> Log: >>> zfs: enable SPA_PROCESS on the kernel side >>> >>> The purpose of this change is to group kernelthreads specific to a >>> particular ZFS pool under a kernel process. There can be many dozens of >>> threads per pool. This change improves observability of those threads. >>> >>> This change consists of several subchanges: >>> 1. illumos taskq_create_proc can now pass its process parameter to >>> taskqueue. Also, use zfsproc instead of NULL for taskq_create. Caveat: >>> zfsproc might not be initialized yet. But in that case it is still NULL, >>> so not worse than before. >> This commit probably breaks dtrace module loading: >> >> link_elf_obj: symbol zfsproc undefined >> linker_load_file: /boot/kernel/dtrace.ko - unsupported file type >> KLD dtraceall.ko: depends on dtrace - not available or version mismatch >> linker_load_file: /boot/kernel/dtraceall.ko - unsupported file type >> >> Does it works for you and this is my local problem? > > I am seeing this too on a cleanly installed system with GENERIC. > Maybe I didn't see the problem earlier because I have ZFS in kernel... > Anyway, I am working on a fix. Should be fixed now. Please check. Thank you for the report and sorry for the trouble. -- Andriy Gapon From owner-svn-src-head@freebsd.org Tue Nov 5 15:19:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 345E31AA83C; Tue, 5 Nov 2019 15:19:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476tcB0ZSbz4YPX; Tue, 5 Nov 2019 15:19:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB1DDE98D; Tue, 5 Nov 2019 15:19:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA5FJ53q098177; Tue, 5 Nov 2019 15:19:05 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA5FJ5UM098176; Tue, 5 Nov 2019 15:19:05 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201911051519.xA5FJ5UM098176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 5 Nov 2019 15:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354360 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 354360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2019 15:19:06 -0000 Author: mav Date: Tue Nov 5 15:19:05 2019 New Revision: 354360 URL: https://svnweb.freebsd.org/changeset/base/354360 Log: Add vfs.zfs.zio.taskq_batch_pct tunable. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Nov 5 14:34:59 2019 (r354359) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Nov 5 15:19:05 2019 (r354360) @@ -245,6 +245,10 @@ uint64_t zfs_max_missing_tvds_cachefile = SPA_DVAS_PER uint64_t zfs_max_missing_tvds_scan = 0; +SYSCTL_DECL(_vfs_zfs_zio); +SYSCTL_INT(_vfs_zfs_zio, OID_AUTO, taskq_batch_pct, CTLFLAG_RDTUN, + &zio_taskq_batch_pct, 0, + "Percentage of CPUs to run an IO worker thread"); SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_load_print_vdev_tree, CTLFLAG_RWTUN, &spa_load_print_vdev_tree, 0, "print out vdev tree during pool import"); From owner-svn-src-head@freebsd.org Tue Nov 5 17:33:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 36F401AE83D; Tue, 5 Nov 2019 17:33:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476xbD0lqsz3KHg; Tue, 5 Nov 2019 17:33:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1FDB183B4; Tue, 5 Nov 2019 17:33:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA5HXREA085849; Tue, 5 Nov 2019 17:33:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA5HXRRK085848; Tue, 5 Nov 2019 17:33:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201911051733.xA5HXRRK085848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Tue, 5 Nov 2019 17:33:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354361 - head X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 354361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2019 17:33:28 -0000 Author: ngie Date: Tue Nov 5 17:33:27 2019 New Revision: 354361 URL: https://svnweb.freebsd.org/changeset/base/354361 Log: Remove picobsd(8) via `make delete-old` This completes the commit that removed picobsd(8) (r354346). MFC after: never Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Nov 5 15:19:05 2019 (r354360) +++ head/ObsoleteFiles.inc Tue Nov 5 17:33:27 2019 (r354361) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20191105: picobsd(8), et al, removed. +OLD_FILES+=usr/share/man/man8/picobsd.8.gz # 20191009: new clang import which bumps version from 8.0.1 to 9.0.0. OLD_FILES+=usr/lib/clang/8.0.1/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/8.0.1/include/sanitizer/asan_interface.h From owner-svn-src-head@freebsd.org Tue Nov 5 17:46:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96EEB1AEE11; Tue, 5 Nov 2019 17:46:17 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476xt13V4Xz3L3M; Tue, 5 Nov 2019 17:46:17 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f182.google.com (mail-qt1-f182.google.com [209.85.160.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 4E76516FB; Tue, 5 Nov 2019 17:46:17 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f182.google.com with SMTP id y39so30541839qty.0; Tue, 05 Nov 2019 09:46:17 -0800 (PST) X-Gm-Message-State: APjAAAXKUmfAWthWqTNmM+VlYVSFKGfFwMnhGb1jULMv6kmSIV1P+MJV 3whrmzZoCIhZr16nNJrWnss0xdFJRikaDf1Swww= X-Google-Smtp-Source: APXvYqxHpQnlA32xsJbsEtywBYEhF6b4dj06art9kfTmGF6NY3z0D2bfj3ENzaKf3hQ5CEfRqNvpRR1A04POLEun+Po= X-Received: by 2002:ac8:21b5:: with SMTP id 50mr18806763qty.60.1572975976769; Tue, 05 Nov 2019 09:46:16 -0800 (PST) MIME-Version: 1.0 References: <201911051733.xA5HXRRK085848@repo.freebsd.org> In-Reply-To: <201911051733.xA5HXRRK085848@repo.freebsd.org> From: Kyle Evans Date: Tue, 5 Nov 2019 11:46:05 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r354361 - head To: Enji Cooper Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2019 17:46:17 -0000 On Tue, Nov 5, 2019 at 11:33 AM Enji Cooper wrote: > > Author: ngie > Date: Tue Nov 5 17:33:27 2019 > New Revision: 354361 > URL: https://svnweb.freebsd.org/changeset/base/354361 > > Log: > Remove picobsd(8) via `make delete-old` > > This completes the commit that removed picobsd(8) (r354346). > > MFC after: never > Ah, sorry about that! Thanks! Kyle Evans From owner-svn-src-head@freebsd.org Tue Nov 5 17:49:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A7CD1AEF9A; Tue, 5 Nov 2019 17:49:16 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476xxS3dgYz3LFZ; Tue, 5 Nov 2019 17:49:16 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FE5118596; Tue, 5 Nov 2019 17:49:16 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA5HnGkQ092090; Tue, 5 Nov 2019 17:49:16 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA5HnGCj092089; Tue, 5 Nov 2019 17:49:16 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201911051749.xA5HnGCj092089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 5 Nov 2019 17:49:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354362 - head/tests/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/netinet6 X-SVN-Commit-Revision: 354362 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2019 17:49:16 -0000 Author: lwhsu Date: Tue Nov 5 17:49:15 2019 New Revision: 354362 URL: https://svnweb.freebsd.org/changeset/base/354362 Log: Temporarily disable sys.netinet6.exthdr on i386 PR: 241493 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/netinet6/exthdr.sh Modified: head/tests/sys/netinet6/exthdr.sh ============================================================================== --- head/tests/sys/netinet6/exthdr.sh Tue Nov 5 17:33:27 2019 (r354361) +++ head/tests/sys/netinet6/exthdr.sh Tue Nov 5 17:49:15 2019 (r354362) @@ -38,6 +38,11 @@ exthdr_head() { exthdr_body() { + if [ "$(atf_config_get ci false)" = "true" ] && \ + [ "$(uname -p)" = "i386" ]; then + atf_skip "https://bugs.freebsd.org/241493" + fi + ids=65533 id=`printf "%x" ${ids}` if [ $$ -gt 65535 ]; then From owner-svn-src-head@freebsd.org Tue Nov 5 18:07:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A6151AF668; Tue, 5 Nov 2019 18:07:31 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476yLW0NW8z3M9H; Tue, 5 Nov 2019 18:07:31 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3F2218960; Tue, 5 Nov 2019 18:07:30 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA5I7Ucn003485; Tue, 5 Nov 2019 18:07:30 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA5I7Ur7003484; Tue, 5 Nov 2019 18:07:30 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911051807.xA5I7Ur7003484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 5 Nov 2019 18:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354363 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 354363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2019 18:07:31 -0000 Author: tsoome Date: Tue Nov 5 18:07:30 2019 New Revision: 354363 URL: https://svnweb.freebsd.org/changeset/base/354363 Log: loader: populate nvl with data even when label_txg is 0 We actually do not use that data, at least not now, but we want to avoid possible surprises. Modified: head/stand/libsa/zfs/zfsimpl.c Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Tue Nov 5 17:49:15 2019 (r354362) +++ head/stand/libsa/zfs/zfsimpl.c Tue Nov 5 18:07:30 2019 (r354363) @@ -1641,8 +1641,10 @@ vdev_label_read_config(vdev_t *vd, uint64_t txg) nvlist = (const unsigned char *) label->vp_nvlist + 4; error = nvlist_find(nvlist, ZPOOL_CONFIG_POOL_TXG, DATA_TYPE_UINT64, NULL, &label_txg); - if (error != 0 || label_txg == 0) + if (error != 0 || label_txg == 0) { + memcpy(nvl, nvlist, nvl_size); return (nvl); + } if (label_txg <= txg && label_txg > best_txg) { best_txg = label_txg; From owner-svn-src-head@freebsd.org Tue Nov 5 18:35:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F11281B06FD; Tue, 5 Nov 2019 18:35:13 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 476yyT6By8z3NhZ; Tue, 5 Nov 2019 18:35:13 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B920518EC7; Tue, 5 Nov 2019 18:35:13 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA5IZDOW021053; Tue, 5 Nov 2019 18:35:13 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA5IZD1d021051; Tue, 5 Nov 2019 18:35:13 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911051835.xA5IZD1d021051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 5 Nov 2019 18:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354364 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 354364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2019 18:35:14 -0000 Author: tsoome Date: Tue Nov 5 18:35:13 2019 New Revision: 354364 URL: https://svnweb.freebsd.org/changeset/base/354364 Log: loader: clean up the noise around log device We are ignoring log device but we also do want to have clean code. Modified: head/stand/libsa/zfs/zfs.c head/stand/libsa/zfs/zfsimpl.c Modified: head/stand/libsa/zfs/zfs.c ============================================================================== --- head/stand/libsa/zfs/zfs.c Tue Nov 5 18:07:30 2019 (r354363) +++ head/stand/libsa/zfs/zfs.c Tue Nov 5 18:35:13 2019 (r354364) @@ -669,14 +669,6 @@ zfs_dev_open(struct open_file *f, ...) spa = spa_find_by_guid(dev->pool_guid); if (!spa) return (ENXIO); -#if 0 - /* Apparently too many are using slog with boot pool. */ - if (spa->spa_with_log) { - printf("Reading pool %s is not supported due to log device.\n", - spa->spa_name); - return (ENXIO); - } -#endif mount = malloc(sizeof(*mount)); if (mount == NULL) rv = ENOMEM; Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Tue Nov 5 18:07:30 2019 (r354363) +++ head/stand/libsa/zfs/zfsimpl.c Tue Nov 5 18:35:13 2019 (r354364) @@ -1774,12 +1774,6 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s return (EIO); } - if (nvlist_find(nvlist, ZPOOL_CONFIG_IS_LOG, DATA_TYPE_UINT64, - NULL, &val) == 0 && val != 0) { - free(nvlist); - return (EIO); - } - /* * Create the pool if this is the first time we've seen it. */ @@ -1854,9 +1848,6 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s return (EIO); } - /* - * We do not support reading pools with log device. - */ if (vdev->v_islog) spa->spa_with_log = vdev->v_islog; From owner-svn-src-head@freebsd.org Tue Nov 5 21:38:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4F551787F4; Tue, 5 Nov 2019 21:38:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47732J4PgMz44tH; Tue, 5 Nov 2019 21:38:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B9D51AF75; Tue, 5 Nov 2019 21:38:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA5LcmBM034374; Tue, 5 Nov 2019 21:38:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA5LcmBr034373; Tue, 5 Nov 2019 21:38:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201911052138.xA5LcmBr034373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 5 Nov 2019 21:38:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354367 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 354367 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Nov 2019 21:38:48 -0000 Author: kib Date: Tue Nov 5 21:38:48 2019 New Revision: 354367 URL: https://svnweb.freebsd.org/changeset/base/354367 Log: Switch cache zones from early counters to real implementation. Early counter mock can be only used on BSP for amd64, when APs try to update it that causes random memory corruption. N.B. This is a temporary patch to plug the corruption for now, while a proper solution for handling cache zones in zone_foreach() is being developed. In collaboration with: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation, Mellanox Technologies Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Nov 5 19:15:43 2019 (r354366) +++ head/sys/vm/uma_core.c Tue Nov 5 21:38:48 2019 (r354367) @@ -2198,6 +2198,7 @@ uma_startup2(void) static void uma_startup3(void) { + uma_zone_t zone; #ifdef INVARIANTS TUNABLE_INT_FETCH("vm.debug.divisor", &dbg_divisor); @@ -2205,6 +2206,8 @@ uma_startup3(void) uma_skip_cnt = counter_u64_alloc(M_WAITOK); #endif zone_foreach(zone_alloc_counters); + LIST_FOREACH(zone, &uma_cachezones, uz_link) + zone_alloc_counters(zone); callout_init(&uma_callout, 1); callout_reset(&uma_callout, UMA_TIMEOUT * hz, uma_timeout, NULL); booted = BOOT_RUNNING; From owner-svn-src-head@freebsd.org Wed Nov 6 01:42:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED4B11B277D; Wed, 6 Nov 2019 01:42:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4778RW5x5gz4JWc; Wed, 6 Nov 2019 01:42:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEC711DC48; Wed, 6 Nov 2019 01:42:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA61gVJG092408; Wed, 6 Nov 2019 01:42:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA61gV5J091689; Wed, 6 Nov 2019 01:42:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911060142.xA61gV5J091689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 6 Nov 2019 01:42:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354368 - in head/usr.bin: brandelf head tail X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/usr.bin: brandelf head tail X-SVN-Commit-Revision: 354368 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 01:42:32 -0000 Author: markj Date: Wed Nov 6 01:42:30 2019 New Revision: 354368 URL: https://svnweb.freebsd.org/changeset/base/354368 Log: fileargs_init() sets errno on failure. Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/brandelf/brandelf.c head/usr.bin/head/head.c head/usr.bin/tail/tail.c Modified: head/usr.bin/brandelf/brandelf.c ============================================================================== --- head/usr.bin/brandelf/brandelf.c Tue Nov 5 21:38:48 2019 (r354367) +++ head/usr.bin/brandelf/brandelf.c Wed Nov 6 01:42:30 2019 (r354368) @@ -135,7 +135,7 @@ main(int argc, char **argv) fa = fileargs_init(argc, argv, flags, 0, &rights, FA_OPEN); if (fa == NULL) - errx(1, "unable to init casper"); + err(1, "unable to init casper"); caph_cache_catpages(); if (caph_limit_stdio() < 0 || caph_enter_casper() < 0) Modified: head/usr.bin/head/head.c ============================================================================== --- head/usr.bin/head/head.c Tue Nov 5 21:38:48 2019 (r354367) +++ head/usr.bin/head/head.c Wed Nov 6 01:42:30 2019 (r354368) @@ -117,7 +117,7 @@ main(int argc, char *argv[]) fa = fileargs_init(argc, argv, O_RDONLY, 0, cap_rights_init(&rights, CAP_READ, CAP_FSTAT, CAP_FCNTL), FA_OPEN); if (fa == NULL) - errx(1, "unable to init casper"); + err(1, "unable to init casper"); caph_cache_catpages(); if (caph_limit_stdio() < 0 || caph_enter_casper() < 0) Modified: head/usr.bin/tail/tail.c ============================================================================== --- head/usr.bin/tail/tail.c Tue Nov 5 21:38:48 2019 (r354367) +++ head/usr.bin/tail/tail.c Wed Nov 6 01:42:30 2019 (r354368) @@ -169,7 +169,7 @@ main(int argc, char *argv[]) fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN); if (fa == NULL) - errx(1, "unable to init casper"); + err(1, "unable to init casper"); caph_cache_catpages(); if (caph_enter_casper() < 0) From owner-svn-src-head@freebsd.org Wed Nov 6 04:40:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D0A581B5D79; Wed, 6 Nov 2019 04:40:12 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477DNX5D1wz4lDY; Wed, 6 Nov 2019 04:40:12 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9054B1FB4A; Wed, 6 Nov 2019 04:40:12 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA64eCKX093763; Wed, 6 Nov 2019 04:40:12 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA64eCcG093762; Wed, 6 Nov 2019 04:40:12 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201911060440.xA64eCcG093762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 6 Nov 2019 04:40:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354369 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 354369 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 04:40:12 -0000 Author: jhibbits Date: Wed Nov 6 04:40:12 2019 New Revision: 354369 URL: https://svnweb.freebsd.org/changeset/base/354369 Log: powerpc/booke: Fix pmap_mapdev_attr() for multi-TLB1 entry mappings Also, fix pmap_change_attr() to ignore non-kernel mappings. * Fix a masking bug in mmu_booke_mapdev_attr() which caused it to align mappings to the smallest mapping alignment, instead of the largest. This caused mappings to be potentially pessimally aligned, using more TLB entries than necessary. * Return existing mappings from mmu_booke_mapdev_attr() that span more than one TLB1 entry. The drm-current-kmod drivers map discontiguous segments of the GPU, resulting in more than one TLB entry being used to satisfy the mapping. * Ignore non-kernel mappings in mmu_booke_change_attr(). There's a bug in the linuxkpi layer that causes it to actually try to change physical address mappings, instead of virtual addresses. amd64 doesn't encounter this because it ignores non-kernel mappings. With this it's possible to use drm-current-kmod on Book-E. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Wed Nov 6 01:42:30 2019 (r354368) +++ head/sys/powerpc/booke/pmap.c Wed Nov 6 04:40:12 2019 (r354369) @@ -3441,31 +3441,57 @@ mmu_booke_mapdev(mmu_t mmu, vm_paddr_t pa, vm_size_t s return (mmu_booke_mapdev_attr(mmu, pa, size, VM_MEMATTR_DEFAULT)); } +static int +tlb1_find_pa(vm_paddr_t pa, tlb_entry_t *e) +{ + int i; + + for (i = 0; i < TLB1_ENTRIES; i++) { + tlb1_read_entry(e, i); + if ((e->mas1 & MAS1_VALID) == 0) + return (i); + } + return (-1); +} + static void * mmu_booke_mapdev_attr(mmu_t mmu, vm_paddr_t pa, vm_size_t size, vm_memattr_t ma) { tlb_entry_t e; + vm_paddr_t tmppa; void *res; uintptr_t va, tmpva; vm_size_t sz; int i; + int wimge; /* - * Check if this is premapped in TLB1. Note: this should probably also - * check whether a sequence of TLB1 entries exist that match the - * requirement, but now only checks the easy case. + * Check if this is premapped in TLB1. */ + sz = size; + tmppa = pa; + va = ~0; + wimge = tlb_calc_wimg(pa, ma); for (i = 0; i < TLB1_ENTRIES; i++) { tlb1_read_entry(&e, i); if (!(e.mas1 & MAS1_VALID)) continue; - if (pa >= e.phys && - (pa + size) <= (e.phys + e.size) && - (ma == VM_MEMATTR_DEFAULT || - tlb_calc_wimg(pa, ma) == - (e.mas2 & (MAS2_WIMGE_MASK & ~_TLB_ENTRY_SHARED)))) - return (void *)(e.virt + - (vm_offset_t)(pa - e.phys)); + if (wimge != (e.mas2 & (MAS2_WIMGE_MASK & ~_TLB_ENTRY_SHARED))) + continue; + if (tmppa >= e.phys && tmppa < e.phys + e.size) { + va = e.virt + (pa - e.phys); + tmppa = e.phys + e.size; + sz -= MIN(sz, e.size); + while (sz > 0 && (i = tlb1_find_pa(tmppa, &e)) != -1) { + if (wimge != (e.mas2 & (MAS2_WIMGE_MASK & ~_TLB_ENTRY_SHARED))) + break; + sz -= MIN(sz, e.size); + tmppa = e.phys + e.size; + } + if (sz != 0) + break; + return ((void *)va); + } } size = roundup(size, PAGE_SIZE); @@ -3489,7 +3515,7 @@ mmu_booke_mapdev_attr(mmu_t mmu, vm_paddr_t pa, vm_siz */ do { tmpva = tlb1_map_base; - sz = ffsl(((1 << flsl(size-1)) - 1) & pa); + sz = ffsl((~((1 << flsl(size-1)) - 1)) & pa); sz = sz ? min(roundup(sz + 3, 4), flsl(size) - 1) : flsl(size) - 1; va = roundup(tlb1_map_base, 1 << sz) | (((1 << sz) - 1) & pa); #ifdef __powerpc64__ @@ -3568,6 +3594,23 @@ mmu_booke_change_attr(mmu_t mmu, vm_offset_t addr, vm_ pte_t *pte; int i, j; tlb_entry_t e; + + addr = trunc_page(addr); + + /* Only allow changes to mapped kernel addresses. This includes: + * - KVA + * - DMAP (powerpc64) + * - Device mappings + */ + if (addr <= VM_MAXUSER_ADDRESS || +#ifdef __powerpc64__ + (addr >= tlb1_map_base && addr < DMAP_BASE_ADDRESS) || + (addr > DMAP_MAX_ADDRESS && addr < VM_MIN_KERNEL_ADDRESS) || +#else + (addr >= tlb1_map_base && addr < VM_MIN_KERNEL_ADDRESS) || +#endif + (addr > VM_MAX_KERNEL_ADDRESS)) + return (EINVAL); /* Check TLB1 mappings */ for (i = 0; i < TLB1_ENTRIES; i++) { From owner-svn-src-head@freebsd.org Wed Nov 6 06:50:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A94CA1AB681; Wed, 6 Nov 2019 06:50:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477HGM41pRz4vNj; Wed, 6 Nov 2019 06:50:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E07021289; Wed, 6 Nov 2019 06:50:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA66o3AK070381; Wed, 6 Nov 2019 06:50:03 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA66o3qo070380; Wed, 6 Nov 2019 06:50:03 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201911060650.xA66o3qo070380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 6 Nov 2019 06:50:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354373 - head/sys/contrib/zstd X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/contrib/zstd X-SVN-Commit-Revision: 354373 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 06:50:03 -0000 Author: cem Date: Wed Nov 6 06:50:02 2019 New Revision: 354373 URL: https://svnweb.freebsd.org/changeset/base/354373 Log: zstd: Add an Xlist and document use during import No functional change. Added: head/sys/contrib/zstd/FREEBSD-Xlist head/sys/contrib/zstd/FREEBSD-upgrade Added: head/sys/contrib/zstd/FREEBSD-Xlist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/zstd/FREEBSD-Xlist Wed Nov 6 06:50:02 2019 (r354373) @@ -0,0 +1,12 @@ +$FreeBSD$ + +.circleci +.cirrus.yml +.gitignore +.travis.yml +build +contrib/linux-kernel +contrib/single_file_decoder +contrib/VS2005 +lib/dll +programs/windres Added: head/sys/contrib/zstd/FREEBSD-upgrade ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/zstd/FREEBSD-upgrade Wed Nov 6 06:50:02 2019 (r354373) @@ -0,0 +1,14 @@ +$FreeBSD$ + +zstd + +To import new vendor sources, prune unwanted files with: + + tar -X FREEBSD-Xlist -xf zstd-x.y.z.tar.zst + +When importing a new version, be sure to check if there are any new bits that +we don't want. + +Please find instructions for importing new releases and merging to HEAD here: + +https://www.freebsd.org/doc/en_US.ISO8859-1/articles/committers-guide/subversion-primer.html#idp45937784 From owner-svn-src-head@freebsd.org Wed Nov 6 14:30:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5CD4C1B752B; Wed, 6 Nov 2019 14:30:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477TV91sN6z4BFh; Wed, 6 Nov 2019 14:30:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 235712658D; Wed, 6 Nov 2019 14:30:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA6EUvH9053476; Wed, 6 Nov 2019 14:30:57 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA6EUunq053474; Wed, 6 Nov 2019 14:30:56 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201911061430.xA6EUunq053474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 6 Nov 2019 14:30:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354390 - in head/tests/sys/netinet6: . frag6 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head/tests/sys/netinet6: . frag6 X-SVN-Commit-Revision: 354390 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 14:30:57 -0000 Author: bz Date: Wed Nov 6 14:30:56 2019 New Revision: 354390 URL: https://svnweb.freebsd.org/changeset/base/354390 Log: ipv6 tests: cleanup Remove mentions of fragmentation tests from extension header test. Remove setting an MTU > IF_MAXMTU from the test cases to avoid warnings; this was only possible in a local research tree. MFC after: 2 weeks Sponsored by: Netflix Modified: head/tests/sys/netinet6/exthdr.sh head/tests/sys/netinet6/frag6/frag6.subr Modified: head/tests/sys/netinet6/exthdr.sh ============================================================================== --- head/tests/sys/netinet6/exthdr.sh Wed Nov 6 14:10:50 2019 (r354389) +++ head/tests/sys/netinet6/exthdr.sh Wed Nov 6 14:30:56 2019 (r354390) @@ -31,7 +31,7 @@ atf_test_case "exthdr" "cleanup" exthdr_head() { - atf_set descr 'Test IPv6 fragmentation code' + atf_set descr 'Test IPv6 extension header code paths' atf_set require.user root atf_set require.progs scapy } @@ -59,12 +59,12 @@ exthdr_body() { ip6b="2001:db8:6666:0000:${yl}:${id}:2:${xl}" epair=$(vnet_mkepair) - ifconfig ${epair}a mtu 131071 up + ifconfig ${epair}a up ifconfig ${epair}a inet6 ${ip6a}/64 jname="v6t-${id}-${yl}-${xl}" vnet_mkjail ${jname} ${epair}b - jexec ${jname} ifconfig ${epair}b mtu 131071 up + jexec ${jname} ifconfig ${epair}b up jexec ${jname} ifconfig ${epair}b inet6 ${ip6b}/64 # Let IPv6 ND do its thing. @@ -75,7 +75,7 @@ exthdr_body() { # Clear statistics. jexec ${jname} netstat -z -s > /dev/null - # Run fragment tests. + # Run extension header tests. pyname=$(atf_get ident) pyname=${pyname%*_[0-9]} Modified: head/tests/sys/netinet6/frag6/frag6.subr ============================================================================== --- head/tests/sys/netinet6/frag6/frag6.subr Wed Nov 6 14:10:50 2019 (r354389) +++ head/tests/sys/netinet6/frag6/frag6.subr Wed Nov 6 14:30:56 2019 (r354390) @@ -54,12 +54,12 @@ frag6_body() ip6b="2001:db8:6666:6666:${yl}:${id}:2:${xl}" epair=$(vnet_mkepair) - ifconfig ${epair}a mtu 131071 up + ifconfig ${epair}a up ifconfig ${epair}a inet6 ${ip6a}/64 jname="v6t-${id}-${yl}-${xl}" vnet_mkjail ${jname} ${epair}b - jexec ${jname} ifconfig ${epair}b mtu 131071 up + jexec ${jname} ifconfig ${epair}b up jexec ${jname} ifconfig ${epair}b inet6 ${ip6b}/64 # Let IPv6 ND do its thing. From owner-svn-src-head@freebsd.org Wed Nov 6 14:43:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 703B71B7C05; Wed, 6 Nov 2019 14:43:36 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477Tmm2KY4z4CX9; Wed, 6 Nov 2019 14:43:36 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33C11268D9; Wed, 6 Nov 2019 14:43:36 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA6Ehawf064668; Wed, 6 Nov 2019 14:43:36 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA6EhZZ5064665; Wed, 6 Nov 2019 14:43:35 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201911061443.xA6EhZZ5064665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 6 Nov 2019 14:43:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354395 - head/tests/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/tests/sys/netinet6 X-SVN-Commit-Revision: 354395 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 14:43:36 -0000 Author: bz Date: Wed Nov 6 14:43:35 2019 New Revision: 354395 URL: https://svnweb.freebsd.org/changeset/base/354395 Log: IPv6 tests: test case for scapy bpf parsing bug PR: 239380 Reported by: lwhsu, CI system MFC after: 3 weeks Sponsored by: Netflix Added: head/tests/sys/netinet6/scapyi386.py (contents, props changed) head/tests/sys/netinet6/scapyi386.sh (contents, props changed) Modified: head/tests/sys/netinet6/Makefile Modified: head/tests/sys/netinet6/Makefile ============================================================================== --- head/tests/sys/netinet6/Makefile Wed Nov 6 14:41:07 2019 (r354394) +++ head/tests/sys/netinet6/Makefile Wed Nov 6 14:43:35 2019 (r354395) @@ -6,11 +6,14 @@ TESTSDIR= ${TESTSBASE}/sys/netinet6 FILESDIR= ${TESTSDIR} ATF_TESTS_SH= \ - exthdr + exthdr \ + scapyi386 ${PACKAGE}FILES+= exthdr.py +${PACKAGE}FILES+= scapyi386.py ${PACKAGE}FILESMODE_exthdr.py= 0555 +${PACKAGE}FILESMODE_scapyi386.py=0555 TESTS_SUBDIRS+= frag6 Added: head/tests/sys/netinet6/scapyi386.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netinet6/scapyi386.py Wed Nov 6 14:43:35 2019 (r354395) @@ -0,0 +1,85 @@ +#!/usr/bin/env python +#- +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2019 Netflix, Inc. +# +# 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$ +# + +import argparse +import scapy.all as sp +import socket +import sys + +def main(): + parser = argparse.ArgumentParser("scapyi386.py", + description="IPv6 Ethernet Dest MAC test") + parser.add_argument('--sendif', nargs=1, + required=True, + help='The interface through which the packet will be sent') + parser.add_argument('--recvif', nargs=1, + required=True, + help='The interface on which to check for the packet') + parser.add_argument('--src', nargs=1, + required=True, + help='The source IP address') + parser.add_argument('--to', nargs=1, + required=True, + help='The destination IP address') + parser.add_argument('--debug', + required=False, action='store_true', + help='Enable test debugging') + + args = parser.parse_args() + + ######################################################################## + # + # A test case to check that IPv6 packets are sent with a proper + # (resolved) Ethernet Destination MAC address instead of the BCAST one. + # This was needed as test cases did not work properly on i386 due to a + # scapy BPF parsing bug. (See PR 239380 and duplicates). + # + bcmac = sp.Ether(dst="ff:ff:ff:ff:ff:ff").dst + data = "6" * 88 + pkt = sp.Ether() / \ + sp.IPv6(src=args.src[0], dst=args.to[0]) / \ + sp.UDP(dport=3456, sport=6543) / \ + data + sp.sendp(pkt, iface=args.sendif[0], verbose=False) + + eth = pkt.getlayer(sp.Ether) + if eth is None: + print("No Ether in packet") + pkt.display() + sys.exit(1) + if eth.dst == bcmac: + print("Broadcast dMAC on packet") + eth.display() + sys.exit(1) + + sys.exit(0) + +if __name__ == '__main__': + main() Added: head/tests/sys/netinet6/scapyi386.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netinet6/scapyi386.sh Wed Nov 6 14:43:35 2019 (r354395) @@ -0,0 +1,94 @@ +# $FreeBSD$ +#- +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2019 Netflix, Inc. +# +# 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. +# + +. $(atf_get_srcdir)/../common/vnet.subr + +atf_test_case "scapyi386" "cleanup" +scapyi386_head() { + + atf_set descr 'Test for correct Ethernet Destination MAC address' + atf_set require.user root + atf_set require.progs scapy +} + +scapyi386_body() { + + if [ "$(atf_config_get ci false)" = "true" ] && \ + [ "$(uname -p)" = "i386" ]; then + atf_skip "https://bugs.freebsd.org/239380" + fi + + ids=65533 + id=`printf "%x" ${ids}` + if [ $$ -gt 65535 ]; then + xl=`printf "%x" $(($$ - 65535))` + yl="1" + else + xl=`printf "%x" $$` + yl="" + fi + + vnet_init + + ip6a="2001:db8:6666:0000:${yl}:${id}:1:${xl}" + ip6b="2001:db8:6666:0000:${yl}:${id}:2:${xl}" + + epair=$(vnet_mkepair) + ifconfig ${epair}a up + ifconfig ${epair}a inet6 ${ip6a}/64 + + jname="v6t-${id}-${yl}-${xl}" + vnet_mkjail ${jname} ${epair}b + jexec ${jname} ifconfig ${epair}b up + jexec ${jname} ifconfig ${epair}b inet6 ${ip6b}/64 + + # Let IPv6 ND do its thing. + #ping6 -q -c 1 ff02::1%${epair}a + #ping6 -q -c 1 ${ip6b} + sleep 3 + + pyname=$(atf_get ident) + pyname=${pyname%*_[0-9]} + + atf_check -s exit:0 $(atf_get_srcdir)/${pyname}.py \ + --sendif ${epair}a --recvif ${epair}a \ + --src ${ip6a} --to ${ip6b} +} + +scapyi386_cleanup() { + + vnet_cleanup +} + +atf_init_test_cases() +{ + + atf_add_test_case "scapyi386" +} + +# end From owner-svn-src-head@freebsd.org Wed Nov 6 14:55:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C8911B7FEC; Wed, 6 Nov 2019 14:55:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477V2Q1mf1z4DBj; Wed, 6 Nov 2019 14:55:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FDC126AE6; Wed, 6 Nov 2019 14:55:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA6EtQK5070539; Wed, 6 Nov 2019 14:55:26 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA6EtOba070533; Wed, 6 Nov 2019 14:55:24 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201911061455.xA6EtOba070533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 6 Nov 2019 14:55:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354396 - in head/sys: arm/allwinner arm64/rockchip dev/extres/regulator X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/allwinner arm64/rockchip dev/extres/regulator X-SVN-Commit-Revision: 354396 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 14:55:26 -0000 Author: manu Date: Wed Nov 6 14:55:24 2019 New Revision: 354396 URL: https://svnweb.freebsd.org/changeset/base/354396 Log: regulator: Add regulator_check_voltage function This function will call the regnode_check_voltage method for a given regulator and check if the desired voltage in reachable by it. Also adds a default method that check the std_param and which should be enough for most regulators and add it as the method for axp* rk805 and fixed regulators. Reviewed by: mmel MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D22260 Modified: head/sys/arm/allwinner/axp209.c head/sys/arm/allwinner/axp81x.c head/sys/arm64/rockchip/rk805.c head/sys/dev/extres/regulator/regnode_if.m head/sys/dev/extres/regulator/regulator.c head/sys/dev/extres/regulator/regulator.h head/sys/dev/extres/regulator/regulator_fixed.c Modified: head/sys/arm/allwinner/axp209.c ============================================================================== --- head/sys/arm/allwinner/axp209.c Wed Nov 6 14:43:35 2019 (r354395) +++ head/sys/arm/allwinner/axp209.c Wed Nov 6 14:55:24 2019 (r354396) @@ -753,6 +753,7 @@ static regnode_method_t axp2xx_regnode_methods[] = { REGNODEMETHOD(regnode_enable, axp2xx_regnode_enable), REGNODEMETHOD(regnode_set_voltage, axp2xx_regnode_set_voltage), REGNODEMETHOD(regnode_get_voltage, axp2xx_regnode_get_voltage), + REGNODEMETHOD(regnode_check_voltage, regnode_method_check_voltage), REGNODEMETHOD_END }; DEFINE_CLASS_1(axp2xx_regnode, axp2xx_regnode_class, axp2xx_regnode_methods, Modified: head/sys/arm/allwinner/axp81x.c ============================================================================== --- head/sys/arm/allwinner/axp81x.c Wed Nov 6 14:43:35 2019 (r354395) +++ head/sys/arm/allwinner/axp81x.c Wed Nov 6 14:55:24 2019 (r354396) @@ -866,6 +866,7 @@ static regnode_method_t axp8xx_regnode_methods[] = { REGNODEMETHOD(regnode_enable, axp8xx_regnode_enable), REGNODEMETHOD(regnode_set_voltage, axp8xx_regnode_set_voltage), REGNODEMETHOD(regnode_get_voltage, axp8xx_regnode_get_voltage), + REGNODEMETHOD(regnode_check_voltage, regnode_method_check_voltage), REGNODEMETHOD_END }; DEFINE_CLASS_1(axp8xx_regnode, axp8xx_regnode_class, axp8xx_regnode_methods, Modified: head/sys/arm64/rockchip/rk805.c ============================================================================== --- head/sys/arm64/rockchip/rk805.c Wed Nov 6 14:43:35 2019 (r354395) +++ head/sys/arm64/rockchip/rk805.c Wed Nov 6 14:55:24 2019 (r354396) @@ -362,6 +362,7 @@ static regnode_method_t rk805_regnode_methods[] = { REGNODEMETHOD(regnode_enable, rk805_regnode_enable), REGNODEMETHOD(regnode_set_voltage, rk805_regnode_set_voltage), REGNODEMETHOD(regnode_get_voltage, rk805_regnode_get_voltage), + REGNODEMETHOD(regnode_check_voltage, regnode_method_check_voltage), REGNODEMETHOD_END }; DEFINE_CLASS_1(rk805_regnode, rk805_regnode_class, rk805_regnode_methods, Modified: head/sys/dev/extres/regulator/regnode_if.m ============================================================================== --- head/sys/dev/extres/regulator/regnode_if.m Wed Nov 6 14:43:35 2019 (r354395) +++ head/sys/dev/extres/regulator/regnode_if.m Wed Nov 6 14:55:24 2019 (r354396) @@ -91,6 +91,15 @@ METHOD int get_voltage { }; # +# Check if a given voltage is supported by the regulator +# Returns 0 on success or a standard errno value. +# +METHOD int check_voltage { + struct regnode *regnode; + int uvolt; +}; + +# # Stop (shutdown) regulator # Returns 0 on success or a standard errno value. # Modified: head/sys/dev/extres/regulator/regulator.c ============================================================================== --- head/sys/dev/extres/regulator/regulator.c Wed Nov 6 14:43:35 2019 (r354395) +++ head/sys/dev/extres/regulator/regulator.c Wed Nov 6 14:55:24 2019 (r354396) @@ -84,6 +84,7 @@ static regnode_method_t regnode_methods[] = { REGNODEMETHOD(regnode_status, regnode_method_status), REGNODEMETHOD(regnode_set_voltage, regnode_method_set_voltage), REGNODEMETHOD(regnode_get_voltage, regnode_method_get_voltage), + REGNODEMETHOD(regnode_check_voltage, regnode_method_check_voltage), REGNODEMETHOD_END }; @@ -278,6 +279,16 @@ regnode_method_get_voltage(struct regnode *regnode, in (regnode->std_param.max_uvolt - regnode->std_param.min_uvolt) / 2); } +int +regnode_method_check_voltage(struct regnode *regnode, int uvolt) +{ + + if ((uvolt > regnode->std_param.max_uvolt) || + (uvolt < regnode->std_param.min_uvolt)) + return (ERANGE); + return (0); +} + /* ---------------------------------------------------------------------------- * * Internal functions. @@ -991,6 +1002,22 @@ regulator_set_voltage(regulator_t reg, int min_uvolt, reg->min_uvolt = min_uvolt; reg->max_uvolt = max_uvolt; } + REG_TOPO_UNLOCK(); + return (rv); +} + +int +regulator_check_voltage(regulator_t reg, int uvolt) +{ + int rv; + struct regnode *regnode; + + regnode = reg->regnode; + KASSERT(regnode->ref_cnt > 0, + ("Attempt to access unreferenced regulator: %s\n", regnode->name)); + + REG_TOPO_SLOCK(); + rv = REGNODE_CHECK_VOLTAGE(regnode, uvolt); REG_TOPO_UNLOCK(); return (rv); } Modified: head/sys/dev/extres/regulator/regulator.h ============================================================================== --- head/sys/dev/extres/regulator/regulator.h Wed Nov 6 14:43:35 2019 (r354395) +++ head/sys/dev/extres/regulator/regulator.h Wed Nov 6 14:55:24 2019 (r354396) @@ -117,6 +117,10 @@ int regnode_status(struct regnode *regnode, int *statu int regnode_get_voltage(struct regnode *regnode, int *uvolt); int regnode_set_voltage(struct regnode *regnode, int min_uvolt, int max_uvolt); int regnode_set_constraint(struct regnode *regnode); + +/* Standard method that aren't default */ +int regnode_method_check_voltage(struct regnode *regnode, int uvolt); + #ifdef FDT phandle_t regnode_get_ofw_node(struct regnode *regnode); #endif @@ -134,6 +138,7 @@ int regulator_stop(regulator_t reg); int regulator_status(regulator_t reg, int *status); int regulator_get_voltage(regulator_t reg, int *uvolt); int regulator_set_voltage(regulator_t reg, int min_uvolt, int max_uvolt); +int regulator_check_voltage(regulator_t reg, int uvolt); #ifdef FDT int regulator_get_by_ofw_property(device_t dev, phandle_t node, char *name, Modified: head/sys/dev/extres/regulator/regulator_fixed.c ============================================================================== --- head/sys/dev/extres/regulator/regulator_fixed.c Wed Nov 6 14:43:35 2019 (r354395) +++ head/sys/dev/extres/regulator/regulator_fixed.c Wed Nov 6 14:55:24 2019 (r354396) @@ -80,6 +80,7 @@ static regnode_method_t regnode_fixed_methods[] = { REGNODEMETHOD(regnode_enable, regnode_fixed_enable), REGNODEMETHOD(regnode_status, regnode_fixed_status), REGNODEMETHOD(regnode_stop, regnode_fixed_stop), + REGNODEMETHOD(regnode_check_voltage, regnode_method_check_voltage), REGNODEMETHOD_END }; DEFINE_CLASS_1(regnode_fixed, regnode_fixed_class, regnode_fixed_methods, From owner-svn-src-head@freebsd.org Wed Nov 6 14:58:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB5F71B808A; Wed, 6 Nov 2019 14:58:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477V5s5Nb7z4DMK; Wed, 6 Nov 2019 14:58:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98DED26AFB; Wed, 6 Nov 2019 14:58:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA6EwPvw070703; Wed, 6 Nov 2019 14:58:25 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA6EwPWl070702; Wed, 6 Nov 2019 14:58:25 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201911061458.xA6EwPWl070702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 6 Nov 2019 14:58:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354397 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 354397 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 14:58:25 -0000 Author: manu Date: Wed Nov 6 14:58:25 2019 New Revision: 354397 URL: https://svnweb.freebsd.org/changeset/base/354397 Log: arm: allwinner: aw_mmc: Check if the regulator support the voltage Don't blindy say that we support both 3.3V and 1.8V. If we have a regulator for the data lines, check that the voltage is supported before adding the signaling caps. If we don't have a regulator, just assume that the data lines are 3.3V This unbreak eMMC on some allwinner boards. Reported by: ganbold MFC after: 1 month X-MFC-With: r354396 Modified: head/sys/arm/allwinner/aw_mmc.c Modified: head/sys/arm/allwinner/aw_mmc.c ============================================================================== --- head/sys/arm/allwinner/aw_mmc.c Wed Nov 6 14:55:24 2019 (r354396) +++ head/sys/arm/allwinner/aw_mmc.c Wed Nov 6 14:58:25 2019 (r354397) @@ -511,7 +511,13 @@ aw_mmc_attach(device_t dev) MMC_CAP_UHS_SDR25 | MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_DDR50 | MMC_CAP_MMC_DDR52; - sc->aw_host.caps |= MMC_CAP_SIGNALING_330 | MMC_CAP_SIGNALING_180; + if (sc->aw_reg_vqmmc != NULL) { + if (regulator_check_voltage(sc->aw_reg_vqmmc, 1800000) == 0) + sc->aw_host.caps |= MMC_CAP_SIGNALING_180; + if (regulator_check_voltage(sc->aw_reg_vqmmc, 3300000) == 0) + sc->aw_host.caps |= MMC_CAP_SIGNALING_330; + } else + sc->aw_host.caps |= MMC_CAP_SIGNALING_330; if (bus_width >= 4) sc->aw_host.caps |= MMC_CAP_4_BIT_DATA; From owner-svn-src-head@freebsd.org Wed Nov 6 16:21:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A1911B9D6B; Wed, 6 Nov 2019 16:21:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477Wxs4Mr3z4JYl; Wed, 6 Nov 2019 16:21:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 790D127B1C; Wed, 6 Nov 2019 16:21:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA6GLbjk022373; Wed, 6 Nov 2019 16:21:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA6GLaAL021014; Wed, 6 Nov 2019 16:21:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911061621.xA6GLaAL021014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 Nov 2019 16:21:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354399 - in head/contrib/blacklist: bin diff lib X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/contrib/blacklist: bin diff lib X-SVN-Commit-Revision: 354399 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 16:21:37 -0000 Author: emaste Date: Wed Nov 6 16:21:35 2019 New Revision: 354399 URL: https://svnweb.freebsd.org/changeset/base/354399 Log: blacklist: update to NetBSD snapshot on 20191106 Cursory review: cem MFC after: 3 months Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22259 Modified: head/contrib/blacklist/bin/blacklistctl.c head/contrib/blacklist/bin/blacklistd.c head/contrib/blacklist/bin/blacklistd.conf.5 head/contrib/blacklist/bin/support.c head/contrib/blacklist/diff/ssh.diff head/contrib/blacklist/lib/Makefile head/contrib/blacklist/lib/libblacklist.3 Directory Properties: head/contrib/blacklist/ (props changed) Modified: head/contrib/blacklist/bin/blacklistctl.c ============================================================================== --- head/contrib/blacklist/bin/blacklistctl.c Wed Nov 6 15:11:51 2019 (r354398) +++ head/contrib/blacklist/bin/blacklistctl.c Wed Nov 6 16:21:35 2019 (r354399) @@ -1,4 +1,4 @@ -/* $NetBSD: blacklistctl.c,v 1.21 2016/11/02 03:15:07 jnemeth Exp $ */ +/* $NetBSD: blacklistctl.c,v 1.23 2018/05/24 19:21:01 christos Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #endif #include -__RCSID("$NetBSD: blacklistctl.c,v 1.21 2016/11/02 03:15:07 jnemeth Exp $"); +__RCSID("$NetBSD: blacklistctl.c,v 1.23 2018/05/24 19:21:01 christos Exp $"); #include #include @@ -67,6 +67,15 @@ usage(int c) exit(EXIT_FAILURE); } +static const char * +star(char *buf, size_t len, int val) +{ + if (val == -1) + return "*"; + snprintf(buf, len, "%d", val); + return buf; +} + int main(int argc, char *argv[]) { @@ -128,9 +137,10 @@ main(int argc, char *argv[]) "address", remain ? "remaining time" : "last access"); for (i = 1; state_iterate(db, &c, &dbi, i) != 0; i = 0) { char buf[BUFSIZ]; + char mbuf[64], pbuf[64]; if (!all) { if (blocked) { - if (dbi.count < c.c_nfail) + if (c.c_nfail == -1 || dbi.count < c.c_nfail) continue; } else { if (dbi.count >= c.c_nfail) @@ -138,13 +148,20 @@ main(int argc, char *argv[]) } } sockaddr_snprintf(buf, sizeof(buf), "%a", (void *)&c.c_ss); - printf("%*.*s/%d:%d\t", wide, wide, buf, c.c_lmask, c.c_port); - if (remain) - fmtydhms(buf, sizeof(buf), - c.c_duration - (ts.tv_sec - dbi.last)); - else - fmttime(buf, sizeof(buf), dbi.last); - printf("%s\t%d/%d\t%-s\n", dbi.id, dbi.count, c.c_nfail, buf); + printf("%*.*s/%s:%s\t", wide, wide, buf, + star(mbuf, sizeof(mbuf), c.c_lmask), + star(pbuf, sizeof(pbuf), c.c_port)); + if (c.c_duration == -1) { + strlcpy(buf, "never", sizeof(buf)); + } else { + if (remain) + fmtydhms(buf, sizeof(buf), + c.c_duration - (ts.tv_sec - dbi.last)); + else + fmttime(buf, sizeof(buf), dbi.last); + } + printf("%s\t%d/%s\t%-s\n", dbi.id, dbi.count, + star(mbuf, sizeof(mbuf), c.c_nfail), buf); } state_close(db); return EXIT_SUCCESS; Modified: head/contrib/blacklist/bin/blacklistd.c ============================================================================== --- head/contrib/blacklist/bin/blacklistd.c Wed Nov 6 15:11:51 2019 (r354398) +++ head/contrib/blacklist/bin/blacklistd.c Wed Nov 6 16:21:35 2019 (r354399) @@ -1,4 +1,4 @@ -/* $NetBSD: blacklistd.c,v 1.37 2017/02/18 00:26:16 christos Exp $ */ +/* $NetBSD: blacklistd.c,v 1.38 2019/02/27 02:20:18 christos Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include "config.h" #endif #include -__RCSID("$NetBSD: blacklistd.c,v 1.37 2017/02/18 00:26:16 christos Exp $"); +__RCSID("$NetBSD: blacklistd.c,v 1.38 2019/02/27 02:20:18 christos Exp $"); #include #include @@ -408,7 +408,6 @@ rules_restore(void) for (f = 1; state_iterate(state, &c, &dbi, f) == 1; f = 0) { if (dbi.id[0] == '\0') continue; - (void)run_change("rem", &c, dbi.id, 0); (void)run_change("add", &c, dbi.id, sizeof(dbi.id)); } } @@ -505,7 +504,8 @@ main(int argc, char *argv[]) conf_parse(configfile); if (flush) { rules_flush(); - flags |= O_TRUNC; + if (!restore) + flags |= O_TRUNC; } struct pollfd *pfd = NULL; @@ -536,8 +536,11 @@ main(int argc, char *argv[]) if (state == NULL) return EXIT_FAILURE; - if (restore) + if (restore) { + if (!flush) + rules_flush(); rules_restore(); + } if (!debug) { if (daemon(0, 0) == -1) Modified: head/contrib/blacklist/bin/blacklistd.conf.5 ============================================================================== --- head/contrib/blacklist/bin/blacklistd.conf.5 Wed Nov 6 15:11:51 2019 (r354398) +++ head/contrib/blacklist/bin/blacklistd.conf.5 Wed Nov 6 16:21:35 2019 (r354399) @@ -1,4 +1,4 @@ -.\" $NetBSD: blacklistd.conf.5,v 1.5 2016/06/08 12:48:37 wiz Exp $ +.\" $NetBSD: blacklistd.conf.5,v 1.7 2017/06/07 13:50:57 wiz Exp $ .\" .\" Copyright (c) 2015 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 7, 2016 +.Dd June 5, 2017 .Dt BLACKLISTD.CONF 5 .Os .Sh NAME @@ -36,12 +36,13 @@ .Sh DESCRIPTION The .Nm -files contains configuration lines for -.Xr blacklistd 8 . -It contains one entry per line, and is similar to +files contains configuration entries for +.Xr blacklistd 8 +in a fashion similar to .Xr inetd.conf 5 . -There must be an entry for each field of the configuration file, with -entries for each field separated by a tab or a space. +Only one entry per line is permitted. +Every entry must have all fields populated. +Each field can be separated by a tab or a space. Comments are denoted by a .Dq # at the beginning of a line. @@ -109,7 +110,7 @@ The can be an IPv4 address in numeric format, an IPv6 address in numeric format and enclosed by square brackets, or an interface name. Mask modifiers are not allowed on interfaces because interfaces -have multiple address in different protocols where the mask has a different +can have multiple addresses in different protocols where the mask has a different size. .Pp The @@ -150,8 +151,8 @@ If the contains a .Dq / , the remaining portion of the name is interpreted as the mask to be -applied to the address specified in the rule, so one can block whole -subnets for a single rule violation. +applied to the address specified in the rule, causing a single rule violation to +block the entire subnet for the configured prefix. .Pp The .Va nfail @@ -176,10 +177,11 @@ for days. .Pp Matching is done first by checking the .Va local -rules one by one, from the most specific to the least specific. +rules individually, in the order of the most specific to the least specific. If a match is found, then the .Va remote -rules are applied, and if a match is found the +rules are applied. +The .Va name , .Va nfail , and @@ -191,15 +193,15 @@ rule that matched. The .Va remote rules can be used for whitelisting specific addresses, changing the mask -size, or the rule that the packet filter uses, the number of failed attempts, -or the blocked duration. +size, the rule that the packet filter uses, the number of failed attempts, +or the block duration. .Sh FILES .Bl -tag -width /etc/blacklistd.conf -compact .It Pa /etc/blacklistd.conf Configuration file. .El .Sh EXAMPLES -.Bd -literal -offset +.Bd -literal -offset 8n # Block ssh, after 3 attempts for 6 hours on the bnx0 interface [local] # location type proto owner name nfail duration Modified: head/contrib/blacklist/bin/support.c ============================================================================== --- head/contrib/blacklist/bin/support.c Wed Nov 6 15:11:51 2019 (r354398) +++ head/contrib/blacklist/bin/support.c Wed Nov 6 16:21:35 2019 (r354399) @@ -1,4 +1,4 @@ -/* $NetBSD: support.c,v 1.8 2016/04/04 15:52:56 christos Exp $ */ +/* $NetBSD: support.c,v 1.9 2018/09/18 22:12:19 christos Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #endif #include -__RCSID("$NetBSD: support.c,v 1.8 2016/04/04 15:52:56 christos Exp $"); +__RCSID("$NetBSD: support.c,v 1.9 2018/09/18 22:12:19 christos Exp $"); #include #include @@ -105,12 +105,16 @@ fmtydhms(char *b, size_t l, time_t t) s = t % 60; t /= 60; + m = t % 60; t /= 60; - h = t % 60; + + h = t % 24; t /= 24; - d = t % 24; - t /= 356; + + d = t % 365; + t /= 365; + y = t; z = 0; Modified: head/contrib/blacklist/diff/ssh.diff ============================================================================== --- head/contrib/blacklist/diff/ssh.diff Wed Nov 6 15:11:51 2019 (r354398) +++ head/contrib/blacklist/diff/ssh.diff Wed Nov 6 16:21:35 2019 (r354399) @@ -1,6 +1,6 @@ --- /dev/null 2015-01-22 23:10:33.000000000 -0500 +++ dist/pfilter.c 2015-01-22 23:46:03.000000000 -0500 -@@ -0,0 +1,28 @@ +@@ -0,0 +1,32 @@ +#include "namespace.h" +#include "includes.h" +#include "ssh.h" @@ -28,6 +28,10 @@ + // XXX: 3? + fd = packet_connection_is_on_socket() ? packet_get_connection_in() : 3; + (void)blacklist_r(blstate, a, fd, "ssh"); ++ if (a == 0) { ++ blacklist_close(blstate); ++ blstate = NULL; ++ } +} --- /dev/null 2015-01-20 21:14:44.000000000 -0500 +++ dist/pfilter.h 2015-01-20 20:16:20.000000000 -0500 @@ -58,174 +62,89 @@ diff -u -u -r1.10 Makefile + +LDADD+= -lblacklist +DPADD+= ${LIBBLACKLIST} -Index: dist/auth.c -=================================================================== -RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/auth.c,v -retrieving revision 1.10 -diff -u -u -r1.10 auth.c ---- dist/auth.c 19 Oct 2014 16:30:58 -0000 1.10 -+++ dist/auth.c 22 Jan 2015 21:39:22 -0000 -@@ -62,6 +62,7 @@ - #include "monitor_wrap.h" - #include "krl.h" - #include "compat.h" -+#include "pfilter.h" - - #ifdef HAVE_LOGIN_CAP - #include -@@ -362,6 +363,8 @@ - compat20 ? "ssh2" : "ssh1", - authctxt->info != NULL ? ": " : "", - authctxt->info != NULL ? authctxt->info : ""); -+ if (!authctxt->postponed) -+ pfilter_notify(!authenticated); - free(authctxt->info); - authctxt->info = NULL; - } -Index: dist/sshd.c -=================================================================== -RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/sshd.c,v -retrieving revision 1.15 -diff -u -u -r1.15 sshd.c ---- dist/sshd.c 28 Oct 2014 21:36:16 -0000 1.15 -+++ dist/sshd.c 22 Jan 2015 21:39:22 -0000 -@@ -109,6 +109,7 @@ - #include "roaming.h" - #include "ssh-sandbox.h" - #include "version.h" -+#include "pfilter.h" - - #ifdef LIBWRAP - #include -@@ -364,6 +365,7 @@ - killpg(0, SIGTERM); - } - -+ pfilter_notify(1); - /* Log error and exit. */ - sigdie("Timeout before authentication for %s", get_remote_ipaddr()); - } -@@ -1160,6 +1162,7 @@ - for (i = 0; i < options.max_startups; i++) - startup_pipes[i] = -1; - -+ pfilter_init(); - /* - * Stay listening for connections until the system crashes or - * the daemon is killed with a signal. -Index: auth1.c -=================================================================== -RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/auth1.c,v -retrieving revision 1.9 -diff -u -u -r1.9 auth1.c ---- auth1.c 19 Oct 2014 16:30:58 -0000 1.9 -+++ auth1.c 14 Feb 2015 15:40:51 -0000 -@@ -41,6 +41,7 @@ +diff -ru openssh-7.7p1/auth-pam.c dist/auth-pam.c +--- openssh-7.7p1/auth-pam.c 2018-04-02 01:38:28.000000000 -0400 ++++ dist/auth-pam.c 2018-05-23 11:56:22.206661484 -0400 +@@ -103,6 +103,7 @@ + #include "ssh-gss.h" #endif #include "monitor_wrap.h" - #include "buffer.h" +#include "pfilter.h" - /* import */ extern ServerOptions options; -@@ -445,6 +446,7 @@ - else { - debug("do_authentication: invalid user %s", user); - authctxt->pw = fakepw(); -+ pfilter_notify(1); - } + extern Buffer loginmsg; +@@ -526,6 +527,7 @@ + ssh_msg_send(ctxt->pam_csock, PAM_MAXTRIES, &buffer); + else + ssh_msg_send(ctxt->pam_csock, PAM_AUTH_ERR, &buffer); ++ pfilter_notify(1); + buffer_free(&buffer); + pthread_exit(NULL); - /* Configuration may have changed as a result of Match */ -Index: auth2.c -=================================================================== -RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/auth2.c,v -retrieving revision 1.9 -diff -u -u -r1.9 auth2.c ---- auth2.c 19 Oct 2014 16:30:58 -0000 1.9 -+++ auth2.c 14 Feb 2015 15:40:51 -0000 -@@ -52,6 +52,7 @@ +@@ -804,6 +806,7 @@ + free(msg); + return (0); + } ++ pfilter_notify(1); + error("PAM: %s for %s%.100s from %.100s", msg, + sshpam_authctxt->valid ? "" : "illegal user ", + sshpam_authctxt->user, +diff -ru openssh-7.7p1/auth2.c dist/auth2.c +--- openssh-7.7p1/auth2.c 2018-04-02 01:38:28.000000000 -0400 ++++ dist/auth2.c 2018-05-23 11:57:31.022197317 -0400 +@@ -51,6 +51,7 @@ + #include "dispatch.h" #include "pathnames.h" #include "buffer.h" - #include "canohost.h" +#include "pfilter.h" #ifdef GSSAPI #include "ssh-gss.h" -@@ -256,6 +257,7 @@ +@@ -242,6 +243,7 @@ } else { - logit("input_userauth_request: invalid user %s", user); + /* Invalid user, fake password information */ authctxt->pw = fakepw(); + pfilter_notify(1); - } - #ifdef USE_PAM - if (options.use_pam) -Index: sshd.c -=================================================================== -RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/sshd.c,v -retrieving revision 1.16 -diff -u -r1.16 sshd.c ---- sshd.c 25 Jan 2015 15:52:44 -0000 1.16 -+++ sshd.c 14 Feb 2015 09:55:06 -0000 -@@ -628,6 +628,8 @@ - explicit_bzero(pw->pw_passwd, strlen(pw->pw_passwd)); - endpwent(); - -+ pfilter_init(); -+ - /* Change our root directory */ - if (chroot(_PATH_PRIVSEP_CHROOT_DIR) == -1) - fatal("chroot(\"%s\"): %s", _PATH_PRIVSEP_CHROOT_DIR, - -Index: auth-pam.c -=================================================================== -RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/auth-pam.c,v -retrieving revision 1.7 -diff -u -u -r1.7 auth-pam.c ---- auth-pam.c 3 Jul 2015 00:59:59 -0000 1.7 -+++ auth-pam.c 23 Jan 2016 00:01:16 -0000 -@@ -114,6 +114,7 @@ - #include "ssh-gss.h" + #ifdef SSH_AUDIT_EVENTS + PRIVSEP(audit_event(SSH_INVALID_USER)); #endif - #include "monitor_wrap.h" +Only in dist: pfilter.c +Only in dist: pfilter.h +diff -ru openssh-7.7p1/sshd.c dist/sshd.c +--- openssh-7.7p1/sshd.c 2018-04-02 01:38:28.000000000 -0400 ++++ dist/sshd.c 2018-05-23 11:59:39.573197347 -0400 +@@ -122,6 +122,7 @@ + #include "auth-options.h" + #include "version.h" + #include "ssherr.h" +#include "pfilter.h" - extern ServerOptions options; - extern Buffer loginmsg; -@@ -809,6 +810,7 @@ - free(msg); - return (0); - } -+ pfilter_notify(1); - error("PAM: %s for %s%.100s from %.100s", msg, - sshpam_authctxt->valid ? "" : "illegal user ", - sshpam_authctxt->user, -Index: auth.c -=================================================================== -RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/auth.c,v -retrieving revision 1.15 -diff -u -u -r1.15 auth.c ---- auth.c 21 Aug 2015 08:20:59 -0000 1.15 -+++ auth.c 23 Jan 2016 00:01:16 -0000 -@@ -656,6 +656,7 @@ + /* Re-exec fds */ + #define REEXEC_DEVCRYPTO_RESERVED_FD (STDERR_FILENO + 1) +@@ -346,6 +347,7 @@ + static void + grace_alarm_handler(int sig) + { ++ pfilter_notify(1); + if (use_privsep && pmonitor != NULL && pmonitor->m_pid > 0) + kill(pmonitor->m_pid, SIGALRM); - pw = getpwnam(user); - if (pw == NULL) { -+ pfilter_notify(1); - logit("Invalid user %.100s from %.100s", - user, get_remote_ipaddr()); - return (NULL); -Index: auth1.c -=================================================================== -RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/auth1.c,v -retrieving revision 1.12 -diff -u -u -r1.12 auth1.c ---- auth1.c 3 Jul 2015 00:59:59 -0000 1.12 -+++ auth1.c 23 Jan 2016 00:01:16 -0000 -@@ -376,6 +376,7 @@ - char *msg; - size_t len; +@@ -1835,6 +1837,8 @@ + if (test_flag) + exit(0); -+ pfilter_notify(1); - error("Access denied for user %s by PAM account " - "configuration", authctxt->user); - len = buffer_len(&loginmsg); ++ pfilter_init(); ++ + /* + * Clear out any supplemental groups we may have inherited. This + * prevents inadvertent creation of files with bad modes (in the +@@ -2280,6 +2284,9 @@ + { + struct ssh *ssh = active_state; /* XXX */ + ++ if (i == 255) ++ pfilter_notify(1); ++ + if (the_authctxt) { + do_cleanup(ssh, the_authctxt); + if (use_privsep && privsep_is_preauth && Modified: head/contrib/blacklist/lib/Makefile ============================================================================== --- head/contrib/blacklist/lib/Makefile Wed Nov 6 15:11:51 2019 (r354398) +++ head/contrib/blacklist/lib/Makefile Wed Nov 6 16:21:35 2019 (r354399) @@ -1,11 +1,11 @@ -# $NetBSD: Makefile,v 1.6 2016/01/05 13:07:46 christos Exp $ +# $NetBSD: Makefile,v 1.7 2019/03/08 20:40:05 christos Exp $ .include USE_SHLIBDIR= yes CPPFLAGS+=-D_REENTRANT -LIBDPLIBS+=pthread ${NETBSDSRCDIR}/lib/libpthread +#LIBDPLIBS+=pthread ${NETBSDSRCDIR}/lib/libpthread LIB=blacklist SRCS=bl.c blacklist.c MAN=libblacklist.3 Modified: head/contrib/blacklist/lib/libblacklist.3 ============================================================================== --- head/contrib/blacklist/lib/libblacklist.3 Wed Nov 6 15:11:51 2019 (r354398) +++ head/contrib/blacklist/lib/libblacklist.3 Wed Nov 6 16:21:35 2019 (r354399) @@ -1,4 +1,4 @@ -.\" $NetBSD: libblacklist.3,v 1.7 2017/02/04 23:33:56 wiz Exp $ +.\" $NetBSD: libblacklist.3,v 1.8 2017/10/22 10:31:57 abhinav Exp $ .\" .\" Copyright (c) 2015 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -35,7 +35,7 @@ .Nm blacklist_close , .Nm blacklist_r , .Nm blacklist , -.Nm blacklist_sa +.Nm blacklist_sa , .Nm blacklist_sa_r .Nd Blacklistd notification library .Sh LIBRARY From owner-svn-src-head@freebsd.org Wed Nov 6 16:59:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F1B31BA744; Wed, 6 Nov 2019 16:59:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477XnK3VwKz4Lgn; Wed, 6 Nov 2019 16:59:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42AEF137; Wed, 6 Nov 2019 16:59:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA6GxHHq048101; Wed, 6 Nov 2019 16:59:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA6GxGwe048100; Wed, 6 Nov 2019 16:59:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911061659.xA6GxGwe048100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 6 Nov 2019 16:59:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354400 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 354400 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 16:59:17 -0000 Author: markj Date: Wed Nov 6 16:59:16 2019 New Revision: 354400 URL: https://svnweb.freebsd.org/changeset/base/354400 Log: Fix a race in release_page(). Since r354156 we may call release_page() without the page's object lock held, specifically following the page copy during a CoW fault. release_page() must therefore unbusy the page only after scheduling the requeue, to avoid racing with a free of the page. Previously, the object lock prevented this race from occurring. Add some assertions that were helpful in tracking this down. Reported by: pho, syzkaller Tested by: pho Reviewed by: alc, jeff, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22234 Modified: head/sys/vm/vm_fault.c head/sys/vm/vm_page.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Wed Nov 6 16:21:35 2019 (r354399) +++ head/sys/vm/vm_fault.c Wed Nov 6 16:59:16 2019 (r354400) @@ -155,10 +155,14 @@ release_page(struct faultstate *fs) { if (fs->m != NULL) { - vm_page_xunbusy(fs->m); + /* + * fs->m's object lock might not be held, so the page must be + * kept busy until we are done with it. + */ vm_page_lock(fs->m); vm_page_deactivate(fs->m); vm_page_unlock(fs->m); + vm_page_xunbusy(fs->m); fs->m = NULL; } } Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Nov 6 16:21:35 2019 (r354399) +++ head/sys/vm/vm_page.c Wed Nov 6 16:59:16 2019 (r354400) @@ -3421,7 +3421,7 @@ vm_page_dequeue(vm_page_t m) struct vm_pagequeue *pq, *pq1; uint8_t aflags; - KASSERT(mtx_owned(vm_page_lockptr(m)) || m->object == NULL, + KASSERT(mtx_owned(vm_page_lockptr(m)) || m->ref_count == 0, ("page %p is allocated and unlocked", m)); for (pq = vm_page_pagequeue(m);; pq = pq1) { @@ -3475,6 +3475,8 @@ vm_page_enqueue(vm_page_t m, uint8_t queue) vm_page_assert_locked(m); KASSERT(m->queue == PQ_NONE && (m->aflags & PGA_QUEUE_STATE_MASK) == 0, ("%s: page %p is already enqueued", __func__, m)); + KASSERT(m->ref_count > 0, + ("%s: page %p does not carry any references", __func__, m)); m->queue = queue; if ((m->aflags & PGA_REQUEUE) == 0) @@ -3496,6 +3498,8 @@ vm_page_requeue(vm_page_t m) vm_page_assert_locked(m); KASSERT(vm_page_queue(m) != PQ_NONE, ("%s: page %p is not logically enqueued", __func__, m)); + KASSERT(m->ref_count > 0, + ("%s: page %p does not carry any references", __func__, m)); if ((m->aflags & PGA_REQUEUE) == 0) vm_page_aflag_set(m, PGA_REQUEUE); @@ -3889,6 +3893,8 @@ vm_page_mvqueue(vm_page_t m, const uint8_t nqueue) vm_page_assert_locked(m); KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("vm_page_mvqueue: page %p is unmanaged", m)); + KASSERT(m->ref_count > 0, + ("%s: page %p does not carry any references", __func__, m)); if (vm_page_queue(m) != nqueue) { vm_page_dequeue(m); From owner-svn-src-head@freebsd.org Wed Nov 6 17:01:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5FB91BA816; Wed, 6 Nov 2019 17:01:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477Xqz5tSdz4M27; Wed, 6 Nov 2019 17:01:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD40D1C1; Wed, 6 Nov 2019 17:01:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA6H1ZbC051416; Wed, 6 Nov 2019 17:01:35 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA6H1Z27051415; Wed, 6 Nov 2019 17:01:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911061701.xA6H1Z27051415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 Nov 2019 17:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354401 - head/contrib/blacklist/bin X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/blacklist/bin X-SVN-Commit-Revision: 354401 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 17:01:36 -0000 Author: emaste Date: Wed Nov 6 17:01:35 2019 New Revision: 354401 URL: https://svnweb.freebsd.org/changeset/base/354401 Log: blacklistd.conf.5: pluralization correction Submitted by: bcr in review D22259 MFC with: r354399 Modified: head/contrib/blacklist/bin/blacklistd.conf.5 Modified: head/contrib/blacklist/bin/blacklistd.conf.5 ============================================================================== --- head/contrib/blacklist/bin/blacklistd.conf.5 Wed Nov 6 16:59:16 2019 (r354400) +++ head/contrib/blacklist/bin/blacklistd.conf.5 Wed Nov 6 17:01:35 2019 (r354401) @@ -36,7 +36,7 @@ .Sh DESCRIPTION The .Nm -files contains configuration entries for +file contains configuration entries for .Xr blacklistd 8 in a fashion similar to .Xr inetd.conf 5 . From owner-svn-src-head@freebsd.org Wed Nov 6 17:03:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B93B1BAA64; Wed, 6 Nov 2019 17:03:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477Xsl3ZMTz4MMV; Wed, 6 Nov 2019 17:03:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E158332; Wed, 6 Nov 2019 17:03:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA6H37v6054420; Wed, 6 Nov 2019 17:03:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA6H371C054419; Wed, 6 Nov 2019 17:03:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911061703.xA6H371C054419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 6 Nov 2019 17:03:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354402 - head/sys/dev/ksyms X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/ksyms X-SVN-Commit-Revision: 354402 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 17:03:07 -0000 Author: markj Date: Wed Nov 6 17:03:06 2019 New Revision: 354402 URL: https://svnweb.freebsd.org/changeset/base/354402 Log: Convert ksyms(4) to use an OBJT_PHYS object. The pages stored in the ksyms object are not pageable. Moreover, this obviates the need to set OBJ_NOSPLIT. Reviewed by: alc, kib MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22229 Modified: head/sys/dev/ksyms/ksyms.c Modified: head/sys/dev/ksyms/ksyms.c ============================================================================== --- head/sys/dev/ksyms/ksyms.c Wed Nov 6 17:01:35 2019 (r354401) +++ head/sys/dev/ksyms/ksyms.c Wed Nov 6 17:03:06 2019 (r354402) @@ -442,9 +442,8 @@ ksyms_open(struct cdev *dev, int flags, int fmt __unus ksyms_size_calc(&ts); elfsz = sizeof(struct ksyms_hdr) + ts.ts_symsz + ts.ts_strsz; - object = vm_object_allocate(OBJT_DEFAULT, + object = vm_object_allocate(OBJT_PHYS, OFF_TO_IDX(round_page(elfsz))); - vm_object_set_flag(object, OBJ_NOSPLIT); sc->sc_obj = object; sc->sc_objsz = elfsz; From owner-svn-src-head@freebsd.org Wed Nov 6 18:39:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 215D61BCD96; Wed, 6 Nov 2019 18:39:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477b1104Mdz4TTR; Wed, 6 Nov 2019 18:39:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA38A141C; Wed, 6 Nov 2019 18:39:32 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA6IdWWd012949; Wed, 6 Nov 2019 18:39:32 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA6IdW2J012948; Wed, 6 Nov 2019 18:39:32 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201911061839.xA6IdW2J012948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 6 Nov 2019 18:39:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354407 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 354407 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 18:39:33 -0000 Author: manu Date: Wed Nov 6 18:39:32 2019 New Revision: 354407 URL: https://svnweb.freebsd.org/changeset/base/354407 Log: arm64: allwinner: a64: Do not init the video related clocks This should be handled by the video drivers and this break EFIFB as this changes clock setup by the bootloader. MFC after: 1 month Modified: head/sys/arm/allwinner/clkng/ccu_a64.c Modified: head/sys/arm/allwinner/clkng/ccu_a64.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a64.c Wed Nov 6 18:15:20 2019 (r354406) +++ head/sys/arm/allwinner/clkng/ccu_a64.c Wed Nov 6 18:39:32 2019 (r354407) @@ -789,10 +789,6 @@ static struct aw_clk_init a64_init_clks[] = { {"ahb1", "pll_periph0", 0, false}, {"ahb2", "pll_periph0", 0, false}, {"dram", "pll_ddr0", 0, false}, - {"pll_de", NULL, 432000000, true}, - {"de", "pll_de", 0, true}, - {"tcon0", "pll_video0-2x", 0, false}, - {"tcon1", "pll_video1", 0, false}, }; static int From owner-svn-src-head@freebsd.org Wed Nov 6 18:54:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5414C1BD3FC; Wed, 6 Nov 2019 18:54:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477bKn1X3rz4VTm; Wed, 6 Nov 2019 18:54:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17A4E17D8; Wed, 6 Nov 2019 18:54:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA6Is4TG024530; Wed, 6 Nov 2019 18:54:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA6Is4v1024529; Wed, 6 Nov 2019 18:54:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201911061854.xA6Is4v1024529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 6 Nov 2019 18:54:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354408 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 354408 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 18:54:05 -0000 Author: imp Date: Wed Nov 6 18:54:04 2019 New Revision: 354408 URL: https://svnweb.freebsd.org/changeset/base/354408 Log: Remove obsolete addition of MACHINE_CPUARCH In the past, we would add symbolic links for MACHINE_CPUARCH when it differed from MACHINE. This was for pc98 only, however. All other architectures didn't need this and it was really due to pc98 pulling from i386 rather than something more intrinsic. At the time, we had the split we did to mimic what NetBSD did for its 68k ports where many different kernels were possible for the same architecture. Since then, both projects have moved away from this convention to having a more generic MACHINE for each architecture. FreeBSD's new arm64/aarch64 breaks this old notion and so was an exception to the rule. So, we no longer need to create this link for any old machine or any new machine, delete it entirely. Differential Revision: https://reviews.freebsd.org/D22246 Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Wed Nov 6 18:39:32 2019 (r354407) +++ head/sys/conf/kmod.mk Wed Nov 6 18:54:04 2019 (r354408) @@ -283,9 +283,6 @@ _MAP_DEBUG_PREFIX= yes .endif _ILINKS=machine -.if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64" -_ILINKS+=${MACHINE_CPUARCH} -.endif .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" _ILINKS+=x86 .endif From owner-svn-src-head@freebsd.org Wed Nov 6 19:44:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFB081BE376; Wed, 6 Nov 2019 19:44:45 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477cSF40J5z4Xvc; Wed, 6 Nov 2019 19:44:45 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6146A20F5; Wed, 6 Nov 2019 19:44:45 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA6JijPw055314; Wed, 6 Nov 2019 19:44:45 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA6Jijg5055313; Wed, 6 Nov 2019 19:44:45 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201911061944.xA6Jijg5055313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 6 Nov 2019 19:44:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354409 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 354409 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 19:44:45 -0000 Author: brooks Date: Wed Nov 6 19:44:44 2019 New Revision: 354409 URL: https://svnweb.freebsd.org/changeset/base/354409 Log: libstats: Improve ABI assertion. On platforms where pointers are larger than 64-bits, struct statsblob may be harmlessly padded out such that opaque[] always has some included space. Make the assertion more general by comparing to the offset of opaque rather than the size of struct statsblob. Discussed with: jhb, James Clarke Reviewed by: trasz, lstewart Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22188 Modified: head/sys/kern/subr_stats.c Modified: head/sys/kern/subr_stats.c ============================================================================== --- head/sys/kern/subr_stats.c Wed Nov 6 18:54:04 2019 (r354408) +++ head/sys/kern/subr_stats.c Wed Nov 6 19:44:44 2019 (r354409) @@ -124,7 +124,8 @@ struct statsblobv1 { struct voi vois[]; /* Array indexed by [voi_id]. */ } __aligned(sizeof(void *)); _Static_assert(offsetof(struct statsblobv1, cursz) + - SIZEOF_MEMBER(struct statsblobv1, cursz) == sizeof(struct statsblob), + SIZEOF_MEMBER(struct statsblobv1, cursz) == + offsetof(struct statsblob, opaque), "statsblobv1 ABI mismatch"); struct statsblobv1_tpl { From owner-svn-src-head@freebsd.org Wed Nov 6 19:51:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 315C71BE46B; Wed, 6 Nov 2019 19:51:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477ccF1JT5z4YGb; Wed, 6 Nov 2019 19:51:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1136A2179; Wed, 6 Nov 2019 19:51:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA6Jpf4o060161; Wed, 6 Nov 2019 19:51:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA6JpffX060159; Wed, 6 Nov 2019 19:51:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911061951.xA6JpffX060159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 Nov 2019 19:51:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354410 - in head/sys: dev/mgb modules/mgb X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: dev/mgb modules/mgb X-SVN-Commit-Revision: 354410 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 19:51:41 -0000 Author: emaste Date: Wed Nov 6 19:51:40 2019 New Revision: 354410 URL: https://svnweb.freebsd.org/changeset/base/354410 Log: Introduce if_mgb driver for Microchip LAN743x PCIe NIC The Microchip LAN7430 is a PCIe 10/100/1000 Ethernet MAC with integrated PHY, and the LAN7431 is a MAC with RGMII interface. To be connected to the build after further testing and review. Committing now so that changes like r354345 (adding a common ETHER_IS_ZERO macro) will update this driver too. Submitted by: Gerald ND Aryeetey Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20079 Added: head/sys/dev/mgb/ head/sys/dev/mgb/if_mgb.c (contents, props changed) head/sys/dev/mgb/if_mgb.h (contents, props changed) head/sys/modules/mgb/ head/sys/modules/mgb/Makefile (contents, props changed) Added: head/sys/dev/mgb/if_mgb.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mgb/if_mgb.c Wed Nov 6 19:51:40 2019 (r354410) @@ -0,0 +1,1634 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 The FreeBSD Foundation, Inc. + * + * This driver was written by Gerald ND Aryeetey + * 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 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$"); + +/* + * Microchip LAN7430/LAN7431 PCIe to Gigabit Ethernet Controller driver. + * + * Product information: + * LAN7430 https://www.microchip.com/wwwproducts/en/LAN7430 + * - Integrated IEEE 802.3 compliant PHY + * LAN7431 https://www.microchip.com/wwwproducts/en/LAN7431 + * - RGMII Interface + * + * This driver uses the iflib interface and the default 'ukphy' PHY driver. + * + * UNIMPLEMENTED FEATURES + * ---------------------- + * A number of features supported by LAN743X device are not yet implemented in + * this driver: + * + * - Multiple (up to 4) RX queues support + * - Just needs to remove asserts and malloc multiple `rx_ring_data` + * structs based on ncpus. + * - RX/TX Checksum Offloading support + * - VLAN support + * - Recieve Packet Filtering (Multicast Perfect/Hash Address) support + * - Wake on LAN (WoL) support + * - TX LSO support + * - Recieve Side Scaling (RSS) support + * - Debugging Capabilities: + * - Could include MAC statistics and + * error status registers in sysctl. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "ifdi_if.h" +#include "miibus_if.h" + +static pci_vendor_info_t mgb_vendor_info_array[] = { + PVID(MGB_MICROCHIP_VENDOR_ID, MGB_LAN7430_DEVICE_ID, + "Microchip LAN7430 PCIe Gigabit Ethernet Controller"), + PVID(MGB_MICROCHIP_VENDOR_ID, MGB_LAN7431_DEVICE_ID, + "Microchip LAN7431 PCIe Gigabit Ethernet Controller"), + PVID_END +}; + +/* Device methods */ +static device_register_t mgb_register; + +/* IFLIB methods */ +static ifdi_attach_pre_t mgb_attach_pre; +static ifdi_attach_post_t mgb_attach_post; +static ifdi_detach_t mgb_detach; + +static ifdi_tx_queues_alloc_t mgb_tx_queues_alloc; +static ifdi_rx_queues_alloc_t mgb_rx_queues_alloc; +static ifdi_queues_free_t mgb_queues_free; + +static ifdi_init_t mgb_init; +static ifdi_stop_t mgb_stop; + +static ifdi_msix_intr_assign_t mgb_msix_intr_assign; +static ifdi_tx_queue_intr_enable_t mgb_tx_queue_intr_enable; +static ifdi_rx_queue_intr_enable_t mgb_rx_queue_intr_enable; +static ifdi_intr_enable_t mgb_intr_enable_all; +static ifdi_intr_disable_t mgb_intr_disable_all; + +/* IFLIB_TXRX methods */ +static int mgb_isc_txd_encap(void *, + if_pkt_info_t); +static void mgb_isc_txd_flush(void *, + uint16_t, qidx_t); +static int mgb_isc_txd_credits_update(void *, + uint16_t, bool); +static int mgb_isc_rxd_available(void *, + uint16_t, qidx_t, qidx_t); +static int mgb_isc_rxd_pkt_get(void *, + if_rxd_info_t); +static void mgb_isc_rxd_refill(void *, + if_rxd_update_t); +static void mgb_isc_rxd_flush(void *, + uint16_t, uint8_t, qidx_t); + +/* Interrupts */ +static driver_filter_t mgb_legacy_intr; +static driver_filter_t mgb_admin_intr; +static driver_filter_t mgb_rxq_intr; +static bool mgb_intr_test(struct mgb_softc *); + +/* MII methods */ +static miibus_readreg_t mgb_miibus_readreg; +static miibus_writereg_t mgb_miibus_writereg; +static miibus_linkchg_t mgb_miibus_linkchg; +static miibus_statchg_t mgb_miibus_statchg; + +static int mgb_media_change(if_t); +static void mgb_media_status(if_t, + struct ifmediareq *); + +/* Helper/Test functions */ +static int mgb_test_bar(struct mgb_softc *); +static int mgb_alloc_regs(struct mgb_softc *); +static int mgb_release_regs(struct mgb_softc *); + +static void mgb_get_ethaddr(struct mgb_softc *, + struct ether_addr *); + +static int mgb_wait_for_bits(struct mgb_softc *, + int, int, int); + +/* H/W init, reset and teardown helpers */ +static int mgb_hw_init(struct mgb_softc *); +static int mgb_hw_teardown(struct mgb_softc *); +static int mgb_hw_reset(struct mgb_softc *); +static int mgb_mac_init(struct mgb_softc *); +static int mgb_dmac_reset(struct mgb_softc *); +static int mgb_phy_reset(struct mgb_softc *); + +static int mgb_dma_init(struct mgb_softc *); +static int mgb_dma_tx_ring_init(struct mgb_softc *, + int); +static int mgb_dma_rx_ring_init(struct mgb_softc *, + int); + +static int mgb_dmac_control(struct mgb_softc *, + int, int, enum mgb_dmac_cmd); +static int mgb_fct_control(struct mgb_softc *, + int, int, enum mgb_fct_cmd); + +/********************************************************************* + * FreeBSD Device Interface Entry Points + *********************************************************************/ + +static device_method_t mgb_methods[] = { + /* Device interface */ + DEVMETHOD(device_register, mgb_register), + DEVMETHOD(device_probe, iflib_device_probe), + DEVMETHOD(device_attach, iflib_device_attach), + DEVMETHOD(device_detach, iflib_device_detach), + DEVMETHOD(device_shutdown, iflib_device_shutdown), + DEVMETHOD(device_suspend, iflib_device_suspend), + DEVMETHOD(device_resume, iflib_device_resume), + + /* MII Interface */ + DEVMETHOD(miibus_readreg, mgb_miibus_readreg), + DEVMETHOD(miibus_writereg, mgb_miibus_writereg), + DEVMETHOD(miibus_linkchg, mgb_miibus_linkchg), + DEVMETHOD(miibus_statchg, mgb_miibus_statchg), + + DEVMETHOD_END +}; + +static driver_t mgb_driver = { + "mgb", mgb_methods, sizeof(struct mgb_softc) +}; + +devclass_t mgb_devclass; +DRIVER_MODULE(mgb, pci, mgb_driver, mgb_devclass, NULL, NULL); +IFLIB_PNP_INFO(pci, mgb, mgb_vendor_info_array); +MODULE_VERSION(mgb, 1); + +#if 0 /* MIIBUS_DEBUG */ +/* If MIIBUS debug stuff is in attach then order matters. Use below instead. */ +DRIVER_MODULE_ORDERED(miibus, mgb, miibus_driver, miibus_devclass, NULL, NULL, + SI_ORDER_ANY); +#endif /* MIIBUS_DEBUG */ +DRIVER_MODULE(miibus, mgb, miibus_driver, miibus_devclass, NULL, NULL); + +MODULE_DEPEND(mgb, pci, 1, 1, 1); +MODULE_DEPEND(mgb, ether, 1, 1, 1); +MODULE_DEPEND(mgb, miibus, 1, 1, 1); +MODULE_DEPEND(mgb, iflib, 1, 1, 1); + +static device_method_t mgb_iflib_methods[] = { + DEVMETHOD(ifdi_attach_pre, mgb_attach_pre), + DEVMETHOD(ifdi_attach_post, mgb_attach_post), + DEVMETHOD(ifdi_detach, mgb_detach), + + DEVMETHOD(ifdi_init, mgb_init), + DEVMETHOD(ifdi_stop, mgb_stop), + + DEVMETHOD(ifdi_tx_queues_alloc, mgb_tx_queues_alloc), + DEVMETHOD(ifdi_rx_queues_alloc, mgb_rx_queues_alloc), + DEVMETHOD(ifdi_queues_free, mgb_queues_free), + + DEVMETHOD(ifdi_msix_intr_assign, mgb_msix_intr_assign), + DEVMETHOD(ifdi_tx_queue_intr_enable, mgb_tx_queue_intr_enable), + DEVMETHOD(ifdi_rx_queue_intr_enable, mgb_rx_queue_intr_enable), + DEVMETHOD(ifdi_intr_enable, mgb_intr_enable_all), + DEVMETHOD(ifdi_intr_disable, mgb_intr_disable_all), + + +#if 0 /* Not yet implemented IFLIB methods */ + /* + * Set multicast addresses, mtu and promiscuous mode + */ + DEVMETHOD(ifdi_multi_set, mgb_multi_set), + DEVMETHOD(ifdi_mtu_set, mgb_mtu_set), + DEVMETHOD(ifdi_promisc_set, mgb_promisc_set), + + /* + * Needed for VLAN support + */ + DEVMETHOD(ifdi_vlan_register, mgb_vlan_register), + DEVMETHOD(ifdi_vlan_unregister, mgb_vlan_unregister), + + /* + * Needed for WOL support + * at the very least. + */ + DEVMETHOD(ifdi_shutdown, mgb_shutdown), + DEVMETHOD(ifdi_suspend, mgb_suspend), + DEVMETHOD(ifdi_resume, mgb_resume), +#endif /* UNUSED_IFLIB_METHODS */ + DEVMETHOD_END +}; + +static driver_t mgb_iflib_driver = { + "mgb", mgb_iflib_methods, sizeof(struct mgb_softc) +}; + +struct if_txrx mgb_txrx = { + .ift_txd_encap = mgb_isc_txd_encap, + .ift_txd_flush = mgb_isc_txd_flush, + .ift_txd_credits_update = mgb_isc_txd_credits_update, + .ift_rxd_available = mgb_isc_rxd_available, + .ift_rxd_pkt_get = mgb_isc_rxd_pkt_get, + .ift_rxd_refill = mgb_isc_rxd_refill, + .ift_rxd_flush = mgb_isc_rxd_flush, + + .ift_legacy_intr = mgb_legacy_intr +}; + +struct if_shared_ctx mgb_sctx_init = { + .isc_magic = IFLIB_MAGIC, + + .isc_q_align = PAGE_SIZE, + .isc_admin_intrcnt = 1, + .isc_flags = IFLIB_DRIVER_MEDIA /* | IFLIB_HAS_RXCQ | IFLIB_HAS_TXCQ*/, + + .isc_vendor_info = mgb_vendor_info_array, + .isc_driver_version = "1", + .isc_driver = &mgb_iflib_driver, + /* 2 queues per set for TX and RX (ring queue, head writeback queue) */ + .isc_ntxqs = 2, + + .isc_tx_maxsize = MGB_DMA_MAXSEGS * MCLBYTES, + /* .isc_tx_nsegments = MGB_DMA_MAXSEGS, */ + .isc_tx_maxsegsize = MCLBYTES, + + .isc_ntxd_min = {1, 1}, /* Will want to make this bigger */ + .isc_ntxd_max = {MGB_DMA_RING_SIZE, 1}, + .isc_ntxd_default = {MGB_DMA_RING_SIZE, 1}, + + .isc_nrxqs = 2, + + .isc_rx_maxsize = MCLBYTES, + .isc_rx_nsegments = 1, + .isc_rx_maxsegsize = MCLBYTES, + + .isc_nrxd_min = {1, 1}, /* Will want to make this bigger */ + .isc_nrxd_max = {MGB_DMA_RING_SIZE, 1}, + .isc_nrxd_default = {MGB_DMA_RING_SIZE, 1}, + + .isc_nfl = 1, /*one free list since there is only one queue */ +#if 0 /* UNUSED_CTX */ + + .isc_tso_maxsize = MGB_TSO_MAXSIZE + sizeof(struct ether_vlan_header), + .isc_tso_maxsegsize = MGB_TX_MAXSEGSIZE, +#endif /* UNUSED_CTX */ +}; + +/*********************************************************************/ + + +static void * +mgb_register(device_t dev) +{ + + return (&mgb_sctx_init); +} + +static int +mgb_attach_pre(if_ctx_t ctx) +{ + struct mgb_softc *sc; + if_softc_ctx_t scctx; + int error, phyaddr, rid; + struct ether_addr hwaddr; + struct mii_data *miid; + + sc = iflib_get_softc(ctx); + sc->ctx = ctx; + sc->dev = iflib_get_dev(ctx); + scctx = iflib_get_softc_ctx(ctx); + + /* IFLIB required setup */ + scctx->isc_txrx = &mgb_txrx; + scctx->isc_tx_nsegments = MGB_DMA_MAXSEGS; + /* Ring desc queues */ + scctx->isc_txqsizes[0] = sizeof(struct mgb_ring_desc) * + scctx->isc_ntxd[0]; + scctx->isc_rxqsizes[0] = sizeof(struct mgb_ring_desc) * + scctx->isc_nrxd[0]; + + /* Head WB queues */ + scctx->isc_txqsizes[1] = sizeof(uint32_t) * scctx->isc_ntxd[1]; + scctx->isc_rxqsizes[1] = sizeof(uint32_t) * scctx->isc_nrxd[1]; + + /* XXX: Must have 1 txqset, but can have up to 4 rxqsets */ + scctx->isc_nrxqsets = 1; + scctx->isc_ntxqsets = 1; + + /* scctx->isc_tx_csum_flags = (CSUM_TCP | CSUM_UDP) | + (CSUM_TCP_IPV6 | CSUM_UDP_IPV6) | CSUM_TSO */ + scctx->isc_tx_csum_flags = 0; + scctx->isc_capabilities = scctx->isc_capenable = 0; +#if 0 + /* + * CSUM, TSO and VLAN support are TBD + */ + IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6 | + IFCAP_TSO4 | IFCAP_TSO6 | + IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6 | + IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | + IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO | + IFCAP_JUMBO_MTU; + scctx->isc_capabilities |= IFCAP_LRO | IFCAP_VLAN_HWFILTER; +#endif + + /* get the BAR */ + error = mgb_alloc_regs(sc); + if (error != 0) { + device_printf(sc->dev, + "Unable to allocate bus resource: registers.\n"); + goto fail; + } + + error = mgb_test_bar(sc); + if (error != 0) + goto fail; + + error = mgb_hw_init(sc); + if (error != 0) { + device_printf(sc->dev, + "MGB device init failed. (err: %d)\n", error); + goto fail; + } + + switch (pci_get_device(sc->dev)) + { + case MGB_LAN7430_DEVICE_ID: + phyaddr = 1; + break; + case MGB_LAN7431_DEVICE_ID: + default: + phyaddr = MII_PHY_ANY; + break; + } + + /* XXX: Would be nice(r) if locked methods were here */ + error = mii_attach(sc->dev, &sc->miibus, iflib_get_ifp(ctx), + mgb_media_change, mgb_media_status, + BMSR_DEFCAPMASK, phyaddr, MII_OFFSET_ANY, MIIF_DOPAUSE); + if (error != 0) { + device_printf(sc->dev, "Failed to attach MII interface\n"); + goto fail; + } + + miid = device_get_softc(sc->miibus); + scctx->isc_media = &miid->mii_media; + + scctx->isc_msix_bar = pci_msix_table_bar(sc->dev); + /** Setup PBA BAR **/ + rid = pci_msix_pba_bar(sc->dev); + if (rid != scctx->isc_msix_bar) { + sc->pba = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); + if (sc->pba == NULL) { + error = ENXIO; + device_printf(sc->dev, "Failed to setup PBA BAR\n"); + goto fail; + } + } + + mgb_get_ethaddr(sc, &hwaddr); + if (ETHER_IS_BROADCAST(hwaddr.octet) || + ETHER_IS_MULTICAST(hwaddr.octet) || + ETHER_IS_ZERO(hwaddr.octet)) + ether_gen_addr(iflib_get_ifp(ctx), &hwaddr); + + /* + * XXX: if the MAC address was generated the linux driver + * writes it back to the device. + */ + iflib_set_mac(ctx, hwaddr.octet); + + /* Map all vectors to vector 0 (admin interrupts) by default. */ + CSR_WRITE_REG(sc, MGB_INTR_VEC_RX_MAP, 0); + CSR_WRITE_REG(sc, MGB_INTR_VEC_TX_MAP, 0); + CSR_WRITE_REG(sc, MGB_INTR_VEC_OTHER_MAP, 0); + + return (0); + +fail: + mgb_detach(ctx); + return (error); +} + +static int +mgb_attach_post(if_ctx_t ctx) +{ + struct mgb_softc *sc; + + sc = iflib_get_softc(ctx); + + device_printf(sc->dev, "Interrupt test: %s\n", + (mgb_intr_test(sc) ? "PASS" : "FAIL")); + + return (0); +} + +static int +mgb_detach(if_ctx_t ctx) +{ + struct mgb_softc *sc; + int error; + + sc = iflib_get_softc(ctx); + + /* XXX: Should report errors but still detach everything. */ + error = mgb_hw_teardown(sc); + + /* Release IRQs */ + iflib_irq_free(ctx, &sc->rx_irq); + iflib_irq_free(ctx, &sc->admin_irq); + + if (sc->miibus != NULL) + device_delete_child(sc->dev, sc->miibus); + + if (sc->pba != NULL) + error = bus_release_resource(sc->dev, SYS_RES_MEMORY, + rman_get_rid(sc->pba), sc->pba); + sc->pba = NULL; + + error = mgb_release_regs(sc); + + return (error); +} + +static int +mgb_media_change(if_t ifp) +{ + struct mii_data *miid; + struct mii_softc *miisc; + struct mgb_softc *sc; + if_ctx_t ctx; + int needs_reset; + + ctx = if_getsoftc(ifp); + sc = iflib_get_softc(ctx); + miid = device_get_softc(sc->miibus); + LIST_FOREACH(miisc, &miid->mii_phys, mii_list) + PHY_RESET(miisc); + + needs_reset = mii_mediachg(miid); + if (needs_reset != 0) + ifp->if_init(ctx); + return (needs_reset); +} + +static void +mgb_media_status(if_t ifp, struct ifmediareq *ifmr) +{ + struct mgb_softc *sc; + struct mii_data *miid; + + sc = iflib_get_softc(if_getsoftc(ifp)); + miid = device_get_softc(sc->miibus); + if ((if_getflags(ifp) & IFF_UP) == 0) + return; + + mii_pollstat(miid); + ifmr->ifm_active = miid->mii_media_active; + ifmr->ifm_status = miid->mii_media_status; +} + +static int +mgb_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, int ntxqs, + int ntxqsets) +{ + struct mgb_softc *sc; + struct mgb_ring_data *rdata; + int q; + + sc = iflib_get_softc(ctx); + KASSERT(ntxqsets == 1, ("ntxqsets = %d", ntxqsets)); + rdata = &sc->tx_ring_data; + for (q = 0; q < ntxqsets; q++) { + KASSERT(ntxqs == 2, ("ntxqs = %d", ntxqs)); + /* Ring */ + rdata->ring = (struct mgb_ring_desc *) vaddrs[q * ntxqs + 0]; + rdata->ring_bus_addr = paddrs[q * ntxqs + 0]; + + /* Head WB */ + rdata->head_wb = (uint32_t *) vaddrs[q * ntxqs + 1]; + rdata->head_wb_bus_addr = paddrs[q * ntxqs + 1]; + } + return 0; +} + +static int +mgb_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, int nrxqs, + int nrxqsets) +{ + struct mgb_softc *sc; + struct mgb_ring_data *rdata; + int q; + + sc = iflib_get_softc(ctx); + KASSERT(nrxqsets == 1, ("nrxqsets = %d", nrxqsets)); + rdata = &sc->rx_ring_data; + for (q = 0; q < nrxqsets; q++) { + KASSERT(nrxqs == 2, ("nrxqs = %d", nrxqs)); + /* Ring */ + rdata->ring = (struct mgb_ring_desc *) vaddrs[q * nrxqs + 0]; + rdata->ring_bus_addr = paddrs[q * nrxqs + 0]; + + /* Head WB */ + rdata->head_wb = (uint32_t *) vaddrs[q * nrxqs + 1]; + rdata->head_wb_bus_addr = paddrs[q * nrxqs + 1]; + } + return 0; +} + +static void +mgb_queues_free(if_ctx_t ctx) +{ + struct mgb_softc *sc; + + sc = iflib_get_softc(ctx); + + memset(&sc->rx_ring_data, 0, sizeof(struct mgb_ring_data)); + memset(&sc->tx_ring_data, 0, sizeof(struct mgb_ring_data)); +} + +static void +mgb_init(if_ctx_t ctx) +{ + struct mgb_softc *sc; + struct mii_data *miid; + int error; + + sc = iflib_get_softc(ctx); + miid = device_get_softc(sc->miibus); + device_printf(sc->dev, "running init ...\n"); + + mgb_dma_init(sc); + + /* XXX: Turn off perfect filtering, turn on (broad|multi|uni)cast rx */ + CSR_CLEAR_REG(sc, MGB_RFE_CTL, MGB_RFE_ALLOW_PERFECT_FILTER); + CSR_UPDATE_REG(sc, MGB_RFE_CTL, + MGB_RFE_ALLOW_BROADCAST | + MGB_RFE_ALLOW_UNICAST | + MGB_RFE_ALLOW_UNICAST); + + error = mii_mediachg(miid); + KASSERT(!error, ("mii_mediachg returned: %d", error)); +} + +#ifdef DEBUG +static void +mgb_dump_some_stats(struct mgb_softc *sc) +{ + int i; + int first_stat = 0x1200; + int last_stat = 0x12FC; + + for (i = first_stat; i <= last_stat; i += 4) + if (CSR_READ_REG(sc, i) != 0) + device_printf(sc->dev, "0x%04x: 0x%08x\n", i, + CSR_READ_REG(sc, i)); + char *stat_names[] = { + "MAC_ERR_STS ", + "FCT_INT_STS ", + "DMAC_CFG ", + "DMAC_CMD ", + "DMAC_INT_STS ", + "DMAC_INT_EN ", + "DMAC_RX_ERR_STS0 ", + "DMAC_RX_ERR_STS1 ", + "DMAC_RX_ERR_STS2 ", + "DMAC_RX_ERR_STS3 ", + "INT_STS ", + "INT_EN ", + "INT_VEC_EN ", + "INT_VEC_MAP0 ", + "INT_VEC_MAP1 ", + "INT_VEC_MAP2 ", + "TX_HEAD0", + "TX_TAIL0", + "DMAC_TX_ERR_STS0 ", + NULL + }; + int stats[] = { + 0x114, + 0xA0, + 0xC00, + 0xC0C, + 0xC10, + 0xC14, + 0xC60, + 0xCA0, + 0xCE0, + 0xD20, + 0x780, + 0x788, + 0x794, + 0x7A0, + 0x7A4, + 0x780, + 0xD58, + 0xD5C, + 0xD60, + 0x0 + }; + i = 0; + printf("==============================\n"); + while (stats[i++]) + device_printf(sc->dev, "%s at offset 0x%04x = 0x%08x\n", + stat_names[i - 1], stats[i - 1], + CSR_READ_REG(sc, stats[i - 1])); + printf("==== TX RING DESCS ====\n"); + for (i = 0; i < MGB_DMA_RING_SIZE; i++) + device_printf(sc->dev, "ring[%d].data0=0x%08x\n" + "ring[%d].data1=0x%08x\n" + "ring[%d].data2=0x%08x\n" + "ring[%d].data3=0x%08x\n", + i, sc->tx_ring_data.ring[i].ctl, + i, sc->tx_ring_data.ring[i].addr.low, + i, sc->tx_ring_data.ring[i].addr.high, + i, sc->tx_ring_data.ring[i].sts); + device_printf(sc->dev, "==== DUMP_TX_DMA_RAM ====\n"); + int i; + CSR_WRITE_REG(sc, 0x24, 0xF); // DP_SEL & TX_RAM_0 + for (i = 0; i < 128; i++) { + CSR_WRITE_REG(sc, 0x2C, i); // DP_ADDR + + CSR_WRITE_REG(sc, 0x28, 0); // DP_CMD + + while ((CSR_READ_REG(sc, 0x24) & 0x80000000) == 0) // DP_SEL & READY + DELAY(1000); + + device_printf(sc->dev, "DMAC_TX_RAM_0[%u]=%08x\n", i, + CSR_READ_REG(sc, 0x30)); // DP_DATA + } +} +#endif + +static void +mgb_stop(if_ctx_t ctx) +{ + struct mgb_softc *sc ; + if_softc_ctx_t scctx; + int i; + + sc = iflib_get_softc(ctx); + scctx = iflib_get_softc_ctx(ctx); + + /* XXX: Could potentially timeout */ + for (i = 0; i < scctx->isc_nrxqsets; i++) { + mgb_dmac_control(sc, MGB_DMAC_RX_START, 0, DMAC_STOP); + mgb_fct_control(sc, MGB_FCT_RX_CTL, 0, FCT_DISABLE); + } + for (i = 0; i < scctx->isc_ntxqsets; i++) { + mgb_dmac_control(sc, MGB_DMAC_TX_START, 0, DMAC_STOP); + mgb_fct_control(sc, MGB_FCT_TX_CTL, 0, FCT_DISABLE); + } +} + +static int +mgb_legacy_intr(void *xsc) +{ + struct mgb_softc *sc; + + sc = xsc; + iflib_admin_intr_deferred(sc->ctx); + return (FILTER_HANDLED); +} + +static int +mgb_rxq_intr(void *xsc) +{ + struct mgb_softc *sc; + if_softc_ctx_t scctx; + uint32_t intr_sts, intr_en; + int qidx; + + sc = xsc; + scctx = iflib_get_softc_ctx(sc->ctx); + + intr_sts = CSR_READ_REG(sc, MGB_INTR_STS); + intr_en = CSR_READ_REG(sc, MGB_INTR_ENBL_SET); + intr_sts &= intr_en; + + for (qidx = 0; qidx < scctx->isc_nrxqsets; qidx++) { + if ((intr_sts & MGB_INTR_STS_RX(qidx))){ + CSR_WRITE_REG(sc, MGB_INTR_ENBL_CLR, + MGB_INTR_STS_RX(qidx)); + CSR_WRITE_REG(sc, MGB_INTR_STS, MGB_INTR_STS_RX(qidx)); + } + } + return (FILTER_SCHEDULE_THREAD); +} + +static int +mgb_admin_intr(void *xsc) +{ + struct mgb_softc *sc; + if_softc_ctx_t scctx; + uint32_t intr_sts, intr_en; + int qidx; + + sc = xsc; + scctx = iflib_get_softc_ctx(sc->ctx); + + intr_sts = CSR_READ_REG(sc, MGB_INTR_STS); + intr_en = CSR_READ_REG(sc, MGB_INTR_ENBL_SET); + intr_sts &= intr_en; + + /* + * NOTE: Debugging printfs here + * will likely cause interrupt test failure. + */ + + /* TODO: shouldn't continue if suspended */ + if ((intr_sts & MGB_INTR_STS_ANY) == 0) + { + device_printf(sc->dev, "non-mgb interrupt triggered.\n"); + return (FILTER_SCHEDULE_THREAD); + } + if ((intr_sts & MGB_INTR_STS_TEST) != 0) + { + sc->isr_test_flag = true; + CSR_WRITE_REG(sc, MGB_INTR_STS, MGB_INTR_STS_TEST); + return (FILTER_HANDLED); + } + if ((intr_sts & MGB_INTR_STS_RX_ANY) != 0) + { + for (qidx = 0; qidx < scctx->isc_nrxqsets; qidx++) { + if ((intr_sts & MGB_INTR_STS_RX(qidx))){ + iflib_rx_intr_deferred(sc->ctx, qidx); + } + } + return (FILTER_HANDLED); + } + /* XXX: TX interrupts should not occur */ + if ((intr_sts & MGB_INTR_STS_TX_ANY) != 0) + { + for (qidx = 0; qidx < scctx->isc_ntxqsets; qidx++) { + if ((intr_sts & MGB_INTR_STS_RX(qidx))) { + /* clear the interrupt sts and run handler */ + CSR_WRITE_REG(sc, MGB_INTR_ENBL_CLR, + MGB_INTR_STS_TX(qidx)); + CSR_WRITE_REG(sc, MGB_INTR_STS, + MGB_INTR_STS_TX(qidx)); + iflib_tx_intr_deferred(sc->ctx, qidx); + } + } + return (FILTER_HANDLED); + } + + return (FILTER_SCHEDULE_THREAD); +} + +static int +mgb_msix_intr_assign(if_ctx_t ctx, int msix) +{ + struct mgb_softc *sc; + if_softc_ctx_t scctx; + int error, i, vectorid; + char irq_name[16]; + + sc = iflib_get_softc(ctx); + scctx = iflib_get_softc_ctx(ctx); + + KASSERT(scctx->isc_nrxqsets == 1 && scctx->isc_ntxqsets == 1, + ("num rxqsets/txqsets != 1 ")); + + /* + * First vector should be admin interrupts, others vectors are TX/RX + * + * RIDs start at 1, and vector ids start at 0. + */ + vectorid = 0; + error = iflib_irq_alloc_generic(ctx, &sc->admin_irq, vectorid + 1, + IFLIB_INTR_ADMIN, mgb_admin_intr, sc, 0, "admin"); + if (error) { + device_printf(sc->dev, + "Failed to register admin interrupt handler\n"); + return (error); + } + + for (i = 0; i < scctx->isc_nrxqsets; i++) { + vectorid++; + snprintf(irq_name, sizeof(irq_name), "rxq%d", i); + error = iflib_irq_alloc_generic(ctx, &sc->rx_irq, vectorid + 1, + IFLIB_INTR_RX, mgb_rxq_intr, sc, i, irq_name); + if (error) { + device_printf(sc->dev, + "Failed to register rxq %d interrupt handler\n", i); + return (error); + } + CSR_UPDATE_REG(sc, MGB_INTR_VEC_RX_MAP, + MGB_INTR_VEC_MAP(vectorid, i)); + } + + /* Not actually mapping hw TX interrupts ... */ + for (i = 0; i < scctx->isc_ntxqsets; i++) { + snprintf(irq_name, sizeof(irq_name), "txq%d", i); + iflib_softirq_alloc_generic(ctx, NULL, IFLIB_INTR_TX, NULL, i, + irq_name); + } + + return (0); +} + +static void +mgb_intr_enable_all(if_ctx_t ctx) +{ + struct mgb_softc *sc; + if_softc_ctx_t scctx; + int i, dmac_enable = 0, intr_sts = 0, vec_en = 0; + + sc = iflib_get_softc(ctx); + scctx = iflib_get_softc_ctx(ctx); + intr_sts |= MGB_INTR_STS_ANY; + vec_en |= MGB_INTR_STS_ANY; + + for (i = 0; i < scctx->isc_nrxqsets; i++) { + intr_sts |= MGB_INTR_STS_RX(i); + dmac_enable |= MGB_DMAC_RX_INTR_ENBL(i); + vec_en |= MGB_INTR_RX_VEC_STS(i); + } + + /* TX interrupts aren't needed ... */ + + CSR_WRITE_REG(sc, MGB_INTR_ENBL_SET, intr_sts); + CSR_WRITE_REG(sc, MGB_INTR_VEC_ENBL_SET, vec_en); + CSR_WRITE_REG(sc, MGB_DMAC_INTR_STS, dmac_enable); + CSR_WRITE_REG(sc, MGB_DMAC_INTR_ENBL_SET, dmac_enable); +} + +static void +mgb_intr_disable_all(if_ctx_t ctx) +{ + struct mgb_softc *sc; + + sc = iflib_get_softc(ctx); + CSR_WRITE_REG(sc, MGB_INTR_ENBL_CLR, UINT32_MAX); + CSR_WRITE_REG(sc, MGB_INTR_VEC_ENBL_CLR, UINT32_MAX); + CSR_WRITE_REG(sc, MGB_INTR_STS, UINT32_MAX); + + CSR_WRITE_REG(sc, MGB_DMAC_INTR_ENBL_CLR, UINT32_MAX); + CSR_WRITE_REG(sc, MGB_DMAC_INTR_STS, UINT32_MAX); +} + +static int +mgb_rx_queue_intr_enable(if_ctx_t ctx, uint16_t qid) +{ + /* called after successful rx isr */ + struct mgb_softc *sc; + + sc = iflib_get_softc(ctx); + CSR_WRITE_REG(sc, MGB_INTR_VEC_ENBL_SET, MGB_INTR_RX_VEC_STS(qid)); + CSR_WRITE_REG(sc, MGB_INTR_ENBL_SET, MGB_INTR_STS_RX(qid)); + + CSR_WRITE_REG(sc, MGB_DMAC_INTR_STS, MGB_DMAC_RX_INTR_ENBL(qid)); + CSR_WRITE_REG(sc, MGB_DMAC_INTR_ENBL_SET, MGB_DMAC_RX_INTR_ENBL(qid)); + return (0); +} + +static int +mgb_tx_queue_intr_enable(if_ctx_t ctx, uint16_t qid) +{ + /* XXX: not called (since tx interrupts not used) */ + struct mgb_softc *sc; + + sc = iflib_get_softc(ctx); + + CSR_WRITE_REG(sc, MGB_INTR_ENBL_SET, MGB_INTR_STS_TX(qid)); + + CSR_WRITE_REG(sc, MGB_DMAC_INTR_STS, MGB_DMAC_TX_INTR_ENBL(qid)); + CSR_WRITE_REG(sc, MGB_DMAC_INTR_ENBL_SET, MGB_DMAC_TX_INTR_ENBL(qid)); + return (0); +} + +static bool +mgb_intr_test(struct mgb_softc *sc) +{ + int i; + + sc->isr_test_flag = false; + CSR_WRITE_REG(sc, MGB_INTR_STS, MGB_INTR_STS_TEST); + CSR_WRITE_REG(sc, MGB_INTR_VEC_ENBL_SET, MGB_INTR_STS_ANY); + CSR_WRITE_REG(sc, MGB_INTR_ENBL_SET, + MGB_INTR_STS_ANY | MGB_INTR_STS_TEST); + CSR_WRITE_REG(sc, MGB_INTR_SET, MGB_INTR_STS_TEST); + if (sc->isr_test_flag) + return true; + for (i = 0; i < MGB_TIMEOUT; i++) { + DELAY(10); + if (sc->isr_test_flag) + break; + } + CSR_WRITE_REG(sc, MGB_INTR_ENBL_CLR, MGB_INTR_STS_TEST); + CSR_WRITE_REG(sc, MGB_INTR_STS, MGB_INTR_STS_TEST); + return sc->isr_test_flag; +} + +static int +mgb_isc_txd_encap(void *xsc , if_pkt_info_t ipi) +{ + struct mgb_softc *sc; + if_softc_ctx_t scctx; + struct mgb_ring_data *rdata; + struct mgb_ring_desc *txd; + bus_dma_segment_t *segs; + qidx_t pidx, nsegs; + int i; + + KASSERT(ipi->ipi_qsidx == 0, + ("tried to refill TX Channel %d.\n", ipi->ipi_qsidx)); + sc = xsc; + scctx = iflib_get_softc_ctx(sc->ctx); + rdata = &sc->tx_ring_data; + + pidx = ipi->ipi_pidx; + segs = ipi->ipi_segs; + nsegs = ipi->ipi_nsegs; + + /* For each seg, create a descriptor */ + for (i = 0; i < nsegs; ++i) { + KASSERT(nsegs == 1, ("Multisegment packet !!!!!\n")); + txd = &rdata->ring[pidx]; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Nov 6 19:52:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 941001BE650; Wed, 6 Nov 2019 19:52:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477cdD3Tkyz4YT7; Wed, 6 Nov 2019 19:52:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4193722C9; Wed, 6 Nov 2019 19:52:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA6JqW81060872; Wed, 6 Nov 2019 19:52:32 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA6JqWtO060871; Wed, 6 Nov 2019 19:52:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911061952.xA6JqWtO060871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 Nov 2019 19:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354411 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 354411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 19:52:32 -0000 Author: emaste Date: Wed Nov 6 19:52:31 2019 New Revision: 354411 URL: https://svnweb.freebsd.org/changeset/base/354411 Log: Add mgb(4) (Microchip LAN783x PCIe NIC) man page Sponsored by: The FreeBSD Foundation Added: head/share/man/man4/mgb.4 (contents, props changed) Added: head/share/man/man4/mgb.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/mgb.4 Wed Nov 6 19:52:31 2019 (r354411) @@ -0,0 +1,86 @@ +.\" Copyright (c) 2019 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 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 May 2, 2019 +.Dt MGB 4 +.Os +.Sh NAME +.Nm mgb +.Nd "Microchip LAN743x PCIe Gigabit Ethernet driver" +.Sh SYNOPSIS +To load the driver as a module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_mgb_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +device driver provides support for PCIe Gigabit Ethernet adapters based on +Microchip's LAN7430 and LAN7431. +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh HARDWARE +The +.Nm +driver supports: +.Pp +.Bl -bullet -compact +.It +Microchip LAN7430 PCIe Gigabit Ethernet controller with PHY +.It +Microchip LAN7431 PCIe Gigabit Ethernet controller with RGMII interface +.El +.Sh SEE ALSO +.Xr arp 4 , +.Xr miibus 4 , +.Xr ifconfig 8 +.Sh CAVEATS +The driver does not yet implement support for many hardware features, +including: +.Bl -bullet -compact +.It +Multiple RX queue support +.It +RX and TX checksum offload +.It +Hardware VLAN tagging or untagging +.It +Multicast receive packet filtering +.It +Wake on LAN (WoL) +.It +LSO +.It +RSS +.El +.Pp +LAN7431 support is completely untested. +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 13.0 . From owner-svn-src-head@freebsd.org Wed Nov 6 20:43:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B1B61BFB65; Wed, 6 Nov 2019 20:43:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477dmD6Wylz4cJB; Wed, 6 Nov 2019 20:43:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C45452C18; Wed, 6 Nov 2019 20:43:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA6Khefh092200; Wed, 6 Nov 2019 20:43:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA6Khei1092198; Wed, 6 Nov 2019 20:43:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911062043.xA6Khei1092198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 6 Nov 2019 20:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354412 - head/sys/dev/mgb X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/mgb X-SVN-Commit-Revision: 354412 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 20:43:41 -0000 Author: emaste Date: Wed Nov 6 20:43:40 2019 New Revision: 354412 URL: https://svnweb.freebsd.org/changeset/base/354412 Log: mgb: Correct spello - recieve -> receive Reported by: N. J. Mann MFC with: r354410 Modified: head/sys/dev/mgb/if_mgb.c head/sys/dev/mgb/if_mgb.h Modified: head/sys/dev/mgb/if_mgb.c ============================================================================== --- head/sys/dev/mgb/if_mgb.c Wed Nov 6 19:52:31 2019 (r354411) +++ head/sys/dev/mgb/if_mgb.c Wed Nov 6 20:43:40 2019 (r354412) @@ -51,10 +51,10 @@ __FBSDID("$FreeBSD$"); * structs based on ncpus. * - RX/TX Checksum Offloading support * - VLAN support - * - Recieve Packet Filtering (Multicast Perfect/Hash Address) support + * - Receive Packet Filtering (Multicast Perfect/Hash Address) support * - Wake on LAN (WoL) support * - TX LSO support - * - Recieve Side Scaling (RSS) support + * - Receive Side Scaling (RSS) support * - Debugging Capabilities: * - Could include MAC statistics and * error status registers in sysctl. Modified: head/sys/dev/mgb/if_mgb.h ============================================================================== --- head/sys/dev/mgb/if_mgb.h Wed Nov 6 19:52:31 2019 (r354411) +++ head/sys/dev/mgb/if_mgb.h Wed Nov 6 20:43:40 2019 (r354412) @@ -75,7 +75,7 @@ #define MGB_MAC_STAT_RX_FRAME_CNT 0x1254 /* etc. */ -/** Recieve Filtering Engine **/ +/** Receive Filtering Engine **/ #define MGB_RFE_CTL 0x508 #define MGB_RFE_ALLOW_BROADCAST (1 << 10) #define MGB_RFE_ALLOW_MULTICAST (1 << 9) From owner-svn-src-head@freebsd.org Wed Nov 6 20:53:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A76D1BFF31; Wed, 6 Nov 2019 20:53:34 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477dzf2cyBz4cyX; Wed, 6 Nov 2019 20:53:34 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E8AC2DEF; Wed, 6 Nov 2019 20:53:34 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA6KrYMt099029; Wed, 6 Nov 2019 20:53:34 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA6KrXiQ099026; Wed, 6 Nov 2019 20:53:33 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201911062053.xA6KrXiQ099026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 6 Nov 2019 20:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354413 - in head/sys: compat/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head/sys: compat/linux i386/linux X-SVN-Commit-Revision: 354413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 20:53:34 -0000 Author: trasz Date: Wed Nov 6 20:53:33 2019 New Revision: 354413 URL: https://svnweb.freebsd.org/changeset/base/354413 Log: Make linux(4) create /dev/shm. Linux applications often expect a tmpfs to be mounted there, and because they like to verify it's actually a mountpoint, a symlink won't do. Reviewed by: dchagin (earlier version) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20333 Modified: head/sys/compat/linux/linux.c head/sys/compat/linux/linux.h head/sys/compat/linux/linux_common.c head/sys/i386/linux/linux_sysvec.c Modified: head/sys/compat/linux/linux.c ============================================================================== --- head/sys/compat/linux/linux.c Wed Nov 6 20:43:40 2019 (r354412) +++ head/sys/compat/linux/linux.c Wed Nov 6 20:53:33 2019 (r354413) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -129,6 +130,12 @@ static int linux_to_bsd_sigtbl[LINUX_SIGTBLSZ] = { SIGSYS /* LINUX_SIGSYS */ }; +static struct cdev *dev_shm_cdev; +static struct cdevsw dev_shm_cdevsw = { + .d_version = D_VERSION, + .d_name = "dev_shm", +}; + /* * Map Linux RT signals to the FreeBSD RT signals. */ @@ -523,4 +530,24 @@ linux_to_bsd_sockaddr(const struct l_sockaddr *osa, st out: free(kosa, M_SONAME); return (error); +} + +void +linux_dev_shm_create(void) +{ + int error; + + error = make_dev_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, &dev_shm_cdev, + &dev_shm_cdevsw, NULL, UID_ROOT, GID_WHEEL, 0, "shm/.mountpoint"); + if (error != 0) { + printf("%s: failed to create device node, error %d\n", + __func__, error); + } +} + +void +linux_dev_shm_destroy(void) +{ + + destroy_dev(dev_shm_cdev); } Modified: head/sys/compat/linux/linux.h ============================================================================== --- head/sys/compat/linux/linux.h Wed Nov 6 20:43:40 2019 (r354412) +++ head/sys/compat/linux/linux.h Wed Nov 6 20:53:33 2019 (r354413) @@ -143,4 +143,7 @@ int bsd_to_linux_signal(int sig); extern LIST_HEAD(futex_list, futex) futex_list; extern struct mtx futex_mtx; +void linux_dev_shm_create(void); +void linux_dev_shm_destroy(void); + #endif /* _LINUX_MI_H_ */ Modified: head/sys/compat/linux/linux_common.c ============================================================================== --- head/sys/compat/linux/linux_common.c Wed Nov 6 20:43:40 2019 (r354412) +++ head/sys/compat/linux/linux_common.c Wed Nov 6 20:53:33 2019 (r354413) @@ -68,6 +68,7 @@ linux_common_modevent(module_t mod, int type, void *da switch(type) { case MOD_LOAD: + linux_dev_shm_create(); linux_osd_jail_register(); linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, linux_proc_exit, NULL, 1000); @@ -81,6 +82,7 @@ linux_common_modevent(module_t mod, int type, void *da mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF); break; case MOD_UNLOAD: + linux_dev_shm_destroy(); linux_osd_jail_deregister(); SET_FOREACH(ldhp, linux_device_handler_set) linux_device_unregister_handler(*ldhp); Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Wed Nov 6 20:43:40 2019 (r354412) +++ head/sys/i386/linux/linux_sysvec.c Wed Nov 6 20:53:33 2019 (r354413) @@ -1006,6 +1006,7 @@ linux_elf_modevent(module_t mod, int type, void *data) linux_get_machine(&linux_kplatform); linux_szplatform = roundup(strlen(linux_kplatform) + 1, sizeof(char *)); + linux_dev_shm_create(); linux_osd_jail_register(); stclohz = (stathz ? stathz : hz); if (bootverbose) @@ -1031,6 +1032,7 @@ linux_elf_modevent(module_t mod, int type, void *data) EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag); EVENTHANDLER_DEREGISTER(process_exec, linux_exec_tag); EVENTHANDLER_DEREGISTER(thread_dtor, linux_thread_dtor_tag); + linux_dev_shm_destroy(); linux_osd_jail_deregister(); if (bootverbose) printf("Linux ELF exec handler removed\n"); From owner-svn-src-head@freebsd.org Wed Nov 6 21:13:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 682FF178877; Wed, 6 Nov 2019 21:13:11 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477fQH27RBz4f6L; Wed, 6 Nov 2019 21:13:11 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1487531B0; Wed, 6 Nov 2019 21:13:11 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA6LDA5a011048; Wed, 6 Nov 2019 21:13:10 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA6LDAEw011047; Wed, 6 Nov 2019 21:13:10 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911062113.xA6LDAEw011047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 6 Nov 2019 21:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354415 - head/stand/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/efi/libefi X-SVN-Commit-Revision: 354415 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 21:13:11 -0000 Author: tsoome Date: Wed Nov 6 21:13:10 2019 New Revision: 354415 URL: https://svnweb.freebsd.org/changeset/base/354415 Log: loader.efi: HARDDRIVE_DEVICE_PATH may have subpaths The macos does create Vendor Media devices on top of APFS container (like partition table inside the partition), so we need to collect such devices into respective device tree. MFC after: 1 week Modified: head/stand/efi/libefi/efipart.c Modified: head/stand/efi/libefi/efipart.c ============================================================================== --- head/stand/efi/libefi/efipart.c Wed Nov 6 21:04:02 2019 (r354414) +++ head/stand/efi/libefi/efipart.c Wed Nov 6 21:13:10 2019 (r354415) @@ -313,11 +313,14 @@ efipart_floppy(EFI_DEVICE_PATH *node) static pdinfo_t * efipart_find_parent(pdinfo_list_t *pdi, EFI_DEVICE_PATH *devpath) { - pdinfo_t *pd; + pdinfo_t *pd, *part; STAILQ_FOREACH(pd, pdi, pd_link) { if (efi_devpath_is_prefix(pd->pd_devpath, devpath)) return (pd); + part = efipart_find_parent(&pd->pd_part, devpath); + if (part != NULL) + return (part); } return (NULL); } @@ -500,22 +503,44 @@ efipart_initcd(void) return (0); } -static void -efipart_hdinfo_add(pdinfo_t *hd, HARDDRIVE_DEVICE_PATH *node) +static bool +efipart_hdinfo_add_node(pdinfo_t *hd, EFI_DEVICE_PATH *node) { pdinfo_t *pd, *last; + VENDOR_DEVICE_PATH *ven_node; STAILQ_FOREACH(pd, &hdinfo, pd_link) { - if (efi_devpath_is_prefix(pd->pd_devpath, hd->pd_devpath)) { - /* Add the partition. */ - hd->pd_unit = node->PartitionNumber; - hd->pd_parent = pd; - hd->pd_devsw = &efipart_hddev; - STAILQ_INSERT_TAIL(&pd->pd_part, hd, pd_link); - return; - } + if (efi_devpath_is_prefix(pd->pd_devpath, hd->pd_devpath)) + break; } + if (pd == NULL) + return (false); + /* Add the partition. */ + if (DevicePathSubType(node) == MEDIA_HARDDRIVE_DP) { + hd->pd_unit = ((HARDDRIVE_DEVICE_PATH *)node)->PartitionNumber; + } else { + last = STAILQ_LAST(&pd->pd_part, pdinfo, pd_link); + if (last != NULL) + hd->pd_unit = last->pd_unit + 1; + else + hd->pd_unit = 0; + } + hd->pd_parent = pd; + hd->pd_devsw = &efipart_hddev; + + STAILQ_INSERT_TAIL(&pd->pd_part, hd, pd_link); + return (true); +} + +static void +efipart_hdinfo_add(pdinfo_t *hd, EFI_DEVICE_PATH *node) +{ + pdinfo_t *pd, *last; + + if (efipart_hdinfo_add_node(hd, node)) + return; + last = STAILQ_LAST(&hdinfo, pdinfo, pd_link); if (last != NULL) hd->pd_unit = last->pd_unit + 1; @@ -677,7 +702,7 @@ restart: efipart_hdinfo_add(parent, NULL); } - efipart_hdinfo_add(hd, (HARDDRIVE_DEVICE_PATH *)node); + efipart_hdinfo_add(hd, node); goto restart; } } From owner-svn-src-head@freebsd.org Wed Nov 6 22:40:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20E1717A5C0; Wed, 6 Nov 2019 22:40:20 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477hLq723dz3F44; Wed, 6 Nov 2019 22:40:19 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D066842A4; Wed, 6 Nov 2019 22:40:19 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA6MeJEr059082; Wed, 6 Nov 2019 22:40:19 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA6MeJL6059081; Wed, 6 Nov 2019 22:40:19 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201911062240.xA6MeJL6059081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 6 Nov 2019 22:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354416 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 354416 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 22:40:20 -0000 Author: bz Date: Wed Nov 6 22:40:19 2019 New Revision: 354416 URL: https://svnweb.freebsd.org/changeset/base/354416 Log: m_pulldown(): Change an if () panic() into a KASSERT(). If we pass in a NULL mbuf to m_pulldown() we are in a bad situation already. There is no point in doing that check for production code. Change the if () panic() into a KASSERT. MFC after: 3 weeks Sponsored by: Netflix Modified: head/sys/kern/uipc_mbuf2.c Modified: head/sys/kern/uipc_mbuf2.c ============================================================================== --- head/sys/kern/uipc_mbuf2.c Wed Nov 6 21:13:10 2019 (r354415) +++ head/sys/kern/uipc_mbuf2.c Wed Nov 6 22:40:19 2019 (r354416) @@ -101,8 +101,8 @@ m_pulldown(struct mbuf *m, int off, int len, int *offp int writable; /* check invalid arguments. */ - if (m == NULL) - panic("m == NULL in m_pulldown()"); + KASSERT(m != NULL, ("%s: fix caller: m is NULL off %d len %d offp %p\n", + __func__, off, len, offp)); if (len > MCLBYTES) { m_freem(m); return NULL; /* impossible */ From owner-svn-src-head@freebsd.org Wed Nov 6 23:40:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11CA717BD66; Wed, 6 Nov 2019 23:40:10 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477jgs6mD3z3HjB; Wed, 6 Nov 2019 23:40:09 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C73184D80; Wed, 6 Nov 2019 23:40:09 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA6Ne9d5093756; Wed, 6 Nov 2019 23:40:09 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA6Ne999093755; Wed, 6 Nov 2019 23:40:09 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201911062340.xA6Ne999093755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Wed, 6 Nov 2019 23:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354417 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 354417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 23:40:10 -0000 Author: sevan (doc committer) Date: Wed Nov 6 23:40:09 2019 New Revision: 354417 URL: https://svnweb.freebsd.org/changeset/base/354417 Log: Add FreeBSD 11.3 Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Wed Nov 6 22:40:19 2019 (r354416) +++ head/share/misc/bsd-family-tree Wed Nov 6 23:40:09 2019 (r354417) @@ -388,18 +388,20 @@ FreeBSD 5.2 | | | | | | | | | | DragonFly 5.2.2 | FreeBSD | | | *--NetBSD | | | 11.2 | | | 7.2 | | - | macOS | | | | | - | 10.14 | | | OpenBSD 6.4 | - | | | | | | | - | | | | | | DragonFly 5.4.0 - *--FreeBSD | | | v | | - | 12.0 | | | | DragonFly 5.4.1 - | | | | | OpenBSD 6.5 | - | | | | | | | - | | | | NetBSD | | - | | | | 8.1 | DragonFly 5.6 - | | | | | | - | | | | | DragonFly 5.6.1 + | | macOS | | | | | + | | 10.14 | | | OpenBSD 6.4 | + | | | | | | | | + | | | | | | | DragonFly 5.4.0 + *--FreeBSD | | | | v | | + | 12.0 | | | | | DragonFly 5.4.1 + | | | | | | OpenBSD 6.5 | + | | | | | | | | + | | | | | NetBSD | | + | | | | | 8.1 | DragonFly 5.6 + | | | | | | | + | | | | | | DragonFly 5.6.1 + | | FreeBSD | | | | + | | 11.3 | | | | | FreeBSD | | OpenBSD 6.6 | | 12.1 | | | | | | | | | | @@ -790,6 +792,7 @@ OpenBSD 6.5 2019-05-01 [OBD] NetBSD 8.1 2019-06-04 [NBD] DragonFly 5.6 2019-06-17 [DFB] DragonFly 5.6.1 2019-06-19 [DFB] +FreeBSD 11.3 2019-07-09 [FBD] OpenBSD 6.6 2019-10-17 [OBD] FreeBSD 12.1 2019-11-04 [FBD] From owner-svn-src-head@freebsd.org Wed Nov 6 23:44:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3261217C160; Wed, 6 Nov 2019 23:44:39 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477jn30bBhz3JD4; Wed, 6 Nov 2019 23:44:39 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7FBE4F4B; Wed, 6 Nov 2019 23:44:38 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA6NicgU099658; Wed, 6 Nov 2019 23:44:38 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA6NicLE099656; Wed, 6 Nov 2019 23:44:38 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201911062344.xA6NicLE099656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 6 Nov 2019 23:44:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354418 - head/contrib/llvm/tools/clang/lib/Driver/ToolChains X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/contrib/llvm/tools/clang/lib/Driver/ToolChains X-SVN-Commit-Revision: 354418 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 23:44:39 -0000 Author: cem Date: Wed Nov 6 23:44:38 2019 New Revision: 354418 URL: https://svnweb.freebsd.org/changeset/base/354418 Log: clang: Enable unwind tables on !amd64 There doesn't seem to be much sense in defaulting "on" unwind tables on amd64 and not on other arches. It causes surprising differences between platforms, such as the PR below. Prior to this change, FreeBSD inherited the default implementation of the method from the Gnu.h Generic_Elf => Generic_GCC parent class, which returned true only for amd64 targets. Override that and opt on always, similar to, e.g., NetBSD. PR: 241562 Reported by: lwhsu Reviewed by: dim Discussed with: emaste MFC after: I'm not going to, but you should feel free Relnotes: yes Differential Revision: https://reviews.freebsd.org/D22252 Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.h Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.cpp Wed Nov 6 23:40:09 2019 (r354417) +++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.cpp Wed Nov 6 23:44:38 2019 (r354418) @@ -409,6 +409,8 @@ llvm::ExceptionHandling FreeBSD::GetExceptionModel(con bool FreeBSD::HasNativeLLVMSupport() const { return true; } +bool FreeBSD::IsUnwindTablesDefault(const ArgList &Args) const { return true; } + bool FreeBSD::isPIEDefault() const { return getSanitizerArgs().requiresPIE(); } SanitizerMask FreeBSD::getSupportedSanitizers() const { Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.h ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.h Wed Nov 6 23:40:09 2019 (r354417) +++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.h Wed Nov 6 23:44:38 2019 (r354418) @@ -67,6 +67,7 @@ class LLVM_LIBRARY_VISIBILITY FreeBSD : public Generic llvm::ExceptionHandling GetExceptionModel( const llvm::opt::ArgList &Args) const override; + bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override; bool isPIEDefault() const override; SanitizerMask getSupportedSanitizers() const override; unsigned GetDefaultDwarfVersion() const override; From owner-svn-src-head@freebsd.org Wed Nov 6 23:45:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E54BD17C21A; Wed, 6 Nov 2019 23:45:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477jpH5lMgz3JMF; Wed, 6 Nov 2019 23:45:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9049C4F56; Wed, 6 Nov 2019 23:45:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA6Njhh3099775; Wed, 6 Nov 2019 23:45:43 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA6Njh9i099774; Wed, 6 Nov 2019 23:45:43 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911062345.xA6Njh9i099774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 6 Nov 2019 23:45:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354419 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 354419 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2019 23:45:44 -0000 Author: glebius Date: Wed Nov 6 23:45:43 2019 New Revision: 354419 URL: https://svnweb.freebsd.org/changeset/base/354419 Log: If vm_pager_get_pages_async() returns an error synchronously we leak wired and busy pages. Add code that would carefully cleanups the state in case of synchronous error return. Cover a case when a first I/O went on asynchronously, but second or N-th returned error synchronously. In collaboration with: chs Reviewed by: jtl, kib Modified: head/sys/kern/kern_sendfile.c Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Wed Nov 6 23:44:38 2019 (r354418) +++ head/sys/kern/kern_sendfile.c Wed Nov 6 23:45:43 2019 (r354419) @@ -269,6 +269,16 @@ sendfile_iodone(void *arg, vm_page_t *pg, int count, i if (!refcount_release(&sfio->nios)) return; + if (__predict_false(sfio->error && sfio->m == NULL)) { + /* + * I/O operation failed, but pru_send hadn't been executed - + * nothing had been sent to the socket. The syscall has + * returned error to the user. + */ + free(sfio, M_TEMP); + return; + } + #if defined(KERN_TLS) && defined(INVARIANTS) if ((sfio->m->m_flags & M_EXT) != 0 && sfio->m->m_ext.ext_type == EXT_PGS) @@ -279,7 +289,7 @@ sendfile_iodone(void *arg, vm_page_t *pg, int count, i ("non-ext_pgs mbuf with TLS session")); #endif CURVNET_SET(so->so_vnet); - if (sfio->error) { + if (__predict_false(sfio->error)) { /* * I/O operation failed. The state of data in the socket * is now inconsistent, and all what we can do is to tear @@ -414,10 +424,25 @@ sendfile_swapin(vm_object_t obj, struct sf_io *sfio, i rv = vm_pager_get_pages_async(obj, pa + i, count, NULL, i + count == npages ? &rhpages : NULL, &sendfile_iodone, sfio); - if (rv != VM_PAGER_OK) { - for (j = i; j < i + count; j++) { - if (pa[j] != bogus_page) - vm_page_unwire(pa[j], PQ_INACTIVE); + if (__predict_false(rv != VM_PAGER_OK)) { + /* + * Perform full pages recovery before returning EIO. + * Pages from 0 to npages are wired. + * Pages from i to npages are also busied. + * Pages from (i + 1) to (i + count - 1) may be + * substituted to bogus page, and not busied. + */ + for (j = 0; j < npages; j++) { + if (j > i && j < i + count - 1 && + pa[j] == bogus_page) + pa[j] = vm_page_lookup(obj, + OFF_TO_IDX(vmoff(j, off))); + else if (j >= i) + vm_page_xunbusy(pa[j]); + KASSERT(pa[j] != NULL && pa[j] != bogus_page, + ("%s: page %p[%d] I/O recovery failure", + __func__, pa, j)); + vm_page_unwire(pa[j], PQ_INACTIVE); } VM_OBJECT_WUNLOCK(obj); return (EIO); @@ -806,7 +831,8 @@ retry_space: if (error != 0) { if (vp != NULL) VOP_UNLOCK(vp, 0); - free(sfio, M_TEMP); + sfio->m = NULL; + sendfile_iodone(sfio, NULL, 0, error); goto done; } From owner-svn-src-head@freebsd.org Thu Nov 7 00:07:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59A6317D0C0; Thu, 7 Nov 2019 00:07:55 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477kHv1fC3z3KTt; Thu, 7 Nov 2019 00:07:55 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14D3352E9; Thu, 7 Nov 2019 00:07:55 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA707sNF011845; Thu, 7 Nov 2019 00:07:54 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA707sUx011844; Thu, 7 Nov 2019 00:07:54 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201911070007.xA707sUx011844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 7 Nov 2019 00:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354420 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 354420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 00:07:55 -0000 Author: brooks Date: Thu Nov 7 00:07:54 2019 New Revision: 354420 URL: https://svnweb.freebsd.org/changeset/base/354420 Log: Fix the alignment of struct xunpcb on systems with >64-bit pointers. Reviewed by: emaste Obtained from: CheriBSD MFC after: 3 days Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22268 Modified: head/sys/sys/unpcb.h Modified: head/sys/sys/unpcb.h ============================================================================== --- head/sys/sys/unpcb.h Wed Nov 6 23:45:43 2019 (r354419) +++ head/sys/sys/unpcb.h Thu Nov 7 00:07:54 2019 (r354420) @@ -156,7 +156,7 @@ struct xunpcb { char xu_dummy2[256]; }; struct xsocket xu_socket; -} __aligned(8); +} __aligned(MAX(8, sizeof(void *))); struct xunpgen { ksize_t xug_len; From owner-svn-src-head@freebsd.org Thu Nov 7 00:08:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F0EE17D152; Thu, 7 Nov 2019 00:08:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477kJj1QNpz3Kck; Thu, 7 Nov 2019 00:08:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E86952EE; Thu, 7 Nov 2019 00:08:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA708aLM011948; Thu, 7 Nov 2019 00:08:36 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA708YeB011934; Thu, 7 Nov 2019 00:08:34 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911070008.xA708YeB011934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Nov 2019 00:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354421 - in head/sys: dev/cxgbe/cxgbei dev/cxgbe/tom kern netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: dev/cxgbe/cxgbei dev/cxgbe/tom kern netinet X-SVN-Commit-Revision: 354421 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 00:08:37 -0000 Author: glebius Date: Thu Nov 7 00:08:34 2019 New Revision: 354421 URL: https://svnweb.freebsd.org/changeset/base/354421 Log: Mechanically convert INP_INFO_RLOCK() to NET_EPOCH_ENTER(). Remove few outdated comments and extraneous assertions. No functional change here. Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_listen.c head/sys/dev/cxgbe/tom/t4_tls.c head/sys/kern/uipc_ktls.c head/sys/netinet/in_pcb.c head/sys/netinet/tcp_lro.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/toecore.c Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/cxgbei.c Thu Nov 7 00:07:54 2019 (r354420) +++ head/sys/dev/cxgbe/cxgbei/cxgbei.c Thu Nov 7 00:08:34 2019 (r354421) @@ -412,12 +412,12 @@ do_rx_iscsi_ddp(struct sge_iq *iq, const struct rss_he SOCKBUF_UNLOCK(sb); INP_WUNLOCK(inp); - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); INP_WLOCK(inp); tp = tcp_drop(tp, ECONNRESET); if (tp) INP_WUNLOCK(inp); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); icl_cxgbei_conn_pdu_free(NULL, ip); #ifdef INVARIANTS Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Thu Nov 7 00:07:54 2019 (r354420) +++ head/sys/dev/cxgbe/tom/t4_connect.c Thu Nov 7 00:08:34 2019 (r354421) @@ -124,12 +124,12 @@ act_open_failure_cleanup(struct adapter *sc, u_int ati CURVNET_SET(toep->vnet); if (status != EAGAIN) - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); INP_WLOCK(inp); toe_connect_failed(tod, inp, status); final_cpl_received(toep); /* unlocks inp */ if (status != EAGAIN) - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); } Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Thu Nov 7 00:07:54 2019 (r354420) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Thu Nov 7 00:08:34 2019 (r354421) @@ -1214,7 +1214,7 @@ do_peer_close(struct sge_iq *iq, const struct rss_head KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__)); CURVNET_SET(toep->vnet); - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); INP_WLOCK(inp); tp = intotcpcb(inp); @@ -1260,7 +1260,7 @@ do_peer_close(struct sge_iq *iq, const struct rss_head case TCPS_FIN_WAIT_2: tcp_twstart(tp); INP_UNLOCK_ASSERT(inp); /* safe, we have a ref on the inp */ - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); INP_WLOCK(inp); @@ -1273,7 +1273,7 @@ do_peer_close(struct sge_iq *iq, const struct rss_head } done: INP_WUNLOCK(inp); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); return (0); } @@ -1303,7 +1303,7 @@ do_close_con_rpl(struct sge_iq *iq, const struct rss_h KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__)); CURVNET_SET(toep->vnet); - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); INP_WLOCK(inp); tp = intotcpcb(inp); @@ -1321,7 +1321,7 @@ do_close_con_rpl(struct sge_iq *iq, const struct rss_h tcp_twstart(tp); release: INP_UNLOCK_ASSERT(inp); /* safe, we have a ref on the inp */ - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); INP_WLOCK(inp); @@ -1346,7 +1346,7 @@ release: } done: INP_WUNLOCK(inp); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); return (0); } @@ -1423,7 +1423,7 @@ do_abort_req(struct sge_iq *iq, const struct rss_heade inp = toep->inp; CURVNET_SET(toep->vnet); - INP_INFO_RLOCK_ET(&V_tcbinfo, et); /* for tcp_close */ + NET_EPOCH_ENTER(et); /* for tcp_close */ INP_WLOCK(inp); tp = intotcpcb(inp); @@ -1457,7 +1457,7 @@ do_abort_req(struct sge_iq *iq, const struct rss_heade final_cpl_received(toep); done: - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); send_abort_rpl(sc, ofld_txq, tid, CPL_ABORT_NO_RST); return (0); @@ -1572,12 +1572,12 @@ do_rx_data(struct sge_iq *iq, const struct rss_header INP_WUNLOCK(inp); CURVNET_SET(toep->vnet); - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); INP_WLOCK(inp); tp = tcp_drop(tp, ECONNRESET); if (tp) INP_WUNLOCK(inp); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); return (0); Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Thu Nov 7 00:07:54 2019 (r354420) +++ head/sys/dev/cxgbe/tom/t4_listen.c Thu Nov 7 00:08:34 2019 (r354421) @@ -949,7 +949,7 @@ t4_offload_socket(struct toedev *tod, void *arg, struc #endif struct toepcb *toep = synqe->toep; - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); /* prevents bad race with accept() */ + NET_EPOCH_ASSERT(); /* prevents bad race with accept() */ INP_WLOCK_ASSERT(inp); KASSERT(synqe->flags & TPF_SYNQE, ("%s: %p not a synq_entry?", __func__, arg)); @@ -1242,12 +1242,12 @@ found: REJECT_PASS_ACCEPT_REQ(true); /* Don't offload if the 4-tuple is already in use */ - INP_INFO_RLOCK_ET(&V_tcbinfo, et); /* for 4-tuple check */ + NET_EPOCH_ENTER(et); /* for 4-tuple check */ if (toe_4tuple_check(&inc, &th, ifp) != 0) { - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); REJECT_PASS_ACCEPT_REQ(false); } - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); inp = lctx->inp; /* listening socket, not owned by TOE */ INP_WLOCK(inp); @@ -1396,7 +1396,7 @@ do_pass_establish(struct sge_iq *iq, const struct rss_ ("%s: tid %u (ctx %p) not a synqe", __func__, tid, synqe)); CURVNET_SET(lctx->vnet); - INP_INFO_RLOCK_ET(&V_tcbinfo, et); /* for syncache_expand */ + NET_EPOCH_ENTER(et); /* for syncache_expand */ INP_WLOCK(inp); CTR6(KTR_CXGBE, @@ -1412,7 +1412,7 @@ do_pass_establish(struct sge_iq *iq, const struct rss_ reset: send_reset_synqe(TOEDEV(ifp), synqe); INP_WUNLOCK(inp); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); return (0); } @@ -1471,7 +1471,7 @@ reset: inp = release_synqe(sc, synqe); if (inp != NULL) INP_WUNLOCK(inp); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); return (0); Modified: head/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tls.c Thu Nov 7 00:07:54 2019 (r354420) +++ head/sys/dev/cxgbe/tom/t4_tls.c Thu Nov 7 00:08:34 2019 (r354421) @@ -2125,12 +2125,12 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_head INP_WUNLOCK(inp); CURVNET_SET(toep->vnet); - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); INP_WLOCK(inp); tp = tcp_drop(tp, ECONNRESET); if (tp) INP_WUNLOCK(inp); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); return (0); Modified: head/sys/kern/uipc_ktls.c ============================================================================== --- head/sys/kern/uipc_ktls.c Thu Nov 7 00:07:54 2019 (r354420) +++ head/sys/kern/uipc_ktls.c Thu Nov 7 00:08:34 2019 (r354421) @@ -1137,7 +1137,7 @@ ktls_reset_send_tag(void *context, int pending) * the send tag is fixed or just rely on timers? */ } else { - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); INP_WLOCK(inp); if (!in_pcbrele_wlocked(inp)) { if (!(inp->inp_flags & INP_TIMEWAIT) && @@ -1150,7 +1150,7 @@ ktls_reset_send_tag(void *context, int pending) } else INP_WUNLOCK(inp); } - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); counter_u64_add(ktls_ifnet_reset_failed, 1); Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Thu Nov 7 00:07:54 2019 (r354420) +++ head/sys/netinet/in_pcb.c Thu Nov 7 00:08:34 2019 (r354421) @@ -515,7 +515,7 @@ in_pcballoc(struct socket *so, struct inpcbinfo *pcbin #ifdef INVARIANTS if (pcbinfo == &V_tcbinfo) { - INP_INFO_RLOCK_ASSERT(pcbinfo); + NET_EPOCH_ASSERT(); } else { INP_INFO_WLOCK_ASSERT(pcbinfo); } @@ -2657,7 +2657,7 @@ in_pcbremlists(struct inpcb *inp) #ifdef INVARIANTS if (pcbinfo == &V_tcbinfo) { - INP_INFO_RLOCK_ASSERT(pcbinfo); + NET_EPOCH_ASSERT(); } else { INP_INFO_WLOCK_ASSERT(pcbinfo); } Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Thu Nov 7 00:07:54 2019 (r354420) +++ head/sys/netinet/tcp_lro.c Thu Nov 7 00:08:34 2019 (r354421) @@ -884,7 +884,7 @@ tcp_lro_flush(struct lro_ctrl *lc, struct lro_entry *l */ if ((tcplro_stacks_wanting_mbufq == 0) || (le->m_head->m_flags & M_VLANTAG)) goto skip_lookup; - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); switch (le->eh_type) { #ifdef INET6 case ETHERTYPE_IPV6: @@ -903,7 +903,7 @@ tcp_lro_flush(struct lro_ctrl *lc, struct lro_entry *l break; #endif } - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); if (inp && ((inp->inp_flags & (INP_DROPPED|INP_TIMEWAIT)) || (inp->inp_flags2 & INP_FREED))) { /* We don't want this guy */ Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Nov 7 00:07:54 2019 (r354420) +++ head/sys/netinet/tcp_subr.c Thu Nov 7 00:08:34 2019 (r354421) @@ -1941,7 +1941,7 @@ tcp_timer_discard(void *ptp) tp = (struct tcpcb *)ptp; CURVNET_SET(tp->t_vnet); - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); inp = tp->t_inpcb; KASSERT(inp != NULL, ("%s: tp %p tp->t_inpcb == NULL", __func__, tp)); @@ -1961,13 +1961,13 @@ tcp_timer_discard(void *ptp) tp->t_inpcb = NULL; uma_zfree(V_tcpcb_zone, tp); if (in_pcbrele_wlocked(inp)) { - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); return; } } INP_WUNLOCK(inp); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); } @@ -2770,7 +2770,7 @@ tcp_drop_syn_sent(struct inpcb *inp, int errno) { struct tcpcb *tp; - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + NET_EPOCH_ASSERT(); INP_WLOCK_ASSERT(inp); if ((inp->inp_flags & INP_TIMEWAIT) || @@ -3042,7 +3042,7 @@ sysctl_drop(SYSCTL_HANDLER_ARGS) default: return (EINVAL); } - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); switch (addrs[0].ss_family) { #ifdef INET6 case AF_INET6: @@ -3081,7 +3081,7 @@ sysctl_drop(SYSCTL_HANDLER_ARGS) INP_WUNLOCK(inp); } else error = ESRCH; - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); return (error); } @@ -3157,7 +3157,7 @@ sysctl_switch_tls(SYSCTL_HANDLER_ARGS) default: return (EINVAL); } - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); switch (addrs[0].ss_family) { #ifdef INET6 case AF_INET6: @@ -3173,7 +3173,7 @@ sysctl_switch_tls(SYSCTL_HANDLER_ARGS) break; #endif } - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); if (inp != NULL) { if ((inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) != 0 || inp->inp_socket == NULL) { Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Thu Nov 7 00:07:54 2019 (r354420) +++ head/sys/netinet/tcp_syncache.c Thu Nov 7 00:08:34 2019 (r354421) @@ -771,7 +771,7 @@ syncache_socket(struct syncache *sc, struct socket *ls int error; char *s; - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + NET_EPOCH_ASSERT(); /* * Ok, create the full blown connection, and set things up @@ -1091,11 +1091,7 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt char *s; bool locked; - /* - * Global TCP locks are held because we manipulate the PCB lists - * and create a new socket. - */ - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + NET_EPOCH_ASSERT(); KASSERT((th->th_flags & (TH_RST|TH_ACK|TH_SYN)) == TH_ACK, ("%s: can handle only ACK", __func__)); @@ -1331,11 +1327,7 @@ syncache_tfo_expand(struct syncache *sc, struct socket struct tcpcb *tp; unsigned int *pending_counter; - /* - * Global TCP locks are held because we manipulate the PCB lists - * and create a new socket. - */ - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + NET_EPOCH_ASSERT(); pending_counter = intotcpcb(sotoinpcb(*lsop))->t_tfo_pending; *lsop = syncache_socket(sc, *lsop, m); Modified: head/sys/netinet/toecore.c ============================================================================== --- head/sys/netinet/toecore.c Thu Nov 7 00:07:54 2019 (r354420) +++ head/sys/netinet/toecore.c Thu Nov 7 00:08:34 2019 (r354421) @@ -360,7 +360,7 @@ toe_syncache_expand(struct in_conninfo *inc, struct tc struct tcphdr *th, struct socket **lsop) { - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + NET_EPOCH_ASSERT(); return (syncache_expand(inc, to, th, lsop, NULL)); } @@ -390,8 +390,6 @@ toe_4tuple_check(struct in_conninfo *inc, struct tcphd INP_WLOCK_ASSERT(inp); if ((inp->inp_flags & INP_TIMEWAIT) && th != NULL) { - - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); /* for twcheck */ if (!tcp_twcheck(inp, NULL, th, NULL, 0)) return (EADDRINUSE); } else { @@ -529,7 +527,7 @@ toe_connect_failed(struct toedev *tod, struct inpcb *i (void) tp->t_fb->tfb_tcp_output(tp); } else { - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + NET_EPOCH_ASSERT(); tp = tcp_drop(tp, err); if (tp == NULL) INP_WLOCK(inp); /* re-acquire */ From owner-svn-src-head@freebsd.org Thu Nov 7 00:10:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2411717D279; Thu, 7 Nov 2019 00:10:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477kLb07jkz3Kms; Thu, 7 Nov 2019 00:10:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D769E52F3; Thu, 7 Nov 2019 00:10:14 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA70AEaQ012133; Thu, 7 Nov 2019 00:10:14 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA70AES8012132; Thu, 7 Nov 2019 00:10:14 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911070010.xA70AES8012132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Nov 2019 00:10:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354422 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 354422 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 00:10:15 -0000 Author: glebius Date: Thu Nov 7 00:10:14 2019 New Revision: 354422 URL: https://svnweb.freebsd.org/changeset/base/354422 Log: Mechanically convert INP_INFO_RLOCK() to NET_EPOCH_ENTER() in TCP functions that are executed in syscall context. No functional change here. Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Thu Nov 7 00:08:34 2019 (r354421) +++ head/sys/netinet/tcp_usrreq.c Thu Nov 7 00:10:14 2019 (r354422) @@ -283,7 +283,7 @@ tcp_usr_detach(struct socket *so) inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp_usr_detach: inp == NULL")); if (!INP_INFO_WLOCKED(&V_tcbinfo)) { - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); rlock = 1; } INP_WLOCK(inp); @@ -291,7 +291,7 @@ tcp_usr_detach(struct socket *so) ("tcp_usr_detach: inp_socket == NULL")); tcp_detach(so, inp); if (rlock) - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); } #ifdef INET @@ -706,7 +706,7 @@ tcp_usr_disconnect(struct socket *so) int error = 0; TCPDEBUG0; - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp_usr_disconnect: inp == NULL")); INP_WLOCK(inp); @@ -723,7 +723,7 @@ out: TCPDEBUG2(PRU_DISCONNECT); TCP_PROBE2(debug__user, tp, PRU_DISCONNECT); INP_WUNLOCK(inp); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); return (error); } @@ -792,7 +792,7 @@ tcp6_usr_accept(struct socket *so, struct sockaddr **n inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp6_usr_accept: inp == NULL")); - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); INP_WLOCK(inp); if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { error = ECONNABORTED; @@ -819,7 +819,7 @@ out: TCPDEBUG2(PRU_ACCEPT); TCP_PROBE2(debug__user, tp, PRU_ACCEPT); INP_WUNLOCK(inp); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); if (error == 0) { if (v4) *nam = in6_v4mapsin6_sockaddr(port, &addr); @@ -842,7 +842,7 @@ tcp_usr_shutdown(struct socket *so) struct epoch_tracker et; TCPDEBUG0; - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); inp = sotoinpcb(so); KASSERT(inp != NULL, ("inp == NULL")); INP_WLOCK(inp); @@ -861,7 +861,7 @@ out: TCPDEBUG2(PRU_SHUTDOWN); TCP_PROBE2(debug__user, tp, PRU_SHUTDOWN); INP_WUNLOCK(inp); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); return (error); } @@ -921,10 +921,10 @@ static int tcp_usr_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam, struct mbuf *control, struct thread *td) { + struct epoch_tracker et; int error = 0; struct inpcb *inp; struct tcpcb *tp = NULL; - struct epoch_tracker net_et; #ifdef INET #ifdef INET6 struct sockaddr_in sin; @@ -940,11 +940,11 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf TCPDEBUG0; /* - * We require the pcbinfo lock if we will close the socket as part of - * this call. + * We require the pcbinfo "read lock" if we will close the socket + * as part of this call. */ if (flags & PRUS_EOF) - INP_INFO_RLOCK_ET(&V_tcbinfo, net_et); + NET_EPOCH_ENTER(et); inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp_usr_send: inp == NULL")); INP_WLOCK(inp); @@ -1135,7 +1135,7 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf * Close the send side of the connection after * the data is sent. */ - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + NET_EPOCH_ASSERT(); socantsendmore(so); tcp_usrclosed(tp); } @@ -1231,7 +1231,7 @@ out: ((flags & PRUS_EOF) ? PRU_SEND_EOF : PRU_SEND)); INP_WUNLOCK(inp); if (flags & PRUS_EOF) - INP_INFO_RUNLOCK_ET(&V_tcbinfo, net_et); + NET_EPOCH_EXIT(et); return (error); } @@ -1275,7 +1275,7 @@ tcp_usr_abort(struct socket *so) inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp_usr_abort: inp == NULL")); - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); INP_WLOCK(inp); KASSERT(inp->inp_socket != NULL, ("tcp_usr_abort: inp_socket == NULL")); @@ -1301,7 +1301,7 @@ tcp_usr_abort(struct socket *so) } INP_WUNLOCK(inp); dropped: - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); } /* @@ -1318,7 +1318,7 @@ tcp_usr_close(struct socket *so) inp = sotoinpcb(so); KASSERT(inp != NULL, ("tcp_usr_close: inp == NULL")); - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); INP_WLOCK(inp); KASSERT(inp->inp_socket != NULL, ("tcp_usr_close: inp_socket == NULL")); @@ -1342,7 +1342,7 @@ tcp_usr_close(struct socket *so) inp->inp_flags |= INP_SOCKREF; } INP_WUNLOCK(inp); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); } /* @@ -2317,10 +2317,10 @@ tcp_attach(struct socket *so) } so->so_rcv.sb_flags |= SB_AUTOSIZE; so->so_snd.sb_flags |= SB_AUTOSIZE; - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); error = in_pcballoc(so, &V_tcbinfo); if (error) { - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); return (error); } inp = sotoinpcb(so); @@ -2338,12 +2338,12 @@ tcp_attach(struct socket *so) if (tp == NULL) { in_pcbdetach(inp); in_pcbfree(inp); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); return (ENOBUFS); } tp->t_state = TCPS_CLOSED; INP_WUNLOCK(inp); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); TCPSTATES_INC(TCPS_CLOSED); return (0); } @@ -2362,7 +2362,7 @@ tcp_disconnect(struct tcpcb *tp) struct inpcb *inp = tp->t_inpcb; struct socket *so = inp->inp_socket; - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + NET_EPOCH_ASSERT(); INP_WLOCK_ASSERT(inp); /* @@ -2401,7 +2401,7 @@ static void tcp_usrclosed(struct tcpcb *tp) { - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + NET_EPOCH_ASSERT(); INP_WLOCK_ASSERT(tp->t_inpcb); switch (tp->t_state) { From owner-svn-src-head@freebsd.org Thu Nov 7 00:27:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7D7F17DD56; Thu, 7 Nov 2019 00:27:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477kkN3y1Cz3M3p; Thu, 7 Nov 2019 00:27:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 669BA56B0; Thu, 7 Nov 2019 00:27:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA70RO6A023827; Thu, 7 Nov 2019 00:27:24 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA70RO5O023826; Thu, 7 Nov 2019 00:27:24 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911070027.xA70RO5O023826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Nov 2019 00:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354423 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 354423 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 00:27:24 -0000 Author: glebius Date: Thu Nov 7 00:27:23 2019 New Revision: 354423 URL: https://svnweb.freebsd.org/changeset/base/354423 Log: TCP timers are executed in callout context, so they need to enter network epoch to look into PCB lists. Mechanically convert INP_INFO_RLOCK() to NET_EPOCH_ENTER(). No functional change here. Modified: head/sys/netinet/tcp_timer.c Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Thu Nov 7 00:10:14 2019 (r354422) +++ head/sys/netinet/tcp_timer.c Thu Nov 7 00:27:23 2019 (r354423) @@ -339,9 +339,9 @@ tcp_timer_2msl(void *xtp) tcp_inpinfo_lock_del(inp, tp); goto out; } - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); tp = tcp_close(tp); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); tcp_inpinfo_lock_del(inp, tp); goto out; } else { @@ -353,9 +353,9 @@ tcp_timer_2msl(void *xtp) tcp_inpinfo_lock_del(inp, tp); goto out; } - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); tp = tcp_close(tp); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); tcp_inpinfo_lock_del(inp, tp); goto out; } @@ -478,7 +478,7 @@ dropit: tcp_inpinfo_lock_del(inp, tp); goto out; } - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); tp = tcp_drop(tp, ETIMEDOUT); #ifdef TCPDEBUG @@ -487,7 +487,7 @@ dropit: PRU_SLOWTIMO); #endif TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); tcp_inpinfo_lock_del(inp, tp); out: CURVNET_RESTORE(); @@ -542,9 +542,9 @@ tcp_timer_persist(void *xtp) tcp_inpinfo_lock_del(inp, tp); goto out; } - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); tp = tcp_drop(tp, ETIMEDOUT); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); tcp_inpinfo_lock_del(inp, tp); goto out; } @@ -559,9 +559,9 @@ tcp_timer_persist(void *xtp) tcp_inpinfo_lock_del(inp, tp); goto out; } - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); tp = tcp_drop(tp, ETIMEDOUT); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); tcp_inpinfo_lock_del(inp, tp); goto out; } @@ -628,9 +628,9 @@ tcp_timer_rexmt(void * xtp) tcp_inpinfo_lock_del(inp, tp); goto out; } - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); tp = tcp_drop(tp, ETIMEDOUT); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); tcp_inpinfo_lock_del(inp, tp); goto out; } From owner-svn-src-head@freebsd.org Thu Nov 7 03:57:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78E781A62D7; Thu, 7 Nov 2019 03:57:07 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477qNM29gDz43vY; Thu, 7 Nov 2019 03:57:07 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EA6A7DA5; Thu, 7 Nov 2019 03:57:07 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA73v7Pw048847; Thu, 7 Nov 2019 03:57:07 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA73v41Y048836; Thu, 7 Nov 2019 03:57:04 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201911070357.xA73v41Y048836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Thu, 7 Nov 2019 03:57:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354427 - in head: contrib/libxo contrib/libxo/doc contrib/libxo/encoder contrib/libxo/encoder/cbor contrib/libxo/encoder/csv contrib/libxo/encoder/test contrib/libxo/libxo contrib/libx... X-SVN-Group: head X-SVN-Commit-Author: phil X-SVN-Commit-Paths: in head: contrib/libxo contrib/libxo/doc contrib/libxo/encoder contrib/libxo/encoder/cbor contrib/libxo/encoder/csv contrib/libxo/encoder/test contrib/libxo/libxo contrib/libxo/tests/core contrib/libx... X-SVN-Commit-Revision: 354427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 03:57:07 -0000 Author: phil Date: Thu Nov 7 03:57:04 2019 New Revision: 354427 URL: https://svnweb.freebsd.org/changeset/base/354427 Log: Import libxo-1.3.0: - move from "oxtradoc" to RST/Sphinx documentation - new "csv" encoder, which allows path and leaf lists - address warnings from PVS-Stdio tool - add "xolint" detected errors to the documentation Added: head/contrib/libxo/doc/encoders.rst - copied unchanged from r354426, vendor/Juniper/libxo/dist/doc/encoders.rst head/contrib/libxo/doc/top-link.html.in - copied unchanged from r354426, vendor/Juniper/libxo/dist/doc/top-link.html.in head/contrib/libxo/encoder/csv/ - copied from r354426, vendor/Juniper/libxo/dist/encoder/csv/ head/contrib/libxo/tests/core/saved/test_01.Ecsv1.err - copied unchanged from r354426, vendor/Juniper/libxo/dist/tests/core/saved/test_01.Ecsv1.err head/contrib/libxo/tests/core/saved/test_01.Ecsv1.out - copied unchanged from r354426, vendor/Juniper/libxo/dist/tests/core/saved/test_01.Ecsv1.out head/contrib/libxo/tests/core/saved/test_01.Ecsv2.err - copied unchanged from r354426, vendor/Juniper/libxo/dist/tests/core/saved/test_01.Ecsv2.err head/contrib/libxo/tests/core/saved/test_01.Ecsv2.out - copied unchanged from r354426, vendor/Juniper/libxo/dist/tests/core/saved/test_01.Ecsv2.out head/contrib/libxo/tests/core/saved/test_01.Ecsv3.err - copied unchanged from r354426, vendor/Juniper/libxo/dist/tests/core/saved/test_01.Ecsv3.err head/contrib/libxo/tests/core/saved/test_01.Ecsv3.out - copied unchanged from r354426, vendor/Juniper/libxo/dist/tests/core/saved/test_01.Ecsv3.out head/lib/libxo/encoder/ head/lib/libxo/encoder/Makefile (contents, props changed) head/lib/libxo/encoder/csv/ head/lib/libxo/encoder/csv/Makefile (contents, props changed) Deleted: head/contrib/libxo/doc/libxo-manual.html head/contrib/libxo/doc/libxo.txt Modified: head/contrib/libxo/Makefile.am head/contrib/libxo/README.md head/contrib/libxo/configure.ac head/contrib/libxo/doc/Makefile.am head/contrib/libxo/doc/api.rst head/contrib/libxo/doc/conf.py head/contrib/libxo/doc/faq.rst head/contrib/libxo/doc/field-formatting.rst head/contrib/libxo/doc/field-modifiers.rst head/contrib/libxo/doc/field-roles.rst head/contrib/libxo/doc/index.rst head/contrib/libxo/doc/options.rst head/contrib/libxo/doc/xo.rst head/contrib/libxo/doc/xohtml.rst head/contrib/libxo/doc/xolint.rst head/contrib/libxo/doc/xopo.rst head/contrib/libxo/encoder/Makefile.am head/contrib/libxo/encoder/cbor/enc_cbor.c head/contrib/libxo/encoder/test/enc_test.c head/contrib/libxo/libxo/add.man.in head/contrib/libxo/libxo/libxo.c head/contrib/libxo/libxo/xo_buf.h head/contrib/libxo/libxo/xo_encoder.c head/contrib/libxo/libxo/xo_encoder.h head/contrib/libxo/tests/core/Makefile.am head/contrib/libxo/tests/core/saved/test_01.E.out head/contrib/libxo/tests/core/saved/test_01.H.out head/contrib/libxo/tests/core/saved/test_01.HIPx.out head/contrib/libxo/tests/core/saved/test_01.HP.out head/contrib/libxo/tests/core/saved/test_01.J.out head/contrib/libxo/tests/core/saved/test_01.JP.out head/contrib/libxo/tests/core/saved/test_01.T.out head/contrib/libxo/tests/core/saved/test_01.X.out head/contrib/libxo/tests/core/saved/test_01.XP.out head/contrib/libxo/tests/core/saved/test_02.E.out head/contrib/libxo/tests/core/saved/test_03.E.out head/contrib/libxo/tests/core/saved/test_04.E.out head/contrib/libxo/tests/core/saved/test_05.E.out head/contrib/libxo/tests/core/saved/test_06.E.out head/contrib/libxo/tests/core/saved/test_07.E.out head/contrib/libxo/tests/core/saved/test_08.E.out head/contrib/libxo/tests/core/saved/test_09.E.out head/contrib/libxo/tests/core/saved/test_10.E.out head/contrib/libxo/tests/core/saved/test_11.E.out head/contrib/libxo/tests/core/saved/test_12.E.err head/contrib/libxo/tests/core/saved/test_12.E.out head/contrib/libxo/tests/core/saved/test_12.H.err head/contrib/libxo/tests/core/saved/test_12.HIPx.err head/contrib/libxo/tests/core/saved/test_12.HP.err head/contrib/libxo/tests/core/saved/test_12.J.err head/contrib/libxo/tests/core/saved/test_12.JP.err head/contrib/libxo/tests/core/saved/test_12.T.err head/contrib/libxo/tests/core/saved/test_12.X.err head/contrib/libxo/tests/core/saved/test_12.XP.err head/contrib/libxo/tests/core/test_01.c head/contrib/libxo/tests/core/test_02.c head/contrib/libxo/tests/core/test_03.c head/contrib/libxo/tests/core/test_08.c head/contrib/libxo/tests/core/test_09.c head/contrib/libxo/tests/core/test_10.c head/contrib/libxo/tests/core/test_11.c head/contrib/libxo/tests/core/test_12.c head/contrib/libxo/tests/gettext/gt_01.c head/contrib/libxo/tests/gettext/saved/gt_01.H.out head/contrib/libxo/tests/gettext/saved/gt_01.HIPx.out head/contrib/libxo/tests/gettext/saved/gt_01.HP.out head/contrib/libxo/tests/gettext/saved/gt_01.J.out head/contrib/libxo/tests/gettext/saved/gt_01.JP.out head/contrib/libxo/tests/gettext/saved/gt_01.T.out head/contrib/libxo/tests/gettext/saved/gt_01.X.out head/contrib/libxo/tests/gettext/saved/gt_01.XP.out head/contrib/libxo/tests/xo/saved/xo_02.H.err head/contrib/libxo/tests/xo/saved/xo_02.HIPx.err head/contrib/libxo/tests/xo/saved/xo_02.HP.err head/contrib/libxo/tests/xo/saved/xo_02.J.err head/contrib/libxo/tests/xo/saved/xo_02.JP.err head/contrib/libxo/tests/xo/saved/xo_02.T.err head/contrib/libxo/tests/xo/saved/xo_02.X.err head/contrib/libxo/tests/xo/saved/xo_02.XP.err head/contrib/libxo/xo/xo.c head/contrib/libxo/xolint/xolint.pl head/lib/libxo/Makefile head/lib/libxo/add.man head/lib/libxo/xo_config.h head/usr.bin/xohtml/xohtml.sh Directory Properties: head/contrib/libxo/ (props changed) Modified: head/contrib/libxo/Makefile.am ============================================================================== --- head/contrib/libxo/Makefile.am Thu Nov 7 03:47:13 2019 (r354426) +++ head/contrib/libxo/Makefile.am Thu Nov 7 03:57:04 2019 (r354427) @@ -32,7 +32,6 @@ errors: docs: @(cd doc ; ${MAKE} docs) - DIST_FILES_DIR = ~/Dropbox/dist-files/ GH_PAGES_DIR = gh-pages/ GH_PAGES_DIR_VER = gh-pages/${PACKAGE_VERSION} @@ -49,18 +48,20 @@ upload: dist upload-docs upload-xohtml-files @echo "Remember to run:" @echo " gt tag ${PACKAGE_VERSION}" -upload-docs: docs - @echo "Uploading libxo-manual.html ... " - @-[ -d ${GH_PAGES_DIR} ] \ - && echo "Updating manual on gh-pages ..." \ - && mkdir -p ${GH_PAGES_DIR_VER} \ - && cp doc/libxo-manual.html ${GH_PAGES_DIR} \ - && cp doc/libxo-manual.html ${GH_PAGES_DIR_VER} \ +upload-docs: docs upload-html + +upload-html: + @echo "Uploading html ... " + @-[ -d ${GH_PAGES_DIR} -a -d doc/html ] \ + && echo "Updating html on gh-pages ..." \ + && mkdir -p ${GH_PAGES_DIR_VER}/html \ + && cp doc/top-link.html ${GH_PAGES_DIR}/libxo.html \ + && cp -r doc/html/* ${GH_PAGES_DIR_VER}/html/ \ && (cd ${GH_PAGES_DIR} \ - && git add ${PACKAGE_VERSION} \ - && git add libxo-manual.html \ + && git add libxo.html \ + && git add ${PACKAGE_VERSION}/html \ && git commit -m 'new docs' \ - libxo-manual.html ${PACKAGE_VERSION} \ + libxo.html ${PACKAGE_VERSION}/html \ && git push origin gh-pages ) ; true upload-xohtml-files: Modified: head/contrib/libxo/README.md ============================================================================== --- head/contrib/libxo/README.md Thu Nov 7 03:47:13 2019 (r354426) +++ head/contrib/libxo/README.md Thu Nov 7 03:57:04 2019 (r354427) @@ -10,6 +10,9 @@ application calls a function "xo_emit" to product outp described in a format string. A "field descriptor" tells libxo what the field is and what it means. +Imagine a simplified ``wc`` that emits its output fields in a single +xo_emit call: + ``` xo_emit(" {:lines/%7ju/%ju} {:words/%7ju/%ju} " "{:characters/%7ju/%ju}{d:filename/%s}\n", Modified: head/contrib/libxo/configure.ac ============================================================================== --- head/contrib/libxo/configure.ac Thu Nov 7 03:47:13 2019 (r354426) +++ head/contrib/libxo/configure.ac Thu Nov 7 03:57:04 2019 (r354427) @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [1.0.4], [phil@juniper.net]) +AC_INIT([libxo], [1.3.0], [phil@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) # Support silent build rules. Requires at least automake-1.11. @@ -452,6 +452,7 @@ AC_CONFIG_FILES([ libxo/add.man encoder/Makefile encoder/cbor/Makefile + encoder/csv/Makefile encoder/test/Makefile xo/Makefile xolint/Makefile @@ -459,6 +460,7 @@ AC_CONFIG_FILES([ xopo/Makefile packaging/libxo.pc doc/Makefile + doc/top-link.html tests/Makefile tests/core/Makefile tests/gettext/Makefile Modified: head/contrib/libxo/doc/Makefile.am ============================================================================== --- head/contrib/libxo/doc/Makefile.am Thu Nov 7 03:47:13 2019 (r354426) +++ head/contrib/libxo/doc/Makefile.am Thu Nov 7 03:57:04 2019 (r354427) @@ -8,68 +8,22 @@ # using the SOFTWARE, you agree to be bound by the terms of that # LICENSE. -if HAVE_OXTRADOC -OXTRADOC_DIR = ${SLAX_OXTRADOCDIR} -OXTRADOC_PREFIX = ${OXTRADOC_DIR} -OXTRADOC = ${OXTRADOC_DIR}/oxtradoc -SLAXPROC_BINDIR = ${SLAX_BINDIR} +doc docs: xolint.rst html -XML2RFC = ${OXTRADOC_DIR}/xml2rfc.tcl -XML2HTMLDIR = ${OXTRADOC_DIR} -XML2HTMLBIN = ${XML2HTMLDIR}/rfc2629-to-html.slax -SLAXPROC = ${SLAX_BINDIR}/slaxproc +# +# The contents of xolint.rst is generated based on xolint.pl, since we +# really want this to be self-documenting. But readthedocs.org needs this +# data to be _in_ repo. So we generate this file on command only, and +# the developer needs to commit any changes. +# -SLAXPROC_ARGS = \ - -a oxtradoc-dir ${OXTRADOC_DIR} \ - -a oxtradoc-install-dir ${OXTRADOC_DIR} \ - -a anchor-prefix docs +xolint.rst: ${top_srcdir}/xolint/xolint.pl + perl ${top_srcdir}/xolint/xolint.pl -D > ${top_srcdir}/doc/xolint.rst -SLAXPROC_ARGS_INLINE = \ - -a oxtradoc-inline yes +SPHINX = python3 -msphinx -SLAXPROC_ARGS += ${SLAXPROC_ARGS_INLINE} - -XML2HTML = \ - ${SLAXPROC} -g -e -I ${OXTRADOC_DIR} -I . \ - ${SLAXPROC_ARGS} \ - ${XML2HTMLBIN} - -OX_ARGS = -P ${OXTRADOC_PREFIX} -L ${OXTRADOC_PREFIX} -OX_ARGS += -S ${SLAXPROC} -p doc -OX_CMD = ${PERL} ${PERLOPTS} ${OXTRADOC} ${OX_ARGS} -OXTRADOC_CMD = ${OX_CMD} - -OUTPUT = libxo-manual -INPUT = libxo - -EXTRA_DIST = \ - ${INPUT}.txt \ - ${OUTPUT}.html \ - ${OUTPUT}.txt - -doc docs: ${OUTPUT}.txt ${OUTPUT}.html - -${OUTPUT}.txt: ${INPUT}.txt ${OXTRADOC} xolint.txt - ${OXTRADOC_CMD} -m text -o $@ $< - -${OUTPUT}.html: ${INPUT}.txt ${OXTRADOC} ${XML2HTMLBIN} xolint.txt - ${OXTRADOC_CMD} -m html -o $@ $< - -xolint.txt: ${top_srcdir}/xolint/xolint.pl - perl ${top_srcdir}/xolint/xolint.pl -D > xolint.txt - -CLEANFILES = \ -xolint.txt \ -${INPUT}.xml \ -${INPUT}.fxml \ -${OUTPUT}.txt \ -${OUTPUT}.html -else -doc docs: - @${ECHO} "The 'oxtradoc' tool is not installed; see libslax.org" -endif - -SPHINX = python3.4 -msphinx - html sphinx sphinx-html: - ${SPHINX} -M html ${srcdir} . + ${SPHINX} -M html ${srcdir} . -N -E + +singlehtml: + ${SPHINX} -M singlehtml ${srcdir} . -N -E Modified: head/contrib/libxo/doc/api.rst ============================================================================== --- head/contrib/libxo/doc/api.rst Thu Nov 7 03:47:13 2019 (r354426) +++ head/contrib/libxo/doc/api.rst Thu Nov 7 03:57:04 2019 (r354427) @@ -1,4 +1,4 @@ -.. index: API +.. index:: API The libxo API ============= @@ -155,14 +155,14 @@ Output Styles (XO_STYLE\_\*) The libxo functions accept a set of output styles: -=============== ========================= - Flag Description -=============== ========================= - XO_STYLE_TEXT Traditional text output - XO_STYLE_XML XML encoded data - XO_STYLE_JSON JSON encoded data - XO_STYLE_HTML HTML encoded data -=============== ========================= + =============== ========================= + Flag Description + =============== ========================= + XO_STYLE_TEXT Traditional text output + XO_STYLE_XML XML encoded data + XO_STYLE_JSON JSON encoded data + XO_STYLE_HTML HTML encoded data + =============== ========================= The "XML", "JSON", and "HTML" output styles all use the UTF-8 character encoding. "TEXT" using locale-based encoding. @@ -256,26 +256,26 @@ Flags (XOF\_\*) The set of valid flags include: -=================== ========================================= - Flag Description -=================== ========================================= - XOF_CLOSE_FP Close file pointer on `xo_destroy` - XOF_COLOR Enable color and effects in output - XOF_COLOR_ALLOWED Allow color/effect for terminal output - XOF_DTRT Enable "do the right thing" mode - XOF_INFO Display info data attributes (HTML) - XOF_KEYS Emit the key attribute (XML) - XOF_NO_ENV Do not use the :ref:`libxo-options` env var - XOF_NO_HUMANIZE Display humanization (TEXT, HTML) - XOF_PRETTY Make "pretty printed" output - XOF_UNDERSCORES Replaces hyphens with underscores - XOF_UNITS Display units (XML, HMTL) - XOF_WARN Generate warnings for broken calls - XOF_WARN_XML Generate warnings in XML on stdout - XOF_XPATH Emit XPath expressions (HTML) - XOF_COLUMNS Force xo_emit to return columns used - XOF_FLUSH Flush output after each `xo_emit` call -=================== ========================================= + =================== ========================================= + Flag Description + =================== ========================================= + XOF_CLOSE_FP Close file pointer on `xo_destroy` + XOF_COLOR Enable color and effects in output + XOF_COLOR_ALLOWED Allow color/effect for terminal output + XOF_DTRT Enable "do the right thing" mode + XOF_INFO Display info data attributes (HTML) + XOF_KEYS Emit the key attribute (XML) + XOF_NO_ENV Do not use the :ref:`libxo-options` env var + XOF_NO_HUMANIZE Display humanization (TEXT, HTML) + XOF_PRETTY Make "pretty printed" output + XOF_UNDERSCORES Replaces hyphens with underscores + XOF_UNITS Display units (XML, HMTL) + XOF_WARN Generate warnings for broken calls + XOF_WARN_XML Generate warnings in XML on stdout + XOF_XPATH Emit XPath expressions (HTML) + XOF_COLUMNS Force xo_emit to return columns used + XOF_FLUSH Flush output after each `xo_emit` call + =================== ========================================= The `XOF_CLOSE_FP` flag will trigger the call of the *close_func* (provided via `xo_set_writer`) when the handle is destroyed. @@ -300,12 +300,12 @@ regardless of whether warnings are enabled. If the style is `XO_STYLE_HTML`, the following additional flags can be used: -=============== ========================================= - Flag Description -=============== ========================================= - XOF_XPATH Emit "data-xpath" attributes - XOF_INFO Emit additional info fields -=============== ========================================= + =============== ========================================= + Flag Description + =============== ========================================= + XOF_XPATH Emit "data-xpath" attributes + XOF_INFO Emit additional info fields + =============== ========================================= The `XOF_XPATH` flag enables the emission of XPath expressions detailing the hierarchy of XML elements used to encode the data field, if the @@ -317,11 +317,11 @@ output. See :ref:`field-information` for details. If the style is `XO_STYLE_XML`, the following additional flags can be used: -=============== ========================================= - Flag Description -=============== ========================================= - XOF_KEYS Flag "key" fields for XML -=============== ========================================= + =============== ========================================= + Flag Description + =============== ========================================= + XOF_KEYS Flag "key" fields for XML + =============== ========================================= The `XOF_KEYS` flag adds "key" attribute to the XML encoding for field definitions that use the "k" modifier. The key attribute has @@ -1308,52 +1308,52 @@ These values are defined in . The priority value indicates the importance and potential impact of each message: -============= ======================================================= - Priority Description -============= ======================================================= - LOG_EMERG A panic condition, normally broadcast to all users - LOG_ALERT A condition that should be corrected immediately - LOG_CRIT Critical conditions - LOG_ERR Generic errors - LOG_WARNING Warning messages - LOG_NOTICE Non-error conditions that might need special handling - LOG_INFO Informational messages - LOG_DEBUG Developer-oriented messages -============= ======================================================= + ============= ======================================================= + Priority Description + ============= ======================================================= + LOG_EMERG A panic condition, normally broadcast to all users + LOG_ALERT A condition that should be corrected immediately + LOG_CRIT Critical conditions + LOG_ERR Generic errors + LOG_WARNING Warning messages + LOG_NOTICE Non-error conditions that might need special handling + LOG_INFO Informational messages + LOG_DEBUG Developer-oriented messages + ============= ======================================================= The facility value indicates the source of message, in fairly generic terms: -=============== ======================================================= - Facility Description -=============== ======================================================= - LOG_AUTH The authorization system (e.g. :manpage:`login(1)`) - LOG_AUTHPRIV As LOG_AUTH, but logged to a privileged file - LOG_CRON The cron daemon: :manpage:`cron(8)` - LOG_DAEMON System daemons, not otherwise explicitly listed - LOG_FTP The file transfer protocol daemons - LOG_KERN Messages generated by the kernel - LOG_LPR The line printer spooling system - LOG_MAIL The mail system - LOG_NEWS The network news system - LOG_SECURITY Security subsystems, such as :manpage:`ipfw(4)` - LOG_SYSLOG Messages generated internally by :manpage:`syslogd(8)` - LOG_USER Messages generated by user processes (default) - LOG_UUCP The uucp system - LOG_LOCAL0..7 Reserved for local use -=============== ======================================================= + =============== ======================================================= + Facility Description + =============== ======================================================= + LOG_AUTH The authorization system (e.g. :manpage:`login(1)`) + LOG_AUTHPRIV As LOG_AUTH, but logged to a privileged file + LOG_CRON The cron daemon: :manpage:`cron(8)` + LOG_DAEMON System daemons, not otherwise explicitly listed + LOG_FTP The file transfer protocol daemons + LOG_KERN Messages generated by the kernel + LOG_LPR The line printer spooling system + LOG_MAIL The mail system + LOG_NEWS The network news system + LOG_SECURITY Security subsystems, such as :manpage:`ipfw(4)` + LOG_SYSLOG Messages generated internally by :manpage:`syslogd(8)` + LOG_USER Messages generated by user processes (default) + LOG_UUCP The uucp system + LOG_LOCAL0..7 Reserved for local use + =============== ======================================================= In addition to the values listed above, xo_open_log accepts a set of addition flags requesting specific logging behaviors: -============ ==================================================== - Flag Description -============ ==================================================== - LOG_CONS If syslogd fails, attempt to write to /dev/console - LOG_NDELAY Open the connection to :manpage:`syslogd(8)` immediately - LOG_PERROR Write the message also to standard error output - LOG_PID Log the process id with each message -============ ==================================================== + ============ ==================================================== + Flag Description + ============ ==================================================== + LOG_CONS If syslogd fails, attempt to write to /dev/console + LOG_NDELAY Open the connection to :manpage:`syslogd(8)` immediately + LOG_PERROR Write the message also to standard error output + LOG_PID Log the process id with each message + ============ ==================================================== .. index:: xo_syslog @@ -1588,26 +1588,26 @@ processing model of libxo. Content is formatted withi callbacks are made to the encoder's handler function when data is ready to be processed: -======================= ======================================= - Operation Meaning (Base function) -======================= ======================================= - XO_OP_CREATE Called when the handle is created - XO_OP_OPEN_CONTAINER Container opened (xo_open_container) - XO_OP_CLOSE_CONTAINER Container closed (xo_close_container) - XO_OP_OPEN_LIST List opened (xo_open_list) - XO_OP_CLOSE_LIST List closed (xo_close_list) - XO_OP_OPEN_LEAF_LIST Leaf list opened (xo_open_leaf_list) - XO_OP_CLOSE_LEAF_LIST Leaf list closed (xo_close_leaf_list) - XO_OP_OPEN_INSTANCE Instance opened (xo_open_instance) - XO_OP_CLOSE_INSTANCE Instance closed (xo_close_instance) - XO_OP_STRING Field with Quoted UTF-8 string - XO_OP_CONTENT Field with content - XO_OP_FINISH Finish any pending output - XO_OP_FLUSH Flush any buffered output - XO_OP_DESTROY Clean up resources - XO_OP_ATTRIBUTE An attribute name/value pair - XO_OP_VERSION A version string -======================= ======================================= + ======================= ======================================= + Operation Meaning (Base function) + ======================= ======================================= + XO_OP_CREATE Called when the handle is created + XO_OP_OPEN_CONTAINER Container opened (xo_open_container) + XO_OP_CLOSE_CONTAINER Container closed (xo_close_container) + XO_OP_OPEN_LIST List opened (xo_open_list) + XO_OP_CLOSE_LIST List closed (xo_close_list) + XO_OP_OPEN_LEAF_LIST Leaf list opened (xo_open_leaf_list) + XO_OP_CLOSE_LEAF_LIST Leaf list closed (xo_close_leaf_list) + XO_OP_OPEN_INSTANCE Instance opened (xo_open_instance) + XO_OP_CLOSE_INSTANCE Instance closed (xo_close_instance) + XO_OP_STRING Field with Quoted UTF-8 string + XO_OP_CONTENT Field with content + XO_OP_FINISH Finish any pending output + XO_OP_FLUSH Flush any buffered output + XO_OP_DESTROY Clean up resources + XO_OP_ATTRIBUTE An attribute name/value pair + XO_OP_VERSION A version string + ======================= ======================================= For all the open and close operations, the name parameter holds the name of the construct. For string, content, and attribute operations, Modified: head/contrib/libxo/doc/conf.py ============================================================================== --- head/contrib/libxo/doc/conf.py Thu Nov 7 03:47:13 2019 (r354426) +++ head/contrib/libxo/doc/conf.py Thu Nov 7 03:57:04 2019 (r354427) @@ -21,7 +21,15 @@ # import sys # sys.path.insert(0, os.path.abspath('.')) +import subprocess +# +# Instead of hardcoding the version number here, we read it from the +# project's configure script +# +vers_cmd = "grep AC_INIT ../configure.ac | awk '{ print substr($2, 2, length($2) - 3);}'" +version = subprocess.check_output(vers_cmd, shell=True).decode("utf-8") + # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. @@ -47,7 +55,7 @@ master_doc = 'index' # General information about the project. project = 'libxo' -copyright = '2017, Juniper Networks' +copyright = '2017-2019, Juniper Networks Inc' author = 'Phil Shafer' default_role = 'code' primary_domain = 'c' @@ -58,9 +66,9 @@ smart_quotes = False # built documents. # # The short X.Y version. -version = '0.8.4' +#version = 'develop' # The full version, including alpha/beta/rc tags. -release = '0.8.4' +release = version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. Copied: head/contrib/libxo/doc/encoders.rst (from r354426, vendor/Juniper/libxo/dist/doc/encoders.rst) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libxo/doc/encoders.rst Thu Nov 7 03:57:04 2019 (r354427, copy of r354426, vendor/Juniper/libxo/dist/doc/encoders.rst) @@ -0,0 +1,269 @@ +.. index:: encoder + +Encoders +======== + +This section gives an overview of encoders, details on the encoders +that ship with libxo, and documentation for developers of future +encoders. + +Overview +-------- + +The libxo library contains software to generate four "built-in" +formats: text, XML, JSON, and HTML. These formats are common and +useful, but there are other common and useful formats that users will +want, and including them all in the libxo software would be difficult +and cumbersome. + +To allow support for additional encodings, libxo includes a +"pluggable" extension mechanism for dynamically loading new encoders. +libxo-based applications can automatically use any installed encoder. + +Use the "encoder=XXX" option to access encoders. The following +example uses the "cbor" encoder, saving the output into a file:: + + df --libxo encoder=cbor > df-output.cbor + +Encoders can support specific options that can be accessed by +following the encoder name with a colon (':') and one of more options, +separated by a plus sign "+":: + + df --libxo encoder=csv:path=filesystem+leaf=name+no-header + +This example instructs libxo to load the "csv" encoder and pass the +following options:: + + path=filesystem + leaf=name + no-header + +Each of these option is interpreted by the encoder, and all such +options names and semantics are specific to the particular encoder. +Refer to the intended encoder for documentation on its options. + +.. _csv_encoder: + +CSV - Comma Separated Values +---------------------------- + +libxo ships with a custom encoder for "CSV" files, a common format for +comma separated values. The output of the CSV encoder can be loaded +directly into spreadsheets or similar applications. + +A standard for CSV files is provided in :RFC:`4180`, but since the +format predates that standard by decades, there are many minor +differences in CSV file consumers and their expectations. The CSV +encoder has a number of options to tailor output to those +expectations. + +Consider the following XML:: + + % list-items --libxo xml,pretty + + + + GRO-000-415 + gum + 1412 + 54 + 10 + + + HRD-000-212 + rope + 85 + 4 + 2 + + + HRD-000-517 + ladder + 0 + 2 + 1 + + + + +This output is a list of `instances` (named "item"), each containing a +set of `leafs` ("sku", "name", etc). + +The CSV encoder will emit the leaf values in this output as `fields` +inside a CSV `record`, which is a line containing a set of +comma-separated values:: + + % list-items --libxo encoder=csv + sku,name,sold,in-stock,on-order + GRO-000-415,gum,1412,54,10 + HRD-000-212,rope,85,4,2 + HRD-000-517,ladder,0,2,1 + +Be aware that since the CSV encoder looks for data instances, when +used with :ref:`xo`, the `--instance` option will be needed:: + + % xo --libxo encoder=csv --instance foo 'The {:product} is {:status}\n' stereo "in route" + product,status + stereo,in route + +.. _csv_path: + +The `path` Option +~~~~~~~~~~~~~~~~~ + +By default, the CSV encoder will attempt to emit any list instance +generated by the application. In some cases, this may be +unacceptable, and a specific list may be desired. + +Use the "path" option to limit the processing of output to a specific +hierarchy. The path should be one or more names of containers or +lists. + +For example, if the "list-items" application generates other lists, +the user can give "path=top/data/item" as a path:: + + % list-items --libxo encoder=csv:path=top/data/item + sku,name,sold,in-stock,on-order + GRO-000-415,gum,1412,54,10 + HRD-000-212,rope,85,4,2 + HRD-000-517,ladder,0,2,1 + +Paths are "relative", meaning they need not be a complete set +of names to the list. This means that "path=item" may be sufficient +for the above example. + +.. _csv_leafs: + +The `leafs` Option +~~~~~~~~~~~~~~~~~~ + +The CSV encoding requires that all lines of output have the same +number of fields with the same order. In contrast, XML and JSON allow +any order (though libxo forces key leafs to appear before other +leafs). + +To maintain a consistent set of fields inside the CSV file, the same +set of leafs must be selected from each list item. By default, the +CSV encoder records the set of leafs that appear in the first list +instance it processes, and extract only those leafs from future +instances. If the first instance is missing a leaf that is desired by +the consumer, the "leaf" option can be used to ensure that an empty +value is recorded for instances that lack a particular leaf. + +The "leafs" option can also be used to exclude leafs, limiting the +output to only those leafs provided. + +In addition, the order of the output fields follows the order in which +the leafs are listed. "leafs=one.two" and "leafs=two.one" give +distinct output. + +So the "leafs" option can be used to expand, limit, and order the set +of leafs. + +The value of the leafs option should be one or more leaf names, +separated by a period ("."):: + + % list-items --libxo encoder=csv:leafs=sku.on-order + sku,on-order + GRO-000-415,10 + HRD-000-212,2 + HRD-000-517,1 + % list-items -libxo encoder=csv:leafs=on-order.sku + on-order,sku + 10,GRO-000-415 + 2,HRD-000-212 + 1,HRD-000-517 + +Note that since libxo uses terminology from YANG (:RFC:`7950`), the +data modeling language for NETCONF (:RFC:`6241`), which uses "leafs" +as the plural form of "leaf". libxo follows that convention. + +.. _csv_no_header: + +The `no-header` Option +~~~~~~~~~~~~~~~~~~~~~~ + +CSV files typical begin with a line that defines the fields included +in that file, in an attempt to make the contents self-defining:: + + sku,name,sold,in-stock,on-order + GRO-000-415,gum,1412,54,10 + HRD-000-212,rope,85,4,2 + HRD-000-517,ladder,0,2,1 + +There is no reliable mechanism for determining whether this header +line is included, so the consumer must make an assumption. + +The csv encoder defaults to producing the header line, but the +"no-header" option can be included to avoid the header line. + +.. _csv_no_quotes: + +The `no-quotes` Option +~~~~~~~~~~~~~~~~~~~~~~ + +:RFC:`4180` specifies that fields containing spaces should be quoted, but +many CSV consumers do not handle quotes. The "no-quotes" option +instruct the CSV encoder to avoid the use of quotes. + +.. _csv_dos: + +The `dos` Option +~~~~~~~~~~~~~~~~ + +:RFC:`4180` defines the end-of-line marker as a carriage return +followed by a newline. This `CRLF` convention dates from the distant +past, but its use was anchored in the 1980s by the `DOS` operating +system. + +The CSV encoder defaults to using the standard Unix end-of-line +marker, a simple newline. Use the "dos" option to use the `CRLF` +convention. + +The Encoder API +--------------- + +The encoder API consists of three distinct phases: + +- loading the encoder +- initializing the encoder +- feeding operations to the encoder + +To load the encoder, libxo will open a shared library named: + + ${prefix}/lib/libxo/encoder/${name}.enc + +This file is typically a symbolic link to a dynamic library, suitable +for `dlopen`(). libxo looks for a symbol called +`xo_encoder_library_init` inside that library and calls it with the +arguments defined in the header file "xo_encoder.h". This function +should look as follows:: + + int + xo_encoder_library_init (XO_ENCODER_INIT_ARGS) + { + arg->xei_version = XO_ENCODER_VERSION; + arg->xei_handler = test_handler; + + return 0; + } + +Several features here allow for future compatibility: the macro +XO_ENCODER_INIT_ARGS allows the arguments to this function change over +time, and the XO_ENCODER_VERSION allows the library to tell libxo +which version of the API it was compiled with. + +The function places in xei_handler should be have the signature:: + + static int + test_handler (XO_ENCODER_HANDLER_ARGS) + { + ... + +This function will be called with the "op" codes defined in +"xo_encoder.h". Each op code represents a distinct event in the libxo +processing model. For example OP_OPEN_CONTAINER tells the encoder +that a new container has been opened, and the encoder can behave in an +appropriate manner. + + Modified: head/contrib/libxo/doc/faq.rst ============================================================================== --- head/contrib/libxo/doc/faq.rst Thu Nov 7 03:47:13 2019 (r354426) +++ head/contrib/libxo/doc/faq.rst Thu Nov 7 03:57:04 2019 (r354427) @@ -202,8 +202,7 @@ will lead users to ask the difference between the two there is no difference, use only one of the field names. If there is a difference, change the names to make that difference more obvious. -.. ignore for now, since we want can't have generated content - What does this message mean? - ---------------------------- +What does this message mean? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - !!include-file xolint.txt +.. include:: xolint.rst Modified: head/contrib/libxo/doc/field-formatting.rst ============================================================================== --- head/contrib/libxo/doc/field-formatting.rst Thu Nov 7 03:47:13 2019 (r354426) +++ head/contrib/libxo/doc/field-formatting.rst Thu Nov 7 03:57:04 2019 (r354427) @@ -53,48 +53,48 @@ removed eventually. The format character is described in the following table: -===== ================= ====================== - Ltr Argument Type Format -===== ================= ====================== - d int base 10 (decimal) - i int base 10 (decimal) - o int base 8 (octal) - u unsigned base 10 (decimal) - x unsigned base 16 (hex) - X unsigned long base 16 (hex) - D long base 10 (decimal) - O unsigned long base 8 (octal) - U unsigned long base 10 (decimal) - e double [-]d.ddde+-dd - E double [-]d.dddE+-dd - f double [-]ddd.ddd - F double [-]ddd.ddd - g double as 'e' or 'f' - G double as 'E' or 'F' - a double [-]0xh.hhhp[+-]d - A double [-]0Xh.hhhp[+-]d - c unsigned char a character - C wint_t a character - s char \* a UTF-8 string - S wchar_t \* a unicode/WCS string - p void \* '%#lx' -===== ================= ====================== + ===== ================= ====================== + Ltr Argument Type Format + ===== ================= ====================== + d int base 10 (decimal) + i int base 10 (decimal) + o int base 8 (octal) + u unsigned base 10 (decimal) + x unsigned base 16 (hex) + X unsigned long base 16 (hex) + D long base 10 (decimal) + O unsigned long base 8 (octal) + U unsigned long base 10 (decimal) + e double [-]d.ddde+-dd + E double [-]d.dddE+-dd + f double [-]ddd.ddd + F double [-]ddd.ddd + g double as 'e' or 'f' + G double as 'E' or 'F' + a double [-]0xh.hhhp[+-]d + A double [-]0Xh.hhhp[+-]d + c unsigned char a character + C wint_t a character + s char \* a UTF-8 string + S wchar_t \* a unicode/WCS string + p void \* '%#lx' + ===== ================= ====================== The 'h' and 'l' modifiers affect the size and treatment of the argument: -===== ============= ==================== - Mod d, i o, u, x, X -===== ============= ==================== - hh signed char unsigned char - h short unsigned short - l long unsigned long - ll long long unsigned long long - j intmax_t uintmax_t - t ptrdiff_t ptrdiff_t - z size_t size_t - q quad_t u_quad_t -===== ============= ==================== + ===== ============= ==================== + Mod d, i o, u, x, X + ===== ============= ==================== + hh signed char unsigned char + h short unsigned short + l long unsigned long + ll long long unsigned long long + j intmax_t uintmax_t + t ptrdiff_t ptrdiff_t + z size_t size_t + q quad_t u_quad_t + ===== ============= ==================== .. index:: UTF-8 .. index:: Locale @@ -122,14 +122,14 @@ style:: xo_emit("All strings are utf-8 content {:tag/%ls}", L"except for wide strings"); -======== ================== =============================== - Format Argument Type Argument Contents -======== ================== =============================== - %s const char \* UTF-8 string - %S const char \* UTF-8 string (alias for '%ls') - %ls const wchar_t \* Wide character UNICODE string - %hs const char * locale-based string -======== ================== =============================== + ======== ================== =============================== + Format Argument Type Argument Contents + ======== ================== =============================== + %s const char \* UTF-8 string + %S const char \* UTF-8 string (alias for '%ls') + %ls const wchar_t \* Wide character UNICODE string + %hs const char * locale-based string + ======== ================== =============================== .. admonition:: "Long", not "locale" @@ -266,21 +266,21 @@ incompatible with printf-like testing: If none of these features are in use by your code, then using the "_p" variants might be wise: -================== ======================== - Function printf-like Equivalent -================== ======================== - xo_emit_hv xo_emit_hvp - xo_emit_h xo_emit_hp - xo_emit xo_emit_p - xo_emit_warn_hcv xo_emit_warn_hcvp - xo_emit_warn_hc xo_emit_warn_hcp - xo_emit_warn_c xo_emit_warn_cp - xo_emit_warn xo_emit_warn_p - xo_emit_warnx xo_emit_warnx_p - xo_emit_err xo_emit_err_p - xo_emit_errx xo_emit_errx_p - xo_emit_errc xo_emit_errc_p -================== ======================== + ================== ======================== + Function printf-like Equivalent + ================== ======================== + xo_emit_hv xo_emit_hvp + xo_emit_h xo_emit_hp + xo_emit xo_emit_p + xo_emit_warn_hcv xo_emit_warn_hcvp + xo_emit_warn_hc xo_emit_warn_hcp + xo_emit_warn_c xo_emit_warn_cp + xo_emit_warn xo_emit_warn_p + xo_emit_warnx xo_emit_warnx_p + xo_emit_err xo_emit_err_p + xo_emit_errx xo_emit_errx_p + xo_emit_errc xo_emit_errc_p + ================== ======================== .. index:: performance .. index:: XOEF_RETAIN @@ -305,16 +305,16 @@ xo_emit_f() function. A complete set of xo_emit_f fun match all the xo_emit function signatures (with handles, varadic argument, and printf-like flags): -================== ======================== - Function Flags Equivalent -================== ======================== - xo_emit_hv xo_emit_hvf - xo_emit_h xo_emit_hf - xo_emit xo_emit_f - xo_emit_hvp xo_emit_hvfp - xo_emit_hp xo_emit_hfp - xo_emit_p xo_emit_fp -================== ======================== + ================== ======================== + Function Flags Equivalent + ================== ======================== + xo_emit_hv xo_emit_hvf + xo_emit_h xo_emit_hf + xo_emit xo_emit_f + xo_emit_hvp xo_emit_hvfp + xo_emit_hp xo_emit_hfp + xo_emit_p xo_emit_fp + ================== ======================== The format string must be immutable across multiple calls to xo_emit_f(), since the library retains the string. Typically this is done by using Modified: head/contrib/libxo/doc/field-modifiers.rst ============================================================================== --- head/contrib/libxo/doc/field-modifiers.rst Thu Nov 7 03:47:13 2019 (r354426) +++ head/contrib/libxo/doc/field-modifiers.rst Thu Nov 7 03:57:04 2019 (r354427) @@ -8,26 +8,26 @@ Field Modifiers Field modifiers are flags which modify the way content emitted for particular output styles: -=== =============== =================================================== - M Name Description -=== =============== =================================================== - a argument The content appears as a 'const char \*' argument - c colon A colon (":") is appended after the label - d display Only emit field for display styles (text/HTML) - e encoding Only emit for encoding styles (XML/JSON) - g gettext Call gettext on field's render content - h humanize (hn) Format large numbers in human-readable style -\ hn-space Humanize: Place space between numeric and unit -\ hn-decimal Humanize: Add a decimal digit, if number < 10 -\ hn-1000 Humanize: Use 1000 as divisor instead of 1024 - k key Field is a key, suitable for XPath predicates - l leaf-list Field is a leaf-list - n no-quotes Do not quote the field when using JSON style - p plural Gettext: Use comma-separated plural form - q quotes Quote the field when using JSON style - t trim Trim leading and trailing whitespace - w white A blank (" ") is appended after the label -=== =============== =================================================== + === =============== =================================================== + M Name Description + === =============== =================================================== + a argument The content appears as a 'const char \*' argument + c colon A colon (":") is appended after the label + d display Only emit field for display styles (text/HTML) + e encoding Only emit for encoding styles (XML/JSON) + g gettext Call gettext on field's render content + h humanize (hn) Format large numbers in human-readable style + \ hn-space Humanize: Place space between numeric and unit + \ hn-decimal Humanize: Add a decimal digit, if number < 10 + \ hn-1000 Humanize: Use 1000 as divisor instead of 1024 + k key Field is a key, suitable for XPath predicates + l leaf-list Field is a leaf-list + n no-quotes Do not quote the field when using JSON style + p plural Gettext: Use comma-separated plural form + q quotes Quote the field when using JSON style + t trim Trim leading and trailing whitespace + w white A blank (" ") is appended after the label + === =============== =================================================== Roles and modifiers can also use more verbose names, when preceded by a comma. For example, the modifier string "Lwc" (or "L,white,colon") Modified: head/contrib/libxo/doc/field-roles.rst ============================================================================== --- head/contrib/libxo/doc/field-roles.rst Thu Nov 7 03:47:13 2019 (r354426) +++ head/contrib/libxo/doc/field-roles.rst Thu Nov 7 03:57:04 2019 (r354427) @@ -8,24 +8,26 @@ Field Roles Field roles are optional, and indicate the role and formatting of the content. The roles are listed below; only one role is permitted: -=== ============== ================================================= -R Name Description -=== ============== ================================================= -C color Field has color and effect controls -D decoration Field is non-text (e.g., colon, comma) -E error Field is an error message -G gettext Call gettext(3) on the format string -L label Field is text that prefixes a value -N note Field is text that follows a value -P padding Field is spaces needed for vertical alignment -T title Field is a title value for headings -U units Field is the units for the previous value field -V value Field is the name of field (the default) -W warning Field is a warning message -[ start-anchor Begin a section of anchored variable-width text -] stop-anchor End a section of anchored variable-width text -=== ============== ================================================= + === ============== ================================================= + R Name Description + === ============== ================================================= + C color Field has color and effect controls + D decoration Field is non-text (e.g., colon, comma) + E error Field is an error message + G gettext Call gettext(3) on the format string + L label Field is text that prefixes a value + N note Field is text that follows a value + P padding Field is spaces needed for vertical alignment *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Nov 7 04:04:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D0BC51A6502; Thu, 7 Nov 2019 04:04:07 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477qXR408tz44KB; Thu, 7 Nov 2019 04:04:07 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DD0C7F7F; Thu, 7 Nov 2019 04:04:07 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7447FY054427; Thu, 7 Nov 2019 04:04:07 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7447Qc054426; Thu, 7 Nov 2019 04:04:07 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201911070404.xA7447Qc054426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Thu, 7 Nov 2019 04:04:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354428 - head/contrib/netbsd-tests/lib/libexecinfo X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libexecinfo X-SVN-Commit-Revision: 354428 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 04:04:07 -0000 Author: lwhsu Date: Thu Nov 7 04:04:06 2019 New Revision: 354428 URL: https://svnweb.freebsd.org/changeset/base/354428 Log: Revert r354238 as the issue has been fixed in r354418 PR: 241562 Sponsored by: The FreeBSD Foundation Modified: head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Modified: head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c ============================================================================== --- head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Thu Nov 7 03:57:04 2019 (r354427) +++ head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Thu Nov 7 04:04:06 2019 (r354428) @@ -151,11 +151,6 @@ ATF_TC_HEAD(backtrace_fmt_basic, tc) ATF_TC_BODY(backtrace_fmt_basic, tc) { -#if defined(__i386__) - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/241562"); -#endif - myfunc(12); if (prevent_inline) From owner-svn-src-head@freebsd.org Thu Nov 7 05:30:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F8D11A7920; Thu, 7 Nov 2019 05:30:33 +0000 (UTC) (envelope-from phil@juniper.net) Received: from mx0b-00273201.pphosted.com (mx0b-00273201.pphosted.com [67.231.152.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "Thawte RSA CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477sS74bcQz473r; Thu, 7 Nov 2019 05:30:31 +0000 (UTC) (envelope-from phil@juniper.net) Received: from pps.filterd (m0108162.ppops.net [127.0.0.1]) by mx0b-00273201.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xA75Rjie011252; Wed, 6 Nov 2019 21:30:28 -0800 Received: from nam04-sn1-obe.outbound.protection.outlook.com (mail-sn1nam04lp2057.outbound.protection.outlook.com [104.47.44.57]) by mx0b-00273201.pphosted.com with ESMTP id 2w41vhh4u2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 06 Nov 2019 21:30:27 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IYxINuj8CKiCxoWvtYXT5LnbgbUfado/IssmXP1boCrGjkQP3jpr+A6gjytmr4uFOtdhXikhShU9YR7rKvO7dW7ZDCOeNxd65qURf6nRwIxMmPRWMR5rB2lzyITL0yNbXd4oSU1xdgEyhjv+i87DcibouMBsudcgADMqWbApDeW63P+5vz7nzao/X8v96YwH5ZdBwZ/01X2Ekl8pronryE7Ii0sy3/WGFLYkssFh2QMRNLiOPgjdVxtyYJasp7v7v68HSKk55IcywEe7z447mm3KKtFl+au4/hSDqypjTFUgAF/XbqIigaNrdpz/hrDhUXc+WTe8+ReLeO/debMCCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SD4icQgiSHdvGq2OetGwHWXSht761f77yIMOlC2nzCk=; b=VZ+8mipmDxcZaT22O6AEvwOGApCYhPvwReJxMgs6fN5/JXfo4FGAakyDNAJEcr1rjPQMe6DuczLlSFhxOOQGNeVrdsWL+oa91ULDxPcPERT3Ux9UVaH5+KsRF3+99Bz6QpLG9VLKhhvy1t8dW20aDCFAHMjcY40Hk4qiOffLZi11OVwk7wISylEhxx04LHjTTCsMEKlawIxeumuYZHYNstmQV4S6F3yOfcCFoI4+tMK5vPLRRbyi7SgVPD4ilKNLZB89Uc4/lagzPj3ubFvDepidVuRNc8wkpnMc64UowZbGfiPt0ZU9IGTN9X0TgQS9Kp4Rd9eBzuvoHQ1+6nIsBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 66.129.239.13) smtp.rcpttodomain=freebsd.org smtp.mailfrom=juniper.net; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=juniper.net; dkim=none (message not signed); arc=none Received: from SN4PR0501CA0120.namprd05.prod.outlook.com (2603:10b6:803:42::37) by MWHPR05MB3166.namprd05.prod.outlook.com (2603:10b6:300:b4::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2430.16; Thu, 7 Nov 2019 05:30:26 +0000 Received: from CO1NAM05FT012.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::209) by SN4PR0501CA0120.outlook.office365.com (2603:10b6:803:42::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2430.16 via Frontend Transport; Thu, 7 Nov 2019 05:30:25 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.13 as permitted sender) Received: from P-EXFEND-EQX-02.jnpr.net (66.129.239.13) by CO1NAM05FT012.mail.protection.outlook.com (10.152.96.119) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2451.15 via Frontend Transport; Thu, 7 Nov 2019 05:30:25 +0000 Received: from P-EXBEND-EQX-03.jnpr.net (10.104.8.56) by P-EXFEND-EQX-02.jnpr.net (10.104.8.55) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 6 Nov 2019 21:30:24 -0800 Received: from P-EXBEND-EQX-01.jnpr.net (10.104.8.52) by P-EXBEND-EQX-03.jnpr.net (10.104.8.56) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 6 Nov 2019 21:30:24 -0800 Received: from p-mailhub01.juniper.net (10.104.20.6) by P-EXBEND-EQX-01.jnpr.net (10.104.8.52) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 6 Nov 2019 21:30:24 -0800 Received: from idle.juniper.net (idleski.juniper.net [172.25.5.10]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id xA75UL09010675; Wed, 6 Nov 2019 21:30:23 -0800 (envelope-from phil@juniper.net) Received: from [10.0.8.3] (localhost [127.0.0.1]) by idle.juniper.net (8.15.2/8.15.2) with ESMTP id xA75RTRw063400; Thu, 7 Nov 2019 00:27:29 -0500 (EST) (envelope-from phil@juniper.net) From: Phil Shafer To: Phil Shafer CC: , , Subject: Re: svn commit: r354427 - in head: contrib/libxo contrib/libxo/doc contrib/libxo/encoder contrib/libxo/encoder/cbor contrib/libxo/encoder/csv contrib/libxo/encoder/test contrib/libxo/libxo contrib/libx... Date: Thu, 7 Nov 2019 00:32:45 -0500 X-Mailer: MailMate (1.13r5655) Message-ID: <0FE9B7F1-990A-428B-842A-6261563FC7A2@juniper.net> In-Reply-To: <201911070357.xA73v41Y048836@repo.freebsd.org> References: <201911070357.xA73v41Y048836@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e3cb0ff2-54e7-4646-8a04-0dae4ac7b136 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.239.13; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(346002)(376002)(39860400002)(396003)(136003)(199004)(189003)(76176011)(2906002)(478600001)(51416003)(36756003)(8676002)(305945005)(81166006)(4744005)(81156014)(4326008)(53546011)(6916009)(5660300002)(6246003)(47776003)(486006)(450100002)(76506006)(229853002)(476003)(126002)(186003)(50226002)(8936002)(2616005)(26005)(7126003)(33656002)(54906003)(11346002)(16586007)(446003)(316002)(70586007)(70206006)(86362001)(426003)(6666004)(356004)(48376002)(336012)(50466002); DIR:OUT; SFP:1102; SCL:1; SRVR:MWHPR05MB3166; H:P-EXFEND-EQX-02.jnpr.net; FPR:; SPF:SoftFail; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a7898b0a-9c69-4af0-1fde-08d7634397be X-MS-TrafficTypeDiagnostic: MWHPR05MB3166: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:962; X-Forefront-PRVS: 0214EB3F68 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JQIXI5JLJqxdzL+WR0FgQ7vMosIjGAKbmmJ0kkPyo77EMAudeaQ9M2N0prsud9+AxuwNiIqLDsj/oG+EsfUx5mzqju/9iXckBqbolCkaTDEjlZPcuNXLzV4jx05F5/XnTyy4gUP6ruTOcFXeOhFox+1t8EAcCXINOLIzjahTddWL3agBvF8sNM7SevewKC797/1Q4NlhsidHQPWZoWFKXqhX2go7eprz5JxQ6CuLSTrSsoeJy1ksOJWyJ/h6WVfn78m5JC2fxrGA4dLq8R5L48HMjU3RjNLqB2ML2EGXPRVJ+CEcjZ3j3h0p8CBLQl8eUvHUgA0HUNG1BR4yqQ2x5ktmA+cbzYQe2w6yvOapJ8Q3yw4GilMYhI2IQ5XWwtKgLlipAs6ehiLQCxYHKQmFzHMW8kYsO94k19h9SC6ETDgz4P1CJSci1j2iQ9zn7Kr+ X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2019 05:30:25.4921 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a7898b0a-9c69-4af0-1fde-08d7634397be X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.13]; Helo=[P-EXFEND-EQX-02.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR05MB3166 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-06_09:2019-11-06,2019-11-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 malwarescore=0 phishscore=0 clxscore=1011 spamscore=0 bulkscore=0 mlxlogscore=608 impostorscore=0 lowpriorityscore=0 suspectscore=0 mlxscore=0 adultscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1911070056 X-Rspamd-Queue-Id: 477sS74bcQz473r X-Spamd-Bar: ----- X-Spamd-Result: default: False [-5.17 / 15.00]; RCVD_COUNT_SEVEN(0.00)[11]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[juniper.net:s=PPS1017,juniper.net:s=selector1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:67.231.152.164]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; IP_SCORE(-1.07)[ip: (-2.52), ipnet: 67.231.152.0/24(-1.12), asn: 22843(-1.68), country: US(-0.05)]; DKIM_TRACE(0.00)[juniper.net:+]; DMARC_POLICY_ALLOW(-0.50)[juniper.net,reject]; RCVD_IN_DNSWL_LOW(-0.10)[164.152.231.67.list.dnswl.org : 127.0.3.1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:22843, ipnet:67.231.152.0/24, country:US]; ARC_ALLOW(-1.00)[i=1]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 05:30:33 -0000 On 6 Nov 2019, at 22:57, Phil Shafer wrote: > Import libxo-1.3.0: > - move from "oxtradoc" to RST/Sphinx documentation > - new "csv" encoder, which allows path and leaf lists > - address warnings from PVS-Stdio tool > - add "xolint" detected errors to the documentation Apologies; this commit has broken HEAD with: --- all_subdir_lib/libxo --- /usr/obj/usr/src/mips.mips64/tmp/usr/bin/ld: cannot find -lxo *** [libenc_csv.so.0.full] Error code 1 I'm investigating now. Thanks, Phil From owner-svn-src-head@freebsd.org Thu Nov 7 06:16:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4CE81A8865; Thu, 7 Nov 2019 06:16:02 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yw1-f65.google.com (mail-yw1-f65.google.com [209.85.161.65]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477tSd4cJCz493J; Thu, 7 Nov 2019 06:16:01 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yw1-f65.google.com with SMTP id y18so253794ywk.1; Wed, 06 Nov 2019 22:16:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=isNXEhzDpo2uBK9M0klQFpHAbIKtboxijyAJazEDOfU=; b=p4x7cevOtlqxTxGR8zuNL+pkWjdogC+iC+0zM7OSl15h8oidPnoF+un86NKK5Ke+NN KqwfhxQLIzazlEuy7IjYBgxN5e5Vr45T87icU9c4DdxU9JBCewJReHfP/gTG/zkvkHQe /3DDiLUO7FQE8KGwJYYu8cFo3JHwhzEXClf/y1CQyRRM4zOMeVm/OIHUJ3O6os4IZzxt oJRqQOqtvN+fu50Dq1YnUjjBRyR9zpvwrkQUCyV6F3pJMtGNH82Kn6CJv+Onh4qKByvM 5IoOk4creBltXHDG+gL1MZC2rbgXN+w7n2dgRhzcVLBhC6B2HaM9hluIgXa+6cI3hB+L JpeA== X-Gm-Message-State: APjAAAWD9yWEBP8/DDKmFBMzEeQNmAigor++QssIftWKReGovMO13pOu V0thf/9hrsHPfd75KdB6/hPIbuvNxV7HFe1/N6wEDw== X-Google-Smtp-Source: APXvYqx4PnLH7FTEsRXyWq6f5hjgQFADfDj9idWqeTdurlca+hFYklIpURgpv9t75ayDkqa5IkASNqgbsI41fAyVn8k= X-Received: by 2002:a81:c24c:: with SMTP id t12mr994972ywg.360.1573107360424; Wed, 06 Nov 2019 22:16:00 -0800 (PST) MIME-Version: 1.0 References: <201911070357.xA73v41Y048836@repo.freebsd.org> <0FE9B7F1-990A-428B-842A-6261563FC7A2@juniper.net> In-Reply-To: <0FE9B7F1-990A-428B-842A-6261563FC7A2@juniper.net> From: Li-Wen Hsu Date: Thu, 7 Nov 2019 14:15:49 +0800 Message-ID: Subject: Re: svn commit: r354427 - in head: contrib/libxo contrib/libxo/doc contrib/libxo/encoder contrib/libxo/encoder/cbor contrib/libxo/encoder/csv contrib/libxo/encoder/test contrib/libxo/libxo contrib/libx... To: Phil Shafer Cc: Phil Shafer , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 477tSd4cJCz493J X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of lwhsufreebsd@gmail.com designates 209.85.161.65 as permitted sender) smtp.mailfrom=lwhsufreebsd@gmail.com X-Spamd-Result: default: False [-3.16 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[65.161.85.209.rep.mailspike.net : 127.0.0.18]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[65.161.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.16)[ip: (-0.55), ipnet: 209.85.128.0/17(-3.21), asn: 15169(-2.01), country: US(-0.05)]; FORGED_SENDER(0.30)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 06:16:02 -0000 On Thu, Nov 7, 2019 at 1:30 PM Phil Shafer wrote: > > On 6 Nov 2019, at 22:57, Phil Shafer wrote: > > Import libxo-1.3.0: > > - move from "oxtradoc" to RST/Sphinx documentation > > - new "csv" encoder, which allows path and leaf lists > > - address warnings from PVS-Stdio tool > > - add "xolint" detected errors to the documentation > > Apologies; this commit has broken HEAD with: > > --- all_subdir_lib/libxo --- > /usr/obj/usr/src/mips.mips64/tmp/usr/bin/ld: cannot find -lxo > *** [libenc_csv.so.0.full] Error code 1 > > I'm investigating now. I'm not sure if this helps, but I found this error only happens in a clean build. It might have something to do with the dependency setting. Best, Li-Wen From owner-svn-src-head@freebsd.org Thu Nov 7 06:28:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4FC8F1A8C22; Thu, 7 Nov 2019 06:28:17 +0000 (UTC) (envelope-from phil@juniper.net) Received: from mx0b-00273201.pphosted.com (mx0b-00273201.pphosted.com [67.231.152.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "Thawte RSA CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477tkm3kb5z49X6; Thu, 7 Nov 2019 06:28:16 +0000 (UTC) (envelope-from phil@juniper.net) Received: from pps.filterd (m0108160.ppops.net [127.0.0.1]) by mx0b-00273201.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xA76RM6n022652; Wed, 6 Nov 2019 22:28:14 -0800 Received: from nam01-bn3-obe.outbound.protection.outlook.com (mail-bn3nam01lp2059.outbound.protection.outlook.com [104.47.33.59]) by mx0b-00273201.pphosted.com with ESMTP id 2w41vjh7aq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 06 Nov 2019 22:28:14 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GIGkNQg15BpMFqOBtsn+vuipGPe3jMCqkta25OpXLOxP1GvXe4QRKAfHxpX0+/o3GFDairtXfyXIn/ofdT2DZLmKr/6odExlmk0ZJbzQ34nAvd7Ve0f/A7aRyLlNQpWgDPcAU8i6JeVt+PKRnQ8QZKtexsSY/1LxdoI02NtHznNNEz5D5pYelY54RlnbhCm2Wc9bx1ul0gD5IJk0RYaJWV+4mfiNGkwN4oXTsSBRw4U+eGgxYQraUOtz5ESD2FPxUX57mxd7+DODabJVxqyThOZvNxepq8updEEoWkYybU3n+HCrfJL2zLwGIFZ/sqKTXGl+JpHZWP2wjnorM5tHvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0Fk1N0u/JSkHOZeJfcPHJtfnBEQAZdAI5IEiCAS82w4=; b=cdJyZ1cWYgKdtRkgGXFBZRN5JTbj//ejpmivG5oPPal0PUmuj4WPPTLG5Se/VlXl2e9xBiuK7Wm08Yp5u1YGX+lHm6mBdTy0z7S0hWgUV6ElSE1Vraw8SrcKeCR58XV6bmN2kqwLokOO/VukR8gRocQ0ftXTi0QbcTWh3y8frcKTqNPiG039h3gWa21bZT9mBXupM9V/aBb2Y30g5D9zFtrVdI1CaL9QnamH1nmS1nCGmkQ/8sf+JeXngyKZ21SQfxKkg2cec0M1CgY8Z7XMlYJSSrWn2zgPV9gNldsZwzGwAVkQ3GNjCFmE8O/ynJD2tEMZbQFqHiU5LAruQlk+eA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 66.129.239.13) smtp.rcpttodomain=freebsd.org smtp.mailfrom=juniper.net; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=juniper.net; dkim=none (message not signed); arc=none Received: from BYAPR05CA0024.namprd05.prod.outlook.com (2603:10b6:a03:c0::37) by DM5PR05MB2985.namprd05.prod.outlook.com (2603:10b6:3:54::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.15; Thu, 7 Nov 2019 06:28:12 +0000 Received: from CO1NAM05FT060.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::206) by BYAPR05CA0024.outlook.office365.com (2603:10b6:a03:c0::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2430.16 via Frontend Transport; Thu, 7 Nov 2019 06:28:12 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.13 as permitted sender) Received: from P-EXFEND-EQX-02.jnpr.net (66.129.239.13) by CO1NAM05FT060.mail.protection.outlook.com (10.152.96.178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2451.15 via Frontend Transport; Thu, 7 Nov 2019 06:28:11 +0000 Received: from P-EXBEND-EQX-01.jnpr.net (10.104.8.52) by P-EXFEND-EQX-02.jnpr.net (10.104.8.55) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 6 Nov 2019 22:28:11 -0800 Received: from p-mailhub01.juniper.net (10.104.20.6) by P-EXBEND-EQX-01.jnpr.net (10.104.8.52) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 6 Nov 2019 22:28:11 -0800 Received: from idle.juniper.net (idleski.juniper.net [172.25.5.10]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id xA76S7XE005278; Wed, 6 Nov 2019 22:28:10 -0800 (envelope-from phil@juniper.net) Received: from [10.0.8.3] (localhost [127.0.0.1]) by idle.juniper.net (8.15.2/8.15.2) with ESMTP id xA76PGCD021987; Thu, 7 Nov 2019 01:25:16 -0500 (EST) (envelope-from phil@juniper.net) From: Phil Shafer To: Li-Wen Hsu CC: Phil Shafer , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r354427 - in head: contrib/libxo contrib/libxo/doc contrib/libxo/encoder contrib/libxo/encoder/cbor contrib/libxo/encoder/csv contrib/libxo/encoder/test contrib/libxo/libxo contrib/libx... Date: Thu, 7 Nov 2019 01:30:32 -0500 X-Mailer: MailMate (1.13r5655) Message-ID: In-Reply-To: References: <201911070357.xA73v41Y048836@repo.freebsd.org> <0FE9B7F1-990A-428B-842A-6261563FC7A2@juniper.net> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-EXCLAIMER-MD-CONFIG: e3cb0ff2-54e7-4646-8a04-0dae4ac7b136 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.239.13; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(376002)(346002)(136003)(39860400002)(396003)(199004)(189003)(53546011)(70586007)(33656002)(305945005)(478600001)(81166006)(81156014)(8676002)(446003)(76176011)(11346002)(126002)(6916009)(476003)(2906002)(50226002)(2616005)(70206006)(8936002)(47776003)(316002)(7126003)(51416003)(486006)(76506006)(229853002)(4744005)(26005)(14444005)(426003)(54906003)(36756003)(50466002)(186003)(6246003)(6666004)(356004)(5660300002)(4326008)(450100002)(336012)(86362001)(16586007); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR05MB2985; H:P-EXFEND-EQX-02.jnpr.net; FPR:; SPF:SoftFail; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a9a11152-87ce-4efd-c74c-08d7634ba9c0 X-MS-TrafficTypeDiagnostic: DM5PR05MB2985: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 0214EB3F68 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nioehrIK6QtHxQEC/kA9J6tr567FH5AijMy9bMnSa5PpOedn+EU5msfxahKtoKxa/hUJRtiSxfM/RKd7rPtr1krEJFkoLkAH/PvuIxP+2HpAUQifVXklsLtoF6ZKx6EOpGcPY6gFYdbIxt/waPoRGqtwZ13jpp5XAhcTMCEdf/E/SIlWRL90+/MBntNdXWbFnR4VTjWnZ1/zO3xsHGzLXw6rUDadK45hwW3c1C98N+pFpj1wCtvB7ZXtBLHfwCC2A4NyNE6Z2FX0SwlNbf3IcwLgI3YS3LGgBxaP8FypwvRE6po1qa12i/0T6ak6hGvQHbxBA4Nbtg0bX5T3hoSuqT3dCBl7ewDXI9iQuSfcAuy03/FUrNYdOiCtYtyOVBLUgkBFs150DNSh+ui5gLJrU1g8RDl9RgfSV8gKw1zk4bZoayS4URD2YlTxQ+8s0Bfx X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2019 06:28:11.6804 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a9a11152-87ce-4efd-c74c-08d7634ba9c0 X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.13]; Helo=[P-EXFEND-EQX-02.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR05MB2985 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-06_09:2019-11-06,2019-11-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 mlxscore=0 impostorscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 suspectscore=0 adultscore=0 phishscore=0 clxscore=1011 priorityscore=1501 spamscore=0 mlxlogscore=592 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1911070065 X-Rspamd-Queue-Id: 477tkm3kb5z49X6 X-Spamd-Bar: ----- X-Spamd-Result: default: False [-5.18 / 15.00]; RCVD_COUNT_SEVEN(0.00)[10]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[juniper.net:s=PPS1017,juniper.net:s=selector1]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:67.231.152.164]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; IP_SCORE(-1.08)[ip: (-2.53), ipnet: 67.231.152.0/24(-1.12), asn: 22843(-1.68), country: US(-0.05)]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[juniper.net:+]; DMARC_POLICY_ALLOW(-0.50)[juniper.net,reject]; RCVD_IN_DNSWL_LOW(-0.10)[164.152.231.67.list.dnswl.org : 127.0.3.1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:22843, ipnet:67.231.152.0/24, country:US]; ARC_ALLOW(-1.00)[i=1]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 06:28:17 -0000 On 7 Nov 2019, at 1:15, Li-Wen Hsu wrote: > I'm not sure if this helps, but I found this error only happens in a > clean build. It might have something to do with the dependency > setting. Well at least that may explain why it snuck in: My import script does an "svn update", followed by a full build of the fresh tree, and then does a build with the incoming source, but I add a -DNO_CLEAN since I'm WITH_META_MODE. The old bit it was it seemed to fail for all builds except amd64 (the one I build against). I've got a fix building now..... slowly.... Thanks, Phil From owner-svn-src-head@freebsd.org Thu Nov 7 06:59:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF3AE1A9641; Thu, 7 Nov 2019 06:59:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477vQQ4dzlz4Bnc; Thu, 7 Nov 2019 06:59:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 833719D8B; Thu, 7 Nov 2019 06:59:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA76xAcF054043; Thu, 7 Nov 2019 06:59:10 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA76xAqR054042; Thu, 7 Nov 2019 06:59:10 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201911070659.xA76xAqR054042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 7 Nov 2019 06:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354429 - head/contrib/llvm/lib/Target/X86 X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/lib/Target/X86 X-SVN-Commit-Revision: 354429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 06:59:10 -0000 Author: dim Date: Thu Nov 7 06:59:09 2019 New Revision: 354429 URL: https://svnweb.freebsd.org/changeset/base/354429 Log: Merge commit 8e34dd941 from llvm git (by Sanjay Patel): [x86] avoid crashing when splitting AVX stores with non-simple type (PR43916) The store splitting transform was assuming a simple type (MVT), but that's not necessarily the case as shown in the test. This should fix 'Assertion failed: (isSimple() && "Expected a SimpleValueType!")' when building the security/openssl111 port targeting a CPU that supports AVX, but not AVX2, such as sandybridge. PR: 241747 MFC after: 1 month X-MFC-With: r353358 Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Nov 7 04:04:06 2019 (r354428) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Nov 7 06:59:09 2019 (r354429) @@ -21182,12 +21182,14 @@ static SDValue splitVectorStore(StoreSDNode *Store, Se "Expecting 256/512-bit op"); // Splitting volatile memory ops is not allowed unless the operation was not - // legal to begin with. We are assuming the input op is legal (this transform - // is only used for targets with AVX). + // legal to begin with. Assume the input store is legal (this transform is + // only used for targets with AVX). Note: It is possible that we have an + // illegal type like v2i128, and so we could allow splitting a volatile store + // in that case if that is important. if (Store->isVolatile()) return SDValue(); - MVT StoreVT = StoredVal.getSimpleValueType(); + EVT StoreVT = StoredVal.getValueType(); unsigned NumElems = StoreVT.getVectorNumElements(); unsigned HalfSize = StoredVal.getValueSizeInBits() / 2; unsigned HalfAlign = (128 == HalfSize ? 16 : 32); From owner-svn-src-head@freebsd.org Thu Nov 7 07:09:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 71DE01A9BD1; Thu, 7 Nov 2019 07:09:29 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477vfK2Twfz4CT8; Thu, 7 Nov 2019 07:09:29 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 388959F72; Thu, 7 Nov 2019 07:09:29 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA779TVZ060041; Thu, 7 Nov 2019 07:09:29 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA779TmL060040; Thu, 7 Nov 2019 07:09:29 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201911070709.xA779TmL060040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Thu, 7 Nov 2019 07:09:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354431 - head/lib/libxo X-SVN-Group: head X-SVN-Commit-Author: phil X-SVN-Commit-Paths: head/lib/libxo X-SVN-Commit-Revision: 354431 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 07:09:29 -0000 Author: phil Date: Thu Nov 7 07:09:28 2019 New Revision: 354431 URL: https://svnweb.freebsd.org/changeset/base/354431 Log: Back out encoder compilation to unbreak HEAD. Modified: head/lib/libxo/Makefile Modified: head/lib/libxo/Makefile ============================================================================== --- head/lib/libxo/Makefile Thu Nov 7 07:09:10 2019 (r354430) +++ head/lib/libxo/Makefile Thu Nov 7 07:09:28 2019 (r354431) @@ -114,6 +114,6 @@ MLINKS= xo_attr.3 xo_attr_h.3 \ HAS_TESTS= SUBDIR.${MK_TESTS}+= tests -SUBDIR = encoder +#SUBDIR = encoder .include From owner-svn-src-head@freebsd.org Thu Nov 7 07:21:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0FEC1AA041; Thu, 7 Nov 2019 07:21:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 477vw43Vr0z4DWk; Thu, 7 Nov 2019 07:21:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AC00A2A0; Thu, 7 Nov 2019 07:21:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA77LOhv068772; Thu, 7 Nov 2019 07:21:24 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA77LOhK068771; Thu, 7 Nov 2019 07:21:24 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201911070721.xA77LOhK068771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 7 Nov 2019 07:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354433 - head X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 354433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 07:21:24 -0000 Author: avg Date: Thu Nov 7 07:21:23 2019 New Revision: 354433 URL: https://svnweb.freebsd.org/changeset/base/354433 Log: add a note about nctgpio and wbwd move to superio Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Nov 7 07:15:01 2019 (r354432) +++ head/UPDATING Thu Nov 7 07:21:23 2019 (r354433) @@ -26,6 +26,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20191107: + The nctgpio and wbwd drivers have been moved to the superio bus. + If you have one of these drivers in a kernel configuration, then + you should add device superio to it. If you use one of these drivers + as a module and you compile a custom set of modules, then you should + add superio to the set. + 20191021: KPIs for network drivers to access interface addresses have changed. Users need to recompile NIC driver modules together with kernel. From owner-svn-src-head@freebsd.org Thu Nov 7 11:17:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB56B1B0487; Thu, 7 Nov 2019 11:17:03 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47817z5yHwz4VdP; Thu, 7 Nov 2019 11:17:03 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1348CE27; Thu, 7 Nov 2019 11:17:03 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7BH3PI010874; Thu, 7 Nov 2019 11:17:03 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7BH390010873; Thu, 7 Nov 2019 11:17:03 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911071117.xA7BH390010873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 7 Nov 2019 11:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354435 - head/stand/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/efi/libefi X-SVN-Commit-Revision: 354435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 11:17:04 -0000 Author: tsoome Date: Thu Nov 7 11:17:03 2019 New Revision: 354435 URL: https://svnweb.freebsd.org/changeset/base/354435 Log: loader: implement fallback efi_devpath_to_name() UEFI 1.10 on macs does not seem to provide devpath to name translation, provide our own (limited) version, so we can get information about commmon devices. MFC after: 1 week Modified: head/stand/efi/libefi/devpath.c Modified: head/stand/efi/libefi/devpath.c ============================================================================== --- head/stand/efi/libefi/devpath.c Thu Nov 7 07:21:45 2019 (r354434) +++ head/stand/efi/libefi/devpath.c Thu Nov 7 11:17:03 2019 (r354435) @@ -29,13 +29,16 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include static EFI_GUID ImageDevicePathGUID = EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID; static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; static EFI_GUID DevicePathToTextGUID = EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID; static EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *toTextProtocol; -static EFI_GUID DevicePathFromTextGUID = EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID; +static EFI_GUID DevicePathFromTextGUID = + EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID; static EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *fromTextProtocol; EFI_DEVICE_PATH * @@ -64,6 +67,427 @@ efi_lookup_devpath(EFI_HANDLE handle) return (devpath); } +static char * +efi_make_tail(char *suffix) +{ + char *tail; + + tail = NULL; + if (suffix != NULL) + (void)asprintf(&tail, "/%s", suffix); + else + tail = strdup(""); + return (tail); +} + +typedef struct { + EFI_DEVICE_PATH Header; + EFI_GUID Guid; + UINT8 VendorDefinedData[1]; +} __packed VENDOR_DEVICE_PATH_WITH_DATA; + +static char * +efi_vendor_path(const char *type, VENDOR_DEVICE_PATH *node, char *suffix) +{ + uint32_t size = DevicePathNodeLength(&node->Header) - sizeof(*node); + VENDOR_DEVICE_PATH_WITH_DATA *dp = (VENDOR_DEVICE_PATH_WITH_DATA *)node; + char *name, *tail, *head; + char *uuid; + int rv; + + uuid_to_string((const uuid_t *)(void *)&node->Guid, &uuid, &rv); + if (rv != uuid_s_ok) + return (NULL); + + tail = efi_make_tail(suffix); + rv = asprintf(&head, "%sVendor(%s)[%x:", type, uuid, size); + free(uuid); + if (rv < 0) + return (NULL); + + if (DevicePathNodeLength(&node->Header) > sizeof(*node)) { + for (uint32_t i = 0; i < size; i++) { + rv = asprintf(&name, "%s%02x", head, + dp->VendorDefinedData[i]); + if (rv < 0) { + free(tail); + free(head); + return (NULL); + } + free(head); + head = name; + } + } + + if (asprintf(&name, "%s]%s", head, tail) < 0) + name = NULL; + free(head); + free(tail); + return (name); +} + +static char * +efi_hw_dev_path(EFI_DEVICE_PATH *node, char *suffix) +{ + uint8_t subtype = DevicePathSubType(node); + char *name, *tail; + + tail = efi_make_tail(suffix); + switch (subtype) { + case HW_PCI_DP: + if (asprintf(&name, "Pci(%x,%x)%s", + ((PCI_DEVICE_PATH *)node)->Function, + ((PCI_DEVICE_PATH *)node)->Device, tail) < 0) + name = NULL; + break; + case HW_PCCARD_DP: + if (asprintf(&name, "PCCARD(%x)%s", + ((PCCARD_DEVICE_PATH *)node)->FunctionNumber, tail) < 0) + name = NULL; + break; + case HW_MEMMAP_DP: + if (asprintf(&name, "MMap(%x,%" PRIx64 ",%" PRIx64 ")%s", + ((MEMMAP_DEVICE_PATH *)node)->MemoryType, + ((MEMMAP_DEVICE_PATH *)node)->StartingAddress, + ((MEMMAP_DEVICE_PATH *)node)->EndingAddress, tail) < 0) + name = NULL; + break; + case HW_VENDOR_DP: + name = efi_vendor_path("Hardware", + (VENDOR_DEVICE_PATH *)node, tail); + break; + case HW_CONTROLLER_DP: + if (asprintf(&name, "Ctrl(%x)%s", + ((CONTROLLER_DEVICE_PATH *)node)->Controller, tail) < 0) + name = NULL; + break; + default: + if (asprintf(&name, "UnknownHW(%x)%s", subtype, tail) < 0) + name = NULL; + break; + } + free(tail); + return (name); +} + +static char * +efi_acpi_dev_path(EFI_DEVICE_PATH *node, char *suffix) +{ + uint8_t subtype = DevicePathSubType(node); + ACPI_HID_DEVICE_PATH *acpi = (ACPI_HID_DEVICE_PATH *)node; + char *name, *tail; + + tail = efi_make_tail(suffix); + switch (subtype) { + case ACPI_DP: + if ((acpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { + switch (EISA_ID_TO_NUM (acpi->HID)) { + case 0x0a03: + if (asprintf(&name, "PciRoot(%x)%s", + acpi->UID, tail) < 0) + name = NULL; + break; + case 0x0a08: + if (asprintf(&name, "PcieRoot(%x)%s", + acpi->UID, tail) < 0) + name = NULL; + break; + case 0x0604: + if (asprintf(&name, "Floppy(%x)%s", + acpi->UID, tail) < 0) + name = NULL; + break; + case 0x0301: + if (asprintf(&name, "Keyboard(%x)%s", + acpi->UID, tail) < 0) + name = NULL; + break; + case 0x0501: + if (asprintf(&name, "Serial(%x)%s", + acpi->UID, tail) < 0) + name = NULL; + break; + case 0x0401: + if (asprintf(&name, "ParallelPort(%x)%s", + acpi->UID, tail) < 0) + name = NULL; + break; + default: + if (asprintf(&name, "Acpi(PNP%04x,%x)%s", + EISA_ID_TO_NUM(acpi->HID), + acpi->UID, tail) < 0) + name = NULL; + break; + } + } else { + if (asprintf(&name, "Acpi(%08x,%x)%s", + acpi->HID, acpi->UID, tail) < 0) + name = NULL; + } + break; + case ACPI_EXTENDED_DP: + default: + if (asprintf(&name, "UnknownACPI(%x)%s", subtype, tail) < 0) + name = NULL; + break; + } + free(tail); + return (name); +} + +static char * +efi_messaging_dev_path(EFI_DEVICE_PATH *node, char *suffix) +{ + uint8_t subtype = DevicePathSubType(node); + char *name; + char *tail; + + tail = efi_make_tail(suffix); + switch (subtype) { + case MSG_ATAPI_DP: + if (asprintf(&name, "ATA(%s,%s,%x)%s", + ((ATAPI_DEVICE_PATH *)node)->PrimarySecondary == 1 ? + "Secondary" : "Primary", + ((ATAPI_DEVICE_PATH *)node)->SlaveMaster == 1 ? + "Slave" : "Master", + ((ATAPI_DEVICE_PATH *)node)->Lun, tail) < 0) + name = NULL; + break; + case MSG_SCSI_DP: + if (asprintf(&name, "SCSI(%x,%x)%s", + ((SCSI_DEVICE_PATH *)node)->Pun, + ((SCSI_DEVICE_PATH *)node)->Lun, tail) < 0) + name = NULL; + break; + case MSG_FIBRECHANNEL_DP: + if (asprintf(&name, "Fibre(%" PRIx64 ",%" PRIx64 ")%s", + ((FIBRECHANNEL_DEVICE_PATH *)node)->WWN, + ((FIBRECHANNEL_DEVICE_PATH *)node)->Lun, tail) < 0) + name = NULL; + break; + case MSG_1394_DP: + if (asprintf(&name, "I1394(%016" PRIx64 ")%s", + ((F1394_DEVICE_PATH *)node)->Guid, tail) < 0) + name = NULL; + break; + case MSG_USB_DP: + if (asprintf(&name, "USB(%x,%x)%s", + ((USB_DEVICE_PATH *)node)->ParentPortNumber, + ((USB_DEVICE_PATH *)node)->InterfaceNumber, tail) < 0) + name = NULL; + break; + case MSG_USB_CLASS_DP: + if (asprintf(&name, "UsbClass(%x,%x,%x,%x,%x)%s", + ((USB_CLASS_DEVICE_PATH *)node)->VendorId, + ((USB_CLASS_DEVICE_PATH *)node)->ProductId, + ((USB_CLASS_DEVICE_PATH *)node)->DeviceClass, + ((USB_CLASS_DEVICE_PATH *)node)->DeviceSubClass, + ((USB_CLASS_DEVICE_PATH *)node)->DeviceProtocol, tail) < 0) + name = NULL; + break; + case MSG_MAC_ADDR_DP: + if (asprintf(&name, "MAC(%02x:%02x:%02x:%02x:%02x:%02x,%x)%s", + ((MAC_ADDR_DEVICE_PATH *)node)->MacAddress.Addr[0], + ((MAC_ADDR_DEVICE_PATH *)node)->MacAddress.Addr[1], + ((MAC_ADDR_DEVICE_PATH *)node)->MacAddress.Addr[2], + ((MAC_ADDR_DEVICE_PATH *)node)->MacAddress.Addr[3], + ((MAC_ADDR_DEVICE_PATH *)node)->MacAddress.Addr[4], + ((MAC_ADDR_DEVICE_PATH *)node)->MacAddress.Addr[5], + ((MAC_ADDR_DEVICE_PATH *)node)->IfType, tail) < 0) + name = NULL; + break; + case MSG_VENDOR_DP: + name = efi_vendor_path("Messaging", + (VENDOR_DEVICE_PATH *)node, tail); + break; + case MSG_UART_DP: + if (asprintf(&name, "UART(%" PRIu64 ",%u,%x,%x)%s", + ((UART_DEVICE_PATH *)node)->BaudRate, + ((UART_DEVICE_PATH *)node)->DataBits, + ((UART_DEVICE_PATH *)node)->Parity, + ((UART_DEVICE_PATH *)node)->StopBits, tail) < 0) + name = NULL; + break; + case MSG_SATA_DP: + if (asprintf(&name, "Sata(%x,%x,%x)%s", + ((SATA_DEVICE_PATH *)node)->HBAPortNumber, + ((SATA_DEVICE_PATH *)node)->PortMultiplierPortNumber, + ((SATA_DEVICE_PATH *)node)->Lun, tail) < 0) + name = NULL; + break; + default: + if (asprintf(&name, "UnknownMessaging(%x)%s", + subtype, tail) < 0) + name = NULL; + break; + } + free(tail); + return (name); +} + +static char * +efi_media_dev_path(EFI_DEVICE_PATH *node, char *suffix) +{ + uint8_t subtype = DevicePathSubType(node); + HARDDRIVE_DEVICE_PATH *hd; + char *name; + char *str; + char *tail; + int rv; + + tail = efi_make_tail(suffix); + name = NULL; + switch (subtype) { + case MEDIA_HARDDRIVE_DP: + hd = (HARDDRIVE_DEVICE_PATH *)node; + switch (hd->SignatureType) { + case SIGNATURE_TYPE_MBR: + if (asprintf(&name, "HD(%d,MBR,%08x,%" PRIx64 + ",%" PRIx64 ")%s", + hd->PartitionNumber, + *((uint32_t *)(uintptr_t)&hd->Signature[0]), + hd->PartitionStart, + hd->PartitionSize, tail) < 0) + name = NULL; + break; + case SIGNATURE_TYPE_GUID: + name = NULL; + uuid_to_string((const uuid_t *)(void *) + &hd->Signature[0], &str, &rv); + if (rv != uuid_s_ok) + break; + rv = asprintf(&name, "HD(%d,GPT,%s,%" PRIx64 ",%" + PRIx64 ")%s", + hd->PartitionNumber, str, + hd->PartitionStart, hd->PartitionSize, tail); + free(str); + break; + default: + if (asprintf(&name, "HD(%d,%d,0)%s", + hd->PartitionNumber, + hd->SignatureType, tail) < 0) { + name = NULL; + } + break; + } + break; + case MEDIA_CDROM_DP: + if (asprintf(&name, "CD(%x,%" PRIx64 ",%" PRIx64 ")%s", + ((CDROM_DEVICE_PATH *)node)->BootEntry, + ((CDROM_DEVICE_PATH *)node)->PartitionStart, + ((CDROM_DEVICE_PATH *)node)->PartitionSize, tail) < 0) { + name = NULL; + } + break; + case MEDIA_VENDOR_DP: + name = efi_vendor_path("Media", + (VENDOR_DEVICE_PATH *)node, tail); + break; + case MEDIA_FILEPATH_DP: + name = NULL; + str = NULL; + if (ucs2_to_utf8(((FILEPATH_DEVICE_PATH *)node)->PathName, + &str) == 0) { + (void)asprintf(&name, "%s%s", str, tail); + free(str); + } + break; + case MEDIA_PROTOCOL_DP: + name = NULL; + uuid_to_string((const uuid_t *)(void *) + &((MEDIA_PROTOCOL_DEVICE_PATH *)node)->Protocol, + &str, &rv); + if (rv != uuid_s_ok) + break; + rv = asprintf(&name, "Protocol(%s)%s", str, tail); + free(str); + break; + default: + if (asprintf(&name, "UnknownMedia(%x)%s", + subtype, tail) < 0) + name = NULL; + } + free(tail); + return (name); +} + +static char * +efi_translate_devpath(EFI_DEVICE_PATH *devpath) +{ + EFI_DEVICE_PATH *dp = NextDevicePathNode(devpath); + char *name, *ptr; + uint8_t type; + + if (!IsDevicePathEnd(devpath)) + name = efi_translate_devpath(dp); + else + return (NULL); + + ptr = NULL; + type = DevicePathType(devpath); + switch (type) { + case HARDWARE_DEVICE_PATH: + ptr = efi_hw_dev_path(devpath, name); + break; + case ACPI_DEVICE_PATH: + ptr = efi_acpi_dev_path(devpath, name); + break; + case MESSAGING_DEVICE_PATH: + ptr = efi_messaging_dev_path(devpath, name); + break; + case MEDIA_DEVICE_PATH: + ptr = efi_media_dev_path(devpath, name); + break; + case BBS_DEVICE_PATH: + default: + if (asprintf(&ptr, "UnknownPath(%x)%s", type, + name? name : "") < 0) + ptr = NULL; + break; + } + + if (ptr != NULL) { + free(name); + name = ptr; + } + return (name); +} + +static CHAR16 * +efi_devpath_to_name(EFI_DEVICE_PATH *devpath) +{ + char *name = NULL; + CHAR16 *ptr = NULL; + size_t len; + int rv; + + name = efi_translate_devpath(devpath); + if (name == NULL) + return (NULL); + + /* + * We need to return memory from AllocatePool, so it can be freed + * with FreePool() in efi_free_devpath_name(). + */ + rv = utf8_to_ucs2(name, &ptr, &len); + free(name); + if (rv == 0) { + CHAR16 *out = NULL; + EFI_STATUS status; + + status = BS->AllocatePool(EfiLoaderData, len, (void **)&out); + if (EFI_ERROR(status)) { + free(ptr); + return (out); + } + memcpy(out, ptr, len); + free(ptr); + ptr = out; + } + + return (ptr); +} + CHAR16 * efi_devpath_name(EFI_DEVICE_PATH *devpath) { @@ -78,7 +502,7 @@ efi_devpath_name(EFI_DEVICE_PATH *devpath) toTextProtocol = NULL; } if (toTextProtocol == NULL) - return (NULL); + return (efi_devpath_to_name(devpath)); return (toTextProtocol->ConvertDevicePathToText(devpath, TRUE, TRUE)); } @@ -86,8 +510,8 @@ efi_devpath_name(EFI_DEVICE_PATH *devpath) void efi_free_devpath_name(CHAR16 *text) { - - BS->FreePool(text); + if (text != NULL) + BS->FreePool(text); } EFI_DEVICE_PATH * From owner-svn-src-head@freebsd.org Thu Nov 7 11:18:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD1F01B0520; Thu, 7 Nov 2019 11:18:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47819f4bnkz4Vn3; Thu, 7 Nov 2019 11:18:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 67DD5CE2F; Thu, 7 Nov 2019 11:18:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7BIUQU011014; Thu, 7 Nov 2019 11:18:30 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7BIS4O011006; Thu, 7 Nov 2019 11:18:28 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201911071118.xA7BIS4O011006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 7 Nov 2019 11:18:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354436 - in head: cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common sys/cddl/contrib/opensolaris/uts/common/... X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/o... X-SVN-Commit-Revision: 354436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 11:18:30 -0000 Author: avg Date: Thu Nov 7 11:18:28 2019 New Revision: 354436 URL: https://svnweb.freebsd.org/changeset/base/354436 Log: MFV r354377: 10554 Implemented zpool sync command illumos/illumos-gate@9c2acf00e275b6b2125a306f33cdddcc58393220 https://github.com/illumos/illumos-gate/commit/9c2acf00e275b6b2125a306f33cdddcc58393220 https://www.illumos.org/issues/10554 During the port of MMP (illumos bug 10499) from ZoL, I found this earlier ZoL project is a prerequisite. Here is the original description. This addition will enable us to sync an open TXG to the main pool on demand. The functionality is similar to 'sync(2)' but 'zpool sync' will return when data has hit the main storage instead of potentially just the ZIL as is the case with the 'sync(2)' cmd. Portions contributed by: Jerry Jelinek Author: Alek Pinchuk MFC after: 3 weeks Relnotes: possibly Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Nov 7 11:17:03 2019 (r354435) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Nov 7 11:18:28 2019 (r354436) @@ -193,6 +193,9 @@ .Ar ... .Op Ar interval Op Ar count .Nm +.Cm sync +.Oo Ar pool Oc Ns ... +.Nm .Cm upgrade .Op Fl v .Nm @@ -1913,6 +1916,19 @@ unavailable. Warnings about pools not using the latest on-disk format, having non-native block size or disabled features will not be included. .El +.It Xo +.Nm +.Cm sync +.Oo Ar pool Oc Ns ... +.Xc +Forces all in-core dirty data to be written to the primary pool storage and +not the ZIL. +It will also update administrative information including quota reporting. +Without arguments, +.Nm zpool Cm sync +will sync all pools on the system. +Otherwise, it will only sync the specified +.Ar pool . .It Xo .Nm .Cm upgrade Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Thu Nov 7 11:17:03 2019 (r354435) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Thu Nov 7 11:18:28 2019 (r354436) @@ -100,6 +100,8 @@ static int zpool_do_history(int, char **); static int zpool_do_get(int, char **); static int zpool_do_set(int, char **); +static int zpool_do_sync(int, char **); + /* * These libumem hooks provide a reasonable set of defaults for the allocator's * debugging facilities. @@ -144,6 +146,7 @@ typedef enum { HELP_GET, HELP_SET, HELP_SPLIT, + HELP_SYNC, HELP_REGUID, HELP_REOPEN } zpool_help_t; @@ -200,6 +203,7 @@ static zpool_command_t command_table[] = { { "history", zpool_do_history, HELP_HISTORY }, { "get", zpool_do_get, HELP_GET }, { "set", zpool_do_set, HELP_SET }, + { "sync", zpool_do_sync, HELP_SYNC }, }; #define NCOMMAND (sizeof (command_table) / sizeof (command_table[0])) @@ -285,6 +289,8 @@ get_usage(zpool_help_t idx) "[ ...]\n")); case HELP_REGUID: return (gettext("\treguid \n")); + case HELP_SYNC: + return (gettext("\tsync [pool] ...\n")); } abort(); @@ -2646,6 +2652,45 @@ error: free(searchdirs); return (err ? 1 : 0); +} + +/* + * zpool sync [-f] [pool] ... + * + * -f (undocumented) force uberblock (and config including zpool cache file) + * update. + * + * Sync the specified pool(s). + * Without arguments "zpool sync" will sync all pools. + * This command initiates TXG sync(s) and will return after the TXG(s) commit. + * + */ +static int +zpool_do_sync(int argc, char **argv) +{ + int ret; + boolean_t force = B_FALSE; + + /* check options */ + while ((ret = getopt(argc, argv, "f")) != -1) { + switch (ret) { + case 'f': + force = B_TRUE; + break; + case '?': + (void) fprintf(stderr, gettext("invalid option '%c'\n"), + optopt); + usage(B_FALSE); + } + } + + argc -= optind; + argv += optind; + + /* if argc == 0 we will execute zpool_sync_one on all pools */ + ret = for_each_pool(argc, argv, B_FALSE, NULL, zpool_sync_one, &force); + + return (ret); } typedef struct iostat_cbdata { Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Thu Nov 7 11:17:03 2019 (r354435) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Thu Nov 7 11:18:28 2019 (r354436) @@ -271,6 +271,8 @@ extern int zpool_clear(zpool_handle_t *, const char *, extern int zpool_reguid(zpool_handle_t *); extern int zpool_reopen(zpool_handle_t *); +extern int zpool_sync_one(zpool_handle_t *, void *); + extern int zpool_vdev_online(zpool_handle_t *, const char *, int, vdev_state_t *); extern int zpool_vdev_offline(zpool_handle_t *, const char *, boolean_t); Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Thu Nov 7 11:17:03 2019 (r354435) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Thu Nov 7 11:18:28 2019 (r354436) @@ -3515,6 +3515,27 @@ zpool_reopen(zpool_handle_t *zhp) return (zpool_standard_error(hdl, errno, msg)); } +/* call into libzfs_core to execute the sync IOCTL per pool */ +int +zpool_sync_one(zpool_handle_t *zhp, void *data) +{ + int ret; + libzfs_handle_t *hdl = zpool_get_handle(zhp); + const char *pool_name = zpool_get_name(zhp); + boolean_t *force = data; + nvlist_t *innvl = fnvlist_alloc(); + + fnvlist_add_boolean_value(innvl, "force", *force); + if ((ret = lzc_sync(pool_name, innvl, NULL)) != 0) { + nvlist_free(innvl); + return (zpool_standard_error_fmt(hdl, ret, + dgettext(TEXT_DOMAIN, "sync '%s' failed"), pool_name)); + } + nvlist_free(innvl); + + return (0); +} + /* * Convert from a devid string to a path. */ Modified: head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Thu Nov 7 11:17:03 2019 (r354435) +++ head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Thu Nov 7 11:18:28 2019 (r354436) @@ -24,6 +24,7 @@ * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2017 RackTop Systems. + * Copyright (c) 2017 Datto Inc. */ /* @@ -137,16 +138,17 @@ lzc_ioctl(zfs_ioc_t ioc, const char *name, { zfs_cmd_t zc = { 0 }; int error = 0; - char *packed; + char *packed = NULL; #ifdef __FreeBSD__ nvlist_t *oldsource; #endif - size_t size; + size_t size = 0; ASSERT3S(g_refcount, >, 0); VERIFY3S(g_fd, !=, -1); - (void) strlcpy(zc.zc_name, name, sizeof (zc.zc_name)); + if (name != NULL) + (void) strlcpy(zc.zc_name, name, sizeof (zc.zc_name)); #ifdef __FreeBSD__ if (zfs_ioctl_version == ZFS_IOCVER_UNDEF) @@ -160,9 +162,11 @@ lzc_ioctl(zfs_ioc_t ioc, const char *name, } #endif - packed = fnvlist_pack(source, &size); - zc.zc_nvlist_src = (uint64_t)(uintptr_t)packed; - zc.zc_nvlist_src_size = size; + if (source != NULL) { + packed = fnvlist_pack(source, &size); + zc.zc_nvlist_src = (uint64_t)(uintptr_t)packed; + zc.zc_nvlist_src_size = size; + } if (resultp != NULL) { *resultp = NULL; @@ -463,6 +467,18 @@ lzc_exists(const char *dataset) } /* + * outnvl is unused. + * It was added to preserve the function signature in case it is + * needed in the future. + */ +/*ARGSUSED*/ +int +lzc_sync(const char *pool_name, nvlist_t *innvl, nvlist_t **outnvl) +{ + return (lzc_ioctl(ZFS_IOC_POOL_SYNC, pool_name, innvl, NULL)); +} + +/* * Create "user holds" on snapshots. If there is a hold on a snapshot, * the snapshot can not be destroyed. (However, it can be marked for deletion * by lzc_destroy_snaps(defer=B_TRUE).) @@ -562,11 +578,7 @@ lzc_release(nvlist_t *holds, nvlist_t **errlist) int lzc_get_holds(const char *snapname, nvlist_t **holdsp) { - int error; - nvlist_t *innvl = fnvlist_alloc(); - error = lzc_ioctl(ZFS_IOC_GET_HOLDS, snapname, innvl, holdsp); - fnvlist_free(innvl); - return (error); + return (lzc_ioctl(ZFS_IOC_GET_HOLDS, snapname, NULL, holdsp)); } /* Modified: head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Thu Nov 7 11:17:03 2019 (r354435) +++ head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Thu Nov 7 11:18:28 2019 (r354436) @@ -23,6 +23,7 @@ * Copyright (c) 2012, 2016 by Delphix. All rights reserved. * Copyright (c) 2013 by Martin Matuska . All rights reserved. * Copyright 2017 RackTop Systems. + * Copyright (c) 2017 Datto Inc. */ #ifndef _LIBZFS_CORE_H @@ -90,6 +91,8 @@ boolean_t lzc_exists(const char *); int lzc_rollback(const char *, char *, int); int lzc_rollback_to(const char *, const char *); + +int lzc_sync(const char *, nvlist_t *, nvlist_t **); int lzc_rename(const char *, const char *); int lzc_destroy(const char *); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Nov 7 11:17:03 2019 (r354435) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Nov 7 11:18:28 2019 (r354436) @@ -5836,6 +5836,7 @@ zfs_ioc_hold(const char *pool, nvlist_t *args, nvlist_ static int zfs_ioc_get_holds(const char *snapname, nvlist_t *args, nvlist_t *outnvl) { + ASSERT3P(args, ==, NULL); return (dsl_dataset_get_holds(snapname, outnvl)); } @@ -6134,6 +6135,44 @@ out: return (error); } +/* + * Sync the currently open TXG to disk for the specified pool. + * This is somewhat similar to 'zfs_sync()'. + * For cases that do not result in error this ioctl will wait for + * the currently open TXG to commit before returning back to the caller. + * + * innvl: { + * "force" -> when true, force uberblock update even if there is no dirty data. + * In addition this will cause the vdev configuration to be written + * out including updating the zpool cache file. (boolean_t) + * } + * + * onvl is unused + */ +/* ARGSUSED */ +static int +zfs_ioc_pool_sync(const char *pool, nvlist_t *innvl, nvlist_t *onvl) +{ + int err; + boolean_t force; + spa_t *spa; + + if ((err = spa_open(pool, &spa, FTAG)) != 0) + return (err); + + force = fnvlist_lookup_boolean_value(innvl, "force"); + if (force) { + spa_config_enter(spa, SCL_CONFIG, FTAG, RW_WRITER); + vdev_config_dirty(spa->spa_root_vdev); + spa_config_exit(spa, SCL_CONFIG, FTAG); + } + txg_wait_synced(spa_get_dsl(spa), 0); + + spa_close(spa, FTAG); + + return (err); +} + static zfs_ioc_vec_t zfs_ioc_vec[ZFS_IOC_LAST - ZFS_IOC_FIRST]; static void @@ -6323,6 +6362,10 @@ zfs_ioctl_init(void) zfs_ioctl_register("initialize", ZFS_IOC_POOL_INITIALIZE, zfs_ioc_pool_initialize, zfs_secpolicy_config, POOL_NAME, POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_TRUE, B_TRUE); + + zfs_ioctl_register("sync", ZFS_IOC_POOL_SYNC, + zfs_ioc_pool_sync, zfs_secpolicy_none, POOL_NAME, + POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_FALSE, B_FALSE); /* IOCTLS that use the legacy function signature */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Thu Nov 7 11:17:03 2019 (r354435) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Thu Nov 7 11:18:28 2019 (r354436) @@ -1016,6 +1016,7 @@ typedef enum zfs_ioc { ZFS_IOC_POOL_CHECKPOINT, ZFS_IOC_POOL_DISCARD_CHECKPOINT, ZFS_IOC_POOL_INITIALIZE, + ZFS_IOC_POOL_SYNC, ZFS_IOC_LAST } zfs_ioc_t; From owner-svn-src-head@freebsd.org Thu Nov 7 11:50:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A73FF1B1116; Thu, 7 Nov 2019 11:50:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4781v23p4xz4XPy; Thu, 7 Nov 2019 11:50:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 669DED3A7; Thu, 7 Nov 2019 11:50:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7BosCm030762; Thu, 7 Nov 2019 11:50:54 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7Bos6t030761; Thu, 7 Nov 2019 11:50:54 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201911071150.xA7Bos6t030761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 7 Nov 2019 11:50:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354437 - head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Commit-Revision: 354437 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 11:50:54 -0000 Author: avg Date: Thu Nov 7 11:50:53 2019 New Revision: 354437 URL: https://svnweb.freebsd.org/changeset/base/354437 Log: fix zpool list property names This change is based on r354380 8899 zpool list property documentation doesn't match actual behaviour There is no "used" pool property, "alloc" is actually spelled "allocated". MFC after: 5 days Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Nov 7 11:18:28 2019 (r354436) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Thu Nov 7 11:50:53 2019 (r354437) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 20, 2019 +.Dd November 7, 2019 .Dt ZPOOL 8 .Os .Sh NAME @@ -602,8 +602,8 @@ Each pool has several properties associated with it. S read-only statistics while others are configurable and change the behavior of the pool. The following are read-only properties: .Bl -tag -width "dedupratio" -.It Sy alloc -Amount of storage space within the pool that has been physically allocated. +.It Sy allocated +Amount of storage space used within the pool. .It Sy capacity Percentage of pool space used. This property can also be referred to by its shortened column name, "cap". @@ -653,8 +653,6 @@ Information about unsupported features that are enable See .Xr zpool-features 7 for details. -.It Sy used -Amount of storage space used within the pool. .El .Pp The space usage properties report actual physical space available to the @@ -1576,8 +1574,8 @@ Comma-separated list of properties to display. See the section for a list of valid properties. The default list is .Sy name , .Sy size , -.Sy used , -.Sy available , +.Sy allocated , +.Sy free , .Sy checkpoint , .Sy expandsize , .Sy fragmentation , From owner-svn-src-head@freebsd.org Thu Nov 7 14:14:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBA2D1B5A5C; Thu, 7 Nov 2019 14:14:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4785575SYNz3FCh; Thu, 7 Nov 2019 14:14:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A893EEE4; Thu, 7 Nov 2019 14:14:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7EEpjb021755; Thu, 7 Nov 2019 14:14:51 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7EEpKW021754; Thu, 7 Nov 2019 14:14:51 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911071414.xA7EEpKW021754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 Nov 2019 14:14:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354441 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 354441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 14:14:51 -0000 Author: emaste Date: Thu Nov 7 14:14:51 2019 New Revision: 354441 URL: https://svnweb.freebsd.org/changeset/base/354441 Log: arch.7: armv6 uses lld by default as of r354289 Modified: head/share/man/man7/arch.7 Modified: head/share/man/man7/arch.7 ============================================================================== --- head/share/man/man7/arch.7 Thu Nov 7 13:12:38 2019 (r354440) +++ head/share/man/man7/arch.7 Thu Nov 7 14:14:51 2019 (r354441) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 11, 2019 +.Dd November 7, 2019 .Dt ARCH 7 .Os .Sh NAME @@ -316,7 +316,7 @@ This table shows the default tool chain for each archi .It aarch64 Ta Clang Ta lld .It amd64 Ta Clang Ta lld .It arm Ta Clang Ta GNU ld 2.17.50 -.It armv6 Ta Clang Ta GNU ld 2.17.50 +.It armv6 Ta Clang Ta lld .It armv7 Ta Clang Ta lld .It i386 Ta Clang Ta lld .It mips Ta GCC 4.2.1 Ta GNU ld 2.17.50 From owner-svn-src-head@freebsd.org Thu Nov 7 15:00:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF6A81B6A1F; Thu, 7 Nov 2019 15:00:38 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47865y4C4tz3HlZ; Thu, 7 Nov 2019 15:00:38 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73526F681; Thu, 7 Nov 2019 15:00:38 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7F0cSi045627; Thu, 7 Nov 2019 15:00:38 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7F0cFa045626; Thu, 7 Nov 2019 15:00:38 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201911071500.xA7F0cFa045626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 7 Nov 2019 15:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354443 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 354443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 15:00:38 -0000 Author: ae Date: Thu Nov 7 15:00:37 2019 New Revision: 354443 URL: https://svnweb.freebsd.org/changeset/base/354443 Log: Enqueue lladdr_task to update link level address of vlan, when its parent interface has changed. During vlan reconfiguration without destroying interface, it is possible, that parent interface will be changed. This usually means, that link layer address of vlan will be different. Therefore we need to update all associated with vlan's addresses permanent llentries - NDP for IPv6 addresses, and ARP for IPv4 addresses. This is done via lladdr_task execution. To avoid extra work, before execution do the check, that L2 address is different. No objection from: #network Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D22243 Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Thu Nov 7 14:16:55 2019 (r354442) +++ head/sys/net/if_vlan.c Thu Nov 7 15:00:37 2019 (r354443) @@ -1459,11 +1459,19 @@ vlan_config(struct ifvlan *ifv, struct ifnet *p, uint1 * Set up our interface address to reflect the underlying * physical interface's. */ - bcopy(IF_LLADDR(p), IF_LLADDR(ifp), p->if_addrlen); + TASK_INIT(&ifv->lladdr_task, 0, vlan_lladdr_fn, ifv); ((struct sockaddr_dl *)ifp->if_addr->ifa_addr)->sdl_alen = p->if_addrlen; - TASK_INIT(&ifv->lladdr_task, 0, vlan_lladdr_fn, ifv); + /* + * Do not schedule link address update if it was the same + * as previous parent's. This helps avoid updating for each + * associated llentry. + */ + if (memcmp(IF_LLADDR(p), IF_LLADDR(ifp), p->if_addrlen) != 0) { + bcopy(IF_LLADDR(p), IF_LLADDR(ifp), p->if_addrlen); + taskqueue_enqueue(taskqueue_thread, &ifv->lladdr_task); + } /* We are ready for operation now. */ ifp->if_drv_flags |= IFF_DRV_RUNNING; From owner-svn-src-head@freebsd.org Thu Nov 7 15:12:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 345DC1B71A7; Thu, 7 Nov 2019 15:12:19 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f193.google.com (mail-il1-f193.google.com [209.85.166.193]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4786MP73dnz3Jtn; Thu, 7 Nov 2019 15:12:17 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f193.google.com with SMTP id p6so2124619ilp.1; Thu, 07 Nov 2019 07:12:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bwB2+6pgOeKc78JUWzZRgPJPkBqTW3gXRe3kFkJMa7w=; b=f0dAS4fmO9p9Mk8RQXDZOTM/VW8IheX++ajc0mr/rqR1MtTTw8VgJEwe1gchX+syJ4 ofzhMdwPcMd4//Yq4sY41fdUFjVoaFMhupHrkHkqouwX8QhB86a7TY2oyGIFuk3cD/j4 38N3tXjCcnl8wkYoowgFRMenD0Pqx6cccKLcTcQI+0mdJf2GO4xTMHMQ4p0+NRSa04tu r6n7PDoEAEy322pnYxQ3t0Yg0y+3HQTgTuxvXMJ3J/YEneicdngbutB2HEkpfV9Lp028 j2w6raFZRMXm2/qwknQ9g5d2ph7IL6B/uxeWDYP2TrDnB8nOue777ZAa8NJHniXesK9U szaQ== X-Gm-Message-State: APjAAAViszQRk3gsOGpw1yTzr50BMFYFB9KIW0hsO+xOlTmkyzPVG7Pp RtLYbuhuQUqGztaRWJsoSS2vQ8FWaV+/J3738sWgeA== X-Google-Smtp-Source: APXvYqwqjP2vEo7Nzj2NpncI+1i2VjAStLQNBFsRlBUGwzuQs8iE+1pZ8R//r5bqCqi9jO8xliVxhlivqjlvTJrvF20= X-Received: by 2002:a92:5f06:: with SMTP id t6mr4920187ilb.17.1573139536370; Thu, 07 Nov 2019 07:12:16 -0800 (PST) MIME-Version: 1.0 References: <201911031745.xA3HjVeV051369@repo.freebsd.org> In-Reply-To: <201911031745.xA3HjVeV051369@repo.freebsd.org> From: Ed Maste Date: Thu, 7 Nov 2019 06:25:33 -0500 Message-ID: Subject: Re: svn commit: r354286 - in head/sys/arm64: arm64 include To: Alan Cox Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4786MP73dnz3Jtn X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.193 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-3.18 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-1.18)[ip: (-0.61), ipnet: 209.85.128.0/17(-3.20), asn: 15169(-2.01), country: US(-0.05)]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[193.166.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[193.166.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 15:12:19 -0000 On Sun, 3 Nov 2019 at 16:39, Alan Cox wrote: > > Author: alc > Date: Sun Nov 3 17:45:30 2019 > New Revision: 354286 > URL: https://svnweb.freebsd.org/changeset/base/354286 > > Log: > Utilize ASIDs to reduce both the direct and indirect costs of context I built a full pkg set on an Ampere eMAG on 2019-09-11, and again on 2019-11-04 after this change went in. The second build included TRYBROKEN so tried to build more ports and took slightly more time overall, but comparing the overall build duration (wall clock) of various ports is illustrative. llvm90 took the longest to build; it was 21:15:58 in the first run and 19:54:32 in the second. qt5-webkit went from 12:13:21 to 11:39:21. rust went from 15:14:46 to 13:49:50. firefox from 7:24:21 to 7:08:35. From owner-svn-src-head@freebsd.org Thu Nov 7 15:29:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A83A1B7A49 for ; Thu, 7 Nov 2019 15:29:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4786l74qFsz3LG3 for ; Thu, 7 Nov 2019 15:29:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x732.google.com with SMTP id z16so2318329qkg.7 for ; Thu, 07 Nov 2019 07:29:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wiX8v9nQhkIlvUUuS82CIMZgJytlgvb0ik9T18UGfcE=; b=Ruegy6NRxysEgneu1s0IHkfkWHDkgy6Nd09SFOha28dOeBelPiGStaKJxRVSWLXRdF fjwK5JBRdwTkp504NssCHshuGT0aoYFUYUD//NMQcQ+yMMLLzrVBw5u8xW6tW+QJi/JO wvLYzhkAmrTrRFsP6Po9uSZtuHN7YTtB4EB8xf7PyXd6qa4aBXEo4YIjk3SAzt70IElB Y3G75bTRS/fqi0PD9gXaZZ7rT/tYJWRRi/t+0w0TsKbzb5f+5LeNXh439zSufcmayCr8 CjJF3z9AVv7UUZxZYkCnou2lrS8UG8KDfCzt3eVWHZDtP+9qXw4P0LtcoqF6yNis14Ad LlcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wiX8v9nQhkIlvUUuS82CIMZgJytlgvb0ik9T18UGfcE=; b=STpSoMRpqHq4rE8/oAQ7MoGzV1zGQwaLauUBN1qj0HnSCnhOVIUKeQiBnY0C5IuvCV Ur7C53JCFiAXb6Wo/A8/N1ksLajdNbKqYAu2m78yU71p7gmmCtEDZU+/TBOY1XRy59UV QQUqTkKYXjSISMK3ze5iquxnoUp5miJVxKg1NvruWy02TUpZSfY5e9GYlQgQ8+lAV6pF BDHW5ZEOON6oRjHC8orQgh52mdvwSKsopCRK82gkc6Cuwy2QsQXCLj2wZE9pePRPiHfd omtF2mHuCjClWtvCL8NKSgB6dgGFfINARTehKYwA61+IrwvgecdT7dqPyGCnymqxglTu JvAg== X-Gm-Message-State: APjAAAVfvDYwMl7BmJ2UXFAya/10CFV9YNZ472bGgixE7lKQE87EUkOU 2rQKWS98sCxmQC3An6xRgozYWun581qqOgJEVVkuhQ== X-Google-Smtp-Source: APXvYqySocZTYpehXC6vziFOzd6K5V+tdYaDF/5Zgtwn65LgAFfLiAtDH7TzaokwFqeRywUHY3uBpS7qfxCkx8IBmto= X-Received: by 2002:a37:4716:: with SMTP id u22mr3354678qka.495.1573140561903; Thu, 07 Nov 2019 07:29:21 -0800 (PST) MIME-Version: 1.0 References: <201911071117.xA7BH390010873@repo.freebsd.org> In-Reply-To: <201911071117.xA7BH390010873@repo.freebsd.org> From: Warner Losh Date: Thu, 7 Nov 2019 08:29:10 -0700 Message-ID: Subject: Re: svn commit: r354435 - head/stand/efi/libefi To: Toomas Soome Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4786l74qFsz3LG3 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=Ruegy6NR; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::732) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.67 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MIME_BASE64_TEXT(0.10)[]; RCVD_IN_DNSWL_NONE(0.00)[2.3.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.77)[ip: (-9.42), ipnet: 2607:f8b0::/32(-2.35), asn: 15169(-2.01), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 15:29:24 -0000 On Thu, Nov 7, 2019 at 4:17 AM Toomas Soome wrote: > Author: tsoome > Date: Thu Nov 7 11:17:03 2019 > New Revision: 354435 > URL: https://svnweb.freebsd.org/changeset/base/354435 > > Log: > loader: implement fallback efi_devpath_to_name() > > UEFI 1.10 on macs does not seem to provide devpath to name translation, > provide our own (limited) version, so we can get information about > commmon > devices. > We specifically deleted our own version of this function (it was wrong in many ways too) because we thought we could require a minimum UEFI 2.0 for full functionality... This sort of function is a total pain to maintain. I'd prefer the fallback was "you don't get this" rather than bloating the code, especially for devices that we don't care about and will never care about for booting... Warner > MFC after: 1 week > > Modified: > head/stand/efi/libefi/devpath.c > > Modified: head/stand/efi/libefi/devpath.c > > ============================================================================== > --- head/stand/efi/libefi/devpath.c Thu Nov 7 07:21:45 2019 > (r354434) > +++ head/stand/efi/libefi/devpath.c Thu Nov 7 11:17:03 2019 > (r354435) > @@ -29,13 +29,16 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > +#include > > static EFI_GUID ImageDevicePathGUID = > EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID; > static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; > static EFI_GUID DevicePathToTextGUID = > EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID; > static EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *toTextProtocol; > -static EFI_GUID DevicePathFromTextGUID = > EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID; > +static EFI_GUID DevicePathFromTextGUID = > + EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID; > static EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *fromTextProtocol; > > EFI_DEVICE_PATH * > @@ -64,6 +67,427 @@ efi_lookup_devpath(EFI_HANDLE handle) > return (devpath); > } > > +static char * > +efi_make_tail(char *suffix) > +{ > + char *tail; > + > + tail = NULL; > + if (suffix != NULL) > + (void)asprintf(&tail, "/%s", suffix); > + else > + tail = strdup(""); > + return (tail); > +} > + > +typedef struct { > + EFI_DEVICE_PATH Header; > + EFI_GUID Guid; > + UINT8 VendorDefinedData[1]; > +} __packed VENDOR_DEVICE_PATH_WITH_DATA; > + > +static char * > +efi_vendor_path(const char *type, VENDOR_DEVICE_PATH *node, char *suffix) > +{ > + uint32_t size = DevicePathNodeLength(&node->Header) - > sizeof(*node); > + VENDOR_DEVICE_PATH_WITH_DATA *dp = (VENDOR_DEVICE_PATH_WITH_DATA > *)node; > + char *name, *tail, *head; > + char *uuid; > + int rv; > + > + uuid_to_string((const uuid_t *)(void *)&node->Guid, &uuid, &rv); > + if (rv != uuid_s_ok) > + return (NULL); > + > + tail = efi_make_tail(suffix); > + rv = asprintf(&head, "%sVendor(%s)[%x:", type, uuid, size); > + free(uuid); > + if (rv < 0) > + return (NULL); > + > + if (DevicePathNodeLength(&node->Header) > sizeof(*node)) { > + for (uint32_t i = 0; i < size; i++) { > + rv = asprintf(&name, "%s%02x", head, > + dp->VendorDefinedData[i]); > + if (rv < 0) { > + free(tail); > + free(head); > + return (NULL); > + } > + free(head); > + head = name; > + } > + } > + > + if (asprintf(&name, "%s]%s", head, tail) < 0) > + name = NULL; > + free(head); > + free(tail); > + return (name); > +} > + > +static char * > +efi_hw_dev_path(EFI_DEVICE_PATH *node, char *suffix) > +{ > + uint8_t subtype = DevicePathSubType(node); > + char *name, *tail; > + > + tail = efi_make_tail(suffix); > + switch (subtype) { > + case HW_PCI_DP: > + if (asprintf(&name, "Pci(%x,%x)%s", > + ((PCI_DEVICE_PATH *)node)->Function, > + ((PCI_DEVICE_PATH *)node)->Device, tail) < 0) > + name = NULL; > + break; > + case HW_PCCARD_DP: > + if (asprintf(&name, "PCCARD(%x)%s", > + ((PCCARD_DEVICE_PATH *)node)->FunctionNumber, tail) < > 0) > + name = NULL; > + break; > + case HW_MEMMAP_DP: > + if (asprintf(&name, "MMap(%x,%" PRIx64 ",%" PRIx64 ")%s", > + ((MEMMAP_DEVICE_PATH *)node)->MemoryType, > + ((MEMMAP_DEVICE_PATH *)node)->StartingAddress, > + ((MEMMAP_DEVICE_PATH *)node)->EndingAddress, tail) < 0) > + name = NULL; > + break; > + case HW_VENDOR_DP: > + name = efi_vendor_path("Hardware", > + (VENDOR_DEVICE_PATH *)node, tail); > + break; > + case HW_CONTROLLER_DP: > + if (asprintf(&name, "Ctrl(%x)%s", > + ((CONTROLLER_DEVICE_PATH *)node)->Controller, tail) < > 0) > + name = NULL; > + break; > + default: > + if (asprintf(&name, "UnknownHW(%x)%s", subtype, tail) < 0) > + name = NULL; > + break; > + } > + free(tail); > + return (name); > +} > + > +static char * > +efi_acpi_dev_path(EFI_DEVICE_PATH *node, char *suffix) > +{ > + uint8_t subtype = DevicePathSubType(node); > + ACPI_HID_DEVICE_PATH *acpi = (ACPI_HID_DEVICE_PATH *)node; > + char *name, *tail; > + > + tail = efi_make_tail(suffix); > + switch (subtype) { > + case ACPI_DP: > + if ((acpi->HID & PNP_EISA_ID_MASK) == PNP_EISA_ID_CONST) { > + switch (EISA_ID_TO_NUM (acpi->HID)) { > + case 0x0a03: > + if (asprintf(&name, "PciRoot(%x)%s", > + acpi->UID, tail) < 0) > + name = NULL; > + break; > + case 0x0a08: > + if (asprintf(&name, "PcieRoot(%x)%s", > + acpi->UID, tail) < 0) > + name = NULL; > + break; > + case 0x0604: > + if (asprintf(&name, "Floppy(%x)%s", > + acpi->UID, tail) < 0) > + name = NULL; > + break; > + case 0x0301: > + if (asprintf(&name, "Keyboard(%x)%s", > + acpi->UID, tail) < 0) > + name = NULL; > + break; > + case 0x0501: > + if (asprintf(&name, "Serial(%x)%s", > + acpi->UID, tail) < 0) > + name = NULL; > + break; > + case 0x0401: > + if (asprintf(&name, "ParallelPort(%x)%s", > + acpi->UID, tail) < 0) > + name = NULL; > + break; > + default: > + if (asprintf(&name, "Acpi(PNP%04x,%x)%s", > + EISA_ID_TO_NUM(acpi->HID), > + acpi->UID, tail) < 0) > + name = NULL; > + break; > + } > + } else { > + if (asprintf(&name, "Acpi(%08x,%x)%s", > + acpi->HID, acpi->UID, tail) < 0) > + name = NULL; > + } > + break; > + case ACPI_EXTENDED_DP: > + default: > + if (asprintf(&name, "UnknownACPI(%x)%s", subtype, tail) < > 0) > + name = NULL; > + break; > + } > + free(tail); > + return (name); > +} > + > +static char * > +efi_messaging_dev_path(EFI_DEVICE_PATH *node, char *suffix) > +{ > + uint8_t subtype = DevicePathSubType(node); > + char *name; > + char *tail; > + > + tail = efi_make_tail(suffix); > + switch (subtype) { > + case MSG_ATAPI_DP: > + if (asprintf(&name, "ATA(%s,%s,%x)%s", > + ((ATAPI_DEVICE_PATH *)node)->PrimarySecondary == 1 ? > + "Secondary" : "Primary", > + ((ATAPI_DEVICE_PATH *)node)->SlaveMaster == 1 ? > + "Slave" : "Master", > + ((ATAPI_DEVICE_PATH *)node)->Lun, tail) < 0) > + name = NULL; > + break; > + case MSG_SCSI_DP: > + if (asprintf(&name, "SCSI(%x,%x)%s", > + ((SCSI_DEVICE_PATH *)node)->Pun, > + ((SCSI_DEVICE_PATH *)node)->Lun, tail) < 0) > + name = NULL; > + break; > + case MSG_FIBRECHANNEL_DP: > + if (asprintf(&name, "Fibre(%" PRIx64 ",%" PRIx64 ")%s", > + ((FIBRECHANNEL_DEVICE_PATH *)node)->WWN, > + ((FIBRECHANNEL_DEVICE_PATH *)node)->Lun, tail) < 0) > + name = NULL; > + break; > + case MSG_1394_DP: > + if (asprintf(&name, "I1394(%016" PRIx64 ")%s", > + ((F1394_DEVICE_PATH *)node)->Guid, tail) < 0) > + name = NULL; > + break; > + case MSG_USB_DP: > + if (asprintf(&name, "USB(%x,%x)%s", > + ((USB_DEVICE_PATH *)node)->ParentPortNumber, > + ((USB_DEVICE_PATH *)node)->InterfaceNumber, tail) < 0) > + name = NULL; > + break; > + case MSG_USB_CLASS_DP: > + if (asprintf(&name, "UsbClass(%x,%x,%x,%x,%x)%s", > + ((USB_CLASS_DEVICE_PATH *)node)->VendorId, > + ((USB_CLASS_DEVICE_PATH *)node)->ProductId, > + ((USB_CLASS_DEVICE_PATH *)node)->DeviceClass, > + ((USB_CLASS_DEVICE_PATH *)node)->DeviceSubClass, > + ((USB_CLASS_DEVICE_PATH *)node)->DeviceProtocol, tail) > < 0) > + name = NULL; > + break; > + case MSG_MAC_ADDR_DP: > + if (asprintf(&name, > "MAC(%02x:%02x:%02x:%02x:%02x:%02x,%x)%s", > + ((MAC_ADDR_DEVICE_PATH *)node)->MacAddress.Addr[0], > + ((MAC_ADDR_DEVICE_PATH *)node)->MacAddress.Addr[1], > + ((MAC_ADDR_DEVICE_PATH *)node)->MacAddress.Addr[2], > + ((MAC_ADDR_DEVICE_PATH *)node)->MacAddress.Addr[3], > + ((MAC_ADDR_DEVICE_PATH *)node)->MacAddress.Addr[4], > + ((MAC_ADDR_DEVICE_PATH *)node)->MacAddress.Addr[5], > + ((MAC_ADDR_DEVICE_PATH *)node)->IfType, tail) < 0) > + name = NULL; > + break; > + case MSG_VENDOR_DP: > + name = efi_vendor_path("Messaging", > + (VENDOR_DEVICE_PATH *)node, tail); > + break; > + case MSG_UART_DP: > + if (asprintf(&name, "UART(%" PRIu64 ",%u,%x,%x)%s", > + ((UART_DEVICE_PATH *)node)->BaudRate, > + ((UART_DEVICE_PATH *)node)->DataBits, > + ((UART_DEVICE_PATH *)node)->Parity, > + ((UART_DEVICE_PATH *)node)->StopBits, tail) < 0) > + name = NULL; > + break; > + case MSG_SATA_DP: > + if (asprintf(&name, "Sata(%x,%x,%x)%s", > + ((SATA_DEVICE_PATH *)node)->HBAPortNumber, > + ((SATA_DEVICE_PATH *)node)->PortMultiplierPortNumber, > + ((SATA_DEVICE_PATH *)node)->Lun, tail) < 0) > + name = NULL; > + break; > + default: > + if (asprintf(&name, "UnknownMessaging(%x)%s", > + subtype, tail) < 0) > + name = NULL; > + break; > + } > + free(tail); > + return (name); > +} > + > +static char * > +efi_media_dev_path(EFI_DEVICE_PATH *node, char *suffix) > +{ > + uint8_t subtype = DevicePathSubType(node); > + HARDDRIVE_DEVICE_PATH *hd; > + char *name; > + char *str; > + char *tail; > + int rv; > + > + tail = efi_make_tail(suffix); > + name = NULL; > + switch (subtype) { > + case MEDIA_HARDDRIVE_DP: > + hd = (HARDDRIVE_DEVICE_PATH *)node; > + switch (hd->SignatureType) { > + case SIGNATURE_TYPE_MBR: > + if (asprintf(&name, "HD(%d,MBR,%08x,%" PRIx64 > + ",%" PRIx64 ")%s", > + hd->PartitionNumber, > + *((uint32_t *)(uintptr_t)&hd->Signature[0]), > + hd->PartitionStart, > + hd->PartitionSize, tail) < 0) > + name = NULL; > + break; > + case SIGNATURE_TYPE_GUID: > + name = NULL; > + uuid_to_string((const uuid_t *)(void *) > + &hd->Signature[0], &str, &rv); > + if (rv != uuid_s_ok) > + break; > + rv = asprintf(&name, "HD(%d,GPT,%s,%" PRIx64 ",%" > + PRIx64 ")%s", > + hd->PartitionNumber, str, > + hd->PartitionStart, hd->PartitionSize, tail); > + free(str); > + break; > + default: > + if (asprintf(&name, "HD(%d,%d,0)%s", > + hd->PartitionNumber, > + hd->SignatureType, tail) < 0) { > + name = NULL; > + } > + break; > + } > + break; > + case MEDIA_CDROM_DP: > + if (asprintf(&name, "CD(%x,%" PRIx64 ",%" PRIx64 ")%s", > + ((CDROM_DEVICE_PATH *)node)->BootEntry, > + ((CDROM_DEVICE_PATH *)node)->PartitionStart, > + ((CDROM_DEVICE_PATH *)node)->PartitionSize, tail) < 0) > { > + name = NULL; > + } > + break; > + case MEDIA_VENDOR_DP: > + name = efi_vendor_path("Media", > + (VENDOR_DEVICE_PATH *)node, tail); > + break; > + case MEDIA_FILEPATH_DP: > + name = NULL; > + str = NULL; > + if (ucs2_to_utf8(((FILEPATH_DEVICE_PATH *)node)->PathName, > + &str) == 0) { > + (void)asprintf(&name, "%s%s", str, tail); > + free(str); > + } > + break; > + case MEDIA_PROTOCOL_DP: > + name = NULL; > + uuid_to_string((const uuid_t *)(void *) > + &((MEDIA_PROTOCOL_DEVICE_PATH *)node)->Protocol, > + &str, &rv); > + if (rv != uuid_s_ok) > + break; > + rv = asprintf(&name, "Protocol(%s)%s", str, tail); > + free(str); > + break; > + default: > + if (asprintf(&name, "UnknownMedia(%x)%s", > + subtype, tail) < 0) > + name = NULL; > + } > + free(tail); > + return (name); > +} > + > +static char * > +efi_translate_devpath(EFI_DEVICE_PATH *devpath) > +{ > + EFI_DEVICE_PATH *dp = NextDevicePathNode(devpath); > + char *name, *ptr; > + uint8_t type; > + > + if (!IsDevicePathEnd(devpath)) > + name = efi_translate_devpath(dp); > + else > + return (NULL); > + > + ptr = NULL; > + type = DevicePathType(devpath); > + switch (type) { > + case HARDWARE_DEVICE_PATH: > + ptr = efi_hw_dev_path(devpath, name); > + break; > + case ACPI_DEVICE_PATH: > + ptr = efi_acpi_dev_path(devpath, name); > + break; > + case MESSAGING_DEVICE_PATH: > + ptr = efi_messaging_dev_path(devpath, name); > + break; > + case MEDIA_DEVICE_PATH: > + ptr = efi_media_dev_path(devpath, name); > + break; > + case BBS_DEVICE_PATH: > + default: > + if (asprintf(&ptr, "UnknownPath(%x)%s", type, > + name? name : "") < 0) > + ptr = NULL; > + break; > + } > + > + if (ptr != NULL) { > + free(name); > + name = ptr; > + } > + return (name); > +} > + > +static CHAR16 * > +efi_devpath_to_name(EFI_DEVICE_PATH *devpath) > +{ > + char *name = NULL; > + CHAR16 *ptr = NULL; > + size_t len; > + int rv; > + > + name = efi_translate_devpath(devpath); > + if (name == NULL) > + return (NULL); > + > + /* > + * We need to return memory from AllocatePool, so it can be freed > + * with FreePool() in efi_free_devpath_name(). > + */ > + rv = utf8_to_ucs2(name, &ptr, &len); > + free(name); > + if (rv == 0) { > + CHAR16 *out = NULL; > + EFI_STATUS status; > + > + status = BS->AllocatePool(EfiLoaderData, len, (void > **)&out); > + if (EFI_ERROR(status)) { > + free(ptr); > + return (out); > + } > + memcpy(out, ptr, len); > + free(ptr); > + ptr = out; > + } > + > + return (ptr); > +} > + > CHAR16 * > efi_devpath_name(EFI_DEVICE_PATH *devpath) > { > @@ -78,7 +502,7 @@ efi_devpath_name(EFI_DEVICE_PATH *devpath) > toTextProtocol = NULL; > } > if (toTextProtocol == NULL) > - return (NULL); > + return (efi_devpath_to_name(devpath)); > > return (toTextProtocol->ConvertDevicePathToText(devpath, TRUE, > TRUE)); > } > @@ -86,8 +510,8 @@ efi_devpath_name(EFI_DEVICE_PATH *devpath) > void > efi_free_devpath_name(CHAR16 *text) > { > - > - BS->FreePool(text); > + if (text != NULL) > + BS->FreePool(text); > } > > EFI_DEVICE_PATH * > From owner-svn-src-head@freebsd.org Thu Nov 7 15:39:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 402931B7E2D for ; Thu, 7 Nov 2019 15:39:29 +0000 (UTC) (envelope-from tsoome@me.com) Received: from pv50p00im-ztdg10021901.me.com (pv50p00im-ztdg10021901.me.com [17.58.6.55]) (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 4786ym3YxGz3M5T for ; Thu, 7 Nov 2019 15:39:28 +0000 (UTC) (envelope-from tsoome@me.com) Received: from nazgul.lan (148-52-235-80.sta.estpak.ee [80.235.52.148]) by pv50p00im-ztdg10021901.me.com (Postfix) with ESMTPSA id 73DBC880DB7; Thu, 7 Nov 2019 15:39:24 +0000 (UTC) From: Toomas Soome Message-Id: <1AFEA810-CC13-444E-BF28-1C3D07CA0FC2@me.com> Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3601.0.10\)) Subject: Re: svn commit: r354435 - head/stand/efi/libefi Date: Thu, 7 Nov 2019 17:39:21 +0200 In-Reply-To: Cc: Toomas Soome , src-committers , svn-src-all , svn-src-head To: Warner Losh References: <201911071117.xA7BH390010873@repo.freebsd.org> X-Mailer: Apple Mail (2.3601.0.10) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-11-07_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1911070149 X-Rspamd-Queue-Id: 4786ym3YxGz3M5T X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.60 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:17.58.0.0/16:c]; FREEMAIL_FROM(0.00)[me.com]; MV_CASE(0.50)[]; RCPT_COUNT_FIVE(0.00)[5]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[me.com:+]; DMARC_POLICY_ALLOW(-0.50)[me.com,quarantine]; RCVD_IN_DNSWL_LOW(-0.10)[55.6.58.17.list.dnswl.org : 127.0.5.1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[me.com]; ASN(0.00)[asn:714, ipnet:17.58.0.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[148.52.235.80.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[me.com:s=1a1hai]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; IP_SCORE(0.00)[ip: (-8.62), ipnet: 17.58.0.0/20(-2.45), asn: 714(-2.52), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; DWL_DNSWL_LOW(-1.00)[me.com.dwl.dnswl.org : 127.0.5.1]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 15:39:29 -0000 > On 7. Nov 2019, at 17:29, Warner Losh wrote: >=20 >=20 >=20 > On Thu, Nov 7, 2019 at 4:17 AM Toomas Soome > wrote: > Author: tsoome > Date: Thu Nov 7 11:17:03 2019 > New Revision: 354435 > URL: https://svnweb.freebsd.org/changeset/base/354435 = >=20 > Log: > loader: implement fallback efi_devpath_to_name() >=20 > UEFI 1.10 on macs does not seem to provide devpath to name = translation, > provide our own (limited) version, so we can get information about = commmon > devices. >=20 > We specifically deleted our own version of this function (it was wrong = in many ways too) because we thought we could require a minimum UEFI 2.0 = for full functionality... This sort of function is a total pain to = maintain. >=20 > I'd prefer the fallback was "you don't get this" rather than bloating = the code, especially for devices that we don't care about and will never = care about for booting... >=20 > Warner I can see why, but then again, try to debug such system=E2=80=A6 btw, = that particular one I debug is MacBookPro11,4 with quad core i7=E2=80=A6. = not even that old hw anyhow. I=E2=80=99d rather keep some bloat than spend 2-3 days to write code = just to get any idea what is going on in the machine=E2=80=A6 rgds, toomas > =20 > MFC after: 1 week >=20 > Modified: > head/stand/efi/libefi/devpath.c >=20 > Modified: head/stand/efi/libefi/devpath.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/stand/efi/libefi/devpath.c Thu Nov 7 07:21:45 2019 = (r354434) > +++ head/stand/efi/libefi/devpath.c Thu Nov 7 11:17:03 2019 = (r354435) > @@ -29,13 +29,16 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > +#include >=20 > static EFI_GUID ImageDevicePathGUID =3D > EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID; > static EFI_GUID DevicePathGUID =3D DEVICE_PATH_PROTOCOL; > static EFI_GUID DevicePathToTextGUID =3D = EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID; > static EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *toTextProtocol; > -static EFI_GUID DevicePathFromTextGUID =3D = EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID; > +static EFI_GUID DevicePathFromTextGUID =3D > + EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID; > static EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *fromTextProtocol; >=20 > EFI_DEVICE_PATH * > @@ -64,6 +67,427 @@ efi_lookup_devpath(EFI_HANDLE handle) > return (devpath); > } >=20 > +static char * > +efi_make_tail(char *suffix) > +{ > + char *tail; > + > + tail =3D NULL; > + if (suffix !=3D NULL) > + (void)asprintf(&tail, "/%s", suffix); > + else > + tail =3D strdup(""); > + return (tail); > +} > + > +typedef struct { > + EFI_DEVICE_PATH Header; > + EFI_GUID Guid; > + UINT8 VendorDefinedData[1]; > +} __packed VENDOR_DEVICE_PATH_WITH_DATA; > + > +static char * > +efi_vendor_path(const char *type, VENDOR_DEVICE_PATH *node, char = *suffix) > +{ > + uint32_t size =3D DevicePathNodeLength(&node->Header) - = sizeof(*node); > + VENDOR_DEVICE_PATH_WITH_DATA *dp =3D = (VENDOR_DEVICE_PATH_WITH_DATA *)node; > + char *name, *tail, *head; > + char *uuid; > + int rv; > + > + uuid_to_string((const uuid_t *)(void *)&node->Guid, &uuid, = &rv); > + if (rv !=3D uuid_s_ok) > + return (NULL); > + > + tail =3D efi_make_tail(suffix); > + rv =3D asprintf(&head, "%sVendor(%s)[%x:", type, uuid, size); > + free(uuid); > + if (rv < 0) > + return (NULL); > + > + if (DevicePathNodeLength(&node->Header) > sizeof(*node)) { > + for (uint32_t i =3D 0; i < size; i++) { > + rv =3D asprintf(&name, "%s%02x", head, > + dp->VendorDefinedData[i]); > + if (rv < 0) { > + free(tail); > + free(head); > + return (NULL); > + } > + free(head); > + head =3D name; > + } > + } > + > + if (asprintf(&name, "%s]%s", head, tail) < 0) > + name =3D NULL; > + free(head); > + free(tail); > + return (name); > +} > + > +static char * > +efi_hw_dev_path(EFI_DEVICE_PATH *node, char *suffix) > +{ > + uint8_t subtype =3D DevicePathSubType(node); > + char *name, *tail; > + > + tail =3D efi_make_tail(suffix); > + switch (subtype) { > + case HW_PCI_DP: > + if (asprintf(&name, "Pci(%x,%x)%s", > + ((PCI_DEVICE_PATH *)node)->Function, > + ((PCI_DEVICE_PATH *)node)->Device, tail) < 0) > + name =3D NULL; > + break; > + case HW_PCCARD_DP: > + if (asprintf(&name, "PCCARD(%x)%s", > + ((PCCARD_DEVICE_PATH *)node)->FunctionNumber, = tail) < 0) > + name =3D NULL; > + break; > + case HW_MEMMAP_DP: > + if (asprintf(&name, "MMap(%x,%" PRIx64 ",%" PRIx64 = ")%s", > + ((MEMMAP_DEVICE_PATH *)node)->MemoryType, > + ((MEMMAP_DEVICE_PATH *)node)->StartingAddress, > + ((MEMMAP_DEVICE_PATH *)node)->EndingAddress, tail) = < 0) > + name =3D NULL; > + break; > + case HW_VENDOR_DP: > + name =3D efi_vendor_path("Hardware", > + (VENDOR_DEVICE_PATH *)node, tail); > + break; > + case HW_CONTROLLER_DP: > + if (asprintf(&name, "Ctrl(%x)%s", > + ((CONTROLLER_DEVICE_PATH *)node)->Controller, = tail) < 0) > + name =3D NULL; > + break; > + default: > + if (asprintf(&name, "UnknownHW(%x)%s", subtype, tail) = < 0) > + name =3D NULL; > + break; > + } > + free(tail); > + return (name); > +} > + > +static char * > +efi_acpi_dev_path(EFI_DEVICE_PATH *node, char *suffix) > +{ > + uint8_t subtype =3D DevicePathSubType(node); > + ACPI_HID_DEVICE_PATH *acpi =3D (ACPI_HID_DEVICE_PATH *)node; > + char *name, *tail; > + > + tail =3D efi_make_tail(suffix); > + switch (subtype) { > + case ACPI_DP: > + if ((acpi->HID & PNP_EISA_ID_MASK) =3D=3D = PNP_EISA_ID_CONST) { > + switch (EISA_ID_TO_NUM (acpi->HID)) { > + case 0x0a03: > + if (asprintf(&name, "PciRoot(%x)%s", > + acpi->UID, tail) < 0) > + name =3D NULL; > + break; > + case 0x0a08: > + if (asprintf(&name, "PcieRoot(%x)%s", > + acpi->UID, tail) < 0) > + name =3D NULL; > + break; > + case 0x0604: > + if (asprintf(&name, "Floppy(%x)%s", > + acpi->UID, tail) < 0) > + name =3D NULL; > + break; > + case 0x0301: > + if (asprintf(&name, "Keyboard(%x)%s", > + acpi->UID, tail) < 0) > + name =3D NULL; > + break; > + case 0x0501: > + if (asprintf(&name, "Serial(%x)%s", > + acpi->UID, tail) < 0) > + name =3D NULL; > + break; > + case 0x0401: > + if (asprintf(&name, = "ParallelPort(%x)%s", > + acpi->UID, tail) < 0) > + name =3D NULL; > + break; > + default: > + if (asprintf(&name, = "Acpi(PNP%04x,%x)%s", > + EISA_ID_TO_NUM(acpi->HID), > + acpi->UID, tail) < 0) > + name =3D NULL; > + break; > + } > + } else { > + if (asprintf(&name, "Acpi(%08x,%x)%s", > + acpi->HID, acpi->UID, tail) < 0) > + name =3D NULL; > + } > + break; > + case ACPI_EXTENDED_DP: > + default: > + if (asprintf(&name, "UnknownACPI(%x)%s", subtype, = tail) < 0) > + name =3D NULL; > + break; > + } > + free(tail); > + return (name); > +} > + > +static char * > +efi_messaging_dev_path(EFI_DEVICE_PATH *node, char *suffix) > +{ > + uint8_t subtype =3D DevicePathSubType(node); > + char *name; > + char *tail; > + > + tail =3D efi_make_tail(suffix); > + switch (subtype) { > + case MSG_ATAPI_DP: > + if (asprintf(&name, "ATA(%s,%s,%x)%s", > + ((ATAPI_DEVICE_PATH *)node)->PrimarySecondary =3D=3D= 1 ? > + "Secondary" : "Primary", > + ((ATAPI_DEVICE_PATH *)node)->SlaveMaster =3D=3D 1 = ? > + "Slave" : "Master", > + ((ATAPI_DEVICE_PATH *)node)->Lun, tail) < 0) > + name =3D NULL; > + break; > + case MSG_SCSI_DP: > + if (asprintf(&name, "SCSI(%x,%x)%s", > + ((SCSI_DEVICE_PATH *)node)->Pun, > + ((SCSI_DEVICE_PATH *)node)->Lun, tail) < 0) > + name =3D NULL; > + break; > + case MSG_FIBRECHANNEL_DP: > + if (asprintf(&name, "Fibre(%" PRIx64 ",%" PRIx64 = ")%s", > + ((FIBRECHANNEL_DEVICE_PATH *)node)->WWN, > + ((FIBRECHANNEL_DEVICE_PATH *)node)->Lun, tail) < = 0) > + name =3D NULL; > + break; > + case MSG_1394_DP: > + if (asprintf(&name, "I1394(%016" PRIx64 ")%s", > + ((F1394_DEVICE_PATH *)node)->Guid, tail) < 0) > + name =3D NULL; > + break; > + case MSG_USB_DP: > + if (asprintf(&name, "USB(%x,%x)%s", > + ((USB_DEVICE_PATH *)node)->ParentPortNumber, > + ((USB_DEVICE_PATH *)node)->InterfaceNumber, tail) = < 0) > + name =3D NULL; > + break; > + case MSG_USB_CLASS_DP: > + if (asprintf(&name, "UsbClass(%x,%x,%x,%x,%x)%s", > + ((USB_CLASS_DEVICE_PATH *)node)->VendorId, > + ((USB_CLASS_DEVICE_PATH *)node)->ProductId, > + ((USB_CLASS_DEVICE_PATH *)node)->DeviceClass, > + ((USB_CLASS_DEVICE_PATH *)node)->DeviceSubClass, > + ((USB_CLASS_DEVICE_PATH *)node)->DeviceProtocol, = tail) < 0) > + name =3D NULL; > + break; > + case MSG_MAC_ADDR_DP: > + if (asprintf(&name, = "MAC(%02x:%02x:%02x:%02x:%02x:%02x,%x)%s", > + ((MAC_ADDR_DEVICE_PATH = *)node)->MacAddress.Addr[0], > + ((MAC_ADDR_DEVICE_PATH = *)node)->MacAddress.Addr[1], > + ((MAC_ADDR_DEVICE_PATH = *)node)->MacAddress.Addr[2], > + ((MAC_ADDR_DEVICE_PATH = *)node)->MacAddress.Addr[3], > + ((MAC_ADDR_DEVICE_PATH = *)node)->MacAddress.Addr[4], > + ((MAC_ADDR_DEVICE_PATH = *)node)->MacAddress.Addr[5], > + ((MAC_ADDR_DEVICE_PATH *)node)->IfType, tail) < 0) > + name =3D NULL; > + break; > + case MSG_VENDOR_DP: > + name =3D efi_vendor_path("Messaging", > + (VENDOR_DEVICE_PATH *)node, tail); > + break; > + case MSG_UART_DP: > + if (asprintf(&name, "UART(%" PRIu64 ",%u,%x,%x)%s", > + ((UART_DEVICE_PATH *)node)->BaudRate, > + ((UART_DEVICE_PATH *)node)->DataBits, > + ((UART_DEVICE_PATH *)node)->Parity, > + ((UART_DEVICE_PATH *)node)->StopBits, tail) < 0) > + name =3D NULL; > + break; > + case MSG_SATA_DP: > + if (asprintf(&name, "Sata(%x,%x,%x)%s", > + ((SATA_DEVICE_PATH *)node)->HBAPortNumber, > + ((SATA_DEVICE_PATH = *)node)->PortMultiplierPortNumber, > + ((SATA_DEVICE_PATH *)node)->Lun, tail) < 0) > + name =3D NULL; > + break; > + default: > + if (asprintf(&name, "UnknownMessaging(%x)%s", > + subtype, tail) < 0) > + name =3D NULL; > + break; > + } > + free(tail); > + return (name); > +} > + > +static char * > +efi_media_dev_path(EFI_DEVICE_PATH *node, char *suffix) > +{ > + uint8_t subtype =3D DevicePathSubType(node); > + HARDDRIVE_DEVICE_PATH *hd; > + char *name; > + char *str; > + char *tail; > + int rv; > + > + tail =3D efi_make_tail(suffix); > + name =3D NULL; > + switch (subtype) { > + case MEDIA_HARDDRIVE_DP: > + hd =3D (HARDDRIVE_DEVICE_PATH *)node; > + switch (hd->SignatureType) { > + case SIGNATURE_TYPE_MBR: > + if (asprintf(&name, "HD(%d,MBR,%08x,%" PRIx64 > + ",%" PRIx64 ")%s", > + hd->PartitionNumber, > + *((uint32_t = *)(uintptr_t)&hd->Signature[0]), > + hd->PartitionStart, > + hd->PartitionSize, tail) < 0) > + name =3D NULL; > + break; > + case SIGNATURE_TYPE_GUID: > + name =3D NULL; > + uuid_to_string((const uuid_t *)(void *) > + &hd->Signature[0], &str, &rv); > + if (rv !=3D uuid_s_ok) > + break; > + rv =3D asprintf(&name, "HD(%d,GPT,%s,%" PRIx64 = ",%" > + PRIx64 ")%s", > + hd->PartitionNumber, str, > + hd->PartitionStart, hd->PartitionSize, = tail); > + free(str); > + break; > + default: > + if (asprintf(&name, "HD(%d,%d,0)%s", > + hd->PartitionNumber, > + hd->SignatureType, tail) < 0) { > + name =3D NULL; > + } > + break; > + } > + break; > + case MEDIA_CDROM_DP: > + if (asprintf(&name, "CD(%x,%" PRIx64 ",%" PRIx64 = ")%s", > + ((CDROM_DEVICE_PATH *)node)->BootEntry, > + ((CDROM_DEVICE_PATH *)node)->PartitionStart, > + ((CDROM_DEVICE_PATH *)node)->PartitionSize, tail) = < 0) { > + name =3D NULL; > + } > + break; > + case MEDIA_VENDOR_DP: > + name =3D efi_vendor_path("Media", > + (VENDOR_DEVICE_PATH *)node, tail); > + break; > + case MEDIA_FILEPATH_DP: > + name =3D NULL; > + str =3D NULL; > + if (ucs2_to_utf8(((FILEPATH_DEVICE_PATH = *)node)->PathName, > + &str) =3D=3D 0) { > + (void)asprintf(&name, "%s%s", str, tail); > + free(str); > + } > + break; > + case MEDIA_PROTOCOL_DP: > + name =3D NULL; > + uuid_to_string((const uuid_t *)(void *) > + &((MEDIA_PROTOCOL_DEVICE_PATH *)node)->Protocol, > + &str, &rv); > + if (rv !=3D uuid_s_ok) > + break; > + rv =3D asprintf(&name, "Protocol(%s)%s", str, tail); > + free(str); > + break; > + default: > + if (asprintf(&name, "UnknownMedia(%x)%s", > + subtype, tail) < 0) > + name =3D NULL; > + } > + free(tail); > + return (name); > +} > + > +static char * > +efi_translate_devpath(EFI_DEVICE_PATH *devpath) > +{ > + EFI_DEVICE_PATH *dp =3D NextDevicePathNode(devpath); > + char *name, *ptr; > + uint8_t type; > + > + if (!IsDevicePathEnd(devpath)) > + name =3D efi_translate_devpath(dp); > + else > + return (NULL); > + > + ptr =3D NULL; > + type =3D DevicePathType(devpath); > + switch (type) { > + case HARDWARE_DEVICE_PATH: > + ptr =3D efi_hw_dev_path(devpath, name); > + break; > + case ACPI_DEVICE_PATH: > + ptr =3D efi_acpi_dev_path(devpath, name); > + break; > + case MESSAGING_DEVICE_PATH: > + ptr =3D efi_messaging_dev_path(devpath, name); > + break; > + case MEDIA_DEVICE_PATH: > + ptr =3D efi_media_dev_path(devpath, name); > + break; > + case BBS_DEVICE_PATH: > + default: > + if (asprintf(&ptr, "UnknownPath(%x)%s", type, > + name? name : "") < 0) > + ptr =3D NULL; > + break; > + } > + > + if (ptr !=3D NULL) { > + free(name); > + name =3D ptr; > + } > + return (name); > +} > + > +static CHAR16 * > +efi_devpath_to_name(EFI_DEVICE_PATH *devpath) > +{ > + char *name =3D NULL; > + CHAR16 *ptr =3D NULL; > + size_t len; > + int rv; > + > + name =3D efi_translate_devpath(devpath); > + if (name =3D=3D NULL) > + return (NULL); > + > + /* > + * We need to return memory from AllocatePool, so it can be = freed > + * with FreePool() in efi_free_devpath_name(). > + */ > + rv =3D utf8_to_ucs2(name, &ptr, &len); > + free(name); > + if (rv =3D=3D 0) { > + CHAR16 *out =3D NULL; > + EFI_STATUS status; > + > + status =3D BS->AllocatePool(EfiLoaderData, len, (void = **)&out); > + if (EFI_ERROR(status)) { > + free(ptr); > + return (out); > + } > + memcpy(out, ptr, len); > + free(ptr); > + ptr =3D out; > + } > + =20 > + return (ptr); > +} > + > CHAR16 * > efi_devpath_name(EFI_DEVICE_PATH *devpath) > { > @@ -78,7 +502,7 @@ efi_devpath_name(EFI_DEVICE_PATH *devpath) > toTextProtocol =3D NULL; > } > if (toTextProtocol =3D=3D NULL) > - return (NULL); > + return (efi_devpath_to_name(devpath)); >=20 > return (toTextProtocol->ConvertDevicePathToText(devpath, TRUE, = TRUE)); > } > @@ -86,8 +510,8 @@ efi_devpath_name(EFI_DEVICE_PATH *devpath) > void > efi_free_devpath_name(CHAR16 *text) > { > - > - BS->FreePool(text); > + if (text !=3D NULL) > + BS->FreePool(text); > } >=20 > EFI_DEVICE_PATH * From owner-svn-src-head@freebsd.org Thu Nov 7 15:47:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A6AD61B8153; Thu, 7 Nov 2019 15:47:06 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47877Z3fvSz3MdP; Thu, 7 Nov 2019 15:47:06 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D0DFFFD2; Thu, 7 Nov 2019 15:47:06 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7Fl6rq074929; Thu, 7 Nov 2019 15:47:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7Fl6qs074928; Thu, 7 Nov 2019 15:47:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911071547.xA7Fl6qs074928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 Nov 2019 15:47:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354445 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 354445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 15:47:06 -0000 Author: emaste Date: Thu Nov 7 15:47:05 2019 New Revision: 354445 URL: https://svnweb.freebsd.org/changeset/base/354445 Log: nvdimm.4: small grammar improvements Modified: head/share/man/man4/nvdimm.4 Modified: head/share/man/man4/nvdimm.4 ============================================================================== --- head/share/man/man4/nvdimm.4 Thu Nov 7 15:32:59 2019 (r354444) +++ head/share/man/man4/nvdimm.4 Thu Nov 7 15:47:05 2019 (r354445) @@ -121,12 +121,12 @@ and then updated by .Sh BUGS The .Nm -driver does not utilize the Block Window interface, so if the write to -NVDIMM was interrupted due to a system crash or power outage, -the corresponding page might be left in partially updated state. +driver does not utilize the Block Window interface, so if a write to an +NVDIMM is interrupted due to a system crash or power outage, +the corresponding page might be left in a partially updated state. .Pp There is no support for Device-Specific Methods (DSM), used to report and -control the device health and wearing. +control device health and wearing. .Pp The driver depends on the .Xr pmap_largemap 9 From owner-svn-src-head@freebsd.org Thu Nov 7 15:48:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E3921B81F2; Thu, 7 Nov 2019 15:48:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47879V6fhKz3MmX; Thu, 7 Nov 2019 15:48:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C344FFFD3; Thu, 7 Nov 2019 15:48:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7FmkjZ075044; Thu, 7 Nov 2019 15:48:46 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7Fmklo075043; Thu, 7 Nov 2019 15:48:46 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911071548.xA7Fmklo075043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 Nov 2019 15:48:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354446 - head/libexec/rc X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/libexec/rc X-SVN-Commit-Revision: 354446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 15:48:47 -0000 Author: emaste Date: Thu Nov 7 15:48:46 2019 New Revision: 354446 URL: https://svnweb.freebsd.org/changeset/base/354446 Log: rc.shutdown: print a newline before watchdog timeout message Previously the watchdog timeout message was appended to the last entry in the "Waiting for PIDS" list, resulting in a message like Waiting for PIDS: 31299 31296 90201 9020090 second watchdog timeout expired. Shutdown terminated. Print a newline to separate the watchdog timeout message. Also perform the kill before logging or echoing the message. PR: 241072 MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/libexec/rc/rc.shutdown Modified: head/libexec/rc/rc.shutdown ============================================================================== --- head/libexec/rc/rc.shutdown Thu Nov 7 15:47:05 2019 (r354445) +++ head/libexec/rc/rc.shutdown Thu Nov 7 15:48:46 2019 (r354446) @@ -69,12 +69,13 @@ _rcshutdown_watchdog= if [ -n "$rcshutdown_timeout" ]; then debug "Initiating watchdog timer." sleep $rcshutdown_timeout && ( + kill -KILL $$ >/dev/null 2>&1 _msg="$rcshutdown_timeout second watchdog" _msg="$_msg timeout expired. Shutdown terminated." logger -t rc.shutdown "$_msg" + echo echo "$_msg" date - kill -KILL $$ >/dev/null 2>&1 ) & _rcshutdown_watchdog=$! fi From owner-svn-src-head@freebsd.org Thu Nov 7 15:51:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC9F51B8306; Thu, 7 Nov 2019 15:51:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4787Dx4882z3NBy; Thu, 7 Nov 2019 15:51:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72A241813F; Thu, 7 Nov 2019 15:51:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7FpjjQ077826; Thu, 7 Nov 2019 15:51:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7FpjML077824; Thu, 7 Nov 2019 15:51:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911071551.xA7FpjML077824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 Nov 2019 15:51:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354447 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 354447 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 15:51:45 -0000 Author: emaste Date: Thu Nov 7 15:51:44 2019 New Revision: 354447 URL: https://svnweb.freebsd.org/changeset/base/354447 Log: linux_renameat2: improve flag checks In the cases where Linux returns an error (e.g. passing in an undefined flag) there's no need for us to emit a message. (The target of this message is a developer working on the linuxulatorm, not the author of presumably broken Linux software). Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21606 Modified: head/sys/compat/linux/linux_file.c head/sys/compat/linux/linux_file.h Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Thu Nov 7 15:48:46 2019 (r354446) +++ head/sys/compat/linux/linux_file.c Thu Nov 7 15:51:44 2019 (r354447) @@ -704,6 +704,13 @@ linux_renameat2(struct thread *td, struct linux_rename int error, olddfd, newdfd; if (args->flags != 0) { + if (args->flags & ~(LINUX_RENAME_EXCHANGE | + LINUX_RENAME_NOREPLACE | LINUX_RENAME_WHITEOUT)) + return (EINVAL); + if (args->flags & LINUX_RENAME_EXCHANGE && + args->flags & (LINUX_RENAME_NOREPLACE | + LINUX_RENAME_WHITEOUT)) + return (EINVAL); linux_msg(td, "renameat2 unsupported flags 0x%x", args->flags); return (EINVAL); Modified: head/sys/compat/linux/linux_file.h ============================================================================== --- head/sys/compat/linux/linux_file.h Thu Nov 7 15:48:46 2019 (r354446) +++ head/sys/compat/linux/linux_file.h Thu Nov 7 15:51:44 2019 (r354447) @@ -127,4 +127,11 @@ #define LINUX_F_UNLCK 2 #endif +/* + * renameat2 flags + */ +#define LINUX_RENAME_NOREPLACE 0x00000001 +#define LINUX_RENAME_EXCHANGE 0x00000002 +#define LINUX_RENAME_WHITEOUT 0x00000004 + #endif /* !_LINUX_FILE_H_ */ From owner-svn-src-head@freebsd.org Thu Nov 7 16:23:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A25531B92F8 for ; Thu, 7 Nov 2019 16:23:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4787xH3Gxmz3Q8x for ; Thu, 7 Nov 2019 16:23:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf2d.google.com with SMTP id f12so1027381qvu.3 for ; Thu, 07 Nov 2019 08:23:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ly3AIzavJ1t0FKV7pmvPXT8NUWZQjbG7kNJ7hrbLY1c=; b=AMcVXWQESQizTgDpsCYM0zchf5EbB82Y4RL7Zr6MPGwbePSkzyivX7B3PmjJ/Q9qtF 5+vljPL7Y6YE9DRxZG8RLRGOUjX4sOKdBFwV5iI85ffTLt1SegZhXDTs12YgsscyU86P g9CIp37bTXXTM61BtHtTgyA69AUi3abEXs9g9o5bS9ItdVGj98JqnrABdkvtTjIwktLH 5IDqUcBnwXe2piXLJjiryrc0t1pQPvhPq8DmyzUD5M+sdRodRWG8krQlgb6rvbCVVa0P qWFhG0LNhFnrr8XcWXnCdFp7YUZSVtW6JNw7ayh+eLJXABWwzrRHiFwVUbjSq4Ym/CUL smgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ly3AIzavJ1t0FKV7pmvPXT8NUWZQjbG7kNJ7hrbLY1c=; b=KfP3PLrFBfXa9+SIYCvXpz/zrVDe2u6UCfHpVt45YuEV8zZ4Ku9T/8kBSuELju2EFh pcURqJ1izmwE5TYKYJ/19WJpog82HUR9lxGnR5LWgm6hS6+85fYlM4AXNol0xMBhrj+b OGTfClch3HehOaqgHQDADNy2etfu4gDiD4WlYcsFrhOkWhFFKV7qXrMf0Yi+fpacNQuZ CsqQPj8/0QRpdSfQw6t17yEA1SuoS4QSTkF7lFX8hubOQfGg0ZPwWyaCK8bvyHA96GoS g5PFdFzmh9H6HewV9KEkgT5+cRIk64wam7Xrju20lZRl18hK38T0uBMGAVIBUlPZnhzf 9O/w== X-Gm-Message-State: APjAAAU8ZxPbPp187em1IwK/dvfuCtT1CXbxeLVypVGIkCJ1xBs5fsUR CroTKajKweN6V/Cqtqiy7dajl1xYnpl7K2DN19ZglA== X-Google-Smtp-Source: APXvYqwtfSgML5r+96XyxQmUbMWs8SaD8ClmypL/71muyxYCxpCLWEhl3mH/88bTwQgidUS8COY2/j46AYAkJCX/rw0= X-Received: by 2002:a0c:ee49:: with SMTP id m9mr4375898qvs.118.1573143793754; Thu, 07 Nov 2019 08:23:13 -0800 (PST) MIME-Version: 1.0 References: <201911071117.xA7BH390010873@repo.freebsd.org> <1AFEA810-CC13-444E-BF28-1C3D07CA0FC2@me.com> In-Reply-To: <1AFEA810-CC13-444E-BF28-1C3D07CA0FC2@me.com> From: Warner Losh Date: Thu, 7 Nov 2019 09:23:02 -0700 Message-ID: Subject: Re: svn commit: r354435 - head/stand/efi/libefi To: Toomas Soome Cc: Toomas Soome , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4787xH3Gxmz3Q8x X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=AMcVXWQE; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::f2d) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-1.78 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[3]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MIME_BASE64_TEXT(0.10)[]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_TO(0.00)[me.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-0.88)[ipnet: 2607:f8b0::/32(-2.35), asn: 15169(-2.01), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 16:23:16 -0000 On Thu, Nov 7, 2019 at 8:39 AM Toomas Soome wrote: > > > On 7. Nov 2019, at 17:29, Warner Losh wrote: > > > > On Thu, Nov 7, 2019 at 4:17 AM Toomas Soome wrote: > >> Author: tsoome >> Date: Thu Nov 7 11:17:03 2019 >> New Revision: 354435 >> URL: https://svnweb.freebsd.org/changeset/base/354435 >> >> Log: >> loader: implement fallback efi_devpath_to_name() >> >> UEFI 1.10 on macs does not seem to provide devpath to name translation= , >> provide our own (limited) version, so we can get information about >> commmon >> devices. >> > > We specifically deleted our own version of this function (it was wrong in > many ways too) because we thought we could require a minimum UEFI 2.0 for > full functionality... This sort of function is a total pain to maintain. > > I'd prefer the fallback was "you don't get this" rather than bloating the > code, especially for devices that we don't care about and will never care > about for booting... > > Warner > > > > I can see why, but then again, try to debug such system=E2=80=A6 btw, th= at > particular one I debug is MacBookPro11,4 with quad core i7=E2=80=A6. not= even that > old hw anyhow. > > I=E2=80=99d rather keep some bloat than spend 2-3 days to write code just= to get > any idea what is going on in the machine=E2=80=A6 > Yea, that's surprising... The initial reports we'd received were only from super-old macbooks. We'd also been told that newer versions were newer UEFI revisions, so not to worry... Guess there's some disconnect here. If there's modern gear that still use this old revision, that's quite useful to know... we've made other decisions that would exclude 1.2-level implementations as well... Warner > rgds, > toomas > > > > >> MFC after: 1 week >> >> Modified: >> head/stand/efi/libefi/devpath.c >> >> Modified: head/stand/efi/libefi/devpath.c >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/stand/efi/libefi/devpath.c Thu Nov 7 07:21:45 2019 >> (r354434) >> +++ head/stand/efi/libefi/devpath.c Thu Nov 7 11:17:03 2019 >> (r354435) >> @@ -29,13 +29,16 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> +#include >> +#include >> >> static EFI_GUID ImageDevicePathGUID =3D >> EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID; >> static EFI_GUID DevicePathGUID =3D DEVICE_PATH_PROTOCOL; >> static EFI_GUID DevicePathToTextGUID =3D >> EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID; >> static EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *toTextProtocol; >> -static EFI_GUID DevicePathFromTextGUID =3D >> EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID; >> +static EFI_GUID DevicePathFromTextGUID =3D >> + EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID; >> static EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *fromTextProtocol; >> >> EFI_DEVICE_PATH * >> @@ -64,6 +67,427 @@ efi_lookup_devpath(EFI_HANDLE handle) >> return (devpath); >> } >> >> +static char * >> +efi_make_tail(char *suffix) >> +{ >> + char *tail; >> + >> + tail =3D NULL; >> + if (suffix !=3D NULL) >> + (void)asprintf(&tail, "/%s", suffix); >> + else >> + tail =3D strdup(""); >> + return (tail); >> +} >> + >> +typedef struct { >> + EFI_DEVICE_PATH Header; >> + EFI_GUID Guid; >> + UINT8 VendorDefinedData[1]; >> +} __packed VENDOR_DEVICE_PATH_WITH_DATA; >> + >> +static char * >> +efi_vendor_path(const char *type, VENDOR_DEVICE_PATH *node, char *suffi= x) >> +{ >> + uint32_t size =3D DevicePathNodeLength(&node->Header) - >> sizeof(*node); >> + VENDOR_DEVICE_PATH_WITH_DATA *dp =3D (VENDOR_DEVICE_PATH_WITH_DA= TA >> *)node; >> + char *name, *tail, *head; >> + char *uuid; >> + int rv; >> + >> + uuid_to_string((const uuid_t *)(void *)&node->Guid, &uuid, &rv); >> + if (rv !=3D uuid_s_ok) >> + return (NULL); >> + >> + tail =3D efi_make_tail(suffix); >> + rv =3D asprintf(&head, "%sVendor(%s)[%x:", type, uuid, size); >> + free(uuid); >> + if (rv < 0) >> + return (NULL); >> + >> + if (DevicePathNodeLength(&node->Header) > sizeof(*node)) { >> + for (uint32_t i =3D 0; i < size; i++) { >> + rv =3D asprintf(&name, "%s%02x", head, >> + dp->VendorDefinedData[i]); >> + if (rv < 0) { >> + free(tail); >> + free(head); >> + return (NULL); >> + } >> + free(head); >> + head =3D name; >> + } >> + } >> + >> + if (asprintf(&name, "%s]%s", head, tail) < 0) >> + name =3D NULL; >> + free(head); >> + free(tail); >> + return (name); >> +} >> + >> +static char * >> +efi_hw_dev_path(EFI_DEVICE_PATH *node, char *suffix) >> +{ >> + uint8_t subtype =3D DevicePathSubType(node); >> + char *name, *tail; >> + >> + tail =3D efi_make_tail(suffix); >> + switch (subtype) { >> + case HW_PCI_DP: >> + if (asprintf(&name, "Pci(%x,%x)%s", >> + ((PCI_DEVICE_PATH *)node)->Function, >> + ((PCI_DEVICE_PATH *)node)->Device, tail) < 0) >> + name =3D NULL; >> + break; >> + case HW_PCCARD_DP: >> + if (asprintf(&name, "PCCARD(%x)%s", >> + ((PCCARD_DEVICE_PATH *)node)->FunctionNumber, tail) = < >> 0) >> + name =3D NULL; >> + break; >> + case HW_MEMMAP_DP: >> + if (asprintf(&name, "MMap(%x,%" PRIx64 ",%" PRIx64 ")%s"= , >> + ((MEMMAP_DEVICE_PATH *)node)->MemoryType, >> + ((MEMMAP_DEVICE_PATH *)node)->StartingAddress, >> + ((MEMMAP_DEVICE_PATH *)node)->EndingAddress, tail) < >> 0) >> + name =3D NULL; >> + break; >> + case HW_VENDOR_DP: >> + name =3D efi_vendor_path("Hardware", >> + (VENDOR_DEVICE_PATH *)node, tail); >> + break; >> + case HW_CONTROLLER_DP: >> + if (asprintf(&name, "Ctrl(%x)%s", >> + ((CONTROLLER_DEVICE_PATH *)node)->Controller, tail) = < >> 0) >> + name =3D NULL; >> + break; >> + default: >> + if (asprintf(&name, "UnknownHW(%x)%s", subtype, tail) < = 0) >> + name =3D NULL; >> + break; >> + } >> + free(tail); >> + return (name); >> +} >> + >> +static char * >> +efi_acpi_dev_path(EFI_DEVICE_PATH *node, char *suffix) >> +{ >> + uint8_t subtype =3D DevicePathSubType(node); >> + ACPI_HID_DEVICE_PATH *acpi =3D (ACPI_HID_DEVICE_PATH *)node; >> + char *name, *tail; >> + >> + tail =3D efi_make_tail(suffix); >> + switch (subtype) { >> + case ACPI_DP: >> + if ((acpi->HID & PNP_EISA_ID_MASK) =3D=3D PNP_EISA_ID_CO= NST) { >> + switch (EISA_ID_TO_NUM (acpi->HID)) { >> + case 0x0a03: >> + if (asprintf(&name, "PciRoot(%x)%s", >> + acpi->UID, tail) < 0) >> + name =3D NULL; >> + break; >> + case 0x0a08: >> + if (asprintf(&name, "PcieRoot(%x)%s", >> + acpi->UID, tail) < 0) >> + name =3D NULL; >> + break; >> + case 0x0604: >> + if (asprintf(&name, "Floppy(%x)%s", >> + acpi->UID, tail) < 0) >> + name =3D NULL; >> + break; >> + case 0x0301: >> + if (asprintf(&name, "Keyboard(%x)%s", >> + acpi->UID, tail) < 0) >> + name =3D NULL; >> + break; >> + case 0x0501: >> + if (asprintf(&name, "Serial(%x)%s", >> + acpi->UID, tail) < 0) >> + name =3D NULL; >> + break; >> + case 0x0401: >> + if (asprintf(&name, "ParallelPort(%x)%s"= , >> + acpi->UID, tail) < 0) >> + name =3D NULL; >> + break; >> + default: >> + if (asprintf(&name, "Acpi(PNP%04x,%x)%s"= , >> + EISA_ID_TO_NUM(acpi->HID), >> + acpi->UID, tail) < 0) >> + name =3D NULL; >> + break; >> + } >> + } else { >> + if (asprintf(&name, "Acpi(%08x,%x)%s", >> + acpi->HID, acpi->UID, tail) < 0) >> + name =3D NULL; >> + } >> + break; >> + case ACPI_EXTENDED_DP: >> + default: >> + if (asprintf(&name, "UnknownACPI(%x)%s", subtype, tail) = < >> 0) >> + name =3D NULL; >> + break; >> + } >> + free(tail); >> + return (name); >> +} >> + >> +static char * >> +efi_messaging_dev_path(EFI_DEVICE_PATH *node, char *suffix) >> +{ >> + uint8_t subtype =3D DevicePathSubType(node); >> + char *name; >> + char *tail; >> + >> + tail =3D efi_make_tail(suffix); >> + switch (subtype) { >> + case MSG_ATAPI_DP: >> + if (asprintf(&name, "ATA(%s,%s,%x)%s", >> + ((ATAPI_DEVICE_PATH *)node)->PrimarySecondary =3D=3D= 1 ? >> + "Secondary" : "Primary", >> + ((ATAPI_DEVICE_PATH *)node)->SlaveMaster =3D=3D 1 ? >> + "Slave" : "Master", >> + ((ATAPI_DEVICE_PATH *)node)->Lun, tail) < 0) >> + name =3D NULL; >> + break; >> + case MSG_SCSI_DP: >> + if (asprintf(&name, "SCSI(%x,%x)%s", >> + ((SCSI_DEVICE_PATH *)node)->Pun, >> + ((SCSI_DEVICE_PATH *)node)->Lun, tail) < 0) >> + name =3D NULL; >> + break; >> + case MSG_FIBRECHANNEL_DP: >> + if (asprintf(&name, "Fibre(%" PRIx64 ",%" PRIx64 ")%s", >> + ((FIBRECHANNEL_DEVICE_PATH *)node)->WWN, >> + ((FIBRECHANNEL_DEVICE_PATH *)node)->Lun, tail) < 0) >> + name =3D NULL; >> + break; >> + case MSG_1394_DP: >> + if (asprintf(&name, "I1394(%016" PRIx64 ")%s", >> + ((F1394_DEVICE_PATH *)node)->Guid, tail) < 0) >> + name =3D NULL; >> + break; >> + case MSG_USB_DP: >> + if (asprintf(&name, "USB(%x,%x)%s", >> + ((USB_DEVICE_PATH *)node)->ParentPortNumber, >> + ((USB_DEVICE_PATH *)node)->InterfaceNumber, tail) < = 0) >> + name =3D NULL; >> + break; >> + case MSG_USB_CLASS_DP: >> + if (asprintf(&name, "UsbClass(%x,%x,%x,%x,%x)%s", >> + ((USB_CLASS_DEVICE_PATH *)node)->VendorId, >> + ((USB_CLASS_DEVICE_PATH *)node)->ProductId, >> + ((USB_CLASS_DEVICE_PATH *)node)->DeviceClass, >> + ((USB_CLASS_DEVICE_PATH *)node)->DeviceSubClass, >> + ((USB_CLASS_DEVICE_PATH *)node)->DeviceProtocol, >> tail) < 0) >> + name =3D NULL; >> + break; >> + case MSG_MAC_ADDR_DP: >> + if (asprintf(&name, >> "MAC(%02x:%02x:%02x:%02x:%02x:%02x,%x)%s", >> + ((MAC_ADDR_DEVICE_PATH *)node)->MacAddress.Addr[0], >> + ((MAC_ADDR_DEVICE_PATH *)node)->MacAddress.Addr[1], >> + ((MAC_ADDR_DEVICE_PATH *)node)->MacAddress.Addr[2], >> + ((MAC_ADDR_DEVICE_PATH *)node)->MacAddress.Addr[3], >> + ((MAC_ADDR_DEVICE_PATH *)node)->MacAddress.Addr[4], >> + ((MAC_ADDR_DEVICE_PATH *)node)->MacAddress.Addr[5], >> + ((MAC_ADDR_DEVICE_PATH *)node)->IfType, tail) < 0) >> + name =3D NULL; >> + break; >> + case MSG_VENDOR_DP: >> + name =3D efi_vendor_path("Messaging", >> + (VENDOR_DEVICE_PATH *)node, tail); >> + break; >> + case MSG_UART_DP: >> + if (asprintf(&name, "UART(%" PRIu64 ",%u,%x,%x)%s", >> + ((UART_DEVICE_PATH *)node)->BaudRate, >> + ((UART_DEVICE_PATH *)node)->DataBits, >> + ((UART_DEVICE_PATH *)node)->Parity, >> + ((UART_DEVICE_PATH *)node)->StopBits, tail) < 0) >> + name =3D NULL; >> + break; >> + case MSG_SATA_DP: >> + if (asprintf(&name, "Sata(%x,%x,%x)%s", >> + ((SATA_DEVICE_PATH *)node)->HBAPortNumber, >> + ((SATA_DEVICE_PATH *)node)->PortMultiplierPortNumber= , >> + ((SATA_DEVICE_PATH *)node)->Lun, tail) < 0) >> + name =3D NULL; >> + break; >> + default: >> + if (asprintf(&name, "UnknownMessaging(%x)%s", >> + subtype, tail) < 0) >> + name =3D NULL; >> + break; >> + } >> + free(tail); >> + return (name); >> +} >> + >> +static char * >> +efi_media_dev_path(EFI_DEVICE_PATH *node, char *suffix) >> +{ >> + uint8_t subtype =3D DevicePathSubType(node); >> + HARDDRIVE_DEVICE_PATH *hd; >> + char *name; >> + char *str; >> + char *tail; >> + int rv; >> + >> + tail =3D efi_make_tail(suffix); >> + name =3D NULL; >> + switch (subtype) { >> + case MEDIA_HARDDRIVE_DP: >> + hd =3D (HARDDRIVE_DEVICE_PATH *)node; >> + switch (hd->SignatureType) { >> + case SIGNATURE_TYPE_MBR: >> + if (asprintf(&name, "HD(%d,MBR,%08x,%" PRIx64 >> + ",%" PRIx64 ")%s", >> + hd->PartitionNumber, >> + *((uint32_t *)(uintptr_t)&hd->Signature[0]), >> + hd->PartitionStart, >> + hd->PartitionSize, tail) < 0) >> + name =3D NULL; >> + break; >> + case SIGNATURE_TYPE_GUID: >> + name =3D NULL; >> + uuid_to_string((const uuid_t *)(void *) >> + &hd->Signature[0], &str, &rv); >> + if (rv !=3D uuid_s_ok) >> + break; >> + rv =3D asprintf(&name, "HD(%d,GPT,%s,%" PRIx64 "= ,%" >> + PRIx64 ")%s", >> + hd->PartitionNumber, str, >> + hd->PartitionStart, hd->PartitionSize, tail)= ; >> + free(str); >> + break; >> + default: >> + if (asprintf(&name, "HD(%d,%d,0)%s", >> + hd->PartitionNumber, >> + hd->SignatureType, tail) < 0) { >> + name =3D NULL; >> + } >> + break; >> + } >> + break; >> + case MEDIA_CDROM_DP: >> + if (asprintf(&name, "CD(%x,%" PRIx64 ",%" PRIx64 ")%s", >> + ((CDROM_DEVICE_PATH *)node)->BootEntry, >> + ((CDROM_DEVICE_PATH *)node)->PartitionStart, >> + ((CDROM_DEVICE_PATH *)node)->PartitionSize, tail) < >> 0) { >> + name =3D NULL; >> + } >> + break; >> + case MEDIA_VENDOR_DP: >> + name =3D efi_vendor_path("Media", >> + (VENDOR_DEVICE_PATH *)node, tail); >> + break; >> + case MEDIA_FILEPATH_DP: >> + name =3D NULL; >> + str =3D NULL; >> + if (ucs2_to_utf8(((FILEPATH_DEVICE_PATH *)node)->PathNam= e, >> + &str) =3D=3D 0) { >> + (void)asprintf(&name, "%s%s", str, tail); >> + free(str); >> + } >> + break; >> + case MEDIA_PROTOCOL_DP: >> + name =3D NULL; >> + uuid_to_string((const uuid_t *)(void *) >> + &((MEDIA_PROTOCOL_DEVICE_PATH *)node)->Protocol, >> + &str, &rv); >> + if (rv !=3D uuid_s_ok) >> + break; >> + rv =3D asprintf(&name, "Protocol(%s)%s", str, tail); >> + free(str); >> + break; >> + default: >> + if (asprintf(&name, "UnknownMedia(%x)%s", >> + subtype, tail) < 0) >> + name =3D NULL; >> + } >> + free(tail); >> + return (name); >> +} >> + >> +static char * >> +efi_translate_devpath(EFI_DEVICE_PATH *devpath) >> +{ >> + EFI_DEVICE_PATH *dp =3D NextDevicePathNode(devpath); >> + char *name, *ptr; >> + uint8_t type; >> + >> + if (!IsDevicePathEnd(devpath)) >> + name =3D efi_translate_devpath(dp); >> + else >> + return (NULL); >> + >> + ptr =3D NULL; >> + type =3D DevicePathType(devpath); >> + switch (type) { >> + case HARDWARE_DEVICE_PATH: >> + ptr =3D efi_hw_dev_path(devpath, name); >> + break; >> + case ACPI_DEVICE_PATH: >> + ptr =3D efi_acpi_dev_path(devpath, name); >> + break; >> + case MESSAGING_DEVICE_PATH: >> + ptr =3D efi_messaging_dev_path(devpath, name); >> + break; >> + case MEDIA_DEVICE_PATH: >> + ptr =3D efi_media_dev_path(devpath, name); >> + break; >> + case BBS_DEVICE_PATH: >> + default: >> + if (asprintf(&ptr, "UnknownPath(%x)%s", type, >> + name? name : "") < 0) >> + ptr =3D NULL; >> + break; >> + } >> + >> + if (ptr !=3D NULL) { >> + free(name); >> + name =3D ptr; >> + } >> + return (name); >> +} >> + >> +static CHAR16 * >> +efi_devpath_to_name(EFI_DEVICE_PATH *devpath) >> +{ >> + char *name =3D NULL; >> + CHAR16 *ptr =3D NULL; >> + size_t len; >> + int rv; >> + >> + name =3D efi_translate_devpath(devpath); >> + if (name =3D=3D NULL) >> + return (NULL); >> + >> + /* >> + * We need to return memory from AllocatePool, so it can be free= d >> + * with FreePool() in efi_free_devpath_name(). >> + */ >> + rv =3D utf8_to_ucs2(name, &ptr, &len); >> + free(name); >> + if (rv =3D=3D 0) { >> + CHAR16 *out =3D NULL; >> + EFI_STATUS status; >> + >> + status =3D BS->AllocatePool(EfiLoaderData, len, (void >> **)&out); >> + if (EFI_ERROR(status)) { >> + free(ptr); >> + return (out); >> + } >> + memcpy(out, ptr, len); >> + free(ptr); >> + ptr =3D out; >> + } >> + >> + return (ptr); >> +} >> + >> CHAR16 * >> efi_devpath_name(EFI_DEVICE_PATH *devpath) >> { >> @@ -78,7 +502,7 @@ efi_devpath_name(EFI_DEVICE_PATH *devpath) >> toTextProtocol =3D NULL; >> } >> if (toTextProtocol =3D=3D NULL) >> - return (NULL); >> + return (efi_devpath_to_name(devpath)); >> >> return (toTextProtocol->ConvertDevicePathToText(devpath, TRUE, >> TRUE)); >> } >> @@ -86,8 +510,8 @@ efi_devpath_name(EFI_DEVICE_PATH *devpath) >> void >> efi_free_devpath_name(CHAR16 *text) >> { >> - >> - BS->FreePool(text); >> + if (text !=3D NULL) >> + BS->FreePool(text); >> } >> >> EFI_DEVICE_PATH * >> > > From owner-svn-src-head@freebsd.org Thu Nov 7 17:00:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C29261B9CA6; Thu, 7 Nov 2019 17:00:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4788m44lNdz3x8F; Thu, 7 Nov 2019 17:00:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8746318D42; Thu, 7 Nov 2019 17:00:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7H0Kih017182; Thu, 7 Nov 2019 17:00:20 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7H0KS5017181; Thu, 7 Nov 2019 17:00:20 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911071700.xA7H0KS5017181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Nov 2019 17:00:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354448 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 354448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 17:00:20 -0000 Author: glebius Date: Thu Nov 7 17:00:20 2019 New Revision: 354448 URL: https://svnweb.freebsd.org/changeset/base/354448 Log: Widen network epoch coverage in nd6_prefix_onlink() as in6ifa_ifpforlinklocal() requires the epoch. Reported by: bz Reviewed by: bz Modified: head/sys/netinet6/nd6_rtr.c Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Thu Nov 7 15:51:44 2019 (r354447) +++ head/sys/netinet6/nd6_rtr.c Thu Nov 7 17:00:20 2019 (r354448) @@ -1974,6 +1974,7 @@ nd6_prefix_onlink_rtrequest(struct nd_prefix *pr, stru int nd6_prefix_onlink(struct nd_prefix *pr) { + struct epoch_tracker et; struct ifaddr *ifa; struct ifnet *ifp = pr->ndpr_ifp; struct nd_prefix *opr; @@ -2018,22 +2019,20 @@ nd6_prefix_onlink(struct nd_prefix *pr) * We prefer link-local addresses as the associated interface address. */ /* search for a link-local addr */ + NET_EPOCH_ENTER(et); ifa = (struct ifaddr *)in6ifa_ifpforlinklocal(ifp, IN6_IFF_NOTREADY | IN6_IFF_ANYCAST); if (ifa == NULL) { - struct epoch_tracker et; - /* XXX: freebsd does not have ifa_ifwithaf */ - NET_EPOCH_ENTER(et); CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family == AF_INET6) { ifa_ref(ifa); break; } } - NET_EPOCH_EXIT(et); /* should we care about ia6_flags? */ } + NET_EPOCH_EXIT(et); if (ifa == NULL) { /* * This can still happen, when, for example, we receive an RA From owner-svn-src-head@freebsd.org Thu Nov 7 17:10:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FD991BA0F3; Thu, 7 Nov 2019 17:10:36 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4788zw0YsHz3y1V; Thu, 7 Nov 2019 17:10:36 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EACA718F35; Thu, 7 Nov 2019 17:10:35 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7HAZXO023840; Thu, 7 Nov 2019 17:10:35 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7HAYrU023832; Thu, 7 Nov 2019 17:10:34 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201911071710.xA7HAYrU023832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 7 Nov 2019 17:10:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354449 - in head: . libexec libexec/rtld-elf libexec/rtld-elf32 share/mk usr.bin usr.bin/ldd32 X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . libexec libexec/rtld-elf libexec/rtld-elf32 share/mk usr.bin usr.bin/ldd32 X-SVN-Commit-Revision: 354449 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 17:10:36 -0000 Author: brooks Date: Thu Nov 7 17:10:33 2019 New Revision: 354449 URL: https://svnweb.freebsd.org/changeset/base/354449 Log: libcompat: build 32-bit rtld and ldd as part of "everything" Alter bsd.compat.mk to set MACHINE and MACHINE_ARCH when included directly so MD paths in Makefiles work. In the process centralize setting them in LIBCOMPATWMAKEENV. Alter .PATH and CFLAGS settings in work when the Makefile is included. While here only support LIB32 on supported platforms rather than always enabling it and requiring users of MK_LIB32 to filter based TARGET/MACHINE_ARCH. The net effect of this change is to make Makefile.libcompat only build compatability libraries. Reviewed by: imp, kib Obtained from: CheriBSD (conceptually) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22251 Added: head/libexec/rtld-elf32/ head/libexec/rtld-elf32/Makefile (contents, props changed) head/usr.bin/ldd32/ head/usr.bin/ldd32/Makefile (contents, props changed) Modified: head/Makefile.inc1 head/Makefile.libcompat head/libexec/Makefile head/libexec/rtld-elf/Makefile head/share/mk/bsd.compat.mk head/share/mk/src.opts.mk head/usr.bin/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Nov 7 17:00:20 2019 (r354448) +++ head/Makefile.inc1 Thu Nov 7 17:10:33 2019 (r354449) @@ -802,11 +802,10 @@ XCFLAGS+= --sysroot=${WORLDTMP} XCFLAGS+= ${BFLAGS} .endif -.if ${MK_LIB32} != "no" && (${TARGET_ARCH} == "amd64" || \ - ${TARGET_ARCH} == "powerpc64" || ${TARGET_ARCH:Mmips64*} != "") +.if ${MK_LIB32} == "yes" _LIBCOMPAT= 32 .include "Makefile.libcompat" -.elif ${MK_LIBSOFT} != "no" && ${TARGET_ARCH:Marmv[67]*} != "" +.elif ${MK_LIBSOFT} == "yes" _LIBCOMPAT= SOFT .include "Makefile.libcompat" .endif Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Thu Nov 7 17:00:20 2019 (r354448) +++ head/Makefile.libcompat Thu Nov 7 17:10:33 2019 (r354449) @@ -111,28 +111,10 @@ build${libcompat}: .PHONY .endfor ${_+_}cd ${.CURDIR}; \ ${LIBCOMPATWMAKE} -f Makefile.inc1 -DNO_FSCHG libraries -.if ${libcompat} == "32" -.for _t in ${_obj} all -.if !defined(NO_RTLD) - ${_+_}cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIBCOMPATWMAKE} \ - -DNO_FSCHG DIRPRFX=libexec/rtld-elf/ ${_t} -.endif - ${_+_}cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIBCOMPATWMAKE} \ - DIRPRFX=usr.bin/ldd ${_t} -.endfor -.endif distribute${libcompat} install${libcompat}: .PHONY .for _dir in ${_LC_LIBDIRS.yes} ${_+_}cd ${.CURDIR}/${_dir}; ${LIBCOMPATIMAKE} ${.TARGET:S/${libcompat}$//} .endfor -.if ${libcompat} == "32" -.if !defined(NO_RTLD) - ${_+_}cd ${.CURDIR}/libexec/rtld-elf; \ - PROG=ld-elf32.so.1 ${LIBCOMPATIMAKE} ${.TARGET:S/32$//} -.endif - ${_+_}cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIBCOMPATIMAKE} \ - ${.TARGET:S/32$//} -.endif -.endif +.endif # !targets(__<${_this:T}>__) Modified: head/libexec/Makefile ============================================================================== --- head/libexec/Makefile Thu Nov 7 17:00:20 2019 (r354448) +++ head/libexec/Makefile Thu Nov 7 17:10:33 2019 (r354449) @@ -74,6 +74,7 @@ _tftp-proxy= tftp-proxy .if !defined(NO_PIC) && !defined(NO_RTLD) _rtld-elf= rtld-elf +SUBDIR.${MK_LIB32}+= rtld-elf32 .endif .if ${MK_RBOOTD} != "no" Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Thu Nov 7 17:00:20 2019 (r354448) +++ head/libexec/rtld-elf/Makefile Thu Nov 7 17:10:33 2019 (r354449) @@ -4,6 +4,8 @@ # linker: # make DEBUG_FLAGS=-g WITHOUT_TESTS=yes all +RTLD_ELF_DIR:= ${.PARSEDIR} + .include PACKAGE= clibs MK_PIE= no # Always position independent using local rules @@ -25,16 +27,16 @@ SRCS= \ xmalloc.c \ debug.c \ libmap.c -MAN= rtld.1 +MAN?= rtld.1 CSTD?= gnu99 CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD -ffreestanding CFLAGS+= -I${SRCTOP}/lib/csu/common -.if exists(${.CURDIR}/${MACHINE_ARCH}) +.if exists(${RTLD_ELF_DIR}/${MACHINE_ARCH}) RTLD_ARCH= ${MACHINE_ARCH} .else RTLD_ARCH= ${MACHINE_CPUARCH} .endif -CFLAGS+= -I${.CURDIR}/${RTLD_ARCH} -I${.CURDIR} +CFLAGS+= -I${RTLD_ELF_DIR}/${RTLD_ARCH} -I${RTLD_ELF_DIR} .if ${MACHINE_ARCH} == "powerpc64" LDFLAGS+= -nostdlib -e _rtld_start .else @@ -81,16 +83,16 @@ LIBADD+= compiler_rt .if ${MK_SYMVER} == "yes" VERSION_DEF= ${LIBCSRCDIR}/Versions.def -SYMBOL_MAPS= ${.CURDIR}/Symbol.map +SYMBOL_MAPS= ${RTLD_ELF_DIR}/Symbol.map VERSION_MAP= Version.map LDFLAGS+= -Wl,--version-script=${VERSION_MAP} -.if exists(${.CURDIR}/${RTLD_ARCH}/Symbol.map) -SYMBOL_MAPS+= ${.CURDIR}/${RTLD_ARCH}/Symbol.map +.if exists(${RTLD_ELF_DIR}/${RTLD_ARCH}/Symbol.map) +SYMBOL_MAPS+= ${RTLD_ELF_DIR}/${RTLD_ARCH}/Symbol.map .endif .endif -.sinclude "${.CURDIR}/${RTLD_ARCH}/Makefile.inc" +.sinclude "${RTLD_ELF_DIR}/${RTLD_ARCH}/Makefile.inc" # Since moving rtld-elf to /libexec, we need to create a symlink. # Fixup the existing binary that's there so we can symlink over it. @@ -99,10 +101,12 @@ beforeinstall: -chflags -h noschg ${DESTDIR}/usr/libexec/${PROG} .endif -.PATH: ${.CURDIR}/${RTLD_ARCH} +.PATH: ${RTLD_ELF_DIR}/${RTLD_ARCH} +.if ${.CURDIR} == ${RTLD_ELF_DIR} HAS_TESTS= SUBDIR.${MK_TESTS}+= tests +.endif .include ${PROG_FULL}: ${VERSION_MAP} Added: head/libexec/rtld-elf32/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/rtld-elf32/Makefile Thu Nov 7 17:10:33 2019 (r354449) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +NEED_COMPAT= 32 +.include + +PROG= ld-elf32.so.1 +MAN= + +.PATH: ${SRCTOP}/libexec/rtld-elf +.include "${SRCTOP}/libexec/rtld-elf/Makefile" Modified: head/share/mk/bsd.compat.mk ============================================================================== --- head/share/mk/bsd.compat.mk Thu Nov 7 17:00:20 2019 (r354448) +++ head/share/mk/bsd.compat.mk Thu Nov 7 17:10:33 2019 (r354449) @@ -26,8 +26,9 @@ LIB32CPUFLAGS= -march=${COMPAT_CPUTYPE} LIB32CPUFLAGS+= -target x86_64-unknown-freebsd13.0 .endif LIB32CPUFLAGS+= -m32 -LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \ - MACHINE_CPU="i686 mmx sse sse2" +LIB32_MACHINE= i386 +LIB32_MACHINE_ARCH= i386 +LIB32WMAKEENV= MACHINE_CPU="i686 mmx sse sse2" LIB32WMAKEFLAGS= \ AS="${XAS} --32" \ LD="${XLD} -m elf_i386_fbsd -L${LIBCOMPATTMP}/usr/lib32" @@ -40,7 +41,8 @@ LIB32CPUFLAGS= -mcpu=powerpc LIB32CPUFLAGS= -mcpu=${COMPAT_CPUTYPE} .endif LIB32CPUFLAGS+= -m32 -LIB32WMAKEENV= MACHINE=powerpc MACHINE_ARCH=powerpc +LIB32_MACHINE= powerpc +LIB32_MACHINE_ARCH= powerpc LIB32WMAKEFLAGS= \ LD="${XLD} -m elf32ppc_fbsd" @@ -61,7 +63,8 @@ LIB32CPUFLAGS= -target mips-unknown-freebsd13.0 .endif .endif LIB32CPUFLAGS+= -mabi=32 -LIB32WMAKEENV= MACHINE=mips MACHINE_ARCH=mips +LIB32_MACHINE= mips +LIB32_MACHINE_ARCH= mips .if ${COMPAT_ARCH:Mmips64el*} != "" LIB32WMAKEFLAGS= LD="${XLD} -m elf32ltsmip_fbsd" .else @@ -82,7 +85,9 @@ LIB32WMAKEFLAGS+= -DCOMPAT_32BIT HAS_COMPAT=SOFT LIBSOFTCFLAGS= -DCOMPAT_SOFTFP LIBSOFTCPUFLAGS= -mfloat-abi=softfp -LIBSOFTWMAKEENV= CPUTYPE=soft MACHINE=arm MACHINE_ARCH=${COMPAT_ARCH} +LIBSOFT_MACHINE= arm +LIBSOFT_MACHINE_ARCH= ${COMPAT_ARCH} +LIBSOFTWMAKEENV= CPUTYPE=soft LIBSOFTWMAKEFLAGS= -DCOMPAT_SOFTFP .endif @@ -114,8 +119,8 @@ _LIBCOMPAT:= ${WANT_COMPAT} # Generic code for each type. # Set defaults based on type. libcompat= ${_LIBCOMPAT:tl} -_LIBCOMPAT_MAKEVARS= _OBJTOP TMP CPUFLAGS CFLAGS CXXFLAGS WMAKEENV \ - WMAKEFLAGS WMAKE +_LIBCOMPAT_MAKEVARS= _OBJTOP TMP CPUFLAGS CFLAGS CXXFLAGS \ + _MACHINE _MACHINE_ARCH WMAKEENV WMAKEFLAGS WMAKE .for _var in ${_LIBCOMPAT_MAKEVARS} .if !empty(LIB${_LIBCOMPAT}${_var}) LIBCOMPAT${_var}?= ${LIB${_LIBCOMPAT}${_var}} @@ -131,6 +136,9 @@ LIBCOMPATCFLAGS+= ${LIBCOMPATCPUFLAGS} \ --sysroot=${LIBCOMPATTMP} \ ${BFLAGS} +LIBCOMPATWMAKEENV+= MACHINE=${LIBCOMPAT_MACHINE} +LIBCOMPATWMAKEENV+= MACHINE_ARCH=${LIBCOMPAT_MACHINE_ARCH} + # -B is needed to find /usr/lib32/crti.o for GCC and /usr/libsoft/crti.o for # Clang/GCC. LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/lib${libcompat} @@ -139,6 +147,8 @@ LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/lib${libcompat LIBDIR_BASE:= /usr/lib${libcompat} _LIB_OBJTOP= ${LIBCOMPAT_OBJTOP} CFLAGS+= ${LIBCOMPATCFLAGS} +MACHINE= ${LIBCOMPAT_MACHINE} +MACHINE_ARCH= ${LIBCOMPAT_MACHINE_ARCH} .endif .endif Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Nov 7 17:00:20 2019 (r354448) +++ head/share/mk/src.opts.mk Thu Nov 7 17:10:33 2019 (r354449) @@ -126,7 +126,6 @@ __DEFAULT_YES_OPTIONS = \ LDNS \ LDNS_UTILS \ LEGACY_CONSOLE \ - LIB32 \ LIBPTHREAD \ LIBTHR \ LLVM_COV \ @@ -357,6 +356,13 @@ BROKEN_OPTIONS+=LLDB __DEFAULT_NO_OPTIONS+=GDB_LIBEXEC .else __DEFAULT_YES_OPTIONS+=GDB_LIBEXEC +.endif +# LIB32 is supported on amd64, mips64, and powerpc64 +.if (${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH:Mmips64*} || \ + ${MACHINE_ARCH} == "powerpc64") +__DEFAULT_YES_OPTIONS+=LIB32 +.else +BROKEN_OPTIONS+=LIB32 .endif # Only doing soft float API stuff on armv6 and armv7 .if ${__T} != "armv6" && ${__T} != "armv7" Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Thu Nov 7 17:00:20 2019 (r354448) +++ head/usr.bin/Makefile Thu Nov 7 17:10:33 2019 (r354449) @@ -226,6 +226,7 @@ SUBDIR.${MK_KDUMP}+= truss SUBDIR.${MK_KERBEROS_SUPPORT}+= compile_et SUBDIR.${MK_LDNS_UTILS}+= drill SUBDIR.${MK_LDNS_UTILS}+= host +SUBDIR.${MK_LIB32}+= ldd32 SUBDIR.${MK_LOCATE}+= locate # XXX msgs? SUBDIR.${MK_MAIL}+= biff Added: head/usr.bin/ldd32/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/ldd32/Makefile Thu Nov 7 17:10:33 2019 (r354449) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +NEED_COMPAT= 32 +.include + +PROG= ldd32 +MAN= + +.PATH: ${SRCTOP}/usr.bin/ldd +.include "${SRCTOP}/usr.bin/ldd/Makefile" From owner-svn-src-head@freebsd.org Thu Nov 7 17:15:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B69F1BA2B3; Thu, 7 Nov 2019 17:15:00 +0000 (UTC) (envelope-from jrm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47894z6zr5z3yQb; Thu, 7 Nov 2019 17:14:59 +0000 (UTC) (envelope-from jrm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3D1119100; Thu, 7 Nov 2019 17:14:59 +0000 (UTC) (envelope-from jrm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7HExFJ029377; Thu, 7 Nov 2019 17:14:59 GMT (envelope-from jrm@FreeBSD.org) Received: (from jrm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7HExbm029375; Thu, 7 Nov 2019 17:14:59 GMT (envelope-from jrm@FreeBSD.org) Message-Id: <201911071714.xA7HExbm029375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrm set sender to jrm@FreeBSD.org using -f From: Joseph Mingrone Date: Thu, 7 Nov 2019 17:14:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354450 - head/usr.bin/env X-SVN-Group: head X-SVN-Commit-Author: jrm X-SVN-Commit-Paths: head/usr.bin/env X-SVN-Commit-Revision: 354450 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 17:15:00 -0000 Author: jrm (ports committer) Date: Thu Nov 7 17:14:59 2019 New Revision: 354450 URL: https://svnweb.freebsd.org/changeset/base/354450 Log: Add -0 option to ENV(1) With the -0 option added to ENV(1), some ports will no longer require genv from sysutils/coreutils. Reviewed by: kevans (prior version), swills Approved by: bcr (manpages), imp Differential Revision: https://reviews.freebsd.org/D22230 Modified: head/usr.bin/env/env.1 head/usr.bin/env/env.c Modified: head/usr.bin/env/env.1 ============================================================================== --- head/usr.bin/env/env.1 Thu Nov 7 17:10:33 2019 (r354449) +++ head/usr.bin/env/env.1 Thu Nov 7 17:14:59 2019 (r354450) @@ -31,7 +31,7 @@ .\" From FreeBSD: src/usr.bin/printenv/printenv.1,v 1.17 2002/11/26 17:33:35 ru Exp .\" $FreeBSD$ .\" -.Dd April 17, 2008 +.Dd November 7, 2019 .Dt ENV 1 .Os .Sh NAME @@ -39,7 +39,7 @@ .Nd set environment and execute command, or print environment .Sh SYNOPSIS .Nm -.Op Fl iv +.Op Fl 0iv .Op Fl P Ar altpath .Op Fl S Ar string .Op Fl u Ar name @@ -64,6 +64,8 @@ is executed. .Pp The options are as follows: .Bl -tag -width indent +.It Fl 0 +End each output line with NUL, not newline. .It Fl i Execute the .Ar utility @@ -130,8 +132,15 @@ If no .Ar utility is specified, .Nm -prints out the names and values -of the variables in the environment, with one name/value pair per line. +prints out the names and values of the variables in the environment. +Each name/value pair is separated by a new line unless +.Fl 0 +is specified, in which case name/value pairs are separated by NUL. +Both +.Fl 0 +and +.Ar utility +may not be specified together. .\" .Ss Details of Fl S \&Ss (split-string) processing The processing of the Modified: head/usr.bin/env/env.c ============================================================================== --- head/usr.bin/env/env.c Thu Nov 7 17:10:33 2019 (r354449) +++ head/usr.bin/env/env.c Thu Nov 7 17:14:59 2019 (r354450) @@ -59,22 +59,33 @@ int env_verbosity; static void usage(void); +/* + * Exit codes. + */ +#define EXIT_CANCELED 125 /* Internal error prior to exec attempt. */ +#define EXIT_CANNOT_INVOKE 126 /* Program located, but not usable. */ +#define EXIT_ENOENT 127 /* Could not find program to exec. */ + int main(int argc, char **argv) { - char *altpath, **ep, *p, **parg; + char *altpath, **ep, *p, **parg, term; char *cleanenv[1]; int ch, want_clear; int rtrn; altpath = NULL; want_clear = 0; - while ((ch = getopt(argc, argv, "-iP:S:u:v")) != -1) + term = '\n'; + while ((ch = getopt(argc, argv, "-0iP:S:u:v")) != -1) switch(ch) { case '-': case 'i': want_clear = 1; break; + case '0': + term = '\0'; + break; case 'P': altpath = strdup(optarg); break; @@ -118,6 +129,8 @@ main(int argc, char **argv) err(EXIT_FAILURE, "setenv %s", *argv); } if (*argv) { + if (term == '\0') + errx(EXIT_CANCELED, "cannot specify command with -0"); if (altpath) search_paths(altpath, argv); if (env_verbosity) { @@ -129,10 +142,11 @@ main(int argc, char **argv) sleep(1); } execvp(*argv, argv); - err(errno == ENOENT ? 127 : 126, "%s", *argv); + err(errno == ENOENT ? EXIT_ENOENT : EXIT_CANNOT_INVOKE, + "%s", *argv); } for (ep = environ; *ep; ep++) - (void)printf("%s\n", *ep); + (void)printf("%s%c", *ep, term); exit(0); } @@ -140,7 +154,7 @@ static void usage(void) { (void)fprintf(stderr, - "usage: env [-iv] [-P utilpath] [-S string] [-u name]\n" + "usage: env [-0iv] [-P utilpath] [-S string] [-u name]\n" " [name=value ...] [utility [argument ...]]\n"); exit(1); } From owner-svn-src-head@freebsd.org Thu Nov 7 17:21:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD1201BA5F2; Thu, 7 Nov 2019 17:21:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4789DG3g20z402c; Thu, 7 Nov 2019 17:21:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 622F619192; Thu, 7 Nov 2019 17:21:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7HLIk2035140; Thu, 7 Nov 2019 17:21:18 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7HLIjQ035139; Thu, 7 Nov 2019 17:21:18 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201911071721.xA7HLIjQ035139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 7 Nov 2019 17:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354451 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 354451 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 17:21:18 -0000 Author: andrew Date: Thu Nov 7 17:21:17 2019 New Revision: 354451 URL: https://svnweb.freebsd.org/changeset/base/354451 Log: Add the missing volatile qualifier in atomic_store_ptr MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/sys/sys/atomic_common.h Modified: head/sys/sys/atomic_common.h ============================================================================== --- head/sys/sys/atomic_common.h Thu Nov 7 17:14:59 2019 (r354450) +++ head/sys/sys/atomic_common.h Thu Nov 7 17:21:17 2019 (r354451) @@ -58,7 +58,7 @@ #define atomic_store_long(p, v) \ (*(volatile u_long *)(p) = (u_long)(v)) #define atomic_store_ptr(p, v) \ - (*(uintptr_t *)(p) = (uintptr_t)(v)) + (*(volatile uintptr_t *)(p) = (uintptr_t)(v)) #define atomic_store_8(p, v) \ (*(volatile uint8_t *)(p) = (uint8_t)(v)) #define atomic_store_16(p, v) \ From owner-svn-src-head@freebsd.org Thu Nov 7 17:34:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5FC4F1BAC7B; Thu, 7 Nov 2019 17:34:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4789Wn1rwDz416q; Thu, 7 Nov 2019 17:34:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23901194DB; Thu, 7 Nov 2019 17:34:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7HYj41044247; Thu, 7 Nov 2019 17:34:45 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7HYjvM044246; Thu, 7 Nov 2019 17:34:45 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201911071734.xA7HYjvM044246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 7 Nov 2019 17:34:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354452 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 354452 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 17:34:45 -0000 Author: andrew Date: Thu Nov 7 17:34:44 2019 New Revision: 354452 URL: https://svnweb.freebsd.org/changeset/base/354452 Log: Add more 8 and 16 bit variants of the the atomic(9) functions on arm64. These are direct copies of the 32 bit functions, adjusted ad needed. While here fix atomic_fcmpset_16 to use the valid load and store exclusive instructions. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/include/atomic.h Modified: head/sys/arm64/include/atomic.h ============================================================================== --- head/sys/arm64/include/atomic.h Thu Nov 7 17:21:17 2019 (r354451) +++ head/sys/arm64/include/atomic.h Thu Nov 7 17:34:44 2019 (r354452) @@ -57,6 +57,40 @@ #define ATOMIC_OP(op, asm_op, bar, a, l) \ static __inline void \ +atomic_##op##_##bar##8(volatile uint8_t *p, uint8_t val) \ +{ \ + uint8_t tmp; \ + int res; \ + \ + __asm __volatile( \ + "1: ld"#a"xrb %w0, [%2] \n" \ + " "#asm_op" %w0, %w0, %w3 \n" \ + " st"#l"xrb %w1, %w0, [%2] \n" \ + " cbnz %w1, 1b \n" \ + : "=&r"(tmp), "=&r"(res) \ + : "r" (p), "r" (val) \ + : "memory" \ + ); \ +} \ + \ +static __inline void \ +atomic_##op##_##bar##16(volatile uint16_t *p, uint16_t val) \ +{ \ + uint16_t tmp; \ + int res; \ + \ + __asm __volatile( \ + "1: ld"#a"xrh %w0, [%2] \n" \ + " "#asm_op" %w0, %w0, %w3 \n" \ + " st"#l"xrh %w1, %w0, [%2] \n" \ + " cbnz %w1, 1b \n" \ + : "=&r"(tmp), "=&r"(res) \ + : "r" (p), "r" (val) \ + : "memory" \ + ); \ +} \ + \ +static __inline void \ atomic_##op##_##bar##32(volatile uint32_t *p, uint32_t val) \ { \ uint32_t tmp; \ @@ -135,10 +169,10 @@ atomic_fcmpset_##bar##16(volatile uint16_t *p, uint16_ \ __asm __volatile( \ "1: mov %w1, #1 \n" \ - " ld"#a"xh %w0, [%2] \n" \ + " ld"#a"xrh %w0, [%2] \n" \ " cmp %w0, %w3 \n" \ " b.ne 2f \n" \ - " st"#l"xh %w1, %w4, [%2] \n" \ + " st"#l"xrh %w1, %w4, [%2] \n" \ "2:" \ : "=&r"(tmp), "=&r"(res) \ : "r" (p), "r" (_cmpval), "r" (newval) \ @@ -204,6 +238,52 @@ ATOMIC_FCMPSET(rel_, ,l) #undef ATOMIC_FCMPSET #define ATOMIC_CMPSET(bar, a, l) \ +static __inline int \ +atomic_cmpset_##bar##8(volatile uint8_t *p, uint8_t cmpval, \ + uint8_t newval) \ +{ \ + uint8_t tmp; \ + int res; \ + \ + __asm __volatile( \ + "1: mov %w1, #1 \n" \ + " ld"#a"xrb %w0, [%2] \n" \ + " cmp %w0, %w3 \n" \ + " b.ne 2f \n" \ + " st"#l"xrb %w1, %w4, [%2] \n" \ + " cbnz %w1, 1b \n" \ + "2:" \ + : "=&r"(tmp), "=&r"(res) \ + : "r" (p), "r" (cmpval), "r" (newval) \ + : "cc", "memory" \ + ); \ + \ + return (!res); \ +} \ + \ +static __inline int \ +atomic_cmpset_##bar##16(volatile uint16_t *p, uint16_t cmpval, \ + uint16_t newval) \ +{ \ + uint16_t tmp; \ + int res; \ + \ + __asm __volatile( \ + "1: mov %w1, #1 \n" \ + " ld"#a"xrh %w0, [%2] \n" \ + " cmp %w0, %w3 \n" \ + " b.ne 2f \n" \ + " st"#l"xrh %w1, %w4, [%2] \n" \ + " cbnz %w1, 1b \n" \ + "2:" \ + : "=&r"(tmp), "=&r"(res) \ + : "r" (p), "r" (cmpval), "r" (newval) \ + : "cc", "memory" \ + ); \ + \ + return (!res); \ +} \ + \ static __inline int \ atomic_cmpset_##bar##32(volatile uint32_t *p, uint32_t cmpval, \ uint32_t newval) \ From owner-svn-src-head@freebsd.org Thu Nov 7 18:06:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 912A41BB70C; Thu, 7 Nov 2019 18:06:46 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478BDk3NhCz43JH; Thu, 7 Nov 2019 18:06:46 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58CB419A77; Thu, 7 Nov 2019 18:06:46 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7I6kj8062049; Thu, 7 Nov 2019 18:06:46 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7I6jxE062043; Thu, 7 Nov 2019 18:06:45 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201911071806.xA7I6jxE062043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Thu, 7 Nov 2019 18:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354455 - in head: contrib/libxo contrib/libxo/libxo contrib/libxo/tests/core lib/libxo lib/libxo/encoder/csv usr.bin/xohtml X-SVN-Group: head X-SVN-Commit-Author: phil X-SVN-Commit-Paths: in head: contrib/libxo contrib/libxo/libxo contrib/libxo/tests/core lib/libxo lib/libxo/encoder/csv usr.bin/xohtml X-SVN-Commit-Revision: 354455 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 18:06:46 -0000 Author: phil Date: Thu Nov 7 18:06:44 2019 New Revision: 354455 URL: https://svnweb.freebsd.org/changeset/base/354455 Log: Import libxo-1.3.1: - handle argv[0] without '/' - add test case for argv[0] without '/' Modified: head/contrib/libxo/configure.ac head/contrib/libxo/libxo/libxo.c head/contrib/libxo/tests/core/test_01.c head/lib/libxo/add.man head/lib/libxo/encoder/csv/Makefile head/lib/libxo/xo_config.h head/usr.bin/xohtml/xohtml.sh Directory Properties: head/contrib/libxo/ (props changed) Modified: head/contrib/libxo/configure.ac ============================================================================== --- head/contrib/libxo/configure.ac Thu Nov 7 18:05:38 2019 (r354454) +++ head/contrib/libxo/configure.ac Thu Nov 7 18:06:44 2019 (r354455) @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [1.3.0], [phil@juniper.net]) +AC_INIT([libxo], [1.3.1], [phil@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) # Support silent build rules. Requires at least automake-1.11. Modified: head/contrib/libxo/libxo/libxo.c ============================================================================== --- head/contrib/libxo/libxo/libxo.c Thu Nov 7 18:05:38 2019 (r354454) +++ head/contrib/libxo/libxo/libxo.c Thu Nov 7 18:06:44 2019 (r354455) @@ -8104,12 +8104,14 @@ xo_parse_args (int argc, char **argv) cp = strrchr(xo_program, '/'); if (cp) xo_program = ++cp; + else + cp = argv[0]; /* Reset to front of string */ /* GNU tools add an annoying ".test" as the program extension; remove it */ size_t len = strlen(xo_program); static const char gnu_ext[] = ".test"; if (len >= sizeof(gnu_ext)) { - cp = &cp[len + 1 - sizeof(gnu_ext)]; + cp += len + 1 - sizeof(gnu_ext); if (xo_streq(cp, gnu_ext)) *cp = '\0'; } Modified: head/contrib/libxo/tests/core/test_01.c ============================================================================== --- head/contrib/libxo/tests/core/test_01.c Thu Nov 7 18:05:38 2019 (r354454) +++ head/contrib/libxo/tests/core/test_01.c Thu Nov 7 18:06:44 2019 (r354455) @@ -50,6 +50,9 @@ main (int argc, char **argv) { "sold", "number", "Number of items sold" }, { XO_INFO_NULL }, }; + + char name[] = "test_01.test"; /* test trimming of xo_program */ + argv[0] = name; argc = xo_parse_args(argc, argv); if (argc < 0) Modified: head/lib/libxo/add.man ============================================================================== --- head/lib/libxo/add.man Thu Nov 7 18:05:38 2019 (r354454) +++ head/lib/libxo/add.man Thu Nov 7 18:06:44 2019 (r354455) @@ -3,10 +3,10 @@ .Fx uses .Nm libxo -version 1.3.0. +version 1.3.1. Complete documentation can be found on github: .Bd -literal -offset indent -https://juniper.github.io/libxo/1.3.0/html/index.html +https://juniper.github.io/libxo/1.3.1/html/index.html .Ed .Pp .Nm libxo Modified: head/lib/libxo/encoder/csv/Makefile ============================================================================== --- head/lib/libxo/encoder/csv/Makefile Thu Nov 7 18:05:38 2019 (r354454) +++ head/lib/libxo/encoder/csv/Makefile Thu Nov 7 18:06:44 2019 (r354455) @@ -2,7 +2,7 @@ LIBXODIR= ${STAGEDIR}${PREFIX}/usr/lib/libxo/encoder SHLIBDIR?= ${LIBXODIR} -LIBDIR?= ${LIBXODIR} +LIBDIR?= ${LIBXODIR} .include @@ -21,6 +21,7 @@ CFLAGS+=-I${LIBXOSRC}/libxo -I${.CURDIR} CFLAGS+=-DXO_ENCODERDIR=\"/usr/lib/libxo/encoder\" LIBADD= util xo +LDFLAGS += -L${.OBJDIR}/../../wildebeast WARNS?= 5 Modified: head/lib/libxo/xo_config.h ============================================================================== --- head/lib/libxo/xo_config.h Thu Nov 7 18:05:38 2019 (r354454) +++ head/lib/libxo/xo_config.h Thu Nov 7 18:06:44 2019 (r354455) @@ -183,16 +183,16 @@ /* #undef LIBXO_TEXT_ONLY */ /* Version number as dotted value */ -#define LIBXO_VERSION "1.3.0" +#define LIBXO_VERSION "1.3.1" /* Version number extra information */ #define LIBXO_VERSION_EXTRA "" /* Version number as a number */ -#define LIBXO_VERSION_NUMBER 1003000 +#define LIBXO_VERSION_NUMBER 1003001 /* Version number as string */ -#define LIBXO_VERSION_STRING "1003000" +#define LIBXO_VERSION_STRING "1003001" /* Enable local wcwidth implementation */ #define LIBXO_WCWIDTH 1 @@ -210,7 +210,7 @@ #define PACKAGE_NAME "libxo" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libxo 1.3.0" +#define PACKAGE_STRING "libxo 1.3.1" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libxo" @@ -219,7 +219,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.3.0" +#define PACKAGE_VERSION "1.3.1" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -236,7 +236,7 @@ /* #undef USE_INT_RETURN_CODES */ /* Version number of package */ -#define VERSION "1.3.0" +#define VERSION "1.3.1" /* Retain hash bucket size */ /* #undef XO_RETAIN_SIZE */ Modified: head/usr.bin/xohtml/xohtml.sh ============================================================================== --- head/usr.bin/xohtml/xohtml.sh Thu Nov 7 18:05:38 2019 (r354454) +++ head/usr.bin/xohtml/xohtml.sh Thu Nov 7 18:06:44 2019 (r354455) @@ -12,7 +12,7 @@ # BASE=/usr/share/libxo -VERSION=1.3.0 +VERSION=1.3.1 CMD=cat DONE= WEB=http://juniper.github.io/libxo/${VERSION}/xohtml From owner-svn-src-head@freebsd.org Thu Nov 7 18:15:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E94A1BBEED; Thu, 7 Nov 2019 18:15:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478BQj1ZjPz44gp; Thu, 7 Nov 2019 18:15:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19D5019C8C; Thu, 7 Nov 2019 18:15:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7IFO3Y070067; Thu, 7 Nov 2019 18:15:24 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7IFOhI070066; Thu, 7 Nov 2019 18:15:24 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201911071815.xA7IFOhI070066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 7 Nov 2019 18:15:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354458 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 354458 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 18:15:25 -0000 Author: trasz Date: Thu Nov 7 18:15:24 2019 New Revision: 354458 URL: https://svnweb.freebsd.org/changeset/base/354458 Log: Extend the linux rc script to mount the neccessary file systems, set ELF fallback brand, and load pty(4). Reviewed by: emaste (earlier version) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21874 Modified: head/libexec/rc/rc.d/linux Modified: head/libexec/rc/rc.d/linux ============================================================================== --- head/libexec/rc/rc.d/linux Thu Nov 7 18:14:58 2019 (r354457) +++ head/libexec/rc/rc.d/linux Thu Nov 7 18:15:24 2019 (r354458) @@ -17,7 +17,7 @@ stop_cmd=":" linux_start() { - local _tmpdir + local _emul_path _tmpdir load_kld -e 'linux(aout|elf)' linux case `sysctl -n hw.machine_arch` in @@ -33,6 +33,25 @@ linux_start() fi rm -rf ${_tmpdir} fi + + # Linux uses the pre-pts(4) tty naming scheme. + load_kld pty + + # Handle unbranded ELF executables by defaulting to ELFOSABI_LINUX. + if [ `sysctl -ni kern.elf64.fallback_brand` -eq "-1" ]; then + sysctl kern.elf64.fallback_brand=3 > /dev/null + fi + + if [ `sysctl -ni kern.elf32.fallback_brand` -eq "-1" ]; then + sysctl kern.elf32.fallback_brand=3 > /dev/null + fi + + _emul_path="/compat/linux" + mount -o nocover -t linprocfs linprocfs "${_emul_path}/proc" + mount -o nocover -t linsysfs linsysfs "${_emul_path}/sys" + mount -o nocover -t devfs devfs "${_emul_path}/dev" + mount -o nocover -t fdescfs fdescfs "${_emul_path}/dev/fd" + mount -o nocover,mode=1777 -t tmpfs tmpfs "${_emul_path}/dev/shm" } load_rc_config $name From owner-svn-src-head@freebsd.org Thu Nov 7 18:16:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7941C1BC0B9; Thu, 7 Nov 2019 18:16:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478BSH2bWMz4514; Thu, 7 Nov 2019 18:16:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DB6119C9C; Thu, 7 Nov 2019 18:16:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7IGldU070186; Thu, 7 Nov 2019 18:16:47 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7IGlun070185; Thu, 7 Nov 2019 18:16:47 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201911071816.xA7IGlun070185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 7 Nov 2019 18:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354459 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 354459 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 18:16:47 -0000 Author: trasz Date: Thu Nov 7 18:16:46 2019 New Revision: 354459 URL: https://svnweb.freebsd.org/changeset/base/354459 Log: The cdceem(4) driver debuted in 12.1. MFC after: 2 weeks Modified: head/share/man/man4/cdceem.4 Modified: head/share/man/man4/cdceem.4 ============================================================================== --- head/share/man/man4/cdceem.4 Thu Nov 7 18:15:24 2019 (r354458) +++ head/share/man/man4/cdceem.4 Thu Nov 7 18:16:46 2019 (r354459) @@ -22,7 +22,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd August 7, 2019 +.Dd November 7, 2019 .Dt CDCEEM 4 .Os .Sh NAME @@ -110,7 +110,7 @@ Defaults to 0. The .Nm device driver first appeared in -.Fx 13.0 . +.Fx 12.1 . .Sh AUTHORS The .Nm From owner-svn-src-head@freebsd.org Thu Nov 7 18:26:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 271841BC608; Thu, 7 Nov 2019 18:26:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478Bfy0KRJz45s2; Thu, 7 Nov 2019 18:26:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E341319EE6; Thu, 7 Nov 2019 18:26:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7IQ11V076707; Thu, 7 Nov 2019 18:26:01 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7IQ1JY076704; Thu, 7 Nov 2019 18:26:01 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201911071826.xA7IQ1JY076704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 7 Nov 2019 18:26:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354460 - in head: contrib/libc++/include sys/sys X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/libc++/include sys/sys X-SVN-Commit-Revision: 354460 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 18:26:02 -0000 Author: dim Date: Thu Nov 7 18:26:01 2019 New Revision: 354460 URL: https://svnweb.freebsd.org/changeset/base/354460 Log: Merge commit e8316372b from llvm git (by Louis Dionne): [libc++] Add `__truncating_cast` for safely casting float types to integers This is needed anytime we need to clamp an arbitrary floating point value to an integer type. Thanks to Eric Fiselier for the patch. Differential Revision: https://reviews.llvm.org/D66836 llvm-svn: 370891 Merge commit b92deded8 from llvm git (by Louis Dionne): [libc++] Move __clamp_to_integral to , and harden against min()/max() macros llvm-svn: 370900 Merge commit 0ec6a4882 from llvm git (by Louis Dionne): [libc++] Fix potential OOB in poisson_distribution See details in the original Chromium bug report: https://bugs.chromium.org/p/chromium/issues/detail?id=994957 Together, these fix a security issue in libc++'s implementation of std::poisson_distribution, which can be exploited to read data which is out of bounds. Note there are no programs in the FreeBSD base system that use std::poisson_distribution, so this is only a possible issue for ports and external programs which have been built against libc++. Therefore, I am bumping __FreeBSD_version for the benefit of our port maintainers. Requested by: emaste Security: potential OOB read MFC after: 3 days Modified: head/contrib/libc++/include/cmath head/contrib/libc++/include/random head/sys/sys/param.h Modified: head/contrib/libc++/include/cmath ============================================================================== --- head/contrib/libc++/include/cmath Thu Nov 7 18:16:46 2019 (r354459) +++ head/contrib/libc++/include/cmath Thu Nov 7 18:26:01 2019 (r354460) @@ -303,11 +303,15 @@ long double truncl(long double x); #include <__config> #include #include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif +_LIBCPP_PUSH_MACROS +#include <__undef_macros> + _LIBCPP_BEGIN_NAMESPACE_STD using ::signbit; @@ -632,6 +636,38 @@ lerp(long double __a, long double __b, long double __t #endif // _LIBCPP_STD_VER > 17 +template ::digits > numeric_limits<_IntT>::digits), + int _Bits = (numeric_limits<_IntT>::digits - numeric_limits<_FloatT>::digits)> +_LIBCPP_INLINE_VISIBILITY +_LIBCPP_CONSTEXPR _IntT __max_representable_int_for_float() _NOEXCEPT { + static_assert(is_floating_point<_FloatT>::value, "must be a floating point type"); + static_assert(is_integral<_IntT>::value, "must be an integral type"); + static_assert(numeric_limits<_FloatT>::radix == 2, "FloatT has incorrect radix"); + static_assert(_IsSame<_FloatT, float>::value || _IsSame<_FloatT, double>::value + || _IsSame<_FloatT,long double>::value, "unsupported floating point type"); + return _FloatBigger ? numeric_limits<_IntT>::max() : (numeric_limits<_IntT>::max() >> _Bits << _Bits); +} + +// Convert a floating point number to the specified integral type after +// clamping to the integral types representable range. +// +// The behavior is undefined if `__r` is NaN. +template +_LIBCPP_INLINE_VISIBILITY +_IntT __clamp_to_integral(_RealT __r) _NOEXCEPT { + using _Lim = std::numeric_limits<_IntT>; + const _IntT _MaxVal = std::__max_representable_int_for_float<_IntT, _RealT>(); + if (__r >= ::nextafter(static_cast<_RealT>(_MaxVal), INFINITY)) { + return _Lim::max(); + } else if (__r <= _Lim::lowest()) { + return _Lim::min(); + } + return static_cast<_IntT>(__r); +} + _LIBCPP_END_NAMESPACE_STD + +_LIBCPP_POP_MACROS #endif // _LIBCPP_CMATH Modified: head/contrib/libc++/include/random ============================================================================== --- head/contrib/libc++/include/random Thu Nov 7 18:16:46 2019 (r354459) +++ head/contrib/libc++/include/random Thu Nov 7 18:26:01 2019 (r354460) @@ -4592,7 +4592,10 @@ class _LIBCPP_TEMPLATE_VIS poisson_distribution (publi template poisson_distribution<_IntType>::param_type::param_type(double __mean) - : __mean_(__mean) + // According to the standard `inf` is a valid input, but it causes the + // distribution to hang, so we replace it with the maximum representable + // mean. + : __mean_(isinf(__mean) ? numeric_limits::max() : __mean) { if (__mean_ < 10) { @@ -4610,7 +4613,7 @@ poisson_distribution<_IntType>::param_type::param_type { __s_ = _VSTD::sqrt(__mean_); __d_ = 6 * __mean_ * __mean_; - __l_ = static_cast(__mean_ - 1.1484); + __l_ = std::trunc(__mean_ - 1.1484); __omega_ = .3989423 / __s_; double __b1_ = .4166667E-1 / __mean_; double __b2_ = .3 * __b1_ * __b1_; @@ -4627,12 +4630,12 @@ template _IntType poisson_distribution<_IntType>::operator()(_URNG& __urng, const param_type& __pr) { - result_type __x; + double __tx; uniform_real_distribution __urd; if (__pr.__mean_ < 10) { - __x = 0; - for (double __p = __urd(__urng); __p > __pr.__l_; ++__x) + __tx = 0; + for (double __p = __urd(__urng); __p > __pr.__l_; ++__tx) __p *= __urd(__urng); } else @@ -4642,19 +4645,19 @@ poisson_distribution<_IntType>::operator()(_URNG& __ur double __u; if (__g > 0) { - __x = static_cast(__g); - if (__x >= __pr.__l_) - return __x; - __difmuk = __pr.__mean_ - __x; + __tx = std::trunc(__g); + if (__tx >= __pr.__l_) + return std::__clamp_to_integral(__tx); + __difmuk = __pr.__mean_ - __tx; __u = __urd(__urng); if (__pr.__d_ * __u >= __difmuk * __difmuk * __difmuk) - return __x; + return std::__clamp_to_integral(__tx); } exponential_distribution __edist; for (bool __using_exp_dist = false; true; __using_exp_dist = true) { double __e; - if (__using_exp_dist || __g < 0) + if (__using_exp_dist || __g <= 0) { double __t; do @@ -4664,31 +4667,31 @@ poisson_distribution<_IntType>::operator()(_URNG& __ur __u += __u - 1; __t = 1.8 + (__u < 0 ? -__e : __e); } while (__t <= -.6744); - __x = __pr.__mean_ + __pr.__s_ * __t; - __difmuk = __pr.__mean_ - __x; + __tx = std::trunc(__pr.__mean_ + __pr.__s_ * __t); + __difmuk = __pr.__mean_ - __tx; __using_exp_dist = true; } double __px; double __py; - if (__x < 10) + if (__tx < 10 && __tx >= 0) { const double __fac[] = {1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880}; __px = -__pr.__mean_; - __py = _VSTD::pow(__pr.__mean_, (double)__x) / __fac[__x]; + __py = _VSTD::pow(__pr.__mean_, (double)__tx) / __fac[static_cast(__tx)]; } else { - double __del = .8333333E-1 / __x; + double __del = .8333333E-1 / __tx; __del -= 4.8 * __del * __del * __del; - double __v = __difmuk / __x; + double __v = __difmuk / __tx; if (_VSTD::abs(__v) > 0.25) - __px = __x * _VSTD::log(1 + __v) - __difmuk - __del; + __px = __tx * _VSTD::log(1 + __v) - __difmuk - __del; else - __px = __x * __v * __v * (((((((.1250060 * __v + -.1384794) * + __px = __tx * __v * __v * (((((((.1250060 * __v + -.1384794) * __v + .1421878) * __v + -.1661269) * __v + .2000118) * __v + -.2500068) * __v + .3333333) * __v + -.5) - __del; - __py = .3989423 / _VSTD::sqrt(__x); + __py = .3989423 / _VSTD::sqrt(__tx); } double __r = (0.5 - __difmuk) / __pr.__s_; double __r2 = __r * __r; @@ -4708,7 +4711,7 @@ poisson_distribution<_IntType>::operator()(_URNG& __ur } } } - return __x; + return std::__clamp_to_integral(__tx); } template Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Nov 7 18:16:46 2019 (r354459) +++ head/sys/sys/param.h Thu Nov 7 18:26:01 2019 (r354460) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300055 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300056 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Thu Nov 7 18:26:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E2691BC698; Thu, 7 Nov 2019 18:26:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478BgT728dz460c; Thu, 7 Nov 2019 18:26:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D553819EE7; Thu, 7 Nov 2019 18:26:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7IQTVx076773; Thu, 7 Nov 2019 18:26:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7IQTvT076772; Thu, 7 Nov 2019 18:26:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911071826.xA7IQTvT076772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 18:26:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354461 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 354461 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 18:26:30 -0000 Author: markj Date: Thu Nov 7 18:26:29 2019 New Revision: 354461 URL: https://svnweb.freebsd.org/changeset/base/354461 Log: Drop Giant before sleeping on a busy page. Before the page busy code was converted to make direct use of sleepqueues, this was handled by _sleep(). Reported by: glebius Reviewed by: kib Sponsored by: The FreeBSD Foundation Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Nov 7 18:26:01 2019 (r354460) +++ head/sys/vm/vm_page.c Thu Nov 7 18:26:29 2019 (r354461) @@ -1053,8 +1053,10 @@ _vm_page_busy_sleep(vm_object_t obj, vm_page_t m, cons } if (locked) VM_OBJECT_DROP(obj); + DROP_GIANT(); sleepq_add(m, NULL, wmesg, 0, 0); sleepq_wait(m, PVM); + PICKUP_GIANT(); } /* From owner-svn-src-head@freebsd.org Thu Nov 7 18:29:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 229991BC778; Thu, 7 Nov 2019 18:29:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478BlQ0v7Xz46V6; Thu, 7 Nov 2019 18:29:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0310719EEE; Thu, 7 Nov 2019 18:29:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7ITrLG077103; Thu, 7 Nov 2019 18:29:53 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7ITq8W077093; Thu, 7 Nov 2019 18:29:52 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201911071829.xA7ITq8W077093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 7 Nov 2019 18:29:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354462 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 354462 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 18:29:54 -0000 Author: bz Date: Thu Nov 7 18:29:51 2019 New Revision: 354462 URL: https://svnweb.freebsd.org/changeset/base/354462 Log: netinet*: variable cleanup In preparation for another change factor out various variable cleanups. These mainly include: (1) do not assign values to variables during declaration: this makes the code more readable and does allow for better grouping of variable declarations, (2) do not assign values to variables before need; e.g., if a variable is only used in the 2nd half of a function and we have multiple return paths before that, then do not set it before it is needed, and (3) try to avoid assigning the same value multiple times. MFC after: 3 weeks Sponsored by: Netflix Modified: head/sys/netinet/tcp_input.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/dest6.c head/sys/netinet6/icmp6.c head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_mroute.c head/sys/netinet6/mld6.c head/sys/netinet6/nd6_nbr.c head/sys/netinet6/nd6_rtr.c head/sys/netinet6/route6.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Nov 7 18:26:29 2019 (r354461) +++ head/sys/netinet/tcp_input.c Thu Nov 7 18:29:51 2019 (r354462) @@ -512,10 +512,11 @@ cc_ecnpkt_handler(struct tcpcb *tp, struct tcphdr *th, int tcp6_input(struct mbuf **mp, int *offp, int proto) { - struct mbuf *m = *mp; + struct mbuf *m; struct in6_ifaddr *ia6; struct ip6_hdr *ip6; + m = *mp; IP6_EXTHDR_CHECK(m, *offp, sizeof(struct tcphdr), IPPROTO_DONE); /* @@ -525,10 +526,8 @@ tcp6_input(struct mbuf **mp, int *offp, int proto) ip6 = mtod(m, struct ip6_hdr *); ia6 = in6ifa_ifwithaddr(&ip6->ip6_dst, 0 /* XXX */); if (ia6 && (ia6->ia6_flags & IN6_IFF_ANYCAST)) { - struct ip6_hdr *ip6; ifa_free(&ia6->ia_ifa); - ip6 = mtod(m, struct ip6_hdr *); icmp6_error(m, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_ADDR, (caddr_t)&ip6->ip6_dst - (caddr_t)ip6); return (IPPROTO_DONE); Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Thu Nov 7 18:26:29 2019 (r354461) +++ head/sys/netinet/udp_usrreq.c Thu Nov 7 18:29:51 2019 (r354462) @@ -421,14 +421,13 @@ udp_input(struct mbuf **mp, int *offp, int proto) /* * Get IP and UDP header together in first mbuf. */ - ip = mtod(m, struct ip *); if (m->m_len < iphlen + sizeof(struct udphdr)) { if ((m = m_pullup(m, iphlen + sizeof(struct udphdr))) == NULL) { UDPSTAT_INC(udps_hdrops); return (IPPROTO_DONE); } - ip = mtod(m, struct ip *); } + ip = mtod(m, struct ip *); uh = (struct udphdr *)((caddr_t)ip + iphlen); cscov_partial = (proto == IPPROTO_UDPLITE) ? 1 : 0; Modified: head/sys/netinet6/dest6.c ============================================================================== --- head/sys/netinet6/dest6.c Thu Nov 7 18:26:29 2019 (r354461) +++ head/sys/netinet6/dest6.c Thu Nov 7 18:29:51 2019 (r354462) @@ -64,10 +64,13 @@ __FBSDID("$FreeBSD$"); int dest6_input(struct mbuf **mp, int *offp, int proto) { - struct mbuf *m = *mp; - int off = *offp, dstoptlen, optlen; + struct mbuf *m; + int off, dstoptlen, optlen; struct ip6_dest *dstopts; u_int8_t *opt; + + m = *mp; + off = *offp; /* validation of the length of the header */ #ifndef PULLDOWN_TEST Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Thu Nov 7 18:26:29 2019 (r354461) +++ head/sys/netinet6/icmp6.c Thu Nov 7 18:29:51 2019 (r354462) @@ -401,17 +401,15 @@ icmp6_error(struct mbuf *m, int type, int code, int pa int icmp6_input(struct mbuf **mp, int *offp, int proto) { - struct mbuf *m = *mp, *n; + struct mbuf *m, *n; struct ifnet *ifp; struct ip6_hdr *ip6, *nip6; struct icmp6_hdr *icmp6, *nicmp6; - int off = *offp; - int icmp6len = m->m_pkthdr.len - *offp; - int code, sum, noff; char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; - int ip6len, error; + int code, error, icmp6len, ip6len, noff, off, sum; - ifp = m->m_pkthdr.rcvif; + m = *mp; + off = *offp; #ifndef PULLDOWN_TEST IP6_EXTHDR_CHECK(m, off, sizeof(struct icmp6_hdr), IPPROTO_DONE); @@ -423,13 +421,14 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) * that not corrupted and of at least minimum length */ - ip6 = mtod(m, struct ip6_hdr *); - ip6len = sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen); + icmp6len = m->m_pkthdr.len - off; if (icmp6len < sizeof(struct icmp6_hdr)) { ICMP6STAT_INC(icp6s_tooshort); goto freeit; } + ip6 = mtod(m, struct ip6_hdr *); + ifp = m->m_pkthdr.rcvif; /* * Check multicast group membership. * Note: SSM filters are not applied for ICMPv6 traffic. @@ -445,9 +444,7 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) } } - /* - * calculate the checksum - */ + /* Calculate the checksum. */ #ifndef PULLDOWN_TEST icmp6 = (struct icmp6_hdr *)((caddr_t)ip6 + off); #else @@ -473,6 +470,7 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) if (icmp6->icmp6_type < ICMP6_INFOMSG_MASK) icmp6_ifstat_inc(ifp, ifs6_in_error); + ip6len = sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen); switch (icmp6->icmp6_type) { case ICMP6_DST_UNREACH: icmp6_ifstat_inc(ifp, ifs6_in_dstunreach); @@ -881,12 +879,14 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) static int icmp6_notify_error(struct mbuf **mp, int off, int icmp6len, int code) { - struct mbuf *m = *mp; + struct mbuf *m; struct icmp6_hdr *icmp6; struct ip6_hdr *eip6; u_int32_t notifymtu; struct sockaddr_in6 icmp6src, icmp6dst; + m = *mp; + if (icmp6len < sizeof(struct icmp6_hdr) + sizeof(struct ip6_hdr)) { ICMP6STAT_INC(icp6s_tooshort); goto freeit; @@ -2220,24 +2220,19 @@ void icmp6_redirect_input(struct mbuf *m, int off) { struct ifnet *ifp; - struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); + struct ip6_hdr *ip6; struct nd_redirect *nd_rd; - int icmp6len = ntohs(ip6->ip6_plen); - char *lladdr = NULL; - int lladdrlen = 0; - int is_router; - int is_onlink; - struct in6_addr src6 = ip6->ip6_src; + struct in6_addr src6; struct in6_addr redtgt6; struct in6_addr reddst6; union nd_opts ndopts; char ip6buf[INET6_ADDRSTRLEN]; + char *lladdr; + int icmp6len, is_onlink, is_router, lladdrlen; M_ASSERTPKTHDR(m); KASSERT(m->m_pkthdr.rcvif != NULL, ("%s: no rcvif", __func__)); - ifp = m->m_pkthdr.rcvif; - /* XXX if we are router, we don't update route by icmp6 redirect */ if (V_ip6_forwarding) goto freeit; @@ -2248,6 +2243,8 @@ icmp6_redirect_input(struct mbuf *m, int off) if(m->m_flags & M_FRAGMENTED) goto freeit; + ip6 = mtod(m, struct ip6_hdr *); + icmp6len = ntohs(ip6->ip6_plen); #ifndef PULLDOWN_TEST IP6_EXTHDR_CHECK(m, off, icmp6len,); nd_rd = (struct nd_redirect *)((caddr_t)ip6 + off); @@ -2258,15 +2255,18 @@ icmp6_redirect_input(struct mbuf *m, int off) return; } #endif + + ifp = m->m_pkthdr.rcvif; redtgt6 = nd_rd->nd_rd_target; reddst6 = nd_rd->nd_rd_dst; - if (in6_setscope(&redtgt6, m->m_pkthdr.rcvif, NULL) || - in6_setscope(&reddst6, m->m_pkthdr.rcvif, NULL)) { + if (in6_setscope(&redtgt6, ifp, NULL) || + in6_setscope(&reddst6, ifp, NULL)) { goto freeit; } /* validation */ + src6 = ip6->ip6_src; if (!IN6_IS_ADDR_LINKLOCAL(&src6)) { nd6log((LOG_ERR, "ICMP6 redirect sent from %s rejected; " @@ -2352,6 +2352,8 @@ icmp6_redirect_input(struct mbuf *m, int off) goto freeit; } + lladdr = NULL; + lladdrlen = 0; if (ndopts.nd_opts_tgt_lladdr) { lladdr = (char *)(ndopts.nd_opts_tgt_lladdr + 1); lladdrlen = ndopts.nd_opts_tgt_lladdr->nd_opt_len << 3; Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Thu Nov 7 18:26:29 2019 (r354461) +++ head/sys/netinet6/ip6_input.c Thu Nov 7 18:29:51 2019 (r354462) @@ -1409,13 +1409,14 @@ ip6_savecontrol_v4(struct inpcb *inp, struct mbuf *m, void ip6_savecontrol(struct inpcb *inp, struct mbuf *m, struct mbuf **mp) { - struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); + struct ip6_hdr *ip6; int v4only = 0; mp = ip6_savecontrol_v4(inp, m, mp, &v4only); if (v4only) return; + ip6 = mtod(m, struct ip6_hdr *); /* * IPV6_HOPOPTS socket option. Recall that we required super-user * privilege for the option (see ip6_ctloutput), but it might be too Modified: head/sys/netinet6/ip6_mroute.c ============================================================================== --- head/sys/netinet6/ip6_mroute.c Thu Nov 7 18:26:29 2019 (r354461) +++ head/sys/netinet6/ip6_mroute.c Thu Nov 7 18:29:51 2019 (r354462) @@ -1720,12 +1720,10 @@ pim6_input(struct mbuf *m, int off, int proto, void *a PIM6STAT_INC(pim6s_rcv_total); - ip6 = mtod(m, struct ip6_hdr *); - pimlen = m->m_pkthdr.len - off; - /* * Validate lengths */ + pimlen = m->m_pkthdr.len - off; if (pimlen < PIM_MINLEN) { PIM6STAT_INC(pim6s_rcv_tooshort); MRT6_DLOG(DEBUG_PIM, "PIM packet too short"); Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Thu Nov 7 18:26:29 2019 (r354461) +++ head/sys/netinet6/mld6.c Thu Nov 7 18:29:51 2019 (r354462) @@ -1260,8 +1260,6 @@ mld_input(struct mbuf *m, int off, int icmp6len) ifp = m->m_pkthdr.rcvif; - ip6 = mtod(m, struct ip6_hdr *); - /* Pullup to appropriate size. */ mld = (struct mld_hdr *)(mtod(m, uint8_t *) + off); if (mld->mld_type == MLD_LISTENER_QUERY && @@ -1275,6 +1273,7 @@ mld_input(struct mbuf *m, int off, int icmp6len) ICMP6STAT_INC(icp6s_badlen); return (IPPROTO_DONE); } + ip6 = mtod(m, struct ip6_hdr *); /* * Userland needs to see all of this traffic for implementing Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Thu Nov 7 18:26:29 2019 (r354461) +++ head/sys/netinet6/nd6_nbr.c Thu Nov 7 18:29:51 2019 (r354462) @@ -121,30 +121,33 @@ VNET_DEFINE_STATIC(int, dad_maxtry) = 15; /* max # of void nd6_ns_input(struct mbuf *m, int off, int icmp6len) { - struct ifnet *ifp = m->m_pkthdr.rcvif; - struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); + struct ifnet *ifp; + struct ip6_hdr *ip6; struct nd_neighbor_solicit *nd_ns; - struct in6_addr saddr6 = ip6->ip6_src; - struct in6_addr daddr6 = ip6->ip6_dst; - struct in6_addr taddr6; - struct in6_addr myaddr6; - char *lladdr = NULL; - struct ifaddr *ifa = NULL; - int lladdrlen = 0; - int anycast = 0, proxy = 0, tentative = 0; - int tlladdr; - int rflag; - union nd_opts ndopts; + struct in6_addr daddr6, myaddr6, saddr6, taddr6; + struct ifaddr *ifa; struct sockaddr_dl proxydl; + union nd_opts ndopts; char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; + char *lladdr; + int anycast, lladdrlen, proxy, rflag, tentative, tlladdr; + ifa = NULL; + /* RFC 6980: Nodes MUST silently ignore fragments */ if(m->m_flags & M_FRAGMENTED) goto freeit; - rflag = (V_ip6_forwarding) ? ND_NA_FLAG_ROUTER : 0; - if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV && V_ip6_norbit_raif) - rflag = 0; + ifp = m->m_pkthdr.rcvif; + ip6 = mtod(m, struct ip6_hdr *); + if (ip6->ip6_hlim != 255) { + nd6log((LOG_ERR, + "nd6_ns_input: invalid hlim (%d) from %s to %s on %s\n", + ip6->ip6_hlim, ip6_sprintf(ip6bufs, &ip6->ip6_src), + ip6_sprintf(ip6bufd, &ip6->ip6_dst), if_name(ifp))); + goto bads; + } + #ifndef PULLDOWN_TEST IP6_EXTHDR_CHECK(m, off, icmp6len,); nd_ns = (struct nd_neighbor_solicit *)((caddr_t)ip6 + off); @@ -156,17 +159,16 @@ nd6_ns_input(struct mbuf *m, int off, int icmp6len) } #endif ip6 = mtod(m, struct ip6_hdr *); /* adjust pointer for safety */ + + saddr6 = ip6->ip6_src; + daddr6 = ip6->ip6_dst; taddr6 = nd_ns->nd_ns_target; if (in6_setscope(&taddr6, ifp, NULL) != 0) goto bad; - if (ip6->ip6_hlim != 255) { - nd6log((LOG_ERR, - "nd6_ns_input: invalid hlim (%d) from %s to %s on %s\n", - ip6->ip6_hlim, ip6_sprintf(ip6bufs, &ip6->ip6_src), - ip6_sprintf(ip6bufd, &ip6->ip6_dst), if_name(ifp))); - goto bad; - } + rflag = (V_ip6_forwarding) ? ND_NA_FLAG_ROUTER : 0; + if (ND_IFINFO(ifp)->flags & ND6_IFF_ACCEPT_RTADV && V_ip6_norbit_raif) + rflag = 0; if (IN6_IS_ADDR_UNSPECIFIED(&saddr6)) { /* dst has to be a solicited node multicast address. */ @@ -215,6 +217,8 @@ nd6_ns_input(struct mbuf *m, int off, int icmp6len) goto freeit; } + lladdr = NULL; + lladdrlen = 0; if (ndopts.nd_opts_src_lladdr) { lladdr = (char *)(ndopts.nd_opts_src_lladdr + 1); lladdrlen = ndopts.nd_opts_src_lladdr->nd_opt_len << 3; @@ -254,6 +258,7 @@ nd6_ns_input(struct mbuf *m, int off, int icmp6len) ifa = (struct ifaddr *)in6ifa_ifpwithaddr(ifp, &taddr6); /* (2) check. */ + proxy = 0; if (ifa == NULL) { struct sockaddr_dl rt_gateway; struct rt_addrinfo info; @@ -380,6 +385,7 @@ nd6_ns_input(struct mbuf *m, int off, int icmp6len) ip6_sprintf(ip6bufs, &daddr6))); nd6log((LOG_ERR, "nd6_ns_input: tgt=%s\n", ip6_sprintf(ip6bufs, &taddr6))); + bads: ICMP6STAT_INC(icp6s_badns); if (ifa != NULL) ifa_free(ifa); @@ -614,34 +620,34 @@ nd6_ns_output(struct ifnet *ifp, const struct in6_addr void nd6_na_input(struct mbuf *m, int off, int icmp6len) { - struct ifnet *ifp = m->m_pkthdr.rcvif; - struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); - struct nd_neighbor_advert *nd_na; - struct in6_addr daddr6 = ip6->ip6_dst; - struct in6_addr taddr6; - int flags; - int is_router; - int is_solicited; - int is_override; - char *lladdr = NULL; - int lladdrlen = 0; - int checklink = 0; + struct ifnet *ifp; + struct ip6_hdr *ip6; struct ifaddr *ifa; - struct llentry *ln = NULL; - union nd_opts ndopts; - struct mbuf *chain = NULL; + struct llentry *ln; + struct mbuf *chain; + struct nd_neighbor_advert *nd_na; + struct in6_addr daddr6, taddr6; struct sockaddr_in6 sin6; + union nd_opts ndopts; u_char linkhdr[LLE_MAX_LINKHDR]; - size_t linkhdrsize; - int lladdr_off; char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; + char *lladdr; + size_t linkhdrsize; + int flags, is_override, is_router, is_solicited; + int lladdr_off, lladdrlen, checklink; NET_EPOCH_ASSERT(); + chain = NULL; + ln = NULL; + checklink = 0; + /* RFC 6980: Nodes MUST silently ignore fragments */ if(m->m_flags & M_FRAGMENTED) goto freeit; + ifp = m->m_pkthdr.rcvif; + ip6 = mtod(m, struct ip6_hdr *); if (ip6->ip6_hlim != 255) { nd6log((LOG_ERR, "nd6_na_input: invalid hlim (%d) from %s to %s on %s\n", @@ -665,7 +671,6 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len) is_router = ((flags & ND_NA_FLAG_ROUTER) != 0); is_solicited = ((flags & ND_NA_FLAG_SOLICITED) != 0); is_override = ((flags & ND_NA_FLAG_OVERRIDE) != 0); - memset(&sin6, 0, sizeof(sin6)); taddr6 = nd_na->nd_na_target; if (in6_setscope(&taddr6, ifp, NULL)) @@ -677,6 +682,8 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len) ip6_sprintf(ip6bufs, &taddr6))); goto bad; } + + daddr6 = ip6->ip6_dst; if (IN6_IS_ADDR_MULTICAST(&daddr6)) if (is_solicited) { nd6log((LOG_ERR, @@ -693,6 +700,8 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len) goto freeit; } + lladdr = NULL; + lladdrlen = 0; if (ndopts.nd_opts_tgt_lladdr) { lladdr = (char *)(ndopts.nd_opts_tgt_lladdr + 1); lladdrlen = ndopts.nd_opts_tgt_lladdr->nd_opt_len << 3; @@ -888,8 +897,10 @@ nd6_na_input(struct mbuf *m, int off, int icmp6len) * rt->rt_flags &= ~RTF_REJECT; */ ln->la_asked = 0; - if (ln->la_hold != NULL) + if (ln->la_hold != NULL) { + memset(&sin6, 0, sizeof(sin6)); nd6_grab_holdchain(ln, &chain, &sin6); + } freeit: if (ln != NULL) LLE_WUNLOCK(ln); Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Thu Nov 7 18:26:29 2019 (r354461) +++ head/sys/netinet6/nd6_rtr.c Thu Nov 7 18:29:51 2019 (r354462) @@ -127,15 +127,17 @@ VNET_DEFINE(int, nd6_ignore_ipv6_only_ra) = 1; void nd6_rs_input(struct mbuf *m, int off, int icmp6len) { - struct ifnet *ifp = m->m_pkthdr.rcvif; - struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); + struct ifnet *ifp; + struct ip6_hdr *ip6; struct nd_router_solicit *nd_rs; - struct in6_addr saddr6 = ip6->ip6_src; - char *lladdr = NULL; - int lladdrlen = 0; + struct in6_addr saddr6; union nd_opts ndopts; char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; + char *lladdr; + int lladdrlen; + ifp = m->m_pkthdr.rcvif; + /* * Accept RS only when V_ip6_forwarding=1 and the interface has * no ND6_IFF_ACCEPT_RTADV. @@ -148,6 +150,7 @@ nd6_rs_input(struct mbuf *m, int off, int icmp6len) goto freeit; /* Sanity checks */ + ip6 = mtod(m, struct ip6_hdr *); if (ip6->ip6_hlim != 255) { nd6log((LOG_ERR, "nd6_rs_input: invalid hlim (%d) from %s to %s on %s\n", @@ -160,6 +163,7 @@ nd6_rs_input(struct mbuf *m, int off, int icmp6len) * Don't update the neighbor cache, if src = ::. * This indicates that the src has no IP address assigned yet. */ + saddr6 = ip6->ip6_src; if (IN6_IS_ADDR_UNSPECIFIED(&saddr6)) goto freeit; @@ -183,6 +187,8 @@ nd6_rs_input(struct mbuf *m, int off, int icmp6len) goto freeit; } + lladdr = NULL; + lladdrlen = 0; if (ndopts.nd_opts_src_lladdr) { lladdr = (char *)(ndopts.nd_opts_src_lladdr + 1); lladdrlen = ndopts.nd_opts_src_lladdr->nd_opt_len << 3; @@ -322,22 +328,22 @@ nd6_ifnet_link_event(void *arg __unused, struct ifnet void nd6_ra_input(struct mbuf *m, int off, int icmp6len) { - struct ifnet *ifp = m->m_pkthdr.rcvif; - struct nd_ifinfo *ndi = ND_IFINFO(ifp); - struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); + struct ifnet *ifp; + struct nd_ifinfo *ndi; + struct ip6_hdr *ip6; struct nd_router_advert *nd_ra; - struct in6_addr saddr6 = ip6->ip6_src; - int mcast = 0; - union nd_opts ndopts; + struct in6_addr saddr6; struct nd_defrouter *dr; + union nd_opts ndopts; char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; + int mcast; - dr = NULL; - /* * We only accept RAs only when the per-interface flag * ND6_IFF_ACCEPT_RTADV is on the receiving interface. */ + ifp = m->m_pkthdr.rcvif; + ndi = ND_IFINFO(ifp); if (!(ndi->flags & ND6_IFF_ACCEPT_RTADV)) goto freeit; @@ -345,6 +351,7 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len) if(m->m_flags & M_FRAGMENTED) goto freeit; + ip6 = mtod(m, struct ip6_hdr *); if (ip6->ip6_hlim != 255) { nd6log((LOG_ERR, "nd6_ra_input: invalid hlim (%d) from %s to %s on %s\n", @@ -353,6 +360,7 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len) goto bad; } + saddr6 = ip6->ip6_src; if (!IN6_IS_ADDR_LINKLOCAL(&saddr6)) { nd6log((LOG_ERR, "nd6_ra_input: src %s is not link-local\n", @@ -380,6 +388,8 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len) goto freeit; } + mcast = 0; + dr = NULL; { struct nd_defrouter dr0; u_int32_t advreachable = nd_ra->nd_ra_reachable; Modified: head/sys/netinet6/route6.c ============================================================================== --- head/sys/netinet6/route6.c Thu Nov 7 18:26:29 2019 (r354461) +++ head/sys/netinet6/route6.c Thu Nov 7 18:29:51 2019 (r354462) @@ -62,12 +62,16 @@ int route6_input(struct mbuf **mp, int *offp, int proto) { struct ip6_hdr *ip6; - struct mbuf *m = *mp; + struct mbuf *m; struct ip6_rthdr *rh; int off = *offp, rhlen; #ifdef __notyet__ struct ip6aux *ip6a; +#endif + m = *mp; + +#ifdef __notyet__ ip6a = ip6_findaux(m); if (ip6a) { /* XXX reject home-address option before rthdr */ From owner-svn-src-head@freebsd.org Thu Nov 7 19:06:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3C061BD839; Thu, 7 Nov 2019 19:06:19 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478CYR46s5z497t; Thu, 7 Nov 2019 19:06:19 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D0DA1A635; Thu, 7 Nov 2019 19:06:19 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7J6Jkb011036; Thu, 7 Nov 2019 19:06:19 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7J6JNF011035; Thu, 7 Nov 2019 19:06:19 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911071906.xA7J6JNF011035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Nov 2019 19:06:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354463 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 354463 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 19:06:19 -0000 Author: glebius Date: Thu Nov 7 19:06:18 2019 New Revision: 354463 URL: https://svnweb.freebsd.org/changeset/base/354463 Log: sysctl_rtsock() has all necessary locking and doesn't need Giant to run. While here add description. Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Thu Nov 7 18:29:51 2019 (r354462) +++ head/sys/net/rtsock.c Thu Nov 7 19:06:18 2019 (r354463) @@ -1970,7 +1970,8 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS) return (error); } -static SYSCTL_NODE(_net, PF_ROUTE, routetable, CTLFLAG_RD, sysctl_rtsock, ""); +static SYSCTL_NODE(_net, PF_ROUTE, routetable, CTLFLAG_RD | CTLFLAG_MPSAFE, + sysctl_rtsock, "Return route tables and interface/address lists"); /* * Definitions of protocols supported in the ROUTE domain. From owner-svn-src-head@freebsd.org Thu Nov 7 19:13:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1E1C1BDC32; Thu, 7 Nov 2019 19:13:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478Ck95GM8z49yh; Thu, 7 Nov 2019 19:13:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9796A1A812; Thu, 7 Nov 2019 19:13:53 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7JDrDu016555; Thu, 7 Nov 2019 19:13:53 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7JDrNZ016554; Thu, 7 Nov 2019 19:13:53 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201911071913.xA7JDrNZ016554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 7 Nov 2019 19:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354464 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 354464 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 19:13:53 -0000 Author: kevans Date: Thu Nov 7 19:13:53 2019 New Revision: 354464 URL: https://svnweb.freebsd.org/changeset/base/354464 Log: sys/conf/files.arm64: remove some unnecessary soc_* dependencies These files already have 'device' lines that they require; adding a dependency on SOC_* options is an extra restriction that adds extra verbosity when future supported Broadcom-based SOC will also feature the same compatible device. Users wishing to not compile these devices in should remove the 'device' lines from their config. Modified: head/sys/conf/files.arm64 Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Thu Nov 7 19:06:18 2019 (r354463) +++ head/sys/conf/files.arm64 Thu Nov 7 19:13:53 2019 (r354464) @@ -88,18 +88,18 @@ arm/arm/pmu.c standard arm/arm/physmem.c standard arm/broadcom/bcm2835/bcm2835_audio.c optional sound vchiq fdt \ compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" -arm/broadcom/bcm2835/bcm2835_bsc.c optional bcm2835_bsc soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_bsc.c optional bcm2835_bsc fdt arm/broadcom/bcm2835/bcm2835_cpufreq.c optional soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm2835_dma.c optional soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm2835_fbd.c optional vt soc_brcm_bcm2837 fdt -arm/broadcom/bcm2835/bcm2835_ft5406.c optional evdev bcm2835_ft5406 soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_ft5406.c optional evdev bcm2835_ft5406 fdt arm/broadcom/bcm2835/bcm2835_gpio.c optional gpio soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm2835_intr.c optional soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm2835_mbox.c optional soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm2835_rng.c optional !random_loadable soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm2835_sdhci.c optional sdhci soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm2835_sdhost.c optional sdhci soc_brcm_bcm2837 fdt -arm/broadcom/bcm2835/bcm2835_spi.c optional bcm2835_spi soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_spi.c optional bcm2835_spi fdt arm/broadcom/bcm2835/bcm2835_vcio.c optional soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm2835_wdog.c optional soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm2836.c optional soc_brcm_bcm2837 fdt From owner-svn-src-head@freebsd.org Thu Nov 7 19:22:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 82FA11BDE6C; Thu, 7 Nov 2019 19:22:53 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478CwY30c9z4BQd; Thu, 7 Nov 2019 19:22:53 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 306791A9D1; Thu, 7 Nov 2019 19:22:53 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7JMrFl022579; Thu, 7 Nov 2019 19:22:53 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7JMpdH022571; Thu, 7 Nov 2019 19:22:51 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201911071922.xA7JMpdH022571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 7 Nov 2019 19:22:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354465 - in head: . lib/msun/src libexec libexec/rtld-elf libexec/rtld-elf32 share/mk usr.bin usr.bin/ldd32 X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . lib/msun/src libexec libexec/rtld-elf libexec/rtld-elf32 share/mk usr.bin usr.bin/ldd32 X-SVN-Commit-Revision: 354465 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 19:22:53 -0000 Author: brooks Date: Thu Nov 7 19:22:51 2019 New Revision: 354465 URL: https://svnweb.freebsd.org/changeset/base/354465 Log: Revert r354449: libcompat: build 32-bit rtld and ldd as part of "everything" Additional testing is required.. Deleted: head/libexec/rtld-elf32/ head/usr.bin/ldd32/ Modified: head/Makefile.inc1 head/Makefile.libcompat head/lib/msun/src/k_sincosl.h head/libexec/Makefile head/libexec/rtld-elf/Makefile head/share/mk/bsd.compat.mk head/share/mk/src.opts.mk head/usr.bin/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Nov 7 19:13:53 2019 (r354464) +++ head/Makefile.inc1 Thu Nov 7 19:22:51 2019 (r354465) @@ -802,10 +802,11 @@ XCFLAGS+= --sysroot=${WORLDTMP} XCFLAGS+= ${BFLAGS} .endif -.if ${MK_LIB32} == "yes" +.if ${MK_LIB32} != "no" && (${TARGET_ARCH} == "amd64" || \ + ${TARGET_ARCH} == "powerpc64" || ${TARGET_ARCH:Mmips64*} != "") _LIBCOMPAT= 32 .include "Makefile.libcompat" -.elif ${MK_LIBSOFT} == "yes" +.elif ${MK_LIBSOFT} != "no" && ${TARGET_ARCH:Marmv[67]*} != "" _LIBCOMPAT= SOFT .include "Makefile.libcompat" .endif Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Thu Nov 7 19:13:53 2019 (r354464) +++ head/Makefile.libcompat Thu Nov 7 19:22:51 2019 (r354465) @@ -111,10 +111,28 @@ build${libcompat}: .PHONY .endfor ${_+_}cd ${.CURDIR}; \ ${LIBCOMPATWMAKE} -f Makefile.inc1 -DNO_FSCHG libraries +.if ${libcompat} == "32" +.for _t in ${_obj} all +.if !defined(NO_RTLD) + ${_+_}cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIBCOMPATWMAKE} \ + -DNO_FSCHG DIRPRFX=libexec/rtld-elf/ ${_t} +.endif + ${_+_}cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIBCOMPATWMAKE} \ + DIRPRFX=usr.bin/ldd ${_t} +.endfor +.endif distribute${libcompat} install${libcompat}: .PHONY .for _dir in ${_LC_LIBDIRS.yes} ${_+_}cd ${.CURDIR}/${_dir}; ${LIBCOMPATIMAKE} ${.TARGET:S/${libcompat}$//} .endfor +.if ${libcompat} == "32" +.if !defined(NO_RTLD) + ${_+_}cd ${.CURDIR}/libexec/rtld-elf; \ + PROG=ld-elf32.so.1 ${LIBCOMPATIMAKE} ${.TARGET:S/32$//} +.endif + ${_+_}cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIBCOMPATIMAKE} \ + ${.TARGET:S/32$//} +.endif -.endif # !targets(__<${_this:T}>__) +.endif Modified: head/lib/msun/src/k_sincosl.h ============================================================================== --- head/lib/msun/src/k_sincosl.h Thu Nov 7 19:13:53 2019 (r354464) +++ head/lib/msun/src/k_sincosl.h Thu Nov 7 19:22:51 2019 (r354465) @@ -28,8 +28,8 @@ S1lo = -9.2563760475949941e-18; /* -0x15580000000000. #define C1 ((long double)C1hi + C1lo) #else static const long double -C1 = 0.0416666666666666666136L; /* 0xaaaaaaaaaaaaaa9b.0p-68 */ -S1 = -0.166666666666666666671L, /* -0xaaaaaaaaaaaaaaab.0p-66 */ +C1 = 0.0416666666666666666136L, /* 0xaaaaaaaaaaaaaa9b.0p-68 */ +S1 = -0.166666666666666666671L; /* -0xaaaaaaaaaaaaaaab.0p-66 */ #endif static const double Modified: head/libexec/Makefile ============================================================================== --- head/libexec/Makefile Thu Nov 7 19:13:53 2019 (r354464) +++ head/libexec/Makefile Thu Nov 7 19:22:51 2019 (r354465) @@ -74,7 +74,6 @@ _tftp-proxy= tftp-proxy .if !defined(NO_PIC) && !defined(NO_RTLD) _rtld-elf= rtld-elf -SUBDIR.${MK_LIB32}+= rtld-elf32 .endif .if ${MK_RBOOTD} != "no" Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Thu Nov 7 19:13:53 2019 (r354464) +++ head/libexec/rtld-elf/Makefile Thu Nov 7 19:22:51 2019 (r354465) @@ -4,8 +4,6 @@ # linker: # make DEBUG_FLAGS=-g WITHOUT_TESTS=yes all -RTLD_ELF_DIR:= ${.PARSEDIR} - .include PACKAGE= clibs MK_PIE= no # Always position independent using local rules @@ -27,16 +25,16 @@ SRCS= \ xmalloc.c \ debug.c \ libmap.c -MAN?= rtld.1 +MAN= rtld.1 CSTD?= gnu99 CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD -ffreestanding CFLAGS+= -I${SRCTOP}/lib/csu/common -.if exists(${RTLD_ELF_DIR}/${MACHINE_ARCH}) +.if exists(${.CURDIR}/${MACHINE_ARCH}) RTLD_ARCH= ${MACHINE_ARCH} .else RTLD_ARCH= ${MACHINE_CPUARCH} .endif -CFLAGS+= -I${RTLD_ELF_DIR}/${RTLD_ARCH} -I${RTLD_ELF_DIR} +CFLAGS+= -I${.CURDIR}/${RTLD_ARCH} -I${.CURDIR} .if ${MACHINE_ARCH} == "powerpc64" LDFLAGS+= -nostdlib -e _rtld_start .else @@ -83,16 +81,16 @@ LIBADD+= compiler_rt .if ${MK_SYMVER} == "yes" VERSION_DEF= ${LIBCSRCDIR}/Versions.def -SYMBOL_MAPS= ${RTLD_ELF_DIR}/Symbol.map +SYMBOL_MAPS= ${.CURDIR}/Symbol.map VERSION_MAP= Version.map LDFLAGS+= -Wl,--version-script=${VERSION_MAP} -.if exists(${RTLD_ELF_DIR}/${RTLD_ARCH}/Symbol.map) -SYMBOL_MAPS+= ${RTLD_ELF_DIR}/${RTLD_ARCH}/Symbol.map +.if exists(${.CURDIR}/${RTLD_ARCH}/Symbol.map) +SYMBOL_MAPS+= ${.CURDIR}/${RTLD_ARCH}/Symbol.map .endif .endif -.sinclude "${RTLD_ELF_DIR}/${RTLD_ARCH}/Makefile.inc" +.sinclude "${.CURDIR}/${RTLD_ARCH}/Makefile.inc" # Since moving rtld-elf to /libexec, we need to create a symlink. # Fixup the existing binary that's there so we can symlink over it. @@ -101,12 +99,10 @@ beforeinstall: -chflags -h noschg ${DESTDIR}/usr/libexec/${PROG} .endif -.PATH: ${RTLD_ELF_DIR}/${RTLD_ARCH} +.PATH: ${.CURDIR}/${RTLD_ARCH} -.if ${.CURDIR} == ${RTLD_ELF_DIR} HAS_TESTS= SUBDIR.${MK_TESTS}+= tests -.endif .include ${PROG_FULL}: ${VERSION_MAP} Modified: head/share/mk/bsd.compat.mk ============================================================================== --- head/share/mk/bsd.compat.mk Thu Nov 7 19:13:53 2019 (r354464) +++ head/share/mk/bsd.compat.mk Thu Nov 7 19:22:51 2019 (r354465) @@ -26,9 +26,8 @@ LIB32CPUFLAGS= -march=${COMPAT_CPUTYPE} LIB32CPUFLAGS+= -target x86_64-unknown-freebsd13.0 .endif LIB32CPUFLAGS+= -m32 -LIB32_MACHINE= i386 -LIB32_MACHINE_ARCH= i386 -LIB32WMAKEENV= MACHINE_CPU="i686 mmx sse sse2" +LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \ + MACHINE_CPU="i686 mmx sse sse2" LIB32WMAKEFLAGS= \ AS="${XAS} --32" \ LD="${XLD} -m elf_i386_fbsd -L${LIBCOMPATTMP}/usr/lib32" @@ -41,8 +40,7 @@ LIB32CPUFLAGS= -mcpu=powerpc LIB32CPUFLAGS= -mcpu=${COMPAT_CPUTYPE} .endif LIB32CPUFLAGS+= -m32 -LIB32_MACHINE= powerpc -LIB32_MACHINE_ARCH= powerpc +LIB32WMAKEENV= MACHINE=powerpc MACHINE_ARCH=powerpc LIB32WMAKEFLAGS= \ LD="${XLD} -m elf32ppc_fbsd" @@ -63,8 +61,7 @@ LIB32CPUFLAGS= -target mips-unknown-freebsd13.0 .endif .endif LIB32CPUFLAGS+= -mabi=32 -LIB32_MACHINE= mips -LIB32_MACHINE_ARCH= mips +LIB32WMAKEENV= MACHINE=mips MACHINE_ARCH=mips .if ${COMPAT_ARCH:Mmips64el*} != "" LIB32WMAKEFLAGS= LD="${XLD} -m elf32ltsmip_fbsd" .else @@ -85,9 +82,7 @@ LIB32WMAKEFLAGS+= -DCOMPAT_32BIT HAS_COMPAT=SOFT LIBSOFTCFLAGS= -DCOMPAT_SOFTFP LIBSOFTCPUFLAGS= -mfloat-abi=softfp -LIBSOFT_MACHINE= arm -LIBSOFT_MACHINE_ARCH= ${COMPAT_ARCH} -LIBSOFTWMAKEENV= CPUTYPE=soft +LIBSOFTWMAKEENV= CPUTYPE=soft MACHINE=arm MACHINE_ARCH=${COMPAT_ARCH} LIBSOFTWMAKEFLAGS= -DCOMPAT_SOFTFP .endif @@ -119,8 +114,8 @@ _LIBCOMPAT:= ${WANT_COMPAT} # Generic code for each type. # Set defaults based on type. libcompat= ${_LIBCOMPAT:tl} -_LIBCOMPAT_MAKEVARS= _OBJTOP TMP CPUFLAGS CFLAGS CXXFLAGS \ - _MACHINE _MACHINE_ARCH WMAKEENV WMAKEFLAGS WMAKE +_LIBCOMPAT_MAKEVARS= _OBJTOP TMP CPUFLAGS CFLAGS CXXFLAGS WMAKEENV \ + WMAKEFLAGS WMAKE .for _var in ${_LIBCOMPAT_MAKEVARS} .if !empty(LIB${_LIBCOMPAT}${_var}) LIBCOMPAT${_var}?= ${LIB${_LIBCOMPAT}${_var}} @@ -136,9 +131,6 @@ LIBCOMPATCFLAGS+= ${LIBCOMPATCPUFLAGS} \ --sysroot=${LIBCOMPATTMP} \ ${BFLAGS} -LIBCOMPATWMAKEENV+= MACHINE=${LIBCOMPAT_MACHINE} -LIBCOMPATWMAKEENV+= MACHINE_ARCH=${LIBCOMPAT_MACHINE_ARCH} - # -B is needed to find /usr/lib32/crti.o for GCC and /usr/libsoft/crti.o for # Clang/GCC. LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/lib${libcompat} @@ -147,8 +139,6 @@ LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/lib${libcompat LIBDIR_BASE:= /usr/lib${libcompat} _LIB_OBJTOP= ${LIBCOMPAT_OBJTOP} CFLAGS+= ${LIBCOMPATCFLAGS} -MACHINE= ${LIBCOMPAT_MACHINE} -MACHINE_ARCH= ${LIBCOMPAT_MACHINE_ARCH} .endif .endif Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Nov 7 19:13:53 2019 (r354464) +++ head/share/mk/src.opts.mk Thu Nov 7 19:22:51 2019 (r354465) @@ -126,6 +126,7 @@ __DEFAULT_YES_OPTIONS = \ LDNS \ LDNS_UTILS \ LEGACY_CONSOLE \ + LIB32 \ LIBPTHREAD \ LIBTHR \ LLVM_COV \ @@ -356,13 +357,6 @@ BROKEN_OPTIONS+=LLDB __DEFAULT_NO_OPTIONS+=GDB_LIBEXEC .else __DEFAULT_YES_OPTIONS+=GDB_LIBEXEC -.endif -# LIB32 is supported on amd64, mips64, and powerpc64 -.if (${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH:Mmips64*} || \ - ${MACHINE_ARCH} == "powerpc64") -__DEFAULT_YES_OPTIONS+=LIB32 -.else -BROKEN_OPTIONS+=LIB32 .endif # Only doing soft float API stuff on armv6 and armv7 .if ${__T} != "armv6" && ${__T} != "armv7" Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Thu Nov 7 19:13:53 2019 (r354464) +++ head/usr.bin/Makefile Thu Nov 7 19:22:51 2019 (r354465) @@ -226,7 +226,6 @@ SUBDIR.${MK_KDUMP}+= truss SUBDIR.${MK_KERBEROS_SUPPORT}+= compile_et SUBDIR.${MK_LDNS_UTILS}+= drill SUBDIR.${MK_LDNS_UTILS}+= host -SUBDIR.${MK_LIB32}+= ldd32 SUBDIR.${MK_LOCATE}+= locate # XXX msgs? SUBDIR.${MK_MAIL}+= biff From owner-svn-src-head@freebsd.org Thu Nov 7 19:28:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA44C1BE09C; Thu, 7 Nov 2019 19:28:04 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478D2X46sgz4Bm7; Thu, 7 Nov 2019 19:28:04 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E3A61A9DD; Thu, 7 Nov 2019 19:28:04 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7JS46d022858; Thu, 7 Nov 2019 19:28:04 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7JS4mI022857; Thu, 7 Nov 2019 19:28:04 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201911071928.xA7JS4mI022857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 7 Nov 2019 19:28:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354466 - head/lib/msun/src X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/lib/msun/src X-SVN-Commit-Revision: 354466 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 19:28:04 -0000 Author: brooks Date: Thu Nov 7 19:28:03 2019 New Revision: 354466 URL: https://svnweb.freebsd.org/changeset/base/354466 Log: Revert change accidentally included in r354465. Will recommit with a proper commit message shortly. Modified: head/lib/msun/src/k_sincosl.h Modified: head/lib/msun/src/k_sincosl.h ============================================================================== --- head/lib/msun/src/k_sincosl.h Thu Nov 7 19:22:51 2019 (r354465) +++ head/lib/msun/src/k_sincosl.h Thu Nov 7 19:28:03 2019 (r354466) @@ -28,8 +28,8 @@ S1lo = -9.2563760475949941e-18; /* -0x15580000000000. #define C1 ((long double)C1hi + C1lo) #else static const long double -C1 = 0.0416666666666666666136L, /* 0xaaaaaaaaaaaaaa9b.0p-68 */ -S1 = -0.166666666666666666671L; /* -0xaaaaaaaaaaaaaaab.0p-66 */ +C1 = 0.0416666666666666666136L; /* 0xaaaaaaaaaaaaaa9b.0p-68 */ +S1 = -0.166666666666666666671L, /* -0xaaaaaaaaaaaaaaab.0p-66 */ #endif static const double From owner-svn-src-head@freebsd.org Thu Nov 7 19:31:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E9151BE367; Thu, 7 Nov 2019 19:31:57 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478D711SYTz4C4D; Thu, 7 Nov 2019 19:31:57 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16DEC1AB70; Thu, 7 Nov 2019 19:31:57 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7JVuEk025472; Thu, 7 Nov 2019 19:31:56 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7JVuPi025460; Thu, 7 Nov 2019 19:31:56 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201911071931.xA7JVuPi025460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 7 Nov 2019 19:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354467 - head/lib/msun/src X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/lib/msun/src X-SVN-Commit-Revision: 354467 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 19:31:57 -0000 Author: brooks Date: Thu Nov 7 19:31:56 2019 New Revision: 354467 URL: https://svnweb.freebsd.org/changeset/base/354467 Log: Fix declaration of S1 by swapping misplaced ',' and ';'. Reported by: kargl Obtained from: OpenBSD (tb@openbsd.org) MFC after: 1 week Modified: head/lib/msun/src/k_sincosl.h Modified: head/lib/msun/src/k_sincosl.h ============================================================================== --- head/lib/msun/src/k_sincosl.h Thu Nov 7 19:28:03 2019 (r354466) +++ head/lib/msun/src/k_sincosl.h Thu Nov 7 19:31:56 2019 (r354467) @@ -28,8 +28,8 @@ S1lo = -9.2563760475949941e-18; /* -0x15580000000000. #define C1 ((long double)C1hi + C1lo) #else static const long double -C1 = 0.0416666666666666666136L; /* 0xaaaaaaaaaaaaaa9b.0p-68 */ -S1 = -0.166666666666666666671L, /* -0xaaaaaaaaaaaaaaab.0p-66 */ +C1 = 0.0416666666666666666136L, /* 0xaaaaaaaaaaaaaa9b.0p-68 */ +S1 = -0.166666666666666666671L; /* -0xaaaaaaaaaaaaaaab.0p-66 */ #endif static const double From owner-svn-src-head@freebsd.org Thu Nov 7 19:37:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E4E41BE74F; Thu, 7 Nov 2019 19:37:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478DFM0Q7cz4Cpy; Thu, 7 Nov 2019 19:37:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E73D01ABBA; Thu, 7 Nov 2019 19:37:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7JbQXc028702; Thu, 7 Nov 2019 19:37:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7JbQkT028701; Thu, 7 Nov 2019 19:37:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911071937.xA7JbQkT028701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 7 Nov 2019 19:37:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354468 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 354468 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 19:37:27 -0000 Author: emaste Date: Thu Nov 7 19:37:26 2019 New Revision: 354468 URL: https://svnweb.freebsd.org/changeset/base/354468 Log: arch.7: claim 12.x as the last architecture with sparc64 support GCC 4.2.1 is being removed before FreeBSD 13, as are some other components required by FreeBSD/sparc64. Contemporary GCC does not build and there is currently no indication that anyone is going to address these issues. PR: 228919, 233405, 236839, 239851 Modified: head/share/man/man7/arch.7 Modified: head/share/man/man7/arch.7 ============================================================================== --- head/share/man/man7/arch.7 Thu Nov 7 19:31:56 2019 (r354467) +++ head/share/man/man7/arch.7 Thu Nov 7 19:37:26 2019 (r354468) @@ -114,7 +114,7 @@ architectures, the final release. .It powerpc64 Ta 6.0 .It riscv64 Ta 12.0 .It riscv64sf Ta 12.0 -.It sparc64 Ta 5.0 +.It sparc64 Ta 5.0 Ta 12.x .El .Ss Type sizes All From owner-svn-src-head@freebsd.org Thu Nov 7 19:54:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 789981BF101; Thu, 7 Nov 2019 19:54:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478Dck3Nktz4FHF; Thu, 7 Nov 2019 19:54:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57C9E1AF78; Thu, 7 Nov 2019 19:54:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7JsEPp040353; Thu, 7 Nov 2019 19:54:14 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7Js9vs040329; Thu, 7 Nov 2019 19:54:09 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201911071954.xA7Js9vs040329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 7 Nov 2019 19:54:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354469 - in head/contrib/llvm: include/llvm/DebugInfo/DWARF include/llvm/MC lib/DebugInfo/DWARF lib/MC lib/Object lib/Target/RISCV lib/Target/RISCV/AsmParser lib/Target/RISCV/MCTargetD... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head/contrib/llvm: include/llvm/DebugInfo/DWARF include/llvm/MC lib/DebugInfo/DWARF lib/MC lib/Object lib/Target/RISCV lib/Target/RISCV/AsmParser lib/Target/RISCV/MCTargetDesc tools/clang/lib/Basic... X-SVN-Commit-Revision: 354469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 19:54:14 -0000 Author: dim Date: Thu Nov 7 19:54:08 2019 New Revision: 354469 URL: https://svnweb.freebsd.org/changeset/base/354469 Log: Merge commit f596f4507 from llvm git (by Sam Elliott): [RISCV] Add Custom Parser for Atomic Memory Operands Summary: GCC Accepts both (reg) and 0(reg) for atomic instruction memory operands. These instructions do not allow for an offset in their encoding, so in the latter case, the 0 is silently dropped. Due to how we have structured the RISCVAsmParser, the easiest way to add support for parsing this offset is to add a custom AsmOperand and parser. This parser drops all the parens, and just keeps the register. This commit also adds a custom printer for these operands, which matches the GCC canonical printer, printing both `(a0)` and `0(a0)` as `(a0)`. Reviewers: asb, lewis-revill Reviewed By: asb Subscribers: s.egerton, hiraditya, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, jfb, PkmX, jocewei, psnobl, benna, Jim, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65205 llvm-svn: 367553 Merge commit f596f4507 from llvm git (by Sam Elliott): [RISCV] Add FreeBSD targets Reviewers: asb Reviewed By: asb Subscribers: simoncook, s.egerton, lenary, psnobl, benna, mhorne, emaste, kito-cheng, shiva0217, rogfer01, rkruppe, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57795 Patch by James Clarke (jrtc27) llvm-svn: 367557 Merge commit f596f4507 from llvm git (by Hsiangkai Wang): [DebugInfo] Generate fixups as emitting DWARF .debug_frame/.eh_frame. It is necessary to generate fixups in .debug_frame or .eh_frame as relaxation is enabled due to the address delta may be changed after relaxation. There is an opcode with 6-bits data in debug frame encoding. So, we also need 6-bits fixup types. Differential Revision: https://reviews.llvm.org/D58335 llvm-svn: 366524 Merge commit f596f4507 from llvm git (by Hsiangkai Wang): [DebugInfo] Some fields do not need relocations even relax is enabled. In debug frame information, some fields, e.g., Length in CIE/FDE and Offset in FDE are attributes to describe the structure of CIE/FDE. They are not related to the relaxed code. However, these attributes are symbol differences. So, in current design, these attributes will be filled as zero and LLVM generates relocations for them. We only need to generate relocations for symbols in executable sections. So, if the symbols are not located in executable sections, we still evaluate their values under relaxation. Differential Revision: https://reviews.llvm.org/D61584 llvm-svn: 366531 Merge commit f596f4507 from llvm git (by Alex Bradbury): [RISCV] Don't force absolute FK_Data_X fixups to relocs The current behavior of shouldForceRelocation forces relocations for the majority of fixups when relaxation is enabled. This makes sense for fixups which incorporate symbols but is unnecessary for simple data fixups where the fixup target is already resolved to an absolute value. Differential Revision: https://reviews.llvm.org/D63404 Patch by Edward Jones. llvm-svn: 369257 Merge commit f596f4507 from llvm git (by Alex Bradbury): [RISCV] Implement getExprForFDESymbol to ensure RISCV_32_PCREL is used for the FDE location Follow binutils in using RISCV_32_PCREL for the FDE initial location. As explained in the relevant binutils commit , the ADD/SUB pair of relocations is problematic in the presence of linker relaxation. This patch has the same end goal as D64715 but includes test changes and avoids adding a new global VariantKind to MCExpr.h (preferring RISCVMCExpr VKs like the rest of the RISC-V backend). Differential Revision: https://reviews.llvm.org/D66419 llvm-svn: 369375 This series of merges will permit riscv64 kernels and riscv64sf worlds to build with clang instead of gcc (but still using the bfd linker). Requested by: jhb Obtained from: https://github.com/freebsd/freebsd/compare/master...bsdjhb:riscv_clang MFC after: 1 month X-MFC-With: r353358 Modified: head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFObject.h head/contrib/llvm/include/llvm/MC/MCDwarf.h head/contrib/llvm/include/llvm/MC/MCFixup.h head/contrib/llvm/include/llvm/MC/MCFragment.h head/contrib/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp head/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp head/contrib/llvm/lib/MC/MCAsmBackend.cpp head/contrib/llvm/lib/MC/MCAssembler.cpp head/contrib/llvm/lib/MC/MCDwarf.cpp head/contrib/llvm/lib/MC/MCExpr.cpp head/contrib/llvm/lib/Object/RelocationResolver.cpp head/contrib/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.cpp head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.h head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCAsmInfo.cpp head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCAsmInfo.h head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.h head/contrib/llvm/lib/Target/RISCV/RISCVInstrInfoA.td head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.cpp Modified: head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h ============================================================================== --- head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h Thu Nov 7 19:54:08 2019 (r354469) @@ -69,7 +69,7 @@ class CFIProgram { (public) /// starting at *Offset and ending at EndOffset. *Offset is updated /// to EndOffset upon successful parsing, or indicates the offset /// where a problem occurred in case an error is returned. - Error parse(DataExtractor Data, uint32_t *Offset, uint32_t EndOffset); + Error parse(DWARFDataExtractor Data, uint32_t *Offset, uint32_t EndOffset); void dump(raw_ostream &OS, const MCRegisterInfo *MRI, bool IsEH, unsigned IndentLevel = 1) const; Modified: head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFObject.h ============================================================================== --- head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFObject.h Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFObject.h Thu Nov 7 19:54:08 2019 (r354469) @@ -40,8 +40,8 @@ class DWARFObject { (public) virtual const DWARFSection &getLocSection() const { return Dummy; } virtual const DWARFSection &getLoclistsSection() const { return Dummy; } virtual StringRef getARangeSection() const { return ""; } - virtual StringRef getDebugFrameSection() const { return ""; } - virtual StringRef getEHFrameSection() const { return ""; } + virtual const DWARFSection &getDebugFrameSection() const { return Dummy; } + virtual const DWARFSection &getEHFrameSection() const { return Dummy; } virtual const DWARFSection &getLineSection() const { return Dummy; } virtual StringRef getLineStringSection() const { return ""; } virtual StringRef getStringSection() const { return ""; } Modified: head/contrib/llvm/include/llvm/MC/MCDwarf.h ============================================================================== --- head/contrib/llvm/include/llvm/MC/MCDwarf.h Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/include/llvm/MC/MCDwarf.h Thu Nov 7 19:54:08 2019 (r354469) @@ -629,7 +629,8 @@ class MCDwarfFrameEmitter { (public) static void Emit(MCObjectStreamer &streamer, MCAsmBackend *MAB, bool isEH); static void EmitAdvanceLoc(MCObjectStreamer &Streamer, uint64_t AddrDelta); static void EncodeAdvanceLoc(MCContext &Context, uint64_t AddrDelta, - raw_ostream &OS); + raw_ostream &OS, uint32_t *Offset = nullptr, + uint32_t *Size = nullptr); }; } // end namespace llvm Modified: head/contrib/llvm/include/llvm/MC/MCFixup.h ============================================================================== --- head/contrib/llvm/include/llvm/MC/MCFixup.h Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/include/llvm/MC/MCFixup.h Thu Nov 7 19:54:08 2019 (r354469) @@ -20,35 +20,38 @@ class MCExpr; /// Extensible enumeration to represent the type of a fixup. enum MCFixupKind { - FK_NONE = 0, ///< A no-op fixup. - FK_Data_1, ///< A one-byte fixup. - FK_Data_2, ///< A two-byte fixup. - FK_Data_4, ///< A four-byte fixup. - FK_Data_8, ///< A eight-byte fixup. - FK_PCRel_1, ///< A one-byte pc relative fixup. - FK_PCRel_2, ///< A two-byte pc relative fixup. - FK_PCRel_4, ///< A four-byte pc relative fixup. - FK_PCRel_8, ///< A eight-byte pc relative fixup. - FK_GPRel_1, ///< A one-byte gp relative fixup. - FK_GPRel_2, ///< A two-byte gp relative fixup. - FK_GPRel_4, ///< A four-byte gp relative fixup. - FK_GPRel_8, ///< A eight-byte gp relative fixup. - FK_DTPRel_4, ///< A four-byte dtp relative fixup. - FK_DTPRel_8, ///< A eight-byte dtp relative fixup. - FK_TPRel_4, ///< A four-byte tp relative fixup. - FK_TPRel_8, ///< A eight-byte tp relative fixup. - FK_SecRel_1, ///< A one-byte section relative fixup. - FK_SecRel_2, ///< A two-byte section relative fixup. - FK_SecRel_4, ///< A four-byte section relative fixup. - FK_SecRel_8, ///< A eight-byte section relative fixup. - FK_Data_Add_1, ///< A one-byte add fixup. - FK_Data_Add_2, ///< A two-byte add fixup. - FK_Data_Add_4, ///< A four-byte add fixup. - FK_Data_Add_8, ///< A eight-byte add fixup. - FK_Data_Sub_1, ///< A one-byte sub fixup. - FK_Data_Sub_2, ///< A two-byte sub fixup. - FK_Data_Sub_4, ///< A four-byte sub fixup. - FK_Data_Sub_8, ///< A eight-byte sub fixup. + FK_NONE = 0, ///< A no-op fixup. + FK_Data_1, ///< A one-byte fixup. + FK_Data_2, ///< A two-byte fixup. + FK_Data_4, ///< A four-byte fixup. + FK_Data_8, ///< A eight-byte fixup. + FK_Data_6b, ///< A six-bits fixup. + FK_PCRel_1, ///< A one-byte pc relative fixup. + FK_PCRel_2, ///< A two-byte pc relative fixup. + FK_PCRel_4, ///< A four-byte pc relative fixup. + FK_PCRel_8, ///< A eight-byte pc relative fixup. + FK_GPRel_1, ///< A one-byte gp relative fixup. + FK_GPRel_2, ///< A two-byte gp relative fixup. + FK_GPRel_4, ///< A four-byte gp relative fixup. + FK_GPRel_8, ///< A eight-byte gp relative fixup. + FK_DTPRel_4, ///< A four-byte dtp relative fixup. + FK_DTPRel_8, ///< A eight-byte dtp relative fixup. + FK_TPRel_4, ///< A four-byte tp relative fixup. + FK_TPRel_8, ///< A eight-byte tp relative fixup. + FK_SecRel_1, ///< A one-byte section relative fixup. + FK_SecRel_2, ///< A two-byte section relative fixup. + FK_SecRel_4, ///< A four-byte section relative fixup. + FK_SecRel_8, ///< A eight-byte section relative fixup. + FK_Data_Add_1, ///< A one-byte add fixup. + FK_Data_Add_2, ///< A two-byte add fixup. + FK_Data_Add_4, ///< A four-byte add fixup. + FK_Data_Add_8, ///< A eight-byte add fixup. + FK_Data_Add_6b, ///< A six-bits add fixup. + FK_Data_Sub_1, ///< A one-byte sub fixup. + FK_Data_Sub_2, ///< A two-byte sub fixup. + FK_Data_Sub_4, ///< A four-byte sub fixup. + FK_Data_Sub_8, ///< A eight-byte sub fixup. + FK_Data_Sub_6b, ///< A six-bits sub fixup. FirstTargetFixupKind = 128, @@ -129,16 +132,40 @@ class MCFixup { (public) /// Return the generic fixup kind for a value with the given size. It /// is an error to pass an unsupported size. - static MCFixupKind getKindForSize(unsigned Size, bool isPCRel) { + static MCFixupKind getKindForSize(unsigned Size, bool IsPCRel) { switch (Size) { default: llvm_unreachable("Invalid generic fixup size!"); - case 1: return isPCRel ? FK_PCRel_1 : FK_Data_1; - case 2: return isPCRel ? FK_PCRel_2 : FK_Data_2; - case 4: return isPCRel ? FK_PCRel_4 : FK_Data_4; - case 8: return isPCRel ? FK_PCRel_8 : FK_Data_8; + case 1: + return IsPCRel ? FK_PCRel_1 : FK_Data_1; + case 2: + return IsPCRel ? FK_PCRel_2 : FK_Data_2; + case 4: + return IsPCRel ? FK_PCRel_4 : FK_Data_4; + case 8: + return IsPCRel ? FK_PCRel_8 : FK_Data_8; } } + /// Return the generic fixup kind for a value with the given size in bits. + /// It is an error to pass an unsupported size. + static MCFixupKind getKindForSizeInBits(unsigned Size, bool IsPCRel) { + switch (Size) { + default: + llvm_unreachable("Invalid generic fixup size!"); + case 6: + assert(!IsPCRel && "Invalid pc-relative fixup size!"); + return FK_Data_6b; + case 8: + return IsPCRel ? FK_PCRel_1 : FK_Data_1; + case 16: + return IsPCRel ? FK_PCRel_2 : FK_Data_2; + case 32: + return IsPCRel ? FK_PCRel_4 : FK_Data_4; + case 64: + return IsPCRel ? FK_PCRel_8 : FK_Data_8; + } + } + /// Return the generic fixup kind for an addition with a given size. It /// is an error to pass an unsupported size. static MCFixupKind getAddKindForKind(unsigned Kind) { @@ -148,6 +175,7 @@ class MCFixup { (public) case FK_Data_2: return FK_Data_Add_2; case FK_Data_4: return FK_Data_Add_4; case FK_Data_8: return FK_Data_Add_8; + case FK_Data_6b: return FK_Data_Add_6b; } } @@ -160,6 +188,7 @@ class MCFixup { (public) case FK_Data_2: return FK_Data_Sub_2; case FK_Data_4: return FK_Data_Sub_4; case FK_Data_8: return FK_Data_Sub_8; + case FK_Data_6b: return FK_Data_Sub_6b; } } Modified: head/contrib/llvm/include/llvm/MC/MCFragment.h ============================================================================== --- head/contrib/llvm/include/llvm/MC/MCFragment.h Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/include/llvm/MC/MCFragment.h Thu Nov 7 19:54:08 2019 (r354469) @@ -149,6 +149,7 @@ class MCEncodedFragment : public MCFragment { (public) case MCFragment::FT_CompactEncodedInst: case MCFragment::FT_Data: case MCFragment::FT_Dwarf: + case MCFragment::FT_DwarfFrame: return true; } } @@ -232,7 +233,8 @@ class MCEncodedFragmentWithFixups : (public) static bool classof(const MCFragment *F) { MCFragment::FragmentType Kind = F->getKind(); return Kind == MCFragment::FT_Relaxable || Kind == MCFragment::FT_Data || - Kind == MCFragment::FT_CVDefRange || Kind == MCFragment::FT_Dwarf;; + Kind == MCFragment::FT_CVDefRange || Kind == MCFragment::FT_Dwarf || + Kind == MCFragment::FT_DwarfFrame; } }; @@ -543,26 +545,20 @@ class MCDwarfLineAddrFragment : public MCEncodedFragme } }; -class MCDwarfCallFrameFragment : public MCFragment { +class MCDwarfCallFrameFragment : public MCEncodedFragmentWithFixups<8, 1> { /// AddrDelta - The expression for the difference of the two symbols that /// make up the address delta between two .cfi_* dwarf directives. const MCExpr *AddrDelta; - SmallString<8> Contents; - public: MCDwarfCallFrameFragment(const MCExpr &AddrDelta, MCSection *Sec = nullptr) - : MCFragment(FT_DwarfFrame, false, Sec), AddrDelta(&AddrDelta) { - Contents.push_back(0); - } + : MCEncodedFragmentWithFixups<8, 1>(FT_DwarfFrame, false, Sec), + AddrDelta(&AddrDelta) {} /// \name Accessors /// @{ const MCExpr &getAddrDelta() const { return *AddrDelta; } - - SmallString<8> &getContents() { return Contents; } - const SmallString<8> &getContents() const { return Contents; } /// @} Modified: head/contrib/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp ============================================================================== --- head/contrib/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp Thu Nov 7 19:54:08 2019 (r354469) @@ -402,11 +402,11 @@ void DWARFContext::dump( } if (const auto *Off = shouldDump(Explicit, ".debug_frame", DIDT_ID_DebugFrame, - DObj->getDebugFrameSection())) + DObj->getDebugFrameSection().Data)) getDebugFrame()->dump(OS, getRegisterInfo(), *Off); if (const auto *Off = shouldDump(Explicit, ".eh_frame", DIDT_ID_DebugFrame, - DObj->getEHFrameSection())) + DObj->getEHFrameSection().Data)) getEHFrame()->dump(OS, getRegisterInfo(), *Off); if (DumpType & DIDT_DebugMacro) { @@ -766,7 +766,7 @@ const DWARFDebugFrame *DWARFContext::getDebugFrame() { // provides this information). This problem is fixed in DWARFv4 // See this dwarf-discuss discussion for more details: // http://lists.dwarfstd.org/htdig.cgi/dwarf-discuss-dwarfstd.org/2011-December/001173.html - DWARFDataExtractor debugFrameData(DObj->getDebugFrameSection(), + DWARFDataExtractor debugFrameData(*DObj, DObj->getDebugFrameSection(), isLittleEndian(), DObj->getAddressSize()); DebugFrame.reset(new DWARFDebugFrame(getArch(), false /* IsEH */)); DebugFrame->parse(debugFrameData); @@ -777,8 +777,8 @@ const DWARFDebugFrame *DWARFContext::getEHFrame() { if (EHFrame) return EHFrame.get(); - DWARFDataExtractor debugFrameData(DObj->getEHFrameSection(), isLittleEndian(), - DObj->getAddressSize()); + DWARFDataExtractor debugFrameData(*DObj, DObj->getEHFrameSection(), + isLittleEndian(), DObj->getAddressSize()); DebugFrame.reset(new DWARFDebugFrame(getArch(), true /* IsEH */)); DebugFrame->parse(debugFrameData); return DebugFrame.get(); @@ -1385,6 +1385,8 @@ class DWARFObjInMemory final : public DWARFObject { DWARFSectionMap RnglistsSection; DWARFSectionMap StringOffsetSection; DWARFSectionMap LineDWOSection; + DWARFSectionMap DebugFrameSection; + DWARFSectionMap EHFrameSection; DWARFSectionMap LocDWOSection; DWARFSectionMap StringOffsetDWOSection; DWARFSectionMap RangeDWOSection; @@ -1405,6 +1407,8 @@ class DWARFObjInMemory final : public DWARFObject { .Case("debug_loc", &LocSection) .Case("debug_loclists", &LocListsSection) .Case("debug_line", &LineSection) + .Case("debug_frame", &DebugFrameSection) + .Case("eh_frame", &EHFrameSection) .Case("debug_str_offsets", &StringOffsetSection) .Case("debug_ranges", &RangeSection) .Case("debug_rnglists", &RnglistsSection) @@ -1428,8 +1432,6 @@ class DWARFObjInMemory final : public DWARFObject { StringRef AbbrevSection; StringRef ARangeSection; - StringRef DebugFrameSection; - StringRef EHFrameSection; StringRef StringSection; StringRef MacinfoSection; StringRef AbbrevDWOSection; @@ -1449,8 +1451,6 @@ class DWARFObjInMemory final : public DWARFObject { return StringSwitch(Name) .Case("debug_abbrev", &AbbrevSection) .Case("debug_aranges", &ARangeSection) - .Case("debug_frame", &DebugFrameSection) - .Case("eh_frame", &EHFrameSection) .Case("debug_str", &StringSection) .Case("debug_macinfo", &MacinfoSection) .Case("debug_abbrev.dwo", &AbbrevDWOSection) @@ -1747,8 +1747,12 @@ class DWARFObjInMemory final : public DWARFObject { const DWARFSection &getLocSection() const override { return LocSection; } const DWARFSection &getLoclistsSection() const override { return LocListsSection; } StringRef getARangeSection() const override { return ARangeSection; } - StringRef getDebugFrameSection() const override { return DebugFrameSection; } - StringRef getEHFrameSection() const override { return EHFrameSection; } + const DWARFSection &getDebugFrameSection() const override { + return DebugFrameSection; + } + const DWARFSection &getEHFrameSection() const override { + return EHFrameSection; + } const DWARFSection &getLineSection() const override { return LineSection; } StringRef getStringSection() const override { return StringSection; } const DWARFSection &getRangeSection() const override { return RangeSection; } Modified: head/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp ============================================================================== --- head/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp Thu Nov 7 19:54:08 2019 (r354469) @@ -34,10 +34,10 @@ using namespace dwarf; const uint8_t DWARF_CFI_PRIMARY_OPCODE_MASK = 0xc0; const uint8_t DWARF_CFI_PRIMARY_OPERAND_MASK = 0x3f; -Error CFIProgram::parse(DataExtractor Data, uint32_t *Offset, +Error CFIProgram::parse(DWARFDataExtractor Data, uint32_t *Offset, uint32_t EndOffset) { while (*Offset < EndOffset) { - uint8_t Opcode = Data.getU8(Offset); + uint8_t Opcode = Data.getRelocatedValue(1, Offset); // Some instructions have a primary opcode encoded in the top bits. uint8_t Primary = Opcode & DWARF_CFI_PRIMARY_OPCODE_MASK; @@ -74,19 +74,19 @@ Error CFIProgram::parse(DataExtractor Data, uint32_t * break; case DW_CFA_set_loc: // Operands: Address - addInstruction(Opcode, Data.getAddress(Offset)); + addInstruction(Opcode, Data.getRelocatedAddress(Offset)); break; case DW_CFA_advance_loc1: // Operands: 1-byte delta - addInstruction(Opcode, Data.getU8(Offset)); + addInstruction(Opcode, Data.getRelocatedValue(1, Offset)); break; case DW_CFA_advance_loc2: // Operands: 2-byte delta - addInstruction(Opcode, Data.getU16(Offset)); + addInstruction(Opcode, Data.getRelocatedValue(2, Offset)); break; case DW_CFA_advance_loc4: // Operands: 4-byte delta - addInstruction(Opcode, Data.getU32(Offset)); + addInstruction(Opcode, Data.getRelocatedValue(4, Offset)); break; case DW_CFA_restore_extended: case DW_CFA_undefined: @@ -361,7 +361,7 @@ void DWARFDebugFrame::parse(DWARFDataExtractor Data) { uint32_t StartOffset = Offset; bool IsDWARF64 = false; - uint64_t Length = Data.getU32(&Offset); + uint64_t Length = Data.getRelocatedValue(4, &Offset); uint64_t Id; if (Length == UINT32_MAX) { @@ -369,7 +369,7 @@ void DWARFDebugFrame::parse(DWARFDataExtractor Data) { // field being 0xffffffff. Then, the next 64 bits are the actual entry // length. IsDWARF64 = true; - Length = Data.getU64(&Offset); + Length = Data.getRelocatedValue(8, &Offset); } // At this point, Offset points to the next field after Length. @@ -512,8 +512,8 @@ void DWARFDebugFrame::parse(DWARFDataExtractor Data) { ReportError(StartOffset, "Parsing augmentation data at %lx failed"); } } else { - InitialLocation = Data.getAddress(&Offset); - AddressRange = Data.getAddress(&Offset); + InitialLocation = Data.getRelocatedAddress(&Offset); + AddressRange = Data.getRelocatedAddress(&Offset); } Entries.emplace_back(new FDE(StartOffset, Length, CIEPointer, Modified: head/contrib/llvm/lib/MC/MCAsmBackend.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCAsmBackend.cpp Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/lib/MC/MCAsmBackend.cpp Thu Nov 7 19:54:08 2019 (r354469) @@ -73,6 +73,7 @@ const MCFixupKindInfo &MCAsmBackend::getFixupKindInfo( {"FK_Data_2", 0, 16, 0}, {"FK_Data_4", 0, 32, 0}, {"FK_Data_8", 0, 64, 0}, + {"FK_Data_6b", 0, 6, 0}, {"FK_PCRel_1", 0, 8, MCFixupKindInfo::FKF_IsPCRel}, {"FK_PCRel_2", 0, 16, MCFixupKindInfo::FKF_IsPCRel}, {"FK_PCRel_4", 0, 32, MCFixupKindInfo::FKF_IsPCRel}, @@ -93,10 +94,12 @@ const MCFixupKindInfo &MCAsmBackend::getFixupKindInfo( {"FK_Data_Add_2", 0, 16, 0}, {"FK_Data_Add_4", 0, 32, 0}, {"FK_Data_Add_8", 0, 64, 0}, + {"FK_Data_Add_6b", 0, 6, 0}, {"FK_Data_Sub_1", 0, 8, 0}, {"FK_Data_Sub_2", 0, 16, 0}, {"FK_Data_Sub_4", 0, 32, 0}, - {"FK_Data_Sub_8", 0, 64, 0}}; + {"FK_Data_Sub_8", 0, 64, 0}, + {"FK_Data_Sub_6b", 0, 6, 0}}; assert((size_t)Kind <= array_lengthof(Builtins) && "Unknown fixup kind"); return Builtins[Kind]; Modified: head/contrib/llvm/lib/MC/MCAssembler.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCAssembler.cpp Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/lib/MC/MCAssembler.cpp Thu Nov 7 19:54:08 2019 (r354469) @@ -840,6 +840,10 @@ void MCAssembler::layout(MCAsmLayout &Layout) { getBackend().shouldInsertFixupForCodeAlign(*this, Layout, *AF); } continue; + } else if (auto *FragWithFixups = + dyn_cast(&Frag)) { + Fixups = FragWithFixups->getFixups(); + Contents = FragWithFixups->getContents(); } else llvm_unreachable("Unknown fragment with fixups!"); for (const MCFixup &Fixup : Fixups) { @@ -969,13 +973,9 @@ bool MCAssembler::relaxDwarfLineAddr(MCAsmLayout &Layo MCContext &Context = Layout.getAssembler().getContext(); uint64_t OldSize = DF.getContents().size(); int64_t AddrDelta; - bool Abs; - if (getBackend().requiresDiffExpressionRelocations()) - Abs = DF.getAddrDelta().evaluateAsAbsolute(AddrDelta, Layout); - else { - Abs = DF.getAddrDelta().evaluateKnownAbsolute(AddrDelta, Layout); - assert(Abs && "We created a line delta with an invalid expression"); - } + bool Abs = DF.getAddrDelta().evaluateKnownAbsolute(AddrDelta, Layout); + assert(Abs && "We created a line delta with an invalid expression"); + (void)Abs; int64_t LineDelta; LineDelta = DF.getLineDelta(); SmallVectorImpl &Data = DF.getContents(); @@ -983,7 +983,7 @@ bool MCAssembler::relaxDwarfLineAddr(MCAsmLayout &Layo raw_svector_ostream OSE(Data); DF.getFixups().clear(); - if (Abs) { + if (!getBackend().requiresDiffExpressionRelocations()) { MCDwarfLineAddr::Encode(Context, getDWARFLinetableParams(), LineDelta, AddrDelta, OSE); } else { @@ -1017,10 +1017,25 @@ bool MCAssembler::relaxDwarfCallFrameFragment(MCAsmLay bool Abs = DF.getAddrDelta().evaluateKnownAbsolute(AddrDelta, Layout); assert(Abs && "We created call frame with an invalid expression"); (void) Abs; - SmallString<8> &Data = DF.getContents(); + SmallVectorImpl &Data = DF.getContents(); Data.clear(); raw_svector_ostream OSE(Data); - MCDwarfFrameEmitter::EncodeAdvanceLoc(Context, AddrDelta, OSE); + DF.getFixups().clear(); + + if (getBackend().requiresDiffExpressionRelocations()) { + uint32_t Offset; + uint32_t Size; + MCDwarfFrameEmitter::EncodeAdvanceLoc(Context, AddrDelta, OSE, &Offset, + &Size); + if (Size) { + DF.getFixups().push_back(MCFixup::create( + Offset, &DF.getAddrDelta(), + MCFixup::getKindForSizeInBits(Size /*In bits.*/, false /*isPCRel*/))); + } + } else { + MCDwarfFrameEmitter::EncodeAdvanceLoc(Context, AddrDelta, OSE); + } + return OldSize != Data.size(); } Modified: head/contrib/llvm/lib/MC/MCDwarf.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCDwarf.cpp Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/lib/MC/MCDwarf.cpp Thu Nov 7 19:54:08 2019 (r354469) @@ -1897,26 +1897,54 @@ void MCDwarfFrameEmitter::EmitAdvanceLoc(MCObjectStrea } void MCDwarfFrameEmitter::EncodeAdvanceLoc(MCContext &Context, - uint64_t AddrDelta, - raw_ostream &OS) { + uint64_t AddrDelta, raw_ostream &OS, + uint32_t *Offset, uint32_t *Size) { // Scale the address delta by the minimum instruction length. AddrDelta = ScaleAddrDelta(Context, AddrDelta); + bool WithFixups = false; + if (Offset && Size) + WithFixups = true; + support::endianness E = Context.getAsmInfo()->isLittleEndian() ? support::little : support::big; if (AddrDelta == 0) { + if (WithFixups) { + *Offset = 0; + *Size = 0; + } } else if (isUIntN(6, AddrDelta)) { uint8_t Opcode = dwarf::DW_CFA_advance_loc | AddrDelta; - OS << Opcode; + if (WithFixups) { + *Offset = OS.tell(); + *Size = 6; + OS << uint8_t(dwarf::DW_CFA_advance_loc); + } else + OS << Opcode; } else if (isUInt<8>(AddrDelta)) { OS << uint8_t(dwarf::DW_CFA_advance_loc1); - OS << uint8_t(AddrDelta); + if (WithFixups) { + *Offset = OS.tell(); + *Size = 8; + OS.write_zeros(1); + } else + OS << uint8_t(AddrDelta); } else if (isUInt<16>(AddrDelta)) { OS << uint8_t(dwarf::DW_CFA_advance_loc2); - support::endian::write(OS, AddrDelta, E); + if (WithFixups) { + *Offset = OS.tell(); + *Size = 16; + OS.write_zeros(2); + } else + support::endian::write(OS, AddrDelta, E); } else { assert(isUInt<32>(AddrDelta)); OS << uint8_t(dwarf::DW_CFA_advance_loc4); - support::endian::write(OS, AddrDelta, E); + if (WithFixups) { + *Offset = OS.tell(); + *Size = 32; + OS.write_zeros(4); + } else + support::endian::write(OS, AddrDelta, E); } } Modified: head/contrib/llvm/lib/MC/MCExpr.cpp ============================================================================== --- head/contrib/llvm/lib/MC/MCExpr.cpp Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/lib/MC/MCExpr.cpp Thu Nov 7 19:54:08 2019 (r354469) @@ -577,6 +577,24 @@ static void AttemptToFoldSymbolOffsetDifference( A = B = nullptr; } +static bool canFold(const MCAssembler *Asm, const MCSymbolRefExpr *A, + const MCSymbolRefExpr *B, bool InSet) { + if (InSet) + return true; + + if (!Asm->getBackend().requiresDiffExpressionRelocations()) + return true; + + const MCSymbol &CheckSym = A ? A->getSymbol() : B->getSymbol(); + if (!CheckSym.isInSection()) + return true; + + if (!CheckSym.getSection().hasInstructions()) + return true; + + return false; +} + /// Evaluate the result of an add between (conceptually) two MCValues. /// /// This routine conceptually attempts to construct an MCValue: @@ -617,8 +635,7 @@ EvaluateSymbolicAdd(const MCAssembler *Asm, const MCAs // the backend requires this to be emitted as individual relocations, unless // the InSet flag is set to get the current difference anyway (used for // example to calculate symbol sizes). - if (Asm && - (InSet || !Asm->getBackend().requiresDiffExpressionRelocations())) { + if (Asm && canFold(Asm, LHS_A, LHS_B, InSet)) { // First, fold out any differences which are fully resolved. By // reassociating terms in // Result = (LHS_A - LHS_B + LHS_Cst) + (RHS_A - RHS_B + RHS_Cst). Modified: head/contrib/llvm/lib/Object/RelocationResolver.cpp ============================================================================== --- head/contrib/llvm/lib/Object/RelocationResolver.cpp Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/lib/Object/RelocationResolver.cpp Thu Nov 7 19:54:08 2019 (r354469) @@ -335,6 +335,8 @@ static bool supportsRISCV(uint64_t Type) { case ELF::R_RISCV_NONE: case ELF::R_RISCV_32: case ELF::R_RISCV_64: + case ELF::R_RISCV_SET6: + case ELF::R_RISCV_SUB6: case ELF::R_RISCV_ADD8: case ELF::R_RISCV_SUB8: case ELF::R_RISCV_ADD16: @@ -358,6 +360,10 @@ static uint64_t resolveRISCV(RelocationRef R, uint64_t return (S + RA) & 0xFFFFFFFF; case ELF::R_RISCV_64: return S + RA; + case ELF::R_RISCV_SET6: + return (A + (S + RA)) & 0xFF; + case ELF::R_RISCV_SUB6: + return (A - (S + RA)) & 0xFF; case ELF::R_RISCV_ADD8: return (A + (S + RA)) & 0xFF; case ELF::R_RISCV_SUB8: Modified: head/contrib/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp ============================================================================== --- head/contrib/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp Thu Nov 7 19:54:08 2019 (r354469) @@ -127,6 +127,7 @@ class RISCVAsmParser : public MCTargetAsmParser { OperandMatchResultTy parseRegister(OperandVector &Operands, bool AllowParens = false); OperandMatchResultTy parseMemOpBaseReg(OperandVector &Operands); + OperandMatchResultTy parseAtomicMemOp(OperandVector &Operands); OperandMatchResultTy parseOperandWithModifier(OperandVector &Operands); OperandMatchResultTy parseBareSymbol(OperandVector &Operands); OperandMatchResultTy parseCallSymbol(OperandVector &Operands); @@ -575,6 +576,15 @@ struct RISCVOperand : public MCParsedAsmOperand { (pub bool isSImm21Lsb0JAL() const { return isBareSimmNLsb0<21>(); } + bool isImmZero() const { + if (!isImm()) + return false; + int64_t Imm; + RISCVMCExpr::VariantKind VK = RISCVMCExpr::VK_RISCV_None; + bool IsConstantImm = evaluateConstantImm(getImm(), Imm, VK); + return IsConstantImm && (Imm == 0) && VK == RISCVMCExpr::VK_RISCV_None; + } + /// getStartLoc - Gets location of the first token of this operand SMLoc getStartLoc() const override { return StartLoc; } /// getEndLoc - Gets location of the last token of this operand @@ -1296,6 +1306,73 @@ RISCVAsmParser::parseMemOpBaseReg(OperandVector &Opera getParser().Lex(); // Eat ')' Operands.push_back(RISCVOperand::createToken(")", getLoc(), isRV64())); + + return MatchOperand_Success; +} + +OperandMatchResultTy RISCVAsmParser::parseAtomicMemOp(OperandVector &Operands) { + // Atomic operations such as lr.w, sc.w, and amo*.w accept a "memory operand" + // as one of their register operands, such as `(a0)`. This just denotes that + // the register (in this case `a0`) contains a memory address. + // + // Normally, we would be able to parse these by putting the parens into the + // instruction string. However, GNU as also accepts a zero-offset memory + // operand (such as `0(a0)`), and ignores the 0. Normally this would be parsed + // with parseImmediate followed by parseMemOpBaseReg, but these instructions + // do not accept an immediate operand, and we do not want to add a "dummy" + // operand that is silently dropped. + // + // Instead, we use this custom parser. This will: allow (and discard) an + // offset if it is zero; require (and discard) parentheses; and add only the + // parsed register operand to `Operands`. + // + // These operands are printed with RISCVInstPrinter::printAtomicMemOp, which + // will only print the register surrounded by parentheses (which GNU as also + // uses as its canonical representation for these operands). + std::unique_ptr OptionalImmOp; + + if (getLexer().isNot(AsmToken::LParen)) { + // Parse an Integer token. We do not accept arbritrary constant expressions + // in the offset field (because they may include parens, which complicates + // parsing a lot). + int64_t ImmVal; + SMLoc ImmStart = getLoc(); + if (getParser().parseIntToken(ImmVal, + "expected '(' or optional integer offset")) + return MatchOperand_ParseFail; + + // Create a RISCVOperand for checking later (so the error messages are + // nicer), but we don't add it to Operands. + SMLoc ImmEnd = getLoc(); + OptionalImmOp = + RISCVOperand::createImm(MCConstantExpr::create(ImmVal, getContext()), + ImmStart, ImmEnd, isRV64()); + } + + if (getLexer().isNot(AsmToken::LParen)) { + Error(getLoc(), OptionalImmOp ? "expected '(' after optional integer offset" + : "expected '(' or optional integer offset"); + return MatchOperand_ParseFail; + } + getParser().Lex(); // Eat '(' + + if (parseRegister(Operands) != MatchOperand_Success) { + Error(getLoc(), "expected register"); + return MatchOperand_ParseFail; + } + + if (getLexer().isNot(AsmToken::RParen)) { + Error(getLoc(), "expected ')'"); + return MatchOperand_ParseFail; + } + getParser().Lex(); // Eat ')' + + // Deferred Handling of non-zero offsets. This makes the error messages nicer. + if (OptionalImmOp && !OptionalImmOp->isImmZero()) { + Error(OptionalImmOp->getStartLoc(), "optional integer offset must be 0", + SMRange(OptionalImmOp->getStartLoc(), OptionalImmOp->getEndLoc())); + return MatchOperand_ParseFail; + } return MatchOperand_Success; } Modified: head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp ============================================================================== --- head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp Thu Nov 7 19:54:08 2019 (r354469) @@ -33,6 +33,13 @@ bool RISCVAsmBackend::shouldForceRelocation(const MCAs switch ((unsigned)Fixup.getKind()) { default: break; + case FK_Data_1: + case FK_Data_2: + case FK_Data_4: + case FK_Data_8: + if (Target.isAbsolute()) + return false; + break; case RISCV::fixup_riscv_got_hi20: case RISCV::fixup_riscv_tls_got_hi20: case RISCV::fixup_riscv_tls_gd_hi20: @@ -186,6 +193,7 @@ static uint64_t adjustFixupValue(const MCFixup &Fixup, case FK_Data_2: case FK_Data_4: case FK_Data_8: + case FK_Data_6b: return Value; case RISCV::fixup_riscv_lo12_i: case RISCV::fixup_riscv_pcrel_lo12_i: Modified: head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp ============================================================================== --- head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp Thu Nov 7 19:54:08 2019 (r354469) @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// #include "MCTargetDesc/RISCVFixupKinds.h" +#include "MCTargetDesc/RISCVMCExpr.h" #include "MCTargetDesc/RISCVMCTargetDesc.h" #include "llvm/MC/MCELFObjectWriter.h" #include "llvm/MC/MCFixup.h" @@ -47,6 +48,7 @@ unsigned RISCVELFObjectWriter::getRelocType(MCContext const MCValue &Target, const MCFixup &Fixup, bool IsPCRel) const { + const MCExpr *Expr = Fixup.getValue(); // Determine the type of the relocation unsigned Kind = Fixup.getKind(); if (IsPCRel) { @@ -87,6 +89,9 @@ unsigned RISCVELFObjectWriter::getRelocType(MCContext default: llvm_unreachable("invalid fixup kind!"); case FK_Data_4: + if (Expr->getKind() == MCExpr::Target && + cast(Expr)->getKind() == RISCVMCExpr::VK_RISCV_32_PCREL) + return ELF::R_RISCV_32_PCREL; return ELF::R_RISCV_32; case FK_Data_8: return ELF::R_RISCV_64; @@ -98,6 +103,8 @@ unsigned RISCVELFObjectWriter::getRelocType(MCContext return ELF::R_RISCV_ADD32; case FK_Data_Add_8: return ELF::R_RISCV_ADD64; + case FK_Data_Add_6b: + return ELF::R_RISCV_SET6; case FK_Data_Sub_1: return ELF::R_RISCV_SUB8; case FK_Data_Sub_2: @@ -106,6 +113,8 @@ unsigned RISCVELFObjectWriter::getRelocType(MCContext return ELF::R_RISCV_SUB32; case FK_Data_Sub_8: return ELF::R_RISCV_SUB64; + case FK_Data_Sub_6b: + return ELF::R_RISCV_SUB6; case RISCV::fixup_riscv_hi20: return ELF::R_RISCV_HI20; case RISCV::fixup_riscv_lo12_i: Modified: head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.cpp ============================================================================== --- head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.cpp Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.cpp Thu Nov 7 19:54:08 2019 (r354469) @@ -112,3 +112,15 @@ void RISCVInstPrinter::printFRMArg(const MCInst *MI, u static_cast(MI->getOperand(OpNo).getImm()); O << RISCVFPRndMode::roundingModeToString(FRMArg); } + +void RISCVInstPrinter::printAtomicMemOp(const MCInst *MI, unsigned OpNo, + const MCSubtargetInfo &STI, + raw_ostream &O) { + const MCOperand &MO = MI->getOperand(OpNo); + + assert(MO.isReg() && "printAtomicMemOp can only print register operands"); + O << "("; + printRegName(O, MO.getReg()); + O << ")"; + return; +} Modified: head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.h ============================================================================== --- head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.h Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.h Thu Nov 7 19:54:08 2019 (r354469) @@ -37,6 +37,8 @@ class RISCVInstPrinter : public MCInstPrinter { (publi const MCSubtargetInfo &STI, raw_ostream &O); void printFRMArg(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI, raw_ostream &O); + void printAtomicMemOp(const MCInst *MI, unsigned OpNo, + const MCSubtargetInfo &STI, raw_ostream &O); // Autogenerated by tblgen. void printInstruction(const MCInst *MI, const MCSubtargetInfo &STI, Modified: head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCAsmInfo.cpp ============================================================================== --- head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCAsmInfo.cpp Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCAsmInfo.cpp Thu Nov 7 19:54:08 2019 (r354469) @@ -11,7 +11,10 @@ //===----------------------------------------------------------------------===// #include "RISCVMCAsmInfo.h" +#include "MCTargetDesc/RISCVMCExpr.h" #include "llvm/ADT/Triple.h" +#include "llvm/BinaryFormat/Dwarf.h" +#include "llvm/MC/MCStreamer.h" using namespace llvm; void RISCVMCAsmInfo::anchor() {} @@ -24,4 +27,21 @@ RISCVMCAsmInfo::RISCVMCAsmInfo(const Triple &TT) { ExceptionsType = ExceptionHandling::DwarfCFI; Data16bitsDirective = "\t.half\t"; Data32bitsDirective = "\t.word\t"; +} + +const MCExpr *RISCVMCAsmInfo::getExprForFDESymbol(const MCSymbol *Sym, + unsigned Encoding, + MCStreamer &Streamer) const { + if (!(Encoding & dwarf::DW_EH_PE_pcrel)) + return MCAsmInfo::getExprForFDESymbol(Sym, Encoding, Streamer); + + // The default symbol subtraction results in an ADD/SUB relocation pair. + // Processing this relocation pair is problematic when linker relaxation is + // enabled, so we follow binutils in using the R_RISCV_32_PCREL relocation + // for the FDE initial location. + MCContext &Ctx = Streamer.getContext(); + const MCExpr *ME = + MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_None, Ctx); + assert(Encoding & dwarf::DW_EH_PE_sdata4 && "Unexpected encoding"); + return RISCVMCExpr::create(ME, RISCVMCExpr::VK_RISCV_32_PCREL, Ctx); } Modified: head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCAsmInfo.h ============================================================================== --- head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCAsmInfo.h Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCAsmInfo.h Thu Nov 7 19:54:08 2019 (r354469) @@ -23,6 +23,9 @@ class RISCVMCAsmInfo : public MCAsmInfoELF { public: explicit RISCVMCAsmInfo(const Triple &TargetTriple); + + const MCExpr *getExprForFDESymbol(const MCSymbol *Sym, unsigned Encoding, + MCStreamer &Streamer) const override; }; } // namespace llvm Modified: head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp ============================================================================== --- head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp Thu Nov 7 19:54:08 2019 (r354469) @@ -266,6 +266,7 @@ unsigned RISCVMCCodeEmitter::getImmOpValue(const MCIns switch (RVExpr->getKind()) { case RISCVMCExpr::VK_RISCV_None: case RISCVMCExpr::VK_RISCV_Invalid: + case RISCVMCExpr::VK_RISCV_32_PCREL: llvm_unreachable("Unhandled fixup kind!"); case RISCVMCExpr::VK_RISCV_TPREL_ADD: // tprel_add is only used to indicate that a relocation should be emitted Modified: head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.h ============================================================================== --- head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.h Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.h Thu Nov 7 19:54:08 2019 (r354469) @@ -36,6 +36,7 @@ class RISCVMCExpr : public MCTargetExpr { (public) VK_RISCV_TLS_GD_HI, VK_RISCV_CALL, VK_RISCV_CALL_PLT, + VK_RISCV_32_PCREL, VK_RISCV_Invalid }; Modified: head/contrib/llvm/lib/Target/RISCV/RISCVInstrInfoA.td ============================================================================== --- head/contrib/llvm/lib/Target/RISCV/RISCVInstrInfoA.td Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/lib/Target/RISCV/RISCVInstrInfoA.td Thu Nov 7 19:54:08 2019 (r354469) @@ -12,14 +12,32 @@ //===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===// +// Operand and SDNode transformation definitions. +//===----------------------------------------------------------------------===// + +// A parse method for (${gpr}) or 0(${gpr}), where the 0 is be silently ignored. +// Used for GNU as Compatibility. +def AtomicMemOpOperand : AsmOperandClass { + let Name = "AtomicMemOpOperand"; + let RenderMethod = "addRegOperands"; + let PredicateMethod = "isReg"; + let ParserMethod = "parseAtomicMemOp"; +} + +def GPRMemAtomic : RegisterOperand { + let ParserMatchClass = AtomicMemOpOperand; + let PrintMethod = "printAtomicMemOp"; +} + +//===----------------------------------------------------------------------===// // Instruction class templates //===----------------------------------------------------------------------===// let hasSideEffects = 0, mayLoad = 1, mayStore = 0 in class LR_r funct3, string opcodestr> : RVInstRAtomic<0b00010, aq, rl, funct3, OPC_AMO, - (outs GPR:$rd), (ins GPR:$rs1), - opcodestr, "$rd, (${rs1})"> { + (outs GPR:$rd), (ins GPRMemAtomic:$rs1), + opcodestr, "$rd, $rs1"> { let rs2 = 0; } @@ -33,8 +51,8 @@ multiclass LR_r_aq_rl funct3, string opcodestr let hasSideEffects = 0, mayLoad = 1, mayStore = 1 in class AMO_rr funct5, bit aq, bit rl, bits<3> funct3, string opcodestr> : RVInstRAtomic; + (outs GPR:$rd), (ins GPRMemAtomic:$rs1, GPR:$rs2), + opcodestr, "$rd, $rs2, $rs1">; multiclass AMO_rr_aq_rl funct5, bits<3> funct3, string opcodestr> { def "" : AMO_rr; Modified: head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Thu Nov 7 19:54:08 2019 (r354469) @@ -363,15 +363,26 @@ TargetInfo *AllocateTarget(const llvm::Triple &Triple, return new AMDGPUTargetInfo(Triple, Opts); case llvm::Triple::riscv32: - // TODO: add cases for FreeBSD, NetBSD, RTEMS once tested. - if (os == llvm::Triple::Linux) + // TODO: add cases for NetBSD, RTEMS once tested. + switch (os) { + case llvm::Triple::FreeBSD: + return new FreeBSDTargetInfo(Triple, Opts); + case llvm::Triple::Linux: return new LinuxTargetInfo(Triple, Opts); - return new RISCV32TargetInfo(Triple, Opts); + default: + return new RISCV32TargetInfo(Triple, Opts); + } + case llvm::Triple::riscv64: - // TODO: add cases for FreeBSD, NetBSD, RTEMS once tested. - if (os == llvm::Triple::Linux) + // TODO: add cases for NetBSD, RTEMS once tested. + switch (os) { + case llvm::Triple::FreeBSD: + return new FreeBSDTargetInfo(Triple, Opts); + case llvm::Triple::Linux: return new LinuxTargetInfo(Triple, Opts); - return new RISCV64TargetInfo(Triple, Opts); + default: + return new RISCV64TargetInfo(Triple, Opts); + } case llvm::Triple::sparc: switch (os) { Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.cpp Thu Nov 7 19:37:26 2019 (r354468) +++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains/FreeBSD.cpp Thu Nov 7 19:54:08 2019 (r354469) @@ -197,6 +197,14 @@ void freebsd::Linker::ConstructJob(Compilation &C, con else CmdArgs.push_back("elf64ltsmip_fbsd"); break; + case llvm::Triple::riscv32: + CmdArgs.push_back("-m"); + CmdArgs.push_back("elf32lriscv"); + break; + case llvm::Triple::riscv64: + CmdArgs.push_back("-m"); + CmdArgs.push_back("elf64lriscv"); + break; default: break; } From owner-svn-src-head@freebsd.org Thu Nov 7 19:54:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79F141BF183; Thu, 7 Nov 2019 19:54:25 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478Dcx1xK1z4FPw; Thu, 7 Nov 2019 19:54:25 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25E7B1AF79; Thu, 7 Nov 2019 19:54:25 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7JsP8K040403; Thu, 7 Nov 2019 19:54:25 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7JsOUc040399; Thu, 7 Nov 2019 19:54:24 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201911071954.xA7JsOUc040399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Thu, 7 Nov 2019 19:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354470 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 354470 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 19:54:25 -0000 Author: gallatin Date: Thu Nov 7 19:54:24 2019 New Revision: 354470 URL: https://svnweb.freebsd.org/changeset/base/354470 Log: hwpmc : fix AMD perf counter MSR access - amd_intr() does not account for the offset (0x200) in the counter MSR address and ends up accessing invalid regions while reading counter value after the 4th counter (0xC001000[8,9,..]) and erroneously updates the counter values for counters [1-4]. - amd_intr() should only check core pmcs for interrupts since other types of pmcs (L3,DF) cannot generate interrupts. - fix pmc NMI's being ignored due to NMI latency on newer AMD processors Note that this fixes a kernel panic due to GPFs accessing MSRs on higher core count AMD cpus (seen on both Rome 7502P, and Threadripper 2990WX 32-core CPUs) Discussed with: markj Submitted by: Shreyank Amartya Differential Revision: https://reviews.freebsd.org/D21553 Modified: head/sys/dev/hwpmc/hwpmc_amd.c head/sys/dev/hwpmc/hwpmc_amd.h Modified: head/sys/dev/hwpmc/hwpmc_amd.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_amd.c Thu Nov 7 19:54:08 2019 (r354469) +++ head/sys/dev/hwpmc/hwpmc_amd.c Thu Nov 7 19:54:24 2019 (r354470) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -53,6 +54,10 @@ __FBSDID("$FreeBSD$"); enum pmc_class amd_pmc_class; #endif +#define OVERFLOW_WAIT_COUNT 50 + +DPCPU_DEFINE_STATIC(uint32_t, nmi_counter); + /* AMD K7 & K8 PMCs */ struct amd_descr { struct pmc_descr pm_descr; /* "base class" */ @@ -739,6 +744,7 @@ amd_stop_pmc(int cpu, int ri) struct pmc_hw *phw; const struct amd_descr *pd; uint64_t config; + int i; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), ("[amd,%d] illegal CPU value %d", __LINE__, cpu)); @@ -761,6 +767,21 @@ amd_stop_pmc(int cpu, int ri) /* turn off the PMC ENABLE bit */ config = pm->pm_md.pm_amd.pm_amd_evsel & ~AMD_PMC_ENABLE; wrmsr(pd->pm_evsel, config); + + /* + * Due to NMI latency on newer AMD processors + * NMI interrupts are ignored, which leads to + * panic or messages based on kernel configuraiton + */ + + /* Wait for the count to be reset */ + for (i = 0; i < OVERFLOW_WAIT_COUNT; i++) { + if (rdmsr(pd->pm_perfctr) & (1 << (pd->pm_descr.pd_width - 1))) + break; + + DELAY(1); + } + return 0; } @@ -779,6 +800,7 @@ amd_intr(struct trapframe *tf) struct pmc *pm; struct amd_cpu *pac; pmc_value_t v; + uint32_t active = 0, count = 0; cpu = curcpu; KASSERT(cpu >= 0 && cpu < pmc_cpu_max(), @@ -798,19 +820,21 @@ amd_intr(struct trapframe *tf) * * If found, we call a helper to process the interrupt. * - * If multiple PMCs interrupt at the same time, the AMD64 - * processor appears to deliver as many NMIs as there are - * outstanding PMC interrupts. So we process only one NMI - * interrupt at a time. + * PMCs interrupting at the same time are collapsed into + * a single interrupt. Check all the valid pmcs for + * overflow. */ - for (i = 0; retval == 0 && i < AMD_NPMCS; i++) { + for (i = 0; i < AMD_CORE_NPMCS; i++) { if ((pm = pac->pc_amdpmcs[i].phw_pmc) == NULL || !PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) { continue; } + /* Consider pmc with valid handle as active */ + active++; + if (!AMD_PMC_HAS_OVERFLOWED(i)) continue; @@ -820,8 +844,8 @@ amd_intr(struct trapframe *tf) continue; /* Stop the PMC, reload count. */ - evsel = AMD_PMC_EVSEL_0 + i; - perfctr = AMD_PMC_PERFCTR_0 + i; + evsel = amd_pmcdesc[i].pm_evsel; + perfctr = amd_pmcdesc[i].pm_perfctr; v = pm->pm_sc.pm_reloadcount; config = rdmsr(evsel); @@ -837,6 +861,26 @@ amd_intr(struct trapframe *tf) error = pmc_process_interrupt(PMC_HR, pm, tf); if (error == 0) wrmsr(evsel, config); + } + + /* + * Due to NMI latency, there can be a scenario in which + * multiple pmcs gets serviced in an earlier NMI and we + * do not find an overflow in the subsequent NMI. + * + * For such cases we keep a per-cpu count of active NMIs + * and compare it with min(active pmcs, 2) to determine + * if this NMI was for a pmc overflow which was serviced + * in an earlier request or should be ignored. + */ + + if (retval) { + DPCPU_SET(nmi_counter, min(2, active)); + } else { + if ((count = DPCPU_GET(nmi_counter))) { + retval = 1; + DPCPU_SET(nmi_counter, --count); + } } if (retval) Modified: head/sys/dev/hwpmc/hwpmc_amd.h ============================================================================== --- head/sys/dev/hwpmc/hwpmc_amd.h Thu Nov 7 19:54:08 2019 (r354469) +++ head/sys/dev/hwpmc/hwpmc_amd.h Thu Nov 7 19:54:24 2019 (r354470) @@ -76,6 +76,7 @@ #define AMD_PMC_PERFCTR_EP_DF_3 0xC0010247 #define AMD_NPMCS 16 +#define AMD_CORE_NPMCS 6 #define AMD_PMC_COUNTERMASK 0xFF000000 From owner-svn-src-head@freebsd.org Thu Nov 7 20:38:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 949181781E2; Thu, 7 Nov 2019 20:38:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478FcG3T1Qz4J4K; Thu, 7 Nov 2019 20:38:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 567461B6AB; Thu, 7 Nov 2019 20:38:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7Kcs3M066506; Thu, 7 Nov 2019 20:38:54 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7Kcs5h066505; Thu, 7 Nov 2019 20:38:54 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911072038.xA7Kcs5h066505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Nov 2019 20:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354473 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 354473 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 20:38:54 -0000 Author: glebius Date: Thu Nov 7 20:38:53 2019 New Revision: 354473 URL: https://svnweb.freebsd.org/changeset/base/354473 Log: Remove unnecessary recursive epoch enter via INP_INFO_RLOCK macro in udp6_input(). It shall always run in the network epoch. Modified: head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Thu Nov 7 20:11:53 2019 (r354472) +++ head/sys/netinet6/udp6_usrreq.c Thu Nov 7 20:38:53 2019 (r354473) @@ -214,12 +214,13 @@ udp6_input(struct mbuf **mp, int *offp, int proto) int off = *offp; int cscov_partial; int plen, ulen; - struct epoch_tracker et; struct sockaddr_in6 fromsa[2]; struct m_tag *fwd_tag; uint16_t uh_sum; uint8_t nxt; + NET_EPOCH_ASSERT(); + ifp = m->m_pkthdr.rcvif; #ifndef PULLDOWN_TEST @@ -301,7 +302,6 @@ udp6_input(struct mbuf **mp, int *offp, int proto) struct inpcbhead *pcblist; struct ip6_moptions *imo; - INP_INFO_RLOCK_ET(pcbinfo, et); /* * In the event that laddr should be set to the link-local * address (this happens in RIPng), the multicast address @@ -395,7 +395,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto) UDP_PROBE(receive, NULL, last, ip6, last, uh); if (udp6_append(last, n, off, fromsa)) - goto inp_lost; + return (IPPROTO_DONE); } INP_RUNLOCK(last); } @@ -422,7 +422,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto) */ UDPSTAT_INC(udps_noport); UDPSTAT_INC(udps_noportmcast); - goto badheadlocked; + goto badunlocked; } INP_RLOCK(last); if (__predict_true(last->inp_flags2 & INP_FREED) == 0) { @@ -434,8 +434,6 @@ udp6_input(struct mbuf **mp, int *offp, int proto) INP_RUNLOCK(last); } else INP_RUNLOCK(last); - inp_lost: - INP_INFO_RUNLOCK_ET(pcbinfo, et); return (IPPROTO_DONE); } /* @@ -522,8 +520,6 @@ udp6_input(struct mbuf **mp, int *offp, int proto) INP_RUNLOCK(inp); return (IPPROTO_DONE); -badheadlocked: - INP_INFO_RUNLOCK_ET(pcbinfo, et); badunlocked: if (m) m_freem(m); From owner-svn-src-head@freebsd.org Thu Nov 7 20:40:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1C2D1782A8; Thu, 7 Nov 2019 20:40:45 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478FfP5GWQz4JCv; Thu, 7 Nov 2019 20:40:45 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98D891B6BD; Thu, 7 Nov 2019 20:40:45 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7KejWu066693; Thu, 7 Nov 2019 20:40:45 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7KejRL066692; Thu, 7 Nov 2019 20:40:45 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911072040.xA7KejRL066692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Nov 2019 20:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354474 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 354474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 20:40:45 -0000 Author: glebius Date: Thu Nov 7 20:40:44 2019 New Revision: 354474 URL: https://svnweb.freebsd.org/changeset/base/354474 Log: Remove unnecessary recursive epoch enter via INP_INFO_RLOCK macro in raw input functions for IPv4 and IPv6. They shall always run in the network epoch. Modified: head/sys/netinet/raw_ip.c head/sys/netinet6/raw_ip6.c Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Thu Nov 7 20:38:53 2019 (r354473) +++ head/sys/netinet/raw_ip.c Thu Nov 7 20:40:44 2019 (r354474) @@ -284,9 +284,10 @@ rip_input(struct mbuf **mp, int *offp, int proto) struct ip *ip = mtod(m, struct ip *); struct inpcb *inp, *last; struct sockaddr_in ripsrc; - struct epoch_tracker et; int hash; + NET_EPOCH_ASSERT(); + *mp = NULL; bzero(&ripsrc, sizeof(ripsrc)); @@ -299,7 +300,6 @@ rip_input(struct mbuf **mp, int *offp, int proto) hash = INP_PCBHASH_RAW(proto, ip->ip_src.s_addr, ip->ip_dst.s_addr, V_ripcbinfo.ipi_hashmask); - INP_INFO_RLOCK_ET(&V_ripcbinfo, et); CK_LIST_FOREACH(inp, &V_ripcbinfo.ipi_hashbase[hash], inp_hash) { if (inp->inp_ip_p != proto) continue; @@ -422,7 +422,6 @@ rip_input(struct mbuf **mp, int *offp, int proto) skip_2: INP_RUNLOCK(inp); } - INP_INFO_RUNLOCK_ET(&V_ripcbinfo, et); if (last != NULL) { if (rip_append(last, ip, m, &ripsrc) != 0) IPSTAT_INC(ips_delivered); Modified: head/sys/netinet6/raw_ip6.c ============================================================================== --- head/sys/netinet6/raw_ip6.c Thu Nov 7 20:38:53 2019 (r354473) +++ head/sys/netinet6/raw_ip6.c Thu Nov 7 20:40:44 2019 (r354474) @@ -165,15 +165,15 @@ rip6_input(struct mbuf **mp, int *offp, int proto) struct inpcb *last = NULL; struct mbuf *opts = NULL; struct sockaddr_in6 fromsa; - struct epoch_tracker et; + NET_EPOCH_ASSERT(); + RIP6STAT_INC(rip6s_ipackets); init_sin6(&fromsa, m, 0); /* general init */ ifp = m->m_pkthdr.rcvif; - INP_INFO_RLOCK_ET(&V_ripcbinfo, et); CK_LIST_FOREACH(inp, &V_ripcb, inp_list) { /* XXX inp locking */ if ((inp->inp_vflag & INP_IPV6) == 0) @@ -303,7 +303,6 @@ rip6_input(struct mbuf **mp, int *offp, int proto) skip_2: INP_RUNLOCK(inp); } - INP_INFO_RUNLOCK_ET(&V_ripcbinfo, et); #if defined(IPSEC) || defined(IPSEC_SUPPORT) /* * Check AH/ESP integrity. From owner-svn-src-head@freebsd.org Thu Nov 7 20:43:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 169CB1784BA; Thu, 7 Nov 2019 20:43:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478FjD6rVvz4JZy; Thu, 7 Nov 2019 20:43:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE60C1B87A; Thu, 7 Nov 2019 20:43:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7KhC18072005; Thu, 7 Nov 2019 20:43:12 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7KhCYl072004; Thu, 7 Nov 2019 20:43:12 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911072043.xA7KhCYl072004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Nov 2019 20:43:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354475 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 354475 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 20:43:13 -0000 Author: glebius Date: Thu Nov 7 20:43:12 2019 New Revision: 354475 URL: https://svnweb.freebsd.org/changeset/base/354475 Log: Remove unnecessary recursive epoch enter via INP_INFO_RLOCK macro in icmp6_rip6_input(). It shall always run in the network epoch. Modified: head/sys/netinet6/icmp6.c Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Thu Nov 7 20:40:44 2019 (r354474) +++ head/sys/netinet6/icmp6.c Thu Nov 7 20:43:12 2019 (r354475) @@ -1893,9 +1893,10 @@ icmp6_rip6_input(struct mbuf **mp, int off) struct inpcb *last = NULL; struct sockaddr_in6 fromsa; struct icmp6_hdr *icmp6; - struct epoch_tracker et; struct mbuf *opts = NULL; + NET_EPOCH_ASSERT(); + #ifndef PULLDOWN_TEST /* this is assumed to be safe. */ icmp6 = (struct icmp6_hdr *)((caddr_t)ip6 + off); @@ -1920,7 +1921,6 @@ icmp6_rip6_input(struct mbuf **mp, int off) return (IPPROTO_DONE); } - INP_INFO_RLOCK_ET(&V_ripcbinfo, et); CK_LIST_FOREACH(inp, &V_ripcb, inp_list) { if ((inp->inp_vflag & INP_IPV6) == 0) continue; @@ -2002,7 +2002,6 @@ icmp6_rip6_input(struct mbuf **mp, int off) } last = inp; } - INP_INFO_RUNLOCK_ET(&V_ripcbinfo, et); if (last != NULL) { if (last->inp_flags & INP_CONTROLOPTS) ip6_savecontrol(last, m, &opts); From owner-svn-src-head@freebsd.org Thu Nov 7 20:44:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BEA90178545; Thu, 7 Nov 2019 20:44:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478Fkp4ctDz4Jjt; Thu, 7 Nov 2019 20:44:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81C691B87C; Thu, 7 Nov 2019 20:44:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7KiYYZ072131; Thu, 7 Nov 2019 20:44:34 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7KiYnn072130; Thu, 7 Nov 2019 20:44:34 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911072044.xA7KiYnn072130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Nov 2019 20:44:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354476 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 354476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 20:44:34 -0000 Author: glebius Date: Thu Nov 7 20:44:34 2019 New Revision: 354476 URL: https://svnweb.freebsd.org/changeset/base/354476 Log: Remove unnecessary recursive epoch enter via INP_INFO_RLOCK macro in divert_packet(). This function is called only from pfil(9) filters, which in their place always run in the network epoch. Modified: head/sys/netinet/ip_divert.c Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Thu Nov 7 20:43:12 2019 (r354475) +++ head/sys/netinet/ip_divert.c Thu Nov 7 20:44:34 2019 (r354476) @@ -192,8 +192,9 @@ divert_packet(struct mbuf *m, bool incoming) u_int16_t nport; struct sockaddr_in divsrc; struct m_tag *mtag; - struct epoch_tracker et; + NET_EPOCH_ASSERT(); + mtag = m_tag_locate(m, MTAG_IPFW_RULE, 0, NULL); if (mtag == NULL) { m_freem(m); @@ -231,7 +232,6 @@ divert_packet(struct mbuf *m, bool incoming) /* Sanity check */ M_ASSERTPKTHDR(m); - NET_EPOCH_ASSERT(); /* Find IP address for receive interface */ ifp = m->m_pkthdr.rcvif; @@ -272,7 +272,6 @@ divert_packet(struct mbuf *m, bool incoming) /* Put packet on socket queue, if any */ sa = NULL; nport = htons((u_int16_t)(((struct ipfw_rule_ref *)(mtag+1))->info)); - INP_INFO_RLOCK_ET(&V_divcbinfo, et); CK_LIST_FOREACH(inp, &V_divcb, inp_list) { /* XXX why does only one socket match? */ if (inp->inp_lport == nport) { @@ -290,7 +289,6 @@ divert_packet(struct mbuf *m, bool incoming) break; } } - INP_INFO_RUNLOCK_ET(&V_divcbinfo, et); if (sa == NULL) { m_freem(m); KMOD_IPSTAT_INC(ips_noproto); From owner-svn-src-head@freebsd.org Thu Nov 7 20:49:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0E0A178767; Thu, 7 Nov 2019 20:49:57 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478Fs15lDWz4K2j; Thu, 7 Nov 2019 20:49:57 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A855C1B885; Thu, 7 Nov 2019 20:49:57 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7Knv1k072526; Thu, 7 Nov 2019 20:49:57 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7Knu4I072521; Thu, 7 Nov 2019 20:49:56 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911072049.xA7Knu4I072521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Nov 2019 20:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354477 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 354477 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 20:49:57 -0000 Author: glebius Date: Thu Nov 7 20:49:56 2019 New Revision: 354477 URL: https://svnweb.freebsd.org/changeset/base/354477 Log: Since r353292 on input path we are always in network epoch, when we lookup PCBs. Thus, do not enter epoch recursively in in_pcblookup_hash() and in6_pcblookup_hash(). Same applies to tcp_ctlinput() and tcp6_ctlinput(). This leaves several sysctl(9) handlers that return PCB credentials unprotected. Add epoch enter/exit to all of them. Differential Revision: https://reviews.freebsd.org/D22197 Modified: head/sys/netinet/in_pcb.c head/sys/netinet/tcp_subr.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Thu Nov 7 20:44:34 2019 (r354476) +++ head/sys/netinet/in_pcb.c Thu Nov 7 20:49:56 2019 (r354477) @@ -2252,12 +2252,10 @@ in_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, st struct inpcb *inp, *tmpinp; u_short fport = fport_arg, lport = lport_arg; -#ifdef INVARIANTS KASSERT((lookupflags & ~(INPLOOKUP_WILDCARD)) == 0, ("%s: invalid lookup flags %d", __func__, lookupflags)); - if (!mtx_owned(&pcbinfo->ipi_hash_lock)) - MPASS(in_epoch_verbose(net_epoch_preempt, 1)); -#endif + INP_HASH_LOCK_ASSERT(pcbinfo); + /* * First look for an exact match. */ @@ -2384,7 +2382,6 @@ in_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in { struct inpcb *inp; - INP_HASH_RLOCK(pcbinfo); inp = in_pcblookup_hash_locked(pcbinfo, faddr, fport, laddr, lport, (lookupflags & ~(INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB)), ifp); if (inp != NULL) { @@ -2411,7 +2408,7 @@ in_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in } #endif } - INP_HASH_RUNLOCK(pcbinfo); + return (inp); } Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Nov 7 20:44:34 2019 (r354476) +++ head/sys/netinet/tcp_subr.c Thu Nov 7 20:49:56 2019 (r354477) @@ -2257,6 +2257,7 @@ tcp_getcred(SYSCTL_HANDLER_ARGS) { struct xucred xuc; struct sockaddr_in addrs[2]; + struct epoch_tracker et; struct inpcb *inp; int error; @@ -2266,8 +2267,10 @@ tcp_getcred(SYSCTL_HANDLER_ARGS) error = SYSCTL_IN(req, addrs, sizeof(addrs)); if (error) return (error); + NET_EPOCH_ENTER(et); inp = in_pcblookup(&V_tcbinfo, addrs[1].sin_addr, addrs[1].sin_port, addrs[0].sin_addr, addrs[0].sin_port, INPLOOKUP_RLOCKPCB, NULL); + NET_EPOCH_EXIT(et); if (inp != NULL) { if (inp->inp_socket == NULL) error = ENOENT; @@ -2292,6 +2295,7 @@ SYSCTL_PROC(_net_inet_tcp, OID_AUTO, getcred, static int tcp6_getcred(SYSCTL_HANDLER_ARGS) { + struct epoch_tracker et; struct xucred xuc; struct sockaddr_in6 addrs[2]; struct inpcb *inp; @@ -2319,6 +2323,7 @@ tcp6_getcred(SYSCTL_HANDLER_ARGS) return (EINVAL); } + NET_EPOCH_ENTER(et); #ifdef INET if (mapped == 1) inp = in_pcblookup(&V_tcbinfo, @@ -2332,6 +2337,7 @@ tcp6_getcred(SYSCTL_HANDLER_ARGS) &addrs[1].sin6_addr, addrs[1].sin6_port, &addrs[0].sin6_addr, addrs[0].sin6_port, INPLOOKUP_RLOCKPCB, NULL); + NET_EPOCH_EXIT(et); if (inp != NULL) { if (inp->inp_socket == NULL) error = ENOENT; @@ -2365,7 +2371,6 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, void *vip) struct inpcb *(*notify)(struct inpcb *, int) = tcp_notify; struct icmp *icp; struct in_conninfo inc; - struct epoch_tracker et; tcp_seq icmp_tcp_seq; int mtu; @@ -2397,7 +2402,6 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, void *vip) icp = (struct icmp *)((caddr_t)ip - offsetof(struct icmp, icmp_ip)); th = (struct tcphdr *)((caddr_t)ip + (ip->ip_hl << 2)); - INP_INFO_RLOCK_ET(&V_tcbinfo, et); inp = in_pcblookup(&V_tcbinfo, faddr, th->th_dport, ip->ip_src, th->th_sport, INPLOOKUP_WLOCKPCB, NULL); if (inp != NULL && PRC_IS_REDIRECT(cmd)) { @@ -2462,7 +2466,6 @@ tcp_ctlinput(int cmd, struct sockaddr *sa, void *vip) out: if (inp != NULL) INP_WUNLOCK(inp); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); } #endif /* INET */ @@ -2480,7 +2483,6 @@ tcp6_ctlinput(int cmd, struct sockaddr *sa, void *d) struct ip6ctlparam *ip6cp = NULL; const struct sockaddr_in6 *sa6_src = NULL; struct in_conninfo inc; - struct epoch_tracker et; struct tcp_ports { uint16_t th_sport; uint16_t th_dport; @@ -2542,7 +2544,6 @@ tcp6_ctlinput(int cmd, struct sockaddr *sa, void *d) } bzero(&t_ports, sizeof(struct tcp_ports)); m_copydata(m, off, sizeof(struct tcp_ports), (caddr_t)&t_ports); - INP_INFO_RLOCK_ET(&V_tcbinfo, et); inp = in6_pcblookup(&V_tcbinfo, &ip6->ip6_dst, t_ports.th_dport, &ip6->ip6_src, t_ports.th_sport, INPLOOKUP_WLOCKPCB, NULL); if (inp != NULL && PRC_IS_REDIRECT(cmd)) { @@ -2614,7 +2615,6 @@ tcp6_ctlinput(int cmd, struct sockaddr *sa, void *d) out: if (inp != NULL) INP_WUNLOCK(inp); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); } #endif /* INET6 */ Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Thu Nov 7 20:44:34 2019 (r354476) +++ head/sys/netinet/udp_usrreq.c Thu Nov 7 20:49:56 2019 (r354477) @@ -963,6 +963,7 @@ udp_getcred(SYSCTL_HANDLER_ARGS) { struct xucred xuc; struct sockaddr_in addrs[2]; + struct epoch_tracker et; struct inpcb *inp; int error; @@ -972,9 +973,11 @@ udp_getcred(SYSCTL_HANDLER_ARGS) error = SYSCTL_IN(req, addrs, sizeof(addrs)); if (error) return (error); + NET_EPOCH_ENTER(et); inp = in_pcblookup(&V_udbinfo, addrs[1].sin_addr, addrs[1].sin_port, addrs[0].sin_addr, addrs[0].sin_port, INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB, NULL); + NET_EPOCH_EXIT(et); if (inp != NULL) { INP_RLOCK_ASSERT(inp); if (inp->inp_socket == NULL) Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Thu Nov 7 20:44:34 2019 (r354476) +++ head/sys/netinet6/in6_pcb.c Thu Nov 7 20:49:56 2019 (r354477) @@ -1245,7 +1245,6 @@ in6_pcblookup_hash(struct inpcbinfo *pcbinfo, struct i { struct inpcb *inp; - INP_HASH_RLOCK(pcbinfo); inp = in6_pcblookup_hash_locked(pcbinfo, faddr, fport, laddr, lport, (lookupflags & ~(INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB)), ifp); if (inp != NULL) { @@ -1272,7 +1271,6 @@ in6_pcblookup_hash(struct inpcbinfo *pcbinfo, struct i } #endif } - INP_HASH_RUNLOCK(pcbinfo); return (inp); } Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Thu Nov 7 20:44:34 2019 (r354476) +++ head/sys/netinet6/udp6_usrreq.c Thu Nov 7 20:49:56 2019 (r354477) @@ -634,6 +634,7 @@ udp6_getcred(SYSCTL_HANDLER_ARGS) { struct xucred xuc; struct sockaddr_in6 addrs[2]; + struct epoch_tracker et; struct inpcb *inp; int error; @@ -652,9 +653,11 @@ udp6_getcred(SYSCTL_HANDLER_ARGS) (error = sa6_embedscope(&addrs[1], V_ip6_use_defzone)) != 0) { return (error); } + NET_EPOCH_ENTER(et); inp = in6_pcblookup(&V_udbinfo, &addrs[1].sin6_addr, addrs[1].sin6_port, &addrs[0].sin6_addr, addrs[0].sin6_port, INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB, NULL); + NET_EPOCH_EXIT(et); if (inp != NULL) { INP_RLOCK_ASSERT(inp); if (inp->inp_socket == NULL) From owner-svn-src-head@freebsd.org Thu Nov 7 20:50:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24827178A4D; Thu, 7 Nov 2019 20:50:38 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 478Fsn2ZQbz4KL5; Thu, 7 Nov 2019 20:50:36 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id xA7KoYne059384 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 7 Nov 2019 12:50:35 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id xA7KoYav059383; Thu, 7 Nov 2019 12:50:34 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Thu, 7 Nov 2019 12:50:34 -0800 From: Gleb Smirnoff To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r354477 - in head/sys: netinet netinet6 Message-ID: <20191107205034.GQ2195@FreeBSD.org> References: <201911072049.xA7Knu4I072521@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201911072049.xA7Knu4I072521@repo.freebsd.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 478Fsn2ZQbz4KL5 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.95)[-0.945,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 20:50:38 -0000 On Thu, Nov 07, 2019 at 08:49:56PM +0000, Gleb Smirnoff wrote: T> Author: glebius T> Date: Thu Nov 7 20:49:56 2019 T> New Revision: 354477 T> URL: https://svnweb.freebsd.org/changeset/base/354477 T> T> Log: T> Since r353292 on input path we are always in network epoch, when T> we lookup PCBs. Thus, do not enter epoch recursively in T> in_pcblookup_hash() and in6_pcblookup_hash(). Same applies to T> tcp_ctlinput() and tcp6_ctlinput(). T> T> This leaves several sysctl(9) handlers that return PCB credentials T> unprotected. Add epoch enter/exit to all of them. T> T> Differential Revision: https://reviews.freebsd.org/D22197 Note: only this commit references the differential revision, as it is the core change. But preceeding commits and following commits related to PCB locking were all part of this review. -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Thu Nov 7 20:57:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2C9DD179039; Thu, 7 Nov 2019 20:57:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478G280NkQz4L79; Thu, 7 Nov 2019 20:57:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5DF31BA89; Thu, 7 Nov 2019 20:57:51 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7KvpZO078285; Thu, 7 Nov 2019 20:57:51 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7KvpMt078284; Thu, 7 Nov 2019 20:57:51 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911072057.xA7KvpMt078284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Nov 2019 20:57:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354478 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 354478 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 20:57:52 -0000 Author: glebius Date: Thu Nov 7 20:57:51 2019 New Revision: 354478 URL: https://svnweb.freebsd.org/changeset/base/354478 Log: Add INP_UNLOCK() which will do whatever R/W unlock is required. Modified: head/sys/netinet/in_pcb.h Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Thu Nov 7 20:49:56 2019 (r354477) +++ head/sys/netinet/in_pcb.h Thu Nov 7 20:57:51 2019 (r354478) @@ -586,6 +586,7 @@ struct inpcblbgroup { #define INP_TRY_WLOCK(inp) rw_try_wlock(&(inp)->inp_lock) #define INP_RUNLOCK(inp) rw_runlock(&(inp)->inp_lock) #define INP_WUNLOCK(inp) rw_wunlock(&(inp)->inp_lock) +#define INP_UNLOCK(inp) rw_unlock(&(inp)->inp_lock) #define INP_TRY_UPGRADE(inp) rw_try_upgrade(&(inp)->inp_lock) #define INP_DOWNGRADE(inp) rw_downgrade(&(inp)->inp_lock) #define INP_WLOCKED(inp) rw_wowned(&(inp)->inp_lock) From owner-svn-src-head@freebsd.org Thu Nov 7 21:01:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54F6A1793CA; Thu, 7 Nov 2019 21:01:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478G6T2F9Mz4LVw; Thu, 7 Nov 2019 21:01:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16A9F1BBEF; Thu, 7 Nov 2019 21:01:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7L1arP078554; Thu, 7 Nov 2019 21:01:36 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7L1a9t078550; Thu, 7 Nov 2019 21:01:36 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911072101.xA7L1a9t078550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Nov 2019 21:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354479 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 354479 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 21:01:37 -0000 Author: glebius Date: Thu Nov 7 21:01:36 2019 New Revision: 354479 URL: https://svnweb.freebsd.org/changeset/base/354479 Log: Now with epoch synchronized PCB lookup tables we can greatly simplify locking in udp_output() and udp6_output(). First, we select if we need read or write lock in PCB itself, we take the lock and enter network epoch. Then, we proceed for the rest of the function. In case if we need to modify PCB hash, we would take write lock on it for a short piece of code. We could exit the epoch before allocating an mbuf, but with this patch we are keeping it all the way into ip_output()/ip6_output(). Today this creates an epoch recursion, since ip_output() enters epoch itself. However, once all protocols are reviewed, ip_output() and ip6_output() would require epoch instead of entering it. Note: I'm not 100% sure that in udp6_output() the epoch is required. We don't do PCB hash lookup for a bound socket. And all branches of in6_select_src() don't require epoch, at least they lack assertions. Today inet6 address list is protected by rmlock, although it is CKLIST. AFAIU, the future plan is to protect it by network epoch. That would require epoch in in6_select_src(). Anyway, in future ip6_output() would require epoch, udp6_output() would need to enter it. Modified: head/sys/netinet/udp_usrreq.c head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Thu Nov 7 20:57:51 2019 (r354478) +++ head/sys/netinet/udp_usrreq.c Thu Nov 7 21:01:36 2019 (r354479) @@ -1118,9 +1118,6 @@ udp_ctloutput(struct socket *so, struct sockopt *sopt) } #ifdef INET -#define UH_WLOCKED 2 -#define UH_RLOCKED 1 -#define UH_UNLOCKED 0 static int udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr, struct mbuf *control, struct thread *td) @@ -1136,19 +1133,12 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct s int error = 0; int ipflags; u_short fport, lport; - int unlock_udbinfo, unlock_inp; u_char tos; uint8_t pr; uint16_t cscov = 0; uint32_t flowid = 0; uint8_t flowtype = M_HASHTYPE_NONE; - /* - * udp_output() may need to temporarily bind or connect the current - * inpcb. As such, we don't know up front whether we will need the - * pcbinfo lock or not. Do any work to decide what is needed up - * front before acquiring any locks. - */ if (len + sizeof(struct udpiphdr) > IP_MAXPACKET) { if (control) m_freem(control); @@ -1158,28 +1148,22 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct s src.sin_family = 0; sin = (struct sockaddr_in *)addr; -retry: + + /* + * udp_output() may need to temporarily bind or connect the current + * inpcb. As such, we don't know up front whether we will need the + * pcbinfo lock or not. Do any work to decide what is needed up + * front before acquiring any locks. + * + * We will need network epoch in either case, to safely lookup into + * pcb hash. + */ if (sin == NULL || - (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0)) { + (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0)) INP_WLOCK(inp); - /* - * In case we lost a race and another thread bound addr/port - * on the inp we cannot keep the wlock (which still would be - * fine) as further down, based on these values we make - * decisions for the pcbinfo lock. If the locks are not in - * synch the assertions on unlock will fire, hence we go for - * one retry loop. - */ - if (sin != NULL && (inp->inp_laddr.s_addr != INADDR_ANY || - inp->inp_lport != 0)) { - INP_WUNLOCK(inp); - goto retry; - } - unlock_inp = UH_WLOCKED; - } else { + else INP_RLOCK(inp); - unlock_inp = UH_RLOCKED; - } + NET_EPOCH_ENTER(et); tos = inp->inp_ip_tos; if (control != NULL) { /* @@ -1187,13 +1171,9 @@ retry: * stored in a single mbuf. */ if (control->m_next) { - if (unlock_inp == UH_WLOCKED) - INP_WUNLOCK(inp); - else - INP_RUNLOCK(inp); m_freem(control); - m_freem(m); - return (EINVAL); + error = EINVAL; + goto release; } for (; control->m_len > 0; control->m_data += CMSG_ALIGN(cm->cmsg_len), @@ -1264,56 +1244,11 @@ retry: } m_freem(control); } - if (error) { - if (unlock_inp == UH_WLOCKED) - INP_WUNLOCK(inp); - else - INP_RUNLOCK(inp); - m_freem(m); - return (error); - } + if (error) + goto release; - /* - * In the old days, depending on whether or not the application had - * bound or connected the socket, we had to do varying levels of work. - * The optimal case was for a connected UDP socket, as a global lock - * wasn't required at all. - * In order to decide which we need, we required stability of the - * inpcb binding, which we ensured by acquiring a read lock on the - * inpcb. This didn't strictly follow the lock order, so we played - * the trylock and retry game. - * With the re-introduction of the route-cache in some cases, we started - * to acquire an early inp wlock and a possible race during re-lock - * went away. With the introduction of epoch(9) some read locking - * became epoch(9) and the lock-order issues also went away. - * Due to route-cache we may now hold more conservative locks than - * otherwise required and have split up the 2nd case in case 2 and 3 - * in order to keep the udpinfo lock level in sync with the inp one - * for the IP_SENDSRCADDR case below. - */ pr = inp->inp_socket->so_proto->pr_protocol; pcbinfo = udp_get_inpcbinfo(pr); - if (sin != NULL && - (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0)) { - INP_HASH_WLOCK(pcbinfo); - unlock_udbinfo = UH_WLOCKED; - } else if (sin != NULL && - (sin->sin_addr.s_addr == INADDR_ANY || - sin->sin_addr.s_addr == INADDR_BROADCAST || - inp->inp_laddr.s_addr == INADDR_ANY || - inp->inp_lport == 0)) { - INP_HASH_RLOCK_ET(pcbinfo, et); - unlock_udbinfo = UH_RLOCKED; - } else if (src.sin_family == AF_INET) { - if (unlock_inp == UH_WLOCKED) { - INP_HASH_WLOCK(pcbinfo); - unlock_udbinfo = UH_WLOCKED; - } else { - INP_HASH_RLOCK_ET(pcbinfo, et); - unlock_udbinfo = UH_RLOCKED; - } - } else - unlock_udbinfo = UH_UNLOCKED; /* * If the IP_SENDSRCADDR control message was specified, override the @@ -1389,7 +1324,6 @@ retry: if (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0) { INP_WLOCK_ASSERT(inp); - INP_HASH_WLOCK_ASSERT(pcbinfo); /* * Remember addr if jailed, to prevent * rebinding. @@ -1397,7 +1331,10 @@ retry: if (prison_flag(td->td_ucred, PR_IP4)) inp->inp_laddr = laddr; inp->inp_lport = lport; - if (in_pcbinshash(inp) != 0) { + INP_HASH_WLOCK(pcbinfo); + error = in_pcbinshash(inp); + INP_HASH_WUNLOCK(pcbinfo); + if (error != 0) { inp->inp_lport = 0; error = EAGAIN; goto release; @@ -1562,48 +1499,20 @@ retry: ipflags |= IP_NODEFAULTFLOWID; #endif /* RSS */ - if (unlock_udbinfo == UH_WLOCKED) - INP_HASH_WUNLOCK(pcbinfo); - else if (unlock_udbinfo == UH_RLOCKED) - INP_HASH_RUNLOCK_ET(pcbinfo, et); if (pr == IPPROTO_UDPLITE) UDPLITE_PROBE(send, NULL, inp, &ui->ui_i, inp, &ui->ui_u); else UDP_PROBE(send, NULL, inp, &ui->ui_i, inp, &ui->ui_u); error = ip_output(m, inp->inp_options, - (unlock_inp == UH_WLOCKED ? &inp->inp_route : NULL), ipflags, + INP_WLOCKED(inp) ? &inp->inp_route : NULL, ipflags, inp->inp_moptions, inp); - if (unlock_inp == UH_WLOCKED) - INP_WUNLOCK(inp); - else - INP_RUNLOCK(inp); + INP_UNLOCK(inp); + NET_EPOCH_EXIT(et); return (error); release: - if (unlock_udbinfo == UH_WLOCKED) { - KASSERT(unlock_inp == UH_WLOCKED, - ("%s: excl udbinfo lock %#03x, shared inp lock %#03x, " - "sin %p daddr %#010x inp %p laddr %#010x lport %#06x " - "src fam %#04x", - __func__, unlock_udbinfo, unlock_inp, sin, - (sin != NULL) ? sin->sin_addr.s_addr : 0xfefefefe, inp, - inp->inp_laddr.s_addr, inp->inp_lport, src.sin_family)); - INP_HASH_WUNLOCK(pcbinfo); - INP_WUNLOCK(inp); - } else if (unlock_udbinfo == UH_RLOCKED) { - KASSERT(unlock_inp == UH_RLOCKED, - ("%s: shared udbinfo lock %#03x, excl inp lock %#03x, " - "sin %p daddr %#010x inp %p laddr %#010x lport %#06x " - "src fam %#04x", - __func__, unlock_udbinfo, unlock_inp, sin, - (sin != NULL) ? sin->sin_addr.s_addr : 0xfefefefe, inp, - inp->inp_laddr.s_addr, inp->inp_lport, src.sin_family)); - INP_HASH_RUNLOCK_ET(pcbinfo, et); - INP_RUNLOCK(inp); - } else if (unlock_inp == UH_WLOCKED) - INP_WUNLOCK(inp); - else - INP_RUNLOCK(inp); + INP_UNLOCK(inp); + NET_EPOCH_EXIT(et); m_freem(m); return (error); } Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Thu Nov 7 20:57:51 2019 (r354478) +++ head/sys/netinet6/udp6_usrreq.c Thu Nov 7 21:01:36 2019 (r354479) @@ -678,14 +678,10 @@ udp6_getcred(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_net_inet6_udp6, OID_AUTO, getcred, CTLTYPE_OPAQUE|CTLFLAG_RW, 0, 0, udp6_getcred, "S,xucred", "Get the xucred of a UDP6 connection"); -#define UH_WLOCKED 2 -#define UH_RLOCKED 1 -#define UH_UNLOCKED 0 static int udp6_output(struct socket *so, int flags_arg, struct mbuf *m, struct sockaddr *addr6, struct mbuf *control, struct thread *td) { - struct inpcbinfo *pcbinfo; struct inpcb *inp; struct ip6_hdr *ip6; struct udphdr *udp6; @@ -697,7 +693,7 @@ udp6_output(struct socket *so, int flags_arg, struct m u_int32_t ulen, plen; uint16_t cscov; u_short fport; - uint8_t nxt, unlock_inp, unlock_udbinfo; + uint8_t nxt; /* addr6 has been validated in udp6_send(). */ sin6 = (struct sockaddr_in6 *)addr6; @@ -740,30 +736,17 @@ udp6_output(struct socket *so, int flags_arg, struct m * - on connected sockets (sin6 is NULL) for route cache updates, * - when we are not bound to an address and source port (it is * in6_pcbsetport() which will require the write lock). + * + * We check the inp fields before actually locking the inp, so + * here exists a race, and we may WLOCK the inp and end with already + * bound one by other thread. This is fine. */ -retry: if (sin6 == NULL || (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr) && - inp->inp_lport == 0)) { + inp->inp_lport == 0)) INP_WLOCK(inp); - /* - * In case we lost a race and another thread bound addr/port - * on the inp we cannot keep the wlock (which still would be - * fine) as further down, based on these values we make - * decisions for the pcbinfo lock. If the locks are not in - * synch the assertions on unlock will fire, hence we go for - * one retry loop. - */ - if (sin6 != NULL && - (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr) || - inp->inp_lport != 0)) { - INP_WUNLOCK(inp); - goto retry; - } - unlock_inp = UH_WLOCKED; - } else { + else INP_RLOCK(inp); - unlock_inp = UH_RLOCKED; - } + nxt = (inp->inp_socket->so_proto->pr_protocol == IPPROTO_UDP) ? IPPROTO_UDP : IPPROTO_UDPLITE; @@ -787,10 +770,7 @@ retry: * potential race in which the factors causing us to * select the UDPv4 output routine are invalidated? */ - if (unlock_inp == UH_WLOCKED) - INP_WUNLOCK(inp); - else - INP_RUNLOCK(inp); + INP_UNLOCK(inp); if (sin6) in6_sin6_2_sin_in_sock((struct sockaddr *)sin6); pru = inetsw[ip_protox[nxt]].pr_usrreqs; @@ -805,21 +785,17 @@ retry: * Given this is either an IPv6-only socket or no INET is * supported we will fail the send if the given destination * address is a v4mapped address. + * + * XXXGL: do we leak m and control? */ - if (unlock_inp == UH_WLOCKED) - INP_WUNLOCK(inp); - else - INP_RUNLOCK(inp); + INP_UNLOCK(inp); return (EINVAL); } if (control) { if ((error = ip6_setpktopts(control, &opt, inp->in6p_outputopts, td->td_ucred, nxt)) != 0) { - if (unlock_inp == UH_WLOCKED) - INP_WUNLOCK(inp); - else - INP_RUNLOCK(inp); + INP_UNLOCK(inp); ip6_clearpktopts(&opt, -1); if (control) m_freem(control); @@ -830,20 +806,7 @@ retry: } else optp = inp->in6p_outputopts; - pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol); - if (sin6 != NULL && - IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr) && inp->inp_lport == 0) { - INP_HASH_WLOCK(pcbinfo); - unlock_udbinfo = UH_WLOCKED; - } else if (sin6 != NULL && - (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) || - IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr) || - inp->inp_lport == 0)) { - INP_HASH_RLOCK_ET(pcbinfo, et); - unlock_udbinfo = UH_RLOCKED; - } else - unlock_udbinfo = UH_UNLOCKED; - + NET_EPOCH_ENTER(et); if (sin6) { /* @@ -879,9 +842,14 @@ retry: laddr = &in6a; if (inp->inp_lport == 0) { + struct inpcbinfo *pcbinfo; INP_WLOCK_ASSERT(inp); + + pcbinfo = udp_get_inpcbinfo(so->so_proto->pr_protocol); + INP_HASH_WLOCK(pcbinfo); error = in6_pcbsetport(laddr, inp, td->td_ucred); + INP_HASH_WUNLOCK(pcbinfo); if (error != 0) { /* Undo an address bind that may have occurred. */ inp->in6p_laddr = in6addr_any; @@ -1005,21 +973,15 @@ retry: #endif UDPSTAT_INC(udps_opackets); - if (unlock_udbinfo == UH_WLOCKED) - INP_HASH_WUNLOCK(pcbinfo); - else if (unlock_udbinfo == UH_RLOCKED) - INP_HASH_RUNLOCK_ET(pcbinfo, et); if (nxt == IPPROTO_UDPLITE) UDPLITE_PROBE(send, NULL, inp, ip6, inp, udp6); else UDP_PROBE(send, NULL, inp, ip6, inp, udp6); error = ip6_output(m, optp, - (unlock_inp == UH_WLOCKED) ? &inp->inp_route6 : NULL, flags, + INP_WLOCKED(inp) ? &inp->inp_route6 : NULL, flags, inp->in6p_moptions, NULL, inp); - if (unlock_inp == UH_WLOCKED) - INP_WUNLOCK(inp); - else - INP_RUNLOCK(inp); + INP_UNLOCK(inp); + NET_EPOCH_EXIT(et); if (control) { ip6_clearpktopts(&opt, -1); @@ -1028,22 +990,8 @@ retry: return (error); release: - if (unlock_udbinfo == UH_WLOCKED) { - KASSERT(unlock_inp == UH_WLOCKED, ("%s: excl udbinfo lock, " - "non-excl inp lock: pcbinfo %p %#x inp %p %#x", - __func__, pcbinfo, unlock_udbinfo, inp, unlock_inp)); - INP_HASH_WUNLOCK(pcbinfo); - INP_WUNLOCK(inp); - } else if (unlock_udbinfo == UH_RLOCKED) { - KASSERT(unlock_inp == UH_RLOCKED, ("%s: non-excl udbinfo lock, " - "excl inp lock: pcbinfo %p %#x inp %p %#x", - __func__, pcbinfo, unlock_udbinfo, inp, unlock_inp)); - INP_HASH_RUNLOCK_ET(pcbinfo, et); - INP_RUNLOCK(inp); - } else if (unlock_inp == UH_WLOCKED) - INP_WUNLOCK(inp); - else - INP_RUNLOCK(inp); + INP_UNLOCK(inp); + NET_EPOCH_EXIT(et); if (control) { ip6_clearpktopts(&opt, -1); m_freem(control); From owner-svn-src-head@freebsd.org Thu Nov 7 21:03:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8BF97179524; Thu, 7 Nov 2019 21:03:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478G8N39FBz4Lk7; Thu, 7 Nov 2019 21:03:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5056A1BC49; Thu, 7 Nov 2019 21:03:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7L3GCb084467; Thu, 7 Nov 2019 21:03:16 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7L3GQw084466; Thu, 7 Nov 2019 21:03:16 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911072103.xA7L3GQw084466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Nov 2019 21:03:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354480 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 354480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 21:03:16 -0000 Author: glebius Date: Thu Nov 7 21:03:15 2019 New Revision: 354480 URL: https://svnweb.freebsd.org/changeset/base/354480 Log: Remove now unused INP_HASH_RLOCK() macros. Modified: head/sys/netinet/in_pcb.h Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Thu Nov 7 21:01:36 2019 (r354479) +++ head/sys/netinet/in_pcb.h Thu Nov 7 21:03:15 2019 (r354480) @@ -664,11 +664,7 @@ int inp_so_options(const struct inpcb *inp); #define INP_HASH_LOCK_INIT(ipi, d) mtx_init(&(ipi)->ipi_hash_lock, (d), NULL, MTX_DEF) #define INP_HASH_LOCK_DESTROY(ipi) mtx_destroy(&(ipi)->ipi_hash_lock) -#define INP_HASH_RLOCK(ipi) struct epoch_tracker inp_hash_et; epoch_enter_preempt(net_epoch_preempt, &inp_hash_et) -#define INP_HASH_RLOCK_ET(ipi, et) epoch_enter_preempt(net_epoch_preempt, &(et)) #define INP_HASH_WLOCK(ipi) mtx_lock(&(ipi)->ipi_hash_lock) -#define INP_HASH_RUNLOCK(ipi) NET_EPOCH_EXIT(inp_hash_et) -#define INP_HASH_RUNLOCK_ET(ipi, et) NET_EPOCH_EXIT((et)) #define INP_HASH_WUNLOCK(ipi) mtx_unlock(&(ipi)->ipi_hash_lock) #define INP_HASH_LOCK_ASSERT(ipi) MPASS(in_epoch(net_epoch_preempt) || mtx_owned(&(ipi)->ipi_hash_lock)) #define INP_HASH_WLOCK_ASSERT(ipi) mtx_assert(&(ipi)->ipi_hash_lock, MA_OWNED); From owner-svn-src-head@freebsd.org Thu Nov 7 21:08:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 711C6179735; Thu, 7 Nov 2019 21:08:50 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478GGp2HjZz4M1v; Thu, 7 Nov 2019 21:08:50 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32EB81BC51; Thu, 7 Nov 2019 21:08:50 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7L8nV7084905; Thu, 7 Nov 2019 21:08:49 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7L8n3q084904; Thu, 7 Nov 2019 21:08:49 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911072108.xA7L8n3q084904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Nov 2019 21:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354481 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 354481 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 21:08:50 -0000 Author: glebius Date: Thu Nov 7 21:08:49 2019 New Revision: 354481 URL: https://svnweb.freebsd.org/changeset/base/354481 Log: Remove unnecessary recursive epoch enter via INP_INFO_RLOCK macro in udp_input(). It shall always run in the network epoch. Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Thu Nov 7 21:03:15 2019 (r354480) +++ head/sys/netinet/udp_usrreq.c Thu Nov 7 21:08:49 2019 (r354481) @@ -399,7 +399,6 @@ udp_input(struct mbuf **mp, int *offp, int proto) struct sockaddr_in udp_in[2]; struct mbuf *m; struct m_tag *fwd_tag; - struct epoch_tracker et; int cscov_partial, iphlen; m = *mp; @@ -528,7 +527,8 @@ udp_input(struct mbuf **mp, int *offp, int proto) struct inpcb *last; struct inpcbhead *pcblist; - INP_INFO_RLOCK_ET(pcbinfo, et); + NET_EPOCH_ASSERT(); + pcblist = udp_get_pcblist(proto); last = NULL; CK_LIST_FOREACH(inp, pcblist, inp_list) { @@ -635,7 +635,6 @@ udp_input(struct mbuf **mp, int *offp, int proto) UDPSTAT_INC(udps_noportbcast); if (inp) INP_RUNLOCK(inp); - INP_INFO_RUNLOCK_ET(pcbinfo, et); goto badunlocked; } if (proto == IPPROTO_UDPLITE) @@ -645,7 +644,6 @@ udp_input(struct mbuf **mp, int *offp, int proto) if (udp_append(last, ip, m, iphlen, udp_in) == 0) INP_RUNLOCK(last); inp_lost: - INP_INFO_RUNLOCK_ET(pcbinfo, et); return (IPPROTO_DONE); } From owner-svn-src-head@freebsd.org Thu Nov 7 21:15:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1DC941799FA; Thu, 7 Nov 2019 21:15:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478GPv7560z4MSj; Thu, 7 Nov 2019 21:14:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D68D91BE0F; Thu, 7 Nov 2019 21:14:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7LExbH090363; Thu, 7 Nov 2019 21:14:59 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7LExVP090362; Thu, 7 Nov 2019 21:14:59 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201911072114.xA7LExVP090362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 7 Nov 2019 21:14:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354482 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 354482 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 21:15:00 -0000 Author: avg Date: Thu Nov 7 21:14:59 2019 New Revision: 354482 URL: https://svnweb.freebsd.org/changeset/base/354482 Log: IPI_TRACE is not really supported on xen x86 stack_save_td_running() can work safely only if IPI_TRACE is a non-maskable interrupt. But at the moment FreeBSD/Xen does not provide support for the NMI delivery mode. So, mark the functionality as unsupported similarly to other platforms without NMI. Maybe there is a way to provide a Xen-specific working stack_save_td_running(), but I couldn't figure it out. MFC after: 3 weeks Sponsored by: Panzura Modified: head/sys/x86/x86/stack_machdep.c Modified: head/sys/x86/x86/stack_machdep.c ============================================================================== --- head/sys/x86/x86/stack_machdep.c Thu Nov 7 21:08:49 2019 (r354481) +++ head/sys/x86/x86/stack_machdep.c Thu Nov 7 21:14:59 2019 (r354482) @@ -135,6 +135,13 @@ int stack_save_td_running(struct stack *st, struct thread *td) { +#ifdef XENHVM + /* + * There is no NMI support on Xen, so this code can lead to + * an inter-processor deadlock. + */ + return (EOPNOTSUPP); +#endif /* XENHVM */ #ifdef STACK THREAD_LOCK_ASSERT(td, MA_OWNED); MPASS(TD_IS_RUNNING(td)); From owner-svn-src-head@freebsd.org Thu Nov 7 21:19:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D22DC179B39 for ; Thu, 7 Nov 2019 21:19:11 +0000 (UTC) (envelope-from 0100016e47bc3d83-8486b1e5-d734-49da-9995-ad5cfc8540d2-000000@amazonses.com) Received: from a8-56.smtp-out.amazonses.com (a8-56.smtp-out.amazonses.com [54.240.8.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 478GVk4m4Cz4Mf3 for ; Thu, 7 Nov 2019 21:19:10 +0000 (UTC) (envelope-from 0100016e47bc3d83-8486b1e5-d734-49da-9995-ad5cfc8540d2-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=vnqrkfnvu6csdl6mwgk5t6ix3nnepx57; d=tarsnap.com; t=1573161549; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=CK+Cxk2dV2kwTecnNi+A6MqhrEQ4gG9hYoSNb54O5WQ=; b=fDlodij8iQPDvXZRz8hq4PPyOcpr9vjztu6Bxhs5/GSYPwA7FLpRtJXbS/LUtNAK 7I94x+40JAiT8TjqeWn5Z8fb1v2jgGL7/MTEkj/0Muy/ei3SU2Hkc6vFtjTAq6LC+ZZ 1xTRFPIEyM+ZIXpTN9UG0UF4nTnBNQ1riG02zvPk= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1573161549; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=CK+Cxk2dV2kwTecnNi+A6MqhrEQ4gG9hYoSNb54O5WQ=; b=FCumVboWdscUw2U/M0MnaqlaekR5qz6YC0peuQLBXQ9DkEWibuSDtZj4/oMI+f+i kYxgVdPVn+XcdRWDQE71ar03iw++buthGGSd63NbxN2hmAXbJ64K9plPQ55iUx9HFMA m4268pDjpSMCXVvH81K7dPKWmaQx5kZvD6xZ+VKo= Subject: Re: svn commit: r354482 - head/sys/x86/x86 To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201911072114.xA7LExVP090362@repo.freebsd.org> From: Colin Percival Autocrypt: addr=cperciva@tarsnap.com; prefer-encrypt=mutual; keydata= mQGhBElrAAcRBACDfDys4ZtK+ErCJ1HAzYeteKpm3OEsvT/49AjUTLihkF79HhIKrCQU+1KC zv7BwHCMLb6hq30As9L7iFKG7n5QFLFC4Te/VcITUnWHMG/c3ViLOfJGvi+9/nOEHaM1dVJY D6tEp5yM1nHmVQpo9932j4KGuGFR0LhOK5IHXOSfGwCgxSFDPdgxe2OEjWxjGgY+oV3EafcD +JROXCTjlcQiG/OguQH4Vks3mhHfFnEppLxTkDuYgHZQiUtpcT9ssH5khgqoTyMar05OUdAj ZIhNbWDh4LgTj+7ZmvLhXT5Zxw8LX9d7T36aTB8XDQSenDqEtinMWOb0TCBBLbsB8EFG1WTT ESbZci9jJS5yhtktuZoY/eM8uXMD/3k4FWFO80VRRkELSp+XSy/VlSQjyi/rhl2nQq/oOA9F oJbDaB0yq9VNhxP+uFBzBWSqeIX0t1ZWLtNfVFr4TRP5hihI5ICrg/0OpqgisKsU2NFe9xyO hyJLYmfD8ebpDJ/9k30C7Iju9pVrwLm1QgS4S2fqJRcR+U4WbjvP7CgStCVDb2xpbiBQZXJj aXZhbCA8Y3BlcmNpdmFAdGFyc25hcC5jb20+iGEEExECACEFAklrALYCGwMHCwkIBwMCAQQV AggDBBYCAwECHgECF4AACgkQOM7KaQxqam6/igCgn+z2k3V5ggNppmWrZstt1U2lugsAoL7L wS9V9yLtil3oWmHtwpUqYruEuQINBElrAAcQCAD3ZLMIsP4CIDoJORg+YY0lqLVBgcnF7pFb 4Uy2+KvdWofN+DKH61rZLjgXXkNE9M4EQC1B4lGttBP8IY2gs41y3AUogGdyFbidq99rCBz7 LTsgARHwFxZoaHmXyiZLEU1QZuMqwPZV1mCviRhN5E3rRqYNXVcrnXAAuhBpvNyj/ntHvcDN 2/m+ochiuBYueU4kX3lHya7sOj+mTsndcWmQ9soOUyr8O0r/BG088bMn4qqtUw4dl5/pglXk jbl7uOOPinKf0WVd2r6M0wLPJCD4NPHrCWRLLLAjwfjrtoSRvXxDbXhCdgGBa72+K8eYLzVs hgq7tJOoBWzjVK6XRxR7AAMGB/9Mo3iJ2DxqDecd02KCB5BsFDICbJGhPltU7FwrtbC7djSb XUrwsEVLHi4st4cbdGNCWCrp0BRezXZKohKnNAPFOTK++ZfgeKxrV2sJod+Q9RILF86tQ4XF 7A7Yme5hy92t/WgiU4vc/fWbgP8gV/19f8nunaT2E9NSa70mZFjZNu4iuwThoUUO5CV3Wo0Y UISsnRK8XD1+LR3A2qVyLiFRwh/miC1hgLFCTGCQ3GLxZeZzIpYSlGdQJ0L5lixW5ZQD9r1I 8i/8zhE6qRFAM0upUMI3Gt1Oq2w03DiXrZU0Fu/R8Rm8rlnkQKA+95mRTUq1xL5P5NZIi4gJ Z569OPMFiEkEGBECAAkFAklrAAcCGwwACgkQOM7KaQxqam41igCfbaldnFTu5uAdrnrghESv EI3CAo8AoLkNMks1pThl2BJNRm4CtTK9xZeH Message-ID: <0100016e47bc3d83-8486b1e5-d734-49da-9995-ad5cfc8540d2-000000@email.amazonses.com> Date: Thu, 7 Nov 2019 21:19:09 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <201911072114.xA7LExVP090362@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2019.11.07-54.240.8.56 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-Rspamd-Queue-Id: 478GVk4m4Cz4Mf3 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=tarsnap.com header.s=vnqrkfnvu6csdl6mwgk5t6ix3nnepx57 header.b=fDlodij8; dkim=pass header.d=amazonses.com header.s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw header.b=FCumVboW; dmarc=none; spf=pass (mx1.freebsd.org: domain of 0100016e47bc3d83-8486b1e5-d734-49da-9995-ad5cfc8540d2-000000@amazonses.com designates 54.240.8.56 as permitted sender) smtp.mailfrom=0100016e47bc3d83-8486b1e5-d734-49da-9995-ad5cfc8540d2-000000@amazonses.com X-Spamd-Result: default: False [-1.68 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[tarsnap.com:s=vnqrkfnvu6csdl6mwgk5t6ix3nnepx57,amazonses.com:s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:54.240.0.0/18]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[tarsnap.com]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[tarsnap.com:+,amazonses.com:+]; RCVD_IN_DNSWL_NONE(0.00)[56.8.240.54.list.dnswl.org : 127.0.15.0]; FORGED_SENDER(0.30)[cperciva@tarsnap.com,0100016e47bc3d83-8486b1e5-d734-49da-9995-ad5cfc8540d2-000000@amazonses.com]; RCVD_COUNT_ZERO(0.00)[0]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-1.98)[ip: (-1.92), ipnet: 54.240.8.0/21(-4.61), asn: 14618(-3.30), country: US(-0.05)]; ASN(0.00)[asn:14618, ipnet:54.240.8.0/21, country:US]; FORGED_MUA_THUNDERBIRD_MSGID_UNKNOWN(2.50)[]; FROM_NEQ_ENVFROM(0.00)[cperciva@tarsnap.com, 0100016e47bc3d83-8486b1e5-d734-49da-9995-ad5cfc8540d2-000000@amazonses.com] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 21:19:11 -0000 On 2019-11-07 13:14, Andriy Gapon wrote: > x86 stack_save_td_running() can work safely only if IPI_TRACE is a > non-maskable interrupt. But at the moment FreeBSD/Xen does not provide > support for the NMI delivery mode. So, mark the functionality as > unsupported similarly to other platforms without NMI. > [...] > +#ifdef XENHVM I'm not sure this does what you intended. XENHVM simply adds *support* for running under Xen/HVM, and it's part of the GENERIC kernel. -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@freebsd.org Thu Nov 7 21:23:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 980FC179F6B; Thu, 7 Nov 2019 21:23:08 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478GbJ4Cdlz4NBq; Thu, 7 Nov 2019 21:23:08 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73BAD1BFE5; Thu, 7 Nov 2019 21:23:08 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7LN845096133; Thu, 7 Nov 2019 21:23:08 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7LN7MA096129; Thu, 7 Nov 2019 21:23:07 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911072123.xA7LN7MA096129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Nov 2019 21:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354483 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 354483 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 21:23:08 -0000 Author: glebius Date: Thu Nov 7 21:23:07 2019 New Revision: 354483 URL: https://svnweb.freebsd.org/changeset/base/354483 Log: Now that all of the tcp_input() and all its branches are executed in the network epoch, we can greatly simplify synchronization. Remove all unneccesary epoch enters hidden under INP_INFO_RLOCK macro. Remove some unneccesary assertions and convert necessary ones into the NET_EPOCH_ASSERT macro. Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/bbr.c head/sys/netinet/tcp_stacks/rack.c head/sys/netinet/tcp_stacks/rack_bbr_common.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Thu Nov 7 21:14:59 2019 (r354482) +++ head/sys/netinet/tcp_input.c Thu Nov 7 21:23:07 2019 (r354483) @@ -561,7 +561,6 @@ tcp_input(struct mbuf **mp, int *offp, int proto) int rstreason = 0; /* For badport_bandlim accounting purposes */ uint8_t iptos; struct m_tag *fwd_tag = NULL; - struct epoch_tracker et; #ifdef INET6 struct ip6_hdr *ip6 = NULL; int isipv6; @@ -570,7 +569,6 @@ tcp_input(struct mbuf **mp, int *offp, int proto) #endif /* INET6 */ struct tcpopt to; /* options in this segment */ char *s = NULL; /* address and port logging */ - int ti_locked; #ifdef TCPDEBUG /* * The size of tcp_saveipgen must be the size of the max ip header, @@ -581,6 +579,8 @@ tcp_input(struct mbuf **mp, int *offp, int proto) short ostate = 0; #endif + NET_EPOCH_ASSERT(); + #ifdef INET6 isipv6 = (mtod(m, struct ip *)->ip_v == 6) ? 1 : 0; #endif @@ -747,19 +747,6 @@ tcp_input(struct mbuf **mp, int *offp, int proto) drop_hdrlen = off0 + off; /* - * Locate pcb for segment; if we're likely to add or remove a - * connection then first acquire pcbinfo lock. There are three cases - * where we might discover later we need a write lock despite the - * flags: ACKs moving a connection out of the syncache, ACKs for a - * connection in TIMEWAIT and SYNs not targeting a listening socket. - */ - if ((thflags & (TH_FIN | TH_RST)) != 0) { - INP_INFO_RLOCK_ET(&V_tcbinfo, et); - ti_locked = TI_RLOCKED; - } else - ti_locked = TI_UNLOCKED; - - /* * Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain. */ if ( @@ -776,13 +763,6 @@ tcp_input(struct mbuf **mp, int *offp, int proto) fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); findpcb: -#ifdef INVARIANTS - if (ti_locked == TI_RLOCKED) { - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); - } else { - INP_INFO_WUNLOCK_ASSERT(&V_tcbinfo); - } -#endif #ifdef INET6 if (isipv6 && fwd_tag != NULL) { struct sockaddr_in6 *next_hop6; @@ -942,12 +922,6 @@ findpcb: * XXXRW: It may be time to rethink timewait locking. */ if (inp->inp_flags & INP_TIMEWAIT) { - if (ti_locked == TI_UNLOCKED) { - INP_INFO_RLOCK_ET(&V_tcbinfo, et); - ti_locked = TI_RLOCKED; - } - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); - if (thflags & TH_SYN) tcp_dooptions(&to, optp, optlen, TO_SYN); /* @@ -955,7 +929,6 @@ findpcb: */ if (tcp_twcheck(inp, &to, th, m, tlen)) goto findpcb; - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); return (IPPROTO_DONE); } /* @@ -977,27 +950,6 @@ findpcb: } #endif - /* - * We've identified a valid inpcb, but it could be that we need an - * inpcbinfo write lock but don't hold it. In this case, attempt to - * acquire using the same strategy as the TIMEWAIT case above. If we - * relock, we have to jump back to 'relocked' as the connection might - * now be in TIMEWAIT. - */ -#ifdef INVARIANTS - if ((thflags & (TH_FIN | TH_RST)) != 0) - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); -#endif - if (!((tp->t_state == TCPS_ESTABLISHED && (thflags & TH_SYN) == 0) || - (tp->t_state == TCPS_LISTEN && (thflags & TH_SYN) && - !IS_FASTOPEN(tp->t_flags)))) { - if (ti_locked == TI_UNLOCKED) { - INP_INFO_RLOCK_ET(&V_tcbinfo, et); - ti_locked = TI_RLOCKED; - } - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); - } - #ifdef MAC INP_WLOCK_ASSERT(inp); if (mac_inpcb_check_deliver(inp, m)) @@ -1052,7 +1004,6 @@ findpcb: */ if ((thflags & (TH_RST|TH_ACK|TH_SYN)) == TH_ACK) { - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); /* * Parse the TCP options here because * syncookies need access to the reflected @@ -1130,8 +1081,6 @@ tfo_socket_result: TCP_PROBE5(receive, NULL, tp, m, tp, th); tp->t_fb->tfb_tcp_do_segment(m, th, so, tp, drop_hdrlen, tlen, iptos); - if (ti_locked == TI_RLOCKED) - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); return (IPPROTO_DONE); } /* @@ -1334,10 +1283,6 @@ tfo_socket_result: * Entry added to syncache and mbuf consumed. * Only the listen socket is unlocked by syncache_add(). */ - if (ti_locked == TI_RLOCKED) { - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); - ti_locked = TI_UNLOCKED; - } INP_INFO_WUNLOCK_ASSERT(&V_tcbinfo); return (IPPROTO_DONE); } else if (tp->t_state == TCPS_LISTEN) { @@ -1370,25 +1315,11 @@ tfo_socket_result: * the inpcb, and unlocks pcbinfo. */ tp->t_fb->tfb_tcp_do_segment(m, th, so, tp, drop_hdrlen, tlen, iptos); - if (ti_locked == TI_RLOCKED) - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); return (IPPROTO_DONE); dropwithreset: TCP_PROBE5(receive, NULL, tp, m, tp, th); - if (ti_locked == TI_RLOCKED) { - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); - ti_locked = TI_UNLOCKED; - } -#ifdef INVARIANTS - else { - KASSERT(ti_locked == TI_UNLOCKED, ("%s: dropwithreset " - "ti_locked: %d", __func__, ti_locked)); - INP_INFO_WUNLOCK_ASSERT(&V_tcbinfo); - } -#endif - if (inp != NULL) { tcp_dropwithreset(m, th, tp, tlen, rstreason); INP_WUNLOCK(inp); @@ -1401,18 +1332,6 @@ dropunlock: if (m != NULL) TCP_PROBE5(receive, NULL, tp, m, tp, th); - if (ti_locked == TI_RLOCKED) { - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); - ti_locked = TI_UNLOCKED; - } -#ifdef INVARIANTS - else { - KASSERT(ti_locked == TI_UNLOCKED, ("%s: dropunlock " - "ti_locked: %d", __func__, ti_locked)); - INP_INFO_WUNLOCK_ASSERT(&V_tcbinfo); - } -#endif - if (inp != NULL) INP_WUNLOCK(inp); @@ -1501,7 +1420,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru struct mbuf *mfree; struct tcpopt to; int tfo_syn; - + #ifdef TCPDEBUG /* * The size of tcp_saveipgen must be the size of the max ip header, @@ -1516,16 +1435,8 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru tp->sackhint.last_sack_ack = 0; sack_changed = 0; nsegs = max(1, m->m_pkthdr.lro_nsegs); - /* - * If this is either a state-changing packet or current state isn't - * established, we require a write lock on tcbinfo. Otherwise, we - * allow the tcbinfo to be in either alocked or unlocked, as the - * caller may have unnecessarily acquired a write lock due to a race. - */ - if ((thflags & (TH_SYN | TH_FIN | TH_RST)) != 0 || - tp->t_state != TCPS_ESTABLISHED) { - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); - } + + NET_EPOCH_ASSERT(); INP_WLOCK_ASSERT(tp->t_inpcb); KASSERT(tp->t_state > TCPS_LISTEN, ("%s: TCPS_LISTEN", __func__)); @@ -2047,7 +1958,6 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru tcp_state_change(tp, TCPS_SYN_RECEIVED); } - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(tp->t_inpcb); /* @@ -2120,7 +2030,6 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru SEQ_LT(th->th_seq, tp->last_ack_sent + tp->rcv_wnd)) || (tp->rcv_wnd == 0 && tp->last_ack_sent == th->th_seq)) { - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); KASSERT(tp->t_state != TCPS_SYN_SENT, ("%s: TH_RST for TCPS_SYN_SENT th %p tp %p", __func__, th, tp)); @@ -2163,8 +2072,6 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru */ if ((thflags & TH_SYN) && tp->t_state != TCPS_SYN_SENT && tp->t_state != TCPS_SYN_RECEIVED) { - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); - TCPSTAT_INC(tcps_badsyn); if (V_tcp_insecure_syn && SEQ_GEQ(th->th_seq, tp->last_ack_sent) && @@ -2288,8 +2195,6 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru */ if ((so->so_state & SS_NOFDREF) && tp->t_state > TCPS_CLOSE_WAIT && tlen) { - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); - if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { log(LOG_DEBUG, "%s; %s: %s: Received %d bytes of data " "after socket was closed, " @@ -2875,7 +2780,6 @@ process_ACK: */ case TCPS_CLOSING: if (ourfinisacked) { - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); tcp_twstart(tp); m_freem(m); return; @@ -2890,7 +2794,6 @@ process_ACK: */ case TCPS_LAST_ACK: if (ourfinisacked) { - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); tp = tcp_close(tp); goto drop; } @@ -3139,8 +3042,6 @@ dodata: /* XXX */ * standard timers. */ case TCPS_FIN_WAIT_2: - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); - tcp_twstart(tp); return; } Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Thu Nov 7 21:14:59 2019 (r354482) +++ head/sys/netinet/tcp_stacks/bbr.c Thu Nov 7 21:23:07 2019 (r354483) @@ -8618,7 +8618,6 @@ dodata: /* XXX */ bbr->rc_timer_first = 1; bbr_timer_cancel(bbr, __LINE__, bbr->r_ctl.rc_rcvtime); - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(tp->t_inpcb); tcp_twstart(tp); return (1); @@ -9619,7 +9618,6 @@ bbr_check_data_after_close(struct mbuf *m, struct tcp_ struct tcpcb *tp, int32_t * tlen, struct tcphdr *th, struct socket *so) { - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); if (bbr->rc_allow_data_af_clo == 0) { close_now: tp = tcp_close(tp); @@ -9861,7 +9859,6 @@ bbr_do_closing(struct mbuf *m, struct tcphdr *th, stru return (ret_val); } if (ourfinisacked) { - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); tcp_twstart(tp); m_freem(m); return (1); @@ -9974,7 +9971,6 @@ bbr_do_lastack(struct mbuf *m, struct tcphdr *th, stru return (ret_val); } if (ourfinisacked) { - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); tp = tcp_close(tp); ctf_do_drop(m, tp); return (1); Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Thu Nov 7 21:14:59 2019 (r354482) +++ head/sys/netinet/tcp_stacks/rack.c Thu Nov 7 21:23:07 2019 (r354483) @@ -5875,7 +5875,6 @@ dodata: /* XXX */ case TCPS_FIN_WAIT_2: rack_timer_cancel(tp, rack, rack->r_ctl.rc_rcvtime, __LINE__); - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); tcp_twstart(tp); return (1); } @@ -6353,7 +6352,6 @@ rack_do_syn_sent(struct mbuf *m, struct tcphdr *th, st tp->t_flags |= (TF_ACKNOW | TF_NEEDSYN); tcp_state_change(tp, TCPS_SYN_RECEIVED); } - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(tp->t_inpcb); /* * Advance th->th_seq to correspond to first data byte. If data, @@ -6847,7 +6845,6 @@ rack_check_data_after_close(struct mbuf *m, { struct tcp_rack *rack; - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); rack = (struct tcp_rack *)tp->t_fb_ptr; if (rack->rc_allow_data_af_clo == 0) { close_now: @@ -7079,7 +7076,6 @@ rack_do_closing(struct mbuf *m, struct tcphdr *th, str return (ret_val); } if (ourfinisacked) { - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); tcp_twstart(tp); m_freem(m); return (1); @@ -7187,7 +7183,6 @@ rack_do_lastack(struct mbuf *m, struct tcphdr *th, str return (ret_val); } if (ourfinisacked) { - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); tp = tcp_close(tp); ctf_do_drop(m, tp); return (1); @@ -7650,16 +7645,8 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr kern_prefetch(rack, &prev_state); prev_state = 0; thflags = th->th_flags; - /* - * If this is either a state-changing packet or current state isn't - * established, we require a read lock on tcbinfo. Otherwise, we - * allow the tcbinfo to be in either locked or unlocked, as the - * caller may have unnecessarily acquired a lock due to a race. - */ - if ((thflags & (TH_SYN | TH_FIN | TH_RST)) != 0 || - tp->t_state != TCPS_ESTABLISHED) { - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); - } + + NET_EPOCH_ASSERT(); INP_WLOCK_ASSERT(tp->t_inpcb); KASSERT(tp->t_state > TCPS_LISTEN, ("%s: TCPS_LISTEN", __func__)); Modified: head/sys/netinet/tcp_stacks/rack_bbr_common.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack_bbr_common.c Thu Nov 7 21:14:59 2019 (r354482) +++ head/sys/netinet/tcp_stacks/rack_bbr_common.c Thu Nov 7 21:23:07 2019 (r354483) @@ -253,7 +253,6 @@ ctf_process_inbound_raw(struct tcpcb *tp, struct socke */ struct mbuf *m_save; struct ether_header *eh; - struct epoch_tracker et; struct tcphdr *th; #ifdef INET6 struct ip6_hdr *ip6 = NULL; /* Keep compiler happy. */ @@ -268,14 +267,8 @@ ctf_process_inbound_raw(struct tcpcb *tp, struct socke uint16_t drop_hdrlen; uint8_t iptos, no_vn=0, bpf_req=0; - /* - * This is a bit deceptive, we get the - * "info epoch" which is really the network - * epoch. This covers us on both any INP - * type change but also if the ifp goes - * away it covers us as well. - */ - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ASSERT(); + if (m && m->m_pkthdr.rcvif) ifp = m->m_pkthdr.rcvif; else @@ -445,7 +438,6 @@ skip_vnet: } if (no_vn == 0) CURVNET_RESTORE(); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); return(retval); } skipped_pkt: @@ -453,7 +445,6 @@ skipped_pkt: } if (no_vn == 0) CURVNET_RESTORE(); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); return(retval); } @@ -680,7 +671,6 @@ ctf_process_rst(struct mbuf *m, struct tcphdr *th, str SEQ_LT(th->th_seq, tp->last_ack_sent + tp->rcv_wnd)) || (tp->rcv_wnd == 0 && tp->last_ack_sent == th->th_seq)) { - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); KASSERT(tp->t_state != TCPS_SYN_SENT, ("%s: TH_RST for TCPS_SYN_SENT th %p tp %p", __func__, th, tp)); @@ -732,7 +722,8 @@ ctf_process_rst(struct mbuf *m, struct tcphdr *th, str void ctf_challenge_ack(struct mbuf *m, struct tcphdr *th, struct tcpcb *tp, int32_t * ret_val) { - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + + NET_EPOCH_ASSERT(); TCPSTAT_INC(tcps_badsyn); if (V_tcp_insecure_syn && From owner-svn-src-head@freebsd.org Thu Nov 7 21:27:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F2C317A0D9; Thu, 7 Nov 2019 21:27:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478GhQ260Tz4NN7; Thu, 7 Nov 2019 21:27:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BD121BFEF; Thu, 7 Nov 2019 21:27:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7LRYjb096368; Thu, 7 Nov 2019 21:27:34 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7LRXis096363; Thu, 7 Nov 2019 21:27:33 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911072127.xA7LRXis096363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Nov 2019 21:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354484 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 354484 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 21:27:34 -0000 Author: glebius Date: Thu Nov 7 21:27:32 2019 New Revision: 354484 URL: https://svnweb.freebsd.org/changeset/base/354484 Log: Now that there is no R/W lock on PCB list the pcblist sysctls handlers can be greatly simplified. All the previous double cycling and complex locking was added to avoid these functions holding global PCB locks for extended period of time, preventing addition of new entries. Modified: head/sys/netinet/ip_divert.c head/sys/netinet/raw_ip.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_syncache.h head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Thu Nov 7 21:23:07 2019 (r354483) +++ head/sys/netinet/ip_divert.c Thu Nov 7 21:27:32 2019 (r354484) @@ -629,71 +629,41 @@ div_ctlinput(int cmd, struct sockaddr *sa, void *vip) static int div_pcblist(SYSCTL_HANDLER_ARGS) { - int error, i, n; - struct inpcb *inp, **inp_list; - inp_gen_t gencnt; struct xinpgen xig; struct epoch_tracker et; + struct inpcb *inp; + int error; - /* - * The process of preparing the TCB list is too time-consuming and - * resource-intensive to repeat twice on every request. - */ + if (req->newptr != 0) + return EPERM; + if (req->oldptr == 0) { + int n; + n = V_divcbinfo.ipi_count; n += imax(n / 8, 10); req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xinpcb); return 0; } - if (req->newptr != 0) - return EPERM; - - /* - * OK, now we're committed to doing something. - */ - INP_INFO_WLOCK(&V_divcbinfo); - gencnt = V_divcbinfo.ipi_gencnt; - n = V_divcbinfo.ipi_count; - INP_INFO_WUNLOCK(&V_divcbinfo); - - error = sysctl_wire_old_buffer(req, - 2 * sizeof(xig) + n*sizeof(struct xinpcb)); - if (error != 0) + if ((error = sysctl_wire_old_buffer(req, 0)) != 0) return (error); bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; - xig.xig_count = n; - xig.xig_gen = gencnt; + xig.xig_count = V_divcbinfo.ipi_count; + xig.xig_gen = V_divcbinfo.ipi_gencnt; xig.xig_sogen = so_gencnt; error = SYSCTL_OUT(req, &xig, sizeof xig); if (error) return error; - inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK); - if (inp_list == NULL) - return ENOMEM; - - INP_INFO_RLOCK_ET(&V_divcbinfo, et); - for (inp = CK_LIST_FIRST(V_divcbinfo.ipi_listhead), i = 0; inp && i < n; - inp = CK_LIST_NEXT(inp, inp_list)) { - INP_WLOCK(inp); - if (inp->inp_gencnt <= gencnt && - cr_canseeinpcb(req->td->td_ucred, inp) == 0) { - in_pcbref(inp); - inp_list[i++] = inp; - } - INP_WUNLOCK(inp); - } - INP_INFO_RUNLOCK_ET(&V_divcbinfo, et); - n = i; - - error = 0; - for (i = 0; i < n; i++) { - inp = inp_list[i]; + NET_EPOCH_ENTER(et); + for (inp = CK_LIST_FIRST(V_divcbinfo.ipi_listhead); + inp != NULL; + inp = CK_LIST_NEXT(inp, inp_list)) { INP_RLOCK(inp); - if (inp->inp_gencnt <= gencnt) { + if (inp->inp_gencnt <= xig.xig_gen) { struct xinpcb xi; in_pcbtoxinpcb(inp, &xi); @@ -702,17 +672,9 @@ div_pcblist(SYSCTL_HANDLER_ARGS) } else INP_RUNLOCK(inp); } - INP_INFO_WLOCK(&V_divcbinfo); - for (i = 0; i < n; i++) { - inp = inp_list[i]; - INP_RLOCK(inp); - if (!in_pcbrele_rlocked(inp)) - INP_RUNLOCK(inp); - } - INP_INFO_WUNLOCK(&V_divcbinfo); + NET_EPOCH_EXIT(et); if (!error) { - struct epoch_tracker et; /* * Give the user an updated idea of our state. * If the generation differs from what we told @@ -720,15 +682,13 @@ div_pcblist(SYSCTL_HANDLER_ARGS) * while we were processing this request, and it * might be necessary to retry. */ - INP_INFO_RLOCK_ET(&V_divcbinfo, et); xig.xig_gen = V_divcbinfo.ipi_gencnt; xig.xig_sogen = so_gencnt; xig.xig_count = V_divcbinfo.ipi_count; - INP_INFO_RUNLOCK_ET(&V_divcbinfo, et); error = SYSCTL_OUT(req, &xig, sizeof xig); } - free(inp_list, M_TEMP); - return error; + + return (error); } #ifdef SYSCTL_NODE Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Thu Nov 7 21:23:07 2019 (r354483) +++ head/sys/netinet/raw_ip.c Thu Nov 7 21:27:32 2019 (r354484) @@ -1067,97 +1067,67 @@ rip_send(struct socket *so, int flags, struct mbuf *m, static int rip_pcblist(SYSCTL_HANDLER_ARGS) { - int error, i, n; - struct inpcb *inp, **inp_list; - inp_gen_t gencnt; struct xinpgen xig; struct epoch_tracker et; + struct inpcb *inp; + int error; - /* - * The process of preparing the TCB list is too time-consuming and - * resource-intensive to repeat twice on every request. - */ + if (req->newptr != 0) + return (EPERM); + if (req->oldptr == 0) { + int n; + n = V_ripcbinfo.ipi_count; n += imax(n / 8, 10); req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xinpcb); return (0); } - if (req->newptr != 0) - return (EPERM); + if ((error = sysctl_wire_old_buffer(req, 0)) != 0) + return (error); - /* - * OK, now we're committed to doing something. - */ - INP_INFO_WLOCK(&V_ripcbinfo); - gencnt = V_ripcbinfo.ipi_gencnt; - n = V_ripcbinfo.ipi_count; - INP_INFO_WUNLOCK(&V_ripcbinfo); - bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; - xig.xig_count = n; - xig.xig_gen = gencnt; + xig.xig_count = V_ripcbinfo.ipi_count; + xig.xig_gen = V_ripcbinfo.ipi_gencnt; xig.xig_sogen = so_gencnt; error = SYSCTL_OUT(req, &xig, sizeof xig); if (error) return (error); - inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK); - - INP_INFO_RLOCK_ET(&V_ripcbinfo, et); - for (inp = CK_LIST_FIRST(V_ripcbinfo.ipi_listhead), i = 0; inp && i < n; - inp = CK_LIST_NEXT(inp, inp_list)) { - INP_WLOCK(inp); - if (inp->inp_gencnt <= gencnt && - cr_canseeinpcb(req->td->td_ucred, inp) == 0) { - in_pcbref(inp); - inp_list[i++] = inp; - } - INP_WUNLOCK(inp); - } - INP_INFO_RUNLOCK_ET(&V_ripcbinfo, et); - n = i; - - error = 0; - for (i = 0; i < n; i++) { - inp = inp_list[i]; + NET_EPOCH_ENTER(et); + for (inp = CK_LIST_FIRST(V_ripcbinfo.ipi_listhead); + inp != NULL; + inp = CK_LIST_NEXT(inp, inp_list)) { INP_RLOCK(inp); - if (inp->inp_gencnt <= gencnt) { + if (inp->inp_gencnt <= xig.xig_gen && + cr_canseeinpcb(req->td->td_ucred, inp) == 0) { struct xinpcb xi; in_pcbtoxinpcb(inp, &xi); INP_RUNLOCK(inp); error = SYSCTL_OUT(req, &xi, sizeof xi); + if (error) + break; } else INP_RUNLOCK(inp); } - INP_INFO_WLOCK(&V_ripcbinfo); - for (i = 0; i < n; i++) { - inp = inp_list[i]; - INP_RLOCK(inp); - if (!in_pcbrele_rlocked(inp)) - INP_RUNLOCK(inp); - } - INP_INFO_WUNLOCK(&V_ripcbinfo); + NET_EPOCH_EXIT(et); if (!error) { - struct epoch_tracker et; /* * Give the user an updated idea of our state. If the * generation differs from what we told her before, she knows * that something happened while we were processing this * request, and it might be necessary to retry. */ - INP_INFO_RLOCK_ET(&V_ripcbinfo, et); xig.xig_gen = V_ripcbinfo.ipi_gencnt; xig.xig_sogen = so_gencnt; xig.xig_count = V_ripcbinfo.ipi_count; - INP_INFO_RUNLOCK_ET(&V_ripcbinfo, et); error = SYSCTL_OUT(req, &xig, sizeof xig); } - free(inp_list, M_TEMP); + return (error); } Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Nov 7 21:23:07 2019 (r354483) +++ head/sys/netinet/tcp_subr.c Thu Nov 7 21:27:32 2019 (r354484) @@ -2127,17 +2127,17 @@ tcp_notify(struct inpcb *inp, int error) static int tcp_pcblist(SYSCTL_HANDLER_ARGS) { - int error, i, m, n, pcb_count; - struct inpcb *inp, **inp_list; - inp_gen_t gencnt; - struct xinpgen xig; struct epoch_tracker et; + struct inpcb *inp; + struct xinpgen xig; + int error; - /* - * The process of preparing the TCB list is too time-consuming and - * resource-intensive to repeat twice on every request. - */ + if (req->newptr != NULL) + return (EPERM); + if (req->oldptr == NULL) { + int n; + n = V_tcbinfo.ipi_count + counter_u64_fetch(V_tcps_states[TCPS_SYN_RECEIVED]); n += imax(n / 8, 10); @@ -2145,44 +2145,29 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) return (0); } - if (req->newptr != NULL) - return (EPERM); - - /* - * OK, now we're committed to doing something. - */ - INP_LIST_RLOCK(&V_tcbinfo); - gencnt = V_tcbinfo.ipi_gencnt; - n = V_tcbinfo.ipi_count; - INP_LIST_RUNLOCK(&V_tcbinfo); - - m = counter_u64_fetch(V_tcps_states[TCPS_SYN_RECEIVED]); - - error = sysctl_wire_old_buffer(req, 2 * (sizeof xig) - + (n + m) * sizeof(struct xtcpcb)); - if (error != 0) + if ((error = sysctl_wire_old_buffer(req, 0)) != 0) return (error); bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; - xig.xig_count = n + m; - xig.xig_gen = gencnt; + xig.xig_count = V_tcbinfo.ipi_count + + counter_u64_fetch(V_tcps_states[TCPS_SYN_RECEIVED]); + xig.xig_gen = V_tcbinfo.ipi_gencnt; xig.xig_sogen = so_gencnt; error = SYSCTL_OUT(req, &xig, sizeof xig); if (error) return (error); - error = syncache_pcblist(req, m, &pcb_count); + error = syncache_pcblist(req); if (error) return (error); - inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK); - - INP_INFO_WLOCK(&V_tcbinfo); - for (inp = CK_LIST_FIRST(V_tcbinfo.ipi_listhead), i = 0; - inp != NULL && i < n; inp = CK_LIST_NEXT(inp, inp_list)) { - INP_WLOCK(inp); - if (inp->inp_gencnt <= gencnt) { + NET_EPOCH_ENTER(et); + for (inp = CK_LIST_FIRST(V_tcbinfo.ipi_listhead); + inp != NULL; + inp = CK_LIST_NEXT(inp, inp_list)) { + INP_RLOCK(inp); + if (inp->inp_gencnt <= xig.xig_gen) { /* * XXX: This use of cr_cansee(), introduced with * TCP state changes, is not quite right, but for @@ -2197,36 +2182,18 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) } else error = cr_canseeinpcb(req->td->td_ucred, inp); if (error == 0) { - in_pcbref(inp); - inp_list[i++] = inp; - } - } - INP_WUNLOCK(inp); - } - INP_INFO_WUNLOCK(&V_tcbinfo); - n = i; + struct xtcpcb xt; - error = 0; - for (i = 0; i < n; i++) { - inp = inp_list[i]; - INP_RLOCK(inp); - if (inp->inp_gencnt <= gencnt) { - struct xtcpcb xt; - - tcp_inptoxtp(inp, &xt); - INP_RUNLOCK(inp); - error = SYSCTL_OUT(req, &xt, sizeof xt); + tcp_inptoxtp(inp, &xt); + INP_RUNLOCK(inp); + error = SYSCTL_OUT(req, &xt, sizeof xt); + if (error) + break; + } } else INP_RUNLOCK(inp); } - INP_INFO_RLOCK_ET(&V_tcbinfo, et); - for (i = 0; i < n; i++) { - inp = inp_list[i]; - INP_RLOCK(inp); - if (!in_pcbrele_rlocked(inp)) - INP_RUNLOCK(inp); - } - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); if (!error) { /* @@ -2236,14 +2203,13 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) * while we were processing this request, and it * might be necessary to retry. */ - INP_LIST_RLOCK(&V_tcbinfo); xig.xig_gen = V_tcbinfo.ipi_gencnt; xig.xig_sogen = so_gencnt; - xig.xig_count = V_tcbinfo.ipi_count + pcb_count; - INP_LIST_RUNLOCK(&V_tcbinfo); + xig.xig_count = V_tcbinfo.ipi_count + + counter_u64_fetch(V_tcps_states[TCPS_SYN_RECEIVED]); error = SYSCTL_OUT(req, &xig, sizeof xig); } - free(inp_list, M_TEMP); + return (error); } Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Thu Nov 7 21:23:07 2019 (r354483) +++ head/sys/netinet/tcp_syncache.c Thu Nov 7 21:27:32 2019 (r354484) @@ -2452,46 +2452,41 @@ syncache_unpause(void *arg) * amount of space the caller allocated for this function to use. */ int -syncache_pcblist(struct sysctl_req *req, int max_pcbs, int *pcbs_exported) +syncache_pcblist(struct sysctl_req *req) { struct xtcpcb xt; struct syncache *sc; struct syncache_head *sch; - int count, error, i; + int error, i; - for (count = 0, error = 0, i = 0; i < V_tcp_syncache.hashsize; i++) { + bzero(&xt, sizeof(xt)); + xt.xt_len = sizeof(xt); + xt.t_state = TCPS_SYN_RECEIVED; + xt.xt_inp.xi_socket.xso_protocol = IPPROTO_TCP; + xt.xt_inp.xi_socket.xso_len = sizeof (struct xsocket); + xt.xt_inp.xi_socket.so_type = SOCK_STREAM; + xt.xt_inp.xi_socket.so_state = SS_ISCONNECTING; + + for (i = 0; i < V_tcp_syncache.hashsize; i++) { sch = &V_tcp_syncache.hashbase[i]; SCH_LOCK(sch); TAILQ_FOREACH(sc, &sch->sch_bucket, sc_hash) { - if (count >= max_pcbs) { - SCH_UNLOCK(sch); - goto exit; - } if (cr_cansee(req->td->td_ucred, sc->sc_cred) != 0) continue; - bzero(&xt, sizeof(xt)); - xt.xt_len = sizeof(xt); if (sc->sc_inc.inc_flags & INC_ISIPV6) xt.xt_inp.inp_vflag = INP_IPV6; else xt.xt_inp.inp_vflag = INP_IPV4; bcopy(&sc->sc_inc, &xt.xt_inp.inp_inc, sizeof (struct in_conninfo)); - xt.t_state = TCPS_SYN_RECEIVED; - xt.xt_inp.xi_socket.xso_protocol = IPPROTO_TCP; - xt.xt_inp.xi_socket.xso_len = sizeof (struct xsocket); - xt.xt_inp.xi_socket.so_type = SOCK_STREAM; - xt.xt_inp.xi_socket.so_state = SS_ISCONNECTING; error = SYSCTL_OUT(req, &xt, sizeof xt); if (error) { SCH_UNLOCK(sch); - goto exit; + return (0); } - count++; } SCH_UNLOCK(sch); } -exit: - *pcbs_exported = count; - return error; + + return (0); } Modified: head/sys/netinet/tcp_syncache.h ============================================================================== --- head/sys/netinet/tcp_syncache.h Thu Nov 7 21:23:07 2019 (r354483) +++ head/sys/netinet/tcp_syncache.h Thu Nov 7 21:27:32 2019 (r354484) @@ -48,7 +48,7 @@ int syncache_add(struct in_conninfo *, struct tcpopt void *, void *); void syncache_chkrst(struct in_conninfo *, struct tcphdr *, struct mbuf *); void syncache_badack(struct in_conninfo *); -int syncache_pcblist(struct sysctl_req *req, int max_pcbs, int *pcbs_exported); +int syncache_pcblist(struct sysctl_req *); struct syncache { TAILQ_ENTRY(syncache) sc_hash; Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Thu Nov 7 21:23:07 2019 (r354483) +++ head/sys/netinet/udp_usrreq.c Thu Nov 7 21:27:32 2019 (r354484) @@ -851,87 +851,53 @@ udplite_ctlinput(int cmd, struct sockaddr *sa, void *v static int udp_pcblist(SYSCTL_HANDLER_ARGS) { - int error, i, n; - struct inpcb *inp, **inp_list; - inp_gen_t gencnt; struct xinpgen xig; struct epoch_tracker et; + struct inpcb *inp; + int error; - /* - * The process of preparing the PCB list is too time-consuming and - * resource-intensive to repeat twice on every request. - */ + if (req->newptr != 0) + return (EPERM); + if (req->oldptr == 0) { + int n; + n = V_udbinfo.ipi_count; n += imax(n / 8, 10); req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xinpcb); return (0); } - if (req->newptr != 0) - return (EPERM); - - /* - * OK, now we're committed to doing something. - */ - INP_INFO_RLOCK_ET(&V_udbinfo, et); - gencnt = V_udbinfo.ipi_gencnt; - n = V_udbinfo.ipi_count; - INP_INFO_RUNLOCK_ET(&V_udbinfo, et); - - error = sysctl_wire_old_buffer(req, 2 * (sizeof xig) - + n * sizeof(struct xinpcb)); - if (error != 0) + if ((error = sysctl_wire_old_buffer(req, 0)) != 0) return (error); bzero(&xig, sizeof(xig)); xig.xig_len = sizeof xig; - xig.xig_count = n; - xig.xig_gen = gencnt; + xig.xig_count = V_udbinfo.ipi_count; + xig.xig_gen = V_udbinfo.ipi_gencnt; xig.xig_sogen = so_gencnt; error = SYSCTL_OUT(req, &xig, sizeof xig); if (error) return (error); - inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK); - if (inp_list == NULL) - return (ENOMEM); - - INP_INFO_RLOCK_ET(&V_udbinfo, et); - for (inp = CK_LIST_FIRST(V_udbinfo.ipi_listhead), i = 0; inp && i < n; - inp = CK_LIST_NEXT(inp, inp_list)) { - INP_WLOCK(inp); - if (inp->inp_gencnt <= gencnt && - cr_canseeinpcb(req->td->td_ucred, inp) == 0) { - in_pcbref(inp); - inp_list[i++] = inp; - } - INP_WUNLOCK(inp); - } - INP_INFO_RUNLOCK_ET(&V_udbinfo, et); - n = i; - - error = 0; - for (i = 0; i < n; i++) { - inp = inp_list[i]; + NET_EPOCH_ENTER(et); + for (inp = CK_LIST_FIRST(V_udbinfo.ipi_listhead); + inp != NULL; + inp = CK_LIST_NEXT(inp, inp_list)) { INP_RLOCK(inp); - if (inp->inp_gencnt <= gencnt) { + if (inp->inp_gencnt <= xig.xig_gen && + cr_canseeinpcb(req->td->td_ucred, inp) == 0) { struct xinpcb xi; in_pcbtoxinpcb(inp, &xi); INP_RUNLOCK(inp); error = SYSCTL_OUT(req, &xi, sizeof xi); + if (error) + break; } else INP_RUNLOCK(inp); } - INP_INFO_WLOCK(&V_udbinfo); - for (i = 0; i < n; i++) { - inp = inp_list[i]; - INP_RLOCK(inp); - if (!in_pcbrele_rlocked(inp)) - INP_RUNLOCK(inp); - } - INP_INFO_WUNLOCK(&V_udbinfo); + NET_EPOCH_EXIT(et); if (!error) { /* @@ -940,14 +906,12 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) * that something happened while we were processing this * request, and it might be necessary to retry. */ - INP_INFO_RLOCK_ET(&V_udbinfo, et); xig.xig_gen = V_udbinfo.ipi_gencnt; xig.xig_sogen = so_gencnt; xig.xig_count = V_udbinfo.ipi_count; - INP_INFO_RUNLOCK_ET(&V_udbinfo, et); error = SYSCTL_OUT(req, &xig, sizeof xig); } - free(inp_list, M_TEMP); + return (error); } From owner-svn-src-head@freebsd.org Thu Nov 7 21:28:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 378D817A210; Thu, 7 Nov 2019 21:28:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478Gjq0kZCz4Nc5; Thu, 7 Nov 2019 21:28:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F08D01BFF3; Thu, 7 Nov 2019 21:28:46 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7LSkU4096586; Thu, 7 Nov 2019 21:28:46 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7LSknp096585; Thu, 7 Nov 2019 21:28:46 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911072128.xA7LSknp096585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Nov 2019 21:28:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354485 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 354485 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 21:28:47 -0000 Author: glebius Date: Thu Nov 7 21:28:46 2019 New Revision: 354485 URL: https://svnweb.freebsd.org/changeset/base/354485 Log: Since pfslowtimo() runs in the network epoch, tcp_slowtimo() also does. This allows to simplify tcp_tw_2msl_scan() and always require the network epoch in it. Modified: head/sys/netinet/tcp_timewait.c Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Thu Nov 7 21:27:32 2019 (r354484) +++ head/sys/netinet/tcp_timewait.c Thu Nov 7 21:28:46 2019 (r354485) @@ -689,25 +689,8 @@ tcp_tw_2msl_scan(int reuse) { struct tcptw *tw; struct inpcb *inp; - struct epoch_tracker et; -#ifdef INVARIANTS - if (reuse) { - /* - * Exclusive pcbinfo lock is not required in reuse case even if - * two inpcb locks can be acquired simultaneously: - * - the inpcb transitioning to TIME_WAIT state in - * tcp_tw_start(), - * - the inpcb closed by tcp_twclose(). - * - * It is because only inpcbs in FIN_WAIT2 or CLOSING states can - * transition in TIME_WAIT state. Then a pcbcb cannot be in - * TIME_WAIT list and transitioning to TIME_WAIT state at same - * time. - */ - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); - } -#endif + NET_EPOCH_ASSERT(); for (;;) { TW_RLOCK(V_tw_lock); @@ -723,12 +706,10 @@ tcp_tw_2msl_scan(int reuse) in_pcbref(inp); TW_RUNLOCK(V_tw_lock); - INP_INFO_RLOCK_ET(&V_tcbinfo, et); INP_WLOCK(inp); tw = intotw(inp); if (in_pcbrele_wlocked(inp)) { if (__predict_true(tw == NULL)) { - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); continue; } else { /* This should not happen as in TIMEWAIT @@ -747,7 +728,6 @@ tcp_tw_2msl_scan(int reuse) "|| inp last reference) && tw != " "NULL", __func__); #endif - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); break; } } @@ -755,12 +735,10 @@ tcp_tw_2msl_scan(int reuse) if (tw == NULL) { /* tcp_twclose() has already been called */ INP_WUNLOCK(inp); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); continue; } tcp_twclose(tw, reuse); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); if (reuse) return tw; } From owner-svn-src-head@freebsd.org Thu Nov 7 21:29:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B02B17A2EE; Thu, 7 Nov 2019 21:29:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478Gkp6cFXz4Nlk; Thu, 7 Nov 2019 21:29:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC1761BFFA; Thu, 7 Nov 2019 21:29:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7LTcee096668; Thu, 7 Nov 2019 21:29:38 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7LTcBg096667; Thu, 7 Nov 2019 21:29:38 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911072129.xA7LTcBg096667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Nov 2019 21:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354486 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 354486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 21:29:39 -0000 Author: glebius Date: Thu Nov 7 21:29:38 2019 New Revision: 354486 URL: https://svnweb.freebsd.org/changeset/base/354486 Log: Mechanically convert INP_INFO_RLOCK() to NET_EPOCH_ENTER() in TCP timewait manipulation leaf functions. Modified: head/sys/netinet/tcp_timewait.c Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Thu Nov 7 21:28:46 2019 (r354485) +++ head/sys/netinet/tcp_timewait.c Thu Nov 7 21:29:38 2019 (r354486) @@ -209,10 +209,10 @@ tcp_tw_destroy(void) struct tcptw *tw; struct epoch_tracker et; - INP_INFO_RLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_ENTER(et); while ((tw = TAILQ_FIRST(&V_twq_2msl)) != NULL) tcp_twclose(tw, 0); - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); + NET_EPOCH_EXIT(et); TW_LOCK_DESTROY(V_tw_lock); uma_zdestroy(V_tcptw_zone); @@ -236,7 +236,7 @@ tcp_twstart(struct tcpcb *tp) bool isipv6 = inp->inp_inc.inc_flags & INC_ISIPV6; #endif - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + NET_EPOCH_ASSERT(); INP_WLOCK_ASSERT(inp); /* A dropped inp should never transition to TIME_WAIT state. */ @@ -382,7 +382,7 @@ tcp_twcheck(struct inpcb *inp, struct tcpopt *to __unu int thflags; tcp_seq seq; - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + NET_EPOCH_ASSERT(); INP_WLOCK_ASSERT(inp); /* @@ -488,7 +488,7 @@ tcp_twclose(struct tcptw *tw, int reuse) inp = tw->tw_inpcb; KASSERT((inp->inp_flags & INP_TIMEWAIT), ("tcp_twclose: !timewait")); KASSERT(intotw(inp) == tw, ("tcp_twclose: inp_ppcb != tw")); - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); /* in_pcbfree() */ + NET_EPOCH_ASSERT(); INP_WLOCK_ASSERT(inp); tcp_tw_2msl_stop(tw, reuse); @@ -644,7 +644,7 @@ static void tcp_tw_2msl_reset(struct tcptw *tw, int rearm) { - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + NET_EPOCH_ASSERT(); INP_WLOCK_ASSERT(tw->tw_inpcb); TW_WLOCK(V_tw_lock); @@ -662,7 +662,7 @@ tcp_tw_2msl_stop(struct tcptw *tw, int reuse) struct inpcb *inp; int released __unused; - INP_INFO_RLOCK_ASSERT(&V_tcbinfo); + NET_EPOCH_ASSERT(); TW_WLOCK(V_tw_lock); inp = tw->tw_inpcb; From owner-svn-src-head@freebsd.org Thu Nov 7 21:30:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C91F317A3C3; Thu, 7 Nov 2019 21:30:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478Gll4wGlz4Nth; Thu, 7 Nov 2019 21:30:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C0E21BFFF; Thu, 7 Nov 2019 21:30:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7LURr8096783; Thu, 7 Nov 2019 21:30:27 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7LURuL096782; Thu, 7 Nov 2019 21:30:27 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911072130.xA7LURuL096782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Nov 2019 21:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354487 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 354487 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 21:30:27 -0000 Author: glebius Date: Thu Nov 7 21:30:27 2019 New Revision: 354487 URL: https://svnweb.freebsd.org/changeset/base/354487 Log: In TCP HPTS enter the epoch in tcp_hpts_thread() and assert it in the leaf functions. Modified: head/sys/netinet/tcp_hpts.c Modified: head/sys/netinet/tcp_hpts.c ============================================================================== --- head/sys/netinet/tcp_hpts.c Thu Nov 7 21:29:38 2019 (r354486) +++ head/sys/netinet/tcp_hpts.c Thu Nov 7 21:30:27 2019 (r354487) @@ -1245,12 +1245,10 @@ tcp_input_data(struct tcp_hpts_entry *hpts, struct tim int16_t set_cpu; uint32_t did_prefetch = 0; int dropped; - struct epoch_tracker et; HPTS_MTX_ASSERT(hpts); -#ifndef VIMAGE - INP_INFO_RLOCK_ET(&V_tcbinfo, et); -#endif + NET_EPOCH_ASSERT(); + while ((inp = TAILQ_FIRST(&hpts->p_input)) != NULL) { HPTS_MTX_ASSERT(hpts); hpts_sane_input_remove(hpts, inp, 0); @@ -1266,7 +1264,6 @@ tcp_input_data(struct tcp_hpts_entry *hpts, struct tim INP_WLOCK(inp); #ifdef VIMAGE CURVNET_SET(inp->inp_vnet); - INP_INFO_RLOCK_ET(&V_tcbinfo, et); #endif if ((inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) || (inp->inp_flags2 & INP_FREED)) { @@ -1276,7 +1273,6 @@ out: INP_WUNLOCK(inp); } #ifdef VIMAGE - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); CURVNET_RESTORE(); #endif mtx_lock(&hpts->p_mtx); @@ -1296,7 +1292,6 @@ out: if (in_pcbrele_wlocked(inp) == 0) INP_WUNLOCK(inp); #ifdef VIMAGE - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); CURVNET_RESTORE(); #endif mtx_lock(&hpts->p_mtx); @@ -1349,22 +1344,16 @@ out: INP_WUNLOCK(inp); INP_UNLOCK_ASSERT(inp); #ifdef VIMAGE - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); CURVNET_RESTORE(); #endif mtx_lock(&hpts->p_mtx); hpts->p_inp = NULL; } -#ifndef VIMAGE - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); - INP_INFO_UNLOCK_ASSERT(&V_tcbinfo); -#endif } static void tcp_hptsi(struct tcp_hpts_entry *hpts) { - struct epoch_tracker et; struct tcpcb *tp; struct inpcb *inp = NULL, *ninp; struct timeval tv; @@ -1378,6 +1367,8 @@ tcp_hptsi(struct tcp_hpts_entry *hpts) int16_t set_cpu; HPTS_MTX_ASSERT(hpts); + NET_EPOCH_ASSERT(); + /* record previous info for any logging */ hpts->saved_lasttick = hpts->p_lasttick; hpts->saved_curtick = hpts->p_curtick; @@ -1469,9 +1460,6 @@ again: goto no_one; } HPTS_MTX_ASSERT(hpts); -#ifndef VIMAGE - INP_INFO_RLOCK_ET(&V_tcbinfo, et); -#endif for (i = 0; i < ticks_to_run; i++) { /* * Calculate our delay, if there are no extra ticks there @@ -1586,7 +1574,6 @@ again: } #ifdef VIMAGE CURVNET_SET(inp->inp_vnet); - INP_INFO_RLOCK_ET(&V_tcbinfo, et); #endif /* Lets do any logging that we might want to */ if (hpts_does_tp_logging && (tp->t_logstate != TCP_LOG_STATE_OFF)) { @@ -1658,7 +1645,6 @@ again: INP_WUNLOCK(inp); skip_pacing: #ifdef VIMAGE - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); CURVNET_RESTORE(); #endif INP_UNLOCK_ASSERT(inp); @@ -1678,9 +1664,6 @@ again: hpts->p_runningtick = 0; } } -#ifndef VIMAGE - INP_INFO_RUNLOCK_ET(&V_tcbinfo, et); -#endif no_one: HPTS_MTX_ASSERT(hpts); hpts->p_delayed_by = 0; @@ -1820,6 +1803,7 @@ static void tcp_hpts_thread(void *ctx) { struct tcp_hpts_entry *hpts; + struct epoch_tracker et; struct timeval tv; sbintime_t sb; @@ -1839,7 +1823,9 @@ tcp_hpts_thread(void *ctx) } hpts->p_hpts_wake_scheduled = 0; hpts->p_hpts_active = 1; + NET_EPOCH_ENTER(et); tcp_hptsi(hpts); + NET_EPOCH_EXIT(et); HPTS_MTX_ASSERT(hpts); tv.tv_sec = 0; tv.tv_usec = hpts->p_hpts_sleep_time * HPTS_TICKS_PER_USEC; From owner-svn-src-head@freebsd.org Thu Nov 7 21:31:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 035A417A468; Thu, 7 Nov 2019 21:31:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478Gmg6MgXz4PB9; Thu, 7 Nov 2019 21:31:15 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDC771C041; Thu, 7 Nov 2019 21:31:15 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7LVFgD099080; Thu, 7 Nov 2019 21:31:15 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7LVFW7099079; Thu, 7 Nov 2019 21:31:15 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201911072131.xA7LVFW7099079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 7 Nov 2019 21:31:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354488 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 354488 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 21:31:16 -0000 Author: kevans Date: Thu Nov 7 21:31:15 2019 New Revision: 354488 URL: https://svnweb.freebsd.org/changeset/base/354488 Log: bcm_lintc: don't attach if "interrupt-controller" is missing This is a standard required property for interrupt controllers, and present on the bcm_lintc nodes for currently supported RPi models. For the RPi4, we have both bcm_lintc as well as GIC-400, but only one may be active at a time. Don't probe bcm_lintc if it's missing the "interrupt-controller" property -- in RPi 4 DTS, the bcm_lintc node is actually missing this along with other required interrupt properties. Presumably, if the earlier boot stages will support switching to the legacy interrupt controller (as is suggested possible by the documentation), the DTS will need to be updated to indicate the proper interrupt-parent and hopefully also mark this node as an interrupt-controller instead. Modified: head/sys/arm/broadcom/bcm2835/bcm2836.c Modified: head/sys/arm/broadcom/bcm2835/bcm2836.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2836.c Thu Nov 7 21:30:27 2019 (r354487) +++ head/sys/arm/broadcom/bcm2835/bcm2836.c Thu Nov 7 21:31:15 2019 (r354488) @@ -660,6 +660,8 @@ bcm_lintc_probe(device_t dev) if (!ofw_bus_is_compatible(dev, "brcm,bcm2836-l1-intc")) return (ENXIO); + if (!ofw_bus_has_prop(dev, "interrupt-controller")) + return (ENXIO); device_set_desc(dev, "BCM2836 Interrupt Controller"); return (BUS_PROBE_DEFAULT); } From owner-svn-src-head@freebsd.org Thu Nov 7 21:34:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA9C717A7D0; Thu, 7 Nov 2019 21:34:28 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478GrM5hjSz4PVL; Thu, 7 Nov 2019 21:34:27 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf1-f65.google.com with SMTP id q28so2765254lfa.5; Thu, 07 Nov 2019 13:34:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=KndlN7utR4FFf83QDNOlArUWET38XVgYl1DasnEXpqQ=; b=gCvjFVxDz4+JrLMh5dQTOeAEDIB5S53FseRFRgcjNZ5UA5TRoVWa2bliE+LFJfQOH7 PmxZlzvxaCGVEiJxps113amSNpQXID/HdFfXPIzkP388WhpzsxHdgfYcYhTpx1I0v6mx T9TaGBxB7gSTr8xn4RFukcNKVTd0x9ZnWikmxqsjMUgtdzCju7ru/fjuZ5eEckwI/x0g oFQPsxFAbxWdUPkVt4+hxczoMyZdElPDhR71JILnckM6Eqox8NwiyQyDw7rUge0uMYfl x8Vd+sggVs3S2XySC0DUa1cm1b41NLru8A8kEJapR2y/y87sEQAmU9ythZZLdgXP2qmI rlJg== X-Gm-Message-State: APjAAAWjGrDzVHgLpT5OKX0KB+G8ZPLyDI5SOavYIf+pFa9mNlgpcuSM LJ5b/YKbYiwzMIynnOeAmmwwny0/9ds= X-Google-Smtp-Source: APXvYqz2fYffl5rhoUAO5uUdsdy6g53BxMbT6G8tKs5qwsC2tNFuCUP6oGXIhOjOgbEnNwHumg4yqQ== X-Received: by 2002:a19:9144:: with SMTP id y4mr3576418lfj.168.1573162465847; Thu, 07 Nov 2019 13:34:25 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id a22sm1490709ljn.58.2019.11.07.13.34.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Nov 2019 13:34:25 -0800 (PST) Subject: Re: svn commit: r354482 - head/sys/x86/x86 To: Colin Percival , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201911072114.xA7LExVP090362@repo.freebsd.org> <0100016e47bc3e05-560c061d-ef2e-41b1-9166-20d80cb6b81d-000000@email.amazonses.com> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <69cbaec6-5799-9640-89bd-bdb5b6ae9843@FreeBSD.org> Date: Thu, 7 Nov 2019 23:34:23 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <0100016e47bc3e05-560c061d-ef2e-41b1-9166-20d80cb6b81d-000000@email.amazonses.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 478GrM5hjSz4PVL X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.167.65 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-3.11 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCVD_TLS_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[65.167.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; IP_SCORE(-1.12)[ip: (-0.31), ipnet: 209.85.128.0/17(-3.20), asn: 15169(-2.01), country: US(-0.05)]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[65.167.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[96.151.72.93.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 21:34:28 -0000 On 07/11/2019 23:19, Colin Percival wrote: > On 2019-11-07 13:14, Andriy Gapon wrote: >> x86 stack_save_td_running() can work safely only if IPI_TRACE is a >> non-maskable interrupt. But at the moment FreeBSD/Xen does not provide >> support for the NMI delivery mode. So, mark the functionality as >> unsupported similarly to other platforms without NMI. >> [...] >> +#ifdef XENHVM > > I'm not sure this does what you intended. XENHVM simply adds *support* for > running under Xen/HVM, and it's part of the GENERIC kernel. Oh... I should not have rushed. So, I should really check for a run-time Xen marker? -- Andriy Gapon From owner-svn-src-head@freebsd.org Thu Nov 7 21:43:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE35717ACE7; Thu, 7 Nov 2019 21:43:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478H2q62w5z4Q3Q; Thu, 7 Nov 2019 21:43:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2CB11C377; Thu, 7 Nov 2019 21:43:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7LhVrw008576; Thu, 7 Nov 2019 21:43:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7LhVP1008575; Thu, 7 Nov 2019 21:43:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201911072143.xA7LhVP1008575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 7 Nov 2019 21:43:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354489 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 354489 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 21:43:32 -0000 Author: avg Date: Thu Nov 7 21:43:31 2019 New Revision: 354489 URL: https://svnweb.freebsd.org/changeset/base/354489 Log: revert r354482, checking for XENHVM was a wrong way of checking for Xen Modified: head/sys/x86/x86/stack_machdep.c Modified: head/sys/x86/x86/stack_machdep.c ============================================================================== --- head/sys/x86/x86/stack_machdep.c Thu Nov 7 21:31:15 2019 (r354488) +++ head/sys/x86/x86/stack_machdep.c Thu Nov 7 21:43:31 2019 (r354489) @@ -135,13 +135,6 @@ int stack_save_td_running(struct stack *st, struct thread *td) { -#ifdef XENHVM - /* - * There is no NMI support on Xen, so this code can lead to - * an inter-processor deadlock. - */ - return (EOPNOTSUPP); -#endif /* XENHVM */ #ifdef STACK THREAD_LOCK_ASSERT(td, MA_OWNED); MPASS(TD_IS_RUNNING(td)); From owner-svn-src-head@freebsd.org Thu Nov 7 22:04:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB0C717B9EE for ; Thu, 7 Nov 2019 22:04:17 +0000 (UTC) (envelope-from 0100016e47e58977-11f120bc-e675-405b-8dd0-42062a5106af-000000@amazonses.com) Received: from a8-176.smtp-out.amazonses.com (a8-176.smtp-out.amazonses.com [54.240.8.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 478HVm6jGQz4RWx for ; Thu, 7 Nov 2019 22:04:16 +0000 (UTC) (envelope-from 0100016e47e58977-11f120bc-e675-405b-8dd0-42062a5106af-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=vnqrkfnvu6csdl6mwgk5t6ix3nnepx57; d=tarsnap.com; t=1573164255; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=YI9I1Yryojb31ukOheTbUtalHRpGOA6nCfJOlmTg52Y=; b=G9UF9hK5Ata4iCcWs/UPlSngnxvX+2Lu/w9loNf3W2XxQVxQY5G+d+wfFc0VkmrB mhnbALbvzJdethyK2F8E9iROl1ti8g4QMjfOSSILnml51g8tCn6kmqqwWgU7dNbzuI0 BbRUW1GDHr0nmTCi6XIHtEGfFsTQv3Jwc3o5egaU= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1573164255; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=YI9I1Yryojb31ukOheTbUtalHRpGOA6nCfJOlmTg52Y=; b=ajDlIm80e7+ydc0IaVToeFBnJixFuPRszlLNOBssyqfH2DuCU8P6T0b+06aFDE77 uIpayVvhVqJ+RAqjhX8QreLLs5wLktxnxowXJOhaB5JbfjXvj6oTHXkydWM1sK5IQv5 gK306jc/NeoqsqXBXIMGWPX3O4SRpTZXHLDU9SRk= Subject: Re: svn commit: r354482 - head/sys/x86/x86 To: Andriy Gapon , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201911072114.xA7LExVP090362@repo.freebsd.org> <0100016e47bc3e05-560c061d-ef2e-41b1-9166-20d80cb6b81d-000000@email.amazonses.com> <69cbaec6-5799-9640-89bd-bdb5b6ae9843@FreeBSD.org> From: Colin Percival Autocrypt: addr=cperciva@tarsnap.com; prefer-encrypt=mutual; keydata= mQGhBElrAAcRBACDfDys4ZtK+ErCJ1HAzYeteKpm3OEsvT/49AjUTLihkF79HhIKrCQU+1KC zv7BwHCMLb6hq30As9L7iFKG7n5QFLFC4Te/VcITUnWHMG/c3ViLOfJGvi+9/nOEHaM1dVJY D6tEp5yM1nHmVQpo9932j4KGuGFR0LhOK5IHXOSfGwCgxSFDPdgxe2OEjWxjGgY+oV3EafcD +JROXCTjlcQiG/OguQH4Vks3mhHfFnEppLxTkDuYgHZQiUtpcT9ssH5khgqoTyMar05OUdAj ZIhNbWDh4LgTj+7ZmvLhXT5Zxw8LX9d7T36aTB8XDQSenDqEtinMWOb0TCBBLbsB8EFG1WTT ESbZci9jJS5yhtktuZoY/eM8uXMD/3k4FWFO80VRRkELSp+XSy/VlSQjyi/rhl2nQq/oOA9F oJbDaB0yq9VNhxP+uFBzBWSqeIX0t1ZWLtNfVFr4TRP5hihI5ICrg/0OpqgisKsU2NFe9xyO hyJLYmfD8ebpDJ/9k30C7Iju9pVrwLm1QgS4S2fqJRcR+U4WbjvP7CgStCVDb2xpbiBQZXJj aXZhbCA8Y3BlcmNpdmFAdGFyc25hcC5jb20+iGEEExECACEFAklrALYCGwMHCwkIBwMCAQQV AggDBBYCAwECHgECF4AACgkQOM7KaQxqam6/igCgn+z2k3V5ggNppmWrZstt1U2lugsAoL7L wS9V9yLtil3oWmHtwpUqYruEuQINBElrAAcQCAD3ZLMIsP4CIDoJORg+YY0lqLVBgcnF7pFb 4Uy2+KvdWofN+DKH61rZLjgXXkNE9M4EQC1B4lGttBP8IY2gs41y3AUogGdyFbidq99rCBz7 LTsgARHwFxZoaHmXyiZLEU1QZuMqwPZV1mCviRhN5E3rRqYNXVcrnXAAuhBpvNyj/ntHvcDN 2/m+ochiuBYueU4kX3lHya7sOj+mTsndcWmQ9soOUyr8O0r/BG088bMn4qqtUw4dl5/pglXk jbl7uOOPinKf0WVd2r6M0wLPJCD4NPHrCWRLLLAjwfjrtoSRvXxDbXhCdgGBa72+K8eYLzVs hgq7tJOoBWzjVK6XRxR7AAMGB/9Mo3iJ2DxqDecd02KCB5BsFDICbJGhPltU7FwrtbC7djSb XUrwsEVLHi4st4cbdGNCWCrp0BRezXZKohKnNAPFOTK++ZfgeKxrV2sJod+Q9RILF86tQ4XF 7A7Yme5hy92t/WgiU4vc/fWbgP8gV/19f8nunaT2E9NSa70mZFjZNu4iuwThoUUO5CV3Wo0Y UISsnRK8XD1+LR3A2qVyLiFRwh/miC1hgLFCTGCQ3GLxZeZzIpYSlGdQJ0L5lixW5ZQD9r1I 8i/8zhE6qRFAM0upUMI3Gt1Oq2w03DiXrZU0Fu/R8Rm8rlnkQKA+95mRTUq1xL5P5NZIi4gJ Z569OPMFiEkEGBECAAkFAklrAAcCGwwACgkQOM7KaQxqam41igCfbaldnFTu5uAdrnrghESv EI3CAo8AoLkNMks1pThl2BJNRm4CtTK9xZeH Message-ID: <0100016e47e58977-11f120bc-e675-405b-8dd0-42062a5106af-000000@email.amazonses.com> Date: Thu, 7 Nov 2019 22:04:15 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <69cbaec6-5799-9640-89bd-bdb5b6ae9843@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2019.11.07-54.240.8.176 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-Rspamd-Queue-Id: 478HVm6jGQz4RWx X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=tarsnap.com header.s=vnqrkfnvu6csdl6mwgk5t6ix3nnepx57 header.b=G9UF9hK5; dkim=pass header.d=amazonses.com header.s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw header.b=ajDlIm80; dmarc=none; spf=pass (mx1.freebsd.org: domain of 0100016e47e58977-11f120bc-e675-405b-8dd0-42062a5106af-000000@amazonses.com designates 54.240.8.176 as permitted sender) smtp.mailfrom=0100016e47e58977-11f120bc-e675-405b-8dd0-42062a5106af-000000@amazonses.com X-Spamd-Result: default: False [-1.78 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[tarsnap.com:s=vnqrkfnvu6csdl6mwgk5t6ix3nnepx57,amazonses.com:s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:54.240.0.0/18]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[tarsnap.com]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[tarsnap.com:+,amazonses.com:+]; RCVD_IN_DNSWL_NONE(0.00)[176.8.240.54.list.dnswl.org : 127.0.15.0]; FORGED_SENDER(0.30)[cperciva@tarsnap.com,0100016e47e58977-11f120bc-e675-405b-8dd0-42062a5106af-000000@amazonses.com]; RCVD_COUNT_ZERO(0.00)[0]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-2.08)[ip: (-2.45), ipnet: 54.240.8.0/21(-4.61), asn: 14618(-3.30), country: US(-0.05)]; ASN(0.00)[asn:14618, ipnet:54.240.8.0/21, country:US]; FORGED_MUA_THUNDERBIRD_MSGID_UNKNOWN(2.50)[]; FROM_NEQ_ENVFROM(0.00)[cperciva@tarsnap.com, 0100016e47e58977-11f120bc-e675-405b-8dd0-42062a5106af-000000@amazonses.com] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 22:04:17 -0000 On 2019-11-07 13:34, Andriy Gapon wrote: > On 07/11/2019 23:19, Colin Percival wrote: >> On 2019-11-07 13:14, Andriy Gapon wrote: >>> x86 stack_save_td_running() can work safely only if IPI_TRACE is a >>> non-maskable interrupt. But at the moment FreeBSD/Xen does not provide >>> support for the NMI delivery mode. So, mark the functionality as >>> unsupported similarly to other platforms without NMI. >>> [...] >>> +#ifdef XENHVM >> >> I'm not sure this does what you intended. XENHVM simply adds *support* for >> running under Xen/HVM, and it's part of the GENERIC kernel. > > Oh... I should not have rushed. > So, I should really check for a run-time Xen marker? I'm guessing that you want #include ... if (vm_guest == VM_GUEST_XEN) return (EOPNOTSUPP); -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@freebsd.org Thu Nov 7 22:26:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 859F017C610; Thu, 7 Nov 2019 22:26:55 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478J0v2zZBz4SYr; Thu, 7 Nov 2019 22:26:55 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4988C1CAD1; Thu, 7 Nov 2019 22:26:55 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7MQtk7032609; Thu, 7 Nov 2019 22:26:55 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7MQtcS032608; Thu, 7 Nov 2019 22:26:55 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201911072226.xA7MQtcS032608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 7 Nov 2019 22:26:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354490 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 354490 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 22:26:55 -0000 Author: glebius Date: Thu Nov 7 22:26:54 2019 New Revision: 354490 URL: https://svnweb.freebsd.org/changeset/base/354490 Log: Remove now unused INP_INFO_RLOCK macros. Modified: head/sys/netinet/in_pcb.h Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Thu Nov 7 21:43:31 2019 (r354489) +++ head/sys/netinet/in_pcb.h Thu Nov 7 22:26:54 2019 (r354490) @@ -629,19 +629,14 @@ int inp_so_options(const struct inpcb *inp); #define INP_INFO_LOCK_INIT(ipi, d) \ mtx_init(&(ipi)->ipi_lock, (d), NULL, MTX_DEF| MTX_RECURSE) #define INP_INFO_LOCK_DESTROY(ipi) mtx_destroy(&(ipi)->ipi_lock) -#define INP_INFO_RLOCK_ET(ipi, et) NET_EPOCH_ENTER((et)) #define INP_INFO_WLOCK(ipi) mtx_lock(&(ipi)->ipi_lock) #define INP_INFO_TRY_WLOCK(ipi) mtx_trylock(&(ipi)->ipi_lock) #define INP_INFO_WLOCKED(ipi) mtx_owned(&(ipi)->ipi_lock) -#define INP_INFO_RUNLOCK_ET(ipi, et) NET_EPOCH_EXIT((et)) -#define INP_INFO_RUNLOCK_TP(ipi, tp) NET_EPOCH_EXIT(*(tp)->t_inpcb->inp_et) #define INP_INFO_WUNLOCK(ipi) mtx_unlock(&(ipi)->ipi_lock) #define INP_INFO_LOCK_ASSERT(ipi) MPASS(in_epoch(net_epoch_preempt) || mtx_owned(&(ipi)->ipi_lock)) -#define INP_INFO_RLOCK_ASSERT(ipi) MPASS(in_epoch(net_epoch_preempt)) #define INP_INFO_WLOCK_ASSERT(ipi) mtx_assert(&(ipi)->ipi_lock, MA_OWNED) #define INP_INFO_WUNLOCK_ASSERT(ipi) \ mtx_assert(&(ipi)->ipi_lock, MA_NOTOWNED) -#define INP_INFO_UNLOCK_ASSERT(ipi) MPASS(!in_epoch(net_epoch_preempt) && !mtx_owned(&(ipi)->ipi_lock)) #define INP_LIST_LOCK_INIT(ipi, d) \ rw_init_flags(&(ipi)->ipi_list_lock, (d), 0) From owner-svn-src-head@freebsd.org Thu Nov 7 22:58:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2490517D082; Thu, 7 Nov 2019 22:58:13 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478Jj06W8Kz4Tfx; Thu, 7 Nov 2019 22:58:12 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF7A01D016; Thu, 7 Nov 2019 22:58:12 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7MwC0e050275; Thu, 7 Nov 2019 22:58:12 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7MwBkh050268; Thu, 7 Nov 2019 22:58:11 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201911072258.xA7MwBkh050268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 7 Nov 2019 22:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354491 - in head: . lib/msun/src libexec libexec/rtld-elf libexec/rtld-elf32 share/mk usr.bin usr.bin/ldd32 X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . lib/msun/src libexec libexec/rtld-elf libexec/rtld-elf32 share/mk usr.bin usr.bin/ldd32 X-SVN-Commit-Revision: 354491 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 22:58:13 -0000 Author: brooks Date: Thu Nov 7 22:58:10 2019 New Revision: 354491 URL: https://svnweb.freebsd.org/changeset/base/354491 Log: libcompat: build 32-bit rtld and ldd as part of "everything" Alter bsd.compat.mk to set MACHINE and MACHINE_ARCH when included directly so MD paths in Makefiles work. In the process centralize setting them in LIBCOMPATWMAKEENV. Alter .PATH and CFLAGS settings in work when the Makefile is included. While here only support LIB32 on supported platforms rather than always enabling it and requiring users of MK_LIB32 to filter based TARGET/MACHINE_ARCH. The net effect of this change is to make Makefile.libcompat only build compatability libraries. Changes relative to r354449: Correct detection of the compiler type when bsd.compat.mk is used outside Makefile.libcompat. Previously it always matched the clang case. Set LDFLAGS including the linker emulation for mips where -m32 seems to be insufficent. Reviewed by: imp, kib (origional version in r354449) Obtained from: CheriBSD (conceptually) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22251 Added: head/libexec/rtld-elf32/ - copied from r354464, head/libexec/rtld-elf32/ head/usr.bin/ldd32/ - copied from r354464, head/usr.bin/ldd32/ Modified: head/Makefile.inc1 head/Makefile.libcompat head/lib/msun/src/k_sincosl.h head/libexec/Makefile head/libexec/rtld-elf/Makefile head/share/mk/bsd.compat.mk head/share/mk/src.opts.mk head/usr.bin/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Nov 7 22:26:54 2019 (r354490) +++ head/Makefile.inc1 Thu Nov 7 22:58:10 2019 (r354491) @@ -802,11 +802,10 @@ XCFLAGS+= --sysroot=${WORLDTMP} XCFLAGS+= ${BFLAGS} .endif -.if ${MK_LIB32} != "no" && (${TARGET_ARCH} == "amd64" || \ - ${TARGET_ARCH} == "powerpc64" || ${TARGET_ARCH:Mmips64*} != "") +.if ${MK_LIB32} == "yes" _LIBCOMPAT= 32 .include "Makefile.libcompat" -.elif ${MK_LIBSOFT} != "no" && ${TARGET_ARCH:Marmv[67]*} != "" +.elif ${MK_LIBSOFT} == "yes" _LIBCOMPAT= SOFT .include "Makefile.libcompat" .endif Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Thu Nov 7 22:26:54 2019 (r354490) +++ head/Makefile.libcompat Thu Nov 7 22:58:10 2019 (r354491) @@ -111,28 +111,10 @@ build${libcompat}: .PHONY .endfor ${_+_}cd ${.CURDIR}; \ ${LIBCOMPATWMAKE} -f Makefile.inc1 -DNO_FSCHG libraries -.if ${libcompat} == "32" -.for _t in ${_obj} all -.if !defined(NO_RTLD) - ${_+_}cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIBCOMPATWMAKE} \ - -DNO_FSCHG DIRPRFX=libexec/rtld-elf/ ${_t} -.endif - ${_+_}cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIBCOMPATWMAKE} \ - DIRPRFX=usr.bin/ldd ${_t} -.endfor -.endif distribute${libcompat} install${libcompat}: .PHONY .for _dir in ${_LC_LIBDIRS.yes} ${_+_}cd ${.CURDIR}/${_dir}; ${LIBCOMPATIMAKE} ${.TARGET:S/${libcompat}$//} .endfor -.if ${libcompat} == "32" -.if !defined(NO_RTLD) - ${_+_}cd ${.CURDIR}/libexec/rtld-elf; \ - PROG=ld-elf32.so.1 ${LIBCOMPATIMAKE} ${.TARGET:S/32$//} -.endif - ${_+_}cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIBCOMPATIMAKE} \ - ${.TARGET:S/32$//} -.endif -.endif +.endif # !targets(__<${_this:T}>__) Modified: head/lib/msun/src/k_sincosl.h ============================================================================== --- head/lib/msun/src/k_sincosl.h Thu Nov 7 22:26:54 2019 (r354490) +++ head/lib/msun/src/k_sincosl.h Thu Nov 7 22:58:10 2019 (r354491) @@ -28,8 +28,8 @@ S1lo = -9.2563760475949941e-18; /* -0x15580000000000. #define C1 ((long double)C1hi + C1lo) #else static const long double -C1 = 0.0416666666666666666136L, /* 0xaaaaaaaaaaaaaa9b.0p-68 */ -S1 = -0.166666666666666666671L; /* -0xaaaaaaaaaaaaaaab.0p-66 */ +C1 = 0.0416666666666666666136L; /* 0xaaaaaaaaaaaaaa9b.0p-68 */ +S1 = -0.166666666666666666671L, /* -0xaaaaaaaaaaaaaaab.0p-66 */ #endif static const double Modified: head/libexec/Makefile ============================================================================== --- head/libexec/Makefile Thu Nov 7 22:26:54 2019 (r354490) +++ head/libexec/Makefile Thu Nov 7 22:58:10 2019 (r354491) @@ -74,6 +74,7 @@ _tftp-proxy= tftp-proxy .if !defined(NO_PIC) && !defined(NO_RTLD) _rtld-elf= rtld-elf +SUBDIR.${MK_LIB32}+= rtld-elf32 .endif .if ${MK_RBOOTD} != "no" Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Thu Nov 7 22:26:54 2019 (r354490) +++ head/libexec/rtld-elf/Makefile Thu Nov 7 22:58:10 2019 (r354491) @@ -4,6 +4,8 @@ # linker: # make DEBUG_FLAGS=-g WITHOUT_TESTS=yes all +RTLD_ELF_DIR:= ${.PARSEDIR} + .include PACKAGE= clibs MK_PIE= no # Always position independent using local rules @@ -25,16 +27,16 @@ SRCS= \ xmalloc.c \ debug.c \ libmap.c -MAN= rtld.1 +MAN?= rtld.1 CSTD?= gnu99 CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD -ffreestanding CFLAGS+= -I${SRCTOP}/lib/csu/common -.if exists(${.CURDIR}/${MACHINE_ARCH}) +.if exists(${RTLD_ELF_DIR}/${MACHINE_ARCH}) RTLD_ARCH= ${MACHINE_ARCH} .else RTLD_ARCH= ${MACHINE_CPUARCH} .endif -CFLAGS+= -I${.CURDIR}/${RTLD_ARCH} -I${.CURDIR} +CFLAGS+= -I${RTLD_ELF_DIR}/${RTLD_ARCH} -I${RTLD_ELF_DIR} .if ${MACHINE_ARCH} == "powerpc64" LDFLAGS+= -nostdlib -e _rtld_start .else @@ -81,16 +83,16 @@ LIBADD+= compiler_rt .if ${MK_SYMVER} == "yes" VERSION_DEF= ${LIBCSRCDIR}/Versions.def -SYMBOL_MAPS= ${.CURDIR}/Symbol.map +SYMBOL_MAPS= ${RTLD_ELF_DIR}/Symbol.map VERSION_MAP= Version.map LDFLAGS+= -Wl,--version-script=${VERSION_MAP} -.if exists(${.CURDIR}/${RTLD_ARCH}/Symbol.map) -SYMBOL_MAPS+= ${.CURDIR}/${RTLD_ARCH}/Symbol.map +.if exists(${RTLD_ELF_DIR}/${RTLD_ARCH}/Symbol.map) +SYMBOL_MAPS+= ${RTLD_ELF_DIR}/${RTLD_ARCH}/Symbol.map .endif .endif -.sinclude "${.CURDIR}/${RTLD_ARCH}/Makefile.inc" +.sinclude "${RTLD_ELF_DIR}/${RTLD_ARCH}/Makefile.inc" # Since moving rtld-elf to /libexec, we need to create a symlink. # Fixup the existing binary that's there so we can symlink over it. @@ -99,10 +101,12 @@ beforeinstall: -chflags -h noschg ${DESTDIR}/usr/libexec/${PROG} .endif -.PATH: ${.CURDIR}/${RTLD_ARCH} +.PATH: ${RTLD_ELF_DIR}/${RTLD_ARCH} +.if ${.CURDIR} == ${RTLD_ELF_DIR} HAS_TESTS= SUBDIR.${MK_TESTS}+= tests +.endif .include ${PROG_FULL}: ${VERSION_MAP} Modified: head/share/mk/bsd.compat.mk ============================================================================== --- head/share/mk/bsd.compat.mk Thu Nov 7 22:26:54 2019 (r354490) +++ head/share/mk/bsd.compat.mk Thu Nov 7 22:58:10 2019 (r354491) @@ -6,9 +6,17 @@ __<${_this:T}>__: .if defined(_LIBCOMPAT) COMPAT_ARCH= ${TARGET_ARCH} COMPAT_CPUTYPE= ${TARGET_CPUTYPE} +.if (defined(WANT_COMPILER_TYPE) && ${WANT_COMPILER_TYPE} == gcc) || \ + (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc) +COMPAT_COMPILER_TYPE= gcc .else +COMPAT_COMPILER_TYPE= clang +.endif +.else COMPAT_ARCH= ${MACHINE_ARCH} COMPAT_CPUTYPE= ${CPUTYPE} +.include +COMPAT_COMPILER_TYPE=${COMPILER_TYPE} .endif # ------------------------------------------------------------------- @@ -20,14 +28,14 @@ LIB32CPUFLAGS= -march=i686 -mmmx -msse -msse2 .else LIB32CPUFLAGS= -march=${COMPAT_CPUTYPE} .endif -.if (defined(WANT_COMPILER_TYPE) && ${WANT_COMPILER_TYPE} == gcc) || \ - (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc) +.if ${COMPAT_COMPILER_TYPE} == gcc .else LIB32CPUFLAGS+= -target x86_64-unknown-freebsd13.0 .endif LIB32CPUFLAGS+= -m32 -LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \ - MACHINE_CPU="i686 mmx sse sse2" +LIB32_MACHINE= i386 +LIB32_MACHINE_ARCH= i386 +LIB32WMAKEENV= MACHINE_CPU="i686 mmx sse sse2" LIB32WMAKEFLAGS= \ AS="${XAS} --32" \ LD="${XLD} -m elf_i386_fbsd -L${LIBCOMPATTMP}/usr/lib32" @@ -40,14 +48,14 @@ LIB32CPUFLAGS= -mcpu=powerpc LIB32CPUFLAGS= -mcpu=${COMPAT_CPUTYPE} .endif LIB32CPUFLAGS+= -m32 -LIB32WMAKEENV= MACHINE=powerpc MACHINE_ARCH=powerpc +LIB32_MACHINE= powerpc +LIB32_MACHINE_ARCH= powerpc LIB32WMAKEFLAGS= \ LD="${XLD} -m elf32ppc_fbsd" .elif ${COMPAT_ARCH:Mmips64*} != "" HAS_COMPAT=32 -.if (defined(WANT_COMPILER_TYPE) && ${WANT_COMPILER_TYPE} == gcc) || \ - (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc) +.if ${COMPAT_COMPILER_TYPE} == gcc .if empty(COMPAT_CPUTYPE) LIB32CPUFLAGS= -march=mips3 .else @@ -61,12 +69,15 @@ LIB32CPUFLAGS= -target mips-unknown-freebsd13.0 .endif .endif LIB32CPUFLAGS+= -mabi=32 -LIB32WMAKEENV= MACHINE=mips MACHINE_ARCH=mips +LIB32_MACHINE= mips +LIB32_MACHINE_ARCH= mips .if ${COMPAT_ARCH:Mmips64el*} != "" -LIB32WMAKEFLAGS= LD="${XLD} -m elf32ltsmip_fbsd" +_EMULATION= elf32ltsmip_fbsd .else -LIB32WMAKEFLAGS= LD="${XLD} -m elf32btsmip_fbsd" +_EMULATION= elf32btsmip_fbsd .endif +LIB32WMAKEFLAGS= LD="${XLD} -m ${_EMULATION}" +LIB32LDFLAGS= -Wl,-m${_EMULATION} .endif LIB32WMAKEFLAGS+= NM="${XNM}" @@ -82,7 +93,9 @@ LIB32WMAKEFLAGS+= -DCOMPAT_32BIT HAS_COMPAT=SOFT LIBSOFTCFLAGS= -DCOMPAT_SOFTFP LIBSOFTCPUFLAGS= -mfloat-abi=softfp -LIBSOFTWMAKEENV= CPUTYPE=soft MACHINE=arm MACHINE_ARCH=${COMPAT_ARCH} +LIBSOFT_MACHINE= arm +LIBSOFT_MACHINE_ARCH= ${COMPAT_ARCH} +LIBSOFTWMAKEENV= CPUTYPE=soft LIBSOFTWMAKEFLAGS= -DCOMPAT_SOFTFP .endif @@ -114,8 +127,8 @@ _LIBCOMPAT:= ${WANT_COMPAT} # Generic code for each type. # Set defaults based on type. libcompat= ${_LIBCOMPAT:tl} -_LIBCOMPAT_MAKEVARS= _OBJTOP TMP CPUFLAGS CFLAGS CXXFLAGS WMAKEENV \ - WMAKEFLAGS WMAKE +_LIBCOMPAT_MAKEVARS= _OBJTOP TMP CPUFLAGS CFLAGS CXXFLAGS LDFLAGS \ + _MACHINE _MACHINE_ARCH WMAKEENV WMAKEFLAGS WMAKE .for _var in ${_LIBCOMPAT_MAKEVARS} .if !empty(LIB${_LIBCOMPAT}${_var}) LIBCOMPAT${_var}?= ${LIB${_LIBCOMPAT}${_var}} @@ -131,6 +144,9 @@ LIBCOMPATCFLAGS+= ${LIBCOMPATCPUFLAGS} \ --sysroot=${LIBCOMPATTMP} \ ${BFLAGS} +LIBCOMPATWMAKEENV+= MACHINE=${LIBCOMPAT_MACHINE} +LIBCOMPATWMAKEENV+= MACHINE_ARCH=${LIBCOMPAT_MACHINE_ARCH} + # -B is needed to find /usr/lib32/crti.o for GCC and /usr/libsoft/crti.o for # Clang/GCC. LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/lib${libcompat} @@ -139,6 +155,9 @@ LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/lib${libcompat LIBDIR_BASE:= /usr/lib${libcompat} _LIB_OBJTOP= ${LIBCOMPAT_OBJTOP} CFLAGS+= ${LIBCOMPATCFLAGS} +LDFLAGS+= ${CFLAGS} ${LIBCOMPATLDFLAGS} +MACHINE= ${LIBCOMPAT_MACHINE} +MACHINE_ARCH= ${LIBCOMPAT_MACHINE_ARCH} .endif .endif Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Nov 7 22:26:54 2019 (r354490) +++ head/share/mk/src.opts.mk Thu Nov 7 22:58:10 2019 (r354491) @@ -126,7 +126,6 @@ __DEFAULT_YES_OPTIONS = \ LDNS \ LDNS_UTILS \ LEGACY_CONSOLE \ - LIB32 \ LIBPTHREAD \ LIBTHR \ LLVM_COV \ @@ -357,6 +356,13 @@ BROKEN_OPTIONS+=LLDB __DEFAULT_NO_OPTIONS+=GDB_LIBEXEC .else __DEFAULT_YES_OPTIONS+=GDB_LIBEXEC +.endif +# LIB32 is supported on amd64, mips64, and powerpc64 +.if (${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH:Mmips64*} || \ + ${MACHINE_ARCH} == "powerpc64") +__DEFAULT_YES_OPTIONS+=LIB32 +.else +BROKEN_OPTIONS+=LIB32 .endif # Only doing soft float API stuff on armv6 and armv7 .if ${__T} != "armv6" && ${__T} != "armv7" Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Thu Nov 7 22:26:54 2019 (r354490) +++ head/usr.bin/Makefile Thu Nov 7 22:58:10 2019 (r354491) @@ -226,6 +226,7 @@ SUBDIR.${MK_KDUMP}+= truss SUBDIR.${MK_KERBEROS_SUPPORT}+= compile_et SUBDIR.${MK_LDNS_UTILS}+= drill SUBDIR.${MK_LDNS_UTILS}+= host +SUBDIR.${MK_LIB32}+= ldd32 SUBDIR.${MK_LOCATE}+= locate # XXX msgs? SUBDIR.${MK_MAIL}+= biff From owner-svn-src-head@freebsd.org Thu Nov 7 23:27:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CAB2117DB7C; Thu, 7 Nov 2019 23:27:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KMH4nLFz4VlD; Thu, 7 Nov 2019 23:27:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 831391D56F; Thu, 7 Nov 2019 23:27:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NRt2g067637; Thu, 7 Nov 2019 23:27:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NRt5l067636; Thu, 7 Nov 2019 23:27:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072327.xA7NRt5l067636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354492 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354492 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:27:55 -0000 Author: markj Date: Thu Nov 7 23:27:54 2019 New Revision: 354492 URL: https://svnweb.freebsd.org/changeset/base/354492 Log: iwm: Fix style in the TX path. Also ensure that the htole* macros are applied correctly when specifying the segment length and upper address bits. No functional change intended (unless you use iwm(4) on a big-endian machine). MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Nov 7 22:58:10 2019 (r354491) +++ head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:27:54 2019 (r354492) @@ -3568,7 +3568,6 @@ iwm_tx(struct iwm_softc *sc, struct mbuf *m, struct ie tid = 0; ring = &sc->txq[ac]; desc = &ring->desc[ring->cur]; - memset(desc, 0, sizeof(*desc)); data = &ring->data[ring->cur]; /* Fill out iwm_tx_cmd to send to the firmware */ @@ -3607,17 +3606,15 @@ iwm_tx(struct iwm_softc *sc, struct mbuf *m, struct ie ieee80211_radiotap_tx(vap, m); } - - totlen = m->m_pkthdr.len; - flags = 0; + totlen = m->m_pkthdr.len; if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { flags |= IWM_TX_CMD_FLG_ACK; } - if (type == IEEE80211_FC0_TYPE_DATA - && (totlen + IEEE80211_CRC_LEN > vap->iv_rtsthreshold) - && !IEEE80211_IS_MULTICAST(wh->i_addr1)) { + if (type == IEEE80211_FC0_TYPE_DATA && + totlen + IEEE80211_CRC_LEN > vap->iv_rtsthreshold && + !IEEE80211_IS_MULTICAST(wh->i_addr1)) { flags |= IWM_TX_CMD_FLG_PROT_REQUIRE; } @@ -3661,7 +3658,7 @@ iwm_tx(struct iwm_softc *sc, struct mbuf *m, struct ie tx->dram_msb_ptr = iwm_get_dma_hi_addr(data->scratch_paddr); /* Copy 802.11 header in TX command. */ - memcpy(((uint8_t *)tx) + sizeof(*tx), wh, hdrlen); + memcpy((uint8_t *)tx + sizeof(*tx), wh, hdrlen); flags |= IWM_TX_CMD_FLG_BT_DIS | IWM_TX_CMD_FLG_SEQ_CTL; @@ -3715,23 +3712,24 @@ iwm_tx(struct iwm_softc *sc, struct mbuf *m, struct ie ); /* Fill TX descriptor. */ + memset(desc, 0, sizeof(*desc)); desc->num_tbs = 2 + nsegs; desc->tbs[0].lo = htole32(data->cmd_paddr); - desc->tbs[0].hi_n_len = htole16(iwm_get_dma_hi_addr(data->cmd_paddr)) | - (TB0_SIZE << 4); + desc->tbs[0].hi_n_len = htole16(iwm_get_dma_hi_addr(data->cmd_paddr) | + (TB0_SIZE << 4)); desc->tbs[1].lo = htole32(data->cmd_paddr + TB0_SIZE); - desc->tbs[1].hi_n_len = htole16(iwm_get_dma_hi_addr(data->cmd_paddr)) | - ((sizeof(struct iwm_cmd_header) + sizeof(*tx) - + hdrlen + pad - TB0_SIZE) << 4); + desc->tbs[1].hi_n_len = htole16(iwm_get_dma_hi_addr(data->cmd_paddr) | + ((sizeof(struct iwm_cmd_header) + sizeof(*tx) + + hdrlen + pad - TB0_SIZE) << 4)); /* Other DMA segments are for data payload. */ for (i = 0; i < nsegs; i++) { seg = &segs[i]; - desc->tbs[i+2].lo = htole32(seg->ds_addr); - desc->tbs[i+2].hi_n_len = \ - htole16(iwm_get_dma_hi_addr(seg->ds_addr)) - | ((seg->ds_len) << 4); + desc->tbs[i + 2].lo = htole32(seg->ds_addr); + desc->tbs[i + 2].hi_n_len = + htole16(iwm_get_dma_hi_addr(seg->ds_addr)) | + (seg->ds_len << 4); } bus_dmamap_sync(ring->data_dmat, data->map, From owner-svn-src-head@freebsd.org Thu Nov 7 23:29:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C7F5017DC04; Thu, 7 Nov 2019 23:29:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KNX4yCHz4Vt8; Thu, 7 Nov 2019 23:29:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D5D41D570; Thu, 7 Nov 2019 23:29:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NT0wE067733; Thu, 7 Nov 2019 23:29:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NT0EK067732; Thu, 7 Nov 2019 23:29:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072329.xA7NT0EK067732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:29:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354493 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354493 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:29:00 -0000 Author: markj Date: Thu Nov 7 23:29:00 2019 New Revision: 354493 URL: https://svnweb.freebsd.org/changeset/base/354493 Log: iwm: Remove a couple of unused fields from the softc. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Thu Nov 7 23:27:54 2019 (r354492) +++ head/sys/dev/iwm/if_iwmvar.h Thu Nov 7 23:29:00 2019 (r354493) @@ -459,8 +459,6 @@ struct iwm_softc { struct iwm_rx_ring rxq; int qfullmsk; - int sc_sf_state; - /* ICT table. */ struct iwm_dma_info ict_dma; int ict_cur; @@ -525,8 +523,6 @@ struct iwm_softc { struct iwm_notif_statistics_v10 sc_stats; int sc_noise; - - caddr_t sc_drvbpf; struct iwm_rx_radiotap_header sc_rxtap; struct iwm_tx_radiotap_header sc_txtap; From owner-svn-src-head@freebsd.org Thu Nov 7 23:29:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 793B517DC90; Thu, 7 Nov 2019 23:29:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KP22cvyz4W1m; Thu, 7 Nov 2019 23:29:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D58C1D571; Thu, 7 Nov 2019 23:29:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NTQGp067793; Thu, 7 Nov 2019 23:29:26 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NTPkK067790; Thu, 7 Nov 2019 23:29:25 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072329.xA7NTPkK067790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:29:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354494 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354494 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:29:26 -0000 Author: markj Date: Thu Nov 7 23:29:25 2019 New Revision: 354494 URL: https://svnweb.freebsd.org/changeset/base/354494 Log: iwm: Simplify fw_has_{api,capa}(). No functional change intended. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_scan.c head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:29:00 2019 (r354493) +++ head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:29:25 2019 (r354494) @@ -4442,8 +4442,7 @@ static boolean_t iwm_mvm_is_lar_supported(struct iwm_softc *sc) { boolean_t nvm_lar = sc->nvm_data->lar_enabled; - boolean_t tlv_lar = fw_has_capa(&sc->sc_fw.ucode_capa, - IWM_UCODE_TLV_CAPA_LAR_SUPPORT); + boolean_t tlv_lar = iwm_fw_has_capa(sc, IWM_UCODE_TLV_CAPA_LAR_SUPPORT); if (iwm_lar_disable) return FALSE; @@ -4461,10 +4460,8 @@ iwm_mvm_is_lar_supported(struct iwm_softc *sc) static boolean_t iwm_mvm_is_wifi_mcc_supported(struct iwm_softc *sc) { - return fw_has_api(&sc->sc_fw.ucode_capa, - IWM_UCODE_TLV_API_WIFI_MCC_UPDATE) || - fw_has_capa(&sc->sc_fw.ucode_capa, - IWM_UCODE_TLV_CAPA_LAR_MULTI_MCC); + return iwm_fw_has_api(sc, IWM_UCODE_TLV_API_WIFI_MCC_UPDATE) || + iwm_fw_has_capa(sc, IWM_UCODE_TLV_CAPA_LAR_MULTI_MCC); } static int @@ -4484,8 +4481,7 @@ iwm_send_update_mcc_cmd(struct iwm_softc *sc, const ch int n_channels; uint16_t mcc; #endif - int resp_v2 = fw_has_capa(&sc->sc_fw.ucode_capa, - IWM_UCODE_TLV_CAPA_LAR_SUPPORT_V2); + int resp_v2 = iwm_fw_has_capa(sc, IWM_UCODE_TLV_CAPA_LAR_SUPPORT_V2); if (!iwm_mvm_is_lar_supported(sc)) { IWM_DPRINTF(sc, IWM_DEBUG_LAR, "%s: no LAR support\n", @@ -4646,7 +4642,7 @@ iwm_init_hw(struct iwm_softc *sc) if ((error = iwm_send_update_mcc_cmd(sc, "ZZ")) != 0) goto error; - if (fw_has_capa(&sc->sc_fw.ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) { + if (iwm_fw_has_capa(sc, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) { if ((error = iwm_mvm_config_umac_scan(sc)) != 0) goto error; } @@ -6183,7 +6179,7 @@ iwm_scan_start(struct ieee80211com *ic) device_printf(sc->sc_dev, "%s: Previous scan not completed yet\n", __func__); } - if (fw_has_capa(&sc->sc_fw.ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) + if (iwm_fw_has_capa(sc, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) error = iwm_mvm_umac_scan(sc); else error = iwm_mvm_lmac_scan(sc); Modified: head/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- head/sys/dev/iwm/if_iwm_scan.c Thu Nov 7 23:29:00 2019 (r354493) +++ head/sys/dev/iwm/if_iwm_scan.c Thu Nov 7 23:29:25 2019 (r354494) @@ -215,8 +215,7 @@ static inline boolean_t iwm_mvm_rrm_scan_needed(struct iwm_softc *sc) { /* require rrm scan whenever the fw supports it */ - return fw_has_capa(&sc->sc_fw.ucode_capa, - IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT); + return iwm_fw_has_capa(sc, IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT); } #ifdef IWM_DEBUG @@ -251,7 +250,7 @@ iwm_mvm_rx_lmac_scan_complete_notif(struct iwm_softc * /* If this happens, the firmware has mistakenly sent an LMAC * notification during UMAC scans -- warn and ignore it. */ - if (fw_has_capa(&sc->sc_fw.ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) { + if (iwm_fw_has_capa(sc, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) { device_printf(sc->sc_dev, "%s: Mistakenly got LMAC notification during UMAC scan\n", __func__); @@ -866,7 +865,7 @@ iwm_mvm_scan_stop_wait(struct iwm_softc *sc) IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "Preparing to stop scan\n"); - if (fw_has_capa(&sc->sc_fw.ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) + if (iwm_fw_has_capa(sc, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) ret = iwm_mvm_umac_scan_abort(sc); else ret = iwm_mvm_lmac_scan_abort(sc); Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Thu Nov 7 23:29:00 2019 (r354493) +++ head/sys/dev/iwm/if_iwmvar.h Thu Nov 7 23:29:25 2019 (r354494) @@ -165,20 +165,6 @@ struct iwm_ucode_capabilities { uint8_t enabled_capa[howmany(IWM_NUM_UCODE_TLV_CAPA, NBBY)]; }; -static inline int -fw_has_api(const struct iwm_ucode_capabilities *capabilities, - unsigned int api) -{ - return isset(capabilities->enabled_api, api); -} - -static inline int -fw_has_capa(const struct iwm_ucode_capabilities *capabilities, - unsigned int capa) -{ - return isset(capabilities->enabled_capa, capa); -} - /* one for each uCode image (inst/data, init/runtime/wowlan) */ struct iwm_fw_desc { const void *data; /* vmalloc'ed data */ @@ -576,3 +562,15 @@ struct iwm_softc { #define IWM_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define IWM_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) #define IWM_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx) + +static inline bool +iwm_fw_has_api(struct iwm_softc *sc, unsigned int api) +{ + return isset(sc->sc_fw.ucode_capa.enabled_api, api); +} + +static inline bool +iwm_fw_has_capa(struct iwm_softc *sc, unsigned int capa) +{ + return isset(sc->sc_fw.ucode_capa.enabled_capa, capa); +} From owner-svn-src-head@freebsd.org Thu Nov 7 23:29:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1CFCB17DD19; Thu, 7 Nov 2019 23:29:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KPM73BDz4W8M; Thu, 7 Nov 2019 23:29:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6E5E1D572; Thu, 7 Nov 2019 23:29:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NTh2o067851; Thu, 7 Nov 2019 23:29:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NTh3H067850; Thu, 7 Nov 2019 23:29:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072329.xA7NTh3H067850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:29:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354495 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354495 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:29:44 -0000 Author: markj Date: Thu Nov 7 23:29:43 2019 New Revision: 354495 URL: https://svnweb.freebsd.org/changeset/base/354495 Log: iwm: Call iwm_dev_check() earlier in iwm_attach(). This ensures that the driver softc reflects device capabilities as early as possible, for use by device initialization code that is conditional on certain capabilities. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:29:25 2019 (r354494) +++ head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:29:43 2019 (r354495) @@ -5743,8 +5743,6 @@ iwm_pci_detach(device_t dev) rman_get_rid(sc->sc_mem), sc->sc_mem); } - - static int iwm_attach(device_t dev) { @@ -5761,6 +5759,10 @@ iwm_attach(device_t dev) callout_init_mtx(&sc->sc_led_blink_to, &sc->sc_mtx, 0); TASK_INIT(&sc->sc_es_task, 0, iwm_endscan_cb, sc); + error = iwm_dev_check(dev); + if (error != 0) + goto fail; + sc->sc_notif_wait = iwm_notification_wait_init(sc); if (sc->sc_notif_wait == NULL) { device_printf(dev, "failed to init notification wait struct\n"); @@ -5785,11 +5787,6 @@ iwm_attach(device_t dev) goto fail; sc->sc_wantresp = -1; - - /* Match device id */ - error = iwm_dev_check(dev); - if (error != 0) - goto fail; sc->sc_hw_rev = IWM_READ(sc, IWM_CSR_HW_REV); /* From owner-svn-src-head@freebsd.org Thu Nov 7 23:29:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3B5717DD90; Thu, 7 Nov 2019 23:29:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KPf3rgJz4WGm; Thu, 7 Nov 2019 23:29:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66A9A1D573; Thu, 7 Nov 2019 23:29:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NTw2J067902; Thu, 7 Nov 2019 23:29:58 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NTw4f067901; Thu, 7 Nov 2019 23:29:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072329.xA7NTw4f067901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354496 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354496 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:29:58 -0000 Author: markj Date: Thu Nov 7 23:29:57 2019 New Revision: 354496 URL: https://svnweb.freebsd.org/changeset/base/354496 Log: iwm: Avoid calling iwm_start() each time a descriptor is reclaimed. Only perform the call when a qfull bit transitions. While here, avoid assignments in declarations in iwm_mvm_rx_tx_cmd(). MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:29:43 2019 (r354495) +++ head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:29:57 2019 (r354496) @@ -3337,15 +3337,22 @@ iwm_mvm_rx_tx_cmd_single(struct iwm_softc *sc, struct static void iwm_mvm_rx_tx_cmd(struct iwm_softc *sc, struct iwm_rx_packet *pkt) { - struct iwm_cmd_header *cmd_hdr = &pkt->hdr; - int idx = cmd_hdr->idx; - int qid = cmd_hdr->qid; - struct iwm_tx_ring *ring = &sc->txq[qid]; - struct iwm_tx_data *txd = &ring->data[idx]; - struct iwm_node *in = txd->in; - struct mbuf *m = txd->m; - int status; + struct iwm_cmd_header *cmd_hdr; + struct iwm_tx_ring *ring; + struct iwm_tx_data *txd; + struct iwm_node *in; + struct mbuf *m; + int idx, qid, qmsk, status; + cmd_hdr = &pkt->hdr; + idx = cmd_hdr->idx; + qid = cmd_hdr->qid; + + ring = &sc->txq[qid]; + txd = &ring->data[idx]; + in = txd->in; + m = txd->m; + KASSERT(txd->done == 0, ("txd not done")); KASSERT(txd->in != NULL, ("txd without node")); KASSERT(txd->m != NULL, ("txd without mbuf")); @@ -3366,11 +3373,11 @@ iwm_mvm_rx_tx_cmd(struct iwm_softc *sc, struct iwm_rx_ ieee80211_tx_complete(&in->in_ni, m, status); - if (--ring->queued < IWM_TX_RING_LOMARK) { - sc->qfullmsk &= ~(1 << ring->qid); - if (sc->qfullmsk == 0) { + qmsk = 1 << qid; + if (--ring->queued < IWM_TX_RING_LOMARK && (sc->qfullmsk & qmsk) != 0) { + sc->qfullmsk &= ~qmsk; + if (sc->qfullmsk == 0) iwm_start(sc); - } } } From owner-svn-src-head@freebsd.org Thu Nov 7 23:33:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5DFAB17E055; Thu, 7 Nov 2019 23:33:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KVH1nL6z4Wfv; Thu, 7 Nov 2019 23:33:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 209791D72A; Thu, 7 Nov 2019 23:33:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NXxd6073490; Thu, 7 Nov 2019 23:33:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NXwMU073488; Thu, 7 Nov 2019 23:33:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072333.xA7NXwMU073488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:33:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354497 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354497 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:33:59 -0000 Author: markj Date: Thu Nov 7 23:33:58 2019 New Revision: 354497 URL: https://svnweb.freebsd.org/changeset/base/354497 Log: iwm: Define a name for TLV 48. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:29:57 2019 (r354496) +++ head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:33:58 2019 (r354497) @@ -793,7 +793,7 @@ iwm_read_firmware(struct iwm_softc *sc) break; } - case 48: /* undocumented TLV */ + case IWM_UCODE_TLV_CMD_VERSIONS: case IWM_UCODE_TLV_SDIO_ADMA_ADDR: case IWM_UCODE_TLV_FW_GSCAN_CAPA: /* ignore, not used by current driver */ Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Nov 7 23:29:57 2019 (r354496) +++ head/sys/dev/iwm/if_iwmreg.h Thu Nov 7 23:33:58 2019 (r354497) @@ -933,6 +933,7 @@ enum iwm_ucode_tlv_type { IWM_UCODE_TLV_FW_DBG_DEST = 38, IWM_UCODE_TLV_FW_DBG_CONF = 39, IWM_UCODE_TLV_FW_DBG_TRIGGER = 40, + IWM_UCODE_TLV_CMD_VERSIONS = 48, IWM_UCODE_TLV_FW_GSCAN_CAPA = 50, IWM_UCODE_TLV_FW_MEM_SEG = 51, }; From owner-svn-src-head@freebsd.org Thu Nov 7 23:34:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98F1D17E0C3; Thu, 7 Nov 2019 23:34:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KVY3ZGwz4WnD; Thu, 7 Nov 2019 23:34:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F0F01D72B; Thu, 7 Nov 2019 23:34:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NYDWN073545; Thu, 7 Nov 2019 23:34:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NYD9G073544; Thu, 7 Nov 2019 23:34:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072334.xA7NYD9G073544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:34:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354498 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354498 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:34:13 -0000 Author: markj Date: Thu Nov 7 23:34:12 2019 New Revision: 354498 URL: https://svnweb.freebsd.org/changeset/base/354498 Log: iwm: Sync the TLV API enum with iwlwifi. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Nov 7 23:33:58 2019 (r354497) +++ head/sys/dev/iwm/if_iwmreg.h Thu Nov 7 23:34:12 2019 (r354498) @@ -635,6 +635,40 @@ P2P_PS_SCM\31UAPSD_SUPPORT\32EBS\33P2P_PS_UAPSD\36BCAS * longer than the passive one, which is essential for fragmented scan. * @IWM_UCODE_TLV_API_WIFI_MCC_UPDATE: ucode supports MCC updates with source. * @IWM_UCODE_TLV_API_LQ_SS_PARAMS: Configure STBC/BFER via LQ CMD ss_params + * @IWM_UCODE_TLV_API_NEW_VERSION: new versioning format + * @IWM_UCODE_TLV_API_SCAN_TSF_REPORT: Scan start time reported in scan + * iteration complete notification, and the timestamp reported for RX + * received during scan, are reported in TSF of the mac specified in the + * scan request. + * @IWM_UCODE_TLV_API_TKIP_MIC_KEYS: This ucode supports version 2 of + * ADD_MODIFY_STA_KEY_API_S_VER_2. + * @IWM_UCODE_TLV_API_STA_TYPE: This ucode supports station type assignement. + * @IWM_UCODE_TLV_API_NAN2_VER2: This ucode supports NAN API version 2 + * @IWM_UCODE_TLV_API_NEW_RX_STATS: should new RX STATISTICS API be used + * @IWM_UCODE_TLV_API_QUOTA_LOW_LATENCY: Quota command includes a field + * indicating low latency direction. + * @IWM_UCODE_TLV_API_DEPRECATE_TTAK: RX status flag TTAK ok (bit 7) is + * deprecated. + * @IWM_UCODE_TLV_API_ADAPTIVE_DWELL_V2: This ucode supports version 8 + * of scan request: SCAN_REQUEST_CMD_UMAC_API_S_VER_8 + * @IWM_UCODE_TLV_API_FRAG_EBS: This ucode supports fragmented EBS + * @IWM_UCODE_TLV_API_REDUCE_TX_POWER: This ucode supports v5 of + * the REDUCE_TX_POWER_CMD. + * @IWM_UCODE_TLV_API_SHORT_BEACON_NOTIF: This ucode supports the short + * version of the beacon notification. + * @IWM_UCODE_TLV_API_BEACON_FILTER_V4: This ucode supports v4 of + * BEACON_FILTER_CONFIG_API_S_VER_4. + * @IWM_UCODE_TLV_API_REGULATORY_NVM_INFO: This ucode supports v4 of + * REGULATORY_NVM_GET_INFO_RSP_API_S. + * @IWM_UCODE_TLV_API_FTM_NEW_RANGE_REQ: This ucode supports v7 of + * LOCATION_RANGE_REQ_CMD_API_S and v6 of LOCATION_RANGE_RESP_NTFY_API_S. + * @IWM_UCODE_TLV_API_SCAN_OFFLOAD_CHANS: This ucode supports v2 of + * SCAN_OFFLOAD_PROFILE_MATCH_RESULTS_S and v3 of + * SCAN_OFFLOAD_PROFILES_QUERY_RSP_S. + * @IWM_UCODE_TLV_API_MBSSID_HE: This ucode supports v2 of + * STA_CONTEXT_DOT11AX_API_S + * @IWM_UCODE_TLV_CAPA_SAR_TABLE_VER: This ucode supports different sar + * version tables. * * @IWM_NUM_UCODE_TLV_API: number of bits used */ @@ -642,12 +676,35 @@ enum iwm_ucode_tlv_api { IWM_UCODE_TLV_API_FRAGMENTED_SCAN = 8, IWM_UCODE_TLV_API_WIFI_MCC_UPDATE = 9, IWM_UCODE_TLV_API_LQ_SS_PARAMS = 18, + IWM_UCODE_TLV_API_NEW_VERSION = 20, + IWM_UCODE_TLV_API_SCAN_TSF_REPORT = 28, + IWM_UCODE_TLV_API_TKIP_MIC_KEYS = 29, + IWM_UCODE_TLV_API_STA_TYPE = 30, + IWM_UCODE_TLV_API_NAN2_VER2 = 31, + IWM_UCODE_TLV_API_ADAPTIVE_DWELL = 32, + IWM_UCODE_TLV_API_OCE = 33, + IWM_UCODE_TLV_API_NEW_BEACON_TEMPLATE = 34, + IWM_UCODE_TLV_API_NEW_RX_STATS = 35, + IWM_UCODE_TLV_API_WOWLAN_KEY_MATERIAL = 36, + IWM_UCODE_TLV_API_QUOTA_LOW_LATENCY = 38, + IWM_UCODE_TLV_API_DEPRECATE_TTAK = 41, + IWM_UCODE_TLV_API_ADAPTIVE_DWELL_V2 = 42, + IWM_UCODE_TLV_API_FRAG_EBS = 44, + IWM_UCODE_TLV_API_REDUCE_TX_POWER = 45, + IWM_UCODE_TLV_API_SHORT_BEACON_NOTIF = 46, + IWM_UCODE_TLV_API_BEACON_FILTER_V4 = 47, + IWM_UCODE_TLV_API_REGULATORY_NVM_INFO = 48, + IWM_UCODE_TLV_API_FTM_NEW_RANGE_REQ = 49, + IWM_UCODE_TLV_API_SCAN_OFFLOAD_CHANS = 50, + IWM_UCODE_TLV_API_MBSSID_HE = 52, + IWM_UCODE_TLV_API_WOWLAN_TCP_SYN_WAKE = 53, + IWM_UCODE_TLV_API_FTM_RTT_ACCURACY = 54, + IWM_UCODE_TLV_API_SAR_TABLE_VER = 55, + IWM_UCODE_TLV_API_ADWELL_HB_DEF_N_AP = 57, + IWM_UCODE_TLV_API_SCAN_EXT_CHAN_VER = 58, - IWM_NUM_UCODE_TLV_API = 32 + IWM_NUM_UCODE_TLV_API = 128, }; - -#define IWM_UCODE_TLV_API_BITS \ - "\020\10FRAGMENTED_SCAN\11WIFI_MCC_UPDATE\16WIDE_CMD_HDR\22LQ_SS_PARAMS\30EXT_SCAN_PRIO\33TX_POWER_CHAIN" /** * enum iwm_ucode_tlv_capa - ucode capabilities From owner-svn-src-head@freebsd.org Thu Nov 7 23:34:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77D5B17E13A; Thu, 7 Nov 2019 23:34:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KVs2XC9z4Ww0; Thu, 7 Nov 2019 23:34:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 011641D72D; Thu, 7 Nov 2019 23:34:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NYST0073602; Thu, 7 Nov 2019 23:34:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NYSJh073600; Thu, 7 Nov 2019 23:34:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072334.xA7NYSJh073600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354499 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354499 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:34:29 -0000 Author: markj Date: Thu Nov 7 23:34:28 2019 New Revision: 354499 URL: https://svnweb.freebsd.org/changeset/base/354499 Log: iwm: Add a few _prph functions needed for 9000-series chips. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwm_pcie_trans.c head/sys/dev/iwm/if_iwm_pcie_trans.h Modified: head/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- head/sys/dev/iwm/if_iwm_pcie_trans.c Thu Nov 7 23:34:12 2019 (r354498) +++ head/sys/dev/iwm/if_iwm_pcie_trans.c Thu Nov 7 23:34:28 2019 (r354499) @@ -185,6 +185,27 @@ iwm_write_prph(struct iwm_softc *sc, uint32_t addr, ui IWM_WRITE(sc, IWM_HBUS_TARG_PRPH_WDAT, val); } +void +iwm_write_prph64(struct iwm_softc *sc, uint64_t addr, uint64_t val) +{ + iwm_write_prph(sc, (uint32_t)addr, val & 0xffffffff); + iwm_write_prph(sc, (uint32_t)addr + 4, val >> 32); +} + +int +iwm_poll_prph(struct iwm_softc *sc, uint32_t addr, uint32_t bits, uint32_t mask, + int timeout) +{ + do { + if ((iwm_read_prph(sc, addr) & mask) == (bits & mask)) + return (0); + DELAY(10); + timeout -= 10; + } while (timeout > 0); + + return (ETIMEDOUT); +} + #ifdef IWM_DEBUG /* iwlwifi: pcie/trans.c */ int Modified: head/sys/dev/iwm/if_iwm_pcie_trans.h ============================================================================== --- head/sys/dev/iwm/if_iwm_pcie_trans.h Thu Nov 7 23:34:12 2019 (r354498) +++ head/sys/dev/iwm/if_iwm_pcie_trans.h Thu Nov 7 23:34:28 2019 (r354499) @@ -106,6 +106,10 @@ extern uint32_t iwm_read_prph(struct iwm_softc *sc, uint32_t addr); extern void iwm_write_prph(struct iwm_softc *sc, uint32_t addr, uint32_t val); +extern void iwm_write_prph64(struct iwm_softc *sc, uint64_t addr, + uint64_t val); +extern int iwm_poll_prph(struct iwm_softc *sc, uint32_t addr, uint32_t bits, + uint32_t mask, int timeout); extern int iwm_read_mem(struct iwm_softc *sc, uint32_t addr, void *buf, int dwords); extern int iwm_write_mem(struct iwm_softc *sc, uint32_t addr, const void *buf, int dwords); From owner-svn-src-head@freebsd.org Thu Nov 7 23:34:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 069F317E1C8; Thu, 7 Nov 2019 23:34:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KW563Dhz4X3X; Thu, 7 Nov 2019 23:34:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2EAD1D72E; Thu, 7 Nov 2019 23:34:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NYfWE073658; Thu, 7 Nov 2019 23:34:41 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NYfiC073657; Thu, 7 Nov 2019 23:34:41 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072334.xA7NYfiC073657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:34:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354500 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354500 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:34:42 -0000 Author: markj Date: Thu Nov 7 23:34:41 2019 New Revision: 354500 URL: https://svnweb.freebsd.org/changeset/base/354500 Log: iwm: Add 9000-series RX register definitions. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Nov 7 23:34:28 2019 (r354499) +++ head/sys/dev/iwm/if_iwmreg.h Thu Nov 7 23:34:41 2019 (r354500) @@ -1527,6 +1527,52 @@ static inline unsigned int IWM_FH_MEM_CBBC_QUEUE(unsig #define IWM_FH_MEM_TFDIB_REG1_ADDR_BITSHIFT 28 +/* 9000 rx series registers */ + +#define IWM_RFH_Q0_FRBDCB_BA_LSB 0xa08000 +#define IWM_RFH_Q_FRBDCB_BA_LSB (IWM_RFH_Q0_FRBDCB_BA_LSB + (q) * 8) +/* Write index table */ +#define IWM_RFH_Q0_FRBDCB_WIDX 0xa08080 +#define IWM_RFH_Q_FRBDCB_WIDX (IWM_RFH_Q0_FRBDCB_WIDX + (q) * 4) +/* Write index table - shadow registers */ +#define IWM_RFH_Q0_FRBDCB_WIDX_TRG 0x1c80 +#define IWM_RFH_Q_FRBDCB_WIDX_TRG (IWM_RFH_Q0_FRBDCB_WIDX_TRG + (q) * 4) +/* Read index table */ +#define IWM_RFH_Q0_FRBDCB_RIDX 0xa080c0 +#define IWM_RFH_Q_FRBDCB_RIDX (IWM_RFH_Q0_FRBDCB_RIDX + (q) * 4) +/* Used list table */ +#define IWM_RFH_Q0_URBDCB_BA_LSB 0xa08100 +#define IWM_RFH_Q_URBDCB_BA_LSB (IWM_RFH_Q0_URBDCB_BA_LSB + (q) * 8) +/* Write index table */ +#define IWM_RFH_Q0_URBDCB_WIDX 0xa08180 +#define IWM_RFH_Q_URBDCB_WIDX (IWM_RFH_Q0_URBDCB_WIDX + (q) * 4) +/* stts */ +#define IWM_RFH_Q0_URBD_STTS_WPTR_LSB 0xa08200 +#define IWM_RFH_Q_URBD_STTS_WPTR_LSB (IWM_RFH_Q0_URBD_STTS_WPTR_LSB + (q) * 8) + +#define IWM_RFH_GEN_STATUS 0xa09808 +#define IWM_RXF_DMA_IDLE 0x80000000 + +/* DMA configuration */ +#define IWM_RFH_RXF_DMA_CFG 0xa09820 +#define IWM_RFH_RXF_DMA_RB_SIZE_1K 0x00010000 +#define IWM_RFH_RXF_DMA_RB_SIZE_2K 0x00020000 +#define IWM_RFH_RXF_DMA_RB_SIZE_4K 0x00040000 +#define IWM_RFH_RXF_DMA_RBDCB_SIZE_512 0x00900000 +#define IWM_RFH_RXF_DMA_MIN_RB_4_8 0x03000000 +#define IWM_RFH_RXF_DMA_DROP_TOO_LARGE_MASK 0x04000000 +#define IWM_RFH_DMA_EN_ENABLE_VAL 0x80000000 + +#define IWM_RFH_GEN_CFG 0xa09800 +#define IWM_RFH_GEN_CFG_SERVICE_DMA_SNOOP 0x00000001 +#define IWM_RFH_GEN_CFG_RFH_DMA_SNOOP 0x00000002 +#define IWM_RFH_GEN_CFG_RB_CHUNK_SIZE_128 0x00000010 +#define IWM_RFH_GEN_CFG_RB_CHUNK_SIZE_64 0x00000000 + +#define IWM_RFH_RXF_RXQ_ACTIVE 0xa0980c + +/* end of 9000 rx series registers */ + /* TFDB Area - TFDs buffer table */ #define IWM_FH_MEM_TFDIB_DRAM_ADDR_LSB_MSK (0xFFFFFFFF) #define IWM_FH_TFDIB_LOWER_BOUND (IWM_FH_MEM_LOWER_BOUND + 0x900) From owner-svn-src-head@freebsd.org Thu Nov 7 23:35:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B76217E257; Thu, 7 Nov 2019 23:35:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KWV1mfYz4XBK; Thu, 7 Nov 2019 23:35:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 217221D72F; Thu, 7 Nov 2019 23:35:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NZ20S073730; Thu, 7 Nov 2019 23:35:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NZ1Va073727; Thu, 7 Nov 2019 23:35:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072335.xA7NZ1Va073727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354501 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354501 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:35:02 -0000 Author: markj Date: Thu Nov 7 23:35:01 2019 New Revision: 354501 URL: https://svnweb.freebsd.org/changeset/base/354501 Log: iwm: Add a device family definition for 9000 chips. Convert existing device family checks to avoid assuming that the device family is always one of IWM_DEVICE_FAMILY_7000 or _8000. Submitted by: lwhsu, Guo Wen Jun MFC after: 2 weeks Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_config.h head/sys/dev/iwm/if_iwm_pcie_trans.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:34:41 2019 (r354500) +++ head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:35:01 2019 (r354501) @@ -1651,7 +1651,7 @@ iwm_trans_pcie_fw_alive(struct iwm_softc *sc, uint32_t iwm_nic_unlock(sc); /* Enable L1-Active */ - if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) { + if (sc->cfg->device_family < IWM_DEVICE_FAMILY_8000) { iwm_clear_bits_prph(sc, IWM_APMG_PCIDEV_STT_REG, IWM_APMG_PCIDEV_STT_VAL_L1_ACT_DIS); } @@ -2069,7 +2069,7 @@ static int iwm_get_sku(const struct iwm_softc *sc, const uint16_t *nvm_sw, const uint16_t *phy_sku) { - if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family < IWM_DEVICE_FAMILY_8000) return le16_to_cpup(nvm_sw + IWM_SKU); return le32_to_cpup((const uint32_t *)(phy_sku + IWM_SKU_8000)); @@ -2078,7 +2078,7 @@ iwm_get_sku(const struct iwm_softc *sc, const uint16_t static int iwm_get_nvm_version(const struct iwm_softc *sc, const uint16_t *nvm_sw) { - if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family < IWM_DEVICE_FAMILY_8000) return le16_to_cpup(nvm_sw + IWM_NVM_VERSION); else return le32_to_cpup((const uint32_t *)(nvm_sw + @@ -2089,7 +2089,7 @@ static int iwm_get_radio_cfg(const struct iwm_softc *sc, const uint16_t *nvm_sw, const uint16_t *phy_sku) { - if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family < IWM_DEVICE_FAMILY_8000) return le16_to_cpup(nvm_sw + IWM_RADIO_CFG); return le32_to_cpup((const uint32_t *)(phy_sku + IWM_RADIO_CFG_8000)); @@ -2100,7 +2100,7 @@ iwm_get_n_hw_addrs(const struct iwm_softc *sc, const u { int n_hw_addr; - if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family < IWM_DEVICE_FAMILY_8000) return le16_to_cpup(nvm_sw + IWM_N_HW_ADDRS); n_hw_addr = le32_to_cpup((const uint32_t *)(nvm_sw + IWM_N_HW_ADDRS_8000)); @@ -2112,7 +2112,7 @@ static void iwm_set_radio_cfg(const struct iwm_softc *sc, struct iwm_nvm_data *data, uint32_t radio_cfg) { - if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) { + if (sc->cfg->device_family < IWM_DEVICE_FAMILY_8000) { data->radio_cfg_type = IWM_NVM_RF_CFG_TYPE_MSK(radio_cfg); data->radio_cfg_step = IWM_NVM_RF_CFG_STEP_MSK(radio_cfg); data->radio_cfg_dash = IWM_NVM_RF_CFG_DASH_MSK(radio_cfg); @@ -2138,7 +2138,7 @@ iwm_set_hw_address(struct iwm_softc *sc, struct iwm_nv iwm_set_hw_address_from_csr(sc, data); } else #endif - if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) { + if (sc->cfg->device_family < IWM_DEVICE_FAMILY_8000) { const uint8_t *hw_addr = (const uint8_t *)(nvm_hw + IWM_HW_ADDR); /* The byte order is little endian 16 bit, meaning 214365 */ @@ -2170,7 +2170,7 @@ iwm_parse_nvm_data(struct iwm_softc *sc, uint32_t sku, radio_cfg; uint16_t lar_config; - if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) { + if (sc->cfg->device_family < IWM_DEVICE_FAMILY_8000) { data = malloc(sizeof(*data) + IWM_NUM_CHANNELS * sizeof(uint16_t), M_DEVBUF, M_NOWAIT | M_ZERO); @@ -2194,7 +2194,8 @@ iwm_parse_nvm_data(struct iwm_softc *sc, data->n_hw_addrs = iwm_get_n_hw_addrs(sc, nvm_sw); - if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { + if (sc->cfg->device_family >= IWM_DEVICE_FAMILY_8000) { + /* TODO: use IWL_NVM_EXT */ uint16_t lar_offset = data->nvm_version < 0xE39 ? IWM_NVM_LAR_OFFSET_8000_OLD : IWM_NVM_LAR_OFFSET_8000; @@ -2242,7 +2243,7 @@ iwm_parse_nvm_sections(struct iwm_softc *sc, struct iw "Can't parse empty OTP/NVM sections\n"); return NULL; } - } else if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { + } else if (sc->cfg->device_family >= IWM_DEVICE_FAMILY_8000) { /* SW and REGULATORY sections are mandatory */ if (!sections[IWM_NVM_SECTION_TYPE_SW].data || !sections[IWM_NVM_SECTION_TYPE_REGULATORY].data) { @@ -2672,7 +2673,7 @@ iwm_start_fw(struct iwm_softc *sc, const struct iwm_fw IWM_WRITE(sc, IWM_CSR_UCODE_DRV_GP1_CLR, IWM_CSR_UCODE_SW_BIT_RFKILL); /* Load the given image to the HW */ - if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family >= IWM_DEVICE_FAMILY_8000) ret = iwm_pcie_load_given_ucode_8000(sc, fw); else ret = iwm_pcie_load_given_ucode(sc, fw); @@ -2823,7 +2824,7 @@ iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, IWM_MVM_UCODE_ALIVE_TIMEOUT); IWM_LOCK(sc); if (error) { - if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { + if (sc->cfg->device_family >= IWM_DEVICE_FAMILY_8000) { uint32_t a = 0x5a5a5a5a, b = 0x5a5a5a5a; if (iwm_nic_lock(sc)) { a = iwm_read_prph(sc, IWM_SB_CPU_1_STATUS); @@ -4458,7 +4459,7 @@ iwm_mvm_is_lar_supported(struct iwm_softc *sc) * Enable LAR only if it is supported by the FW (TLV) && * enabled in the NVM */ - if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family >= IWM_DEVICE_FAMILY_8000) return nvm_lar && tlv_lar; else return tlv_lar; @@ -5802,7 +5803,7 @@ iwm_attach(device_t dev) * "dash" value). To keep hw_rev backwards compatible - we'll store it * in the old format. */ - if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { + if (sc->cfg->device_family >= IWM_DEVICE_FAMILY_8000) { int ret; uint32_t hw_step; Modified: head/sys/dev/iwm/if_iwm_config.h ============================================================================== --- head/sys/dev/iwm/if_iwm_config.h Thu Nov 7 23:34:41 2019 (r354500) +++ head/sys/dev/iwm/if_iwm_config.h Thu Nov 7 23:35:01 2019 (r354501) @@ -78,6 +78,7 @@ enum iwm_device_family { IWM_DEVICE_FAMILY_UNDEFINED, IWM_DEVICE_FAMILY_7000, IWM_DEVICE_FAMILY_8000, + IWM_DEVICE_FAMILY_9000, }; #define IWM_DEFAULT_MAX_TX_POWER 22 Modified: head/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- head/sys/dev/iwm/if_iwm_pcie_trans.c Thu Nov 7 23:34:41 2019 (r354500) +++ head/sys/dev/iwm/if_iwm_pcie_trans.c Thu Nov 7 23:35:01 2019 (r354501) @@ -282,7 +282,7 @@ iwm_nic_lock(struct iwm_softc *sc) IWM_SETBITS(sc, IWM_CSR_GP_CNTRL, IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); - if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family >= IWM_DEVICE_FAMILY_8000) DELAY(2); if (iwm_poll_bit(sc, IWM_CSR_GP_CNTRL, @@ -475,7 +475,7 @@ iwm_apm_init(struct iwm_softc *sc) IWM_DPRINTF(sc, IWM_DEBUG_RESET, "iwm apm start\n"); /* Disable L0S exit timer (platform NMI Work/Around) */ - if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) { + if (sc->cfg->device_family < IWM_DEVICE_FAMILY_8000) { IWM_SETBITS(sc, IWM_CSR_GIO_CHICKEN_BITS, IWM_CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER); } From owner-svn-src-head@freebsd.org Thu Nov 7 23:35:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3701D17E302; Thu, 7 Nov 2019 23:35:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KWm0nXLz4XJx; Thu, 7 Nov 2019 23:35:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3F621D730; Thu, 7 Nov 2019 23:35:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NZFV7073786; Thu, 7 Nov 2019 23:35:15 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NZF05073785; Thu, 7 Nov 2019 23:35:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072335.xA7NZF05073785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354502 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354502 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:35:16 -0000 Author: markj Date: Thu Nov 7 23:35:15 2019 New Revision: 354502 URL: https://svnweb.freebsd.org/changeset/base/354502 Log: iwm: Use the same delays as iwlwifi when resetting the device. This is required for initialization to succeed for newer device families. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_pcie_trans.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:35:01 2019 (r354501) +++ head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:35:15 2019 (r354502) @@ -1315,12 +1315,14 @@ iwm_stop_device(struct iwm_softc *sc) /* Stop the device, and put it in low power state */ iwm_apm_stop(sc); - /* Upon stop, the APM issues an interrupt if HW RF kill is set. - * Clean again the interrupt here + /* stop and reset the on-board processor */ + IWM_SETBITS(sc, IWM_CSR_RESET, IWM_CSR_RESET_REG_FLAG_SW_RESET); + DELAY(5000); + + /* + * Upon stop, the APM issues an interrupt if HW RF kill is set. */ iwm_disable_interrupts(sc); - /* stop and reset the on-board processor */ - IWM_WRITE(sc, IWM_CSR_RESET, IWM_CSR_RESET_REG_FLAG_SW_RESET); /* * Even if we stop the HW, we still want the RF kill Modified: head/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- head/sys/dev/iwm/if_iwm_pcie_trans.c Thu Nov 7 23:35:01 2019 (r354501) +++ head/sys/dev/iwm/if_iwm_pcie_trans.c Thu Nov 7 23:35:15 2019 (r354502) @@ -611,7 +611,7 @@ iwm_start_hw(struct iwm_softc *sc) /* Reset the entire device */ IWM_WRITE(sc, IWM_CSR_RESET, IWM_CSR_RESET_REG_FLAG_SW_RESET); - DELAY(10); + DELAY(5000); if ((error = iwm_apm_init(sc)) != 0) return error; From owner-svn-src-head@freebsd.org Thu Nov 7 23:35:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E6E217E396; Thu, 7 Nov 2019 23:35:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KX21Sbtz4XRc; Thu, 7 Nov 2019 23:35:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 143EF1D731; Thu, 7 Nov 2019 23:35:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NZTcj073838; Thu, 7 Nov 2019 23:35:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NZTDE073836; Thu, 7 Nov 2019 23:35:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072335.xA7NZTDE073836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354503 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354503 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:35:30 -0000 Author: markj Date: Thu Nov 7 23:35:29 2019 New Revision: 354503 URL: https://svnweb.freebsd.org/changeset/base/354503 Log: iwm: Sync the firmware tx_cmd descriptor fields with iwlwifi. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:35:15 2019 (r354502) +++ head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:35:29 2019 (r354503) @@ -3656,7 +3656,6 @@ iwm_tx(struct iwm_softc *sc, struct mbuf *m, struct ie } else pad = 0; - tx->driver_txop = 0; tx->next_frame_len = 0; tx->len = htole16(totlen); Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Nov 7 23:35:15 2019 (r354502) +++ head/sys/dev/iwm/if_iwmreg.h Thu Nov 7 23:35:29 2019 (r354503) @@ -4465,8 +4465,7 @@ struct iwm_tx_cmd { uint8_t initial_rate_index; uint8_t reserved2; uint8_t key[16]; - uint16_t next_frame_flags; - uint16_t reserved3; + uint32_t reserved3; uint32_t life_time; uint32_t dram_lsb_ptr; uint8_t dram_msb_ptr; @@ -4474,7 +4473,7 @@ struct iwm_tx_cmd { uint8_t data_retry_limit; uint8_t tid_tspec; uint16_t pm_frame_timeout; - uint16_t driver_txop; + uint16_t reserved4; uint8_t payload[0]; struct ieee80211_frame hdr[0]; } __packed; /* IWM_TX_CMD_API_S_VER_3 */ From owner-svn-src-head@freebsd.org Thu Nov 7 23:35:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4071117E435; Thu, 7 Nov 2019 23:35:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KXX0lxBz4XZX; Thu, 7 Nov 2019 23:35:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5E311D732; Thu, 7 Nov 2019 23:35:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NZtiC073902; Thu, 7 Nov 2019 23:35:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NZsWZ073897; Thu, 7 Nov 2019 23:35:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072335.xA7NZsWZ073897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354504 - in head/sys: dev/iwm modules/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: dev/iwm modules/iwm X-SVN-Commit-Revision: 354504 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:35:56 -0000 Author: markj Date: Thu Nov 7 23:35:54 2019 New Revision: 354504 URL: https://svnweb.freebsd.org/changeset/base/354504 Log: iwm: Add device configuration definitions for 9000-series chips. Match such chips using the device ID. We should really be checking the subdevice as well, since a smaller number of 9460 and 9560 devices actually belong to a new series of devices and require different firmware, but that will require some extra logic in iwm_attach(). Submitted by: lwhsu, Guo Wen Jun MFC after: 2 weeks Added: head/sys/dev/iwm/if_iwm_9000.c (contents, props changed) head/sys/dev/iwm/if_iwm_9260.c (contents, props changed) Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_config.h head/sys/modules/iwm/Makefile Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:35:29 2019 (r354503) +++ head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:35:54 2019 (r354504) @@ -5624,6 +5624,9 @@ iwm_intr(void *arg) #define PCI_PRODUCT_INTEL_WL_8260_1 0x24f3 #define PCI_PRODUCT_INTEL_WL_8260_2 0x24f4 #define PCI_PRODUCT_INTEL_WL_8265_1 0x24fd +#define PCI_PRODUCT_INTEL_WL_9560_1 0x9df0 +#define PCI_PRODUCT_INTEL_WL_9560_2 0xa370 +#define PCI_PRODUCT_INTEL_WL_9260_1 0x2526 static const struct iwm_devices { uint16_t device; @@ -5641,6 +5644,9 @@ static const struct iwm_devices { { PCI_PRODUCT_INTEL_WL_8260_1, &iwm8260_cfg }, { PCI_PRODUCT_INTEL_WL_8260_2, &iwm8260_cfg }, { PCI_PRODUCT_INTEL_WL_8265_1, &iwm8265_cfg }, + { PCI_PRODUCT_INTEL_WL_9560_1, &iwm9560_cfg }, + { PCI_PRODUCT_INTEL_WL_9560_2, &iwm9560_cfg }, + { PCI_PRODUCT_INTEL_WL_9260_1, &iwm9260_cfg }, }; static int Added: head/sys/dev/iwm/if_iwm_9000.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iwm/if_iwm_9000.c Thu Nov 7 23:35:54 2019 (r354504) @@ -0,0 +1,95 @@ +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + ****************************************************************************** + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * BSD LICENSE + * + * Copyright(c) 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT + * OWNER 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 "opt_wlan.h" +#include "opt_iwm.h" + +#include + +#include "if_iwm_config.h" + +#define IWM9000_FW "iwm9000fw" + +#define IWM_NVM_HW_SECTION_NUM_FAMILY_9000 10 + +#define IWM_DEVICE_9000_COMMON \ + .device_family = IWM_DEVICE_FAMILY_9000, \ + .eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_9000, \ + .nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_9000 + +const struct iwm_cfg iwm9560_cfg = { + .name = "Intel(R) Dual Band Wireless AC 9560", + .fw_name = IWM9000_FW, + IWM_DEVICE_9000_COMMON, + .host_interrupt_operation_mode = 0, +}; Added: head/sys/dev/iwm/if_iwm_9260.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iwm/if_iwm_9260.c Thu Nov 7 23:35:54 2019 (r354504) @@ -0,0 +1,95 @@ +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + ****************************************************************************** + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * BSD LICENSE + * + * Copyright(c) 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT + * OWNER 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 "opt_wlan.h" +#include "opt_iwm.h" + +#include + +#include "if_iwm_config.h" + +#define IWM9260_FW "iwm9260fw" + +#define IWM_NVM_HW_SECTION_NUM_FAMILY_9260 10 + +#define IWM_DEVICE_9260_COMMON \ + .device_family = IWM_DEVICE_FAMILY_9000, \ + .eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_9000, \ + .nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_9260 + +const struct iwm_cfg iwm9260_cfg = { + .name = "Intel(R) Dual Band Wireless AC 9260", + .fw_name = IWM9260_FW, + IWM_DEVICE_9260_COMMON, + .host_interrupt_operation_mode = 0, +}; Modified: head/sys/dev/iwm/if_iwm_config.h ============================================================================== --- head/sys/dev/iwm/if_iwm_config.h Thu Nov 7 23:35:29 2019 (r354503) +++ head/sys/dev/iwm/if_iwm_config.h Thu Nov 7 23:35:54 2019 (r354504) @@ -151,5 +151,7 @@ extern const struct iwm_cfg iwm7265_cfg; extern const struct iwm_cfg iwm7265d_cfg; extern const struct iwm_cfg iwm8260_cfg; extern const struct iwm_cfg iwm8265_cfg; +extern const struct iwm_cfg iwm9560_cfg; +extern const struct iwm_cfg iwm9260_cfg; #endif /* __IWM_CONFIG_H__ */ Modified: head/sys/modules/iwm/Makefile ============================================================================== --- head/sys/modules/iwm/Makefile Thu Nov 7 23:35:29 2019 (r354503) +++ head/sys/modules/iwm/Makefile Thu Nov 7 23:35:54 2019 (r354504) @@ -7,7 +7,8 @@ KMOD= if_iwm SRCS= if_iwm.c if_iwm_binding.c if_iwm_util.c if_iwm_phy_db.c SRCS+= if_iwm_mac_ctxt.c if_iwm_phy_ctxt.c if_iwm_time_event.c SRCS+= if_iwm_power.c if_iwm_scan.c if_iwm_led.c if_iwm_notif_wait.c -SRCS+= if_iwm_7000.c if_iwm_8000.c if_iwm_fw.c if_iwm_sta.c if_iwm_sf.c +SRCS+= if_iwm_7000.c if_iwm_8000.c if_iwm_9000.c if_iwm_fw.c if_iwm_9260.c +SRCS+= if_iwm_sta.c if_iwm_sf.c # bus layer SRCS+= if_iwm_pcie_trans.c SRCS+= device_if.h bus_if.h pci_if.h opt_wlan.h opt_iwm.h From owner-svn-src-head@freebsd.org Thu Nov 7 23:36:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E387B17E4DA; Thu, 7 Nov 2019 23:36:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KXq5mqXz4XjH; Thu, 7 Nov 2019 23:36:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A97B31D733; Thu, 7 Nov 2019 23:36:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NaBP5073962; Thu, 7 Nov 2019 23:36:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NaBbd073959; Thu, 7 Nov 2019 23:36:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072336.xA7NaBbd073959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:36:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354505 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354505 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:36:12 -0000 Author: markj Date: Thu Nov 7 23:36:10 2019 New Revision: 354505 URL: https://svnweb.freebsd.org/changeset/base/354505 Log: iwm: Define the mqrx_supported capability. The firmware for 9000-series and newer devices has a different receive API which supports multiple queues. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwm_9000.c head/sys/dev/iwm/if_iwm_9260.c head/sys/dev/iwm/if_iwm_config.h Modified: head/sys/dev/iwm/if_iwm_9000.c ============================================================================== --- head/sys/dev/iwm/if_iwm_9000.c Thu Nov 7 23:35:54 2019 (r354504) +++ head/sys/dev/iwm/if_iwm_9000.c Thu Nov 7 23:36:10 2019 (r354505) @@ -92,4 +92,6 @@ const struct iwm_cfg iwm9560_cfg = { .fw_name = IWM9000_FW, IWM_DEVICE_9000_COMMON, .host_interrupt_operation_mode = 0, + .mqrx_supported = 1, + .integrated = 1, }; Modified: head/sys/dev/iwm/if_iwm_9260.c ============================================================================== --- head/sys/dev/iwm/if_iwm_9260.c Thu Nov 7 23:35:54 2019 (r354504) +++ head/sys/dev/iwm/if_iwm_9260.c Thu Nov 7 23:36:10 2019 (r354505) @@ -92,4 +92,5 @@ const struct iwm_cfg iwm9260_cfg = { .fw_name = IWM9260_FW, IWM_DEVICE_9260_COMMON, .host_interrupt_operation_mode = 0, + .mqrx_supported = 1, }; Modified: head/sys/dev/iwm/if_iwm_config.h ============================================================================== --- head/sys/dev/iwm/if_iwm_config.h Thu Nov 7 23:35:54 2019 (r354504) +++ head/sys/dev/iwm/if_iwm_config.h Thu Nov 7 23:36:10 2019 (r354505) @@ -131,13 +131,15 @@ enum iwm_nvm_type { */ struct iwm_cfg { const char *name; - const char *fw_name; - uint16_t eeprom_size; - enum iwm_device_family device_family; - int host_interrupt_operation_mode; - uint8_t nvm_hw_section_num; - int apmg_wake_up_wa; - enum iwm_nvm_type nvm_type; + const char *fw_name; + uint16_t eeprom_size; + enum iwm_device_family device_family; + int host_interrupt_operation_mode; + int mqrx_supported; + int integrated; + uint8_t nvm_hw_section_num; + int apmg_wake_up_wa; + enum iwm_nvm_type nvm_type; }; /* From owner-svn-src-head@freebsd.org Thu Nov 7 23:36:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4817B17E554; Thu, 7 Nov 2019 23:36:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KY60rRcz4Xqs; Thu, 7 Nov 2019 23:36:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3F671D734; Thu, 7 Nov 2019 23:36:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NaPlX074017; Thu, 7 Nov 2019 23:36:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NaPb5074015; Thu, 7 Nov 2019 23:36:25 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072336.xA7NaPb5074015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354506 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354506 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:36:26 -0000 Author: markj Date: Thu Nov 7 23:36:25 2019 New Revision: 354506 URL: https://svnweb.freebsd.org/changeset/base/354506 Log: iwm: Explicitly enable MSI on newer chipsets. 9000-series chips implement support for MSI-X interrupts and disable MSI by default. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwm_pcie_trans.c head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- head/sys/dev/iwm/if_iwm_pcie_trans.c Thu Nov 7 23:36:10 2019 (r354505) +++ head/sys/dev/iwm/if_iwm_pcie_trans.c Thu Nov 7 23:36:25 2019 (r354506) @@ -616,6 +616,10 @@ iwm_start_hw(struct iwm_softc *sc) if ((error = iwm_apm_init(sc)) != 0) return error; + /* On newer chipsets MSI is disabled by default. */ + if (sc->cfg->mqrx_supported) + iwm_write_prph(sc, IWM_UREG_CHICK, IWM_UREG_CHICK_MSI_ENABLE); + iwm_enable_rfkill_int(sc); iwm_check_rfkill(sc); Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Nov 7 23:36:10 2019 (r354505) +++ head/sys/dev/iwm/if_iwmreg.h Thu Nov 7 23:36:25 2019 (r354506) @@ -457,6 +457,10 @@ enum iwm_secure_boot_status_reg { #define IWM_LMPM_CHICK 0xa01ff8 #define IWM_LMPM_CHICK_EXTENDED_ADDR_SPACE 0x01 +#define IWM_UREG_CHICK 0xa05c00 +#define IWM_UREG_CHICK_MSI_ENABLE 0x01000000 +#define IWM_UREG_CHICK_MSIX_ENABLE 0x02000000 + #define IWM_FH_TCSR_0_REG0 (0x1D00) /* From owner-svn-src-head@freebsd.org Thu Nov 7 23:36:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3F5C17E612; Thu, 7 Nov 2019 23:36:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KYV4PQBz4Xyt; Thu, 7 Nov 2019 23:36:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B1741D735; Thu, 7 Nov 2019 23:36:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NakG5074071; Thu, 7 Nov 2019 23:36:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NakMT074070; Thu, 7 Nov 2019 23:36:46 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072336.xA7NakMT074070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354507 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354507 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:36:46 -0000 Author: markj Date: Thu Nov 7 23:36:46 2019 New Revision: 354507 URL: https://svnweb.freebsd.org/changeset/base/354507 Log: iwm: Enable all 31 tx queues. For now iwm only ever uses queue 0 and the management queue, but my 9560 raises a software error interrupt during initialization if this flag is not set. iwlwifi sets it for all 7000- and 8000-series hardware, so we might as well do it unconditionally. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:36:25 2019 (r354506) +++ head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:36:46 2019 (r354507) @@ -1468,7 +1468,9 @@ iwm_nic_tx_init(struct iwm_softc *sc) (unsigned long) (txq->desc_dma.paddr >> 8)); } - iwm_write_prph(sc, IWM_SCD_GP_CTRL, IWM_SCD_GP_CTRL_AUTO_ACTIVE_MODE); + iwm_set_bits_prph(sc, IWM_SCD_GP_CTRL, + IWM_SCD_GP_CTRL_AUTO_ACTIVE_MODE | + IWM_SCD_GP_CTRL_ENABLE_31_QUEUES); iwm_nic_unlock(sc); From owner-svn-src-head@freebsd.org Thu Nov 7 23:37:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F420B17E68C; Thu, 7 Nov 2019 23:37:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KYq6wPLz4Y6X; Thu, 7 Nov 2019 23:37:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0F201D736; Thu, 7 Nov 2019 23:37:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7Nb38I074135; Thu, 7 Nov 2019 23:37:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7Nb3Zg074130; Thu, 7 Nov 2019 23:37:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072337.xA7Nb3Zg074130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354508 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354508 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:37:04 -0000 Author: markj Date: Thu Nov 7 23:37:02 2019 New Revision: 354508 URL: https://svnweb.freebsd.org/changeset/base/354508 Log: iwm: Implement the new receive path. This is the multiqueue receive code required for 9000-series chips. Note that we still only configure a single RX queue for now. Multiqueue support will require MSI-X configuration and a scheme for managing a global pool of RX buffers. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_pcie_trans.c head/sys/dev/iwm/if_iwmreg.h head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:36:46 2019 (r354507) +++ head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:37:02 2019 (r354508) @@ -322,16 +322,14 @@ static int iwm_mvm_load_ucode_wait_alive(struct iwm_so static int iwm_run_init_mvm_ucode(struct iwm_softc *, int); static int iwm_mvm_config_ltr(struct iwm_softc *sc); static int iwm_rx_addbuf(struct iwm_softc *, int, int); -static int iwm_mvm_get_signal_strength(struct iwm_softc *, - struct iwm_rx_phy_info *); static void iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *, struct iwm_rx_packet *); static int iwm_get_noise(struct iwm_softc *, const struct iwm_mvm_statistics_rx_non_phy *); static void iwm_mvm_handle_rx_statistics(struct iwm_softc *, struct iwm_rx_packet *); -static boolean_t iwm_mvm_rx_rx_mpdu(struct iwm_softc *, struct mbuf *, - uint32_t, boolean_t); +static bool iwm_mvm_rx_mpdu(struct iwm_softc *, struct mbuf *, + uint32_t, bool); static int iwm_mvm_rx_tx_cmd_single(struct iwm_softc *, struct iwm_rx_packet *, struct iwm_node *); @@ -929,19 +927,28 @@ static int iwm_alloc_rx_ring(struct iwm_softc *sc, struct iwm_rx_ring *ring) { bus_size_t size; - int i, error; + size_t descsz; + int count, i, error; ring->cur = 0; + if (sc->cfg->mqrx_supported) { + count = IWM_RX_MQ_RING_COUNT; + descsz = sizeof(uint64_t); + } else { + count = IWM_RX_LEGACY_RING_COUNT; + descsz = sizeof(uint32_t); + } /* Allocate RX descriptors (256-byte aligned). */ - size = IWM_RX_RING_COUNT * sizeof(uint32_t); - error = iwm_dma_contig_alloc(sc->sc_dmat, &ring->desc_dma, size, 256); + size = count * descsz; + error = iwm_dma_contig_alloc(sc->sc_dmat, &ring->free_desc_dma, size, + 256); if (error != 0) { device_printf(sc->sc_dev, "could not allocate RX ring DMA memory\n"); goto fail; } - ring->desc = ring->desc_dma.vaddr; + ring->desc = ring->free_desc_dma.vaddr; /* Allocate RX status area (16-byte aligned). */ error = iwm_dma_contig_alloc(sc->sc_dmat, &ring->stat_dma, @@ -953,6 +960,17 @@ iwm_alloc_rx_ring(struct iwm_softc *sc, struct iwm_rx_ } ring->stat = ring->stat_dma.vaddr; + if (sc->cfg->mqrx_supported) { + size = count * sizeof(uint32_t); + error = iwm_dma_contig_alloc(sc->sc_dmat, &ring->used_desc_dma, + size, 256); + if (error != 0) { + device_printf(sc->sc_dev, + "could not allocate RX ring DMA memory\n"); + goto fail; + } + } + /* Create RX buffer DMA tag. */ error = bus_dma_tag_create(sc->sc_dmat, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, @@ -972,10 +990,11 @@ iwm_alloc_rx_ring(struct iwm_softc *sc, struct iwm_rx_ __func__, error); goto fail; } + /* * Allocate and map RX buffers. */ - for (i = 0; i < IWM_RX_RING_COUNT; i++) { + for (i = 0; i < count; i++) { struct iwm_rx_data *data = &ring->data[i]; error = bus_dmamap_create(ring->data_dmat, 0, &data->map); if (error != 0) { @@ -1013,12 +1032,16 @@ iwm_reset_rx_ring(struct iwm_softc *sc, struct iwm_rx_ static void iwm_free_rx_ring(struct iwm_softc *sc, struct iwm_rx_ring *ring) { - int i; + int count, i; - iwm_dma_contig_free(&ring->desc_dma); + iwm_dma_contig_free(&ring->free_desc_dma); iwm_dma_contig_free(&ring->stat_dma); + iwm_dma_contig_free(&ring->used_desc_dma); - for (i = 0; i < IWM_RX_RING_COUNT; i++) { + count = sc->cfg->mqrx_supported ? IWM_RX_MQ_RING_COUNT : + IWM_RX_LEGACY_RING_COUNT; + + for (i = 0; i < count; i++) { struct iwm_rx_data *data = &ring->data[i]; if (data->m != NULL) { @@ -1377,13 +1400,62 @@ iwm_mvm_nic_config(struct iwm_softc *sc) } static int -iwm_nic_rx_init(struct iwm_softc *sc) +iwm_nic_rx_mq_init(struct iwm_softc *sc) { - /* - * Initialize RX ring. This is from the iwn driver. - */ - memset(sc->rxq.stat, 0, sizeof(*sc->rxq.stat)); + int enabled; + if (!iwm_nic_lock(sc)) + return EBUSY; + + /* Stop RX DMA. */ + iwm_write_prph(sc, IWM_RFH_RXF_DMA_CFG, 0); + /* Disable RX used and free queue operation. */ + iwm_write_prph(sc, IWM_RFH_RXF_RXQ_ACTIVE, 0); + + iwm_write_prph64(sc, IWM_RFH_Q0_FRBDCB_BA_LSB, + sc->rxq.free_desc_dma.paddr); + iwm_write_prph64(sc, IWM_RFH_Q0_URBDCB_BA_LSB, + sc->rxq.used_desc_dma.paddr); + iwm_write_prph64(sc, IWM_RFH_Q0_URBD_STTS_WPTR_LSB, + sc->rxq.stat_dma.paddr); + iwm_write_prph(sc, IWM_RFH_Q0_FRBDCB_WIDX, 0); + iwm_write_prph(sc, IWM_RFH_Q0_FRBDCB_RIDX, 0); + iwm_write_prph(sc, IWM_RFH_Q0_URBDCB_WIDX, 0); + + /* We configure only queue 0 for now. */ + enabled = ((1 << 0) << 16) | (1 << 0); + + /* Enable RX DMA, 4KB buffer size. */ + iwm_write_prph(sc, IWM_RFH_RXF_DMA_CFG, + IWM_RFH_DMA_EN_ENABLE_VAL | + IWM_RFH_RXF_DMA_RB_SIZE_4K | + IWM_RFH_RXF_DMA_MIN_RB_4_8 | + IWM_RFH_RXF_DMA_DROP_TOO_LARGE_MASK | + IWM_RFH_RXF_DMA_RBDCB_SIZE_512); + + /* Enable RX DMA snooping. */ + iwm_write_prph(sc, IWM_RFH_GEN_CFG, + IWM_RFH_GEN_CFG_RFH_DMA_SNOOP | + IWM_RFH_GEN_CFG_SERVICE_DMA_SNOOP | + (sc->cfg->integrated ? IWM_RFH_GEN_CFG_RB_CHUNK_SIZE_64 : + IWM_RFH_GEN_CFG_RB_CHUNK_SIZE_128)); + + /* Enable the configured queue(s). */ + iwm_write_prph(sc, IWM_RFH_RXF_RXQ_ACTIVE, enabled); + + iwm_nic_unlock(sc); + + IWM_WRITE_1(sc, IWM_CSR_INT_COALESCING, IWM_HOST_INT_TIMEOUT_DEF); + + IWM_WRITE(sc, IWM_RFH_Q0_FRBDCB_WIDX_TRG, 8); + + return (0); +} + +static int +iwm_nic_rx_legacy_init(struct iwm_softc *sc) +{ + /* Stop Rx DMA */ iwm_pcie_rx_stop(sc); @@ -1398,7 +1470,8 @@ iwm_nic_rx_init(struct iwm_softc *sc) /* Set physical address of RX ring (256-byte aligned). */ IWM_WRITE(sc, - IWM_FH_RSCSR_CHNL0_RBDCB_BASE_REG, sc->rxq.desc_dma.paddr >> 8); + IWM_FH_RSCSR_CHNL0_RBDCB_BASE_REG, + sc->rxq.free_desc_dma.paddr >> 8); /* Set physical address of RX status (16-byte aligned). */ IWM_WRITE(sc, @@ -1427,20 +1500,23 @@ iwm_nic_rx_init(struct iwm_softc *sc) if (sc->cfg->host_interrupt_operation_mode) IWM_SETBITS(sc, IWM_CSR_INT_COALESCING, IWM_HOST_INT_OPER_MODE); - /* - * Thus sayeth el jefe (iwlwifi) via a comment: - * - * This value should initially be 0 (before preparing any - * RBs), should be 8 after preparing the first 8 RBs (for example) - */ - IWM_WRITE(sc, IWM_FH_RSCSR_CHNL0_WPTR, 8); - iwm_nic_unlock(sc); + IWM_WRITE(sc, IWM_FH_RSCSR_CHNL0_WPTR, 8); + return 0; } static int +iwm_nic_rx_init(struct iwm_softc *sc) +{ + if (sc->cfg->mqrx_supported) + return iwm_nic_rx_mq_init(sc); + else + return iwm_nic_rx_legacy_init(sc); +} + +static int iwm_nic_tx_init(struct iwm_softc *sc) { int qid; @@ -3030,46 +3106,16 @@ iwm_rx_addbuf(struct iwm_softc *sc, int size, int idx) /* Update RX descriptor. */ KASSERT((seg.ds_addr & 255) == 0, ("seg.ds_addr not aligned")); - ring->desc[idx] = htole32(seg.ds_addr >> 8); - bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map, + if (sc->cfg->mqrx_supported) + ((uint64_t *)ring->desc)[idx] = htole64(seg.ds_addr); + else + ((uint32_t *)ring->desc)[idx] = htole32(seg.ds_addr >> 8); + bus_dmamap_sync(ring->free_desc_dma.tag, ring->free_desc_dma.map, BUS_DMASYNC_PREWRITE); return 0; } -/* iwlwifi: mvm/rx.c */ -/* - * iwm_mvm_get_signal_strength - use new rx PHY INFO API - * values are reported by the fw as positive values - need to negate - * to obtain their dBM. Account for missing antennas by replacing 0 - * values by -256dBm: practically 0 power and a non-feasible 8 bit value. - */ -static int -iwm_mvm_get_signal_strength(struct iwm_softc *sc, struct iwm_rx_phy_info *phy_info) -{ - int energy_a, energy_b, energy_c, max_energy; - uint32_t val; - - val = le32toh(phy_info->non_cfg_phy[IWM_RX_INFO_ENERGY_ANT_ABC_IDX]); - energy_a = (val & IWM_RX_INFO_ENERGY_ANT_A_MSK) >> - IWM_RX_INFO_ENERGY_ANT_A_POS; - energy_a = energy_a ? -energy_a : -256; - energy_b = (val & IWM_RX_INFO_ENERGY_ANT_B_MSK) >> - IWM_RX_INFO_ENERGY_ANT_B_POS; - energy_b = energy_b ? -energy_b : -256; - energy_c = (val & IWM_RX_INFO_ENERGY_ANT_C_MSK) >> - IWM_RX_INFO_ENERGY_ANT_C_POS; - energy_c = energy_c ? -energy_c : -256; - max_energy = MAX(energy_a, energy_b); - max_energy = MAX(max_energy, energy_c); - - IWM_DPRINTF(sc, IWM_DEBUG_RECV, - "energy In A %d B %d C %d , and max %d\n", - energy_a, energy_b, energy_c, max_energy); - - return max_energy; -} - static void iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *sc, struct iwm_rx_packet *pkt) { @@ -3123,19 +3169,65 @@ iwm_mvm_handle_rx_statistics(struct iwm_softc *sc, str sc->sc_noise = iwm_get_noise(sc, &stats->rx.general); } +/* iwlwifi: mvm/rx.c */ /* + * iwm_mvm_get_signal_strength - use new rx PHY INFO API + * values are reported by the fw as positive values - need to negate + * to obtain their dBM. Account for missing antennas by replacing 0 + * values by -256dBm: practically 0 power and a non-feasible 8 bit value. + */ +static int +iwm_mvm_rx_get_signal_strength(struct iwm_softc *sc, + struct iwm_rx_phy_info *phy_info) +{ + int energy_a, energy_b, energy_c, max_energy; + uint32_t val; + + val = le32toh(phy_info->non_cfg_phy[IWM_RX_INFO_ENERGY_ANT_ABC_IDX]); + energy_a = (val & IWM_RX_INFO_ENERGY_ANT_A_MSK) >> + IWM_RX_INFO_ENERGY_ANT_A_POS; + energy_a = energy_a ? -energy_a : -256; + energy_b = (val & IWM_RX_INFO_ENERGY_ANT_B_MSK) >> + IWM_RX_INFO_ENERGY_ANT_B_POS; + energy_b = energy_b ? -energy_b : -256; + energy_c = (val & IWM_RX_INFO_ENERGY_ANT_C_MSK) >> + IWM_RX_INFO_ENERGY_ANT_C_POS; + energy_c = energy_c ? -energy_c : -256; + max_energy = MAX(energy_a, energy_b); + max_energy = MAX(max_energy, energy_c); + + IWM_DPRINTF(sc, IWM_DEBUG_RECV, + "energy In A %d B %d C %d , and max %d\n", + energy_a, energy_b, energy_c, max_energy); + + return max_energy; +} + +static int +iwm_mvm_rxmq_get_signal_strength(struct iwm_softc *sc, + struct iwm_rx_mpdu_desc *desc) +{ + int energy_a, energy_b; + + energy_a = desc->v1.energy_a; + energy_b = desc->v1.energy_b; + energy_a = energy_a ? -energy_a : -256; + energy_b = energy_b ? -energy_b : -256; + return MAX(energy_a, energy_b); +} + +/* * iwm_mvm_rx_rx_mpdu - IWM_REPLY_RX_MPDU_CMD handler * * Handles the actual data of the Rx packet from the fw */ -static boolean_t +static bool iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, - boolean_t stolen) + bool stolen) { struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); struct ieee80211_frame *wh; - struct ieee80211_node *ni; struct ieee80211_rx_stats rxs; struct iwm_rx_phy_info *phy_info; struct iwm_rx_mpdu_res_start *rx_res; @@ -3154,17 +3246,17 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf * device_printf(sc->sc_dev, "dsp size out of range [0,20]: %d\n", phy_info->cfg_phy_cnt); - goto fail; + return false; } if (!(rx_pkt_status & IWM_RX_MPDU_RES_STATUS_CRC_OK) || !(rx_pkt_status & IWM_RX_MPDU_RES_STATUS_OVERRUN_OK)) { IWM_DPRINTF(sc, IWM_DEBUG_RECV, "Bad CRC or FIFO: 0x%08X.\n", rx_pkt_status); - goto fail; + return false; } - rssi = iwm_mvm_get_signal_strength(sc, phy_info); + rssi = iwm_mvm_rx_get_signal_strength(sc, phy_info); /* Map it to relative value */ rssi = rssi - sc->sc_noise; @@ -3173,7 +3265,7 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf * if (!stolen && iwm_rx_addbuf(sc, IWM_RBUF_SIZE, sc->rxq.cur) != 0) { device_printf(sc->sc_dev, "%s: unable to add more buffers\n", __func__); - goto fail; + return false; } m->m_data = pkt->data + sizeof(*rx_res); @@ -3182,8 +3274,6 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf * IWM_DPRINTF(sc, IWM_DEBUG_RECV, "%s: rssi=%d, noise=%d\n", __func__, rssi, sc->sc_noise); - ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); - IWM_DPRINTF(sc, IWM_DEBUG_RECV, "%s: phy_info: channel=%d, flags=0x%08x\n", __func__, @@ -3206,11 +3296,8 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf * /* rssi is in 1/2db units */ rxs.c_rssi = rssi * 2; rxs.c_nf = sc->sc_noise; - if (ieee80211_add_rx_params(m, &rxs) == 0) { - if (ni) - ieee80211_free_node(ni); - goto fail; - } + if (ieee80211_add_rx_params(m, &rxs) == 0) + return false; if (ieee80211_radiotap_active_vap(vap)) { struct iwm_rx_radiotap_header *tap = &sc->sc_rxtap; @@ -3244,6 +3331,139 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf * } } + return true; +} + +static bool +iwm_mvm_rx_mpdu_mq(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, + bool stolen) +{ + struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + struct ieee80211_frame *wh; + struct ieee80211_rx_stats rxs; + struct iwm_rx_mpdu_desc *desc; + struct iwm_rx_packet *pkt; + int rssi; + uint32_t hdrlen, len, rate_n_flags; + uint16_t phy_info; + uint8_t channel; + + pkt = mtodo(m, offset); + desc = (void *)pkt->data; + + if (!(desc->status & htole16(IWM_RX_MPDU_RES_STATUS_CRC_OK)) || + !(desc->status & htole16(IWM_RX_MPDU_RES_STATUS_OVERRUN_OK))) { + IWM_DPRINTF(sc, IWM_DEBUG_RECV, + "Bad CRC or FIFO: 0x%08X.\n", desc->status); + return false; + } + + channel = desc->v1.channel; + len = le16toh(desc->mpdu_len); + phy_info = le16toh(desc->phy_info); + rate_n_flags = desc->v1.rate_n_flags; + + wh = mtodo(m, sizeof(*desc)); + m->m_data = pkt->data + sizeof(*desc); + m->m_pkthdr.len = m->m_len = len; + m->m_len = len; + + /* Account for padding following the frame header. */ + if ((desc->mac_flags2 & IWM_RX_MPDU_MFLG2_PAD)) { + hdrlen = ieee80211_anyhdrsize(wh); + memmove(mtodo(m, 2), mtodo(m, 0), hdrlen); + m->m_data = mtodo(m, 2); + wh = mtod(m, struct ieee80211_frame *); + } + + /* Map it to relative value */ + rssi = iwm_mvm_rxmq_get_signal_strength(sc, desc); + rssi = rssi - sc->sc_noise; + + /* replenish ring for the buffer we're going to feed to the sharks */ + if (!stolen && iwm_rx_addbuf(sc, IWM_RBUF_SIZE, sc->rxq.cur) != 0) { + device_printf(sc->sc_dev, "%s: unable to add more buffers\n", + __func__); + return false; + } + + IWM_DPRINTF(sc, IWM_DEBUG_RECV, + "%s: rssi=%d, noise=%d\n", __func__, rssi, sc->sc_noise); + + /* + * Populate an RX state struct with the provided information. + */ + bzero(&rxs, sizeof(rxs)); + rxs.r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ; + rxs.r_flags |= IEEE80211_R_NF | IEEE80211_R_RSSI; + rxs.c_ieee = channel; + rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, + channel <= 14 ? IEEE80211_CHAN_2GHZ : IEEE80211_CHAN_5GHZ); + + /* rssi is in 1/2db units */ + rxs.c_rssi = rssi * 2; + rxs.c_nf = sc->sc_noise; + if (ieee80211_add_rx_params(m, &rxs) == 0) + return false; + + if (ieee80211_radiotap_active_vap(vap)) { + struct iwm_rx_radiotap_header *tap = &sc->sc_rxtap; + + tap->wr_flags = 0; + if ((phy_info & IWM_RX_MPDU_PHY_SHORT_PREAMBLE) != 0) + tap->wr_flags |= IEEE80211_RADIOTAP_F_SHORTPRE; + tap->wr_chan_freq = htole16(rxs.c_freq); + /* XXX only if ic->ic_curchan->ic_ieee == rxs.c_ieee */ + tap->wr_chan_flags = htole16(ic->ic_curchan->ic_flags); + tap->wr_dbm_antsignal = (int8_t)rssi; + tap->wr_dbm_antnoise = (int8_t)sc->sc_noise; + tap->wr_tsft = desc->v1.gp2_on_air_rise; + switch ((rate_n_flags & 0xff)) { + /* CCK rates. */ + case 10: tap->wr_rate = 2; break; + case 20: tap->wr_rate = 4; break; + case 55: tap->wr_rate = 11; break; + case 110: tap->wr_rate = 22; break; + /* OFDM rates. */ + case 0xd: tap->wr_rate = 12; break; + case 0xf: tap->wr_rate = 18; break; + case 0x5: tap->wr_rate = 24; break; + case 0x7: tap->wr_rate = 36; break; + case 0x9: tap->wr_rate = 48; break; + case 0xb: tap->wr_rate = 72; break; + case 0x1: tap->wr_rate = 96; break; + case 0x3: tap->wr_rate = 108; break; + /* Unknown rate: should not happen. */ + default: tap->wr_rate = 0; + } + } + + return true; +} + +static bool +iwm_mvm_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, + bool stolen) +{ + struct ieee80211com *ic; + struct ieee80211_frame *wh; + struct ieee80211_node *ni; + bool ret; + + ic = &sc->sc_ic; + + ret = sc->cfg->mqrx_supported ? + iwm_mvm_rx_mpdu_mq(sc, m, offset, stolen) : + iwm_mvm_rx_rx_mpdu(sc, m, offset, stolen); + if (!ret) { + counter_u64_add(ic->ic_ierrors, 1); + return (ret); + } + + wh = mtod(m, struct ieee80211_frame *); + ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); + IWM_UNLOCK(sc); if (ni != NULL) { IWM_DPRINTF(sc, IWM_DEBUG_RECV, "input m %p\n", m); @@ -3255,11 +3475,7 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf * } IWM_LOCK(sc); - return TRUE; - -fail: - counter_u64_add(ic->ic_ierrors, 1); - return FALSE; + return true; } static int @@ -5153,7 +5369,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) nextpkt->hdr.idx == 0) || (nextpkt->len_n_flags == htole32(IWM_FH_RSCSR_FRAME_INVALID))) { - if (iwm_mvm_rx_rx_mpdu(sc, m, offset, stolen)) { + if (iwm_mvm_rx_mpdu(sc, m, offset, stolen)) { stolen = FALSE; /* Make sure we abort the loop */ nextoff = maxoff; @@ -5164,14 +5380,14 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) /* * Use m_copym instead of m_split, because that * makes it easier to keep a valid rx buffer in - * the ring, when iwm_mvm_rx_rx_mpdu() fails. + * the ring, when iwm_mvm_rx_mpdu() fails. * * We need to start m_copym() at offset 0, to get the * M_PKTHDR flag preserved. */ m1 = m_copym(m, 0, M_COPYALL, M_NOWAIT); if (m1) { - if (iwm_mvm_rx_rx_mpdu(sc, m1, offset, stolen)) + if (iwm_mvm_rx_mpdu(sc, m1, offset, stolen)) stolen = TRUE; else m_freem(m1); @@ -5420,11 +5636,21 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) static void iwm_notif_intr(struct iwm_softc *sc) { + int count; + uint32_t wreg; uint16_t hw; bus_dmamap_sync(sc->rxq.stat_dma.tag, sc->rxq.stat_dma.map, BUS_DMASYNC_POSTREAD); + if (sc->cfg->mqrx_supported) { + count = IWM_RX_MQ_RING_COUNT; + wreg = IWM_RFH_Q0_FRBDCB_WIDX_TRG; + } else { + count = IWM_RX_LEGACY_RING_COUNT; + wreg = IWM_FH_RSCSR_CHNL0_WPTR; + } + hw = le16toh(sc->rxq.stat->closed_rb_num) & 0xfff; /* @@ -5441,7 +5667,7 @@ iwm_notif_intr(struct iwm_softc *sc) "%s: hw = %d cur = %d\n", __func__, hw, ring->cur); iwm_handle_rxb(sc, data->m); - ring->cur = (ring->cur + 1) % IWM_RX_RING_COUNT; + ring->cur = (ring->cur + 1) % count; } /* @@ -5450,8 +5676,8 @@ iwm_notif_intr(struct iwm_softc *sc) * Seems like the hardware gets upset unless we align * the write by 8?? */ - hw = (hw == 0) ? IWM_RX_RING_COUNT - 1 : hw - 1; - IWM_WRITE(sc, IWM_FH_RSCSR_CHNL0_WPTR, rounddown2(hw, 8)); + hw = (hw == 0) ? count - 1 : hw - 1; + IWM_WRITE(sc, wreg, rounddown2(hw, 8)); } static void Modified: head/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- head/sys/dev/iwm/if_iwm_pcie_trans.c Thu Nov 7 23:36:46 2019 (r354507) +++ head/sys/dev/iwm/if_iwm_pcie_trans.c Thu Nov 7 23:37:02 2019 (r354508) @@ -638,13 +638,21 @@ iwm_set_pwr(struct iwm_softc *sc) int iwm_pcie_rx_stop(struct iwm_softc *sc) { - int ret = 0; + int ret; + + ret = 0; if (iwm_nic_lock(sc)) { - IWM_WRITE(sc, IWM_FH_MEM_RCSR_CHNL0_CONFIG_REG, 0); - ret = iwm_poll_bit(sc, IWM_FH_MEM_RSSR_RX_STATUS_REG, - IWM_FH_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, - IWM_FH_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, - 1000); + if (sc->cfg->mqrx_supported) { + iwm_write_prph(sc, IWM_RFH_RXF_DMA_CFG, 0); + ret = iwm_poll_prph(sc, IWM_RFH_GEN_STATUS, + IWM_RXF_DMA_IDLE, IWM_RXF_DMA_IDLE, 1000); + } else { + IWM_WRITE(sc, IWM_FH_MEM_RCSR_CHNL0_CONFIG_REG, 0); + ret = iwm_poll_bit(sc, IWM_FH_MEM_RSSR_RX_STATUS_REG, + IWM_FH_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, + IWM_FH_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, + 1000); + } iwm_nic_unlock(sc); } return ret; Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Nov 7 23:36:46 2019 (r354507) +++ head/sys/dev/iwm/if_iwmreg.h Thu Nov 7 23:37:02 2019 (r354508) @@ -2907,6 +2907,69 @@ enum iwm_mvm_rx_status { IWM_RX_MPDU_RES_STATUS2_FILTERING_MSK = (0xc0000000), }; +enum iwm_rx_mpdu_mac_flags1 { + IWM_RX_MPDU_MFLG1_ADDRTYPE_MASK = 0x03, + IWM_RX_MPDU_MFLG1_MIC_CRC_LEN_MASK = 0xf0, + IWM_RX_MPDU_MFLG1_MIC_CRC_LEN_SHIFT = 3, +}; + +enum iwm_rx_mpdu_mac_flags2 { + IWM_RX_MPDU_MFLG2_HDR_LEN_MASK = 0x1f, + IWM_RX_MPDU_MFLG2_PAD = 0x20, + IWM_RX_MPDU_MFLG2_AMSDU = 0x40, +}; + +enum iwm_rx_mpdu_phy_info { + IWM_RX_MPDU_PHY_AMPDU = (1 << 5), + IWM_RX_MPDU_PHY_AMPDU_TOGGLE = (1 << 6), + IWM_RX_MPDU_PHY_SHORT_PREAMBLE = (1 << 7), + IWM_RX_MPDU_PHY_NCCK_ADDTL_NTFY = (1 << 7), + IWM_RX_MPDU_PHY_TSF_OVERLOAD = (1 << 8), +}; + +struct iwm_rx_mpdu_desc_v1 { + union { + uint32_t rss_hash; + uint32_t phy_data2; + }; + union { + uint32_t filter_match; + uint32_t phy_data3; + }; + uint32_t rate_n_flags; + uint8_t energy_a; + uint8_t energy_b; + uint8_t channel; + uint8_t mac_context; + uint32_t gp2_on_air_rise; + union { + uint64_t tsf_on_air_rise; + struct { + uint32_t phy_data0; + uint32_t phy_data1; + }; + }; +} __packed; + +struct iwm_rx_mpdu_desc { + uint16_t mpdu_len; + uint8_t mac_flags1; + uint8_t mac_flags2; + uint8_t amsdu_info; + uint16_t phy_info; + uint8_t mac_phy_idx; + uint16_t raw_csum; + union { + uint16_t l3l4_flags; + uint16_t phy_data4; + }; + uint16_t status; + uint8_t hash_filter; + uint8_t sta_id_flags; + uint32_t reorder_data; + struct iwm_rx_mpdu_desc_v1 v1; +} __packed; + /** * struct iwm_radio_version_notif - information on the radio version * ( IWM_RADIO_VERSION_NOTIFICATION = 0x68 ) Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Thu Nov 7 23:36:46 2019 (r354507) +++ head/sys/dev/iwm/if_iwmvar.h Thu Nov 7 23:37:02 2019 (r354508) @@ -285,11 +285,12 @@ struct iwm_tx_ring { int cur; }; -#define IWM_RX_RING_COUNT 256 -/* Linux driver optionally uses 8k buffer */ +#define IWM_RX_LEGACY_RING_COUNT 256 +#define IWM_RX_MQ_RING_COUNT 512 + #define IWM_RBUF_SIZE 4096 -#define IWM_MAX_SCATTER 20 +#define IWM_MAX_SCATTER 20 struct iwm_rx_data { struct mbuf *m; @@ -297,12 +298,13 @@ struct iwm_rx_data { }; struct iwm_rx_ring { - struct iwm_dma_info desc_dma; + struct iwm_dma_info free_desc_dma; + struct iwm_dma_info used_desc_dma; struct iwm_dma_info stat_dma; struct iwm_dma_info buf_dma; - uint32_t *desc; + void *desc; struct iwm_rb_status *stat; - struct iwm_rx_data data[IWM_RX_RING_COUNT]; + struct iwm_rx_data data[512]; bus_dmamap_t spare_map; /* for iwm_rx_addbuf() */ bus_dma_tag_t data_dmat; int cur; From owner-svn-src-head@freebsd.org Thu Nov 7 23:37:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC69A17E724; Thu, 7 Nov 2019 23:37:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KZ54Bw9z4YFN; Thu, 7 Nov 2019 23:37:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 725771D739; Thu, 7 Nov 2019 23:37:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NbHF9074188; Thu, 7 Nov 2019 23:37:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NbHvn074187; Thu, 7 Nov 2019 23:37:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072337.xA7NbHvn074187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:37:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354509 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354509 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:37:17 -0000 Author: markj Date: Thu Nov 7 23:37:17 2019 New Revision: 354509 URL: https://svnweb.freebsd.org/changeset/base/354509 Log: iwm: Fix scheduler configuration for aux and cmd queue configuration. - Configure the scheduler only for the management queue. - Fix a bug when enabling the schduler: the queues are specified using a bitmask. - Fix style in the area. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:37:02 2019 (r354508) +++ head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:37:17 2019 (r354509) @@ -1583,25 +1583,31 @@ iwm_nic_init(struct iwm_softc *sc) int iwm_enable_txq(struct iwm_softc *sc, int sta_id, int qid, int fifo) { + int qmsk; + + qmsk = 1 << qid; + if (!iwm_nic_lock(sc)) { - device_printf(sc->sc_dev, - "%s: cannot enable txq %d\n", - __func__, - qid); + device_printf(sc->sc_dev, "%s: cannot enable txq %d\n", + __func__, qid); return EBUSY; } IWM_WRITE(sc, IWM_HBUS_TARG_WRPTR, qid << 8 | 0); if (qid == IWM_MVM_CMD_QUEUE) { - /* unactivate before configuration */ + /* Disable the scheduler. */ + iwm_write_prph(sc, IWM_SCD_EN_CTRL, 0); + + /* Stop the TX queue prior to configuration. */ iwm_write_prph(sc, IWM_SCD_QUEUE_STATUS_BITS(qid), - (0 << IWM_SCD_QUEUE_STTS_REG_POS_ACTIVE) - | (1 << IWM_SCD_QUEUE_STTS_REG_POS_SCD_ACT_EN)); + (0 << IWM_SCD_QUEUE_STTS_REG_POS_ACTIVE) | + (1 << IWM_SCD_QUEUE_STTS_REG_POS_SCD_ACT_EN)); iwm_nic_unlock(sc); - iwm_clear_bits_prph(sc, IWM_SCD_AGGR_SEL, (1 << qid)); + /* Disable aggregations for this queue. */ + iwm_clear_bits_prph(sc, IWM_SCD_AGGR_SEL, qmsk); if (!iwm_nic_lock(sc)) { device_printf(sc->sc_dev, @@ -1611,7 +1617,8 @@ iwm_enable_txq(struct iwm_softc *sc, int sta_id, int q iwm_write_prph(sc, IWM_SCD_QUEUE_RDPTR(qid), 0); iwm_nic_unlock(sc); - iwm_write_mem32(sc, sc->scd_base_addr + IWM_SCD_CONTEXT_QUEUE_OFFSET(qid), 0); + iwm_write_mem32(sc, + sc->scd_base_addr + IWM_SCD_CONTEXT_QUEUE_OFFSET(qid), 0); /* Set scheduler window size and frame limit. */ iwm_write_mem32(sc, sc->scd_base_addr + IWM_SCD_CONTEXT_QUEUE_OFFSET(qid) + @@ -1631,6 +1638,9 @@ iwm_enable_txq(struct iwm_softc *sc, int sta_id, int q (fifo << IWM_SCD_QUEUE_STTS_REG_POS_TXF) | (1 << IWM_SCD_QUEUE_STTS_REG_POS_WSL) | IWM_SCD_QUEUE_STTS_REG_MSK); + + /* Enable the scheduler for this queue. */ + iwm_write_prph(sc, IWM_SCD_EN_CTRL, qmsk); } else { struct iwm_scd_txq_cfg_cmd cmd; int error; @@ -1656,9 +1666,6 @@ iwm_enable_txq(struct iwm_softc *sc, int sta_id, int q if (!iwm_nic_lock(sc)) return EBUSY; } - - iwm_write_prph(sc, IWM_SCD_EN_CTRL, - iwm_read_prph(sc, IWM_SCD_EN_CTRL) | qid); iwm_nic_unlock(sc); From owner-svn-src-head@freebsd.org Thu Nov 7 23:37:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8681617E7B7; Thu, 7 Nov 2019 23:37:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KZM2yQ2z4YNR; Thu, 7 Nov 2019 23:37:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48CDE1D73B; Thu, 7 Nov 2019 23:37:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NbVo3074240; Thu, 7 Nov 2019 23:37:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NbVTn074239; Thu, 7 Nov 2019 23:37:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072337.xA7NbVTn074239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:37:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354510 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354510 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:37:31 -0000 Author: markj Date: Thu Nov 7 23:37:30 2019 New Revision: 354510 URL: https://svnweb.freebsd.org/changeset/base/354510 Log: iwm: Sync with iwm_run_init_mvm_ucode() with iwlwifi. Do not configure bluetooth on newer chips, it causes firmware panics. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:37:17 2019 (r354509) +++ head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:37:30 2019 (r354510) @@ -3002,6 +3002,15 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justn goto error; } + if (sc->cfg->device_family < IWM_DEVICE_FAMILY_8000) { + ret = iwm_send_bt_init_conf(sc); + if (ret) { + device_printf(sc->sc_dev, + "failed to send bt coex configuration: %d\n", ret); + goto error; + } + } + if (justnvm) { /* Read nvm */ ret = iwm_nvm_init(sc); @@ -3010,13 +3019,6 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justn goto error; } IEEE80211_ADDR_COPY(sc->sc_ic.ic_macaddr, sc->nvm_data->hw_addr); - goto error; - } - - ret = iwm_send_bt_init_conf(sc); - if (ret) { - device_printf(sc->sc_dev, - "failed to send bt coex configuration: %d\n", ret); goto error; } From owner-svn-src-head@freebsd.org Thu Nov 7 23:37:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6861E17E855; Thu, 7 Nov 2019 23:37:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KZr26Dhz4YWR; Thu, 7 Nov 2019 23:37:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BC391D73C; Thu, 7 Nov 2019 23:37:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7Nbuqc074300; Thu, 7 Nov 2019 23:37:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NbtDe074298; Thu, 7 Nov 2019 23:37:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072337.xA7NbtDe074298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:37:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354511 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354511 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:37:56 -0000 Author: markj Date: Thu Nov 7 23:37:55 2019 New Revision: 354511 URL: https://svnweb.freebsd.org/changeset/base/354511 Log: iwm: Update the station add command for the new RX API. The firmware expects a new version of the add-station command in 9000-series chips. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwm_sta.c head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwm_sta.c ============================================================================== --- head/sys/dev/iwm/if_iwm_sta.c Thu Nov 7 23:37:30 2019 (r354510) +++ head/sys/dev/iwm/if_iwm_sta.c Thu Nov 7 23:37:55 2019 (r354511) @@ -138,13 +138,8 @@ __FBSDID("$FreeBSD$"); static inline int iwm_mvm_add_sta_cmd_size(struct iwm_softc *sc) { -#ifdef notyet - return iwm_mvm_has_new_rx_api(mvm) ? - sizeof(struct iwm_mvm_add_sta_cmd) : - sizeof(struct iwm_mvm_add_sta_cmd_v7); -#else - return sizeof(struct iwm_mvm_add_sta_cmd); -#endif + return sc->cfg->mqrx_supported ? sizeof(struct iwm_mvm_add_sta_cmd) : + sizeof(struct iwm_mvm_add_sta_cmd_v7); } /* send station add/update command to firmware */ @@ -318,7 +313,7 @@ iwm_mvm_rm_sta_id(struct iwm_softc *sc, struct ieee802 static int iwm_mvm_add_int_sta_common(struct iwm_softc *sc, struct iwm_int_sta *sta, - const uint8_t *addr, uint16_t mac_id, uint16_t color) + const uint8_t *addr, uint16_t mac_id, uint16_t color) { struct iwm_mvm_add_sta_cmd cmd; int ret; @@ -327,6 +322,8 @@ iwm_mvm_add_int_sta_common(struct iwm_softc *sc, struc memset(&cmd, 0, sizeof(cmd)); cmd.sta_id = sta->sta_id; cmd.mac_id_n_color = htole32(IWM_FW_CMD_ID_AND_COLOR(mac_id, color)); + if (sta->sta_id == IWM_AUX_STA_ID && sc->cfg->mqrx_supported) + cmd.station_type = IWM_STA_AUX_ACTIVITY; cmd.tfd_queue_msk = htole32(sta->tfd_queue_msk); cmd.tid_disable_tx = htole16(0xffff); @@ -362,7 +359,8 @@ iwm_mvm_add_aux_sta(struct iwm_softc *sc) sc->sc_aux_sta.tfd_queue_msk = (1 << IWM_MVM_AUX_QUEUE); /* Map Aux queue to fifo - needs to happen before adding Aux station */ - ret = iwm_enable_txq(sc, 0, IWM_MVM_AUX_QUEUE, IWM_MVM_TX_FIFO_MCAST); + ret = iwm_enable_txq(sc, IWM_AUX_STA_ID, IWM_MVM_AUX_QUEUE, + IWM_MVM_TX_FIFO_MCAST); if (ret) return ret; Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Nov 7 23:37:30 2019 (r354510) +++ head/sys/dev/iwm/if_iwmreg.h Thu Nov 7 23:37:55 2019 (r354511) @@ -5806,30 +5806,34 @@ struct iwm_mvm_keyinfo { #define IWM_ADD_STA_BAID_SHIFT 8 /** - * struct iwm_mvm_add_sta_cmd - Add/modify a station in the fw's sta table. + * struct iwl_mvm_add_sta_cmd_v7 - Add/modify a station in the fw's sta table. * ( REPLY_ADD_STA = 0x18 ) - * @add_modify: 1: modify existing, 0: add new station - * @awake_acs: + * @add_modify: see &enum iwl_sta_mode + * @awake_acs: ACs to transmit data on while station is sleeping (for U-APSD) * @tid_disable_tx: is tid BIT(tid) enabled for Tx. Clear BIT(x) to enable - * AMPDU for tid x. Set %IWM_STA_MODIFY_TID_DISABLE_TX to change this field. - * @mac_id_n_color: the Mac context this station belongs to - * @addr[IEEE80211_ADDR_LEN]: station's MAC address + * AMPDU for tid x. Set %STA_MODIFY_TID_DISABLE_TX to change this field. + * @mac_id_n_color: the Mac context this station belongs to, + * see &enum iwl_ctxt_id_and_color + * @addr: station's MAC address + * @reserved2: reserved * @sta_id: index of station in uCode's station table - * @modify_mask: IWM_STA_MODIFY_*, selects which parameters to modify vs. leave + * @modify_mask: STA_MODIFY_*, selects which parameters to modify vs. leave * alone. 1 - modify, 0 - don't change. - * @station_flags: look at %iwm_sta_flags - * @station_flags_msk: what of %station_flags have changed + * @reserved3: reserved + * @station_flags: look at &enum iwl_sta_flags + * @station_flags_msk: what of %station_flags have changed, + * also &enum iwl_sta_flags * @add_immediate_ba_tid: tid for which to add block-ack support (Rx) - * Set %IWM_STA_MODIFY_ADD_BA_TID to use this field, and also set + * Set %STA_MODIFY_ADD_BA_TID to use this field, and also set * add_immediate_ba_ssn. * @remove_immediate_ba_tid: tid for which to remove block-ack support (Rx) - * Set %IWM_STA_MODIFY_REMOVE_BA_TID to use this field + * Set %STA_MODIFY_REMOVE_BA_TID to use this field * @add_immediate_ba_ssn: ssn for the Rx block-ack session. Used together with * add_immediate_ba_tid. * @sleep_tx_count: number of packets to transmit to station even though it is * asleep. Used to synchronise PS-poll and u-APSD responses while ucode * keeps track of STA sleep state. - * @sleep_state_flags: Look at %iwm_sta_sleep_flag. + * @sleep_state_flags: Look at &enum iwl_sta_sleep_flag. * @assoc_id: assoc_id to be sent in VHT PLCP (9-bit), for grp use 0, for AP * mac-addr. * @beamform_flags: beam forming controls @@ -5837,12 +5841,12 @@ struct iwm_mvm_keyinfo { * * The device contains an internal table of per-station information, with info * on security keys, aggregation parameters, and Tx rates for initial Tx - * attempt and any retries (set by IWM_REPLY_TX_LINK_QUALITY_CMD). + * attempt and any retries (set by REPLY_TX_LINK_QUALITY_CMD). * * ADD_STA sets up the table entry for one station, either creating a new * entry, or modifying a pre-existing one. */ -struct iwm_mvm_add_sta_cmd { +struct iwm_mvm_add_sta_cmd_v7 { uint8_t add_modify; uint8_t awake_acs; uint16_t tid_disable_tx; @@ -5863,6 +5867,97 @@ struct iwm_mvm_add_sta_cmd { uint16_t beamform_flags; uint32_t tfd_queue_msk; } __packed; /* ADD_STA_CMD_API_S_VER_7 */ + +/** + * enum iwm_sta_type - FW station types + * ( REPLY_ADD_STA = 0x18 ) + * @IWM_STA_LINK: Link station - normal RX and TX traffic. + * @IWM_STA_GENERAL_PURPOSE: General purpose. In AP mode used for beacons + * and probe responses. + * @IWM_STA_MULTICAST: multicast traffic, + * @IWM_STA_TDLS_LINK: TDLS link station + * @IWM_STA_AUX_ACTIVITY: auxilary station (scan, ROC and so on). + */ +enum iwm_sta_type { + IWM_STA_LINK, + IWM_STA_GENERAL_PURPOSE, + IWM_STA_MULTICAST, + IWM_STA_TDLS_LINK, + IWM_STA_AUX_ACTIVITY, +}; + +/** + * struct iwm_mvm_add_sta_cmd - Add/modify a station in the fw's sta table. + * ( REPLY_ADD_STA = 0x18 ) + * @add_modify: see &enum iwm_sta_mode + * @awake_acs: ACs to transmit data on while station is sleeping (for U-APSD) + * @tid_disable_tx: is tid BIT(tid) enabled for Tx. Clear BIT(x) to enable + * AMPDU for tid x. Set %STA_MODIFY_TID_DISABLE_TX to change this field. + * @mac_id_n_color: the Mac context this station belongs to, + * see &enum iwl_ctxt_id_and_color + * @addr: station's MAC address + * @reserved2: reserved + * @sta_id: index of station in uCode's station table + * @modify_mask: STA_MODIFY_*, selects which parameters to modify vs. leave + * alone. 1 - modify, 0 - don't change. + * @reserved3: reserved + * @station_flags: look at &enum iwm_sta_flags + * @station_flags_msk: what of %station_flags have changed, + * also &enum iwm_sta_flags + * @add_immediate_ba_tid: tid for which to add block-ack support (Rx) + * Set %STA_MODIFY_ADD_BA_TID to use this field, and also set + * add_immediate_ba_ssn. + * @remove_immediate_ba_tid: tid for which to remove block-ack support (Rx) + * Set %STA_MODIFY_REMOVE_BA_TID to use this field + * @add_immediate_ba_ssn: ssn for the Rx block-ack session. Used together with + * add_immediate_ba_tid. + * @sleep_tx_count: number of packets to transmit to station even though it is + * asleep. Used to synchronise PS-poll and u-APSD responses while ucode + * keeps track of STA sleep state. + * @station_type: type of this station. See &enum iwl_sta_type. + * @sleep_state_flags: Look at &enum iwl_sta_sleep_flag. + * @assoc_id: assoc_id to be sent in VHT PLCP (9-bit), for grp use 0, for AP + * mac-addr. + * @beamform_flags: beam forming controls + * @tfd_queue_msk: tfd queues used by this station. + * Obselete for new TX API (9 and above). + * @rx_ba_window: aggregation window size + * @sp_length: the size of the SP in actual number of frames + * @uapsd_acs: 4 LS bits are trigger enabled ACs, 4 MS bits are the deliver + * enabled ACs. + * + * The device contains an internal table of per-station information, with info + * on security keys, aggregation parameters, and Tx rates for initial Tx + * attempt and any retries (set by REPLY_TX_LINK_QUALITY_CMD). + * + * ADD_STA sets up the table entry for one station, either creating a new + * entry, or modifying a pre-existing one. + */ +struct iwm_mvm_add_sta_cmd { + uint8_t add_modify; + uint8_t awake_acs; + uint16_t tid_disable_tx; + uint32_t mac_id_n_color; + uint8_t addr[IEEE80211_ADDR_LEN]; /* _STA_ID_MODIFY_INFO_API_S_VER_1 */ + uint16_t reserved2; + uint8_t sta_id; + uint8_t modify_mask; + uint16_t reserved3; + uint32_t station_flags; + uint32_t station_flags_msk; + uint8_t add_immediate_ba_tid; + uint8_t remove_immediate_ba_tid; + uint16_t add_immediate_ba_ssn; + uint16_t sleep_tx_count; + uint8_t sleep_state_flags; + uint8_t station_type; + uint16_t assoc_id; + uint16_t beamform_flags; + uint32_t tfd_queue_msk; + uint16_t rx_ba_window; + uint8_t sp_length; + uint8_t uapsd_acs; +} __packed; /* ADD_STA_CMD_API_S_VER_10 */ /** * struct iwm_mvm_add_sta_key_cmd - add/modify sta key From owner-svn-src-head@freebsd.org Thu Nov 7 23:38:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F14BA17E8F3; Thu, 7 Nov 2019 23:38:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KbF5z5sz4YfC; Thu, 7 Nov 2019 23:38:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE3941D73D; Thu, 7 Nov 2019 23:38:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NcH3C074359; Thu, 7 Nov 2019 23:38:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NcHG4074358; Thu, 7 Nov 2019 23:38:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072338.xA7NcHG4074358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354512 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354512 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:38:18 -0000 Author: markj Date: Thu Nov 7 23:38:17 2019 New Revision: 354512 URL: https://svnweb.freebsd.org/changeset/base/354512 Log: iwm: Use antenna B for TX on 9000-series chips. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:37:55 2019 (r354511) +++ head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:38:17 2019 (r354512) @@ -3768,7 +3768,10 @@ iwm_tx_fill_cmd(struct iwm_softc *sc, struct iwm_node ); /* XXX TODO: hard-coded TX antenna? */ - rate_flags = 1 << IWM_RATE_MCS_ANT_POS; + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_9000) + rate_flags = IWM_RATE_MCS_ANT_B_MSK; + else + rate_flags = IWM_RATE_MCS_ANT_A_MSK; if (IWM_RIDX_IS_CCK(ridx)) rate_flags |= IWM_RATE_MCS_CCK_MSK; tx->rate_n_flags = htole32(rate_flags | rinfo->plcp); From owner-svn-src-head@freebsd.org Thu Nov 7 23:38:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 87E9717E975; Thu, 7 Nov 2019 23:38:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478Kbd31MBz4Yn1; Thu, 7 Nov 2019 23:38:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AB421D73F; Thu, 7 Nov 2019 23:38:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NcbWj074416; Thu, 7 Nov 2019 23:38:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NcaTS074414; Thu, 7 Nov 2019 23:38:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072338.xA7NcaTS074414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:38:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354513 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354513 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:38:37 -0000 Author: markj Date: Thu Nov 7 23:38:36 2019 New Revision: 354513 URL: https://svnweb.freebsd.org/changeset/base/354513 Log: iwm: Set flag for pad bytes in offload_assist. Though we don't otherwise use firmware's offload capabilities, we need to set this flag when the MAC header's size isn't a multiple of four. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:38:17 2019 (r354512) +++ head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:38:36 2019 (r354513) @@ -3882,11 +3882,12 @@ iwm_tx(struct iwm_softc *sc, struct mbuf *m, struct ie if (hdrlen & 3) { /* First segment length must be a multiple of 4. */ flags |= IWM_TX_CMD_FLG_MH_PAD; + tx->offload_assist |= htole16(1 << IWM_TX_CMD_OFFLD_PAD); pad = 4 - (hdrlen & 3); - } else + } else { + tx->offload_assist = 0; pad = 0; - - tx->next_frame_len = 0; + } tx->len = htole16(totlen); tx->tid_tspec = tid; Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Nov 7 23:38:17 2019 (r354512) +++ head/sys/dev/iwm/if_iwmreg.h Thu Nov 7 23:38:36 2019 (r354513) @@ -4477,13 +4477,41 @@ enum iwm_tx_pm_timeouts { #define IWM_BAR_DFAULT_RETRY_LIMIT 60 #define IWM_LOW_RETRY_LIMIT 7 +/** + * enum iwm_tx_offload_assist_flags_pos - set %iwm_tx_cmd offload_assist values + * @IWM_TX_CMD_OFFLD_IP_HDR: offset to start of IP header (in words) + * from mac header end. For normal case it is 4 words for SNAP. + * note: tx_cmd, mac header and pad are not counted in the offset. + * This is used to help the offload in case there is tunneling such as + * IPv6 in IPv4, in such case the ip header offset should point to the + * inner ip header and IPv4 checksum of the external header should be + * calculated by driver. + * @IWM_TX_CMD_OFFLD_L4_EN: enable TCP/UDP checksum + * @IWM_TX_CMD_OFFLD_L3_EN: enable IP header checksum + * @IWM_TX_CMD_OFFLD_MH_SIZE: size of the mac header in words. Includes the IV + * field. Doesn't include the pad. + * @IWM_TX_CMD_OFFLD_PAD: mark 2-byte pad was inserted after the mac header for + * alignment + * @IWM_TX_CMD_OFFLD_AMSDU: mark TX command is A-MSDU + */ +enum iwm_tx_offload_assist_flags_pos { + IWM_TX_CMD_OFFLD_IP_HDR = 0, + IWM_TX_CMD_OFFLD_L4_EN = 6, + IWM_TX_CMD_OFFLD_L3_EN = 7, + IWM_TX_CMD_OFFLD_MH_SIZE = 8, + IWM_TX_CMD_OFFLD_PAD = 13, + IWM_TX_CMD_OFFLD_AMSDU = 14, +}; + +#define IWM_TX_CMD_OFFLD_MH_MASK 0x1f +#define IWM_TX_CMD_OFFLD_IP_HDR_MASK 0x3f + /* TODO: complete documentation for try_cnt and btkill_cnt */ /** * struct iwm_tx_cmd - TX command struct to FW * ( IWM_TX_CMD = 0x1c ) * @len: in bytes of the payload, see below for details - * @next_frame_len: same as len, but for next frame (0 if not applicable) - * Used for fragmentation and bursting, but not in 11n aggregation. + * @offload_assist: TX offload configuration * @tx_flags: combination of IWM_TX_CMD_FLG_* * @rate_n_flags: rate for *all* Tx attempts, if IWM_TX_CMD_FLG_STA_RATE_MSK is * cleared. Combination of IWM_RATE_MCS_* @@ -4519,7 +4547,7 @@ enum iwm_tx_pm_timeouts { */ struct iwm_tx_cmd { uint16_t len; - uint16_t next_frame_len; + uint16_t offload_assist; uint32_t tx_flags; struct { uint8_t try_cnt; From owner-svn-src-head@freebsd.org Thu Nov 7 23:38:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD88F17E9E6; Thu, 7 Nov 2019 23:38:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478Kbs4Dy2z4YvP; Thu, 7 Nov 2019 23:38:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 748261D740; Thu, 7 Nov 2019 23:38:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NcnOb074467; Thu, 7 Nov 2019 23:38:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7Ncnrh074466; Thu, 7 Nov 2019 23:38:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072338.xA7Ncnrh074466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:38:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354514 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354514 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:38:49 -0000 Author: markj Date: Thu Nov 7 23:38:49 2019 New Revision: 354514 URL: https://svnweb.freebsd.org/changeset/base/354514 Log: iwm: Use the default station for all transmits. This is what iwlwifi seems to do, and the previous behaviour triggered firmware panics during transmit on a 9560. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:38:36 2019 (r354513) +++ head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:38:49 2019 (r354514) @@ -3858,11 +3858,7 @@ iwm_tx(struct iwm_softc *sc, struct mbuf *m, struct ie flags |= IWM_TX_CMD_FLG_PROT_REQUIRE; } - if (IEEE80211_IS_MULTICAST(wh->i_addr1) || - type != IEEE80211_FC0_TYPE_DATA) - tx->sta_id = sc->sc_aux_sta.sta_id; - else - tx->sta_id = IWM_STATION_ID; + tx->sta_id = IWM_STATION_ID; if (type == IEEE80211_FC0_TYPE_MGT) { uint8_t subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; From owner-svn-src-head@freebsd.org Thu Nov 7 23:39:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9567717EA8E; Thu, 7 Nov 2019 23:39:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478Kc93TZ7z4Z3J; Thu, 7 Nov 2019 23:39:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A6A81D741; Thu, 7 Nov 2019 23:39:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7Nd5OY074526; Thu, 7 Nov 2019 23:39:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7Nd4bv074524; Thu, 7 Nov 2019 23:39:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072339.xA7Nd4bv074524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:39:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354515 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354515 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:39:05 -0000 Author: markj Date: Thu Nov 7 23:39:04 2019 New Revision: 354515 URL: https://svnweb.freebsd.org/changeset/base/354515 Log: iwm: Implement support for scans with "adaptive" dwell time. This is required by 9000-series firmware. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwm_scan.c head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- head/sys/dev/iwm/if_iwm_scan.c Thu Nov 7 23:38:49 2019 (r354514) +++ head/sys/dev/iwm/if_iwm_scan.c Thu Nov 7 23:39:04 2019 (r354515) @@ -580,6 +580,29 @@ iwm_mvm_scan_use_ebs(struct iwm_softc *sc) sc->last_ebs_successful); } +static int +iwm_mvm_scan_size(struct iwm_softc *sc) +{ + int base_size; + + if (iwm_fw_has_capa(sc, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) { + if (iwm_fw_has_api(sc, IWM_UCODE_TLV_API_ADAPTIVE_DWELL)) + base_size = IWM_SCAN_REQ_UMAC_SIZE_V7; + else + base_size = IWM_SCAN_REQ_UMAC_SIZE_V1; + + return base_size + + sizeof(struct iwm_scan_channel_cfg_umac) * + sc->sc_fw.ucode_capa.n_scan_channels + + sizeof(struct iwm_scan_req_umac_tail); + } else { + return sizeof(struct iwm_scan_req_lmac) + + sizeof(struct iwm_scan_channel_cfg_lmac) * + sc->sc_fw.ucode_capa.n_scan_channels + + sizeof(struct iwm_scan_probe_req); + } +} + int iwm_mvm_umac_scan(struct iwm_softc *sc) { @@ -593,13 +616,11 @@ iwm_mvm_umac_scan(struct iwm_softc *sc) struct iwm_scan_req_umac *req; struct iwm_scan_req_umac_tail *tail; size_t req_len; - uint8_t i, nssid; + uint16_t general_flags; + uint8_t channel_flags, i, nssid; int ret; - req_len = sizeof(struct iwm_scan_req_umac) + - (sizeof(struct iwm_scan_channel_cfg_umac) * - sc->sc_fw.ucode_capa.n_scan_channels) + - sizeof(struct iwm_scan_req_umac_tail); + req_len = iwm_mvm_scan_size(sc); if (req_len > IWM_MAX_CMD_PAYLOAD_SIZE) return ENOMEM; req = malloc(req_len, M_DEVBUF, M_NOWAIT | M_ZERO); @@ -611,28 +632,58 @@ iwm_mvm_umac_scan(struct iwm_softc *sc) IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "Handling ieee80211 scan request\n"); - /* These timings correspond to iwlwifi's UNASSOC scan. */ - req->active_dwell = 10; - req->passive_dwell = 110; - req->fragmented_dwell = 44; - req->extended_dwell = 90; - req->max_out_time = 0; - req->suspend_time = 0; + nssid = MIN(ss->ss_nssid, IWM_PROBE_OPTION_MAX); - req->scan_priority = htole32(IWM_SCAN_PRIORITY_HIGH); + general_flags = IWM_UMAC_SCAN_GEN_FLAGS_PASS_ALL | + IWM_UMAC_SCAN_GEN_FLAGS_ITER_COMPLETE; + if (!iwm_fw_has_api(sc, IWM_UCODE_TLV_API_ADAPTIVE_DWELL)) + general_flags |= IWM_UMAC_SCAN_GEN_FLAGS_EXTENDED_DWELL; + if (iwm_mvm_rrm_scan_needed(sc)) + general_flags |= IWM_UMAC_SCAN_GEN_FLAGS_RRM_ENABLED; + if (nssid != 0) + general_flags |= IWM_UMAC_SCAN_GEN_FLAGS_PRE_CONNECT; + else + general_flags |= IWM_UMAC_SCAN_GEN_FLAGS_PASSIVE; + + channel_flags = 0; + if (iwm_mvm_scan_use_ebs(sc)) + channel_flags = IWM_SCAN_CHANNEL_FLAG_EBS | + IWM_SCAN_CHANNEL_FLAG_EBS_ACCURATE | + IWM_SCAN_CHANNEL_FLAG_CACHE_ADD; + + req->general_flags = htole16(general_flags); req->ooc_priority = htole32(IWM_SCAN_PRIORITY_HIGH); - nssid = MIN(ss->ss_nssid, IWM_PROBE_OPTION_MAX); - req->n_channels = iwm_mvm_umac_scan_fill_channels(sc, - (struct iwm_scan_channel_cfg_umac *)req->data, nssid); + /* These timings correspond to iwlwifi's UNASSOC scan. */ + if (iwm_fw_has_api(sc, IWM_UCODE_TLV_API_ADAPTIVE_DWELL)) { + req->v7.active_dwell = 10; + req->v7.passive_dwell = 110; + req->v7.fragmented_dwell = 44; + req->v7.adwell_default_n_aps_social = 10; + req->v7.adwell_default_n_aps = 2; + req->v7.adwell_max_budget = htole16(300); + req->v7.scan_priority = htole32(IWM_SCAN_PRIORITY_HIGH); + req->v7.channel.flags = channel_flags; + req->v7.channel.count = iwm_mvm_umac_scan_fill_channels(sc, + (struct iwm_scan_channel_cfg_umac *)req->v7.data, nssid); - req->general_flags = htole32(IWM_UMAC_SCAN_GEN_FLAGS_PASS_ALL | - IWM_UMAC_SCAN_GEN_FLAGS_ITER_COMPLETE | - IWM_UMAC_SCAN_GEN_FLAGS_EXTENDED_DWELL); + tail = (void *)((char *)&req->v7.data + + sizeof(struct iwm_scan_channel_cfg_umac) * + sc->sc_fw.ucode_capa.n_scan_channels); + } else { + req->v1.active_dwell = 10; + req->v1.passive_dwell = 110; + req->v1.fragmented_dwell = 44; + req->v1.extended_dwell = 90; + req->v1.scan_priority = htole32(IWM_SCAN_PRIORITY_HIGH); + req->v1.channel.flags = channel_flags; + req->v1.channel.count = iwm_mvm_umac_scan_fill_channels(sc, + (struct iwm_scan_channel_cfg_umac *)req->v1.data, nssid); - tail = (void *)((char *)&req->data + - sizeof(struct iwm_scan_channel_cfg_umac) * - sc->sc_fw.ucode_capa.n_scan_channels); + tail = (void *)((char *)&req->v1.data + + sizeof(struct iwm_scan_channel_cfg_umac) * + sc->sc_fw.ucode_capa.n_scan_channels); + } /* Check if we're doing an active directed scan. */ for (i = 0; i < nssid; i++) { @@ -643,21 +694,7 @@ iwm_mvm_umac_scan(struct iwm_softc *sc) tail->direct_scan[i].len); /* XXX debug */ } - if (nssid != 0) { - req->general_flags |= - htole32(IWM_UMAC_SCAN_GEN_FLAGS_PRE_CONNECT); - } else - req->general_flags |= htole32(IWM_UMAC_SCAN_GEN_FLAGS_PASSIVE); - if (iwm_mvm_scan_use_ebs(sc)) - req->channel_flags = IWM_SCAN_CHANNEL_FLAG_EBS | - IWM_SCAN_CHANNEL_FLAG_EBS_ACCURATE | - IWM_SCAN_CHANNEL_FLAG_CACHE_ADD; - - if (iwm_mvm_rrm_scan_needed(sc)) - req->general_flags |= - htole32(IWM_UMAC_SCAN_GEN_FLAGS_RRM_ENABLED); - ret = iwm_mvm_fill_probe_req(sc, &tail->preq); if (ret) { free(req, M_DEVBUF); @@ -694,9 +731,7 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc) IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "Handling ieee80211 scan request\n"); - req_len = sizeof(struct iwm_scan_req_lmac) + - (sizeof(struct iwm_scan_channel_cfg_lmac) * - sc->sc_fw.ucode_capa.n_scan_channels) + sizeof(struct iwm_scan_probe_req); + req_len = iwm_mvm_scan_size(sc); if (req_len > IWM_MAX_CMD_PAYLOAD_SIZE) return ENOMEM; req = malloc(req_len, M_DEVBUF, M_NOWAIT | M_ZERO); Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Nov 7 23:38:49 2019 (r354514) +++ head/sys/dev/iwm/if_iwmreg.h Thu Nov 7 23:39:04 2019 (r354515) @@ -5488,21 +5488,44 @@ struct iwm_scan_req_umac_tail { } __packed; /** + * struct iwm_scan_uma_chan_param + * @flags: channel flags &enum iwm_scan_channel_flags + * @count: num of channels in scan request + * @reserved: for future use and alignment + */ +struct iwm_scan_umac_chan_param { + uint8_t flags; + uint8_t count; + uint16_t reserved; +} __packed; + +/** * struct iwm_scan_req_umac * @flags: &enum iwm_umac_scan_flags * @uid: scan id, &enum iwm_umac_scan_uid_offsets * @ooc_priority: out of channel priority - &enum iwm_scan_priority * @general_flags: &enum iwm_umac_scan_general_flags + * @scan_start_mac_id: report the scan start TSF time according to this mac TSF * @extended_dwell: dwell time for channels 1, 6 and 11 - * @active_dwell: dwell time for active scan - * @passive_dwell: dwell time for passive scan + * @active_dwell: dwell time for active scan per LMAC + * @passive_dwell: dwell time for passive scan per LMAC * @fragmented_dwell: dwell time for fragmented passive scan - * @max_out_time: max out of serving channel time - * @suspend_time: max suspend time - * @scan_priority: scan internal prioritization &enum iwm_scan_priority - * @channel_flags: &enum iwm_scan_channel_flags - * @n_channels: num of channels in scan request + * @adwell_default_n_aps: for adaptive dwell the default number of APs + * per channel + * @adwell_default_n_aps_social: for adaptive dwell the default + * number of APs per social (1,6,11) channel + * @general_flags2: &enum iwl_umac_scan_general_flags2 + * @adwell_max_budget: for adaptive dwell the maximal budget of TU to be added + * to total scan time + * @max_out_time: max out of serving channel time, per LMAC - for CDB there + * are 2 LMACs + * @suspend_time: max suspend time, per LMAC - for CDB there are 2 LMACs + * @scan_priority: scan internal prioritization &enum iwl_scan_priority + * @num_of_fragments: Number of fragments needed for full coverage per band. + * Relevant only for fragmented scan. + * @channel: &struct iwl_scan_umac_chan_param * @reserved: for future use and alignment + * @reserved3: for future use and alignment * @data: &struct iwm_scan_channel_cfg_umac and * &struct iwm_scan_req_umac_tail */ @@ -5510,21 +5533,40 @@ struct iwm_scan_req_umac { uint32_t flags; uint32_t uid; uint32_t ooc_priority; - /* SCAN_GENERAL_PARAMS_API_S_VER_1 */ - uint32_t general_flags; - uint8_t extended_dwell; - uint8_t active_dwell; - uint8_t passive_dwell; - uint8_t fragmented_dwell; - uint32_t max_out_time; - uint32_t suspend_time; - uint32_t scan_priority; - /* SCAN_CHANNEL_PARAMS_API_S_VER_1 */ - uint8_t channel_flags; - uint8_t n_channels; - uint16_t reserved; - uint8_t data[]; -} __packed; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_1 */ + uint16_t general_flags; + uint8_t reserved; + uint8_t scan_start_mac_id; + union { + struct { + uint8_t extended_dwell; + uint8_t active_dwell; + uint8_t passive_dwell; + uint8_t fragmented_dwell; + uint32_t max_out_time; + uint32_t suspend_time; + uint32_t scan_priority; + struct iwm_scan_umac_chan_param channel; + uint8_t data[]; + } v1; + struct { + uint8_t active_dwell; + uint8_t passive_dwell; + uint8_t fragmented_dwell; + uint8_t adwell_default_n_aps; + uint8_t adwell_default_n_aps_social; + uint8_t reserved3; + uint16_t adwell_max_budget; + uint32_t max_out_time[2]; + uint32_t suspend_time[2]; + uint32_t scan_priority; + struct iwm_scan_umac_chan_param channel; + uint8_t data[]; + } v7; + }; +} __packed; + +#define IWM_SCAN_REQ_UMAC_SIZE_V7 48 +#define IWM_SCAN_REQ_UMAC_SIZE_V1 36 /** * struct iwm_umac_scan_abort From owner-svn-src-head@freebsd.org Thu Nov 7 23:39:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C434717EB2D; Thu, 7 Nov 2019 23:39:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KcQ4ksYz4Z9s; Thu, 7 Nov 2019 23:39:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 871C81D742; Thu, 7 Nov 2019 23:39:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NdIEp074589; Thu, 7 Nov 2019 23:39:18 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NdHK3074585; Thu, 7 Nov 2019 23:39:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072339.xA7NdHK3074585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:39:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354516 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 354516 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:39:18 -0000 Author: markj Date: Thu Nov 7 23:39:17 2019 New Revision: 354516 URL: https://svnweb.freebsd.org/changeset/base/354516 Log: iwm: Sync device initialization and reset code with iwlwifi. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_pcie_trans.c head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:39:04 2019 (r354515) +++ head/sys/dev/iwm/if_iwm.c Thu Nov 7 23:39:17 2019 (r354516) @@ -1353,6 +1353,8 @@ iwm_stop_device(struct iwm_softc *sc) */ iwm_enable_rfkill_int(sc); iwm_check_rfkill(sc); + + iwm_prepare_card_hw(sc); } /* iwlwifi: mvm/ops.c */ @@ -1381,7 +1383,15 @@ iwm_mvm_nic_config(struct iwm_softc *sc) reg_val |= radio_cfg_step << IWM_CSR_HW_IF_CONFIG_REG_POS_PHY_STEP; reg_val |= radio_cfg_dash << IWM_CSR_HW_IF_CONFIG_REG_POS_PHY_DASH; - IWM_WRITE(sc, IWM_CSR_HW_IF_CONFIG_REG, reg_val); + IWM_WRITE(sc, IWM_CSR_HW_IF_CONFIG_REG, + IWM_CSR_HW_IF_CONFIG_REG_MSK_MAC_DASH | + IWM_CSR_HW_IF_CONFIG_REG_MSK_MAC_STEP | + IWM_CSR_HW_IF_CONFIG_REG_MSK_PHY_STEP | + IWM_CSR_HW_IF_CONFIG_REG_MSK_PHY_DASH | + IWM_CSR_HW_IF_CONFIG_REG_MSK_PHY_TYPE | + IWM_CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI | + IWM_CSR_HW_IF_CONFIG_REG_BIT_MAC_SI | + reg_val); IWM_DPRINTF(sc, IWM_DEBUG_RESET, "Radio type=0x%x-0x%x-0x%x\n", radio_cfg_type, Modified: head/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- head/sys/dev/iwm/if_iwm_pcie_trans.c Thu Nov 7 23:39:04 2019 (r354515) +++ head/sys/dev/iwm/if_iwm_pcie_trans.c Thu Nov 7 23:39:17 2019 (r354516) @@ -346,6 +346,8 @@ iwm_enable_rfkill_int(struct iwm_softc *sc) { sc->sc_intmask = IWM_CSR_INT_BIT_RF_KILL; IWM_WRITE(sc, IWM_CSR_INT_MASK, sc->sc_intmask); + IWM_SETBITS(sc, IWM_CSR_GP_CNTRL, + IWM_CSR_GP_CNTRL_REG_FLAG_RFKILL_WAKE_L1A_EN); } int @@ -404,7 +406,9 @@ iwm_prepare_card_hw(struct iwm_softc *sc) if (iwm_set_hw_ready(sc)) goto out; - DELAY(100); + IWM_SETBITS(sc, IWM_CSR_DBG_LINK_PWR_MGMT_REG, + IWM_CSR_RESET_LINK_PWR_MGMT_DISABLED); + DELAY(1000); /* If HW is not ready, prepare the conditions to check again */ IWM_SETBITS(sc, IWM_CSR_HW_IF_CONFIG_REG, @@ -590,6 +594,16 @@ iwm_apm_init(struct iwm_softc *sc) void iwm_apm_stop(struct iwm_softc *sc) { + IWM_SETBITS(sc, IWM_CSR_DBG_LINK_PWR_MGMT_REG, + IWM_CSR_RESET_LINK_PWR_MGMT_DISABLED); + IWM_SETBITS(sc, IWM_CSR_HW_IF_CONFIG_REG, + IWM_CSR_HW_IF_CONFIG_REG_PREPARE | + IWM_CSR_HW_IF_CONFIG_REG_ENABLE_PME); + DELAY(1000); + IWM_CLRBITS(sc, IWM_CSR_DBG_LINK_PWR_MGMT_REG, + IWM_CSR_RESET_LINK_PWR_MGMT_DISABLED); + DELAY(5000); + /* stop device's busmaster DMA activity */ IWM_SETBITS(sc, IWM_CSR_RESET, IWM_CSR_RESET_REG_FLAG_STOP_MASTER); @@ -597,6 +611,14 @@ iwm_apm_stop(struct iwm_softc *sc) IWM_CSR_RESET_REG_FLAG_MASTER_DISABLED, IWM_CSR_RESET_REG_FLAG_MASTER_DISABLED, 100)) device_printf(sc->sc_dev, "timeout waiting for master\n"); + + /* + * Clear "initialization complete" bit to move adapter from + * D0A* (powered-up Active) --> D0U* (Uninitialized) state. + */ + IWM_CLRBITS(sc, IWM_CSR_GP_CNTRL, + IWM_CSR_GP_CNTRL_REG_FLAG_INIT_DONE); + IWM_DPRINTF(sc, IWM_DEBUG_TRANS, "%s: iwm apm stop\n", __func__); } Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Thu Nov 7 23:39:04 2019 (r354515) +++ head/sys/dev/iwm/if_iwmreg.h Thu Nov 7 23:39:17 2019 (r354516) @@ -289,7 +289,7 @@ #define IWM_CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN (0x00000001) #define IWM_CSR_GP_CNTRL_REG_MSK_POWER_SAVE_TYPE (0x07000000) -#define IWM_CSR_GP_CNTRL_REG_FLAG_MAC_POWER_SAVE (0x04000000) +#define IWM_CSR_GP_CNTRL_REG_FLAG_RFKILL_WAKE_L1A_EN (0x04000000) #define IWM_CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW (0x08000000) From owner-svn-src-head@freebsd.org Thu Nov 7 23:39:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 757E117EBBB; Thu, 7 Nov 2019 23:39:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478Kck2YQZz4ZJb; Thu, 7 Nov 2019 23:39:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23AEE1D743; Thu, 7 Nov 2019 23:39:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NdYW1074642; Thu, 7 Nov 2019 23:39:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NdXDj074640; Thu, 7 Nov 2019 23:39:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911072339.xA7NdXDj074640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 7 Nov 2019 23:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354517 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 354517 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:39:34 -0000 Author: markj Date: Thu Nov 7 23:39:33 2019 New Revision: 354517 URL: https://svnweb.freebsd.org/changeset/base/354517 Log: Update iwm and iwmfw man pages with info about 9000-series chips. Thanks to bapt, bz, cem, woodsb02, Neel Chauhan and Salvador Martínez Mármol for helping test the initial 9000-series support. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/iwm.4 head/share/man/man4/iwmfw.4 Modified: head/share/man/man4/iwm.4 ============================================================================== --- head/share/man/man4/iwm.4 Thu Nov 7 23:39:17 2019 (r354516) +++ head/share/man/man4/iwm.4 Thu Nov 7 23:39:33 2019 (r354517) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 29, 2017 +.Dd November 7, 2019 .Dt IWM 4 .Os .Sh NAME @@ -51,6 +51,8 @@ Choose one from: .Cd "device iwm7265fw" .Cd "device iwm8000Cfw" .Cd "device iwm8265fw" +.Cd "device iwm9000fw" +.Cd "device iwm9260fw" .Ed .Pp Or you can use @@ -71,6 +73,8 @@ iwm7260fw_load="YES" iwm7265fw_load="YES" iwm8000Cfw_load="YES" iwm8265fw_load="YES" +iwm9000fw_load="YES" +iwm9260fw_load="YES" .Ed .Sh DESCRIPTION The @@ -84,6 +88,10 @@ driver provides support for: .It Intel Dual Band Wireless AC 7260 .It Intel Dual Band Wireless AC 7265 .It Intel Dual Band Wireless AC 8260 +.It Intel Dual Band Wireless AC 9260 +.It Intel Dual Band Wireless AC 9270 +.It Intel Dual Band Wireless AC 946X +.It Intel Dual Band Wireless AC 9560 .El .Pp .Nm Modified: head/share/man/man4/iwmfw.4 ============================================================================== --- head/share/man/man4/iwmfw.4 Thu Nov 7 23:39:17 2019 (r354516) +++ head/share/man/man4/iwmfw.4 Thu Nov 7 23:39:33 2019 (r354517) @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 29, 2017 +.Dd November 7, 2019 .Dt IWMFW 4 .Os .Sh NAME @@ -48,10 +48,12 @@ of the following: .Cd "device iwm7265fw" .Cd "device iwm8000Cfw" .Cd "device iwm8265fw" +.Cd "device iwm9000fw" +.Cd "device iwm9260fw" .Ed .Pp Alternatively, to load the driver as a -module at boot time, place the following line in +module at boot time, place one of the following lines in .Xr loader.conf 5 : .Bd -literal -offset indent iwm3160fw_load="YES" @@ -61,13 +63,14 @@ iwm7265fw_load="YES" iwm7265Dfw_load="YES" iwm8000Cfw_load="YES" iwm8265fw_load="YES" +iwm9000fw_load="YES" +iwm9260fw_load="YES" .Ed .Sh DESCRIPTION This module provides access to firmware sets for the -Intel Dual Band Wireless WiFi 3160, 3165, 3168, 7260, 7265, 8000, and 8260 series of -IEEE 802.11n/11ac adapters. -It may be -statically linked into the kernel, or loaded as a module. +Intel Dual Band Wireless WiFi 3160, 3165, 3168, 7260, 7265, 8000, 8260, +9000 and 9260 series of IEEE 802.11n/11ac adapters. +It may be statically linked into the kernel, or loaded as a module. .Sh SEE ALSO .Xr iwm 4 , .Xr firmware 9 From owner-svn-src-head@freebsd.org Thu Nov 7 23:50:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15D1717EFD0; Thu, 7 Nov 2019 23:50:34 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478KsP6vYcz4ZmL; Thu, 7 Nov 2019 23:50:33 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0DF01D920; Thu, 7 Nov 2019 23:50:33 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NoXkQ080524; Thu, 7 Nov 2019 23:50:33 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NoXS3080523; Thu, 7 Nov 2019 23:50:33 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201911072350.xA7NoXS3080523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 7 Nov 2019 23:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354518 - head X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 354518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:50:34 -0000 Author: brooks Date: Thu Nov 7 23:50:33 2019 New Revision: 354518 URL: https://svnweb.freebsd.org/changeset/base/354518 Log: Fix the ARCH check for LIB32 from Makefile.inc1. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Nov 7 23:39:33 2019 (r354517) +++ head/Makefile.inc1 Thu Nov 7 23:50:33 2019 (r354518) @@ -803,6 +803,7 @@ XCFLAGS+= ${BFLAGS} .endif .if ${MK_LIB32} == "yes" +.error WTF _LIBCOMPAT= 32 .include "Makefile.libcompat" .elif ${MK_LIBSOFT} == "yes" From owner-svn-src-head@freebsd.org Thu Nov 7 23:54:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15DBD17F25E; Thu, 7 Nov 2019 23:54:41 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478Ky86Pxxz4bBr; Thu, 7 Nov 2019 23:54:40 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFD9D1DADD; Thu, 7 Nov 2019 23:54:40 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7Nse4m086074; Thu, 7 Nov 2019 23:54:40 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NseBO086072; Thu, 7 Nov 2019 23:54:40 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201911072354.xA7NseBO086072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 7 Nov 2019 23:54:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354519 - in head: . share/mk X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . share/mk X-SVN-Commit-Revision: 354519 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:54:41 -0000 Author: brooks Date: Thu Nov 7 23:54:40 2019 New Revision: 354519 URL: https://svnweb.freebsd.org/changeset/base/354519 Log: Revert r354518 and commit the intented fix rather than the diagnostic check. This fixes the definition of MK_LIB32 in Makefile.inc1. Modified: head/Makefile.inc1 head/share/mk/src.opts.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Nov 7 23:50:33 2019 (r354518) +++ head/Makefile.inc1 Thu Nov 7 23:54:40 2019 (r354519) @@ -803,7 +803,6 @@ XCFLAGS+= ${BFLAGS} .endif .if ${MK_LIB32} == "yes" -.error WTF _LIBCOMPAT= 32 .include "Makefile.libcompat" .elif ${MK_LIBSOFT} == "yes" Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Nov 7 23:50:33 2019 (r354518) +++ head/share/mk/src.opts.mk Thu Nov 7 23:54:40 2019 (r354519) @@ -358,8 +358,7 @@ __DEFAULT_NO_OPTIONS+=GDB_LIBEXEC __DEFAULT_YES_OPTIONS+=GDB_LIBEXEC .endif # LIB32 is supported on amd64, mips64, and powerpc64 -.if (${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH:Mmips64*} || \ - ${MACHINE_ARCH} == "powerpc64") +.if (${__T} == "amd64" || ${__T:Mmips64*} || ${__T} == "powerpc64") __DEFAULT_YES_OPTIONS+=LIB32 .else BROKEN_OPTIONS+=LIB32 From owner-svn-src-head@freebsd.org Thu Nov 7 23:57:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B762017F599; Thu, 7 Nov 2019 23:57:48 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478L1m4R9Yz4bLx; Thu, 7 Nov 2019 23:57:48 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B6271DAE1; Thu, 7 Nov 2019 23:57:48 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7NvmZ1086277; Thu, 7 Nov 2019 23:57:48 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7NvmSv086276; Thu, 7 Nov 2019 23:57:48 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201911072357.xA7NvmSv086276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Thu, 7 Nov 2019 23:57:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354520 - head/lib/msun/src X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/lib/msun/src X-SVN-Commit-Revision: 354520 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 23:57:48 -0000 Author: lwhsu Date: Thu Nov 7 23:57:48 2019 New Revision: 354520 URL: https://svnweb.freebsd.org/changeset/base/354520 Log: Get the fix in back by reverting the part accidentally included in r354491. This brings back r354467. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/lib/msun/src/k_sincosl.h Modified: head/lib/msun/src/k_sincosl.h ============================================================================== --- head/lib/msun/src/k_sincosl.h Thu Nov 7 23:54:40 2019 (r354519) +++ head/lib/msun/src/k_sincosl.h Thu Nov 7 23:57:48 2019 (r354520) @@ -28,8 +28,8 @@ S1lo = -9.2563760475949941e-18; /* -0x15580000000000. #define C1 ((long double)C1hi + C1lo) #else static const long double -C1 = 0.0416666666666666666136L; /* 0xaaaaaaaaaaaaaa9b.0p-68 */ -S1 = -0.166666666666666666671L, /* -0xaaaaaaaaaaaaaaab.0p-66 */ +C1 = 0.0416666666666666666136L, /* 0xaaaaaaaaaaaaaa9b.0p-68 */ +S1 = -0.166666666666666666671L; /* -0xaaaaaaaaaaaaaaab.0p-66 */ #endif static const double From owner-svn-src-head@freebsd.org Fri Nov 8 00:01:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A78817F705; Fri, 8 Nov 2019 00:01:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478L6B2jgvz4bZD; Fri, 8 Nov 2019 00:01:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 401331DC4C; Fri, 8 Nov 2019 00:01:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA801c7V089615; Fri, 8 Nov 2019 00:01:38 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA801cel089614; Fri, 8 Nov 2019 00:01:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911080001.xA801cel089614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 8 Nov 2019 00:01:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354521 - head X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 354521 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 00:01:38 -0000 Author: markj Date: Fri Nov 8 00:01:37 2019 New Revision: 354521 URL: https://svnweb.freebsd.org/changeset/base/354521 Log: Document iwm(4) support for 9000-series devices. Sponsored by: The FreeBSD Foundation Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Thu Nov 7 23:57:48 2019 (r354520) +++ head/RELNOTES Fri Nov 8 00:01:37 2019 (r354521) @@ -10,6 +10,9 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r354517: + iwm(4) now supports most Intel 9260, 9460 and 9560 Wi-Fi devices. + r354269: sqlite3 is updated to sqlite3-3.30.1. From owner-svn-src-head@freebsd.org Fri Nov 8 01:13:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D61971A1D38; Fri, 8 Nov 2019 01:13:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478Mhm5Hn4z4fFg; Fri, 8 Nov 2019 01:13:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 996E21E8FA; Fri, 8 Nov 2019 01:13:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA81DCxe032932; Fri, 8 Nov 2019 01:13:12 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA81DC5L032931; Fri, 8 Nov 2019 01:13:12 GMT (envelope-from np@FreeBSD.org) Message-Id: <201911080113.xA81DC5L032931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 8 Nov 2019 01:13:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354522 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 354522 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 01:13:12 -0000 Author: np Date: Fri Nov 8 01:13:12 2019 New Revision: 354522 URL: https://svnweb.freebsd.org/changeset/base/354522 Log: cxgbe(4): Query Vdd from the firmware if its last known value is 0. TVSENSE may not be ready by the time t4_fw_initialize returns and the firmware returns 0 if the driver asks for the Vdd before the sensor is ready. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Nov 8 00:01:37 2019 (r354521) +++ head/sys/dev/cxgbe/t4_main.c Fri Nov 8 01:13:12 2019 (r354522) @@ -656,6 +656,7 @@ static int sysctl_fec(SYSCTL_HANDLER_ARGS); static int sysctl_autoneg(SYSCTL_HANDLER_ARGS); static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS); static int sysctl_temperature(SYSCTL_HANDLER_ARGS); +static int sysctl_vdd(SYSCTL_HANDLER_ARGS); static int sysctl_loadavg(SYSCTL_HANDLER_ARGS); static int sysctl_cctrl(SYSCTL_HANDLER_ARGS); static int sysctl_cim_ibq_obq(SYSCTL_HANDLER_ARGS); @@ -6153,8 +6154,8 @@ t4_sysctls(struct adapter *sc) CTLFLAG_RD, sc, 0, sysctl_loadavg, "A", "microprocessor load averages (debug firmwares only)"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "core_vdd", CTLFLAG_RD, - &sc->params.core_vdd, 0, "core Vdd (in mV)"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "core_vdd", CTLTYPE_INT | + CTLFLAG_RD, sc, 0, sysctl_vdd, "I", "core Vdd (in mV)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "local_cpus", CTLTYPE_STRING | CTLFLAG_RD, sc, LOCAL_CPUS, @@ -7292,6 +7293,31 @@ sysctl_temperature(SYSCTL_HANDLER_ARGS) rc = sysctl_handle_int(oidp, &t, 0, req); return (rc); +} + +static int +sysctl_vdd(SYSCTL_HANDLER_ARGS) +{ + struct adapter *sc = arg1; + int rc; + uint32_t param, val; + + if (sc->params.core_vdd == 0) { + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, + "t4vdd"); + if (rc) + return (rc); + param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_DIAG) | + V_FW_PARAMS_PARAM_Y(FW_PARAM_DEV_DIAG_VDD); + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 1, ¶m, &val); + end_synchronized_op(sc, 0); + if (rc) + return (rc); + sc->params.core_vdd = val; + } + + return (sysctl_handle_int(oidp, &sc->params.core_vdd, 0, req)); } static int From owner-svn-src-head@freebsd.org Fri Nov 8 03:14:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75E551A51F1; Fri, 8 Nov 2019 03:14:07 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478QNH2VD9z3Hgf; Fri, 8 Nov 2019 03:14:07 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 391641FE9B; Fri, 8 Nov 2019 03:14:07 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA83E7rI004517; Fri, 8 Nov 2019 03:14:07 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA83E7GO004516; Fri, 8 Nov 2019 03:14:07 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201911080314.xA83E7GO004516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 8 Nov 2019 03:14:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354523 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 354523 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 03:14:07 -0000 Author: brooks Date: Fri Nov 8 03:14:06 2019 New Revision: 354523 URL: https://svnweb.freebsd.org/changeset/base/354523 Log: Turn the error about a lack of LIBCOMPAT into a warning. Add some diagnostic output. This works around the fact that buildworld calls cleandir in libexec with the wrong MACHINE_ARCH (i386 on amd64) when the OBJ directory is empty. Reported by: bdragon, jkim Modified: head/share/mk/bsd.compat.mk Modified: head/share/mk/bsd.compat.mk ============================================================================== --- head/share/mk/bsd.compat.mk Fri Nov 8 01:13:12 2019 (r354522) +++ head/share/mk/bsd.compat.mk Fri Nov 8 03:14:06 2019 (r354523) @@ -103,7 +103,7 @@ LIBSOFTWMAKEFLAGS= -DCOMPAT_SOFTFP # In the program linking case, select LIBCOMPAT .if defined(NEED_COMPAT) .ifndef HAS_COMPAT -.error NEED_COMPAT defined, but no LIBCOMPAT is available +.warning NEED_COMPAT defined, but no LIBCOMPAT is available (COMPAT_ARCH == ${COMPAT_ARCH} .elif !${HAS_COMPAT:M${NEED_COMPAT}} && ${NEED_COMPAT} != "any" .error NEED_COMPAT (${NEED_COMPAT}) defined, but not in HAS_COMPAT ($HAS_COMPAT) .elif ${NEED_COMPAT} == "any" From owner-svn-src-head@freebsd.org Fri Nov 8 03:27:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 60FD71A555C; Fri, 8 Nov 2019 03:27:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478QhF1njXz3JDW; Fri, 8 Nov 2019 03:27:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 207782007A; Fri, 8 Nov 2019 03:27:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA83RvEB010607; Fri, 8 Nov 2019 03:27:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA83Rvur010606; Fri, 8 Nov 2019 03:27:57 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201911080327.xA83Rvur010606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 8 Nov 2019 03:27:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354524 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 354524 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 03:27:57 -0000 Author: kevans Date: Fri Nov 8 03:27:56 2019 New Revision: 354524 URL: https://svnweb.freebsd.org/changeset/base/354524 Log: bcm2835_dma: Mark IRQs shareable On the RPi4, some of these IRQs are shared. Start moving toward a mode where we accept that shared IRQs happen and simply ignore interrupts that are seemingly for no reason. I would like to be more verbose here, but my 30-minute assessment of the current world order is that mapping a resource/rid to an actual IRQ number (as found in FDT) data is not a simple matter. Determining if more than one handler is attached to an IRQ is closer to feasible, but it's unclear which way is the cleaner path. Beyond that, we're only really using it to be slightly more verbose when something's going wrong, so for now just suppress and drop a complaint-comment. This was originally submitted (via freebsd-arm@) by Robert Crowston; the additional verbosity was dropped by kevans@. Submitted by: Robert Crowston Modified: head/sys/arm/broadcom/bcm2835/bcm2835_dma.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_dma.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_dma.c Fri Nov 8 03:14:06 2019 (r354523) +++ head/sys/arm/broadcom/bcm2835/bcm2835_dma.c Fri Nov 8 03:27:56 2019 (r354524) @@ -619,18 +619,18 @@ bcm_dma_intr(void *arg) /* my interrupt? */ cs = bus_read_4(sc->sc_mem, BCM_DMA_CS(ch->ch)); - if (!(cs & (CS_INT | CS_ERR))) { - device_printf(sc->sc_dev, - "unexpected DMA intr CH=%d, CS=%x\n", ch->ch, cs); + /* + * Is it an active channel? Our diagnostics could be better here, but + * it's not necessarily an easy task to resolve a rid/resource to an + * actual irq number. We'd want to do this to set a flag indicating + * whether the irq is shared or not, so we know to complain. + */ + if (!(ch->flags & BCM_DMA_CH_USED)) return; - } - /* running? */ - if (!(ch->flags & BCM_DMA_CH_USED)) { - device_printf(sc->sc_dev, - "unused DMA intr CH=%d, CS=%x\n", ch->ch, cs); + /* Again, we can't complain here. The same logic applies. */ + if (!(cs & (CS_INT | CS_ERR))) return; - } if (cs & CS_ERR) { debug = bus_read_4(sc->sc_mem, BCM_DMA_DEBUG(ch->ch)); @@ -715,7 +715,7 @@ bcm_dma_attach(device_t dev) continue; sc->sc_irq[rid] = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_ACTIVE); + RF_ACTIVE | RF_SHAREABLE); if (sc->sc_irq[rid] == NULL) { device_printf(dev, "cannot allocate interrupt\n"); err = ENXIO; From owner-svn-src-head@freebsd.org Fri Nov 8 03:36:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ABB851A58CF; Fri, 8 Nov 2019 03:36:20 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478Qsw3mwRz3Jvt; Fri, 8 Nov 2019 03:36:20 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6418B2023F; Fri, 8 Nov 2019 03:36:20 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA83aKux016535; Fri, 8 Nov 2019 03:36:20 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA83aJZQ016532; Fri, 8 Nov 2019 03:36:19 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201911080336.xA83aJZQ016532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 8 Nov 2019 03:36:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354525 - in head/sys/powerpc: include mpc85xx ofw powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: include mpc85xx ofw powerpc X-SVN-Commit-Revision: 354525 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 03:36:20 -0000 Author: jhibbits Date: Fri Nov 8 03:36:19 2019 New Revision: 354525 URL: https://svnweb.freebsd.org/changeset/base/354525 Log: powerpc/mpc85xx: Add MSI support for Freescale PowerPC SoCs Freescale SoCs use a set of IRQs at the high end of the OpenPIC IRQ list, not counted in the NIRQs of the Feature reporting register. Some SoCs include a MSI inbound window in the PCIe controller configuration registers as well, but some don't. Currently, this only handles the SoCs *with* the MSI window. There are 256 MSIs per MSI bank (32 per MSI IRQ, 8 IRQs per MSI bank). The P5020 has 3 banks, yielding up to 768 MSIs; older SoCs have only one bank. Modified: head/sys/powerpc/include/openpicvar.h head/sys/powerpc/mpc85xx/pci_mpc85xx.c head/sys/powerpc/ofw/openpic_ofw.c head/sys/powerpc/powerpc/openpic.c Modified: head/sys/powerpc/include/openpicvar.h ============================================================================== --- head/sys/powerpc/include/openpicvar.h Fri Nov 8 03:27:56 2019 (r354524) +++ head/sys/powerpc/include/openpicvar.h Fri Nov 8 03:36:19 2019 (r354525) @@ -35,6 +35,7 @@ #define OPENPIC_IRQMAX 256 /* h/w allows more */ #define OPENPIC_QUIRK_SINGLE_BIND 1 /* Bind interrupts to only 1 CPU */ +#define OPENPIC_QUIRK_HIDDEN_IRQS 2 /* May have IRQs beyond FRR[NIRQ] */ /* Names match the macros in openpicreg.h. */ struct openpic_timer { Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_mpc85xx.c Fri Nov 8 03:27:56 2019 (r354524) +++ head/sys/powerpc/mpc85xx/pci_mpc85xx.c Fri Nov 8 03:36:19 2019 (r354525) @@ -51,8 +51,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include @@ -67,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include "ofw_bus_if.h" #include "pcib_if.h" +#include "pic_if.h" #include #include @@ -80,6 +83,12 @@ __FBSDID("$FreeBSD$"); #define REG_CFG_DATA 0x0004 #define REG_INT_ACK 0x0008 +#define REG_PEX_IP_BLK_REV1 0x0bf8 +#define IP_MJ_M 0x0000ff00 +#define IP_MJ_S 8 +#define IP_MN_M 0x000000ff +#define IP_MN_S 0 + #define REG_POTAR(n) (0x0c00 + 0x20 * (n)) #define REG_POTEAR(n) (0x0c04 + 0x20 * (n)) #define REG_POWBAR(n) (0x0c08 + 0x20 * (n)) @@ -89,6 +98,12 @@ __FBSDID("$FreeBSD$"); #define REG_PIWBAR(n) (0x0e08 - 0x20 * (n)) #define REG_PIWBEAR(n) (0x0e0c - 0x20 * (n)) #define REG_PIWAR(n) (0x0e10 - 0x20 * (n)) +#define PIWAR_EN 0x80000000 +#define PIWAR_PF 0x40000000 +#define PIWAR_TRGT_M 0x00f00000 +#define PIWAR_TRGT_S 20 +#define PIWAR_TRGT_CCSR 0xe +#define PIWAR_TRGT_LOCAL 0xf #define REG_PEX_MES_DR 0x0020 #define REG_PEX_MES_IER 0x0028 @@ -123,10 +138,14 @@ __FBSDID("$FreeBSD$"); #define DEVFN(b, s, f) ((b << 16) | (s << 8) | f) +#define FSL_NUM_MSIS 256 /* 8 registers of 32 bits (8 hardware IRQs) */ + struct fsl_pcib_softc { struct ofw_pci_softc pci_sc; device_t sc_dev; struct mtx sc_cfg_mtx; + int sc_ip_maj; + int sc_ip_min; int sc_iomem_target; bus_addr_t sc_iomem_start, sc_iomem_end; @@ -151,6 +170,14 @@ struct fsl_pcib_err_dr { uint32_t err_dr_mask; }; +struct fsl_msi_map { + SLIST_ENTRY(fsl_msi_map) slist; + uint32_t irq_base; + bus_addr_t target; +}; + +SLIST_HEAD(msi_head, fsl_msi_map) fsl_msis = SLIST_HEAD_INITIALIZER(msi_head); + static const struct fsl_pcib_err_dr pci_err[] = { {"ME", REG_PEX_ERR_DR_ME}, {"PCT", REG_PEX_ERR_DR_PCT}, @@ -195,7 +222,17 @@ static int fsl_pcib_maxslots(device_t); static uint32_t fsl_pcib_read_config(device_t, u_int, u_int, u_int, u_int, int); static void fsl_pcib_write_config(device_t, u_int, u_int, u_int, u_int, uint32_t, int); +static int fsl_pcib_alloc_msi(device_t dev, device_t child, + int count, int maxcount, int *irqs); +static int fsl_pcib_release_msi(device_t dev, device_t child, + int count, int *irqs); +static int fsl_pcib_alloc_msix(device_t dev, device_t child, int *irq); +static int fsl_pcib_release_msix(device_t dev, device_t child, int irq); +static int fsl_pcib_map_msi(device_t dev, device_t child, + int irq, uint64_t *addr, uint32_t *data); +static vmem_t *msi_vmem; /* Global MSI vmem, holds all MSI ranges. */ + /* * Bus interface definitions. */ @@ -209,6 +246,11 @@ static device_method_t fsl_pcib_methods[] = { DEVMETHOD(pcib_maxslots, fsl_pcib_maxslots), DEVMETHOD(pcib_read_config, fsl_pcib_read_config), DEVMETHOD(pcib_write_config, fsl_pcib_write_config), + DEVMETHOD(pcib_alloc_msi, fsl_pcib_alloc_msi), + DEVMETHOD(pcib_release_msi, fsl_pcib_release_msi), + DEVMETHOD(pcib_alloc_msix, fsl_pcib_alloc_msix), + DEVMETHOD(pcib_release_msix, fsl_pcib_release_msix), + DEVMETHOD(pcib_map_msi, fsl_pcib_map_msi), DEVMETHOD_END }; @@ -272,7 +314,7 @@ fsl_pcib_attach(device_t dev) { struct fsl_pcib_softc *sc; phandle_t node; - uint32_t cfgreg, brctl; + uint32_t cfgreg, brctl, ipreg; int error, rid; uint8_t ltssm, capptr; @@ -290,6 +332,9 @@ fsl_pcib_attach(device_t dev) sc->sc_bsh = rman_get_bushandle(sc->sc_res); sc->sc_busnr = 0; + ipreg = bus_read_4(sc->sc_res, REG_PEX_IP_BLK_REV1); + sc->sc_ip_min = (ipreg & IP_MN_M) >> IP_MN_S; + sc->sc_ip_maj = (ipreg & IP_MJ_M) >> IP_MJ_S; mtx_init(&sc->sc_cfg_mtx, "pcicfg", NULL, MTX_SPIN); cfgreg = fsl_pcib_cfgread(sc, 0, 0, 0, PCIR_VENDOR, 2); @@ -533,14 +578,16 @@ fsl_pcib_inbound(struct fsl_pcib_softc *sc, int wnd, i KASSERT(wnd > 0, ("%s: inbound window 0 is invalid", __func__)); + attr = PIWAR_EN; + switch (tgt) { - /* XXX OCP85XX_TGTIF_RAM2, OCP85XX_TGTIF_RAM_INTL should be handled */ - case OCP85XX_TGTIF_RAM1_85XX: - case OCP85XX_TGTIF_RAM1_QORIQ: - attr = 0xa0f55000 | (ffsl(size) - 2); + case -1: + attr &= ~PIWAR_EN; break; + case PIWAR_TRGT_LOCAL: + attr |= (ffsl(size) - 2); default: - attr = 0; + attr |= (tgt << PIWAR_TRGT_S); break; } tar = start >> 12; @@ -702,8 +749,209 @@ fsl_pcib_decode_win(phandle_t node, struct fsl_pcib_so fsl_pcib_inbound(sc, 1, -1, 0, 0, 0); fsl_pcib_inbound(sc, 2, -1, 0, 0, 0); - fsl_pcib_inbound(sc, 3, OCP85XX_TGTIF_RAM1, 0, - 2U * 1024U * 1024U * 1024U, 0); + fsl_pcib_inbound(sc, 3, PIWAR_TRGT_LOCAL, 0, + ptoa(Maxmem), 0); + /* Direct-map the CCSR for MSIs. */ + /* Freescale PCIe 2.x has a dedicated MSI window. */ + /* inbound window 8 makes it hit 0xD00 offset, the MSI window. */ + if (sc->sc_ip_maj >= 2) + fsl_pcib_inbound(sc, 8, PIWAR_TRGT_CCSR, ccsrbar_pa, + ccsrbar_size, ccsrbar_pa); + else + fsl_pcib_inbound(sc, 1, PIWAR_TRGT_CCSR, ccsrbar_pa, + ccsrbar_size, ccsrbar_pa); + return (0); } + +static int fsl_pcib_alloc_msi(device_t dev, device_t child, + int count, int maxcount, int *irqs) +{ + struct fsl_pcib_softc *sc; + vmem_addr_t start; + int err, i; + + sc = device_get_softc(dev); + if (msi_vmem == NULL) + return (ENODEV); + + err = vmem_xalloc(msi_vmem, count, powerof2(count), 0, 0, + VMEM_ADDR_MIN, VMEM_ADDR_MAX, M_BESTFIT | M_WAITOK, &start); + + if (err) + return (err); + + for (i = 0; i < count; i++) + irqs[i] = start + i; + + return (0); +} + +static int fsl_pcib_release_msi(device_t dev, device_t child, + int count, int *irqs) +{ + if (msi_vmem == NULL) + return (ENODEV); + + vmem_xfree(msi_vmem, irqs[0], count); + return (0); +} + +static int fsl_pcib_alloc_msix(device_t dev, device_t child, int *irq) +{ + return (fsl_pcib_alloc_msi(dev, child, 1, 1, irq)); +} + +static int fsl_pcib_release_msix(device_t dev, device_t child, int irq) +{ + return (fsl_pcib_release_msi(dev, child, 1, &irq)); +} + +static int fsl_pcib_map_msi(device_t dev, device_t child, + int irq, uint64_t *addr, uint32_t *data) +{ + struct fsl_msi_map *mp; + + SLIST_FOREACH(mp, &fsl_msis, slist) { + if (irq >= mp->irq_base && irq < mp->irq_base + FSL_NUM_MSIS) + break; + } + + if (mp == NULL) + return (ENODEV); + + *data = (irq & 255); + *addr = ccsrbar_pa + mp->target; + + return (0); +} + + +/* + * Linux device trees put the msi@ as children of the SoC, with ranges based + * on the CCSR. Since rman doesn't permit overlapping or sub-ranges between + * devices (bus_space_subregion(9) could do it, but let's not touch the PIC + * driver just to allocate a subregion for a sibling driver). This driver will + * use ccsr_write() and ccsr_read() instead. + */ + +#define FSL_NUM_IRQS 8 +#define FSL_NUM_MSI_PER_IRQ 32 +#define FSL_MSI_TARGET 0x140 + +struct fsl_msi_softc { + vm_offset_t sc_base; + vm_offset_t sc_target; + int sc_msi_base_irq; + struct fsl_msi_map sc_map; + struct fsl_msi_irq { + /* This struct gets passed as the filter private data. */ + struct fsl_msi_softc *sc_ptr; /* Pointer back to softc. */ + struct resource *res; + int irq; + void *cookie; + int vectors[FSL_NUM_MSI_PER_IRQ]; + vm_offset_t reg; + } sc_msi_irq[FSL_NUM_IRQS]; +}; + +static int +fsl_msi_intr_filter(void *priv) +{ + struct fsl_msi_irq *data = priv; + uint32_t reg; + int i; + + reg = ccsr_read4(ccsrbar_va + data->reg); + i = 0; + while (reg != 0) { + if (reg & 1) + powerpc_dispatch_intr(data->vectors[i], NULL); + reg >>= 1; + i++; + } + + return (FILTER_HANDLED); +} + +static int +fsl_msi_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "fsl,mpic-msi")) + return (ENXIO); + + device_set_desc(dev, "Freescale MSI"); + + return (BUS_PROBE_DEFAULT); +} + +static int +fsl_msi_attach(device_t dev) +{ + struct fsl_msi_softc *sc; + struct fsl_msi_irq *irq; + int i; + + sc = device_get_softc(dev); + + if (msi_vmem == NULL) + msi_vmem = vmem_create("MPIC MSI", 0, 0, 1, 1, M_BESTFIT | M_WAITOK); + + /* Manually play with resource entries. */ + sc->sc_base = bus_get_resource_start(dev, SYS_RES_MEMORY, 0); + sc->sc_map.target = bus_get_resource_start(dev, SYS_RES_MEMORY, 1); + + if (sc->sc_map.target == 0) + sc->sc_map.target = sc->sc_base + FSL_MSI_TARGET; + + for (i = 0; i < FSL_NUM_IRQS; i++) { + irq = &sc->sc_msi_irq[i]; + irq->irq = i; + irq->reg = sc->sc_base + 16 * i; + irq->res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &irq->irq, RF_ACTIVE); + bus_setup_intr(dev, irq->res, INTR_TYPE_MISC | INTR_MPSAFE, + fsl_msi_intr_filter, NULL, irq, &irq->cookie); + } + sc->sc_map.irq_base = powerpc_register_pic(dev, ofw_bus_get_node(dev), + FSL_NUM_MSIS, 0, 0); + + /* Let vmem and the IRQ subsystem work their magic for allocations. */ + vmem_add(msi_vmem, sc->sc_map.irq_base, FSL_NUM_MSIS, M_WAITOK); + + SLIST_INSERT_HEAD(&fsl_msis, &sc->sc_map, slist); + + return (0); +} + +static void +fsl_msi_enable(device_t dev, u_int irq, u_int vector, void **priv) +{ + struct fsl_msi_softc *sc; + struct fsl_msi_irq *irqd; + + sc = device_get_softc(dev); + + irqd = &sc->sc_msi_irq[irq / FSL_NUM_MSI_PER_IRQ]; + irqd->vectors[irq % FSL_NUM_MSI_PER_IRQ] = vector; +} + +static device_method_t fsl_msi_methods[] = { + DEVMETHOD(device_probe, fsl_msi_probe), + DEVMETHOD(device_attach, fsl_msi_attach), + + DEVMETHOD(pic_enable, fsl_msi_enable), + DEVMETHOD_END +}; + +static devclass_t fsl_msi_devclass; + +static driver_t fsl_msi_driver = { + "fsl_msi", + fsl_msi_methods, + sizeof(struct fsl_msi_softc) +}; + +EARLY_DRIVER_MODULE(fsl_msi, simplebus, fsl_msi_driver, fsl_msi_devclass, 0, 0, + BUS_PASS_INTERRUPT + 1); Modified: head/sys/powerpc/ofw/openpic_ofw.c ============================================================================== --- head/sys/powerpc/ofw/openpic_ofw.c Fri Nov 8 03:27:56 2019 (r354524) +++ head/sys/powerpc/ofw/openpic_ofw.c Fri Nov 8 03:36:19 2019 (r354525) @@ -139,8 +139,10 @@ openpic_ofw_attach(device_t dev) OF_getencprop(node, "linux,phandle", &xref, sizeof(xref)) == -1) xref = node; - if (ofw_bus_is_compatible(dev, "fsl,mpic")) + if (ofw_bus_is_compatible(dev, "fsl,mpic")) { sc->sc_quirks = OPENPIC_QUIRK_SINGLE_BIND; + sc->sc_quirks |= OPENPIC_QUIRK_HIDDEN_IRQS; + } return (openpic_common_attach(dev, xref)); } Modified: head/sys/powerpc/powerpc/openpic.c ============================================================================== --- head/sys/powerpc/powerpc/openpic.c Fri Nov 8 03:27:56 2019 (r354524) +++ head/sys/powerpc/powerpc/openpic.c Fri Nov 8 03:36:19 2019 (r354525) @@ -52,6 +52,8 @@ #include "pic_if.h" +#define OPENPIC_NIPIS 4 + devclass_t openpic_devclass; /* @@ -182,6 +184,14 @@ openpic_common_attach(device_t dev, uint32_t node) "Version %s, supports %d CPUs and %d irqs\n", sc->sc_version, sc->sc_ncpu, sc->sc_nirq); + /* + * Allow more IRQs than what the PIC says it handles. Some Freescale PICs + * have MSIs that show up above the PIC's self-described 196 IRQs + * (P5020 starts MSI IRQs at 224). + */ + if (sc->sc_quirks & OPENPIC_QUIRK_HIDDEN_IRQS) + sc->sc_nirq = OPENPIC_IRQMAX - OPENPIC_NIPIS; + for (cpu = 0; cpu < sc->sc_ncpu; cpu++) openpic_write(sc, OPENPIC_PCPU_TPR(cpu), 15); @@ -196,7 +206,7 @@ openpic_common_attach(device_t dev, uint32_t node) } /* Reset and disable all IPIs. */ - for (ipi = 0; ipi < 4; ipi++) { + for (ipi = 0; ipi < OPENPIC_NIPIS; ipi++) { x = sc->sc_nirq + ipi; x |= OPENPIC_IMASK; x |= 15 << OPENPIC_PRIORITY_SHIFT; @@ -221,7 +231,7 @@ openpic_common_attach(device_t dev, uint32_t node) for (cpu = 0; cpu < sc->sc_ncpu; cpu++) openpic_write(sc, OPENPIC_PCPU_TPR(cpu), 0); - powerpc_register_pic(dev, node, sc->sc_nirq, 4, FALSE); + powerpc_register_pic(dev, node, sc->sc_nirq, OPENPIC_NIPIS, FALSE); /* If this is not a cascaded PIC, it must be the root PIC */ if (sc->sc_intr == NULL) @@ -411,7 +421,7 @@ openpic_suspend(device_t dev) sc = device_get_softc(dev); sc->sc_saved_config = bus_read_4(sc->sc_memr, OPENPIC_CONFIG); - for (i = 0; i < 4; i++) { + for (i = 0; i < OPENPIC_NIPIS; i++) { sc->sc_saved_ipis[i] = bus_read_4(sc->sc_memr, OPENPIC_IPI_VECTOR(i)); } @@ -442,7 +452,7 @@ openpic_resume(device_t dev) sc = device_get_softc(dev); sc->sc_saved_config = bus_read_4(sc->sc_memr, OPENPIC_CONFIG); - for (i = 0; i < 4; i++) { + for (i = 0; i < OPENPIC_NIPIS; i++) { bus_write_4(sc->sc_memr, OPENPIC_IPI_VECTOR(i), sc->sc_saved_ipis[i]); } From owner-svn-src-head@freebsd.org Fri Nov 8 03:45:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 775F61A5DAA; Fri, 8 Nov 2019 03:45:14 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478R4B2CVBz3Kcq; Fri, 8 Nov 2019 03:45:14 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F36320409; Fri, 8 Nov 2019 03:45:14 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA83jErf022219; Fri, 8 Nov 2019 03:45:14 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA83jDhk022217; Fri, 8 Nov 2019 03:45:13 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201911080345.xA83jDhk022217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 8 Nov 2019 03:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354526 - in head/sys/powerpc: booke include X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: booke include X-SVN-Commit-Revision: 354526 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 03:45:14 -0000 Author: jhibbits Date: Fri Nov 8 03:45:13 2019 New Revision: 354526 URL: https://svnweb.freebsd.org/changeset/base/354526 Log: powerpc/booke: Make the TLB save area and mask match Since TLB_MAXNEST is 3, the insert mask should only be 2 bits. Given that 2 bits counts to 4, and that we already have plenty of space wasted in padding, make the nest level 4 to match the mask. Modified: head/sys/powerpc/booke/trap_subr.S head/sys/powerpc/include/pcpu.h Modified: head/sys/powerpc/booke/trap_subr.S ============================================================================== --- head/sys/powerpc/booke/trap_subr.S Fri Nov 8 03:36:19 2019 (r354525) +++ head/sys/powerpc/booke/trap_subr.S Fri Nov 8 03:45:13 2019 (r354526) @@ -365,14 +365,14 @@ ld %r30, (TLBSAVE_BOOKE_R30)(br); \ ld %r31, (TLBSAVE_BOOKE_R31)(br); #define TLB_NEST(outr,inr) \ - rlwinm outr, inr, 7, 22, 24; /* 8 x TLBSAVE_LEN */ + rlwinm outr, inr, 7, 23, 24; /* 8 x TLBSAVE_LEN */ #else #define TLB_SAVE_REGS(br) \ stmw %r20, TLBSAVE_BOOKE_R20(br) #define TLB_RESTORE_REGS(br) \ lmw %r20, TLBSAVE_BOOKE_R20(br) #define TLB_NEST(outr,inr) \ - rlwinm outr, inr, 6, 23, 25; /* 4 x TLBSAVE_LEN */ + rlwinm outr, inr, 6, 24, 25; /* 4 x TLBSAVE_LEN */ #endif #define TLB_PROLOG \ mtspr SPR_SPRG4, %r1; /* Save SP */ \ Modified: head/sys/powerpc/include/pcpu.h ============================================================================== --- head/sys/powerpc/include/pcpu.h Fri Nov 8 03:36:19 2019 (r354525) +++ head/sys/powerpc/include/pcpu.h Fri Nov 8 03:45:13 2019 (r354526) @@ -77,14 +77,14 @@ struct pvo_entry; #endif #define BOOKE_CRITSAVE_LEN (CPUSAVE_LEN + 2) -#define BOOKE_TLB_MAXNEST 3 +#define BOOKE_TLB_MAXNEST 4 #define BOOKE_TLB_SAVELEN 16 #define BOOKE_TLBSAVE_LEN (BOOKE_TLB_SAVELEN * BOOKE_TLB_MAXNEST) #ifdef __powerpc64__ #define BOOKE_PCPU_PAD 901 #else -#define BOOKE_PCPU_PAD 429 +#define BOOKE_PCPU_PAD 365 #endif #define PCPU_MD_BOOKE_FIELDS \ register_t critsave[BOOKE_CRITSAVE_LEN]; \ From owner-svn-src-head@freebsd.org Fri Nov 8 04:26:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D62A81A6A92; Fri, 8 Nov 2019 04:26:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478Rzb5Kj6z3MSf; Fri, 8 Nov 2019 04:26:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B31E20B25; Fri, 8 Nov 2019 04:26:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA84QJKG046506; Fri, 8 Nov 2019 04:26:19 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA84QJrM046505; Fri, 8 Nov 2019 04:26:19 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201911080426.xA84QJrM046505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 8 Nov 2019 04:26:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354527 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 354527 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 04:26:19 -0000 Author: jhibbits Date: Fri Nov 8 04:26:19 2019 New Revision: 354527 URL: https://svnweb.freebsd.org/changeset/base/354527 Log: powerpc/booke: Only handle kernel page faults in KVA range The memory range between VM_MAXUSER_ADDRESS and VM_MIN_KERNEL_ADDRESS is reserved for devices currently, which are always mapped in TLB1, and therefore do not exist in the kernel page table. Any page fault in this range is therefore automatically a fatal fault. Modified: head/sys/powerpc/booke/trap_subr.S Modified: head/sys/powerpc/booke/trap_subr.S ============================================================================== --- head/sys/powerpc/booke/trap_subr.S Fri Nov 8 03:45:13 2019 (r354526) +++ head/sys/powerpc/booke/trap_subr.S Fri Nov 8 04:26:19 2019 (r354527) @@ -713,6 +713,15 @@ INTERRUPT(int_data_tlb_error) mtcr %r21 bt 17, search_failed /* check MSR[PR] */ +#ifdef __powerpc64__ + srdi %r21, %r31, 48 + cmpldi cr0, %r21, VM_MIN_KERNEL_ADDRESS@highest +#else + lis %r21, VM_MIN_KERNEL_ADDRESS@h + cmplw cr0, %r31, %r21 +#endif + blt search_failed + search_kernel_pmap: /* Load r26 with kernel_pmap address */ bl 1f From owner-svn-src-head@freebsd.org Fri Nov 8 06:40:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 504C61A8CB4; Fri, 8 Nov 2019 06:40:18 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478VyB1SWHz3xJ1; Fri, 8 Nov 2019 06:40:18 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13E3922210; Fri, 8 Nov 2019 06:40:18 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA86eHNW022708; Fri, 8 Nov 2019 06:40:17 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA86eHMw022707; Fri, 8 Nov 2019 06:40:17 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201911080640.xA86eHMw022707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 8 Nov 2019 06:40:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354528 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 354528 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 06:40:18 -0000 Author: rmacklem Date: Fri Nov 8 06:40:17 2019 New Revision: 354528 URL: https://svnweb.freebsd.org/changeset/base/354528 Log: Fix the man page to correctly describe the use of the "len" argument. The man page incorrectly described the use of the"len" argument, which is updated to the number of bytes copied and not reduced by the number of bytes copied. This is a content change. Modified: head/share/man/man9/VOP_COPY_FILE_RANGE.9 Modified: head/share/man/man9/VOP_COPY_FILE_RANGE.9 ============================================================================== --- head/share/man/man9/VOP_COPY_FILE_RANGE.9 Fri Nov 8 04:26:19 2019 (r354527) +++ head/share/man/man9/VOP_COPY_FILE_RANGE.9 Fri Nov 8 06:40:17 2019 (r354528) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 2019 +.Dd November 7, 2019 .Dt VOP_COPY_FILE_RANGE 9 .Os .Sh NAME @@ -60,7 +60,7 @@ The vnode of the output file. .It Fa outoff A pointer to the file offset for the output file. .It Fa len -A pointer to the number of bytes to be copied. +A pointer to the byte count for the copy. .It Fa flags Flags, should be set to 0 for now. .It Fa incred @@ -89,11 +89,11 @@ The .Fa len argument points to the location that stores the number of bytes to be copied. -It should be reduced by the number of bytes copied, which implies that -the value pointed to by +Upon a successful return .Fa len -will normally be zero for a non-error return. -However, a copy of fewer bytes than requested is permitted. +will be updated to the number of bytes actually copied. +Normally, this will be the number of bytes requested to be copied, +however a copy of fewer bytes than requested is permitted. .Sh LOCKS The vnode are unlocked on entry and must be unlocked on return. The byte ranges for both From owner-svn-src-head@freebsd.org Fri Nov 8 11:09:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9BD741AEB35; Fri, 8 Nov 2019 11:09:51 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478cxC3cVzz4C17; Fri, 8 Nov 2019 11:09:51 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 603A025214; Fri, 8 Nov 2019 11:09:51 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8B9p5v094516; Fri, 8 Nov 2019 11:09:51 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8B9p20094515; Fri, 8 Nov 2019 11:09:51 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201911081109.xA8B9p20094515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 8 Nov 2019 11:09:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354533 - head/usr.bin/vmstat X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.bin/vmstat X-SVN-Commit-Revision: 354533 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 11:09:51 -0000 Author: trasz Date: Fri Nov 8 11:09:50 2019 New Revision: 354533 URL: https://svnweb.freebsd.org/changeset/base/354533 Log: Humanize more columns in the vmstat(8) output and adjust widths. The few columns that are not humanized are usually 0. This makes the output mostly aligned. Reviewed by: allanjude MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D22185 Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Fri Nov 8 07:56:14 2019 (r354532) +++ head/usr.bin/vmstat/vmstat.c Fri Nov 8 11:09:50 2019 (r354533) @@ -646,9 +646,8 @@ getcpuinfo(u_long *maskp, int *maxidp) static void -prthuman(const char *name, uint64_t val, int size) +prthuman(const char *name, uint64_t val, int size, int flags) { - int flags; char buf[10]; char fmt[128]; @@ -656,7 +655,7 @@ prthuman(const char *name, uint64_t val, int size) if (size < 5 || size > 9) xo_errx(1, "doofus"); - flags = HN_B | HN_NOSPACE | HN_DECIMAL; + flags |= HN_NOSPACE | HN_DECIMAL; humanize_number(buf, size, val, "", HN_AUTOSCALE, flags); xo_attr("value", "%ju", (uintmax_t) val); xo_emit(fmt, size, buf); @@ -784,20 +783,21 @@ dovmstat(unsigned int interval, int reps) fill_vmmeter(&sum); fill_vmtotal(&total); xo_open_container("processes"); - xo_emit("{:runnable/%1d} {:waiting/%ld} " - "{:swapped-out/%ld}", total.t_rq - 1, total.t_dw + + xo_emit("{:runnable/%2d} {:waiting/%2ld} " + "{:swapped-out/%2ld}", total.t_rq - 1, total.t_dw + total.t_pw, total.t_sw); xo_close_container("processes"); xo_open_container("memory"); #define vmstat_pgtok(a) ((uintmax_t)(a) * (sum.v_page_size >> 10)) #define rate(x) (((x) * rate_adj + halfuptime) / uptime) /* round */ if (hflag) { - xo_emit(""); prthuman("available-memory", - total.t_avm * (uint64_t)sum.v_page_size, 5); - xo_emit(" "); + total.t_avm * (uint64_t)sum.v_page_size, 5, HN_B); prthuman("free-memory", - total.t_free * (uint64_t)sum.v_page_size, 5); + total.t_free * (uint64_t)sum.v_page_size, 5, HN_B); + prthuman("total-page-faults", + (unsigned long)rate(sum.v_vm_faults - + osum.v_vm_faults), 5, 0); xo_emit(" "); } else { xo_emit(" "); @@ -807,10 +807,10 @@ dovmstat(unsigned int interval, int reps) xo_emit("{:free-memory/%7ju}", vmstat_pgtok(total.t_free)); xo_emit(" "); + xo_emit("{:total-page-faults/%5lu} ", + (unsigned long)rate(sum.v_vm_faults - + osum.v_vm_faults)); } - xo_emit("{:total-page-faults/%5lu} ", - (unsigned long)rate(sum.v_vm_faults - - osum.v_vm_faults)); xo_close_container("memory"); xo_open_container("paging-rates"); @@ -820,22 +820,44 @@ dovmstat(unsigned int interval, int reps) xo_emit("{:paged-in/%3lu} ", (unsigned long)rate(sum.v_swapin + sum.v_vnodein - (osum.v_swapin + osum.v_vnodein))); - xo_emit("{:paged-out/%3lu} ", + xo_emit("{:paged-out/%3lu}", (unsigned long)rate(sum.v_swapout + sum.v_vnodeout - (osum.v_swapout + osum.v_vnodeout))); - xo_emit("{:freed/%5lu} ", - (unsigned long)rate(sum.v_tfree - osum.v_tfree)); - xo_emit("{:scanned/%4lu} ", - (unsigned long)rate(sum.v_pdpages - osum.v_pdpages)); + if (hflag) { + prthuman("freed", + (unsigned long)rate(sum.v_tfree - osum.v_tfree), + 5, 0); + prthuman("scanned", + (unsigned long)rate(sum.v_pdpages - osum.v_pdpages), + 5, 0); + xo_emit(" "); + } else { + xo_emit(" "); + xo_emit("{:freed/%5lu} ", + (unsigned long)rate(sum.v_tfree - osum.v_tfree)); + xo_emit("{:scanned/%4lu} ", + (unsigned long)rate(sum.v_pdpages - osum.v_pdpages)); + } xo_close_container("paging-rates"); devstats(); xo_open_container("fault-rates"); - xo_emit("{:interrupts/%4lu} {:system-calls/%5lu} " - "{:context-switches/%5lu}", - (unsigned long)rate(sum.v_intr - osum.v_intr), - (unsigned long)rate(sum.v_syscall - osum.v_syscall), - (unsigned long)rate(sum.v_swtch - osum.v_swtch)); + xo_emit("{:interrupts/%4lu}", + (unsigned long)rate(sum.v_intr - osum.v_intr)); + if (hflag) { + prthuman("system-calls", + (unsigned long)rate(sum.v_syscall - osum.v_syscall), + 5, 0); + prthuman("context-switches", + (unsigned long)rate(sum.v_swtch - osum.v_swtch), + 5, 0); + } else { + xo_emit(" "); + xo_emit("{:system-calls/%5lu} " + "{:context-switches/%5lu}", + (unsigned long)rate(sum.v_syscall - osum.v_syscall), + (unsigned long)rate(sum.v_swtch - osum.v_swtch)); + } xo_close_container("fault-rates"); if (Pflag) pcpustats(cpumask, maxid); @@ -867,14 +889,14 @@ printhdr(int maxid, u_long cpumask) num_shown = MIN(num_selected, maxshowdevs); if (hflag) - xo_emit("{T:procs} {T:memory} {T:/page%*s}", 19, ""); + xo_emit(" {T:procs} {T:memory} {T:/page%*s}", 19, ""); else xo_emit("{T:procs} {T:memory} {T:/page%*s}", 19, ""); if (num_shown > 1) - xo_emit(" {T:/disks %*s}", num_shown * 4 - 7, ""); + xo_emit(" {T:/disks %*s} ", num_shown * 4 - 7, ""); else if (num_shown == 1) xo_emit(" {T:disks}"); - xo_emit(" {T:faults} "); + xo_emit(" {T:faults} "); if (Pflag) { for (i = 0; i <= maxid; i++) { if (cpumask & (1ul << i)) @@ -882,10 +904,10 @@ printhdr(int maxid, u_long cpumask) } xo_emit("\n"); } else - xo_emit(" {T:cpu}\n"); + xo_emit(" {T:cpu}\n"); if (hflag) { - xo_emit("{T:r} {T:b} {T:w} {T:avm} {T:fre} {T:flt} {T:re}" - " {T:pi} {T:po} {T:fr} {T:sr} "); + xo_emit(" {T:r} {T:b} {T:w} {T:avm} {T:fre} {T:flt} {T:re}" + " {T:pi} {T:po} {T:fr} {T:sr} "); } else { xo_emit("{T:r} {T:b} {T:w} {T:avm} {T:fre} {T:flt} " "{T:re} {T:pi} {T:po} {T:fr} {T:sr} "); @@ -896,7 +918,7 @@ printhdr(int maxid, u_long cpumask) xo_emit("{T:/%c%c%d} ", dev_select[i].device_name[0], dev_select[i].device_name[1], dev_select[i].unit_number); - xo_emit(" {T:in} {T:sy} {T:cs}"); + xo_emit(" {T:in} {T:sy} {T:cs}"); if (Pflag) { for (i = 0; i <= maxid; i++) { if (cpumask & (1ul << i)) From owner-svn-src-head@freebsd.org Fri Nov 8 11:51:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 372321AF70E; Fri, 8 Nov 2019 11:51:24 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478ds71VXgz4F56; Fri, 8 Nov 2019 11:51:22 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f180.google.com with SMTP id y23so5875130ljh.10; Fri, 08 Nov 2019 03:51:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=B/YYJZwnl/Us6rulHFaHppdyWEpAT6SL501jvPGLvLs=; b=nUf/8t+B9VNtGMb3wz6VIe2BHIBfK8KBoj50nsdZ9G5JxypFFqJW6NmnX6/WaHRXzy FVQh9QHq8F7syuZDz8HnAEAuYUA1uu179wVOjE2H7kzOFxCZZbNOE705PCp6hhA54cjb +6qJ4kJzIwxRczs/uOM8ersaHu12jg5BNM37PAghnomiCkF3hTDJsYqBtbQOge80AIeb tjIkEbKiB1UGCrTe1ZhdvYIeyJItV8aYFor2GDBW8W8hHxZaSbYV27PWXX7r0XRol9B4 tmCGQBnmnN6Lmx5Gbf/OoWCHSHwd2yNbhj0rfAQQc6+QHXAhmphppFaSPr2T3cx3mu4v G4jw== X-Gm-Message-State: APjAAAU+KQnLGOJoDrvp8FAYgUqHVfx19VPLnrLRLYE4lJNK/FsdoNn8 3vWGYc+4wfK0gNr86lry1khtovCtSSo= X-Google-Smtp-Source: APXvYqxNFFY4CoAutlQ3qjkH249A1d4JOQNa+o43dFUrw8bj3PFceU2XTWSQexX6Bl/K+CYnBf0GQw== X-Received: by 2002:a2e:6a19:: with SMTP id f25mr6551085ljc.147.1573213880851; Fri, 08 Nov 2019 03:51:20 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id u2sm6509525ljg.34.2019.11.08.03.51.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Nov 2019 03:51:19 -0800 (PST) Subject: Re: svn commit: r354482 - head/sys/x86/x86 To: Colin Percival , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201911072114.xA7LExVP090362@repo.freebsd.org> <0100016e47bc3e05-560c061d-ef2e-41b1-9166-20d80cb6b81d-000000@email.amazonses.com> <69cbaec6-5799-9640-89bd-bdb5b6ae9843@FreeBSD.org> <0100016e47e589be-1ed635b1-6701-43a8-88f7-79726e4bc036-000000@email.amazonses.com> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <1d4ff16f-2c0c-8939-4876-4ceb0044d359@FreeBSD.org> Date: Fri, 8 Nov 2019 13:51:18 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <0100016e47e589be-1ed635b1-6701-43a8-88f7-79726e4bc036-000000@email.amazonses.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 478ds71VXgz4F56 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.208.180 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-3.13 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; RCVD_TLS_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[180.208.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; IP_SCORE(-1.13)[ip: (-0.39), ipnet: 209.85.128.0/17(-3.20), asn: 15169(-2.01), country: US(-0.05)]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[180.208.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[96.151.72.93.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 11:51:24 -0000 On 08/11/2019 00:04, Colin Percival wrote: > On 2019-11-07 13:34, Andriy Gapon wrote: >> On 07/11/2019 23:19, Colin Percival wrote: >>> On 2019-11-07 13:14, Andriy Gapon wrote: >>>> x86 stack_save_td_running() can work safely only if IPI_TRACE is a >>>> non-maskable interrupt. But at the moment FreeBSD/Xen does not provide >>>> support for the NMI delivery mode. So, mark the functionality as >>>> unsupported similarly to other platforms without NMI. >>>> [...] >>>> +#ifdef XENHVM >>> >>> I'm not sure this does what you intended. XENHVM simply adds *support* for >>> running under Xen/HVM, and it's part of the GENERIC kernel. >> >> Oh... I should not have rushed. >> So, I should really check for a run-time Xen marker? > > I'm guessing that you want > > #include > > ... > > if (vm_guest == VM_GUEST_XEN) > return (EOPNOTSUPP); > Colin, thank you again. But it seems that adding NMI support to a type of guest which is FreeBSD turned out to be much easier than I imagined. In fact, Roger (royger@) has already come up with a patch. I will be testing it soon. -- Andriy Gapon From owner-svn-src-head@freebsd.org Fri Nov 8 12:19:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2771C1B0B47; Fri, 8 Nov 2019 12:19:04 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478fT40C5rz4HT2; Fri, 8 Nov 2019 12:19:04 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D972D25E6B; Fri, 8 Nov 2019 12:19:03 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8CJ3hq041341; Fri, 8 Nov 2019 12:19:03 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8CJ3q8041340; Fri, 8 Nov 2019 12:19:03 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201911081219.xA8CJ3q8041340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 8 Nov 2019 12:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354535 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 354535 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 12:19:04 -0000 Author: tsoome Date: Fri Nov 8 12:19:03 2019 New Revision: 354535 URL: https://svnweb.freebsd.org/changeset/base/354535 Log: cstyle cleanup for i386_copy.c No functional changes are intended. Modified: head/stand/i386/libi386/i386_copy.c Modified: head/stand/i386/libi386/i386_copy.c ============================================================================== --- head/stand/i386/libi386/i386_copy.c Fri Nov 8 12:06:03 2019 (r354534) +++ head/stand/i386/libi386/i386_copy.c Fri Nov 8 12:19:03 2019 (r354535) @@ -40,25 +40,25 @@ __FBSDID("$FreeBSD$"); ssize_t i386_copyin(const void *src, vm_offset_t dest, const size_t len) { - if (dest + len >= memtop) { - errno = EFBIG; - return(-1); - } + if (dest + len >= memtop) { + errno = EFBIG; + return (-1); + } - bcopy(src, PTOV(dest), len); - return(len); + bcopy(src, PTOV(dest), len); + return (len); } ssize_t i386_copyout(const vm_offset_t src, void *dest, const size_t len) { - if (src + len >= memtop) { - errno = EFBIG; - return(-1); - } - - bcopy(PTOV(src), dest, len); - return(len); + if (src + len >= memtop) { + errno = EFBIG; + return (-1); + } + + bcopy(PTOV(src), dest, len); + return (len); } @@ -66,10 +66,10 @@ ssize_t i386_readin(const int fd, vm_offset_t dest, const size_t len) { - if (dest + len >= memtop_copyin) { - errno = EFBIG; - return(-1); - } + if (dest + len >= memtop_copyin) { + errno = EFBIG; + return (-1); + } - return (read(fd, PTOV(dest), len)); + return (read(fd, PTOV(dest), len)); } From owner-svn-src-head@freebsd.org Fri Nov 8 14:06:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 87FF31B38CC; Fri, 8 Nov 2019 14:06:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478hsP2yfhz4PYN; Fri, 8 Nov 2019 14:06:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48E6627203; Fri, 8 Nov 2019 14:06:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8E6nLB014544; Fri, 8 Nov 2019 14:06:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8E6nUa014543; Fri, 8 Nov 2019 14:06:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911081406.xA8E6nUa014543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 8 Nov 2019 14:06:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354536 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 354536 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 14:06:49 -0000 Author: emaste Date: Fri Nov 8 14:06:48 2019 New Revision: 354536 URL: https://svnweb.freebsd.org/changeset/base/354536 Log: suggest xtoolchain package if binutils and GCC bootstraps are both broken Previously we checked for only BINUTILS_BOOTSTRAP as a broken option and suggested installing the binutils package. This was originally done for arm64 where we used the in-tree Clang with external binutils package. Add a case to the warning to suggest instead the full xtoolchain package if we have no in-tree compiler either. Differential Revision: https://reviews.freebsd.org/D21851 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Nov 8 12:19:03 2019 (r354535) +++ head/Makefile.inc1 Fri Nov 8 14:06:48 2019 (r354536) @@ -189,7 +189,11 @@ CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} !defined(CROSS_BINUTILS_PREFIX) CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_TRIPLE}/bin/ .if !exists(${CROSS_BINUTILS_PREFIX}) +.if !empty(BROKEN_OPTIONS:MGCC_BOOTSTRAP) && ${MK_CLANG_BOOTSTRAP} == "no" +.error In-tree toolchain does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-xtoolchain-gcc port or package or set CROSS_TOOLCHAIN_PREFIX. +.else .error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX. +.endif .endif .endif .endif From owner-svn-src-head@freebsd.org Fri Nov 8 14:11:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D02B21B3A11; Fri, 8 Nov 2019 14:11:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478hyj5BT3z4PtV; Fri, 8 Nov 2019 14:11:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9601627267; Fri, 8 Nov 2019 14:11:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8EBP0o018540; Fri, 8 Nov 2019 14:11:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8EBPF9018539; Fri, 8 Nov 2019 14:11:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911081411.xA8EBPF9018539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 8 Nov 2019 14:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354537 - head/sbin/newfs_msdos X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sbin/newfs_msdos X-SVN-Commit-Revision: 354537 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 14:11:25 -0000 Author: emaste Date: Fri Nov 8 14:11:25 2019 New Revision: 354537 URL: https://svnweb.freebsd.org/changeset/base/354537 Log: makefs: avoid warning when creating FAT filesystem on existing file Previously the mkfs_msdos function (from newfs_msdos) emitted warnings in the case that an image size is specified and the target is not a file, or no size is specified and the target is not a character device. The latter warning (not a character device) doesn't make sense when this code is used in makefs, regardless of whether an image size is specified or not. Sponsored by: The FreeBSD Foundation Modified: head/sbin/newfs_msdos/mkfs_msdos.c Modified: head/sbin/newfs_msdos/mkfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/mkfs_msdos.c Fri Nov 8 14:06:48 2019 (r354536) +++ head/sbin/newfs_msdos/mkfs_msdos.c Fri Nov 8 14:11:25 2019 (r354537) @@ -285,8 +285,10 @@ mkfs_msdos(const char *fname, const char *dtype, const if (!S_ISREG(sb.st_mode)) warnx("warning, %s is not a regular file", fname); } else { +#ifndef MAKEFS if (!S_ISCHR(sb.st_mode)) warnx("warning, %s is not a character device", fname); +#endif } if (!o.no_create) if (check_mounted(fname, sb.st_mode) == -1) From owner-svn-src-head@freebsd.org Fri Nov 8 14:17:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56FCB1B3DC5; Fri, 8 Nov 2019 14:17:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478j5f1r4qz4QJr; Fri, 8 Nov 2019 14:17:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 221F3273CE; Fri, 8 Nov 2019 14:17:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8EHQn5020971; Fri, 8 Nov 2019 14:17:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8EHQi5020970; Fri, 8 Nov 2019 14:17:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911081417.xA8EHQi5020970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 8 Nov 2019 14:17:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354538 - head/sys/arm/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm/linux X-SVN-Commit-Revision: 354538 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 14:17:26 -0000 Author: emaste Date: Fri Nov 8 14:17:25 2019 New Revision: 354538 URL: https://svnweb.freebsd.org/changeset/base/354538 Log: arm linuxulator: add syscalls definition From Linux arch/arm/kernel/call.S Reviewed by: imp (earlier) Submitted by: Grégory Soutadé Differential Revision: https://reviews.freebsd.org/D7972 Added: head/sys/arm/linux/ head/sys/arm/linux/syscalls.master (contents, props changed) Added: head/sys/arm/linux/syscalls.master ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/linux/syscalls.master Fri Nov 8 14:17:25 2019 (r354538) @@ -0,0 +1,673 @@ + $FreeBSD$ + +; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 +; System call name/number master file (or rather, slave, from LINUX). +; Processed to create linux_sysent.c, linux_proto.h and linux_syscall.h. + +; Columns: number audit type nargs name alt{name,tag,rtyp}/comments +; number system call number, must be in order +; audit the audit event associated with the system call +; A value of AUE_NULL means no auditing, but it also means that +; there is no audit event for the call at this time. For the +; case where the event exists, but we don't want auditing, the +; event should be #defined to AUE_NULL in audit_kevents.h. +; type one of STD, OBSOL, UNIMPL +; name psuedo-prototype of syscall routine +; If one of the following alts is different, then all appear: +; altname name of system call if different +; alttag name of args struct tag if different from [o]`name'"_args" +; altrtyp return type if not int (bogus - syscalls always return int) +; for UNIMPL/OBSOL, name continues with comments + +; types: +; STD always included +; OBSOL obsolete, not included in system, only specifies name +; UNIMPL not implemented, placeholder only + +#include +#include +#include +#include +#include +#include + +; Isn't pretty, but there seems to be no other way to trap nosys +#define nosys linux_nosys + +; #ifdef's, etc. may be included, and are copied to the output files. + +0 AUE_NULL UNIMPL setup +1 AUE_EXIT STD { void linux_exit(int rval); } +2 AUE_FORK STD { int linux_fork(void); } +3 AUE_NULL NOPROTO { int read(int fd, char *buf, \ + u_int nbyte); } +4 AUE_NULL NOPROTO { int write(int fd, char *buf, \ + u_int nbyte); } +5 AUE_OPEN_RWTC STD { int linux_open(char *path, l_int flags, \ + l_int mode); } +6 AUE_CLOSE NOPROTO { int close(int fd); } +7 AUE_NULL UNIMPL ; was linux_waitpid +8 AUE_CREAT STD { int linux_creat(char *path, \ + l_int mode); } +9 AUE_LINK STD { int linux_link(char *path, char *to); } +10 AUE_UNLINK STD { int linux_unlink(char *path); } +11 AUE_EXECVE STD { int linux_execve(char *path, char **argp, \ + char **envp); } +12 AUE_CHDIR STD { int linux_chdir(char *path); } +13 AUE_NULL UNIMPL ; was OBSOLETE(linux_time) +14 AUE_MKNOD STD { int linux_mknod(char *path, l_int mode, \ + l_dev_t dev); } +15 AUE_CHMOD STD { int linux_chmod(char *path, \ + l_mode_t mode); } +16 AUE_LCHOWN STD { int linux_lchown16(char *path, \ + l_uid16_t uid, l_gid16_t gid); } +17 AUE_NULL UNIMPL ; was linux_break +18 AUE_NULL UNIMPL ; was linux_stat +19 AUE_LSEEK STD { int linux_lseek(l_uint fdes, l_off_t off, \ + l_int whence); } +20 AUE_GETPID STD { int linux_getpid(void); } +21 AUE_MOUNT STD { int linux_mount(char *specialfile, \ + char *dir, char *filesystemtype, \ + l_ulong rwflag, void *data); } +22 AUE_NULL UNIMPL ; was OBSOLETE(linux_oldumount) +23 AUE_SETUID STD { int linux_setuid16(l_uid16_t uid); } +24 AUE_GETUID STD { int linux_getuid16(void); } +25 AUE_NULL UNIMPL ; was OBSOLETE(linux_stime) +26 AUE_PTRACE UNIMPL ptrace +27 AUE_NULL UNIMPL ; was OBSOLETE(linux_alarm) +28 AUE_NULL UNIMPL ; was linux_fstat +29 AUE_NULL STD { int linux_pause(void); } +30 AUE_NULL UNIMPL ; was OBSOLETE(linux_utime) +31 AUE_NULL UNIMPL ; was linux_stty +32 AUE_NULL UNIMPL ; was linux_getty +33 AUE_ACCESS STD { int linux_access(char *path, l_int amode); } +34 AUE_NICE STD { int linux_nice(l_int inc); } +35 AUE_NULL UNIMPL ; was linux_ftime +36 AUE_SYNC NOPROTO { int sync(void); } +37 AUE_KILL STD { int linux_kill(l_int pid, l_int signum); } +38 AUE_RENAME STD { int linux_rename(char *from, char *to); } +39 AUE_MKDIR STD { int linux_mkdir(char *path, l_int mode); } +40 AUE_RMDIR STD { int linux_rmdir(char *path); } +41 AUE_DUP NOPROTO { int dup(u_int fd); } +42 AUE_PIPE STD { int linux_pipe(l_int *pipefds); } +43 AUE_NULL STD { int linux_times(struct l_times_argv *buf); } +44 AUE_NULL UNIMPL ; was linux_prof +45 AUE_NULL STD { int linux_brk(l_ulong dsend); } +46 AUE_SETGID STD { int linux_setgid16(l_gid16_t gid); } +47 AUE_GETGID STD { int linux_getgid16(void); } +48 AUE_NULL UNIMPL ; was linux_signal +49 AUE_GETEUID STD { int linux_geteuid16(void); } +50 AUE_GETEGID STD { int linux_getegid16(void); } +51 AUE_ACCT NOPROTO { int acct(char *path); } +52 AUE_UMOUNT STD { int linux_umount(char *path, l_int flags); } +53 AUE_NULL UNIMPL ; was linux_lock +54 AUE_IOCTL STD { int linux_ioctl(l_uint fd, l_uint cmd, \ + l_ulong arg); } +55 AUE_FCNTL STD { int linux_fcntl(l_uint fd, l_uint cmd, \ + l_ulong arg); } +56 AUE_NULL UNIMPL ; was linux_mpx +57 AUE_SETPGRP NOPROTO { int setpgid(int pid, int pgid); } +58 AUE_NULL UNIMPL ; was linux_ulimit +59 AUE_NULL UNIMPL ; was linux_olduname +60 AUE_UMASK NOPROTO { int umask(int newmask); } +61 AUE_CHROOT NOPROTO { int chroot(char *path); } +62 AUE_NULL STD { int linux_ustat(l_dev_t dev, \ + struct l_ustat *ubuf); } +63 AUE_DUP2 NOPROTO { int dup2(u_int from, u_int to); } +64 AUE_GETPPID STD { int linux_getppid(void); } +65 AUE_GETPGRP NOPROTO { int getpgrp(void); } +66 AUE_SETSID NOPROTO { int setsid(void); } +67 AUE_NULL STD { int linux_sigaction(l_int sig, \ + l_osigaction_t *nsa, \ + l_osigaction_t *osa); } +68 AUE_NULL UNIMPL ; was linux_sgetmask +69 AUE_NULL UNIMPL ; was linux_ssetmask +70 AUE_SETREUID STD { int linux_setreuid16(l_uid16_t ruid, \ + l_uid16_t euid); } +71 AUE_SETREGID STD { int linux_setregid16(l_gid16_t rgid, \ + l_gid16_t egid); } +72 AUE_NULL STD { int linux_sigsuspend(l_int hist0, \ + l_int hist1, l_osigset_t mask); } +73 AUE_NULL STD { int linux_sigpending(l_osigset_t *mask); } +74 AUE_SYSCTL STD { int linux_sethostname(char *hostname, \ + u_int len); } +75 AUE_SETRLIMIT STD { int linux_setrlimit(l_uint resource, \ + struct l_rlimit *rlim); } +76 AUE_NULL UNIMPL ; was OBSOLETE(linux_old_getrlimit) +77 AUE_GETRUSAGE NOPROTO { int getrusage(int who, \ + struct rusage *rusage); } +78 AUE_GETTIMEOFDAY STD { int linux_gettimeofday( \ + struct timeval32 *tp, \ + struct timezone *tzp); } +79 AUE_SETTIMEOFDAY STD { int linux_settimeofday( \ + struct timeval32 *tp, \ + struct timezone *tzp); } +80 AUE_GETGROUPS STD { int linux_getgroups16(l_uint gidsetsize, \ + l_gid16_t *gidset); } +81 AUE_SETGROUPS STD { int linux_setgroups16(l_uint gidsetsize, \ + l_gid16_t *gidset); } +82 AUE_NULL UNIMPL ; was OBSOLETE(linux_old_select) +83 AUE_SYMLINK STD { int linux_symlink(char *path, char *to); } +84 AUE_NULL UNIMPL ; was linux_lstat +85 AUE_READLINK STD { int linux_readlink(char *name, char *buf, \ + l_int count); } +86 AUE_NULL UNIMPL uselib +87 AUE_SWAPON NOPROTO { int swapon(char *name); } +88 AUE_REBOOT STD { int linux_reboot(l_int magic1, \ + l_int magic2, l_uint cmd, void *arg); } +89 AUE_NULL UNIMPL ; was OBSOLETE(linux_old_readdir) +90 AUE_NULL UNIMPL ; was OBSOLETE(linux_old_mmap) +91 AUE_MUNMAP NOPROTO { int munmap(caddr_t addr, int len); } +92 AUE_TRUNCATE STD { int linux_truncate(char *path, \ + l_ulong length); } +93 AUE_FTRUNCATE STD { int linux_ftruncate(int fd, long length); } +94 AUE_FCHMOD NOPROTO { int fchmod(int fd, int mode); } +95 AUE_FCHOWN NOPROTO { int fchown(int fd, int uid, int gid); } +96 AUE_GETPRIORITY STD { int linux_getpriority(int which, int who); } +97 AUE_SETPRIORITY NOPROTO { int setpriority(int which, int who, \ + int prio); } +98 AUE_NULL UNIMPL ; was linux_profil +99 AUE_STATFS STD { int linux_statfs(char *path, \ + struct l_statfs_buf *buf); } +100 AUE_FSTATFS STD { int linux_fstatfs(l_uint fd, \ + struct l_statfs_buf *buf); } +101 AUE_NULL UNIMPL ; was ioperm +102 AUE_NULL UNIMPL ; was OBSOLETE(linux_socketcall) +103 AUE_NULL STD { int linux_syslog(l_int type, char *buf, \ + l_int len); } +104 AUE_SETITIMER STD { int linux_setitimer(l_int which, \ + struct l_itimerval *itv, \ + struct l_itimerval *oitv); } +105 AUE_GETITIMER STD { int linux_getitimer(l_int which, \ + struct l_itimerval *itv); } +106 AUE_STAT STD { int linux_newstat(char *path, \ + struct l_newstat *buf); } +107 AUE_LSTAT STD { int linux_newlstat(char *path, \ + struct l_newstat *buf); } +108 AUE_FSTAT STD { int linux_newfstat(l_uint fd, \ + struct l_newstat *buf); } +109 AUE_NULL UNIMPL ; was linux_uname +110 AUE_NULL UNIMPL ; was linux_iopl +111 AUE_NULL STD { int linux_vhangup(void); } +112 AUE_NULL UNIMPL ; +113 AUE_NULL UNIMPL ; was OBSOLETE(linux_syscall) +114 AUE_WAIT4 STD { int linux_wait4(l_pid_t pid, \ + l_int *status, l_int options, \ + void *rusage); } +115 AUE_SWAPOFF STD { int linux_swapoff(void); } +116 AUE_NULL STD { int linux_sysinfo(struct l_sysinfo *info); } +117 AUE_NULL UNIMPL ; was OBSOLETE(linux_ipc) +118 AUE_FSYNC NOPROTO { int fsync(int fd); } +119 AUE_SIGRETURN STD { int linux_sigreturn( \ + struct l_sigframe *sfp); } +120 AUE_RFORK STD { int linux_clone(l_int flags, void *stack, \ + void *parent_tidptr, void *tls, void * child_tidptr); } +121 AUE_SYSCTL STD { int linux_setdomainname(char *name, \ + int len); } +122 AUE_NULL STD { int linux_newuname( \ + struct l_new_utsname *buf); } +123 AUE_NULL UNIMPL ; was linux_modify_ldt +124 AUE_ADJTIME STD { int linux_adjtimex(void); } +125 AUE_MPROTECT STD { int linux_mprotect(caddr_t addr, int len, \ + int prot); } +126 AUE_SIGPROCMASK STD { int linux_sigprocmask(l_int how, \ + l_osigset_t *mask, l_osigset_t *omask); } +127 AUE_NULL UNIMPL ; was linux_create_module +128 AUE_NULL STD { int linux_init_module(void); } +129 AUE_NULL STD { int linux_delete_module(void); } +130 AUE_NULL UNIMPL ; was linux_get_kernel_syms +131 AUE_QUOTACTL STD { int linux_quotactl(void); } +132 AUE_GETPGID NOPROTO { int getpgid(int pid); } +133 AUE_FCHDIR NOPROTO { int fchdir(int fd); } +134 AUE_BDFLUSH STD { int linux_bdflush(void); } +135 AUE_NULL STD { int linux_sysfs(l_int option, \ + l_ulong arg1, l_ulong arg2); } +136 AUE_PERSONALITY STD { int linux_personality(l_ulong per); } +137 AUE_NULL UNIMPL ; was afs_syscall +138 AUE_SETFSUID STD { int linux_setfsuid16(l_uid16_t uid); } +139 AUE_SETFSGID STD { int linux_setfsgid16(l_gid16_t gid); } +140 AUE_LSEEK STD { int linux_llseek(l_int fd, l_ulong ohigh, \ + l_ulong olow, l_loff_t *res, \ + l_uint whence); } +141 AUE_GETDIRENTRIES STD { int linux_getdents(l_uint fd, \ + void *dent, l_uint count); } +; 142: newselect +142 AUE_SELECT STD { int linux_select(l_int nfds, \ + l_fd_set *readfds, l_fd_set *writefds, \ + l_fd_set *exceptfds, \ + struct l_timeval *timeout); } +143 AUE_FLOCK NOPROTO { int flock(int fd, int how); } +144 AUE_MSYNC STD { int linux_msync(l_ulong addr, \ + l_size_t len, l_int fl); } +145 AUE_READV NOPROTO { int readv(int fd, struct iovec *iovp, \ + u_int iovcnt); } +146 AUE_WRITEV NOPROTO { int writev(int fd, struct iovec *iovp, \ + u_int iovcnt); } +147 AUE_GETSID STD { int linux_getsid(l_pid_t pid); } +148 AUE_NULL STD { int linux_fdatasync(l_uint fd); } +149 AUE_SYSCTL STD { int linux_sysctl( \ + struct l___sysctl_args *args); } +150 AUE_MLOCK NOPROTO { int mlock(const void *addr, size_t len); } +151 AUE_MUNLOCK NOPROTO { int munlock(const void *addr, size_t len); } +152 AUE_MLOCKALL NOPROTO { int mlockall(int how); } +153 AUE_MUNLOCKALL NOPROTO { int munlockall(void); } +154 AUE_SCHED_SETPARAM STD { int linux_sched_setparam(l_pid_t pid, \ + struct sched_param *param); } +155 AUE_SCHED_GETPARAM STD { int linux_sched_getparam(l_pid_t pid, \ + struct sched_param *param); } +156 AUE_SCHED_SETSCHEDULER STD { int linux_sched_setscheduler( \ + l_pid_t pid, l_int policy, \ + struct sched_param *param); } +157 AUE_SCHED_GETSCHEDULER STD { int linux_sched_getscheduler( \ + l_pid_t pid); } +158 AUE_NULL NOPROTO { int sched_yield(void); } +159 AUE_SCHED_GET_PRIORITY_MAX STD { int linux_sched_get_priority_max( \ + l_int policy); } +160 AUE_SCHED_GET_PRIORITY_MIN STD { int linux_sched_get_priority_min( \ + l_int policy); } +161 AUE_SCHED_RR_GET_INTERVAL STD { int linux_sched_rr_get_interval( \ + l_pid_t pid, struct l_timespec *interval); } +162 AUE_NULL STD { int linux_nanosleep( \ + const struct l_timespec *rqtp, \ + struct l_timespec *rmtp); } +163 AUE_NULL STD { int linux_mremap(l_ulong addr, \ + l_ulong old_len, l_ulong new_len, \ + l_ulong flags, l_ulong new_addr); } +164 AUE_SETRESUID STD { int linux_setresuid16(l_uid16_t ruid, \ + l_uid16_t euid, l_uid16_t suid); } +165 AUE_GETRESUID STD { int linux_getresuid16(l_uid16_t *ruid, \ + l_uid16_t *euid, l_uid16_t *suid); } +166 AUE_NULL UNIMPL ; was linux_vm86 +167 AUE_NULL UNIMPL ; was linux_query_module +168 AUE_POLL NOPROTO { int poll(struct pollfd* fds, \ + unsigned int nfds, long timeout); } +169 AUE_NULL UNIMPL ; was linux_nfsservctl +170 AUE_SETRESGID STD { int linux_setresgid16(l_gid16_t rgid, \ + l_gid16_t egid, l_gid16_t sgid); } +171 AUE_GETRESGID STD { int linux_getresgid16(l_gid16_t *rgid, \ + l_gid16_t *egid, l_gid16_t *sgid); } +172 AUE_PRCTL STD { int linux_prctl(l_int option, l_int arg2, l_int arg3, \ + l_int arg4, l_int arg5); } +173 AUE_NULL STD { int linux_rt_sigreturn( \ + struct l_ucontext *ucp); } +174 AUE_NULL STD { int linux_rt_sigaction(l_int sig, \ + l_sigaction_t *act, l_sigaction_t *oact, \ + l_size_t sigsetsize); } +175 AUE_NULL STD { int linux_rt_sigprocmask(l_int how, \ + l_sigset_t *mask, l_sigset_t *omask, \ + l_size_t sigsetsize); } +176 AUE_NULL STD { int linux_rt_sigpending(l_sigset_t *set, \ + l_size_t sigsetsize); } +177 AUE_NULL STD { int linux_rt_sigtimedwait(l_sigset_t *mask, \ + l_siginfo_t *ptr, \ + struct l_timeval *timeout, \ + l_size_t sigsetsize); } +178 AUE_NULL STD { int linux_rt_sigqueueinfo(l_pid_t pid, l_int sig, \ + l_siginfo_t *info); } +179 AUE_NULL STD { int linux_rt_sigsuspend( \ + l_sigset_t *newset, \ + l_size_t sigsetsize); } +180 AUE_PREAD STD { int linux_pread(l_uint fd, char *buf, \ + l_size_t nbyte, l_loff_t offset); } +181 AUE_PWRITE STD { int linux_pwrite(l_uint fd, char *buf, \ + l_size_t nbyte, l_loff_t offset); } +182 AUE_CHOWN STD { int linux_chown16(char *path, \ + l_uid16_t uid, l_gid16_t gid); } +183 AUE_GETCWD STD { int linux_getcwd(char *buf, \ + l_ulong bufsize); } +184 AUE_CAPGET STD { int linux_capget(struct l_user_cap_header *hdrp, \ + struct l_user_cap_data *datap); } +185 AUE_CAPSET STD { int linux_capset(struct l_user_cap_header *hdrp, \ + struct l_user_cap_data *datap); } +186 AUE_NULL STD { int linux_sigaltstack(l_stack_t *uss, \ + l_stack_t *uoss); } +187 AUE_SENDFILE STD { int linux_sendfile(void); } +188 AUE_NULL UNIMPL ; was getpmsg +189 AUE_NULL UNIMPL ; was putpmsg +190 AUE_VFORK STD { int linux_vfork(void); } +; 191: ugetrlimit +191 AUE_GETRLIMIT STD { int linux_getrlimit(l_uint resource, \ + struct l_rlimit *rlim); } +192 AUE_MMAP STD { int linux_mmap2(l_ulong addr, l_ulong len, \ + l_ulong prot, l_ulong flags, l_ulong fd, \ + l_ulong pgoff); } +193 AUE_TRUNCATE STD { int linux_truncate64(char *path, \ + l_loff_t length); } +194 AUE_FTRUNCATE STD { int linux_ftruncate64(l_uint fd, \ + l_loff_t length); } +195 AUE_STAT STD { int linux_stat64(const char *filename, \ + struct l_stat64 *statbuf); } +196 AUE_LSTAT STD { int linux_lstat64(const char *filename, \ + struct l_stat64 *statbuf); } +197 AUE_FSTAT STD { int linux_fstat64(l_int fd, \ + struct l_stat64 *statbuf); } +198 AUE_LCHOWN STD { int linux_lchown(char *path, l_uid_t uid, \ + l_gid_t gid); } +199 AUE_GETUID STD { int linux_getuid(void); } +200 AUE_GETGID STD { int linux_getgid(void); } +201 AUE_GETEUID NOPROTO { int geteuid(void); } +202 AUE_GETEGID NOPROTO { int getegid(void); } +203 AUE_SETREUID NOPROTO { int setreuid(uid_t ruid, uid_t euid); } +204 AUE_SETREGID NOPROTO { int setregid(gid_t rgid, gid_t egid); } +205 AUE_GETGROUPS STD { int linux_getgroups(l_int gidsetsize, \ + l_gid_t *grouplist); } +206 AUE_SETGROUPS STD { int linux_setgroups(l_int gidsetsize, \ + l_gid_t *grouplist); } +207 AUE_FCHOWN NODEF fchown fchown fchown_args int +208 AUE_SETRESUID NOPROTO { int setresuid(uid_t ruid, uid_t euid, \ + uid_t suid); } +209 AUE_GETRESUID NOPROTO { int getresuid(uid_t *ruid, uid_t *euid, \ + uid_t *suid); } +210 AUE_SETRESGID NOPROTO { int setresgid(gid_t rgid, gid_t egid, \ + gid_t sgid); } +211 AUE_GETRESGID NOPROTO { int getresgid(gid_t *rgid, gid_t *egid, \ + gid_t *sgid); } +212 AUE_CHOWN STD { int linux_chown(char *path, l_uid_t uid, \ + l_gid_t gid); } +213 AUE_SETUID NOPROTO { int setuid(uid_t uid); } +214 AUE_SETGID NOPROTO { int setgid(gid_t gid); } +215 AUE_SETFSUID STD { int linux_setfsuid(l_uid_t uid); } +216 AUE_SETFSGID STD { int linux_setfsgid(l_gid_t gid); } + +217 AUE_GETDIRENTRIES STD { int linux_getdents64(l_uint fd, \ + void *dirent, l_uint count); } +218 AUE_PIVOT_ROOT STD { int linux_pivot_root(char *new_root, \ + char *put_old); } +219 AUE_MINCORE STD { int linux_mincore(l_ulong start, \ + l_size_t len, u_char *vec); } +220 AUE_MADVISE NOPROTO { int madvise(void *addr, size_t len, \ + int behav); } +221 AUE_FCNTL STD { int linux_fcntl64(l_uint fd, l_uint cmd, \ + l_ulong arg); } +222 AUE_NULL UNIMPL +223 AUE_NULL UNIMPL +224 AUE_NULL STD { long linux_gettid(void); } +225 AUE_NULL UNIMPL linux_readahead +226 AUE_NULL STD { int linux_setxattr(void); } +227 AUE_NULL STD { int linux_lsetxattr(void); } +228 AUE_NULL STD { int linux_fsetxattr(void); } +229 AUE_NULL STD { int linux_getxattr(void); } +230 AUE_NULL STD { int linux_lgetxattr(void); } +231 AUE_NULL STD { int linux_fgetxattr(void); } +232 AUE_NULL STD { int linux_listxattr(void); } +233 AUE_NULL STD { int linux_llistxattr(void); } +234 AUE_NULL STD { int linux_flistxattr(void); } +235 AUE_NULL STD { int linux_removexattr(void); } +236 AUE_NULL STD { int linux_lremovexattr(void); } +237 AUE_NULL STD { int linux_fremovexattr(void); } +238 AUE_NULL STD { int linux_tkill(int tid, int sig); } +239 AUE_SENDFILE UNIMPL linux_sendfile64 +240 AUE_NULL STD { int linux_sys_futex(void *uaddr, int op, uint32_t val, \ + struct l_timespec *timeout, uint32_t *uaddr2, uint32_t val3); } +241 AUE_NULL STD { int linux_sched_setaffinity(l_pid_t pid, l_uint len, \ + l_ulong *user_mask_ptr); } +242 AUE_NULL STD { int linux_sched_getaffinity(l_pid_t pid, l_uint len, \ + l_ulong *user_mask_ptr); } +243 AUE_NULL UNIMPL linux_io_setup +244 AUE_NULL UNIMPL linux_io_destroy +245 AUE_NULL UNIMPL linux_io_getevents +246 AUE_NULL UNIMPL linux_io_submit +247 AUE_NULL UNIMPL linux_io_cancel +248 AUE_EXIT STD { int linux_exit_group(int error_code); } +249 AUE_NULL STD { int linux_lookup_dcookie(void); } +250 AUE_NULL STD { int linux_epoll_create(l_int size); } +251 AUE_NULL STD { int linux_epoll_ctl(l_int epfd, l_int op, l_int fd, \ + struct epoll_event *event); } +252 AUE_NULL STD { int linux_epoll_wait(l_int epfd, struct epoll_event *events, \ + l_int maxevents, l_int timeout); } +253 AUE_NULL STD { int linux_remap_file_pages(void); } + +254 AUE_NULL UNIMPL ; was set_thread_area +255 AUE_NULL UNIMPL ; was get_thread_area +256 AUE_NULL STD { int linux_set_tid_address(int *tidptr); } +257 AUE_NULL STD { int linux_timer_create(clockid_t clock_id, \ + struct sigevent *evp, l_timer_t *timerid); } +258 AUE_NULL STD { int linux_timer_settime(l_timer_t timerid, l_int flags, \ + const struct itimerspec *new, struct itimerspec *old); } +259 AUE_NULL STD { int linux_timer_gettime(l_timer_t timerid, struct itimerspec *setting); } +260 AUE_NULL STD { int linux_timer_getoverrun(l_timer_t timerid); } +261 AUE_NULL STD { int linux_timer_delete(l_timer_t timerid); } +262 AUE_CLOCK_SETTIME STD { int linux_clock_settime(clockid_t which, struct l_timespec *tp); } +263 AUE_NULL STD { int linux_clock_gettime(clockid_t which, struct l_timespec *tp); } +264 AUE_NULL STD { int linux_clock_getres(clockid_t which, struct l_timespec *tp); } +265 AUE_NULL STD { int linux_clock_nanosleep(clockid_t which, int flags, \ + struct l_timespec *rqtp, struct l_timespec *rmtp); } +266 AUE_STATFS STD { int linux_statfs64(char *path, size_t bufsize, struct l_statfs64_buf *buf); } +267 AUE_FSTATFS STD { int linux_fstatfs64(l_uint fd, size_t bufsize, struct l_statfs64_buf *buf); } +268 AUE_NULL STD { int linux_tgkill(int tgid, int pid, int sig); } +269 AUE_UTIMES STD { int linux_utimes(char *fname, \ + struct l_timeval *tptr); } +270 AUE_NULL STD { int linux_fadvise64_64(int fd, \ + l_loff_t offset, l_loff_t len, \ + int advice); } +271 AUE_NULL UNIMPL pciconfig_iobase +272 AUE_NULL UNIMPL pciconfig_read +273 AUE_NULL UNIMPL pciconfig_write +; linux 2.6.6: +274 AUE_NULL STD { int linux_mq_open(const char *name, int oflag, mode_t mode, \ + struct mq_attr *attr); } +275 AUE_NULL STD { int linux_mq_unlink(const char *name); } +276 AUE_NULL STD { int linux_mq_timedsend(l_mqd_t mqd, const char *msg_ptr, \ + size_t msg_len, unsigned int msg_prio, const struct \ + l_timespec *abs_timeout); } +277 AUE_NULL STD { int linux_mq_timedreceive(l_mqd_t mqd, char *msg_ptr, \ + size_t msg_len, unsigned int msg_prio, const struct \ + l_timespec *abs_timeout); } +278 AUE_NULL STD { int linux_mq_notify(l_mqd_t mqd, const struct l_timespec *abs_timeout); } +279 AUE_NULL STD { int linux_mq_getsetattr(l_mqd_t mqd, const struct mq_attr *attr, \ + struct mq_attr *oattr); } +280 AUE_WAIT6 STD { int linux_waitid(int idtype, l_pid_t id, \ + l_siginfo_t *info, int options, \ + void *rusage); } +281 AUE_SOCKET STD { int linux_socket(l_int domain, l_int type, \ + l_int protocol); } +282 AUE_BIND STD { int linux_bind(l_int s, l_uintptr_t name, \ + l_int namelen); } +283 AUE_CONNECT STD { int linux_connect(l_int s, l_uintptr_t name, \ + l_int namelen); } +284 AUE_LISTEN STD { int linux_listen(l_int s, l_int backlog); } +285 AUE_ACCEPT STD { int linux_accept(l_int s, l_uintptr_t addr, \ + l_uintptr_t namelen); } +286 AUE_GETSOCKNAME STD { int linux_getsockname(l_int s, \ + l_uintptr_t addr, l_uintptr_t namelen); } +287 AUE_GETPEERNAME STD { int linux_getpeername(l_int s, \ + l_uintptr_t addr, l_uintptr_t namelen); } +288 AUE_SOCKETPAIR STD { int linux_socketpair(l_int domain, \ + l_int type, l_int protocol, l_uintptr_t rsv); } +289 AUE_SEND STD { int linux_send(int s, l_uintptr_t msg, \ + int len, int flags); } +290 AUE_SENDTO STD { int linux_sendto(l_int s, l_uintptr_t msg, \ + l_int len, l_int flags, l_uintptr_t to, \ + l_int tolen); } +291 AUE_RECV STD { int linux_recv(int s, l_uintptr_t msg, \ + int len, int flags); } +292 AUE_RECVFROM STD { int linux_recvfrom(l_int s, l_uintptr_t buf, \ + l_size_t len, l_int flags, l_uintptr_t from, \ + l_uintptr_t fromlen); } +293 AUE_NULL STD { int linux_shutdown(l_int s, l_int how); } +294 AUE_SETSOCKOPT STD { int linux_setsockopt(l_int s, l_int level, \ + l_int optname, l_uintptr_t optval, \ + l_int optlen); } +295 AUE_GETSOCKOPT STD { int linux_getsockopt(l_int s, l_int level, \ + l_int optname, l_uintptr_t optval, \ + l_uintptr_t optlen); } +296 AUE_SENDMSG STD { int linux_sendmsg(l_int s, l_uintptr_t msg, \ + l_int flags); } +297 AUE_RECVMSG STD { int linux_recvmsg(l_int s, l_uintptr_t msg, \ + l_int flags); } +298 AUE_NULL STD { int linux_semop(l_int semid, \ + struct l_sembuf *tsops, l_uint nsops); } +299 AUE_NULL STD { int linux_semget(l_key_t key, \ + l_int nsems, l_int semflg); } +300 AUE_NULL STD { int linux_semctl(l_int semid, \ + l_int semnum, l_int cmd, union l_semun arg); } +301 AUE_NULL STD { int linux_msgsnd(l_int msqid, \ + struct l_msgbuf *msgp, l_size_t msgsz, \ + l_int msgflg); } +302 AUE_NULL STD { int linux_msgrcv(l_int msqid, \ + struct l_msgbuf *msgp, l_size_t msgsz, \ + l_long msgtyp, l_int msgflg); } +303 AUE_NULL STD { int linux_msgget(l_key_t key, l_int msgflg); } +304 AUE_NULL STD { int linux_msgctl(l_int msqid, l_int cmd, \ + struct l_msqid_ds *buf); } +305 AUE_NULL STD { int linux_shmat(l_int shmid, char *shmaddr, \ + l_int shmflg); } +306 AUE_NULL STD { int linux_shmdt(char *shmaddr); } +307 AUE_NULL STD { int linux_shmget(l_key_t key, l_size_t size, \ + l_int shmflg); } +308 AUE_NULL STD { int linux_shmctl(l_int shmid, l_int cmd, \ + struct l_shmid_ds *buf); } +; linux 2.6.11: +309 AUE_NULL STD { int linux_add_key(void); } +310 AUE_NULL STD { int linux_request_key(void); } +311 AUE_NULL STD { int linux_keyctl(void); } +312 AUE_NULL UNIMPL semtimedop +313 AUE_NULL UNIMPL ; was vserver + +; linux 2.6.13: +314 AUE_NULL STD { int linux_ioprio_set(void); } +315 AUE_NULL STD { int linux_ioprio_get(void); } +316 AUE_NULL STD { int linux_inotify_init(void); } +317 AUE_NULL STD { int linux_inotify_add_watch(void); } +318 AUE_NULL STD { int linux_inotify_rm_watch(void); } + +319 AUE_NULL STD { int linux_mbind(void); } +320 AUE_NULL STD { int linux_get_mempolicy(void); } +321 AUE_NULL STD { int linux_set_mempolicy(void); } + +; linux 2.6.16: +322 AUE_OPEN_RWTC STD { int linux_openat(l_int dfd, const char *filename, \ + l_int flags, l_int mode); } +323 AUE_MKDIRAT STD { int linux_mkdirat(l_int dfd, const char *pathname, \ + l_int mode); } +324 AUE_MKNODAT STD { int linux_mknodat(l_int dfd, const char *filename, \ + l_int mode, l_uint dev); } +325 AUE_FCHOWNAT STD { int linux_fchownat(l_int dfd, const char *filename, \ + l_uid16_t uid, l_gid16_t gid, l_int flag); } +326 AUE_FUTIMESAT STD { int linux_futimesat(l_int dfd, char *filename, \ + struct l_timeval *utimes); } +327 AUE_FSTATAT STD { int linux_fstatat64(l_int dfd, char *pathname, \ + struct l_stat64 *statbuf, l_int flag); } +328 AUE_UNLINKAT STD { int linux_unlinkat(l_int dfd, const char *pathname, \ + l_int flag); } +329 AUE_RENAMEAT STD { int linux_renameat(l_int olddfd, const char *oldname, \ + l_int newdfd, const char *newname); } +330 AUE_LINKAT STD { int linux_linkat(l_int olddfd, const char *oldname, \ + l_int newdfd, const char *newname, l_int flag); } +331 AUE_SYMLINKAT STD { int linux_symlinkat(const char *oldname, l_int newdfd, \ + const char *newname); } +332 AUE_READLINKAT STD { int linux_readlinkat(l_int dfd, const char *path, \ + char *buf, l_int bufsiz); } +333 AUE_FCHMODAT STD { int linux_fchmodat(l_int dfd, const char *filename, \ + l_mode_t mode); } +334 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, \ + l_int amode); } +335 AUE_SELECT STD { int linux_pselect6(l_int nfds, l_fd_set *readfds, \ + l_fd_set *writefds, l_fd_set *exceptfds, \ + struct l_timespec *tsp, l_uintptr_t *sig); } +336 AUE_POLL STD { int linux_ppoll(struct pollfd *fds, uint32_t nfds, \ + struct l_timespec *tsp, l_sigset_t *sset, l_size_t ssize); } +337 AUE_NULL STD { int linux_unshare(void); } +; linux 2.6.17: +338 AUE_NULL STD { int linux_set_robust_list(struct linux_robust_list_head *head, \ + l_size_t len); } +339 AUE_NULL STD { int linux_get_robust_list(l_int pid, \ + struct linux_robust_list_head **head, l_size_t *len); } +340 AUE_NULL STD { int linux_splice(void); } +341 AUE_NULL STD { int linux_sync_file_range(void); } +342 AUE_NULL STD { int linux_tee(void); } +343 AUE_NULL STD { int linux_vmsplice(void); } +; linux 2.6.18: +344 AUE_NULL STD { int linux_move_pages(void); } +; linux 2.6.19: +345 AUE_NULL STD { int linux_getcpu(void); } +346 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ + l_int maxevents, l_int timeout, l_sigset_t *mask); } +; linux 2.6.22: +347 AUE_NULL STD { int linux_kexec_load(void); } +348 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ + const struct l_timespec *times, l_int flags); } +349 AUE_NULL STD { int linux_signalfd(void); } +350 AUE_NULL STD { int linux_timerfd_create(void); } +351 AUE_NULL STD { int linux_eventfd(l_uint initval); } +; linux 2.6.23: +352 AUE_NULL STD { int linux_fallocate(l_int fd, l_int mode, \ + l_loff_t offset, l_loff_t len); } +; linux 2.6.25: +353 AUE_NULL STD { int linux_timerfd_settime(void); } +354 AUE_NULL STD { int linux_timerfd_gettime(void); } +; linux 2.6.27: +355 AUE_NULL STD { int linux_signalfd4(void); } +356 AUE_NULL STD { int linux_eventfd2(l_uint initval, l_int flags); } +357 AUE_NULL STD { int linux_epoll_create1(l_int flags); } +358 AUE_NULL STD { int linux_dup3(l_int oldfd, \ + l_int newfd, l_int flags); } +359 AUE_NULL STD { int linux_pipe2(l_int *pipefds, l_int flags); } +360 AUE_NULL STD { int linux_inotify_init1(void); } +; linux 2.6.30: +361 AUE_NULL STD { int linux_preadv(void); } +362 AUE_NULL STD { int linux_pwritev(void); } +; linux 2.6.31: +363 AUE_NULL STD { int linux_rt_tsigqueueinfo(void); } +364 AUE_NULL STD { int linux_perf_event_open(void); } +; linux 2.6.33: +365 AUE_NULL STD { int linux_recvmmsg(l_int s, \ + struct l_mmsghdr *msg, l_uint vlen, \ + l_uint flags, struct l_timespec *timeout); } +366 AUE_ACCEPT STD { int linux_accept4(l_int s, l_uintptr_t addr, \ + l_uintptr_t namelen, int flags); } +367 AUE_NULL STD { int linux_fanotify_init(void); } +368 AUE_NULL STD { int linux_fanotify_mark(void); } +; linux 2.6.36: +369 AUE_NULL STD { int linux_prlimit64(l_pid_t pid, \ + l_uint resource, \ + struct rlimit *new, \ + struct rlimit *old); } +; later: +370 AUE_NULL STD { int linux_name_to_handle_at(void); } +371 AUE_NULL STD { int linux_open_by_handle_at(void); } +372 AUE_NULL STD { int linux_clock_adjtime(void); } +373 AUE_SYNC STD { int linux_syncfs(l_int fd); } +374 AUE_NULL STD { int linux_sendmmsg(l_int s, \ + struct l_mmsghdr *msg, l_uint vlen, \ + l_uint flags); } +375 AUE_NULL STD { int linux_setns(void); } +376 AUE_NULL STD { int linux_process_vm_readv(void); } +377 AUE_NULL STD { int linux_process_vm_writev(void); } +378 AUE_NULL UNIMPL kcmp +379 AUE_NULL UNIMPL finit_module + +380 AUE_NULL UNIMPL sys_sched_setattr +381 AUE_NULL UNIMPL sys_sched_getattr +382 AUE_NULL UNIMPL sys_renameat2 +383 AUE_NULL UNIMPL sys_seccomp +384 AUE_NULL UNIMPL sys_getrandom +385 AUE_NULL UNIMPL sys_memfd_create +386 AUE_NULL UNIMPL sys_bpf +387 AUE_NULL UNIMPL sys_execveat +388 AUE_NULL UNIMPL sys_userfaultfd +389 AUE_NULL UNIMPL sys_membarrier +390 AUE_NULL UNIMPL sys_mlock2 +391 AUE_NULL UNIMPL sys_copy_file_range +392 AUE_NULL UNIMPL sys_preadv2 +393 AUE_NULL UNIMPL sys_pwritev2 +394 AUE_NULL UNIMPL +395 AUE_NULL UNIMPL +396 AUE_NULL UNIMPL +397 AUE_NULL UNIMPL +398 AUE_NULL UNIMPL +399 AUE_NULL UNIMPL + +; ARM specific +; Effective number here is 0x000f0000 +; but we must not breaks syscall numbering + +400 AUE_NULL UNIMPL +401 AUE_NULL UNIMPL breakpoint +402 AUE_NULL UNIMPL cacheflush +403 AUE_NULL UNIMPL usr26 +404 AUE_NULL UNIMPL usr32 +405 AUE_NULL STD { int linux_set_tls(void* tls); } + +; please, keep this line at the end. +406 AUE_NULL UNIMPL nosys From owner-svn-src-head@freebsd.org Fri Nov 8 14:18:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 752EE1B3E5F; Fri, 8 Nov 2019 14:18:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478j6d3Fd2z4QX7; Fri, 8 Nov 2019 14:18:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A45D273DA; Fri, 8 Nov 2019 14:18:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8EIHL6021555; Fri, 8 Nov 2019 14:18:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8EIHwh021554; Fri, 8 Nov 2019 14:18:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911081418.xA8EIHwh021554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 8 Nov 2019 14:18:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354539 - head/sys/arm/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm/linux X-SVN-Commit-Revision: 354539 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 14:18:17 -0000 Author: emaste Date: Fri Nov 8 14:18:16 2019 New Revision: 354539 URL: https://svnweb.freebsd.org/changeset/base/354539 Log: arm linuxulator: reformat syscalls.master per current style Equivalent to r339958 for sys/kern/syscalls.master. Also add a dummy name for an UNUSED. Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/linux/syscalls.master Modified: head/sys/arm/linux/syscalls.master ============================================================================== --- head/sys/arm/linux/syscalls.master Fri Nov 8 14:17:25 2019 (r354538) +++ head/sys/arm/linux/syscalls.master Fri Nov 8 14:18:16 2019 (r354539) @@ -1,29 +1,8 @@ $FreeBSD$ -; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 -; System call name/number master file (or rather, slave, from LINUX). -; Processed to create linux_sysent.c, linux_proto.h and linux_syscall.h. +; Linux ABI system call name/number map, based on Linux file +; arch/arm/kernel/calls.S -; Columns: number audit type nargs name alt{name,tag,rtyp}/comments -; number system call number, must be in order -; audit the audit event associated with the system call -; A value of AUE_NULL means no auditing, but it also means that -; there is no audit event for the call at this time. For the -; case where the event exists, but we don't want auditing, the -; event should be #defined to AUE_NULL in audit_kevents.h. -; type one of STD, OBSOL, UNIMPL -; name psuedo-prototype of syscall routine -; If one of the following alts is different, then all appear: -; altname name of system call if different -; alttag name of args struct tag if different from [o]`name'"_args" -; altrtyp return type if not int (bogus - syscalls always return int) -; for UNIMPL/OBSOL, name continues with comments - -; types: -; STD always included -; OBSOL obsolete, not included in system, only specifies name -; UNIMPL not implemented, placeholder only - #include #include #include @@ -34,606 +13,1859 @@ ; Isn't pretty, but there seems to be no other way to trap nosys #define nosys linux_nosys -; #ifdef's, etc. may be included, and are copied to the output files. - 0 AUE_NULL UNIMPL setup -1 AUE_EXIT STD { void linux_exit(int rval); } -2 AUE_FORK STD { int linux_fork(void); } -3 AUE_NULL NOPROTO { int read(int fd, char *buf, \ - u_int nbyte); } -4 AUE_NULL NOPROTO { int write(int fd, char *buf, \ - u_int nbyte); } -5 AUE_OPEN_RWTC STD { int linux_open(char *path, l_int flags, \ - l_int mode); } -6 AUE_CLOSE NOPROTO { int close(int fd); } +1 AUE_EXIT STD { + void linux_exit( + int rval + ); + } +2 AUE_FORK STD { + int linux_fork(void); + } +3 AUE_NULL NOPROTO { + int read( + int fd, + char *buf, + u_int nbyte + ); + } +4 AUE_NULL NOPROTO { + int write( + int fd, + char *buf, + u_int nbyte + ); + } +5 AUE_OPEN_RWTC STD { + int linux_open( + char *path, + l_int flags, + l_int mode + ); + } +6 AUE_CLOSE NOPROTO { + int close( + int fd); + } 7 AUE_NULL UNIMPL ; was linux_waitpid -8 AUE_CREAT STD { int linux_creat(char *path, \ - l_int mode); } -9 AUE_LINK STD { int linux_link(char *path, char *to); } -10 AUE_UNLINK STD { int linux_unlink(char *path); } -11 AUE_EXECVE STD { int linux_execve(char *path, char **argp, \ - char **envp); } -12 AUE_CHDIR STD { int linux_chdir(char *path); } +8 AUE_CREAT STD { + int linux_creat( + char *path, + l_int mode + ); + } +9 AUE_LINK STD { + int linux_link( + char *path, + char *to + ); + } +10 AUE_UNLINK STD { + int linux_unlink( + char *path + ); + } +11 AUE_EXECVE STD { + int linux_execve( + char *path, + char **argp, + char **envp + ); + } +12 AUE_CHDIR STD { + int linux_chdir( + char *path + ); + } 13 AUE_NULL UNIMPL ; was OBSOLETE(linux_time) -14 AUE_MKNOD STD { int linux_mknod(char *path, l_int mode, \ - l_dev_t dev); } -15 AUE_CHMOD STD { int linux_chmod(char *path, \ - l_mode_t mode); } -16 AUE_LCHOWN STD { int linux_lchown16(char *path, \ - l_uid16_t uid, l_gid16_t gid); } +14 AUE_MKNOD STD { + int linux_mknod( + char *path, + l_int mode, + l_dev_t dev + ); + } +15 AUE_CHMOD STD { + int linux_chmod( + char *path, + l_mode_t mode + ); + } +16 AUE_LCHOWN STD { + int linux_lchown16( + char *path, + l_uid16_t uid, + l_gid16_t gid); + } 17 AUE_NULL UNIMPL ; was linux_break 18 AUE_NULL UNIMPL ; was linux_stat -19 AUE_LSEEK STD { int linux_lseek(l_uint fdes, l_off_t off, \ - l_int whence); } -20 AUE_GETPID STD { int linux_getpid(void); } -21 AUE_MOUNT STD { int linux_mount(char *specialfile, \ - char *dir, char *filesystemtype, \ - l_ulong rwflag, void *data); } +19 AUE_LSEEK STD { + int linux_lseek( + l_uint fdes, + l_off_t off, + l_int whence + ); + } +20 AUE_GETPID STD { + int linux_getpid(void); + } +21 AUE_MOUNT STD { + int linux_mount( + char *specialfile, + char *dir, + char *filesystemtype, + l_ulong rwflag, + void *data + ); + } 22 AUE_NULL UNIMPL ; was OBSOLETE(linux_oldumount) -23 AUE_SETUID STD { int linux_setuid16(l_uid16_t uid); } -24 AUE_GETUID STD { int linux_getuid16(void); } +23 AUE_SETUID STD { + int linux_setuid16( + l_uid16_t uid); + } +24 AUE_GETUID STD { + int linux_getuid16(void); + } 25 AUE_NULL UNIMPL ; was OBSOLETE(linux_stime) 26 AUE_PTRACE UNIMPL ptrace 27 AUE_NULL UNIMPL ; was OBSOLETE(linux_alarm) 28 AUE_NULL UNIMPL ; was linux_fstat -29 AUE_NULL STD { int linux_pause(void); } +29 AUE_NULL STD { + int linux_pause(void); + } 30 AUE_NULL UNIMPL ; was OBSOLETE(linux_utime) 31 AUE_NULL UNIMPL ; was linux_stty 32 AUE_NULL UNIMPL ; was linux_getty -33 AUE_ACCESS STD { int linux_access(char *path, l_int amode); } -34 AUE_NICE STD { int linux_nice(l_int inc); } +33 AUE_ACCESS STD { + int linux_access( + char *path, + l_int amode + ); + } +34 AUE_NICE STD { + int linux_nice( + l_int inc + ); + } 35 AUE_NULL UNIMPL ; was linux_ftime -36 AUE_SYNC NOPROTO { int sync(void); } -37 AUE_KILL STD { int linux_kill(l_int pid, l_int signum); } -38 AUE_RENAME STD { int linux_rename(char *from, char *to); } -39 AUE_MKDIR STD { int linux_mkdir(char *path, l_int mode); } -40 AUE_RMDIR STD { int linux_rmdir(char *path); } -41 AUE_DUP NOPROTO { int dup(u_int fd); } -42 AUE_PIPE STD { int linux_pipe(l_int *pipefds); } -43 AUE_NULL STD { int linux_times(struct l_times_argv *buf); } +36 AUE_SYNC NOPROTO { + int sync(void); + } +37 AUE_KILL STD { + int linux_kill( + l_int pid, + l_int signum + ); + } +38 AUE_RENAME STD { + int linux_rename( + char *from, + char *to + ); + } +39 AUE_MKDIR STD { + int linux_mkdir( + char *path, + l_int mode + ); + } +40 AUE_RMDIR STD { + int linux_rmdir( + char *path + ); + } +41 AUE_DUP NOPROTO { + int dup( + u_int fd); + } +42 AUE_PIPE STD { + int linux_pipe( + l_int *pipefds + ); + } +43 AUE_NULL STD { + int linux_times( + struct l_times_argv *buf + ); + } 44 AUE_NULL UNIMPL ; was linux_prof -45 AUE_NULL STD { int linux_brk(l_ulong dsend); } -46 AUE_SETGID STD { int linux_setgid16(l_gid16_t gid); } -47 AUE_GETGID STD { int linux_getgid16(void); } +45 AUE_NULL STD { + int linux_brk( + l_ulong dsend); + } +46 AUE_SETGID STD { + int linux_setgid16( + l_gid16_t gid); + } +47 AUE_GETGID STD { + int linux_getgid16(void); + } 48 AUE_NULL UNIMPL ; was linux_signal -49 AUE_GETEUID STD { int linux_geteuid16(void); } -50 AUE_GETEGID STD { int linux_getegid16(void); } -51 AUE_ACCT NOPROTO { int acct(char *path); } -52 AUE_UMOUNT STD { int linux_umount(char *path, l_int flags); } +49 AUE_GETEUID STD { + int linux_geteuid16(void); + } +50 AUE_GETEGID STD { + int linux_getegid16(void); + } +51 AUE_ACCT NOPROTO { + int acct( + char *path + ); + } +52 AUE_UMOUNT STD { + int linux_umount( + char *path, + l_int flags + ); + } 53 AUE_NULL UNIMPL ; was linux_lock -54 AUE_IOCTL STD { int linux_ioctl(l_uint fd, l_uint cmd, \ - l_ulong arg); } -55 AUE_FCNTL STD { int linux_fcntl(l_uint fd, l_uint cmd, \ - l_ulong arg); } +54 AUE_IOCTL STD { + int linux_ioctl( + l_uint fd, + l_uint cmd, + l_ulong arg + ); + } +55 AUE_FCNTL STD { + int linux_fcntl( + l_uint fd, + l_uint cmd, + l_ulong arg + ); + } 56 AUE_NULL UNIMPL ; was linux_mpx -57 AUE_SETPGRP NOPROTO { int setpgid(int pid, int pgid); } +57 AUE_SETPGRP NOPROTO { + int setpgid( + int pid, + int pgid); + } 58 AUE_NULL UNIMPL ; was linux_ulimit 59 AUE_NULL UNIMPL ; was linux_olduname -60 AUE_UMASK NOPROTO { int umask(int newmask); } -61 AUE_CHROOT NOPROTO { int chroot(char *path); } -62 AUE_NULL STD { int linux_ustat(l_dev_t dev, \ - struct l_ustat *ubuf); } -63 AUE_DUP2 NOPROTO { int dup2(u_int from, u_int to); } -64 AUE_GETPPID STD { int linux_getppid(void); } -65 AUE_GETPGRP NOPROTO { int getpgrp(void); } -66 AUE_SETSID NOPROTO { int setsid(void); } -67 AUE_NULL STD { int linux_sigaction(l_int sig, \ - l_osigaction_t *nsa, \ - l_osigaction_t *osa); } +60 AUE_UMASK NOPROTO { + int umask( + int newmask + ); + } +61 AUE_CHROOT NOPROTO { + int chroot( + char *path + ); + } +62 AUE_NULL STD { + int linux_ustat( + l_dev_t dev, + struct l_ustat *ubuf + ); + } +63 AUE_DUP2 NOPROTO { + int dup2( + u_int from, + u_int to + ); + } +64 AUE_GETPPID STD { + int linux_getppid(void); + } +65 AUE_GETPGRP NOPROTO { + int getpgrp(void); + } +66 AUE_SETSID NOPROTO { + int setsid(void); + } +67 AUE_NULL STD { + int linux_sigaction( + l_int sig, + l_osigaction_t *nsa, + l_osigaction_t *osa + ); + } 68 AUE_NULL UNIMPL ; was linux_sgetmask 69 AUE_NULL UNIMPL ; was linux_ssetmask -70 AUE_SETREUID STD { int linux_setreuid16(l_uid16_t ruid, \ - l_uid16_t euid); } -71 AUE_SETREGID STD { int linux_setregid16(l_gid16_t rgid, \ - l_gid16_t egid); } -72 AUE_NULL STD { int linux_sigsuspend(l_int hist0, \ - l_int hist1, l_osigset_t mask); } -73 AUE_NULL STD { int linux_sigpending(l_osigset_t *mask); } -74 AUE_SYSCTL STD { int linux_sethostname(char *hostname, \ - u_int len); } -75 AUE_SETRLIMIT STD { int linux_setrlimit(l_uint resource, \ - struct l_rlimit *rlim); } +70 AUE_SETREUID STD { + int linux_setreuid16( + l_uid16_t ruid, + l_uid16_t euid); + } +71 AUE_SETREGID STD { + int linux_setregid16( + l_gid16_t rgid, + l_gid16_t egid); + } +72 AUE_NULL STD { + int linux_sigsuspend( + l_int hist0, + l_int hist1, + l_osigset_t mask + ); + } +73 AUE_NULL STD { + int linux_sigpending( + l_osigset_t *mask + ); + } +74 AUE_SYSCTL STD { + int linux_sethostname( + char *hostname, + u_int len + ); + } +75 AUE_SETRLIMIT STD { + int linux_setrlimit( + l_uint resource, + struct l_rlimit *rlim + ); + } 76 AUE_NULL UNIMPL ; was OBSOLETE(linux_old_getrlimit) -77 AUE_GETRUSAGE NOPROTO { int getrusage(int who, \ - struct rusage *rusage); } -78 AUE_GETTIMEOFDAY STD { int linux_gettimeofday( \ - struct timeval32 *tp, \ - struct timezone *tzp); } -79 AUE_SETTIMEOFDAY STD { int linux_settimeofday( \ - struct timeval32 *tp, \ - struct timezone *tzp); } -80 AUE_GETGROUPS STD { int linux_getgroups16(l_uint gidsetsize, \ - l_gid16_t *gidset); } -81 AUE_SETGROUPS STD { int linux_setgroups16(l_uint gidsetsize, \ - l_gid16_t *gidset); } +77 AUE_GETRUSAGE NOPROTO { + int getrusage( + int who, + struct rusage *rusage + ); + } +78 AUE_GETTIMEOFDAY STD { + int linux_gettimeofday( + struct timeval32 *tp, + struct timezone *tzp + ); + } +79 AUE_SETTIMEOFDAY STD { + int linux_settimeofday( + struct timeval32 *tp, + struct timezone *tzp + ); + } +80 AUE_GETGROUPS STD { + int linux_getgroups16( + l_uint gidsetsize, + l_gid16_t *gidset + ); + } +81 AUE_SETGROUPS STD { + int linux_setgroups16( + l_uint gidsetsize, + l_gid16_t *gidset + ); + } 82 AUE_NULL UNIMPL ; was OBSOLETE(linux_old_select) -83 AUE_SYMLINK STD { int linux_symlink(char *path, char *to); } +83 AUE_SYMLINK STD { + int linux_symlink( + char *path, + char *to + ); + } 84 AUE_NULL UNIMPL ; was linux_lstat -85 AUE_READLINK STD { int linux_readlink(char *name, char *buf, \ - l_int count); } +85 AUE_READLINK STD { + int linux_readlink( + char *name, + char *buf, + l_int count + ); + } 86 AUE_NULL UNIMPL uselib -87 AUE_SWAPON NOPROTO { int swapon(char *name); } -88 AUE_REBOOT STD { int linux_reboot(l_int magic1, \ - l_int magic2, l_uint cmd, void *arg); } +87 AUE_SWAPON NOPROTO { + int swapon( + char *name + ); + } +88 AUE_REBOOT STD { + int linux_reboot( + l_int magic1, + l_int magic2, + l_uint cmd, + void *arg + ); + } 89 AUE_NULL UNIMPL ; was OBSOLETE(linux_old_readdir) 90 AUE_NULL UNIMPL ; was OBSOLETE(linux_old_mmap) -91 AUE_MUNMAP NOPROTO { int munmap(caddr_t addr, int len); } -92 AUE_TRUNCATE STD { int linux_truncate(char *path, \ - l_ulong length); } -93 AUE_FTRUNCATE STD { int linux_ftruncate(int fd, long length); } -94 AUE_FCHMOD NOPROTO { int fchmod(int fd, int mode); } -95 AUE_FCHOWN NOPROTO { int fchown(int fd, int uid, int gid); } -96 AUE_GETPRIORITY STD { int linux_getpriority(int which, int who); } -97 AUE_SETPRIORITY NOPROTO { int setpriority(int which, int who, \ - int prio); } +91 AUE_MUNMAP NOPROTO { + int munmap( + caddr_t addr, + int len + ); + } +92 AUE_TRUNCATE STD { + int linux_truncate( + char *path, + l_ulong length + ); + } +93 AUE_FTRUNCATE STD { + int linux_ftruncate( + int fd, + long length + ); + } +94 AUE_FCHMOD NOPROTO { + int fchmod( + int fd, + int mode + ); + } +95 AUE_FCHOWN NOPROTO { + int fchown( + int fd, + int uid, + int gid); + } +96 AUE_GETPRIORITY STD { + int linux_getpriority( + int which, + int who + ); + } +97 AUE_SETPRIORITY NOPROTO { + int setpriority( + int which, + int who, + int prio + ); + } 98 AUE_NULL UNIMPL ; was linux_profil -99 AUE_STATFS STD { int linux_statfs(char *path, \ - struct l_statfs_buf *buf); } -100 AUE_FSTATFS STD { int linux_fstatfs(l_uint fd, \ - struct l_statfs_buf *buf); } +99 AUE_STATFS STD { + int linux_statfs( + char *path, + struct l_statfs_buf *buf + ); + } +100 AUE_FSTATFS STD { + int linux_fstatfs( + l_uint fd, + struct l_statfs_buf *buf + ); + } 101 AUE_NULL UNIMPL ; was ioperm 102 AUE_NULL UNIMPL ; was OBSOLETE(linux_socketcall) -103 AUE_NULL STD { int linux_syslog(l_int type, char *buf, \ - l_int len); } -104 AUE_SETITIMER STD { int linux_setitimer(l_int which, \ - struct l_itimerval *itv, \ - struct l_itimerval *oitv); } -105 AUE_GETITIMER STD { int linux_getitimer(l_int which, \ - struct l_itimerval *itv); } -106 AUE_STAT STD { int linux_newstat(char *path, \ - struct l_newstat *buf); } -107 AUE_LSTAT STD { int linux_newlstat(char *path, \ - struct l_newstat *buf); } -108 AUE_FSTAT STD { int linux_newfstat(l_uint fd, \ - struct l_newstat *buf); } +103 AUE_NULL STD { + int linux_syslog( + l_int type, + char *buf, + l_int len + ); + } +104 AUE_SETITIMER STD { + int linux_setitimer( + l_int which, + struct l_itimerval *itv, + struct l_itimerval *oitv + ); + } +105 AUE_GETITIMER STD { + int linux_getitimer( + l_int which, + struct l_itimerval *itv + ); + } +106 AUE_STAT STD { + int linux_newstat( + char *path, + struct l_newstat *buf + ); + } +107 AUE_LSTAT STD { + int linux_newlstat( + char *path, + struct l_newstat *buf + ); + } +108 AUE_FSTAT STD { + int linux_newfstat( + l_uint fd, + struct l_newstat *buf + ); + } 109 AUE_NULL UNIMPL ; was linux_uname 110 AUE_NULL UNIMPL ; was linux_iopl -111 AUE_NULL STD { int linux_vhangup(void); } +111 AUE_NULL STD { + int linux_vhangup(void); + } 112 AUE_NULL UNIMPL ; 113 AUE_NULL UNIMPL ; was OBSOLETE(linux_syscall) -114 AUE_WAIT4 STD { int linux_wait4(l_pid_t pid, \ - l_int *status, l_int options, \ - void *rusage); } -115 AUE_SWAPOFF STD { int linux_swapoff(void); } -116 AUE_NULL STD { int linux_sysinfo(struct l_sysinfo *info); } +114 AUE_WAIT4 STD { + int linux_wait4( + l_pid_t pid, + l_int *status, + l_int options, + void *rusage + ); + } +115 AUE_SWAPOFF STD { + int linux_swapoff(void); + } +116 AUE_NULL STD { + int linux_sysinfo( + struct l_sysinfo *info + ); + } 117 AUE_NULL UNIMPL ; was OBSOLETE(linux_ipc) -118 AUE_FSYNC NOPROTO { int fsync(int fd); } -119 AUE_SIGRETURN STD { int linux_sigreturn( \ - struct l_sigframe *sfp); } -120 AUE_RFORK STD { int linux_clone(l_int flags, void *stack, \ - void *parent_tidptr, void *tls, void * child_tidptr); } -121 AUE_SYSCTL STD { int linux_setdomainname(char *name, \ - int len); } -122 AUE_NULL STD { int linux_newuname( \ - struct l_new_utsname *buf); } +118 AUE_FSYNC NOPROTO { + int fsync( + int fd); + } +119 AUE_SIGRETURN STD { + int linux_sigreturn( + struct l_sigframe *sfp + ); + } +120 AUE_RFORK STD { + int linux_clone( + l_int flags, + void *stack, + void *parent_tidptr, + void *tls, + void * child_tidptr + ); + } +121 AUE_SYSCTL STD { + int linux_setdomainname( + char *name, + int len + ); + } +122 AUE_NULL STD { + int linux_newuname( + struct l_new_utsname *buf + ); + } 123 AUE_NULL UNIMPL ; was linux_modify_ldt -124 AUE_ADJTIME STD { int linux_adjtimex(void); } -125 AUE_MPROTECT STD { int linux_mprotect(caddr_t addr, int len, \ - int prot); } -126 AUE_SIGPROCMASK STD { int linux_sigprocmask(l_int how, \ - l_osigset_t *mask, l_osigset_t *omask); } +124 AUE_ADJTIME STD { + int linux_adjtimex(void); + } +125 AUE_MPROTECT STD { + int linux_mprotect( + caddr_t addr, + int len, + int prot + ); + } +126 AUE_SIGPROCMASK STD { + int linux_sigprocmask( + l_int how, + l_osigset_t *mask, + l_osigset_t *omask + ); + } 127 AUE_NULL UNIMPL ; was linux_create_module -128 AUE_NULL STD { int linux_init_module(void); } -129 AUE_NULL STD { int linux_delete_module(void); } +128 AUE_NULL STD { + int linux_init_module(void); + } +129 AUE_NULL STD { + int linux_delete_module(void); + } 130 AUE_NULL UNIMPL ; was linux_get_kernel_syms -131 AUE_QUOTACTL STD { int linux_quotactl(void); } -132 AUE_GETPGID NOPROTO { int getpgid(int pid); } -133 AUE_FCHDIR NOPROTO { int fchdir(int fd); } -134 AUE_BDFLUSH STD { int linux_bdflush(void); } -135 AUE_NULL STD { int linux_sysfs(l_int option, \ - l_ulong arg1, l_ulong arg2); } -136 AUE_PERSONALITY STD { int linux_personality(l_ulong per); } +131 AUE_QUOTACTL STD { + int linux_quotactl(void); + } +132 AUE_GETPGID NOPROTO { + int getpgid( + int pid); + } +133 AUE_FCHDIR NOPROTO { + int fchdir( + int fd); + } +134 AUE_BDFLUSH STD { + int linux_bdflush(void); + } +135 AUE_NULL STD { + int linux_sysfs( + l_int option, + l_ulong arg1, + l_ulong arg2 + ); + } +136 AUE_PERSONALITY STD { + int linux_personality( + l_ulong per + ); + } 137 AUE_NULL UNIMPL ; was afs_syscall -138 AUE_SETFSUID STD { int linux_setfsuid16(l_uid16_t uid); } -139 AUE_SETFSGID STD { int linux_setfsgid16(l_gid16_t gid); } -140 AUE_LSEEK STD { int linux_llseek(l_int fd, l_ulong ohigh, \ - l_ulong olow, l_loff_t *res, \ - l_uint whence); } -141 AUE_GETDIRENTRIES STD { int linux_getdents(l_uint fd, \ - void *dent, l_uint count); } +138 AUE_SETFSUID STD { + int linux_setfsuid16( + l_uid16_t uid); + } +139 AUE_SETFSGID STD { + int linux_setfsgid16( + l_gid16_t gid); + } +140 AUE_LSEEK STD { + int linux_llseek( + l_int fd, + l_ulong ohigh, + l_ulong olow, + l_loff_t *res, + l_uint whence + ); + } +141 AUE_GETDIRENTRIES STD { + int linux_getdents( + l_uint fd, + void *dent, + l_uint count + ); + } ; 142: newselect -142 AUE_SELECT STD { int linux_select(l_int nfds, \ - l_fd_set *readfds, l_fd_set *writefds, \ - l_fd_set *exceptfds, \ - struct l_timeval *timeout); } -143 AUE_FLOCK NOPROTO { int flock(int fd, int how); } -144 AUE_MSYNC STD { int linux_msync(l_ulong addr, \ - l_size_t len, l_int fl); } -145 AUE_READV NOPROTO { int readv(int fd, struct iovec *iovp, \ - u_int iovcnt); } -146 AUE_WRITEV NOPROTO { int writev(int fd, struct iovec *iovp, \ - u_int iovcnt); } -147 AUE_GETSID STD { int linux_getsid(l_pid_t pid); } -148 AUE_NULL STD { int linux_fdatasync(l_uint fd); } -149 AUE_SYSCTL STD { int linux_sysctl( \ - struct l___sysctl_args *args); } -150 AUE_MLOCK NOPROTO { int mlock(const void *addr, size_t len); } -151 AUE_MUNLOCK NOPROTO { int munlock(const void *addr, size_t len); } -152 AUE_MLOCKALL NOPROTO { int mlockall(int how); } -153 AUE_MUNLOCKALL NOPROTO { int munlockall(void); } -154 AUE_SCHED_SETPARAM STD { int linux_sched_setparam(l_pid_t pid, \ - struct sched_param *param); } -155 AUE_SCHED_GETPARAM STD { int linux_sched_getparam(l_pid_t pid, \ - struct sched_param *param); } -156 AUE_SCHED_SETSCHEDULER STD { int linux_sched_setscheduler( \ - l_pid_t pid, l_int policy, \ - struct sched_param *param); } -157 AUE_SCHED_GETSCHEDULER STD { int linux_sched_getscheduler( \ - l_pid_t pid); } -158 AUE_NULL NOPROTO { int sched_yield(void); } -159 AUE_SCHED_GET_PRIORITY_MAX STD { int linux_sched_get_priority_max( \ - l_int policy); } -160 AUE_SCHED_GET_PRIORITY_MIN STD { int linux_sched_get_priority_min( \ - l_int policy); } -161 AUE_SCHED_RR_GET_INTERVAL STD { int linux_sched_rr_get_interval( \ - l_pid_t pid, struct l_timespec *interval); } -162 AUE_NULL STD { int linux_nanosleep( \ - const struct l_timespec *rqtp, \ - struct l_timespec *rmtp); } -163 AUE_NULL STD { int linux_mremap(l_ulong addr, \ - l_ulong old_len, l_ulong new_len, \ - l_ulong flags, l_ulong new_addr); } -164 AUE_SETRESUID STD { int linux_setresuid16(l_uid16_t ruid, \ - l_uid16_t euid, l_uid16_t suid); } -165 AUE_GETRESUID STD { int linux_getresuid16(l_uid16_t *ruid, \ - l_uid16_t *euid, l_uid16_t *suid); } +142 AUE_SELECT STD { + int linux_select( + l_int nfds, + l_fd_set *readfds, + l_fd_set *writefds, + l_fd_set *exceptfds, + struct l_timeval *timeout + ); + } +143 AUE_FLOCK NOPROTO { + int flock( + int fd, + int how + ); + } +144 AUE_MSYNC STD { + int linux_msync( + l_ulong addr, + l_size_t len, + l_int fl + ); + } +145 AUE_READV NOPROTO { + int readv( + int fd, + struct iovec *iovp, + u_int iovcnt + ); + } +146 AUE_WRITEV NOPROTO { + int writev( + int fd, + struct iovec *iovp, + u_int iovcnt + ); + } +147 AUE_GETSID STD { + int linux_getsid( + l_pid_t pid); + } +148 AUE_NULL STD { + int linux_fdatasync( + l_uint fd); + } +149 AUE_SYSCTL STD { + int linux_sysctl( + struct l___sysctl_args *args + ); + } +150 AUE_MLOCK NOPROTO { + int mlock( + const void *addr, + size_t len + ); + } +151 AUE_MUNLOCK NOPROTO { + int munlock( + const void *addr, + size_t len + ); + } +152 AUE_MLOCKALL NOPROTO { + int mlockall( + int how + ); + } +153 AUE_MUNLOCKALL NOPROTO { + int munlockall(void); + } +154 AUE_SCHED_SETPARAM STD { + int linux_sched_setparam( + l_pid_t pid, + struct sched_param *param + ); + } +155 AUE_SCHED_GETPARAM STD { + int linux_sched_getparam( + l_pid_t pid, + struct sched_param *param + ); + } +156 AUE_SCHED_SETSCHEDULER STD { + int linux_sched_setscheduler( + l_pid_t pid, + l_int policy, + struct sched_param *param + ); + } +157 AUE_SCHED_GETSCHEDULER STD { + int linux_sched_getscheduler( + l_pid_t pid); + } +158 AUE_NULL NOPROTO { + int sched_yield(void); + } +159 AUE_SCHED_GET_PRIORITY_MAX STD { + int linux_sched_get_priority_max( + l_int policy + ); + } +160 AUE_SCHED_GET_PRIORITY_MIN STD { + int linux_sched_get_priority_min( + l_int policy + ); + } +161 AUE_SCHED_RR_GET_INTERVAL STD { + int linux_sched_rr_get_interval( + l_pid_t pid, + struct l_timespec *interval + ); + } +162 AUE_NULL STD { + int linux_nanosleep( + const struct l_timespec *rqtp, + struct l_timespec *rmtp + ); + } +163 AUE_NULL STD { + int linux_mremap( + l_ulong addr, + l_ulong old_len, + l_ulong new_len, + l_ulong flags, + l_ulong new_addr + ); + } +164 AUE_SETRESUID STD { + int linux_setresuid16( + l_uid16_t ruid, + l_uid16_t euid, + l_uid16_t suid); + } +165 AUE_GETRESUID STD { + int linux_getresuid16( + l_uid16_t *ruid, + l_uid16_t *euid, + l_uid16_t *suid); + } 166 AUE_NULL UNIMPL ; was linux_vm86 167 AUE_NULL UNIMPL ; was linux_query_module -168 AUE_POLL NOPROTO { int poll(struct pollfd* fds, \ - unsigned int nfds, long timeout); } +168 AUE_POLL NOPROTO { + int poll( + struct pollfd* fds, + unsigned int nfds, + long timeout + ); + } 169 AUE_NULL UNIMPL ; was linux_nfsservctl -170 AUE_SETRESGID STD { int linux_setresgid16(l_gid16_t rgid, \ - l_gid16_t egid, l_gid16_t sgid); } -171 AUE_GETRESGID STD { int linux_getresgid16(l_gid16_t *rgid, \ - l_gid16_t *egid, l_gid16_t *sgid); } -172 AUE_PRCTL STD { int linux_prctl(l_int option, l_int arg2, l_int arg3, \ - l_int arg4, l_int arg5); } -173 AUE_NULL STD { int linux_rt_sigreturn( \ - struct l_ucontext *ucp); } -174 AUE_NULL STD { int linux_rt_sigaction(l_int sig, \ - l_sigaction_t *act, l_sigaction_t *oact, \ - l_size_t sigsetsize); } -175 AUE_NULL STD { int linux_rt_sigprocmask(l_int how, \ - l_sigset_t *mask, l_sigset_t *omask, \ - l_size_t sigsetsize); } -176 AUE_NULL STD { int linux_rt_sigpending(l_sigset_t *set, \ - l_size_t sigsetsize); } -177 AUE_NULL STD { int linux_rt_sigtimedwait(l_sigset_t *mask, \ - l_siginfo_t *ptr, \ - struct l_timeval *timeout, \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Nov 8 14:25:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44B571B420C; Fri, 8 Nov 2019 14:25:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478jGv13jdz4R34; Fri, 8 Nov 2019 14:25:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07B0F2759C; Fri, 8 Nov 2019 14:25:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8EPQTN027403; Fri, 8 Nov 2019 14:25:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8EPQnw027402; Fri, 8 Nov 2019 14:25:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911081425.xA8EPQnw027402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 8 Nov 2019 14:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354540 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 354540 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 14:25:27 -0000 Author: emaste Date: Fri Nov 8 14:25:26 2019 New Revision: 354540 URL: https://svnweb.freebsd.org/changeset/base/354540 Log: add reference to PR for sparc64 BSD_CRTBEGIN in BROKEN_OPTIONS We will soon remove the BSD_CRTBEGIN option (and will use the new CRT files always) as part of the GCC 4.2.1 removal. Right now BSD_CRTBEGIN works everywhere but sparc64; add a reference to the PR in case anyone stumbles across this and is looking for more information. Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Fri Nov 8 14:18:16 2019 (r354539) +++ head/share/mk/src.opts.mk Fri Nov 8 14:25:26 2019 (r354540) @@ -411,7 +411,7 @@ BROKEN_OPTIONS+=HYPERV BROKEN_OPTIONS+=NVME .endif -# Sparc64 need extra crt*.o files +# Sparc64 need extra crt*.o files - PR 239851 .if ${__T:Msparc64} BROKEN_OPTIONS+=BSD_CRTBEGIN .endif From owner-svn-src-head@freebsd.org Fri Nov 8 14:28:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80AEB1B4355; Fri, 8 Nov 2019 14:28:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478jLc2rX9z4RDv; Fri, 8 Nov 2019 14:28:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44FC3275A2; Fri, 8 Nov 2019 14:28:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8ESeOo027579; Fri, 8 Nov 2019 14:28:40 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8ESefv027578; Fri, 8 Nov 2019 14:28:40 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201911081428.xA8ESefv027578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 8 Nov 2019 14:28:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354541 - head/lib/csu/common X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/csu/common X-SVN-Commit-Revision: 354541 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 14:28:40 -0000 Author: kevans Date: Fri Nov 8 14:28:39 2019 New Revision: 354541 URL: https://svnweb.freebsd.org/changeset/base/354541 Log: csu: Fix dynamiclib/init_test:jcr_test on !HAVE_CTORS archs .jcr still needs a 0-entry added in crtend, even on !HAVE_CTORS archs, as we're still getting .jcr sections added -- presumably due to the reference in crtbegin. Without this terminal, the .jcr section (without data) overlaps with the next section and register_classes in crtbegin will be examining the wrong item. PR: 241439 Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D22132 Modified: head/lib/csu/common/crtend.c Modified: head/lib/csu/common/crtend.c ============================================================================== --- head/lib/csu/common/crtend.c Fri Nov 8 14:25:26 2019 (r354540) +++ head/lib/csu/common/crtend.c Fri Nov 8 14:28:39 2019 (r354541) @@ -26,9 +26,14 @@ __FBSDID("$FreeBSD$"); #include "crt.h" -#ifdef HAVE_CTORS typedef void (*crt_func)(void); +static crt_func __JCR_LIST__[] __section(".jcr") __used = { + (crt_func)0 +}; + +#ifdef HAVE_CTORS + /* * On some architectures and toolchains we may need to call the .ctors. * These are called in the reverse order they are in the ELF file. @@ -39,9 +44,6 @@ static crt_func __CTOR_END__[] __section(".ctors") __u (crt_func)0 }; static crt_func __DTOR_END__[] __section(".dtors") __used = { - (crt_func)0 -}; -static crt_func __JCR_LIST__[] __section(".jcr") __used = { (crt_func)0 }; From owner-svn-src-head@freebsd.org Fri Nov 8 14:36:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F19E1B47C1; Fri, 8 Nov 2019 14:36:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478jWx1Q9Fz4Rvc; Fri, 8 Nov 2019 14:36:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13F1527782; Fri, 8 Nov 2019 14:36:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8Eaiau035258; Fri, 8 Nov 2019 14:36:44 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8EaiIQ035255; Fri, 8 Nov 2019 14:36:44 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201911081436.xA8EaiIQ035255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 8 Nov 2019 14:36:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354542 - in head: sys/netinet6 tests/sys/netinet6/frag6 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head: sys/netinet6 tests/sys/netinet6/frag6 X-SVN-Commit-Revision: 354542 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 14:36:45 -0000 Author: bz Date: Fri Nov 8 14:36:44 2019 New Revision: 354542 URL: https://svnweb.freebsd.org/changeset/base/354542 Log: frag6: properly handle atomic fragments according to RFCs. RFC 8200 says: "If the fragment is a whole datagram (that is, both the Fragment Offset field and the M flag are zero), then it does not need any further reassembly and should be processed as a fully reassembled packet (i.e., updating Next Header, adjust Payload Length, removing the Fragment header, etc.). .." That means we should remove the fragment header and make all the adjustments rather than just skipping over the fragment header. The difference should be noticeable in that a properly handled atomic fragment triggering an ICMPv6 message at an upper layer (e.g. dest unreach, unreachable port) will not include the fragment header. Update the test cases to also test for an unfragmentable part. That is needed so that the next header is properly updated (not just lengths). MFC after: 3 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D22155 Modified: head/sys/netinet6/frag6.c head/tests/sys/netinet6/frag6/frag6_03.py head/tests/sys/netinet6/frag6/frag6_03.sh Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Fri Nov 8 14:28:39 2019 (r354541) +++ head/sys/netinet6/frag6.c Fri Nov 8 14:36:44 2019 (r354542) @@ -395,6 +395,8 @@ frag6_input(struct mbuf **mp, int *offp, int proto) m = *mp; offset = *offp; + M_ASSERTPKTHDR(m); + ip6 = mtod(m, struct ip6_hdr *); #ifndef PULLDOWN_TEST IP6_EXTHDR_CHECK(m, offset, sizeof(struct ip6_frag), IPPROTO_DONE); @@ -437,22 +439,35 @@ frag6_input(struct mbuf **mp, int *offp, int proto) IP6STAT_INC(ip6s_fragments); in6_ifstat_inc(dstifp, ifs6_reass_reqd); - /* Offset now points to data portion. */ - offset += sizeof(struct ip6_frag); - /* * Handle "atomic" fragments (offset and m bit set to 0) upfront, - * unrelated to any reassembly. Still need to remove the frag hdr. + * unrelated to any reassembly. We need to remove the frag hdr + * which is ugly. * See RFC 6946 and section 4.5 of RFC 8200. */ if ((ip6f->ip6f_offlg & ~IP6F_RESERVED_MASK) == 0) { IP6STAT_INC(ip6s_atomicfrags); - /* XXX-BZ handle correctly. */ + nxt = ip6f->ip6f_nxt; + /* + * Set nxt(-hdr field value) to the original value. + * We cannot just set ip6->ip6_nxt as there might be + * an unfragmentable part with extension headers and + * we must update the last one. + */ + m_copyback(m, ip6_get_prevhdr(m, offset), sizeof(uint8_t), + (caddr_t)&nxt); + ip6->ip6_plen = htons(ntohs(ip6->ip6_plen) - + sizeof(struct ip6_frag)); + if (ip6_deletefraghdr(m, offset, M_NOWAIT) != 0) + goto dropfrag2; + m->m_pkthdr.len -= sizeof(struct ip6_frag); in6_ifstat_inc(dstifp, ifs6_reass_ok); - *offp = offset; - m->m_flags |= M_FRAGMENTED; - return (ip6f->ip6f_nxt); + *mp = m; + return (nxt); } + + /* Offset now points to data portion. */ + offset += sizeof(struct ip6_frag); /* Get fragment length and discard 0-byte fragments. */ frgpartlen = sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen) - offset; Modified: head/tests/sys/netinet6/frag6/frag6_03.py ============================================================================== --- head/tests/sys/netinet6/frag6/frag6_03.py Fri Nov 8 14:28:39 2019 (r354541) +++ head/tests/sys/netinet6/frag6/frag6_03.py Fri Nov 8 14:36:44 2019 (r354542) @@ -101,6 +101,33 @@ def main(): if not sniffer.foundCorrectPacket: sys.exit(1) + + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ## + # + # Atomic fragment with extension header. + # + # A: Nothing listening on UDP port. + # R: ICMPv6 dst unreach, unreach port. + # + # Start sniffing on recvif + sniffer = Sniffer(args, check_icmp6_error) + + ip6f01 = sp.Ether() / \ + sp.IPv6(src=args.src[0], dst=args.to[0]) / \ + sp.IPv6ExtHdrDestOpt(options = \ + sp.PadN(optdata="\x00\x00\x00\x00\x00\x00")) / \ + sp.IPv6ExtHdrFragment(offset=0, m=0, id=0x3001) / \ + sp.UDP(dport=3456, sport=6543) + if args.debug : + ip6f01.display() + sp.sendp(ip6f01, iface=args.sendif[0], verbose=False) + + sleep(0.10) + sniffer.setEnd() + sniffer.join() + if not sniffer.foundCorrectPacket: + sys.exit(1) + sys.exit(0) if __name__ == '__main__': Modified: head/tests/sys/netinet6/frag6/frag6_03.sh ============================================================================== --- head/tests/sys/netinet6/frag6/frag6_03.sh Fri Nov 8 14:28:39 2019 (r354541) +++ head/tests/sys/netinet6/frag6/frag6_03.sh Fri Nov 8 14:36:44 2019 (r354542) @@ -67,12 +67,12 @@ frag6_03_check_stats() { # Check selection of global UDP stats. # cat < ${HOME}/filter-${jname}.txt - 1 + 2 0 0 0 0 - 1 + 2 0 0 0 @@ -94,11 +94,11 @@ EOF 0 0 0 - 1 + 2 0 0 0 - 1 + 2 0 0 0 @@ -124,12 +124,12 @@ EOF # XXX-TODO check output histogram (just too hard to parse [no multi-line-grep]) # cat < ${HOME}/filter-${jname}.txt - 1 + 2 0 0 0 0 - 1 + 2 0 0 0 @@ -170,8 +170,8 @@ EOF 0 0 0 - 1 - 1 + 2 + 2 0 EOF count=`jexec ${jname} netstat -s -p ip6 -I ${ifname} --libxo xml,pretty | grep -E -x -c -f ${HOME}/filter-${jname}.txt` @@ -196,8 +196,8 @@ EOF 0 0 0 - 1 - 1 + 2 + 2 0 0 0 From owner-svn-src-head@freebsd.org Fri Nov 8 14:51:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E8E91B4D23; Fri, 8 Nov 2019 14:51:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478jrZ6hQmz4SdH; Fri, 8 Nov 2019 14:51:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C90792799A; Fri, 8 Nov 2019 14:51:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8EpAhE043192; Fri, 8 Nov 2019 14:51:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8EpAcO043190; Fri, 8 Nov 2019 14:51:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911081451.xA8EpAcO043190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 8 Nov 2019 14:51:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354543 - in head: lib/libkvm sys/sys X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: lib/libkvm sys/sys X-SVN-Commit-Revision: 354543 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 14:51:11 -0000 Author: emaste Date: Fri Nov 8 14:51:09 2019 New Revision: 354543 URL: https://svnweb.freebsd.org/changeset/base/354543 Log: kvm: fix types for cross-debugging As with other libkvm interfaces use maximum-sized types to support cross-debugging (e.g. a 64-bit vmcore on a 32-bit host). See https://lists.freebsd.org/pipermail/svn-src-all/2019-February/176051.html for further discussion. This is an API-breaking change, but there are few consumers of this interface today. Reviewed by: will Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21945 Modified: head/lib/libkvm/kvm.h head/lib/libkvm/kvm_private.c head/sys/sys/types.h Modified: head/lib/libkvm/kvm.h ============================================================================== --- head/lib/libkvm/kvm.h Fri Nov 8 14:36:44 2019 (r354542) +++ head/lib/libkvm/kvm.h Fri Nov 8 14:51:09 2019 (r354543) @@ -82,18 +82,18 @@ struct kvm_swap { }; struct kvm_page { - unsigned int version; - u_long paddr; - u_long kmap_vaddr; - u_long dmap_vaddr; - vm_prot_t prot; - u_long offset; - size_t len; - /* end of version 1 */ + u_int kp_version; + kpaddr_t kp_paddr; + kvaddr_t kp_kmap_vaddr; + kvaddr_t kp_dmap_vaddr; + vm_prot_t kp_prot; + off_t kp_offset; + size_t kp_len; + /* end of version 2 */ }; #define SWIF_DEV_PREFIX 0x0002 -#define LIBKVM_WALK_PAGES_VERSION 1 +#define LIBKVM_WALK_PAGES_VERSION 2 __BEGIN_DECLS int kvm_close(kvm_t *); Modified: head/lib/libkvm/kvm_private.c ============================================================================== --- head/lib/libkvm/kvm_private.c Fri Nov 8 14:36:44 2019 (r354542) +++ head/lib/libkvm/kvm_private.c Fri Nov 8 14:51:09 2019 (r354543) @@ -755,13 +755,13 @@ _kvm_visit_cb(kvm_t *kd, kvm_walk_pages_cb_t *cb, void { unsigned int pgsz = page_size ? page_size : len; struct kvm_page p = { - .version = LIBKVM_WALK_PAGES_VERSION, - .paddr = pa, - .kmap_vaddr = kmap_vaddr, - .dmap_vaddr = dmap_vaddr, - .prot = prot, - .offset = _kvm_pt_find(kd, pa, pgsz), - .len = len, + .kp_version = LIBKVM_WALK_PAGES_VERSION, + .kp_paddr = pa, + .kp_kmap_vaddr = kmap_vaddr, + .kp_dmap_vaddr = dmap_vaddr, + .kp_prot = prot, + .kp_offset = _kvm_pt_find(kd, pa, pgsz), + .kp_len = len, }; return cb(&p, arg); Modified: head/sys/sys/types.h ============================================================================== --- head/sys/sys/types.h Fri Nov 8 14:36:44 2019 (r354542) +++ head/sys/sys/types.h Fri Nov 8 14:51:09 2019 (r354543) @@ -252,11 +252,12 @@ typedef struct cap_rights cap_rights_t; #endif /* - * Types suitable for exporting size and pointers (as virtual addresses) - * from the kernel independent of native word size. These should be - * used in place of size_t and (u)intptr_t in structs which contain such - * types that are shared with userspace. + * Types suitable for exporting physical addresses, virtual addresses + * (pointers), and memory object sizes from the kernel independent of native + * word size. These should be used in place of vm_paddr_t, (u)intptr_t, and + * size_t in structs which contain such types that are shared with userspace. */ +typedef __uint64_t kpaddr_t; typedef __uint64_t kvaddr_t; typedef __uint64_t ksize_t; From owner-svn-src-head@freebsd.org Fri Nov 8 14:59:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 339691B5005; Fri, 8 Nov 2019 14:59:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478k2Q0YqFz4T3r; Fri, 8 Nov 2019 14:59:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EABD427B2C; Fri, 8 Nov 2019 14:59:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8ExfLF048139; Fri, 8 Nov 2019 14:59:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8ExfeZ048138; Fri, 8 Nov 2019 14:59:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911081459.xA8ExfeZ048138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 8 Nov 2019 14:59:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354544 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/elftoolchain/elfcopy X-SVN-Commit-Revision: 354544 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 14:59:42 -0000 Author: emaste Date: Fri Nov 8 14:59:41 2019 New Revision: 354544 URL: https://svnweb.freebsd.org/changeset/base/354544 Log: elfcopy/strip: Ensure sections have required alignment on output Object files may specify insufficient alignment on certain sections, for example due to a bug in NASM[1]. When we detect that case in elfcopy or strip, emit a warning and increase the alignment to the minimum required. The NASM bug was fixed in 2015[2], but we might as well have this fixup (and warning) in elfcopy in case we encounter such a file for any other reason. This might be reworked somewhat upstream - see ELF Tool Chain ticket 485[3]. [1] https://bugzilla.nasm.us/show_bug.cgi?id=3392307 [2] https://repo.or.cz/w/nasm.git/commit/1f0cb0f2c1ba632c0fab02424928cfb756a9160c [3] https://sourceforge.net/p/elftoolchain/tickets/485/ PR: 198611 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2292 Modified: head/contrib/elftoolchain/elfcopy/sections.c Modified: head/contrib/elftoolchain/elfcopy/sections.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/sections.c Fri Nov 8 14:51:09 2019 (r354543) +++ head/contrib/elftoolchain/elfcopy/sections.c Fri Nov 8 14:59:41 2019 (r354544) @@ -879,6 +879,43 @@ pad_section(struct elfcopy *ecp, struct section *s) elf_errmsg(-1)); } +static int +section_type_alignment(int sht, int class) +{ + switch (sht) + { + case SHT_DYNAMIC: + case SHT_DYNSYM: + case SHT_FINI_ARRAY: + case SHT_GNU_HASH: + case SHT_INIT_ARRAY: + case SHT_PREINIT_ARRAY: + case SHT_REL: + case SHT_RELA: + case SHT_SYMTAB: + return (class == ELFCLASS64 ? 8 : 4); + case SHT_SUNW_move: + return (8); + case SHT_GNU_LIBLIST: + case SHT_GROUP: + case SHT_HASH: + case SHT_NOTE: + case SHT_SUNW_verdef: /* == SHT_GNU_verdef */ + case SHT_SUNW_verneed: /* == SHT_GNU_verneed */ + case SHT_SYMTAB_SHNDX: + return (4); + case SHT_SUNW_syminfo: + case SHT_SUNW_versym: /* == SHT_GNU_versym */ + return (2); + case SHT_NOBITS: + case SHT_PROGBITS: + case SHT_STRTAB: + case SHT_SUNW_dof: + return (1); + } + return (1); +} + void resync_sections(struct elfcopy *ecp) { @@ -886,6 +923,7 @@ resync_sections(struct elfcopy *ecp) GElf_Shdr osh; uint64_t off; int first; + int min_alignment; ps = NULL; first = 1; @@ -908,6 +946,12 @@ resync_sections(struct elfcopy *ecp) /* Align section offset. */ if (s->align == 0) s->align = 1; + min_alignment = section_type_alignment(s->type, ecp->oec); + if (s->align < INT_MAX && (int)s->align < min_alignment) { + warnx("section %s alignment %d increased to %d", + s->name, (int)s->align, min_alignment); + s->align = min_alignment; + } if (off <= s->off) { if (!s->loadable || (ecp->flags & RELOCATABLE)) s->off = roundup(off, s->align); @@ -937,6 +981,7 @@ resync_sections(struct elfcopy *ecp) errx(EXIT_FAILURE, "gelf_getshdr() failed: %s", elf_errmsg(-1)); osh.sh_addr = s->vma; + osh.sh_addralign = s->align; osh.sh_offset = s->off; osh.sh_size = s->sz; if (!gelf_update_shdr(s->os, &osh)) From owner-svn-src-head@freebsd.org Fri Nov 8 15:15:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A0EC1B579B; Fri, 8 Nov 2019 15:15:45 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478kNw6wQnz4VNJ; Fri, 8 Nov 2019 15:15:44 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 58238223E; Fri, 8 Nov 2019 15:15:44 +0000 (UTC) (envelope-from gjb@freebsd.org) Date: Fri, 8 Nov 2019 15:15:41 +0000 From: Glen Barber To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r350089 - head Message-ID: <20191108151541.GU5599@FreeBSD.org> References: <201907171909.x6HJ96Tu082986@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="oGy11dVowAZA6eXT" Content-Disposition: inline In-Reply-To: <201907171909.x6HJ96Tu082986@repo.freebsd.org> User-Agent: Mutt/1.12.1 (2019-06-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 15:15:45 -0000 --oGy11dVowAZA6eXT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 17, 2019 at 07:09:06PM +0000, Mark Johnston wrote: > Author: markj > Date: Wed Jul 17 19:09:05 2019 > New Revision: 350089 > URL: https://svnweb.freebsd.org/changeset/base/350089 >=20 > Log: > Add an initial RELNOTES file. > =20 > The intent is to provide a convenient location to document changes > that are relevant to users of binary FreeBSD distributions, in contrast > with UPDATING, which exists to document caveats for users who build > FreeBSD from source. > =20 > This complements the "Relnotes:" tag in commit messages by providing a > place to document the change in more detail, or in case a "Relnotes:" > tag was accidentally omitted. In particular, "Relnotes:" should be > used if you do not intend to document the change in RELNOTES for some > reason. > =20 > Changes to the file should not be MFCed. For now the file will exist > only in head, but may be updated via direct commits to stable branches > depending on how things go. > =20 I had to go look at the original thread to remind myself about this, but regarding not MFCing changes from head to stable branches, I think there may have been some confusion in the discussion. By "changes should not be MFCed", at least based on my recollection of how the conversation was going, I (at least) meant "not MFCed, but committed as a direct commit to stable branches." In other words, merging the RELNOTES change from head to stable/X does not really make sense, as the revision numbers will have changed, and would inevitably cause merge conflicts. Now that 12.1 is out, maybe we can expand the idea of this file into stable/12 and even stable/11. One additional idea that came to mind is with the formatting for stable branches. For example, in head, there is: rNNNNNN: The foo(8) utility was added. For stable branches, I would propose the format of: rNNNNNM, MFC of rNNNNNN: The foo(8) utility was added. Thoughts? Glen --oGy11dVowAZA6eXT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAl3Fhp0ACgkQAxRYpUeP 4pPozw//ZwQ0CIkxoRyhkmuJlu6cWcvYG8FSgLZsG08UNJmV3BQ58qF2yJQFV/N0 UeBW/60BrhDn3WRf3LhtG/ZKoIFJEhnWvgShdyMBv4iSV6oYg65ZIbnleLoflAf5 ktINUsgbyq/X+DbcdEGAFXrL03IFukIkxmAKDV4kf4FSJ9ywyPTBfyynhKxB5Vpy 3s+5K7IJQlWVxmCmSOtGoE3IKDMofKQbvRJZL6i13ViBQlu5qMJimzuQkDLBoXX5 SCysNlzumzH2beJM9JsBE5YgxPG4ISkjJ3uhi3HxudNT7tMYuu+W09il2z9zneQ0 uEx3yqw/rA2ikuRq5H9ck80oFdlL+af3z/olhodgTPCfSEqAY5ZWVgLTxic3y5Ym I3y4vNeEIwZx1B1kQRIdyDOFOvxIIQe3qle9QCyLKKruptxJahN8Z3N0VF3pedPp i+UIujwtF4NGNHjtjBgDOi1+by6b+EwUuv5r2yhV3usnuZQXjSb00v9VNNsuXNHb 6alUlR2ymX/OT8lxEozrFfNOmvdleJZNmodpK2L3HTeWS1lStISixMAOPu2NDVmX s3BWfevCGqwVQSAwNDsq7WDR1jan4QK4ocfav8Y91ihokkF2uZbbePzKg5Yegli4 S79Qa2knx23Tx6Ipicqj1leDZzD9BgWXSacS24ZnoO7QI8GB/kg= =EMF7 -----END PGP SIGNATURE----- --oGy11dVowAZA6eXT-- From owner-svn-src-head@freebsd.org Fri Nov 8 15:20:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95C701B5906; Fri, 8 Nov 2019 15:20:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478kVD3Qlcz4VZk; Fri, 8 Nov 2019 15:20:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5903A27EF5; Fri, 8 Nov 2019 15:20:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8FKKqm060316; Fri, 8 Nov 2019 15:20:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8FKKuo060315; Fri, 8 Nov 2019 15:20:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201911081520.xA8FKKuo060315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 8 Nov 2019 15:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354545 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 354545 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 15:20:20 -0000 Author: emaste Date: Fri Nov 8 15:20:19 2019 New Revision: 354545 URL: https://svnweb.freebsd.org/changeset/base/354545 Log: mark LLVM_LIBUNWIND as broken on sparc64, with PR reference PR: 233405 Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Fri Nov 8 14:59:41 2019 (r354544) +++ head/share/mk/src.opts.mk Fri Nov 8 15:20:19 2019 (r354545) @@ -411,9 +411,11 @@ BROKEN_OPTIONS+=HYPERV BROKEN_OPTIONS+=NVME .endif -# Sparc64 need extra crt*.o files - PR 239851 .if ${__T:Msparc64} +# Sparc64 need extra crt*.o files - PR 239851 BROKEN_OPTIONS+=BSD_CRTBEGIN +# PR 233405 +BROKEN_OPTIONS+=LLVM_LIBUNWIND .endif .if ${COMPILER_FEATURES:Mc++11} && \ From owner-svn-src-head@freebsd.org Fri Nov 8 15:48:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 207141B616A; Fri, 8 Nov 2019 15:48:29 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478l6j039mz4X0f; Fri, 8 Nov 2019 15:48:28 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x841.google.com with SMTP id o3so6943879qtj.8; Fri, 08 Nov 2019 07:48:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=wpmxzNjwmrOMVC3TYGifGplBs1Jmeal2KLWCbTCK+n0=; b=VZ5hQAps7leLxrCG7wcfIDQ9+S4VVoAxOpeM4L31fh4yjEltw1oHerjegGQsFsL+Yo qL7OIa50uRGXcnR+hdaqD/wox3ir/YetUF8ncHDf+00YGGM+xRhTkdAU0+ncaPLxJw/N L9Sl9proBgYJCGCGcFURVutsMieUjFX5FNX1VTjKSzQLVr1MXmEJ50c+C4r4GgXRHA07 KAGIVVZ/aZu4U+VFSkWoBVNKFxlcQ6jUPg5HdGO1KIwHIF18kSNO9PgvJYWnT8ngBoJJ zbTXP6Q3LW1iRoaqXWlf3lRKSFA3CX9ySOTPPNO8AEAAxo4scvJGVv42fllwuZHPdewN f5bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=wpmxzNjwmrOMVC3TYGifGplBs1Jmeal2KLWCbTCK+n0=; b=OPqy82IIKhrkwPXze03YNaVC2TDE7ek9VcZo69yQhCfZC/aatMSaqTH43wc/DLx5m4 yVZ/Rz/x+t/NuzHS9/ph76VkNfth4UQxNkdMt5xGPE2ygviLCCCMLWVvCHa9nxziqlsU 2E7PQ9VyalnvwyavTZCUhBR2BJn85HUc3wROAyq/cvkUHB1wSNoZ+mN+h3Yp8LuJcFir sXwLtaLrFFCqz+HnHzaJ+vIJhg19t2YHQ06rdfLNpVr0PvvJsSzcW+/ekz30sWmzT/mQ +L9VKQzXGdUb7+7IsR5JAJkL9HaDV75y6uK4Tm9ZblDvRn4gIvv0BAxC0uCR6QQKmdjb 9+Gw== X-Gm-Message-State: APjAAAU2MYU2iNhva7vSAbLRFlUk1jYZPtkIi/TOnj+x+Vm4BQm4efkQ CkNk/xDEfqi+3Q9mluLszAHYoNRHYew= X-Google-Smtp-Source: APXvYqyj59CmApXeDbdVwYBMh1mM22m3ePaGWuYGsDGsKOn1JBCNVMjz8RwAquWOhHWYvogmSnG9Fg== X-Received: by 2002:ac8:4403:: with SMTP id j3mr8550305qtn.66.1573228107405; Fri, 08 Nov 2019 07:48:27 -0800 (PST) Received: from raichu (toroon0560w-lp130-05-69-158-183-252.dsl.bell.ca. [69.158.183.252]) by smtp.gmail.com with ESMTPSA id 76sm3374830qke.111.2019.11.08.07.48.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 07:48:26 -0800 (PST) Sender: Mark Johnston Date: Fri, 8 Nov 2019 10:41:15 -0500 From: Mark Johnston To: Glen Barber Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r350089 - head Message-ID: <20191108154115.GA37198@raichu> References: <201907171909.x6HJ96Tu082986@repo.freebsd.org> <20191108151541.GU5599@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191108151541.GU5599@FreeBSD.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 478l6j039mz4X0f X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 15:48:29 -0000 On Fri, Nov 08, 2019 at 03:15:41PM +0000, Glen Barber wrote: > On Wed, Jul 17, 2019 at 07:09:06PM +0000, Mark Johnston wrote: > > Author: markj > > Date: Wed Jul 17 19:09:05 2019 > > New Revision: 350089 > > URL: https://svnweb.freebsd.org/changeset/base/350089 > > > > Log: > > Add an initial RELNOTES file. > > > > The intent is to provide a convenient location to document changes > > that are relevant to users of binary FreeBSD distributions, in contrast > > with UPDATING, which exists to document caveats for users who build > > FreeBSD from source. > > > > This complements the "Relnotes:" tag in commit messages by providing a > > place to document the change in more detail, or in case a "Relnotes:" > > tag was accidentally omitted. In particular, "Relnotes:" should be > > used if you do not intend to document the change in RELNOTES for some > > reason. > > > > Changes to the file should not be MFCed. For now the file will exist > > only in head, but may be updated via direct commits to stable branches > > depending on how things go. > > > > I had to go look at the original thread to remind myself about this, but > regarding not MFCing changes from head to stable branches, I think there > may have been some confusion in the discussion. > > By "changes should not be MFCed", at least based on my recollection of > how the conversation was going, I (at least) meant "not MFCed, but > committed as a direct commit to stable branches." In other words, > merging the RELNOTES change from head to stable/X does not really make > sense, as the revision numbers will have changed, and would inevitably > cause merge conflicts. Right. I don't think there's any problem with having a per-branch RELNOTES file so long as they are maintained by direct commits. When I added the file I initially just wanted to target HEAD and see if people would actually add things to the file. > Now that 12.1 is out, maybe we can expand the idea of this file into > stable/12 and even stable/11. One additional idea that came to mind is > with the formatting for stable branches. > > For example, in head, there is: > > rNNNNNN: > The foo(8) utility was added. > > For stable branches, I would propose the format of: > > rNNNNNM, MFC of rNNNNNN: > The foo(8) utility was added. > > Thoughts? That seems reasonable to me. From owner-svn-src-head@freebsd.org Fri Nov 8 16:27:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B9FC81B6EE1; Fri, 8 Nov 2019 16:27:36 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qv1-xf42.google.com (mail-qv1-xf42.google.com [IPv6:2607:f8b0:4864:20::f42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478lzq6WhFz4Z0F; Fri, 8 Nov 2019 16:27:35 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qv1-xf42.google.com with SMTP id x14so2435645qvu.0; Fri, 08 Nov 2019 08:27:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=tD2yvSSWSBFNr73tUkwjt9YSORzRbKnUxzi18dj7coQ=; b=T7HNvI4X53Lx0qoufhDwJDGNJJVKxA7c2KWUe9IXRXQbPsVwo5jv1IJhXyObQvwrYF H8umiTp6xI81C3VYz5s4djQAqRXtVS+1mn+TawCDvHuuaXcAGsjIaUu5gQ1QvQvLnpnz 1y7uswk2HvZlZXmxe3Dmn5y7wvxazf0drS2sdZlsQ2MrPtMJzNFCNKgfpoMC2llf6YO9 jk17oJB1tIRTWvbspsigiAaKn0uiDa7hP+gzZEdBJsX/g2N9Ogm0xhTOBvPBnSLQA8Tv WunAGNTim/Qm7Ufquzq+EatoeJYRYOe9J5F/BIqLbIHW0+QIvF6k/+mT7km97GrnMou4 UY/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=tD2yvSSWSBFNr73tUkwjt9YSORzRbKnUxzi18dj7coQ=; b=HRmuyGtGP9uRERTZZYmAPS9pXFoUzvKG4MvrI39dTCDdFVAqikdFGWGZvbWDBAPGor ged3ZxjY9bqI5pIBBffYlNjHtQ6xmnAdQjCLutb+kokCs0flATjDQb/Ol9JcW3TtWJKq xnGMUa+MLvPl80Z1LvpyyDNrYuyKBu5epHIv8SHCcAu/YFOj2CtI7mr1sFQ+EOLHnLS9 J8poXTm39MAXQXmPFKV8eI8GGIg88pfbqaCSr58nPUkrsHmK6gSu/A6C2IHr28liZlRn e3lh8M1R41F2DjN0pxGH23epwROyislA/zYXWu5QbLFxq+IJOARDJEVuYs/kXvREsHHE NA/w== X-Gm-Message-State: APjAAAW2DLciSL+p2iEpXVJXNBrpgdffD96S7BGyO3IFAZi5Um/mupEP qMx+ydB+CDIr9bcWRIi0kpMqaV// X-Google-Smtp-Source: APXvYqzuGEF7gvfB9LH4d1JjXmEvGUNElbednLnpJpkzh9pt+mmUD37/68nS2jr4DFEfRgu/12JH3g== X-Received: by 2002:ad4:55c7:: with SMTP id bt7mr10174576qvb.29.1573230454270; Fri, 08 Nov 2019 08:27:34 -0800 (PST) Received: from mbp.home ([2804:f1c:800:fc00:351a:3009:3672:3590]) by smtp.gmail.com with ESMTPSA id t27sm2793257qkm.19.2019.11.08.08.27.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Nov 2019 08:27:33 -0800 (PST) Sender: Renato Botelho Subject: Re: svn commit: r354149 - head/sys/net To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201910291736.x9THa6Gd018030@repo.freebsd.org> From: Renato Botelho Autocrypt: addr=garga@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFn4ZqUBCACxJRWi57JkmsCrSU0gZd/CwB+B90OTUeXmF63lDPETOQ+pBA4+vJgzjW1C pv7rR25wxvESJKphxZJOOk9AXTXsg5QrhdP3+KQG/zNcKd2ukbt3ezkhdMx8q81wn4wY2oTl WXdGIVdDKvC8sCp1fc6pPKJin71/skb9wg6ThtlRFlv9en4f8QSVmRuzRKQ6VjCbl+yIpiye /I5BQ4I99uouPzPhzf9ya3cvp4xbiw5wSo1F3nLsThBT2osYy/nRNz2ciuCYyyX87dGhio0T 8Pxl37eBbGQvCGwPQBApCcfoiZBN/5F65Tt4p72gIqT+AYuqq5G7Bhj+fGTC7q0QotL/ABEB AAG0LFJlbmF0byBCb3RlbGhvIChGcmVlQlNEKSA8Z2FyZ2FARnJlZUJTRC5vcmc+iQFXBBMB CgBBAhsDBQkFo5qABQsJCAcDBRUKCQgLBRYDAgEAAh4BAheAFiEExxiLNMqsn7yXmTy7W54E w5ZrhhoFAln4aeUCGQEACgkQW54Ew5ZrhhpTIwf+OS+Gv/ITOy7+8D+8SKXNmkfczsTO+Uqz 6SraXcq32j1C4QcRQCwGPhVJJgKnFSvPm3kbNPFXaQh1zD+mTQ4r/Loc78Rz+fZljYcgNx7n aQKhd9pdpXaELOe+Y10jvGUrT0SE06Y10BP/NmQaLplt9qG8VgLAAB9ZcsuZ9pzbBbQjd9In OK5VcXQzHT/EBBQ1rHsl1Aq8TYdmjbKl+HKc1c8dJ5OfXrgnTIUwQdN1rauXbmH/YW/CKN7z zF59v/sPBTaWfFl2CS/BORhWhe1PBudrVZWFT0oJGNuG6k8dlnssoL/0ojFaN5w5xm8mvMAf uAuixGf4bK6C7hcE34D/ULkBDQRZ+GalAQgApiTibUM0OpeCcxf5YUep4F4y853ClU4TMqZO +ho38sz0GdshQWuBEBqahOtxapHUMtlmC+wJNCBAav5JYjHHrXXE9pgRm5EgVssDpMvplLB4 5CFdx5jBu02Bt9Wp5bD21TPH3rsYJUB3rYmxWfVmdRhNBERrCJu49OIsBSKAlIinx8altYrh Z7bO2C1hKOG6QHWRr4ml4HTD/gZ6TTfsrR+sktBNv/5ZRkcJNDVM+eOGagXkEUOVFe9KXynD 3KcZBbBKpwoaW5GK8OglKJt8ggUfc78CG1xk4b5nL8QCk0CBrC6VPPOYvXTpYSTHmx1QkElm 1iNu1Tc5ccvcyAwTswARAQABiQE8BBgBCgAmFiEExxiLNMqsn7yXmTy7W54Ew5ZrhhoFAln4 ZqUCGwwFCQWjmoAACgkQW54Ew5ZrhhoH3wf+KuIeDyvIJOui+0C5FD5r44Bwkj/SAUVUerfp 0qtRktc+BZoSifPs3Rqjh/PpwRvLTuJnSsiqWLz8NCTThogRzVqEcQHqZR3vOjtYM60sjYJ+ BGQl/bjm1C/YtWEEmKs7mJc+02U8qJA4rbNKSRRRoz6XngnuN6YC0fkeD7c7rxRhOg6OWasZ JinB9+dO1IH7eZ5c97v518qSaLRp0T7I+FpEGOp7tTFHaepZWEnuojr5D6jI1MOEywy0EWJu 3m0TYlh935I8o7gLABqoHEmUeW7JK7r91SZaFnr8zQ6XOAxkPh50uFMTNtNZTnM7k1pRv5Ov fms0VzARITYzTwmpDQ== Message-ID: <781d285f-0b6d-45f1-f4b4-4bab60b789ae@FreeBSD.org> Date: Fri, 8 Nov 2019 13:27:30 -0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <201910291736.x9THa6Gd018030@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 478lzq6WhFz4Z0F X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=T7HNvI4X; dmarc=none; spf=pass (mx1.freebsd.org: domain of gargabsd@gmail.com designates 2607:f8b0:4864:20::f42 as permitted sender) smtp.mailfrom=gargabsd@gmail.com X-Spamd-Result: default: False [-3.08 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.88)[ipnet: 2607:f8b0::/32(-2.34), asn: 15169(-2.01), country: US(-0.05)]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FORGED_SENDER(0.30)[garga@FreeBSD.org,gargabsd@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[garga@FreeBSD.org,gargabsd@gmail.com] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 16:27:36 -0000 On 29/10/19 14:36, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Oct 29 17:36:06 2019 > New Revision: 354149 > URL: https://svnweb.freebsd.org/changeset/base/354149 > > Log: > There is a long standing problem with multicast programming for NICs > and IPv6. With IPv6 we may call if_addmulti() in context of processing > of an incoming packet. Usually this is interrupt context. While most > of the NIC drivers are able to reprogram multicast filters without > sleeping, some of them can't. An example is e1000 family of drivers. > With iflib conversion the problem was somewhat hidden. Iflib processes > packets in private taskqueue, so going to sleep doesn't trigger an > assertion. However, the sleep would block operation of the driver and > following incoming packets would fill the ring and eventually would > start being dropped. Enabling epoch for the full time of a packet > processing again started to trigger assertions for e1000. > > Fix this problem once and for all using a general taskqueue to call > if_ioctl() method in all cases when if_addmulti() is called in a > non sleeping context. Note that nobody cares about returned value. > > Reviewed by: hselasky, kib > Differential Revision: https://reviews.freebsd.org/D22154 Hi Gleb, I upgraded my laptop running 13-CURRENT from r354133 to r354437 and it crashed during boot as you can see in the pictures [1]. It seems like it crashed while it was configuring network. After bisect I managed to boot fine with r354148 and reproduce the crash with this revision applied. Here is the relevant portion of my /etc/rc.conf: # Lagg ifconfig_em0="up" wlans_iwn0="wlan0" ifconfig_wlan0="WPA" create_args_wlan0="wlanaddr 3c:97:0e:48:3f:f8 up" cloned_interfaces="lagg0" ifconfig_lagg0="up laggproto failover laggport em0 laggport wlan0 DHCP" ifconfig_lagg0_ipv6="inet6 accept_rtadv" rtsold_enable="YES" [1] https://imgur.com/a/lBtq3FW -- Renato Botelho From owner-svn-src-head@freebsd.org Fri Nov 8 16:30:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D933A1B6FE5; Fri, 8 Nov 2019 16:30:56 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478m3h5Jgnz4ZHk; Fri, 8 Nov 2019 16:30:56 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99D79C43; Fri, 8 Nov 2019 16:30:56 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8GUuLA003770; Fri, 8 Nov 2019 16:30:56 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8GUuJT003769; Fri, 8 Nov 2019 16:30:56 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201911081630.xA8GUuJT003769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 8 Nov 2019 16:30:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354548 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 354548 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 16:30:56 -0000 Author: vangyzen Date: Fri Nov 8 16:30:55 2019 New Revision: 354548 URL: https://svnweb.freebsd.org/changeset/base/354548 Log: vmm: pass M_WAITOK to uma_zalloc when allocating FPU save area Submitted by: patrick.sullivan3@dell.com Reviewed by: markj MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22276 Modified: head/sys/amd64/amd64/fpu.c head/sys/i386/i386/npx.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Fri Nov 8 16:10:45 2019 (r354547) +++ head/sys/amd64/amd64/fpu.c Fri Nov 8 16:30:55 2019 (r354548) @@ -1190,7 +1190,7 @@ struct savefpu * fpu_save_area_alloc(void) { - return (uma_zalloc(fpu_save_area_zone, 0)); + return (uma_zalloc(fpu_save_area_zone, M_WAITOK)); } void Modified: head/sys/i386/i386/npx.c ============================================================================== --- head/sys/i386/i386/npx.c Fri Nov 8 16:10:45 2019 (r354547) +++ head/sys/i386/i386/npx.c Fri Nov 8 16:30:55 2019 (r354548) @@ -1473,7 +1473,7 @@ union savefpu * fpu_save_area_alloc(void) { - return (uma_zalloc(fpu_save_area_zone, 0)); + return (uma_zalloc(fpu_save_area_zone, M_WAITOK)); } void From owner-svn-src-head@freebsd.org Fri Nov 8 16:56:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B35181B790A; Fri, 8 Nov 2019 16:56:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478mdY3VSxz4bwK; Fri, 8 Nov 2019 16:56:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A62C117C; Fri, 8 Nov 2019 16:56:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8Gunt3019528; Fri, 8 Nov 2019 16:56:49 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8Gun2a019527; Fri, 8 Nov 2019 16:56:49 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201911081656.xA8Gun2a019527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 8 Nov 2019 16:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354549 - head/lib/libpmc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/lib/libpmc X-SVN-Commit-Revision: 354549 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 16:56:49 -0000 Author: manu Date: Fri Nov 8 16:56:48 2019 New Revision: 354549 URL: https://svnweb.freebsd.org/changeset/base/354549 Log: libpmc: Match on the cpuid with a regex The CPUID is, or can be, a regex to be matched. Use regex from libc instead of strcmp Tested-by: gallatin MFC after: 1 week Modified: head/lib/libpmc/libpmc_pmu_util.c Modified: head/lib/libpmc/libpmc_pmu_util.c ============================================================================== --- head/lib/libpmc/libpmc_pmu_util.c Fri Nov 8 16:30:55 2019 (r354548) +++ head/lib/libpmc/libpmc_pmu_util.c Fri Nov 8 16:56:48 2019 (r354549) @@ -165,8 +165,11 @@ struct pmu_event_desc { static const struct pmu_events_map * pmu_events_map_get(const char *cpuid) { - size_t s; + regex_t re; + regmatch_t pmatch[1]; + size_t s, len; char buf[64]; + int match; const struct pmu_events_map *pme; if (cpuid != NULL) { @@ -179,9 +182,20 @@ pmu_events_map_get(const char *cpuid) (void *)NULL, 0) == -1) return (NULL); } - for (pme = pmu_events_map; pme->cpuid != NULL; pme++) - if (strcmp(buf, pme->cpuid) == 0) - return (pme); + for (pme = pmu_events_map; pme->cpuid != NULL; pme++) { + if (regcomp(&re, pme->cpuid, REG_EXTENDED) != 0) { + printf("regex '%s' failed to compile, ignoring\n", + pme->cpuid); + continue; + } + match = regexec(&re, buf, 1, pmatch, 0); + regfree(&re); + if (match == 0) { + len = pmatch[0].rm_eo - pmatch[0].rm_so; + if(len == strlen(buf)) + return (pme); + } + } return (NULL); } From owner-svn-src-head@freebsd.org Fri Nov 8 17:19:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E886E15842B; Fri, 8 Nov 2019 17:19:03 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478n7B6qkBz4dQX; Fri, 8 Nov 2019 17:19:02 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qk1-x743.google.com with SMTP id 205so5956356qkk.1; Fri, 08 Nov 2019 09:19:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:references:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=BSTrmw7VH9q7Jg7WiXu3AmIiiDguXVDPkE651Z24XV4=; b=rsDE1rv2w7cpEiTF6BBKBaXrBqsgfPVekdk/zgBQZUgWNAXSAB9Q5OfWnJwqf9jpSd UI2+J9svf9u1fo3I75pK5ziG9yT9/f5PsVXsLXjgLPvAFUE1aSILDGKiYgvy4ZsY3GXw 3U19fFNibu8mwHROIfYz6C5oDas8tOhG7LNUjxvgBEEAG2CYRPEcia52T/MCZFuOC4P5 d+cXlKXGporYYDVrzkDXIOaZM2CdgN6G5wdYsiK2fnpZdH7d31zirrpEtiGmibuLP7ej nOSlWPJJYvT6ecP56BBhlNS8xub74MODBqMdKRLBjfcriXNq3F1CYVYpgVxpOKfMvCzj nJUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:references:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=BSTrmw7VH9q7Jg7WiXu3AmIiiDguXVDPkE651Z24XV4=; b=A/YxY5RsLFSFmBwsSWzIkXHTG+3KvNkO8SkaKGPUA4UcgdOs6/rAjD7MiXQlFfyh0K AvxnsZOXjyFFHPf8SuXym02dF0dEh1Q0U02RcCOxXrBE6HpTWZ0qK+0eRh6jswOSEnwT 4cX3ySv6ArX/QA8wTsR6+cQnmTyN4ZedvE4dRpFBvXE/BUrBEqf9Hn2er05cCtDB71sk CMgyoWLk6yiQKL7meR+O/RiWHcshVpJ0O2H8aEPNS6qdO51e3hwkKM4B/NlBnHjmRqau giEUcZQmAl8LEA3nbJG16MRpRTwXoWxmAjwN4FNQif3KsJiBXMvnmHIakaUvI0oETLUj OGYg== X-Gm-Message-State: APjAAAVSarGIPTaRvuyELuON8Q+OuBTtCqu/yuKx/C8P8lvR22d/wktD gDRyGLOgQ+ZImjXtZMX9opaV2ZHW X-Google-Smtp-Source: APXvYqw8c4rZIexgnA+kgejxJXTHoo1qrgbFqX+8w1D7FeHqNXqLiykQkyCw6LkWGP/Hq/NToAiz4Q== X-Received: by 2002:a37:4f0a:: with SMTP id d10mr10072902qkb.286.1573233541656; Fri, 08 Nov 2019 09:19:01 -0800 (PST) Received: from mbp.home ([2804:f1c:800:fc00:a4ea:5918:a7:f7cd]) by smtp.gmail.com with ESMTPSA id j18sm2766948qtn.52.2019.11.08.09.18.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Nov 2019 09:19:00 -0800 (PST) Sender: Renato Botelho Subject: Re: svn commit: r354149 - head/sys/net From: Renato Botelho To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201910291736.x9THa6Gd018030@repo.freebsd.org> <781d285f-0b6d-45f1-f4b4-4bab60b789ae@FreeBSD.org> Autocrypt: addr=garga@FreeBSD.org; prefer-encrypt=mutual; keydata= mQENBFn4ZqUBCACxJRWi57JkmsCrSU0gZd/CwB+B90OTUeXmF63lDPETOQ+pBA4+vJgzjW1C pv7rR25wxvESJKphxZJOOk9AXTXsg5QrhdP3+KQG/zNcKd2ukbt3ezkhdMx8q81wn4wY2oTl WXdGIVdDKvC8sCp1fc6pPKJin71/skb9wg6ThtlRFlv9en4f8QSVmRuzRKQ6VjCbl+yIpiye /I5BQ4I99uouPzPhzf9ya3cvp4xbiw5wSo1F3nLsThBT2osYy/nRNz2ciuCYyyX87dGhio0T 8Pxl37eBbGQvCGwPQBApCcfoiZBN/5F65Tt4p72gIqT+AYuqq5G7Bhj+fGTC7q0QotL/ABEB AAG0LFJlbmF0byBCb3RlbGhvIChGcmVlQlNEKSA8Z2FyZ2FARnJlZUJTRC5vcmc+iQFXBBMB CgBBAhsDBQkFo5qABQsJCAcDBRUKCQgLBRYDAgEAAh4BAheAFiEExxiLNMqsn7yXmTy7W54E w5ZrhhoFAln4aeUCGQEACgkQW54Ew5ZrhhpTIwf+OS+Gv/ITOy7+8D+8SKXNmkfczsTO+Uqz 6SraXcq32j1C4QcRQCwGPhVJJgKnFSvPm3kbNPFXaQh1zD+mTQ4r/Loc78Rz+fZljYcgNx7n aQKhd9pdpXaELOe+Y10jvGUrT0SE06Y10BP/NmQaLplt9qG8VgLAAB9ZcsuZ9pzbBbQjd9In OK5VcXQzHT/EBBQ1rHsl1Aq8TYdmjbKl+HKc1c8dJ5OfXrgnTIUwQdN1rauXbmH/YW/CKN7z zF59v/sPBTaWfFl2CS/BORhWhe1PBudrVZWFT0oJGNuG6k8dlnssoL/0ojFaN5w5xm8mvMAf uAuixGf4bK6C7hcE34D/ULkBDQRZ+GalAQgApiTibUM0OpeCcxf5YUep4F4y853ClU4TMqZO +ho38sz0GdshQWuBEBqahOtxapHUMtlmC+wJNCBAav5JYjHHrXXE9pgRm5EgVssDpMvplLB4 5CFdx5jBu02Bt9Wp5bD21TPH3rsYJUB3rYmxWfVmdRhNBERrCJu49OIsBSKAlIinx8altYrh Z7bO2C1hKOG6QHWRr4ml4HTD/gZ6TTfsrR+sktBNv/5ZRkcJNDVM+eOGagXkEUOVFe9KXynD 3KcZBbBKpwoaW5GK8OglKJt8ggUfc78CG1xk4b5nL8QCk0CBrC6VPPOYvXTpYSTHmx1QkElm 1iNu1Tc5ccvcyAwTswARAQABiQE8BBgBCgAmFiEExxiLNMqsn7yXmTy7W54Ew5ZrhhoFAln4 ZqUCGwwFCQWjmoAACgkQW54Ew5ZrhhoH3wf+KuIeDyvIJOui+0C5FD5r44Bwkj/SAUVUerfp 0qtRktc+BZoSifPs3Rqjh/PpwRvLTuJnSsiqWLz8NCTThogRzVqEcQHqZR3vOjtYM60sjYJ+ BGQl/bjm1C/YtWEEmKs7mJc+02U8qJA4rbNKSRRRoz6XngnuN6YC0fkeD7c7rxRhOg6OWasZ JinB9+dO1IH7eZ5c97v518qSaLRp0T7I+FpEGOp7tTFHaepZWEnuojr5D6jI1MOEywy0EWJu 3m0TYlh935I8o7gLABqoHEmUeW7JK7r91SZaFnr8zQ6XOAxkPh50uFMTNtNZTnM7k1pRv5Ov fms0VzARITYzTwmpDQ== Message-ID: Date: Fri, 8 Nov 2019 14:18:57 -0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <781d285f-0b6d-45f1-f4b4-4bab60b789ae@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 478n7B6qkBz4dQX X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=rsDE1rv2; dmarc=none; spf=pass (mx1.freebsd.org: domain of gargabsd@gmail.com designates 2607:f8b0:4864:20::743 as permitted sender) smtp.mailfrom=gargabsd@gmail.com X-Spamd-Result: default: False [-2.52 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_NEQ_ENVFROM(0.00)[garga@FreeBSD.org,gargabsd@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.33)[ip: (2.74), ipnet: 2607:f8b0::/32(-2.34), asn: 15169(-2.01), country: US(-0.05)]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[3.4.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-0.99)[-0.992,0]; FORGED_SENDER(0.30)[garga@FreeBSD.org,gargabsd@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 17:19:04 -0000 On 08/11/19 13:27, Renato Botelho wrote: > On 29/10/19 14:36, Gleb Smirnoff wrote: >> Author: glebius >> Date: Tue Oct 29 17:36:06 2019 >> New Revision: 354149 >> URL: https://svnweb.freebsd.org/changeset/base/354149 >> >> Log: >> There is a long standing problem with multicast programming for NICs >> and IPv6. With IPv6 we may call if_addmulti() in context of processing >> of an incoming packet. Usually this is interrupt context. While most >> of the NIC drivers are able to reprogram multicast filters without >> sleeping, some of them can't. An example is e1000 family of drivers. >> With iflib conversion the problem was somewhat hidden. Iflib processes >> packets in private taskqueue, so going to sleep doesn't trigger an >> assertion. However, the sleep would block operation of the driver and >> following incoming packets would fill the ring and eventually would >> start being dropped. Enabling epoch for the full time of a packet >> processing again started to trigger assertions for e1000. >> >> Fix this problem once and for all using a general taskqueue to call >> if_ioctl() method in all cases when if_addmulti() is called in a >> non sleeping context. Note that nobody cares about returned value. >> >> Reviewed by: hselasky, kib >> Differential Revision: https://reviews.freebsd.org/D22154 > > Hi Gleb, > > I upgraded my laptop running 13-CURRENT from r354133 to r354437 and it > crashed during boot as you can see in the pictures [1]. It seems like > it crashed while it was configuring network. > > After bisect I managed to boot fine with r354148 and reproduce the crash > with this revision applied. > > Here is the relevant portion of my /etc/rc.conf: > > # Lagg > ifconfig_em0="up" > wlans_iwn0="wlan0" > ifconfig_wlan0="WPA" > create_args_wlan0="wlanaddr 3c:97:0e:48:3f:f8 up" > cloned_interfaces="lagg0" > ifconfig_lagg0="up laggproto failover laggport em0 laggport wlan0 DHCP" > ifconfig_lagg0_ipv6="inet6 accept_rtadv" > rtsold_enable="YES" > > [1] https://imgur.com/a/lBtq3FW I forgot to mention. If I disable IPv6 on lagg interface the crash is gone. -- Renato Botelho From owner-svn-src-head@freebsd.org Fri Nov 8 17:27:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34BB715876A; Fri, 8 Nov 2019 17:27:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478nJn0KkTz4dvZ; Fri, 8 Nov 2019 17:27:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E28491747; Fri, 8 Nov 2019 17:27:20 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8HRKoK038979; Fri, 8 Nov 2019 17:27:20 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8HRK2J038978; Fri, 8 Nov 2019 17:27:20 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201911081727.xA8HRK2J038978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 8 Nov 2019 17:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354550 - head/lib/libpmc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/lib/libpmc X-SVN-Commit-Revision: 354550 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 17:27:21 -0000 Author: manu Date: Fri Nov 8 17:27:20 2019 New Revision: 354550 URL: https://svnweb.freebsd.org/changeset/base/354550 Log: libpmc: Forgot regex.h Reported by: ci MFC after: 1 week X-MFC-With: r354549 Modified: head/lib/libpmc/libpmc_pmu_util.c Modified: head/lib/libpmc/libpmc_pmu_util.c ============================================================================== --- head/lib/libpmc/libpmc_pmu_util.c Fri Nov 8 16:56:48 2019 (r354549) +++ head/lib/libpmc/libpmc_pmu_util.c Fri Nov 8 17:27:20 2019 (r354550) @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include From owner-svn-src-head@freebsd.org Fri Nov 8 17:33:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E23BD158B19; Fri, 8 Nov 2019 17:33:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478nRb5WByz4fSc; Fri, 8 Nov 2019 17:33:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-5.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id EC965EBF; Fri, 8 Nov 2019 17:33:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r354491 - in head: . lib/msun/src libexec libexec/rtld-elf libexec/rtld-elf32 share/mk usr.bin usr.bin/ldd32 To: Brooks Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201911072258.xA7MwBkh050268@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Fri, 8 Nov 2019 09:33:13 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <201911072258.xA7MwBkh050268@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 17:33:16 -0000 On 11/7/19 2:58 PM, Brooks Davis wrote: > Author: brooks > Date: Thu Nov 7 22:58:10 2019 > New Revision: 354491 > URL: https://svnweb.freebsd.org/changeset/base/354491 > > Log: > libcompat: build 32-bit rtld and ldd as part of "everything" > > Alter bsd.compat.mk to set MACHINE and MACHINE_ARCH when included > directly so MD paths in Makefiles work. In the process centralize > setting them in LIBCOMPATWMAKEENV. > > Alter .PATH and CFLAGS settings in work when the Makefile is included. > > While here only support LIB32 on supported platforms rather than always > enabling it and requiring users of MK_LIB32 to filter based > TARGET/MACHINE_ARCH. > > The net effect of this change is to make Makefile.libcompat only build > compatability libraries. > > Changes relative to r354449: > > Correct detection of the compiler type when bsd.compat.mk is used > outside Makefile.libcompat. Previously it always matched the clang > case. > > Set LDFLAGS including the linker emulation for mips where -m32 seems to > be insufficent. Hmm, so mips doesn't use -m32 at all (it doesn't work there), but mips should be setting -mabi=o32 which the compiler driver should use to pass the right linker emulation to ld. Only bare LD instances (which mostly don't exist anymore) should require the explicit emulation. That is what the old Makefile.libcompat was doing which worked fine. -- John Baldwin From owner-svn-src-head@freebsd.org Fri Nov 8 17:33:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 616EC158BD4; Fri, 8 Nov 2019 17:33:43 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478nS71vTVz4fcC; Fri, 8 Nov 2019 17:33:43 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 249ED1942; Fri, 8 Nov 2019 17:33:43 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8HXh2Q044802; Fri, 8 Nov 2019 17:33:43 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8HXh8B044801; Fri, 8 Nov 2019 17:33:43 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201911081733.xA8HXh8B044801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 8 Nov 2019 17:33:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354551 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 354551 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 17:33:43 -0000 Author: gjb Date: Fri Nov 8 17:33:42 2019 New Revision: 354551 URL: https://svnweb.freebsd.org/changeset/base/354551 Log: Dereference lem(4), no longer in 13-CURRENT. While here, fix formatting of inline parenthesis and Xrs. Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: head/share/man/man4/netmap.4 Modified: head/share/man/man4/netmap.4 ============================================================================== --- head/share/man/man4/netmap.4 Fri Nov 8 17:27:20 2019 (r354550) +++ head/share/man/man4/netmap.4 Fri Nov 8 17:33:42 2019 (r354551) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 26, 2019 +.Dd November 8, 2019 .Dt NETMAP 4 .Os .Sh NAME @@ -828,7 +828,7 @@ On .Xr cxgbe 4 , .Xr em 4 , .Xr iflib 4 -(providing igb, em and lem), +.Pq providing Xr igb 4 and Xr em 4 , .Xr ixgbe 4 , .Xr ixl 4 , .Xr re 4 , From owner-svn-src-head@freebsd.org Fri Nov 8 17:57:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 003501592FA; Fri, 8 Nov 2019 17:57:05 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478nz46CFzz3Bxh; Fri, 8 Nov 2019 17:57:04 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4DAD1D0D; Fri, 8 Nov 2019 17:57:04 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8Hv4l6056494; Fri, 8 Nov 2019 17:57:04 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8Hv3j0056489; Fri, 8 Nov 2019 17:57:03 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201911081757.xA8Hv3j0056489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Fri, 8 Nov 2019 17:57:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354552 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 354552 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 17:57:05 -0000 Author: vmaffione Date: Fri Nov 8 17:57:03 2019 New Revision: 354552 URL: https://svnweb.freebsd.org/changeset/base/354552 Log: bhyve: add support for virtio-net mergeable rx buffers Mergeable rx buffers is a virtio-net feature that allows the hypervisor to use multiple RX descriptor chains to receive a single receive packet. Without this feature, a TSO-enabled guest is compelled to publish only 64K (or 32K) long chains, and each of these large buffers is consumed to receive a single packet, even a very short one. This is a waste of memory, as a RX queue has room for 256 chains, which means up to 16MB of buffer memory for each (single-queue) vtnet device. With the feature on, the guest can publish 2K long chains, and the hypervisor will merge them as needed. This change also enables the feature in the netmap backend, which supports virtio-net offloads. We plan to add support for the tap backend too. Note that differently from QEMU/KVM, here we implement one-copy receive, while QEMU uses two copies. Reviewed by: jhb MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D21007 Modified: head/usr.sbin/bhyve/net_backends.c head/usr.sbin/bhyve/pci_virtio_console.c head/usr.sbin/bhyve/pci_virtio_net.c head/usr.sbin/bhyve/virtio.c head/usr.sbin/bhyve/virtio.h Modified: head/usr.sbin/bhyve/net_backends.c ============================================================================== --- head/usr.sbin/bhyve/net_backends.c Fri Nov 8 17:33:42 2019 (r354551) +++ head/usr.sbin/bhyve/net_backends.c Fri Nov 8 17:57:03 2019 (r354552) @@ -328,7 +328,8 @@ DATA_SET(net_backend_set, vmnet_backend); #define NETMAP_FEATURES (VIRTIO_NET_F_CSUM | VIRTIO_NET_F_HOST_TSO4 | \ VIRTIO_NET_F_HOST_TSO6 | VIRTIO_NET_F_HOST_UFO | \ VIRTIO_NET_F_GUEST_CSUM | VIRTIO_NET_F_GUEST_TSO4 | \ - VIRTIO_NET_F_GUEST_TSO6 | VIRTIO_NET_F_GUEST_UFO) + VIRTIO_NET_F_GUEST_TSO6 | VIRTIO_NET_F_GUEST_UFO | \ + VIRTIO_NET_F_MRG_RXBUF) struct netmap_priv { char ifname[IFNAMSIZ]; Modified: head/usr.sbin/bhyve/pci_virtio_console.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_console.c Fri Nov 8 17:33:42 2019 (r354551) +++ head/usr.sbin/bhyve/pci_virtio_console.c Fri Nov 8 17:57:03 2019 (r354552) @@ -423,7 +423,7 @@ pci_vtcon_sock_rx(int fd __unused, enum ev_type t __un len = readv(sock->vss_conn_fd, &iov, n); if (len == 0 || (len < 0 && errno == EWOULDBLOCK)) { - vq_retchain(vq); + vq_retchains(vq, 1); vq_endchains(vq, 0); if (len == 0) goto close; Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Fri Nov 8 17:33:42 2019 (r354551) +++ head/usr.sbin/bhyve/pci_virtio_net.c Fri Nov 8 17:57:03 2019 (r354552) @@ -58,11 +58,14 @@ __FBSDID("$FreeBSD$"); #include "virtio.h" #include "net_utils.h" #include "net_backends.h" +#include "iov.h" #define VTNET_RINGSZ 1024 #define VTNET_MAXSEGS 256 +#define VTNET_MAX_PKT_LEN (65536 + 64) + #define VTNET_S_HOSTCAPS \ ( VIRTIO_NET_F_MAC | VIRTIO_NET_F_STATUS | \ VIRTIO_F_NOTIFY_ON_EMPTY | VIRTIO_RING_F_INDIRECT_DESC) @@ -170,59 +173,119 @@ pci_vtnet_reset(void *vsc) pthread_mutex_unlock(&sc->rx_mtx); } +struct virtio_mrg_rxbuf_info { + uint16_t idx; + uint16_t pad; + uint32_t len; +}; + static void pci_vtnet_rx(struct pci_vtnet_softc *sc) { + struct virtio_mrg_rxbuf_info info[VTNET_MAXSEGS]; struct iovec iov[VTNET_MAXSEGS + 1]; struct vqueue_info *vq; - int len, n; - uint16_t idx; + uint32_t cur_iov_bytes; + struct iovec *cur_iov; + uint16_t cur_iov_len; + uint32_t ulen; + int n_chains; + int len; vq = &sc->vsc_queues[VTNET_RXQ]; for (;;) { /* - * Check for available rx buffers. + * Get a descriptor chain to store the next ingress + * packet. In case of mergeable rx buffers, get as + * many chains as necessary in order to make room + * for a maximum sized LRO packet. */ - if (!vq_has_descs(vq)) { - /* No rx buffers. Enable RX kicks and double check. */ - vq_kick_enable(vq); - if (!vq_has_descs(vq)) { + cur_iov_bytes = 0; + cur_iov_len = 0; + cur_iov = iov; + n_chains = 0; + do { + int n = vq_getchain(vq, &info[n_chains].idx, cur_iov, + VTNET_MAXSEGS - cur_iov_len, NULL); + + if (n == 0) { /* - * Still no buffers. Interrupt if needed - * (including for NOTIFY_ON_EMPTY), and - * disable the backend until the next kick. + * No rx buffers. Enable RX kicks and double + * check. */ - vq_endchains(vq, /*used_all_avail=*/1); - netbe_rx_disable(sc->vsc_be); - return; + vq_kick_enable(vq); + if (!vq_has_descs(vq)) { + /* + * Still no buffers. Return the unused + * chains (if any), interrupt if needed + * (including for NOTIFY_ON_EMPTY), and + * disable the backend until the next + * kick. + */ + vq_retchains(vq, n_chains); + vq_endchains(vq, /*used_all_avail=*/1); + netbe_rx_disable(sc->vsc_be); + return; + } + + /* More rx buffers found, so keep going. */ + vq_kick_disable(vq); + continue; } + assert(n >= 1 && cur_iov_len + n <= VTNET_MAXSEGS); + cur_iov_len += n; + if (!sc->rx_merge) { + n_chains = 1; + break; + } + info[n_chains].len = (uint32_t)count_iov(cur_iov, n); + cur_iov_bytes += info[n_chains].len; + cur_iov += n; + n_chains++; + } while (cur_iov_bytes < VTNET_MAX_PKT_LEN && + cur_iov_len < VTNET_MAXSEGS); - /* More rx buffers found, so keep going. */ - vq_kick_disable(vq); - } + len = netbe_recv(sc->vsc_be, iov, cur_iov_len); - /* - * Get descriptor chain. - */ - n = vq_getchain(vq, &idx, iov, VTNET_MAXSEGS, NULL); - assert(n >= 1 && n <= VTNET_MAXSEGS); - - len = netbe_recv(sc->vsc_be, iov, n); - if (len <= 0) { /* * No more packets (len == 0), or backend errored * (err < 0). Return unused available buffers * and stop. */ - vq_retchain(vq); + vq_retchains(vq, n_chains); /* Interrupt if needed/appropriate and stop. */ vq_endchains(vq, /*used_all_avail=*/0); return; } - /* Publish the info to the guest */ - vq_relchain(vq, idx, (uint32_t)len); + ulen = (uint32_t)len; /* avoid too many casts below */ + + /* Publish the used buffers to the guest. */ + if (!sc->rx_merge) { + vq_relchain(vq, info[0].idx, ulen); + } else { + struct virtio_net_rxhdr *hdr = iov[0].iov_base; + uint32_t iolen; + int i = 0; + + assert(iov[0].iov_len >= sizeof(*hdr)); + + do { + iolen = info[i].len; + if (iolen > ulen) { + iolen = ulen; + } + vq_relchain_prepare(vq, info[i].idx, iolen); + ulen -= iolen; + i++; + assert(i <= n_chains); + } while (ulen > 0); + + hdr->vrh_bufs = i; + vq_relchain_publish(vq); + vq_retchains(vq, n_chains - i); + } } } Modified: head/usr.sbin/bhyve/virtio.c ============================================================================== --- head/usr.sbin/bhyve/virtio.c Fri Nov 8 17:33:42 2019 (r354551) +++ head/usr.sbin/bhyve/virtio.c Fri Nov 8 17:57:03 2019 (r354552) @@ -102,6 +102,7 @@ vi_reset_dev(struct virtio_softc *vs) for (vq = vs->vs_queues, i = 0; i < nvq; vq++, i++) { vq->vq_flags = 0; vq->vq_last_avail = 0; + vq->vq_next_used = 0; vq->vq_save_used = 0; vq->vq_pfn = 0; vq->vq_msix_idx = VIRTIO_MSI_NO_VECTOR; @@ -199,6 +200,7 @@ vi_vq_init(struct virtio_softc *vs, uint32_t pfn) /* Mark queue as allocated, and start at 0 when we use it. */ vq->vq_flags = VQ_ALLOC; vq->vq_last_avail = 0; + vq->vq_next_used = 0; vq->vq_save_used = 0; } @@ -279,7 +281,7 @@ vq_getchain(struct vqueue_info *vq, uint16_t *pidx, * the guest has written are valid (including all their * vd_next fields and vd_flags). * - * Compute (last_avail - va_idx) in integers mod 2**16. This is + * Compute (va_idx - last_avail) in integers mod 2**16. This is * the number of descriptors the device has made available * since the last time we updated vq->vq_last_avail. * @@ -382,38 +384,30 @@ loopy: } /* - * Return the currently-first request chain back to the available queue. + * Return the first n_chain request chains back to the available queue. * - * (This chain is the one you handled when you called vq_getchain() + * (These chains are the ones you handled when you called vq_getchain() * and used its positive return value.) */ void -vq_retchain(struct vqueue_info *vq) +vq_retchains(struct vqueue_info *vq, uint16_t n_chains) { - vq->vq_last_avail--; + vq->vq_last_avail -= n_chains; } -/* - * Return specified request chain to the guest, setting its I/O length - * to the provided value. - * - * (This chain is the one you handled when you called vq_getchain() - * and used its positive return value.) - */ void -vq_relchain(struct vqueue_info *vq, uint16_t idx, uint32_t iolen) +vq_relchain_prepare(struct vqueue_info *vq, uint16_t idx, uint32_t iolen) { - uint16_t uidx, mask; volatile struct vring_used *vuh; volatile struct virtio_used *vue; + uint16_t mask; /* * Notes: * - mask is N-1 where N is a power of 2 so computes x % N * - vuh points to the "used" data shared with guest * - vue points to the "used" ring entry we want to update - * - head is the same value we compute in vq_iovecs(). * * (I apologize for the two fields named vu_idx; the * virtio spec calls the one that vue points to, "id"...) @@ -421,18 +415,35 @@ vq_relchain(struct vqueue_info *vq, uint16_t idx, uint mask = vq->vq_qsize - 1; vuh = vq->vq_used; - uidx = vuh->vu_idx; - vue = &vuh->vu_ring[uidx++ & mask]; + vue = &vuh->vu_ring[vq->vq_next_used++ & mask]; vue->vu_idx = idx; vue->vu_tlen = iolen; +} +void +vq_relchain_publish(struct vqueue_info *vq) +{ /* * Ensure the used descriptor is visible before updating the index. * This is necessary on ISAs with memory ordering less strict than x86 * (and even on x86 to act as a compiler barrier). */ atomic_thread_fence_rel(); - vuh->vu_idx = uidx; + vq->vq_used->vu_idx = vq->vq_next_used; +} + +/* + * Return specified request chain to the guest, setting its I/O length + * to the provided value. + * + * (This chain is the one you handled when you called vq_getchain() + * and used its positive return value.) + */ +void +vq_relchain(struct vqueue_info *vq, uint16_t idx, uint32_t iolen) +{ + vq_relchain_prepare(vq, idx, iolen); + vq_relchain_publish(vq); } /* Modified: head/usr.sbin/bhyve/virtio.h ============================================================================== --- head/usr.sbin/bhyve/virtio.h Fri Nov 8 17:33:42 2019 (r354551) +++ head/usr.sbin/bhyve/virtio.h Fri Nov 8 17:57:03 2019 (r354552) @@ -392,6 +392,7 @@ struct vqueue_info { uint16_t vq_flags; /* flags (see above) */ uint16_t vq_last_avail; /* a recent value of vq_avail->va_idx */ + uint16_t vq_next_used; /* index of the next used slot to be filled */ uint16_t vq_save_used; /* saved vq_used->vu_idx; see vq_endchains */ uint16_t vq_msix_idx; /* MSI-X index, or VIRTIO_MSI_NO_VECTOR */ @@ -479,7 +480,10 @@ void vi_set_io_bar(struct virtio_softc *, int); int vq_getchain(struct vqueue_info *vq, uint16_t *pidx, struct iovec *iov, int n_iov, uint16_t *flags); -void vq_retchain(struct vqueue_info *vq); +void vq_retchains(struct vqueue_info *vq, uint16_t n_chains); +void vq_relchain_prepare(struct vqueue_info *vq, uint16_t idx, + uint32_t iolen); +void vq_relchain_publish(struct vqueue_info *vq); void vq_relchain(struct vqueue_info *vq, uint16_t idx, uint32_t iolen); void vq_endchains(struct vqueue_info *vq, int used_all_avail); From owner-svn-src-head@freebsd.org Fri Nov 8 18:26:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A4F915AC25; Fri, 8 Nov 2019 18:26:27 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 478pcz1d8Yz3F85; Fri, 8 Nov 2019 18:26:26 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id xA8IQI5i021143; Fri, 8 Nov 2019 10:26:18 -0800 (PST) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id xA8IQIUn021142; Fri, 8 Nov 2019 10:26:18 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201911081826.xA8IQIUn021142@gndrsh.dnsmgr.net> Subject: Re: svn commit: r350089 - head In-Reply-To: <20191108151541.GU5599@FreeBSD.org> To: Glen Barber Date: Fri, 8 Nov 2019 10:26:18 -0800 (PST) CC: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 478pcz1d8Yz3F85 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.99 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.987,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 18:26:27 -0000 > On Wed, Jul 17, 2019 at 07:09:06PM +0000, Mark Johnston wrote: > > Author: markj > > Date: Wed Jul 17 19:09:05 2019 > > New Revision: 350089 > > URL: https://svnweb.freebsd.org/changeset/base/350089 > > > > Log: > > Add an initial RELNOTES file. > > > > The intent is to provide a convenient location to document changes > > that are relevant to users of binary FreeBSD distributions, in contrast > > with UPDATING, which exists to document caveats for users who build > > FreeBSD from source. > > > > This complements the "Relnotes:" tag in commit messages by providing a > > place to document the change in more detail, or in case a "Relnotes:" > > tag was accidentally omitted. In particular, "Relnotes:" should be > > used if you do not intend to document the change in RELNOTES for some > > reason. > > > > Changes to the file should not be MFCed. For now the file will exist > > only in head, but may be updated via direct commits to stable branches > > depending on how things go. > > > > I had to go look at the original thread to remind myself about this, but > regarding not MFCing changes from head to stable branches, I think there > may have been some confusion in the discussion. > > By "changes should not be MFCed", at least based on my recollection of > how the conversation was going, I (at least) meant "not MFCed, but > committed as a direct commit to stable branches." In other words, > merging the RELNOTES change from head to stable/X does not really make > sense, as the revision numbers will have changed, and would inevitably > cause merge conflicts. > > Now that 12.1 is out, maybe we can expand the idea of this file into > stable/12 and even stable/11. One additional idea that came to mind is > with the formatting for stable branches. > > For example, in head, there is: > > rNNNNNN: > The foo(8) utility was added. > > For stable branches, I would propose the format of: > > rNNNNNM, MFC of rNNNNNN: > The foo(8) utility was added. > > Thoughts? My thoughs originally on this was that when a release noteable item is merged from head to stable the exact related commit to RELNOTES should also be merged unaltered. The RELNOTES file should state that revision numbers in this file are ^/HEAD revision numbers, and that a merge serach may be needed to find the branch verson of the MFC. The ^/head RELNOTES file should be trunkated to length 0 when a .0 branch is crated POST branch creation, thus all the relevant entries are in the file on the new branch and can grow as things are merged to it. Thus keeps the RELNOTES file in a state that matches the branch as far as entires, just the Rxxxxx is referential to when the entry was created relative to head. > Glen -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Nov 8 18:56:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B52EC15B8D0; Fri, 8 Nov 2019 18:56:04 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478qH84KvBz3GwB; Fri, 8 Nov 2019 18:56:04 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74C8227F2; Fri, 8 Nov 2019 18:56:04 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8Iu4XS091890; Fri, 8 Nov 2019 18:56:04 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8Iu39F091885; Fri, 8 Nov 2019 18:56:03 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201911081856.xA8Iu39F091885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Fri, 8 Nov 2019 18:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354553 - in head/tests/sys: netinet6 netpfil/common netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: in head/tests/sys: netinet6 netpfil/common netpfil/pf X-SVN-Commit-Revision: 354553 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 18:56:04 -0000 Author: lwhsu Date: Fri Nov 8 18:56:02 2019 New Revision: 354553 URL: https://svnweb.freebsd.org/changeset/base/354553 Log: Reenable netinet6 and netpfil tests on i386, net/scapy 2.4.3_2 contains the fix PR: 239380 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/netinet6/exthdr.sh head/tests/sys/netinet6/scapyi386.sh head/tests/sys/netpfil/common/forward.sh head/tests/sys/netpfil/common/tos.sh head/tests/sys/netpfil/pf/forward.sh head/tests/sys/netpfil/pf/set_tos.sh Modified: head/tests/sys/netinet6/exthdr.sh ============================================================================== --- head/tests/sys/netinet6/exthdr.sh Fri Nov 8 17:57:03 2019 (r354552) +++ head/tests/sys/netinet6/exthdr.sh Fri Nov 8 18:56:02 2019 (r354553) @@ -38,11 +38,6 @@ exthdr_head() { exthdr_body() { - if [ "$(atf_config_get ci false)" = "true" ] && \ - [ "$(uname -p)" = "i386" ]; then - atf_skip "https://bugs.freebsd.org/241493" - fi - ids=65533 id=`printf "%x" ${ids}` if [ $$ -gt 65535 ]; then Modified: head/tests/sys/netinet6/scapyi386.sh ============================================================================== --- head/tests/sys/netinet6/scapyi386.sh Fri Nov 8 17:57:03 2019 (r354552) +++ head/tests/sys/netinet6/scapyi386.sh Fri Nov 8 18:56:02 2019 (r354553) @@ -38,11 +38,6 @@ scapyi386_head() { scapyi386_body() { - if [ "$(atf_config_get ci false)" = "true" ] && \ - [ "$(uname -p)" = "i386" ]; then - atf_skip "https://bugs.freebsd.org/239380" - fi - ids=65533 id=`printf "%x" ${ids}` if [ $$ -gt 65535 ]; then Modified: head/tests/sys/netpfil/common/forward.sh ============================================================================== --- head/tests/sys/netpfil/common/forward.sh Fri Nov 8 17:57:03 2019 (r354552) +++ head/tests/sys/netpfil/common/forward.sh Fri Nov 8 18:56:02 2019 (r354553) @@ -40,10 +40,6 @@ v4_head() v4_body() { firewall=$1 - if [ "$(atf_config_get ci false)" = "true" ] && \ - [ "$(uname -p)" = "i386" ] && [ "${firewall}" = "pf" ]; then - atf_skip "https://bugs.freebsd.org/240085" - fi firewall_init $firewall epair_send=$(vnet_mkepair) Modified: head/tests/sys/netpfil/common/tos.sh ============================================================================== --- head/tests/sys/netpfil/common/tos.sh Fri Nov 8 17:57:03 2019 (r354552) +++ head/tests/sys/netpfil/common/tos.sh Fri Nov 8 18:56:02 2019 (r354553) @@ -40,10 +40,6 @@ tos_head() tos_body() { firewall=$1 - if [ "$(atf_config_get ci false)" = "true" ] && \ - [ "$(uname -p)" = "i386" ] && [ "${firewall}" = "pf" ]; then - atf_skip "https://bugs.freebsd.org/240086" - fi firewall_init $firewall epair_send=$(vnet_mkepair) Modified: head/tests/sys/netpfil/pf/forward.sh ============================================================================== --- head/tests/sys/netpfil/pf/forward.sh Fri Nov 8 17:57:03 2019 (r354552) +++ head/tests/sys/netpfil/pf/forward.sh Fri Nov 8 18:56:02 2019 (r354553) @@ -41,10 +41,6 @@ v4_head() v4_body() { - if [ `uname -p` = "i386" ]; then - atf_skip "https://bugs.freebsd.org/239380" - fi - pft_init epair_send=$(vnet_mkepair) @@ -104,10 +100,6 @@ v6_head() v6_body() { - if [ `uname -p` = "i386" ]; then - atf_skip "https://bugs.freebsd.org/239380" - fi - pft_init epair_send=$(vnet_mkepair) Modified: head/tests/sys/netpfil/pf/set_tos.sh ============================================================================== --- head/tests/sys/netpfil/pf/set_tos.sh Fri Nov 8 17:57:03 2019 (r354552) +++ head/tests/sys/netpfil/pf/set_tos.sh Fri Nov 8 18:56:02 2019 (r354553) @@ -41,10 +41,6 @@ v4_head() v4_body() { - if [ `uname -p` = "i386" ]; then - atf_skip "https://bugs.freebsd.org/239380" - fi - pft_init epair_send=$(vnet_mkepair) From owner-svn-src-head@freebsd.org Fri Nov 8 18:57:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9C4F15BA24; Fri, 8 Nov 2019 18:57:42 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478qK241WQz3HBj; Fri, 8 Nov 2019 18:57:42 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52FD127FB; Fri, 8 Nov 2019 18:57:42 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8Ivg7i092150; Fri, 8 Nov 2019 18:57:42 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8Ivf2J092145; Fri, 8 Nov 2019 18:57:41 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201911081857.xA8Ivf2J092145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 8 Nov 2019 18:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354554 - in head/sys: conf dev/extres/clk X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in head/sys: conf dev/extres/clk X-SVN-Commit-Revision: 354554 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 18:57:42 -0000 Author: mmel Date: Fri Nov 8 18:57:41 2019 New Revision: 354554 URL: https://svnweb.freebsd.org/changeset/base/354554 Log: Implement support for (soft)linked clocks. This kind of clock nodes represent temporary placeholder for clocks defined later in boot process. Also, these are necessary to break circular dependencies occasionally occurring in complex clock graphs. MFC after: 3 weeks Added: head/sys/dev/extres/clk/clk_link.c (contents, props changed) head/sys/dev/extres/clk/clk_link.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/extres/clk/clk.c head/sys/dev/extres/clk/clk.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Nov 8 18:56:02 2019 (r354553) +++ head/sys/conf/files Fri Nov 8 18:57:41 2019 (r354554) @@ -1681,6 +1681,7 @@ dev/extres/clk/clk_bus.c optional ext_resources clk fd dev/extres/clk/clk_div.c optional ext_resources clk fdt dev/extres/clk/clk_fixed.c optional ext_resources clk fdt dev/extres/clk/clk_gate.c optional ext_resources clk fdt +dev/extres/clk/clk_link.c optional ext_resources clk fdt dev/extres/clk/clk_mux.c optional ext_resources clk fdt dev/extres/phy/phy.c optional ext_resources phy fdt dev/extres/phy/phydev_if.m optional ext_resources phy fdt Modified: head/sys/dev/extres/clk/clk.c ============================================================================== --- head/sys/dev/extres/clk/clk.c Fri Nov 8 18:56:02 2019 (r354553) +++ head/sys/dev/extres/clk/clk.c Fri Nov 8 18:57:41 2019 (r354554) @@ -189,6 +189,9 @@ enum clknode_sysctl_type { static int clknode_sysctl(SYSCTL_HANDLER_ARGS); static int clkdom_sysctl(SYSCTL_HANDLER_ARGS); +static void clknode_finish(void *dummy); +SYSINIT(clknode_finish, SI_SUB_LAST, SI_ORDER_ANY, clknode_finish, NULL); + /* * Default clock methods for base class. */ @@ -526,20 +529,71 @@ clknode_create(struct clkdom * clkdom, clknode_class_t { struct clknode *clknode; struct sysctl_oid *clknode_oid; + bool replaced; KASSERT(def->name != NULL, ("clock name is NULL")); KASSERT(def->name[0] != '\0', ("clock name is empty")); -#ifdef INVARIANTS + if (def->flags & CLK_NODE_LINKED) { + KASSERT(def->parent_cnt == 0, + ("Linked clock must not have parents")); + KASSERT(clknode_class->size== 0, + ("Linked clock cannot have own softc")); + } + + /* Process duplicated clocks */ CLK_TOPO_SLOCK(); - if (clknode_find_by_name(def->name) != NULL) - panic("Duplicated clock registration: %s\n", def->name); + clknode = clknode_find_by_name(def->name); CLK_TOPO_UNLOCK(); -#endif + if (clknode != NULL) { + if (!(clknode->flags & CLK_NODE_LINKED) && + def->flags & CLK_NODE_LINKED) { + /* + * New clock is linked and real already exists. + * Do nothing and return real node. It is in right + * domain, enqueued in right lists and fully initialized. + */ + return (clknode); + } else if (clknode->flags & CLK_NODE_LINKED && + !(def->flags & CLK_NODE_LINKED)) { + /* + * New clock is real but linked already exists. + * Remove old linked node from originating domain + * (real clock must be owned by another) and from + * global names link (it will be added back into it + * again in following clknode_register()). Then reuse + * original clknode structure and reinitialize it + * with new dat. By this, all lists containing this + * node remains valid, but the new node virtually + * replace the linked one. + */ + KASSERT(clkdom != clknode->clkdom, + ("linked clock must be from another " + "domain that real one")); + TAILQ_REMOVE(&clkdom->clknode_list, clknode, + clkdom_link); + TAILQ_REMOVE(&clknode_list, clknode, clklist_link); + replaced = true; + } else if (clknode->flags & CLK_NODE_LINKED && + def->flags & CLK_NODE_LINKED) { + /* + * Both clocks are linked. + * Return old one, so we hold only one copy od link. + */ + return (clknode); + } else { + /* Both clocks are real */ + panic("Duplicated clock registration: %s\n", def->name); + } + } else { + /* Create clknode object and initialize it. */ + clknode = malloc(sizeof(struct clknode), M_CLOCK, + M_WAITOK | M_ZERO); + sx_init(&clknode->lock, "Clocknode lock"); + TAILQ_INIT(&clknode->children); + replaced = false; + } - /* Create object and initialize it. */ - clknode = malloc(sizeof(struct clknode), M_CLOCK, M_WAITOK | M_ZERO); kobj_init((kobj_t)clknode, (kobj_class_t)clknode_class); - sx_init(&clknode->lock, "Clocknode lock"); /* Allocate softc if required. */ if (clknode_class->size > 0) { @@ -568,8 +622,10 @@ clknode_create(struct clkdom * clkdom, clknode_class_t clknode->parent_cnt = def->parent_cnt; clknode->parent = NULL; clknode->parent_idx = CLKNODE_IDX_NONE; - TAILQ_INIT(&clknode->children); + if (replaced) + return (clknode); + sysctl_ctx_init(&clknode->sysctl_ctx); clknode_oid = SYSCTL_ADD_NODE(&clknode->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_hw_clock), @@ -617,6 +673,10 @@ clknode_register(struct clkdom * clkdom, struct clknod { int rv; + /* Skip already registered linked node */ + if (clknode->flags & CLK_NODE_REGISTERED) + return(clknode); + rv = CLKNODE_INIT(clknode, clknode_get_device(clknode)); if (rv != 0) { printf(" CLKNODE_INIT failed: %d\n", rv); @@ -624,10 +684,24 @@ clknode_register(struct clkdom * clkdom, struct clknod } TAILQ_INSERT_TAIL(&clkdom->clknode_list, clknode, clkdom_link); - + clknode->flags |= CLK_NODE_REGISTERED; return (clknode); } + +static void +clknode_finish(void *dummy) +{ + struct clknode *clknode; + + CLK_TOPO_SLOCK(); + TAILQ_FOREACH(clknode, &clknode_list, clklist_link) { + if (clknode->flags & CLK_NODE_LINKED) + printf("Unresolved linked clock found: %s\n", + clknode->name); + } + CLK_TOPO_UNLOCK(); +} /* * Clock providers interface. */ Modified: head/sys/dev/extres/clk/clk.h ============================================================================== --- head/sys/dev/extres/clk/clk.h Fri Nov 8 18:56:02 2019 (r354553) +++ head/sys/dev/extres/clk/clk.h Fri Nov 8 18:57:41 2019 (r354554) @@ -41,7 +41,9 @@ /* clknode flags. */ #define CLK_NODE_STATIC_STRINGS 0x00000001 /* Static name strings */ #define CLK_NODE_GLITCH_FREE 0x00000002 /* Freq can change w/o stop */ -#define CLK_NODE_CANNOT_STOP 0x00000004 /* Clock cannot be disabled */ +#define CLK_NODE_CANNOT_STOP 0x00000004 /* Cannot be disabled */ +#define CLK_NODE_LINKED 0x00000008 /* Is linked clock */ +#define CLK_NODE_REGISTERED 0x00000020 /* Is already registered */ /* Flags passed to clk_set_freq() and clknode_set_freq(). */ #define CLK_SET_ROUND(x) ((x) & (CLK_SET_ROUND_UP | CLK_SET_ROUND_DOWN)) Added: head/sys/dev/extres/clk/clk_link.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/clk/clk_link.c Fri Nov 8 18:57:41 2019 (r354554) @@ -0,0 +1,122 @@ +/*- + * Copyright 2016 Michal Meloun + * 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 +#include + +#include + +#include +#include +#include + +static int clknode_link_init(struct clknode *clk, device_t dev); +static int clknode_link_recalc(struct clknode *clk, uint64_t *freq); +static int clknode_link_set_freq(struct clknode *clk, uint64_t fin, + uint64_t *fout, int flags, int *stop); +static int clknode_link_set_mux(struct clknode *clk, int idx); +static int clknode_link_set_gate(struct clknode *clk, bool enable); + +static clknode_method_t clknode_link_methods[] = { + /* Device interface */ + CLKNODEMETHOD(clknode_init, clknode_link_init), + CLKNODEMETHOD(clknode_recalc_freq, clknode_link_recalc), + CLKNODEMETHOD(clknode_set_freq, clknode_link_set_freq), + CLKNODEMETHOD(clknode_set_gate, clknode_link_set_gate), + CLKNODEMETHOD(clknode_set_mux, clknode_link_set_mux), + CLKNODEMETHOD_END +}; +DEFINE_CLASS_1(clknode_link, clknode_link_class, clknode_link_methods, + 0, clknode_class); + +static int +clknode_link_init(struct clknode *clk, device_t dev) +{ + return(0); +} + +static int +clknode_link_recalc(struct clknode *clk, uint64_t *freq) +{ + + printf("%s: Attempt to use unresolved linked clock: %s\n", __func__, + clknode_get_name(clk)); + return (EBADF); +} + +static int +clknode_link_set_freq(struct clknode *clk, uint64_t fin, uint64_t *fout, + int flags, int *stop) +{ + + printf("%s: Attempt to use unresolved linked clock: %s\n", __func__, + clknode_get_name(clk)); + return (EBADF); +} + +static int +clknode_link_set_mux(struct clknode *clk, int idx) +{ + + printf("%s: Attempt to use unresolved linked clock: %s\n", __func__, + clknode_get_name(clk)); + return (EBADF); +} + +static int +clknode_link_set_gate(struct clknode *clk, bool enable) +{ + + printf("%s: Attempt to use unresolved linked clock: %s\n", __func__, + clknode_get_name(clk)); + return (EBADF); +} + +int +clknode_link_register(struct clkdom *clkdom, struct clk_link_def *clkdef) +{ + struct clknode *clk; + struct clknode_init_def tmp; + + tmp = clkdef->clkdef; + tmp.flags |= CLK_NODE_LINKED; + clk = clknode_create(clkdom, &clknode_link_class, &tmp); + if (clk == NULL) + return (1); + clknode_register(clkdom, clk); + return (0); +} Added: head/sys/dev/extres/clk/clk_link.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/clk/clk_link.h Fri Nov 8 18:57:41 2019 (r354554) @@ -0,0 +1,47 @@ +/*- + * Copyright 2016 Michal Meloun + * 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 _DEV_EXTRES_CLK_LINK_H_ +#define _DEV_EXTRES_CLK_LINK_H_ + +#include + +/* + * A linked clock is used as placeholder for not yet available clock. + * It will be replaced by equally named clock from other domain, created + * in future stage of system initialization. +*/ + +struct clk_link_def { + struct clknode_init_def clkdef; + +}; + +int clknode_link_register(struct clkdom *clkdom, struct clk_link_def *clkdef); + +#endif /*_DEV_EXTRES_CLK_LINK_H_*/ From owner-svn-src-head@freebsd.org Fri Nov 8 19:03:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51EB715BD4C; Fri, 8 Nov 2019 19:03:36 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478qRr1Rbdz3HgJ; Fri, 8 Nov 2019 19:03:36 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14E4029BA; Fri, 8 Nov 2019 19:03:36 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8J3ZrF098060; Fri, 8 Nov 2019 19:03:35 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8J3Ypt098054; Fri, 8 Nov 2019 19:03:34 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201911081903.xA8J3Ypt098054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 8 Nov 2019 19:03:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354555 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 354555 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 19:03:36 -0000 Author: mmel Date: Fri Nov 8 19:03:34 2019 New Revision: 354555 URL: https://svnweb.freebsd.org/changeset/base/354555 Log: Cleanup Rockchip clocks implementation. - style - unify dprinf defines - make dprinf's 32-bit compatible Not a functional change. MFC after: 3 weeks Reviewed by: manu, imp Differential Revision: https://reviews.freebsd.org/D22281 Modified: head/sys/arm64/rockchip/clk/rk_clk_armclk.c head/sys/arm64/rockchip/clk/rk_clk_composite.c head/sys/arm64/rockchip/clk/rk_clk_gate.c head/sys/arm64/rockchip/clk/rk_clk_mux.c head/sys/arm64/rockchip/clk/rk_clk_pll.c head/sys/arm64/rockchip/clk/rk_cru.c Modified: head/sys/arm64/rockchip/clk/rk_clk_armclk.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_armclk.c Fri Nov 8 18:57:41 2019 (r354554) +++ head/sys/arm64/rockchip/clk/rk_clk_armclk.c Fri Nov 8 19:03:34 2019 (r354555) @@ -67,15 +67,19 @@ struct rk_clk_armclk_sc { CLKDEV_WRITE_4(clknode_get_device(_clk), off, val) #define READ4(_clk, off, val) \ CLKDEV_READ_4(clknode_get_device(_clk), off, val) -#define DEVICE_LOCK(_clk) \ +#define DEVICE_LOCK(_clk) \ CLKDEV_DEVICE_LOCK(clknode_get_device(_clk)) #define DEVICE_UNLOCK(_clk) \ CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk)) #define RK_ARMCLK_WRITE_MASK_SHIFT 16 -/* #define dprintf(format, arg...) printf("%s:(%s)" format, __func__, clknode_get_name(clk), arg) */ +#if 0 +#define dprintf(format, arg...) \ + printf("%s:(%s)" format, __func__, clknode_get_name(clk), arg) +#else #define dprintf(format, arg...) +#endif static int rk_clk_armclk_init(struct clknode *clk, device_t dev) @@ -132,7 +136,7 @@ rk_clk_armclk_recalc(struct clknode *clk, uint64_t *fr DEVICE_UNLOCK(clk); div = ((reg & sc->div_mask) >> sc->div_shift) + 1; - dprintf("parent_freq=%lu, div=%u\n", *freq, div); + dprintf("parent_freq=%ju, div=%u\n", *freq, div); *freq = *freq / div; @@ -152,7 +156,7 @@ rk_clk_armclk_set_freq(struct clknode *clk, uint64_t f sc = clknode_get_softc(clk); - dprintf("Finding best parent/div for target freq of %lu\n", *fout); + dprintf("Finding best parent/div for target freq of %ju\n", *fout); p_names = clknode_get_parent_names(clk); p_main = clknode_find_by_name(p_names[sc->main_parent]); @@ -162,7 +166,7 @@ rk_clk_armclk_set_freq(struct clknode *clk, uint64_t f div = sc->rates[i].div; best_p = best * div; rate = i; - dprintf("Best parent %s (%d) with best freq at %lu\n", + dprintf("Best parent %s (%d) with best freq at %ju\n", clknode_get_name(p_main), sc->main_parent, best); @@ -179,17 +183,18 @@ rk_clk_armclk_set_freq(struct clknode *clk, uint64_t f return (0); } - dprintf("Changing parent (%s) freq to %lu\n", clknode_get_name(p_main), best_p); + dprintf("Changing parent (%s) freq to %ju\n", clknode_get_name(p_main), + best_p); err = clknode_set_freq(p_main, best_p, 0, 1); if (err != 0) - printf("Cannot set %s to %lu\n", + printf("Cannot set %s to %ju\n", clknode_get_name(p_main), best_p); clknode_set_parent_by_idx(clk, sc->main_parent); clknode_get_freq(p_main, &best_p); - dprintf("main parent freq at %lu\n", best_p); + dprintf("main parent freq at %ju\n", best_p); DEVICE_LOCK(clk); val |= (div - 1) << sc->div_shift; val |= sc->div_mask << RK_ARMCLK_WRITE_MASK_SHIFT; Modified: head/sys/arm64/rockchip/clk/rk_clk_composite.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_composite.c Fri Nov 8 18:57:41 2019 (r354554) +++ head/sys/arm64/rockchip/clk/rk_clk_composite.c Fri Nov 8 19:03:34 2019 (r354555) @@ -61,15 +61,19 @@ struct rk_clk_composite_sc { CLKDEV_WRITE_4(clknode_get_device(_clk), off, val) #define READ4(_clk, off, val) \ CLKDEV_READ_4(clknode_get_device(_clk), off, val) -#define DEVICE_LOCK(_clk) \ +#define DEVICE_LOCK(_clk) \ CLKDEV_DEVICE_LOCK(clknode_get_device(_clk)) #define DEVICE_UNLOCK(_clk) \ CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk)) #define RK_CLK_COMPOSITE_MASK_SHIFT 16 -/* #define dprintf(format, arg...) printf("%s:(%s)" format, __func__, clknode_get_name(clk), arg) */ +#if 0 +#define dprintf(format, arg...) \ + printf("%s:(%s)" format, __func__, clknode_get_name(clk), arg) +#else #define dprintf(format, arg...) +#endif static int rk_clk_composite_init(struct clknode *clk, device_t dev) @@ -158,6 +162,7 @@ rk_clk_composite_recalc(struct clknode *clk, uint64_t dprintf("parent_freq=%lu, div=%u\n", *freq, div); *freq = *freq / div; + dprintf("Final freq=%ju\n", *freq); return (0); } @@ -194,20 +199,22 @@ rk_clk_composite_set_freq(struct clknode *clk, uint64_ sc = clknode_get_softc(clk); - dprintf("Finding best parent/div for target freq of %lu\n", *fout); + dprintf("Finding best parent/div for target freq of %ju\n", *fout); p_names = clknode_get_parent_names(clk); for (best_div = 0, best = 0, p_idx = 0; p_idx != clknode_get_parents_num(clk); p_idx++) { p_clk = clknode_find_by_name(p_names[p_idx]); clknode_get_freq(p_clk, &fparent); - dprintf("Testing with parent %s (%d) at freq %lu\n", clknode_get_name(p_clk), p_idx, fparent); + dprintf("Testing with parent %s (%d) at freq %ju\n", + clknode_get_name(p_clk), p_idx, fparent); div = rk_clk_composite_find_best(sc, fparent, *fout); cur = fparent / div; if ((*fout - cur) < (*fout - best)) { best = cur; best_div = div; best_parent = p_idx; - dprintf("Best parent so far %s (%d) with best freq at %lu\n", clknode_get_name(p_clk), p_idx, best); + dprintf("Best parent so far %s (%d) with best freq at " + "%ju\n", clknode_get_name(p_clk), p_idx, best); } } @@ -233,7 +240,8 @@ rk_clk_composite_set_freq(struct clknode *clk, uint64_ p_idx = clknode_get_parent_idx(clk); if (p_idx != best_parent) { - dprintf("Switching parent index from %d to %d\n", p_idx, best_parent); + dprintf("Switching parent index from %d to %d\n", p_idx, + best_parent); clknode_set_parent_by_idx(clk, best_parent); } @@ -266,7 +274,8 @@ DEFINE_CLASS_1(rk_clk_composite_clknode, rk_clk_compos clknode_class); int -rk_clk_composite_register(struct clkdom *clkdom, struct rk_clk_composite_def *clkdef) +rk_clk_composite_register(struct clkdom *clkdom, + struct rk_clk_composite_def *clkdef) { struct clknode *clk; struct rk_clk_composite_sc *sc; Modified: head/sys/arm64/rockchip/clk/rk_clk_gate.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_gate.c Fri Nov 8 18:57:41 2019 (r354554) +++ head/sys/arm64/rockchip/clk/rk_clk_gate.c Fri Nov 8 19:03:34 2019 (r354555) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); CLKDEV_READ_4(clknode_get_device(_clk), off, val) #define MD4(_clk, off, clr, set ) \ CLKDEV_MODIFY_4(clknode_get_device(_clk), off, clr, set) -#define DEVICE_LOCK(_clk) \ +#define DEVICE_LOCK(_clk) \ CLKDEV_DEVICE_LOCK(clknode_get_device(_clk)) #define DEVICE_UNLOCK(_clk) \ CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk)) Modified: head/sys/arm64/rockchip/clk/rk_clk_mux.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_mux.c Fri Nov 8 18:57:41 2019 (r354554) +++ head/sys/arm64/rockchip/clk/rk_clk_mux.c Fri Nov 8 19:03:34 2019 (r354555) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); CLKDEV_READ_4(clknode_get_device(_clk), off, val) #define MD4(_clk, off, clr, set ) \ CLKDEV_MODIFY_4(clknode_get_device(_clk), off, clr, set) -#define DEVICE_LOCK(_clk) \ +#define DEVICE_LOCK(_clk) \ CLKDEV_DEVICE_LOCK(clknode_get_device(_clk)) #define DEVICE_UNLOCK(_clk) \ CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk)) Modified: head/sys/arm64/rockchip/clk/rk_clk_pll.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_pll.c Fri Nov 8 18:57:41 2019 (r354554) +++ head/sys/arm64/rockchip/clk/rk_clk_pll.c Fri Nov 8 19:03:34 2019 (r354555) @@ -58,19 +58,23 @@ struct rk_clk_pll_sc { bool normal_mode; }; -#define WRITE4(_clk, off, val) \ +#define WRITE4(_clk, off, val) \ CLKDEV_WRITE_4(clknode_get_device(_clk), off, val) -#define READ4(_clk, off, val) \ +#define READ4(_clk, off, val) \ CLKDEV_READ_4(clknode_get_device(_clk), off, val) -#define DEVICE_LOCK(_clk) \ +#define DEVICE_LOCK(_clk) \ CLKDEV_DEVICE_LOCK(clknode_get_device(_clk)) -#define DEVICE_UNLOCK(_clk) \ +#define DEVICE_UNLOCK(_clk) \ CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk)) #define RK_CLK_PLL_MASK_SHIFT 16 -/* #define dprintf(format, arg...) printf("%s:(%s)" format, __func__, clknode_get_name(clk), arg) */ +#if 0 +#define dprintf(format, arg...) \ + printf("%s:(%s)" format, __func__, clknode_get_name(clk), arg) +#else #define dprintf(format, arg...) +#endif static int rk_clk_pll_set_gate(struct clknode *clk, bool enable) @@ -397,13 +401,18 @@ rk3399_clk_pll_recalc(struct clknode *clk, uint64_t *f dprintf("con2: %x\n", con3); dprintf("con3: %x\n", con4); - fbdiv = (con1 & RK3399_CLK_PLL_FBDIV_MASK) >> RK3399_CLK_PLL_FBDIV_SHIFT; + fbdiv = (con1 & RK3399_CLK_PLL_FBDIV_MASK) + >> RK3399_CLK_PLL_FBDIV_SHIFT; - postdiv1 = (con2 & RK3399_CLK_PLL_POSTDIV1_MASK) >> RK3399_CLK_PLL_POSTDIV1_SHIFT; - postdiv2 = (con2 & RK3399_CLK_PLL_POSTDIV2_MASK) >> RK3399_CLK_PLL_POSTDIV2_SHIFT; - refdiv = (con2 & RK3399_CLK_PLL_REFDIV_MASK) >> RK3399_CLK_PLL_REFDIV_SHIFT; + postdiv1 = (con2 & RK3399_CLK_PLL_POSTDIV1_MASK) + >> RK3399_CLK_PLL_POSTDIV1_SHIFT; + postdiv2 = (con2 & RK3399_CLK_PLL_POSTDIV2_MASK) + >> RK3399_CLK_PLL_POSTDIV2_SHIFT; + refdiv = (con2 & RK3399_CLK_PLL_REFDIV_MASK) + >> RK3399_CLK_PLL_REFDIV_SHIFT; - fracdiv = (con3 & RK3399_CLK_PLL_FRAC_MASK) >> RK3399_CLK_PLL_FRAC_SHIFT; + fracdiv = (con3 & RK3399_CLK_PLL_FRAC_MASK) + >> RK3399_CLK_PLL_FRAC_SHIFT; fracdiv >>= 24; dsmpd = (con4 & RK3399_CLK_PLL_DSMPD_MASK) >> RK3399_CLK_PLL_DSMPD_SHIFT; @@ -415,7 +424,7 @@ rk3399_clk_pll_recalc(struct clknode *clk, uint64_t *f dprintf("fracdiv: %d\n", fracdiv); dprintf("dsmpd: %d\n", dsmpd); - dprintf("parent freq=%lu\n", *freq); + dprintf("parent freq=%ju\n", *freq); if (dsmpd == 0) { /* Fractional mode */ @@ -424,10 +433,10 @@ rk3399_clk_pll_recalc(struct clknode *clk, uint64_t *f /* Integer mode */ foutvco = *freq / refdiv * fbdiv; } - dprintf("foutvco: %lu\n", foutvco); + dprintf("foutvco: %ju\n", foutvco); *freq = foutvco / postdiv1 / postdiv2; - dprintf("freq: %lu\n", *freq); + dprintf("freq: %ju\n", *freq); return (0); } Modified: head/sys/arm64/rockchip/clk/rk_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_cru.c Fri Nov 8 18:57:41 2019 (r354554) +++ head/sys/arm64/rockchip/clk/rk_cru.c Fri Nov 8 19:03:34 2019 (r354555) @@ -233,10 +233,12 @@ rk_cru_attach(device_t dev) case RK_CLK_UNDEFINED: break; case RK3328_CLK_PLL: - rk3328_clk_pll_register(sc->clkdom, sc->clks[i].clk.pll); + rk3328_clk_pll_register(sc->clkdom, + sc->clks[i].clk.pll); break; case RK3399_CLK_PLL: - rk3399_clk_pll_register(sc->clkdom, sc->clks[i].clk.pll); + rk3399_clk_pll_register(sc->clkdom, + sc->clks[i].clk.pll); break; case RK_CLK_COMPOSITE: rk_clk_composite_register(sc->clkdom, @@ -246,7 +248,8 @@ rk_cru_attach(device_t dev) rk_clk_mux_register(sc->clkdom, sc->clks[i].clk.mux); break; case RK_CLK_ARMCLK: - rk_clk_armclk_register(sc->clkdom, sc->clks[i].clk.armclk); + rk_clk_armclk_register(sc->clkdom, + sc->clks[i].clk.armclk); break; default: device_printf(dev, "Unknown clock type\n"); From owner-svn-src-head@freebsd.org Fri Nov 8 19:13:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57C3515C169; Fri, 8 Nov 2019 19:13:13 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478qfx1d2Pz3JTk; Fri, 8 Nov 2019 19:13:13 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00AFC2BA0; Fri, 8 Nov 2019 19:13:13 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8JDCff004004; Fri, 8 Nov 2019 19:13:12 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8JDC8L003999; Fri, 8 Nov 2019 19:13:12 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201911081913.xA8JDC8L003999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 8 Nov 2019 19:13:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354556 - in head/sys: arm64/rockchip/clk conf X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in head/sys: arm64/rockchip/clk conf X-SVN-Commit-Revision: 354556 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 19:13:13 -0000 Author: mmel Date: Fri Nov 8 19:13:11 2019 New Revision: 354556 URL: https://svnweb.freebsd.org/changeset/base/354556 Log: Enhance Rockchip clocks implementation. - add support for fractional dividers - allow to declare fixed and linked clock MFC after: 3 weeks Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D22282 Added: head/sys/arm64/rockchip/clk/rk_clk_fract.c (contents, props changed) head/sys/arm64/rockchip/clk/rk_clk_fract.h (contents, props changed) Modified: head/sys/arm64/rockchip/clk/rk_cru.c head/sys/arm64/rockchip/clk/rk_cru.h head/sys/conf/files.arm64 Added: head/sys/arm64/rockchip/clk/rk_clk_fract.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/rockchip/clk/rk_clk_fract.c Fri Nov 8 19:13:11 2019 (r354556) @@ -0,0 +1,249 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright 2019 Michal Meloun + * + * 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 "clkdev_if.h" + +#define WR4(_clk, off, val) \ + CLKDEV_WRITE_4(clknode_get_device(_clk), off, val) +#define RD4(_clk, off, val) \ + CLKDEV_READ_4(clknode_get_device(_clk), off, val) +#define MD4(_clk, off, clr, set ) \ + CLKDEV_MODIFY_4(clknode_get_device(_clk), off, clr, set) +#define DEVICE_LOCK(_clk) \ + CLKDEV_DEVICE_LOCK(clknode_get_device(_clk)) +#define DEVICE_UNLOCK(_clk) \ + CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk)) + +static int rk_clk_fract_init(struct clknode *clk, device_t dev); +static int rk_clk_fract_recalc(struct clknode *clk, uint64_t *req); +static int rk_clk_fract_set_freq(struct clknode *clknode, uint64_t fin, + uint64_t *fout, int flag, int *stop); + +struct rk_clk_fract_sc { + uint32_t flags; + uint32_t offset; + uint32_t numerator; + uint32_t denominator; +}; + +static clknode_method_t rk_clk_fract_methods[] = { + /* Device interface */ + CLKNODEMETHOD(clknode_init, rk_clk_fract_init), + CLKNODEMETHOD(clknode_recalc_freq, rk_clk_fract_recalc), + CLKNODEMETHOD(clknode_set_freq, rk_clk_fract_set_freq), + CLKNODEMETHOD_END +}; +DEFINE_CLASS_1(rk_clk_fract, rk_clk_fract_class, rk_clk_fract_methods, + sizeof(struct rk_clk_fract_sc), clknode_class); + + +/* + * Compute best rational approximation of input fraction + * for fixed sized fractional divider registers. + * http://en.wikipedia.org/wiki/Continued_fraction + * + * - n_input, d_input Given input fraction + * - n_max, d_max Maximum vaues of divider registers + * - n_out, d_out Computed approximation + */ + +static void +clk_compute_fract_div( + uint64_t n_input, uint64_t d_input, + uint64_t n_max, uint64_t d_max, + uint64_t *n_out, uint64_t *d_out) +{ + uint64_t n_prev, d_prev; /* previous convergents */ + uint64_t n_cur, d_cur; /* current convergents */ + uint64_t n_rem, d_rem; /* fraction remainder */ + uint64_t tmp, fact; + + /* Initialize fraction reminder */ + n_rem = n_input; + d_rem = d_input; + + /* Init convergents to 0/1 and 1/0 */ + n_prev = 0; + d_prev = 1; + n_cur = 1; + d_cur = 0; + + while (d_rem != 0 && n_cur < n_max && d_cur < d_max) { + /* Factor for this step. */ + fact = n_rem / d_rem; + + /* Adjust fraction reminder */ + tmp = d_rem; + d_rem = n_rem % d_rem; + n_rem = tmp; + + /* Compute new nominator and save last one */ + tmp = n_prev + fact * n_cur; + n_prev = n_cur; + n_cur = tmp; + + /* Compute new denominator and save last one */ + tmp = d_prev + fact * d_cur; + d_prev = d_cur; + d_cur = tmp; + } + + if (n_cur > n_max || d_cur > d_max) { + *n_out = n_prev; + *d_out = d_prev; + } else { + *n_out = n_cur; + *d_out = d_cur; + } +} + +static int +rk_clk_fract_init(struct clknode *clk, device_t dev) +{ + uint32_t reg; + struct rk_clk_fract_sc *sc; + + sc = clknode_get_softc(clk); + DEVICE_LOCK(clk); + RD4(clk, sc->offset, ®); + DEVICE_UNLOCK(clk); + + sc->numerator = (reg >> 16) & 0xFFFF; + sc->denominator = reg & 0xFFFF; + clknode_init_parent_idx(clk, 0); + + return(0); +} +static int +rk_clk_fract_set_freq(struct clknode *clk, uint64_t fin, uint64_t *fout, + int flags, int *stop); +static int +rk_clk_fract_recalc(struct clknode *clk, uint64_t *freq) +{ + struct rk_clk_fract_sc *sc; + + sc = clknode_get_softc(clk); + if (sc->denominator == 0) { + printf("%s: %s denominator is zero!\n", clknode_get_name(clk), + __func__); + *freq = 0; + return(EINVAL); + } + + *freq *= sc->numerator; + *freq /= sc->denominator; + + return (0); +} + +static int +rk_clk_fract_set_freq(struct clknode *clk, uint64_t fin, uint64_t *fout, + int flags, int *stop) +{ + struct rk_clk_fract_sc *sc; + uint64_t div_n, div_d, _fout; + + sc = clknode_get_softc(clk); + + clk_compute_fract_div(*fout, fin, 0xFFFF, 0xFFFF, &div_n, &div_d); + _fout = fin * div_n; + _fout /= div_d; + + /* Rounding. */ + if ((flags & CLK_SET_ROUND_UP) && (_fout < *fout)) { + if (div_n > div_d && div_d > 1) + div_n++; + else + div_d--; + } else if ((flags & CLK_SET_ROUND_DOWN) && (_fout > *fout)) { + if (div_n > div_d && div_n > 1) + div_n--; + else + div_d++; + } + + /* Check range after rounding */ + if (div_n > 0xFFFF || div_d > 0xFFFF) + return (ERANGE); + + if (div_d == 0) { + printf("%s: %s divider is zero!\n", + clknode_get_name(clk), __func__); + return(EINVAL); + } + /* Recompute final output frequency */ + _fout = fin * div_n; + _fout /= div_d; + + *stop = 1; + + if ((flags & CLK_SET_DRYRUN) == 0) { + if (*stop != 0 && + (flags & (CLK_SET_ROUND_UP | CLK_SET_ROUND_DOWN)) == 0 && + *fout != _fout) + return (ERANGE); + + sc->numerator = (uint32_t)div_n; + sc->denominator = (uint32_t)div_d; + + DEVICE_LOCK(clk); + WR4(clk, sc->offset, sc->numerator << 16 | sc->denominator); + DEVICE_UNLOCK(clk); + } + + *fout = _fout; + return (0); +} + +int +rk_clk_fract_register(struct clkdom *clkdom, struct rk_clk_fract_def *clkdef) +{ + struct clknode *clk; + struct rk_clk_fract_sc *sc; + + clk = clknode_create(clkdom, &rk_clk_fract_class, &clkdef->clkdef); + if (clk == NULL) + return (1); + + sc = clknode_get_softc(clk); + sc->flags = clkdef->flags; + sc->offset = clkdef->offset; + + clknode_register(clkdom, clk); + return (0); +} Added: head/sys/arm64/rockchip/clk/rk_clk_fract.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/rockchip/clk/rk_clk_fract.h Fri Nov 8 19:13:11 2019 (r354556) @@ -0,0 +1,44 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright 2019 Michal Meloun + * + * 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 _RK_CLK_FRACT_H_ +#define _RK_CLK_FRACT_H_ + +#include + +struct rk_clk_fract_def { + struct clknode_init_def clkdef; + uint32_t offset; + uint32_t flags; +}; + +int rk_clk_fract_register(struct clkdom *clkdom, + struct rk_clk_fract_def *clkdef); + +#endif /* _RK_CLK_FRACT_H_ */ Modified: head/sys/arm64/rockchip/clk/rk_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_cru.c Fri Nov 8 19:03:34 2019 (r354555) +++ head/sys/arm64/rockchip/clk/rk_cru.c Fri Nov 8 19:13:11 2019 (r354556) @@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include @@ -251,12 +253,24 @@ rk_cru_attach(device_t dev) rk_clk_armclk_register(sc->clkdom, sc->clks[i].clk.armclk); break; + case RK_CLK_FIXED: + clknode_fixed_register(sc->clkdom, + sc->clks[i].clk.fixed); + break; + case RK_CLK_FRACT: + rk_clk_fract_register(sc->clkdom, + sc->clks[i].clk.fract); + break; + case RK_CLK_LINK: + clknode_link_register(sc->clkdom, + sc->clks[i].clk.link); + break; default: device_printf(dev, "Unknown clock type\n"); return (ENXIO); - break; } } + if (sc->gates) rk_cru_register_gates(sc); Modified: head/sys/arm64/rockchip/clk/rk_cru.h ============================================================================== --- head/sys/arm64/rockchip/clk/rk_cru.h Fri Nov 8 19:03:34 2019 (r354555) +++ head/sys/arm64/rockchip/clk/rk_cru.h Fri Nov 8 19:13:11 2019 (r354556) @@ -31,8 +31,15 @@ #ifndef __RK_CRU_H__ #define __RK_CRU_H__ +#include +#include +#include +#include +#include + #include #include +#include #include #include #include @@ -59,8 +66,11 @@ enum rk_clk_type { RK3328_CLK_PLL, RK3399_CLK_PLL, RK_CLK_COMPOSITE, + RK_CLK_FIXED, + RK_CLK_FRACT, RK_CLK_MUX, RK_CLK_ARMCLK, + RK_CLK_LINK, }; struct rk_clk { @@ -70,6 +80,9 @@ struct rk_clk { struct rk_clk_composite_def *composite; struct rk_clk_mux_def *mux; struct rk_clk_armclk_def *armclk; + struct clk_fixed_def *fixed; + struct rk_clk_fract_def *fract; + struct clk_link_def *link; } clk; }; Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Fri Nov 8 19:03:34 2019 (r354555) +++ head/sys/conf/files.arm64 Fri Nov 8 19:13:11 2019 (r354556) @@ -309,6 +309,7 @@ dev/dwc/if_dwc_if.m optional fdt dwc_rk soc_rockchip arm64/rockchip/clk/rk_cru.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 arm64/rockchip/clk/rk_clk_armclk.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 arm64/rockchip/clk/rk_clk_composite.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 +arm64/rockchip/clk/rk_clk_fract.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 arm64/rockchip/clk/rk_clk_gate.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 arm64/rockchip/clk/rk_clk_mux.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 arm64/rockchip/clk/rk_clk_pll.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 From owner-svn-src-head@freebsd.org Fri Nov 8 19:15:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67C7F15C33C; Fri, 8 Nov 2019 19:15:51 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478qjz2373z3JmB; Fri, 8 Nov 2019 19:15:51 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A82F2BB7; Fri, 8 Nov 2019 19:15:51 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8JFpT6004175; Fri, 8 Nov 2019 19:15:51 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8JFokc004173; Fri, 8 Nov 2019 19:15:50 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201911081915.xA8JFokc004173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 8 Nov 2019 19:15:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354557 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 354557 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 19:15:51 -0000 Author: mmel Date: Fri Nov 8 19:15:50 2019 New Revision: 354557 URL: https://svnweb.freebsd.org/changeset/base/354557 Log: Tidy up Rockchip composite clock. - add support for log2 based dividers - use proper write mask when writing to divider register MFC after: 3 weeks Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D22283 Modified: head/sys/arm64/rockchip/clk/rk_clk_composite.c head/sys/arm64/rockchip/clk/rk_clk_composite.h Modified: head/sys/arm64/rockchip/clk/rk_clk_composite.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_composite.c Fri Nov 8 19:13:11 2019 (r354556) +++ head/sys/arm64/rockchip/clk/rk_clk_composite.c Fri Nov 8 19:15:50 2019 (r354557) @@ -158,31 +158,44 @@ rk_clk_composite_recalc(struct clknode *clk, uint64_t DEVICE_UNLOCK(clk); - div = ((reg & sc->div_mask) >> sc->div_shift) + 1; - dprintf("parent_freq=%lu, div=%u\n", *freq, div); + div = ((reg & sc->div_mask) >> sc->div_shift); + if (sc->flags & RK_CLK_COMPOSITE_DIV_EXP) + div = 1 << div; + else + div += 1; + dprintf("parent_freq=%ju, div=%u\n", *freq, div); *freq = *freq / div; - dprintf("Final freq=%ju\n", *freq); return (0); } static uint32_t rk_clk_composite_find_best(struct rk_clk_composite_sc *sc, uint64_t fparent, - uint64_t freq) + uint64_t freq, uint32_t *reg) { uint64_t best, cur; - uint32_t best_div, div; + uint32_t best_div, best_div_reg; + uint32_t div, div_reg; - for (best = 0, best_div = 0, div = 0; - div <= ((sc->div_mask >> sc->div_shift) + 1); div++) { + best = 0; + best_div = 0; + best_div_reg = 0; + + for (div_reg = 0; div_reg <= ((sc->div_mask >> sc->div_shift) + 1); + div_reg++) { + if (sc->flags == RK_CLK_COMPOSITE_DIV_EXP) + div = 1 << div_reg; + else + div = div_reg + 1; cur = fparent / div; if ((freq - cur) < (freq - best)) { best = cur; best_div = div; + best_div_reg = div_reg; break; } } - + *reg = div_reg; return (best_div); } @@ -194,11 +207,10 @@ rk_clk_composite_set_freq(struct clknode *clk, uint64_ struct clknode *p_clk; const char **p_names; uint64_t best, cur; - uint32_t div, best_div, val = 0; + uint32_t div, div_reg, best_div, best_div_reg, val; int p_idx, best_parent; sc = clknode_get_softc(clk); - dprintf("Finding best parent/div for target freq of %ju\n", *fout); p_names = clknode_get_parent_names(clk); for (best_div = 0, best = 0, p_idx = 0; @@ -207,34 +219,31 @@ rk_clk_composite_set_freq(struct clknode *clk, uint64_ clknode_get_freq(p_clk, &fparent); dprintf("Testing with parent %s (%d) at freq %ju\n", clknode_get_name(p_clk), p_idx, fparent); - div = rk_clk_composite_find_best(sc, fparent, *fout); + div = rk_clk_composite_find_best(sc, fparent, *fout, &div_reg); cur = fparent / div; if ((*fout - cur) < (*fout - best)) { best = cur; best_div = div; + best_div_reg = div_reg; best_parent = p_idx; dprintf("Best parent so far %s (%d) with best freq at " "%ju\n", clknode_get_name(p_clk), p_idx, best); } } + *stop = 1; if (best_div == 0) - return (0); + return (ERANGE); - if ((best < *fout) && - ((flags & CLK_SET_ROUND_DOWN) == 0)) { - *stop = 1; + if ((best < *fout) && ((flags & CLK_SET_ROUND_DOWN) == 0)) return (ERANGE); - } - if ((best > *fout) && - ((flags & CLK_SET_ROUND_UP) == 0)) { - *stop = 1; + + if ((best > *fout) && ((flags & CLK_SET_ROUND_UP) == 0)) { return (ERANGE); } if ((flags & CLK_SET_DRYRUN) != 0) { *fout = best; - *stop = 1; return (0); } @@ -245,17 +254,18 @@ rk_clk_composite_set_freq(struct clknode *clk, uint64_ clknode_set_parent_by_idx(clk, best_parent); } - dprintf("Setting divider to %d\n", best_div); + dprintf("Setting divider to %d (reg: %d)\n", best_div, best_div_reg); + dprintf(" div_mask: 0x%X, div_shift: %d\n", sc->div_mask, + sc->div_shift); + DEVICE_LOCK(clk); - val |= (best_div - 1) << sc->div_shift; - val |= (sc->div_mask << sc->div_shift) << RK_CLK_COMPOSITE_MASK_SHIFT; + val = best_div_reg << sc->div_shift; + val |= sc->div_mask << RK_CLK_COMPOSITE_MASK_SHIFT; dprintf("Write: muxdiv_offset=%x, val=%x\n", sc->muxdiv_offset, val); WRITE4(clk, sc->muxdiv_offset, val); DEVICE_UNLOCK(clk); *fout = best; - *stop = 1; - return (0); } Modified: head/sys/arm64/rockchip/clk/rk_clk_composite.h ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_composite.h Fri Nov 8 19:13:11 2019 (r354556) +++ head/sys/arm64/rockchip/clk/rk_clk_composite.h Fri Nov 8 19:15:50 2019 (r354557) @@ -52,7 +52,8 @@ struct rk_clk_composite_def { #define RK_CLK_COMPOSITE_HAVE_MUX 0x0001 #define RK_CLK_COMPOSITE_HAVE_GATE 0x0002 - +#define RK_CLK_COMPOSITE_DIV_EXP 0x0004 /* Register 0, 1, 2, 2, ... */ + /* Divider 1, 2, 4, 8, ... */ int rk_clk_composite_register(struct clkdom *clkdom, struct rk_clk_composite_def *clkdef); From owner-svn-src-head@freebsd.org Fri Nov 8 19:29:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5CE415D064; Fri, 8 Nov 2019 19:29:14 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478r1Q4s35z3Kbg; Fri, 8 Nov 2019 19:29:14 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 870C52DA0; Fri, 8 Nov 2019 19:29:14 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8JTEW1010394; Fri, 8 Nov 2019 19:29:14 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8JTE4F010393; Fri, 8 Nov 2019 19:29:14 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201911081929.xA8JTE4F010393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 8 Nov 2019 19:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354558 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 354558 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 19:29:14 -0000 Author: mmel Date: Fri Nov 8 19:29:14 2019 New Revision: 354558 URL: https://svnweb.freebsd.org/changeset/base/354558 Log: Remove explicit declaration of rk_clk_fract_set_freq() function forgotten in r354556. MFC after: 3 weeks MFC with: r354556 Noticed by: manu Modified: head/sys/arm64/rockchip/clk/rk_clk_fract.c Modified: head/sys/arm64/rockchip/clk/rk_clk_fract.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk_clk_fract.c Fri Nov 8 19:15:50 2019 (r354557) +++ head/sys/arm64/rockchip/clk/rk_clk_fract.c Fri Nov 8 19:29:14 2019 (r354558) @@ -149,9 +149,7 @@ rk_clk_fract_init(struct clknode *clk, device_t dev) return(0); } -static int -rk_clk_fract_set_freq(struct clknode *clk, uint64_t fin, uint64_t *fout, - int flags, int *stop); + static int rk_clk_fract_recalc(struct clknode *clk, uint64_t *freq) { From owner-svn-src-head@freebsd.org Fri Nov 8 20:08:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 84C1815E342; Fri, 8 Nov 2019 20:08:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478rv12vg2z3Mkm; Fri, 8 Nov 2019 20:08:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42D0036CB; Fri, 8 Nov 2019 20:08:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8K8jn2033597; Fri, 8 Nov 2019 20:08:45 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8K8j7C033596; Fri, 8 Nov 2019 20:08:45 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201911082008.xA8K8j7C033596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 8 Nov 2019 20:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354559 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 354559 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 20:08:45 -0000 Author: manu Date: Fri Nov 8 20:08:44 2019 New Revision: 354559 URL: https://svnweb.freebsd.org/changeset/base/354559 Log: loader.efi: Default to serial if we don't have a ConOut variable In the EFI implementation in U-Boot no ConOut efi variable is created, this cause loader to fallback to TERM_EMU implementation which is very very very slow (and uses the ConOut device in the system table anyway). The UEFI spec aren't clear as if this variable needs to exists or not. Reviewed by: imp, kevans Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Fri Nov 8 19:29:14 2019 (r354558) +++ head/stand/efi/loader/main.c Fri Nov 8 20:08:44 2019 (r354559) @@ -703,8 +703,11 @@ parse_uefi_con_out(void) how = 0; sz = sizeof(buf); rv = efi_global_getenv("ConOut", buf, &sz); - if (rv != EFI_SUCCESS) + if (rv != EFI_SUCCESS) { + /* If we don't have any ConOut default to serial */ + how = RB_SERIAL; goto out; + } ep = buf + sz; node = (EFI_DEVICE_PATH *)buf; while ((char *)node < ep) { From owner-svn-src-head@freebsd.org Fri Nov 8 20:12:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC8CA15E8CD; Fri, 8 Nov 2019 20:12:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478rzs61Klz3NLj; Fri, 8 Nov 2019 20:12:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1930389E; Fri, 8 Nov 2019 20:12:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8KCvkS039285; Fri, 8 Nov 2019 20:12:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8KCvP0039284; Fri, 8 Nov 2019 20:12:57 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201911082012.xA8KCvP0039284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 8 Nov 2019 20:12:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354560 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 354560 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 20:12:58 -0000 Author: kevans Date: Fri Nov 8 20:12:57 2019 New Revision: 354560 URL: https://svnweb.freebsd.org/changeset/base/354560 Log: bcm2835_sdhci: add some very basic support for rpi4 DMA is currently disabled while I work out why it's broken, but this is enough for upstream U-Boot + rpi-firmware + our rpi3-psci-monitor to boot with the right config. The RPi 4 is still not in a good "supported" state, as we have no USB/PCI-E/Ethernet drivers, but if air-gapped pies only able to operate over cereal is your thing, here's your guy. Submitted by: Robert Crowston (with modifications) Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Fri Nov 8 20:08:44 2019 (r354559) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Fri Nov 8 20:12:57 2019 (r354560) @@ -58,9 +58,12 @@ __FBSDID("$FreeBSD$"); #include "bcm2835_dma.h" #include -#include "bcm2835_vcbus.h" +#ifdef NOTYET +#include +#endif #define BCM2835_DEFAULT_SDHCI_FREQ 50 +#define BCM2838_DEFAULT_SDHCI_FREQ 100 #define BCM_SDHCI_BUFFER_SIZE 512 #define NUM_DMA_SEGS 2 @@ -84,10 +87,40 @@ SYSCTL_INT(_hw_sdhci, OID_AUTO, bcm2835_sdhci_debug, C static int bcm2835_sdhci_hs = 1; static int bcm2835_sdhci_pio_mode = 0; +struct bcm_mmc_conf { + int clock_id; + int clock_src; + int default_freq; + int power_id; + int quirks; + bool use_dma; +}; + +struct bcm_mmc_conf bcm2835_sdhci_conf = { + .clock_id = BCM2835_MBOX_CLOCK_ID_EMMC, + .clock_src = -1, + .default_freq = BCM2835_DEFAULT_SDHCI_FREQ, + .quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | + SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | SDHCI_QUIRK_DONT_SET_HISPD_BIT | + SDHCI_QUIRK_MISSING_CAPS, + .use_dma = true +}; + +struct bcm_mmc_conf bcm2838_emmc2_conf = { + .clock_id = BCM2838_MBOX_CLOCK_ID_EMMC2, + .clock_src = -1, + .default_freq = BCM2838_DEFAULT_SDHCI_FREQ, + .quirks = 0, + /* XXX DMA is currently broken, but it shouldn't be. */ + .use_dma = false +}; + static struct ofw_compat_data compat_data[] = { - {"broadcom,bcm2835-sdhci", 1}, - {"brcm,bcm2835-sdhci", 1}, - {"brcm,bcm2835-mmc", 1}, + {"broadcom,bcm2835-sdhci", (uintptr_t)&bcm2835_sdhci_conf}, + {"brcm,bcm2835-sdhci", (uintptr_t)&bcm2835_sdhci_conf}, + {"brcm,bcm2835-mmc", (uintptr_t)&bcm2835_sdhci_conf}, + {"brcm,bcm2711-emmc2", (uintptr_t)&bcm2838_emmc2_conf}, + {"brcm,bcm2838-emmc2", (uintptr_t)&bcm2838_emmc2_conf}, {NULL, 0} }; @@ -115,6 +148,10 @@ struct bcm_sdhci_softc { uint32_t blksz_and_count; uint32_t cmd_and_mode; bool need_update_blk; +#ifdef NOTYET + device_t clkman; +#endif + struct bcm_mmc_conf * conf; }; static int bcm_sdhci_probe(device_t); @@ -168,8 +205,12 @@ bcm_sdhci_attach(device_t dev) sc->sc_dev = dev; sc->sc_req = NULL; - err = bcm2835_mbox_set_power_state(BCM2835_MBOX_POWER_ID_EMMC, - TRUE); + sc->conf = (struct bcm_mmc_conf *)ofw_bus_search_compatible(dev, + compat_data)->ocd_data; + if (sc->conf == 0) + return (ENXIO); + + err = bcm2835_mbox_set_power_state(BCM2835_MBOX_POWER_ID_EMMC, TRUE); if (err != 0) { if (bootverbose) device_printf(dev, "Unable to enable the power\n"); @@ -177,8 +218,7 @@ bcm_sdhci_attach(device_t dev) } default_freq = 0; - err = bcm2835_mbox_get_clock_rate(BCM2835_MBOX_CLOCK_ID_EMMC, - &default_freq); + err = bcm2835_mbox_get_clock_rate(sc->conf->clock_id, &default_freq); if (err == 0) { /* Convert to MHz */ default_freq /= 1000000; @@ -190,11 +230,28 @@ bcm_sdhci_attach(device_t dev) default_freq = cell / 1000000; } if (default_freq == 0) - default_freq = BCM2835_DEFAULT_SDHCI_FREQ; + default_freq = sc->conf->default_freq; if (bootverbose) device_printf(dev, "SDHCI frequency: %dMHz\n", default_freq); +#ifdef NOTYET + if (sc->conf->clock_src > 0) { + uint32_t f; + sc->clkman = devclass_get_device(devclass_find("bcm2835_clkman"), 0); + if (sc->clkman == NULL) { + device_printf(dev, "cannot find Clock Manager\n"); + return (ENXIO); + } + f = bcm2835_clkman_set_frequency(sc->clkman, sc->conf->clock_src, default_freq); + if (f == 0) + return (EINVAL); + + if (bootverbose) + device_printf(dev, "Clock source frequency: %dMHz\n", f); + } +#endif + rid = 0; sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -209,7 +266,7 @@ bcm_sdhci_attach(device_t dev) rid = 0; sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_ACTIVE); + RF_ACTIVE | RF_SHAREABLE); if (!sc->sc_irq_res) { device_printf(dev, "cannot allocate interrupt\n"); err = ENXIO; @@ -230,36 +287,39 @@ bcm_sdhci_attach(device_t dev) if (bcm2835_sdhci_hs) sc->sc_slot.caps |= SDHCI_CAN_DO_HISPD; sc->sc_slot.caps |= (default_freq << SDHCI_CLOCK_BASE_SHIFT); - sc->sc_slot.quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK - | SDHCI_QUIRK_BROKEN_TIMEOUT_VAL - | SDHCI_QUIRK_DONT_SET_HISPD_BIT - | SDHCI_QUIRK_MISSING_CAPS; + sc->sc_slot.quirks = sc->conf->quirks; sdhci_init_slot(dev, &sc->sc_slot, 0); - sc->sc_dma_ch = bcm_dma_allocate(BCM_DMA_CH_ANY); - if (sc->sc_dma_ch == BCM_DMA_CH_INVALID) - goto fail; + if (sc->conf->use_dma) { + sc->sc_dma_ch = bcm_dma_allocate(BCM_DMA_CH_ANY); + if (sc->sc_dma_ch == BCM_DMA_CH_INVALID) + goto fail; - bcm_dma_setup_intr(sc->sc_dma_ch, bcm_sdhci_dma_intr, sc); + if (bcm_dma_setup_intr(sc->sc_dma_ch, bcm_sdhci_dma_intr, sc) != 0) { + device_printf(dev, "cannot setup dma interrupt handler\n"); + err = ENXIO; + goto fail; + } - /* Allocate bus_dma resources. */ - err = bus_dma_tag_create(bus_get_dma_tag(dev), - 1, 0, BUS_SPACE_MAXADDR_32BIT, - BUS_SPACE_MAXADDR, NULL, NULL, - BCM_SDHCI_BUFFER_SIZE, NUM_DMA_SEGS, BCM_SDHCI_BUFFER_SIZE, - BUS_DMA_ALLOCNOW, NULL, NULL, - &sc->sc_dma_tag); + /* Allocate bus_dma resources. */ + err = bus_dma_tag_create(bus_get_dma_tag(dev), + 1, 0, BUS_SPACE_MAXADDR_32BIT, + BUS_SPACE_MAXADDR, NULL, NULL, + BCM_SDHCI_BUFFER_SIZE, NUM_DMA_SEGS, BCM_SDHCI_BUFFER_SIZE, + BUS_DMA_ALLOCNOW, NULL, NULL, + &sc->sc_dma_tag); - if (err) { - device_printf(dev, "failed allocate DMA tag"); - goto fail; - } + if (err) { + device_printf(dev, "failed allocate DMA tag"); + goto fail; + } - err = bus_dmamap_create(sc->sc_dma_tag, 0, &sc->sc_dma_map); - if (err) { - device_printf(dev, "bus_dmamap_create failed\n"); - goto fail; + err = bus_dmamap_create(sc->sc_dma_tag, 0, &sc->sc_dma_map); + if (err) { + device_printf(dev, "bus_dmamap_create failed\n"); + goto fail; + } } /* FIXME: Fix along with other BUS_SPACE_PHYSADDR instances */ @@ -454,26 +514,25 @@ bcm_sdhci_start_dma_seg(struct bcm_sdhci_softc *sc) { struct sdhci_slot *slot; vm_paddr_t pdst, psrc; - int err, idx, len, sync_op; + int err, idx, len, sync_op, width; slot = &sc->sc_slot; idx = sc->dmamap_seg_index++; len = sc->dmamap_seg_sizes[idx]; slot->offset += len; + width = (len & 0xf ? BCM_DMA_32BIT : BCM_DMA_128BIT); if (slot->curcmd->data->flags & MMC_DATA_READ) { bcm_dma_setup_src(sc->sc_dma_ch, BCM_DMA_DREQ_EMMC, BCM_DMA_SAME_ADDR, BCM_DMA_32BIT); bcm_dma_setup_dst(sc->sc_dma_ch, BCM_DMA_DREQ_NONE, - BCM_DMA_INC_ADDR, - (len & 0xf) ? BCM_DMA_32BIT : BCM_DMA_128BIT); + BCM_DMA_INC_ADDR, width); psrc = sc->sc_sdhci_buffer_phys; pdst = sc->dmamap_seg_addrs[idx]; sync_op = BUS_DMASYNC_PREREAD; } else { bcm_dma_setup_src(sc->sc_dma_ch, BCM_DMA_DREQ_NONE, - BCM_DMA_INC_ADDR, - (len & 0xf) ? BCM_DMA_32BIT : BCM_DMA_128BIT); + BCM_DMA_INC_ADDR, width); bcm_dma_setup_dst(sc->sc_dma_ch, BCM_DMA_DREQ_EMMC, BCM_DMA_SAME_ADDR, BCM_DMA_32BIT); psrc = sc->dmamap_seg_addrs[idx]; @@ -664,8 +723,12 @@ bcm_sdhci_write_dma(device_t dev, struct sdhci_slot *s static int bcm_sdhci_will_handle_transfer(device_t dev, struct sdhci_slot *slot) { + struct bcm_sdhci_softc *sc = device_get_softc(slot->bus); size_t left; + if (!sc->conf->use_dma) + return (0); + /* * Do not use DMA for transfers less than block size or with a length * that is not a multiple of four. @@ -744,6 +807,9 @@ static driver_t bcm_sdhci_driver = { DRIVER_MODULE(sdhci_bcm, simplebus, bcm_sdhci_driver, bcm_sdhci_devclass, NULL, NULL); +#ifdef NOTYET +MODULE_DEPEND(sdhci_bcm, bcm2835_clkman, 1, 1, 1); +#endif SDHCI_DEPEND(sdhci_bcm); #ifndef MMCCAM MMC_DECLARE_BRIDGE(sdhci_bcm); From owner-svn-src-head@freebsd.org Fri Nov 8 20:14:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F11915E9BF; Fri, 8 Nov 2019 20:14:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478s1n3jTxz3NVf; Fri, 8 Nov 2019 20:14:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5EAAB389F; Fri, 8 Nov 2019 20:14:37 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8KEbME039403; Fri, 8 Nov 2019 20:14:37 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8KEbVU039402; Fri, 8 Nov 2019 20:14:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201911082014.xA8KEbVU039402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 8 Nov 2019 20:14:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354561 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 354561 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 20:14:37 -0000 Author: kevans Date: Fri Nov 8 20:14:36 2019 New Revision: 354561 URL: https://svnweb.freebsd.org/changeset/base/354561 Log: bcm2835_sdhci: remove unused power_id field This was once set, but I removed it by the time I committed it because both configurations use the same POWER_ID. This can be separated back out if the situation changes. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Fri Nov 8 20:12:57 2019 (r354560) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Fri Nov 8 20:14:36 2019 (r354561) @@ -91,7 +91,6 @@ struct bcm_mmc_conf { int clock_id; int clock_src; int default_freq; - int power_id; int quirks; bool use_dma; }; From owner-svn-src-head@freebsd.org Fri Nov 8 20:43:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79F3615F647; Fri, 8 Nov 2019 20:43:05 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 478sfc0CRRz3Pyk; Fri, 8 Nov 2019 20:43:03 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id TB5uiXdQfnCigTB5viiuSg; Fri, 08 Nov 2019 13:43:01 -0700 X-Authority-Analysis: v=2.3 cv=cZisUULM c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=MeAgGD-zjQ4A:10 a=iKhvJSA4AAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=pb_jOsI30yJrBfHcqsIA:9 a=QEXdDO2ut3YA:10 a=fDx4lTW7LADd24os25wA:9 a=mvTd8gQ2dj9sSofm:21 a=_W_S_7VecoQA:10 a=odh9cflL3HIXMm4fY7Wr:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from [10.199.244.203] (unknown [24.244.29.97]) by spqr.komquats.com (Postfix) with ESMTPSA id 3B4678EA; Fri, 8 Nov 2019 12:42:57 -0800 (PST) Date: Fri, 08 Nov 2019 13:42:33 -0700 User-Agent: K-9 Mail for Android In-Reply-To: <201911081826.xA8IQIUn021142@gndrsh.dnsmgr.net> References: <201911081826.xA8IQIUn021142@gndrsh.dnsmgr.net> MIME-Version: 1.0 Subject: Re: svn commit: r350089 - head To: rgrimes@freebsd.org, "Rodney W. Grimes" , Glen Barber CC: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Cy Schubert Message-ID: X-CMAE-Envelope: MS4wfD3aJqaR01dvctBVnTCCJ2wm3MRhUei0r9/U27NVLd/hrfIBdBYH1VitmqqElQg8jB3EON22RTs7luUClfXEMstDVeu+3lnJFGvcl4hN6Xst+EhiuPk1 sAnomQFH0Zxnnb2POzeelEj2+AuyI90g9FvOLzye3o5hd8PkAUvgtsCp+s7mUCJnScVAIBAF82A3uLwtO5oNvAdZsXVAjznFpeSScbbyD4kIZOMgw1BS57MM vyReuY5QiccfUKe9RewbIc1vKV7SIzJPTfY9+MAhPm6ffW+/qmKJkhlbTYhKBMJRamZu6peoChTmKpcPqE5bFurQ8PF0N2EcPG3w2LyrtWScY7+Qr8xzRyPA 0H+BGo21sDCcMrS79L37l6im1gcwNw== X-Rspamd-Queue-Id: 478sfc0CRRz3Pyk X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.134.13) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-4.57 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; R_SPF_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[13.134.59.64.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-2.37)[ip: (-6.40), ipnet: 64.59.128.0/20(-3.02), asn: 6327(-2.33), country: CA(-0.09)]; FROM_EQ_ENVFROM(0.00)[] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 20:43:05 -0000 Those were my initial thoughts at the time=2E If an MFC is performed, its a= ssociated RELNOTES should also be committed=2E If committing an MFC, it mak= es sense to commit the same RELNOTES text through an MFC as well=2E On November 8, 2019 11:26:18 AM MST, "Rodney W=2E Grimes" wrote: >> On Wed, Jul 17, 2019 at 07:09:06PM +0000, Mark Johnston wrote: >> > Author: markj >> > Date: Wed Jul 17 19:09:05 2019 >> > New Revision: 350089 >> > URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/350089 >> >=20 >> > Log: >> > Add an initial RELNOTES file=2E >> > =20 >> > The intent is to provide a convenient location to document >changes >> > that are relevant to users of binary FreeBSD distributions, in >contrast >> > with UPDATING, which exists to document caveats for users who >build >> > FreeBSD from source=2E >> > =20 >> > This complements the "Relnotes:" tag in commit messages by >providing a >> > place to document the change in more detail, or in case a >"Relnotes:" >> > tag was accidentally omitted=2E In particular, "Relnotes:" should >be >> > used if you do not intend to document the change in RELNOTES for >some >> > reason=2E >> > =20 >> > Changes to the file should not be MFCed=2E For now the file will >exist >> > only in head, but may be updated via direct commits to stable >branches >> > depending on how things go=2E >> > =20 >>=20 >> I had to go look at the original thread to remind myself about this, >but >> regarding not MFCing changes from head to stable branches, I think >there >> may have been some confusion in the discussion=2E >>=20 >> By "changes should not be MFCed", at least based on my recollection >of >> how the conversation was going, I (at least) meant "not MFCed, but >> committed as a direct commit to stable branches=2E" In other words, >> merging the RELNOTES change from head to stable/X does not really >make >> sense, as the revision numbers will have changed, and would >inevitably >> cause merge conflicts=2E >>=20 >> Now that 12=2E1 is out, maybe we can expand the idea of this file into >> stable/12 and even stable/11=2E One additional idea that came to mind >is >> with the formatting for stable branches=2E >>=20 >> For example, in head, there is: >>=20 >> rNNNNNN: >> The foo(8) utility was added=2E >>=20 >> For stable branches, I would propose the format of: >>=20 >> rNNNNNM, MFC of rNNNNNN: >> The foo(8) utility was added=2E >>=20 >> Thoughts? > >My thoughs originally on this was that when a release noteable item >is merged from head to stable the exact related commit to RELNOTES >should also be merged unaltered=2E > >The RELNOTES file should state that revision numbers in this file >are ^/HEAD revision numbers, and that a merge serach may be needed >to find the branch verson of the MFC=2E > >The ^/head RELNOTES file should be trunkated to length 0 when a =2E0 >branch is crated POST branch creation, thus all the relevant >entries are in the file on the new branch and can grow as things >are merged to it=2E Thus keeps the RELNOTES file in a state that >matches the branch as far as entires, just the Rxxxxx is referential >to when the entry was created relative to head=2E > >> Glen >--=20 >Rod Grimes =20 >rgrimes@freebsd=2Eorg --=20 Pardon the typos and autocorrect, small keyboard in use=2E=20 Cy Schubert FreeBSD UNIX: Web: https://www=2EFreeBSD=2Eorg The need of the many outweighs the greed of the few=2E Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E From owner-svn-src-head@freebsd.org Fri Nov 8 20:48:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8564515F7C0; Fri, 8 Nov 2019 20:48:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478smJ2jKMz3Q8k; Fri, 8 Nov 2019 20:48:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C33C3E86; Fri, 8 Nov 2019 20:48:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8Km0dg057176; Fri, 8 Nov 2019 20:48:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8Km0V3057174; Fri, 8 Nov 2019 20:48:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201911082048.xA8Km0V3057174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 8 Nov 2019 20:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354562 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 354562 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 20:48:00 -0000 Author: markj Date: Fri Nov 8 20:47:59 2019 New Revision: 354562 URL: https://svnweb.freebsd.org/changeset/base/354562 Log: Add new iwm(4) files to sys/conf/files. Submitted by: rea MFC with: r354504 Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Nov 8 20:14:36 2019 (r354561) +++ head/sys/conf/files Fri Nov 8 20:47:59 2019 (r354562) @@ -1918,6 +1918,8 @@ iwi_monitor.fw optional iwimonitorfw | iwifw \ dev/iwm/if_iwm.c optional iwm dev/iwm/if_iwm_7000.c optional iwm dev/iwm/if_iwm_8000.c optional iwm +dev/iwm/if_iwm_9000.c optional iwm +dev/iwm/if_iwm_9260.c optional iwm dev/iwm/if_iwm_binding.c optional iwm dev/iwm/if_iwm_fw.c optional iwm dev/iwm/if_iwm_led.c optional iwm From owner-svn-src-head@freebsd.org Fri Nov 8 20:53:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95A3415FA8B; Fri, 8 Nov 2019 20:53:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478sv93QM6z3QYs; Fri, 8 Nov 2019 20:53:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 585714074; Fri, 8 Nov 2019 20:53:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8KrvpW062919; Fri, 8 Nov 2019 20:53:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8KrvRZ062918; Fri, 8 Nov 2019 20:53:57 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201911082053.xA8KrvRZ062918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 8 Nov 2019 20:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354563 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 354563 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 20:53:57 -0000 Author: kevans Date: Fri Nov 8 20:53:56 2019 New Revision: 354563 URL: https://svnweb.freebsd.org/changeset/base/354563 Log: bcm2835: commit missing constant from r354560 Surgically pulling the patch from my debugging work lead to this slopiness- my apologies. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Fri Nov 8 20:47:59 2019 (r354562) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Fri Nov 8 20:53:56 2019 (r354563) @@ -118,6 +118,7 @@ int bcm2835_mbox_set_power_state(uint32_t, boolean_t); #define BCM2835_MBOX_CLOCK_ID_SDRAM 0x00000008 #define BCM2835_MBOX_CLOCK_ID_PIXEL 0x00000009 #define BCM2835_MBOX_CLOCK_ID_PWM 0x0000000a +#define BCM2838_MBOX_CLOCK_ID_EMMC2 0x0000000c #define BCM2835_MBOX_TAG_GET_CLOCK_RATE 0x00030002 #define BCM2835_MBOX_TAG_SET_CLOCK_RATE 0x00038002 From owner-svn-src-head@freebsd.org Fri Nov 8 23:39:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F2FCF1648E0; Fri, 8 Nov 2019 23:39:17 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478xYx6D3Wz44mJ; Fri, 8 Nov 2019 23:39:17 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9AE15DF1; Fri, 8 Nov 2019 23:39:17 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8NdHCR056811; Fri, 8 Nov 2019 23:39:17 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8NdHm7056810; Fri, 8 Nov 2019 23:39:17 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201911082339.xA8NdHm7056810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 8 Nov 2019 23:39:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354564 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 354564 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 23:39:18 -0000 Author: rmacklem Date: Fri Nov 8 23:39:17 2019 New Revision: 354564 URL: https://svnweb.freebsd.org/changeset/base/354564 Log: Update copy_file_range(2) to be Linux5 compatible. The current linux man page and testing done on a fairly recent linux5.n kernel have identified two changes to the semantics of the linux copy_file_range system call. Since the copy_file_range(2) system call is intended to be linux compatible and is only currently in head/current and not used by any commands, it seems appropriate to update the system call to be compatible with the current linux one. The old linux man page stated that, if the offset + len exceeded file_size for the input file, EINVAL should be returned. Now, the semantics is to copy up to at most file_size bytes and return that number of bytes copied. If the offset is at or beyond file_size, a return of 0 bytes is done. This patch modifies copy_file_range(2) to be linux compatible for this semantic change. A separate patch will change copy_file_range(2) for the other semantic change, which allows the infd and outfd to refer to the same file, so long as the byte ranges do not overlap. Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Fri Nov 8 20:53:56 2019 (r354563) +++ head/sys/kern/vfs_vnops.c Fri Nov 8 23:39:17 2019 (r354564) @@ -2679,7 +2679,6 @@ vn_copy_file_range(struct vnode *invp, off_t *inoffp, off_t *outoffp, size_t *lenp, unsigned int flags, struct ucred *incred, struct ucred *outcred, struct thread *fsize_td) { - struct vattr va; int error; size_t len; uint64_t uvalin, uvalout; @@ -2705,17 +2704,6 @@ vn_copy_file_range(struct vnode *invp, off_t *inoffp, if (error != 0) goto out; - error = vn_lock(invp, LK_SHARED); - if (error != 0) - goto out; - /* Check that the offset + len does not go past EOF of invp. */ - error = VOP_GETATTR(invp, &va, incred); - if (error == 0 && va.va_size < *inoffp + len) - error = EINVAL; - VOP_UNLOCK(invp, 0); - if (error != 0) - goto out; - /* * If the two vnode are for the same file system, call * VOP_COPY_FILE_RANGE(), otherwise call vn_generic_copy_file_range() @@ -2917,7 +2905,7 @@ vn_generic_copy_file_range(struct vnode *invp, off_t * off_t startoff, endoff, xfer, xfer2; u_long blksize; int error; - bool cantseek, readzeros; + bool cantseek, readzeros, eof, lastblock; ssize_t aresid; size_t copylen, len, savlen; char *dat; @@ -3004,7 +2992,8 @@ vn_generic_copy_file_range(struct vnode *invp, off_t * * Note that some file systems such as NFSv3, NFSv4.0 and NFSv4.1 may * support holes on the server, but do not support FIOSEEKHOLE. */ - while (len > 0 && error == 0) { + eof = false; + while (len > 0 && error == 0 && !eof) { endoff = 0; /* To shut up compilers. */ cantseek = true; startoff = *inoffp; @@ -3086,7 +3075,7 @@ vn_generic_copy_file_range(struct vnode *invp, off_t * xfer -= (*inoffp % blksize); } /* Loop copying the data block. */ - while (copylen > 0 && error == 0) { + while (copylen > 0 && error == 0 && !eof) { if (copylen < xfer) xfer = copylen; error = vn_lock(invp, LK_SHARED); @@ -3097,12 +3086,13 @@ vn_generic_copy_file_range(struct vnode *invp, off_t * curthread->td_ucred, incred, &aresid, curthread); VOP_UNLOCK(invp, 0); - /* - * Linux considers a range that exceeds EOF to - * be an error, so we will too. - */ - if (error == 0 && aresid > 0) - error = EINVAL; + lastblock = false; + if (error == 0 && aresid > 0) { + /* Stop the copy at EOF on the input file. */ + xfer -= aresid; + eof = true; + lastblock = true; + } if (error == 0) { /* * Skip the write for holes past the initial EOF @@ -3111,11 +3101,13 @@ vn_generic_copy_file_range(struct vnode *invp, off_t * */ readzeros = cantseek ? mem_iszero(dat, xfer) : false; + if (xfer == len) + lastblock = true; if (!cantseek || *outoffp < va.va_size || - xfer == len || !readzeros) + lastblock || !readzeros) error = vn_write_outvp(outvp, dat, *outoffp, xfer, blksize, - readzeros && xfer == len && + readzeros && lastblock && *outoffp >= va.va_size, false, outcred); if (error == 0) { From owner-svn-src-head@freebsd.org Fri Nov 8 23:49:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6636C164BCB; Fri, 8 Nov 2019 23:49:28 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478xnh1xPtz459h; Fri, 8 Nov 2019 23:49:28 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26F105FA8; Fri, 8 Nov 2019 23:49:28 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8NnRld062656; Fri, 8 Nov 2019 23:49:27 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8NnR5k062655; Fri, 8 Nov 2019 23:49:27 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201911082349.xA8NnR5k062655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 8 Nov 2019 23:49:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354565 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 354565 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 23:49:28 -0000 Author: rmacklem Date: Fri Nov 8 23:49:27 2019 New Revision: 354565 URL: https://svnweb.freebsd.org/changeset/base/354565 Log: Update the copy_file_range.2 man page to reflect the semantic change implemented by r354564. This is a content change. Modified: head/lib/libc/sys/copy_file_range.2 Modified: head/lib/libc/sys/copy_file_range.2 ============================================================================== --- head/lib/libc/sys/copy_file_range.2 Fri Nov 8 23:39:17 2019 (r354564) +++ head/lib/libc/sys/copy_file_range.2 Fri Nov 8 23:49:27 2019 (r354565) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 2019 +.Dd November 8, 2019 .Dt COPY_FILE_RANGE 2 .Os .Sh NAME @@ -113,6 +113,14 @@ data ranges found. If it succeeds, the call returns the number of bytes copied, which can be fewer than .Fa len . +Returning fewer bytes than +.Fa len +does not necessarily indicate that EOF was reached. +However, a return of zero for a non-zero +.Fa len +argument indicates that the offset for +.Fa infd +is at or beyond EOF. .Fn copy_file_range should be used in a loop until copying of the desired byte range has been completed. @@ -154,13 +162,6 @@ and .Fa outoffp are reset to the initial values for the system call. .It Bq Er EINVAL -If the initial offset for -.Fa infd -plus -.Fa len -exceeds EOF for -.Fa infd -or .Fa flags is not zero. From owner-svn-src-head@freebsd.org Fri Nov 8 23:58:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D0AA1651CB; Fri, 8 Nov 2019 23:58:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 478y0B1Nwjz45dQ; Fri, 8 Nov 2019 23:58:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12E106195; Fri, 8 Nov 2019 23:58:34 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA8NwXdf068692; Fri, 8 Nov 2019 23:58:33 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA8NwXNw068691; Fri, 8 Nov 2019 23:58:33 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201911082358.xA8NwXNw068691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 8 Nov 2019 23:58:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354566 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 354566 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Nov 2019 23:58:34 -0000 Author: rmacklem Date: Fri Nov 8 23:58:33 2019 New Revision: 354566 URL: https://svnweb.freebsd.org/changeset/base/354566 Log: Update the VOP_COPY_FILE_RANGE.9 man page to reflect the semantic change implemented by r354564. This is a content change. Modified: head/share/man/man9/VOP_COPY_FILE_RANGE.9 Modified: head/share/man/man9/VOP_COPY_FILE_RANGE.9 ============================================================================== --- head/share/man/man9/VOP_COPY_FILE_RANGE.9 Fri Nov 8 23:49:27 2019 (r354565) +++ head/share/man/man9/VOP_COPY_FILE_RANGE.9 Fri Nov 8 23:58:33 2019 (r354566) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 7, 2019 +.Dd November 8, 2019 .Dt VOP_COPY_FILE_RANGE 9 .Os .Sh NAME @@ -94,6 +94,13 @@ Upon a successful return will be updated to the number of bytes actually copied. Normally, this will be the number of bytes requested to be copied, however a copy of fewer bytes than requested is permitted. +This does not necessarily indicate that the copy reached EOF on the input file. +However, if the value pointed to by the +.Fa len +argument is zero upon a successful return, +it indicates that the offset pointed to by +.Fa inoff +is at or beyond EOF on the input file. .Sh LOCKS The vnode are unlocked on entry and must be unlocked on return. The byte ranges for both From owner-svn-src-head@freebsd.org Sat Nov 9 04:16:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8572117CAAD; Sat, 9 Nov 2019 04:16:26 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4793jk14jjz4JxZ; Sat, 9 Nov 2019 04:16:25 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id xA94GNIK068522 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 8 Nov 2019 20:16:23 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id xA94GNGo068521; Fri, 8 Nov 2019 20:16:23 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Fri, 8 Nov 2019 20:16:23 -0800 From: Gleb Smirnoff To: Renato Botelho Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r354149 - head/sys/net Message-ID: <20191109041623.GS2195@FreeBSD.org> References: <201910291736.x9THa6Gd018030@repo.freebsd.org> <781d285f-0b6d-45f1-f4b4-4bab60b789ae@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="qp4W5+cUSnZs0RIF" Content-Disposition: inline In-Reply-To: <781d285f-0b6d-45f1-f4b4-4bab60b789ae@FreeBSD.org> User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 4793jk14jjz4JxZ X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Nov 2019 04:16:26 -0000 --qp4W5+cUSnZs0RIF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Renato, can you please try out the attached patch? On Fri, Nov 08, 2019 at 01:27:30PM -0300, Renato Botelho wrote: R> On 29/10/19 14:36, Gleb Smirnoff wrote: R> > Author: glebius R> > Date: Tue Oct 29 17:36:06 2019 R> > New Revision: 354149 R> > URL: https://svnweb.freebsd.org/changeset/base/354149 R> > R> > Log: R> > There is a long standing problem with multicast programming for NICs R> > and IPv6. With IPv6 we may call if_addmulti() in context of processing R> > of an incoming packet. Usually this is interrupt context. While most R> > of the NIC drivers are able to reprogram multicast filters without R> > sleeping, some of them can't. An example is e1000 family of drivers. R> > With iflib conversion the problem was somewhat hidden. Iflib processes R> > packets in private taskqueue, so going to sleep doesn't trigger an R> > assertion. However, the sleep would block operation of the driver and R> > following incoming packets would fill the ring and eventually would R> > start being dropped. Enabling epoch for the full time of a packet R> > processing again started to trigger assertions for e1000. R> > R> > Fix this problem once and for all using a general taskqueue to call R> > if_ioctl() method in all cases when if_addmulti() is called in a R> > non sleeping context. Note that nobody cares about returned value. R> > R> > Reviewed by: hselasky, kib R> > Differential Revision: https://reviews.freebsd.org/D22154 R> R> Hi Gleb, R> R> I upgraded my laptop running 13-CURRENT from r354133 to r354437 and it R> crashed during boot as you can see in the pictures [1]. It seems like R> it crashed while it was configuring network. R> R> After bisect I managed to boot fine with r354148 and reproduce the crash R> with this revision applied. R> R> Here is the relevant portion of my /etc/rc.conf: R> R> # Lagg R> ifconfig_em0="up" R> wlans_iwn0="wlan0" R> ifconfig_wlan0="WPA" R> create_args_wlan0="wlanaddr 3c:97:0e:48:3f:f8 up" R> cloned_interfaces="lagg0" R> ifconfig_lagg0="up laggproto failover laggport em0 laggport wlan0 DHCP" R> ifconfig_lagg0_ipv6="inet6 accept_rtadv" R> rtsold_enable="YES" R> R> [1] https://imgur.com/a/lBtq3FW R> -- R> Renato Botelho -- Gleb Smirnoff --qp4W5+cUSnZs0RIF Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="if_siocaddmulti.diff" Index: sys/net/if.c =================================================================== --- sys/net/if.c (revision 354565) +++ sys/net/if.c (working copy) @@ -3571,7 +3571,9 @@ if_siocaddmulti(void *arg, int pending) if (pending > 1) if_printf(ifp, "%d SIOCADDMULTI coalesced\n", pending); #endif + CURVNET_SET(ifp->if_vnet); (void )(*ifp->if_ioctl)(ifp, SIOCADDMULTI, 0); + CURVNET_RESTORE(); } /* --qp4W5+cUSnZs0RIF-- From owner-svn-src-head@freebsd.org Sat Nov 9 12:55:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED72C1A945C; Sat, 9 Nov 2019 12:55:08 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 479HDC6X35z3Dy7; Sat, 9 Nov 2019 12:55:07 +0000 (UTC) (envelope-from oshogbo.vx@gmail.com) Received: by mail-ed1-f67.google.com with SMTP id b72so8231685edf.1; Sat, 09 Nov 2019 04:55:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JngLqI+BCOho9bx7N226LanVksiuFczUOT2A9807o4w=; b=Pqx+Y5Hordxk2MCum/vOiVfmz75ya+LA6mVTODmPIY5w3T0M3bo5ChhARKPGqTVFTd E6/Y0sZRsr+KzI3fUK6XFwlLZNmgPH3irfjOknA2GKzUWuw6+qHWCo/A9rlcZd+FF9MV P+t6ezA0AsRs33DruOPe3FsNA3oVb47H8G7NTbC4ySgspNo5UL55IYMDYKLwHRoHdOeV nOWHYhPo95+WPSdZs3c7emOuMDw5Ki78uqfRWRTg8Xcf3no4laf1NxVaA6fWdzWX/1/G ce9Es8K/qpM6a9sjDutnM57ifHKSbTczfoja3MkqUAXjsuRHP6GflGhbkaHNSVmRsOqr 087g== X-Gm-Message-State: APjAAAWR0JqQ2ecTjVcy6rgIWrG+bljhvaXnXNQtZarQnSvQ9jNwo1+s oQmfUa9i3Rx/k5Kp25yLlB89865ydbmNa2HFN3FBmMlzmT8= X-Google-Smtp-Source: APXvYqyHKfE/3+ZJmgL0nDMZu53s0hlf8nJOsGXw+7nEHBcbSONt1Cadrw08ln+TLgWK/Ocmrh2yZFrqEA++BqkATL0= X-Received: by 2002:a50:9fc1:: with SMTP id c59mr16283411edf.305.1573304105513; Sat, 09 Nov 2019 04:55:05 -0800 (PST) MIME-Version: 1.0 References: <201909132303.x8DN3uw3026373@repo.freebsd.org> <20191002220807.GA3971@spathi.chuq.com> In-Reply-To: <20191002220807.GA3971@spathi.chuq.com> From: Mariusz Zaborski Date: Sat, 9 Nov 2019 13:54:59 +0100 Message-ID: Subject: Re: svn commit: r352312 - in head: lib/geom/nop sys/geom/nop To: Chuck Silvers Cc: Alan Somers , svn-src-head , svn-src-all , src-committers , Warner Losh Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 479HDC6X35z3Dy7 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of oshogbovx@gmail.com designates 209.85.208.67 as permitted sender) smtp.mailfrom=oshogbovx@gmail.com X-Spamd-Result: default: False [-3.99 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[67.208.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.99)[ip: (-4.68), ipnet: 209.85.128.0/17(-3.19), asn: 15169(-2.00), country: US(-0.05)]; FORGED_SENDER(0.30)[oshogbo@freebsd.org,oshogbovx@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[67.208.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[oshogbo@freebsd.org,oshogbovx@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Nov 2019 12:55:09 -0000 Hello Chuck :) I wonder if we shouldn't change this option a bit. Shouldn't we have an option which says more like: ``` Specifies the number of I/O requests to allow before setting the read and write failure rate. ``` In some cases, I don't want to have 100% of failure probabilities, but on the early stage, I would like to allow some read/writes requests. If the options would only specify the amount of the requests not the failure probabilities could be used in other cases? Those that make sens? Mariusz On Thu, 3 Oct 2019 at 00:08, Chuck Silvers wrote: > > On Wed, Oct 02, 2019 at 08:11:57AM -0600, Alan Somers wrote: > > On Fri, Sep 13, 2019 at 5:04 PM Chuck Silvers wrote: > > > > > Author: chs > > > Date: Fri Sep 13 23:03:56 2019 > > > New Revision: 352312 > > > URL: https://svnweb.freebsd.org/changeset/base/352312 > > > > > > Log: > > > Add a "count_until_fail" option to gnop, which says to start failing > > > I/O requests after the given number have been allowed though. > > > > > > Approved by: imp (mentor) > > > Reviewed by: rpokala kib 0mp mckusick > > > Sponsored by: Netflix > > > Differential Revision: https://reviews.freebsd.org/D21593 > > > > > > Modified: > > > head/lib/geom/nop/geom_nop.c > > > head/lib/geom/nop/gnop.8 > > > head/sys/geom/nop/g_nop.c > > > head/sys/geom/nop/g_nop.h > > > > > > > This patch introduces a backwards-compatibility bug. On a system with a > > post-352312 kernel but a pre-352312 userland, the gnop command will always > > fail with the error "gnop: Missing count_until_fail argument". > > -Alan > > Thanks for pointing this out, I'll see about fixing it right away. > > -Chuck > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Sat Nov 9 17:08:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9143B1AEEC9; Sat, 9 Nov 2019 17:08:28 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 479NrX2pBgz3xVV; Sat, 9 Nov 2019 17:08:28 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4487719D10; Sat, 9 Nov 2019 17:08:28 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA9H8SV4080214; Sat, 9 Nov 2019 17:08:28 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA9H8R5M080213; Sat, 9 Nov 2019 17:08:27 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201911091708.xA9H8R5M080213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Sat, 9 Nov 2019 17:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354570 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 354570 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Nov 2019 17:08:28 -0000 Author: dougm Date: Sat Nov 9 17:08:27 2019 New Revision: 354570 URL: https://svnweb.freebsd.org/changeset/base/354570 Log: For vm_map, #defining DIAGNOSTIC to turn on full assertion-based consistency checking slows performance dramatically. This change reduces the number of assertions checked by completely walking the vm_map tree only when the write-lock is released, and only then if the number of modifications to the tree since the last walk exceeds the number of tree nodes. Reviewed by: alc, kib Tested by: pho Differential Revision: https://reviews.freebsd.org/D22163 Modified: head/sys/vm/vm_map.c head/sys/vm/vm_map.h Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sat Nov 9 11:55:01 2019 (r354569) +++ head/sys/vm/vm_map.c Sat Nov 9 17:08:27 2019 (r354570) @@ -596,10 +596,54 @@ vm_map_process_deferred(void) } } +#ifdef INVARIANTS +static void +_vm_map_assert_locked(vm_map_t map, const char *file, int line) +{ + + if (map->system_map) + mtx_assert_(&map->system_mtx, MA_OWNED, file, line); + else + sx_assert_(&map->lock, SA_XLOCKED, file, line); +} + +#define VM_MAP_ASSERT_LOCKED(map) \ + _vm_map_assert_locked(map, LOCK_FILE, LOCK_LINE) + +enum { VMMAP_CHECK_NONE, VMMAP_CHECK_UNLOCK, VMMAP_CHECK_ALL }; +#ifdef DIAGNOSTIC +static int enable_vmmap_check = VMMAP_CHECK_UNLOCK; +#else +static int enable_vmmap_check = VMMAP_CHECK_NONE; +#endif +SYSCTL_INT(_debug, OID_AUTO, vmmap_check, CTLFLAG_RWTUN, + &enable_vmmap_check, 0, "Enable vm map consistency checking"); + +static void _vm_map_assert_consistent(vm_map_t map, int check); + +#define VM_MAP_ASSERT_CONSISTENT(map) \ + _vm_map_assert_consistent(map, VMMAP_CHECK_ALL) +#ifdef DIAGNOSTIC +#define VM_MAP_UNLOCK_CONSISTENT(map) do { \ + if (map->nupdates > map->nentries) { \ + _vm_map_assert_consistent(map, VMMAP_CHECK_UNLOCK); \ + map->nupdates = 0; \ + } \ +} while (0) +#else +#define VM_MAP_UNLOCK_CONSISTENT(map) +#endif +#else +#define VM_MAP_ASSERT_LOCKED(map) +#define VM_MAP_ASSERT_CONSISTENT(map) +#define VM_MAP_UNLOCK_CONSISTENT(map) +#endif /* INVARIANTS */ + void _vm_map_unlock(vm_map_t map, const char *file, int line) { + VM_MAP_UNLOCK_CONSISTENT(map); if (map->system_map) mtx_unlock_flags_(&map->system_mtx, 0, file, line); else { @@ -697,8 +741,10 @@ _vm_map_lock_downgrade(vm_map_t map, const char *file, if (map->system_map) { mtx_assert_(&map->system_mtx, MA_OWNED, file, line); - } else + } else { + VM_MAP_UNLOCK_CONSISTENT(map); sx_downgrade_(&map->lock, file, line); + } } /* @@ -717,37 +763,6 @@ vm_map_locked(vm_map_t map) return (sx_xlocked(&map->lock)); } -#ifdef INVARIANTS -static void -_vm_map_assert_locked(vm_map_t map, const char *file, int line) -{ - - if (map->system_map) - mtx_assert_(&map->system_mtx, MA_OWNED, file, line); - else - sx_assert_(&map->lock, SA_XLOCKED, file, line); -} - -#define VM_MAP_ASSERT_LOCKED(map) \ - _vm_map_assert_locked(map, LOCK_FILE, LOCK_LINE) - -#ifdef DIAGNOSTIC -static int enable_vmmap_check = 1; -#else -static int enable_vmmap_check = 0; -#endif -SYSCTL_INT(_debug, OID_AUTO, vmmap_check, CTLFLAG_RWTUN, - &enable_vmmap_check, 0, "Enable vm map consistency checking"); - -static void _vm_map_assert_consistent(vm_map_t map); - -#define VM_MAP_ASSERT_CONSISTENT(map) \ - _vm_map_assert_consistent(map) -#else -#define VM_MAP_ASSERT_LOCKED(map) -#define VM_MAP_ASSERT_CONSISTENT(map) -#endif /* INVARIANTS */ - /* * _vm_map_unlock_and_wait: * @@ -766,6 +781,7 @@ int _vm_map_unlock_and_wait(vm_map_t map, int timo, const char *file, int line) { + VM_MAP_UNLOCK_CONSISTENT(map); mtx_lock(&map_sleep_mtx); if (map->system_map) mtx_unlock_flags_(&map->system_mtx, 0, file, line); @@ -874,6 +890,9 @@ _vm_map_init(vm_map_t map, pmap_t pmap, vm_offset_t mi map->timestamp = 0; map->busy = 0; map->anon_loc = 0; +#ifdef DIAGNOSTIC + map->nupdates = 0; +#endif } void @@ -1132,6 +1151,9 @@ vm_map_splay_merge(vm_map_t map, vm_map_entry_t root, } root->max_free = MAX(max_free_left, max_free_right); map->root = root; +#ifdef DIAGNOSTIC + ++map->nupdates; +#endif } /* @@ -1330,8 +1352,10 @@ vm_map_lookup_entry( * on a temporary upgrade. */ cur = vm_map_splay(map, address); - if (!locked) + if (!locked) { + VM_MAP_UNLOCK_CONSISTENT(map); sx_downgrade(&map->lock); + } /* * If "address" is contained within a map entry, the new root @@ -4786,12 +4810,12 @@ vm_map_pmap_KBI(vm_map_t map) #ifdef INVARIANTS static void -_vm_map_assert_consistent(vm_map_t map) +_vm_map_assert_consistent(vm_map_t map, int check) { vm_map_entry_t entry, prev; vm_size_t max_left, max_right; - if (!enable_vmmap_check) + if (enable_vmmap_check != check) return; prev = &map->header; Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Sat Nov 9 11:55:01 2019 (r354569) +++ head/sys/vm/vm_map.h Sat Nov 9 17:08:27 2019 (r354570) @@ -207,6 +207,9 @@ struct vm_map { pmap_t pmap; /* (c) Physical map */ vm_offset_t anon_loc; int busy; +#ifdef DIAGNOSTIC + int nupdates; +#endif }; /* From owner-svn-src-head@freebsd.org Sat Nov 9 17:30:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24BB81AF531; Sat, 9 Nov 2019 17:30:22 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 479PKp077Kz3yLY; Sat, 9 Nov 2019 17:30:22 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB9CD1A0A8; Sat, 9 Nov 2019 17:30:21 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA9HULPO091889; Sat, 9 Nov 2019 17:30:21 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA9HUKGn091881; Sat, 9 Nov 2019 17:30:20 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201911091730.xA9HUKGn091881@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 9 Nov 2019 17:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354571 - in head: sys/cam/ata sys/cam/mmc sys/cam/nvme sys/cam/scsi sys/geom usr.sbin/diskinfo X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: sys/cam/ata sys/cam/mmc sys/cam/nvme sys/cam/scsi sys/geom usr.sbin/diskinfo X-SVN-Commit-Revision: 354571 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Nov 2019 17:30:22 -0000 Author: trasz Date: Sat Nov 9 17:30:19 2019 New Revision: 354571 URL: https://svnweb.freebsd.org/changeset/base/354571 Log: Add GEOM attribute to report physical device name, and report it via 'diskinfo -v'. This avoids the need to track it down via CAM, and should also work for disks that don't use CAM. And since it's inherited thru the GEOM hierarchy, in most cases one doesn't need to walk the GEOM graph either, eg you can use it on a partition instead of disk itself. Reviewed by: allanjude, imp Sponsored by: Klara Inc Differential Revision: https://reviews.freebsd.org/D22249 Modified: head/sys/cam/ata/ata_da.c head/sys/cam/mmc/mmc_da.c head/sys/cam/nvme/nvme_da.c head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_da.c head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h head/usr.sbin/diskinfo/diskinfo.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Sat Nov 9 17:08:27 2019 (r354570) +++ head/sys/cam/ata/ata_da.c Sat Nov 9 17:30:19 2019 (r354571) @@ -3420,6 +3420,8 @@ adasetgeom(struct ada_softc *softc, struct ccb_getdev softc->disk->d_fwheads = softc->params.heads; ata_disk_firmware_geom_adjust(softc->disk); softc->disk->d_rotation_rate = cgd->ident_data.media_rotation_rate; + snprintf(softc->disk->d_attachment, sizeof(softc->disk->d_attachment), + "%s%d", softc->cpi.dev_name, softc->cpi.unit_number); } static void Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Sat Nov 9 17:08:27 2019 (r354570) +++ head/sys/cam/mmc/mmc_da.c Sat Nov 9 17:30:19 2019 (r354571) @@ -1532,6 +1532,8 @@ sdda_add_part(struct cam_periph *periph, u_int type, c part->disk->d_hba_device = cpi.hba_device; part->disk->d_hba_subvendor = cpi.hba_subvendor; part->disk->d_hba_subdevice = cpi.hba_subdevice; + snprintf(part->disk->d_attachment, sizeof(part->disk->d_attachment), + "%s%d", cpi.dev_name, cpi.unit_number); part->disk->d_sectorsize = mmc_get_sector_size(periph); part->disk->d_mediasize = media_size; Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Sat Nov 9 17:08:27 2019 (r354570) +++ head/sys/cam/nvme/nvme_da.c Sat Nov 9 17:30:19 2019 (r354571) @@ -815,6 +815,8 @@ ndaregister(struct cam_periph *periph, void *arg) disk->d_hba_device = cpi.hba_device; disk->d_hba_subvendor = cpi.hba_subvendor; disk->d_hba_subdevice = cpi.hba_subdevice; + snprintf(disk->d_attachment, sizeof(disk->d_attachment), + "%s%d", cpi.dev_name, cpi.unit_number); disk->d_stripesize = disk->d_sectorsize; disk->d_stripeoffset = 0; disk->d_devstat = devstat_new_entry(periph->periph_name, Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Sat Nov 9 17:08:27 2019 (r354570) +++ head/sys/cam/scsi/scsi_cd.c Sat Nov 9 17:30:19 2019 (r354571) @@ -702,6 +702,8 @@ cdregister(struct cam_periph *periph, void *arg) softc->disk->d_hba_device = cpi.hba_device; softc->disk->d_hba_subvendor = cpi.hba_subvendor; softc->disk->d_hba_subdevice = cpi.hba_subdevice; + snprintf(softc->disk->d_attachment, sizeof(softc->disk->d_attachment), + "%s%d", cpi.dev_name, cpi.unit_number); /* * Acquire a reference to the periph before we register with GEOM. Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Sat Nov 9 17:08:27 2019 (r354570) +++ head/sys/cam/scsi/scsi_da.c Sat Nov 9 17:30:19 2019 (r354571) @@ -2875,6 +2875,8 @@ daregister(struct cam_periph *periph, void *arg) softc->disk->d_hba_device = cpi.hba_device; softc->disk->d_hba_subvendor = cpi.hba_subvendor; softc->disk->d_hba_subdevice = cpi.hba_subdevice; + snprintf(softc->disk->d_attachment, sizeof(softc->disk->d_attachment), + "%s%d", cpi.dev_name, cpi.unit_number); /* * Acquire a reference to the periph before we register with GEOM. Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Sat Nov 9 17:08:27 2019 (r354570) +++ head/sys/geom/geom_disk.c Sat Nov 9 17:30:19 2019 (r354571) @@ -528,7 +528,10 @@ g_disk_start(struct bio *bp) else if (g_handleattr_uint16_t(bp, "GEOM::rotation_rate", dp->d_rotation_rate)) break; - else + else if (g_handleattr_str(bp, "GEOM::attachment", + dp->d_attachment)) + break; + else error = ENOIOCTL; break; case BIO_FLUSH: Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Sat Nov 9 17:08:27 2019 (r354570) +++ head/sys/geom/geom_disk.h Sat Nov 9 17:30:19 2019 (r354571) @@ -118,6 +118,7 @@ struct disk { uint16_t d_hba_subvendor; uint16_t d_hba_subdevice; uint16_t d_rotation_rate; + char d_attachment[DISK_IDENT_SIZE]; /* Fields private to the driver */ void *d_drv1; Modified: head/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- head/usr.sbin/diskinfo/diskinfo.c Sat Nov 9 17:08:27 2019 (r354570) +++ head/usr.sbin/diskinfo/diskinfo.c Sat Nov 9 17:30:19 2019 (r354571) @@ -251,6 +251,10 @@ main(int argc, char **argv) printf("\t%-12s\t# Disk descr.\n", arg.value.str); if (ioctl(fd, DIOCGIDENT, ident) == 0) printf("\t%-12s\t# Disk ident.\n", ident); + strlcpy(arg.name, "GEOM::attachment", sizeof(arg.name)); + arg.len = sizeof(arg.value.str); + if (ioctl(fd, DIOCGATTR, &arg) == 0) + printf("\t%-12s\t# Attachment\n", arg.value.str); if (ioctl(fd, DIOCGPHYSPATH, physpath) == 0) printf("\t%-12s\t# Physical path\n", physpath); printf("\t%-12s\t# TRIM/UNMAP support\n", From owner-svn-src-head@freebsd.org Sat Nov 9 17:55:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 505CD1AFBC6; Sat, 9 Nov 2019 17:55:26 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 479Ptk1F1Zz40Mr; Sat, 9 Nov 2019 17:55:26 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id D303FB7AC; Sat, 9 Nov 2019 17:55:25 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [10.0.1.237] (78-22-44-167.access.telenet.be [78.22.44.167]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 2DEC9F8CD; Sat, 9 Nov 2019 18:55:24 +0100 (CET) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Kristof Provost Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r354553 - in head/tests/sys: netinet6 netpfil/common netpfil/pf Date: Sat, 9 Nov 2019 18:55:23 +0100 Message-Id: References: <201911081856.xA8Iu39F091885@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201911081856.xA8Iu39F091885@repo.freebsd.org> To: Li-Wen Hsu X-Mailer: iPhone Mail (17B84) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Nov 2019 17:55:26 -0000 Thank you! Kristof > On 8 Nov 2019, at 19:56, Li-Wen Hsu wrote: >=20 > =EF=BB=BFAuthor: lwhsu > Date: Fri Nov 8 18:56:02 2019 > New Revision: 354553 > URL: https://svnweb.freebsd.org/changeset/base/354553 >=20 > Log: > Reenable netinet6 and netpfil tests on i386, net/scapy 2.4.3_2 contains t= he fix >=20 > PR: 239380 > Sponsored by: The FreeBSD Foundation >=20 > Modified: > head/tests/sys/netinet6/exthdr.sh > head/tests/sys/netinet6/scapyi386.sh > head/tests/sys/netpfil/common/forward.sh > head/tests/sys/netpfil/common/tos.sh > head/tests/sys/netpfil/pf/forward.sh > head/tests/sys/netpfil/pf/set_tos.sh >=20 > Modified: head/tests/sys/netinet6/exthdr.sh > =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/tests/sys/netinet6/exthdr.sh Fri Nov 8 17:57:03 2019 (r354= 552) > +++ head/tests/sys/netinet6/exthdr.sh Fri Nov 8 18:56:02 2019 (r354= 553) > @@ -38,11 +38,6 @@ exthdr_head() { >=20 > exthdr_body() { >=20 > - if [ "$(atf_config_get ci false)" =3D "true" ] && \ > - [ "$(uname -p)" =3D "i386" ]; then > - atf_skip "https://bugs.freebsd.org/241493" > - fi > - > ids=3D65533 > id=3D`printf "%x" ${ids}` > if [ $$ -gt 65535 ]; then >=20 > Modified: head/tests/sys/netinet6/scapyi386.sh > =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/tests/sys/netinet6/scapyi386.sh Fri Nov 8 17:57:03 2019 (r= 354552) > +++ head/tests/sys/netinet6/scapyi386.sh Fri Nov 8 18:56:02 2019 (r= 354553) > @@ -38,11 +38,6 @@ scapyi386_head() { >=20 > scapyi386_body() { >=20 > - if [ "$(atf_config_get ci false)" =3D "true" ] && \ > - [ "$(uname -p)" =3D "i386" ]; then > - atf_skip "https://bugs.freebsd.org/239380" > - fi > - > ids=3D65533 > id=3D`printf "%x" ${ids}` > if [ $$ -gt 65535 ]; then >=20 > Modified: head/tests/sys/netpfil/common/forward.sh > =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/tests/sys/netpfil/common/forward.sh Fri Nov 8 17:57:03 2019 = (r354552) > +++ head/tests/sys/netpfil/common/forward.sh Fri Nov 8 18:56:02 2019 = (r354553) > @@ -40,10 +40,6 @@ v4_head() > v4_body() > { > firewall=3D$1 > - if [ "$(atf_config_get ci false)" =3D "true" ] && \ > - [ "$(uname -p)" =3D "i386" ] && [ "${firewall}" =3D "pf" ]; then > - atf_skip "https://bugs.freebsd.org/240085" > - fi > firewall_init $firewall >=20 > epair_send=3D$(vnet_mkepair) >=20 > Modified: head/tests/sys/netpfil/common/tos.sh > =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/tests/sys/netpfil/common/tos.sh Fri Nov 8 17:57:03 2019 (r= 354552) > +++ head/tests/sys/netpfil/common/tos.sh Fri Nov 8 18:56:02 2019 (r= 354553) > @@ -40,10 +40,6 @@ tos_head() > tos_body() > { > firewall=3D$1 > - if [ "$(atf_config_get ci false)" =3D "true" ] && \ > - [ "$(uname -p)" =3D "i386" ] && [ "${firewall}" =3D "pf" ]; then > - atf_skip "https://bugs.freebsd.org/240086" > - fi > firewall_init $firewall >=20 > epair_send=3D$(vnet_mkepair) >=20 > Modified: head/tests/sys/netpfil/pf/forward.sh > =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/tests/sys/netpfil/pf/forward.sh Fri Nov 8 17:57:03 2019 (r= 354552) > +++ head/tests/sys/netpfil/pf/forward.sh Fri Nov 8 18:56:02 2019 (r= 354553) > @@ -41,10 +41,6 @@ v4_head() >=20 > v4_body() > { > - if [ `uname -p` =3D "i386" ]; then > - atf_skip "https://bugs.freebsd.org/239380" > - fi > - > pft_init >=20 > epair_send=3D$(vnet_mkepair) > @@ -104,10 +100,6 @@ v6_head() >=20 > v6_body() > { > - if [ `uname -p` =3D "i386" ]; then > - atf_skip "https://bugs.freebsd.org/239380" > - fi > - > pft_init >=20 > epair_send=3D$(vnet_mkepair) >=20 > Modified: head/tests/sys/netpfil/pf/set_tos.sh > =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/tests/sys/netpfil/pf/set_tos.sh Fri Nov 8 17:57:03 2019 (r= 354552) > +++ head/tests/sys/netpfil/pf/set_tos.sh Fri Nov 8 18:56:02 2019 (r= 354553) > @@ -41,10 +41,6 @@ v4_head() >=20 > v4_body() > { > - if [ `uname -p` =3D "i386" ]; then > - atf_skip "https://bugs.freebsd.org/239380" > - fi > - > pft_init >=20 > epair_send=3D$(vnet_mkepair) >=20 From owner-svn-src-head@freebsd.org Sat Nov 9 19:50:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 688A717B06F; Sat, 9 Nov 2019 19:50:05 +0000 (UTC) (envelope-from Alexander@leidinger.net) Received: from mailgate.Leidinger.net (mailgate.leidinger.net [IPv6:2a00:1828:2000:313::1:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 479SR02Rtyz45Zh; Sat, 9 Nov 2019 19:50:04 +0000 (UTC) (envelope-from Alexander@leidinger.net) Received: from outgoing.leidinger.net (p5B165DF1.dip0.t-ipconnect.de [91.22.93.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (Client did not present a certificate) by mailgate.Leidinger.net (Postfix) with ESMTPSA id 06F7C145A; Sat, 9 Nov 2019 20:50:01 +0100 (CET) Received: from webmail.leidinger.net (webmail.Leidinger.net [IPv6:fd73:10c7:2053:1::3:102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by outgoing.leidinger.net (Postfix) with ESMTPS id 8AA4CA11D; Sat, 9 Nov 2019 20:49:58 +0100 (CET) Received: (from www@localhost) by webmail.leidinger.net (8.15.2/8.14.4/Submit) id xA9Jnwui092096; Sat, 9 Nov 2019 20:49:58 +0100 (CET) (envelope-from Alexander@leidinger.net) X-Authentication-Warning: webmail.leidinger.net: www set sender to Alexander@leidinger.net using -f Received: from [::ffff:192.168.1.28] ([::ffff:192.168.1.28]) by webmail.leidinger.net (Horde Framework) with HTTPS; Sat, 09 Nov 2019 20:49:58 +0100 Date: Sat, 09 Nov 2019 20:49:58 +0100 Message-ID: <20191109204958.Horde.B0ynnS_aur1OZimnDNObsAt@webmail.leidinger.net> From: Alexander Leidinger To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r354458 - head/libexec/rc/rc.d In-Reply-To: <201911071815.xA7IFOhI070066@repo.freebsd.org> User-Agent: Horde Application Framework 5 Accept-Language: de,en Content-Type: multipart/signed; boundary="=_HNo1qBiWgvcf_L5sQpvCu0i"; protocol="application/pgp-signature"; micalg=pgp-sha1 MIME-Version: 1.0 X-Rspamd-Queue-Id: 479SR02Rtyz45Zh X-Spamd-Bar: ------- X-Spamd-Result: default: False [-7.82 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[leidinger.net:s=outgoing-alex]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; XAW_SERVICE_ACCT(1.00)[]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[leidinger.net:+]; DMARC_POLICY_ALLOW(-0.50)[leidinger.net,quarantine]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-3.72)[ip: (-9.81), ipnet: 2a00:1828::/32(-4.89), asn: 34240(-3.90), country: DE(-0.01)]; ASN(0.00)[asn:34240, ipnet:2a00:1828::/32, country:DE]; RCVD_TLS_ALL(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[241.93.22.91.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Nov 2019 19:50:05 -0000 This message is in MIME format and has been PGP signed. --=_HNo1qBiWgvcf_L5sQpvCu0i Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Quoting Edward Tomasz Napierala (from Thu, 7 Nov=20=20 2019=2018:15:24 +0000 (UTC)): > Author: trasz > Date: Thu Nov 7 18:15:24 2019 > New Revision: 354458 > URL: https://svnweb.freebsd.org/changeset/base/354458 > > Log: > Extend the linux rc script to mount the neccessary file systems, > set ELF fallback brand, and load pty(4). We never did something like that. We have it documented everywhere=20=20 that=20it needs to be done manually. So this is at least a POLA=20=20 violation.=20It is great that the nocover option is used in the mount,=20= =20 but=20it's still some kind of layering violation (I may want to have=20=20 only=20a subset mounted, or nothing at all). I do not object to the functionality, but I think it needs to be=20=20 configurable=20(an option to influence if the auto-mount is done or not,=20= =20 doesn't=20matter to me what the default behavior is, as long as it is=20=20 configurable)=20and documented (UPDATING, handbook, man-pages, maybe=20=20 even=20the release notes). Bye, Alexander. --=20 http://www.Leidinger.net=20Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF --=_HNo1qBiWgvcf_L5sQpvCu0i Content-Type: application/pgp-signature Content-Description: Digitale PGP-Signatur Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJdxxhmAAoJEBINsJsD+NiGlFIP/2IHcnBe5tDBtAcisS/HONgw Qrbwweqcsf2THYewkCIXt36e6G5iq3vVgP9quQ3ZHVba3KauP83mg2a7BR0JsC7W R8fOE9AVQ4R4NNg8p6qqhfMVIMUCSDWhkfuDYYkfKiaiQezZHXp39YfkvM1aFcsV 5gqcP/upbZ1YDE0GrfuZhwn78ulbFJYVi6ysgdk+XRPzIp8jkvX2Rqjp/zpxFAxY OZvazCOFH4+Kj3wPmpkZ4G7ZbwQ5itWXr/g2KP3M2u+SYuxolEf/hMD+WEcHQqr1 zJ+xB3XQSjeqwipuKRf3Y5BFzEMLBu8QMDATO+nawv3BMvAHSQYy2OHSjfLG8hq/ xV/8RBysjJfyqXiFfM2GACsyo/x1FsxrmOYry7hpsxrrl/zi5wFeyeQMZ2GhGNos iWXvnoSAHH1XB3fy4fM8+5hbcj1ELP7Pa1eygY0ewM6bqOC0xL1Cg6hBcXj4UIUa +UeKmywvJBtcnmRVFoqigvO/hFkE4GYgboVJEk67zX9JkEX272A4gOsEk0/o8NwK HSmdAPUJICEFv9xehf6hZ6OrKoxr5CgcBxYxQuNk3gwuz0KCDDFNsQ/1IBfQF8Hj 6PFOOkz7UDV2FKD9u5WpDoW6f7ccZn5ObTHt4AAbngQp6WSXqmige3bB8l6iHB+8 uIdgQDqoad9UGLzRMAtU =6vFC -----END PGP SIGNATURE----- --=_HNo1qBiWgvcf_L5sQpvCu0i-- From owner-svn-src-head@freebsd.org Sat Nov 9 21:59:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D91217E68E; Sat, 9 Nov 2019 21:59:30 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 479WJL1FFGz4CNx; Sat, 9 Nov 2019 21:59:30 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E47C1D1F1; Sat, 9 Nov 2019 21:59:30 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA9LxTEK051747; Sat, 9 Nov 2019 21:59:29 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA9LxTVF051745; Sat, 9 Nov 2019 21:59:29 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201911092159.xA9LxTVF051745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 9 Nov 2019 21:59:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354572 - head/lib/libipsec X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/lib/libipsec X-SVN-Commit-Revision: 354572 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Nov 2019 21:59:30 -0000 Author: bz Date: Sat Nov 9 21:59:29 2019 New Revision: 354572 URL: https://svnweb.freebsd.org/changeset/base/354572 Log: libipsec: correct a typo Correct a typo in the ipsec_errlist and replicated in a comment. No functional changes. MFC after: 3 weeks Modified: head/lib/libipsec/ipsec_strerror.c head/lib/libipsec/ipsec_strerror.h Modified: head/lib/libipsec/ipsec_strerror.c ============================================================================== --- head/lib/libipsec/ipsec_strerror.c Sat Nov 9 17:30:19 2019 (r354571) +++ head/lib/libipsec/ipsec_strerror.c Sat Nov 9 21:59:29 2019 (r354572) @@ -62,7 +62,7 @@ static const char *ipsec_errlist[] = { "Invalid key length", /*EIPSEC_INVAL_KEYLEN*/ "Invalid address family", /*EIPSEC_INVAL_FAMILY*/ "Invalid prefix length", /*EIPSEC_INVAL_PREFIXLEN*/ -"Invalid direciton", /*EIPSEC_INVAL_DIR*/ +"Invalid direction", /*EIPSEC_INVAL_DIR*/ "SPI range violation", /*EIPSEC_INVAL_SPI*/ "No protocol specified", /*EIPSEC_NO_PROTO*/ "No algorithm specified", /*EIPSEC_NO_ALGS*/ Modified: head/lib/libipsec/ipsec_strerror.h ============================================================================== --- head/lib/libipsec/ipsec_strerror.h Sat Nov 9 17:30:19 2019 (r354571) +++ head/lib/libipsec/ipsec_strerror.h Sat Nov 9 21:59:29 2019 (r354572) @@ -52,7 +52,7 @@ extern void __ipsec_set_strerror(const char *); #define EIPSEC_INVAL_KEYLEN 14 /*invalid key length*/ #define EIPSEC_INVAL_FAMILY 15 /*invalid address family*/ #define EIPSEC_INVAL_PREFIXLEN 16 /*SPI range violation*/ -#define EIPSEC_INVAL_DIR 17 /*Invalid direciton*/ +#define EIPSEC_INVAL_DIR 17 /*Invalid direction*/ #define EIPSEC_INVAL_SPI 18 /*invalid prefixlen*/ #define EIPSEC_NO_PROTO 19 /*no protocol specified*/ #define EIPSEC_NO_ALGS 20 /*No algorithm specified*/ From owner-svn-src-head@freebsd.org Sat Nov 9 22:25:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 81F2D17F3A7; Sat, 9 Nov 2019 22:25:46 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 479Wtf2LLsz4Flk; Sat, 9 Nov 2019 22:25:46 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F9781D751; Sat, 9 Nov 2019 22:25:46 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA9MPkUR071153; Sat, 9 Nov 2019 22:25:46 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA9MPkxg071152; Sat, 9 Nov 2019 22:25:46 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201911092225.xA9MPkxg071152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 9 Nov 2019 22:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354573 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 354573 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Nov 2019 22:25:46 -0000 Author: manu Date: Sat Nov 9 22:25:45 2019 New Revision: 354573 URL: https://svnweb.freebsd.org/changeset/base/354573 Log: generic_ehci_fdt: Fix compile when EXT_RESOURCES isn't present Modified: head/sys/dev/usb/controller/generic_ehci_fdt.c Modified: head/sys/dev/usb/controller/generic_ehci_fdt.c ============================================================================== --- head/sys/dev/usb/controller/generic_ehci_fdt.c Sat Nov 9 21:59:29 2019 (r354572) +++ head/sys/dev/usb/controller/generic_ehci_fdt.c Sat Nov 9 22:25:45 2019 (r354573) @@ -114,6 +114,7 @@ generic_ehci_fdt_probe(device_t self) static int generic_ehci_fdt_attach(device_t dev) { + int err; #ifdef EXT_RESOURCES struct generic_ehci_fdt_softc *sc; struct clk_list *clkp; @@ -122,7 +123,7 @@ generic_ehci_fdt_attach(device_t dev) hwreset_t rst; struct phy_list *phyp; phy_t phy; - int err, off; + int off; sc = device_get_softc(dev);