From owner-svn-src-head@freebsd.org Sun May 12 01:31:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3E2D15ACEC6; Sun, 12 May 2019 01:31:14 +0000 (UTC) (envelope-from unkadoug@gmail.com) Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) (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 33C5982C3B; Sun, 12 May 2019 01:31:14 +0000 (UTC) (envelope-from unkadoug@gmail.com) Received: by mail-ot1-x32a.google.com with SMTP id l17so8836267otq.1; Sat, 11 May 2019 18:31:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=bX2ERCFQLjJxYJRcj9FxHJiT4h4EnFjXkttzqyEKAbE=; b=j3HLkcii1GUDREkiAuPyhBlius/D0b6LW9wYlTKRv1p+n2phMjUUac14nkCTmKo6qq lWwuaVK7iaOC5BNOhUqnzC3JlGCHapdewVLBFv5E6Gt0HKXu7MgZf1WVQQklDI844i8R hu9H+2tG/NBwbyxPqiIfqbI1g1jJQ3Y93Q0YIjlvdPNvbQpkGZimUqNzUZQF2qg3cujS +GbhM+9KcoQgbnNIoiLn1kIFiic+ne+hIsaDi5IFjVVQiw7mAHzpQwlNlCJEovnCLOlw hyz08iHfXMHdwpa8pqOz6BjMXZa6YFKVPoU7O55ZdZyr3ccJlnxUj5Wp93Q8g/tuqL/A OIPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=bX2ERCFQLjJxYJRcj9FxHJiT4h4EnFjXkttzqyEKAbE=; b=gACU0V9bicRmIlZu2dIGigTwg3IMs83HXIIrAwexom3pyYE/M8nPzSJsdJnoE7u2+X AtwM3+82unhuxz5IRh7O3obsjqhwI5I3TbUvQ/GWMCBNQjn9IqAoN+jw+7cQWrLIyA0g 06w3rL9+8An0Odrx15h3SdVha34lIhfyuXJ4JRYl9lF/S1zp/2fmsqdgqQmJvMK6vz+n Ls0MSmIFIV8ufRHBLFtVZpaL2HREF9i9Aj2MS6pscA+uzi9puMZBArfMZ0/DRuU49QCh U5TaFOxV9WAPo/wPC9u74nMiuDGv9XRzJQW94MzJy0LycflPB7u5JSU75jp06FZMoavh fcRQ== X-Gm-Message-State: APjAAAWtvzsWct6lazAJSh3m24vLPoKbWawjDg3UXrxyVLFpXJzbe54r 5Caet6HQzYjEOwxy416iAZfeh0APg6NAmQ== X-Google-Smtp-Source: APXvYqzcjUWZuI8v+1tm9tI8SKhzSnBx9e3HY8vTF8rIawNaUkm4Eurw99LbWWhx0NdxSDVci11CxA== X-Received: by 2002:a9d:3f05:: with SMTP id m5mr12459812otc.59.1557624673477; Sat, 11 May 2019 18:31:13 -0700 (PDT) Received: from 108-254-203-202.lightspeed.hstntx.sbcglobal.net (108-254-203-202.lightspeed.hstntx.sbcglobal.net. [108.254.203.202]) by smtp.gmail.com with ESMTPSA id 33sm3694172ott.23.2019.05.11.18.31.12 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Sat, 11 May 2019 18:31:12 -0700 (PDT) Subject: Re: svn commit: r347484 - head/sys/kern To: Bruce Evans , Doug Moore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905110909.x4B99A5L006389@repo.freebsd.org> <20190511202741.H1251@besplex.bde.org> From: Doug Moore Openpgp: preference=signencrypt Autocrypt: addr=unkadoug@gmail.com; keydata= mQENBFy53VQBCAD2UiGSouAAMcSIax5Sp9JtRSd9dYVuAmSraY7x5yOylq8yJ5IDvHZy5q3a FamaCHMpXxieiD/8yTnHIeHP4bg02oDD3ALs0hMAEz00pZlLdxeXRfDzAlMTqFF6USPjDUI8 J/WH+pciNT68bFVXFYVg+bgp4GIdi2Md8X8zQQnHY0xLyKE9FjVN1MlCk+62B6fFhMQIEvd5 RQdbGd+ljuoORD1ajljwP1waXKBfAN5RnIbAXppokgQvnwNRf1eZ7GnqSiwu0eaTHGBatPgr y2v5N19R5WxP2kiN95xdlJEwdUikAhWO1UncDxvXQoM1e68L/J85JSLLIgzuywKpBBtdABEB AAG0MERvdWcgTW9vcmUgKHd3dy5mcmVlYnNkLm9yZykgPGRvdWdtQGZyZWVic2Qub3JnPokB UgQTAQoAPBYhBHleNTGSVgOuQpfeg+iPIVPTudVuBQJcyljBAhsDBQkFo5qAAwsJCAUVCgkI CwUWAwIBAAIeAQIXgAAKCRDojyFT07nVbs4lB/49oHwi3YR7SQr43+59tBudmf3WdQ1SRi3G vJDufsrtsB7E9bIFXwFGvVDOMn/cfhNlzors3aM6UQr1N3TPqMAK4TaS12qGL3EvFQ0eVAF1 J+vhQCIjZtgFaCIjoPeQVbi2tVsHaCttBRJeHRIPruWlxngSGZ7eMfjlOY9Oupi809QjFO/3 7FHv+/Bw9HvzlUciY3wH6vLe4zE3Bhqz4lrQAAKey4XPwKwUgs7QK0qhHrlxy+mD0r8LYvwE +Y7WVu5bbDPbyWYZeI8rnCCKnoJ7VFxQd2/g3Jxc1alDg5LoHCssP7z8g9OG8GBXk1T5dRrA Vxlc8Rs3gSxg6b3+lt+CuQENBFy53VQBCADbHDoIQCMsyFFaNjzqZbrd8ntaMwpQ6hBL7Rnb LJSHa8jehZYyAdtWWbbttyVf66J3EAF6HyBXExw9fryuLU+yZfANI0D3cmmb51jCG6Bu8Nnk QTOf3N7cw1sYQSHH2PQlhWYc55Jbu/aJrwfVnEchLdbN8p2y4WXRLfhK32iOaQzMM2xHNk28 sXnAV5DRxQjvXY7IG7cT5Pfr2uAhXqPDDCZsMj9ghZ3aQyvr7q7jS1uzvSPsimOW4Hf9fJqi VxF2kMRH1hQNe1I4v79SaFtDXRSuYivEPV6epifWATwY66/U/jO55TqqDyFz/Bg+2CCpHyyZ GM9A+f86VxLEGc7hABEBAAGJATwEGAEIACYWIQR5XjUxklYDrkKX3oPojyFT07nVbgUCXLnd VAIbDAUJBaOagAAKCRDojyFT07nVbkhiB/0SVq6YcYwrz1j1lBUk7DCUPVALoNSiW4iNia52 7pWQdHGtsTVVCiEcB65qZo0DSrMsAvtGCRSzUebIQ6omDSDnWmbveXykr3vO0+pcRqsJPQKc ATRq2XjcBjZMKOD4A2XOS2t3hAM+oY4F9htQIY9gnvK6RdTtyafJonHpeeNkMC7KEwPGS6hz FU0lrfZxXQ1ipj0QOOgZ8ZomMXbSV5f8GwYSULMPOVmB9ak0ZCOoa451h0o3Hjcnrngw7ofF JFPbmPT2zbpXOm9PqshzTA10ngIETm2x4j5iVvCHEbOJCH8UQydNKrGFa3UBzqj1OoxAggqh CFx6S9PsRfm6+86cuQENBFy6y/MBCAC+ULdDmJZVs7GFnpBdKJnSnVIbX1dkGju1jkvg+7pA 82yX+0hZvIOh0x3Py8asbfqxFleVws59mGEAe5YpRyg+kn0fd14ethlIrsf0sG82b7QLyf9p xGuQBlhyHvgDgdeUGlz6kybVJ9e59ebtNYgjuEC/Glf/b55pmmkSXx5F/4l82Er7fhpiOg42 n7CLonP+AxLsR8L6AjCODedyKidSopcdH8dH6RTN9CmIYSPQq8vRiARrDLNvVQH4PQlv3s4C KqP6zSN3hMdLlLtvgd6UMdyuWKxRk0y0WhGa4bZ8oKPCo5Dr6o12OSEvx+Ue2QBQ67nVY5H6 SoCoopHHomeRABEBAAGJAtIEGAEKACYWIQR5XjUxklYDrkKX3oPojyFT07nVbgUCXLrL8wIb AgUJBaOagAGgCRDojyFT07nVbsDUIAQZAQoAfRYhBH6QdtAAogUD++RrUKO0e1Y/oUusBQJc usvzXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9wZW5wZ3AuZmlmdGhob3JzZW1h bi5uZXQ3RTkwNzZEMDAwQTIwNTAzRkJFNDZCNTBBM0I0N0I1NjNGQTE0QkFDAAoJEKO0e1Y/ oUusp/AH/0kmG5bylgh6Crg307jXoCQgZvtThaB9LGmf57ypUvnfrwt1n0Ex7cKcQnvSA+12 809K12QmR5D61AdU8HBaQdoLFj0rDi34raxgAY554+YiGuj9XagPEKMeb+iuvqvhetC6v7K8 eXqpaWIozIpFJCmElxGMSngAj/V6nOnm6XDSyfgaOCmnjOQRqe49uU+6R67gb7UB4J+XJHgP Wla91BTqsv3NLcwXINqP+iiHtgMLmrH1j0eNhxOk9+RLNf0YbZcGZHf7eWjcJbWcB13e0gF6 mR0RcQxClm89EVv2p+CPITpXTALrIb1/EX9O4bz9OuzdZk5FrWAUNHStBE6+McJz9Qf9Hs+Z vDizuv8NOX2YZeKRdBpWSsKRL32DkPrup6vMDVL1LIft3SJXLc+oWvy82fAm0HuGMXHq47Zc bvmHUJfnSrdhjHSB35R3BwzYZ4/lINDR90WgKw+NJNErmiIP3oPzlVNtLsQmAXXjAdysFuq6 VSW0TclJVIiBjLgnKvh0XzakzxdZ5pVpgCHzKggO+53lRhEkQIgLTRU0bVb/BQkqa8iGwUhB dGd4Sgy9sykO8/1C8ApYrsT51iG7956YWG14NOBuHXoBsdynCTAVYwSR7+7f3enNKzEpUKtg ALG/tpjXzp8gsOtBSlComvjQjZHfWe9+fLy2wJ98wi8q0n3xHA== Message-ID: Date: Sat, 11 May 2019 20:31:11 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190511202741.H1251@besplex.bde.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: 33C5982C3B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,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: Sun, 12 May 2019 01:31:14 -0000 On 5/11/19 5:52 AM, Bruce Evans wrote: > On Sat, 11 May 2019, Doug Moore wrote: >> +#ifdef HAVE_INLINE_FFS >> +    case sizeof(int): >> +        return (ffs(mask) - 1); >> +#endif > > This is unreachable, since sizeof(int) is 4 on all supported arches, and > sizeof(mask) is 8 on all arches. > Another FreeBSD developer has expressed to me that sizeof(mask) ought to become 4 on some 32-bit arches before too long, and I added this case in anticipation of that.  I see now that I should have waited. Doug Moore From owner-svn-src-head@freebsd.org Sun May 12 06:32:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B567D158DF6A; Sun, 12 May 2019 06:32:47 +0000 (UTC) (envelope-from mjg@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 5680C8A233; Sun, 12 May 2019 06:32:47 +0000 (UTC) (envelope-from mjg@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 2B74F26E54; Sun, 12 May 2019 06:32:47 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4C6WkBF093872; Sun, 12 May 2019 06:32:46 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4C6Wkmr093871; Sun, 12 May 2019 06:32:46 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201905120632.x4C6Wkmr093871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 12 May 2019 06:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347500 - head/sys/libkern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/libkern X-SVN-Commit-Revision: 347500 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5680C8A233 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.91)[-0.913,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Sun, 12 May 2019 06:32:47 -0000 Author: mjg Date: Sun May 12 06:32:46 2019 New Revision: 347500 URL: https://svnweb.freebsd.org/changeset/base/347500 Log: random(4): depessimize arc4random - __predict_false reseeding on entry as it is almost never true. - don't blindly atomic_cmpset as on x86 it ends up dirtying the cacheline. it almost ever succeeds per above - fetch the timestamp prior to getting the cpu number Reviewed by: cem Approved by: secteam (delphij) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20242 Modified: head/sys/libkern/arc4random.c Modified: head/sys/libkern/arc4random.c ============================================================================== --- head/sys/libkern/arc4random.c Sat May 11 22:58:25 2019 (r347499) +++ head/sys/libkern/arc4random.c Sun May 12 06:32:46 2019 (r347500) @@ -173,18 +173,20 @@ arc4rand(void *ptr, u_int len, int reseed) u_int length; u_int8_t *p; - if (reseed || atomic_cmpset_int(&arc4rand_iniseed_state, ARC4_ENTR_HAVE, ARC4_ENTR_SEED)) + if (__predict_false(reseed || + (arc4rand_iniseed_state == ARC4_ENTR_HAVE && + atomic_cmpset_int(&arc4rand_iniseed_state, ARC4_ENTR_HAVE, ARC4_ENTR_SEED)))) CHACHA20_FOREACH(chacha20) chacha20_randomstir(chacha20); - chacha20 = &chacha20inst[curcpu]; getmicrouptime(&tv); + chacha20 = &chacha20inst[curcpu]; /* We may get unlucky and be migrated off this CPU, but that is expected to be infrequent */ if ((chacha20->numbytes > CHACHA20_RESEED_BYTES) || (tv.tv_sec > chacha20->t_reseed)) chacha20_randomstir(chacha20); - mtx_lock(&chacha20->mtx); p = ptr; + mtx_lock(&chacha20->mtx); while (len) { length = MIN(CHACHA20_BUFFER_SIZE, len); chacha_encrypt_bytes(&chacha20->ctx, chacha20->m_buffer, p, length); From owner-svn-src-head@freebsd.org Sun May 12 06:34:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0199158E015; Sun, 12 May 2019 06:34:59 +0000 (UTC) (envelope-from mjg@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 647518A3CF; Sun, 12 May 2019 06:34:59 +0000 (UTC) (envelope-from mjg@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 532DF26E60; Sun, 12 May 2019 06:34:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4C6Yxo4094024; Sun, 12 May 2019 06:34:59 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4C6YxFx094023; Sun, 12 May 2019 06:34:59 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201905120634.x4C6YxFx094023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 12 May 2019 06:34:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347501 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 347501 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 647518A3CF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.91)[-0.913,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 12 May 2019 06:34:59 -0000 Author: mjg Date: Sun May 12 06:34:58 2019 New Revision: 347501 URL: https://svnweb.freebsd.org/changeset/base/347501 Log: amd64: stop re-reading curpc in suword Plugs re-reads missed in r341719 Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/support.S Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Sun May 12 06:32:46 2019 (r347500) +++ head/sys/amd64/amd64/support.S Sun May 12 06:34:58 2019 (r347501) @@ -1083,7 +1083,6 @@ ENTRY(suword_nosmap) movq %rsi,(%rdi) xorl %eax,%eax - movq PCPU(CURPCB),%rcx movq %rax,PCB_ONFAULT(%rcx) POP_FRAME_POINTER ret @@ -1102,7 +1101,6 @@ ENTRY(suword_smap) movq %rsi,(%rdi) clac xorl %eax,%eax - movq PCPU(CURPCB),%rcx movq %rax,PCB_ONFAULT(%rcx) POP_FRAME_POINTER ret @@ -1119,7 +1117,6 @@ ENTRY(suword32_nosmap) movl %esi,(%rdi) xorl %eax,%eax - movq PCPU(CURPCB),%rcx movq %rax,PCB_ONFAULT(%rcx) POP_FRAME_POINTER ret @@ -1138,7 +1135,6 @@ ENTRY(suword32_smap) movl %esi,(%rdi) clac xorl %eax,%eax - movq PCPU(CURPCB),%rcx movq %rax,PCB_ONFAULT(%rcx) POP_FRAME_POINTER ret From owner-svn-src-head@freebsd.org Sun May 12 06:36:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47D6C158E139; Sun, 12 May 2019 06:36:56 +0000 (UTC) (envelope-from mjg@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 E1F608A68A; Sun, 12 May 2019 06:36:55 +0000 (UTC) (envelope-from mjg@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 BE02826E63; Sun, 12 May 2019 06:36:55 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4C6atqa094486; Sun, 12 May 2019 06:36:55 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4C6asUq094481; Sun, 12 May 2019 06:36:54 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201905120636.x4C6asUq094481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 12 May 2019 06:36:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347502 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include x86/include x86/x86 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/include i386/i386 i386/include x86/include x86/x86 X-SVN-Commit-Revision: 347502 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E1F608A68A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.91)[-0.913,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Sun, 12 May 2019 06:36:56 -0000 Author: mjg Date: Sun May 12 06:36:54 2019 New Revision: 347502 URL: https://svnweb.freebsd.org/changeset/base/347502 Log: x86: store pending bitmapped IPIs in per-cpu areas This gets rid of the global cpu_ipi_pending array. While replace cmpset with fcmpset in the delivery code and opportunistically check if given IPI is already pending. Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/include/pcpu.h head/sys/i386/i386/mp_machdep.c head/sys/i386/include/pcpu.h head/sys/x86/include/x86_smp.h head/sys/x86/x86/mp_x86.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Sun May 12 06:34:58 2019 (r347501) +++ head/sys/amd64/amd64/mp_machdep.c Sun May 12 06:36:54 2019 (r347502) @@ -193,7 +193,6 @@ cpu_mp_start(void) /* Initialize the logical ID to APIC ID table. */ for (i = 0; i < MAXCPU; i++) { cpu_apic_ids[i] = -1; - cpu_ipi_pending[i] = 0; } /* Install an inter-CPU IPI for TLB invalidation */ Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Sun May 12 06:34:58 2019 (r347501) +++ head/sys/amd64/include/pcpu.h Sun May 12 06:36:54 2019 (r347502) @@ -84,7 +84,8 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x c uint32_t pc_pcid_gen; \ uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \ uint32_t pc_ibpb_set; \ - char __pad[3288] /* pad to UMA_PCPU_ALLOC_SIZE */ + u_int pc_ipi_bitmap; \ + char __pad[3284] /* pad to UMA_PCPU_ALLOC_SIZE */ #define PC_DBREG_CMD_NONE 0 #define PC_DBREG_CMD_LOAD 1 Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Sun May 12 06:34:58 2019 (r347501) +++ head/sys/i386/i386/mp_machdep.c Sun May 12 06:36:54 2019 (r347502) @@ -153,7 +153,6 @@ cpu_mp_start(void) /* Initialize the logical ID to APIC ID table. */ for (i = 0; i < MAXCPU; i++) { cpu_apic_ids[i] = -1; - cpu_ipi_pending[i] = 0; } /* Install an inter-CPU IPI for TLB invalidation */ Modified: head/sys/i386/include/pcpu.h ============================================================================== --- head/sys/i386/include/pcpu.h Sun May 12 06:34:58 2019 (r347501) +++ head/sys/i386/include/pcpu.h Sun May 12 06:36:54 2019 (r347502) @@ -87,7 +87,8 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x c caddr_t pc_pmap_eh_ptep; \ uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \ uint32_t pc_ibpb_set; \ - char __pad[3610] + u_int pc_ipi_bitmap; \ + char __pad[3606] #ifdef _KERNEL Modified: head/sys/x86/include/x86_smp.h ============================================================================== --- head/sys/x86/include/x86_smp.h Sun May 12 06:34:58 2019 (r347501) +++ head/sys/x86/include/x86_smp.h Sun May 12 06:36:54 2019 (r347502) @@ -34,7 +34,6 @@ extern char *bootSTK; extern void *bootstacks[]; extern unsigned int boot_address; extern unsigned int bootMP_size; -extern volatile u_int cpu_ipi_pending[]; extern volatile int aps_ready; extern struct mtx ap_boot_mtx; extern int cpu_logical; Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Sun May 12 06:34:58 2019 (r347501) +++ head/sys/x86/x86/mp_x86.c Sun May 12 06:36:54 2019 (r347502) @@ -137,9 +137,6 @@ _Static_assert(MAXCPU <= MAX_APIC_ID, _Static_assert(xAPIC_MAX_APIC_ID <= MAX_APIC_ID, "xAPIC_MAX_APIC_ID cannot be larger that MAX_APIC_ID"); -/* Holds pending bitmap based IPIs per CPU */ -volatile u_int cpu_ipi_pending[MAXCPU]; - static void release_aps(void *dummy); static void cpustop_handler_post(u_int cpu); @@ -1224,19 +1221,24 @@ ipi_startup(int apic_id, int vector) void ipi_send_cpu(int cpu, u_int ipi) { - u_int bitmap, old_pending, new_pending; + u_int bitmap, old, new; + u_int *cpu_bitmap; KASSERT(cpu_apic_ids[cpu] != -1, ("IPI to non-existent CPU %d", cpu)); if (IPI_IS_BITMAPED(ipi)) { bitmap = 1 << ipi; ipi = IPI_BITMAP_VECTOR; - do { - old_pending = cpu_ipi_pending[cpu]; - new_pending = old_pending | bitmap; - } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu], - old_pending, new_pending)); - if (old_pending) + cpu_bitmap = &cpuid_to_pcpu[cpu]->pc_ipi_bitmap; + old = *cpu_bitmap; + for (;;) { + if ((old & bitmap) == bitmap) + break; + new = old | bitmap; + if (atomic_fcmpset_int(cpu_bitmap, &old, new)) + break; + } + if (old) return; } lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]); @@ -1255,7 +1257,7 @@ ipi_bitmap_handler(struct trapframe frame) td->td_intr_nesting_level++; oldframe = td->td_intr_frame; td->td_intr_frame = &frame; - ipi_bitmap = atomic_readandclear_int(&cpu_ipi_pending[cpu]); + ipi_bitmap = atomic_readandclear_int(&cpuid_to_pcpu[cpu]->pc_ipi_bitmap); if (ipi_bitmap & (1 << IPI_PREEMPT)) { #ifdef COUNT_IPIS (*ipi_preempt_counts[cpu])++; From owner-svn-src-head@freebsd.org Sun May 12 06:39:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BB7D158E2AC; Sun, 12 May 2019 06:39:31 +0000 (UTC) (envelope-from mjg@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 211258A89E; Sun, 12 May 2019 06:39:31 +0000 (UTC) (envelope-from mjg@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 F093526E66; Sun, 12 May 2019 06:39:30 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4C6dUeU094626; Sun, 12 May 2019 06:39:30 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4C6dU31094625; Sun, 12 May 2019 06:39:30 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201905120639.x4C6dU31094625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 12 May 2019 06:39:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347503 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347503 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 211258A89E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.91)[-0.913,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 12 May 2019 06:39:31 -0000 Author: mjg Date: Sun May 12 06:39:30 2019 New Revision: 347503 URL: https://svnweb.freebsd.org/changeset/base/347503 Log: cache: push sdt probes in cache_zap_locked to code doing the work Avoids branching to check which probe to evaluate. Very same check was being done later to do the actual work. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun May 12 06:36:54 2019 (r347502) +++ head/sys/kern/vfs_cache.c Sun May 12 06:39:30 2019 (r347503) @@ -851,19 +851,16 @@ cache_zap_locked(struct namecache *ncp, bool neg_locke CTR2(KTR_VFS, "cache_zap(%p) vp %p", ncp, (ncp->nc_flag & NCF_NEGATIVE) ? NULL : ncp->nc_vp); + LIST_REMOVE(ncp, nc_hash); if (!(ncp->nc_flag & NCF_NEGATIVE)) { SDT_PROBE3(vfs, namecache, zap, done, ncp->nc_dvp, ncp->nc_name, ncp->nc_vp); - } else { - SDT_PROBE3(vfs, namecache, zap_negative, done, ncp->nc_dvp, - ncp->nc_name, ncp->nc_neghits); - } - LIST_REMOVE(ncp, nc_hash); - if (!(ncp->nc_flag & NCF_NEGATIVE)) { TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst, ncp, nc_dst); if (ncp == ncp->nc_vp->v_cache_dd) ncp->nc_vp->v_cache_dd = NULL; } else { + SDT_PROBE3(vfs, namecache, zap_negative, done, ncp->nc_dvp, + ncp->nc_name, ncp->nc_neghits); cache_negative_remove(ncp, neg_locked); } if (ncp->nc_flag & NCF_ISDOTDOT) { From owner-svn-src-head@freebsd.org Sun May 12 06:42:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86980158E599; Sun, 12 May 2019 06:42:18 +0000 (UTC) (envelope-from mjg@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 2DA978AC94; Sun, 12 May 2019 06:42:18 +0000 (UTC) (envelope-from mjg@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 0914E2700A; Sun, 12 May 2019 06:42:18 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4C6gH6T098797; Sun, 12 May 2019 06:42:17 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4C6gH30098796; Sun, 12 May 2019 06:42:17 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201905120642.x4C6gH30098796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 12 May 2019 06:42:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347504 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 347504 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2DA978AC94 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.91)[-0.913,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Sun, 12 May 2019 06:42:18 -0000 Author: mjg Date: Sun May 12 06:42:17 2019 New Revision: 347504 URL: https://svnweb.freebsd.org/changeset/base/347504 Log: amd64: fixup MEMMOVE comment (10 -> r10) Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/support.S Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Sun May 12 06:39:30 2019 (r347503) +++ head/sys/amd64/amd64/support.S Sun May 12 06:42:17 2019 (r347504) @@ -205,7 +205,7 @@ END(memcmp) * rsi - source * rdx - count * - * The macro possibly clobbers the above and: rcx, r8, r9, 10 + * The macro possibly clobbers the above and: rcx, r8, r9, r10 * It does not clobber rax nor r11. */ .macro MEMMOVE erms overlap begin end From owner-svn-src-head@freebsd.org Sun May 12 06:59:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBFC4158EF9D; Sun, 12 May 2019 06:59:23 +0000 (UTC) (envelope-from mjg@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 71EC08B819; Sun, 12 May 2019 06:59:23 +0000 (UTC) (envelope-from mjg@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 4D2B6271C7; Sun, 12 May 2019 06:59:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4C6xNJb005163; Sun, 12 May 2019 06:59:23 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4C6xNXS005162; Sun, 12 May 2019 06:59:23 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201905120659.x4C6xNXS005162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 12 May 2019 06:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347505 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347505 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 71EC08B819 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.91)[-0.913,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 12 May 2019 06:59:24 -0000 Author: mjg Date: Sun May 12 06:59:22 2019 New Revision: 347505 URL: https://svnweb.freebsd.org/changeset/base/347505 Log: cache: bump numcache on entry, while here fix lnumcache type Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun May 12 06:42:17 2019 (r347504) +++ head/sys/kern/vfs_cache.c Sun May 12 06:59:22 2019 (r347505) @@ -1632,7 +1632,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, int flag; int len; bool neg_locked; - int lnumcache; + u_long lnumcache; CTR3(KTR_VFS, "cache_enter(%p, %p, %s)", dvp, vp, cnp->cn_nameptr); VNASSERT(vp == NULL || (vp->v_iflag & VI_DOOMED) == 0, vp, @@ -1646,7 +1646,8 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, /* * Avoid blowout in namecache entries. */ - if (__predict_false(numcache >= desiredvnodes * ncsizefactor)) + lnumcache = atomic_fetchadd_long(&numcache, 1) + 1; + if (__predict_false(lnumcache >= desiredvnodes * ncsizefactor)) return; cache_celockstate_init(&cel); @@ -1825,7 +1826,6 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, ncp->nc_name); } cache_enter_unlock(&cel); - lnumcache = atomic_fetchadd_long(&numcache, 1) + 1; if (numneg * ncnegfactor > lnumcache) cache_negative_zap_one(); cache_free(ndd); From owner-svn-src-head@freebsd.org Sun May 12 07:11:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8A3C158F458; Sun, 12 May 2019 07:11:45 +0000 (UTC) (envelope-from mjg@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 4520D8BE68; Sun, 12 May 2019 07:11:45 +0000 (UTC) (envelope-from mjg@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 1AE60274E4; Sun, 12 May 2019 07:11:45 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4C7Bi0D012104; Sun, 12 May 2019 07:11:44 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4C7Bifm012103; Sun, 12 May 2019 07:11:44 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201905120711.x4C7Bifm012103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 12 May 2019 07:11:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347506 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 347506 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4520D8BE68 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Sun, 12 May 2019 07:11:45 -0000 Author: mjg Date: Sun May 12 07:11:44 2019 New Revision: 347506 URL: https://svnweb.freebsd.org/changeset/base/347506 Log: amd64: tidy up pagezero*/pagecopy (movq -> movl) Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/support.S Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Sun May 12 06:59:22 2019 (r347505) +++ head/sys/amd64/amd64/support.S Sun May 12 07:11:44 2019 (r347506) @@ -43,7 +43,7 @@ /* Address: %rdi */ ENTRY(pagezero_std) PUSH_FRAME_POINTER - movq $PAGE_SIZE/8,%rcx + movl $PAGE_SIZE/8,%ecx xorl %eax,%eax rep stosq @@ -53,7 +53,7 @@ END(pagezero_std) ENTRY(pagezero_erms) PUSH_FRAME_POINTER - movq $PAGE_SIZE,%rcx + movl $PAGE_SIZE,%ecx xorl %eax,%eax rep stosb @@ -66,7 +66,7 @@ END(pagezero_erms) */ ENTRY(pagecopy) PUSH_FRAME_POINTER - movq $PAGE_SIZE/8,%rcx + movl $PAGE_SIZE/8,%ecx movq %rdi,%r9 movq %rsi,%rdi movq %r9,%rsi From owner-svn-src-head@freebsd.org Sun May 12 07:13:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6B8D158F4F8; Sun, 12 May 2019 07:13:26 +0000 (UTC) (envelope-from mjg@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 8797D8C02C; Sun, 12 May 2019 07:13:26 +0000 (UTC) (envelope-from mjg@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 5CD1027520; Sun, 12 May 2019 07:13:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4C7DQFo015479; Sun, 12 May 2019 07:13:26 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4C7DQkW015478; Sun, 12 May 2019 07:13:26 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201905120713.x4C7DQkW015478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 12 May 2019 07:13:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347507 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 347507 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8797D8C02C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 12 May 2019 07:13:27 -0000 Author: mjg Date: Sun May 12 07:13:25 2019 New Revision: 347507 URL: https://svnweb.freebsd.org/changeset/base/347507 Log: seqc: fix sed-introduced typos (seqcuence -> sequence) Sponsored by: The FreeBSD Foundation Modified: head/sys/sys/seqc.h Modified: head/sys/sys/seqc.h ============================================================================== --- head/sys/sys/seqc.h Sun May 12 07:11:44 2019 (r347506) +++ head/sys/sys/seqc.h Sun May 12 07:13:25 2019 (r347507) @@ -44,9 +44,9 @@ typedef uint32_t seqc_t; * seqc allows readers and writers to work with a consistent snapshot. Modifying * operations must be enclosed within a transaction delineated by * seqc_write_beg/seqc_write_end. The trick works by having the writer increment - * the seqcuence number twice, at the beginning and end of the transaction. - * The reader detects that the seqcuence number has not changed between its start - * and end, and that the seqcuence number is even, to validate consistency. + * the sequence number twice, at the beginning and end of the transaction. + * The reader detects that the sequence number has not changed between its start + * and end, and that the sequence number is even, to validate consistency. * * Some fencing (both hard fencing and compiler barriers) may be needed, * depending on the cpu. Modern AMD cpus provide strong enough guarantees to not From owner-svn-src-head@freebsd.org Sun May 12 07:56:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 743E81590334; Sun, 12 May 2019 07:56:02 +0000 (UTC) (envelope-from mjg@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 177E88D368; Sun, 12 May 2019 07:56:02 +0000 (UTC) (envelope-from mjg@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 E530927BC7; Sun, 12 May 2019 07:56:01 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4C7u1RR036562; Sun, 12 May 2019 07:56:01 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4C7u1eL036561; Sun, 12 May 2019 07:56:01 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201905120756.x4C7u1eL036561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 12 May 2019 07:56:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347510 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347510 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 177E88D368 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 12 May 2019 07:56:02 -0000 Author: mjg Date: Sun May 12 07:56:01 2019 New Revision: 347510 URL: https://svnweb.freebsd.org/changeset/base/347510 Log: cache: fix a brainfart in r347505 If bumping over the counter goes over the limit we have to decrement it back. Previous code would only bump the counter after adding the entry (thus allowing the cache to go over the limit). Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun May 12 07:55:25 2019 (r347509) +++ head/sys/kern/vfs_cache.c Sun May 12 07:56:01 2019 (r347510) @@ -1647,8 +1647,10 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, * Avoid blowout in namecache entries. */ lnumcache = atomic_fetchadd_long(&numcache, 1) + 1; - if (__predict_false(lnumcache >= desiredvnodes * ncsizefactor)) + if (__predict_false(lnumcache >= desiredvnodes * ncsizefactor)) { + atomic_add_long(&numcache, -1); return; + } cache_celockstate_init(&cel); ndd = NULL; From owner-svn-src-head@freebsd.org Sun May 12 11:45:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9421F1595024; Sun, 12 May 2019 11:45:21 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 115D16CD81; Sun, 12 May 2019 11:45:20 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id E5AB5105E529; Sun, 12 May 2019 21:45:08 +1000 (AEST) Date: Sun, 12 May 2019 21:45:07 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Doug Moore cc: Bruce Evans , Doug Moore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347484 - head/sys/kern In-Reply-To: Message-ID: <20190512212143.M868@besplex.bde.org> References: <201905110909.x4B99A5L006389@repo.freebsd.org> <20190511202741.H1251@besplex.bde.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=nlC_4_pT8q9DhB4Ho9EA:9 a=dJQolKwh0MkX_D4bUnwA:9 a=45ClL6m2LaAA:10 X-Rspamd-Queue-Id: 115D16CD81 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.980,0] Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed 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, 12 May 2019 11:45:21 -0000 On Sat, 11 May 2019, Doug Moore wrote: > On 5/11/19 5:52 AM, Bruce Evans wrote: >> On Sat, 11 May 2019, Doug Moore wrote: >>> +#ifdef HAVE_INLINE_FFS >>> +=C2=A0=C2=A0=C2=A0 case sizeof(int): >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return (ffs(mask) - 1); >>> +#endif >> >> This is unreachable, since sizeof(int) is 4 on all supported arches, and >> sizeof(mask) is 8 on all arches. >> > Another FreeBSD developer has expressed to me that sizeof(mask) ought to > become 4 on some 32-bit arches before too long, and I added this case in > anticipation of that.=C2=A0 I see now that I should have waited. I also don't like the use of unsigned long for __fd_mask and bitstr_t. This asks for a a pessimal type that is twice as wide as a machine register, but is not so pessimal in practice since longs are rarely implemented correctly except on systems with 16-bit machine registers. The mask type u_daddr_t is both logically wrong (masks have nothing to do with daddr_t's) and gives a pessimal bitstring type more often in practice: - in FreeBSD-4, [u_]daddr_t was 32 bits, so misusing it for bitstrings was pessimal on 64-bit arches - expanding [u_]daddr_t to 64 bits in FreeBSD-5 (r96572-96851 only 17 years ago) made it pessimal for bitstrings on 32-bit arches. The pessimization would be smaller if ffs64() exists and is inlined to 32-bit ffs()'s. Using the long long abomination asks for double the pessimizations and machine dependencies as using long. In practice, expanding long long to larger than 64 bits would break ABIs so it is not much worse than a spelling error for int64_t. Bruce From owner-svn-src-head@freebsd.org Sun May 12 15:27:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A16E15999F4; Sun, 12 May 2019 15:27:02 +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 C270B72DC9; Sun, 12 May 2019 15:27:01 +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 8FDF92C68F; Sun, 12 May 2019 15:27:01 +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 x4CFR1w1071629; Sun, 12 May 2019 15:27:01 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4CFR1eO071628; Sun, 12 May 2019 15:27:01 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905121527.x4CFR1eO071628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 12 May 2019 15:27:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347512 - 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: 347512 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C270B72DC9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Sun, 12 May 2019 15:27:02 -0000 Author: manu Date: Sun May 12 15:27:01 2019 New Revision: 347512 URL: https://svnweb.freebsd.org/changeset/base/347512 Log: arm: allwinner: aw_clk_nm: Don't reparent the clock if we didn't ask When looking for the best frequency don't change the clock parent if the clock wasn't configured to do that. Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk_nm.c Sun May 12 12:30:45 2019 (r347511) +++ head/sys/arm/allwinner/clkng/aw_clk_nm.c Sun May 12 15:27:01 2019 (r347512) @@ -236,7 +236,7 @@ aw_clk_nm_set_freq(struct clknode *clk, uint64_t fpare return (ERANGE); } - if (p_idx != best_parent) + if ((sc->flags & AW_CLK_REPARENT) != 0 && p_idx != best_parent) clknode_set_parent_by_idx(clk, best_parent); DEVICE_LOCK(clk); From owner-svn-src-head@freebsd.org Sun May 12 16:17:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37D11159AA4A; Sun, 12 May 2019 16:17:07 +0000 (UTC) (envelope-from br@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 BFC8C745D4; Sun, 12 May 2019 16:17:06 +0000 (UTC) (envelope-from br@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 94AAA2CEEA; Sun, 12 May 2019 16:17:06 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4CGH6Lg097226; Sun, 12 May 2019 16:17:06 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4CGH5CU097220; Sun, 12 May 2019 16:17:05 GMT (envelope-from br@FreeBSD.org) Message-Id: <201905121617.x4CGH5CU097220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Sun, 12 May 2019 16:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347514 - in head/sys/riscv: include riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys/riscv: include riscv X-SVN-Commit-Revision: 347514 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BFC8C745D4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 12 May 2019 16:17:07 -0000 Author: br Date: Sun May 12 16:17:05 2019 New Revision: 347514 URL: https://svnweb.freebsd.org/changeset/base/347514 Log: Add support for HiFive Unleashed -- the board with a multi-core RISC-V SoC from SiFive, Inc. The first core on this SoC (hart 0) is a 64-bit microcontroller. o Pick a hart to run boot process using hart lottery. This allows to exclude hart 0 from running the boot process. (BBL releases hart 0 after the main harts, so it never wins the lottery). o Renumber CPUs early on boot. Exclude non-MMU cores. Store the original hart ID in struct pcpu. This allows to find out the correct destination for IPIs and remote sfence calls. Thanks to SiFive, Inc for the board provided. Reviewed by: markj Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D20225 Modified: head/sys/riscv/include/pcpu.h head/sys/riscv/riscv/intr_machdep.c head/sys/riscv/riscv/locore.S head/sys/riscv/riscv/machdep.c head/sys/riscv/riscv/mp_machdep.c head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/include/pcpu.h ============================================================================== --- head/sys/riscv/include/pcpu.h Sun May 12 15:27:18 2019 (r347513) +++ head/sys/riscv/include/pcpu.h Sun May 12 16:17:05 2019 (r347514) @@ -47,7 +47,8 @@ #define PCPU_MD_FIELDS \ struct pmap *pc_curpmap; /* Currently active pmap */ \ uint32_t pc_pending_ipis; /* IPIs pending to this CPU */ \ - char __pad[61] + uint32_t pc_hart; /* Hart ID */ \ + char __pad[57] #ifdef _KERNEL Modified: head/sys/riscv/riscv/intr_machdep.c ============================================================================== --- head/sys/riscv/riscv/intr_machdep.c Sun May 12 15:27:18 2019 (r347513) +++ head/sys/riscv/riscv/intr_machdep.c Sun May 12 16:17:05 2019 (r347514) @@ -207,7 +207,7 @@ ipi_send(struct pcpu *pc, int ipi) CTR3(KTR_SMP, "%s: cpu=%d, ipi=%x", __func__, pc->pc_cpuid, ipi); atomic_set_32(&pc->pc_pending_ipis, ipi); - mask = (1 << (pc->pc_cpuid)); + mask = (1 << pc->pc_hart); sbi_send_ipi(&mask); @@ -252,7 +252,7 @@ ipi_selected(cpuset_t cpus, u_int ipi) CTR3(KTR_SMP, "%s: pc: %p, ipi: %x\n", __func__, pc, ipi); atomic_set_32(&pc->pc_pending_ipis, ipi); - mask |= (1 << (pc->pc_cpuid)); + mask |= (1 << pc->pc_hart); } } sbi_send_ipi(&mask); Modified: head/sys/riscv/riscv/locore.S ============================================================================== --- head/sys/riscv/riscv/locore.S Sun May 12 15:27:18 2019 (r347513) +++ head/sys/riscv/riscv/locore.S Sun May 12 16:17:05 2019 (r347514) @@ -59,12 +59,18 @@ _start: sub t1, t1, t0 li t2, KERNBASE sub s9, t2, t1 /* s9 = physmem base */ - mv s10, a0 /* s10 = hart id */ - mv s11, a1 /* s11 = dtbp */ - /* Direct secondary cores to mpentry */ - bnez s10, mpentry + /* + * a0 = hart id + * a1 = dtbp + */ + /* Pick a hart to run the boot process. */ + la t0, hart_lottery + li t1, 1 + amoadd.w t0, t1, 0(t0) + bnez t0, mpentry + /* * Page tables */ @@ -123,7 +129,7 @@ _start: /* Create an L2 page superpage for DTB */ la s1, pagetable_l2_devmap - mv s2, s11 + mv s2, a1 srli s2, s2, PAGE_SHIFT li t0, (PTE_KERN) @@ -171,13 +177,19 @@ va: addi sp, sp, -PCB_SIZE /* Clear BSS */ - la a0, _C_LABEL(__bss_start) + la s0, _C_LABEL(__bss_start) la s1, _C_LABEL(_end) 1: - sd zero, 0(a0) - addi a0, a0, 8 - bltu a0, s1, 1b + sd zero, 0(s0) + addi s0, s0, 8 + bltu s0, s1, 1b +#ifdef SMP + /* Store boot hart id. */ + la t0, boot_hart + sw a0, 0(t0) +#endif + /* Fill riscv_bootparams */ addi sp, sp, -40 @@ -190,7 +202,7 @@ va: li t0, (VM_MAX_KERNEL_ADDRESS - 2 * L2_SIZE) sd t0, 24(sp) /* dtbp_virt */ - sd s11, 32(sp) /* dtbp_phys */ + sd a1, 32(sp) /* dtbp_phys */ mv a0, sp call _C_LABEL(initriscv) /* Off we go */ @@ -233,9 +245,11 @@ pagetable_l2: pagetable_l2_devmap: .space PAGE_SIZE - .align 3 + .align 3 virt_map: - .quad virt_map + .quad virt_map +hart_lottery: + .space 4 /* Not in use, but required for linking. */ .align 3 @@ -278,7 +292,8 @@ ENTRY(mpentry) /* Setup stack pointer */ la t0, secondary_stacks li t1, (PAGE_SIZE * KSTACK_PAGES) - mulw t1, t1, s10 + mulw t2, t1, a0 + add t0, t0, t2 add t0, t0, t1 sub t0, t0, s9 li t1, KERNBASE Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Sun May 12 15:27:18 2019 (r347513) +++ head/sys/riscv/riscv/machdep.c Sun May 12 16:17:05 2019 (r347514) @@ -117,6 +117,9 @@ int64_t dcache_line_size; /* The minimum D cache line int64_t icache_line_size; /* The minimum I cache line size */ int64_t idcache_line_size; /* The minimum cache line size */ +uint32_t boot_hart; /* The hart we booted on. */ +cpuset_t all_harts; + extern int *end; extern int *initstack_end; @@ -815,6 +818,7 @@ initriscv(struct riscv_bootparams *rvbp) /* Set the pcpu data, this is needed by pmap_bootstrap */ pcpup = &__pcpu[0]; pcpu_init(pcpup, 0, sizeof(struct pcpu)); + pcpup->pc_hart = boot_hart; /* Set the pcpu pointer */ __asm __volatile("mv gp, %0" :: "r"(pcpup)); Modified: head/sys/riscv/riscv/mp_machdep.c ============================================================================== --- head/sys/riscv/riscv/mp_machdep.c Sun May 12 15:27:18 2019 (r347513) +++ head/sys/riscv/riscv/mp_machdep.c Sun May 12 16:17:05 2019 (r347514) @@ -91,6 +91,9 @@ static int ipi_handler(void *); struct mtx ap_boot_mtx; struct pcb stoppcbs[MAXCPU]; +extern uint32_t boot_hart; +extern cpuset_t all_harts; + #ifdef INVARIANTS static uint32_t cpu_reg[MAXCPU][2]; #endif @@ -99,7 +102,7 @@ static device_t cpu_list[MAXCPU]; void mpentry(unsigned long cpuid); void init_secondary(uint64_t); -uint8_t secondary_stacks[MAXCPU - 1][PAGE_SIZE * KSTACK_PAGES] __aligned(16); +uint8_t secondary_stacks[MAXCPU][PAGE_SIZE * KSTACK_PAGES] __aligned(16); /* Set to 1 once we're ready to let the APs out of the pen. */ volatile int aps_ready = 0; @@ -182,7 +185,7 @@ riscv64_cpu_attach(device_t dev) static void release_aps(void *dummy __unused) { - u_long mask; + cpuset_t mask; int cpu, i; if (mp_ncpus == 1) @@ -194,15 +197,13 @@ release_aps(void *dummy __unused) atomic_store_rel_int(&aps_ready, 1); /* Wake up the other CPUs */ - mask = 0; + mask = all_harts; + CPU_CLR(boot_hart, &mask); - for (i = 1; i < mp_ncpus; i++) - mask |= (1 << i); - - sbi_send_ipi(&mask); - printf("Release APs\n"); + sbi_send_ipi(mask.__bits); + for (i = 0; i < 2000; i++) { if (smp_started) { for (cpu = 0; cpu <= mp_maxid; cpu++) { @@ -219,12 +220,19 @@ release_aps(void *dummy __unused) SYSINIT(start_aps, SI_SUB_SMP, SI_ORDER_FIRST, release_aps, NULL); void -init_secondary(uint64_t cpu) +init_secondary(uint64_t hart) { struct pcpu *pcpup; + u_int cpuid; + /* Renumber this cpu */ + cpuid = hart; + if (cpuid < boot_hart) + cpuid += mp_maxid + 1; + cpuid -= boot_hart; + /* Setup the pcpu pointer */ - pcpup = &__pcpu[cpu]; + pcpup = &__pcpu[cpuid]; __asm __volatile("mv gp, %0" :: "r"(pcpup)); /* Workaround: make sure wfi doesn't halt the hart */ @@ -366,11 +374,12 @@ cpu_mp_probe(void) static boolean_t cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg) { - uint64_t target_cpu; struct pcpu *pcpup; + uint64_t hart; + u_int cpuid; - /* Check we are able to start this cpu */ - if (id > mp_maxid) + /* Check if this hart supports MMU. */ + if (OF_getproplen(node, "mmu-type") < 0) return (0); KASSERT(id < MAXCPU, ("Too many CPUs")); @@ -382,29 +391,44 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size cpu_reg[id][1] = reg[1]; #endif - target_cpu = reg[0]; + hart = reg[0]; if (addr_size == 2) { - target_cpu <<= 32; - target_cpu |= reg[1]; + hart <<= 32; + hart |= reg[1]; } - pcpup = &__pcpu[id]; + KASSERT(hart < MAXCPU, ("Too many harts.")); - /* We are already running on cpu 0 */ - if (id == 0) { + /* We are already running on this cpu */ + if (hart == boot_hart) return (1); - } - pcpu_init(pcpup, id, sizeof(struct pcpu)); + /* + * Rotate the CPU IDs to put the boot CPU as CPU 0. + * We keep the other CPUs ordered. + */ + cpuid = hart; + if (cpuid < boot_hart) + cpuid += mp_maxid + 1; + cpuid -= boot_hart; - dpcpu[id - 1] = (void *)kmem_malloc(DPCPU_SIZE, M_WAITOK | M_ZERO); - dpcpu_init(dpcpu[id - 1], id); + /* Check if we are able to start this cpu */ + if (cpuid > mp_maxid) + return (0); - printf("Starting CPU %u (%lx)\n", id, target_cpu); - __riscv_boot_ap[id] = 1; + pcpup = &__pcpu[cpuid]; + pcpu_init(pcpup, cpuid, sizeof(struct pcpu)); + pcpup->pc_hart = hart; - CPU_SET(id, &all_cpus); + dpcpu[cpuid - 1] = (void *)kmem_malloc(DPCPU_SIZE, M_WAITOK | M_ZERO); + dpcpu_init(dpcpu[cpuid - 1], cpuid); + printf("Starting CPU %u (hart %lx)\n", cpuid, hart); + __riscv_boot_ap[hart] = 1; + + CPU_SET(cpuid, &all_cpus); + CPU_SET(hart, &all_harts); + return (1); } #endif @@ -417,6 +441,7 @@ cpu_mp_start(void) mtx_init(&ap_boot_mtx, "ap boot", NULL, MTX_SPIN); CPU_SET(0, &all_cpus); + CPU_SET(boot_hart, &all_harts); switch(cpu_enum_method) { #ifdef FDT @@ -435,13 +460,24 @@ cpu_mp_announce(void) { } +static boolean_t +cpu_check_mmu(u_int id, phandle_t node, u_int addr_size, pcell_t *reg) +{ + + /* Check if this hart supports MMU. */ + if (OF_getproplen(node, "mmu-type") < 0) + return (0); + + return (1); +} + void cpu_mp_setmaxid(void) { #ifdef FDT int cores; - cores = ofw_cpu_early_foreach(NULL, false); + cores = ofw_cpu_early_foreach(cpu_check_mmu, true); if (cores > 0) { cores = MIN(cores, MAXCPU); if (bootverbose) Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Sun May 12 15:27:18 2019 (r347513) +++ head/sys/riscv/riscv/pmap.c Sun May 12 16:17:05 2019 (r347514) @@ -273,6 +273,8 @@ static struct rwlock pv_list_locks[NPV_LIST_LOCKS]; static struct md_page *pv_table; static struct md_page pv_dummy; +extern cpuset_t all_harts; + /* * Internal flags for pmap_enter()'s helper functions. */ @@ -737,7 +739,7 @@ pmap_invalidate_page(pmap_t pmap, vm_offset_t va) sched_pin(); mask = pmap->pm_active; - CPU_CLR(PCPU_GET(cpuid), &mask); + CPU_CLR(PCPU_GET(hart), &mask); fence(); if (!CPU_EMPTY(&mask) && smp_started) sbi_remote_sfence_vma(mask.__bits, va, 1); @@ -752,7 +754,7 @@ pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm sched_pin(); mask = pmap->pm_active; - CPU_CLR(PCPU_GET(cpuid), &mask); + CPU_CLR(PCPU_GET(hart), &mask); fence(); if (!CPU_EMPTY(&mask) && smp_started) sbi_remote_sfence_vma(mask.__bits, sva, eva - sva + 1); @@ -772,7 +774,7 @@ pmap_invalidate_all(pmap_t pmap) sched_pin(); mask = pmap->pm_active; - CPU_CLR(PCPU_GET(cpuid), &mask); + CPU_CLR(PCPU_GET(hart), &mask); /* * XXX: The SBI doc doesn't detail how to specify x0 as the @@ -4255,7 +4257,7 @@ void pmap_activate_sw(struct thread *td) { pmap_t oldpmap, pmap; - u_int cpu; + u_int hart; oldpmap = PCPU_GET(curpmap); pmap = vmspace_pmap(td->td_proc->p_vmspace); @@ -4263,13 +4265,13 @@ pmap_activate_sw(struct thread *td) return; load_satp(pmap->pm_satp); - cpu = PCPU_GET(cpuid); + hart = PCPU_GET(hart); #ifdef SMP - CPU_SET_ATOMIC(cpu, &pmap->pm_active); - CPU_CLR_ATOMIC(cpu, &oldpmap->pm_active); + CPU_SET_ATOMIC(hart, &pmap->pm_active); + CPU_CLR_ATOMIC(hart, &oldpmap->pm_active); #else - CPU_SET(cpu, &pmap->pm_active); - CPU_CLR(cpu, &oldpmap->pm_active); + CPU_SET(hart, &pmap->pm_active); + CPU_CLR(hart, &oldpmap->pm_active); #endif PCPU_SET(curpmap, pmap); @@ -4288,13 +4290,13 @@ pmap_activate(struct thread *td) void pmap_activate_boot(pmap_t pmap) { - u_int cpu; + u_int hart; - cpu = PCPU_GET(cpuid); + hart = PCPU_GET(hart); #ifdef SMP - CPU_SET_ATOMIC(cpu, &pmap->pm_active); + CPU_SET_ATOMIC(hart, &pmap->pm_active); #else - CPU_SET(cpu, &pmap->pm_active); + CPU_SET(hart, &pmap->pm_active); #endif PCPU_SET(curpmap, pmap); } @@ -4313,8 +4315,8 @@ pmap_sync_icache(pmap_t pmap, vm_offset_t va, vm_size_ * FENCE.I." */ sched_pin(); - mask = all_cpus; - CPU_CLR(PCPU_GET(cpuid), &mask); + mask = all_harts; + CPU_CLR(PCPU_GET(hart), &mask); fence(); if (!CPU_EMPTY(&mask) && smp_started) sbi_remote_fence_i(mask.__bits); From owner-svn-src-head@freebsd.org Mon May 13 01:18:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2C5915A7684; Mon, 13 May 2019 01:18: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 865D091948; Mon, 13 May 2019 01:18: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 60C5B2A1D; Mon, 13 May 2019 01:18: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 x4D1IIeC092844; Mon, 13 May 2019 01:18:18 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4D1IIvV092843; Mon, 13 May 2019 01:18:18 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905130118.x4D1IIvV092843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 13 May 2019 01:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347515 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 347515 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 865D091948 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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, 13 May 2019 01:18:19 -0000 Author: markj Date: Mon May 13 01:18:17 2019 New Revision: 347515 URL: https://svnweb.freebsd.org/changeset/base/347515 Log: Catch up with r347241. MFC with: r347241 Modified: head/sys/mips/conf/std.AR_MIPS_BASE Modified: head/sys/mips/conf/std.AR_MIPS_BASE ============================================================================== --- head/sys/mips/conf/std.AR_MIPS_BASE Sun May 12 16:17:05 2019 (r347514) +++ head/sys/mips/conf/std.AR_MIPS_BASE Mon May 13 01:18:17 2019 (r347515) @@ -21,8 +21,8 @@ options SCSI_NO_OP_STRINGS # .. And no sysctl strings options NO_SYSCTL_DESCR -makeoptions MODULES_OVERRIDE+="gpio ar71xx if_gif if_vlan if_gre if_tap" -makeoptions MODULES_OVERRIDE+="if_tun if_bridge bridgestp usb" +makeoptions MODULES_OVERRIDE+="gpio ar71xx if_gif if_vlan if_gre if_tuntap" +makeoptions MODULES_OVERRIDE+="if_bridge bridgestp usb" makeoptions MODULES_OVERRIDE+="alq" # Random - required during early boot! From owner-svn-src-head@freebsd.org Mon May 13 05:06:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AEE115ABC5D; Mon, 13 May 2019 05:06:37 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) (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 AB21E9730A; Mon, 13 May 2019 05:06:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x62d.google.com with SMTP id y3so5829767plp.0; Sun, 12 May 2019 22:06:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=z6Fe+PBu/NDgbfuVAU9z7dmfMq0/Db7z5jSVUeEa8zM=; b=SNAVrMrvzdIa/6Fp8pLon8azE0gYdlLPY04oAHOm8GK4MXDw+UBq2JioRGNA5lMNS2 pOJ24AXTUZmhbsly1YscLRVKPRa5sYDiPivTCkyQCliGmw2lPCScDRTXCBivyWfza7Rr nLjamc5hM0I+fKpv7zFEN9ipm0XMmET38yqSpLm7R+6BR219/G5V0WHanI5Tr6aw5EJv RS30c3h++zSQdjWzI5adN7+PxStCz+ZRPI6eK7GmYiUsQbFKRQ4w12cEDbZhJOcpofIi FESmGdEviCtvKQK9e1BjaTRm4EmgGdv0yuqMJemGnn66wZRW7kMGXJD4aurHfJOUy+gm xrLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=z6Fe+PBu/NDgbfuVAU9z7dmfMq0/Db7z5jSVUeEa8zM=; b=lmtDfihtYH/xj7KMu1pLGJnzjfxa7unhFtug9FgvmotKNeqMubP0MhYg8LzWQIsx24 mdNUdjE8grb6tbhR0Vo8M+qgw14Csal/erfgt0QAa4ay5dH+vwUoe6v8oT9OyCcgRZRN b8ZcLCVvqMfFcrucZ5qnwo3H88HEMs6yd9O3h4qKtwWQd78C5umQC4eTN9hH09vemV5k UNAVGeDCZi8kMQ4NqAZmSDv21UdQOjRZFeLG0ITkYUlUH2f7VJ4z0/n/EUjjaNI4SlvU w9fFYv/I20ewot6hRS1CFsxbc3v5KXu2NIOznBwyaiAreuWTY4R7IMdpi5ZTokuUYTNd jNxw== X-Gm-Message-State: APjAAAUvI20K/uy/oOP9Jh90J99G9ekSxHHnnCA0TzAG2oS0KPe2agbQ yWL1V4zMLkTN9pfSNIe9qA+wxFdtYmo= X-Google-Smtp-Source: APXvYqxX6fG4vG2gXNxNfYo44QFmTYJBas000stlaDnJZxOWRf0eZsoiJzr2neF1nFdipS6bEbR/Lw== X-Received: by 2002:a17:902:e183:: with SMTP id cd3mr28387364plb.233.1557723994143; Sun, 12 May 2019 22:06:34 -0700 (PDT) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id s18sm1438334pgg.64.2019.05.12.22.06.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 May 2019 22:06:33 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: svn commit: r347477 - head/sys/kern From: Enji Cooper In-Reply-To: <201905110213.x4B2Dq9U088622@repo.freebsd.org> Date: Sun, 12 May 2019 22:06:31 -0700 Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: References: <201905110213.x4B2Dq9U088622@repo.freebsd.org> To: Doug Moore X-Mailer: Apple Mail (2.3445.104.8) X-Rspamd-Queue-Id: AB21E9730A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=SNAVrMrv; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::62d as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-6.16 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(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)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-2.68)[ip: (-7.82), ipnet: 2607:f8b0::/32(-3.25), asn: 15169(-2.26), country: US(-0.06)]; RCVD_IN_DNSWL_NONE(0.00)[d.2.6.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] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 13 May 2019 05:06:37 -0000 Hi Doug, > On May 10, 2019, at 7:13 PM, Doug Moore wrote: > > Author: dougm > Date: Sat May 11 02:13:52 2019 > New Revision: 347477 > URL: https://svnweb.freebsd.org/changeset/base/347477 > > Log: > Revert r347469. Why was the commit reverted? Thank you! -Enji From owner-svn-src-head@freebsd.org Mon May 13 05:11:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6197F15AC134; Mon, 13 May 2019 05:11:15 +0000 (UTC) (envelope-from unkadoug@gmail.com) Received: from mail-ot1-x343.google.com (mail-ot1-x343.google.com [IPv6:2607:f8b0:4864:20::343]) (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 E961E97724; Mon, 13 May 2019 05:11:14 +0000 (UTC) (envelope-from unkadoug@gmail.com) Received: by mail-ot1-x343.google.com with SMTP id 66so10598311otq.0; Sun, 12 May 2019 22:11:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=c99cS9K0ASsMUrDeSjZ8+oF5s4LM/gBhmNK1B9sakpU=; b=KqC/qtOq09wFSmS6Tz0Ba+y65RjkKr7YpXueNaiH6NF7skgQeS3al65J1sqQttflLY mlMaapsAMvA0XxL53Z+DD9sCxpJb1hvXN+x/PgRu0oOCXbc+Cv6DoTJTfrlBIcU343d7 y8zU763FWfL6HMcVfI9GXTNHEv0fPPpIs/l4mB7bC8U9zfcKcBVNBTcixuq0QVtNlAKy Tj1gUgZOSSKfsOrNcwm1/jHnqwmOvzZOrAq87INuVXGFNWcH31EOtidOajMk+lDpRyhz eSnLH10E1Dtf/SisIbHUAb/EKiu9VXKJnnB2hgRnrdPvsmNIT8pJxWsRvXeo5eK55w07 gTzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=c99cS9K0ASsMUrDeSjZ8+oF5s4LM/gBhmNK1B9sakpU=; b=tl7g7+Ehopt8kIUTR+MZVhE/G4JKNbrWNo+PwdRYctSkF0S3PpqsZyEpa5iH2vNFfn VCvaMtYTuhf/OZEeFiJOOztEjDJskxIxoIEnoVRjsk8DZNiJUgCSdILBIb1FQH3AaBTM kOjBNF/6LXzobxAxHtzzbXlPoEU/0faaWhLUnl8wNwgPk5ViKFsXYuMFGozEM7wybnhs G8HYCCSnA6KThZGqny9K221D1ASifkpzS5Me1iujzmBSLt3H4jCLg0ZIPRy3l7fbGjVK yyDez7adTmbwm5yZ4RLgrv1n7zMANj8D2I7QxdQMUMvvUtIh9bfyCmuYd0FhnwxH/WvF C8uw== X-Gm-Message-State: APjAAAWtVVn0TlHW7xOEViBYWCVCVk1rbUQJ35SkLvrEHcpuIyF5pKOY +guwuo88e+aktu6ILiLx2qDCyv6oy2xkZQ== X-Google-Smtp-Source: APXvYqy9te05Ld6MLt/jWybwS6k6QAYsNHCG2faa0x6px8NYm/CkXKDdxvRFhBMZOKYWZg2xeERDyg== X-Received: by 2002:a9d:6313:: with SMTP id q19mr737201otk.90.1557724274111; Sun, 12 May 2019 22:11:14 -0700 (PDT) Received: from 108-254-203-202.lightspeed.hstntx.sbcglobal.net (108-254-203-202.lightspeed.hstntx.sbcglobal.net. [108.254.203.202]) by smtp.gmail.com with ESMTPSA id b186sm1013326oia.51.2019.05.12.22.11.13 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Sun, 12 May 2019 22:11:13 -0700 (PDT) From: Doug Moore X-Google-Original-From: Doug Moore Subject: Re: svn commit: r347477 - head/sys/kern To: Enji Cooper Cc: src-committers , svn-src-all , svn-src-head@freebsd.org References: <201905110213.x4B2Dq9U088622@repo.freebsd.org> Message-ID: <87a91545-01a1-dd96-881f-d5adde0896bd@freebsd.org> Date: Mon, 13 May 2019 00:11:12 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: E961E97724 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,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, 13 May 2019 05:11:15 -0000 I refer you to the discussion that began with that question from Cy Schubert on Friday night. I apologize again for the brevity of my commit message. Doug Moore On 5/13/19 12:06 AM, Enji Cooper wrote: > Hi Doug, > >> On May 10, 2019, at 7:13 PM, Doug Moore wrote: >> >> Author: dougm >> Date: Sat May 11 02:13:52 2019 >> New Revision: 347477 >> URL: https://svnweb.freebsd.org/changeset/base/347477 >> >> Log: >> Revert r347469. > Why was the commit reverted? > > Thank you! > -Enji From owner-svn-src-head@freebsd.org Mon May 13 05:12:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA47015AC2D2; Mon, 13 May 2019 05:12:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) (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 286D097939; Mon, 13 May 2019 05:12:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x629.google.com with SMTP id p15so5833193pll.4; Sun, 12 May 2019 22:12:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=yA7ZDMCh0RQLoEQ6oxO/DqiR0bB80jhTieS+Oi78u/8=; b=jOjJQk7r88mQg8FsXHQb2+B8hn430ZnQFafTCQkmk3XdOQq163ku+8CNLjN4JPrGu/ Zpopa05h5pu12rsmQdpCyW+PSN4X8kwWeYHDQlmW5UY8j4Gp37HWCkVjGQk3bq+hNxSg 2FSOX/fxDCdLARb1MDWWyiM+PVMLe6TffmYdQ7NeuVEb00mb0U3mtVsCTM66EmWoF/sM xHE8BVGPmm/8k91qviWjLkW+qzgxyVnKpR3xjOCdv1+NonIqgqghAM2fdmuBwOspmzjz 7sgJxCypPl00JGQT9rZ2rQWMA2NycIWKY4xAJ3vsSN/ZwSrumHw4yGzV/38feDoCN5HG 4qfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=yA7ZDMCh0RQLoEQ6oxO/DqiR0bB80jhTieS+Oi78u/8=; b=XwhPFrziuOwRb1T5mLRz9uyHSxVAsR0NPLDCz0Gwky8aXYxUpt0oUUj9uH2Eo1sr3b RweqHn0YCisXZNNfJLdN5rZs3qv7AlIHiVZjMs9MGMgJhM1PJoSKNZiVKVaShez5RfxO GZo502s138J8iyaVBmCxtDVbxD3zoKwYPFO9bajcOQd0b/8dWcUUviaQGUiGyvBQtf99 sDpmea3pPqoyMHCPUTGVEPzCtGYCJiqZXq0vsergzZaPfrWiT5zyNg864GI13E+A3pxG v359ujPCw+0FPjuOFFW8pDdiQl4F6Q+CT9oOBGeCgUsRmoEX2x0luAmfL7CB4j/s1wYp aQLg== X-Gm-Message-State: APjAAAUirvfP2Bm3g1g2lmv7nbPQ8StbC12j050QUVDuBRJAnY/UpBIL 4F582Ti/KDa6uVZDv7AeqZo= X-Google-Smtp-Source: APXvYqxuEobokhMz1HHWrci4YOW0xGkVv9loitjeQqib05M6oI79QUJ5tgnPBikt3TpV//vUduMk7Q== X-Received: by 2002:a17:902:102a:: with SMTP id b39mr28452813pla.188.1557724375833; Sun, 12 May 2019 22:12:55 -0700 (PDT) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id w125sm16814578pfw.69.2019.05.12.22.12.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 May 2019 22:12:54 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: svn commit: r347477 - head/sys/kern From: Enji Cooper In-Reply-To: <87a91545-01a1-dd96-881f-d5adde0896bd@freebsd.org> Date: Sun, 12 May 2019 22:12:53 -0700 Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <41948E9C-4B2F-4211-B814-9D5BF5E8163C@gmail.com> References: <201905110213.x4B2Dq9U088622@repo.freebsd.org> <87a91545-01a1-dd96-881f-d5adde0896bd@freebsd.org> To: Doug Moore X-Mailer: Apple Mail (2.3445.104.8) X-Rspamd-Queue-Id: 286D097939 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,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: Mon, 13 May 2019 05:12:57 -0000 > On May 12, 2019, at 10:11 PM, Doug Moore wrote: >=20 > I refer you to the discussion that began with that question from Cy > Schubert on Friday night. >=20 > I apologize again for the brevity of my commit message. It=E2=80=99s quite all right. Unfortunately Cy=E2=80=99s mail client = reads threading, so it=E2=80=99s sometimes difficult for me to track a = conversation. I appreciate your reaching out and for answering the question there. Thank you! -Enji From owner-svn-src-head@freebsd.org Mon May 13 05:13:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1795215AC33D; Mon, 13 May 2019 05:13:34 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) (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 8B2DF97A5B; Mon, 13 May 2019 05:13:33 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x629.google.com with SMTP id n8so5827208plp.10; Sun, 12 May 2019 22:13:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=rskH74Eleu6dT4fsiFboxt7CC+svvZbo5ABAtorBJy8=; b=U1vLVNPNmyU8vq0QbHktuCxIDm0fvPKwK6ett7wnQ1DNCUWXdeEaeuTDrR4EBs/giR 21nMNav38ajp5WhIbgrp/nR5Yb09qlT6sA1wKGVS/+XLg3QmaZoHsJm7V0JJGmTVJD9e QtT1POaoKRuLMgi9E8RIMw8K0HdF3jPgAIQeh1xOqqmjUjQvAxKKlrlgOWlWxKsxpCl/ ZRad2jazP+caATgbuE7vlINksD5rYj0wlh1yBySgySbFO7QNOshCbh+4pzGZEbo830Cc SqB7WWORt+c3YeTpYtZE4dsRJEbVAR1aIH48YQbeBxTHTb9lnzZc5iMvxEkqZMTJTE+W RFBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=rskH74Eleu6dT4fsiFboxt7CC+svvZbo5ABAtorBJy8=; b=ZreG9v9+maseN0f+V9yDFvn88nHAAOPJItTgzGC8KE+vkjyddy7jNt0fGgQGnEgztx /veHB/PImS5DA5PSV4zefkaPS5NbaFxunsOAaXK3YWuqLkTVdDoaFUvrxdn6L8Tr3JfI tE6fU1ZJMyYtlqLPzFib2UWxKLfHJkVCD4tC5yl4TOsWWjApZKxowLnlAEz0B/o+G++b wB10KFb+8LFBBAh8UaJoi1dVXCfhM/M8Dduvs7kR/ObjdaW3vRhTOWEoWxACPI/2OH1d lZ5E9uuC2461NQUYEBbUNUSFHwYX5TxSZrL+1ioqlmmmpAXWkmCM0MNlAcUe3Xyu2wNR I8EA== X-Gm-Message-State: APjAAAVh8MNlS04TblYBpgSImwD23keiA5oIurr5uJAnrTvbwDaSz2Et Zh6/Ds3bfCbX5CbIPl659K4= X-Google-Smtp-Source: APXvYqwiHZwIXaa/d1bGUJtvd3NsBLjeCriCWbMSqPr9LPkFHd4Kv5Gfs5LdsptzSyMUO97YRS+lgw== X-Received: by 2002:a17:902:e48d:: with SMTP id cj13mr28518719plb.156.1557724412605; Sun, 12 May 2019 22:13:32 -0700 (PDT) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id w125sm16814578pfw.69.2019.05.12.22.13.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 May 2019 22:13:32 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: svn commit: r347477 - head/sys/kern From: Enji Cooper In-Reply-To: <41948E9C-4B2F-4211-B814-9D5BF5E8163C@gmail.com> Date: Sun, 12 May 2019 22:13:31 -0700 Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <563A6E6A-514C-4CDE-A522-7A3E329C0B8E@gmail.com> References: <201905110213.x4B2Dq9U088622@repo.freebsd.org> <87a91545-01a1-dd96-881f-d5adde0896bd@freebsd.org> <41948E9C-4B2F-4211-B814-9D5BF5E8163C@gmail.com> To: Doug Moore X-Mailer: Apple Mail (2.3445.104.8) X-Rspamd-Queue-Id: 8B2DF97A5B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,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, 13 May 2019 05:13:34 -0000 > On May 12, 2019, at 10:12 PM, Enji Cooper = wrote: >=20 >=20 >> On May 12, 2019, at 10:11 PM, Doug Moore wrote: >>=20 >> I refer you to the discussion that began with that question from Cy >> Schubert on Friday night. >>=20 >> I apologize again for the brevity of my commit message. >=20 > It=E2=80=99s quite all right. Unfortunately Cy=E2=80=99s mail client = reads threading, so it=E2=80=99s sometimes difficult for me to track a = conversation. *reads -> breaks I need to get some sleep. -Enji= From owner-svn-src-head@freebsd.org Mon May 13 08:34:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 300351585221; Mon, 13 May 2019 08:34:14 +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 CA1326EFC2; Mon, 13 May 2019 08:34:13 +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 A26DB7613; Mon, 13 May 2019 08:34:13 +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 x4D8YDTK024638; Mon, 13 May 2019 08:34:13 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4D8YDBw024637; Mon, 13 May 2019 08:34:13 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905130834.x4D8YDBw024637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 13 May 2019 08:34:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347519 - head/sys/modules/ipsec X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/modules/ipsec X-SVN-Commit-Revision: 347519 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CA1326EFC2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Mon, 13 May 2019 08:34:14 -0000 Author: ae Date: Mon May 13 08:34:13 2019 New Revision: 347519 URL: https://svnweb.freebsd.org/changeset/base/347519 Log: Revert r347402. After r347429 symlink is no longer needed. Modified: head/sys/modules/ipsec/Makefile Modified: head/sys/modules/ipsec/Makefile ============================================================================== --- head/sys/modules/ipsec/Makefile Mon May 13 08:29:28 2019 (r347518) +++ head/sys/modules/ipsec/Makefile Mon May 13 08:34:13 2019 (r347519) @@ -7,7 +7,6 @@ SRCS= if_ipsec.c ipsec.c ipsec_input.c ipsec_mbuf.c ip ipsec_output.c xform_ah.c xform_esp.c xform_ipcomp.c \ opt_inet.h opt_inet6.h opt_ipsec.h opt_sctp.h SRCS.INET= udpencap.c -SYMLINKS= ${KMOD}.ko ${KMODDIR}/if_${KMOD}.ko opt_ipsec.h: @echo "#define IPSEC_SUPPORT 1" > ${.TARGET} From owner-svn-src-head@freebsd.org Mon May 13 12:38:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12BCF158F227; Mon, 13 May 2019 12:38:34 +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 AD35A80169; Mon, 13 May 2019 12:38: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 874819E51; Mon, 13 May 2019 12:38:33 +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 x4DCcXof055813; Mon, 13 May 2019 12:38:33 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4DCcXml055812; Mon, 13 May 2019 12:38:33 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905131238.x4DCcXml055812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 13 May 2019 12:38:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347522 - head/etc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 347522 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AD35A80169 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Mon, 13 May 2019 12:38:34 -0000 Author: manu Date: Mon May 13 12:38:33 2019 New Revision: 347522 URL: https://svnweb.freebsd.org/changeset/base/347522 Log: Revert r347356 and r347371 passwd related files need to be tagged as config file so pkg update will attempt merging them when we install a new package. We should use CONFS for that. Revert for now until I come up with a better version of this patch as it breaks pkgbase for users. Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Mon May 13 11:17:31 2019 (r347521) +++ head/etc/Makefile Mon May 13 12:38:33 2019 (r347522) @@ -18,10 +18,15 @@ BIN1= \ group \ login.access \ rc.bsdextended \ + rc.firewall \ termcap.small # NB: keep these sorted by MK_* knobs +.if ${MK_SENDMAIL} != "no" +BIN1+= rc.sendmail +.endif + .if ${MK_SENDMAIL} == "no" ETCMAIL=mailer.conf aliases .else @@ -58,20 +63,10 @@ distribution: @echo "set DESTDIR before running \"make ${.TARGET}\"" @false .endif -.if ${MK_SENDMAIL} != "no" cd ${.CURDIR}; \ - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 -T "tags=package=sendmail"\ - rc.sendmail ${DESTDIR}/etc; -.endif -.if ${MK_IPFW} != "no" - cd ${.CURDIR}; \ - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 -T "tags=package=ipfw"\ - rc.firewall ${DESTDIR}/etc; -.endif - cd ${.CURDIR}; \ - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 -T "tags=package=runtime"\ + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ ${BIN1} ${DESTDIR}/etc; \ - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 -T "tags=package=runtime"\ + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ master.passwd ${DESTDIR}/etc; .if ${MK_TCSH} == "no" From owner-svn-src-head@freebsd.org Mon May 13 13:45:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E25081590A0A; Mon, 13 May 2019 13:45:29 +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 92F0482807; Mon, 13 May 2019 13:45:29 +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 4D359A9D3; Mon, 13 May 2019 13:45:29 +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 x4DDjTvV092670; Mon, 13 May 2019 13:45:29 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4DDjTRn092669; Mon, 13 May 2019 13:45:29 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905131345.x4DDjTRn092669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 13 May 2019 13:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347526 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 347526 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 92F0482807 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Mon, 13 May 2019 13:45:30 -0000 Author: ae Date: Mon May 13 13:45:28 2019 New Revision: 347526 URL: https://svnweb.freebsd.org/changeset/base/347526 Log: Rework locking in BPF code to remove rwlock from fast path. On high packets rate the contention on rwlock in bpf_*tap*() functions can lead to packets dropping. To avoid this, migrate this code to use epoch(9) KPI and ConcurrencyKit's lists. * all lists changed to use CK_LIST; * reference counting added to bpf_if and bpf_d; * now bpf_if references ifnet and releases this reference on destroy; * each bpf_d descriptor references bpf_if when it is attached; * new struct bpf_program_buffer introduced to keep BPF filter programs; * bpf_program_buffer, bpf_d and bpf_if structures are freed by epoch_call(); * bpf_freelist and ifnet_departure event are no longer needed, thus both are removed; Reviewed by: melifaro Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D20224 Modified: head/sys/net/bpf.c head/sys/net/bpf.h head/sys/net/bpfdesc.h Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Mon May 13 13:30:34 2019 (r347525) +++ head/sys/net/bpf.c Mon May 13 13:45:28 2019 (r347526) @@ -3,6 +3,7 @@ * * Copyright (c) 1990, 1991, 1993 * The Regents of the University of California. All rights reserved. + * Copyright (c) 2019 Andrey V. Elsukov * * This code is derived from the Stanford/CMU enet packet filter, * (net/enet.c) distributed as part of 4.3BSD, and code contributed @@ -46,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -99,7 +99,7 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_BPF, "BPF", "BPF data"); static struct bpf_if_ext dead_bpf_if = { - .bif_dlist = LIST_HEAD_INITIALIZER() + .bif_dlist = CK_LIST_HEAD_INITIALIZER() }; struct bpf_if { @@ -108,19 +108,22 @@ struct bpf_if { struct bpf_if_ext bif_ext; /* public members */ u_int bif_dlt; /* link layer type */ u_int bif_hdrlen; /* length of link header */ + struct bpfd_list bif_wlist; /* writer-only list */ struct ifnet *bif_ifp; /* corresponding interface */ - struct rwlock bif_lock; /* interface lock */ - LIST_HEAD(, bpf_d) bif_wlist; /* writer-only list */ - int bif_flags; /* Interface flags */ struct bpf_if **bif_bpf; /* Pointer to pointer to us */ + volatile u_int bif_refcnt; + struct epoch_context epoch_ctx; }; CTASSERT(offsetof(struct bpf_if, bif_ext) == 0); -#define BPFIF_RLOCK(bif) rw_rlock(&(bif)->bif_lock) -#define BPFIF_RUNLOCK(bif) rw_runlock(&(bif)->bif_lock) -#define BPFIF_WLOCK(bif) rw_wlock(&(bif)->bif_lock) -#define BPFIF_WUNLOCK(bif) rw_wunlock(&(bif)->bif_lock) +struct bpf_program_buffer { + struct epoch_context epoch_ctx; +#ifdef BPF_JITTER + bpf_jit_filter *func; +#endif + void *buffer[0]; +}; #if defined(DEV_BPF) || defined(NETGRAPH_BPF) @@ -173,18 +176,24 @@ struct bpf_dltlist32 { #define BPF_LOCK_ASSERT() sx_assert(&bpf_sx, SA_XLOCKED) /* * bpf_iflist is a list of BPF interface structures, each corresponding to a - * specific DLT. The same network interface might have several BPF interface + * specific DLT. The same network interface might have several BPF interface * structures registered by different layers in the stack (i.e., 802.11 * frames, ethernet frames, etc). */ -static LIST_HEAD(, bpf_if) bpf_iflist, bpf_freelist; +CK_LIST_HEAD(bpf_iflist, bpf_if); +static struct bpf_iflist bpf_iflist; static struct sx bpf_sx; /* bpf global lock */ static int bpf_bpfd_cnt; +static void bpfif_ref(struct bpf_if *); +static void bpfif_rele(struct bpf_if *); + +static void bpfd_ref(struct bpf_d *); +static void bpfd_rele(struct bpf_d *); static void bpf_attachd(struct bpf_d *, struct bpf_if *); static void bpf_detachd(struct bpf_d *); -static void bpf_detachd_locked(struct bpf_d *); -static void bpf_freed(struct bpf_d *); +static void bpf_detachd_locked(struct bpf_d *, bool); +static void bpfd_free(epoch_context_t); static int bpf_movein(struct uio *, int, struct ifnet *, struct mbuf **, struct sockaddr *, int *, struct bpf_d *); static int bpf_setif(struct bpf_d *, struct ifreq *); @@ -243,37 +252,106 @@ static struct filterops bpfread_filtops = { .f_event = filt_bpfread, }; -eventhandler_tag bpf_ifdetach_cookie = NULL; - /* - * LOCKING MODEL USED BY BPF: + * LOCKING MODEL USED BY BPF + * * Locks: - * 1) global lock (BPF_LOCK). Mutex, used to protect interface addition/removal, - * some global counters and every bpf_if reference. - * 2) Interface lock. Rwlock, used to protect list of BPF descriptors and their filters. - * 3) Descriptor lock. Mutex, used to protect BPF buffers and various structure fields - * used by bpf_mtap code. + * 1) global lock (BPF_LOCK). Sx, used to protect some global counters, + * every bpf_iflist changes, serializes ioctl access to bpf descriptors. + * 2) Descriptor lock. Mutex, used to protect BPF buffers and various + * structure fields used by bpf_*tap* code. * - * Lock order: + * Lock order: global lock, then descriptor lock. * - * Global lock, interface lock, descriptor lock + * There are several possible consumers: * - * We have to acquire interface lock before descriptor main lock due to BPF_MTAP[2] - * working model. In many places (like bpf_detachd) we start with BPF descriptor - * (and we need to at least rlock it to get reliable interface pointer). This - * gives us potential LOR. As a result, we use global lock to protect from bpf_if - * change in every such place. + * 1. The kernel registers interface pointer with bpfattach(). + * Each call allocates new bpf_if structure, references ifnet pointer + * and links bpf_if into bpf_iflist chain. This is protected with global + * lock. * - * Changing d->bd_bif is protected by 1) global lock, 2) interface lock and - * 3) descriptor main wlock. - * Reading bd_bif can be protected by any of these locks, typically global lock. + * 2. An userland application uses ioctl() call to bpf_d descriptor. + * All such call are serialized with global lock. BPF filters can be + * changed, but pointer to old filter will be freed using epoch_call(). + * Thus it should be safe for bpf_tap/bpf_mtap* code to do access to + * filter pointers, even if change will happen during bpf_tap execution. + * Destroying of bpf_d descriptor also is doing using epoch_call(). * - * Changing read/write BPF filter is protected by the same three locks, - * the same applies for reading. + * 3. An userland application can write packets into bpf_d descriptor. + * There we need to be sure, that ifnet won't disappear during bpfwrite(). * - * Sleeping in global lock is not allowed due to bpfdetach() using it. + * 4. The kernel invokes bpf_tap/bpf_mtap* functions. The access to + * bif_dlist is protected with net_epoch_preempt section. So, it should + * be safe to make access to bpf_d descriptor inside the section. + * + * 5. The kernel invokes bpfdetach() on interface destroying. All lists + * are modified with global lock held and actual free() is done using + * epoch_call(). */ +static void +bpfif_free(epoch_context_t ctx) +{ + struct bpf_if *bp; + + bp = __containerof(ctx, struct bpf_if, epoch_ctx); + if_rele(bp->bif_ifp); + free(bp, M_BPF); +} + +static void +bpfif_ref(struct bpf_if *bp) +{ + + refcount_acquire(&bp->bif_refcnt); +} + +static void +bpfif_rele(struct bpf_if *bp) +{ + + if (!refcount_release(&bp->bif_refcnt)) + return; + epoch_call(net_epoch_preempt, &bp->epoch_ctx, bpfif_free); +} + +static void +bpfd_ref(struct bpf_d *d) +{ + + refcount_acquire(&d->bd_refcnt); +} + +static void +bpfd_rele(struct bpf_d *d) +{ + + if (!refcount_release(&d->bd_refcnt)) + return; + epoch_call(net_epoch_preempt, &d->epoch_ctx, bpfd_free); +} + +static struct bpf_program_buffer* +bpf_program_buffer_alloc(size_t size, int flags) +{ + + return (malloc(sizeof(struct bpf_program_buffer) + size, + M_BPF, flags)); +} + +static void +bpf_program_buffer_free(epoch_context_t ctx) +{ + struct bpf_program_buffer *ptr; + + ptr = __containerof(ctx, struct bpf_program_buffer, epoch_ctx); +#ifdef BPF_JITTER + if (ptr->func != NULL) + bpf_destroy_jit_filter(ptr->func); +#endif + free(ptr, M_BPF); +} + /* * Wrapper functions for various buffering methods. If the set of buffer * modes expands, we will probably want to introduce a switch data structure @@ -627,7 +705,8 @@ bad: } /* - * Attach file to the bpf interface, i.e. make d listen on bp. + * Attach descriptor to the bpf interface, i.e. make d listen on bp, + * then reset its buffers and counters with reset_d(). */ static void bpf_attachd(struct bpf_d *d, struct bpf_if *bp) @@ -643,7 +722,7 @@ bpf_attachd(struct bpf_d *d, struct bpf_if *bp) op_w = V_bpf_optimize_writers || d->bd_writer; if (d->bd_bif != NULL) - bpf_detachd_locked(d); + bpf_detachd_locked(d, false); /* * Point d at bp, and add d to the interface's list. * Since there are many applications using BPF for @@ -652,26 +731,27 @@ bpf_attachd(struct bpf_d *d, struct bpf_if *bp) * some filter is configured. */ - BPFIF_WLOCK(bp); BPFD_LOCK(d); - + /* + * Hold reference to bpif while descriptor uses this interface. + */ + bpfif_ref(bp); d->bd_bif = bp; - if (op_w != 0) { /* Add to writers-only list */ - LIST_INSERT_HEAD(&bp->bif_wlist, d, bd_next); + CK_LIST_INSERT_HEAD(&bp->bif_wlist, d, bd_next); /* * We decrement bd_writer on every filter set operation. * First BIOCSETF is done by pcap_open_live() to set up - * snap length. After that appliation usually sets its own filter + * snap length. After that appliation usually sets its own + * filter. */ d->bd_writer = 2; } else - LIST_INSERT_HEAD(&bp->bif_dlist, d, bd_next); + CK_LIST_INSERT_HEAD(&bp->bif_dlist, d, bd_next); + reset_d(d); BPFD_UNLOCK(d); - BPFIF_WUNLOCK(bp); - bpf_bpfd_cnt++; CTR3(KTR_NET, "%s: bpf_attach called by pid %d, adding to %s list", @@ -685,7 +765,8 @@ bpf_attachd(struct bpf_d *d, struct bpf_if *bp) * Check if we need to upgrade our descriptor @d from write-only mode. */ static int -bpf_check_upgrade(u_long cmd, struct bpf_d *d, struct bpf_insn *fcode, int flen) +bpf_check_upgrade(u_long cmd, struct bpf_d *d, struct bpf_insn *fcode, + int flen) { int is_snap, need_upgrade; @@ -705,7 +786,8 @@ bpf_check_upgrade(u_long cmd, struct bpf_d *d, struct * we'd prefer to treat k=0 (deny ALL) case the same way: e.g. * do not consider upgrading immediately */ - if (cmd == BIOCSETF && flen == 1 && fcode[0].code == (BPF_RET | BPF_K)) + if (cmd == BIOCSETF && flen == 1 && + fcode[0].code == (BPF_RET | BPF_K)) is_snap = 1; else is_snap = 0; @@ -743,88 +825,45 @@ bpf_check_upgrade(u_long cmd, struct bpf_d *d, struct } /* - * Add d to the list of active bp filters. - * Requires bpf_attachd() to be called before. - */ -static void -bpf_upgraded(struct bpf_d *d) -{ - struct bpf_if *bp; - - BPF_LOCK_ASSERT(); - - bp = d->bd_bif; - - /* - * Filter can be set several times without specifying interface. - * Mark d as reader and exit. - */ - if (bp == NULL) { - BPFD_LOCK(d); - d->bd_writer = 0; - BPFD_UNLOCK(d); - return; - } - - BPFIF_WLOCK(bp); - BPFD_LOCK(d); - - /* Remove from writers-only list */ - LIST_REMOVE(d, bd_next); - LIST_INSERT_HEAD(&bp->bif_dlist, d, bd_next); - /* Mark d as reader */ - d->bd_writer = 0; - - BPFD_UNLOCK(d); - BPFIF_WUNLOCK(bp); - - CTR2(KTR_NET, "%s: upgrade required by pid %d", __func__, d->bd_pid); - - EVENTHANDLER_INVOKE(bpf_track, bp->bif_ifp, bp->bif_dlt, 1); -} - -/* * Detach a file from its interface. */ static void bpf_detachd(struct bpf_d *d) { BPF_LOCK(); - bpf_detachd_locked(d); + bpf_detachd_locked(d, false); BPF_UNLOCK(); } static void -bpf_detachd_locked(struct bpf_d *d) +bpf_detachd_locked(struct bpf_d *d, bool detached_ifp) { - int error; struct bpf_if *bp; struct ifnet *ifp; + int error; + BPF_LOCK_ASSERT(); CTR2(KTR_NET, "%s: detach required by pid %d", __func__, d->bd_pid); - BPF_LOCK_ASSERT(); - /* Check if descriptor is attached */ if ((bp = d->bd_bif) == NULL) return; - BPFIF_WLOCK(bp); BPFD_LOCK(d); - + /* Remove d from the interface's descriptor list. */ + CK_LIST_REMOVE(d, bd_next); /* Save bd_writer value */ error = d->bd_writer; - - /* - * Remove d from the interface's descriptor list. - */ - LIST_REMOVE(d, bd_next); - ifp = bp->bif_ifp; d->bd_bif = NULL; + if (detached_ifp) { + /* + * Notify descriptor as it's detached, so that any + * sleepers wake up and get ENXIO. + */ + bpf_wakeup(d); + } BPFD_UNLOCK(d); - BPFIF_WUNLOCK(bp); - bpf_bpfd_cnt--; /* Call event handler iff d is attached */ @@ -833,9 +872,9 @@ bpf_detachd_locked(struct bpf_d *d) /* * Check if this descriptor had requested promiscuous mode. - * If so, turn it off. + * If so and ifnet is not detached, turn it off. */ - if (d->bd_promisc) { + if (d->bd_promisc && !detached_ifp) { d->bd_promisc = 0; CURVNET_SET(ifp->if_vnet); error = ifpromisc(ifp, 0); @@ -851,6 +890,7 @@ bpf_detachd_locked(struct bpf_d *d) "bpf_detach: ifpromisc failed (%d)\n", error); } } + bpfif_rele(bp); } /* @@ -875,8 +915,7 @@ bpf_dtor(void *data) seldrain(&d->bd_sel); knlist_destroy(&d->bd_sel.si_note); callout_drain(&d->bd_callout); - bpf_freed(d); - free(d, M_BPF); + bpfd_rele(d); } /* @@ -918,6 +957,7 @@ bpfopen(struct cdev *dev, int flags, int fmt, struct t d->bd_bufmode = BPF_BUFMODE_BUFFER; d->bd_sig = SIGIO; d->bd_direction = BPF_D_INOUT; + d->bd_refcnt = 1; BPF_PID_REFRESH(d, td); #ifdef MAC mac_bpfdesc_init(d); @@ -1093,7 +1133,8 @@ bpf_timed_out(void *arg) BPFD_LOCK_ASSERT(d); - if (callout_pending(&d->bd_callout) || !callout_active(&d->bd_callout)) + if (callout_pending(&d->bd_callout) || + !callout_active(&d->bd_callout)) return; if (d->bd_state == BPF_WAITING) { d->bd_state = BPF_TIMED_OUT; @@ -1119,47 +1160,71 @@ bpf_ready(struct bpf_d *d) static int bpfwrite(struct cdev *dev, struct uio *uio, int ioflag) { + struct route ro; + struct sockaddr dst; + struct epoch_tracker et; + struct bpf_if *bp; struct bpf_d *d; struct ifnet *ifp; struct mbuf *m, *mc; - struct sockaddr dst; - struct route ro; int error, hlen; error = devfs_get_cdevpriv((void **)&d); if (error != 0) return (error); + NET_EPOCH_ENTER(et); + BPFD_LOCK(d); BPF_PID_REFRESH_CUR(d); counter_u64_add(d->bd_wcount, 1); - /* XXX: locking required */ - if (d->bd_bif == NULL) { - counter_u64_add(d->bd_wdcount, 1); - return (ENXIO); + if ((bp = d->bd_bif) == NULL) { + error = ENXIO; + goto out_locked; } - ifp = d->bd_bif->bif_ifp; - + ifp = bp->bif_ifp; if ((ifp->if_flags & IFF_UP) == 0) { - counter_u64_add(d->bd_wdcount, 1); - return (ENETDOWN); + error = ENETDOWN; + goto out_locked; } - if (uio->uio_resid == 0) { - counter_u64_add(d->bd_wdcount, 1); - return (0); - } + if (uio->uio_resid == 0) + goto out_locked; bzero(&dst, sizeof(dst)); m = NULL; hlen = 0; - /* XXX: bpf_movein() can sleep */ - error = bpf_movein(uio, (int)d->bd_bif->bif_dlt, ifp, + + /* + * Take extra reference, unlock d and exit from epoch section, + * since bpf_movein() can sleep. + */ + bpfd_ref(d); + NET_EPOCH_EXIT(et); + BPFD_UNLOCK(d); + + error = bpf_movein(uio, (int)bp->bif_dlt, ifp, &m, &dst, &hlen, d); - if (error) { + + if (error != 0) { counter_u64_add(d->bd_wdcount, 1); + bpfd_rele(d); return (error); } + + BPFD_LOCK(d); + /* + * Check that descriptor is still attached to the interface. + * This can happen on bpfdetach(). To avoid access to detached + * ifnet, free mbuf and return ENXIO. + */ + if (d->bd_bif == NULL) { + counter_u64_add(d->bd_wdcount, 1); + BPFD_UNLOCK(d); + bpfd_rele(d); + m_freem(m); + return (ENXIO); + } counter_u64_add(d->bd_wfcount, 1); if (d->bd_hdrcmplt) dst.sa_family = pseudo_AF_HDRCMPLT; @@ -1180,11 +1245,9 @@ bpfwrite(struct cdev *dev, struct uio *uio, int ioflag CURVNET_SET(ifp->if_vnet); #ifdef MAC - BPFD_LOCK(d); mac_bpfdesc_create_mbuf(d, m); if (mc != NULL) mac_bpfdesc_create_mbuf(d, mc); - BPFD_UNLOCK(d); #endif bzero(&ro, sizeof(ro)); @@ -1205,7 +1268,14 @@ bpfwrite(struct cdev *dev, struct uio *uio, int ioflag m_freem(mc); } CURVNET_RESTORE(); + BPFD_UNLOCK(d); + bpfd_rele(d); + return (error); +out_locked: + counter_u64_add(d->bd_wdcount, 1); + NET_EPOCH_EXIT(et); + BPFD_UNLOCK(d); return (error); } @@ -1830,16 +1900,11 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, i } /* - * Set d's packet filter program to fp. If this file already has a filter, - * free it and replace it. Returns EINVAL for bogus requests. + * Set d's packet filter program to fp. If this file already has a filter, + * free it and replace it. Returns EINVAL for bogus requests. * - * Note we need global lock here to serialize bpf_setf() and bpf_setif() calls - * since reading d->bd_bif can't be protected by d or interface lock due to - * lock order. - * - * Additionally, we have to acquire interface write lock due to bpf_mtap() uses - * interface read lock to read all filers. - * + * Note we use global lock here to serialize bpf_setf() and bpf_setif() + * calls. */ static int bpf_setf(struct bpf_d *d, struct bpf_program *fp, u_long cmd) @@ -1848,13 +1913,14 @@ bpf_setf(struct bpf_d *d, struct bpf_program *fp, u_lo struct bpf_program fp_swab; struct bpf_program32 *fp32; #endif - struct bpf_insn *fcode, *old; + struct bpf_program_buffer *fcode; + struct bpf_insn *filter; #ifdef BPF_JITTER - bpf_jit_filter *jfunc, *ofunc; + bpf_jit_filter *jfunc; #endif size_t size; u_int flen; - int need_upgrade; + bool track_event; #ifdef COMPAT_FREEBSD32 switch (cmd) { @@ -1863,7 +1929,8 @@ bpf_setf(struct bpf_d *d, struct bpf_program *fp, u_lo case BIOCSETFNR32: fp32 = (struct bpf_program32 *)fp; fp_swab.bf_len = fp32->bf_len; - fp_swab.bf_insns = (struct bpf_insn *)(uintptr_t)fp32->bf_insns; + fp_swab.bf_insns = + (struct bpf_insn *)(uintptr_t)fp32->bf_insns; fp = &fp_swab; switch (cmd) { case BIOCSETF32: @@ -1877,12 +1944,10 @@ bpf_setf(struct bpf_d *d, struct bpf_program *fp, u_lo } #endif - fcode = NULL; + filter = NULL; #ifdef BPF_JITTER - jfunc = ofunc = NULL; + jfunc = NULL; #endif - need_upgrade = 0; - /* * Check new filter validness before acquiring any locks. * Allocate memory for new filter, if needed. @@ -1892,10 +1957,11 @@ bpf_setf(struct bpf_d *d, struct bpf_program *fp, u_lo return (EINVAL); size = flen * sizeof(*fp->bf_insns); if (size > 0) { - /* We're setting up new filter. Copy and check actual data. */ - fcode = malloc(size, M_BPF, M_WAITOK); - if (copyin(fp->bf_insns, fcode, size) != 0 || - !bpf_validate(fcode, flen)) { + /* We're setting up new filter. Copy and check actual data. */ + fcode = bpf_program_buffer_alloc(size, M_WAITOK); + filter = (struct bpf_insn *)fcode->buffer; + if (copyin(fp->bf_insns, filter, size) != 0 || + !bpf_validate(filter, flen)) { free(fcode, M_BPF); return (EINVAL); } @@ -1905,50 +1971,73 @@ bpf_setf(struct bpf_d *d, struct bpf_program *fp, u_lo * Filter is copied inside fcode and is * perfectly valid. */ - jfunc = bpf_jitter(fcode, flen); + jfunc = bpf_jitter(filter, flen); } #endif } - BPF_LOCK(); + track_event = false; + fcode = NULL; - /* - * Set up new filter. - * Protect filter change by interface lock. - * Additionally, we are protected by global lock here. - */ - if (d->bd_bif != NULL) - BPFIF_WLOCK(d->bd_bif); + BPF_LOCK(); BPFD_LOCK(d); + /* Set up new filter. */ if (cmd == BIOCSETWF) { - old = d->bd_wfilter; - d->bd_wfilter = fcode; + if (d->bd_wfilter != NULL) { + fcode = __containerof((void *)d->bd_wfilter, + struct bpf_program_buffer, buffer); +#ifdef BPF_JITTER + fcode->func = NULL; +#endif + } + d->bd_wfilter = filter; } else { - old = d->bd_rfilter; - d->bd_rfilter = fcode; + if (d->bd_rfilter != NULL) { + fcode = __containerof((void *)d->bd_rfilter, + struct bpf_program_buffer, buffer); #ifdef BPF_JITTER - ofunc = d->bd_bfilter; + fcode->func = d->bd_bfilter; +#endif + } + d->bd_rfilter = filter; +#ifdef BPF_JITTER d->bd_bfilter = jfunc; #endif if (cmd == BIOCSETF) reset_d(d); - need_upgrade = bpf_check_upgrade(cmd, d, fcode, flen); + if (bpf_check_upgrade(cmd, d, filter, flen) != 0) { + /* + * Filter can be set several times without + * specifying interface. In this case just mark d + * as reader. + */ + d->bd_writer = 0; + if (d->bd_bif != NULL) { + /* + * Remove descriptor from writers-only list + * and add it to active readers list. + */ + CK_LIST_REMOVE(d, bd_next); + CK_LIST_INSERT_HEAD(&d->bd_bif->bif_dlist, + d, bd_next); + CTR2(KTR_NET, + "%s: upgrade required by pid %d", + __func__, d->bd_pid); + track_event = true; + } + } } BPFD_UNLOCK(d); - if (d->bd_bif != NULL) - BPFIF_WUNLOCK(d->bd_bif); - if (old != NULL) - free(old, M_BPF); -#ifdef BPF_JITTER - if (ofunc != NULL) - bpf_destroy_jit_filter(ofunc); -#endif - /* Move d to active readers list. */ - if (need_upgrade != 0) - bpf_upgraded(d); + if (fcode != NULL) + epoch_call(net_epoch_preempt, &fcode->epoch_ctx, + bpf_program_buffer_free); + if (track_event) + EVENTHANDLER_INVOKE(bpf_track, + d->bd_bif->bif_ifp, d->bd_bif->bif_dlt, 1); + BPF_UNLOCK(); return (0); } @@ -1971,15 +2060,6 @@ bpf_setif(struct bpf_d *d, struct ifreq *ifr) return (ENXIO); bp = theywant->if_bpf; - - /* Check if interface is not being detached from BPF */ - BPFIF_RLOCK(bp); - if (bp->bif_flags & BPFIF_FLAG_DYING) { - BPFIF_RUNLOCK(bp); - return (ENXIO); - } - BPFIF_RUNLOCK(bp); - /* * At this point, we expect the buffer is already allocated. If not, * return an error. @@ -1996,9 +2076,11 @@ bpf_setif(struct bpf_d *d, struct ifreq *ifr) } if (bp != d->bd_bif) bpf_attachd(d, bp); - BPFD_LOCK(d); - reset_d(d); - BPFD_UNLOCK(d); + else { + BPFD_LOCK(d); + reset_d(d); + BPFD_UNLOCK(d); + } return (0); } @@ -2150,6 +2232,7 @@ bpf_gettime(struct bintime *bt, int tstype, struct mbu void bpf_tap(struct bpf_if *bp, u_char *pkt, u_int pktlen) { + struct epoch_tracker et; struct bintime bt; struct bpf_d *d; #ifdef BPF_JITTER @@ -2159,24 +2242,14 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, u_int pktlen) int gottime; gottime = BPF_TSTAMP_NONE; - - BPFIF_RLOCK(bp); - - LIST_FOREACH(d, &bp->bif_dlist, bd_next) { - /* - * We are not using any locks for d here because: - * 1) any filter change is protected by interface - * write lock - * 2) destroying/detaching d is protected by interface - * write lock, too - */ - + NET_EPOCH_ENTER(et); + CK_LIST_FOREACH(d, &bp->bif_dlist, bd_next) { counter_u64_add(d->bd_rcount, 1); /* - * NB: We dont call BPF_CHECK_DIRECTION() here since there is no - * way for the caller to indiciate to us whether this packet - * is inbound or outbound. In the bpf_mtap() routines, we use - * the interface pointers on the mbuf to figure it out. + * NB: We dont call BPF_CHECK_DIRECTION() here since there + * is no way for the caller to indiciate to us whether this + * packet is inbound or outbound. In the bpf_mtap() routines, + * we use the interface pointers on the mbuf to figure it out. */ #ifdef BPF_JITTER bf = bpf_jitter_enable != 0 ? d->bd_bfilter : NULL; @@ -2190,10 +2263,10 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, u_int pktlen) * Filter matches. Let's to acquire write lock. */ BPFD_LOCK(d); - counter_u64_add(d->bd_fcount, 1); if (gottime < bpf_ts_quality(d->bd_tstamp)) - gottime = bpf_gettime(&bt, d->bd_tstamp, NULL); + gottime = bpf_gettime(&bt, d->bd_tstamp, + NULL); #ifdef MAC if (mac_bpfdesc_check_receive(d, bp->bif_ifp) == 0) #endif @@ -2202,7 +2275,7 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, u_int pktlen) BPFD_UNLOCK(d); } } - BPFIF_RUNLOCK(bp); + NET_EPOCH_EXIT(et); } #define BPF_CHECK_DIRECTION(d, r, i) \ @@ -2216,6 +2289,7 @@ bpf_tap(struct bpf_if *bp, u_char *pkt, u_int pktlen) void bpf_mtap(struct bpf_if *bp, struct mbuf *m) { + struct epoch_tracker et; struct bintime bt; struct bpf_d *d; #ifdef BPF_JITTER @@ -2233,9 +2307,8 @@ bpf_mtap(struct bpf_if *bp, struct mbuf *m) pktlen = m_length(m, NULL); gottime = BPF_TSTAMP_NONE; - BPFIF_RLOCK(bp); - - LIST_FOREACH(d, &bp->bif_dlist, bd_next) { + NET_EPOCH_ENTER(et); + CK_LIST_FOREACH(d, &bp->bif_dlist, bd_next) { if (BPF_CHECK_DIRECTION(d, m->m_pkthdr.rcvif, bp->bif_ifp)) continue; counter_u64_add(d->bd_rcount, 1); @@ -2243,7 +2316,8 @@ bpf_mtap(struct bpf_if *bp, struct mbuf *m) bf = bpf_jitter_enable != 0 ? d->bd_bfilter : NULL; /* XXX We cannot handle multiple mbufs. */ if (bf != NULL && m->m_next == NULL) - slen = (*(bf->func))(mtod(m, u_char *), pktlen, pktlen); + slen = (*(bf->func))(mtod(m, u_char *), pktlen, + pktlen); else #endif slen = bpf_filter(d->bd_rfilter, (u_char *)m, pktlen, 0); @@ -2261,7 +2335,7 @@ bpf_mtap(struct bpf_if *bp, struct mbuf *m) BPFD_UNLOCK(d); } } - BPFIF_RUNLOCK(bp); + NET_EPOCH_EXIT(et); } /* @@ -2271,6 +2345,7 @@ bpf_mtap(struct bpf_if *bp, struct mbuf *m) void bpf_mtap2(struct bpf_if *bp, void *data, u_int dlen, struct mbuf *m) { + struct epoch_tracker et; struct bintime bt; struct mbuf mb; struct bpf_d *d; @@ -2296,9 +2371,8 @@ bpf_mtap2(struct bpf_if *bp, void *data, u_int dlen, s gottime = BPF_TSTAMP_NONE; - BPFIF_RLOCK(bp); - - LIST_FOREACH(d, &bp->bif_dlist, bd_next) { + NET_EPOCH_ENTER(et); + CK_LIST_FOREACH(d, &bp->bif_dlist, bd_next) { if (BPF_CHECK_DIRECTION(d, m->m_pkthdr.rcvif, bp->bif_ifp)) continue; counter_u64_add(d->bd_rcount, 1); @@ -2317,11 +2391,10 @@ bpf_mtap2(struct bpf_if *bp, void *data, u_int dlen, s BPFD_UNLOCK(d); } } - BPFIF_RUNLOCK(bp); + NET_EPOCH_EXIT(et); } #undef BPF_CHECK_DIRECTION - #undef BPF_TSTAMP_NONE #undef BPF_TSTAMP_FAST #undef BPF_TSTAMP_NORMAL @@ -2540,26 +2613,30 @@ copy: * Called on close. */ static void -bpf_freed(struct bpf_d *d) +bpfd_free(epoch_context_t ctx) { + struct bpf_d *d; + struct bpf_program_buffer *p; /* * We don't need to lock out interrupts since this descriptor has * been detached from its interface and it yet hasn't been marked * free. */ + d = __containerof(ctx, struct bpf_d, epoch_ctx); bpf_free(d); if (d->bd_rfilter != NULL) { - free((caddr_t)d->bd_rfilter, M_BPF); -#ifdef BPF_JITTER - if (d->bd_bfilter != NULL) - bpf_destroy_jit_filter(d->bd_bfilter); -#endif + p = __containerof((void *)d->bd_rfilter, + struct bpf_program_buffer, buffer); + bpf_program_buffer_free(&p->epoch_ctx); } - if (d->bd_wfilter != NULL) - free((caddr_t)d->bd_wfilter, M_BPF); - mtx_destroy(&d->bd_lock); + if (d->bd_wfilter != NULL) { + p = __containerof((void *)d->bd_wfilter, + struct bpf_program_buffer, buffer); + bpf_program_buffer_free(&p->epoch_ctx); + } + mtx_destroy(&d->bd_lock); counter_u64_free(d->bd_rcount); counter_u64_free(d->bd_dcount); counter_u64_free(d->bd_fcount); @@ -2567,7 +2644,7 @@ bpf_freed(struct bpf_d *d) counter_u64_free(d->bd_wfcount); counter_u64_free(d->bd_wdcount); counter_u64_free(d->bd_zcopy); - + free(d, M_BPF); } /* @@ -2588,25 +2665,31 @@ bpfattach(struct ifnet *ifp, u_int dlt, u_int hdrlen) * headers are not yet supporrted). */ void -bpfattach2(struct ifnet *ifp, u_int dlt, u_int hdrlen, struct bpf_if **driverp) +bpfattach2(struct ifnet *ifp, u_int dlt, u_int hdrlen, + struct bpf_if **driverp) { struct bpf_if *bp; - KASSERT(*driverp == NULL, ("bpfattach2: driverp already initialized")); + KASSERT(*driverp == NULL, + ("bpfattach2: driverp already initialized")); bp = malloc(sizeof(*bp), M_BPF, M_WAITOK | M_ZERO); - rw_init(&bp->bif_lock, "bpf interface lock"); - LIST_INIT(&bp->bif_dlist); - LIST_INIT(&bp->bif_wlist); + CK_LIST_INIT(&bp->bif_dlist); + CK_LIST_INIT(&bp->bif_wlist); bp->bif_ifp = ifp; bp->bif_dlt = dlt; bp->bif_hdrlen = hdrlen; bp->bif_bpf = driverp; + bp->bif_refcnt = 1; *driverp = bp; - + /* + * Reference ifnet pointer, so it won't freed until + * we release it. + */ + if_ref(ifp); BPF_LOCK(); - LIST_INSERT_HEAD(&bpf_iflist, bp, bif_next); + CK_LIST_INSERT_HEAD(&bpf_iflist, bp, bif_next); BPF_UNLOCK(); if (bootverbose && IS_DEFAULT_VNET(curvnet)) @@ -2647,103 +2730,37 @@ bpf_get_bp_params(struct bpf_if *bp, u_int *bif_dlt, u void bpfdetach(struct ifnet *ifp) { - struct bpf_if *bp, *bp_temp; - struct bpf_d *d; - int ndetached; + struct bpf_if *bp, *bp_temp; + struct bpf_d *d; - ndetached = 0; - BPF_LOCK(); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon May 13 14:07:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40B151590F53; Mon, 13 May 2019 14:07:03 +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 D566D830FA; Mon, 13 May 2019 14:07:02 +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 AA04CAD43; Mon, 13 May 2019 14:07:02 +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 x4DE72vH003612; Mon, 13 May 2019 14:07:02 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4DE72Bu003611; Mon, 13 May 2019 14:07:02 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905131407.x4DE72Bu003611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 13 May 2019 14:07:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347527 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 347527 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D566D830FA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Mon, 13 May 2019 14:07:03 -0000 Author: ae Date: Mon May 13 14:07:02 2019 New Revision: 347527 URL: https://svnweb.freebsd.org/changeset/base/347527 Log: Do not leak memory used for binary filter. Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Mon May 13 13:45:28 2019 (r347526) +++ head/sys/net/bpf.c Mon May 13 14:07:02 2019 (r347527) @@ -2628,11 +2628,17 @@ bpfd_free(epoch_context_t ctx) if (d->bd_rfilter != NULL) { p = __containerof((void *)d->bd_rfilter, struct bpf_program_buffer, buffer); +#ifdef BPF_JITTER + p->func = d->bd_bfilter; +#endif bpf_program_buffer_free(&p->epoch_ctx); } if (d->bd_wfilter != NULL) { p = __containerof((void *)d->bd_wfilter, struct bpf_program_buffer, buffer); +#ifdef BPF_JITTER + p->func = NULL; +#endif bpf_program_buffer_free(&p->epoch_ctx); } From owner-svn-src-head@freebsd.org Mon May 13 16:38:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65784159460F; Mon, 13 May 2019 16:38:52 +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 1688589A22; Mon, 13 May 2019 16:38:52 +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 C3D18C858; Mon, 13 May 2019 16:38:51 +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 x4DGcp3p083453; Mon, 13 May 2019 16:38:51 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4DGcmIw083437; Mon, 13 May 2019 16:38:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905131638.x4DGcmIw083437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 13 May 2019 16:38:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347532 - in head: contrib/netbsd-tests/lib/libc/sys lib/libc/sys lib/libc/tests/sys sys/amd64/vmm sys/sys sys/vm usr.bin/vmstat X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: contrib/netbsd-tests/lib/libc/sys lib/libc/sys lib/libc/tests/sys sys/amd64/vmm sys/sys sys/vm usr.bin/vmstat X-SVN-Commit-Revision: 347532 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1688589A22 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Mon, 13 May 2019 16:38:52 -0000 Author: markj Date: Mon May 13 16:38:48 2019 New Revision: 347532 URL: https://svnweb.freebsd.org/changeset/base/347532 Log: Provide separate accounting for user-wired pages. Historically we have not distinguished between kernel wirings and user wirings for accounting purposes. User wirings (via mlock(2)) were subject to a global limit on the number of wired pages, so if large swaths of physical memory were wired by the kernel, as happens with the ZFS ARC among other things, the limit could be exceeded, causing user wirings to fail. The change adds a new counter, v_user_wire_count, which counts the number of virtual pages wired by user processes via mlock(2) and mlockall(2). Only user-wired pages are subject to the system-wide limit which helps provide some safety against deadlocks. In particular, while sources of kernel wirings typically support some backpressure mechanism, there is no way to reclaim user-wired pages shorting of killing the wiring process. The limit is exported as vm.max_user_wired, renamed from vm.max_wired, and changed from u_int to u_long. The choice to count virtual user-wired pages rather than physical pages was done for simplicity. There are mechanisms that can cause user-wired mappings to be destroyed while maintaining a wiring of the backing physical page; these make it difficult to accurately track user wirings at the physical page layer. The change also closes some holes which allowed user wirings to succeed even when they would cause the system limit to be exceeded. For instance, mmap() may now fail with ENOMEM in a process that has called mlockall(MCL_FUTURE) if the new mapping would cause the user wiring limit to be exceeded. Note that bhyve -S is subject to the user wiring limit, which defaults to 1/3 of physical RAM. Users that wish to exceed the limit must tune vm.max_user_wired. Reviewed by: kib, ngie (mlock() test changes) Tested by: pho (earlier version) MFC after: 45 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D19908 Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c head/lib/libc/sys/mlock.2 head/lib/libc/sys/mlockall.2 head/lib/libc/tests/sys/mlock_helper.c head/sys/amd64/vmm/vmm.c head/sys/sys/vmmeter.h head/sys/vm/vm_glue.c head/sys/vm/vm_map.c head/sys/vm/vm_map.h head/sys/vm/vm_meter.c head/sys/vm/vm_mmap.c head/sys/vm/vm_pageout.c head/sys/vm/vm_pageout.h head/sys/vm/vm_unix.c head/usr.bin/vmstat/vmstat.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Mon May 13 15:39:54 2019 (r347531) +++ head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Mon May 13 16:38:48 2019 (r347532) @@ -51,7 +51,7 @@ __RCSID("$NetBSD: t_mlock.c,v 1.6 2016/08/09 12:02:44 #define _KMEMUSER #include -void set_vm_max_wired(int); +void set_vm_max_wired(u_long); void restore_vm_max_wired(void); #endif Modified: head/lib/libc/sys/mlock.2 ============================================================================== --- head/lib/libc/sys/mlock.2 Mon May 13 15:39:54 2019 (r347531) +++ head/lib/libc/sys/mlock.2 Mon May 13 16:38:48 2019 (r347532) @@ -28,7 +28,7 @@ .\" @(#)mlock.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd March 20, 2018 +.Dd May 13, 2019 .Dt MLOCK 2 .Os .Sh NAME @@ -97,13 +97,13 @@ resource limit and the system-wide .Dq wired pages limit -.Va vm.max_wired . -.Va vm.max_wired +.Va vm.max_user_wired . +.Va vm.max_user_wired applies to the system as a whole, so the amount available to a single process at any given time is the difference between -.Va vm.max_wired +.Va vm.max_user_wired and -.Va vm.stats.vm.v_wire_count . +.Va vm.stats.vm.v_user_wire_count . .Pp If .Va security.bsd.unprivileged_mlock @@ -124,13 +124,11 @@ will fail if: is set to 0 and the caller is not the super-user. .It Bq Er EINVAL The address range given wraps around zero. -.It Bq Er EAGAIN -Locking the indicated range would exceed the system limit for locked memory. .It Bq Er ENOMEM Some portion of the indicated address range is not allocated. There was an error faulting/mapping a page. -Locking the indicated range would exceed the per-process limit for locked -memory. +Locking the indicated range would exceed the per-process or system-wide limits +for locked memory. .El The .Fn munlock @@ -171,11 +169,11 @@ system calls first appeared in Allocating too much wired memory can lead to a memory-allocation deadlock which requires a reboot to recover from. .Pp -The per-process resource limit is a limit on the amount of virtual -memory locked, while the system-wide limit is for the number of locked -physical pages. -Hence a process with two distinct locked mappings of the same physical page -counts as 2 pages against the per-process limit and as only a single page -in the system limit. +The per-process and system-wide resource limits of locked memory apply +to the amount of virtual memory locked, not the amount of locked physical +pages. +Hence two distinct locked mappings of the same physical page counts as +2 pages aginst the system limit, and also against the per-process limit +if both mappings belong to the same physical map. .Pp The per-process resource limit is not currently supported. Modified: head/lib/libc/sys/mlockall.2 ============================================================================== --- head/lib/libc/sys/mlockall.2 Mon May 13 15:39:54 2019 (r347531) +++ head/lib/libc/sys/mlockall.2 Mon May 13 16:38:48 2019 (r347532) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 25, 2012 +.Dd May 13, 2019 .Dt MLOCKALL 2 .Os .Sh NAME @@ -69,7 +69,7 @@ limited in how much they can lock down. A single process can lock the minimum of a system-wide .Dq wired pages limit -.Va vm.max_wired +.Va vm.max_user_wired and the per-process .Dv RLIMIT_MEMLOCK resource limit. @@ -138,9 +138,9 @@ and functions first appeared in .Fx 5.1 . .Sh BUGS -The per-process resource limit is a limit on the amount of virtual -memory locked, while the system-wide limit is for the number of locked -physical pages. -Hence a process with two distinct locked mappings of the same physical page -counts as 2 pages against the per-process limit and as only a single page -in the system limit. +The per-process and system-wide resource limits of locked memory apply +to the amount of virtual memory locked, not the amount of locked physical +pages. +Hence two distinct locked mappings of the same physical page counts as +2 pages aginst the system limit, and also against the per-process limit +if both mappings belong to the same physical map. Modified: head/lib/libc/tests/sys/mlock_helper.c ============================================================================== --- head/lib/libc/tests/sys/mlock_helper.c Mon May 13 15:39:54 2019 (r347531) +++ head/lib/libc/tests/sys/mlock_helper.c Mon May 13 16:38:48 2019 (r347532) @@ -39,16 +39,16 @@ __FBSDID("$FreeBSD$"); #include #include -#define VM_MAX_WIRED "vm.max_wired" +#define VM_MAX_WIRED "vm.max_user_wired" static void -vm_max_wired_sysctl(int *old_value, int *new_value) +vm_max_wired_sysctl(u_long *old_value, u_long *new_value) { size_t old_len; - size_t new_len = (new_value == NULL ? 0 : sizeof(int)); + size_t new_len = (new_value == NULL ? 0 : sizeof(*new_value)); if (old_value == NULL) - printf("Setting the new value to %d\n", *new_value); + printf("Setting the new value to %lu\n", *new_value); else { ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, NULL, &old_len, new_value, new_len) == 0, @@ -60,14 +60,14 @@ vm_max_wired_sysctl(int *old_value, int *new_value) "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno)); if (old_value != NULL) - printf("Saved the old value (%d)\n", *old_value); + printf("Saved the old value (%lu)\n", *old_value); } void -set_vm_max_wired(int new_value) +set_vm_max_wired(u_long new_value) { FILE *fp; - int old_value; + u_long old_value; fp = fopen(VM_MAX_WIRED, "w"); if (fp == NULL) { @@ -78,7 +78,7 @@ set_vm_max_wired(int new_value) vm_max_wired_sysctl(&old_value, NULL); - ATF_REQUIRE_MSG(fprintf(fp, "%d", old_value) > 0, + ATF_REQUIRE_MSG(fprintf(fp, "%lu", old_value) > 0, "saving %s failed", VM_MAX_WIRED); fclose(fp); @@ -90,7 +90,7 @@ void restore_vm_max_wired(void) { FILE *fp; - int saved_max_wired; + u_long saved_max_wired; fp = fopen(VM_MAX_WIRED, "r"); if (fp == NULL) { @@ -98,14 +98,14 @@ restore_vm_max_wired(void) return; } - if (fscanf(fp, "%d", &saved_max_wired) != 1) { + if (fscanf(fp, "%lu", &saved_max_wired) != 1) { perror("fscanf failed\n"); fclose(fp); return; } fclose(fp); - printf("old value in %s: %d\n", VM_MAX_WIRED, saved_max_wired); + printf("old value in %s: %lu\n", VM_MAX_WIRED, saved_max_wired); if (saved_max_wired == 0) /* This will cripple the test host */ return; Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Mon May 13 15:39:54 2019 (r347531) +++ head/sys/amd64/vmm/vmm.c Mon May 13 16:38:48 2019 (r347532) @@ -754,7 +754,8 @@ vm_mmap_memseg(struct vm *vm, vm_paddr_t gpa, int segi VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); if (error != KERN_SUCCESS) { vm_map_remove(&vm->vmspace->vm_map, gpa, gpa + len); - return (EFAULT); + return (error == KERN_RESOURCE_SHORTAGE ? ENOMEM : + EFAULT); } } Modified: head/sys/sys/vmmeter.h ============================================================================== --- head/sys/sys/vmmeter.h Mon May 13 15:39:54 2019 (r347531) +++ head/sys/sys/vmmeter.h Mon May 13 16:38:48 2019 (r347532) @@ -153,6 +153,8 @@ extern domainset_t vm_severe_domains; #define VM_CNT_INC(var) VM_CNT_ADD(var, 1) #define VM_CNT_FETCH(var) counter_u64_fetch(vm_cnt.var) +extern u_long vm_user_wire_count; + static inline void vm_wire_add(int cnt) { Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Mon May 13 15:39:54 2019 (r347531) +++ head/sys/vm/vm_glue.c Mon May 13 16:38:48 2019 (r347532) @@ -181,21 +181,8 @@ vslock(void *addr, size_t len) if (last < (vm_offset_t)addr || end < (vm_offset_t)addr) return (EINVAL); npages = atop(end - start); - if (npages > vm_page_max_wired) + if (npages > vm_page_max_user_wired) return (ENOMEM); -#if 0 - /* - * XXX - not yet - * - * The limit for transient usage of wired pages should be - * larger than for "permanent" wired pages (mlock()). - * - * Also, the sysctl code, which is the only present user - * of vslock(), does a hard loop on EAGAIN. - */ - if (npages + vm_wire_count() > vm_page_max_wired) - return (EAGAIN); -#endif error = vm_map_wire(&curproc->p_vmspace->vm_map, start, end, VM_MAP_WIRE_SYSTEM | VM_MAP_WIRE_NOHOLES); if (error == KERN_SUCCESS) { Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Mon May 13 15:39:54 2019 (r347531) +++ head/sys/vm/vm_map.c Mon May 13 16:38:48 2019 (r347532) @@ -90,6 +90,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2917,12 +2918,12 @@ done: if (rv == KERN_SUCCESS && (!user_unwire || (entry->eflags & MAP_ENTRY_USER_WIRED))) { - if (user_unwire) - entry->eflags &= ~MAP_ENTRY_USER_WIRED; if (entry->wired_count == 1) vm_map_entry_unwire(map, entry); else entry->wired_count--; + if (user_unwire) + entry->eflags &= ~MAP_ENTRY_USER_WIRED; } KASSERT((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0, ("vm_map_unwire: in-transition flag missing %p", entry)); @@ -2942,6 +2943,28 @@ done: return (rv); } +static void +vm_map_wire_user_count_sub(u_long npages) +{ + + atomic_subtract_long(&vm_user_wire_count, npages); +} + +static bool +vm_map_wire_user_count_add(u_long npages) +{ + u_long wired; + + wired = vm_user_wire_count; + do { + if (npages + wired > vm_page_max_user_wired) + return (false); + } while (!atomic_fcmpset_long(&vm_user_wire_count, &wired, + npages + wired)); + + return (true); +} + /* * vm_map_wire_entry_failure: * @@ -2978,37 +3001,49 @@ vm_map_wire_entry_failure(vm_map_t map, vm_map_entry_t entry->wired_count = -1; } +int +vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags) +{ + int rv; + + vm_map_lock(map); + rv = vm_map_wire_locked(map, start, end, flags); + vm_map_unlock(map); + return (rv); +} + + /* - * vm_map_wire: + * vm_map_wire_locked: * - * Implements both kernel and user wiring. + * Implements both kernel and user wiring. Returns with the map locked, + * the map lock may be dropped. */ int -vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, - int flags) +vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags) { vm_map_entry_t entry, first_entry, tmp_entry; vm_offset_t faddr, saved_end, saved_start; - unsigned int last_timestamp; + u_long npages; + u_int last_timestamp; int rv; boolean_t need_wakeup, result, user_wire; vm_prot_t prot; + VM_MAP_ASSERT_LOCKED(map); + if (start == end) return (KERN_SUCCESS); prot = 0; if (flags & VM_MAP_WIRE_WRITE) prot |= VM_PROT_WRITE; user_wire = (flags & VM_MAP_WIRE_USER) ? TRUE : FALSE; - vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); if (!vm_map_lookup_entry(map, start, &first_entry)) { if (flags & VM_MAP_WIRE_HOLESOK) first_entry = first_entry->next; - else { - vm_map_unlock(map); + else return (KERN_INVALID_ADDRESS); - } } last_timestamp = map->timestamp; entry = first_entry; @@ -3042,7 +3077,6 @@ vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset /* * first_entry has been deleted. */ - vm_map_unlock(map); return (KERN_INVALID_ADDRESS); } end = saved_start; @@ -3082,13 +3116,22 @@ vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset } if (entry->wired_count == 0) { entry->wired_count++; - saved_start = entry->start; - saved_end = entry->end; + npages = atop(entry->end - entry->start); + if (user_wire && !vm_map_wire_user_count_add(npages)) { + vm_map_wire_entry_failure(map, entry, + entry->start); + end = entry->end; + rv = KERN_RESOURCE_SHORTAGE; + goto done; + } + /* * Release the map lock, relying on the in-transition * mark. Mark the map busy for fork. */ + saved_start = entry->start; + saved_end = entry->end; vm_map_busy(map); vm_map_unlock(map); @@ -3136,6 +3179,8 @@ vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset last_timestamp = map->timestamp; if (rv != KERN_SUCCESS) { vm_map_wire_entry_failure(map, entry, faddr); + if (user_wire) + vm_map_wire_user_count_sub(npages); end = entry->end; goto done; } @@ -3201,9 +3246,12 @@ done: * Undo the wiring. Wiring succeeded on this entry * but failed on a later entry. */ - if (entry->wired_count == 1) + if (entry->wired_count == 1) { vm_map_entry_unwire(map, entry); - else + if (user_wire) + vm_map_wire_user_count_sub( + atop(entry->end - entry->start)); + } else entry->wired_count--; } next_entry_done: @@ -3220,7 +3268,6 @@ done: } vm_map_simplify_entry(map, entry); } - vm_map_unlock(map); if (need_wakeup) vm_map_wakeup(map); return (rv); @@ -3338,13 +3385,18 @@ vm_map_sync( static void vm_map_entry_unwire(vm_map_t map, vm_map_entry_t entry) { + vm_size_t size; VM_MAP_ASSERT_LOCKED(map); KASSERT(entry->wired_count > 0, ("vm_map_entry_unwire: entry %p isn't wired", entry)); + + size = entry->end - entry->start; + if ((entry->eflags & MAP_ENTRY_USER_WIRED) != 0) + vm_map_wire_user_count_sub(atop(size)); pmap_unwire(map->pmap, entry->start, entry->end); - vm_object_unwire(entry->object.vm_object, entry->offset, entry->end - - entry->start, PQ_ACTIVE); + vm_object_unwire(entry->object.vm_object, entry->offset, size, + PQ_ACTIVE); entry->wired_count = 0; } @@ -4311,12 +4363,11 @@ retry: * Heed the MAP_WIREFUTURE flag if it was set for this process. */ if (rv == KERN_SUCCESS && (map->flags & MAP_WIREFUTURE) != 0) { - vm_map_unlock(map); - vm_map_wire(map, grow_start, grow_start + grow_amount, + rv = vm_map_wire_locked(map, grow_start, + grow_start + grow_amount, VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); - vm_map_lock_read(map); - } else - vm_map_lock_downgrade(map); + } + vm_map_lock_downgrade(map); out: #ifdef RACCT Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Mon May 13 15:39:54 2019 (r347531) +++ head/sys/vm/vm_map.h Mon May 13 16:38:48 2019 (r347532) @@ -422,7 +422,8 @@ int vm_map_madvise (vm_map_t, vm_offset_t, vm_offset_t int vm_map_stack (vm_map_t, vm_offset_t, vm_size_t, vm_prot_t, vm_prot_t, int); int vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags); -int vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, +int vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags); +int vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags); long vmspace_swap_count(struct vmspace *vmspace); void vm_map_entry_set_vnode_text(vm_map_entry_t entry, bool add); Modified: head/sys/vm/vm_meter.c ============================================================================== --- head/sys/vm/vm_meter.c Mon May 13 15:39:54 2019 (r347531) +++ head/sys/vm/vm_meter.c Mon May 13 16:38:48 2019 (r347532) @@ -97,6 +97,8 @@ struct vmmeter __read_mostly vm_cnt = { .v_wire_count = EARLY_COUNTER, }; +u_long __exclusive_cache_line vm_user_wire_count; + static void vmcounter_startup(void) { @@ -394,6 +396,8 @@ sysctl_handle_vmstat_proc(SYSCTL_HANDLER_ARGS) #define VM_STATS_UINT(var, descr) \ SYSCTL_UINT(_vm_stats_vm, OID_AUTO, var, CTLFLAG_RD, &vm_cnt.var, 0, descr) +#define VM_STATS_ULONG(var, descr) \ + SYSCTL_ULONG(_vm_stats_vm, OID_AUTO, var, CTLFLAG_RD, &vm_cnt.var, 0, descr) VM_STATS_UINT(v_page_size, "Page size in bytes"); VM_STATS_UINT(v_page_count, "Total number of pages in system"); @@ -410,6 +414,9 @@ VM_STATS_PROC(v_laundry_count, "Pages eligible for lau VM_STATS_UINT(v_pageout_free_min, "Min pages reserved for kernel"); VM_STATS_UINT(v_interrupt_free_min, "Reserved pages for interrupt code"); VM_STATS_UINT(v_free_severe, "Severe page depletion point"); + +SYSCTL_ULONG(_vm_stats_vm, OID_AUTO, v_user_wire_count, CTLFLAG_RD, + &vm_user_wire_count, 0, "User-wired virtual memory"); #ifdef COMPAT_FREEBSD11 /* Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Mon May 13 15:39:54 2019 (r347531) +++ head/sys/vm/vm_mmap.c Mon May 13 16:38:48 2019 (r347532) @@ -1003,7 +1003,7 @@ kern_mlock(struct proc *proc, struct ucred *cred, uint if (last < addr || end < addr) return (EINVAL); npages = atop(end - start); - if (npages > vm_page_max_wired) + if (npages > vm_page_max_user_wired) return (ENOMEM); map = &proc->p_vmspace->vm_map; PROC_LOCK(proc); @@ -1013,8 +1013,6 @@ kern_mlock(struct proc *proc, struct ucred *cred, uint return (ENOMEM); } PROC_UNLOCK(proc); - if (npages + vm_wire_count() > vm_page_max_wired) - return (EAGAIN); #ifdef RACCT if (racct_enable) { PROC_LOCK(proc); @@ -1091,7 +1089,12 @@ sys_mlockall(struct thread *td, struct mlockall_args * */ error = vm_map_wire(map, vm_map_min(map), vm_map_max(map), VM_MAP_WIRE_USER|VM_MAP_WIRE_HOLESOK); - error = (error == KERN_SUCCESS ? 0 : EAGAIN); + if (error == KERN_SUCCESS) + error = 0; + else if (error == KERN_RESOURCE_SHORTAGE) + error = ENOMEM; + else + error = EAGAIN; } #ifdef RACCT if (racct_enable && error != KERN_SUCCESS) { @@ -1558,10 +1561,16 @@ vm_mmap_object(vm_map_t map, vm_offset_t *addr, vm_siz * If the process has requested that all future mappings * be wired, then heed this. */ - if (map->flags & MAP_WIREFUTURE) { - vm_map_wire(map, *addr, *addr + size, - VM_MAP_WIRE_USER | ((flags & MAP_STACK) ? - VM_MAP_WIRE_HOLESOK : VM_MAP_WIRE_NOHOLES)); + if ((map->flags & MAP_WIREFUTURE) != 0) { + vm_map_lock(map); + if ((map->flags & MAP_WIREFUTURE) != 0) + rv = vm_map_wire_locked(map, *addr, + *addr + size, VM_MAP_WIRE_USER | + ((flags & MAP_STACK) ? VM_MAP_WIRE_HOLESOK : + VM_MAP_WIRE_NOHOLES)); + if (rv != KERN_SUCCESS) + (void)vm_map_delete(map, *addr, *addr + size); + vm_map_unlock(map); } } return (vm_mmap_to_errno(rv)); Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Mon May 13 15:39:54 2019 (r347531) +++ head/sys/vm/vm_pageout.c Mon May 13 16:38:48 2019 (r347532) @@ -194,9 +194,10 @@ SYSCTL_UINT(_vm, OID_AUTO, background_launder_max, CTL int vm_pageout_page_count = 32; -int vm_page_max_wired; /* XXX max # of wired pages system-wide */ -SYSCTL_INT(_vm, OID_AUTO, max_wired, - CTLFLAG_RW, &vm_page_max_wired, 0, "System-wide limit to wired page count"); +u_long vm_page_max_user_wired; +SYSCTL_ULONG(_vm, OID_AUTO, max_user_wired, CTLFLAG_RW, + &vm_page_max_user_wired, 0, + "system-wide limit to user-wired page count"); static u_int isqrt(u_int num); static int vm_pageout_launder(struct vm_domain *vmd, int launder, @@ -2041,8 +2042,8 @@ vm_pageout_init(void) if (vm_pageout_update_period == 0) vm_pageout_update_period = 600; - if (vm_page_max_wired == 0) - vm_page_max_wired = freecount / 3; + if (vm_page_max_user_wired == 0) + vm_page_max_user_wired = freecount / 3; } /* Modified: head/sys/vm/vm_pageout.h ============================================================================== --- head/sys/vm/vm_pageout.h Mon May 13 15:39:54 2019 (r347531) +++ head/sys/vm/vm_pageout.h Mon May 13 16:38:48 2019 (r347532) @@ -75,7 +75,7 @@ * Exported data structures. */ -extern int vm_page_max_wired; +extern u_long vm_page_max_user_wired; extern int vm_pageout_page_count; #define VM_OOM_MEM 1 Modified: head/sys/vm/vm_unix.c ============================================================================== --- head/sys/vm/vm_unix.c Mon May 13 15:39:54 2019 (r347531) +++ head/sys/vm/vm_unix.c Mon May 13 16:38:48 2019 (r347532) @@ -95,13 +95,11 @@ kern_break(struct thread *td, uintptr_t *addr) rlim_t datalim, lmemlim, vmemlim; int prot, rv; int error = 0; - boolean_t do_map_wirefuture; datalim = lim_cur(td, RLIMIT_DATA); lmemlim = lim_cur(td, RLIMIT_MEMLOCK); vmemlim = lim_cur(td, RLIMIT_VMEM); - do_map_wirefuture = FALSE; new = round_page(*addr); vm_map_lock(map); @@ -184,7 +182,14 @@ kern_break(struct thread *td, uintptr_t *addr) if (i386_read_exec && SV_PROC_FLAG(td->td_proc, SV_ILP32)) prot |= VM_PROT_EXECUTE; #endif - rv = vm_map_insert(map, NULL, 0, old, new, prot, VM_PROT_ALL, 0); + rv = vm_map_insert(map, NULL, 0, old, new, prot, VM_PROT_ALL, + 0); + if (rv == KERN_SUCCESS && (map->flags & MAP_WIREFUTURE) != 0) { + rv = vm_map_wire_locked(map, old, new, + VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); + if (rv != KERN_SUCCESS) + vm_map_delete(map, old, new); + } if (rv != KERN_SUCCESS) { #ifdef RACCT if (racct_enable) { @@ -205,17 +210,6 @@ kern_break(struct thread *td, uintptr_t *addr) goto done; } vm->vm_dsize += btoc(new - old); - /* - * Handle the MAP_WIREFUTURE case for legacy applications, - * by marking the newly mapped range of pages as wired. - * We are not required to perform a corresponding - * vm_map_unwire() before vm_map_delete() below, as - * it will forcibly unwire the pages in the range. - * - * XXX If the pages cannot be wired, no error is returned. - */ - if ((map->flags & MAP_WIREFUTURE) == MAP_WIREFUTURE) - do_map_wirefuture = TRUE; } else if (new < old) { rv = vm_map_delete(map, new, old); if (rv != KERN_SUCCESS) { @@ -238,10 +232,6 @@ kern_break(struct thread *td, uintptr_t *addr) } done: vm_map_unlock(map); - - if (do_map_wirefuture) - (void) vm_map_wire(map, old, new, - VM_MAP_WIRE_USER|VM_MAP_WIRE_NOHOLES); if (error == 0) *addr = new; Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Mon May 13 15:39:54 2019 (r347531) +++ head/usr.bin/vmstat/vmstat.c Mon May 13 16:38:48 2019 (r347532) @@ -156,6 +156,7 @@ static struct __vmmeter { u_int v_free_min; u_int v_free_count; u_int v_wire_count; + u_long v_user_wire_count; u_int v_active_count; u_int v_inactive_target; u_int v_inactive_count; @@ -566,6 +567,7 @@ fill_vmmeter(struct __vmmeter *vmmp) GET_VM_STATS(vm, v_free_min); GET_VM_STATS(vm, v_free_count); GET_VM_STATS(vm, v_wire_count); + GET_VM_STATS(vm, v_user_wire_count); GET_VM_STATS(vm, v_active_count); GET_VM_STATS(vm, v_inactive_target); GET_VM_STATS(vm, v_inactive_count); @@ -1057,6 +1059,8 @@ dosum(void) sum.v_laundry_count); xo_emit("{:wired-pages/%9u} {N:pages wired down}\n", sum.v_wire_count); + xo_emit("{:virtual-user-wired-pages/%9lu} {N:virtual user pages wired " + "down}\n", sum.v_user_wire_count); xo_emit("{:free-pages/%9u} {N:pages free}\n", sum.v_free_count); xo_emit("{:bytes-per-page/%9u} {N:bytes per page}\n", sum.v_page_size); From owner-svn-src-head@freebsd.org Mon May 13 16:44:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A97621594954; Mon, 13 May 2019 16:44:18 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) (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 B4EEE89F6B; Mon, 13 May 2019 16:44:17 +0000 (UTC) (envelope-from delphij@gmail.com) Received: by mail-io1-xd34.google.com with SMTP id x24so3147677ion.5; Mon, 13 May 2019 09:44:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=owzjXIt3bRBvMlIikYEvwpek1MzaeHp0d6J9Cpt9Utw=; b=OK4xai17M74G2dDJvcDGB9yfPef/UMnGAo7RmzneZPjPewXe1h+cSEnLikaBHBjQ22 sNf0+k1JtLWLNbDV/HxXOOH1jK6XMJwlF3BJnjDg99QWq/bga7ZDdwj78OHFB7JH6X5g 2vaqXTjE9CfJQlBtmvGboYi7A5vLRHoogQWLjiOvNlVXztePGOegeybO0JLjiQpVGh8y geffmjszQRkfRzhO5gbvrS1WXhf8dk6S5K95O2ayVA+LZT2Jx8ruxbD+N7dzYZ6nCwi8 HwWewU5etJ2dnF5UVXrBHwWcHAA1dqn4AWXkP2Mg+f6UvBDd0x/5jljIcCpm597f2l4Z Lctg== 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=owzjXIt3bRBvMlIikYEvwpek1MzaeHp0d6J9Cpt9Utw=; b=ZOhjqAOhZJ1VM5U3h+R5vsW4/ZASVYeI9qJSgucZJoCouYqIxU50+VIghZFZ40nmG8 ldxTUc4YvqBdWTmnDp2Rn0ueh17VWyqoptaBhQMRqOGOWHeWaUyzZGrv0xJTeKDc05LQ L97lVtrgCyLTDo7uU09yEWlIwJXpMjvL436K/s9CjHmyO9pQ7Db5YDL1nPs22Pf7p84n mVsAga0WUKyGIaY6NTfsqvYJ7yB9XUWpmB6qUAlXWHLgZq5uQr9MCCq5XH3r3A3ic7I7 Xwl6/OLb7Ugoib2DlGYLdH1W8/w/6WSxNSvAjFbl5gP1m3XO+XlLX+w84kYvRc/vALKB gHxg== X-Gm-Message-State: APjAAAXuklQ3slSLcqD6T5ezNQcWNFPEB6Kr6Ik7bm4tL4uWUTdqglpa qslxrlUCh3EgqO7LAllKCs6DSBLAP3Mw5mndpC+5aVtw X-Google-Smtp-Source: APXvYqw2K+wR4zyrDug2JeRjlT26oGvp/M1a5v5ocdeVq0npcf2nOFuGCyUDPV3RCH/daQt09VZZ2Pnsl48KjePSA9E= X-Received: by 2002:a6b:8f51:: with SMTP id r78mr17414682iod.110.1557765856765; Mon, 13 May 2019 09:44:16 -0700 (PDT) MIME-Version: 1.0 References: <201905111637.x4BGbAWj032623@gndrsh.dnsmgr.net> <201905111741.x4BHflXP008848@slippy.cwsent.com> In-Reply-To: <201905111741.x4BHflXP008848@slippy.cwsent.com> From: Xin LI Date: Mon, 13 May 2019 09:44:05 -0700 Message-ID: Subject: Re: svn commit: r347488 - head/usr.sbin/ntp/ntpd To: Cy Schubert Cc: rgrimes@freebsd.org, Ian Lepore , Xin LI , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: B4EEE89F6B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=OK4xai17; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of delphij@gmail.com designates 2607:f8b0:4864:20::d34 as permitted sender) smtp.mailfrom=delphij@gmail.com X-Spamd-Result: default: False [-6.52 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; 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]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCPT_COUNT_SEVEN(0.00)[7]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[4.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]; NEURAL_HAM_SHORT(-0.89)[-0.891,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE(-2.62)[ip: (-7.53), ipnet: 2607:f8b0::/32(-3.25), asn: 15169(-2.26), country: US(-0.06)]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] 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: Mon, 13 May 2019 16:44:18 -0000 On Sat, May 11, 2019 at 10:42 AM Cy Schubert wrote: > In message <201905111637.x4BGbAWj032623@gndrsh.dnsmgr.net>, "Rodney W. > Grimes" > writes: > > > On Sat, 2019-05-11 at 14:22 +0000, Xin LI wrote: > > > > Author: delphij > > > > Date: Sat May 11 14:22:21 2019 > > > > New Revision: 347488 > > > > URL: https://svnweb.freebsd.org/changeset/base/347488 > > > > > > > > Log: > > > > Update leap-seconds to leap-seconds.3757622400. > > > > > > > > > > For future reference: it's a bit better to get this file from NIST [*] > > > than from USNO. The USNO boilerplate is full of typos, and USNO > > > incorrectly adjusts the "last update date" metadata every time they > > > change the expiration date of the file. That's not correct... as the > > > boilerplate itself states, that field is only supposed to be updated > > > when new leap seconds are added to the file. > > > > I would be very happy if that information would end up in the > > top of, or next to the leap-seconds file so that it was followed > > in the future, rather than being folk lore. > > > > Thanks, > > Rod > > Leap seconds hasn't been updated upstream since 2017. USNO updates the > file when they last paid attention to the file by not updating it. NIST > only updates the file when there is indeed an update, that being Ian's > point. > Yeah, obviously I somehow misread the commit message of r320256. I can do a follow commit to fix it tonight but if you have some time please feel free to fix it now. Cheers, From owner-svn-src-head@freebsd.org Mon May 13 17:35:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6D5E1596280; Mon, 13 May 2019 17:35:12 +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 F38428C122; Mon, 13 May 2019 17:35:11 +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 x4DHZ2mH042283; Mon, 13 May 2019 10:35:02 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4DHZ2BS042282; Mon, 13 May 2019 10:35:02 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905131735.x4DHZ2BS042282@gndrsh.dnsmgr.net> Subject: Re: svn commit: r347532 - in head: contrib/netbsd-tests/lib/libc/sys lib/libc/sys lib/libc/tests/sys sys/amd64/vmm sys/sys sys/vm usr.bin/vmstat In-Reply-To: <201905131638.x4DGcmIw083437@repo.freebsd.org> To: Mark Johnston Date: Mon, 13 May 2019 10:35:02 -0700 (PDT) CC: 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: F38428C122 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.972,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, 13 May 2019 17:35:13 -0000 > Author: markj > Date: Mon May 13 16:38:48 2019 > New Revision: 347532 > URL: https://svnweb.freebsd.org/changeset/base/347532 > > Log: > Provide separate accounting for user-wired pages. > > Historically we have not distinguished between kernel wirings and user > wirings for accounting purposes. User wirings (via mlock(2)) were > subject to a global limit on the number of wired pages, so if large > swaths of physical memory were wired by the kernel, as happens with > the ZFS ARC among other things, the limit could be exceeded, causing > user wirings to fail. > > The change adds a new counter, v_user_wire_count, which counts the > number of virtual pages wired by user processes via mlock(2) and > mlockall(2). Only user-wired pages are subject to the system-wide > limit which helps provide some safety against deadlocks. In > particular, while sources of kernel wirings typically support some > backpressure mechanism, there is no way to reclaim user-wired pages > shorting of killing the wiring process. The limit is exported as > vm.max_user_wired, renamed from vm.max_wired, and changed from u_int > to u_long. > > The choice to count virtual user-wired pages rather than physical > pages was done for simplicity. There are mechanisms that can cause > user-wired mappings to be destroyed while maintaining a wiring of > the backing physical page; these make it difficult to accurately > track user wirings at the physical page layer. > > The change also closes some holes which allowed user wirings to succeed > even when they would cause the system limit to be exceeded. For > instance, mmap() may now fail with ENOMEM in a process that has called > mlockall(MCL_FUTURE) if the new mapping would cause the user wiring > limit to be exceeded. > > Note that bhyve -S is subject to the user wiring limit, which defaults > to 1/3 of physical RAM. Users that wish to exceed the limit must tune > vm.max_user_wired. Because of that this should probably have a: Release Notes: Yes > Reviewed by: kib, ngie (mlock() test changes) > Tested by: pho (earlier version) > MFC after: 45 days > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D19908 > > Modified: > head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c > head/lib/libc/sys/mlock.2 > head/lib/libc/sys/mlockall.2 > head/lib/libc/tests/sys/mlock_helper.c > head/sys/amd64/vmm/vmm.c > head/sys/sys/vmmeter.h > head/sys/vm/vm_glue.c > head/sys/vm/vm_map.c > head/sys/vm/vm_map.h > head/sys/vm/vm_meter.c > head/sys/vm/vm_mmap.c > head/sys/vm/vm_pageout.c > head/sys/vm/vm_pageout.h > head/sys/vm/vm_unix.c > head/usr.bin/vmstat/vmstat.c > > Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c > ============================================================================== > --- head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Mon May 13 15:39:54 2019 (r347531) > +++ head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Mon May 13 16:38:48 2019 (r347532) > @@ -51,7 +51,7 @@ __RCSID("$NetBSD: t_mlock.c,v 1.6 2016/08/09 12:02:44 > #define _KMEMUSER > #include > > -void set_vm_max_wired(int); > +void set_vm_max_wired(u_long); > void restore_vm_max_wired(void); > #endif > > > Modified: head/lib/libc/sys/mlock.2 > ============================================================================== > --- head/lib/libc/sys/mlock.2 Mon May 13 15:39:54 2019 (r347531) > +++ head/lib/libc/sys/mlock.2 Mon May 13 16:38:48 2019 (r347532) > @@ -28,7 +28,7 @@ > .\" @(#)mlock.2 8.2 (Berkeley) 12/11/93 > .\" $FreeBSD$ > .\" > -.Dd March 20, 2018 > +.Dd May 13, 2019 > .Dt MLOCK 2 > .Os > .Sh NAME > @@ -97,13 +97,13 @@ resource limit and the > system-wide > .Dq wired pages > limit > -.Va vm.max_wired . > -.Va vm.max_wired > +.Va vm.max_user_wired . > +.Va vm.max_user_wired > applies to the system as a whole, so the amount available to a single > process at any given time is the difference between > -.Va vm.max_wired > +.Va vm.max_user_wired > and > -.Va vm.stats.vm.v_wire_count . > +.Va vm.stats.vm.v_user_wire_count . > .Pp > If > .Va security.bsd.unprivileged_mlock > @@ -124,13 +124,11 @@ will fail if: > is set to 0 and the caller is not the super-user. > .It Bq Er EINVAL > The address range given wraps around zero. > -.It Bq Er EAGAIN > -Locking the indicated range would exceed the system limit for locked memory. > .It Bq Er ENOMEM > Some portion of the indicated address range is not allocated. > There was an error faulting/mapping a page. > -Locking the indicated range would exceed the per-process limit for locked > -memory. > +Locking the indicated range would exceed the per-process or system-wide limits > +for locked memory. > .El > The > .Fn munlock > @@ -171,11 +169,11 @@ system calls first appeared in > Allocating too much wired memory can lead to a memory-allocation deadlock > which requires a reboot to recover from. > .Pp > -The per-process resource limit is a limit on the amount of virtual > -memory locked, while the system-wide limit is for the number of locked > -physical pages. > -Hence a process with two distinct locked mappings of the same physical page > -counts as 2 pages against the per-process limit and as only a single page > -in the system limit. > +The per-process and system-wide resource limits of locked memory apply > +to the amount of virtual memory locked, not the amount of locked physical > +pages. > +Hence two distinct locked mappings of the same physical page counts as > +2 pages aginst the system limit, and also against the per-process limit > +if both mappings belong to the same physical map. > .Pp > The per-process resource limit is not currently supported. > > Modified: head/lib/libc/sys/mlockall.2 > ============================================================================== > --- head/lib/libc/sys/mlockall.2 Mon May 13 15:39:54 2019 (r347531) > +++ head/lib/libc/sys/mlockall.2 Mon May 13 16:38:48 2019 (r347532) > @@ -30,7 +30,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd December 25, 2012 > +.Dd May 13, 2019 > .Dt MLOCKALL 2 > .Os > .Sh NAME > @@ -69,7 +69,7 @@ limited in how much they can lock down. > A single process can lock the minimum of a system-wide > .Dq wired pages > limit > -.Va vm.max_wired > +.Va vm.max_user_wired > and the per-process > .Dv RLIMIT_MEMLOCK > resource limit. > @@ -138,9 +138,9 @@ and > functions first appeared in > .Fx 5.1 . > .Sh BUGS > -The per-process resource limit is a limit on the amount of virtual > -memory locked, while the system-wide limit is for the number of locked > -physical pages. > -Hence a process with two distinct locked mappings of the same physical page > -counts as 2 pages against the per-process limit and as only a single page > -in the system limit. > +The per-process and system-wide resource limits of locked memory apply > +to the amount of virtual memory locked, not the amount of locked physical > +pages. > +Hence two distinct locked mappings of the same physical page counts as > +2 pages aginst the system limit, and also against the per-process limit > +if both mappings belong to the same physical map. > > Modified: head/lib/libc/tests/sys/mlock_helper.c > ============================================================================== > --- head/lib/libc/tests/sys/mlock_helper.c Mon May 13 15:39:54 2019 (r347531) > +++ head/lib/libc/tests/sys/mlock_helper.c Mon May 13 16:38:48 2019 (r347532) > @@ -39,16 +39,16 @@ __FBSDID("$FreeBSD$"); > #include > #include > > -#define VM_MAX_WIRED "vm.max_wired" > +#define VM_MAX_WIRED "vm.max_user_wired" > > static void > -vm_max_wired_sysctl(int *old_value, int *new_value) > +vm_max_wired_sysctl(u_long *old_value, u_long *new_value) > { > size_t old_len; > - size_t new_len = (new_value == NULL ? 0 : sizeof(int)); > + size_t new_len = (new_value == NULL ? 0 : sizeof(*new_value)); > > if (old_value == NULL) > - printf("Setting the new value to %d\n", *new_value); > + printf("Setting the new value to %lu\n", *new_value); > else { > ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, NULL, &old_len, > new_value, new_len) == 0, > @@ -60,14 +60,14 @@ vm_max_wired_sysctl(int *old_value, int *new_value) > "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno)); > > if (old_value != NULL) > - printf("Saved the old value (%d)\n", *old_value); > + printf("Saved the old value (%lu)\n", *old_value); > } > > void > -set_vm_max_wired(int new_value) > +set_vm_max_wired(u_long new_value) > { > FILE *fp; > - int old_value; > + u_long old_value; > > fp = fopen(VM_MAX_WIRED, "w"); > if (fp == NULL) { > @@ -78,7 +78,7 @@ set_vm_max_wired(int new_value) > > vm_max_wired_sysctl(&old_value, NULL); > > - ATF_REQUIRE_MSG(fprintf(fp, "%d", old_value) > 0, > + ATF_REQUIRE_MSG(fprintf(fp, "%lu", old_value) > 0, > "saving %s failed", VM_MAX_WIRED); > > fclose(fp); > @@ -90,7 +90,7 @@ void > restore_vm_max_wired(void) > { > FILE *fp; > - int saved_max_wired; > + u_long saved_max_wired; > > fp = fopen(VM_MAX_WIRED, "r"); > if (fp == NULL) { > @@ -98,14 +98,14 @@ restore_vm_max_wired(void) > return; > } > > - if (fscanf(fp, "%d", &saved_max_wired) != 1) { > + if (fscanf(fp, "%lu", &saved_max_wired) != 1) { > perror("fscanf failed\n"); > fclose(fp); > return; > } > > fclose(fp); > - printf("old value in %s: %d\n", VM_MAX_WIRED, saved_max_wired); > + printf("old value in %s: %lu\n", VM_MAX_WIRED, saved_max_wired); > > if (saved_max_wired == 0) /* This will cripple the test host */ > return; > > Modified: head/sys/amd64/vmm/vmm.c > ============================================================================== > --- head/sys/amd64/vmm/vmm.c Mon May 13 15:39:54 2019 (r347531) > +++ head/sys/amd64/vmm/vmm.c Mon May 13 16:38:48 2019 (r347532) > @@ -754,7 +754,8 @@ vm_mmap_memseg(struct vm *vm, vm_paddr_t gpa, int segi > VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); > if (error != KERN_SUCCESS) { > vm_map_remove(&vm->vmspace->vm_map, gpa, gpa + len); > - return (EFAULT); > + return (error == KERN_RESOURCE_SHORTAGE ? ENOMEM : > + EFAULT); > } > } > > > Modified: head/sys/sys/vmmeter.h > ============================================================================== > --- head/sys/sys/vmmeter.h Mon May 13 15:39:54 2019 (r347531) > +++ head/sys/sys/vmmeter.h Mon May 13 16:38:48 2019 (r347532) > @@ -153,6 +153,8 @@ extern domainset_t vm_severe_domains; > #define VM_CNT_INC(var) VM_CNT_ADD(var, 1) > #define VM_CNT_FETCH(var) counter_u64_fetch(vm_cnt.var) > > +extern u_long vm_user_wire_count; > + > static inline void > vm_wire_add(int cnt) > { > > Modified: head/sys/vm/vm_glue.c > ============================================================================== > --- head/sys/vm/vm_glue.c Mon May 13 15:39:54 2019 (r347531) > +++ head/sys/vm/vm_glue.c Mon May 13 16:38:48 2019 (r347532) > @@ -181,21 +181,8 @@ vslock(void *addr, size_t len) > if (last < (vm_offset_t)addr || end < (vm_offset_t)addr) > return (EINVAL); > npages = atop(end - start); > - if (npages > vm_page_max_wired) > + if (npages > vm_page_max_user_wired) > return (ENOMEM); > -#if 0 > - /* > - * XXX - not yet > - * > - * The limit for transient usage of wired pages should be > - * larger than for "permanent" wired pages (mlock()). > - * > - * Also, the sysctl code, which is the only present user > - * of vslock(), does a hard loop on EAGAIN. > - */ > - if (npages + vm_wire_count() > vm_page_max_wired) > - return (EAGAIN); > -#endif > error = vm_map_wire(&curproc->p_vmspace->vm_map, start, end, > VM_MAP_WIRE_SYSTEM | VM_MAP_WIRE_NOHOLES); > if (error == KERN_SUCCESS) { > > Modified: head/sys/vm/vm_map.c > ============================================================================== > --- head/sys/vm/vm_map.c Mon May 13 15:39:54 2019 (r347531) > +++ head/sys/vm/vm_map.c Mon May 13 16:38:48 2019 (r347532) > @@ -90,6 +90,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -2917,12 +2918,12 @@ done: > > if (rv == KERN_SUCCESS && (!user_unwire || > (entry->eflags & MAP_ENTRY_USER_WIRED))) { > - if (user_unwire) > - entry->eflags &= ~MAP_ENTRY_USER_WIRED; > if (entry->wired_count == 1) > vm_map_entry_unwire(map, entry); > else > entry->wired_count--; > + if (user_unwire) > + entry->eflags &= ~MAP_ENTRY_USER_WIRED; > } > KASSERT((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0, > ("vm_map_unwire: in-transition flag missing %p", entry)); > @@ -2942,6 +2943,28 @@ done: > return (rv); > } > > +static void > +vm_map_wire_user_count_sub(u_long npages) > +{ > + > + atomic_subtract_long(&vm_user_wire_count, npages); > +} > + > +static bool > +vm_map_wire_user_count_add(u_long npages) > +{ > + u_long wired; > + > + wired = vm_user_wire_count; > + do { > + if (npages + wired > vm_page_max_user_wired) > + return (false); > + } while (!atomic_fcmpset_long(&vm_user_wire_count, &wired, > + npages + wired)); > + > + return (true); > +} > + > /* > * vm_map_wire_entry_failure: > * > @@ -2978,37 +3001,49 @@ vm_map_wire_entry_failure(vm_map_t map, vm_map_entry_t > entry->wired_count = -1; > } > > +int > +vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags) > +{ > + int rv; > + > + vm_map_lock(map); > + rv = vm_map_wire_locked(map, start, end, flags); > + vm_map_unlock(map); > + return (rv); > +} > + > + > /* > - * vm_map_wire: > + * vm_map_wire_locked: > * > - * Implements both kernel and user wiring. > + * Implements both kernel and user wiring. Returns with the map locked, > + * the map lock may be dropped. > */ > int > -vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, > - int flags) > +vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags) > { > vm_map_entry_t entry, first_entry, tmp_entry; > vm_offset_t faddr, saved_end, saved_start; > - unsigned int last_timestamp; > + u_long npages; > + u_int last_timestamp; > int rv; > boolean_t need_wakeup, result, user_wire; > vm_prot_t prot; > > + VM_MAP_ASSERT_LOCKED(map); > + > if (start == end) > return (KERN_SUCCESS); > prot = 0; > if (flags & VM_MAP_WIRE_WRITE) > prot |= VM_PROT_WRITE; > user_wire = (flags & VM_MAP_WIRE_USER) ? TRUE : FALSE; > - vm_map_lock(map); > VM_MAP_RANGE_CHECK(map, start, end); > if (!vm_map_lookup_entry(map, start, &first_entry)) { > if (flags & VM_MAP_WIRE_HOLESOK) > first_entry = first_entry->next; > - else { > - vm_map_unlock(map); > + else > return (KERN_INVALID_ADDRESS); > - } > } > last_timestamp = map->timestamp; > entry = first_entry; > @@ -3042,7 +3077,6 @@ vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset > /* > * first_entry has been deleted. > */ > - vm_map_unlock(map); > return (KERN_INVALID_ADDRESS); > } > end = saved_start; > @@ -3082,13 +3116,22 @@ vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset > } > if (entry->wired_count == 0) { > entry->wired_count++; > - saved_start = entry->start; > - saved_end = entry->end; > > + npages = atop(entry->end - entry->start); > + if (user_wire && !vm_map_wire_user_count_add(npages)) { > + vm_map_wire_entry_failure(map, entry, > + entry->start); > + end = entry->end; > + rv = KERN_RESOURCE_SHORTAGE; > + goto done; > + } > + > /* > * Release the map lock, relying on the in-transition > * mark. Mark the map busy for fork. > */ > + saved_start = entry->start; > + saved_end = entry->end; > vm_map_busy(map); > vm_map_unlock(map); > > @@ -3136,6 +3179,8 @@ vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset > last_timestamp = map->timestamp; > if (rv != KERN_SUCCESS) { > vm_map_wire_entry_failure(map, entry, faddr); > + if (user_wire) > + vm_map_wire_user_count_sub(npages); > end = entry->end; > goto done; > } > @@ -3201,9 +3246,12 @@ done: > * Undo the wiring. Wiring succeeded on this entry > * but failed on a later entry. > */ > - if (entry->wired_count == 1) > + if (entry->wired_count == 1) { > vm_map_entry_unwire(map, entry); > - else > + if (user_wire) > + vm_map_wire_user_count_sub( > + atop(entry->end - entry->start)); > + } else > entry->wired_count--; > } > next_entry_done: > @@ -3220,7 +3268,6 @@ done: > } > vm_map_simplify_entry(map, entry); > } > - vm_map_unlock(map); > if (need_wakeup) > vm_map_wakeup(map); > return (rv); > @@ -3338,13 +3385,18 @@ vm_map_sync( > static void > vm_map_entry_unwire(vm_map_t map, vm_map_entry_t entry) > { > + vm_size_t size; > > VM_MAP_ASSERT_LOCKED(map); > KASSERT(entry->wired_count > 0, > ("vm_map_entry_unwire: entry %p isn't wired", entry)); > + > + size = entry->end - entry->start; > + if ((entry->eflags & MAP_ENTRY_USER_WIRED) != 0) > + vm_map_wire_user_count_sub(atop(size)); > pmap_unwire(map->pmap, entry->start, entry->end); > - vm_object_unwire(entry->object.vm_object, entry->offset, entry->end - > - entry->start, PQ_ACTIVE); > + vm_object_unwire(entry->object.vm_object, entry->offset, size, > + PQ_ACTIVE); > entry->wired_count = 0; > } > > @@ -4311,12 +4363,11 @@ retry: > * Heed the MAP_WIREFUTURE flag if it was set for this process. > */ > if (rv == KERN_SUCCESS && (map->flags & MAP_WIREFUTURE) != 0) { > - vm_map_unlock(map); > - vm_map_wire(map, grow_start, grow_start + grow_amount, > + rv = vm_map_wire_locked(map, grow_start, > + grow_start + grow_amount, > VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); > - vm_map_lock_read(map); > - } else > - vm_map_lock_downgrade(map); > + } > + vm_map_lock_downgrade(map); > > out: > #ifdef RACCT > > Modified: head/sys/vm/vm_map.h > ============================================================================== > --- head/sys/vm/vm_map.h Mon May 13 15:39:54 2019 (r347531) > +++ head/sys/vm/vm_map.h Mon May 13 16:38:48 2019 (r347532) > @@ -422,7 +422,8 @@ int vm_map_madvise (vm_map_t, vm_offset_t, vm_offset_t > int vm_map_stack (vm_map_t, vm_offset_t, vm_size_t, vm_prot_t, vm_prot_t, int); > int vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offset_t end, > int flags); > -int vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, > +int vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags); > +int vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm_offset_t end, > int flags); > long vmspace_swap_count(struct vmspace *vmspace); > void vm_map_entry_set_vnode_text(vm_map_entry_t entry, bool add); > > Modified: head/sys/vm/vm_meter.c > ============================================================================== > --- head/sys/vm/vm_meter.c Mon May 13 15:39:54 2019 (r347531) > +++ head/sys/vm/vm_meter.c Mon May 13 16:38:48 2019 (r347532) > @@ -97,6 +97,8 @@ struct vmmeter __read_mostly vm_cnt = { > .v_wire_count = EARLY_COUNTER, > }; > > +u_long __exclusive_cache_line vm_user_wire_count; > + > static void > vmcounter_startup(void) > { > @@ -394,6 +396,8 @@ sysctl_handle_vmstat_proc(SYSCTL_HANDLER_ARGS) > > #define VM_STATS_UINT(var, descr) \ > SYSCTL_UINT(_vm_stats_vm, OID_AUTO, var, CTLFLAG_RD, &vm_cnt.var, 0, descr) > +#define VM_STATS_ULONG(var, descr) \ > + SYSCTL_ULONG(_vm_stats_vm, OID_AUTO, var, CTLFLAG_RD, &vm_cnt.var, 0, descr) > > VM_STATS_UINT(v_page_size, "Page size in bytes"); > VM_STATS_UINT(v_page_count, "Total number of pages in system"); > @@ -410,6 +414,9 @@ VM_STATS_PROC(v_laundry_count, "Pages eligible for lau > VM_STATS_UINT(v_pageout_free_min, "Min pages reserved for kernel"); > VM_STATS_UINT(v_interrupt_free_min, "Reserved pages for interrupt code"); > VM_STATS_UINT(v_free_severe, "Severe page depletion point"); > + > +SYSCTL_ULONG(_vm_stats_vm, OID_AUTO, v_user_wire_count, CTLFLAG_RD, > + &vm_user_wire_count, 0, "User-wired virtual memory"); > > #ifdef COMPAT_FREEBSD11 > /* > > Modified: head/sys/vm/vm_mmap.c > ============================================================================== > --- head/sys/vm/vm_mmap.c Mon May 13 15:39:54 2019 (r347531) > +++ head/sys/vm/vm_mmap.c Mon May 13 16:38:48 2019 (r347532) > @@ -1003,7 +1003,7 @@ kern_mlock(struct proc *proc, struct ucred *cred, uint > if (last < addr || end < addr) > return (EINVAL); > npages = atop(end - start); > - if (npages > vm_page_max_wired) > + if (npages > vm_page_max_user_wired) > return (ENOMEM); > map = &proc->p_vmspace->vm_map; > PROC_LOCK(proc); > @@ -1013,8 +1013,6 @@ kern_mlock(struct proc *proc, struct ucred *cred, uint > return (ENOMEM); > } > PROC_UNLOCK(proc); > - if (npages + vm_wire_count() > vm_page_max_wired) > - return (EAGAIN); > #ifdef RACCT > if (racct_enable) { > PROC_LOCK(proc); > @@ -1091,7 +1089,12 @@ sys_mlockall(struct thread *td, struct mlockall_args * > */ > error = vm_map_wire(map, vm_map_min(map), vm_map_max(map), > VM_MAP_WIRE_USER|VM_MAP_WIRE_HOLESOK); > - error = (error == KERN_SUCCESS ? 0 : EAGAIN); > + if (error == KERN_SUCCESS) > + error = 0; > + else if (error == KERN_RESOURCE_SHORTAGE) > + error = ENOMEM; > + else > + error = EAGAIN; > } > #ifdef RACCT > if (racct_enable && error != KERN_SUCCESS) { > @@ -1558,10 +1561,16 @@ vm_mmap_object(vm_map_t map, vm_offset_t *addr, vm_siz > * If the process has requested that all future mappings > * be wired, then heed this. > */ > - if (map->flags & MAP_WIREFUTURE) { > - vm_map_wire(map, *addr, *addr + size, > - VM_MAP_WIRE_USER | ((flags & MAP_STACK) ? > - VM_MAP_WIRE_HOLESOK : VM_MAP_WIRE_NOHOLES)); > + if ((map->flags & MAP_WIREFUTURE) != 0) { > + vm_map_lock(map); > + if ((map->flags & MAP_WIREFUTURE) != 0) > + rv = vm_map_wire_locked(map, *addr, > + *addr + size, VM_MAP_WIRE_USER | > + ((flags & MAP_STACK) ? VM_MAP_WIRE_HOLESOK : > + VM_MAP_WIRE_NOHOLES)); > + if (rv != KERN_SUCCESS) > + (void)vm_map_delete(map, *addr, *addr + size); > + vm_map_unlock(map); > } > } > return (vm_mmap_to_errno(rv)); > > Modified: head/sys/vm/vm_pageout.c > ============================================================================== > --- head/sys/vm/vm_pageout.c Mon May 13 15:39:54 2019 (r347531) > +++ head/sys/vm/vm_pageout.c Mon May 13 16:38:48 2019 (r347532) > @@ -194,9 +194,10 @@ SYSCTL_UINT(_vm, OID_AUTO, background_launder_max, CTL > > int vm_pageout_page_count = 32; > > -int vm_page_max_wired; /* XXX max # of wired pages system-wide */ > -SYSCTL_INT(_vm, OID_AUTO, max_wired, > - CTLFLAG_RW, &vm_page_max_wired, 0, "System-wide limit to wired page count"); > +u_long vm_page_max_user_wired; > +SYSCTL_ULONG(_vm, OID_AUTO, max_user_wired, CTLFLAG_RW, > + &vm_page_max_user_wired, 0, > + "system-wide limit to user-wired page count"); > > static u_int isqrt(u_int num); > static int vm_pageout_launder(struct vm_domain *vmd, int launder, > @@ -2041,8 +2042,8 @@ vm_pageout_init(void) > if (vm_pageout_update_period == 0) > vm_pageout_update_period = 600; > > - if (vm_page_max_wired == 0) > - vm_page_max_wired = freecount / 3; > + if (vm_page_max_user_wired == 0) > + vm_page_max_user_wired = freecount / 3; > } > > /* > > Modified: head/sys/vm/vm_pageout.h > ============================================================================== > --- head/sys/vm/vm_pageout.h Mon May 13 15:39:54 2019 (r347531) > +++ head/sys/vm/vm_pageout.h Mon May 13 16:38:48 2019 (r347532) > @@ -75,7 +75,7 @@ > * Exported data structures. > */ > > -extern int vm_page_max_wired; > +extern u_long vm_page_max_user_wired; > extern int vm_pageout_page_count; > > #define VM_OOM_MEM 1 > > Modified: head/sys/vm/vm_unix.c > ============================================================================== > --- head/sys/vm/vm_unix.c Mon May 13 15:39:54 2019 (r347531) > +++ head/sys/vm/vm_unix.c Mon May 13 16:38:48 2019 (r347532) > @@ -95,13 +95,11 @@ kern_break(struct thread *td, uintptr_t *addr) > rlim_t datalim, lmemlim, vmemlim; > int prot, rv; > int error = 0; > - boolean_t do_map_wirefuture; > > datalim = lim_cur(td, RLIMIT_DATA); > lmemlim = lim_cur(td, RLIMIT_MEMLOCK); > vmemlim = lim_cur(td, RLIMIT_VMEM); > > - do_map_wirefuture = FALSE; > new = round_page(*addr); > vm_map_lock(map); > > @@ -184,7 +182,14 @@ kern_break(struct thread *td, uintptr_t *addr) > if (i386_read_exec && SV_PROC_FLAG(td->td_proc, SV_ILP32)) > prot |= VM_PROT_EXECUTE; > #endif > - rv = vm_map_insert(map, NULL, 0, old, new, prot, VM_PROT_ALL, 0); > + rv = vm_map_insert(map, NULL, 0, old, new, prot, VM_PROT_ALL, > + 0); > + if (rv == KERN_SUCCESS && (map->flags & MAP_WIREFUTURE) != 0) { > + rv = vm_map_wire_locked(map, old, new, > + VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); > + if (rv != KERN_SUCCESS) > + vm_map_delete(map, old, new); > + } > if (rv != KERN_SUCCESS) { > #ifdef RACCT > if (racct_enable) { > @@ -205,17 +210,6 @@ kern_break(struct thread *td, uintptr_t *addr) > goto done; > } > vm->vm_dsize += btoc(new - old); > - /* > - * Handle the MAP_WIREFUTURE case for legacy applications, > - * by marking the newly mapped range of pages as wired. > - * We are not required to perform a corresponding > - * vm_map_unwire() before vm_map_delete() below, as > - * it will forcibly unwire the pages in the range. > - * > - * XXX If the pages cannot be wired, no error is returned. > - */ > - if ((map->flags & MAP_WIREFUTURE) == MAP_WIREFUTURE) > - do_map_wirefuture = TRUE; > } else if (new < old) { > rv = vm_map_delete(map, new, old); > if (rv != KERN_SUCCESS) { > @@ -238,10 +232,6 @@ kern_break(struct thread *td, uintptr_t *addr) > } > done: > vm_map_unlock(map); > - > - if (do_map_wirefuture) > - (void) vm_map_wire(map, old, new, > - VM_MAP_WIRE_USER|VM_MAP_WIRE_NOHOLES); > > if (error == 0) > *addr = new; > > Modified: head/usr.bin/vmstat/vmstat.c > ============================================================================== > --- head/usr.bin/vmstat/vmstat.c Mon May 13 15:39:54 2019 (r347531) > +++ head/usr.bin/vmstat/vmstat.c Mon May 13 16:38:48 2019 (r347532) > @@ -156,6 +156,7 @@ static struct __vmmeter { > u_int v_free_min; > u_int v_free_count; > u_int v_wire_count; > + u_long v_user_wire_count; > u_int v_active_count; > u_int v_inactive_target; > u_int v_inactive_count; > @@ -566,6 +567,7 @@ fill_vmmeter(struct __vmmeter *vmmp) > GET_VM_STATS(vm, v_free_min); > GET_VM_STATS(vm, v_free_count); > GET_VM_STATS(vm, v_wire_count); > + GET_VM_STATS(vm, v_user_wire_count); > GET_VM_STATS(vm, v_active_count); > GET_VM_STATS(vm, v_inactive_target); > GET_VM_STATS(vm, v_inactive_count); > @@ -1057,6 +1059,8 @@ dosum(void) > sum.v_laundry_count); > xo_emit("{:wired-pages/%9u} {N:pages wired down}\n", > sum.v_wire_count); > + xo_emit("{:virtual-user-wired-pages/%9lu} {N:virtual user pages wired " > + "down}\n", sum.v_user_wire_count); > xo_emit("{:free-pages/%9u} {N:pages free}\n", > sum.v_free_count); > xo_emit("{:bytes-per-page/%9u} {N:bytes per page}\n", sum.v_page_size); > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon May 13 17:41:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAEBA15965F7; Mon, 13 May 2019 17:41:46 +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 B4DC18C547; Mon, 13 May 2019 17:41:45 +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 x4DHfhmg042305; Mon, 13 May 2019 10:41:43 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4DHfh2G042304; Mon, 13 May 2019 10:41:43 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905131741.x4DHfh2G042304@gndrsh.dnsmgr.net> Subject: Re: svn commit: r347532 - in head: contrib/netbsd-tests/lib/libc/sys lib/libc/sys lib/libc/tests/sys sys/amd64/vmm sys/sys sys/vm usr.bin/vmstat In-Reply-To: <201905131735.x4DHZ2BS042282@gndrsh.dnsmgr.net> To: rgrimes@freebsd.org Date: Mon, 13 May 2019 10:41:43 -0700 (PDT) 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: B4DC18C547 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,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, 13 May 2019 17:41:47 -0000 > > Author: markj > > Date: Mon May 13 16:38:48 2019 > > New Revision: 347532 > > URL: https://svnweb.freebsd.org/changeset/base/347532 > > > > Log: > > Provide separate accounting for user-wired pages. > > > > Historically we have not distinguished between kernel wirings and user > > wirings for accounting purposes. User wirings (via mlock(2)) were > > subject to a global limit on the number of wired pages, so if large > > swaths of physical memory were wired by the kernel, as happens with > > the ZFS ARC among other things, the limit could be exceeded, causing > > user wirings to fail. > > > > The change adds a new counter, v_user_wire_count, which counts the > > number of virtual pages wired by user processes via mlock(2) and > > mlockall(2). Only user-wired pages are subject to the system-wide > > limit which helps provide some safety against deadlocks. In > > particular, while sources of kernel wirings typically support some > > backpressure mechanism, there is no way to reclaim user-wired pages > > shorting of killing the wiring process. The limit is exported as > > vm.max_user_wired, renamed from vm.max_wired, and changed from u_int > > to u_long. > > > > The choice to count virtual user-wired pages rather than physical > > pages was done for simplicity. There are mechanisms that can cause > > user-wired mappings to be destroyed while maintaining a wiring of > > the backing physical page; these make it difficult to accurately > > track user wirings at the physical page layer. > > > > The change also closes some holes which allowed user wirings to succeed > > even when they would cause the system limit to be exceeded. For > > instance, mmap() may now fail with ENOMEM in a process that has called > > mlockall(MCL_FUTURE) if the new mapping would cause the user wiring > > limit to be exceeded. > > > > Note that bhyve -S is subject to the user wiring limit, which defaults > > to 1/3 of physical RAM. Users that wish to exceed the limit must tune > > vm.max_user_wired. > > Because of that this should probably have a: > Release Notes: Yes And probably an UPDATING entry since this may cause some -head users VM's to fall over on a update/reboot. > > Reviewed by: kib, ngie (mlock() test changes) > > Tested by: pho (earlier version) > > MFC after: 45 days > > Sponsored by: Netflix > > Differential Revision: https://reviews.freebsd.org/D19908 > > > > Modified: > > head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c > > head/lib/libc/sys/mlock.2 > > head/lib/libc/sys/mlockall.2 > > head/lib/libc/tests/sys/mlock_helper.c > > head/sys/amd64/vmm/vmm.c > > head/sys/sys/vmmeter.h > > head/sys/vm/vm_glue.c > > head/sys/vm/vm_map.c > > head/sys/vm/vm_map.h > > head/sys/vm/vm_meter.c > > head/sys/vm/vm_mmap.c > > head/sys/vm/vm_pageout.c > > head/sys/vm/vm_pageout.h > > head/sys/vm/vm_unix.c > > head/usr.bin/vmstat/vmstat.c > > > > Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c > > ============================================================================== > > --- head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Mon May 13 15:39:54 2019 (r347531) > > +++ head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Mon May 13 16:38:48 2019 (r347532) > > @@ -51,7 +51,7 @@ __RCSID("$NetBSD: t_mlock.c,v 1.6 2016/08/09 12:02:44 > > #define _KMEMUSER > > #include > > > > -void set_vm_max_wired(int); > > +void set_vm_max_wired(u_long); > > void restore_vm_max_wired(void); > > #endif > > > > > > Modified: head/lib/libc/sys/mlock.2 > > ============================================================================== > > --- head/lib/libc/sys/mlock.2 Mon May 13 15:39:54 2019 (r347531) > > +++ head/lib/libc/sys/mlock.2 Mon May 13 16:38:48 2019 (r347532) > > @@ -28,7 +28,7 @@ > > .\" @(#)mlock.2 8.2 (Berkeley) 12/11/93 > > .\" $FreeBSD$ > > .\" > > -.Dd March 20, 2018 > > +.Dd May 13, 2019 > > .Dt MLOCK 2 > > .Os > > .Sh NAME > > @@ -97,13 +97,13 @@ resource limit and the > > system-wide > > .Dq wired pages > > limit > > -.Va vm.max_wired . > > -.Va vm.max_wired > > +.Va vm.max_user_wired . > > +.Va vm.max_user_wired > > applies to the system as a whole, so the amount available to a single > > process at any given time is the difference between > > -.Va vm.max_wired > > +.Va vm.max_user_wired > > and > > -.Va vm.stats.vm.v_wire_count . > > +.Va vm.stats.vm.v_user_wire_count . > > .Pp > > If > > .Va security.bsd.unprivileged_mlock > > @@ -124,13 +124,11 @@ will fail if: > > is set to 0 and the caller is not the super-user. > > .It Bq Er EINVAL > > The address range given wraps around zero. > > -.It Bq Er EAGAIN > > -Locking the indicated range would exceed the system limit for locked memory. > > .It Bq Er ENOMEM > > Some portion of the indicated address range is not allocated. > > There was an error faulting/mapping a page. > > -Locking the indicated range would exceed the per-process limit for locked > > -memory. > > +Locking the indicated range would exceed the per-process or system-wide limits > > +for locked memory. > > .El > > The > > .Fn munlock > > @@ -171,11 +169,11 @@ system calls first appeared in > > Allocating too much wired memory can lead to a memory-allocation deadlock > > which requires a reboot to recover from. > > .Pp > > -The per-process resource limit is a limit on the amount of virtual > > -memory locked, while the system-wide limit is for the number of locked > > -physical pages. > > -Hence a process with two distinct locked mappings of the same physical page > > -counts as 2 pages against the per-process limit and as only a single page > > -in the system limit. > > +The per-process and system-wide resource limits of locked memory apply > > +to the amount of virtual memory locked, not the amount of locked physical > > +pages. > > +Hence two distinct locked mappings of the same physical page counts as > > +2 pages aginst the system limit, and also against the per-process limit > > +if both mappings belong to the same physical map. > > .Pp > > The per-process resource limit is not currently supported. > > > > Modified: head/lib/libc/sys/mlockall.2 > > ============================================================================== > > --- head/lib/libc/sys/mlockall.2 Mon May 13 15:39:54 2019 (r347531) > > +++ head/lib/libc/sys/mlockall.2 Mon May 13 16:38:48 2019 (r347532) > > @@ -30,7 +30,7 @@ > > .\" > > .\" $FreeBSD$ > > .\" > > -.Dd December 25, 2012 > > +.Dd May 13, 2019 > > .Dt MLOCKALL 2 > > .Os > > .Sh NAME > > @@ -69,7 +69,7 @@ limited in how much they can lock down. > > A single process can lock the minimum of a system-wide > > .Dq wired pages > > limit > > -.Va vm.max_wired > > +.Va vm.max_user_wired > > and the per-process > > .Dv RLIMIT_MEMLOCK > > resource limit. > > @@ -138,9 +138,9 @@ and > > functions first appeared in > > .Fx 5.1 . > > .Sh BUGS > > -The per-process resource limit is a limit on the amount of virtual > > -memory locked, while the system-wide limit is for the number of locked > > -physical pages. > > -Hence a process with two distinct locked mappings of the same physical page > > -counts as 2 pages against the per-process limit and as only a single page > > -in the system limit. > > +The per-process and system-wide resource limits of locked memory apply > > +to the amount of virtual memory locked, not the amount of locked physical > > +pages. > > +Hence two distinct locked mappings of the same physical page counts as > > +2 pages aginst the system limit, and also against the per-process limit > > +if both mappings belong to the same physical map. > > > > Modified: head/lib/libc/tests/sys/mlock_helper.c > > ============================================================================== > > --- head/lib/libc/tests/sys/mlock_helper.c Mon May 13 15:39:54 2019 (r347531) > > +++ head/lib/libc/tests/sys/mlock_helper.c Mon May 13 16:38:48 2019 (r347532) > > @@ -39,16 +39,16 @@ __FBSDID("$FreeBSD$"); > > #include > > #include > > > > -#define VM_MAX_WIRED "vm.max_wired" > > +#define VM_MAX_WIRED "vm.max_user_wired" > > > > static void > > -vm_max_wired_sysctl(int *old_value, int *new_value) > > +vm_max_wired_sysctl(u_long *old_value, u_long *new_value) > > { > > size_t old_len; > > - size_t new_len = (new_value == NULL ? 0 : sizeof(int)); > > + size_t new_len = (new_value == NULL ? 0 : sizeof(*new_value)); > > > > if (old_value == NULL) > > - printf("Setting the new value to %d\n", *new_value); > > + printf("Setting the new value to %lu\n", *new_value); > > else { > > ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, NULL, &old_len, > > new_value, new_len) == 0, > > @@ -60,14 +60,14 @@ vm_max_wired_sysctl(int *old_value, int *new_value) > > "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno)); > > > > if (old_value != NULL) > > - printf("Saved the old value (%d)\n", *old_value); > > + printf("Saved the old value (%lu)\n", *old_value); > > } > > > > void > > -set_vm_max_wired(int new_value) > > +set_vm_max_wired(u_long new_value) > > { > > FILE *fp; > > - int old_value; > > + u_long old_value; > > > > fp = fopen(VM_MAX_WIRED, "w"); > > if (fp == NULL) { > > @@ -78,7 +78,7 @@ set_vm_max_wired(int new_value) > > > > vm_max_wired_sysctl(&old_value, NULL); > > > > - ATF_REQUIRE_MSG(fprintf(fp, "%d", old_value) > 0, > > + ATF_REQUIRE_MSG(fprintf(fp, "%lu", old_value) > 0, > > "saving %s failed", VM_MAX_WIRED); > > > > fclose(fp); > > @@ -90,7 +90,7 @@ void > > restore_vm_max_wired(void) > > { > > FILE *fp; > > - int saved_max_wired; > > + u_long saved_max_wired; > > > > fp = fopen(VM_MAX_WIRED, "r"); > > if (fp == NULL) { > > @@ -98,14 +98,14 @@ restore_vm_max_wired(void) > > return; > > } > > > > - if (fscanf(fp, "%d", &saved_max_wired) != 1) { > > + if (fscanf(fp, "%lu", &saved_max_wired) != 1) { > > perror("fscanf failed\n"); > > fclose(fp); > > return; > > } > > > > fclose(fp); > > - printf("old value in %s: %d\n", VM_MAX_WIRED, saved_max_wired); > > + printf("old value in %s: %lu\n", VM_MAX_WIRED, saved_max_wired); > > > > if (saved_max_wired == 0) /* This will cripple the test host */ > > return; > > > > Modified: head/sys/amd64/vmm/vmm.c > > ============================================================================== > > --- head/sys/amd64/vmm/vmm.c Mon May 13 15:39:54 2019 (r347531) > > +++ head/sys/amd64/vmm/vmm.c Mon May 13 16:38:48 2019 (r347532) > > @@ -754,7 +754,8 @@ vm_mmap_memseg(struct vm *vm, vm_paddr_t gpa, int segi > > VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); > > if (error != KERN_SUCCESS) { > > vm_map_remove(&vm->vmspace->vm_map, gpa, gpa + len); > > - return (EFAULT); > > + return (error == KERN_RESOURCE_SHORTAGE ? ENOMEM : > > + EFAULT); > > } > > } > > > > > > Modified: head/sys/sys/vmmeter.h > > ============================================================================== > > --- head/sys/sys/vmmeter.h Mon May 13 15:39:54 2019 (r347531) > > +++ head/sys/sys/vmmeter.h Mon May 13 16:38:48 2019 (r347532) > > @@ -153,6 +153,8 @@ extern domainset_t vm_severe_domains; > > #define VM_CNT_INC(var) VM_CNT_ADD(var, 1) > > #define VM_CNT_FETCH(var) counter_u64_fetch(vm_cnt.var) > > > > +extern u_long vm_user_wire_count; > > + > > static inline void > > vm_wire_add(int cnt) > > { > > > > Modified: head/sys/vm/vm_glue.c > > ============================================================================== > > --- head/sys/vm/vm_glue.c Mon May 13 15:39:54 2019 (r347531) > > +++ head/sys/vm/vm_glue.c Mon May 13 16:38:48 2019 (r347532) > > @@ -181,21 +181,8 @@ vslock(void *addr, size_t len) > > if (last < (vm_offset_t)addr || end < (vm_offset_t)addr) > > return (EINVAL); > > npages = atop(end - start); > > - if (npages > vm_page_max_wired) > > + if (npages > vm_page_max_user_wired) > > return (ENOMEM); > > -#if 0 > > - /* > > - * XXX - not yet > > - * > > - * The limit for transient usage of wired pages should be > > - * larger than for "permanent" wired pages (mlock()). > > - * > > - * Also, the sysctl code, which is the only present user > > - * of vslock(), does a hard loop on EAGAIN. > > - */ > > - if (npages + vm_wire_count() > vm_page_max_wired) > > - return (EAGAIN); > > -#endif > > error = vm_map_wire(&curproc->p_vmspace->vm_map, start, end, > > VM_MAP_WIRE_SYSTEM | VM_MAP_WIRE_NOHOLES); > > if (error == KERN_SUCCESS) { > > > > Modified: head/sys/vm/vm_map.c > > ============================================================================== > > --- head/sys/vm/vm_map.c Mon May 13 15:39:54 2019 (r347531) > > +++ head/sys/vm/vm_map.c Mon May 13 16:38:48 2019 (r347532) > > @@ -90,6 +90,7 @@ __FBSDID("$FreeBSD$"); > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -2917,12 +2918,12 @@ done: > > > > if (rv == KERN_SUCCESS && (!user_unwire || > > (entry->eflags & MAP_ENTRY_USER_WIRED))) { > > - if (user_unwire) > > - entry->eflags &= ~MAP_ENTRY_USER_WIRED; > > if (entry->wired_count == 1) > > vm_map_entry_unwire(map, entry); > > else > > entry->wired_count--; > > + if (user_unwire) > > + entry->eflags &= ~MAP_ENTRY_USER_WIRED; > > } > > KASSERT((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0, > > ("vm_map_unwire: in-transition flag missing %p", entry)); > > @@ -2942,6 +2943,28 @@ done: > > return (rv); > > } > > > > +static void > > +vm_map_wire_user_count_sub(u_long npages) > > +{ > > + > > + atomic_subtract_long(&vm_user_wire_count, npages); > > +} > > + > > +static bool > > +vm_map_wire_user_count_add(u_long npages) > > +{ > > + u_long wired; > > + > > + wired = vm_user_wire_count; > > + do { > > + if (npages + wired > vm_page_max_user_wired) > > + return (false); > > + } while (!atomic_fcmpset_long(&vm_user_wire_count, &wired, > > + npages + wired)); > > + > > + return (true); > > +} > > + > > /* > > * vm_map_wire_entry_failure: > > * > > @@ -2978,37 +3001,49 @@ vm_map_wire_entry_failure(vm_map_t map, vm_map_entry_t > > entry->wired_count = -1; > > } > > > > +int > > +vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags) > > +{ > > + int rv; > > + > > + vm_map_lock(map); > > + rv = vm_map_wire_locked(map, start, end, flags); > > + vm_map_unlock(map); > > + return (rv); > > +} > > + > > + > > /* > > - * vm_map_wire: > > + * vm_map_wire_locked: > > * > > - * Implements both kernel and user wiring. > > + * Implements both kernel and user wiring. Returns with the map locked, > > + * the map lock may be dropped. > > */ > > int > > -vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, > > - int flags) > > +vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags) > > { > > vm_map_entry_t entry, first_entry, tmp_entry; > > vm_offset_t faddr, saved_end, saved_start; > > - unsigned int last_timestamp; > > + u_long npages; > > + u_int last_timestamp; > > int rv; > > boolean_t need_wakeup, result, user_wire; > > vm_prot_t prot; > > > > + VM_MAP_ASSERT_LOCKED(map); > > + > > if (start == end) > > return (KERN_SUCCESS); > > prot = 0; > > if (flags & VM_MAP_WIRE_WRITE) > > prot |= VM_PROT_WRITE; > > user_wire = (flags & VM_MAP_WIRE_USER) ? TRUE : FALSE; > > - vm_map_lock(map); > > VM_MAP_RANGE_CHECK(map, start, end); > > if (!vm_map_lookup_entry(map, start, &first_entry)) { > > if (flags & VM_MAP_WIRE_HOLESOK) > > first_entry = first_entry->next; > > - else { > > - vm_map_unlock(map); > > + else > > return (KERN_INVALID_ADDRESS); > > - } > > } > > last_timestamp = map->timestamp; > > entry = first_entry; > > @@ -3042,7 +3077,6 @@ vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset > > /* > > * first_entry has been deleted. > > */ > > - vm_map_unlock(map); > > return (KERN_INVALID_ADDRESS); > > } > > end = saved_start; > > @@ -3082,13 +3116,22 @@ vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset > > } > > if (entry->wired_count == 0) { > > entry->wired_count++; > > - saved_start = entry->start; > > - saved_end = entry->end; > > > > + npages = atop(entry->end - entry->start); > > + if (user_wire && !vm_map_wire_user_count_add(npages)) { > > + vm_map_wire_entry_failure(map, entry, > > + entry->start); > > + end = entry->end; > > + rv = KERN_RESOURCE_SHORTAGE; > > + goto done; > > + } > > + > > /* > > * Release the map lock, relying on the in-transition > > * mark. Mark the map busy for fork. > > */ > > + saved_start = entry->start; > > + saved_end = entry->end; > > vm_map_busy(map); > > vm_map_unlock(map); > > > > @@ -3136,6 +3179,8 @@ vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset > > last_timestamp = map->timestamp; > > if (rv != KERN_SUCCESS) { > > vm_map_wire_entry_failure(map, entry, faddr); > > + if (user_wire) > > + vm_map_wire_user_count_sub(npages); > > end = entry->end; > > goto done; > > } > > @@ -3201,9 +3246,12 @@ done: > > * Undo the wiring. Wiring succeeded on this entry > > * but failed on a later entry. > > */ > > - if (entry->wired_count == 1) > > + if (entry->wired_count == 1) { > > vm_map_entry_unwire(map, entry); > > - else > > + if (user_wire) > > + vm_map_wire_user_count_sub( > > + atop(entry->end - entry->start)); > > + } else > > entry->wired_count--; > > } > > next_entry_done: > > @@ -3220,7 +3268,6 @@ done: > > } > > vm_map_simplify_entry(map, entry); > > } > > - vm_map_unlock(map); > > if (need_wakeup) > > vm_map_wakeup(map); > > return (rv); > > @@ -3338,13 +3385,18 @@ vm_map_sync( > > static void > > vm_map_entry_unwire(vm_map_t map, vm_map_entry_t entry) > > { > > + vm_size_t size; > > > > VM_MAP_ASSERT_LOCKED(map); > > KASSERT(entry->wired_count > 0, > > ("vm_map_entry_unwire: entry %p isn't wired", entry)); > > + > > + size = entry->end - entry->start; > > + if ((entry->eflags & MAP_ENTRY_USER_WIRED) != 0) > > + vm_map_wire_user_count_sub(atop(size)); > > pmap_unwire(map->pmap, entry->start, entry->end); > > - vm_object_unwire(entry->object.vm_object, entry->offset, entry->end - > > - entry->start, PQ_ACTIVE); > > + vm_object_unwire(entry->object.vm_object, entry->offset, size, > > + PQ_ACTIVE); > > entry->wired_count = 0; > > } > > > > @@ -4311,12 +4363,11 @@ retry: > > * Heed the MAP_WIREFUTURE flag if it was set for this process. > > */ > > if (rv == KERN_SUCCESS && (map->flags & MAP_WIREFUTURE) != 0) { > > - vm_map_unlock(map); > > - vm_map_wire(map, grow_start, grow_start + grow_amount, > > + rv = vm_map_wire_locked(map, grow_start, > > + grow_start + grow_amount, > > VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); > > - vm_map_lock_read(map); > > - } else > > - vm_map_lock_downgrade(map); > > + } > > + vm_map_lock_downgrade(map); > > > > out: > > #ifdef RACCT > > > > Modified: head/sys/vm/vm_map.h > > ============================================================================== > > --- head/sys/vm/vm_map.h Mon May 13 15:39:54 2019 (r347531) > > +++ head/sys/vm/vm_map.h Mon May 13 16:38:48 2019 (r347532) > > @@ -422,7 +422,8 @@ int vm_map_madvise (vm_map_t, vm_offset_t, vm_offset_t > > int vm_map_stack (vm_map_t, vm_offset_t, vm_size_t, vm_prot_t, vm_prot_t, int); > > int vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offset_t end, > > int flags); > > -int vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, > > +int vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, int flags); > > +int vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm_offset_t end, > > int flags); > > long vmspace_swap_count(struct vmspace *vmspace); > > void vm_map_entry_set_vnode_text(vm_map_entry_t entry, bool add); > > > > Modified: head/sys/vm/vm_meter.c > > ============================================================================== > > --- head/sys/vm/vm_meter.c Mon May 13 15:39:54 2019 (r347531) > > +++ head/sys/vm/vm_meter.c Mon May 13 16:38:48 2019 (r347532) > > @@ -97,6 +97,8 @@ struct vmmeter __read_mostly vm_cnt = { > > .v_wire_count = EARLY_COUNTER, > > }; > > > > +u_long __exclusive_cache_line vm_user_wire_count; > > + > > static void > > vmcounter_startup(void) > > { > > @@ -394,6 +396,8 @@ sysctl_handle_vmstat_proc(SYSCTL_HANDLER_ARGS) > > > > #define VM_STATS_UINT(var, descr) \ > > SYSCTL_UINT(_vm_stats_vm, OID_AUTO, var, CTLFLAG_RD, &vm_cnt.var, 0, descr) > > +#define VM_STATS_ULONG(var, descr) \ > > + SYSCTL_ULONG(_vm_stats_vm, OID_AUTO, var, CTLFLAG_RD, &vm_cnt.var, 0, descr) > > > > VM_STATS_UINT(v_page_size, "Page size in bytes"); > > VM_STATS_UINT(v_page_count, "Total number of pages in system"); > > @@ -410,6 +414,9 @@ VM_STATS_PROC(v_laundry_count, "Pages eligible for lau > > VM_STATS_UINT(v_pageout_free_min, "Min pages reserved for kernel"); > > VM_STATS_UINT(v_interrupt_free_min, "Reserved pages for interrupt code"); > > VM_STATS_UINT(v_free_severe, "Severe page depletion point"); > > + > > +SYSCTL_ULONG(_vm_stats_vm, OID_AUTO, v_user_wire_count, CTLFLAG_RD, > > + &vm_user_wire_count, 0, "User-wired virtual memory"); > > > > #ifdef COMPAT_FREEBSD11 > > /* > > > > Modified: head/sys/vm/vm_mmap.c > > ============================================================================== > > --- head/sys/vm/vm_mmap.c Mon May 13 15:39:54 2019 (r347531) > > +++ head/sys/vm/vm_mmap.c Mon May 13 16:38:48 2019 (r347532) > > @@ -1003,7 +1003,7 @@ kern_mlock(struct proc *proc, struct ucred *cred, uint > > if (last < addr || end < addr) > > return (EINVAL); > > npages = atop(end - start); > > - if (npages > vm_page_max_wired) > > + if (npages > vm_page_max_user_wired) > > return (ENOMEM); > > map = &proc->p_vmspace->vm_map; > > PROC_LOCK(proc); > > @@ -1013,8 +1013,6 @@ kern_mlock(struct proc *proc, struct ucred *cred, uint > > return (ENOMEM); > > } > > PROC_UNLOCK(proc); > > - if (npages + vm_wire_count() > vm_page_max_wired) > > - return (EAGAIN); > > #ifdef RACCT > > if (racct_enable) { > > PROC_LOCK(proc); > > @@ -1091,7 +1089,12 @@ sys_mlockall(struct thread *td, struct mlockall_args * > > */ > > error = vm_map_wire(map, vm_map_min(map), vm_map_max(map), > > VM_MAP_WIRE_USER|VM_MAP_WIRE_HOLESOK); > > - error = (error == KERN_SUCCESS ? 0 : EAGAIN); > > + if (error == KERN_SUCCESS) > > + error = 0; > > + else if (error == KERN_RESOURCE_SHORTAGE) > > + error = ENOMEM; > > + else > > + error = EAGAIN; > > } > > #ifdef RACCT > > if (racct_enable && error != KERN_SUCCESS) { > > @@ -1558,10 +1561,16 @@ vm_mmap_object(vm_map_t map, vm_offset_t *addr, vm_siz > > * If the process has requested that all future mappings > > * be wired, then heed this. > > */ > > - if (map->flags & MAP_WIREFUTURE) { > > - vm_map_wire(map, *addr, *addr + size, > > - VM_MAP_WIRE_USER | ((flags & MAP_STACK) ? > > - VM_MAP_WIRE_HOLESOK : VM_MAP_WIRE_NOHOLES)); > > + if ((map->flags & MAP_WIREFUTURE) != 0) { > > + vm_map_lock(map); > > + if ((map->flags & MAP_WIREFUTURE) != 0) > > + rv = vm_map_wire_locked(map, *addr, > > + *addr + size, VM_MAP_WIRE_USER | > > + ((flags & MAP_STACK) ? VM_MAP_WIRE_HOLESOK : > > + VM_MAP_WIRE_NOHOLES)); > > + if (rv != KERN_SUCCESS) > > + (void)vm_map_delete(map, *addr, *addr + size); > > + vm_map_unlock(map); > > } > > } > > return (vm_mmap_to_errno(rv)); > > > > Modified: head/sys/vm/vm_pageout.c > > ============================================================================== > > --- head/sys/vm/vm_pageout.c Mon May 13 15:39:54 2019 (r347531) > > +++ head/sys/vm/vm_pageout.c Mon May 13 16:38:48 2019 (r347532) > > @@ -194,9 +194,10 @@ SYSCTL_UINT(_vm, OID_AUTO, background_launder_max, CTL > > > > int vm_pageout_page_count = 32; > > > > -int vm_page_max_wired; /* XXX max # of wired pages system-wide */ > > -SYSCTL_INT(_vm, OID_AUTO, max_wired, > > - CTLFLAG_RW, &vm_page_max_wired, 0, "System-wide limit to wired page count"); > > +u_long vm_page_max_user_wired; > > +SYSCTL_ULONG(_vm, OID_AUTO, max_user_wired, CTLFLAG_RW, > > + &vm_page_max_user_wired, 0, > > + "system-wide limit to user-wired page count"); > > > > static u_int isqrt(u_int num); > > static int vm_pageout_launder(struct vm_domain *vmd, int launder, > > @@ -2041,8 +2042,8 @@ vm_pageout_init(void) > > if (vm_pageout_update_period == 0) > > vm_pageout_update_period = 600; > > > > - if (vm_page_max_wired == 0) > > - vm_page_max_wired = freecount / 3; > > + if (vm_page_max_user_wired == 0) > > + vm_page_max_user_wired = freecount / 3; > > } > > > > /* > > > > Modified: head/sys/vm/vm_pageout.h > > ============================================================================== > > --- head/sys/vm/vm_pageout.h Mon May 13 15:39:54 2019 (r347531) > > +++ head/sys/vm/vm_pageout.h Mon May 13 16:38:48 2019 (r347532) > > @@ -75,7 +75,7 @@ > > * Exported data structures. > > */ > > > > -extern int vm_page_max_wired; > > +extern u_long vm_page_max_user_wired; > > extern int vm_pageout_page_count; > > > > #define VM_OOM_MEM 1 > > > > Modified: head/sys/vm/vm_unix.c > > ============================================================================== > > --- head/sys/vm/vm_unix.c Mon May 13 15:39:54 2019 (r347531) > > +++ head/sys/vm/vm_unix.c Mon May 13 16:38:48 2019 (r347532) > > @@ -95,13 +95,11 @@ kern_break(struct thread *td, uintptr_t *addr) > > rlim_t datalim, lmemlim, vmemlim; > > int prot, rv; > > int error = 0; > > - boolean_t do_map_wirefuture; > > > > datalim = lim_cur(td, RLIMIT_DATA); > > lmemlim = lim_cur(td, RLIMIT_MEMLOCK); > > vmemlim = lim_cur(td, RLIMIT_VMEM); > > > > - do_map_wirefuture = FALSE; > > new = round_page(*addr); > > vm_map_lock(map); > > > > @@ -184,7 +182,14 @@ kern_break(struct thread *td, uintptr_t *addr) > > if (i386_read_exec && SV_PROC_FLAG(td->td_proc, SV_ILP32)) > > prot |= VM_PROT_EXECUTE; > > #endif > > - rv = vm_map_insert(map, NULL, 0, old, new, prot, VM_PROT_ALL, 0); > > + rv = vm_map_insert(map, NULL, 0, old, new, prot, VM_PROT_ALL, > > + 0); > > + if (rv == KERN_SUCCESS && (map->flags & MAP_WIREFUTURE) != 0) { > > + rv = vm_map_wire_locked(map, old, new, > > + VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); > > + if (rv != KERN_SUCCESS) > > + vm_map_delete(map, old, new); > > + } > > if (rv != KERN_SUCCESS) { > > #ifdef RACCT > > if (racct_enable) { > > @@ -205,17 +210,6 @@ kern_break(struct thread *td, uintptr_t *addr) > > goto done; > > } > > vm->vm_dsize += btoc(new - old); > > - /* > > - * Handle the MAP_WIREFUTURE case for legacy applications, > > - * by marking the newly mapped range of pages as wired. > > - * We are not required to perform a corresponding > > - * vm_map_unwire() before vm_map_delete() below, as > > - * it will forcibly unwire the pages in the range. > > - * > > - * XXX If the pages cannot be wired, no error is returned. > > - */ > > - if ((map->flags & MAP_WIREFUTURE) == MAP_WIREFUTURE) > > - do_map_wirefuture = TRUE; > > } else if (new < old) { > > rv = vm_map_delete(map, new, old); > > if (rv != KERN_SUCCESS) { > > @@ -238,10 +232,6 @@ kern_break(struct thread *td, uintptr_t *addr) > > } > > done: > > vm_map_unlock(map); > > - > > - if (do_map_wirefuture) > > - (void) vm_map_wire(map, old, new, > > - VM_MAP_WIRE_USER|VM_MAP_WIRE_NOHOLES); > > > > if (error == 0) > > *addr = new; > > > > Modified: head/usr.bin/vmstat/vmstat.c > > ============================================================================== > > --- head/usr.bin/vmstat/vmstat.c Mon May 13 15:39:54 2019 (r347531) > > +++ head/usr.bin/vmstat/vmstat.c Mon May 13 16:38:48 2019 (r347532) > > @@ -156,6 +156,7 @@ static struct __vmmeter { > > u_int v_free_min; > > u_int v_free_count; > > u_int v_wire_count; > > + u_long v_user_wire_count; > > u_int v_active_count; > > u_int v_inactive_target; > > u_int v_inactive_count; > > @@ -566,6 +567,7 @@ fill_vmmeter(struct __vmmeter *vmmp) > > GET_VM_STATS(vm, v_free_min); > > GET_VM_STATS(vm, v_free_count); > > GET_VM_STATS(vm, v_wire_count); > > + GET_VM_STATS(vm, v_user_wire_count); > > GET_VM_STATS(vm, v_active_count); > > GET_VM_STATS(vm, v_inactive_target); > > GET_VM_STATS(vm, v_inactive_count); > > @@ -1057,6 +1059,8 @@ dosum(void) > > sum.v_laundry_count); > > xo_emit("{:wired-pages/%9u} {N:pages wired down}\n", > > sum.v_wire_count); > > + xo_emit("{:virtual-user-wired-pages/%9lu} {N:virtual user pages wired " > > + "down}\n", sum.v_user_wire_count); > > xo_emit("{:free-pages/%9u} {N:pages free}\n", > > sum.v_free_count); > > xo_emit("{:bytes-per-page/%9u} {N:bytes per page}\n", sum.v_page_size); > > > > > > -- > Rod Grimes rgrimes@freebsd.org > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon May 13 17:48:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62B6B1596736; Mon, 13 May 2019 17:48:18 +0000 (UTC) (envelope-from dchagin@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 130AB8C772; Mon, 13 May 2019 17:48:18 +0000 (UTC) (envelope-from dchagin@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 DBD51D3E1; Mon, 13 May 2019 17:48:17 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4DHmHYF020450; Mon, 13 May 2019 17:48:17 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4DHmGaH020444; Mon, 13 May 2019 17:48:16 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905131748.x4DHmGaH020444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Mon, 13 May 2019 17:48:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347533 - in head/sys: compat/linux modules/linux_common X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in head/sys: compat/linux modules/linux_common X-SVN-Commit-Revision: 347533 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 130AB8C772 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Mon, 13 May 2019 17:48:18 -0000 Author: dchagin Date: Mon May 13 17:48:16 2019 New Revision: 347533 URL: https://svnweb.freebsd.org/changeset/base/347533 Log: Our bsd_to_linux_sockaddr() and linux_to_bsd_sockaddr() functions alter the userspace sockaddr to convert the format between linux and BSD versions. That's the minimum 3 of copyin/copyout operations for one syscall. Also some syscall uses linux_sa_put() and linux_getsockaddr() when load sockaddr to userspace or from userspace accordingly. To avoid this chaos, especially converting sockaddr in the userspace, rewrite these 4 functions to convert sockaddr only in kernel and leave only 2 of this functions. Also in order to reduce duplication between MD parts of the Linuxulator put struct sockaddr conversion functions that are MI out into linux_common module. PR: 232920 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20157 Modified: head/sys/compat/linux/linux.c head/sys/compat/linux/linux.h head/sys/compat/linux/linux_common.h head/sys/compat/linux/linux_socket.c head/sys/compat/linux/linux_socket.h head/sys/modules/linux_common/Makefile Modified: head/sys/compat/linux/linux.c ============================================================================== --- head/sys/compat/linux/linux.c Mon May 13 16:38:48 2019 (r347532) +++ head/sys/compat/linux/linux.c Mon May 13 17:48:16 2019 (r347533) @@ -27,21 +27,29 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include #include #include #include +#include #include #include +#include #include #include #include #include +#include +#include + #include #include +#include CTASSERT(LINUX_IFNAMSIZ == IFNAMSIZ); @@ -322,4 +330,194 @@ linux_ifhwaddr(struct ifnet *ifp, struct l_sockaddr *l } return (ENOENT); +} + +int +linux_to_bsd_domain(int domain) +{ + + switch (domain) { + case LINUX_AF_UNSPEC: + return (AF_UNSPEC); + case LINUX_AF_UNIX: + return (AF_LOCAL); + case LINUX_AF_INET: + return (AF_INET); + case LINUX_AF_INET6: + return (AF_INET6); + case LINUX_AF_AX25: + return (AF_CCITT); + case LINUX_AF_IPX: + return (AF_IPX); + case LINUX_AF_APPLETALK: + return (AF_APPLETALK); + } + return (-1); +} + +int +bsd_to_linux_domain(int domain) +{ + + switch (domain) { + case AF_UNSPEC: + return (LINUX_AF_UNSPEC); + case AF_LOCAL: + return (LINUX_AF_UNIX); + case AF_INET: + return (LINUX_AF_INET); + case AF_INET6: + return (LINUX_AF_INET6); + case AF_CCITT: + return (LINUX_AF_AX25); + case AF_IPX: + return (LINUX_AF_IPX); + case AF_APPLETALK: + return (LINUX_AF_APPLETALK); + } + return (-1); +} + +/* + * Based on the fact that: + * 1. Native and Linux storage of struct sockaddr + * and struct sockaddr_in6 are equal. + * 2. On Linux sa_family is the first member of all struct sockaddr. + */ +int +bsd_to_linux_sockaddr(const struct sockaddr *sa, struct l_sockaddr **lsa, + socklen_t len) +{ + struct l_sockaddr *kosa; + int error, bdom; + + *lsa = NULL; + if (len < 2 || len > UCHAR_MAX) + return (EINVAL); + + kosa = malloc(len, M_SONAME, M_WAITOK); + bcopy(sa, kosa, len); + + bdom = bsd_to_linux_domain(sa->sa_family); + if (bdom == -1) { + error = EAFNOSUPPORT; + goto out; + } + + kosa->sa_family = bdom; + *lsa = kosa; + return (0); + +out: + free(kosa, M_SONAME); + return (error); +} + +int +linux_to_bsd_sockaddr(const struct l_sockaddr *osa, struct sockaddr **sap, + socklen_t *len) +{ + struct sockaddr *sa; + struct l_sockaddr *kosa; +#ifdef INET6 + struct sockaddr_in6 *sin6; + bool oldv6size; +#endif + char *name; + int salen, bdom, error, hdrlen, namelen; + + if (*len < 2 || *len > UCHAR_MAX) + return (EINVAL); + + salen = *len; + +#ifdef INET6 + oldv6size = false; + /* + * Check for old (pre-RFC2553) sockaddr_in6. We may accept it + * if it's a v4-mapped address, so reserve the proper space + * for it. + */ + if (salen == sizeof(struct sockaddr_in6) - sizeof(uint32_t)) { + salen += sizeof(uint32_t); + oldv6size = true; + } +#endif + + kosa = malloc(salen, M_SONAME, M_WAITOK); + + if ((error = copyin(osa, kosa, *len))) + goto out; + + bdom = linux_to_bsd_domain(kosa->sa_family); + if (bdom == -1) { + error = EAFNOSUPPORT; + goto out; + } + +#ifdef INET6 + /* + * Older Linux IPv6 code uses obsolete RFC2133 struct sockaddr_in6, + * which lacks the scope id compared with RFC2553 one. If we detect + * the situation, reject the address and write a message to system log. + * + * Still accept addresses for which the scope id is not used. + */ + if (oldv6size) { + if (bdom == AF_INET6) { + sin6 = (struct sockaddr_in6 *)kosa; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr) || + (!IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr) && + !IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr) && + !IN6_IS_ADDR_V4COMPAT(&sin6->sin6_addr) && + !IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) && + !IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))) { + sin6->sin6_scope_id = 0; + } else { + linux_msg(curthread, + "obsolete pre-RFC2553 sockaddr_in6 rejected\n"); + error = EINVAL; + goto out; + } + } else + salen -= sizeof(uint32_t); + } +#endif + if (bdom == AF_INET) { + if (salen < sizeof(struct sockaddr_in)) { + error = EINVAL; + goto out; + } + salen = sizeof(struct sockaddr_in); + } + + if (bdom == AF_LOCAL && salen > sizeof(struct sockaddr_un)) { + hdrlen = offsetof(struct sockaddr_un, sun_path); + name = ((struct sockaddr_un *)kosa)->sun_path; + if (*name == '\0') { + /* + * Linux abstract namespace starts with a NULL byte. + * XXX We do not support abstract namespace yet. + */ + namelen = strnlen(name + 1, salen - hdrlen - 1) + 1; + } else + namelen = strnlen(name, salen - hdrlen); + salen = hdrlen + namelen; + if (salen > sizeof(struct sockaddr_un)) { + error = ENAMETOOLONG; + goto out; + } + } + + sa = (struct sockaddr *)kosa; + sa->sa_family = bdom; + sa->sa_len = salen; + + *sap = sa; + *len = salen; + return (0); + +out: + free(kosa, M_SONAME); + return (error); } Modified: head/sys/compat/linux/linux.h ============================================================================== --- head/sys/compat/linux/linux.h Mon May 13 16:38:48 2019 (r347532) +++ head/sys/compat/linux/linux.h Mon May 13 17:48:16 2019 (r347533) @@ -47,6 +47,17 @@ struct l_sockaddr { #define LINUX_ARPHRD_LOOPBACK 772 /* + * Supported address families + */ +#define LINUX_AF_UNSPEC 0 +#define LINUX_AF_UNIX 1 +#define LINUX_AF_INET 2 +#define LINUX_AF_AX25 3 +#define LINUX_AF_IPX 4 +#define LINUX_AF_APPLETALK 5 +#define LINUX_AF_INET6 10 + +/* * net device flags */ #define LINUX_IFF_UP 0x0001 Modified: head/sys/compat/linux/linux_common.h ============================================================================== --- head/sys/compat/linux/linux_common.h Mon May 13 16:38:48 2019 (r347532) +++ head/sys/compat/linux/linux_common.h Mon May 13 17:48:16 2019 (r347533) @@ -35,4 +35,11 @@ struct ifnet *ifname_linux_to_bsd(struct thread *td, void linux_ifflags(struct ifnet *ifp, short *flags); int linux_ifhwaddr(struct ifnet *ifp, struct l_sockaddr *lsa); +int linux_to_bsd_domain(int domain); +int bsd_to_linux_domain(int domain); +int bsd_to_linux_sockaddr(const struct sockaddr *sa, + struct l_sockaddr **lsa, socklen_t len); +int linux_to_bsd_sockaddr(const struct l_sockaddr *lsa, + struct sockaddr **sap, socklen_t *len); + #endif /* _LINUX_COMMON_H_ */ Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Mon May 13 16:38:48 2019 (r347532) +++ head/sys/compat/linux/linux_socket.c Mon May 13 17:48:16 2019 (r347533) @@ -70,176 +70,20 @@ __FBSDID("$FreeBSD$"); #include #include #endif +#include #include #include #include #include -static int linux_to_bsd_domain(int); static int linux_sendmsg_common(struct thread *, l_int, struct l_msghdr *, l_uint); static int linux_recvmsg_common(struct thread *, l_int, struct l_msghdr *, l_uint, struct msghdr *); static int linux_set_socket_flags(int, int *); -/* - * Reads a Linux sockaddr and does any necessary translation. - * Linux sockaddrs don't have a length field, only a family. - * Copy the osockaddr structure pointed to by osa to kernel, adjust - * family and convert to sockaddr. - */ -static int -linux_getsockaddr(struct sockaddr **sap, const struct osockaddr *osa, int salen) -{ - struct sockaddr *sa; - struct osockaddr *kosa; -#ifdef INET6 - struct sockaddr_in6 *sin6; - int oldv6size; -#endif - char *name; - int bdom, error, hdrlen, namelen; - if (salen < 2 || salen > UCHAR_MAX || !osa) - return (EINVAL); - -#ifdef INET6 - oldv6size = 0; - /* - * Check for old (pre-RFC2553) sockaddr_in6. We may accept it - * if it's a v4-mapped address, so reserve the proper space - * for it. - */ - if (salen == sizeof(struct sockaddr_in6) - sizeof(uint32_t)) { - salen += sizeof(uint32_t); - oldv6size = 1; - } -#endif - - kosa = malloc(salen, M_SONAME, M_WAITOK); - - if ((error = copyin(osa, kosa, salen))) - goto out; - - bdom = linux_to_bsd_domain(kosa->sa_family); - if (bdom == -1) { - error = EAFNOSUPPORT; - goto out; - } - -#ifdef INET6 - /* - * Older Linux IPv6 code uses obsolete RFC2133 struct sockaddr_in6, - * which lacks the scope id compared with RFC2553 one. If we detect - * the situation, reject the address and write a message to system log. - * - * Still accept addresses for which the scope id is not used. - */ - if (oldv6size) { - if (bdom == AF_INET6) { - sin6 = (struct sockaddr_in6 *)kosa; - if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr) || - (!IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr) && - !IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr) && - !IN6_IS_ADDR_V4COMPAT(&sin6->sin6_addr) && - !IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) && - !IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))) { - sin6->sin6_scope_id = 0; - } else { - log(LOG_DEBUG, - "obsolete pre-RFC2553 sockaddr_in6 rejected\n"); - error = EINVAL; - goto out; - } - } else - salen -= sizeof(uint32_t); - } -#endif - if (bdom == AF_INET) { - if (salen < sizeof(struct sockaddr_in)) { - error = EINVAL; - goto out; - } - salen = sizeof(struct sockaddr_in); - } - - if (bdom == AF_LOCAL && salen > sizeof(struct sockaddr_un)) { - hdrlen = offsetof(struct sockaddr_un, sun_path); - name = ((struct sockaddr_un *)kosa)->sun_path; - if (*name == '\0') { - /* - * Linux abstract namespace starts with a NULL byte. - * XXX We do not support abstract namespace yet. - */ - namelen = strnlen(name + 1, salen - hdrlen - 1) + 1; - } else - namelen = strnlen(name, salen - hdrlen); - salen = hdrlen + namelen; - if (salen > sizeof(struct sockaddr_un)) { - error = ENAMETOOLONG; - goto out; - } - } - - sa = (struct sockaddr *)kosa; - sa->sa_family = bdom; - sa->sa_len = salen; - - *sap = sa; - return (0); - -out: - free(kosa, M_SONAME); - return (error); -} - static int -linux_to_bsd_domain(int domain) -{ - - switch (domain) { - case LINUX_AF_UNSPEC: - return (AF_UNSPEC); - case LINUX_AF_UNIX: - return (AF_LOCAL); - case LINUX_AF_INET: - return (AF_INET); - case LINUX_AF_INET6: - return (AF_INET6); - case LINUX_AF_AX25: - return (AF_CCITT); - case LINUX_AF_IPX: - return (AF_IPX); - case LINUX_AF_APPLETALK: - return (AF_APPLETALK); - } - return (-1); -} - -static int -bsd_to_linux_domain(int domain) -{ - - switch (domain) { - case AF_UNSPEC: - return (LINUX_AF_UNSPEC); - case AF_LOCAL: - return (LINUX_AF_UNIX); - case AF_INET: - return (LINUX_AF_INET); - case AF_INET6: - return (LINUX_AF_INET6); - case AF_CCITT: - return (LINUX_AF_AX25); - case AF_IPX: - return (LINUX_AF_IPX); - case AF_APPLETALK: - return (LINUX_AF_APPLETALK); - } - return (-1); -} - -static int linux_to_bsd_sockopt_level(int level) { @@ -451,72 +295,7 @@ linux_to_bsd_msg_flags(int flags) return (ret_flags); } -/* -* If bsd_to_linux_sockaddr() or linux_to_bsd_sockaddr() faults, then the -* native syscall will fault. Thus, we don't really need to check the -* return values for these functions. -*/ - static int -bsd_to_linux_sockaddr(struct sockaddr *arg) -{ - struct sockaddr sa; - size_t sa_len = sizeof(struct sockaddr); - int error, bdom; - - if ((error = copyin(arg, &sa, sa_len))) - return (error); - - bdom = bsd_to_linux_domain(sa.sa_family); - if (bdom == -1) - return (EAFNOSUPPORT); - - *(u_short *)&sa = bdom; - return (copyout(&sa, arg, sa_len)); -} - -static int -linux_to_bsd_sockaddr(struct sockaddr *arg, int len) -{ - struct sockaddr sa; - size_t sa_len = sizeof(struct sockaddr); - int error, bdom; - - if ((error = copyin(arg, &sa, sa_len))) - return (error); - - bdom = linux_to_bsd_domain(*(sa_family_t *)&sa); - if (bdom == -1) - return (EAFNOSUPPORT); - - sa.sa_family = bdom; - sa.sa_len = len; - return (copyout(&sa, arg, sa_len)); -} - -static int -linux_sa_put(struct osockaddr *osa) -{ - struct osockaddr sa; - int error, bdom; - - /* - * Only read/write the osockaddr family part, the rest is - * not changed. - */ - error = copyin(osa, &sa, sizeof(sa.sa_family)); - if (error != 0) - return (error); - - bdom = bsd_to_linux_domain(sa.sa_family); - if (bdom == -1) - return (EINVAL); - - sa.sa_family = bdom; - return (copyout(&sa, osa, sizeof(sa.sa_family))); -} - -static int linux_to_bsd_cmsg_type(int cmsg_type) { @@ -609,10 +388,11 @@ linux_sendit(struct thread *td, int s, struct msghdr * struct mbuf *control, enum uio_seg segflg) { struct sockaddr *to; - int error; + int error, len; if (mp->msg_name != NULL) { - error = linux_getsockaddr(&to, mp->msg_name, mp->msg_namelen); + len = mp->msg_namelen; + error = linux_to_bsd_sockaddr(mp->msg_name, &to, &len); if (error != 0) return (error); mp->msg_name = to; @@ -751,13 +531,15 @@ linux_bind(struct thread *td, struct linux_bind_args * struct sockaddr *sa; int error; - error = linux_getsockaddr(&sa, PTRIN(args->name), - args->namelen); + error = linux_to_bsd_sockaddr(PTRIN(args->name), &sa, + &args->namelen); if (error != 0) return (error); error = kern_bindat(td, AT_FDCWD, args->s, sa); free(sa, M_SONAME); + + /* XXX */ if (error == EADDRNOTAVAIL && args->namelen != sizeof(struct sockaddr_in)) return (EINVAL); return (error); @@ -772,8 +554,8 @@ linux_connect(struct thread *td, struct linux_connect_ u_int fflag; int error; - error = linux_getsockaddr(&sa, (struct osockaddr *)PTRIN(args->name), - args->namelen); + error = linux_to_bsd_sockaddr(PTRIN(args->name), &sa, + &args->namelen); if (error != 0) return (error); @@ -817,43 +599,67 @@ static int linux_accept_common(struct thread *td, int s, l_uintptr_t addr, l_uintptr_t namelen, int flags) { - struct accept4_args /* { - int s; - struct sockaddr * __restrict name; - socklen_t * __restrict anamelen; - int flags; - } */ bsd_args; - struct socket *so; + struct l_sockaddr *lsa; + struct sockaddr *sa; struct file *fp; + int bflags, len; + struct socket *so; int error, error1; - bsd_args.s = s; - bsd_args.name = (struct sockaddr * __restrict)PTRIN(addr); - bsd_args.anamelen = PTRIN(namelen); - bsd_args.flags = 0; - error = linux_set_socket_flags(flags, &bsd_args.flags); + bflags = 0; + error = linux_set_socket_flags(flags, &bflags); if (error != 0) return (error); - error = sys_accept4(td, &bsd_args); - bsd_to_linux_sockaddr((struct sockaddr *)bsd_args.name); + + sa = NULL; + if (PTRIN(addr) == NULL) { + len = 0; + error = kern_accept4(td, s, NULL, NULL, bflags, NULL); + } else { + error = copyin(PTRIN(namelen), &len, sizeof(len)); + if (error != 0) + return (error); + if (len < 0) + return (EINVAL); + error = kern_accept4(td, s, &sa, &len, bflags, &fp); + if (error == 0) + fdrop(fp, td); + } + if (error != 0) { + /* + * XXX. This is wrong, different sockaddr structures + * have different sizes. + */ if (error == EFAULT && namelen != sizeof(struct sockaddr_in)) - return (EINVAL); + { + error = EINVAL; + goto out; + } if (error == EINVAL) { error1 = getsock_cap(td, s, &cap_accept_rights, &fp, NULL, NULL); - if (error1 != 0) - return (error1); - so = fp->f_data; - if (so->so_type == SOCK_DGRAM) { - fdrop(fp, td); - return (EOPNOTSUPP); + if (error1 != 0) { + error = error1; + goto out; } + so = fp->f_data; + if (so->so_type == SOCK_DGRAM) + error = EOPNOTSUPP; fdrop(fp, td); } - return (error); + goto out; } - if (addr) - error = linux_sa_put(PTRIN(addr)); + + if (len != 0 && error == 0) { + error = bsd_to_linux_sockaddr(sa, &lsa, len); + if (error == 0) + error = copyout(lsa, PTRIN(addr), len); + free(lsa, M_SONAME); + } + + free(sa, M_SONAME); + +out: if (error != 0) { (void)kern_close(td, td->td_retval[0]); td->td_retval[0] = 0; @@ -880,41 +686,59 @@ linux_accept4(struct thread *td, struct linux_accept4_ int linux_getsockname(struct thread *td, struct linux_getsockname_args *args) { - struct getsockname_args /* { - int fdes; - struct sockaddr * __restrict asa; - socklen_t * __restrict alen; - } */ bsd_args; - int error; + struct l_sockaddr *lsa; + struct sockaddr *sa; + int len, error; - bsd_args.fdes = args->s; - bsd_args.asa = (struct sockaddr * __restrict)PTRIN(args->addr); - bsd_args.alen = PTRIN(args->namelen); - error = sys_getsockname(td, &bsd_args); - bsd_to_linux_sockaddr((struct sockaddr *)bsd_args.asa); + error = copyin(PTRIN(args->namelen), &len, sizeof(len)); if (error != 0) return (error); - return (linux_sa_put(PTRIN(args->addr))); + + error = kern_getsockname(td, args->s, &sa, &len); + if (error != 0) + return (error); + + if (len != 0) { + error = bsd_to_linux_sockaddr(sa, &lsa, len); + if (error == 0) + error = copyout(lsa, PTRIN(args->addr), + len); + free(lsa, M_SONAME); + } + + free(sa, M_SONAME); + if (error == 0) + error = copyout(&len, PTRIN(args->namelen), sizeof(len)); + return (error); } int linux_getpeername(struct thread *td, struct linux_getpeername_args *args) { - struct getpeername_args /* { - int fdes; - caddr_t asa; - int *alen; - } */ bsd_args; - int error; + struct l_sockaddr *lsa; + struct sockaddr *sa; + int len, error; - bsd_args.fdes = args->s; - bsd_args.asa = (struct sockaddr *)PTRIN(args->addr); - bsd_args.alen = (socklen_t *)PTRIN(args->namelen); - error = sys_getpeername(td, &bsd_args); - bsd_to_linux_sockaddr((struct sockaddr *)bsd_args.asa); + error = copyin(PTRIN(args->namelen), &len, sizeof(len)); if (error != 0) return (error); - return (linux_sa_put(PTRIN(args->addr))); + + error = kern_getpeername(td, args->s, &sa, &len); + if (error != 0) + return (error); + + if (len != 0) { + error = bsd_to_linux_sockaddr(sa, &lsa, len); + if (error == 0) + error = copyout(lsa, PTRIN(args->addr), + len); + free(lsa, M_SONAME); + } + + free(sa, M_SONAME); + if (error == 0) + error = copyout(&len, PTRIN(args->namelen), sizeof(len)); + return (error); } int @@ -1036,6 +860,8 @@ linux_sendto(struct thread *td, struct linux_sendto_ar int linux_recvfrom(struct thread *td, struct linux_recvfrom_args *args) { + struct l_sockaddr *lsa; + struct sockaddr *sa; struct msghdr msg; struct iovec aiov; int error, fromlen; @@ -1047,11 +873,14 @@ linux_recvfrom(struct thread *td, struct linux_recvfro return (error); if (fromlen < 0) return (EINVAL); - msg.msg_namelen = fromlen; - } else - msg.msg_namelen = 0; + sa = malloc(fromlen, M_SONAME, M_WAITOK); + } else { + fromlen = 0; + sa = NULL; + } - msg.msg_name = (struct sockaddr * __restrict)PTRIN(args->from); + msg.msg_name = sa; + msg.msg_namelen = fromlen; msg.msg_iov = &aiov; msg.msg_iovlen = 1; aiov.iov_base = PTRIN(args->buf); @@ -1059,24 +888,23 @@ linux_recvfrom(struct thread *td, struct linux_recvfro msg.msg_control = 0; msg.msg_flags = linux_to_bsd_msg_flags(args->flags); - error = kern_recvit(td, args->s, &msg, UIO_USERSPACE, NULL); + error = kern_recvit(td, args->s, &msg, UIO_SYSSPACE, NULL); if (error != 0) return (error); if (PTRIN(args->from) != NULL) { - error = bsd_to_linux_sockaddr((struct sockaddr *) - PTRIN(args->from)); - if (error != 0) - return (error); - - error = linux_sa_put((struct osockaddr *) - PTRIN(args->from)); + error = bsd_to_linux_sockaddr(sa, &lsa, msg.msg_namelen); + if (error == 0) + error = copyout(lsa, PTRIN(args->from), + msg.msg_namelen); + free(lsa, M_SONAME); } - if (PTRIN(args->fromlen) != NULL) + if (error == 0 && PTRIN(args->fromlen) != NULL) error = copyout(&msg.msg_namelen, PTRIN(args->fromlen), sizeof(msg.msg_namelen)); + free(sa, M_SONAME); return (error); } @@ -1282,6 +1110,8 @@ linux_recvmsg_common(struct thread *td, l_int s, struc struct mbuf *control = NULL; struct mbuf **controlp; struct timeval *ftmvl; + struct l_sockaddr *lsa; + struct sockaddr *sa; l_timeval ltmvl; caddr_t outbuf; void *data; @@ -1305,36 +1135,34 @@ linux_recvmsg_common(struct thread *td, l_int s, struc return (error); if (msg->msg_name) { - error = linux_to_bsd_sockaddr((struct sockaddr *)msg->msg_name, - msg->msg_namelen); - if (error != 0) - goto bad; + sa = malloc(msg->msg_namelen, M_SONAME, M_WAITOK); + msg->msg_name = sa; } uiov = msg->msg_iov; msg->msg_iov = iov; controlp = (msg->msg_control != NULL) ? &control : NULL; - error = kern_recvit(td, s, msg, UIO_USERSPACE, controlp); + error = kern_recvit(td, s, msg, UIO_SYSSPACE, controlp); msg->msg_iov = uiov; if (error != 0) goto bad; - error = bsd_to_linux_msghdr(msg, &linux_msg); - if (error != 0) - goto bad; - - if (linux_msg.msg_name) { - error = bsd_to_linux_sockaddr((struct sockaddr *) - PTRIN(linux_msg.msg_name)); + if (sa) { + msg->msg_name = PTRIN(linux_msg.msg_name); + error = bsd_to_linux_sockaddr(sa, &lsa, msg->msg_namelen); + if (error == 0) + error = copyout(lsa, PTRIN(msg->msg_name), + msg->msg_namelen); + free(lsa, M_SONAME); + free(sa, M_SONAME); if (error != 0) goto bad; } - if (linux_msg.msg_name && linux_msg.msg_namelen > 2) { - error = linux_sa_put(PTRIN(linux_msg.msg_name)); - if (error != 0) - goto bad; - } + error = bsd_to_linux_msghdr(msg, &linux_msg); + if (error != 0) + goto bad; + maxlen = linux_msg.msg_controllen; linux_msg.msg_controllen = 0; if (control) { @@ -1537,7 +1365,9 @@ linux_setsockopt(struct thread *td, struct linux_setso int valsize; } */ bsd_args; l_timeval linux_tv; + struct sockaddr *sa; struct timeval tv; + socklen_t len; int error, name; bsd_args.s = args->s; @@ -1578,18 +1408,23 @@ linux_setsockopt(struct thread *td, struct linux_setso if (name == -1) return (ENOPROTOOPT); - bsd_args.name = name; - bsd_args.val = PTRIN(args->optval); - bsd_args.valsize = args->optlen; if (name == IPV6_NEXTHOP) { - linux_to_bsd_sockaddr(__DECONST(struct sockaddr *, - bsd_args.val), bsd_args.valsize); + + len = args->optlen; + error = linux_to_bsd_sockaddr(PTRIN(args->optval), &sa, &len); + if (error != 0) + return (error); + + error = kern_setsockopt(td, args->s, bsd_args.level, + name, sa, UIO_SYSSPACE, len); + free(sa, M_SONAME); + } else { + bsd_args.name = name; + bsd_args.val = PTRIN(args->optval); + bsd_args.valsize = args->optlen; error = sys_setsockopt(td, &bsd_args); - bsd_to_linux_sockaddr(__DECONST(struct sockaddr *, - bsd_args.val)); - } else - error = sys_setsockopt(td, &bsd_args); + } return (error); } @@ -1607,6 +1442,8 @@ linux_getsockopt(struct thread *td, struct linux_getso l_timeval linux_tv; struct timeval tv; socklen_t tv_len, xulen, len; + struct l_sockaddr *lsa; + struct sockaddr *sa; struct xucred xu; struct l_ucred lxu; int error, name, newval; @@ -1681,14 +1518,32 @@ linux_getsockopt(struct thread *td, struct linux_getso return (EINVAL); bsd_args.name = name; - bsd_args.val = PTRIN(args->optval); bsd_args.avalsize = PTRIN(args->optlen); if (name == IPV6_NEXTHOP) { + error = copyin(PTRIN(args->optlen), &len, sizeof(len)); + if (error != 0) + return (error); + sa = malloc(len, M_SONAME, M_WAITOK); + + error = kern_getsockopt(td, args->s, bsd_args.level, + name, sa, UIO_SYSSPACE, &len); + if (error != 0) + goto out; + + error = bsd_to_linux_sockaddr(sa, &lsa, len); + if (error == 0) + error = copyout(lsa, PTRIN(args->optval), len); + free(lsa, M_SONAME); + if (error == 0) + error = copyout(&len, PTRIN(args->optlen), + sizeof(len)); +out: + free(sa, M_SONAME); + } else { + bsd_args.val = PTRIN(args->optval); error = sys_getsockopt(td, &bsd_args); - bsd_to_linux_sockaddr((struct sockaddr *)bsd_args.val); - } else - error = sys_getsockopt(td, &bsd_args); + } return (error); } Modified: head/sys/compat/linux/linux_socket.h ============================================================================== --- head/sys/compat/linux/linux_socket.h Mon May 13 16:38:48 2019 (r347532) +++ head/sys/compat/linux/linux_socket.h Mon May 13 17:48:16 2019 (r347533) @@ -109,16 +109,6 @@ struct l_cmsghdr { #define CMSG_HDRSZ CMSG_LEN(0) #define L_CMSG_HDRSZ LINUX_CMSG_LEN(0) -/* Supported address families */ - -#define LINUX_AF_UNSPEC 0 -#define LINUX_AF_UNIX 1 -#define LINUX_AF_INET 2 -#define LINUX_AF_AX25 3 -#define LINUX_AF_IPX 4 -#define LINUX_AF_APPLETALK 5 -#define LINUX_AF_INET6 10 - /* Supported socket types */ #define LINUX_SOCK_STREAM 1 Modified: head/sys/modules/linux_common/Makefile ============================================================================== --- head/sys/modules/linux_common/Makefile Mon May 13 16:38:48 2019 (r347532) +++ head/sys/modules/linux_common/Makefile Mon May 13 17:48:16 2019 (r347533) @@ -5,7 +5,7 @@ KMOD= linux_common SRCS= linux_common.c linux_mib.c linux_mmap.c linux_util.c linux_emul.c \ linux_errno.c \ - linux.c device_if.h vnode_if.h bus_if.h + linux.c device_if.h vnode_if.h bus_if.h opt_inet6.h EXPORT_SYMS= EXPORT_SYMS+= linux_emul_path From owner-svn-src-head@freebsd.org Mon May 13 17:49:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A947E1596835; Mon, 13 May 2019 17:49: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 564478C94C; Mon, 13 May 2019 17:49: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 2FCF4D3EB; Mon, 13 May 2019 17:49: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 x4DHnu2k020575; Mon, 13 May 2019 17:49:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4DHnt1M020569; Mon, 13 May 2019 17:49:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905131749.x4DHnt1M020569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 13 May 2019 17:49:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347534 - in head: . lib/libcasper/services/cap_sysctl lib/libcasper/services/cap_sysctl/tests X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: . lib/libcasper/services/cap_sysctl lib/libcasper/services/cap_sysctl/tests X-SVN-Commit-Revision: 347534 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 564478C94C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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, 13 May 2019 17:49:57 -0000 Author: markj Date: Mon May 13 17:49:54 2019 New Revision: 347534 URL: https://svnweb.freebsd.org/changeset/base/347534 Log: Add cap_sysctl(3) and cap_sysctlnametomib(3). These complement cap_sysctlbyname(3) to provide a drop-in replacement for the corresponding libc functions. Also revise the libcap_sysctl limit interface to provide access to sysctls by MIB, and to avoid direct manipulation of nvlists by the caller. Reviewed by: oshogbo Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17854 Modified: head/ObsoleteFiles.inc head/lib/libcasper/services/cap_sysctl/Makefile head/lib/libcasper/services/cap_sysctl/cap_sysctl.3 head/lib/libcasper/services/cap_sysctl/cap_sysctl.c head/lib/libcasper/services/cap_sysctl/cap_sysctl.h head/lib/libcasper/services/cap_sysctl/tests/sysctl_test.c Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon May 13 17:48:16 2019 (r347533) +++ head/ObsoleteFiles.inc Mon May 13 17:49:54 2019 (r347534) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20190513: libcap_sysctl interface change +OLD_FILES+=lib/casper/libcap_sysctl.1 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package. OLD_FILES+=usr/tests/sys/opencrypto/dpkt.py OLD_FILES+=usr/tests/sys/opencrypto/dpkt.pyc Modified: head/lib/libcasper/services/cap_sysctl/Makefile ============================================================================== --- head/lib/libcasper/services/cap_sysctl/Makefile Mon May 13 17:48:16 2019 (r347533) +++ head/lib/libcasper/services/cap_sysctl/Makefile Mon May 13 17:49:54 2019 (r347534) @@ -6,7 +6,7 @@ SHLIBDIR?= /lib/casper PACKAGE=libcasper -SHLIB_MAJOR= 1 +SHLIB_MAJOR= 2 INCSDIR?= ${INCLUDEDIR}/casper .if ${MK_CASPER} != "no" @@ -25,8 +25,12 @@ HAS_TESTS= SUBDIR.${MK_TESTS}+= tests MAN+= cap_sysctl.3 - -MLINKS+=cap_sysctl.3 libcap_sysctl.3 -MLINKS+=cap_sysctl.3 cap_sysctlbyname.3 +MLINKS+=cap_sysctl.3 libcap_sysctl.3 \ + cap_sysctl.3 cap_sysctlbyname.3 \ + cap_sysctl.3 cap_nametomib.3 \ + cap_sysctl.3 cap_sysctl_limit_init.3 \ + cap_sysctl.3 cap_sysctl_limit_mib.3 \ + cap_sysctl.3 cap_sysctl_limit_name.3 \ + cap_sysctl.3 cap_sysctl_limit.3 .include Modified: head/lib/libcasper/services/cap_sysctl/cap_sysctl.3 ============================================================================== --- head/lib/libcasper/services/cap_sysctl/cap_sysctl.3 Mon May 13 17:48:16 2019 (r347533) +++ head/lib/libcasper/services/cap_sysctl/cap_sysctl.3 Mon May 13 17:49:54 2019 (r347534) @@ -24,72 +24,113 @@ .\" .\" $FreeBSD$ .\" -.Dd March 18, 2018 +.Dd May 13, 2019 .Dt CAP_SYSCTL 3 .Os .Sh NAME -.Nm cap_sysctlbyname +.Nm cap_sysctl .Nd "library for getting or setting system information in capability mode" .Sh LIBRARY .Lb libcap_sysctl .Sh SYNOPSIS -.In sys/nv.h .In libcasper.h .In casper/cap_sysctl.h .Ft int -.Fn cap_sysctlbyname "cap_channel_t *chan" " const char *name" " void *oldp" " size_t *oldlenp" " const void *newp" " size_t newlen" +.Fn cap_sysctl "cap_channel_t *chan" "const int *name" "u_int namelen" "void *oldp" "size_t *oldlenp" "const void *newp" "size_t newlen" +.Ft int +.Fn cap_sysctlbyname "cap_channel_t *chan" "const char *name" "void *oldp" "size_t *oldlenp" "const void *newp" "size_t newlen" +.Ft int +.Fn cap_sysctlnametomib "cap_channel_t *chan" "const char *name" "int *mibp" "size_t *sizep" +.Ft void * +.Fn cap_sysctl_limit_init "cap_channel_t *chan" +.Ft void * +.Fn cap_sysctl_limit_name "void *limit" "const char *name" "int flags" +.Ft void * +.Fn cap_sysctl_limit_mib "void *limit" "int *mibp" "u_int miblen" "int flags" +.Ft int +.Fn cap_sysctl_limit "void *limit" .Sh DESCRIPTION -The function +The +.Fn cap_sysctl , .Fn cap_sysctlbyname -is equivalent to +and +.Fn cap_sysctlnametomib +functions are equivalent to +.Xr sysctl 3 , .Xr sysctlbyname 3 -except that the connection to the -.Nm system.sysctl -service needs to be provided. +and +.Xr sysctlnametomib 3 , +except that they are implemented by the +.Ql system.sysctl +.Xr libcasper 3 +service and require a corresponding +.Xr libcasper 3 +capability. .Sh LIMITS -The service can be limited using -.Xr cap_limit_set 3 -function. +By default, the +.Nm +capability provides unrestricted access to the sysctl namespace. +Applications typically only require access to a small number of sysctl +variables; the +.Fn cap_sysctl_limit +interface can be used to restrict the sysctls that can be accessed using +the +.Nm +capability. +.Fn cap_sysctl_limit_init +returns an opaque limit handle used to store a list of permitted sysctls +and access rights. +Rights are encoded using the following flags: +.Pp +.Bd -literal -offset indent -compact +CAP_SYSCTL_READ allow reads of the sysctl variable +CAP_SYSCTL_WRITE allow writes of the sysctl variable +CAP_SYSCTL_RDWR allow reads and writes of the sysctl variable +CAP_RECURSIVE permit access to any child of the sysctl variable +.Ed +.Pp The -.Xr nvlist 9 -for that function can contain the following values and types: -.Bl -ohang -offset indent -.It ( NV_TYPE_NUMBER ) -The name of the element with type number will be treated as the limited sysctl. -The value of the element will describe the access rights for given sysctl. -There are four different rights +.Fn cap_sysctl_limit_name +function adds the sysctl identified by +.Ar name +to the limit list, and +.Fn cap_sysctl_limit_mib +function adds the sysctl identified by +.Ar mibp +to the limit list. +The access rights for the sysctl are specified in the +.Ar flags +parameter; at least one of .Dv CAP_SYSCTL_READ , -.Dv CAP_SYSCTL_WRITE , -.Dv CAP_SYSCTL_RDWR , +.Dv CAP_SYSCTL_WRITE and -.Dv CAP_SYSCTL_RECURSIVE . -The -.Dv CAP_SYSCTL_READ -flag allows to fetch the value of a given sysctl. -The -.Dv CAP_SYSCTL_WIRTE -flag allows to override the value of a given sysctl. -The .Dv CAP_SYSCTL_RDWR -is combination of the -.Dv CAP_SYSCTL_WIRTE -and -.Dv CAP_SYSCTL_READ -and allows to read and write the value of a given sysctl. -The -.Dv CAP_SYSCTL_RECURSIVE -allows access to all children of a given sysctl. -This right must be combined with at least one other right. +must be specified. +.Fn cap_sysctl_limit +applies a set of sysctl limits to the capability, denying access to sysctl +variables not belonging to the set. +.Pp +Once a set of limits is applied, subsequent calls to +.Fn cap_sysctl_limit +will fail unless the new set is a subset of the current set. +.Pp +.Fn cap_sysctlnametomib +will succeed so long as the named sysctl variable is present in the limit set, +regardless of its access rights. +When a sysctl variable name is added to a limit set, its MIB identifier is +automatically added to the set. .Sh EXAMPLES -The following example first opens a capability to casper and then uses this +The following example first opens a capability to casper, uses this capability to create the .Nm system.sysctl -casper service and uses it to get the value of +casper service, and then uses the +.Nm +capability to get the value of .Dv kern.trap_enotcap . .Bd -literal cap_channel_t *capcas, *capsysctl; const char *name = "kern.trap_enotcap"; -nvlist_t *limits; +void *limit; int value; size_t size; @@ -111,11 +152,11 @@ if (capsysctl == NULL) cap_close(capcas); /* Create limit for one MIB with read access only. */ -limits = nvlist_create(0); -nvlist_add_number(limits, name, CAP_SYSCTL_READ); +limit = cap_sysctl_limit_init(capsysctl); +(void)cap_sysctl_limit_name(limit, name, CAP_SYSCTL_READ); /* Limit system.sysctl. */ -if (cap_limit_set(capsysctl, limits) < 0) +if (cap_sysctl_limit(limit) < 0) err(1, "Unable to set limits"); /* Fetch value. */ @@ -129,7 +170,9 @@ cap_close(capsysctl); .Sh SEE ALSO .Xr cap_enter 2 , .Xr err 3 , +.Xr sysctl 3 , .Xr sysctlbyname 3 , +.Xr sysctlnametomib 3 , .Xr capsicum 4 , .Xr nv 9 .Sh AUTHORS Modified: head/lib/libcasper/services/cap_sysctl/cap_sysctl.c ============================================================================== --- head/lib/libcasper/services/cap_sysctl/cap_sysctl.c Mon May 13 17:48:16 2019 (r347533) +++ head/lib/libcasper/services/cap_sysctl/cap_sysctl.c Mon May 13 17:49:54 2019 (r347534) @@ -1,12 +1,15 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2013 The FreeBSD Foundation + * Copyright (c) 2013, 2018 The FreeBSD Foundation * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. * + * Portions of this software were developed by Mark Johnston + * 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: @@ -32,9 +35,11 @@ #include __FBSDID("$FreeBSD$"); -#include -#include +#include +#include +#include #include +#include #include #include @@ -46,24 +51,117 @@ __FBSDID("$FreeBSD$"); #include "cap_sysctl.h" +/* + * Limit interface. + */ + +struct cap_sysctl_limit { + cap_channel_t *chan; + nvlist_t *nv; +}; + +cap_sysctl_limit_t * +cap_sysctl_limit_init(cap_channel_t *chan) +{ + cap_sysctl_limit_t *limit; + int error; + + limit = malloc(sizeof(*limit)); + if (limit != NULL) { + limit->chan = chan; + limit->nv = nvlist_create(NV_FLAG_NO_UNIQUE); + if (limit->nv == NULL) { + error = errno; + free(limit); + limit = NULL; + errno = error; + } + } + return (limit); +} + +cap_sysctl_limit_t * +cap_sysctl_limit_name(cap_sysctl_limit_t *limit, const char *name, int flags) +{ + nvlist_t *lnv; + size_t mibsz; + int error, mib[CTL_MAXNAME]; + + lnv = nvlist_create(0); + if (lnv == NULL) { + error = errno; + if (limit->nv != NULL) + nvlist_destroy(limit->nv); + free(limit); + errno = error; + return (NULL); + } + nvlist_add_string(lnv, "name", name); + nvlist_add_number(lnv, "operation", flags); + + mibsz = nitems(mib); + error = cap_sysctlnametomib(limit->chan, name, mib, &mibsz); + if (error == 0) + nvlist_add_binary(lnv, "mib", mib, mibsz * sizeof(int)); + + nvlist_move_nvlist(limit->nv, "limit", lnv); + return (limit); +} + +cap_sysctl_limit_t * +cap_sysctl_limit_mib(cap_sysctl_limit_t *limit, int *mibp, u_int miblen, + int flags) +{ + nvlist_t *lnv; + int error; + + lnv = nvlist_create(0); + if (lnv == NULL) { + error = errno; + if (limit->nv != NULL) + nvlist_destroy(limit->nv); + free(limit); + errno = error; + return (NULL); + } + nvlist_add_binary(lnv, "mib", mibp, miblen * sizeof(int)); + nvlist_add_number(lnv, "operation", flags); + nvlist_add_nvlist(limit->nv, "limit", lnv); + return (limit); +} + int -cap_sysctlbyname(cap_channel_t *chan, const char *name, void *oldp, - size_t *oldlenp, const void *newp, size_t newlen) +cap_sysctl_limit(cap_sysctl_limit_t *limit) { - nvlist_t *nvl; + cap_channel_t *chan; + nvlist_t *lnv; + + chan = limit->chan; + lnv = limit->nv; + free(limit); + + /* cap_limit_set(3) will always free the nvlist. */ + return (cap_limit_set(chan, lnv)); +} + +/* + * Service interface. + */ + +static int +do_sysctl(cap_channel_t *chan, nvlist_t *nvl, void *oldp, size_t *oldlenp, + const void *newp, size_t newlen) +{ const uint8_t *retoldp; - uint8_t operation; size_t oldlen; + int error; + uint8_t operation; operation = 0; - if (oldp != NULL) + if (oldlenp != NULL) operation |= CAP_SYSCTL_READ; if (newp != NULL) operation |= CAP_SYSCTL_WRITE; - - nvl = nvlist_create(0); - nvlist_add_string(nvl, "cmd", "sysctl"); - nvlist_add_string(nvl, "name", name); nvlist_add_number(nvl, "operation", (uint64_t)operation); if (oldp == NULL && oldlenp != NULL) nvlist_add_null(nvl, "justsize"); @@ -71,12 +169,14 @@ cap_sysctlbyname(cap_channel_t *chan, const char *name nvlist_add_number(nvl, "oldlen", (uint64_t)*oldlenp); if (newp != NULL) nvlist_add_binary(nvl, "newp", newp, newlen); + nvl = cap_xfer_nvlist(chan, nvl); if (nvl == NULL) return (-1); - if (nvlist_get_number(nvl, "error") != 0) { - errno = (int)nvlist_get_number(nvl, "error"); + error = (int)dnvlist_get_number(nvl, "error", 0); + if (error != 0) { nvlist_destroy(nvl); + errno = error; return (-1); } @@ -88,21 +188,87 @@ cap_sysctlbyname(cap_channel_t *chan, const char *name if (oldlenp != NULL) *oldlenp = oldlen; } + nvlist_destroy(nvl); return (0); } +int +cap_sysctl(cap_channel_t *chan, const int *name, u_int namelen, void *oldp, + size_t *oldlenp, const void *newp, size_t newlen) +{ + nvlist_t *req; + + req = nvlist_create(0); + nvlist_add_string(req, "cmd", "sysctl"); + nvlist_add_binary(req, "mib", name, (size_t)namelen * sizeof(int)); + return (do_sysctl(chan, req, oldp, oldlenp, newp, newlen)); +} + +int +cap_sysctlbyname(cap_channel_t *chan, const char *name, void *oldp, + size_t *oldlenp, const void *newp, size_t newlen) +{ + nvlist_t *req; + + req = nvlist_create(0); + nvlist_add_string(req, "cmd", "sysctlbyname"); + nvlist_add_string(req, "name", name); + return (do_sysctl(chan, req, oldp, oldlenp, newp, newlen)); +} + +int +cap_sysctlnametomib(cap_channel_t *chan, const char *name, int *mibp, + size_t *sizep) +{ + nvlist_t *req; + const void *mib; + size_t mibsz; + int error; + + req = nvlist_create(0); + nvlist_add_string(req, "cmd", "sysctlnametomib"); + nvlist_add_string(req, "name", name); + nvlist_add_number(req, "operation", 0); + nvlist_add_number(req, "size", (uint64_t)*sizep); + + req = cap_xfer_nvlist(chan, req); + if (req == NULL) + return (-1); + error = (int)dnvlist_get_number(req, "error", 0); + if (error != 0) { + nvlist_destroy(req); + errno = error; + return (-1); + } + + mib = nvlist_get_binary(req, "mib", &mibsz); + *sizep = mibsz / sizeof(int); + + memcpy(mibp, mib, mibsz); + + nvlist_destroy(req); + + return (0); +} + /* - * Service functions. + * Service implementation. */ + +/* + * Validate a sysctl description. This must consist of an nvlist with either a + * binary "mib" field or a string "name", and an operation. + */ static int -sysctl_check_one(const nvlist_t *nvl, bool islimit) +sysctl_valid(const nvlist_t *nvl, bool limit) { const char *name; void *cookie; int type; - unsigned int fields; + size_t size; + unsigned int field, fields; /* NULL nvl is of course invalid. */ if (nvl == NULL) @@ -111,84 +277,120 @@ sysctl_check_one(const nvlist_t *nvl, bool islimit) return (nvlist_error(nvl)); #define HAS_NAME 0x01 -#define HAS_OPERATION 0x02 +#define HAS_MIB 0x02 +#define HAS_ID (HAS_NAME | HAS_MIB) +#define HAS_OPERATION 0x04 fields = 0; cookie = NULL; while ((name = nvlist_next(nvl, &type, &cookie)) != NULL) { - /* We accept only one 'name' and one 'operation' in nvl. */ - if (strcmp(name, "name") == 0) { - if (type != NV_TYPE_STRING) + if ((strcmp(name, "name") == 0 && type == NV_TYPE_STRING) || + (strcmp(name, "mib") == 0 && type == NV_TYPE_BINARY)) { + if (strcmp(name, "mib") == 0) { + /* A MIB must be an array of integers. */ + (void)cnvlist_get_binary(cookie, &size); + if (size % sizeof(int) != 0) + return (EINVAL); + field = HAS_MIB; + } else + field = HAS_NAME; + + /* + * A limit may contain both a name and a MIB identifier. + */ + if ((fields & field) != 0 || + (!limit && (fields & HAS_ID) != 0)) return (EINVAL); - /* Only one 'name' can be present. */ - if ((fields & HAS_NAME) != 0) - return (EINVAL); - fields |= HAS_NAME; + fields |= field; } else if (strcmp(name, "operation") == 0) { - uint64_t operation; + uint64_t mask, operation; if (type != NV_TYPE_NUMBER) return (EINVAL); + + operation = cnvlist_get_number(cookie); + /* - * We accept only CAP_SYSCTL_READ and - * CAP_SYSCTL_WRITE flags. + * Requests can only include the RDWR flags; limits may + * also include the RECURSIVE flag. */ - operation = nvlist_get_number(nvl, name); - if ((operation & ~(CAP_SYSCTL_RDWR)) != 0) + mask = limit ? (CAP_SYSCTL_RDWR | + CAP_SYSCTL_RECURSIVE) : CAP_SYSCTL_RDWR; + if ((operation & ~limit) != 0 || + (operation & CAP_SYSCTL_RDWR) == 0) return (EINVAL); - /* ...but there has to be at least one of them. */ - if ((operation & (CAP_SYSCTL_RDWR)) == 0) - return (EINVAL); /* Only one 'operation' can be present. */ if ((fields & HAS_OPERATION) != 0) return (EINVAL); fields |= HAS_OPERATION; - } else if (islimit) { - /* If this is limit, there can be no other fields. */ + } else if (limit) return (EINVAL); - } } - /* Both fields has to be there. */ - if (fields != (HAS_NAME | HAS_OPERATION)) + if ((fields & HAS_OPERATION) == 0 || (fields & HAS_ID) == 0) return (EINVAL); -#undef HAS_OPERATION -#undef HAS_NAME +#undef HAS_OPERATION +#undef HAS_ID +#undef HAS_MIB +#undef HAS_NAME return (0); } static bool -sysctl_allowed(const nvlist_t *limits, const char *chname, uint64_t choperation) +sysctl_allowed(const nvlist_t *limits, const nvlist_t *req) { - uint64_t operation; - const char *name; + const nvlist_t *limit; + uint64_t op, reqop; + const char *lname, *name, *reqname; void *cookie; + size_t lsize, reqsize; + const int *lmib, *reqmib; int type; if (limits == NULL) return (true); + reqmib = dnvlist_get_binary(req, "mib", &reqsize, NULL, 0); + reqname = dnvlist_get_string(req, "name", NULL); + reqop = nvlist_get_number(req, "operation"); + cookie = NULL; while ((name = nvlist_next(limits, &type, &cookie)) != NULL) { - assert(type == NV_TYPE_NUMBER); + assert(type == NV_TYPE_NVLIST); - operation = nvlist_get_number(limits, name); - if ((operation & choperation) != choperation) + limit = cnvlist_get_nvlist(cookie); + op = nvlist_get_number(limit, "operation"); + if ((reqop & op) != reqop) continue; - if ((operation & CAP_SYSCTL_RECURSIVE) == 0) { - if (strcmp(name, chname) != 0) + if (reqname != NULL) { + lname = dnvlist_get_string(limit, "name", NULL); + if (lname == NULL) continue; - } else { - size_t namelen; + if ((op & CAP_SYSCTL_RECURSIVE) == 0) { + if (strcmp(lname, reqname) != 0) + continue; + } else { + size_t namelen; - namelen = strlen(name); - if (strncmp(name, chname, namelen) != 0) + namelen = strlen(lname); + if (strncmp(lname, reqname, namelen) != 0) + continue; + if (reqname[namelen] != '.' && + reqname[namelen] != '\0') + continue; + } + } else { + lmib = dnvlist_get_binary(limit, "mib", &lsize, NULL, 0); + if (lmib == NULL) continue; - if (chname[namelen] != '.' && chname[namelen] != '\0') + if (lsize > reqsize || ((op & CAP_SYSCTL_RECURSIVE) == 0 && + lsize < reqsize)) continue; + if (memcmp(lmib, reqmib, lsize) != 0) + continue; } return (true); @@ -200,21 +402,20 @@ sysctl_allowed(const nvlist_t *limits, const char *chn static int sysctl_limit(const nvlist_t *oldlimits, const nvlist_t *newlimits) { + const nvlist_t *nvl; const char *name; void *cookie; - uint64_t operation; - int type; + int error, type; cookie = NULL; while ((name = nvlist_next(newlimits, &type, &cookie)) != NULL) { - if (type != NV_TYPE_NUMBER) + if (strcmp(name, "limit") != 0 || type != NV_TYPE_NVLIST) return (EINVAL); - operation = nvlist_get_number(newlimits, name); - if ((operation & ~(CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE)) != 0) - return (EINVAL); - if ((operation & (CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE)) == 0) - return (EINVAL); - if (!sysctl_allowed(oldlimits, name, operation)) + nvl = cnvlist_get_nvlist(cookie); + error = sysctl_valid(nvl, true); + if (error != 0) + return (error); + if (!sysctl_allowed(oldlimits, nvl)) return (ENOTCAPABLE); } @@ -222,28 +423,59 @@ sysctl_limit(const nvlist_t *oldlimits, const nvlist_t } static int +nametomib(const nvlist_t *limits, const nvlist_t *nvlin, nvlist_t *nvlout) +{ + const char *name; + size_t size; + int error, *mibp; + + if (!sysctl_allowed(limits, nvlin)) + return (ENOTCAPABLE); + + name = nvlist_get_string(nvlin, "name"); + size = (size_t)nvlist_get_number(nvlin, "size"); + + mibp = malloc(size * sizeof(*mibp)); + if (mibp == NULL) + return (ENOMEM); + + error = sysctlnametomib(name, mibp, &size); + if (error != 0) { + error = errno; + free(mibp); + return (error); + } + + nvlist_add_binary(nvlout, "mib", mibp, size * sizeof(*mibp)); + + return (0); +} + +static int sysctl_command(const char *cmd, const nvlist_t *limits, nvlist_t *nvlin, nvlist_t *nvlout) { const char *name; const void *newp; + const int *mibp; void *oldp; uint64_t operation; - size_t oldlen, newlen; + size_t oldlen, newlen, size; size_t *oldlenp; int error; - if (strcmp(cmd, "sysctl") != 0) + if (strcmp(cmd, "sysctlnametomib") == 0) + return (nametomib(limits, nvlin, nvlout)); + + if (strcmp(cmd, "sysctlbyname") != 0 && strcmp(cmd, "sysctl") != 0) return (EINVAL); - error = sysctl_check_one(nvlin, false); + error = sysctl_valid(nvlin, false); if (error != 0) return (error); - - name = nvlist_get_string(nvlin, "name"); - operation = nvlist_get_number(nvlin, "operation"); - if (!sysctl_allowed(limits, name, operation)) + if (!sysctl_allowed(limits, nvlin)) return (ENOTCAPABLE); + operation = nvlist_get_number(nvlin, "operation"); if ((operation & CAP_SYSCTL_WRITE) != 0) { if (!nvlist_exists_binary(nvlin, "newp")) return (EINVAL); @@ -276,7 +508,15 @@ sysctl_command(const char *cmd, const nvlist_t *limits oldlenp = NULL; } - if (sysctlbyname(name, oldp, oldlenp, newp, newlen) == -1) { + if (strcmp(cmd, "sysctlbyname") == 0) { + name = nvlist_get_string(nvlin, "name"); + error = sysctlbyname(name, oldp, oldlenp, newp, newlen); + } else { + mibp = nvlist_get_binary(nvlin, "mib", &size); + error = sysctl(mibp, size / sizeof(*mibp), oldp, oldlenp, newp, + newlen); + } + if (error != 0) { error = errno; free(oldp); return (error); Modified: head/lib/libcasper/services/cap_sysctl/cap_sysctl.h ============================================================================== --- head/lib/libcasper/services/cap_sysctl/cap_sysctl.h Mon May 13 17:48:16 2019 (r347533) +++ head/lib/libcasper/services/cap_sysctl/cap_sysctl.h Mon May 13 17:49:54 2019 (r347534) @@ -29,24 +29,47 @@ * $FreeBSD$ */ -#ifndef _CAP_SYSCTL_H_ +#ifndef _CAP_SYSCTL_H_ #define _CAP_SYSCTL_H_ #ifdef HAVE_CASPER -#define WITH_CASPER +#define WITH_CASPER #endif +#ifdef WITH_CASPER #define CAP_SYSCTL_READ 0x01 #define CAP_SYSCTL_WRITE 0x02 #define CAP_SYSCTL_RDWR (CAP_SYSCTL_READ | CAP_SYSCTL_WRITE) #define CAP_SYSCTL_RECURSIVE 0x04 -#ifdef WITH_CASPER +int cap_sysctl(cap_channel_t *chan, const int *name, u_int namelen, void *oldp, + size_t *oldlenp, const void *newp, size_t newlen); int cap_sysctlbyname(cap_channel_t *chan, const char *name, void *oldp, size_t *oldlenp, const void *newp, size_t newlen); -#else -#define cap_sysctlbyname(chan, name, oldp, oldlenp, newp, newlen) \ - sysctlbyname(name, oldp, oldlenp, newp, newlen) -#endif +int cap_sysctlnametomib(cap_channel_t *chan, const char *name, int *mibp, + size_t *sizep); -#endif /* !_CAP_SYSCTL_H_ */ +struct cap_sysctl_limit; +typedef struct cap_sysctl_limit cap_sysctl_limit_t; + +cap_sysctl_limit_t *cap_sysctl_limit_init(cap_channel_t *); +cap_sysctl_limit_t *cap_sysctl_limit_name(cap_sysctl_limit_t *limit, + const char *name, int flags); +cap_sysctl_limit_t *cap_sysctl_limit_mib(cap_sysctl_limit_t *limit, int *mibp, + u_int miblen, int flags); +int cap_sysctl_limit(cap_sysctl_limit_t *limit); +#else /* !WITH_CASPER */ +#define cap_sysctl(chan, name, namelen, oldp, oldlenp, newp, newlen) \ + sysctl((name), (namelen), (oldp), (oldlenp), (newp), (newlen)) +#define cap_sysctlbyname(chan, name, oldp, oldlenp, newp, newlen) \ + sysctlbyname((name), (oldp), (oldlenp), (newp), (newlen)) +#define cap_sysctlnametomib(chan, name, mibp, sizep) \ + sysctlnametomib((name), (mibp), (sizep)) + +#define cap_sysctl_limit_init(chan) (NULL) +#define cap_sysctl_limit_name(limit, name, flags) (NULL) +#define cap_sysctl_limit_mib(limit, mibp, miblen, flags) (NULL) +#define cap_sysctl_limit(limit) (0) +#endif /* WITH_CASPER */ + +#endif /* !_CAP_SYSCTL_H_ */ Modified: head/lib/libcasper/services/cap_sysctl/tests/sysctl_test.c ============================================================================== --- head/lib/libcasper/services/cap_sysctl/tests/sysctl_test.c Mon May 13 17:48:16 2019 (r347533) +++ head/lib/libcasper/services/cap_sysctl/tests/sysctl_test.c Mon May 13 17:49:54 2019 (r347534) @@ -1,12 +1,15 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2013 The FreeBSD Foundation + * Copyright (c) 2013, 2018 The FreeBSD Foundation * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from * the FreeBSD Foundation. * + * Portions of this software were developed by Mark Johnston + * 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: @@ -185,7 +188,7 @@ static void test_operation(cap_channel_t *origcapsysctl) { cap_channel_t *capsysctl; - nvlist_t *limits; + void *limit; /* * Allow: @@ -196,61 +199,63 @@ test_operation(cap_channel_t *origcapsysctl) capsysctl = cap_clone(origcapsysctl); CHECK(capsysctl != NULL); - limits = nvlist_create(0); - nvlist_add_number(limits, SYSCTL0_PARENT, + limit = cap_sysctl_limit_init(capsysctl); + (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - nvlist_add_number(limits, SYSCTL1_PARENT, + (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_limit_set(capsysctl, limits) == 0); - limits = nvlist_create(0); - nvlist_add_number(limits, SYSCTL0_PARENT, + CHECK(cap_sysctl_limit(limit) == 0); + + limit = cap_sysctl_limit_init(capsysctl); + (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - nvlist_add_number(limits, SYSCTL1_PARENT, + (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - nvlist_add_number(limits, "foo.bar", + (void)cap_sysctl_limit_name(limit, "foo.bar", CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_limit_set(capsysctl, limits) == -1 && errno == ENOTCAPABLE); - limits = nvlist_create(0); - nvlist_add_number(limits, "foo.bar", + CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + + limit = cap_sysctl_limit_init(capsysctl); + (void)cap_sysctl_limit_name(limit, "foo.bar", CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_limit_set(capsysctl, limits) == -1 && errno == ENOTCAPABLE); + CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); CHECK(runtest(capsysctl) == (SYSCTL0_READ0 | SYSCTL0_READ1 | SYSCTL0_READ2 | SYSCTL0_WRITE | SYSCTL0_READ_WRITE | SYSCTL1_READ0 | SYSCTL1_READ1 | SYSCTL1_READ2 | SYSCTL1_WRITE | SYSCTL1_READ_WRITE)); - limits = nvlist_create(0); - nvlist_add_number(limits, SYSCTL0_NAME, + limit = cap_sysctl_limit_init(capsysctl); + (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - nvlist_add_number(limits, SYSCTL1_NAME, + (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_limit_set(capsysctl, limits) == 0); + CHECK(cap_sysctl_limit(limit) == 0); CHECK(runtest(capsysctl) == (SYSCTL0_READ0 | SYSCTL0_READ1 | SYSCTL0_READ2 | SYSCTL0_WRITE | SYSCTL0_READ_WRITE | SYSCTL1_READ0 | SYSCTL1_READ1 | SYSCTL1_READ2 | SYSCTL1_WRITE | SYSCTL1_READ_WRITE)); - limits = nvlist_create(0); - nvlist_add_number(limits, SYSCTL0_NAME, + limit = cap_sysctl_limit_init(capsysctl); + (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); - nvlist_add_number(limits, SYSCTL1_NAME, + (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); - CHECK(cap_limit_set(capsysctl, limits) == 0); + CHECK(cap_sysctl_limit(limit) == 0); CHECK(runtest(capsysctl) == (SYSCTL0_READ0 | SYSCTL1_WRITE)); - limits = nvlist_create(0); - nvlist_add_number(limits, SYSCTL0_NAME, CAP_SYSCTL_READ); - nvlist_add_number(limits, SYSCTL1_NAME, CAP_SYSCTL_WRITE); - CHECK(cap_limit_set(capsysctl, limits) == 0); + limit = cap_sysctl_limit_init(capsysctl); + (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_READ); + (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_WRITE); + CHECK(cap_sysctl_limit(limit) == 0); CHECK(runtest(capsysctl) == (SYSCTL0_READ0 | SYSCTL1_WRITE)); - limits = nvlist_create(0); - nvlist_add_number(limits, SYSCTL0_NAME, CAP_SYSCTL_READ); - CHECK(cap_limit_set(capsysctl, limits) == 0); + limit = cap_sysctl_limit_init(capsysctl); + (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_READ); + CHECK(cap_sysctl_limit(limit) == 0); CHECK(runtest(capsysctl) == SYSCTL0_READ0); @@ -265,29 +270,30 @@ test_operation(cap_channel_t *origcapsysctl) capsysctl = cap_clone(origcapsysctl); CHECK(capsysctl != NULL); - limits = nvlist_create(0); - nvlist_add_number(limits, SYSCTL0_NAME, + limit = cap_sysctl_limit_init(capsysctl); + (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - nvlist_add_number(limits, SYSCTL1_NAME, + (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_limit_set(capsysctl, limits) == 0); - limits = nvlist_create(0); - nvlist_add_number(limits, SYSCTL0_PARENT, + CHECK(cap_sysctl_limit(limit) == 0); + + limit = cap_sysctl_limit_init(capsysctl); + (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - nvlist_add_number(limits, SYSCTL1_PARENT, + (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_limit_set(capsysctl, limits) == -1 && errno == ENOTCAPABLE); - limits = nvlist_create(0); - nvlist_add_number(limits, SYSCTL0_PARENT, CAP_SYSCTL_RDWR); - nvlist_add_number(limits, SYSCTL1_PARENT, CAP_SYSCTL_RDWR); - CHECK(cap_limit_set(capsysctl, limits) == -1 && errno == ENOTCAPABLE); - limits = nvlist_create(0); - nvlist_add_number(limits, SYSCTL0_PARENT, CAP_SYSCTL_READ); - nvlist_add_number(limits, SYSCTL1_PARENT, CAP_SYSCTL_WRITE); - CHECK(cap_limit_set(capsysctl, limits) == -1 && errno == ENOTCAPABLE); - limits = nvlist_create(0); - nvlist_add_number(limits, SYSCTL0_PARENT, CAP_SYSCTL_READ); - CHECK(cap_limit_set(capsysctl, limits) == -1 && errno == ENOTCAPABLE); + CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + limit = cap_sysctl_limit_init(capsysctl); + (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR); + (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR); + CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + limit = cap_sysctl_limit_init(capsysctl); + (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_READ); + (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_WRITE); + CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + limit = cap_sysctl_limit_init(capsysctl); + (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_READ); + CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); CHECK(runtest(capsysctl) == (SYSCTL0_READ0 | SYSCTL0_READ1 | SYSCTL0_READ2 | SYSCTL0_WRITE | SYSCTL0_READ_WRITE | @@ -305,26 +311,26 @@ test_operation(cap_channel_t *origcapsysctl) capsysctl = cap_clone(origcapsysctl); CHECK(capsysctl != NULL); - limits = nvlist_create(0); - nvlist_add_number(limits, SYSCTL0_PARENT, CAP_SYSCTL_RDWR); - nvlist_add_number(limits, SYSCTL1_PARENT, CAP_SYSCTL_RDWR); - CHECK(cap_limit_set(capsysctl, limits) == 0); - limits = nvlist_create(0); - nvlist_add_number(limits, SYSCTL0_PARENT, + limit = cap_sysctl_limit_init(capsysctl); + (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR); + (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR); + CHECK(cap_sysctl_limit(limit) == 0); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon May 13 17:51:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69D861596921; Mon, 13 May 2019 17:51:04 +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 1BDCF8CB77; Mon, 13 May 2019 17:51:04 +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 EA376D42E; Mon, 13 May 2019 17:51: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 x4DHp3i6022586; Mon, 13 May 2019 17:51:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4DHp3oA022584; Mon, 13 May 2019 17:51:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905131751.x4DHp3oA022584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 13 May 2019 17:51:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347535 - head/lib/libcasper/services/cap_sysctl/tests X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libcasper/services/cap_sysctl/tests X-SVN-Commit-Revision: 347535 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1BDCF8CB77 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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, 13 May 2019 17:51:04 -0000 Author: markj Date: Mon May 13 17:51:03 2019 New Revision: 347535 URL: https://svnweb.freebsd.org/changeset/base/347535 Log: Convert the libcap_sysctl test cases to ATF. Reviewed by: oshogbo Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17855 Modified: head/lib/libcasper/services/cap_sysctl/tests/Makefile head/lib/libcasper/services/cap_sysctl/tests/sysctl_test.c Modified: head/lib/libcasper/services/cap_sysctl/tests/Makefile ============================================================================== --- head/lib/libcasper/services/cap_sysctl/tests/Makefile Mon May 13 17:49:54 2019 (r347534) +++ head/lib/libcasper/services/cap_sysctl/tests/Makefile Mon May 13 17:51:03 2019 (r347535) @@ -2,7 +2,7 @@ .include -TAP_TESTS_C= sysctl_test +ATF_TESTS_C= sysctl_test .if ${MK_CASPER} != "no" LIBADD+= casper Modified: head/lib/libcasper/services/cap_sysctl/tests/sysctl_test.c ============================================================================== --- head/lib/libcasper/services/cap_sysctl/tests/sysctl_test.c Mon May 13 17:49:54 2019 (r347534) +++ head/lib/libcasper/services/cap_sysctl/tests/sysctl_test.c Mon May 13 17:51:03 2019 (r347535) @@ -50,39 +50,21 @@ __FBSDID("$FreeBSD$"); #include #include - #include +#include + /* * We need some sysctls to perform the tests on. * We remember their values and restore them afer the test is done. */ #define SYSCTL0_PARENT "kern" #define SYSCTL0_NAME "kern.sync_on_panic" +#define SYSCTL0_FILE "./sysctl0" #define SYSCTL1_PARENT "debug" #define SYSCTL1_NAME "debug.minidump" +#define SYSCTL1_FILE "./sysctl1" -static int ntest = 1; - -#define CHECK(expr) do { \ - if ((expr)) \ - printf("ok %d # %s:%u\n", ntest, __FILE__, __LINE__); \ - else \ - printf("not ok %d # %s:%u\n", ntest, __FILE__, __LINE__); \ - fflush(stdout); \ - ntest++; \ -} while (0) -#define CHECKX(expr) do { \ - if ((expr)) { \ - printf("ok %d # %s:%u\n", ntest, __FILE__, __LINE__); \ - } else { \ - printf("not ok %d # %s:%u\n", ntest, __FILE__, __LINE__); \ - exit(1); \ - } \ - fflush(stdout); \ - ntest++; \ -} while (0) - #define SYSCTL0_READ0 0x0001 #define SYSCTL0_READ1 0x0002 #define SYSCTL0_READ2 0x0004 @@ -94,8 +76,77 @@ static int ntest = 1; #define SYSCTL1_WRITE 0x0100 #define SYSCTL1_READ_WRITE 0x0200 +static void +save_int_sysctl(const char *name, const char *file) +{ + ssize_t n; + size_t sz; + int error, fd, val; + + sz = sizeof(val); + error = sysctlbyname(name, &val, &sz, NULL, 0); + ATF_REQUIRE_MSG(error == 0, + "sysctlbyname(%s): %s", name, strerror(errno)); + + fd = open(file, O_CREAT | O_WRONLY, 0600); + ATF_REQUIRE_MSG(fd >= 0, "open(%s): %s", file, strerror(errno)); + n = write(fd, &val, sz); + ATF_REQUIRE(n >= 0 && (size_t)n == sz); + error = close(fd); + ATF_REQUIRE(error == 0); +} + +static void +restore_int_sysctl(const char *name, const char *file) +{ + ssize_t n; + size_t sz; + int error, fd, val; + + fd = open(file, O_RDONLY); + ATF_REQUIRE(fd >= 0); + sz = sizeof(val); + n = read(fd, &val, sz); + ATF_REQUIRE(n >= 0 && (size_t)n == sz); + error = unlink(file); + ATF_REQUIRE(error == 0); + error = close(fd); + ATF_REQUIRE(error == 0); + + error = sysctlbyname(name, NULL, NULL, &val, sz); + ATF_REQUIRE_MSG(error == 0, + "sysctlbyname(%s): %s", name, strerror(errno)); +} + +static cap_channel_t * +initcap(void) +{ + cap_channel_t *capcas, *capsysctl; + + save_int_sysctl(SYSCTL0_NAME, SYSCTL0_FILE); + save_int_sysctl(SYSCTL1_NAME, SYSCTL1_FILE); + + capcas = cap_init(); + ATF_REQUIRE(capcas != NULL); + + capsysctl = cap_service_open(capcas, "system.sysctl"); + ATF_REQUIRE(capsysctl != NULL); + + cap_close(capcas); + + return (capsysctl); +} + +static void +cleanup(void) +{ + + restore_int_sysctl(SYSCTL0_NAME, SYSCTL0_FILE); + restore_int_sysctl(SYSCTL1_NAME, SYSCTL1_FILE); +} + static unsigned int -runtest(cap_channel_t *capsysctl) +checkcaps(cap_channel_t *capsysctl) { unsigned int result; int oldvalue, newvalue; @@ -184,27 +235,32 @@ runtest(cap_channel_t *capsysctl) return (result); } -static void -test_operation(cap_channel_t *origcapsysctl) +ATF_TC_WITH_CLEANUP(cap_sysctl__operation); +ATF_TC_HEAD(cap_sysctl__operation, tc) { - cap_channel_t *capsysctl; +} +ATF_TC_BODY(cap_sysctl__operation, tc) +{ + cap_channel_t *capsysctl, *ocapsysctl; void *limit; + ocapsysctl = initcap(); + /* * Allow: * SYSCTL0_PARENT/RDWR/RECURSIVE * SYSCTL1_PARENT/RDWR/RECURSIVE */ - capsysctl = cap_clone(origcapsysctl); - CHECK(capsysctl != NULL); + capsysctl = cap_clone(ocapsysctl); + ATF_REQUIRE(capsysctl != NULL); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == 0); + ATF_REQUIRE(cap_sysctl_limit(limit) == 0); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, @@ -213,14 +269,14 @@ test_operation(cap_channel_t *origcapsysctl) CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, "foo.bar", CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, "foo.bar", CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); - CHECK(runtest(capsysctl) == (SYSCTL0_READ0 | SYSCTL0_READ1 | + ATF_REQUIRE(checkcaps(capsysctl) == (SYSCTL0_READ0 | SYSCTL0_READ1 | SYSCTL0_READ2 | SYSCTL0_WRITE | SYSCTL0_READ_WRITE | SYSCTL1_READ0 | SYSCTL1_READ1 | SYSCTL1_READ2 | SYSCTL1_WRITE | SYSCTL1_READ_WRITE)); @@ -230,9 +286,9 @@ test_operation(cap_channel_t *origcapsysctl) CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == 0); + ATF_REQUIRE(cap_sysctl_limit(limit) == 0); - CHECK(runtest(capsysctl) == (SYSCTL0_READ0 | SYSCTL0_READ1 | + ATF_REQUIRE(checkcaps(capsysctl) == (SYSCTL0_READ0 | SYSCTL0_READ1 | SYSCTL0_READ2 | SYSCTL0_WRITE | SYSCTL0_READ_WRITE | SYSCTL1_READ0 | SYSCTL1_READ1 | SYSCTL1_READ2 | SYSCTL1_WRITE | SYSCTL1_READ_WRITE)); @@ -242,22 +298,22 @@ test_operation(cap_channel_t *origcapsysctl) CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == 0); + ATF_REQUIRE(cap_sysctl_limit(limit) == 0); - CHECK(runtest(capsysctl) == (SYSCTL0_READ0 | SYSCTL1_WRITE)); + ATF_REQUIRE(checkcaps(capsysctl) == (SYSCTL0_READ0 | SYSCTL1_WRITE)); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_READ); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_WRITE); - CHECK(cap_sysctl_limit(limit) == 0); + ATF_REQUIRE(cap_sysctl_limit(limit) == 0); - CHECK(runtest(capsysctl) == (SYSCTL0_READ0 | SYSCTL1_WRITE)); + ATF_REQUIRE(checkcaps(capsysctl) == (SYSCTL0_READ0 | SYSCTL1_WRITE)); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_READ); - CHECK(cap_sysctl_limit(limit) == 0); + ATF_REQUIRE(cap_sysctl_limit(limit) == 0); - CHECK(runtest(capsysctl) == SYSCTL0_READ0); + ATF_REQUIRE(checkcaps(capsysctl) == SYSCTL0_READ0); cap_close(capsysctl); @@ -267,35 +323,35 @@ test_operation(cap_channel_t *origcapsysctl) * SYSCTL1_NAME/RDWR/RECURSIVE */ - capsysctl = cap_clone(origcapsysctl); - CHECK(capsysctl != NULL); + capsysctl = cap_clone(ocapsysctl); + ATF_REQUIRE(capsysctl != NULL); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == 0); + ATF_REQUIRE(cap_sysctl_limit(limit) == 0); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_READ); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_WRITE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_READ); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); - CHECK(runtest(capsysctl) == (SYSCTL0_READ0 | SYSCTL0_READ1 | + ATF_REQUIRE(checkcaps(capsysctl) == (SYSCTL0_READ0 | SYSCTL0_READ1 | SYSCTL0_READ2 | SYSCTL0_WRITE | SYSCTL0_READ_WRITE | SYSCTL1_READ0 | SYSCTL1_READ1 | SYSCTL1_READ2 | SYSCTL1_WRITE | SYSCTL1_READ_WRITE)); @@ -308,31 +364,31 @@ test_operation(cap_channel_t *origcapsysctl) * SYSCTL1_PARENT/RDWR */ - capsysctl = cap_clone(origcapsysctl); - CHECK(capsysctl != NULL); + capsysctl = cap_clone(ocapsysctl); + ATF_REQUIRE(capsysctl != NULL); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR); - CHECK(cap_sysctl_limit(limit) == 0); + ATF_REQUIRE(cap_sysctl_limit(limit) == 0); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); - CHECK(runtest(capsysctl) == 0); + ATF_REQUIRE(checkcaps(capsysctl) == 0); cap_close(capsysctl); @@ -342,31 +398,31 @@ test_operation(cap_channel_t *origcapsysctl) * SYSCTL1_NAME/RDWR */ - capsysctl = cap_clone(origcapsysctl); - CHECK(capsysctl != NULL); + capsysctl = cap_clone(ocapsysctl); + ATF_REQUIRE(capsysctl != NULL); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_RDWR); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_RDWR); - CHECK(cap_sysctl_limit(limit) == 0); + ATF_REQUIRE(cap_sysctl_limit(limit) == 0); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); - CHECK(runtest(capsysctl) == (SYSCTL0_READ0 | SYSCTL0_READ1 | + ATF_REQUIRE(checkcaps(capsysctl) == (SYSCTL0_READ0 | SYSCTL0_READ1 | SYSCTL0_READ2 | SYSCTL0_WRITE | SYSCTL0_READ_WRITE | SYSCTL1_READ0 | SYSCTL1_READ1 | SYSCTL1_READ2 | SYSCTL1_WRITE | SYSCTL1_READ_WRITE)); @@ -379,34 +435,34 @@ test_operation(cap_channel_t *origcapsysctl) * SYSCTL1_PARENT/RDWR/RECURSIVE */ - capsysctl = cap_clone(origcapsysctl); - CHECK(capsysctl != NULL); + capsysctl = cap_clone(ocapsysctl); + ATF_REQUIRE(capsysctl != NULL); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == 0); + ATF_REQUIRE(cap_sysctl_limit(limit) == 0); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); - CHECK(runtest(capsysctl) == (SYSCTL1_READ0 | SYSCTL1_READ1 | + ATF_REQUIRE(checkcaps(capsysctl) == (SYSCTL1_READ0 | SYSCTL1_READ1 | SYSCTL1_READ2 | SYSCTL1_WRITE | SYSCTL1_READ_WRITE)); cap_close(capsysctl); @@ -417,30 +473,30 @@ test_operation(cap_channel_t *origcapsysctl) * SYSCTL1_NAME/RDWR/RECURSIVE */ - capsysctl = cap_clone(origcapsysctl); - CHECK(capsysctl != NULL); + capsysctl = cap_clone(ocapsysctl); + ATF_REQUIRE(capsysctl != NULL); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_RDWR); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == 0); + ATF_REQUIRE(cap_sysctl_limit(limit) == 0); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); - CHECK(runtest(capsysctl) == (SYSCTL0_READ0 | SYSCTL0_READ1 | + ATF_REQUIRE(checkcaps(capsysctl) == (SYSCTL0_READ0 | SYSCTL0_READ1 | SYSCTL0_READ2 | SYSCTL0_WRITE | SYSCTL0_READ_WRITE | SYSCTL1_READ0 | SYSCTL1_READ1 | SYSCTL1_READ2 | SYSCTL1_WRITE | SYSCTL1_READ_WRITE)); @@ -453,51 +509,51 @@ test_operation(cap_channel_t *origcapsysctl) * SYSCTL1_PARENT/READ/RECURSIVE */ - capsysctl = cap_clone(origcapsysctl); - CHECK(capsysctl != NULL); + capsysctl = cap_clone(ocapsysctl); + ATF_REQUIRE(capsysctl != NULL); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == 0); + ATF_REQUIRE(cap_sysctl_limit(limit) == 0); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_WRITE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_WRITE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_WRITE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); - CHECK(runtest(capsysctl) == (SYSCTL0_READ0 | SYSCTL1_READ0)); + ATF_REQUIRE(checkcaps(capsysctl) == (SYSCTL0_READ0 | SYSCTL1_READ0)); cap_close(capsysctl); @@ -507,51 +563,51 @@ test_operation(cap_channel_t *origcapsysctl) * SYSCTL1_NAME/READ/RECURSIVE */ - capsysctl = cap_clone(origcapsysctl); - CHECK(capsysctl != NULL); + capsysctl = cap_clone(ocapsysctl); + ATF_REQUIRE(capsysctl != NULL); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == 0); + ATF_REQUIRE(cap_sysctl_limit(limit) == 0); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_RDWR); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_RDWR); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_WRITE); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_WRITE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_RDWR); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_WRITE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); - CHECK(runtest(capsysctl) == (SYSCTL0_READ0 | SYSCTL1_READ0)); + ATF_REQUIRE(checkcaps(capsysctl) == (SYSCTL0_READ0 | SYSCTL1_READ0)); cap_close(capsysctl); @@ -561,59 +617,59 @@ test_operation(cap_channel_t *origcapsysctl) * SYSCTL1_PARENT/READ */ - capsysctl = cap_clone(origcapsysctl); - CHECK(capsysctl != NULL); + capsysctl = cap_clone(ocapsysctl); + ATF_REQUIRE(capsysctl != NULL); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_READ); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_READ); - CHECK(cap_sysctl_limit(limit) == 0); + ATF_REQUIRE(cap_sysctl_limit(limit) == 0); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_WRITE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_WRITE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_WRITE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); - CHECK(runtest(capsysctl) == 0); + ATF_REQUIRE(checkcaps(capsysctl) == 0); cap_close(capsysctl); @@ -623,59 +679,59 @@ test_operation(cap_channel_t *origcapsysctl) * SYSCTL1_NAME/READ */ - capsysctl = cap_clone(origcapsysctl); - CHECK(capsysctl != NULL); + capsysctl = cap_clone(ocapsysctl); + ATF_REQUIRE(capsysctl != NULL); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_READ); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_READ); - CHECK(cap_sysctl_limit(limit) == 0); + ATF_REQUIRE(cap_sysctl_limit(limit) == 0); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_RDWR); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_RDWR); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_WRITE); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_WRITE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_RDWR); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_WRITE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); - CHECK(runtest(capsysctl) == (SYSCTL0_READ0 | SYSCTL1_READ0)); + ATF_REQUIRE(checkcaps(capsysctl) == (SYSCTL0_READ0 | SYSCTL1_READ0)); cap_close(capsysctl); @@ -685,21 +741,21 @@ test_operation(cap_channel_t *origcapsysctl) * SYSCTL1_PARENT/READ/RECURSIVE */ - capsysctl = cap_clone(origcapsysctl); - CHECK(capsysctl != NULL); + capsysctl = cap_clone(ocapsysctl); + ATF_REQUIRE(capsysctl != NULL); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_READ); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == 0); + ATF_REQUIRE(cap_sysctl_limit(limit) == 0); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_READ); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); - CHECK(runtest(capsysctl) == SYSCTL1_READ0); + ATF_REQUIRE(checkcaps(capsysctl) == SYSCTL1_READ0); cap_close(capsysctl); @@ -709,21 +765,21 @@ test_operation(cap_channel_t *origcapsysctl) * SYSCTL1_NAME/READ/RECURSIVE */ - capsysctl = cap_clone(origcapsysctl); - CHECK(capsysctl != NULL); + capsysctl = cap_clone(ocapsysctl); + ATF_REQUIRE(capsysctl != NULL); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_READ); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == 0); + ATF_REQUIRE(cap_sysctl_limit(limit) == 0); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_READ); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); - CHECK(runtest(capsysctl) == (SYSCTL0_READ0 | SYSCTL1_READ0)); + ATF_REQUIRE(checkcaps(capsysctl) == (SYSCTL0_READ0 | SYSCTL1_READ0)); cap_close(capsysctl); @@ -733,51 +789,51 @@ test_operation(cap_channel_t *origcapsysctl) * SYSCTL1_PARENT/WRITE/RECURSIVE */ - capsysctl = cap_clone(origcapsysctl); - CHECK(capsysctl != NULL); + capsysctl = cap_clone(ocapsysctl); + ATF_REQUIRE(capsysctl != NULL); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == 0); + ATF_REQUIRE(cap_sysctl_limit(limit) == 0); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_READ); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_READ); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_READ); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); - CHECK(runtest(capsysctl) == (SYSCTL0_WRITE | SYSCTL1_WRITE)); + ATF_REQUIRE(checkcaps(capsysctl) == (SYSCTL0_WRITE | SYSCTL1_WRITE)); cap_close(capsysctl); @@ -787,51 +843,51 @@ test_operation(cap_channel_t *origcapsysctl) * SYSCTL1_NAME/WRITE/RECURSIVE */ - capsysctl = cap_clone(origcapsysctl); - CHECK(capsysctl != NULL); + capsysctl = cap_clone(ocapsysctl); + ATF_REQUIRE(capsysctl != NULL); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == 0); + ATF_REQUIRE(cap_sysctl_limit(limit) == 0); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_RDWR); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_RDWR); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_READ); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_READ); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_RDWR); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_READ); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); - CHECK(runtest(capsysctl) == (SYSCTL0_WRITE | SYSCTL1_WRITE)); + ATF_REQUIRE(checkcaps(capsysctl) == (SYSCTL0_WRITE | SYSCTL1_WRITE)); cap_close(capsysctl); @@ -841,59 +897,59 @@ test_operation(cap_channel_t *origcapsysctl) * SYSCTL1_PARENT/WRITE */ - capsysctl = cap_clone(origcapsysctl); - CHECK(capsysctl != NULL); + capsysctl = cap_clone(ocapsysctl); + ATF_REQUIRE(capsysctl != NULL); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_WRITE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_WRITE); - CHECK(cap_sysctl_limit(limit) == 0); + ATF_REQUIRE(cap_sysctl_limit(limit) == 0); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_READ); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_READ); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL1_PARENT, CAP_SYSCTL_RDWR); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_PARENT, CAP_SYSCTL_READ); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); - CHECK(runtest(capsysctl) == 0); + ATF_REQUIRE(checkcaps(capsysctl) == 0); cap_close(capsysctl); @@ -903,59 +959,59 @@ test_operation(cap_channel_t *origcapsysctl) * SYSCTL1_NAME/WRITE */ - capsysctl = cap_clone(origcapsysctl); - CHECK(capsysctl != NULL); + capsysctl = cap_clone(ocapsysctl); + ATF_REQUIRE(capsysctl != NULL); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_WRITE); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_WRITE); - CHECK(cap_sysctl_limit(limit) == 0); + ATF_REQUIRE(cap_sysctl_limit(limit) == 0); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_WRITE | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); (void)cap_sysctl_limit_name(limit, SYSCTL1_NAME, CAP_SYSCTL_READ | CAP_SYSCTL_RECURSIVE); - CHECK(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); + ATF_REQUIRE(cap_sysctl_limit(limit) == -1 && errno == ENOTCAPABLE); limit = cap_sysctl_limit_init(capsysctl); (void)cap_sysctl_limit_name(limit, SYSCTL0_NAME, CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon May 13 17:53:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A45E51596B2E; Mon, 13 May 2019 17:53:04 +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 48A1B8CF45; Mon, 13 May 2019 17:53:04 +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 08BFAD5CB; Mon, 13 May 2019 17:53:04 +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 x4DHr3ab025689; Mon, 13 May 2019 17:53:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4DHr3uR025688; Mon, 13 May 2019 17:53:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905131753.x4DHr3uR025688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 13 May 2019 17:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347536 - head/lib/libcasper/services/cap_sysctl/tests X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libcasper/services/cap_sysctl/tests X-SVN-Commit-Revision: 347536 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48A1B8CF45 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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, 13 May 2019 17:53:04 -0000 Author: markj Date: Mon May 13 17:53:03 2019 New Revision: 347536 URL: https://svnweb.freebsd.org/changeset/base/347536 Log: Extend the libcap_sysctl tests. - Add some coverage for cap_sysctl(3). - Add a test for the case where the caller wishes to find the sysctl output length without specifying an output buffer. Reviewed by: oshogbo Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17856 Modified: head/lib/libcasper/services/cap_sysctl/tests/sysctl_test.c Modified: head/lib/libcasper/services/cap_sysctl/tests/sysctl_test.c ============================================================================== --- head/lib/libcasper/services/cap_sysctl/tests/sysctl_test.c Mon May 13 17:51:03 2019 (r347535) +++ head/lib/libcasper/services/cap_sysctl/tests/sysctl_test.c Mon May 13 17:53:03 2019 (r347536) @@ -149,17 +149,27 @@ static unsigned int checkcaps(cap_channel_t *capsysctl) { unsigned int result; - int oldvalue, newvalue; - size_t oldsize; + size_t len0, len1, oldsize; + int error, mib0[2], mib1[2], oldvalue, newvalue; result = 0; + len0 = nitems(mib0); + ATF_REQUIRE(sysctlnametomib(SYSCTL0_NAME, mib0, &len0) == 0); + len1 = nitems(mib1); + ATF_REQUIRE(sysctlnametomib(SYSCTL1_NAME, mib1, &len1) == 0); + oldsize = sizeof(oldvalue); if (cap_sysctlbyname(capsysctl, SYSCTL0_NAME, &oldvalue, &oldsize, NULL, 0) == 0) { if (oldsize == sizeof(oldvalue)) result |= SYSCTL0_READ0; } + error = cap_sysctl(capsysctl, mib0, len0, &oldvalue, &oldsize, NULL, 0); + if ((result & SYSCTL0_READ0) != 0) + ATF_REQUIRE(error == 0); + else + ATF_REQUIRE_ERRNO(ENOTCAPABLE, error != 0); newvalue = 123; if (cap_sysctlbyname(capsysctl, SYSCTL0_NAME, NULL, NULL, &newvalue, @@ -175,6 +185,13 @@ checkcaps(cap_channel_t *capsysctl) result |= SYSCTL0_READ1; } } + newvalue = 123; + error = cap_sysctl(capsysctl, mib0, len0, NULL, NULL, + &newvalue, sizeof(newvalue)); + if ((result & SYSCTL0_WRITE) != 0) + ATF_REQUIRE(error == 0); + else + ATF_REQUIRE_ERRNO(ENOTCAPABLE, error != 0); oldsize = sizeof(oldvalue); newvalue = 4567; @@ -199,6 +216,11 @@ checkcaps(cap_channel_t *capsysctl) if (oldsize == sizeof(oldvalue)) result |= SYSCTL1_READ0; } + error = cap_sysctl(capsysctl, mib1, len1, &oldvalue, &oldsize, NULL, 0); + if ((result & SYSCTL1_READ0) != 0) + ATF_REQUIRE(error == 0); + else + ATF_REQUIRE_ERRNO(ENOTCAPABLE, error != 0); newvalue = 506; if (cap_sysctlbyname(capsysctl, SYSCTL1_NAME, NULL, NULL, &newvalue, @@ -207,6 +229,10 @@ checkcaps(cap_channel_t *capsysctl) } if ((result & SYSCTL1_WRITE) != 0) { + newvalue = 506; + ATF_REQUIRE(cap_sysctl(capsysctl, mib1, len1, NULL, NULL, + &newvalue, sizeof(newvalue)) == 0); + oldsize = sizeof(oldvalue); if (cap_sysctlbyname(capsysctl, SYSCTL1_NAME, &oldvalue, &oldsize, NULL, 0) == 0) { @@ -214,6 +240,13 @@ checkcaps(cap_channel_t *capsysctl) result |= SYSCTL1_READ1; } } + newvalue = 506; + error = cap_sysctl(capsysctl, mib1, len1, NULL, NULL, + &newvalue, sizeof(newvalue)); + if ((result & SYSCTL1_WRITE) != 0) + ATF_REQUIRE(error == 0); + else + ATF_REQUIRE_ERRNO(ENOTCAPABLE, error != 0); oldsize = sizeof(oldvalue); newvalue = 7008; @@ -1563,11 +1596,98 @@ ATF_TC_CLEANUP(cap_sysctl__no_limits, tc) cleanup(); } +ATF_TC_WITH_CLEANUP(cap_sysctl__recursive_limits); +ATF_TC_HEAD(cap_sysctl__recursive_limits, tc) +{ +} +ATF_TC_BODY(cap_sysctl__recursive_limits, tc) +{ + cap_channel_t *capsysctl, *ocapsysctl; + void *limit; + size_t len; + int mib[2], val = 420; + + len = nitems(mib); + ATF_REQUIRE(sysctlnametomib(SYSCTL0_NAME, mib, &len) == 0); + + ocapsysctl = initcap(); + + /* + * Make sure that we match entire components. + */ + capsysctl = cap_clone(ocapsysctl); + ATF_REQUIRE(capsysctl != NULL); + + limit = cap_sysctl_limit_init(capsysctl); + (void)cap_sysctl_limit_name(limit, "ker", + CAP_SYSCTL_RDWR | CAP_SYSCTL_RECURSIVE); + ATF_REQUIRE(cap_sysctl_limit(limit) == 0); + + ATF_REQUIRE_ERRNO(ENOTCAPABLE, cap_sysctlbyname(capsysctl, SYSCTL0_NAME, + NULL, NULL, &val, sizeof(val))); + ATF_REQUIRE_ERRNO(ENOTCAPABLE, cap_sysctl(capsysctl, mib, len, + NULL, NULL, &val, sizeof(val))); + + cap_close(capsysctl); + + /* + * Verify that we check for CAP_SYSCTL_RECURSIVE. + */ + capsysctl = cap_clone(ocapsysctl); + ATF_REQUIRE(capsysctl != NULL); + + limit = cap_sysctl_limit_init(capsysctl); + (void)cap_sysctl_limit_name(limit, "kern", CAP_SYSCTL_RDWR); + ATF_REQUIRE(cap_sysctl_limit(limit) == 0); + + ATF_REQUIRE_ERRNO(ENOTCAPABLE, cap_sysctlbyname(capsysctl, SYSCTL0_NAME, + NULL, NULL, &val, sizeof(val))); + ATF_REQUIRE_ERRNO(ENOTCAPABLE, cap_sysctl(capsysctl, mib, len, + NULL, NULL, &val, sizeof(val))); + + cap_close(capsysctl); +} +ATF_TC_CLEANUP(cap_sysctl__recursive_limits, tc) +{ + cleanup(); +} + +ATF_TC_WITH_CLEANUP(cap_sysctl__just_size); +ATF_TC_HEAD(cap_sysctl__just_size, tc) +{ +} +ATF_TC_BODY(cap_sysctl__just_size, tc) +{ + cap_channel_t *capsysctl; + size_t len; + int mib0[2]; + + capsysctl = initcap(); + + len = nitems(mib0); + ATF_REQUIRE(sysctlnametomib(SYSCTL0_NAME, mib0, &len) == 0); + + ATF_REQUIRE(cap_sysctlbyname(capsysctl, SYSCTL0_NAME, + NULL, &len, NULL, 0) == 0); + ATF_REQUIRE(len == sizeof(int)); + ATF_REQUIRE(cap_sysctl(capsysctl, mib0, nitems(mib0), + NULL, &len, NULL, 0) == 0); + ATF_REQUIRE(len == sizeof(int)); + + cap_close(capsysctl); +} +ATF_TC_CLEANUP(cap_sysctl__just_size, tc) +{ + cleanup(); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, cap_sysctl__operation); ATF_TP_ADD_TC(tp, cap_sysctl__names); ATF_TP_ADD_TC(tp, cap_sysctl__no_limits); + ATF_TP_ADD_TC(tp, cap_sysctl__recursive_limits); + ATF_TP_ADD_TC(tp, cap_sysctl__just_size); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Mon May 13 18:14:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24FFB15976AC; Mon, 13 May 2019 18:14:21 +0000 (UTC) (envelope-from dchagin@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 BDFA38DA90; Mon, 13 May 2019 18:14:20 +0000 (UTC) (envelope-from dchagin@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 8CDA6D91B; Mon, 13 May 2019 18:14:20 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4DIEKSI036052; Mon, 13 May 2019 18:14:20 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4DIEKLP036051; Mon, 13 May 2019 18:14:20 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905131814.x4DIEKLP036051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Mon, 13 May 2019 18:14:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347537 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 347537 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BDFA38DA90 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Mon, 13 May 2019 18:14:21 -0000 Author: dchagin Date: Mon May 13 18:14:20 2019 New Revision: 347537 URL: https://svnweb.freebsd.org/changeset/base/347537 Log: Linuxulator getpeername() returns EINVAL in case then namelen less then 0. MFC after: 2 weeks Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Mon May 13 17:53:03 2019 (r347536) +++ head/sys/compat/linux/linux_socket.c Mon May 13 18:14:20 2019 (r347537) @@ -722,6 +722,8 @@ linux_getpeername(struct thread *td, struct linux_getp error = copyin(PTRIN(args->namelen), &len, sizeof(len)); if (error != 0) return (error); + if (len < 0) + return (EINVAL); error = kern_getpeername(td, args->s, &sa, &len); if (error != 0) From owner-svn-src-head@freebsd.org Mon May 13 18:24:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3016215979D6; Mon, 13 May 2019 18:24:32 +0000 (UTC) (envelope-from dchagin@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 CED0C8DF9C; Mon, 13 May 2019 18:24:31 +0000 (UTC) (envelope-from dchagin@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 A425DDAC8; Mon, 13 May 2019 18:24:31 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4DIOVnK041670; Mon, 13 May 2019 18:24:31 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4DIOTIS041656; Mon, 13 May 2019 18:24:29 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905131824.x4DIOTIS041656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Mon, 13 May 2019 18:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347538 - in head/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux modules/linux modules/linux64 modules/linux_common X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux modules/linux modules/linux64 modules/linux_common X-SVN-Commit-Revision: 347538 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CED0C8DF9C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; 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, 13 May 2019 18:24:32 -0000 Author: dchagin Date: Mon May 13 18:24:29 2019 New Revision: 347538 URL: https://svnweb.freebsd.org/changeset/base/347538 Log: Linuxulator depends on a fundamental kernel settings such as SMP. Many of them listed in opt_global.h which is not generated while building modules outside of a kernel and such modules never match real cofigured kernel. So, we should prevent our users from building obviously defective modules. Therefore, remove the root cause of the building of modules outside of a kernel - the possibility of building modules with DEBUG or KTR flags. And remove all of DEBUG printfs as it is incomplete and in threaded programms not informative, also a half of system call does not have DEBUG printf. For debuging Linux programms we have dtrace, ktr and ktrace ability. PR: 222861 Reviewed by: trasz MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20178 Modified: head/sys/amd64/linux/linux.h head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux.h head/sys/amd64/linux32/linux32_machdep.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/arm64/linux/linux.h head/sys/arm64/linux/linux_sysvec.c head/sys/compat/linux/linux_file.c head/sys/compat/linux/linux_fork.c head/sys/compat/linux/linux_getcwd.c head/sys/compat/linux/linux_ioctl.c head/sys/compat/linux/linux_misc.c head/sys/compat/linux/linux_misc.h head/sys/compat/linux/linux_signal.c head/sys/compat/linux/linux_stats.c head/sys/i386/linux/linux.h head/sys/i386/linux/linux_machdep.c head/sys/i386/linux/linux_sysvec.c head/sys/modules/linux/Makefile head/sys/modules/linux64/Makefile head/sys/modules/linux_common/Makefile Modified: head/sys/amd64/linux/linux.h ============================================================================== --- head/sys/amd64/linux/linux.h Mon May 13 18:14:20 2019 (r347537) +++ head/sys/amd64/linux/linux.h Mon May 13 18:24:29 2019 (r347538) @@ -37,15 +37,6 @@ #define LINUX_LEGACY_SYSCALLS -/* - * debugging support - */ -extern u_char linux_debug_map[]; -#define ldebug(name) isclr(linux_debug_map, LINUX_SYS_linux_ ## name) -#define ARGS(nm, fmt) "linux(%ld/%ld): "#nm"("fmt")\n", \ - (long)td->td_proc->p_pid, (long)td->td_tid -#define LMSG(fmt) "linux(%ld/%ld): "fmt"\n", \ - (long)td->td_proc->p_pid, (long)td->td_tid #define LINUX_DTRACE linuxulator #define PTRIN(v) (void *)(v) Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Mon May 13 18:14:20 2019 (r347537) +++ head/sys/amd64/linux/linux_sysvec.c Mon May 13 18:24:29 2019 (r347538) @@ -86,20 +86,6 @@ __FBSDID("$FreeBSD$"); MODULE_VERSION(linux64, 1); -#if defined(DEBUG) -SYSCTL_PROC(_compat_linux, OID_AUTO, debug, - CTLTYPE_STRING | CTLFLAG_RW, - 0, 0, linux_sysctl_debug, "A", - "Linux 64 debugging control"); -#endif - -/* - * Allow the sendsig functions to use the ldebug() facility even though they - * are not syscalls themselves. Map them to syscall 0. This is slightly less - * bogus than using ldebug(sigreturn). - */ -#define LINUX_SYS_linux_rt_sendsig 0 - const char *linux_kplatform; static int linux_szsigcode; static vm_object_t linux_shared_page_obj; @@ -645,9 +631,6 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse /* Copy the sigframe out to the user's stack. */ if (copyout(&sf, sfp, sizeof(*sfp)) != 0) { -#ifdef DEBUG - printf("process %ld has trashed its stack\n", (long)p->p_pid); -#endif PROC_LOCK(p); sigexit(td, SIGILL); } Modified: head/sys/amd64/linux32/linux.h ============================================================================== --- head/sys/amd64/linux32/linux.h Mon May 13 18:14:20 2019 (r347537) +++ head/sys/amd64/linux32/linux.h Mon May 13 18:24:29 2019 (r347538) @@ -40,15 +40,6 @@ #define LINUX_LEGACY_SYSCALLS -/* - * debugging support - */ -extern u_char linux_debug_map[]; -#define ldebug(name) isclr(linux_debug_map, LINUX32_SYS_linux_ ## name) -#define ARGS(nm, fmt) "linux(%ld/%ld): "#nm"("fmt")\n", \ - (long)td->td_proc->p_pid, (long)td->td_tid -#define LMSG(fmt) "linux(%ld/%ld): "fmt"\n", \ - (long)td->td_proc->p_pid, (long)td->td_tid #define LINUX_DTRACE linuxulator32 #define LINUX32_MAXUSER ((1ul << 32) - PAGE_SIZE) Modified: head/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- head/sys/amd64/linux32/linux32_machdep.c Mon May 13 18:14:20 2019 (r347537) +++ head/sys/amd64/linux32/linux32_machdep.c Mon May 13 18:24:29 2019 (r347538) @@ -133,11 +133,6 @@ linux_execve(struct thread *td, struct linux_execve_ar LCONVPATHEXIST(td, args->path, &path); -#ifdef DEBUG - if (ldebug(execve)) - printf(ARGS(execve, "%s"), path); -#endif - error = freebsd32_exec_copyin_args(&eargs, path, UIO_SYSSPACE, args->argp, args->envp); free(path, M_TEMP); @@ -382,11 +377,6 @@ linux_old_select(struct thread *td, struct linux_old_s struct linux_select_args newsel; int error; -#ifdef DEBUG - if (ldebug(old_select)) - printf(ARGS(old_select, "%p"), args->ptr); -#endif - error = copyin(args->ptr, &linux_args, sizeof(linux_args)); if (error) return (error); @@ -410,29 +400,19 @@ linux_set_cloned_tls(struct thread *td, void *desc) error = copyin(desc, &info, sizeof(struct l_user_desc)); if (error) { - printf(LMSG("copyin failed!")); + linux_msg(td, "set_cloned_tls copyin info failed!"); } else { + /* We might copy out the entry_number as GUGS32_SEL. */ info.entry_number = GUGS32_SEL; error = copyout(&info, desc, sizeof(struct l_user_desc)); if (error) - printf(LMSG("copyout failed!")); + linux_msg(td, "set_cloned_tls copyout info failed!"); a[0] = LINUX_LDT_entry_a(&info); a[1] = LINUX_LDT_entry_b(&info); memcpy(&sd, &a, sizeof(a)); -#ifdef DEBUG - if (ldebug(clone)) - printf("Segment created in clone with " - "CLONE_SETTLS: lobase: %x, hibase: %x, " - "lolimit: %x, hilimit: %x, type: %i, " - "dpl: %i, p: %i, xx: %i, long: %i, " - "def32: %i, gran: %i\n", sd.sd_lobase, - sd.sd_hibase, sd.sd_lolimit, sd.sd_hilimit, - sd.sd_type, sd.sd_dpl, sd.sd_p, sd.sd_xx, - sd.sd_long, sd.sd_def32, sd.sd_gran); -#endif pcb = td->td_pcb; pcb->pcb_gsbase = (register_t)info.base_addr; td->td_frame->tf_gs = GSEL(GUGS32_SEL, SEL_UPL); @@ -461,13 +441,6 @@ int linux_mmap2(struct thread *td, struct linux_mmap2_args *args) { -#ifdef DEBUG - if (ldebug(mmap2)) - printf(ARGS(mmap2, "0x%08x, %d, %d, 0x%08x, %d, %d"), - args->addr, args->len, args->prot, - args->flags, args->fd, args->pgoff); -#endif - return (linux_mmap_common(td, PTROUT(args->addr), args->len, args->prot, args->flags, args->fd, (uint64_t)(uint32_t)args->pgoff * PAGE_SIZE)); @@ -483,13 +456,6 @@ linux_mmap(struct thread *td, struct linux_mmap_args * if (error) return (error); -#ifdef DEBUG - if (ldebug(mmap)) - printf(ARGS(mmap, "0x%08x, %d, %d, 0x%08x, %d, %d"), - linux_args.addr, linux_args.len, linux_args.prot, - linux_args.flags, linux_args.fd, linux_args.pgoff); -#endif - return (linux_mmap_common(td, linux_args.addr, linux_args.len, linux_args.prot, linux_args.flags, linux_args.fd, (uint32_t)linux_args.pgoff)); @@ -526,12 +492,6 @@ linux_sigaction(struct thread *td, struct linux_sigact l_sigaction_t act, oact; int error; -#ifdef DEBUG - if (ldebug(sigaction)) - printf(ARGS(sigaction, "%d, %p, %p"), - args->sig, (void *)args->nsa, (void *)args->osa); -#endif - if (args->nsa != NULL) { error = copyin(args->nsa, &osa, sizeof(l_osigaction_t)); if (error) @@ -568,11 +528,6 @@ linux_sigsuspend(struct thread *td, struct linux_sigsu sigset_t sigmask; l_sigset_t mask; -#ifdef DEBUG - if (ldebug(sigsuspend)) - printf(ARGS(sigsuspend, "%08lx"), (unsigned long)args->mask); -#endif - LINUX_SIGEMPTYSET(mask); mask.__mask = args->mask; linux_to_bsd_sigset(&mask, &sigmask); @@ -586,12 +541,6 @@ linux_rt_sigsuspend(struct thread *td, struct linux_rt sigset_t sigmask; int error; -#ifdef DEBUG - if (ldebug(rt_sigsuspend)) - printf(ARGS(rt_sigsuspend, "%p, %d"), - (void *)uap->newset, uap->sigsetsize); -#endif - if (uap->sigsetsize != sizeof(l_sigset_t)) return (EINVAL); @@ -609,11 +558,6 @@ linux_pause(struct thread *td, struct linux_pause_args struct proc *p = td->td_proc; sigset_t sigmask; -#ifdef DEBUG - if (ldebug(pause)) - printf(ARGS(pause, "")); -#endif - PROC_LOCK(p); sigmask = td->td_sigmask; PROC_UNLOCK(p); @@ -627,11 +571,6 @@ linux_sigaltstack(struct thread *td, struct linux_siga l_stack_t lss; int error; -#ifdef DEBUG - if (ldebug(sigaltstack)) - printf(ARGS(sigaltstack, "%p, %p"), uap->uss, uap->uoss); -#endif - if (uap->uss != NULL) { error = copyin(uap->uss, &lss, sizeof(l_stack_t)); if (error) @@ -657,12 +596,6 @@ int linux_ftruncate64(struct thread *td, struct linux_ftruncate64_args *args) { -#ifdef DEBUG - if (ldebug(ftruncate64)) - printf(ARGS(ftruncate64, "%u, %jd"), args->fd, - (intmax_t)args->length); -#endif - return (kern_ftruncate(td, args->fd, args->length)); } @@ -743,15 +676,6 @@ linux_set_thread_area(struct thread *td, if (error) return (error); -#ifdef DEBUG - if (ldebug(set_thread_area)) - printf(ARGS(set_thread_area, "%i, %x, %x, %i, %i, %i, " - "%i, %i, %i"), info.entry_number, info.base_addr, - info.limit, info.seg_32bit, info.contents, - info.read_exec_only, info.limit_in_pages, - info.seg_not_present, info.useable); -#endif - /* * Semantics of Linux version: every thread in the system has array * of three TLS descriptors. 1st is GLIBC TLS, 2nd is WINE, 3rd unknown. @@ -805,25 +729,6 @@ linux_set_thread_area(struct thread *td, } memcpy(&sd, &a, sizeof(a)); -#ifdef DEBUG - if (ldebug(set_thread_area)) - printf("Segment created in set_thread_area: " - "lobase: %x, hibase: %x, lolimit: %x, hilimit: %x, " - "type: %i, dpl: %i, p: %i, xx: %i, long: %i, " - "def32: %i, gran: %i\n", - sd.sd_lobase, - sd.sd_hibase, - sd.sd_lolimit, - sd.sd_hilimit, - sd.sd_type, - sd.sd_dpl, - sd.sd_p, - sd.sd_xx, - sd.sd_long, - sd.sd_def32, - sd.sd_gran); -#endif - pcb = td->td_pcb; pcb->pcb_gsbase = (register_t)info.base_addr; set_pcb_flags(pcb, PCB_32BIT); Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Mon May 13 18:14:20 2019 (r347537) +++ head/sys/amd64/linux32/linux32_sysvec.c Mon May 13 18:24:29 2019 (r347538) @@ -91,14 +91,6 @@ __FBSDID("$FreeBSD$"); MODULE_VERSION(linux, 1); -/* - * Allow the sendsig functions to use the ldebug() facility even though they - * are not syscalls themselves. Map them to syscall 0. This is slightly less - * bogus than using ldebug(sigreturn). - */ -#define LINUX32_SYS_linux_rt_sendsig 0 -#define LINUX32_SYS_linux_sendsig 0 - const char *linux_kplatform; static int linux_szsigcode; static vm_object_t linux_shared_page_obj; @@ -286,11 +278,6 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse regs = td->td_frame; oonstack = sigonstack(regs->tf_rsp); -#ifdef DEBUG - if (ldebug(rt_sendsig)) - printf(ARGS(rt_sendsig, "%p, %d, %p, %u"), - catcher, sig, (void*)mask, code); -#endif /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { @@ -349,23 +336,11 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse frame.sf_sc.uc_mcontext.sc_cr2 = (u_int32_t)(uintptr_t)ksi->ksi_addr; frame.sf_sc.uc_mcontext.sc_trapno = bsd_to_linux_trapcode(code); -#ifdef DEBUG - if (ldebug(rt_sendsig)) - printf(LMSG("rt_sendsig flags: 0x%x, sp: %p, ss: 0x%lx, mask: 0x%x"), - frame.sf_sc.uc_stack.ss_flags, td->td_sigstk.ss_sp, - td->td_sigstk.ss_size, frame.sf_sc.uc_mcontext.sc_mask); -#endif - if (copyout(&frame, fp, sizeof(frame)) != 0) { /* * Process has trashed its stack; give it an illegal * instruction to halt it in its tracks. */ -#ifdef DEBUG - if (ldebug(rt_sendsig)) - printf(LMSG("rt_sendsig: bad stack %p, oonstack=%x"), - fp, oonstack); -#endif PROC_LOCK(p); sigexit(td, SIGILL); } @@ -423,12 +398,6 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t regs = td->td_frame; oonstack = sigonstack(regs->tf_rsp); -#ifdef DEBUG - if (ldebug(sendsig)) - printf(ARGS(sendsig, "%p, %d, %p, %u"), - catcher, sig, (void*)mask, code); -#endif - /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { @@ -521,10 +490,6 @@ linux_sigreturn(struct thread *td, struct linux_sigret regs = td->td_frame; -#ifdef DEBUG - if (ldebug(sigreturn)) - printf(ARGS(sigreturn, "%p"), (void *)args->sfp); -#endif /* * The trampoline code hands us the sigframe. * It is unsafe to keep track of it ourselves, in the event that a @@ -606,10 +571,6 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_ regs = td->td_frame; -#ifdef DEBUG - if (ldebug(rt_sigreturn)) - printf(ARGS(rt_sigreturn, "%p"), (void *)args->ucp); -#endif /* * The trampoline code hands us the ucontext. * It is unsafe to keep track of it ourselves, in the event that a @@ -674,11 +635,6 @@ linux_rt_sigreturn(struct thread *td, struct linux_rt_ ss.ss_size = lss->ss_size; ss.ss_flags = linux_to_bsd_sigaltstack(lss->ss_flags); -#ifdef DEBUG - if (ldebug(rt_sigreturn)) - printf(LMSG("rt_sigret flags: 0x%x, sp: %p, ss: 0x%lx, mask: 0x%x"), - ss.ss_flags, ss.ss_sp, ss.ss_size, context->sc_mask); -#endif (void)kern_sigaltstack(td, &ss, NULL); return (EJUSTRETURN); @@ -868,11 +824,6 @@ SYSCTL_ULONG(_compat_linux32, OID_AUTO, maxssiz, CTLFL static u_long linux32_maxvmem = LINUX32_MAXVMEM; SYSCTL_ULONG(_compat_linux32, OID_AUTO, maxvmem, CTLFLAG_RW, &linux32_maxvmem, 0, ""); - -#if defined(DEBUG) -SYSCTL_PROC(_compat_linux32, OID_AUTO, debug, CTLTYPE_STRING | CTLFLAG_RW, 0, 0, - linux_sysctl_debug, "A", "Linux debugging control"); -#endif static void linux32_fixlimit(struct rlimit *rl, int which) Modified: head/sys/arm64/linux/linux.h ============================================================================== --- head/sys/arm64/linux/linux.h Mon May 13 18:14:20 2019 (r347537) +++ head/sys/arm64/linux/linux.h Mon May 13 18:24:29 2019 (r347538) @@ -34,14 +34,6 @@ #include #include -/* Debugging support */ -#define DEBUG -extern u_char linux_debug_map[]; -#define ldebug(name) isclr(linux_debug_map, LINUX_SYS_linux_ ## name) -#define ARGS(nm, fmt) "linux(%ld/%ld): "#nm"("fmt")\n", \ - (long)td->td_proc->p_pid, (long)td->td_tid -#define LMSG(fmt) "linux(%ld/%ld): "fmt"\n", \ - (long)td->td_proc->p_pid, (long)td->td_tid #define LINUX_DTRACE linuxulator #define PTRIN(v) (void *)(v) Modified: head/sys/arm64/linux/linux_sysvec.c ============================================================================== --- head/sys/arm64/linux/linux_sysvec.c Mon May 13 18:14:20 2019 (r347537) +++ head/sys/arm64/linux/linux_sysvec.c Mon May 13 18:24:29 2019 (r347538) @@ -59,11 +59,6 @@ __FBSDID("$FreeBSD$"); MODULE_VERSION(linux64elf, 1); -#if defined(DEBUG) -SYSCTL_PROC(_compat_linux, OID_AUTO, debug, CTLTYPE_STRING | CTLFLAG_RW, 0, 0, - linux_sysctl_debug, "A", "64-bit Linux debugging control"); -#endif - const char *linux_kplatform; static int linux_szsigcode; static vm_object_t linux_shared_page_obj; Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Mon May 13 18:14:20 2019 (r347537) +++ head/sys/compat/linux/linux_file.c Mon May 13 18:24:29 2019 (r347538) @@ -76,10 +76,7 @@ linux_creat(struct thread *td, struct linux_creat_args int error; LCONVPATHEXIST(td, args->path, &path); -#ifdef DEBUG - if (ldebug(creat)) - printf(ARGS(creat, "%s, %d"), path, args->mode); -#endif + error = kern_openat(td, AT_FDCWD, path, UIO_SYSSPACE, O_WRONLY | O_CREAT | O_TRUNC, args->mode); LFREEPATH(path); @@ -165,14 +162,6 @@ linux_common_open(struct thread *td, int dirfd, char * } done: -#ifdef DEBUG -#ifdef LINUX_LEGACY_SYSCALLS - if (ldebug(open)) -#else - if (ldebug(openat)) -#endif - printf(LMSG("open returns error %d"), error); -#endif LFREEPATH(path); return (error); } @@ -188,11 +177,7 @@ linux_openat(struct thread *td, struct linux_openat_ar LCONVPATH_AT(td, args->filename, &path, 1, dfd); else LCONVPATH_AT(td, args->filename, &path, 0, dfd); -#ifdef DEBUG - if (ldebug(openat)) - printf(ARGS(openat, "%i, %s, 0x%x, 0x%x"), args->dfd, - path, args->flags, args->mode); -#endif + return (linux_common_open(td, dfd, path, args->flags, args->mode)); } @@ -206,11 +191,7 @@ linux_open(struct thread *td, struct linux_open_args * LCONVPATHCREAT(td, args->path, &path); else LCONVPATHEXIST(td, args->path, &path); -#ifdef DEBUG - if (ldebug(open)) - printf(ARGS(open, "%s, 0x%x, 0x%x"), - path, args->flags, args->mode); -#endif + return (linux_common_open(td, AT_FDCWD, path, args->flags, args->mode)); } #endif @@ -219,11 +200,6 @@ int linux_lseek(struct thread *td, struct linux_lseek_args *args) { -#ifdef DEBUG - if (ldebug(lseek)) - printf(ARGS(lseek, "%d, %ld, %d"), - args->fdes, (long)args->off, args->whence); -#endif return (kern_lseek(td, args->fdes, args->off, args->whence)); } @@ -234,11 +210,6 @@ linux_llseek(struct thread *td, struct linux_llseek_ar int error; off_t off; -#ifdef DEBUG - if (ldebug(llseek)) - printf(ARGS(llseek, "%d, %d:%d, %d"), - args->fd, args->ohigh, args->olow, args->whence); -#endif off = (args->olow) | (((off_t) args->ohigh) << 32); error = kern_lseek(td, args->fd, off, args->whence); @@ -327,10 +298,6 @@ linux_getdents(struct thread *td, struct linux_getdent int buflen, error; size_t retval; -#ifdef DEBUG - if (ldebug(getdents)) - printf(ARGS(getdents, "%d, *, %d"), args->fd, args->count); -#endif buflen = min(args->count, MAXBSIZE); buf = malloc(buflen, M_TEMP, M_WAITOK); @@ -408,10 +375,6 @@ linux_getdents64(struct thread *td, struct linux_getde int buflen, error; size_t retval; -#ifdef DEBUG - if (ldebug(getdents64)) - uprintf(ARGS(getdents64, "%d, *, %d"), args->fd, args->count); -#endif buflen = min(args->count, MAXBSIZE); buf = malloc(buflen, M_TEMP, M_WAITOK); @@ -483,10 +446,6 @@ linux_readdir(struct thread *td, struct linux_readdir_ struct l_dirent *linux_dirent; int buflen, error; -#ifdef DEBUG - if (ldebug(readdir)) - printf(ARGS(readdir, "%d, *"), args->fd); -#endif buflen = LINUX_RECLEN(LINUX_NAME_MAX); buf = malloc(buflen, M_TEMP, M_WAITOK); @@ -539,10 +498,6 @@ linux_access(struct thread *td, struct linux_access_ar LCONVPATHEXIST(td, args->path, &path); -#ifdef DEBUG - if (ldebug(access)) - printf(ARGS(access, "%s, %d"), path, args->amode); -#endif error = kern_accessat(td, AT_FDCWD, path, UIO_SYSSPACE, 0, args->amode); LFREEPATH(path); @@ -564,11 +519,6 @@ linux_faccessat(struct thread *td, struct linux_facces dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd; LCONVPATHEXIST_AT(td, args->filename, &path, dfd); -#ifdef DEBUG - if (ldebug(faccessat)) - printf(ARGS(access, "%s, %d"), path, args->amode); -#endif - error = kern_accessat(td, dfd, path, UIO_SYSSPACE, 0, args->amode); LFREEPATH(path); @@ -585,11 +535,6 @@ linux_unlink(struct thread *td, struct linux_unlink_ar LCONVPATHEXIST(td, args->path, &path); -#ifdef DEBUG - if (ldebug(unlink)) - printf(ARGS(unlink, "%s"), path); -#endif - error = kern_funlinkat(td, AT_FDCWD, path, FD_NONE, UIO_SYSSPACE, 0, 0); if (error == EPERM) { /* Introduce POSIX noncompliant behaviour of Linux */ @@ -617,11 +562,6 @@ linux_unlinkat(struct thread *td, struct linux_unlinka dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd; LCONVPATHEXIST_AT(td, args->pathname, &path, dfd); -#ifdef DEBUG - if (ldebug(unlinkat)) - printf(ARGS(unlinkat, "%s"), path); -#endif - if (args->flag & LINUX_AT_REMOVEDIR) error = kern_frmdirat(td, dfd, path, FD_NONE, UIO_SYSSPACE, 0); else @@ -644,10 +584,6 @@ linux_chdir(struct thread *td, struct linux_chdir_args LCONVPATHEXIST(td, args->path, &path); -#ifdef DEBUG - if (ldebug(chdir)) - printf(ARGS(chdir, "%s"), path); -#endif error = kern_chdir(td, path, UIO_SYSSPACE); LFREEPATH(path); return (error); @@ -662,10 +598,6 @@ linux_chmod(struct thread *td, struct linux_chmod_args LCONVPATHEXIST(td, args->path, &path); -#ifdef DEBUG - if (ldebug(chmod)) - printf(ARGS(chmod, "%s, %d"), path, args->mode); -#endif error = kern_fchmodat(td, AT_FDCWD, path, UIO_SYSSPACE, args->mode, 0); LFREEPATH(path); @@ -682,11 +614,6 @@ linux_fchmodat(struct thread *td, struct linux_fchmoda dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd; LCONVPATHEXIST_AT(td, args->filename, &path, dfd); -#ifdef DEBUG - if (ldebug(fchmodat)) - printf(ARGS(fchmodat, "%s, %d"), path, args->mode); -#endif - error = kern_fchmodat(td, dfd, path, UIO_SYSSPACE, args->mode, 0); LFREEPATH(path); return (error); @@ -701,10 +628,6 @@ linux_mkdir(struct thread *td, struct linux_mkdir_args LCONVPATHCREAT(td, args->path, &path); -#ifdef DEBUG - if (ldebug(mkdir)) - printf(ARGS(mkdir, "%s, %d"), path, args->mode); -#endif error = kern_mkdirat(td, AT_FDCWD, path, UIO_SYSSPACE, args->mode); LFREEPATH(path); return (error); @@ -720,10 +643,6 @@ linux_mkdirat(struct thread *td, struct linux_mkdirat_ dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd; LCONVPATHCREAT_AT(td, args->pathname, &path, dfd); -#ifdef DEBUG - if (ldebug(mkdirat)) - printf(ARGS(mkdirat, "%s, %d"), path, args->mode); -#endif error = kern_mkdirat(td, dfd, path, UIO_SYSSPACE, args->mode); LFREEPATH(path); return (error); @@ -738,10 +657,6 @@ linux_rmdir(struct thread *td, struct linux_rmdir_args LCONVPATHEXIST(td, args->path, &path); -#ifdef DEBUG - if (ldebug(rmdir)) - printf(ARGS(rmdir, "%s"), path); -#endif error = kern_frmdirat(td, AT_FDCWD, path, FD_NONE, UIO_SYSSPACE, 0); LFREEPATH(path); return (error); @@ -761,10 +676,6 @@ linux_rename(struct thread *td, struct linux_rename_ar return (error); } -#ifdef DEBUG - if (ldebug(rename)) - printf(ARGS(rename, "%s, %s"), from, to); -#endif error = kern_renameat(td, AT_FDCWD, from, AT_FDCWD, to, UIO_SYSSPACE); LFREEPATH(from); LFREEPATH(to); @@ -788,10 +699,6 @@ linux_renameat(struct thread *td, struct linux_renamea return (error); } -#ifdef DEBUG - if (ldebug(renameat)) - printf(ARGS(renameat, "%s, %s"), from, to); -#endif error = kern_renameat(td, olddfd, from, newdfd, to, UIO_SYSSPACE); LFREEPATH(from); LFREEPATH(to); @@ -813,10 +720,6 @@ linux_symlink(struct thread *td, struct linux_symlink_ return (error); } -#ifdef DEBUG - if (ldebug(symlink)) - printf(ARGS(symlink, "%s, %s"), path, to); -#endif error = kern_symlinkat(td, path, AT_FDCWD, to, UIO_SYSSPACE); LFREEPATH(path); LFREEPATH(to); @@ -839,11 +742,6 @@ linux_symlinkat(struct thread *td, struct linux_symlin return (error); } -#ifdef DEBUG - if (ldebug(symlinkat)) - printf(ARGS(symlinkat, "%s, %s"), path, to); -#endif - error = kern_symlinkat(td, path, dfd, to, UIO_SYSSPACE); LFREEPATH(path); LFREEPATH(to); @@ -859,11 +757,6 @@ linux_readlink(struct thread *td, struct linux_readlin LCONVPATHEXIST(td, args->name, &name); -#ifdef DEBUG - if (ldebug(readlink)) - printf(ARGS(readlink, "%s, %p, %d"), name, (void *)args->buf, - args->count); -#endif error = kern_readlinkat(td, AT_FDCWD, name, UIO_SYSSPACE, args->buf, UIO_USERSPACE, args->count); LFREEPATH(name); @@ -880,12 +773,6 @@ linux_readlinkat(struct thread *td, struct linux_readl dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd; LCONVPATHEXIST_AT(td, args->path, &name, dfd); -#ifdef DEBUG - if (ldebug(readlinkat)) - printf(ARGS(readlinkat, "%s, %p, %d"), name, (void *)args->buf, - args->bufsiz); -#endif - error = kern_readlinkat(td, dfd, name, UIO_SYSSPACE, args->buf, UIO_USERSPACE, args->bufsiz); LFREEPATH(name); @@ -900,11 +787,6 @@ linux_truncate(struct thread *td, struct linux_truncat LCONVPATHEXIST(td, args->path, &path); -#ifdef DEBUG - if (ldebug(truncate)) - printf(ARGS(truncate, "%s, %ld"), path, (long)args->length); -#endif - error = kern_truncate(td, path, UIO_SYSSPACE, args->length); LFREEPATH(path); return (error); @@ -919,11 +801,6 @@ linux_truncate64(struct thread *td, struct linux_trunc LCONVPATHEXIST(td, args->path, &path); -#ifdef DEBUG - if (ldebug(truncate64)) - printf(ARGS(truncate64, "%s, %jd"), path, args->length); -#endif - error = kern_truncate(td, path, UIO_SYSSPACE, args->length); LFREEPATH(path); return (error); @@ -952,10 +829,6 @@ linux_link(struct thread *td, struct linux_link_args * return (error); } -#ifdef DEBUG - if (ldebug(link)) - printf(ARGS(link, "%s, %s"), path, to); -#endif error = kern_linkat(td, AT_FDCWD, AT_FDCWD, path, to, UIO_SYSSPACE, FOLLOW); LFREEPATH(path); @@ -983,12 +856,6 @@ linux_linkat(struct thread *td, struct linux_linkat_ar return (error); } -#ifdef DEBUG - if (ldebug(linkat)) - printf(ARGS(linkat, "%i, %s, %i, %s, %i"), args->olddfd, path, - args->newdfd, to, args->flag); -#endif - follow = (args->flag & LINUX_AT_SYMLINK_FOLLOW) == 0 ? NOFOLLOW : FOLLOW; error = kern_linkat(td, olddfd, newdfd, path, to, UIO_SYSSPACE, follow); @@ -1110,12 +977,6 @@ linux_mount(struct thread *td, struct linux_mount_args if (error != 0) goto out; -#ifdef DEBUG - if (ldebug(mount)) - printf(ARGS(mount, "%s, %s, %s"), - fstypename, mntfromname, mntonname); -#endif - if (strcmp(fstypename, "ext2") == 0) { strcpy(fstypename, "ext2fs"); } else if (strcmp(fstypename, "proc") == 0) { @@ -1424,11 +1285,6 @@ int linux_fcntl(struct thread *td, struct linux_fcntl_args *args) { -#ifdef DEBUG - if (ldebug(fcntl)) - printf(ARGS(fcntl, "%d, %08x, *"), args->fd, args->cmd); -#endif - return (fcntl_common(td, args)); } @@ -1441,11 +1297,6 @@ linux_fcntl64(struct thread *td, struct linux_fcntl64_ struct linux_fcntl_args fcntl_args; int error; -#ifdef DEBUG - if (ldebug(fcntl64)) - printf(ARGS(fcntl64, "%d, %08x, *"), args->fd, args->cmd); -#endif - switch (args->cmd) { case LINUX_F_GETLK64: error = copyin((void *)args->arg, &linux_flock, @@ -1495,10 +1346,6 @@ linux_chown(struct thread *td, struct linux_chown_args LCONVPATHEXIST(td, args->path, &path); -#ifdef DEBUG - if (ldebug(chown)) - printf(ARGS(chown, "%s, %d, %d"), path, args->uid, args->gid); -#endif error = kern_fchownat(td, AT_FDCWD, path, UIO_SYSSPACE, args->uid, args->gid, 0); LFREEPATH(path); @@ -1518,11 +1365,6 @@ linux_fchownat(struct thread *td, struct linux_fchowna dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd; LCONVPATHEXIST_AT(td, args->filename, &path, dfd); -#ifdef DEBUG - if (ldebug(fchownat)) - printf(ARGS(fchownat, "%s, %d, %d"), path, args->uid, args->gid); -#endif - flag = (args->flag & LINUX_AT_SYMLINK_NOFOLLOW) == 0 ? 0 : AT_SYMLINK_NOFOLLOW; error = kern_fchownat(td, dfd, path, UIO_SYSSPACE, args->uid, args->gid, @@ -1540,10 +1382,6 @@ linux_lchown(struct thread *td, struct linux_lchown_ar LCONVPATHEXIST(td, args->path, &path); -#ifdef DEBUG - if (ldebug(lchown)) - printf(ARGS(lchown, "%s, %d, %d"), path, args->uid, args->gid); -#endif error = kern_fchownat(td, AT_FDCWD, path, UIO_SYSSPACE, args->uid, args->gid, AT_SYMLINK_NOFOLLOW); LFREEPATH(path); @@ -1605,11 +1443,6 @@ linux_pipe(struct thread *td, struct linux_pipe_args * int fildes[2]; int error; -#ifdef DEBUG - if (ldebug(pipe)) - printf(ARGS(pipe, "*")); -#endif - error = kern_pipe(td, fildes, 0, NULL, NULL); if (error != 0) return (error); @@ -1629,11 +1462,6 @@ linux_pipe2(struct thread *td, struct linux_pipe2_args { int fildes[2]; int error, flags; - -#ifdef DEBUG - if (ldebug(pipe2)) - printf(ARGS(pipe2, "*, %d"), args->flags); -#endif if ((args->flags & ~(LINUX_O_NONBLOCK | LINUX_O_CLOEXEC)) != 0) return (EINVAL); Modified: head/sys/compat/linux/linux_fork.c ============================================================================== --- head/sys/compat/linux/linux_fork.c Mon May 13 18:14:20 2019 (r347537) +++ head/sys/compat/linux/linux_fork.c Mon May 13 18:24:29 2019 (r347538) @@ -74,11 +74,6 @@ linux_fork(struct thread *td, struct linux_fork_args * struct proc *p2; struct thread *td2; -#ifdef DEBUG - if (ldebug(fork)) - printf(ARGS(fork, "")); -#endif - bzero(&fr, sizeof(fr)); fr.fr_flags = RFFDG | RFPROC | RFSTOPPED; fr.fr_procp = &p2; @@ -110,11 +105,6 @@ linux_vfork(struct thread *td, struct linux_vfork_args struct proc *p2; struct thread *td2; -#ifdef DEBUG - if (ldebug(vfork)) - printf(ARGS(vfork, "")); -#endif - bzero(&fr, sizeof(fr)); fr.fr_flags = RFFDG | RFPROC | RFMEM | RFPPWAIT | RFSTOPPED; fr.fr_procp = &p2; @@ -149,14 +139,6 @@ linux_clone_proc(struct thread *td, struct linux_clone int exit_signal; struct linux_emuldata *em; -#ifdef DEBUG - if (ldebug(clone)) { - printf(ARGS(clone, "flags %x, stack %p, parent tid: %p, " - "child tid: %p"), (unsigned)args->flags, - args->stack, args->parent_tidptr, args->child_tidptr); - } -#endif - exit_signal = args->flags & 0x000000ff; if (LINUX_SIG_VALID(exit_signal)) { exit_signal = linux_to_bsd_signal(exit_signal); @@ -212,7 +194,7 @@ linux_clone_proc(struct thread *td, struct linux_clone error = copyout(&p2->p_pid, args->parent_tidptr, sizeof(p2->p_pid)); if (error) - printf(LMSG("copyout failed!")); + linux_msg(td, "copyout p_pid failed!"); } PROC_LOCK(p2); @@ -240,13 +222,6 @@ linux_clone_proc(struct thread *td, struct linux_clone sx_xunlock(&proctree_lock); } -#ifdef DEBUG - if (ldebug(clone)) - printf(LMSG("clone: successful rfork to %d, " - "stack %p sig = %d"), (int)p2->p_pid, args->stack, - exit_signal); -#endif - /* * Make this runnable after we are finished with it. */ @@ -268,14 +243,6 @@ linux_clone_thread(struct thread *td, struct linux_clo struct proc *p; int error; -#ifdef DEBUG - if (ldebug(clone)) { - printf(ARGS(clone, "thread: flags %x, stack %p, parent tid: %p, " - "child tid: %p"), (unsigned)args->flags, - args->stack, args->parent_tidptr, args->child_tidptr); - } -#endif - LINUX_CTR4(clone_thread, "thread(%d) flags %x ptid %p ctid %p", td->td_tid, (unsigned)args->flags, args->parent_tidptr, args->child_tidptr); @@ -360,12 +327,6 @@ linux_clone_thread(struct thread *td, struct linux_clo tidhash_add(newtd); -#ifdef DEBUG - if (ldebug(clone)) - printf(ARGS(clone, "successful clone to %d, stack %p"), - (int)newtd->td_tid, args->stack); -#endif - LINUX_CTR2(clone_thread, "thread(%d) successful clone to %d", td->td_tid, newtd->td_tid); @@ -373,7 +334,7 @@ linux_clone_thread(struct thread *td, struct linux_clo error = copyout(&newtd->td_tid, args->parent_tidptr, sizeof(newtd->td_tid)); if (error) - printf(LMSG("clone_thread: copyout failed!")); + linux_msg(td, "clone_thread: copyout td_tid failed!"); } /* Modified: head/sys/compat/linux/linux_getcwd.c ============================================================================== --- head/sys/compat/linux/linux_getcwd.c Mon May 13 18:14:20 2019 (r347537) +++ head/sys/compat/linux/linux_getcwd.c Mon May 13 18:24:29 2019 (r347538) @@ -65,11 +65,6 @@ linux_getcwd(struct thread *td, struct linux_getcwd_ar char *path; int error, lenused; -#ifdef DEBUG - if (ldebug(getcwd)) - printf(ARGS(getcwd, "%p, %ld"), args->buf, (long)args->bufsize); -#endif - /* * Linux returns ERANGE instead of EINVAL. */ Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Mon May 13 18:14:20 2019 (r347537) +++ head/sys/compat/linux/linux_ioctl.c Mon May 13 18:24:29 2019 (r347538) @@ -238,12 +238,7 @@ linux_ioctl_hdio(struct thread *td, struct linux_ioctl */ bytespercyl = (off_t) sectorsize * fwheads * fwsectors; fwcylinders = mediasize / bytespercyl; -#if defined(DEBUG) - linux_msg(td, "HDIO_GET_GEO: mediasize %jd, c/h/s %d/%d/%d, " - "bpc %jd", - (intmax_t)mediasize, fwcylinders, fwheads, fwsectors, - (intmax_t)bytespercyl); -#endif + if ((args->cmd & 0xffff) == LINUX_HDIO_GET_GEO) { struct linux_hd_geometry hdg; @@ -404,19 +399,6 @@ bsd_to_linux_termios(struct termios *bios, struct linu { int i; -#ifdef DEBUG - if (ldebug(ioctl)) { - printf("LINUX: BSD termios structure (input):\n"); - printf("i=%08x o=%08x c=%08x l=%08x ispeed=%d ospeed=%d\n", - bios->c_iflag, bios->c_oflag, bios->c_cflag, bios->c_lflag, - bios->c_ispeed, bios->c_ospeed); - printf("c_cc "); - for (i=0; ic_cc[i]); - printf("\n"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon May 13 18:28:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03FEA1597ABD; Mon, 13 May 2019 18:28:42 +0000 (UTC) (envelope-from dchagin@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 965C58E240; Mon, 13 May 2019 18:28:41 +0000 (UTC) (envelope-from dchagin@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 7D95DDAD8; Mon, 13 May 2019 18:28:41 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4DISfZT041958; Mon, 13 May 2019 18:28:41 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4DISeYG041954; Mon, 13 May 2019 18:28:40 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905131828.x4DISeYG041954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Mon, 13 May 2019 18:28:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347540 - in head/sys/modules: linprocfs linsysfs linux linux64 linux_common X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in head/sys/modules: linprocfs linsysfs linux linux64 linux_common X-SVN-Commit-Revision: 347540 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 965C58E240 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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, 13 May 2019 18:28:42 -0000 Author: dchagin Date: Mon May 13 18:28:40 2019 New Revision: 347540 URL: https://svnweb.freebsd.org/changeset/base/347540 Log: Add warning to the Linuxulator makefiles that building it outside of a kernel does not make sence. PR: 222861 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20179 Modified: head/sys/modules/linprocfs/Makefile head/sys/modules/linsysfs/Makefile head/sys/modules/linux/Makefile head/sys/modules/linux64/Makefile head/sys/modules/linux_common/Makefile Modified: head/sys/modules/linprocfs/Makefile ============================================================================== --- head/sys/modules/linprocfs/Makefile Mon May 13 18:25:55 2019 (r347539) +++ head/sys/modules/linprocfs/Makefile Mon May 13 18:28:40 2019 (r347540) @@ -7,4 +7,8 @@ SRCS= vnode_if.h \ device_if.h bus_if.h \ linprocfs.c +.if !defined(KERNBUILDDIR) +.warning Building Linuxulator outside of a kernel does not make sense +.endif + .include Modified: head/sys/modules/linsysfs/Makefile ============================================================================== --- head/sys/modules/linsysfs/Makefile Mon May 13 18:25:55 2019 (r347539) +++ head/sys/modules/linsysfs/Makefile Mon May 13 18:28:40 2019 (r347540) @@ -7,4 +7,8 @@ SRCS= vnode_if.h \ device_if.h bus_if.h pci_if.h \ linsysfs.c +.if !defined(KERNBUILDDIR) +.warning Building Linuxulator outside of a kernel does not make sense +.endif + .include Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Mon May 13 18:25:55 2019 (r347539) +++ head/sys/modules/linux/Makefile Mon May 13 18:28:40 2019 (r347540) @@ -80,4 +80,8 @@ ${VDSO}.so: linux${SFX}_locore.o linux${SFX}_genassym.o: offset.inc ${CC} -c ${CFLAGS:N-flto:N-fno-common} ${.IMPSRC} +.if !defined(KERNBUILDDIR) +.warning Building Linuxulator outside of a kernel does not make sense +.endif + .include Modified: head/sys/modules/linux64/Makefile ============================================================================== --- head/sys/modules/linux64/Makefile Mon May 13 18:25:55 2019 (r347539) +++ head/sys/modules/linux64/Makefile Mon May 13 18:28:40 2019 (r347540) @@ -55,4 +55,8 @@ linux_support.o: assym.inc linux_assym.h linux_genassym.o: offset.inc ${CC} -c ${CFLAGS:N-flto:N-fno-common} ${.IMPSRC} +.if !defined(KERNBUILDDIR) +.warning Building Linuxulator outside of a kernel does not make sense +.endif + .include Modified: head/sys/modules/linux_common/Makefile ============================================================================== --- head/sys/modules/linux_common/Makefile Mon May 13 18:25:55 2019 (r347539) +++ head/sys/modules/linux_common/Makefile Mon May 13 18:28:40 2019 (r347540) @@ -15,4 +15,8 @@ EXPORT_SYMS+= linux_ioctl_unregister_handler EXPORT_SYMS+= linux_get_osname EXPORT_SYMS+= linux_get_osrelease +.if !defined(KERNBUILDDIR) +.warning Building Linuxulator outside of a kernel does not make sense +.endif + .include From owner-svn-src-head@freebsd.org Mon May 13 18:29:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27BC71597AFE for ; Mon, 13 May 2019 18:29:15 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yw1-xc33.google.com (mail-yw1-xc33.google.com [IPv6:2607:f8b0:4864:20::c33]) (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 900358E35F for ; Mon, 13 May 2019 18:29:14 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yw1-xc33.google.com with SMTP id e74so11762290ywe.11 for ; Mon, 13 May 2019 11:29:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=P6ESao7H5yEOTgeBUxn4YC62hsE+s5SNoCIMatr6sKo=; b=c+L+b24wbGdRtEGSzM2e+FUM6AEaa0KCdxn+ZUYw/V3wpZejm9T2Bsb66J0HdeO6HS xDSxHz3NeqQnqNGbzLVl4JW7W20kzcrfOX0Irr+54cuY67RtQsbjBAgchn66NKI32J2y 0VUG0YhKCniWFHpMxNBlUC5IvzobW4ZDrn51GOZoXM3Qf17k4vv+JL/MfOVzqmyC3jZi ZwvI30R/6Amh1XMBBWDDMT4kTgJWIl6HjZzoAgn0QP0QJRWrXqn3gQOo/ghHm/R3VxUi y7wp3SeuU/AO5iuddd7iOpqi4JInZ/HwzW+N8LlKUD0Sa6SCndP13mjv7gX3eA5L2S2B PsdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=P6ESao7H5yEOTgeBUxn4YC62hsE+s5SNoCIMatr6sKo=; b=CFL3bUc9ykQ6/FJg3il033XQW/VlZc2B99ZafG8yibBqhf5oiNGBF1Tw00kiA78QM6 uv7xmcDnxW3RoRnq3ehwl7B5BVpD4jkO5ufDgGliTdyzNJxE+d6XafEm2EWFH1ifrxdp o0CGKznmC+XDlDKzZVOFjdawYMKZpvgWTKFkpeTvdf9o61rh2+NP3wyKJUOMY5XhsgGg 7TyC7tU5cJzQ/e+sL5SyyDIHY4jXt3Pozr8+bUyi4CI/07z5kXTpVf5IoTmI/7qPiQVE SsVkAgJpNKP8MViFNit5hBZxNf4nxHprOkd8DybW/6owlXGyJWueNjIDekxP80K6Wnx8 gF9w== X-Gm-Message-State: APjAAAUqJcVMPuh1gTvsUtfIjOz8UAXo7+IZ5X58PgOujUOs6EJX/lk8 +z7uUp8YtKIuHLGl0RY4ichn8As599CVNm4ef0ofxQ== X-Google-Smtp-Source: APXvYqxRaVheJPgEP5REe3oePHKp3X5yUmicYkQGK0e5qBYuNkTg/jnNIUk4KnlBOTtT+7GaE7nNeXZDw2uIL+qhXYE= X-Received: by 2002:a0d:c1c4:: with SMTP id c187mr14643355ywd.79.1557772153138; Mon, 13 May 2019 11:29:13 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:4dd4:0:0:0:0:0 with HTTP; Mon, 13 May 2019 11:29:12 -0700 (PDT) In-Reply-To: <201905131741.x4DHfh2G042304@gndrsh.dnsmgr.net> References: <201905131735.x4DHZ2BS042282@gndrsh.dnsmgr.net> <201905131741.x4DHfh2G042304@gndrsh.dnsmgr.net> From: Oliver Pinter Date: Mon, 13 May 2019 20:29:12 +0200 Message-ID: Subject: Re: svn commit: r347532 - in head: contrib/netbsd-tests/lib/libc/sys lib/libc/sys lib/libc/tests/sys sys/amd64/vmm sys/sys sys/vm usr.bin/vmstat To: "rgrimes@freebsd.org" Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Mark Johnston , "src-committers@freebsd.org" X-Rspamd-Queue-Id: 900358E35F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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: Mon, 13 May 2019 18:29:15 -0000 And it would be nice to bump __freebsd_version too. On Monday, May 13, 2019, Rodney W. Grimes wrote: > > > Author: markj > > > Date: Mon May 13 16:38:48 2019 > > > New Revision: 347532 > > > URL: https://svnweb.freebsd.org/changeset/base/347532 > > > > > > Log: > > > Provide separate accounting for user-wired pages. > > > > > > Historically we have not distinguished between kernel wirings and > user > > > wirings for accounting purposes. User wirings (via mlock(2)) were > > > subject to a global limit on the number of wired pages, so if large > > > swaths of physical memory were wired by the kernel, as happens with > > > the ZFS ARC among other things, the limit could be exceeded, causing > > > user wirings to fail. > > > > > > The change adds a new counter, v_user_wire_count, which counts the > > > number of virtual pages wired by user processes via mlock(2) and > > > mlockall(2). Only user-wired pages are subject to the system-wide > > > limit which helps provide some safety against deadlocks. In > > > particular, while sources of kernel wirings typically support some > > > backpressure mechanism, there is no way to reclaim user-wired pages > > > shorting of killing the wiring process. The limit is exported as > > > vm.max_user_wired, renamed from vm.max_wired, and changed from u_int > > > to u_long. > > > > > > The choice to count virtual user-wired pages rather than physical > > > pages was done for simplicity. There are mechanisms that can cause > > > user-wired mappings to be destroyed while maintaining a wiring of > > > the backing physical page; these make it difficult to accurately > > > track user wirings at the physical page layer. > > > > > > The change also closes some holes which allowed user wirings to > succeed > > > even when they would cause the system limit to be exceeded. For > > > instance, mmap() may now fail with ENOMEM in a process that has > called > > > mlockall(MCL_FUTURE) if the new mapping would cause the user wiring > > > limit to be exceeded. > > > > > > Note that bhyve -S is subject to the user wiring limit, which > defaults > > > to 1/3 of physical RAM. Users that wish to exceed the limit must > tune > > > vm.max_user_wired. > > > > Because of that this should probably have a: > > Release Notes: Yes > > And probably an UPDATING entry since this may cause some -head > users VM's to fall over on a update/reboot. > > > > > Reviewed by: kib, ngie (mlock() test changes) > > > Tested by: pho (earlier version) > > > MFC after: 45 days > > > Sponsored by: Netflix > > > Differential Revision: https://reviews.freebsd.org/D19908 > > > > > > Modified: > > > head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c > > > head/lib/libc/sys/mlock.2 > > > head/lib/libc/sys/mlockall.2 > > > head/lib/libc/tests/sys/mlock_helper.c > > > head/sys/amd64/vmm/vmm.c > > > head/sys/sys/vmmeter.h > > > head/sys/vm/vm_glue.c > > > head/sys/vm/vm_map.c > > > head/sys/vm/vm_map.h > > > head/sys/vm/vm_meter.c > > > head/sys/vm/vm_mmap.c > > > head/sys/vm/vm_pageout.c > > > head/sys/vm/vm_pageout.h > > > head/sys/vm/vm_unix.c > > > head/usr.bin/vmstat/vmstat.c > > > > > > Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c > > > ============================================================ > ================== > > > --- head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Mon May > 13 15:39:54 2019 (r347531) > > > +++ head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Mon May > 13 16:38:48 2019 (r347532) > > > @@ -51,7 +51,7 @@ __RCSID("$NetBSD: t_mlock.c,v 1.6 2016/08/09 > 12:02:44 > > > #define _KMEMUSER > > > #include > > > > > > -void set_vm_max_wired(int); > > > +void set_vm_max_wired(u_long); > > > void restore_vm_max_wired(void); > > > #endif > > > > > > > > > Modified: head/lib/libc/sys/mlock.2 > > > ============================================================ > ================== > > > --- head/lib/libc/sys/mlock.2 Mon May 13 15:39:54 2019 > (r347531) > > > +++ head/lib/libc/sys/mlock.2 Mon May 13 16:38:48 2019 > (r347532) > > > @@ -28,7 +28,7 @@ > > > .\" @(#)mlock.2 8.2 (Berkeley) 12/11/93 > > > .\" $FreeBSD$ > > > .\" > > > -.Dd March 20, 2018 > > > +.Dd May 13, 2019 > > > .Dt MLOCK 2 > > > .Os > > > .Sh NAME > > > @@ -97,13 +97,13 @@ resource limit and the > > > system-wide > > > .Dq wired pages > > > limit > > > -.Va vm.max_wired . > > > -.Va vm.max_wired > > > +.Va vm.max_user_wired . > > > +.Va vm.max_user_wired > > > applies to the system as a whole, so the amount available to a single > > > process at any given time is the difference between > > > -.Va vm.max_wired > > > +.Va vm.max_user_wired > > > and > > > -.Va vm.stats.vm.v_wire_count . > > > +.Va vm.stats.vm.v_user_wire_count . > > > .Pp > > > If > > > .Va security.bsd.unprivileged_mlock > > > @@ -124,13 +124,11 @@ will fail if: > > > is set to 0 and the caller is not the super-user. > > > .It Bq Er EINVAL > > > The address range given wraps around zero. > > > -.It Bq Er EAGAIN > > > -Locking the indicated range would exceed the system limit for locked > memory. > > > .It Bq Er ENOMEM > > > Some portion of the indicated address range is not allocated. > > > There was an error faulting/mapping a page. > > > -Locking the indicated range would exceed the per-process limit for > locked > > > -memory. > > > +Locking the indicated range would exceed the per-process or > system-wide limits > > > +for locked memory. > > > .El > > > The > > > .Fn munlock > > > @@ -171,11 +169,11 @@ system calls first appeared in > > > Allocating too much wired memory can lead to a memory-allocation > deadlock > > > which requires a reboot to recover from. > > > .Pp > > > -The per-process resource limit is a limit on the amount of virtual > > > -memory locked, while the system-wide limit is for the number of locked > > > -physical pages. > > > -Hence a process with two distinct locked mappings of the same > physical page > > > -counts as 2 pages against the per-process limit and as only a single > page > > > -in the system limit. > > > +The per-process and system-wide resource limits of locked memory apply > > > +to the amount of virtual memory locked, not the amount of locked > physical > > > +pages. > > > +Hence two distinct locked mappings of the same physical page counts as > > > +2 pages aginst the system limit, and also against the per-process > limit > > > +if both mappings belong to the same physical map. > > > .Pp > > > The per-process resource limit is not currently supported. > > > > > > Modified: head/lib/libc/sys/mlockall.2 > > > ============================================================ > ================== > > > --- head/lib/libc/sys/mlockall.2 Mon May 13 15:39:54 2019 > (r347531) > > > +++ head/lib/libc/sys/mlockall.2 Mon May 13 16:38:48 2019 > (r347532) > > > @@ -30,7 +30,7 @@ > > > .\" > > > .\" $FreeBSD$ > > > .\" > > > -.Dd December 25, 2012 > > > +.Dd May 13, 2019 > > > .Dt MLOCKALL 2 > > > .Os > > > .Sh NAME > > > @@ -69,7 +69,7 @@ limited in how much they can lock down. > > > A single process can lock the minimum of a system-wide > > > .Dq wired pages > > > limit > > > -.Va vm.max_wired > > > +.Va vm.max_user_wired > > > and the per-process > > > .Dv RLIMIT_MEMLOCK > > > resource limit. > > > @@ -138,9 +138,9 @@ and > > > functions first appeared in > > > .Fx 5.1 . > > > .Sh BUGS > > > -The per-process resource limit is a limit on the amount of virtual > > > -memory locked, while the system-wide limit is for the number of locked > > > -physical pages. > > > -Hence a process with two distinct locked mappings of the same > physical page > > > -counts as 2 pages against the per-process limit and as only a single > page > > > -in the system limit. > > > +The per-process and system-wide resource limits of locked memory apply > > > +to the amount of virtual memory locked, not the amount of locked > physical > > > +pages. > > > +Hence two distinct locked mappings of the same physical page counts as > > > +2 pages aginst the system limit, and also against the per-process > limit > > > +if both mappings belong to the same physical map. > > > > > > Modified: head/lib/libc/tests/sys/mlock_helper.c > > > ============================================================ > ================== > > > --- head/lib/libc/tests/sys/mlock_helper.c Mon May 13 15:39:54 2019 > (r347531) > > > +++ head/lib/libc/tests/sys/mlock_helper.c Mon May 13 16:38:48 2019 > (r347532) > > > @@ -39,16 +39,16 @@ __FBSDID("$FreeBSD$"); > > > #include > > > #include > > > > > > -#define VM_MAX_WIRED "vm.max_wired" > > > +#define VM_MAX_WIRED "vm.max_user_wired" > > > > > > static void > > > -vm_max_wired_sysctl(int *old_value, int *new_value) > > > +vm_max_wired_sysctl(u_long *old_value, u_long *new_value) > > > { > > > size_t old_len; > > > - size_t new_len = (new_value == NULL ? 0 : sizeof(int)); > > > + size_t new_len = (new_value == NULL ? 0 : sizeof(*new_value)); > > > > > > if (old_value == NULL) > > > - printf("Setting the new value to %d\n", *new_value); > > > + printf("Setting the new value to %lu\n", *new_value); > > > else { > > > ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, NULL, &old_len, > > > new_value, new_len) == 0, > > > @@ -60,14 +60,14 @@ vm_max_wired_sysctl(int *old_value, int *new_value) > > > "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno)); > > > > > > if (old_value != NULL) > > > - printf("Saved the old value (%d)\n", *old_value); > > > + printf("Saved the old value (%lu)\n", *old_value); > > > } > > > > > > void > > > -set_vm_max_wired(int new_value) > > > +set_vm_max_wired(u_long new_value) > > > { > > > FILE *fp; > > > - int old_value; > > > + u_long old_value; > > > > > > fp = fopen(VM_MAX_WIRED, "w"); > > > if (fp == NULL) { > > > @@ -78,7 +78,7 @@ set_vm_max_wired(int new_value) > > > > > > vm_max_wired_sysctl(&old_value, NULL); > > > > > > - ATF_REQUIRE_MSG(fprintf(fp, "%d", old_value) > 0, > > > + ATF_REQUIRE_MSG(fprintf(fp, "%lu", old_value) > 0, > > > "saving %s failed", VM_MAX_WIRED); > > > > > > fclose(fp); > > > @@ -90,7 +90,7 @@ void > > > restore_vm_max_wired(void) > > > { > > > FILE *fp; > > > - int saved_max_wired; > > > + u_long saved_max_wired; > > > > > > fp = fopen(VM_MAX_WIRED, "r"); > > > if (fp == NULL) { > > > @@ -98,14 +98,14 @@ restore_vm_max_wired(void) > > > return; > > > } > > > > > > - if (fscanf(fp, "%d", &saved_max_wired) != 1) { > > > + if (fscanf(fp, "%lu", &saved_max_wired) != 1) { > > > perror("fscanf failed\n"); > > > fclose(fp); > > > return; > > > } > > > > > > fclose(fp); > > > - printf("old value in %s: %d\n", VM_MAX_WIRED, saved_max_wired); > > > + printf("old value in %s: %lu\n", VM_MAX_WIRED, saved_max_wired); > > > > > > if (saved_max_wired == 0) /* This will cripple the test host */ > > > return; > > > > > > Modified: head/sys/amd64/vmm/vmm.c > > > ============================================================ > ================== > > > --- head/sys/amd64/vmm/vmm.c Mon May 13 15:39:54 2019 > (r347531) > > > +++ head/sys/amd64/vmm/vmm.c Mon May 13 16:38:48 2019 > (r347532) > > > @@ -754,7 +754,8 @@ vm_mmap_memseg(struct vm *vm, vm_paddr_t gpa, int > segi > > > VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); > > > if (error != KERN_SUCCESS) { > > > vm_map_remove(&vm->vmspace->vm_map, gpa, gpa + > len); > > > - return (EFAULT); > > > + return (error == KERN_RESOURCE_SHORTAGE ? ENOMEM : > > > + EFAULT); > > > } > > > } > > > > > > > > > Modified: head/sys/sys/vmmeter.h > > > ============================================================ > ================== > > > --- head/sys/sys/vmmeter.h Mon May 13 15:39:54 2019 (r347531) > > > +++ head/sys/sys/vmmeter.h Mon May 13 16:38:48 2019 (r347532) > > > @@ -153,6 +153,8 @@ extern domainset_t vm_severe_domains; > > > #define VM_CNT_INC(var) VM_CNT_ADD(var, 1) > > > #define VM_CNT_FETCH(var) counter_u64_fetch(vm_cnt.var) > > > > > > +extern u_long vm_user_wire_count; > > > + > > > static inline void > > > vm_wire_add(int cnt) > > > { > > > > > > Modified: head/sys/vm/vm_glue.c > > > ============================================================ > ================== > > > --- head/sys/vm/vm_glue.c Mon May 13 15:39:54 2019 (r347531) > > > +++ head/sys/vm/vm_glue.c Mon May 13 16:38:48 2019 (r347532) > > > @@ -181,21 +181,8 @@ vslock(void *addr, size_t len) > > > if (last < (vm_offset_t)addr || end < (vm_offset_t)addr) > > > return (EINVAL); > > > npages = atop(end - start); > > > - if (npages > vm_page_max_wired) > > > + if (npages > vm_page_max_user_wired) > > > return (ENOMEM); > > > -#if 0 > > > - /* > > > - * XXX - not yet > > > - * > > > - * The limit for transient usage of wired pages should be > > > - * larger than for "permanent" wired pages (mlock()). > > > - * > > > - * Also, the sysctl code, which is the only present user > > > - * of vslock(), does a hard loop on EAGAIN. > > > - */ > > > - if (npages + vm_wire_count() > vm_page_max_wired) > > > - return (EAGAIN); > > > -#endif > > > error = vm_map_wire(&curproc->p_vmspace->vm_map, start, end, > > > VM_MAP_WIRE_SYSTEM | VM_MAP_WIRE_NOHOLES); > > > if (error == KERN_SUCCESS) { > > > > > > Modified: head/sys/vm/vm_map.c > > > ============================================================ > ================== > > > --- head/sys/vm/vm_map.c Mon May 13 15:39:54 2019 (r347531) > > > +++ head/sys/vm/vm_map.c Mon May 13 16:38:48 2019 (r347532) > > > @@ -90,6 +90,7 @@ __FBSDID("$FreeBSD$"); > > > #include > > > #include > > > #include > > > +#include > > > #include > > > #include > > > #include > > > @@ -2917,12 +2918,12 @@ done: > > > > > > if (rv == KERN_SUCCESS && (!user_unwire || > > > (entry->eflags & MAP_ENTRY_USER_WIRED))) { > > > - if (user_unwire) > > > - entry->eflags &= ~MAP_ENTRY_USER_WIRED; > > > if (entry->wired_count == 1) > > > vm_map_entry_unwire(map, entry); > > > else > > > entry->wired_count--; > > > + if (user_unwire) > > > + entry->eflags &= ~MAP_ENTRY_USER_WIRED; > > > } > > > KASSERT((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0, > > > ("vm_map_unwire: in-transition flag missing %p", > entry)); > > > @@ -2942,6 +2943,28 @@ done: > > > return (rv); > > > } > > > > > > +static void > > > +vm_map_wire_user_count_sub(u_long npages) > > > +{ > > > + > > > + atomic_subtract_long(&vm_user_wire_count, npages); > > > +} > > > + > > > +static bool > > > +vm_map_wire_user_count_add(u_long npages) > > > +{ > > > + u_long wired; > > > + > > > + wired = vm_user_wire_count; > > > + do { > > > + if (npages + wired > vm_page_max_user_wired) > > > + return (false); > > > + } while (!atomic_fcmpset_long(&vm_user_wire_count, &wired, > > > + npages + wired)); > > > + > > > + return (true); > > > +} > > > + > > > /* > > > * vm_map_wire_entry_failure: > > > * > > > @@ -2978,37 +3001,49 @@ vm_map_wire_entry_failure(vm_map_t map, > vm_map_entry_t > > > entry->wired_count = -1; > > > } > > > > > > +int > > > +vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, int > flags) > > > +{ > > > + int rv; > > > + > > > + vm_map_lock(map); > > > + rv = vm_map_wire_locked(map, start, end, flags); > > > + vm_map_unlock(map); > > > + return (rv); > > > +} > > > + > > > + > > > /* > > > - * vm_map_wire: > > > + * vm_map_wire_locked: > > > * > > > - * Implements both kernel and user wiring. > > > + * Implements both kernel and user wiring. Returns with the map > locked, > > > + * the map lock may be dropped. > > > */ > > > int > > > -vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, > > > - int flags) > > > +vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm_offset_t end, > int flags) > > > { > > > vm_map_entry_t entry, first_entry, tmp_entry; > > > vm_offset_t faddr, saved_end, saved_start; > > > - unsigned int last_timestamp; > > > + u_long npages; > > > + u_int last_timestamp; > > > int rv; > > > boolean_t need_wakeup, result, user_wire; > > > vm_prot_t prot; > > > > > > + VM_MAP_ASSERT_LOCKED(map); > > > + > > > if (start == end) > > > return (KERN_SUCCESS); > > > prot = 0; > > > if (flags & VM_MAP_WIRE_WRITE) > > > prot |= VM_PROT_WRITE; > > > user_wire = (flags & VM_MAP_WIRE_USER) ? TRUE : FALSE; > > > - vm_map_lock(map); > > > VM_MAP_RANGE_CHECK(map, start, end); > > > if (!vm_map_lookup_entry(map, start, &first_entry)) { > > > if (flags & VM_MAP_WIRE_HOLESOK) > > > first_entry = first_entry->next; > > > - else { > > > - vm_map_unlock(map); > > > + else > > > return (KERN_INVALID_ADDRESS); > > > - } > > > } > > > last_timestamp = map->timestamp; > > > entry = first_entry; > > > @@ -3042,7 +3077,6 @@ vm_map_wire(vm_map_t map, vm_offset_t start, > vm_offset > > > /* > > > * first_entry has > been deleted. > > > */ > > > - vm_map_unlock(map); > > > return > (KERN_INVALID_ADDRESS); > > > } > > > end = saved_start; > > > @@ -3082,13 +3116,22 @@ vm_map_wire(vm_map_t map, vm_offset_t start, > vm_offset > > > } > > > if (entry->wired_count == 0) { > > > entry->wired_count++; > > > - saved_start = entry->start; > > > - saved_end = entry->end; > > > > > > + npages = atop(entry->end - entry->start); > > > + if (user_wire && !vm_map_wire_user_count_add(npages)) > { > > > + vm_map_wire_entry_failure(map, entry, > > > + entry->start); > > > + end = entry->end; > > > + rv = KERN_RESOURCE_SHORTAGE; > > > + goto done; > > > + } > > > + > > > /* > > > * Release the map lock, relying on the > in-transition > > > * mark. Mark the map busy for fork. > > > */ > > > + saved_start = entry->start; > > > + saved_end = entry->end; > > > vm_map_busy(map); > > > vm_map_unlock(map); > > > > > > @@ -3136,6 +3179,8 @@ vm_map_wire(vm_map_t map, vm_offset_t start, > vm_offset > > > last_timestamp = map->timestamp; > > > if (rv != KERN_SUCCESS) { > > > vm_map_wire_entry_failure(map, entry, > faddr); > > > + if (user_wire) > > > + vm_map_wire_user_count_sub( > npages); > > > end = entry->end; > > > goto done; > > > } > > > @@ -3201,9 +3246,12 @@ done: > > > * Undo the wiring. Wiring succeeded on this entry > > > * but failed on a later entry. > > > */ > > > - if (entry->wired_count == 1) > > > + if (entry->wired_count == 1) { > > > vm_map_entry_unwire(map, entry); > > > - else > > > + if (user_wire) > > > + vm_map_wire_user_count_sub( > > > + atop(entry->end - > entry->start)); > > > + } else > > > entry->wired_count--; > > > } > > > next_entry_done: > > > @@ -3220,7 +3268,6 @@ done: > > > } > > > vm_map_simplify_entry(map, entry); > > > } > > > - vm_map_unlock(map); > > > if (need_wakeup) > > > vm_map_wakeup(map); > > > return (rv); > > > @@ -3338,13 +3385,18 @@ vm_map_sync( > > > static void > > > vm_map_entry_unwire(vm_map_t map, vm_map_entry_t entry) > > > { > > > + vm_size_t size; > > > > > > VM_MAP_ASSERT_LOCKED(map); > > > KASSERT(entry->wired_count > 0, > > > ("vm_map_entry_unwire: entry %p isn't wired", entry)); > > > + > > > + size = entry->end - entry->start; > > > + if ((entry->eflags & MAP_ENTRY_USER_WIRED) != 0) > > > + vm_map_wire_user_count_sub(atop(size)); > > > pmap_unwire(map->pmap, entry->start, entry->end); > > > - vm_object_unwire(entry->object.vm_object, entry->offset, > entry->end - > > > - entry->start, PQ_ACTIVE); > > > + vm_object_unwire(entry->object.vm_object, entry->offset, size, > > > + PQ_ACTIVE); > > > entry->wired_count = 0; > > > } > > > > > > @@ -4311,12 +4363,11 @@ retry: > > > * Heed the MAP_WIREFUTURE flag if it was set for this process. > > > */ > > > if (rv == KERN_SUCCESS && (map->flags & MAP_WIREFUTURE) != 0) { > > > - vm_map_unlock(map); > > > - vm_map_wire(map, grow_start, grow_start + grow_amount, > > > + rv = vm_map_wire_locked(map, grow_start, > > > + grow_start + grow_amount, > > > VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); > > > - vm_map_lock_read(map); > > > - } else > > > - vm_map_lock_downgrade(map); > > > + } > > > + vm_map_lock_downgrade(map); > > > > > > out: > > > #ifdef RACCT > > > > > > Modified: head/sys/vm/vm_map.h > > > ============================================================ > ================== > > > --- head/sys/vm/vm_map.h Mon May 13 15:39:54 2019 (r347531) > > > +++ head/sys/vm/vm_map.h Mon May 13 16:38:48 2019 (r347532) > > > @@ -422,7 +422,8 @@ int vm_map_madvise (vm_map_t, vm_offset_t, > vm_offset_t > > > int vm_map_stack (vm_map_t, vm_offset_t, vm_size_t, vm_prot_t, > vm_prot_t, int); > > > int vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offset_t end, > > > int flags); > > > -int vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, > > > +int vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, int > flags); > > > +int vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm_offset_t > end, > > > int flags); > > > long vmspace_swap_count(struct vmspace *vmspace); > > > void vm_map_entry_set_vnode_text(vm_map_entry_t entry, bool add); > > > > > > Modified: head/sys/vm/vm_meter.c > > > ============================================================ > ================== > > > --- head/sys/vm/vm_meter.c Mon May 13 15:39:54 2019 (r347531) > > > +++ head/sys/vm/vm_meter.c Mon May 13 16:38:48 2019 (r347532) > > > @@ -97,6 +97,8 @@ struct vmmeter __read_mostly vm_cnt = { > > > .v_wire_count = EARLY_COUNTER, > > > }; > > > > > > +u_long __exclusive_cache_line vm_user_wire_count; > > > + > > > static void > > > vmcounter_startup(void) > > > { > > > @@ -394,6 +396,8 @@ sysctl_handle_vmstat_proc(SYSCTL_HANDLER_ARGS) > > > > > > #define VM_STATS_UINT(var, descr) \ > > > SYSCTL_UINT(_vm_stats_vm, OID_AUTO, var, CTLFLAG_RD, &vm_cnt.var, > 0, descr) > > > +#define VM_STATS_ULONG(var, descr) \ > > > + SYSCTL_ULONG(_vm_stats_vm, OID_AUTO, var, CTLFLAG_RD, > &vm_cnt.var, 0, descr) > > > > > > VM_STATS_UINT(v_page_size, "Page size in bytes"); > > > VM_STATS_UINT(v_page_count, "Total number of pages in system"); > > > @@ -410,6 +414,9 @@ VM_STATS_PROC(v_laundry_count, "Pages eligible for > lau > > > VM_STATS_UINT(v_pageout_free_min, "Min pages reserved for kernel"); > > > VM_STATS_UINT(v_interrupt_free_min, "Reserved pages for interrupt > code"); > > > VM_STATS_UINT(v_free_severe, "Severe page depletion point"); > > > + > > > +SYSCTL_ULONG(_vm_stats_vm, OID_AUTO, v_user_wire_count, CTLFLAG_RD, > > > + &vm_user_wire_count, 0, "User-wired virtual memory"); > > > > > > #ifdef COMPAT_FREEBSD11 > > > /* > > > > > > Modified: head/sys/vm/vm_mmap.c > > > ============================================================ > ================== > > > --- head/sys/vm/vm_mmap.c Mon May 13 15:39:54 2019 (r347531) > > > +++ head/sys/vm/vm_mmap.c Mon May 13 16:38:48 2019 (r347532) > > > @@ -1003,7 +1003,7 @@ kern_mlock(struct proc *proc, struct ucred > *cred, uint > > > if (last < addr || end < addr) > > > return (EINVAL); > > > npages = atop(end - start); > > > - if (npages > vm_page_max_wired) > > > + if (npages > vm_page_max_user_wired) > > > return (ENOMEM); > > > map = &proc->p_vmspace->vm_map; > > > PROC_LOCK(proc); > > > @@ -1013,8 +1013,6 @@ kern_mlock(struct proc *proc, struct ucred > *cred, uint > > > return (ENOMEM); > > > } > > > PROC_UNLOCK(proc); > > > - if (npages + vm_wire_count() > vm_page_max_wired) > > > - return (EAGAIN); > > > #ifdef RACCT > > > if (racct_enable) { > > > PROC_LOCK(proc); > > > @@ -1091,7 +1089,12 @@ sys_mlockall(struct thread *td, struct > mlockall_args * > > > */ > > > error = vm_map_wire(map, vm_map_min(map), vm_map_max(map), > > > VM_MAP_WIRE_USER|VM_MAP_WIRE_HOLESOK); > > > - error = (error == KERN_SUCCESS ? 0 : EAGAIN); > > > + if (error == KERN_SUCCESS) > > > + error = 0; > > > + else if (error == KERN_RESOURCE_SHORTAGE) > > > + error = ENOMEM; > > > + else > > > + error = EAGAIN; > > > } > > > #ifdef RACCT > > > if (racct_enable && error != KERN_SUCCESS) { > > > @@ -1558,10 +1561,16 @@ vm_mmap_object(vm_map_t map, vm_offset_t > *addr, vm_siz > > > * If the process has requested that all future mappings > > > * be wired, then heed this. > > > */ > > > - if (map->flags & MAP_WIREFUTURE) { > > > - vm_map_wire(map, *addr, *addr + size, > > > - VM_MAP_WIRE_USER | ((flags & MAP_STACK) ? > > > - VM_MAP_WIRE_HOLESOK : VM_MAP_WIRE_NOHOLES)); > > > + if ((map->flags & MAP_WIREFUTURE) != 0) { > > > + vm_map_lock(map); > > > + if ((map->flags & MAP_WIREFUTURE) != 0) > > > + rv = vm_map_wire_locked(map, *addr, > > > + *addr + size, VM_MAP_WIRE_USER | > > > + ((flags & MAP_STACK) ? > VM_MAP_WIRE_HOLESOK : > > > + VM_MAP_WIRE_NOHOLES)); > > > + if (rv != KERN_SUCCESS) > > > + (void)vm_map_delete(map, *addr, *addr + > size); > > > + vm_map_unlock(map); > > > } > > > } > > > return (vm_mmap_to_errno(rv)); > > > > > > Modified: head/sys/vm/vm_pageout.c > > > ============================================================ > ================== > > > --- head/sys/vm/vm_pageout.c Mon May 13 15:39:54 2019 > (r347531) > > > +++ head/sys/vm/vm_pageout.c Mon May 13 16:38:48 2019 > (r347532) > > > @@ -194,9 +194,10 @@ SYSCTL_UINT(_vm, OID_AUTO, > background_launder_max, CTL > > > > > > int vm_pageout_page_count = 32; > > > > > > -int vm_page_max_wired; /* XXX max # of wired pages > system-wide */ > > > -SYSCTL_INT(_vm, OID_AUTO, max_wired, > > > - CTLFLAG_RW, &vm_page_max_wired, 0, "System-wide limit to wired > page count"); > > > +u_long vm_page_max_user_wired; > > > +SYSCTL_ULONG(_vm, OID_AUTO, max_user_wired, CTLFLAG_RW, > > > + &vm_page_max_user_wired, 0, > > > + "system-wide limit to user-wired page count"); > > > > > > static u_int isqrt(u_int num); > > > static int vm_pageout_launder(struct vm_domain *vmd, int launder, > > > @@ -2041,8 +2042,8 @@ vm_pageout_init(void) > > > if (vm_pageout_update_period == 0) > > > vm_pageout_update_period = 600; > > > > > > - if (vm_page_max_wired == 0) > > > - vm_page_max_wired = freecount / 3; > > > + if (vm_page_max_user_wired == 0) > > > + vm_page_max_user_wired = freecount / 3; > > > } > > > > > > /* > > > > > > Modified: head/sys/vm/vm_pageout.h > > > ============================================================ > ================== > > > --- head/sys/vm/vm_pageout.h Mon May 13 15:39:54 2019 > (r347531) > > > +++ head/sys/vm/vm_pageout.h Mon May 13 16:38:48 2019 > (r347532) > > > @@ -75,7 +75,7 @@ > > > * Exported data structures. > > > */ > > > > > > -extern int vm_page_max_wired; > > > +extern u_long vm_page_max_user_wired; > > > extern int vm_pageout_page_count; > > > > > > #define VM_OOM_MEM 1 > > > > > > Modified: head/sys/vm/vm_unix.c > > > ============================================================ > ================== > > > --- head/sys/vm/vm_unix.c Mon May 13 15:39:54 2019 (r347531) > > > +++ head/sys/vm/vm_unix.c Mon May 13 16:38:48 2019 (r347532) > > > @@ -95,13 +95,11 @@ kern_break(struct thread *td, uintptr_t *addr) > > > rlim_t datalim, lmemlim, vmemlim; > > > int prot, rv; > > > int error = 0; > > > - boolean_t do_map_wirefuture; > > > > > > datalim = lim_cur(td, RLIMIT_DATA); > > > lmemlim = lim_cur(td, RLIMIT_MEMLOCK); > > > vmemlim = lim_cur(td, RLIMIT_VMEM); > > > > > > - do_map_wirefuture = FALSE; > > > new = round_page(*addr); > > > vm_map_lock(map); > > > > > > @@ -184,7 +182,14 @@ kern_break(struct thread *td, uintptr_t *addr) > > > if (i386_read_exec && SV_PROC_FLAG(td->td_proc, SV_ILP32)) > > > prot |= VM_PROT_EXECUTE; > > > #endif > > > - rv = vm_map_insert(map, NULL, 0, old, new, prot, > VM_PROT_ALL, 0); > > > + rv = vm_map_insert(map, NULL, 0, old, new, prot, > VM_PROT_ALL, > > > + 0); > > > + if (rv == KERN_SUCCESS && (map->flags & MAP_WIREFUTURE) != > 0) { > > > + rv = vm_map_wire_locked(map, old, new, > > > + VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); > > > + if (rv != KERN_SUCCESS) > > > + vm_map_delete(map, old, new); > > > + } > > > if (rv != KERN_SUCCESS) { > > > #ifdef RACCT > > > if (racct_enable) { > > > @@ -205,17 +210,6 @@ kern_break(struct thread *td, uintptr_t *addr) > > > goto done; > > > } > > > vm->vm_dsize += btoc(new - old); > > > - /* > > > - * Handle the MAP_WIREFUTURE case for legacy applications, > > > - * by marking the newly mapped range of pages as wired. > > > - * We are not required to perform a corresponding > > > - * vm_map_unwire() before vm_map_delete() below, as > > > - * it will forcibly unwire the pages in the range. > > > - * > > > - * XXX If the pages cannot be wired, no error is returned. > > > - */ > > > - if ((map->flags & MAP_WIREFUTURE) == MAP_WIREFUTURE) > > > - do_map_wirefuture = TRUE; > > > } else if (new < old) { > > > rv = vm_map_delete(map, new, old); > > > if (rv != KERN_SUCCESS) { > > > @@ -238,10 +232,6 @@ kern_break(struct thread *td, uintptr_t *addr) > > > } > > > done: > > > vm_map_unlock(map); > > > - > > > - if (do_map_wirefuture) > > > - (void) vm_map_wire(map, old, new, > > > - VM_MAP_WIRE_USER|VM_MAP_WIRE_NOHOLES); > > > > > > if (error == 0) > > > *addr = new; > > > > > > Modified: head/usr.bin/vmstat/vmstat.c > > > ============================================================ > ================== > > > --- head/usr.bin/vmstat/vmstat.c Mon May 13 15:39:54 2019 > (r347531) > > > +++ head/usr.bin/vmstat/vmstat.c Mon May 13 16:38:48 2019 > (r347532) > > > @@ -156,6 +156,7 @@ static struct __vmmeter { > > > u_int v_free_min; > > > u_int v_free_count; > > > u_int v_wire_count; > > > + u_long v_user_wire_count; > > > u_int v_active_count; > > > u_int v_inactive_target; > > > u_int v_inactive_count; > > > @@ -566,6 +567,7 @@ fill_vmmeter(struct __vmmeter *vmmp) > > > GET_VM_STATS(vm, v_free_min); > > > GET_VM_STATS(vm, v_free_count); > > > GET_VM_STATS(vm, v_wire_count); > > > + GET_VM_STATS(vm, v_user_wire_count); > > > GET_VM_STATS(vm, v_active_count); > > > GET_VM_STATS(vm, v_inactive_target); > > > GET_VM_STATS(vm, v_inactive_count); > > > @@ -1057,6 +1059,8 @@ dosum(void) > > > sum.v_laundry_count); > > > xo_emit("{:wired-pages/%9u} {N:pages wired down}\n", > > > sum.v_wire_count); > > > + xo_emit("{:virtual-user-wired-pages/%9lu} {N:virtual user pages > wired " > > > + "down}\n", sum.v_user_wire_count); > > > xo_emit("{:free-pages/%9u} {N:pages free}\n", > > > sum.v_free_count); > > > xo_emit("{:bytes-per-page/%9u} {N:bytes per page}\n", > sum.v_page_size); > > > > > > > > > > -- > > Rod Grimes > rgrimes@freebsd.org > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > _______________________________________________ > 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 Mon May 13 18:40:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 047C41597ECC; Mon, 13 May 2019 18:40: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 9C5BB8EB48; Mon, 13 May 2019 18:40:01 +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 8A5E7DCA4; Mon, 13 May 2019 18:40:01 +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 x4DIe1bX049160; Mon, 13 May 2019 18:40:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4DIe1E0049159; Mon, 13 May 2019 18:40:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905131840.x4DIe1E0049159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 13 May 2019 18:40:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347541 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 347541 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9C5BB8EB48 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Mon, 13 May 2019 18:40:02 -0000 Author: markj Date: Mon May 13 18:40:01 2019 New Revision: 347541 URL: https://svnweb.freebsd.org/changeset/base/347541 Log: Restore the pre-r347532 behaviour of ignoring wiring failures in mmap(). The error handling added in r347532 is not right when mapping vnodes and will be fixed separately. Reported by: syzbot+1d2cc393bd6c88a548be@syzkaller.appspotmail.com MFC with: r347532 Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Mon May 13 18:28:40 2019 (r347540) +++ head/sys/vm/vm_mmap.c Mon May 13 18:40:01 2019 (r347541) @@ -1564,12 +1564,10 @@ vm_mmap_object(vm_map_t map, vm_offset_t *addr, vm_siz if ((map->flags & MAP_WIREFUTURE) != 0) { vm_map_lock(map); if ((map->flags & MAP_WIREFUTURE) != 0) - rv = vm_map_wire_locked(map, *addr, + (void)vm_map_wire_locked(map, *addr, *addr + size, VM_MAP_WIRE_USER | ((flags & MAP_STACK) ? VM_MAP_WIRE_HOLESOK : VM_MAP_WIRE_NOHOLES)); - if (rv != KERN_SUCCESS) - (void)vm_map_delete(map, *addr, *addr + size); vm_map_unlock(map); } } From owner-svn-src-head@freebsd.org Mon May 13 18:48:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1CA21598107; Mon, 13 May 2019 18:48:09 +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 975608EFD6; Mon, 13 May 2019 18:48:09 +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 6F663DE3F; Mon, 13 May 2019 18:48:09 +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 x4DIm9Tl054371; Mon, 13 May 2019 18:48:09 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4DIm9ug054363; Mon, 13 May 2019 18:48:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905131848.x4DIm9ug054363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 13 May 2019 18:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347543 - in head: . sys/sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: . sys/sys X-SVN-Commit-Revision: 347543 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 975608EFD6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Mon, 13 May 2019 18:48:10 -0000 Author: markj Date: Mon May 13 18:48:08 2019 New Revision: 347543 URL: https://svnweb.freebsd.org/changeset/base/347543 Log: Add an UPDATING entry and bump __FreeBSD_version for r347532. Reported by: rgrimes, Oliver Pinter Modified: head/UPDATING head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon May 13 18:48:08 2019 (r347542) +++ head/UPDATING Mon May 13 18:48:08 2019 (r347543) @@ -31,6 +31,14 @@ 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".) +20190513: + User-wired pages now have their own counter, + vm.stats.vm.v_user_wire_count. The vm.max_wired sysctl was renamed + to vm.max_user_wired and changed from an unsigned int to an unsigned + long. bhyve VMs wired with the -S are now subject to the user + wiring limit; the vm.max_user_wired sysctl may need to be tuned to + avoid running into the limit. + 20190507: The IPSEC option has been removed from GENERIC. Users requiring ipsec(4) must now load the ipsec(4) kernel module. Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon May 13 18:48:08 2019 (r347542) +++ head/sys/sys/param.h Mon May 13 18:48:08 2019 (r347543) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300024 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300025 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Mon May 13 19:35:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE533159957E; Mon, 13 May 2019 19:35:36 +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 9552F6A51F; Mon, 13 May 2019 19:35:36 +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 64B8BE69C; Mon, 13 May 2019 19:35:36 +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 x4DJZagc081656; Mon, 13 May 2019 19:35:36 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4DJZafj081655; Mon, 13 May 2019 19:35:36 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905131935.x4DJZafj081655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 13 May 2019 19:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347546 - head/sys/dev/random X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/random X-SVN-Commit-Revision: 347546 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9552F6A51F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Mon, 13 May 2019 19:35:37 -0000 Author: cem Date: Mon May 13 19:35:35 2019 New Revision: 347546 URL: https://svnweb.freebsd.org/changeset/base/347546 Log: Fortuna: Fix false negatives in is_random_seeded() (1) We may have had sufficient entropy to consider Fortuna seeded, but the random_fortuna_seeded() function would produce a false negative if fs_counter was still zero. This condition could arise after random_harvestq_prime() processed the /boot/entropy file and before any read-type operation invoked "pre_read()." Fortuna's fs_counter variable is only incremented (if certain conditions are met) by reseeding, which is invoked by random_fortuna_pre_read(). is_random_seeded(9) was introduced in r346282, but the function was unused prior to r346358, which introduced this regression. The regression broke initial seeding of arc4random(9) and broke periodic reseeding[A], until something other than arc4random(9) invoked read_random(9) or read_random_uio(9) directly. (Such as userspace getrandom(2) or read(2) of /dev/random. By default, /etc/rc.d/random does this during multiuser start-up.) (2) The conditions under which Fortuna will reseed (including initial seeding) are: (a) sufficient "entropy" (by sheer byte count; default 64) is collected in the zeroth pool (of 32 pools), and (b) it has been at least 100ms since the last reseed (to prevent trivial DoS; part of FS&K design). Prior to this revision, initial seeding might have been prevented if the reseed function was invoked during the first 100ms of boot. This revision addresses both of these issues. If random_fortuna_seeded() observes a zero fs_counter, it invokes random_fortuna_pre_read() and checks again. This addresses the problem where entropy actually was sufficient, but nothing had attempted a read -> pre_read yet. The second change is to disable the 100ms reseed guard when Fortuna has never been seeded yet (fs_lasttime == 0). The guard is intended to prevent gratuitous subsequent reseeds, not initial seeding! Machines running CURRENT between r346358 and this revision are encouraged to refresh when possible. Keys generated by userspace with /dev/random or getrandom(9) during this timeframe are safe, but any long-term session keys generated by kernel arc4random consumers are potentially suspect. [A]: Broken in the sense that is_random_seeded(9) false negatives would cause arc4random(9) to (re-)seed with weak entropy (SHA256(cyclecount || FreeBSD_version)). PR: 237869 Reported by: delphij, dim Reviewed by: delphij Approved by: secteam(delphij) X-MFC-With: r346282, r346358 (if ever) Security: yes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20239 Modified: head/sys/dev/random/fortuna.c Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Mon May 13 19:31:09 2019 (r347545) +++ head/sys/dev/random/fortuna.c Mon May 13 19:35:35 2019 (r347546) @@ -130,6 +130,7 @@ static uint8_t zero_region[RANDOM_ZERO_BLOCKSIZE]; static void random_fortuna_pre_read(void); static void random_fortuna_read(uint8_t *, u_int); static bool random_fortuna_seeded(void); +static bool random_fortuna_seeded_internal(void); static void random_fortuna_process_event(struct harvest_event *); static void random_fortuna_init_alg(void *); static void random_fortuna_deinit_alg(void *); @@ -277,7 +278,7 @@ random_fortuna_reseed_internal(uint32_t *entropy_data, RANDOM_RESEED_ASSERT_LOCK_OWNED(); - seeded = random_fortuna_seeded(); + seeded = random_fortuna_seeded_internal(); if (seeded) { randomdev_getkey(&fortuna_state.fs_key, &keymaterial, &keysz); KASSERT(keysz == RANDOM_KEYSIZE, ("%s: key size %zu not %u", @@ -377,8 +378,12 @@ random_fortuna_pre_read(void) if (fortuna_state.fs_pool[0].fsp_length < fortuna_state.fs_minpoolsize #ifdef _KERNEL - /* FS&K - Use 'getsbinuptime()' to prevent reseed-spamming. */ - || (now - fortuna_state.fs_lasttime <= SBT_1S/10) + /* + * FS&K - Use 'getsbinuptime()' to prevent reseed-spamming, but do + * not block initial seeding (fs_lasttime == 0). + */ + || (__predict_true(fortuna_state.fs_lasttime != 0) && + now - fortuna_state.fs_lasttime <= SBT_1S/10) #endif ) { RANDOM_RESEED_UNLOCK(); @@ -460,7 +465,13 @@ SYSCTL_BOOL(_kern_random, OID_AUTO, block_seeded_statu "unavailable."); #endif -bool +static bool +random_fortuna_seeded_internal(void) +{ + return (!uint128_is_zero(fortuna_state.fs_counter)); +} + +static bool random_fortuna_seeded(void) { @@ -469,5 +480,14 @@ random_fortuna_seeded(void) return (false); #endif - return (!uint128_is_zero(fortuna_state.fs_counter)); + if (__predict_true(random_fortuna_seeded_internal())) + return (true); + + /* + * Maybe we have enough entropy in the zeroth pool but just haven't + * kicked the initial seed step. Do so now. + */ + random_fortuna_pre_read(); + + return (random_fortuna_seeded_internal()); } From owner-svn-src-head@freebsd.org Mon May 13 19:38:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CECA21599635; Mon, 13 May 2019 19:38:01 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it1-x12a.google.com (mail-it1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) (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 6BD2E6A711; Mon, 13 May 2019 19:38:01 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it1-x12a.google.com with SMTP id q65so1057780itg.2; Mon, 13 May 2019 12:38:01 -0700 (PDT) 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=Nk/8sfq4Tok6/qoaRcuxwjKDdJ7+AcJxrUL1JPkWuSo=; b=eOlG81UDgtTjgXQM4Swf2wWDXzheb/s83nRSVDE+unXPHmiPL6BI+AlTBB+lUir0e7 1MHnhbnDbcv1Pf/VdvroChX89cm1q//GgCDVzIYJUC536ME3kAWdkFp1SNIRNGplA2g3 q1CytoJ+QNOako3dUoQdwwK4VoXK3iFwEh5/systb8RlPLO2cbA2Hk+wufOH3QbvvAV9 tB7BjOPIAMEtRw9aK8XO2A6m9/0TV+jwYNfUUPJUn4wEHBlxCjOi9i7p4Xtj+r23ie8o dnOZA7DsABbbNZuC7EAiyO/Dm0mmoCSjIhEOxdYvp4+1+VUZ42E/2DohGeKdecI0Wo0I soDg== 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=Nk/8sfq4Tok6/qoaRcuxwjKDdJ7+AcJxrUL1JPkWuSo=; b=KCzPbFPidDhTuwVRop+X/BGaKtLt61LeK/RM/LtMdQ8iZfXqSOeagwYC6kYPnRBD+c /c8I3NbkHMq4KWadQ68BccDCdBuGRj0KeY3p4GB8u65vsBMoNnyOS/vsnXys6AR9MNS/ F2UsHX2QeJ2I0DB/VZIKPHZHE3+VPW6ewcuj5jcTgWtFhllOLnTVv9cve+OONpHrm5fs vbqS0URxxQrml519Y93eJFd1DPQTECWP5Ok5L9YeMshBqyp++UMA2BQyz5dcHiQnMb1g hp9W12lds1gt7YHkc3EQDfGjTSGf3EtAO6X1fy4BabPBzv9yzqcuFCy8qY7OeqDJzryJ vKag== X-Gm-Message-State: APjAAAU+SlItGJUnv/SspTtGXoY+8l9scowwQ/3kwzam0y8MdFpbKHpa UnESKLHBI+XxKieHpBb2IqaTktgu X-Google-Smtp-Source: APXvYqz25Uxd/oIkhBQr5gmjkhGRHhDlLZQ2FCbb0sagf5muWdtjfC1n6Tp+SEw/yc5riGl7eY80kg== X-Received: by 2002:a24:9412:: with SMTP id j18mr661915ite.124.1557776279730; Mon, 13 May 2019 12:37:59 -0700 (PDT) Received: from raichu (toroon0560w-lp140-01-69-159-36-31.dsl.bell.ca. [69.159.36.31]) by smtp.gmail.com with ESMTPSA id b1sm206699itd.12.2019.05.13.12.37.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 May 2019 12:37:58 -0700 (PDT) Sender: Mark Johnston Date: Mon, 13 May 2019 15:37:54 -0400 From: Mark Johnston To: "Andrey V. Elsukov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, melifaro@freebsd.org Subject: Re: svn commit: r347526 - head/sys/net Message-ID: <20190513193754.GA37655@raichu> References: <201905131345.x4DDjTRn092669@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905131345.x4DDjTRn092669@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 6BD2E6A711 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.990,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, 13 May 2019 19:38:02 -0000 On Mon, May 13, 2019 at 01:45:29PM +0000, Andrey V. Elsukov wrote: > Author: ae > Date: Mon May 13 13:45:28 2019 > New Revision: 347526 > URL: https://svnweb.freebsd.org/changeset/base/347526 > > Log: > Rework locking in BPF code to remove rwlock from fast path. > > On high packets rate the contention on rwlock in bpf_*tap*() functions > can lead to packets dropping. To avoid this, migrate this code to use > epoch(9) KPI and ConcurrencyKit's lists. > > * all lists changed to use CK_LIST; > * reference counting added to bpf_if and bpf_d; > * now bpf_if references ifnet and releases this reference on destroy; > * each bpf_d descriptor references bpf_if when it is attached; > * new struct bpf_program_buffer introduced to keep BPF filter programs; > * bpf_program_buffer, bpf_d and bpf_if structures are freed by > epoch_call(); > * bpf_freelist and ifnet_departure event are no longer needed, thus > both are removed; > > Reviewed by: melifaro > Sponsored by: Yandex LLC > Differential Revision: https://reviews.freebsd.org/D20224 This seems to introduce a possible recursion on the bpf cdev mutex. Now bpfwrite() holds the mutex over the if_output call, which may enter bpf_mtap() via bridge_transmit(), and bpf_mtap() may attempt to reacquire the mutex. From owner-svn-src-head@freebsd.org Mon May 13 20:17:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8085B159A2BF; Mon, 13 May 2019 20:17:56 +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 278DE6C1EC; Mon, 13 May 2019 20:17:56 +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 00BCFED6C; Mon, 13 May 2019 20:17:56 +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 x4DKHtfm003355; Mon, 13 May 2019 20:17:55 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4DKHtvn003354; Mon, 13 May 2019 20:17:55 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905132017.x4DKHtvn003354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 13 May 2019 20:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347549 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 347549 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 278DE6C1EC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Mon, 13 May 2019 20:17:56 -0000 Author: ae Date: Mon May 13 20:17:55 2019 New Revision: 347549 URL: https://svnweb.freebsd.org/changeset/base/347549 Log: Avoid possible recursion on BPF_LOCK() in bpfwrite(). Release BPF_LOCK() before invoking if_output() and if_input(). Also enter epoch section before releasing lock, this should prevent access to ifnet that may be freed on interface detach. Reported by: markj Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Mon May 13 19:48:57 2019 (r347548) +++ head/sys/net/bpf.c Mon May 13 20:17:55 2019 (r347549) @@ -1257,6 +1257,9 @@ bpfwrite(struct cdev *dev, struct uio *uio, int ioflag ro.ro_flags = RT_HAS_HEADER; } + /* Avoid possible recursion on BPFD_LOCK(). */ + NET_EPOCH_ENTER(et); + BPFD_UNLOCK(d); error = (*ifp->if_output)(ifp, m, &dst, &ro); if (error) counter_u64_add(d->bd_wdcount, 1); @@ -1267,8 +1270,8 @@ bpfwrite(struct cdev *dev, struct uio *uio, int ioflag else m_freem(mc); } + NET_EPOCH_EXIT(et); CURVNET_RESTORE(); - BPFD_UNLOCK(d); bpfd_rele(d); return (error); From owner-svn-src-head@freebsd.org Mon May 13 22:10:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11335159C120; Mon, 13 May 2019 22:10:19 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yw1-f68.google.com (mail-yw1-f68.google.com [209.85.161.68]) (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 8703A7070B; Mon, 13 May 2019 22:10:18 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yw1-f68.google.com with SMTP id q185so12318579ywe.3; Mon, 13 May 2019 15:10:18 -0700 (PDT) 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=qkKLrEaY9WbdrD28Mq3TG+CqxIXQHRdW62x4Zm5IjgY=; b=VvCWDt2WOlryOAMWe/qYxibEKkqLjeY1YJh0xewL8y81ETPjQ5G8X86v1SPD9RyA6U 8kQwioorRaZKirglMj871BYMivplJsg9o6XiQ7/1SJMfLwF4javdZy0Vwg4gkl8YSVaS IAXpdDCZzTwn9lIH1M/tQR4zT0uTi3jgBjT5nBNTMCXe6NEpNw8YA4lkLDH8QOuvqzA4 H/jiZBsX0wPBKgkM+HsItvVsEpt03Za6E7UEZxC8NtqiOZX9xLCeRPuSJo8e03qy3FAU 5fuzZvK5GHW+HjHyxjjWtN+rBrzW3hPduMK771BV1xzyNk0GB905+GDJLVFqeQ3YVrAZ VLug== X-Gm-Message-State: APjAAAUS/5gRMQ+WR3ZKZAlHL1ECez4vmPglSauXI5sBEIdboIlcJ0kp nASoeaBdZqtAPcN3tWrrVzUEEsRRC3cDLTDg9Ur2AnOLRtU= X-Google-Smtp-Source: APXvYqw0RHsct/N3piuNLJaYSO/FlXSuGJ0Hh73/Zo+Tvy8lbzDEFpMEMSqq0AaSwIEb4R0IsdwwNSIzD+Ib4xB4mbA= X-Received: by 2002:a81:a34a:: with SMTP id a71mr5002222ywh.318.1557785411817; Mon, 13 May 2019 15:10:11 -0700 (PDT) MIME-Version: 1.0 References: <201905131345.x4DDjTRn092669@repo.freebsd.org> <20190513193754.GA37655@raichu> In-Reply-To: <20190513193754.GA37655@raichu> From: Li-Wen Hsu Date: Mon, 13 May 2019 18:09:59 -0400 Message-ID: Subject: Re: svn commit: r347526 - head/sys/net To: Mark Johnston Cc: "Andrey V. Elsukov" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, melifaro@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 8703A7070B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; TAGGED_FROM(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; 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, 13 May 2019 22:10:19 -0000 On Mon, May 13, 2019 at 3:38 PM Mark Johnston wrote: > > On Mon, May 13, 2019 at 01:45:29PM +0000, Andrey V. Elsukov wrote: > > Author: ae > > Date: Mon May 13 13:45:28 2019 > > New Revision: 347526 > > URL: https://svnweb.freebsd.org/changeset/base/347526 > > > > Log: > > Rework locking in BPF code to remove rwlock from fast path. > > > > On high packets rate the contention on rwlock in bpf_*tap*() functions > > can lead to packets dropping. To avoid this, migrate this code to use > > epoch(9) KPI and ConcurrencyKit's lists. > > > > * all lists changed to use CK_LIST; > > * reference counting added to bpf_if and bpf_d; > > * now bpf_if references ifnet and releases this reference on destroy; > > * each bpf_d descriptor references bpf_if when it is attached; > > * new struct bpf_program_buffer introduced to keep BPF filter programs; > > * bpf_program_buffer, bpf_d and bpf_if structures are freed by > > epoch_call(); > > * bpf_freelist and ifnet_departure event are no longer needed, thus > > both are removed; > > > > Reviewed by: melifaro > > Sponsored by: Yandex LLC > > Differential Revision: https://reviews.freebsd.org/D20224 > > This seems to introduce a possible recursion on the bpf cdev mutex. Now > bpfwrite() holds the mutex over the if_output call, which may enter > bpf_mtap() via bridge_transmit(), and bpf_mtap() may attempt to > reacquire the mutex. It does, the sys.netinet.fibs_test.arpresolve_checks_interface_fib case can trigger a panic: root@:/usr/tests/sys/netinet # kyua test fibs_test:arpresolve_checks_interface_fib fibs_test:arpresolve_checks_interface_fib -> panic: _mtx_lock_sleep: recursed on non-recursive mutex bpf @ /usr/src/sys/net/bpf.c:2325 From owner-svn-src-head@freebsd.org Mon May 13 22:17:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CE97159C3A4; Mon, 13 May 2019 22:17:12 +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 35B5770B43; Mon, 13 May 2019 22:17:12 +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 B619B1818F; Mon, 13 May 2019 22:17: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 x4DMHBrL066372; Mon, 13 May 2019 22:17:11 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4DMHBr7066371; Mon, 13 May 2019 22:17:11 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201905132217.x4DMHBr7066371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 13 May 2019 22:17:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347553 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 347553 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 35B5770B43 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Mon, 13 May 2019 22:17:12 -0000 Author: tsoome Date: Mon May 13 22:17:11 2019 New Revision: 347553 URL: https://svnweb.freebsd.org/changeset/base/347553 Log: loader: fix memory handling errors in module.c file_loadraw(): check for file_alloc() and strdup() results. we leak 'name'. mod_load() does leak 'filename'. mod_loadkld() does not need to check fp, file_discard() does check. Modified: head/stand/common/module.c Modified: head/stand/common/module.c ============================================================================== --- head/stand/common/module.c Mon May 13 20:57:21 2019 (r347552) +++ head/stand/common/module.c Mon May 13 22:17:11 2019 (r347553) @@ -499,7 +499,14 @@ file_loadraw(const char *fname, char *type, int insert /* Looks OK so far; create & populate control structure */ fp = file_alloc(); - fp->f_name = strdup(name); + if (fp == NULL) { + snprintf(command_errbuf, sizeof (command_errbuf), + "no memory to load %s", name); + free(name); + close(fd); + return (NULL); + } + fp->f_name = name; fp->f_type = strdup(type); fp->f_args = NULL; fp->f_metadata = NULL; @@ -507,6 +514,13 @@ file_loadraw(const char *fname, char *type, int insert fp->f_addr = loadaddr; fp->f_size = laddr - loadaddr; + if (fp->f_type == NULL) { + snprintf(command_errbuf, sizeof (command_errbuf), + "no memory to load %s", name); + free(name); + close(fd); + return (NULL); + } /* recognise space consumption */ loadaddr = laddr; @@ -552,6 +566,7 @@ mod_load(char *modname, struct mod_depend *verinfo, in return (ENOENT); } err = mod_loadkld(filename, argc, argv); + free(filename); return (err); } @@ -607,7 +622,7 @@ mod_loadkld(const char *kldname, int argc, char *argv[ snprintf(command_errbuf, sizeof(command_errbuf), "don't know how to load module '%s'", filename); } - if (err && fp) + if (err) file_discard(fp); free(filename); return (err); From owner-svn-src-head@freebsd.org Mon May 13 23:37:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18213159D78E; Mon, 13 May 2019 23:37:46 +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 9F4D372A3C; Mon, 13 May 2019 23:37:45 +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 5D38718ED0; Mon, 13 May 2019 23:37:45 +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 x4DNbjDa008732; Mon, 13 May 2019 23:37:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4DNbiVs008730; Mon, 13 May 2019 23:37:44 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905132337.x4DNbiVs008730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 13 May 2019 23:37:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347555 - in head: . sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: . sys/kern X-SVN-Commit-Revision: 347555 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9F4D372A3C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Mon, 13 May 2019 23:37:46 -0000 Author: cem Date: Mon May 13 23:37:44 2019 New Revision: 347555 URL: https://svnweb.freebsd.org/changeset/base/347555 Log: Revert r346292 (permit_nonrandom_stackcookies) We have a better, more comprehensive knob for this now: kern.random.initial_seeding.bypass_before_seeding=1. Requested by: delphij Sponsored by: Dell EMC Isilon Modified: head/UPDATING head/sys/kern/stack_protector.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon May 13 23:30:06 2019 (r347554) +++ head/UPDATING Mon May 13 23:37:44 2019 (r347555) @@ -76,13 +76,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: produce warnings in dmesg when the conditions are met. 20190416: - The tunable "security.stack_protect.permit_nonrandom_cookies" may be - set to a non-zero value to boot systems that do not provide early - entropy. Otherwise, such systems may see the panic message: - "cannot initialize stack cookies because random device is not yet - seeded." - -20190416: The loadable random module KPI has changed; the random_infra_init() routine now requires a 3rd function pointer for a bool (*)(void) method that returns true if the random device is seeded (and Modified: head/sys/kern/stack_protector.c ============================================================================== --- head/sys/kern/stack_protector.c Mon May 13 23:30:06 2019 (r347554) +++ head/sys/kern/stack_protector.c Mon May 13 23:37:44 2019 (r347555) @@ -4,28 +4,12 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include long __stack_chk_guard[8] = {}; void __stack_chk_fail(void); -/* - * XXX This default is unsafe!!! We intend to change it after resolving issues - * with early entropy in the installer; some kinds of systems that do not use - * loader(8), such as riscv, aarch64, and power; and perhaps others that I am - * forgetting off the top of my head. - */ -static bool permit_nonrandom_cookies = true; - -SYSCTL_NODE(_security, OID_AUTO, stack_protect, CTLFLAG_RW, 0, - "-fstack-protect support"); -SYSCTL_BOOL(_security_stack_protect, OID_AUTO, permit_nonrandom_cookies, - CTLFLAG_RDTUN, &permit_nonrandom_cookies, 0, - "Allow stack guard to be used without real random cookies"); - void __stack_chk_fail(void) { @@ -39,37 +23,8 @@ __stack_chk_init(void *dummy __unused) size_t i; long guard[nitems(__stack_chk_guard)]; - if (is_random_seeded()) { - arc4rand(guard, sizeof(guard), 0); - for (i = 0; i < nitems(guard); i++) - __stack_chk_guard[i] = guard[i]; - return; - } - - if (permit_nonrandom_cookies) { - printf("%s: WARNING: Initializing stack protection with " - "non-random cookies!\n", __func__); - printf("%s: WARNING: This severely limits the benefit of " - "-fstack-protector!\n", __func__); - - /* - * The emperor is naked, but I rolled some dice and at least - * these values aren't zero. - */ - __stack_chk_guard[0] = (long)0xe7318d5959af899full; - __stack_chk_guard[1] = (long)0x35a9481c089348bfull; - __stack_chk_guard[2] = (long)0xde657fdc04117255ull; - __stack_chk_guard[3] = (long)0x0dd44c61c22e4a6bull; - __stack_chk_guard[4] = (long)0x0a5869a354edb0a5ull; - __stack_chk_guard[5] = (long)0x05cebfed255b5232ull; - __stack_chk_guard[6] = (long)0x270ffac137c4c72full; - __stack_chk_guard[7] = (long)0xd8141a789bad478dull; - _Static_assert(nitems(__stack_chk_guard) == 8, - "__stack_chk_guard doesn't have 8 items"); - return; - } - - panic("%s: cannot initialize stack cookies because random device is " - "not yet seeded", __func__); + arc4rand(guard, sizeof(guard), 0); + for (i = 0; i < nitems(guard); i++) + __stack_chk_guard[i] = guard[i]; } SYSINIT(stack_chk, SI_SUB_RANDOM, SI_ORDER_ANY, __stack_chk_init, NULL); From owner-svn-src-head@freebsd.org Tue May 14 00:24:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3937159EE3B; Tue, 14 May 2019 00:24:44 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it1-x141.google.com (mail-it1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) (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 4A7D174723; Tue, 14 May 2019 00:24:44 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it1-x141.google.com with SMTP id q132so2112077itc.5; Mon, 13 May 2019 17:24:44 -0700 (PDT) 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=qIuDtgOGHmeOp+qgq+hFNiFfd+yTXKCmcZ391Ja4QMs=; b=plWtn3OzgxaMrua51Mh7TOCud+6Hj2oC+DI4FtvoFl/cqRvrErw9UboCrtpyaemZWf ITue5HR3dLbjNHS4ku7FFUFCGWoL+Pjvn7Tnd0D0Dpr9Ocd07JFcz5AxgrWe0s7mFBvt BemWOmt2FC0vdUna50Q4LuCaALlgIIy1wfm0YS0yw2bNVAREE914Dnc269xnB5OHmkEA yK23zrC8iApy9eQH4gffSmnIhW1AEddgmW1hcbMm2ugBcMajtzqeVbCJhD321CSco2mO 3JWRwp9qNlYtgMBfOPrPp+AMXUYrt9JhG1nbS7RoQH8TvKyA5P9jGrE0LKQDatL/EPj5 OLcQ== 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=qIuDtgOGHmeOp+qgq+hFNiFfd+yTXKCmcZ391Ja4QMs=; b=lQhfImjrjLRWXGXfvaXrVIKOkx3JEHdVrlIppl8zlD3BNmj6rPLSjKneBd8UoG9zJw XsPjw+FT4xywanr4XQ07woh9x0ABDiPqf8OXxZlVKCWgJuR6vA/dqxbAtrQjWocfeOC0 KhzjGaPMFCNd7yweX92Hiz7LpTdn404DnOLxi5PMoXxJ4ueXt+gb7qFtRjMv36jxGCTl 8g509jTzV6fsCL40SqkDHPIqnncsiuXgElFeXDvxQx21qbcYdFmVctOewdj8Lf1vrF0/ AU95/0+XrYDy4BOT/ztXMgnga7IJMzkJ9++epO8+6Rs1RiGM4rvNcGHgWVKtqNMzKwpy cyww== X-Gm-Message-State: APjAAAW0L7fcfjcBXWK8z0ZPsbItWnuxi4wjs0OOvBLjdCLh5UmZeBwK r2ObytHq8XNGcs5sCqmJTbdEkHd7 X-Google-Smtp-Source: APXvYqwNmWc/zgyGk/D4WO+FgCYasutcEB1AqahypeqXVHcGA7gFOm2QpBtC/dNKE/0k2Q9UdxQi9g== X-Received: by 2002:a02:83ce:: with SMTP id j14mr21150179jah.61.1557793483118; Mon, 13 May 2019 17:24:43 -0700 (PDT) Received: from raichu (toroon0560w-lp140-01-69-159-36-31.dsl.bell.ca. [69.159.36.31]) by smtp.gmail.com with ESMTPSA id x23sm5092110iob.57.2019.05.13.17.24.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 May 2019 17:24:42 -0700 (PDT) Sender: Mark Johnston Date: Mon, 13 May 2019 20:24:37 -0400 From: Mark Johnston To: Li-Wen Hsu Cc: "Andrey V. Elsukov" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, melifaro@freebsd.org Subject: Re: svn commit: r347526 - head/sys/net Message-ID: <20190514002437.GA51157@raichu> References: <201905131345.x4DDjTRn092669@repo.freebsd.org> <20190513193754.GA37655@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 4A7D174723 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.986,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: Tue, 14 May 2019 00:24:44 -0000 On Mon, May 13, 2019 at 06:09:59PM -0400, Li-Wen Hsu wrote: > On Mon, May 13, 2019 at 3:38 PM Mark Johnston wrote: > > > > On Mon, May 13, 2019 at 01:45:29PM +0000, Andrey V. Elsukov wrote: > > > Author: ae > > > Date: Mon May 13 13:45:28 2019 > > > New Revision: 347526 > > > URL: https://svnweb.freebsd.org/changeset/base/347526 > > > > > > Log: > > > Rework locking in BPF code to remove rwlock from fast path. > > > > > > On high packets rate the contention on rwlock in bpf_*tap*() functions > > > can lead to packets dropping. To avoid this, migrate this code to use > > > epoch(9) KPI and ConcurrencyKit's lists. > > > > > > * all lists changed to use CK_LIST; > > > * reference counting added to bpf_if and bpf_d; > > > * now bpf_if references ifnet and releases this reference on destroy; > > > * each bpf_d descriptor references bpf_if when it is attached; > > > * new struct bpf_program_buffer introduced to keep BPF filter programs; > > > * bpf_program_buffer, bpf_d and bpf_if structures are freed by > > > epoch_call(); > > > * bpf_freelist and ifnet_departure event are no longer needed, thus > > > both are removed; > > > > > > Reviewed by: melifaro > > > Sponsored by: Yandex LLC > > > Differential Revision: https://reviews.freebsd.org/D20224 > > > > This seems to introduce a possible recursion on the bpf cdev mutex. Now > > bpfwrite() holds the mutex over the if_output call, which may enter > > bpf_mtap() via bridge_transmit(), and bpf_mtap() may attempt to > > reacquire the mutex. > > It does, the sys.netinet.fibs_test.arpresolve_checks_interface_fib > case can trigger a panic: > > root@:/usr/tests/sys/netinet # kyua test > fibs_test:arpresolve_checks_interface_fib > fibs_test:arpresolve_checks_interface_fib -> panic: _mtx_lock_sleep: > recursed on non-recursive mutex bpf @ /usr/src/sys/net/bpf.c:2325 The problem should be fixed by r347549. From owner-svn-src-head@freebsd.org Tue May 14 10:21:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AFD215AB209; Tue, 14 May 2019 10:21:29 +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 42A188E3C4; Tue, 14 May 2019 10:21:29 +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 1CC931FBAC; Tue, 14 May 2019 10:21:29 +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 x4EALSCD053883; Tue, 14 May 2019 10:21:28 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4EALSRO053882; Tue, 14 May 2019 10:21:28 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905141021.x4EALSRO053882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 14 May 2019 10:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347563 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347563 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 42A188E3C4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Tue, 14 May 2019 10:21:29 -0000 Author: ae Date: Tue May 14 10:21:28 2019 New Revision: 347563 URL: https://svnweb.freebsd.org/changeset/base/347563 Log: Remove bpf interface lock, it is no longer exist. Modified: head/sys/kern/subr_witness.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Tue May 14 04:34:58 2019 (r347562) +++ head/sys/kern/subr_witness.c Tue May 14 10:21:28 2019 (r347563) @@ -576,7 +576,6 @@ static struct witness_order_list_entry order_lists[] = * BPF */ { "bpf global lock", &lock_class_sx }, - { "bpf interface lock", &lock_class_rw }, { "bpf cdev lock", &lock_class_mtx_sleep }, { NULL, NULL }, /* From owner-svn-src-head@freebsd.org Tue May 14 15:19:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42A9D15909F6; Tue, 14 May 2019 15:19: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 DD014711EA; Tue, 14 May 2019 15:19:48 +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 B724722C30; Tue, 14 May 2019 15:19:48 +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 x4EFJmG7007334; Tue, 14 May 2019 15:19:48 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4EFJmBj007333; Tue, 14 May 2019 15:19:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905141519.x4EFJmBj007333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 14 May 2019 15:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347564 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 347564 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD014711EA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Tue, 14 May 2019 15:19:49 -0000 Author: markj Date: Tue May 14 15:19:48 2019 New Revision: 347564 URL: https://svnweb.freebsd.org/changeset/base/347564 Log: Fix formatting. MFC after: 3 days Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Tue May 14 10:21:28 2019 (r347563) +++ head/sys/amd64/amd64/trap.c Tue May 14 15:19:48 2019 (r347564) @@ -904,8 +904,8 @@ trap_fatal(frame, eva) code & PGEX_U ? "user" : "supervisor", code & PGEX_W ? "write" : "read", code & PGEX_I ? "instruction" : "data", - code & PGEX_PK ? " prot key" : " ", - code & PGEX_SGX ? " SGX" : " ", + code & PGEX_PK ? " prot key" : "", + code & PGEX_SGX ? " SGX" : "", code & PGEX_RSV ? "reserved bits in PTE" : code & PGEX_P ? "protection violation" : "page not present"); } From owner-svn-src-head@freebsd.org Tue May 14 15:41:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38EE71591420; Tue, 14 May 2019 15:41:35 +0000 (UTC) (envelope-from ygy@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 D2A4871D24; Tue, 14 May 2019 15:41:34 +0000 (UTC) (envelope-from ygy@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 AC5FA22FBA; Tue, 14 May 2019 15:41:34 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4EFfY6P019679; Tue, 14 May 2019 15:41:34 GMT (envelope-from ygy@FreeBSD.org) Received: (from ygy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4EFfYPT019678; Tue, 14 May 2019 15:41:34 GMT (envelope-from ygy@FreeBSD.org) Message-Id: <201905141541.x4EFfYPT019678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ygy set sender to ygy@FreeBSD.org using -f From: Guangyuan Yang Date: Tue, 14 May 2019 15:41:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347565 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: ygy X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 347565 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D2A4871D24 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Tue, 14 May 2019 15:41:35 -0000 Author: ygy (doc committer) Date: Tue May 14 15:41:34 2019 New Revision: 347565 URL: https://svnweb.freebsd.org/changeset/base/347565 Log: Fix some spelling errors in ng_eiface(4). MFC after: 3 days PR: 237764 Submitted by: Tom Marcoen Modified: head/share/man/man4/ng_eiface.4 Modified: head/share/man/man4/ng_eiface.4 ============================================================================== --- head/share/man/man4/ng_eiface.4 Tue May 14 15:19:48 2019 (r347564) +++ head/share/man/man4/ng_eiface.4 Tue May 14 15:41:34 2019 (r347565) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 3, 2005 +.Dd May 14, 2019 .Dt NG_EIFACE 4 .Os .Sh NAME @@ -36,7 +36,7 @@ The .Vt eiface netgraph node implements the generic Ethernet interface. -When +When an .Vt eiface node is created, a new interface appears which is accessible via .Xr ifconfig 8 . @@ -78,7 +78,7 @@ which requires as an argument an string consisting of 6 colon-separated hex digits. .It Dv NGM_EIFACE_GET_IFNAME Pq Ic getifname Return the name of the associated interface as a -.Dv NUL Ns -terminated +.Dv NULL Ns -terminated .Tn ASCII string. .It Dv NGM_EIFACE_GET_IFADDRS @@ -97,7 +97,7 @@ Unlike most other node types, an .Vt eiface node does .Em not -go away when all hooks have been disconnected; rather, and explicit +go away when all hooks have been disconnected; rather, an explicit .Dv NGM_SHUTDOWN control message is required. .Sh SEE ALSO From owner-svn-src-head@freebsd.org Tue May 14 17:02:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 691821592DDA; Tue, 14 May 2019 17:02:24 +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 1BC6A7464C; Tue, 14 May 2019 17:02:24 +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 E361423E30; Tue, 14 May 2019 17:02:23 +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 x4EH2NEY061073; Tue, 14 May 2019 17:02:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4EH2LuD061054; Tue, 14 May 2019 17:02:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905141702.x4EH2LuD061054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 14 May 2019 17:02:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347566 - in head/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86 X-SVN-Commit-Revision: 347566 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1BC6A7464C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Tue, 14 May 2019 17:02:24 -0000 Author: kib Date: Tue May 14 17:02:20 2019 New Revision: 347566 URL: https://svnweb.freebsd.org/changeset/base/347566 Log: Mitigations for Microarchitectural Data Sampling. Microarchitectural buffers on some Intel processors utilizing speculative execution may allow a local process to obtain a memory disclosure. An attacker may be able to read secret data from the kernel or from a process when executing untrusted code (for example, in a web browser). Reference: https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00233.html Security: CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091 Security: FreeBSD-SA-19:07.mds Reviewed by: jhb Tested by: emaste, lwhsu Approved by: so (gtetlow) Modified: head/sys/amd64/amd64/exception.S head/sys/amd64/amd64/genassym.c head/sys/amd64/amd64/initcpu.c head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/support.S head/sys/amd64/include/pcpu.h head/sys/dev/cpuctl/cpuctl.c head/sys/i386/i386/exception.s head/sys/i386/i386/genassym.c head/sys/i386/i386/initcpu.c head/sys/i386/i386/support.s head/sys/i386/include/pcpu.h head/sys/x86/include/specialreg.h head/sys/x86/include/x86_var.h head/sys/x86/x86/cpu_machdep.c Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Tue May 14 15:41:34 2019 (r347565) +++ head/sys/amd64/amd64/exception.S Tue May 14 17:02:20 2019 (r347566) @@ -512,6 +512,7 @@ fast_syscall_common: testl $TDF_ASTPENDING | TDF_NEEDRESCHED,TD_FLAGS(%rax) jne 3f call handle_ibrs_exit + callq *mds_handler /* Restore preserved registers. */ MEXITCOUNT movq TF_RDI(%rsp),%rdi /* bonus; preserve arg 1 */ @@ -1157,6 +1158,7 @@ ld_regs: jz 2f /* keep running with kernel GS.base */ cli call handle_ibrs_exit_rs + callq *mds_handler cmpq $~0,PCPU(UCR3) je 1f pushq %rdx Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Tue May 14 15:41:34 2019 (r347565) +++ head/sys/amd64/amd64/genassym.c Tue May 14 17:02:20 2019 (r347566) @@ -233,6 +233,9 @@ ASSYM(PC_PTI_STACK, offsetof(struct pcpu, pc_pti_stack ASSYM(PC_PTI_STACK_SZ, PC_PTI_STACK_SZ); ASSYM(PC_PTI_RSP0, offsetof(struct pcpu, pc_pti_rsp0)); ASSYM(PC_IBPB_SET, offsetof(struct pcpu, pc_ibpb_set)); +ASSYM(PC_MDS_TMP, offsetof(struct pcpu, pc_mds_tmp)); +ASSYM(PC_MDS_BUF, offsetof(struct pcpu, pc_mds_buf)); +ASSYM(PC_MDS_BUF64, offsetof(struct pcpu, pc_mds_buf64)); ASSYM(LA_EOI, LAPIC_EOI * LAPIC_MEM_MUL); ASSYM(LA_ISR, LAPIC_ISR0 * LAPIC_MEM_MUL); Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Tue May 14 15:41:34 2019 (r347565) +++ head/sys/amd64/amd64/initcpu.c Tue May 14 17:02:20 2019 (r347566) @@ -257,6 +257,7 @@ initializecpu(void) hw_ibrs_recalculate(); hw_ssb_recalculate(false); amd64_syscall_ret_flush_l1d_recalc(); + hw_mds_recalculate(); switch (cpu_vendor_id) { case CPU_VENDOR_AMD: init_amd(); Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue May 14 15:41:34 2019 (r347565) +++ head/sys/amd64/amd64/machdep.c Tue May 14 17:02:20 2019 (r347566) @@ -1732,6 +1732,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) TUNABLE_INT_FETCH("hw.spec_store_bypass_disable", &hw_ssb_disable); TUNABLE_INT_FETCH("machdep.syscall_ret_l1d_flush", &syscall_ret_l1d_flush_mode); + TUNABLE_INT_FETCH("hw.mds_disable", &hw_mds_disable); finishidentcpu(); /* Final stage of CPU initialization */ initializecpu(); /* Initialize CPU registers */ Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Tue May 14 15:41:34 2019 (r347565) +++ head/sys/amd64/amd64/support.S Tue May 14 17:02:20 2019 (r347566) @@ -1,8 +1,13 @@ /*- + * Copyright (c) 2018-2019 The FreeBSD Foundation * Copyright (c) 2003 Peter Wemm. * Copyright (c) 1993 The Regents of the University of California. * All rights reserved. * + * Portions of this software were developed by + * Konstantin Belousov 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: @@ -1622,3 +1627,239 @@ ENTRY(flush_l1d_sw_abi) popq %rbx ret END(flush_l1d_sw_abi) + +ENTRY(mds_handler_void) + retq +END(mds_handler_void) + +ENTRY(mds_handler_verw) + subq $8, %rsp + movw %ds, (%rsp) + verw (%rsp) + addq $8, %rsp + retq +END(mds_handler_verw) + +ENTRY(mds_handler_ivb) + pushq %rax + pushq %rdx + pushq %rcx + + movq %cr0, %rax + testb $CR0_TS, %al + je 1f + clts +1: movq PCPU(MDS_BUF), %rdx + movdqa %xmm0, PCPU(MDS_TMP) + pxor %xmm0, %xmm0 + + lfence + orpd (%rdx), %xmm0 + orpd (%rdx), %xmm0 + mfence + movl $40, %ecx + addq $16, %rdx +2: movntdq %xmm0, (%rdx) + addq $16, %rdx + decl %ecx + jnz 2b + mfence + + movdqa PCPU(MDS_TMP),%xmm0 + testb $CR0_TS, %al + je 3f + movq %rax, %cr0 +3: popq %rcx + popq %rdx + popq %rax + retq +END(mds_handler_ivb) + +ENTRY(mds_handler_bdw) + pushq %rax + pushq %rbx + pushq %rcx + pushq %rdi + pushq %rsi + + movq %cr0, %rax + testb $CR0_TS, %al + je 1f + clts +1: movq PCPU(MDS_BUF), %rbx + movdqa %xmm0, PCPU(MDS_TMP) + pxor %xmm0, %xmm0 + + movq %rbx, %rdi + movq %rbx, %rsi + movl $40, %ecx +2: movntdq %xmm0, (%rbx) + addq $16, %rbx + decl %ecx + jnz 2b + mfence + movl $1536, %ecx + rep; movsb + lfence + + movdqa PCPU(MDS_TMP),%xmm0 + testb $CR0_TS, %al + je 3f + movq %rax, %cr0 +3: popq %rsi + popq %rdi + popq %rcx + popq %rbx + popq %rax + retq +END(mds_handler_bdw) + +ENTRY(mds_handler_skl_sse) + pushq %rax + pushq %rdx + pushq %rcx + pushq %rdi + + movq %cr0, %rax + testb $CR0_TS, %al + je 1f + clts +1: movq PCPU(MDS_BUF), %rdi + movq PCPU(MDS_BUF64), %rdx + movdqa %xmm0, PCPU(MDS_TMP) + pxor %xmm0, %xmm0 + + lfence + orpd (%rdx), %xmm0 + orpd (%rdx), %xmm0 + xorl %eax, %eax +2: clflushopt 5376(%rdi, %rax, 8) + addl $8, %eax + cmpl $8 * 12, %eax + jb 2b + sfence + movl $6144, %ecx + xorl %eax, %eax + rep; stosb + mfence + + movdqa PCPU(MDS_TMP), %xmm0 + testb $CR0_TS, %al + je 3f + movq %rax, %cr0 +3: popq %rdi + popq %rcx + popq %rdx + popq %rax + retq +END(mds_handler_skl_sse) + +ENTRY(mds_handler_skl_avx) + pushq %rax + pushq %rdx + pushq %rcx + pushq %rdi + + movq %cr0, %rax + testb $CR0_TS, %al + je 1f + clts +1: movq PCPU(MDS_BUF), %rdi + movq PCPU(MDS_BUF64), %rdx + vmovdqa %ymm0, PCPU(MDS_TMP) + vpxor %ymm0, %ymm0, %ymm0 + + lfence + vorpd (%rdx), %ymm0, %ymm0 + vorpd (%rdx), %ymm0, %ymm0 + xorl %eax, %eax +2: clflushopt 5376(%rdi, %rax, 8) + addl $8, %eax + cmpl $8 * 12, %eax + jb 2b + sfence + movl $6144, %ecx + xorl %eax, %eax + rep; stosb + mfence + + vmovdqa PCPU(MDS_TMP), %ymm0 + testb $CR0_TS, %al + je 3f + movq %rax, %cr0 +3: popq %rdi + popq %rcx + popq %rdx + popq %rax + retq +END(mds_handler_skl_avx) + +ENTRY(mds_handler_skl_avx512) + pushq %rax + pushq %rdx + pushq %rcx + pushq %rdi + + movq %cr0, %rax + testb $CR0_TS, %al + je 1f + clts +1: movq PCPU(MDS_BUF), %rdi + movq PCPU(MDS_BUF64), %rdx + vmovdqa64 %zmm0, PCPU(MDS_TMP) + vpxor %zmm0, %zmm0, %zmm0 + + lfence + vorpd (%rdx), %zmm0, %zmm0 + vorpd (%rdx), %zmm0, %zmm0 + xorl %eax, %eax +2: clflushopt 5376(%rdi, %rax, 8) + addl $8, %eax + cmpl $8 * 12, %eax + jb 2b + sfence + movl $6144, %ecx + xorl %eax, %eax + rep; stosb + mfence + + vmovdqa64 PCPU(MDS_TMP), %zmm0 + testb $CR0_TS, %al + je 3f + movq %rax, %cr0 +3: popq %rdi + popq %rcx + popq %rdx + popq %rax + retq +END(mds_handler_skl_avx512) + +ENTRY(mds_handler_silvermont) + pushq %rax + pushq %rdx + pushq %rcx + + movq %cr0, %rax + testb $CR0_TS, %al + je 1f + clts +1: movq PCPU(MDS_BUF), %rdx + movdqa %xmm0, PCPU(MDS_TMP) + pxor %xmm0, %xmm0 + + movl $16, %ecx +2: movntdq %xmm0, (%rdx) + addq $16, %rdx + decl %ecx + jnz 2b + mfence + + movdqa PCPU(MDS_TMP),%xmm0 + testb $CR0_TS, %al + je 3f + movq %rax, %cr0 +3: popq %rcx + popq %rdx + popq %rax + retq +END(mds_handler_silvermont) Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Tue May 14 15:41:34 2019 (r347565) +++ head/sys/amd64/include/pcpu.h Tue May 14 17:02:20 2019 (r347566) @@ -84,8 +84,12 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x c uint32_t pc_pcid_gen; \ uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \ uint32_t pc_ibpb_set; \ + void *pc_mds_buf; \ + void *pc_mds_buf64; \ + uint32_t pc_pad[2]; \ + uint8_t pc_mds_tmp[64]; \ u_int pc_ipi_bitmap; \ - char __pad[3284] /* pad to UMA_PCPU_ALLOC_SIZE */ + char __pad[3172] /* pad to UMA_PCPU_ALLOC_SIZE */ #define PC_DBREG_CMD_NONE 0 #define PC_DBREG_CMD_LOAD 1 Modified: head/sys/dev/cpuctl/cpuctl.c ============================================================================== --- head/sys/dev/cpuctl/cpuctl.c Tue May 14 15:41:34 2019 (r347565) +++ head/sys/dev/cpuctl/cpuctl.c Tue May 14 17:02:20 2019 (r347566) @@ -540,6 +540,7 @@ cpuctl_do_eval_cpu_features(int cpu, struct thread *td #ifdef __amd64__ amd64_syscall_ret_flush_l1d_recalc(); #endif + hw_mds_recalculate(); printcpuinfo(); return (0); } Modified: head/sys/i386/i386/exception.s ============================================================================== --- head/sys/i386/i386/exception.s Tue May 14 15:41:34 2019 (r347565) +++ head/sys/i386/i386/exception.s Tue May 14 17:02:20 2019 (r347566) @@ -522,6 +522,8 @@ doreti_exit: 2: movl $handle_ibrs_exit,%eax pushl %ecx /* preserve enough call-used regs */ call *%eax + movl mds_handler,%eax + call *%eax popl %ecx movl %esp, %esi movl PCPU(TRAMPSTK), %edx Modified: head/sys/i386/i386/genassym.c ============================================================================== --- head/sys/i386/i386/genassym.c Tue May 14 15:41:34 2019 (r347565) +++ head/sys/i386/i386/genassym.c Tue May 14 17:02:20 2019 (r347566) @@ -209,6 +209,9 @@ ASSYM(PC_KESP0, offsetof(struct pcpu, pc_kesp0)); ASSYM(PC_TRAMPSTK, offsetof(struct pcpu, pc_trampstk)); ASSYM(PC_COPYOUT_BUF, offsetof(struct pcpu, pc_copyout_buf)); ASSYM(PC_IBPB_SET, offsetof(struct pcpu, pc_ibpb_set)); +ASSYM(PC_MDS_TMP, offsetof(struct pcpu, pc_mds_tmp)); +ASSYM(PC_MDS_BUF, offsetof(struct pcpu, pc_mds_buf)); +ASSYM(PC_MDS_BUF64, offsetof(struct pcpu, pc_mds_buf64)); ASSYM(PMAP_TRM_MIN_ADDRESS, PMAP_TRM_MIN_ADDRESS); ASSYM(KERNLOAD, KERNLOAD); ASSYM(KERNBASE, KERNBASE); Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Tue May 14 15:41:34 2019 (r347565) +++ head/sys/i386/i386/initcpu.c Tue May 14 17:02:20 2019 (r347566) @@ -749,6 +749,7 @@ initializecpu(void) msr = rdmsr(MSR_EFER) | EFER_NXE; wrmsr(MSR_EFER, msr); } + hw_mds_recalculate(); if ((amd_feature & AMDID_RDTSCP) != 0 || (cpu_stdext_feature2 & CPUID_STDEXT2_RDPID) != 0) wrmsr(MSR_TSC_AUX, PCPU_GET(cpuid)); Modified: head/sys/i386/i386/support.s ============================================================================== --- head/sys/i386/i386/support.s Tue May 14 15:41:34 2019 (r347565) +++ head/sys/i386/i386/support.s Tue May 14 17:02:20 2019 (r347566) @@ -472,3 +472,187 @@ ENTRY(handle_ibrs_exit) movb $0,PCPU(IBPB_SET) 1: ret END(handle_ibrs_exit) + +ENTRY(mds_handler_void) + ret +END(mds_handler_void) + +ENTRY(mds_handler_verw) + subl $4, %esp + movw %ds, (%esp) + verw (%esp) + addl $4, %esp + ret +END(mds_handler_verw) + +ENTRY(mds_handler_ivb) + movl %cr0, %eax + testb $CR0_TS, %al + je 1f + clts +1: movl PCPU(MDS_BUF), %edx + movdqa %xmm0, PCPU(MDS_TMP) + pxor %xmm0, %xmm0 + + lfence + orpd (%edx), %xmm0 + orpd (%edx), %xmm0 + mfence + movl $40, %ecx + addl $16, %edx +2: movntdq %xmm0, (%edx) + addl $16, %edx + decl %ecx + jnz 2b + mfence + + movdqa PCPU(MDS_TMP),%xmm0 + testb $CR0_TS, %al + je 3f + movl %eax, %cr0 +3: ret +END(mds_handler_ivb) + +ENTRY(mds_handler_bdw) + movl %cr0, %eax + testb $CR0_TS, %al + je 1f + clts +1: movl PCPU(MDS_BUF), %ebx + movdqa %xmm0, PCPU(MDS_TMP) + pxor %xmm0, %xmm0 + + movl %ebx, %edi + movl %ebx, %esi + movl $40, %ecx +2: movntdq %xmm0, (%ebx) + addl $16, %ebx + decl %ecx + jnz 2b + mfence + movl $1536, %ecx + rep; movsb + lfence + + movdqa PCPU(MDS_TMP),%xmm0 + testb $CR0_TS, %al + je 3f + movl %eax, %cr0 +3: ret +END(mds_handler_bdw) + +ENTRY(mds_handler_skl_sse) + movl %cr0, %eax + testb $CR0_TS, %al + je 1f + clts +1: movl PCPU(MDS_BUF), %edi + movl PCPU(MDS_BUF64), %edx + movdqa %xmm0, PCPU(MDS_TMP) + pxor %xmm0, %xmm0 + + lfence + orpd (%edx), %xmm0 + orpd (%edx), %xmm0 + xorl %eax, %eax +2: clflushopt 5376(%edi, %eax, 8) + addl $8, %eax + cmpl $8 * 12, %eax + jb 2b + sfence + movl $6144, %ecx + xorl %eax, %eax + rep; stosb + mfence + + movdqa PCPU(MDS_TMP), %xmm0 + testb $CR0_TS, %al + je 3f + movl %eax, %cr0 +3: ret +END(mds_handler_skl_sse) + +ENTRY(mds_handler_skl_avx) + movl %cr0, %eax + testb $CR0_TS, %al + je 1f + clts +1: movl PCPU(MDS_BUF), %edi + movl PCPU(MDS_BUF64), %edx + vmovdqa %ymm0, PCPU(MDS_TMP) + vpxor %ymm0, %ymm0, %ymm0 + + lfence + vorpd (%edx), %ymm0, %ymm0 + vorpd (%edx), %ymm0, %ymm0 + xorl %eax, %eax +2: clflushopt 5376(%edi, %eax, 8) + addl $8, %eax + cmpl $8 * 12, %eax + jb 2b + sfence + movl $6144, %ecx + xorl %eax, %eax + rep; stosb + mfence + + vmovdqa PCPU(MDS_TMP), %ymm0 + testb $CR0_TS, %al + je 3f + movl %eax, %cr0 +3: ret +END(mds_handler_skl_avx) + +ENTRY(mds_handler_skl_avx512) + movl %cr0, %eax + testb $CR0_TS, %al + je 1f + clts +1: movl PCPU(MDS_BUF), %edi + movl PCPU(MDS_BUF64), %edx + vmovdqa64 %zmm0, PCPU(MDS_TMP) + vpxor %zmm0, %zmm0, %zmm0 + + lfence + vorpd (%edx), %zmm0, %zmm0 + vorpd (%edx), %zmm0, %zmm0 + xorl %eax, %eax +2: clflushopt 5376(%edi, %eax, 8) + addl $8, %eax + cmpl $8 * 12, %eax + jb 2b + sfence + movl $6144, %ecx + xorl %eax, %eax + rep; stosb + mfence + + vmovdqa64 PCPU(MDS_TMP), %zmm0 + testb $CR0_TS, %al + je 3f + movl %eax, %cr0 +3: ret +END(mds_handler_skl_avx512) + +ENTRY(mds_handler_silvermont) + movl %cr0, %eax + testb $CR0_TS, %al + je 1f + clts +1: movl PCPU(MDS_BUF), %edx + movdqa %xmm0, PCPU(MDS_TMP) + pxor %xmm0, %xmm0 + + movl $16, %ecx +2: movntdq %xmm0, (%edx) + addl $16, %edx + decl %ecx + jnz 2b + mfence + + movdqa PCPU(MDS_TMP),%xmm0 + testb $CR0_TS, %al + je 3f + movl %eax, %cr0 +3: ret +END(mds_handler_silvermont) Modified: head/sys/i386/include/pcpu.h ============================================================================== --- head/sys/i386/include/pcpu.h Tue May 14 15:41:34 2019 (r347565) +++ head/sys/i386/include/pcpu.h Tue May 14 17:02:20 2019 (r347566) @@ -84,11 +84,15 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x c struct sx pc_copyout_slock; \ char *pc_copyout_buf; \ vm_offset_t pc_pmap_eh_va; \ - caddr_t pc_pmap_eh_ptep; \ + caddr_t pc_pmap_eh_ptep; \ uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \ uint32_t pc_ibpb_set; \ + void *pc_mds_buf; \ + void *pc_mds_buf64; \ + uint32_t pc_pad[4]; \ + uint8_t pc_mds_tmp[64]; \ u_int pc_ipi_bitmap; \ - char __pad[3606] + char __pad[3518] #ifdef _KERNEL Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Tue May 14 15:41:34 2019 (r347565) +++ head/sys/x86/include/specialreg.h Tue May 14 17:02:20 2019 (r347566) @@ -448,6 +448,7 @@ /* * CPUID instruction 7 Structured Extended Features, leaf 0 edx info */ +#define CPUID_STDEXT3_MD_CLEAR 0x00000400 #define CPUID_STDEXT3_TSXFA 0x00002000 #define CPUID_STDEXT3_IBPB 0x04000000 #define CPUID_STDEXT3_STIBP 0x08000000 @@ -462,6 +463,7 @@ #define IA32_ARCH_CAP_RSBA 0x00000004 #define IA32_ARCH_CAP_SKIP_L1DFL_VMENTRY 0x00000008 #define IA32_ARCH_CAP_SSB_NO 0x00000010 +#define IA32_ARCH_CAP_MDS_NO 0x00000020 /* * CPUID manufacturers identifiers Modified: head/sys/x86/include/x86_var.h ============================================================================== --- head/sys/x86/include/x86_var.h Tue May 14 15:41:34 2019 (r347565) +++ head/sys/x86/include/x86_var.h Tue May 14 17:02:20 2019 (r347566) @@ -86,6 +86,7 @@ extern u_int max_apic_id; extern int i386_read_exec; extern int pti; extern int hw_ibrs_active; +extern int hw_mds_disable; extern int hw_ssb_active; struct pcb; @@ -128,6 +129,7 @@ int isa_nmi(int cd); void handle_ibrs_entry(void); void handle_ibrs_exit(void); void hw_ibrs_recalculate(void); +void hw_mds_recalculate(void); void hw_ssb_recalculate(bool all_cpus); void nmi_call_kdb(u_int cpu, u_int type, struct trapframe *frame); void nmi_call_kdb_smp(u_int type, struct trapframe *frame); Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Tue May 14 15:41:34 2019 (r347565) +++ head/sys/x86/x86/cpu_machdep.c Tue May 14 17:02:20 2019 (r347566) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -929,6 +930,203 @@ SYSCTL_PROC(_hw, OID_AUTO, spec_store_bypass_disable, CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, NULL, 0, hw_ssb_disable_handler, "I", "Speculative Store Bypass Disable (0 - off, 1 - on, 2 - auto"); + +int hw_mds_disable; + +/* + * Handler for Microarchitectural Data Sampling issues. Really not a + * pointer to C function: on amd64 the code must not change any CPU + * architectural state except possibly %rflags. Also, it is always + * called with interrupts disabled. + */ +void (*mds_handler)(void); +void mds_handler_void(void); +void mds_handler_verw(void); +void mds_handler_ivb(void); +void mds_handler_bdw(void); +void mds_handler_skl_sse(void); +void mds_handler_skl_avx(void); +void mds_handler_skl_avx512(void); +void mds_handler_silvermont(void); + +static int +sysctl_hw_mds_disable_state_handler(SYSCTL_HANDLER_ARGS) +{ + const char *state; + + if (mds_handler == mds_handler_void) + state = "inactive"; + else if (mds_handler == mds_handler_verw) + state = "VERW"; + else if (mds_handler == mds_handler_ivb) + state = "software IvyBridge"; + else if (mds_handler == mds_handler_bdw) + state = "software Broadwell"; + else if (mds_handler == mds_handler_skl_sse) + state = "software Skylake SSE"; + else if (mds_handler == mds_handler_skl_avx) + state = "software Skylake AVX"; + else if (mds_handler == mds_handler_skl_avx512) + state = "software Skylake AVX512"; + else if (mds_handler == mds_handler_silvermont) + state = "software Silvermont"; + else + state = "unknown"; + return (SYSCTL_OUT(req, state, strlen(state))); +} + +SYSCTL_PROC(_hw, OID_AUTO, mds_disable_state, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + sysctl_hw_mds_disable_state_handler, "A", + "Microarchitectural Data Sampling Mitigation state"); + +_Static_assert(__offsetof(struct pcpu, pc_mds_tmp) % 64 == 0, "MDS AVX512"); + +void +hw_mds_recalculate(void) +{ + struct pcpu *pc; + vm_offset_t b64; + u_long xcr0; + int i; + + /* + * Allow user to force VERW variant even if MD_CLEAR is not + * reported. For instance, hypervisor might unknowingly + * filter the cap out. + * For the similar reasons, and for testing, allow to enable + * mitigation even for RDCL_NO or MDS_NO caps. + */ + if (cpu_vendor_id != CPU_VENDOR_INTEL || hw_mds_disable == 0 || + ((cpu_ia32_arch_caps & (IA32_ARCH_CAP_RDCL_NO | + IA32_ARCH_CAP_MDS_NO)) != 0 && hw_mds_disable == 3)) { + mds_handler = mds_handler_void; + } else if (((cpu_stdext_feature3 & CPUID_STDEXT3_MD_CLEAR) != 0 && + hw_mds_disable == 3) || hw_mds_disable == 1) { + mds_handler = mds_handler_verw; + } else if (CPUID_TO_FAMILY(cpu_id) == 0x6 && + (CPUID_TO_MODEL(cpu_id) == 0x2e || CPUID_TO_MODEL(cpu_id) == 0x1e || + CPUID_TO_MODEL(cpu_id) == 0x1f || CPUID_TO_MODEL(cpu_id) == 0x1a || + CPUID_TO_MODEL(cpu_id) == 0x2f || CPUID_TO_MODEL(cpu_id) == 0x25 || + CPUID_TO_MODEL(cpu_id) == 0x2c || CPUID_TO_MODEL(cpu_id) == 0x2d || + CPUID_TO_MODEL(cpu_id) == 0x2a || CPUID_TO_MODEL(cpu_id) == 0x3e || + CPUID_TO_MODEL(cpu_id) == 0x3a) && + (hw_mds_disable == 2 || hw_mds_disable == 3)) { + /* + * Nehalem, SandyBridge, IvyBridge + */ + CPU_FOREACH(i) { + pc = pcpu_find(i); + if (pc->pc_mds_buf == NULL) { + pc->pc_mds_buf = malloc_domainset(672, M_TEMP, + DOMAINSET_PREF(pc->pc_domain), M_WAITOK); + bzero(pc->pc_mds_buf, 16); + } + } + mds_handler = mds_handler_ivb; + } else if (CPUID_TO_FAMILY(cpu_id) == 0x6 && + (CPUID_TO_MODEL(cpu_id) == 0x3f || CPUID_TO_MODEL(cpu_id) == 0x3c || + CPUID_TO_MODEL(cpu_id) == 0x45 || CPUID_TO_MODEL(cpu_id) == 0x46 || + CPUID_TO_MODEL(cpu_id) == 0x56 || CPUID_TO_MODEL(cpu_id) == 0x4f || + CPUID_TO_MODEL(cpu_id) == 0x47 || CPUID_TO_MODEL(cpu_id) == 0x3d) && + (hw_mds_disable == 2 || hw_mds_disable == 3)) { + /* + * Haswell, Broadwell + */ + CPU_FOREACH(i) { + pc = pcpu_find(i); + if (pc->pc_mds_buf == NULL) { + pc->pc_mds_buf = malloc_domainset(1536, M_TEMP, + DOMAINSET_PREF(pc->pc_domain), M_WAITOK); + bzero(pc->pc_mds_buf, 16); + } + } + mds_handler = mds_handler_bdw; + } else if (CPUID_TO_FAMILY(cpu_id) == 0x6 && + ((CPUID_TO_MODEL(cpu_id) == 0x55 && (cpu_id & + CPUID_STEPPING) <= 5) || + CPUID_TO_MODEL(cpu_id) == 0x4e || CPUID_TO_MODEL(cpu_id) == 0x5e || + (CPUID_TO_MODEL(cpu_id) == 0x8e && (cpu_id & + CPUID_STEPPING) <= 0xb) || + (CPUID_TO_MODEL(cpu_id) == 0x9e && (cpu_id & + CPUID_STEPPING) <= 0xc)) && + (hw_mds_disable == 2 || hw_mds_disable == 3)) { + /* + * Skylake, KabyLake, CoffeeLake, WhiskeyLake, + * CascadeLake + */ + CPU_FOREACH(i) { + pc = pcpu_find(i); + if (pc->pc_mds_buf == NULL) { + pc->pc_mds_buf = malloc_domainset(6 * 1024, + M_TEMP, DOMAINSET_PREF(pc->pc_domain), + M_WAITOK); + b64 = (vm_offset_t)malloc_domainset(64 + 63, + M_TEMP, DOMAINSET_PREF(pc->pc_domain), + M_WAITOK); + pc->pc_mds_buf64 = (void *)roundup2(b64, 64); + bzero(pc->pc_mds_buf64, 64); + } + } + xcr0 = rxcr(0); + if ((xcr0 & XFEATURE_ENABLED_ZMM_HI256) != 0 && + (cpu_stdext_feature2 & CPUID_STDEXT_AVX512DQ) != 0) + mds_handler = mds_handler_skl_avx512; + else if ((xcr0 & XFEATURE_ENABLED_AVX) != 0 && + (cpu_feature2 & CPUID2_AVX) != 0) + mds_handler = mds_handler_skl_avx; + else + mds_handler = mds_handler_skl_sse; + } else if (CPUID_TO_FAMILY(cpu_id) == 0x6 && + ((CPUID_TO_MODEL(cpu_id) == 0x37 || + CPUID_TO_MODEL(cpu_id) == 0x4a || + CPUID_TO_MODEL(cpu_id) == 0x4c || + CPUID_TO_MODEL(cpu_id) == 0x4d || + CPUID_TO_MODEL(cpu_id) == 0x5a || + CPUID_TO_MODEL(cpu_id) == 0x5d || + CPUID_TO_MODEL(cpu_id) == 0x6e || + CPUID_TO_MODEL(cpu_id) == 0x65 || + CPUID_TO_MODEL(cpu_id) == 0x75 || + CPUID_TO_MODEL(cpu_id) == 0x1c || + CPUID_TO_MODEL(cpu_id) == 0x26 || + CPUID_TO_MODEL(cpu_id) == 0x27 || + CPUID_TO_MODEL(cpu_id) == 0x35 || + CPUID_TO_MODEL(cpu_id) == 0x36 || + CPUID_TO_MODEL(cpu_id) == 0x7a))) { + /* Silvermont, Airmont */ + CPU_FOREACH(i) { + pc = pcpu_find(i); + if (pc->pc_mds_buf == NULL) + pc->pc_mds_buf = malloc(256, M_TEMP, M_WAITOK); + } + mds_handler = mds_handler_silvermont; + } else { + hw_mds_disable = 0; + mds_handler = mds_handler_void; + } +} + +static int +sysctl_mds_disable_handler(SYSCTL_HANDLER_ARGS) +{ + int error, val; + + val = hw_mds_disable; + error = sysctl_handle_int(oidp, &val, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + if (val < 0 || val > 3) + return (EINVAL); + hw_mds_disable = val; + hw_mds_recalculate(); + return (0); +} + +SYSCTL_PROC(_hw, OID_AUTO, mds_disable, CTLTYPE_INT | + CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, NULL, 0, + sysctl_mds_disable_handler, "I", + "Microarchitectural Data Sampling Mitigation " + "(0 - off, 1 - on VERW, 2 - on SW, 3 - on AUTO"); /* * Enable and restore kernel text write permissions. From owner-svn-src-head@freebsd.org Tue May 14 18:10:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CF4315947B4; Tue, 14 May 2019 18:10:33 +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 3F7C076A33; Tue, 14 May 2019 18:10:33 +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 190C824889; Tue, 14 May 2019 18:10:33 +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 x4EIAWgS095911; Tue, 14 May 2019 18:10:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4EIAW3D095910; Tue, 14 May 2019 18:10:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905141810.x4EIAW3D095910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 14 May 2019 18:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347569 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 347569 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3F7C076A33 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Tue, 14 May 2019 18:10:33 -0000 Author: markj Date: Tue May 14 18:10:32 2019 New Revision: 347569 URL: https://svnweb.freebsd.org/changeset/base/347569 Log: Remove redundant -Wl uses from the kernel's LDFLAGS. No functional change intended. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue May 14 17:05:02 2019 (r347568) +++ head/sys/conf/kern.pre.mk Tue May 14 18:10:32 2019 (r347569) @@ -144,7 +144,7 @@ CFLAGS+= ${GCOV_CFLAGS} CFLAGS+= ${CONF_CFLAGS} .if defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mbuild-id} -LDFLAGS+= -Wl,--build-id=sha1 +LDFLAGS+= --build-id=sha1 .endif .if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ @@ -153,11 +153,11 @@ LDFLAGS+= -Wl,--build-id=sha1 .error amd64/arm64/i386 kernel requires linker ifunc support .endif .if ${MACHINE_CPUARCH} == "amd64" -LDFLAGS+= -Wl,-z max-page-size=2097152 +LDFLAGS+= -z max-page-size=2097152 .if ${LINKER_TYPE} != "lld" -LDFLAGS+= -Wl,-z common-page-size=4096 +LDFLAGS+= -z common-page-size=4096 .else -LDFLAGS+= -Wl,-z -Wl,ifunc-noplt +LDFLAGS+= -z ifunc-noplt .endif .endif Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Tue May 14 17:05:02 2019 (r347568) +++ head/sys/conf/kmod.mk Tue May 14 18:10:32 2019 (r347569) @@ -138,7 +138,7 @@ CFLAGS+= -fno-common LDFLAGS+= -d -warn-common .if defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mbuild-id} -LDFLAGS+= -Wl,--build-id=sha1 +LDFLAGS+= --build-id=sha1 .endif CFLAGS+= ${DEBUG_FLAGS} From owner-svn-src-head@freebsd.org Tue May 14 18:26:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE2011594E9B; Tue, 14 May 2019 18:26:40 +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 5C6E377514; Tue, 14 May 2019 18:26:40 +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 36AAC24BE3; Tue, 14 May 2019 18:26:40 +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 x4EIQdQV006297; Tue, 14 May 2019 18:26:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4EIQdUI006296; Tue, 14 May 2019 18:26:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905141826.x4EIQdUI006296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 14 May 2019 18:26:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347570 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 347570 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C6E377514 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Tue, 14 May 2019 18:26:40 -0000 Author: markj Date: Tue May 14 18:26:39 2019 New Revision: 347570 URL: https://svnweb.freebsd.org/changeset/base/347570 Log: Specify -z notext when building with -z ifunc-noplt. The upstream implementation of -z ifunc-noplt disallows its combination with -z text. The option does not have much significance for kernel builds, though. Reviewed by: kib (previous version) Discussed with: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20260 Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue May 14 18:10:32 2019 (r347569) +++ head/sys/conf/kern.pre.mk Tue May 14 18:26:39 2019 (r347570) @@ -157,7 +157,7 @@ LDFLAGS+= -z max-page-size=2097152 .if ${LINKER_TYPE} != "lld" LDFLAGS+= -z common-page-size=4096 .else -LDFLAGS+= -z ifunc-noplt +LDFLAGS+= -z notext -z ifunc-noplt .endif .endif From owner-svn-src-head@freebsd.org Tue May 14 20:32:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E7F51597EB1; Tue, 14 May 2019 20:32:30 +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 B6D0A837D0; Tue, 14 May 2019 20:32:29 +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 90A6A26184; Tue, 14 May 2019 20:32:29 +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 x4EKWTYt074474; Tue, 14 May 2019 20:32:29 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4EKWTpt074473; Tue, 14 May 2019 20:32:29 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905142032.x4EKWTpt074473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 14 May 2019 20:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347578 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 347578 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B6D0A837D0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Tue, 14 May 2019 20:32:30 -0000 Author: kevans Date: Tue May 14 20:32:29 2019 New Revision: 347578 URL: https://svnweb.freebsd.org/changeset/base/347578 Log: tuntap: Defer clearing if_softc until after if_detach r346670 added an sx to close a race between the ifioctl handler and interface destruction. Unfortunately, it clears if_softc immediately after the interface is closed, but before if_detach has been invoked. Any time before detachment, an interface that's part of a bridge may still receive traffic that's pushed through tunstart/tunstart_l2 and promptly lead to a panic because if_softc is now NULL. Fix it by deferring the clearing of if_softc until after the interface has detached and thus been removed from the bridge. if_softc still gets cleared in case another thread has already entered the ioctl handler before it's replaced with ifdead_ioctl. Reported by: markj MFC after: 3 days Modified: head/sys/net/if_tuntap.c Modified: head/sys/net/if_tuntap.c ============================================================================== --- head/sys/net/if_tuntap.c Tue May 14 20:31:06 2019 (r347577) +++ head/sys/net/if_tuntap.c Tue May 14 20:32:29 2019 (r347578) @@ -537,9 +537,6 @@ tun_destroy(struct tuntap_softc *tp) TUN_UNLOCK(tp); CURVNET_SET(TUN2IFP(tp)->if_vnet); - sx_xlock(&tun_ioctl_sx); - TUN2IFP(tp)->if_softc = NULL; - sx_xunlock(&tun_ioctl_sx); destroy_dev(tp->tun_dev); seldrain(&tp->tun_rsel); @@ -551,6 +548,9 @@ tun_destroy(struct tuntap_softc *tp) bpfdetach(TUN2IFP(tp)); if_detach(TUN2IFP(tp)); } + sx_xlock(&tun_ioctl_sx); + TUN2IFP(tp)->if_softc = NULL; + sx_xunlock(&tun_ioctl_sx); free_unr(tp->tun_drv->unrhdr, TUN2IFP(tp)->if_dunit); if_free(TUN2IFP(tp)); mtx_destroy(&tp->tun_mtx); From owner-svn-src-head@freebsd.org Tue May 14 20:59:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D16515989DD; Tue, 14 May 2019 20:59:45 +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 2411F84565; Tue, 14 May 2019 20:59:45 +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 EEEAF2650C; Tue, 14 May 2019 20:59:44 +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 x4EKxi4O084787; Tue, 14 May 2019 20:59:44 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4EKxieO084786; Tue, 14 May 2019 20:59:44 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905142059.x4EKxieO084786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 14 May 2019 20:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347580 - head/sys/amd64/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/amd64/linux X-SVN-Commit-Revision: 347580 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2411F84565 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Tue, 14 May 2019 20:59:45 -0000 Author: trasz Date: Tue May 14 20:59:44 2019 New Revision: 347580 URL: https://svnweb.freebsd.org/changeset/base/347580 Log: Fix handling of r10 in Linux ptrace(2). This fixes decoding of the 'flags' argument to mmap(2) with Linux strace(1). Reviewed by: dchagin MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20223 Modified: head/sys/amd64/linux/linux_ptrace.c Modified: head/sys/amd64/linux/linux_ptrace.c ============================================================================== --- head/sys/amd64/linux/linux_ptrace.c Tue May 14 20:41:24 2019 (r347579) +++ head/sys/amd64/linux/linux_ptrace.c Tue May 14 20:59:44 2019 (r347580) @@ -338,18 +338,27 @@ linux_ptrace_getregs(struct thread *td, pid_t pid, voi map_regs_to_linux(&b_reg, &l_reg); - /* - * The strace(1) utility depends on RAX being set to -ENOSYS - * on syscall entry. - */ error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); if (error != 0) { printf("%s: PT_LWPINFO failed with error %d\n", __func__, error); return (error); } - if (lwpinfo.pl_flags & PL_FLAG_SCE) - l_reg.rax = -38; // XXX: Don't hardcode? + if (lwpinfo.pl_flags & PL_FLAG_SCE) { + /* + * The strace(1) utility depends on RAX being set to -ENOSYS + * on syscall entry; otherwise it loops printing those: + * + * [ Process PID=928 runs in 64 bit mode. ] + * [ Process PID=928 runs in x32 mode. ] + */ + l_reg.rax = -38; /* -ENOSYS */ + /* + * Undo the mangling done in exception.S:fast_syscall_common(). + */ + l_reg.r10 = l_reg.rcx; + } + error = copyout(&l_reg, (void *)data, sizeof(l_reg)); return (error); } @@ -399,21 +408,27 @@ linux_ptrace_getregset_prstatus(struct thread *td, pid map_regs_to_linux_regset(&b_reg, fsbase, gsbase, &l_regset); - /* - * The strace(1) utility depends on RAX being set to -ENOSYS - * on syscall entry; otherwise it loops printing those: - * - * [ Process PID=928 runs in 64 bit mode. ] - * [ Process PID=928 runs in x32 mode. ] - */ error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); if (error != 0) { printf("%s: PT_LWPINFO failed with error %d\n", __func__, error); return (error); } - if (lwpinfo.pl_flags & PL_FLAG_SCE) - l_regset.rax = -38; // XXX: Don't hardcode? + if (lwpinfo.pl_flags & PL_FLAG_SCE) { + /* + * The strace(1) utility depends on RAX being set to -ENOSYS + * on syscall entry; otherwise it loops printing those: + * + * [ Process PID=928 runs in 64 bit mode. ] + * [ Process PID=928 runs in x32 mode. ] + */ + l_regset.rax = -38; /* -ENOSYS */ + + /* + * Undo the mangling done in exception.S:fast_syscall_common(). + */ + l_regset.r10 = l_regset.rcx; + } len = MIN(iov.iov_len, sizeof(l_regset)); error = copyout(&l_regset, (void *)iov.iov_base, len); From owner-svn-src-head@freebsd.org Tue May 14 21:30:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8DFB159949E; Tue, 14 May 2019 21:30: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 6ADA8857EB; Tue, 14 May 2019 21:30: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 4435626A32; Tue, 14 May 2019 21:30: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 x4ELUugu002702; Tue, 14 May 2019 21:30:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ELUtr2002700; Tue, 14 May 2019 21:30:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905142130.x4ELUtr2002700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 14 May 2019 21:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347582 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 347582 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6ADA8857EB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Tue, 14 May 2019 21:30:57 -0000 Author: markj Date: Tue May 14 21:30:55 2019 New Revision: 347582 URL: https://svnweb.freebsd.org/changeset/base/347582 Log: Close some races in multicast socket option handling. r333175 converted the global multicast lock to a sleepable sx lock, so the lock order with respect to the (non-sleepable) inp lock changed. To handle this, r333175 and r333505 added code to drop the inp lock, but this opened races that could leave multicast group description structures in an inconsistent state. This change fixes the problem by simply acquiring the global lock sooner. Along the way, this fixes some LORs and bogus error handling introduced in r333175, and commits some related cleanup. Reported by: syzbot+ba7c4943547e0604faca@syzkaller.appspotmail.com Reported by: syzbot+1b803796ab94d11a46f9@syzkaller.appspotmail.com Reviewed by: ae MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20070 Modified: head/sys/netinet/in_mcast.c head/sys/netinet6/in6_mcast.c Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Tue May 14 21:11:15 2019 (r347581) +++ head/sys/netinet/in_mcast.c Tue May 14 21:30:55 2019 (r347582) @@ -1534,6 +1534,7 @@ inp_block_unblock_source(struct inpcb *inp, struct soc /* * Check if we are actually a member of this group. */ + IN_MULTI_LOCK(); imo = inp_findmoptions(inp); idx = imo_match_group(imo, ifp, &gsa->sa); if (idx == -1 || imo->imo_mfilters == NULL) { @@ -1593,14 +1594,13 @@ inp_block_unblock_source(struct inpcb *inp, struct soc /* * Begin state merge transaction at IGMP layer. */ - IN_MULTI_LOCK(); CTR1(KTR_IGMPV3, "%s: merge inm state", __func__); IN_MULTI_LIST_LOCK(); error = inm_merge(inm, imf); if (error) { CTR1(KTR_IGMPV3, "%s: failed to merge inm state", __func__); IN_MULTI_LIST_UNLOCK(); - goto out_in_multi_locked; + goto out_imf_rollback; } CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__); @@ -1609,9 +1609,6 @@ inp_block_unblock_source(struct inpcb *inp, struct soc if (error) CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__); -out_in_multi_locked: - - IN_MULTI_UNLOCK(); out_imf_rollback: if (error) imf_rollback(imf); @@ -1622,6 +1619,7 @@ out_imf_rollback: out_inp_locked: INP_WUNLOCK(inp); + IN_MULTI_UNLOCK(); return (error); } @@ -1680,10 +1678,10 @@ inp_findmoptions(struct inpcb *inp) static void inp_gcmoptions(struct ip_moptions *imo) { - struct in_mfilter *imf; + struct in_mfilter *imf; struct in_multi *inm; struct ifnet *ifp; - size_t idx, nmships; + size_t idx, nmships; nmships = imo->imo_num_memberships; for (idx = 0; idx < nmships; ++idx) { @@ -2142,12 +2140,12 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt CTR2(KTR_IGMPV3, "%s: unknown sopt_name %d", __func__, sopt->sopt_name); return (EOPNOTSUPP); - break; } if (ifp == NULL || (ifp->if_flags & IFF_MULTICAST) == 0) return (EADDRNOTAVAIL); + IN_MULTI_LOCK(); imo = inp_findmoptions(inp); idx = imo_match_group(imo, ifp, &gsa->sa); if (idx == -1) { @@ -2272,10 +2270,6 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt /* * Begin state merge transaction at IGMP layer. */ - in_pcbref(inp); - INP_WUNLOCK(inp); - IN_MULTI_LOCK(); - if (is_new) { error = in_joingroup_locked(ifp, &gsa->sin.sin_addr, imf, &inm); @@ -2286,6 +2280,8 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt goto out_imo_free; } inm_acquire(inm); + KASSERT(imo->imo_membership[idx] == NULL, + ("%s: imo_membership already allocated", __func__)); imo->imo_membership[idx] = inm; } else { CTR1(KTR_IGMPV3, "%s: merge inm state", __func__); @@ -2295,7 +2291,7 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt CTR1(KTR_IGMPV3, "%s: failed to merge inm state", __func__); IN_MULTI_LIST_UNLOCK(); - goto out_in_multi_locked; + goto out_imf_rollback; } CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__); error = igmp_change_state(inm); @@ -2303,16 +2299,11 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt if (error) { CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__); - goto out_in_multi_locked; + goto out_imf_rollback; } } -out_in_multi_locked: - - IN_MULTI_UNLOCK(); - INP_WLOCK(inp); - if (in_pcbrele_wlocked(inp)) - return (ENXIO); +out_imf_rollback: if (error) { imf_rollback(imf); if (is_new) @@ -2337,6 +2328,7 @@ out_imo_free: out_inp_locked: INP_WUNLOCK(inp); + IN_MULTI_UNLOCK(); return (error); } @@ -2463,6 +2455,7 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop /* * Find the membership in the membership array. */ + IN_MULTI_LOCK(); imo = inp_findmoptions(inp); idx = imo_match_group(imo, ifp, &gsa->sa); if (idx == -1) { @@ -2510,9 +2503,6 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop /* * Begin state merge transaction at IGMP layer. */ - in_pcbref(inp); - INP_WUNLOCK(inp); - IN_MULTI_LOCK(); if (is_final) { /* @@ -2528,7 +2518,7 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop CTR1(KTR_IGMPV3, "%s: failed to merge inm state", __func__); IN_MULTI_LIST_UNLOCK(); - goto out_in_multi_locked; + goto out_imf_rollback; } CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__); @@ -2540,13 +2530,7 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop } } -out_in_multi_locked: - - IN_MULTI_UNLOCK(); - INP_WLOCK(inp); - if (in_pcbrele_wlocked(inp)) - return (ENXIO); - +out_imf_rollback: if (error) imf_rollback(imf); else @@ -2557,7 +2541,7 @@ out_in_multi_locked: if (is_final) { /* Remove the gap in the membership and filter array. */ KASSERT(RB_EMPTY(&imf->imf_sources), - ("%s: imf_sources not empty", __func__)); + ("%s: imf_sources (%p %p %zu) not empty", __func__, imf, imo, idx)); for (++idx; idx < imo->imo_num_memberships; ++idx) { imo->imo_membership[idx - 1] = imo->imo_membership[idx]; imo->imo_mfilters[idx - 1] = imo->imo_mfilters[idx]; @@ -2569,6 +2553,7 @@ out_in_multi_locked: out_inp_locked: INP_WUNLOCK(inp); + IN_MULTI_UNLOCK(); return (error); } @@ -2646,8 +2631,6 @@ inp_set_multicast_if(struct inpcb *inp, struct sockopt /* * Atomically set source filters on a socket for an IPv4 multicast group. - * - * SMPng: NOTE: Potentially calls malloc(M_WAITOK) with Giant held. */ static int inp_set_source_filters(struct inpcb *inp, struct sockopt *sopt) @@ -2694,6 +2677,7 @@ inp_set_source_filters(struct inpcb *inp, struct socko * Take the INP write lock. * Check if this socket is a member of this group. */ + IN_MULTI_LOCK(); imo = inp_findmoptions(inp); idx = imo_match_group(imo, ifp, &gsa->sa); if (idx == -1 || imo->imo_mfilters == NULL) { @@ -2778,7 +2762,6 @@ inp_set_source_filters(struct inpcb *inp, struct socko goto out_imf_rollback; INP_WLOCK_ASSERT(inp); - IN_MULTI_LOCK(); /* * Begin state merge transaction at IGMP layer. @@ -2789,7 +2772,7 @@ inp_set_source_filters(struct inpcb *inp, struct socko if (error) { CTR1(KTR_IGMPV3, "%s: failed to merge inm state", __func__); IN_MULTI_LIST_UNLOCK(); - goto out_in_multi_locked; + goto out_imf_rollback; } CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__); @@ -2798,10 +2781,6 @@ inp_set_source_filters(struct inpcb *inp, struct socko if (error) CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__); -out_in_multi_locked: - - IN_MULTI_UNLOCK(); - out_imf_rollback: if (error) imf_rollback(imf); @@ -2812,6 +2791,7 @@ out_imf_rollback: out_inp_locked: INP_WUNLOCK(inp); + IN_MULTI_UNLOCK(); return (error); } Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Tue May 14 21:11:15 2019 (r347581) +++ head/sys/netinet6/in6_mcast.c Tue May 14 21:30:55 2019 (r347582) @@ -2052,6 +2052,7 @@ in6p_join_group(struct inpcb *inp, struct sockopt *sop */ (void)in6_setscope(&gsa->sin6.sin6_addr, ifp, NULL); + IN6_MULTI_LOCK(); imo = in6p_findmoptions(inp); idx = im6o_match_group(imo, ifp, &gsa->sa); if (idx == -1) { @@ -2171,10 +2172,6 @@ in6p_join_group(struct inpcb *inp, struct sockopt *sop /* * Begin state merge transaction at MLD layer. */ - in_pcbref(inp); - INP_WUNLOCK(inp); - IN6_MULTI_LOCK(); - if (is_new) { error = in6_joingroup_locked(ifp, &gsa->sin6.sin6_addr, imf, &inm, 0); @@ -2204,10 +2201,6 @@ in6p_join_group(struct inpcb *inp, struct sockopt *sop IN6_MULTI_LIST_UNLOCK(); } - IN6_MULTI_UNLOCK(); - INP_WLOCK(inp); - if (in_pcbrele_wlocked(inp)) - return (ENXIO); if (error) { im6f_rollback(imf); if (is_new) @@ -2232,6 +2225,7 @@ out_im6o_free: out_in6p_locked: INP_WUNLOCK(inp); + IN6_MULTI_UNLOCK(); in6m_release_list_deferred(&inmh); return (error); } @@ -2381,6 +2375,7 @@ in6p_leave_group(struct inpcb *inp, struct sockopt *so /* * Find the membership in the membership array. */ + IN6_MULTI_LOCK(); imo = in6p_findmoptions(inp); idx = im6o_match_group(imo, ifp, &gsa->sa); if (idx == -1) { @@ -2429,10 +2424,6 @@ in6p_leave_group(struct inpcb *inp, struct sockopt *so /* * Begin state merge transaction at MLD layer. */ - in_pcbref(inp); - INP_WUNLOCK(inp); - IN6_MULTI_LOCK(); - if (is_final) { /* * Give up the multicast address record to which @@ -2456,11 +2447,6 @@ in6p_leave_group(struct inpcb *inp, struct sockopt *so IN6_MULTI_LIST_UNLOCK(); } - IN6_MULTI_UNLOCK(); - INP_WLOCK(inp); - if (in_pcbrele_wlocked(inp)) - return (ENXIO); - if (error) im6f_rollback(imf); else @@ -2483,6 +2469,7 @@ in6p_leave_group(struct inpcb *inp, struct sockopt *so out_in6p_locked: INP_WUNLOCK(inp); + IN6_MULTI_UNLOCK(); return (error); } @@ -2528,8 +2515,6 @@ in6p_set_multicast_if(struct inpcb *inp, struct sockop /* * Atomically set source filters on a socket for an IPv6 multicast group. - * - * SMPng: NOTE: Potentially calls malloc(M_WAITOK) with Giant held. */ static int in6p_set_source_filters(struct inpcb *inp, struct sockopt *sopt) From owner-svn-src-head@freebsd.org Tue May 14 22:00:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4F901599F19; Tue, 14 May 2019 22:00:48 +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 5751886826; Tue, 14 May 2019 22:00:48 +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 330D726F74; Tue, 14 May 2019 22:00:48 +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 x4EM0mYf016867; Tue, 14 May 2019 22:00:48 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4EM0mdh016866; Tue, 14 May 2019 22:00:48 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905142200.x4EM0mdh016866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 14 May 2019 22:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347583 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 347583 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5751886826 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Tue, 14 May 2019 22:00:48 -0000 Author: rmacklem Date: Tue May 14 22:00:47 2019 New Revision: 347583 URL: https://svnweb.freebsd.org/changeset/base/347583 Log: Replace global list for grouplist with list(s) for each exportlist element. In mountd.c, the grouplist structures are linked into a single global linked list headed by "grphead". The only use of this linked list is to free all list elements when the exportlist elements are also all being free'd at the time the exports are being reloaded. This patch replaces this one global linked list head with a list head in each exportlist structure, where the grouplist elements for that exported file system are linked. The only change is that now the grouplist elements are free'd with the associated exportlist element as they are free'd instead of all grouplist elements being free'd after the exportlist elements are free'd. This change should have no effect in practice. This is being done, since a future patch that will add a "-I" option for incrementally updating the exports in the kernel needs to know which grouplist elements are associated with each exported file system and having them linked into a list headed by the exportlist element does that. MFC after: 1 month Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Tue May 14 21:30:55 2019 (r347582) +++ head/usr.sbin/mountd/mountd.c Tue May 14 22:00:47 2019 (r347583) @@ -114,6 +114,7 @@ struct dirlist { struct exportlist { struct dirlist *ex_dirl; struct dirlist *ex_defdir; + struct grouplist *ex_grphead; int ex_flag; fsid_t ex_fs; char *ex_fsdir; @@ -235,7 +236,6 @@ static void terminate(int); static struct exportlisthead exphead = SLIST_HEAD_INITIALIZER(&exphead); static SLIST_HEAD(, mountlist) mlhead = SLIST_HEAD_INITIALIZER(&mlhead); -static struct grouplist *grphead; static char *exnames_default[2] = { _PATH_EXPORTS, NULL }; static char **exnames; static char **hosts = NULL; @@ -455,7 +455,6 @@ main(int argc, char **argv) argc -= optind; argv += optind; - grphead = (struct grouplist *)NULL; if (argc > 0) exnames = argv; else @@ -1692,8 +1691,8 @@ get_exportlist_one(void) */ if (has_host) { hang_dirp(dirhead, tgrp, ep, opt_flags); - grp->gr_next = grphead; - grphead = tgrp; + grp->gr_next = ep->ex_grphead; + ep->ex_grphead = tgrp; } else { hang_dirp(dirhead, (struct grouplist *)NULL, ep, opt_flags); @@ -1720,7 +1719,6 @@ nextline: static void get_exportlist(void) { - struct grouplist *grp, *tgrp; struct export_args export; struct iovec *iov; struct statfs *mntbufp; @@ -1743,14 +1741,6 @@ get_exportlist(void) */ free_exports(&exphead); - grp = grphead; - while (grp) { - tgrp = grp; - grp = grp->gr_next; - free_grp(tgrp); - } - grphead = (struct grouplist *)NULL; - /* * and the old V4 root dir. */ @@ -2448,6 +2438,7 @@ get_host(char *cp, struct grouplist *grp, struct group static void free_exp(struct exportlist *ep) { + struct grouplist *grp, *tgrp; if (ep->ex_defdir) { free_host(ep->ex_defdir->dp_hosts); @@ -2458,6 +2449,12 @@ free_exp(struct exportlist *ep) if (ep->ex_indexfile) free(ep->ex_indexfile); free_dir(ep->ex_dirl); + grp = ep->ex_grphead; + while (grp) { + tgrp = grp; + grp = grp->gr_next; + free_grp(tgrp); + } free((caddr_t)ep); } From owner-svn-src-head@freebsd.org Tue May 14 23:12:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53DDA159BE75; Tue, 14 May 2019 23:12:15 +0000 (UTC) (envelope-from johalun@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 EBD5A8967F; Tue, 14 May 2019 23:12:14 +0000 (UTC) (envelope-from johalun@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 C2E8327CCD; Tue, 14 May 2019 23:12:14 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4ENCEcD058412; Tue, 14 May 2019 23:12:14 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ENCEic058410; Tue, 14 May 2019 23:12:14 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905142312.x4ENCEic058410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Tue, 14 May 2019 23:12:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347592 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 347592 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EBD5A8967F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Tue, 14 May 2019 23:12:15 -0000 Author: johalun Date: Tue May 14 23:12:14 2019 New Revision: 347592 URL: https://svnweb.freebsd.org/changeset/base/347592 Log: LinuxKPI: Let del_timer return a value to match Linux. This patch is part of https://reviews.freebsd.org/D19565. Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/timer.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/timer.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/timer.h Tue May 14 23:10:21 2019 (r347591) +++ head/sys/compat/linuxkpi/common/include/linux/timer.h Tue May 14 23:12:14 2019 (r347592) @@ -81,8 +81,8 @@ extern unsigned long linux_timer_hz_mask; extern void mod_timer(struct timer_list *, int); extern void add_timer(struct timer_list *); extern void add_timer_on(struct timer_list *, int cpu); +extern int del_timer(struct timer_list *); -#define del_timer(timer) (void)callout_stop(&(timer)->callout) #define del_timer_sync(timer) (void)callout_drain(&(timer)->callout) #define timer_pending(timer) callout_pending(&(timer)->callout) #define round_jiffies(j) \ Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Tue May 14 23:10:21 2019 (r347591) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Tue May 14 23:12:14 2019 (r347592) @@ -1906,6 +1906,15 @@ add_timer_on(struct timer_list *timer, int cpu) &linux_timer_callback_wrapper, timer, cpu); } +int +del_timer(struct timer_list *timer) +{ + + if (callout_stop(&(timer)->callout) == -1) + return (0); + return (1); +} + static void linux_timer_init(void *arg) { From owner-svn-src-head@freebsd.org Tue May 14 23:21:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E27BE159C315; Tue, 14 May 2019 23:21:21 +0000 (UTC) (envelope-from johalun@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 88B0089DCE; Tue, 14 May 2019 23:21:21 +0000 (UTC) (envelope-from johalun@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 60A8427E28; Tue, 14 May 2019 23:21:21 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4ENLLmW061409; Tue, 14 May 2019 23:21:21 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ENLKHH061408; Tue, 14 May 2019 23:21:20 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905142321.x4ENLKHH061408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Tue, 14 May 2019 23:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347596 - in head/sys: compat/linuxkpi/common/include/linux sys X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux sys X-SVN-Commit-Revision: 347596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 88B0089DCE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Tue, 14 May 2019 23:21:22 -0000 Author: johalun Date: Tue May 14 23:21:20 2019 New Revision: 347596 URL: https://svnweb.freebsd.org/changeset/base/347596 Log: LinuxKPI: Add context member to ww_mutex and bump FreeBSD version. This patch is part of https://reviews.freebsd.org/D19565. Reviewed by: hps Approved by: imp (mentor), hps Modified: head/sys/compat/linuxkpi/common/include/linux/ww_mutex.h head/sys/sys/param.h Modified: head/sys/compat/linuxkpi/common/include/linux/ww_mutex.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/ww_mutex.h Tue May 14 23:20:16 2019 (r347595) +++ head/sys/compat/linuxkpi/common/include/linux/ww_mutex.h Tue May 14 23:21:20 2019 (r347596) @@ -45,6 +45,7 @@ struct ww_acquire_ctx { struct ww_mutex { struct mutex base; struct cv condvar; + struct ww_acquire_ctx *ctx; }; #define DEFINE_WW_CLASS(name) \ Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue May 14 23:20:16 2019 (r347595) +++ head/sys/sys/param.h Tue May 14 23:21:20 2019 (r347596) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300025 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300026 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Tue May 14 23:32:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F000159C7B6; Tue, 14 May 2019 23:32:03 +0000 (UTC) (envelope-from johalun@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 25F768A562; Tue, 14 May 2019 23:32:03 +0000 (UTC) (envelope-from johalun@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 E98D457; Tue, 14 May 2019 23:32:02 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4ENW2hg069716; Tue, 14 May 2019 23:32:02 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ENW2Tp069715; Tue, 14 May 2019 23:32:02 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905142332.x4ENW2Tp069715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Tue, 14 May 2019 23:32:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347600 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 347600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 25F768A562 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Tue, 14 May 2019 23:32:03 -0000 Author: johalun Date: Tue May 14 23:32:02 2019 New Revision: 347600 URL: https://svnweb.freebsd.org/changeset/base/347600 Log: LinuxKPI: Add vm_fault_t type. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/mm_types.h Modified: head/sys/compat/linuxkpi/common/include/linux/mm_types.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mm_types.h Tue May 14 23:28:45 2019 (r347599) +++ head/sys/compat/linuxkpi/common/include/linux/mm_types.h Tue May 14 23:32:02 2019 (r347600) @@ -35,6 +35,8 @@ #include +typedef int vm_fault_t; + struct vm_area_struct; struct task_struct; From owner-svn-src-head@freebsd.org Tue May 14 23:50:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B721159CE0D; Tue, 14 May 2019 23:50:47 +0000 (UTC) (envelope-from johalun@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 127288ACFF; Tue, 14 May 2019 23:50:47 +0000 (UTC) (envelope-from johalun@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 E2C0437E; Tue, 14 May 2019 23:50:46 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4ENokrS076373; Tue, 14 May 2019 23:50:46 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ENokjW076371; Tue, 14 May 2019 23:50:46 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905142350.x4ENokjW076371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Tue, 14 May 2019 23:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347601 - in head/sys: compat/linuxkpi/common/include/linux sys X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux sys X-SVN-Commit-Revision: 347601 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 127288ACFF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Tue, 14 May 2019 23:50:47 -0000 Author: johalun Date: Tue May 14 23:50:46 2019 New Revision: 347601 URL: https://svnweb.freebsd.org/changeset/base/347601 Log: LinuxKPI: Add prepare to pm_ops and bump FreeBSD version. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/device.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 Tue May 14 23:32:02 2019 (r347600) +++ head/sys/compat/linuxkpi/common/include/linux/device.h Tue May 14 23:50:46 2019 (r347601) @@ -61,6 +61,7 @@ struct class { }; struct dev_pm_ops { + int (*prepare)(struct device *dev); int (*suspend)(struct device *dev); int (*suspend_late)(struct device *dev); int (*resume)(struct device *dev); Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue May 14 23:32:02 2019 (r347600) +++ head/sys/sys/param.h Tue May 14 23:50:46 2019 (r347601) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300026 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300027 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Wed May 15 03:39:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FD8A15A7280; Wed, 15 May 2019 03:39:28 +0000 (UTC) (envelope-from delphij@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 0BBC36F448; Wed, 15 May 2019 03:39:28 +0000 (UTC) (envelope-from delphij@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 D2DEA3377; Wed, 15 May 2019 03:39:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4F3dR3a099025; Wed, 15 May 2019 03:39:27 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4F3dR0D099024; Wed, 15 May 2019 03:39:27 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201905150339.x4F3dR0D099024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 15 May 2019 03:39:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347606 - head/usr.sbin/ntp/ntpd X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/usr.sbin/ntp/ntpd X-SVN-Commit-Revision: 347606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0BBC36F448 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.94)[-0.943,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Wed, 15 May 2019 03:39:28 -0000 Author: delphij Date: Wed May 15 03:39:27 2019 New Revision: 347606 URL: https://svnweb.freebsd.org/changeset/base/347606 Log: Replace the leap-seconds file in r347488 from USNO with a leap-seconds file from NIST at ftp://ftp.nist.gov/pub/time. Future updates should use the NIST version of file, available at ftp://ftp.nist.gov/pub/time/leap-seconds.list . Requested by: ian@ Obtained from: ftp://ftp.nist.gov/pub/time/leap-seconds.3676924800 MFC after: 3 days Modified: head/usr.sbin/ntp/ntpd/leap-seconds Modified: head/usr.sbin/ntp/ntpd/leap-seconds ============================================================================== --- head/usr.sbin/ntp/ntpd/leap-seconds Wed May 15 01:40:40 2019 (r347605) +++ head/usr.sbin/ntp/ntpd/leap-seconds Wed May 15 03:39:27 2019 (r347606) @@ -1,10 +1,10 @@ # # In the following text, the symbol '#' introduces -# a comment, which continues from that symbol until +# a comment, which continues from that symbol until # the end of the line. A plain comment line has a # whitespace character following the comment indicator. -# There are also special comment lines defined below. -# A special comment will always have a non-whitespace +# There are also special comment lines defined below. +# A special comment will always have a non-whitespace # character in column 2. # # A blank line should be ignored. @@ -15,17 +15,22 @@ # are transmitted by almost all time services. # # The first column shows an epoch as a number of seconds -# since 1900.0 and the second column shows the number of -# seconds that must be added to UTC to compute TAI for -# any timestamp at or after that epoch. The value on -# each line is valid from the indicated initial instant -# until the epoch given on the next one or indefinitely -# into the future if there is no next line. +# since 1 January 1900, 00:00:00 (1900.0 is also used to +# indicate the same epoch.) Both of these time stamp formats +# ignore the complexities of the time scales that were +# used before the current definition of UTC at the start +# of 1972. (See note 3 below.) +# The second column shows the number of seconds that +# must be added to UTC to compute TAI for any timestamp +# at or after that epoch. The value on each line is +# valid from the indicated initial instant until the +# epoch given on the next one or indefinitely into the +# future if there is no next line. # (The comment on each line shows the representation of -# the corresponding initial epoch in the usual +# the corresponding initial epoch in the usual # day-month-year format. The epoch always begins at # 00:00:00 UTC on the indicated day. See Note 5 below.) -# +# # Important notes: # # 1. Coordinated Universal Time (UTC) is often referred to @@ -33,7 +38,7 @@ # longer used, and the use of GMT to designate UTC is # discouraged. # -# 2. The UTC time scale is realized by many national +# 2. The UTC time scale is realized by many national # laboratories and timing centers. Each laboratory # identifies its realization with its name: Thus # UTC(NIST), UTC(USNO), etc. The differences among @@ -42,12 +47,12 @@ # and can be ignored for many purposes. These differences # are tabulated in Circular T, which is published monthly # by the International Bureau of Weights and Measures -# (BIPM). See www.bipm.fr for more information. +# (BIPM). See www.bipm.org for more information. # -# 3. The current defintion of the relationship between UTC -# and TAI dates from 1 January 1972. A number of different -# time scales were in use before than epoch, and it can be -# quite difficult to compute precise timestamps and time +# 3. The current definition of the relationship between UTC +# and TAI dates from 1 January 1972. A number of different +# time scales were in use before that epoch, and it can be +# quite difficult to compute precise timestamps and time # intervals in those "prehistoric" days. For more information, # consult: # @@ -56,38 +61,41 @@ # or # Terry Quinn, "The BIPM and the Accurate Measurement # of Time," Proc. of the IEEE, Vol. 79, pp. 894-905, -# July, 1991. +# July, 1991. +# reprinted in: +# Christine Hackman and Donald B Sullivan (eds.) +# Time and Frequency Measurement +# American Association of Physics Teachers (1996) +# , pp. 75-86 # -# 4. The insertion of leap seconds into UTC is currently the -# responsibility of the International Earth Rotation Service, -# which is located at the Paris Observatory: +# 4. The decision to insert a leap second into UTC is currently +# the responsibility of the International Earth Rotation and +# Reference Systems Service. (The name was changed from the +# International Earth Rotation Service, but the acronym IERS +# is still used.) # -# Central Bureau of IERS -# 61, Avenue de l'Observatoire -# 75014 Paris, France. +# Leap seconds are announced by the IERS in its Bulletin C. # -# Leap seconds are announced by the IERS in its Bulletin C +# See www.iers.org for more details. # -# See hpiers.obspm.fr or www.iers.org for more details. +# Every national laboratory and timing center uses the +# data from the BIPM and the IERS to construct UTC(lab), +# their local realization of UTC. # -# All national laboratories and timing centers use the -# data from the BIPM and the IERS to construct their -# local realizations of UTC. -# # Although the definition also includes the possibility -# of dropping seconds ("negative" leap seconds), this has -# never been done and is unlikely to be necessary in the +# of dropping seconds ("negative" leap seconds), this has +# never been done and is unlikely to be necessary in the # foreseeable future. # # 5. If your system keeps time as the number of seconds since # some epoch (e.g., NTP timestamps), then the algorithm for # assigning a UTC time stamp to an event that happens during a positive -# leap second is not well defined. The official name of that leap -# second is 23:59:60, but there is no way of representing that time -# in these systems. -# Many systems of this type effectively stop the system clock for -# one second during the leap second and use a time that is equivalent -# to 23:59:59 UTC twice. For these systems, the corresponding TAI +# leap second is not well defined. The official name of that leap +# second is 23:59:60, but there is no way of representing that time +# in these systems. +# Many systems of this type effectively stop the system clock for +# one second during the leap second and use a time that is equivalent +# to 23:59:59 UTC twice. For these systems, the corresponding TAI # timestamp would be obtained by advancing to the next entry in the # following table when the time equivalent to 23:59:59 UTC # is used for the second time. Thus the leap second which @@ -102,7 +110,7 @@ # # If your system realizes the leap second by repeating 00:00:00 UTC twice # (this is possible but not usual), then the advance to the next entry -# in the table must occur the second time that a time equivlent to +# in the table must occur the second time that a time equivalent to # 00:00:00 UTC is used. Thus, using the same example as above: # # ... @@ -112,66 +120,94 @@ # ... # # in both cases the use of timestamps based on TAI produces a smooth -# time scale with no discontinuity in the time interval. +# time scale with no discontinuity in the time interval. However, +# although the long-term behavior of the time scale is correct in both +# methods, the second method is technically not correct because it adds +# the extra second to the wrong day. # -# This complexity would not be needed for negative leap seconds (if they -# are ever used). The UTC time would skip 23:59:59 and advance from -# 23:59:58 to 00:00:00 in that case. The TAI offset would decrease by -# 1 second at the same instant. This is a much easier situation to deal -# with, since the difficulty of unambiguously representing the epoch +# This complexity would not be needed for negative leap seconds (if they +# are ever used). The UTC time would skip 23:59:59 and advance from +# 23:59:58 to 00:00:00 in that case. The TAI offset would decrease by +# 1 second at the same instant. This is a much easier situation to deal +# with, since the difficulty of unambiguously representing the epoch # during the leap second does not arise. # +# Some systems implement leap seconds by amortizing the leap second +# over the last few minutes of the day. The frequency of the local +# clock is decreased (or increased) to realize the positive (or +# negative) leap second. This method removes the time step described +# above. Although the long-term behavior of the time scale is correct +# in this case, this method introduces an error during the adjustment +# period both in time and in frequency with respect to the official +# definition of UTC. +# # Questions or comments to: -# Jeff Prillaman -# Time Service Department -# US Naval Observatory -# Washington, DC -# jeff.k.prillaman@navy.mil +# Judah Levine +# Time and Frequency Division +# NIST +# Boulder, Colorado +# Judah.Levine@nist.gov # -# Last Update of leap second values: 28 Jan 2019 +# Last Update of leap second values: 8 July 2016 # -# The following line shows this last update date in NTP timestamp +# The following line shows this last update date in NTP timestamp # format. This is the date on which the most recent change to # the leap second data was added to the file. This line can -# be identified by the unique pair of characters in the first two +# be identified by the unique pair of characters in the first two # columns as shown below. # -#$ 3757622400 +#$ 3676924800 # -# The data in this file will be updated periodically as new leap +# The NTP timestamps are in units of seconds since the NTP epoch, +# which is 1 January 1900, 00:00:00. The Modified Julian Day number +# corresponding to the NTP time stamp, X, can be computed as +# +# X/86400 + 15020 +# +# where the first term converts seconds to days and the second +# term adds the MJD corresponding to the time origin defined above. +# The integer portion of the result is the integer MJD for that +# day, and any remainder is the time of day, expressed as the +# fraction of the day since 0 hours UTC. The conversion from day +# fraction to seconds or to hours, minutes, and seconds may involve +# rounding or truncation, depending on the method used in the +# computation. +# +# The data in this file will be updated periodically as new leap # seconds are announced. In addition to being entered on the line -# above, the update time (in NTP format) will be added to the basic +# above, the update time (in NTP format) will be added to the basic # file name leap-seconds to form the name leap-seconds.. -# In addition, the generic name leap-seconds.list will always point to +# In addition, the generic name leap-seconds.list will always point to # the most recent version of the file. # # This update procedure will be performed only when a new leap second -# is announced. +# is announced. # # The following entry specifies the expiration date of the data -# in this file in units of seconds since 1900.0. This expiration date -# will be changed at least twice per year whether or not a new leap -# second is announced. These semi-annual changes will be made no -# later than 1 June and 1 December of each year to indicate what -# action (if any) is to be taken on 30 June and 31 December, +# in this file in units of seconds since the origin at the instant +# 1 January 1900, 00:00:00. This expiration date will be changed +# at least twice per year whether or not a new leap second is +# announced. These semi-annual changes will be made no later +# than 1 June and 1 December of each year to indicate what +# action (if any) is to be taken on 30 June and 31 December, # respectively. (These are the customary effective dates for new # leap seconds.) This expiration date will be identified by a # unique pair of characters in columns 1 and 2 as shown below. -# In the unlikely event that a leap second is announced with an +# In the unlikely event that a leap second is announced with an # effective date other than 30 June or 31 December, then this # file will be edited to include that leap second as soon as it is # announced or at least one month before the effective date -# (whichever is later). -# If an announcement by the IERS specifies that no leap second is -# scheduled, then only the expiration date of the file will +# (whichever is later). +# If an announcement by the IERS specifies that no leap second is +# scheduled, then only the expiration date of the file will # be advanced to show that the information in the file is still -# current -- the update time stamp, the data and the name of the file +# current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C 57 -# File expires on: 1 Dec 2019 +# Updated through IERS Bulletin C57 +# File expires on: 28 December 2019 # -#@ 3784147200 +#@ 3786480000 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -205,16 +241,15 @@ # the following special comment contains the # hash value of the data in this file computed # use the secure hash algorithm as specified -# by FIPS 180-1. See the files in ~/sha for +# by FIPS 180-1. See the files in ~/pub/sha for # the details of how this hash value is # computed. Note that the hash computation # ignores comments and whitespace characters # in data lines. It includes the NTP values -# of both the last modification time and the +# of both the last modification time and the # expiration time of the file, but not the # white space on those lines. # the hash line is also ignored in the # computation. # -#h 630ac741 2fffdd6b 858a7d1d 31d4802f 6382e10c -# +#h 83c68138 d3650221 07dbbbcd 11fcc859 ced1106a From owner-svn-src-head@freebsd.org Wed May 15 06:00:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24CEB15ABE06; Wed, 15 May 2019 06:00:06 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (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 B38037465A; Wed, 15 May 2019 06:00:05 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: by mail-io1-f54.google.com with SMTP id f22so1239152iol.11; Tue, 14 May 2019 23:00:05 -0700 (PDT) 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=5ZC47tbROuziuhWgGBsgqv6rPgfdTlDk6eRP4z6fezk=; b=LVodQj0PmJRWm96tATTwHoLCmrlhcaLvHtx/cszq+7gumw2kKcOSJNK//sbpLV2oan /E9n2qOnyYooEy3MEksnl9cEpoaJzYnyQCgOYdjnT8G4EH5ghyaUMpVkHd+K5w8giz9Y DMsxOYlr2f0dmm6MJvPWF+VQAft433gn4XFgRI2R93QiWyZ1Uk1jONr7y3t2YylNalnk yrQjNtYWp0e/A+nDuD1zeeBsVBgbsrztPtsXo9di1RXy1/Dj56/hyPLXTndTAYZMhKoT 2uSFuMkt2rghBWi+34mxgvPCqfaCMS8ov9eh2SARefkpDHMIxtb7jJ1B3Cd7JULY1ZB4 AcAA== X-Gm-Message-State: APjAAAVYRBwghX5DHB6LO7M1PCiICqqy8iyGe0vRruTDGYanzX3S8nUm bb4ImY1MYn663mkKSP5PmyKMPEElW8mPWG2lMteCk3VF X-Google-Smtp-Source: APXvYqw5h6wVIkapvGSdzZzxQ+UUIExFo2CexLet4ZjWaj9P1pUAvJ65ogTnu9W2P50phRMdZ6j3QNRyJ17TbvhRDZo= X-Received: by 2002:a6b:7a49:: with SMTP id k9mr3387260iop.73.1557899655952; Tue, 14 May 2019 22:54:15 -0700 (PDT) MIME-Version: 1.0 References: <201905141702.x4EH2LuD061054@repo.freebsd.org> In-Reply-To: <201905141702.x4EH2LuD061054@repo.freebsd.org> From: Dmitry Chagin Date: Wed, 15 May 2019 08:54:04 +0300 Message-ID: Subject: Re: svn commit: r347566 - in head/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86 To: Konstantin Belousov Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: B38037465A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(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: Wed, 15 May 2019 06:00:06 -0000 =D0=B2=D1=82, 14 =D0=BC=D0=B0=D1=8F 2019 =D0=B3. =D0=B2 20:02, Konstantin B= elousov : > Author: kib > Date: Tue May 14 17:02:20 2019 > New Revision: 347566 > URL: https://svnweb.freebsd.org/changeset/base/347566 > > Log: > Mitigations for Microarchitectural Data Sampling. > > Microarchitectural buffers on some Intel processors utilizing > speculative execution may allow a local process to obtain a memory > disclosure. An attacker may be able to read secret data from the > kernel or from a process when executing untrusted code (for example, > in a web browser). > > Reference: > https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa= -00233.html > Security: CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, > CVE-2019-11091 > Security: FreeBSD-SA-19:07.mds > Reviewed by: jhb > Tested by: emaste, lwhsu > Approved by: so (gtetlow) > > Modified: > head/sys/amd64/amd64/exception.S > head/sys/amd64/amd64/genassym.c > head/sys/amd64/amd64/initcpu.c > head/sys/amd64/amd64/machdep.c > head/sys/amd64/amd64/support.S > Hi, Kostik! cc -target x86_64-unknown-freebsd13.0 --sysroot=3D/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp -B/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp/usr/bin -c -x assembler-with-cpp -DLOCORE -O2 -pipe -fno-strict-aliasing -g -nostdinc -I. -I/home/dchagin/head/sys -I/home/dchagin/head/sys/contrib/ck/include -I/home/dchagin/head/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD -MF.depend.support.o -MTsupport.o -fdebug-prefix-map=3D./machine=3D/home/dchagin/head/sys/amd64/include -fdebug-prefix-map=3D./x86=3D/home/dchagin/head/sys/x86/include -mcmodel=3D= kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=3D__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member -mno-aes -mno-avx -std=3Diso9899:1999 -Werror /home/dchagin/head/sys/amd64/amd64/support.S /home/dchagin/head/sys/amd64/amd64/support.S:1809:2: error: instruction requires: AVX-512 ISA vmovdqa64 %zmm0, %gs:0x340 ^ /home/dchagin/head/sys/amd64/amd64/support.S:1810:2: error: instruction requires: AVX-512 ISA vpxor %zmm0, %zmm0, %zmm0 ^ /home/dchagin/head/sys/amd64/amd64/support.S:1813:2: error: instruction requires: AVX-512 DQ ISA vorpd (%rdx), %zmm0, %zmm0 ^ /home/dchagin/head/sys/amd64/amd64/support.S:1814:2: error: instruction requires: AVX-512 DQ ISA vorpd (%rdx), %zmm0, %zmm0 ^ /home/dchagin/head/sys/amd64/amd64/support.S:1826:2: error: instruction requires: AVX-512 ISA vmovdqa64 %gs:0x340, %zmm0 ^ *** Error code 1 I/m missied something? From owner-svn-src-head@freebsd.org Wed May 15 08:10:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7340915AF157; Wed, 15 May 2019 08:10:36 +0000 (UTC) (envelope-from kib@freebsd.org) 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 ED5A980CAC; Wed, 15 May 2019 08:10:35 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x4F8ARSc016152 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 15 May 2019 11:10:31 +0300 (EEST) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x4F8ARSc016152 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x4F8AR6p016151; Wed, 15 May 2019 11:10:27 +0300 (EEST) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Wed, 15 May 2019 11:10:27 +0300 From: Konstantin Belousov To: Dmitry Chagin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347566 - in head/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86 Message-ID: <20190515081027.GL2748@kib.kiev.ua> References: <201905141702.x4EH2LuD061054@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 May 2019 08:10:36 -0000 On Wed, May 15, 2019 at 08:54:04AM +0300, Dmitry Chagin wrote: > вт, 14 мая 2019 г. в 20:02, Konstantin Belousov : > > > Author: kib > > Date: Tue May 14 17:02:20 2019 > > New Revision: 347566 > > URL: https://svnweb.freebsd.org/changeset/base/347566 > > > > Log: > > Mitigations for Microarchitectural Data Sampling. > > > > Microarchitectural buffers on some Intel processors utilizing > > speculative execution may allow a local process to obtain a memory > > disclosure. An attacker may be able to read secret data from the > > kernel or from a process when executing untrusted code (for example, > > in a web browser). > > > > Reference: > > https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00233.html > > Security: CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, > > CVE-2019-11091 > > Security: FreeBSD-SA-19:07.mds > > Reviewed by: jhb > > Tested by: emaste, lwhsu > > Approved by: so (gtetlow) > > > > Modified: > > head/sys/amd64/amd64/exception.S > > head/sys/amd64/amd64/genassym.c > > head/sys/amd64/amd64/initcpu.c > > head/sys/amd64/amd64/machdep.c > > head/sys/amd64/amd64/support.S > > > > > > Hi, Kostik! > > cc -target x86_64-unknown-freebsd13.0 > --sysroot=/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp > -B/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp/usr/bin -c -x > assembler-with-cpp -DLOCORE -O2 -pipe -fno-strict-aliasing -g -nostdinc > -I. -I/home/dchagin/head/sys -I/home/dchagin/head/sys/contrib/ck/include > -I/home/dchagin/head/sys/contrib/libfdt -D_KERNEL > -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h > -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD > -MF.depend.support.o -MTsupport.o > -fdebug-prefix-map=./machine=/home/dchagin/head/sys/amd64/include > -fdebug-prefix-map=./x86=/home/dchagin/head/sys/x86/include -mcmodel=kernel > -mno-red-zone -mno-mmx -mno-sse -msoft-float > -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector > -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign > -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs > -fdiagnostics-show-option -Wno-unknown-pragmas > -Wno-error-tautological-compare -Wno-error-empty-body > -Wno-error-parentheses-equality -Wno-error-unused-function > -Wno-error-pointer-sign -Wno-error-shift-negative-value > -Wno-address-of-packed-member -mno-aes -mno-avx -std=iso9899:1999 > -Werror /home/dchagin/head/sys/amd64/amd64/support.S > /home/dchagin/head/sys/amd64/amd64/support.S:1809:2: error: instruction > requires: AVX-512 ISA > vmovdqa64 %zmm0, %gs:0x340 > ^ > /home/dchagin/head/sys/amd64/amd64/support.S:1810:2: error: instruction > requires: AVX-512 ISA > vpxor %zmm0, %zmm0, %zmm0 > ^ > /home/dchagin/head/sys/amd64/amd64/support.S:1813:2: error: instruction > requires: AVX-512 DQ ISA > vorpd (%rdx), %zmm0, %zmm0 > ^ > /home/dchagin/head/sys/amd64/amd64/support.S:1814:2: error: instruction > requires: AVX-512 DQ ISA > vorpd (%rdx), %zmm0, %zmm0 > ^ > /home/dchagin/head/sys/amd64/amd64/support.S:1826:2: error: instruction > requires: AVX-512 ISA > vmovdqa64 %gs:0x340, %zmm0 > ^ > *** Error code 1 > > > I/m missied something? Yes, you are using older compiler than current. Perhaps you are using clang 6.0 still. Update your world. FWIW, this is is reason why the sw sequences use .byte in 11.2/12.0 patches. I do not want to put such abomination into live code base, remembering aesni.ko. From owner-svn-src-head@freebsd.org Wed May 15 15:11:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA2DA15952A2; Wed, 15 May 2019 15:11:50 +0000 (UTC) (envelope-from antoine@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 4E1178FB7D; Wed, 15 May 2019 15:11:50 +0000 (UTC) (envelope-from antoine@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 29598B454; Wed, 15 May 2019 15:11:50 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4FFBosd064289; Wed, 15 May 2019 15:11:50 GMT (envelope-from antoine@FreeBSD.org) Received: (from antoine@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4FFBoRl064288; Wed, 15 May 2019 15:11:50 GMT (envelope-from antoine@FreeBSD.org) Message-Id: <201905151511.x4FFBoRl064288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: antoine set sender to antoine@FreeBSD.org using -f From: Antoine Brodin Date: Wed, 15 May 2019 15:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347615 - head X-SVN-Group: head X-SVN-Commit-Author: antoine X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 347615 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4E1178FB7D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.934,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Wed, 15 May 2019 15:11:51 -0000 Author: antoine Date: Wed May 15 15:11:49 2019 New Revision: 347615 URL: https://svnweb.freebsd.org/changeset/base/347615 Log: Add more obsolete files. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed May 15 15:03:55 2019 (r347614) +++ head/ObsoleteFiles.inc Wed May 15 15:11:49 2019 (r347615) @@ -43,6 +43,8 @@ OLD_FILES+=lib/casper/libcap_sysctl.1 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package. OLD_FILES+=usr/tests/sys/opencrypto/dpkt.py OLD_FILES+=usr/tests/sys/opencrypto/dpkt.pyc +# 20190326: tzdata 2019a import +OLD_FILES+=usr/share/zoneinfo/Etc/UCT # 20190304: new libc++ import which bumps version from 7.0.1 to 8.0.0. OLD_FILES+=usr/include/c++/v1/experimental/dynarray # 20190304: new clang import which bumps version from 7.0.1 to 8.0.0. @@ -201,16 +203,21 @@ OLD_FILES+=usr/include/sys/seq.h OLD_FILES+=usr/lib/libprivateifconfig.a OLD_FILES+=usr/lib/libprivateifconfig_p.a # 20190131: pfil(9) changed -OLD_FILES+=usr/share/man/man9/pfil_hook_get.9 -OLD_FILES+=usr/share/man/man9/pfil_rlock.9 -OLD_FILES+=usr/share/man/man9/pfil_runlock.9 -OLD_FILES+=usr/share/man/man9/pfil_wlock.9 -OLD_FILES+=usr/share/man/man9/pfil_wunlock.9 +OLD_FILES+=usr/share/man/man9/pfil_hook_get.9.gz +OLD_FILES+=usr/share/man/man9/pfil_rlock.9.gz +OLD_FILES+=usr/share/man/man9/pfil_runlock.9.gz +OLD_FILES+=usr/share/man/man9/pfil_wlock.9.gz +OLD_FILES+=usr/share/man/man9/pfil_wunlock.9.gz # 20190126: adv(4) / adw(4) removal OLD_FILES+=usr/share/man/man4/adv.4.gz OLD_FILES+=usr/share/man/man4/adw.4.gz +# 20190123: nonexistant cred_update_thread(9) removed +OLD_FILES+=usr/share/man/man9/cred_update_thread.9.gz # 20190114: old pbuf allocator removed +OLD_FILES+=usr/share/man/man9/getpbuf.9.gz OLD_FILES+=usr/share/man/man9/pbuf.9.gz +OLD_FILES+=usr/share/man/man9/relpbuf.9.gz +OLD_FILES+=usr/share/man/man9/trypbuf.9.gz # 20181219: ibcs removal OLD_FILES+=usr/share/examples/ibcs2/hello.uu OLD_FILES+=usr/share/examples/ibcs2/README From owner-svn-src-head@freebsd.org Wed May 15 15:54:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA18A1596742; Wed, 15 May 2019 15:54:28 +0000 (UTC) (envelope-from bcr@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 8665591987; Wed, 15 May 2019 15:54:28 +0000 (UTC) (envelope-from bcr@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 1B2F9BD29; Wed, 15 May 2019 15:54:28 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4FFsR12087634; Wed, 15 May 2019 15:54:27 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4FFsRLp087633; Wed, 15 May 2019 15:54:27 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201905151554.x4FFsRLp087633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Wed, 15 May 2019 15:54:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347617 - head/lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/lib/libc/stdlib X-SVN-Commit-Revision: 347617 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8665591987 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Wed, 15 May 2019 15:54:29 -0000 Author: bcr (doc committer) Date: Wed May 15 15:54:27 2019 New Revision: 347617 URL: https://svnweb.freebsd.org/changeset/base/347617 Log: Add small EXAMPLE section to bsearch.3. Submitted by: fernape (via Phabricator) Reviewed by: bcr, jilles, dab Approved by: bcr (man pages), jilles (src) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D19902 Modified: head/lib/libc/stdlib/bsearch.3 Modified: head/lib/libc/stdlib/bsearch.3 ============================================================================== --- head/lib/libc/stdlib/bsearch.3 Wed May 15 15:49:29 2019 (r347616) +++ head/lib/libc/stdlib/bsearch.3 Wed May 15 15:54:27 2019 (r347617) @@ -32,7 +32,7 @@ .\" @(#)bsearch.3 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd February 22, 2013 +.Dd May 15, 2019 .Dt BSEARCH 3 .Os .Sh NAME @@ -83,6 +83,61 @@ The function returns a pointer to a matching member of the array, or a null pointer if no match is found. If two members compare as equal, which member is matched is unspecified. +.Sh EXAMPLES +A sample program that searches people by age in a sorted array: +.Bd -literal +#include +#include +#include +#include +#include + +struct person { + char name[5]; + int age; +}; + +int +compare(const void *key, const void *array_member) +{ + int age = (intptr_t) key; + struct person person = *(struct person *) array_member; + + return (age - person.age); +} + +int +main() +{ + struct person *friend; + + /* Sorted array */ + struct person friends[6] = { + { "paul", 22 }, + { "anne", 25 }, + { "fred", 25 }, + { "mary", 27 }, + { "mark", 35 }, + { "bill", 50 } + }; + + size_t array_size = sizeof(friends) / sizeof(struct person); + + friend = bsearch((void *)22, &friends, array_size, sizeof(struct person), compare); + assert(strcmp(friend->name, "paul") == 0); + printf("name: %s\enage: %d\en", friend->name, friend->age); + + friend = bsearch((void *)25, &friends, array_size, sizeof(struct person), compare); + assert(strcmp(friend->name, "fred") == 0 || strcmp(friend->name, "anne") == 0); + printf("name: %s\enage: %d\en", friend->name, friend->age); + + friend = bsearch((void *)30, &friends, array_size, sizeof(struct person), compare); + assert(friend == NULL); + printf("friend aged 30 not found\en"); + + return (EXIT_SUCCESS); +} +.Ed .Sh SEE ALSO .Xr db 3 , .Xr lsearch 3 , From owner-svn-src-head@freebsd.org Wed May 15 16:51:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 618D2159911E; Wed, 15 May 2019 16:51:09 +0000 (UTC) (envelope-from adrian@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 0542D95296; Wed, 15 May 2019 16:51:09 +0000 (UTC) (envelope-from adrian@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 D4B2CC5F3; Wed, 15 May 2019 16:51:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4FGp8mZ017395; Wed, 15 May 2019 16:51:08 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4FGp8DF017394; Wed, 15 May 2019 16:51:08 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201905151651.x4FGp8DF017394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 15 May 2019 16:51:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347618 - head/sys/mips/atheros X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/mips/atheros X-SVN-Commit-Revision: 347618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0542D95296 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Wed, 15 May 2019 16:51:09 -0000 Author: adrian Date: Wed May 15 16:51:08 2019 New Revision: 347618 URL: https://svnweb.freebsd.org/changeset/base/347618 Log: [ar71xx_gpio] Add AR9341/AR9342 to the list of chips for programming function/output enable. This is reqired to use the gpiofunc behaviour for configuring GPIO pins at boot time. Submitted by: Differential Revision: https://reviews.freebsd.org/D20170 Modified: head/sys/mips/atheros/ar71xx_gpio.c Modified: head/sys/mips/atheros/ar71xx_gpio.c ============================================================================== --- head/sys/mips/atheros/ar71xx_gpio.c Wed May 15 15:54:27 2019 (r347617) +++ head/sys/mips/atheros/ar71xx_gpio.c Wed May 15 16:51:08 2019 (r347618) @@ -151,6 +151,8 @@ static int ar71xx_gpio_oe_is_high(void) { switch (ar71xx_soc) { + case AR71XX_SOC_AR9341: + case AR71XX_SOC_AR9342: case AR71XX_SOC_AR9344: case AR71XX_SOC_QCA9533: case AR71XX_SOC_QCA9533_V2: @@ -559,7 +561,7 @@ ar71xx_gpio_attach(device_t dev) &gpiomode) != 0) continue; - /* We only handle mode=1 for now */ + /* We only handle mode=1 (output) for now */ if (gpiomode != 1) continue; From owner-svn-src-head@freebsd.org Wed May 15 16:59:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48C8D159922E; Wed, 15 May 2019 16:59:05 +0000 (UTC) (envelope-from johalun@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 DE232956CE; Wed, 15 May 2019 16:59:04 +0000 (UTC) (envelope-from johalun@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 CEA0CC785; Wed, 15 May 2019 16:59:04 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4FGx4AJ021893; Wed, 15 May 2019 16:59:04 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4FGx4at021892; Wed, 15 May 2019 16:59:04 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905151659.x4FGx4at021892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Wed, 15 May 2019 16:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347619 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 347619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE232956CE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.938,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Wed, 15 May 2019 16:59:05 -0000 Author: johalun Date: Wed May 15 16:59:04 2019 New Revision: 347619 URL: https://svnweb.freebsd.org/changeset/base/347619 Log: LinuxKPI: Expand ktime functionality. Also, make ktime_get_raw call getnanouptime instead of getnanotime to match (the correct) ktime_get_raw_ns. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/ktime.h Wed May 15 16:51:08 2019 (r347618) +++ head/sys/compat/linuxkpi/common/include/linux/ktime.h Wed May 15 16:59:04 2019 (r347619) @@ -35,8 +35,6 @@ #include #include -#define ktime_get_ts(x) getnanouptime(x) - /* time values in nanoseconds */ typedef s64 ktime_t; @@ -93,6 +91,13 @@ ktime_add_ms(ktime_t kt, int64_t ms) } static inline ktime_t +ktime_add_us(ktime_t kt, int64_t us) +{ + + return (ktime_add_ns(kt, us * NSEC_PER_USEC)); +} + +static inline ktime_t ktime_sub_ns(ktime_t kt, int64_t ns) { return (kt - ns); @@ -172,11 +177,20 @@ timeval_to_ktime(struct timeval tv) return (ktime_set(tv.tv_sec, tv.tv_usec * NSEC_PER_USEC)); } +static inline int64_t +timespec64_to_ns(struct timespec64 *ts) +{ + return (timespec_to_ns(ts)); +} + #define ktime_to_timespec(kt) ns_to_timespec(kt) #define ktime_to_timespec64(kt) ns_to_timespec(kt) #define ktime_to_timeval(kt) ns_to_timeval(kt) #define ktime_to_ns(kt) (kt) -#define ktime_get_ts64(ts) ktime_get_ts(ts) +#define ktime_get_ts(ts) getnanouptime(ts) +#define ktime_get_ts64(ts) getnanouptime(ts) +#define ktime_get_raw_ts64(ts) getnanouptime(ts) +#define getrawmonotonic64(ts) getnanouptime(ts) static inline int64_t ktime_get_ns(void) @@ -229,7 +243,7 @@ ktime_get_raw(void) { struct timespec ts; - nanotime(&ts); + nanouptime(&ts); return (timespec_to_ktime(ts)); } From owner-svn-src-head@freebsd.org Wed May 15 17:04:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BE8F1599500; Wed, 15 May 2019 17:04:13 +0000 (UTC) (envelope-from johalun@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 1233295BD3; Wed, 15 May 2019 17:04:13 +0000 (UTC) (envelope-from johalun@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 DE277C926; Wed, 15 May 2019 17:04:12 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4FH4CeM027050; Wed, 15 May 2019 17:04:12 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4FH4Clv027049; Wed, 15 May 2019 17:04:12 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905151704.x4FH4Clv027049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Wed, 15 May 2019 17:04:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347620 - head/sys/compat/linuxkpi/common/include/asm X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 347620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1233295BD3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.94)[-0.938,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; 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: Wed, 15 May 2019 17:04:13 -0000 Author: johalun Date: Wed May 15 17:04:12 2019 New Revision: 347620 URL: https://svnweb.freebsd.org/changeset/base/347620 Log: LinuxKPI: Update user_access_begin for Linux v5.0. Check the new LINUXKPI_VERSION macro for backwards compatibility. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/asm/uaccess.h Modified: head/sys/compat/linuxkpi/common/include/asm/uaccess.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/uaccess.h Wed May 15 16:59:04 2019 (r347619) +++ head/sys/compat/linuxkpi/common/include/asm/uaccess.h Wed May 15 17:04:12 2019 (r347620) @@ -52,7 +52,11 @@ copy_from_user(void *to, const void *from, unsigned lo #define __copy_from_user(...) copy_from_user(__VA_ARGS__) #define __copy_in_user(...) copy_from_user(__VA_ARGS__) +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 50000 +#define user_access_begin(ptr, len) access_ok(ptr, len) +#else #define user_access_begin() do { } while (0) +#endif #define user_access_end() do { } while (0) #define unsafe_get_user(x, ptr, err) do { \ From owner-svn-src-head@freebsd.org Wed May 15 17:32:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B0F5159A39E; Wed, 15 May 2019 17:32:01 +0000 (UTC) (envelope-from johalun@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 F0E4E96BB5; Wed, 15 May 2019 17:32:00 +0000 (UTC) (envelope-from johalun@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 CB9F0CE0D; Wed, 15 May 2019 17:32:00 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4FHW04H042357; Wed, 15 May 2019 17:32:00 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4FHW0rI042356; Wed, 15 May 2019 17:32:00 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905151732.x4FHW0rI042356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Wed, 15 May 2019 17:32:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347621 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 347621 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F0E4E96BB5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Wed, 15 May 2019 17:32:01 -0000 Author: johalun Date: Wed May 15 17:32:00 2019 New Revision: 347621 URL: https://svnweb.freebsd.org/changeset/base/347621 Log: LinuxKPI: Add get_random_u32 function. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/random.h Modified: head/sys/compat/linuxkpi/common/include/linux/random.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/random.h Wed May 15 17:04:12 2019 (r347620) +++ head/sys/compat/linuxkpi/common/include/linux/random.h Wed May 15 17:32:00 2019 (r347621) @@ -35,6 +35,8 @@ #include #include +#define get_random_u32() get_random_int() + static inline void get_random_bytes(void *buf, int nbytes) { From owner-svn-src-head@freebsd.org Wed May 15 17:44:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9F70159A842; Wed, 15 May 2019 17:44:26 +0000 (UTC) (envelope-from johalun@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 80E96970D0; Wed, 15 May 2019 17:44:26 +0000 (UTC) (envelope-from johalun@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 5B6DECFCF; Wed, 15 May 2019 17:44:26 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4FHiQYw047689; Wed, 15 May 2019 17:44:26 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4FHiQQi047688; Wed, 15 May 2019 17:44:26 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905151744.x4FHiQQi047688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Wed, 15 May 2019 17:44:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347622 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 347622 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 80E96970D0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; 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: Wed, 15 May 2019 17:44:27 -0000 Author: johalun Date: Wed May 15 17:44:25 2019 New Revision: 347622 URL: https://svnweb.freebsd.org/changeset/base/347622 Log: LinuxKPI: Include asm/atomic-long.h from atomic.h. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/atomic.h Modified: head/sys/compat/linuxkpi/common/include/linux/atomic.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/atomic.h Wed May 15 17:32:00 2019 (r347621) +++ head/sys/compat/linuxkpi/common/include/linux/atomic.h Wed May 15 17:44:25 2019 (r347622) @@ -31,5 +31,6 @@ #include #include +#include #endif /* _LINUX_ATOMIC_H_ */ From owner-svn-src-head@freebsd.org Wed May 15 17:48:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27C14159A8FB; Wed, 15 May 2019 17:48:13 +0000 (UTC) (envelope-from johalun@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 BB1419728B; Wed, 15 May 2019 17:48:12 +0000 (UTC) (envelope-from johalun@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 52B4CCFD7; Wed, 15 May 2019 17:48:12 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4FHmC5G047880; Wed, 15 May 2019 17:48:12 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4FHmCWw047879; Wed, 15 May 2019 17:48:12 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905151748.x4FHmCWw047879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Wed, 15 May 2019 17:48:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347623 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 347623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BB1419728B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Wed, 15 May 2019 17:48:13 -0000 Author: johalun Date: Wed May 15 17:48:11 2019 New Revision: 347623 URL: https://svnweb.freebsd.org/changeset/base/347623 Log: LinuxKPI: Move {lower|upper}_32_bits macros from port to base. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/compiler.h Wed May 15 17:44:25 2019 (r347622) +++ head/sys/compat/linuxkpi/common/include/linux/compiler.h Wed May 15 17:48:11 2019 (r347623) @@ -81,6 +81,12 @@ #define barrier() __asm__ __volatile__("": : :"memory") +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 50000 +/* Moved from drm_os_freebsd.h */ +#define lower_32_bits(n) ((u32)(n)) +#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16)) +#endif + #define ___PASTE(a,b) a##b #define __PASTE(a,b) ___PASTE(a,b) From owner-svn-src-head@freebsd.org Wed May 15 17:55:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53EBC159ACEF; Wed, 15 May 2019 17:55:42 +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 EF37F9791A; Wed, 15 May 2019 17:55:41 +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 C6076D196; Wed, 15 May 2019 17:55:41 +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 x4FHtfo4052952; Wed, 15 May 2019 17:55:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4FHtfTR052951; Wed, 15 May 2019 17:55:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905151755.x4FHtfTR052951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 15 May 2019 17:55:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347625 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 347625 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EF37F9791A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Wed, 15 May 2019 17:55:42 -0000 Author: kib Date: Wed May 15 17:55:41 2019 New Revision: 347625 URL: https://svnweb.freebsd.org/changeset/base/347625 Log: Properly announce MD_CLEAR. Submitted by: Petr Lampa MFC after: 3 days Modified: head/sys/x86/x86/identcpu.c Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Wed May 15 17:50:17 2019 (r347624) +++ head/sys/x86/x86/identcpu.c Wed May 15 17:55:41 2019 (r347625) @@ -995,6 +995,7 @@ printcpuinfo(void) printf("\n Structured Extended Features3=0x%b", cpu_stdext_feature3, "\020" + "\013MD_CLEAR" "\016TSXFA" "\033IBPB" "\034STIBP" From owner-svn-src-head@freebsd.org Wed May 15 17:57:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFF45159ADF0; Wed, 15 May 2019 17:57:07 +0000 (UTC) (envelope-from johalun@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 55E5697A92; Wed, 15 May 2019 17:57:07 +0000 (UTC) (envelope-from johalun@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 25DC3D198; Wed, 15 May 2019 17:57:07 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4FHv7h2053058; Wed, 15 May 2019 17:57:07 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4FHv74H053057; Wed, 15 May 2019 17:57:07 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905151757.x4FHv74H053057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Wed, 15 May 2019 17:57:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347626 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 347626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 55E5697A92 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Wed, 15 May 2019 17:57:07 -0000 Author: johalun Date: Wed May 15 17:57:06 2019 New Revision: 347626 URL: https://svnweb.freebsd.org/changeset/base/347626 Log: LinuxKPI: Add helper macros IS_ALIGNED and DIV_ROUND_DOWN_ULL. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Wed May 15 17:55:41 2019 (r347625) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Wed May 15 17:57:06 2019 (r347626) @@ -130,9 +130,14 @@ #define ALIGN(x, y) roundup2((x), (y)) #undef PTR_ALIGN #define PTR_ALIGN(p, a) ((__typeof(p))ALIGN((uintptr_t)(p), (a))) +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 50000 +/* Moved from linuxkpi_gplv2 */ +#define IS_ALIGNED(x, a) (((x) & ((__typeof(x))(a) - 1)) == 0) +#endif #define DIV_ROUND_UP(x, n) howmany(x, n) #define __KERNEL_DIV_ROUND_UP(x, n) howmany(x, n) #define DIV_ROUND_UP_ULL(x, n) DIV_ROUND_UP((unsigned long long)(x), (n)) +#define DIV_ROUND_DOWN_ULL(x, n) (((unsigned long long)(x) / (n)) * (n)) #define FIELD_SIZEOF(t, f) sizeof(((t *)0)->f) #define printk(...) printf(__VA_ARGS__) From owner-svn-src-head@freebsd.org Wed May 15 18:01:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3F9D159B057; Wed, 15 May 2019 18:01:06 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (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 72C6097EC5; Wed, 15 May 2019 18:01:06 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: by mail-io1-f43.google.com with SMTP id x24so316480ion.5; Wed, 15 May 2019 11:01:06 -0700 (PDT) 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=KkPUHl67R3KdpWKkt8Zj9VYSDGLyUjWwUVDjttE7R6E=; b=HQRkJD5hqZ+Y/d/MMsA4fTy27mHvV7hGPrmVxt9MWiHf2o1QhfFnh7daP3V/8/6tg0 XW7OrrGTCFqZQ7gLX0W9+4UKVe8jtxuxxvOnFQt0LsZd2F46fy2o33qgU2WiqWs+j3i5 ijw4LOzUFraS5rpW/O/54bbDXwrG2la8mtYx8Emwq9yol+ld4x21bVbGf6gte2X+Z37D 4oRLyaxUJ6NBIH9IYUVtz9uN/xLpP44oWQ9GOTFhBiq3W1w7z3OIf8T8PmYNTgxEtfIE +fs008GyTYT1o15WOuqJZ6IDyz91ieOPws2PnXV/Afig2++EWLjEB4jsxIm5ooChFeJ9 UROg== X-Gm-Message-State: APjAAAXy/HT4yWd0wGo2UsMrgkdqdS4331RB0Ldywynk/a5dO5ue4Xai G3ucUvj/C35vtKIG2cZGSeb6Pr8a8ZMv8MrnfPbtoQQ5VcE= X-Google-Smtp-Source: APXvYqzjwMtTCz7w5BrQ5AJxBQ8FK//Oh8YzxRdA1SO+AaA0RepITyvMIgajbEfAZMJSzEJygC3VadomDDFI+5TNyKI= X-Received: by 2002:a6b:7a49:: with SMTP id k9mr5602071iop.73.1557941494752; Wed, 15 May 2019 10:31:34 -0700 (PDT) MIME-Version: 1.0 References: <201905141702.x4EH2LuD061054@repo.freebsd.org> <20190515081027.GL2748@kib.kiev.ua> In-Reply-To: <20190515081027.GL2748@kib.kiev.ua> From: Dmitry Chagin Date: Wed, 15 May 2019 20:31:23 +0300 Message-ID: Subject: Re: svn commit: r347566 - in head/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86 To: Konstantin Belousov Cc: Dmitry Chagin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 72C6097EC5 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.90 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.90)[-0.902,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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: Wed, 15 May 2019 18:01:07 -0000 =D1=81=D1=80, 15 =D0=BC=D0=B0=D1=8F 2019 =D0=B3. =D0=B2 11:10, Konstantin B= elousov : > On Wed, May 15, 2019 at 08:54:04AM +0300, Dmitry Chagin wrote: > > =D0=B2=D1=82, 14 =D0=BC=D0=B0=D1=8F 2019 =D0=B3. =D0=B2 20:02, Konstant= in Belousov : > > > > > Author: kib > > > Date: Tue May 14 17:02:20 2019 > > > New Revision: 347566 > > > URL: https://svnweb.freebsd.org/changeset/base/347566 > > > > > > Log: > > > Mitigations for Microarchitectural Data Sampling. > > > > > > Microarchitectural buffers on some Intel processors utilizing > > > speculative execution may allow a local process to obtain a memory > > > disclosure. An attacker may be able to read secret data from the > > > kernel or from a process when executing untrusted code (for example= , > > > in a web browser). > > > > > > Reference: > > > > https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa= -00233.html > > > Security: CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, > > > CVE-2019-11091 > > > Security: FreeBSD-SA-19:07.mds > > > Reviewed by: jhb > > > Tested by: emaste, lwhsu > > > Approved by: so (gtetlow) > > > > > > Modified: > > > head/sys/amd64/amd64/exception.S > > > head/sys/amd64/amd64/genassym.c > > > head/sys/amd64/amd64/initcpu.c > > > head/sys/amd64/amd64/machdep.c > > > head/sys/amd64/amd64/support.S > > > > > > > > > > > Hi, Kostik! > > > > cc -target x86_64-unknown-freebsd13.0 > > --sysroot=3D/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp > > -B/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp/usr/bin -c -x > > assembler-with-cpp -DLOCORE -O2 -pipe -fno-strict-aliasing -g -nostdin= c > > -I. -I/home/dchagin/head/sys -I/home/dchagin/head/sys/contrib/ck/includ= e > > -I/home/dchagin/head/sys/contrib/libfdt -D_KERNEL > > -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h > > -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD > > -MF.depend.support.o -MTsupport.o > > -fdebug-prefix-map=3D./machine=3D/home/dchagin/head/sys/amd64/include > > -fdebug-prefix-map=3D./x86=3D/home/dchagin/head/sys/x86/include > -mcmodel=3Dkernel > > -mno-red-zone -mno-mmx -mno-sse -msoft-float > > -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protecto= r > > -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes > > -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef > -Wno-pointer-sign > > -D__printf__=3D__freebsd_kprintf__ -Wmissing-include-dirs > > -fdiagnostics-show-option -Wno-unknown-pragmas > > -Wno-error-tautological-compare -Wno-error-empty-body > > -Wno-error-parentheses-equality -Wno-error-unused-function > > -Wno-error-pointer-sign -Wno-error-shift-negative-value > > -Wno-address-of-packed-member -mno-aes -mno-avx -std=3Diso9899:1999 > > -Werror /home/dchagin/head/sys/amd64/amd64/support.S > > /home/dchagin/head/sys/amd64/amd64/support.S:1809:2: error: instruction > > requires: AVX-512 ISA > > vmovdqa64 %zmm0, %gs:0x340 > > ^ > > /home/dchagin/head/sys/amd64/amd64/support.S:1810:2: error: instruction > > requires: AVX-512 ISA > > vpxor %zmm0, %zmm0, %zmm0 > > ^ > > /home/dchagin/head/sys/amd64/amd64/support.S:1813:2: error: instruction > > requires: AVX-512 DQ ISA > > vorpd (%rdx), %zmm0, %zmm0 > > ^ > > /home/dchagin/head/sys/amd64/amd64/support.S:1814:2: error: instruction > > requires: AVX-512 DQ ISA > > vorpd (%rdx), %zmm0, %zmm0 > > ^ > > /home/dchagin/head/sys/amd64/amd64/support.S:1826:2: error: instruction > > requires: AVX-512 ISA > > vmovdqa64 %gs:0x340, %zmm0 > > ^ > > *** Error code 1 > > > > > > I/m missied something? > Yes, you are using older compiler than current. Perhaps you are using > clang 6.0 still. Update your world. > > FWIW, this is is reason why the sw sequences use .byte in 11.2/12.0 > patches. I do not want to put such abomination into live code base, > remembering aesni.ko. > yes, you are right. thank you! but in the best tradition of the project, the system does not built, I got ar error when building static llvm library: ar: fatal: Symbol table offset overflow *** Error code 70 Stop. make[6]: stopped in /home/dchagin/head/lib/clang/libllvm *** Error code 1 From owner-svn-src-head@freebsd.org Wed May 15 18:13:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 164FA159B700; Wed, 15 May 2019 18:13:45 +0000 (UTC) (envelope-from rlibby@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 B003569B19; Wed, 15 May 2019 18:13:44 +0000 (UTC) (envelope-from rlibby@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 8BA87D4E4; Wed, 15 May 2019 18:13:44 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4FIDiRU063641; Wed, 15 May 2019 18:13:44 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4FIDipT063640; Wed, 15 May 2019 18:13:44 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201905151813.x4FIDipT063640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Wed, 15 May 2019 18:13:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347628 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 347628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B003569B19 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Wed, 15 May 2019 18:13:45 -0000 Author: rlibby Date: Wed May 15 18:13:43 2019 New Revision: 347628 URL: https://svnweb.freebsd.org/changeset/base/347628 Log: x86: spell vpxor %zmm0 as vpxord Fix gcc/gas amd64 & i386 build after r347566. Reviewed by: kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20264 Modified: head/sys/amd64/amd64/support.S head/sys/i386/i386/support.s Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Wed May 15 17:58:08 2019 (r347627) +++ head/sys/amd64/amd64/support.S Wed May 15 18:13:43 2019 (r347628) @@ -1807,7 +1807,7 @@ ENTRY(mds_handler_skl_avx512) 1: movq PCPU(MDS_BUF), %rdi movq PCPU(MDS_BUF64), %rdx vmovdqa64 %zmm0, PCPU(MDS_TMP) - vpxor %zmm0, %zmm0, %zmm0 + vpxord %zmm0, %zmm0, %zmm0 lfence vorpd (%rdx), %zmm0, %zmm0 Modified: head/sys/i386/i386/support.s ============================================================================== --- head/sys/i386/i386/support.s Wed May 15 17:58:08 2019 (r347627) +++ head/sys/i386/i386/support.s Wed May 15 18:13:43 2019 (r347628) @@ -611,7 +611,7 @@ ENTRY(mds_handler_skl_avx512) 1: movl PCPU(MDS_BUF), %edi movl PCPU(MDS_BUF64), %edx vmovdqa64 %zmm0, PCPU(MDS_TMP) - vpxor %zmm0, %zmm0, %zmm0 + vpxord %zmm0, %zmm0, %zmm0 lfence vorpd (%edx), %zmm0, %zmm0 From owner-svn-src-head@freebsd.org Wed May 15 18:15:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65267159B84F; Wed, 15 May 2019 18:15:34 +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 9189B69DBB; Wed, 15 May 2019 18:15:33 +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 x4FIFPAo081412 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 15 May 2019 21:15:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x4FIFPAo081412 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x4FIFPvW081410; Wed, 15 May 2019 21:15:25 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 15 May 2019 21:15:25 +0300 From: Konstantin Belousov To: Dmitry Chagin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347566 - in head/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86 Message-ID: <20190515181525.GN2748@kib.kiev.ua> References: <201905141702.x4EH2LuD061054@repo.freebsd.org> <20190515081027.GL2748@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) 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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 15 May 2019 18:15:34 -0000 On Wed, May 15, 2019 at 08:31:23PM +0300, Dmitry Chagin wrote: > ср, 15 мая 2019 г. в 11:10, Konstantin Belousov : > > > On Wed, May 15, 2019 at 08:54:04AM +0300, Dmitry Chagin wrote: > > > вт, 14 мая 2019 г. в 20:02, Konstantin Belousov : > > > > > > > Author: kib > > > > Date: Tue May 14 17:02:20 2019 > > > > New Revision: 347566 > > > > URL: https://svnweb.freebsd.org/changeset/base/347566 > > > > > > > > Log: > > > > Mitigations for Microarchitectural Data Sampling. > > > > > > > > Microarchitectural buffers on some Intel processors utilizing > > > > speculative execution may allow a local process to obtain a memory > > > > disclosure. An attacker may be able to read secret data from the > > > > kernel or from a process when executing untrusted code (for example, > > > > in a web browser). > > > > > > > > Reference: > > > > > > https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00233.html > > > > Security: CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, > > > > CVE-2019-11091 > > > > Security: FreeBSD-SA-19:07.mds > > > > Reviewed by: jhb > > > > Tested by: emaste, lwhsu > > > > Approved by: so (gtetlow) > > > > > > > > Modified: > > > > head/sys/amd64/amd64/exception.S > > > > head/sys/amd64/amd64/genassym.c > > > > head/sys/amd64/amd64/initcpu.c > > > > head/sys/amd64/amd64/machdep.c > > > > head/sys/amd64/amd64/support.S > > > > > > > > > > > > > > > > Hi, Kostik! > > > > > > cc -target x86_64-unknown-freebsd13.0 > > > --sysroot=/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp > > > -B/home/dchagin/obj/home/dchagin/head/amd64.amd64/tmp/usr/bin -c -x > > > assembler-with-cpp -DLOCORE -O2 -pipe -fno-strict-aliasing -g -nostdinc > > > -I. -I/home/dchagin/head/sys -I/home/dchagin/head/sys/contrib/ck/include > > > -I/home/dchagin/head/sys/contrib/libfdt -D_KERNEL > > > -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h > > > -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD > > > -MF.depend.support.o -MTsupport.o > > > -fdebug-prefix-map=./machine=/home/dchagin/head/sys/amd64/include > > > -fdebug-prefix-map=./x86=/home/dchagin/head/sys/x86/include > > -mcmodel=kernel > > > -mno-red-zone -mno-mmx -mno-sse -msoft-float > > > -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector > > > -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes > > > -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef > > -Wno-pointer-sign > > > -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs > > > -fdiagnostics-show-option -Wno-unknown-pragmas > > > -Wno-error-tautological-compare -Wno-error-empty-body > > > -Wno-error-parentheses-equality -Wno-error-unused-function > > > -Wno-error-pointer-sign -Wno-error-shift-negative-value > > > -Wno-address-of-packed-member -mno-aes -mno-avx -std=iso9899:1999 > > > -Werror /home/dchagin/head/sys/amd64/amd64/support.S > > > /home/dchagin/head/sys/amd64/amd64/support.S:1809:2: error: instruction > > > requires: AVX-512 ISA > > > vmovdqa64 %zmm0, %gs:0x340 > > > ^ > > > /home/dchagin/head/sys/amd64/amd64/support.S:1810:2: error: instruction > > > requires: AVX-512 ISA > > > vpxor %zmm0, %zmm0, %zmm0 > > > ^ > > > /home/dchagin/head/sys/amd64/amd64/support.S:1813:2: error: instruction > > > requires: AVX-512 DQ ISA > > > vorpd (%rdx), %zmm0, %zmm0 > > > ^ > > > /home/dchagin/head/sys/amd64/amd64/support.S:1814:2: error: instruction > > > requires: AVX-512 DQ ISA > > > vorpd (%rdx), %zmm0, %zmm0 > > > ^ > > > /home/dchagin/head/sys/amd64/amd64/support.S:1826:2: error: instruction > > > requires: AVX-512 ISA > > > vmovdqa64 %gs:0x340, %zmm0 > > > ^ > > > *** Error code 1 > > > > > > > > > I/m missied something? > > Yes, you are using older compiler than current. Perhaps you are using > > clang 6.0 still. Update your world. > > > > FWIW, this is is reason why the sw sequences use .byte in 11.2/12.0 > > patches. I do not want to put such abomination into live code base, > > remembering aesni.ko. > > > > yes, you are right. thank you! but in the best tradition of the project, > the system does not built, > I got ar error when building static llvm library: > ar: fatal: Symbol table offset overflow > *** Error code 70 > > Stop. > make[6]: stopped in /home/dchagin/head/lib/clang/libllvm > *** Error code 1 Perhaps try to manually compile usr.bin/ar from the new source and install it before doing buildworld. From owner-svn-src-head@freebsd.org Thu May 16 00:09:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E3D615A6D2C; Thu, 16 May 2019 00:09:22 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-eopbgr670087.outbound.protection.outlook.com [40.107.67.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFDDD77862; Thu, 16 May 2019 00:09:21 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YQXPR0101MB2262.CANPRD01.PROD.OUTLOOK.COM (52.132.80.151) by YQXPR0101MB1112.CANPRD01.PROD.OUTLOOK.COM (52.132.78.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.22; Thu, 16 May 2019 00:09:20 +0000 Received: from YQXPR0101MB2262.CANPRD01.PROD.OUTLOOK.COM ([fe80::44dc:5f27:855:3fde]) by YQXPR0101MB2262.CANPRD01.PROD.OUTLOOK.COM ([fe80::44dc:5f27:855:3fde%3]) with mapi id 15.20.1900.010; Thu, 16 May 2019 00:09:20 +0000 From: Rick Macklem To: Konstantin Belousov , Dmitry Chagin CC: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r347566 - in head/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86 Thread-Topic: svn commit: r347566 - in head/sys: amd64/amd64 amd64/include dev/cpuctl i386/i386 i386/include x86/include x86/x86 Thread-Index: AQHVC0g3/aq+u21wCU2fUBFuiUtKlaZsfcWAgABgC30= Date: Thu, 16 May 2019 00:09:19 +0000 Message-ID: References: <201905141702.x4EH2LuD061054@repo.freebsd.org> <20190515081027.GL2748@kib.kiev.ua> , <20190515181525.GN2748@kib.kiev.ua> In-Reply-To: <20190515181525.GN2748@kib.kiev.ua> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c676f08f-f382-4dbe-669e-08d6d992be4b x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:YQXPR0101MB1112; x-ms-traffictypediagnostic: YQXPR0101MB1112: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-forefront-prvs: 0039C6E5C5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(376002)(346002)(396003)(39860400002)(199004)(189003)(86362001)(33656002)(14454004)(7696005)(4744005)(786003)(5660300002)(316002)(53936002)(52536014)(6246003)(99286004)(66946007)(66476007)(66556008)(64756008)(102836004)(73956011)(66446008)(446003)(8676002)(6506007)(305945005)(76176011)(8936002)(4326008)(74482002)(76116006)(81166006)(81156014)(74316002)(68736007)(478600001)(25786009)(55016002)(186003)(9686003)(256004)(71190400001)(71200400001)(229853002)(11346002)(46003)(6436002)(486006)(476003)(54906003)(2906002)(110136005); DIR:OUT; SFP:1101; SCL:1; SRVR:YQXPR0101MB1112; H:YQXPR0101MB2262.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: KDORj5RUuwt8XqqQOlnrg4Q0bq4DtSxsHlZsS91dqocYh2aWCXT3YBaWQAFwCqui3fMcDMI+9ZvWxY+PpTlshx7qeotDtQUOocJ+FnoBU0g5M6GTJhXjNUbRt5U7LsqdIdMlCmVsjWbXgac54hpGj/GsXnjeW3gezIxGxSz6c9EUBpTLo4q7ndXQ9ekqK4v7eC2VeFImIzeoMruRYKlhUF+zpFQTgvFo56s8gjGfeohiQhHDWK7RGz3j26Q5L7mtocQXq9w1ufTa7MTjfAt3vG9FAYrSTUOgon6+07jl2HXJUxE5uMet63V1KRLnVxM2nh3AUDUo/QI9Y0xjqZByvng66Yxq6ZIOJ5uzPwnBWEkkBJd76AQ2j54j414EVQfswgEn1VoW8w8AU1QJxWvPIYeEXBLfJ9lRatuwmonhWkM= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: c676f08f-f382-4dbe-669e-08d6d992be4b X-MS-Exchange-CrossTenant-originalarrivaltime: 16 May 2019 00:09:19.9569 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: YQXPR0101MB1112 X-Rspamd-Queue-Id: DFDDD77862 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,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: Thu, 16 May 2019 00:09:22 -0000 Konstantin Belousov wrote: [lots of stuff snipped] >On Wed, May 15, 2019 at 08:31:23PM +0300, Dmitry Chagin wrote: >> >> yes, you are right. thank you! but in the best tradition of the project, >> the system does not built, >> I got ar error when building static llvm library: >> ar: fatal: Symbol table offset overflow >> *** Error code 70 errno 70 is ESTALE, which is an NFS error indicating that the file was dele= ted on the NFS server. If you are using an NFS mount, I'd suggest trying it on a local disk. (NFS isn't a POSIX compliant file system and never will be, given the proto= col specification. You can usually get away with builds on NFS, but...) If you aren't using a NFS mount, then I have no idea why an ESTALE would ha= ppen? >> >> Stop. >> make[6]: stopped in /home/dchagin/head/lib/clang/libllvm >> *** Error code 1 >Perhaps try to manually compile usr.bin/ar from the new source and install >it before doing buildworld. Good luck with it, rick From owner-svn-src-head@freebsd.org Thu May 16 01:09:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F35D715A80DA; Thu, 16 May 2019 01:09:14 +0000 (UTC) (envelope-from brd@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 970128150A; Thu, 16 May 2019 01:09:14 +0000 (UTC) (envelope-from brd@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 6866819A05; Thu, 16 May 2019 01:09:14 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4G19Esf080694; Thu, 16 May 2019 01:09:14 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4G19DhY080690; Thu, 16 May 2019 01:09:13 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201905160109.x4G19DhY080690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Thu, 16 May 2019 01:09:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347638 - in head: . etc lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head: . etc lib/libc/gen X-SVN-Commit-Revision: 347638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 970128150A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 16 May 2019 01:09:15 -0000 Author: brd Date: Thu May 16 01:09:13 2019 New Revision: 347638 URL: https://svnweb.freebsd.org/changeset/base/347638 Log: Move master.passwd and group to lib/libc/gen/ libc was picked as the destination location for these because of the syscalls that use these files as the lowest level place they are referenced. Approved by: will (mentor), rgrimes, manu Differential Revision: https://reviews.freebsd.org/D16728 Added: head/lib/libc/gen/group - copied unchanged from r347637, head/etc/group head/lib/libc/gen/master.passwd - copied unchanged from r347637, head/etc/master.passwd Deleted: head/etc/group head/etc/master.passwd Modified: head/Makefile.inc1 head/etc/Makefile head/lib/libc/gen/Makefile.inc Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu May 16 00:53:54 2019 (r347637) +++ head/Makefile.inc1 Thu May 16 01:09:13 2019 (r347638) @@ -871,8 +871,8 @@ DB_FROM_SRC= yes .endif .if defined(DB_FROM_SRC) -INSTALLFLAGS+= -N ${.CURDIR}/etc -MTREEFLAGS+= -N ${.CURDIR}/etc +INSTALLFLAGS+= -N ${.CURDIR}/lib/libc/gen +MTREEFLAGS+= -N ${.CURDIR}/lib/libc/gen .endif _INSTALL_DDIR= ${DESTDIR}/${DISTDIR} INSTALL_DDIR= ${_INSTALL_DDIR:S://:/:g:C:/$::} Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Thu May 16 00:53:54 2019 (r347637) +++ head/etc/Makefile Thu May 16 01:09:13 2019 (r347638) @@ -15,7 +15,6 @@ SUBDIR+=sendmail .endif BIN1= \ - group \ login.access \ rc.bsdextended \ rc.firewall \ @@ -65,21 +64,7 @@ distribution: .endif cd ${.CURDIR}; \ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ - ${BIN1} ${DESTDIR}/etc; \ - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ - master.passwd ${DESTDIR}/etc; - -.if ${MK_TCSH} == "no" - sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd -.endif - pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd -.if defined(NO_ROOT) - ( \ - echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \ - echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \ - echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \ - ) | ${METALOG.add} -.endif + ${BIN1} ${DESTDIR}/etc ${_+_}cd ${.CURDIR}/gss; ${MAKE} install ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Thu May 16 00:53:54 2019 (r347637) +++ head/lib/libc/gen/Makefile.inc Thu May 16 01:09:13 2019 (r347638) @@ -4,7 +4,8 @@ # machine-independent gen sources .PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/gen ${LIBC_SRCTOP}/gen -CONFS= shells +CONFS+= group master.passwd shells +CONFSMODE_master.passwd= 600 SRCS+= __getosreldate.c \ __pthread_mutex_init_calloc_cb_stub.c \ @@ -543,3 +544,16 @@ MLINKS+=vis.3 nvis.3 \ vis.3 svis.3 MLINKS+=wordexp.3 wordfree.3 + +afterinstallconfig: +.if ${MK_TCSH} == "no" + sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd +.endif + pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd +.if defined(NO_ROOT) && defined(METALOG) + ( \ + echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \ + echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \ + echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \ + ) | cat -l >> ${METALOG} +.endif Copied: head/lib/libc/gen/group (from r347637, head/etc/group) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/group Thu May 16 01:09:13 2019 (r347638, copy of r347637, head/etc/group) @@ -0,0 +1,36 @@ +# $FreeBSD$ +# +wheel:*:0:root +daemon:*:1: +kmem:*:2: +sys:*:3: +tty:*:4: +operator:*:5:root +mail:*:6: +bin:*:7: +news:*:8: +man:*:9: +games:*:13: +ftp:*:14: +staff:*:20: +sshd:*:22: +smmsp:*:25: +mailnull:*:26: +guest:*:31: +video:*:44: +bind:*:53: +unbound:*:59: +proxy:*:62: +authpf:*:63: +_pflogd:*:64: +_dhcp:*:65: +uucp:*:66: +dialer:*:68: +network:*:69: +audit:*:77: +www:*:80: +ntpd:*:123: +_ypldap:*:160: +hast:*:845: +nogroup:*:65533: +nobody:*:65534: Copied: head/lib/libc/gen/master.passwd (from r347637, head/etc/master.passwd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/master.passwd Thu May 16 01:09:13 2019 (r347638, copy of r347637, head/etc/master.passwd) @@ -0,0 +1,28 @@ +# $FreeBSD$ +# +root::0:0::0:0:Charlie &:/root:/bin/csh +toor:*:0:0::0:0:Bourne-again Superuser:/root: +daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin +operator:*:2:5::0:0:System &:/:/usr/sbin/nologin +bin:*:3:7::0:0:Binaries Commands and Source:/:/usr/sbin/nologin +tty:*:4:65533::0:0:Tty Sandbox:/:/usr/sbin/nologin +kmem:*:5:65533::0:0:KMem Sandbox:/:/usr/sbin/nologin +games:*:7:13::0:0:Games pseudo-user:/:/usr/sbin/nologin +news:*:8:8::0:0:News Subsystem:/:/usr/sbin/nologin +man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/usr/sbin/nologin +sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin +smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/usr/sbin/nologin +mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin +bind:*:53:53::0:0:Bind Sandbox:/:/usr/sbin/nologin +unbound:*:59:59::0:0:Unbound DNS Resolver:/var/unbound:/usr/sbin/nologin +proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin +_pflogd:*:64:64::0:0:pflogd privsep user:/var/empty:/usr/sbin/nologin +_dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin +uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/local/libexec/uucp/uucico +pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin +auditdistd:*:78:77::0:0:Auditdistd unprivileged user:/var/empty:/usr/sbin/nologin +www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin +ntpd:*:123:123::0:0:NTP Daemon:/var/db/ntp:/usr/sbin/nologin +_ypldap:*:160:160::0:0:YP LDAP unprivileged user:/var/empty:/usr/sbin/nologin +hast:*:845:845::0:0:HAST unprivileged user:/var/empty:/usr/sbin/nologin +nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin From owner-svn-src-head@freebsd.org Thu May 16 01:32:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75BCC15A8956; Thu, 16 May 2019 01:32:55 +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 19B01825A9; Thu, 16 May 2019 01:32:55 +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 E737B19F0E; Thu, 16 May 2019 01:32:54 +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 x4G1Wsbs096484; Thu, 16 May 2019 01:32:54 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4G1Wsv6096483; Thu, 16 May 2019 01:32:54 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905160132.x4G1Wsv6096483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 16 May 2019 01:32:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347639 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 347639 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 19B01825A9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 16 May 2019 01:32:55 -0000 Author: cem Date: Thu May 16 01:32:54 2019 New Revision: 347639 URL: https://svnweb.freebsd.org/changeset/base/347639 Log: x86: Correctly identify bhyve hypervisor Spotted after a similar report by Olivier Cochard-Labbé. Sponsored by: Dell EMC Isilon Modified: head/sys/x86/x86/identcpu.c Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Thu May 16 01:09:13 2019 (r347638) +++ head/sys/x86/x86/identcpu.c Thu May 16 01:32:54 2019 (r347639) @@ -1365,7 +1365,7 @@ identify_hypervisor(void) vm_guest = VM_GUEST_HV; else if (strcmp(hv_vendor, "KVMKVMKVM") == 0) vm_guest = VM_GUEST_KVM; - else if (strcmp(hv_vendor, "bhyve bhyve") == 0) + else if (strcmp(hv_vendor, "bhyve bhyve ") == 0) vm_guest = VM_GUEST_BHYVE; } return; From owner-svn-src-head@freebsd.org Thu May 16 02:11:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7FA215A94C1; Thu, 16 May 2019 02:11:34 +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 8EC54837B8; Thu, 16 May 2019 02:11:34 +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 600271A577; Thu, 16 May 2019 02:11:34 +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 x4G2BYCt016560; Thu, 16 May 2019 02:11:34 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4G2BY5u016559; Thu, 16 May 2019 02:11:34 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905160211.x4G2BY5u016559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 16 May 2019 02:11:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347640 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 347640 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8EC54837B8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Thu, 16 May 2019 02:11:35 -0000 Author: kevans Date: Thu May 16 02:11:33 2019 New Revision: 347640 URL: https://svnweb.freebsd.org/changeset/base/347640 Log: libbe(3): Descend into children of datasets w/ mountpoint=none These datasets will generally be canmount=noauto,mountpoint=none (e.g. zroot/var) but have children that may need to be mounted. Instead of skipping that segment for no good reason, descend. Submitted by: Wes Maag Reported by: Wes Maag MFC after: 3 days Modified: head/lib/libbe/be_access.c Modified: head/lib/libbe/be_access.c ============================================================================== --- head/lib/libbe/be_access.c Thu May 16 01:32:54 2019 (r347639) +++ head/lib/libbe/be_access.c Thu May 16 02:11:33 2019 (r347640) @@ -99,13 +99,12 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) if (strcmp("none", zfs_mnt) == 0) { /* * mountpoint=none; we'll mount it at info->mountpoint assuming - * we're at the root. If we're not at the root... that's less - * than stellar and not entirely sure what to do with that. - * For now, we won't treat it as an error condition -- we just - * won't mount it, and we'll continue on. + * we're at the root. If we're not at the root, we're likely + * at some intermediate dataset (e.g. zroot/var) that will have + * children that may need to be mounted. */ if (info->depth > 0) - return (0); + goto skipmount; snprintf(tmp, BE_MAXPATHLEN, "%s", info->mountpoint); } else { @@ -136,6 +135,7 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) if (!info->deepmount) return (0); +skipmount: ++info->depth; err = zfs_iter_filesystems(zfs_hdl, be_mount_iter, info); --info->depth; From owner-svn-src-head@freebsd.org Thu May 16 02:18:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BADD215A96C7; Thu, 16 May 2019 02:18:58 +0000 (UTC) (envelope-from kp@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 5CF9E839E0; Thu, 16 May 2019 02:18:58 +0000 (UTC) (envelope-from kp@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 363B51A5B5; Thu, 16 May 2019 02:18:58 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4G2IvFY017606; Thu, 16 May 2019 02:18:57 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4G2IvQT017605; Thu, 16 May 2019 02:18:57 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201905160218.x4G2IvQT017605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 16 May 2019 02:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347641 - head/tests/sys/netipsec/tunnel X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netipsec/tunnel X-SVN-Commit-Revision: 347641 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5CF9E839E0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 16 May 2019 02:18:58 -0000 Author: kp Date: Thu May 16 02:18:57 2019 New Revision: 347641 URL: https://svnweb.freebsd.org/changeset/base/347641 Log: ipsec tests: Skip if ipsec.ko is not loaded As of r347410 IPSec is no longer built into GENERIC. The ipsec.ko module must be loaded before we can execute the IPSec tests. Check this, and skip the tests if IPSec is not available. Modified: head/tests/sys/netipsec/tunnel/utils.subr Modified: head/tests/sys/netipsec/tunnel/utils.subr ============================================================================== --- head/tests/sys/netipsec/tunnel/utils.subr Thu May 16 02:11:33 2019 (r347640) +++ head/tests/sys/netipsec/tunnel/utils.subr Thu May 16 02:18:57 2019 (r347641) @@ -8,6 +8,10 @@ ist_init() { + if ! sysctl -q kern.features.ipsec >/dev/null ; then + atf_skip "This test requires ipsec" + fi + vnet_init } From owner-svn-src-head@freebsd.org Thu May 16 02:41:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8464915A9EDE; Thu, 16 May 2019 02:41:26 +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 2629D8467E; Thu, 16 May 2019 02:41:26 +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 03AA11AA5A; Thu, 16 May 2019 02:41:26 +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 x4G2fPJu028414; Thu, 16 May 2019 02:41:25 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4G2fPaI028413; Thu, 16 May 2019 02:41:25 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905160241.x4G2fPaI028413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 16 May 2019 02:41:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347642 - head/contrib/wpa/wpa_supplicant X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/wpa/wpa_supplicant X-SVN-Commit-Revision: 347642 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2629D8467E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 16 May 2019 02:41:26 -0000 Author: cy Date: Thu May 16 02:41:25 2019 New Revision: 347642 URL: https://svnweb.freebsd.org/changeset/base/347642 Log: The driver list prints "(null)" for the NDIS driver when -h (help) or an unknown switch is passed outputting the command usage. This is because the NDIS driver is uninitialized when usage help is printed. To resolve this we initialize the driver prior to the possibility of printing the usage help message. Obtained from: The wpa_supplicant port MFC after: 1 week Modified: head/contrib/wpa/wpa_supplicant/main.c head/contrib/wpa/wpa_supplicant/wpa_supplicant.c Modified: head/contrib/wpa/wpa_supplicant/main.c ============================================================================== --- head/contrib/wpa/wpa_supplicant/main.c Thu May 16 02:18:57 2019 (r347641) +++ head/contrib/wpa/wpa_supplicant/main.c Thu May 16 02:41:25 2019 (r347642) @@ -199,6 +199,11 @@ int main(int argc, char *argv[]) wpa_supplicant_fd_workaround(1); +#ifdef CONFIG_DRIVER_NDIS + void driver_ndis_init_ops(void); + driver_ndis_init_ops(); +#endif /* CONFIG_DRIVER_NDIS */ + for (;;) { c = getopt(argc, argv, "b:Bc:C:D:de:f:g:G:hi:I:KLMm:No:O:p:P:qsTtuvW"); Modified: head/contrib/wpa/wpa_supplicant/wpa_supplicant.c ============================================================================== --- head/contrib/wpa/wpa_supplicant/wpa_supplicant.c Thu May 16 02:18:57 2019 (r347641) +++ head/contrib/wpa/wpa_supplicant/wpa_supplicant.c Thu May 16 02:41:25 2019 (r347642) @@ -6357,13 +6357,6 @@ struct wpa_global * wpa_supplicant_init(struct wpa_par if (params == NULL) return NULL; -#ifdef CONFIG_DRIVER_NDIS - { - void driver_ndis_init_ops(void); - driver_ndis_init_ops(); - } -#endif /* CONFIG_DRIVER_NDIS */ - #ifndef CONFIG_NO_WPA_MSG wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); #endif /* CONFIG_NO_WPA_MSG */ From owner-svn-src-head@freebsd.org Thu May 16 04:24:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36D5615AC9F5; Thu, 16 May 2019 04:24:10 +0000 (UTC) (envelope-from rlibby@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 CF39488A95; Thu, 16 May 2019 04:24:09 +0000 (UTC) (envelope-from rlibby@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 A133B1BC43; Thu, 16 May 2019 04:24:09 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4G4O9IM086585; Thu, 16 May 2019 04:24:09 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4G4O9LF086581; Thu, 16 May 2019 04:24:09 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201905160424.x4G4O9LF086581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Thu, 16 May 2019 04:24:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347645 - head/sys/x86/iommu X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/x86/iommu X-SVN-Commit-Revision: 347645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CF39488A95 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 16 May 2019 04:24:10 -0000 Author: rlibby Date: Thu May 16 04:24:08 2019 New Revision: 347645 URL: https://svnweb.freebsd.org/changeset/base/347645 Log: iommu static analysis cleanup A static analyzer complained about a couple instances of checking a variable against NULL after already having dereferenced it. - dmar_gas_alloc_region: remove the tautological NULL checks - dmar_release_resources / dmar_fini_fault_log: don't deref unit->regs unless initialized. And while here, fix an inverted initialization check in dmar_fini_qi. Reviewed by: kib Sponsored by: Dell EMC Isilon Differential revision: https://reviews.freebsd.org/D20263 Modified: head/sys/x86/iommu/intel_fault.c head/sys/x86/iommu/intel_gas.c head/sys/x86/iommu/intel_qi.c Modified: head/sys/x86/iommu/intel_fault.c ============================================================================== --- head/sys/x86/iommu/intel_fault.c Thu May 16 03:30:36 2019 (r347644) +++ head/sys/x86/iommu/intel_fault.c Thu May 16 04:24:08 2019 (r347645) @@ -291,12 +291,12 @@ void dmar_fini_fault_log(struct dmar_unit *unit) { + if (unit->fault_taskqueue == NULL) + return; + DMAR_LOCK(unit); dmar_disable_fault_intr(unit); DMAR_UNLOCK(unit); - - if (unit->fault_taskqueue == NULL) - return; taskqueue_drain(unit->fault_taskqueue, &unit->fault_task); taskqueue_free(unit->fault_taskqueue); Modified: head/sys/x86/iommu/intel_gas.c ============================================================================== --- head/sys/x86/iommu/intel_gas.c Thu May 16 03:30:36 2019 (r347644) +++ head/sys/x86/iommu/intel_gas.c Thu May 16 04:24:08 2019 (r347645) @@ -546,7 +546,7 @@ dmar_gas_alloc_region(struct dmar_domain *domain, stru return (EBUSY); entry->start = prev->end; } - if (next != NULL && next->start < entry->end && + if (next->start < entry->end && (next->flags & DMAR_MAP_ENTRY_PLACE) == 0) { if ((next->flags & DMAR_MAP_ENTRY_RMRR) == 0) return (EBUSY); @@ -560,7 +560,7 @@ dmar_gas_alloc_region(struct dmar_domain *domain, stru dmar_gas_rb_remove(domain, prev); prev = NULL; } - if (next != NULL && next->start < entry->end) { + if (next->start < entry->end) { dmar_gas_rb_remove(domain, next); next = NULL; } Modified: head/sys/x86/iommu/intel_qi.c ============================================================================== --- head/sys/x86/iommu/intel_qi.c Thu May 16 03:30:36 2019 (r347644) +++ head/sys/x86/iommu/intel_qi.c Thu May 16 04:24:08 2019 (r347645) @@ -425,7 +425,7 @@ dmar_fini_qi(struct dmar_unit *unit) { struct dmar_qi_genseq gseq; - if (unit->qi_enabled) + if (!unit->qi_enabled) return; taskqueue_drain(unit->qi_taskqueue, &unit->qi_task); taskqueue_free(unit->qi_taskqueue); From owner-svn-src-head@freebsd.org Thu May 16 05:29:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFCC815AD6E7; Thu, 16 May 2019 05:29:55 +0000 (UTC) (envelope-from rlibby@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 74EF78A0FC; Thu, 16 May 2019 05:29:55 +0000 (UTC) (envelope-from rlibby@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 630FA1C65D; Thu, 16 May 2019 05:29:55 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4G5Tt8Y017968; Thu, 16 May 2019 05:29:55 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4G5Ttk2017967; Thu, 16 May 2019 05:29:55 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201905160529.x4G5Ttk2017967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Thu, 16 May 2019 05:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347646 - head/sys/ddb X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/ddb X-SVN-Commit-Revision: 347646 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 74EF78A0FC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Thu, 16 May 2019 05:29:56 -0000 Author: rlibby Date: Thu May 16 05:29:54 2019 New Revision: 347646 URL: https://svnweb.freebsd.org/changeset/base/347646 Log: db show thread: avoid overflow in tick conversion The previous calculations for displaying the time since last switch easily overflowed, after less than 36 min for hz=1000. Now overflow takes 2000 times longer (as long as ticks takes to wrap). Reviewed by: cem, markj Sponsored by: Dell EMC Isilon Differential revision: https://reviews.freebsd.org/D20273 Modified: head/sys/ddb/db_ps.c Modified: head/sys/ddb/db_ps.c ============================================================================== --- head/sys/ddb/db_ps.c Thu May 16 04:24:08 2019 (r347645) +++ head/sys/ddb/db_ps.c Thu May 16 05:29:54 2019 (r347646) @@ -338,8 +338,8 @@ DB_SHOW_COMMAND(thread, db_show_thread) { struct thread *td; struct lock_object *lock; + u_int delta; bool comma; - int delta; /* Determine which thread to examine. */ if (have_addr) @@ -421,14 +421,14 @@ DB_SHOW_COMMAND(thread, db_show_thread) db_printf(" priority: %d\n", td->td_priority); db_printf(" container lock: %s (%p)\n", lock->lo_name, lock); if (td->td_swvoltick != 0) { - delta = (u_int)ticks - (u_int)td->td_swvoltick; - db_printf(" last voluntary switch: %d ms ago\n", - 1000 * delta / hz); + delta = ticks - td->td_swvoltick; + db_printf(" last voluntary switch: %u.%03u s ago\n", + delta / hz, (delta % hz) * 1000 / hz); } if (td->td_swinvoltick != 0) { - delta = (u_int)ticks - (u_int)td->td_swinvoltick; - db_printf(" last involuntary switch: %d ms ago\n", - 1000 * delta / hz); + delta = ticks - td->td_swinvoltick; + db_printf(" last involuntary switch: %u.%03u s ago\n", + delta / hz, (delta % hz) * 1000 / hz); } } From owner-svn-src-head@freebsd.org Thu May 16 09:49:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6039158F50B; Thu, 16 May 2019 09:49:20 +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 893846DA73; Thu, 16 May 2019 09:49:20 +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 62F8B1F1B3; Thu, 16 May 2019 09:49:20 +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 x4G9nKYl057081; Thu, 16 May 2019 09:49:20 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4G9nKoI057080; Thu, 16 May 2019 09:49:20 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905160949.x4G9nKoI057080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 16 May 2019 09:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347682 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 347682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 893846DA73 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Thu, 16 May 2019 09:49:21 -0000 Author: trasz Date: Thu May 16 09:49:19 2019 New Revision: 347682 URL: https://svnweb.freebsd.org/changeset/base/347682 Log: The "apropos ''" command no longer works; change development(7) to suggest "apropos ." instead. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/share/man/man7/development.7 Modified: head/share/man/man7/development.7 ============================================================================== --- head/share/man/man7/development.7 Thu May 16 09:33:38 2019 (r347681) +++ head/share/man/man7/development.7 Thu May 16 09:49:19 2019 (r347682) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 6, 2018 +.Dd May 16, 2019 .Dt DEVELOPMENT 7 .Os .Sh NAME @@ -83,7 +83,7 @@ and .Xr release 7 . Kernel programming interfaces (KPIs) are documented in section 9 manual pages; use -.Ql "apropos -s 9 ''" +.Ql "apropos -s 9 ." for a list. Regression test suite is described in .Xr tests 7 . From owner-svn-src-head@freebsd.org Thu May 16 13:00:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2849015958DC; Thu, 16 May 2019 13:00:36 +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 C266274B94; Thu, 16 May 2019 13:00:35 +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 9B95C211C3; Thu, 16 May 2019 13:00:35 +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 x4GD0ZSN056080; Thu, 16 May 2019 13:00:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GD0Z3f056079; Thu, 16 May 2019 13:00:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905161300.x4GD0Z3f056079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 16 May 2019 13:00:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347689 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 347689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C266274B94 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 16 May 2019 13:00:36 -0000 Author: kib Date: Thu May 16 13:00:35 2019 New Revision: 347689 URL: https://svnweb.freebsd.org/changeset/base/347689 Log: arm64: bzero buffer for ucontext in freebsd32_swapcontext(). This change is the same as r340994 for amd64. PR: 237922 Submitted by: Young MFC after: 3 days Modified: head/sys/arm64/arm64/freebsd32_machdep.c Modified: head/sys/arm64/arm64/freebsd32_machdep.c ============================================================================== --- head/sys/arm64/arm64/freebsd32_machdep.c Thu May 16 11:20:02 2019 (r347688) +++ head/sys/arm64/arm64/freebsd32_machdep.c Thu May 16 13:00:35 2019 (r347689) @@ -284,6 +284,7 @@ freebsd32_swapcontext(struct thread *td, struct freebs if (uap->oucp == NULL || uap->ucp == NULL) ret = EINVAL; else { + bzero(&uc, sizeof(uc)); get_mcontext32(td, &uc.uc_mcontext, GET_MC_CLEAR_RET); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; From owner-svn-src-head@freebsd.org Thu May 16 13:03:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C28761595D46; Thu, 16 May 2019 13:03:55 +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 66FF6751DC; Thu, 16 May 2019 13:03:55 +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 434592135E; Thu, 16 May 2019 13:03:55 +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 x4GD3tLT061070; Thu, 16 May 2019 13:03:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GD3tT2061069; Thu, 16 May 2019 13:03:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905161303.x4GD3tT2061069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 16 May 2019 13:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347690 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347690 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 66FF6751DC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 16 May 2019 13:03:55 -0000 Author: kib Date: Thu May 16 13:03:54 2019 New Revision: 347690 URL: https://svnweb.freebsd.org/changeset/base/347690 Log: imgact_elf.c: Add comment explaining the malloc/VOP_UNLOCK() dance from r347148. Requested by: alc Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Thu May 16 13:00:35 2019 (r347689) +++ head/sys/kern/imgact_elf.c Thu May 16 13:03:54 2019 (r347690) @@ -935,12 +935,22 @@ __elfN(get_interp)(struct image_params *imgp, const El interp_name_len = phdr->p_filesz; if (phdr->p_offset > PAGE_SIZE || interp_name_len > PAGE_SIZE - phdr->p_offset) { + /* + * The vnode lock might be needed by pagedaemon to + * clean pages owned by the vnode. Do not allow sleep + * waiting for memory with the vnode locked, instead + * try non-sleepable allocation first, and if it + * fails, go to the slow path were we drop the lock + * and do M_WAITOK. Text reference prevents + * modifications of the vnode content. + */ interp = malloc(interp_name_len + 1, M_TEMP, M_NOWAIT); if (interp == NULL) { VOP_UNLOCK(imgp->vp, 0); interp = malloc(interp_name_len + 1, M_TEMP, M_WAITOK); vn_lock(imgp->vp, LK_SHARED | LK_RETRY); } + error = vn_rdwr(UIO_READ, imgp->vp, interp, interp_name_len, phdr->p_offset, UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, From owner-svn-src-head@freebsd.org Thu May 16 13:04:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 334BD1595DD6; Thu, 16 May 2019 13:04:28 +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 9B1C77532D; Thu, 16 May 2019 13:04: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 44CB12135F; Thu, 16 May 2019 13:04: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 x4GD4R82061150; Thu, 16 May 2019 13:04:27 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GD4QYU061147; Thu, 16 May 2019 13:04:26 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905161304.x4GD4QYU061147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 16 May 2019 13:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347691 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 347691 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9B1C77532D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 16 May 2019 13:04:28 -0000 Author: markj Date: Thu May 16 13:04:26 2019 New Revision: 347691 URL: https://svnweb.freebsd.org/changeset/base/347691 Log: Revert r347582 for now. The inp lock still needs to be dropped when calling into the driver ioctl handler, as some drivers expect to be able to sleep. Reported by: kib Modified: head/sys/netinet/in_mcast.c head/sys/netinet6/in6_mcast.c Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Thu May 16 13:03:54 2019 (r347690) +++ head/sys/netinet/in_mcast.c Thu May 16 13:04:26 2019 (r347691) @@ -1534,7 +1534,6 @@ inp_block_unblock_source(struct inpcb *inp, struct soc /* * Check if we are actually a member of this group. */ - IN_MULTI_LOCK(); imo = inp_findmoptions(inp); idx = imo_match_group(imo, ifp, &gsa->sa); if (idx == -1 || imo->imo_mfilters == NULL) { @@ -1594,13 +1593,14 @@ inp_block_unblock_source(struct inpcb *inp, struct soc /* * Begin state merge transaction at IGMP layer. */ + IN_MULTI_LOCK(); CTR1(KTR_IGMPV3, "%s: merge inm state", __func__); IN_MULTI_LIST_LOCK(); error = inm_merge(inm, imf); if (error) { CTR1(KTR_IGMPV3, "%s: failed to merge inm state", __func__); IN_MULTI_LIST_UNLOCK(); - goto out_imf_rollback; + goto out_in_multi_locked; } CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__); @@ -1609,6 +1609,9 @@ inp_block_unblock_source(struct inpcb *inp, struct soc if (error) CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__); +out_in_multi_locked: + + IN_MULTI_UNLOCK(); out_imf_rollback: if (error) imf_rollback(imf); @@ -1619,7 +1622,6 @@ out_imf_rollback: out_inp_locked: INP_WUNLOCK(inp); - IN_MULTI_UNLOCK(); return (error); } @@ -1678,10 +1680,10 @@ inp_findmoptions(struct inpcb *inp) static void inp_gcmoptions(struct ip_moptions *imo) { - struct in_mfilter *imf; + struct in_mfilter *imf; struct in_multi *inm; struct ifnet *ifp; - size_t idx, nmships; + size_t idx, nmships; nmships = imo->imo_num_memberships; for (idx = 0; idx < nmships; ++idx) { @@ -2140,12 +2142,12 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt CTR2(KTR_IGMPV3, "%s: unknown sopt_name %d", __func__, sopt->sopt_name); return (EOPNOTSUPP); + break; } if (ifp == NULL || (ifp->if_flags & IFF_MULTICAST) == 0) return (EADDRNOTAVAIL); - IN_MULTI_LOCK(); imo = inp_findmoptions(inp); idx = imo_match_group(imo, ifp, &gsa->sa); if (idx == -1) { @@ -2270,6 +2272,10 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt /* * Begin state merge transaction at IGMP layer. */ + in_pcbref(inp); + INP_WUNLOCK(inp); + IN_MULTI_LOCK(); + if (is_new) { error = in_joingroup_locked(ifp, &gsa->sin.sin_addr, imf, &inm); @@ -2280,8 +2286,6 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt goto out_imo_free; } inm_acquire(inm); - KASSERT(imo->imo_membership[idx] == NULL, - ("%s: imo_membership already allocated", __func__)); imo->imo_membership[idx] = inm; } else { CTR1(KTR_IGMPV3, "%s: merge inm state", __func__); @@ -2291,7 +2295,7 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt CTR1(KTR_IGMPV3, "%s: failed to merge inm state", __func__); IN_MULTI_LIST_UNLOCK(); - goto out_imf_rollback; + goto out_in_multi_locked; } CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__); error = igmp_change_state(inm); @@ -2299,11 +2303,16 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt if (error) { CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__); - goto out_imf_rollback; + goto out_in_multi_locked; } } -out_imf_rollback: +out_in_multi_locked: + + IN_MULTI_UNLOCK(); + INP_WLOCK(inp); + if (in_pcbrele_wlocked(inp)) + return (ENXIO); if (error) { imf_rollback(imf); if (is_new) @@ -2328,7 +2337,6 @@ out_imo_free: out_inp_locked: INP_WUNLOCK(inp); - IN_MULTI_UNLOCK(); return (error); } @@ -2455,7 +2463,6 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop /* * Find the membership in the membership array. */ - IN_MULTI_LOCK(); imo = inp_findmoptions(inp); idx = imo_match_group(imo, ifp, &gsa->sa); if (idx == -1) { @@ -2503,6 +2510,9 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop /* * Begin state merge transaction at IGMP layer. */ + in_pcbref(inp); + INP_WUNLOCK(inp); + IN_MULTI_LOCK(); if (is_final) { /* @@ -2518,7 +2528,7 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop CTR1(KTR_IGMPV3, "%s: failed to merge inm state", __func__); IN_MULTI_LIST_UNLOCK(); - goto out_imf_rollback; + goto out_in_multi_locked; } CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__); @@ -2530,7 +2540,13 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop } } -out_imf_rollback: +out_in_multi_locked: + + IN_MULTI_UNLOCK(); + INP_WLOCK(inp); + if (in_pcbrele_wlocked(inp)) + return (ENXIO); + if (error) imf_rollback(imf); else @@ -2541,7 +2557,7 @@ out_imf_rollback: if (is_final) { /* Remove the gap in the membership and filter array. */ KASSERT(RB_EMPTY(&imf->imf_sources), - ("%s: imf_sources (%p %p %zu) not empty", __func__, imf, imo, idx)); + ("%s: imf_sources not empty", __func__)); for (++idx; idx < imo->imo_num_memberships; ++idx) { imo->imo_membership[idx - 1] = imo->imo_membership[idx]; imo->imo_mfilters[idx - 1] = imo->imo_mfilters[idx]; @@ -2553,7 +2569,6 @@ out_imf_rollback: out_inp_locked: INP_WUNLOCK(inp); - IN_MULTI_UNLOCK(); return (error); } @@ -2631,6 +2646,8 @@ inp_set_multicast_if(struct inpcb *inp, struct sockopt /* * Atomically set source filters on a socket for an IPv4 multicast group. + * + * SMPng: NOTE: Potentially calls malloc(M_WAITOK) with Giant held. */ static int inp_set_source_filters(struct inpcb *inp, struct sockopt *sopt) @@ -2677,7 +2694,6 @@ inp_set_source_filters(struct inpcb *inp, struct socko * Take the INP write lock. * Check if this socket is a member of this group. */ - IN_MULTI_LOCK(); imo = inp_findmoptions(inp); idx = imo_match_group(imo, ifp, &gsa->sa); if (idx == -1 || imo->imo_mfilters == NULL) { @@ -2762,6 +2778,7 @@ inp_set_source_filters(struct inpcb *inp, struct socko goto out_imf_rollback; INP_WLOCK_ASSERT(inp); + IN_MULTI_LOCK(); /* * Begin state merge transaction at IGMP layer. @@ -2772,7 +2789,7 @@ inp_set_source_filters(struct inpcb *inp, struct socko if (error) { CTR1(KTR_IGMPV3, "%s: failed to merge inm state", __func__); IN_MULTI_LIST_UNLOCK(); - goto out_imf_rollback; + goto out_in_multi_locked; } CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__); @@ -2781,6 +2798,10 @@ inp_set_source_filters(struct inpcb *inp, struct socko if (error) CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__); +out_in_multi_locked: + + IN_MULTI_UNLOCK(); + out_imf_rollback: if (error) imf_rollback(imf); @@ -2791,7 +2812,6 @@ out_imf_rollback: out_inp_locked: INP_WUNLOCK(inp); - IN_MULTI_UNLOCK(); return (error); } Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Thu May 16 13:03:54 2019 (r347690) +++ head/sys/netinet6/in6_mcast.c Thu May 16 13:04:26 2019 (r347691) @@ -2052,7 +2052,6 @@ in6p_join_group(struct inpcb *inp, struct sockopt *sop */ (void)in6_setscope(&gsa->sin6.sin6_addr, ifp, NULL); - IN6_MULTI_LOCK(); imo = in6p_findmoptions(inp); idx = im6o_match_group(imo, ifp, &gsa->sa); if (idx == -1) { @@ -2172,6 +2171,10 @@ in6p_join_group(struct inpcb *inp, struct sockopt *sop /* * Begin state merge transaction at MLD layer. */ + in_pcbref(inp); + INP_WUNLOCK(inp); + IN6_MULTI_LOCK(); + if (is_new) { error = in6_joingroup_locked(ifp, &gsa->sin6.sin6_addr, imf, &inm, 0); @@ -2201,6 +2204,10 @@ in6p_join_group(struct inpcb *inp, struct sockopt *sop IN6_MULTI_LIST_UNLOCK(); } + IN6_MULTI_UNLOCK(); + INP_WLOCK(inp); + if (in_pcbrele_wlocked(inp)) + return (ENXIO); if (error) { im6f_rollback(imf); if (is_new) @@ -2225,7 +2232,6 @@ out_im6o_free: out_in6p_locked: INP_WUNLOCK(inp); - IN6_MULTI_UNLOCK(); in6m_release_list_deferred(&inmh); return (error); } @@ -2375,7 +2381,6 @@ in6p_leave_group(struct inpcb *inp, struct sockopt *so /* * Find the membership in the membership array. */ - IN6_MULTI_LOCK(); imo = in6p_findmoptions(inp); idx = im6o_match_group(imo, ifp, &gsa->sa); if (idx == -1) { @@ -2424,6 +2429,10 @@ in6p_leave_group(struct inpcb *inp, struct sockopt *so /* * Begin state merge transaction at MLD layer. */ + in_pcbref(inp); + INP_WUNLOCK(inp); + IN6_MULTI_LOCK(); + if (is_final) { /* * Give up the multicast address record to which @@ -2447,6 +2456,11 @@ in6p_leave_group(struct inpcb *inp, struct sockopt *so IN6_MULTI_LIST_UNLOCK(); } + IN6_MULTI_UNLOCK(); + INP_WLOCK(inp); + if (in_pcbrele_wlocked(inp)) + return (ENXIO); + if (error) im6f_rollback(imf); else @@ -2469,7 +2483,6 @@ in6p_leave_group(struct inpcb *inp, struct sockopt *so out_in6p_locked: INP_WUNLOCK(inp); - IN6_MULTI_UNLOCK(); return (error); } @@ -2515,6 +2528,8 @@ in6p_set_multicast_if(struct inpcb *inp, struct sockop /* * Atomically set source filters on a socket for an IPv6 multicast group. + * + * SMPng: NOTE: Potentially calls malloc(M_WAITOK) with Giant held. */ static int in6p_set_source_filters(struct inpcb *inp, struct sockopt *sopt) From owner-svn-src-head@freebsd.org Thu May 16 13:07:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D60941596072; Thu, 16 May 2019 13:07:27 +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 7C3E775699; Thu, 16 May 2019 13:07:27 +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 4E18A21369; Thu, 16 May 2019 13:07:27 +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 x4GD7Rur061318; Thu, 16 May 2019 13:07:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GD7RVX061317; Thu, 16 May 2019 13:07:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905161307.x4GD7RVX061317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 16 May 2019 13:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347692 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 347692 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7C3E775699 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Thu, 16 May 2019 13:07:28 -0000 Author: kib Date: Thu May 16 13:07:26 2019 New Revision: 347692 URL: https://svnweb.freebsd.org/changeset/base/347692 Log: Remove more dead definitions from rtld_malloc.c after r347019. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/libexec/rtld-elf/rtld_malloc.c Modified: head/libexec/rtld-elf/rtld_malloc.c ============================================================================== --- head/libexec/rtld-elf/rtld_malloc.c Thu May 16 13:04:26 2019 (r347691) +++ head/libexec/rtld-elf/rtld_malloc.c Thu May 16 13:07:26 2019 (r347692) @@ -81,17 +81,13 @@ union overhead { } ovu; #define ov_magic ovu.ovu_magic #define ov_index ovu.ovu_index -#define ov_rmagic ovu.ovu_rmagic -#define ov_size ovu.ovu_size }; static void morecore(int bucket); static int morepages(int n); static int findbucket(union overhead *freep, int srchlen); - #define MAGIC 0xef /* magic # on accounting info */ -#define RMAGIC 0x5555 /* magic # on range info */ /* * nextf[i] is the pointer to the next free block of size 2^(i+3). The From owner-svn-src-head@freebsd.org Thu May 16 13:13:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F32F159657B; Thu, 16 May 2019 13:13:34 +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 E9E1D75C7C; Thu, 16 May 2019 13:13:33 +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 C5D1221509; Thu, 16 May 2019 13:13:33 +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 x4GDDX0Z066176; Thu, 16 May 2019 13:13:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GDDXKA066175; Thu, 16 May 2019 13:13:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905161313.x4GDDXKA066175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 16 May 2019 13:13:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347693 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 347693 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E9E1D75C7C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 16 May 2019 13:13:34 -0000 Author: kib Date: Thu May 16 13:13:33 2019 New Revision: 347693 URL: https://svnweb.freebsd.org/changeset/base/347693 Log: rtld_malloc.c: cleanup morepages(). Use roundup2() and rounddown2() instead of inlining them. Get rid of the fd local variable, use literal -1 for the mmap argument. Use MAP_FAILED as mmap(2) failure indicator. After that, apply some style. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/libexec/rtld-elf/rtld_malloc.c Modified: head/libexec/rtld-elf/rtld_malloc.c ============================================================================== --- head/libexec/rtld-elf/rtld_malloc.c Thu May 16 13:07:26 2019 (r347692) +++ head/libexec/rtld-elf/rtld_malloc.c Thu May 16 13:13:33 2019 (r347693) @@ -345,12 +345,11 @@ findbucket(union overhead *freep, int srchlen) static int morepages(int n) { - int fd = -1; - int offset; + caddr_t addr; + int offset; if (pagepool_end - pagepool_start > pagesz) { - caddr_t addr = (caddr_t) - (((long)pagepool_start + pagesz - 1) & ~(pagesz - 1)); + addr = (caddr_t)roundup2((long)pagepool_start, pagesz); if (munmap(addr, pagepool_end - addr) != 0) { #ifdef IN_RTLD rtld_fdprintf(STDERR_FILENO, _BASENAME_RTLD ": " @@ -360,20 +359,21 @@ morepages(int n) } } - offset = (long)pagepool_start - ((long)pagepool_start & ~(pagesz - 1)); + offset = (long)pagepool_start - rounddown2((long)pagepool_start, + pagesz); - if ((pagepool_start = mmap(0, n * pagesz, - PROT_READ|PROT_WRITE, - MAP_ANON|MAP_PRIVATE, fd, 0)) == (caddr_t)-1) { + pagepool_start = mmap(0, n * pagesz, PROT_READ | PROT_WRITE, + MAP_ANON | MAP_PRIVATE, -1, 0); + if (pagepool_start == MAP_FAILED) { #ifdef IN_RTLD rtld_fdprintf(STDERR_FILENO, _BASENAME_RTLD ": morepages: " "cannot mmap anonymous memory: %s\n", rtld_strerror(errno)); #endif - return 0; + return (0); } pagepool_end = pagepool_start + n * pagesz; pagepool_start += offset; - return n; + return (n); } From owner-svn-src-head@freebsd.org Thu May 16 13:17:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 254D6159668C; Thu, 16 May 2019 13:17:58 +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 BF85A75EB0; Thu, 16 May 2019 13:17:57 +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 97C7B2151F; Thu, 16 May 2019 13:17:57 +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 x4GDHvIw066396; Thu, 16 May 2019 13:17:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GDHvMr066395; Thu, 16 May 2019 13:17:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905161317.x4GDHvMr066395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 16 May 2019 13:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347694 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347694 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF85A75EB0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 16 May 2019 13:17:58 -0000 Author: kib Date: Thu May 16 13:17:57 2019 New Revision: 347694 URL: https://svnweb.freebsd.org/changeset/base/347694 Log: subr_turnstile: Extract some common code to a helper. Code walks the list of contested turnstiles to calculate the priority to unlend. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/subr_turnstile.c Modified: head/sys/kern/subr_turnstile.c ============================================================================== --- head/sys/kern/subr_turnstile.c Thu May 16 13:13:33 2019 (r347693) +++ head/sys/kern/subr_turnstile.c Thu May 16 13:17:57 2019 (r347694) @@ -897,6 +897,24 @@ turnstile_broadcast(struct turnstile *ts, int queue) } } +static u_char +turnstile_calc_unlend_prio_locked(struct thread *td) +{ + struct turnstile *nts; + u_char cp, pri; + + THREAD_LOCK_ASSERT(td, MA_OWNED); + mtx_assert(&td_contested_lock, MA_OWNED); + + pri = PRI_MAX; + LIST_FOREACH(nts, &td->td_contested, ts_link) { + cp = turnstile_first_waiter(nts)->td_priority; + if (cp < pri) + pri = cp; + } + return (pri); +} + /* * Wakeup all threads on the pending list and adjust the priority of the * current thread appropriately. This must be called with the turnstile @@ -906,9 +924,8 @@ void turnstile_unpend(struct turnstile *ts) { TAILQ_HEAD( ,thread) pending_threads; - struct turnstile *nts; struct thread *td; - u_char cp, pri; + u_char pri; MPASS(ts != NULL); mtx_assert(&ts->ts_lock, MA_OWNED); @@ -932,7 +949,6 @@ turnstile_unpend(struct turnstile *ts) * priority however. */ td = curthread; - pri = PRI_MAX; thread_lock(td); mtx_lock_spin(&td_contested_lock); /* @@ -946,11 +962,7 @@ turnstile_unpend(struct turnstile *ts) ts->ts_owner = NULL; LIST_REMOVE(ts, ts_link); } - LIST_FOREACH(nts, &td->td_contested, ts_link) { - cp = turnstile_first_waiter(nts)->td_priority; - if (cp < pri) - pri = cp; - } + pri = turnstile_calc_unlend_prio_locked(td); mtx_unlock_spin(&td_contested_lock); sched_unlend_prio(td, pri); thread_unlock(td); @@ -991,7 +1003,7 @@ void turnstile_disown(struct turnstile *ts) { struct thread *td; - u_char cp, pri; + u_char pri; MPASS(ts != NULL); mtx_assert(&ts->ts_lock, MA_OWNED); @@ -1017,15 +1029,10 @@ turnstile_disown(struct turnstile *ts) * priority however. */ td = curthread; - pri = PRI_MAX; thread_lock(td); mtx_unlock_spin(&ts->ts_lock); mtx_lock_spin(&td_contested_lock); - LIST_FOREACH(ts, &td->td_contested, ts_link) { - cp = turnstile_first_waiter(ts)->td_priority; - if (cp < pri) - pri = cp; - } + pri = turnstile_calc_unlend_prio_locked(td); mtx_unlock_spin(&td_contested_lock); sched_unlend_prio(td, pri); thread_unlock(td); From owner-svn-src-head@freebsd.org Thu May 16 13:18:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B41E61596717; Thu, 16 May 2019 13:18:56 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 4DB5B76014; Thu, 16 May 2019 13:18:56 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [176.74.212.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 7EEBF2603AD; Thu, 16 May 2019 15:18:53 +0200 (CEST) Subject: Re: svn commit: r347691 - in head/sys: netinet netinet6 To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905161304.x4GD4QYU061147@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <77e40f46-28d6-518b-970c-fa69891b6329@selasky.org> Date: Thu, 16 May 2019 15:18:24 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201905161304.x4GD4QYU061147@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DB5B76014 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.87 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.87)[-0.872,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: Thu, 16 May 2019 13:18:56 -0000 On 2019-05-16 15:04, Mark Johnston wrote: > Author: markj > Date: Thu May 16 13:04:26 2019 > New Revision: 347691 > URL: https://svnweb.freebsd.org/changeset/base/347691 > > Log: > Revert r347582 for now. > > The inp lock still needs to be dropped when calling into the driver ioctl > handler, as some drivers expect to be able to sleep. > > Reported by: kib > Hi Mark, May I ask people to not touch *anything* in the multicast code until the following two differential revisions are completed: https://reviews.freebsd.org/D20080 https://reviews.freebsd.org/D20109 --HPS From owner-svn-src-head@freebsd.org Thu May 16 13:28:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A943B15969EB; Thu, 16 May 2019 13:28:50 +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 5A05876516; Thu, 16 May 2019 13:28:50 +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 21E16216DC; Thu, 16 May 2019 13:28:50 +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 x4GDSoUb072077; Thu, 16 May 2019 13:28:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GDSmMd072071; Thu, 16 May 2019 13:28:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905161328.x4GDSmMd072071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 16 May 2019 13:28:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347695 - in head/sys: amd64/amd64 amd64/include kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/include kern X-SVN-Commit-Revision: 347695 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5A05876516 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 16 May 2019 13:28:50 -0000 Author: kib Date: Thu May 16 13:28:48 2019 New Revision: 347695 URL: https://svnweb.freebsd.org/changeset/base/347695 Log: amd64 pmap: rework delayed invalidation, removing global mutex. For machines having cmpxcgh16b instruction, i.e. everything but very early Athlons, provide lockless implementation of delayed invalidation. The implementation maintains lock-less single-linked list with the trick from the T.L. Harris article about volatile mark of the elements being removed. Double-CAS is used to atomically update both link and generation. New thread starting DI appends itself to the end of the queue, setting the generation to the generation of the last element +1. On DI finish, thread donates its generation to the previous element. The generation of the fake head of the list is the last passed DI generation. Basically, the implementation is a queued spinlock but without spinlock. Many thanks both to Peter Holm and Mark Johnson for keeping with me while I produced intermediate versions of the patch. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 month MFC note: td_md.md_invl_gen should go to the end of struct thread Differential revision: https://reviews.freebsd.org/D19630 Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/amd64/trap.c head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/include/pmap.h head/sys/amd64/include/proc.h head/sys/kern/kern_thread.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu May 16 13:17:57 2019 (r347694) +++ head/sys/amd64/amd64/pmap.c Thu May 16 13:28:48 2019 (r347695) @@ -107,6 +107,7 @@ __FBSDID("$FreeBSD$"); * and to when physical maps must be made correct. */ +#include "opt_ddb.h" #include "opt_pmap.h" #include "opt_vm.h" @@ -130,6 +131,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef DDB +#include +#include +#endif #include #include @@ -468,22 +473,46 @@ SYSCTL_PROC(_vm_pmap, OID_AUTO, pcid_save_cnt, CTLTYPE static LIST_HEAD(, pmap_invl_gen) pmap_invl_gen_tracker = LIST_HEAD_INITIALIZER(&pmap_invl_gen_tracker); static struct mtx invl_gen_mtx; -static u_long pmap_invl_gen = 0; /* Fake lock object to satisfy turnstiles interface. */ static struct lock_object invl_gen_ts = { .lo_name = "invlts", }; +static struct pmap_invl_gen pmap_invl_gen_head = { + .gen = 1, + .next = NULL, +}; +static u_long pmap_invl_gen = 1; +#define PMAP_ASSERT_NOT_IN_DI() \ + KASSERT(pmap_not_in_di(), ("DI already started")) + +static bool pmap_not_in_di_l(void); +static bool pmap_not_in_di_u(void); +DEFINE_IFUNC(, bool, pmap_not_in_di, (void), static) +{ + + return ((cpu_feature2 & CPUID2_CX16) == 0 ? pmap_not_in_di_l : + pmap_not_in_di_u); +} + static bool -pmap_not_in_di(void) +pmap_not_in_di_l(void) { + struct pmap_invl_gen *invl_gen; - return (curthread->td_md.md_invl_gen.gen == 0); + invl_gen = &curthread->td_md.md_invl_gen; + return (invl_gen->gen == 0); } -#define PMAP_ASSERT_NOT_IN_DI() \ - KASSERT(pmap_not_in_di(), ("DI already started")) +static void +pmap_thread_init_invl_gen_l(struct thread *td) +{ + struct pmap_invl_gen *invl_gen; + invl_gen = &td->td_md.md_invl_gen; + invl_gen->gen = 0; +} + /* * Start a new Delayed Invalidation (DI) block of code, executed by * the current thread. Within a DI block, the current thread may @@ -493,7 +522,7 @@ pmap_not_in_di(void) * pmap active. */ static void -pmap_delayed_invl_started(void) +pmap_delayed_invl_started_l(void) { struct pmap_invl_gen *invl_gen; u_long currgen; @@ -525,7 +554,7 @@ pmap_delayed_invl_started(void) * current thread's DI. */ static void -pmap_delayed_invl_finished(void) +pmap_delayed_invl_finished_l(void) { struct pmap_invl_gen *invl_gen, *next; struct turnstile *ts; @@ -551,7 +580,285 @@ pmap_delayed_invl_finished(void) invl_gen->gen = 0; } +static bool +pmap_not_in_di_u(void) +{ + struct pmap_invl_gen *invl_gen; + + invl_gen = &curthread->td_md.md_invl_gen; + return (((uintptr_t)invl_gen->next & PMAP_INVL_GEN_NEXT_INVALID) != 0); +} + +static void +pmap_thread_init_invl_gen_u(struct thread *td) +{ + struct pmap_invl_gen *invl_gen; + + invl_gen = &td->td_md.md_invl_gen; + invl_gen->gen = 0; + invl_gen->next = (void *)PMAP_INVL_GEN_NEXT_INVALID; +} + +static bool +pmap_di_load_invl(struct pmap_invl_gen *ptr, struct pmap_invl_gen *out) +{ + uint64_t new_high, new_low, old_high, old_low; + char res; + + old_low = new_low = 0; + old_high = new_high = (uintptr_t)0; + + __asm volatile("lock;cmpxchg16b\t%1;sete\t%0" + : "=r" (res), "+m" (*ptr), "+a" (old_low), "+d" (old_high) + : "b"(new_low), "c" (new_high) + : "memory", "cc"); + if (res == 0) { + if ((old_high & PMAP_INVL_GEN_NEXT_INVALID) != 0) + return (false); + out->gen = old_low; + out->next = (void *)old_high; + } else { + out->gen = new_low; + out->next = (void *)new_high; + } + return (true); +} + +static bool +pmap_di_store_invl(struct pmap_invl_gen *ptr, struct pmap_invl_gen *old_val, + struct pmap_invl_gen *new_val) +{ + uint64_t new_high, new_low, old_high, old_low; + char res; + + new_low = new_val->gen; + new_high = (uintptr_t)new_val->next; + old_low = old_val->gen; + old_high = (uintptr_t)old_val->next; + + __asm volatile("lock;cmpxchg16b\t%1;sete\t%0" + : "=r" (res), "+m" (*ptr), "+a" (old_low), "+d" (old_high) + : "b"(new_low), "c" (new_high) + : "memory", "cc"); + return (res); +} + #ifdef PV_STATS +static long invl_start_restart; +SYSCTL_LONG(_vm_pmap, OID_AUTO, invl_start_restart, CTLFLAG_RD, + &invl_start_restart, 0, + ""); +static long invl_finish_restart; +SYSCTL_LONG(_vm_pmap, OID_AUTO, invl_finish_restart, CTLFLAG_RD, + &invl_finish_restart, 0, + ""); +static int invl_max_qlen; +SYSCTL_INT(_vm_pmap, OID_AUTO, invl_max_qlen, CTLFLAG_RD, + &invl_max_qlen, 0, + ""); +#endif + +static struct lock_delay_config __read_frequently di_delay; +LOCK_DELAY_SYSINIT_DEFAULT(di_delay); + +static void +pmap_delayed_invl_started_u(void) +{ + struct pmap_invl_gen *invl_gen, *p, prev, new_prev; + struct thread *td; + struct lock_delay_arg lda; + uintptr_t prevl; + u_char pri; +#ifdef PV_STATS + int i, ii; +#endif + + td = curthread; + invl_gen = &td->td_md.md_invl_gen; + PMAP_ASSERT_NOT_IN_DI(); + lock_delay_arg_init(&lda, &di_delay); + thread_lock(td); + pri = td->td_base_pri; + if (pri < PVM) { + invl_gen->saved_pri = 0; + } else { + invl_gen->saved_pri = pri; + sched_prio(td, PVM); + } + thread_unlock(td); + +again: + PV_STAT(i = 0); + for (p = &pmap_invl_gen_head;; p = prev.next) { + PV_STAT(i++); + prevl = atomic_load_ptr(&p->next); + if ((prevl & PMAP_INVL_GEN_NEXT_INVALID) != 0) { + PV_STAT(atomic_add_long(&invl_start_restart, 1)); + lock_delay(&lda); + goto again; + } + if (prevl == 0) + break; + prev.next = (void *)prevl; + } +#ifdef PV_STATS + if ((ii = invl_max_qlen) < i) + atomic_cmpset_int(&invl_max_qlen, ii, i); +#endif + + if (!pmap_di_load_invl(p, &prev) || prev.next != NULL) { + PV_STAT(atomic_add_long(&invl_start_restart, 1)); + lock_delay(&lda); + goto again; + } + + new_prev.gen = prev.gen; + new_prev.next = invl_gen; + invl_gen->gen = prev.gen + 1; + + /* Formal fence between store to invl->gen and updating *p. */ + atomic_thread_fence_rel(); + + /* + * After inserting an invl_gen element with invalid bit set, + * this thread blocks any other thread trying to enter the + * delayed invalidation block. Do not allow to remove us from + * the CPU, because it causes starvation for other threads. + */ + critical_enter(); + + /* + * ABA for *p is not possible there, since p->gen can only + * increase. So if the *p thread finished its di, then + * started a new one and got inserted into the list at the + * same place, its gen will appear greater than the previously + * read gen. + */ + if (!pmap_di_store_invl(p, &prev, &new_prev)) { + critical_exit(); + PV_STAT(atomic_add_long(&invl_start_restart, 1)); + lock_delay(&lda); + goto again; + } + + /* + * There we clear PMAP_INVL_GEN_NEXT_INVALID in + * invl_gen->next, allowing other threads to iterate past us. + * pmap_di_store_invl() provides fence between the generation + * write and the update of next. + */ + invl_gen->next = NULL; + critical_exit(); +} + +static bool +pmap_delayed_invl_finished_u_crit(struct pmap_invl_gen *invl_gen, + struct pmap_invl_gen *p) +{ + struct pmap_invl_gen prev, new_prev; + u_long mygen; + + /* + * Load invl_gen->gen after setting invl_gen->next + * PMAP_INVL_GEN_NEXT_INVALID. This prevents larger + * generations to propagate to our invl_gen->gen. Lock prefix + * in atomic_set_ptr() worked as seq_cst fence. + */ + mygen = atomic_load_long(&invl_gen->gen); + + if (!pmap_di_load_invl(p, &prev) || prev.next != invl_gen) + return (false); + + KASSERT(prev.gen < mygen, + ("invalid di gen sequence %lu %lu", prev.gen, mygen)); + new_prev.gen = mygen; + new_prev.next = (void *)((uintptr_t)invl_gen->next & + ~PMAP_INVL_GEN_NEXT_INVALID); + + /* Formal fence between load of prev and storing update to it. */ + atomic_thread_fence_rel(); + + return (pmap_di_store_invl(p, &prev, &new_prev)); +} + +static void +pmap_delayed_invl_finished_u(void) +{ + struct pmap_invl_gen *invl_gen, *p; + struct thread *td; + struct lock_delay_arg lda; + uintptr_t prevl; + + td = curthread; + invl_gen = &td->td_md.md_invl_gen; + KASSERT(invl_gen->gen != 0, ("missed invl_start: gen 0")); + KASSERT(((uintptr_t)invl_gen->next & PMAP_INVL_GEN_NEXT_INVALID) == 0, + ("missed invl_start: INVALID")); + lock_delay_arg_init(&lda, &di_delay); + +again: + for (p = &pmap_invl_gen_head; p != NULL; p = (void *)prevl) { + prevl = atomic_load_ptr(&p->next); + if ((prevl & PMAP_INVL_GEN_NEXT_INVALID) != 0) { + PV_STAT(atomic_add_long(&invl_finish_restart, 1)); + lock_delay(&lda); + goto again; + } + if ((void *)prevl == invl_gen) + break; + } + + /* + * It is legitimate to not find ourself on the list if a + * thread before us finished its DI and started it again. + */ + if (__predict_false(p == NULL)) { + PV_STAT(atomic_add_long(&invl_finish_restart, 1)); + lock_delay(&lda); + goto again; + } + + critical_enter(); + atomic_set_ptr((uintptr_t *)&invl_gen->next, + PMAP_INVL_GEN_NEXT_INVALID); + if (!pmap_delayed_invl_finished_u_crit(invl_gen, p)) { + atomic_clear_ptr((uintptr_t *)&invl_gen->next, + PMAP_INVL_GEN_NEXT_INVALID); + critical_exit(); + PV_STAT(atomic_add_long(&invl_finish_restart, 1)); + lock_delay(&lda); + goto again; + } + critical_exit(); + if (invl_gen->saved_pri != 0) { + thread_lock(td); + sched_prio(td, invl_gen->saved_pri); + thread_unlock(td); + } +} + +#ifdef DDB +DB_SHOW_COMMAND(di_queue, pmap_di_queue) +{ + struct pmap_invl_gen *p, *pn; + struct thread *td; + uintptr_t nextl; + bool first; + + for (p = &pmap_invl_gen_head, first = true; p != NULL; p = pn, + first = false) { + nextl = atomic_load_ptr(&p->next); + pn = (void *)(nextl & ~PMAP_INVL_GEN_NEXT_INVALID); + td = first ? NULL : __containerof(p, struct thread, + td_md.md_invl_gen); + db_printf("gen %lu inv %d td %p tid %d\n", p->gen, + (nextl & PMAP_INVL_GEN_NEXT_INVALID) != 0, td, + td != NULL ? td->td_tid : -1); + } +} +#endif + +#ifdef PV_STATS static long invl_wait; SYSCTL_LONG(_vm_pmap, OID_AUTO, invl_wait, CTLFLAG_RD, &invl_wait, 0, "Number of times DI invalidation blocked pmap_remove_all/write"); @@ -579,7 +886,7 @@ pmap_delayed_invl_genp(vm_page_t m) * processor. */ static void -pmap_delayed_invl_wait(vm_page_t m) +pmap_delayed_invl_wait_l(vm_page_t m) { struct turnstile *ts; u_long *m_gen; @@ -603,6 +910,54 @@ pmap_delayed_invl_wait(vm_page_t m) } } +static void +pmap_delayed_invl_wait_u(vm_page_t m) +{ + u_long *m_gen; +#ifdef PV_STATS + bool accounted = false; +#endif + + m_gen = pmap_delayed_invl_genp(m); + while (*m_gen > atomic_load_long(&pmap_invl_gen_head.gen)) { +#ifdef PV_STATS + if (!accounted) { + atomic_add_long(&invl_wait, 1); + accounted = true; + } +#endif + kern_yield(PRI_USER); + } +} + +DEFINE_IFUNC(, void, pmap_thread_init_invl_gen, (struct thread *), static) +{ + + return ((cpu_feature2 & CPUID2_CX16) == 0 ? + pmap_thread_init_invl_gen_l : pmap_thread_init_invl_gen_u); +} + +DEFINE_IFUNC(static, void, pmap_delayed_invl_started, (void), static) +{ + + return ((cpu_feature2 & CPUID2_CX16) == 0 ? + pmap_delayed_invl_started_l : pmap_delayed_invl_started_u); +} + +DEFINE_IFUNC(static, void, pmap_delayed_invl_finished, (void), static) +{ + + return ((cpu_feature2 & CPUID2_CX16) == 0 ? + pmap_delayed_invl_finished_l : pmap_delayed_invl_finished_u); +} + +DEFINE_IFUNC(static, void, pmap_delayed_invl_wait, (vm_page_t), static) +{ + + return ((cpu_feature2 & CPUID2_CX16) == 0 ? + pmap_delayed_invl_wait_l : pmap_delayed_invl_wait_u); +} + /* * Mark the page m's PV list as participating in the current thread's * DI block. Any threads concurrently using m's PV list to remove or @@ -2854,6 +3209,7 @@ void pmap_pinit0(pmap_t pmap) { struct proc *p; + struct thread *td; int i; PMAP_LOCK_INIT(pmap); @@ -2872,12 +3228,14 @@ pmap_pinit0(pmap_t pmap) pmap->pm_pcids[i].pm_gen = 1; } pmap_activate_boot(pmap); + td = curthread; if (pti) { - p = curproc; + p = td->td_proc; PROC_LOCK(p); p->p_md.md_flags |= P_MD_KPTI; PROC_UNLOCK(p); } + pmap_thread_init_invl_gen(td); if ((cpu_stdext_feature2 & CPUID_STDEXT2_PKU) != 0) { pmap_pkru_ranges_zone = uma_zcreate("pkru ranges", @@ -9327,11 +9685,7 @@ pmap_pkru_clear(pmap_t pmap, vm_offset_t sva, vm_offse return (error); } -#include "opt_ddb.h" #ifdef DDB -#include -#include - DB_SHOW_COMMAND(pte, pmap_print_pte) { pmap_t pmap; Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Thu May 16 13:17:57 2019 (r347694) +++ head/sys/amd64/amd64/trap.c Thu May 16 13:28:48 2019 (r347695) @@ -1183,7 +1183,7 @@ amd64_syscall(struct thread *td, int traced) KASSERT(td->td_pcb->pcb_save == get_pcb_user_save_td(td), ("System call %s returning with mangled pcb_save", syscallname(td->td_proc, td->td_sa.code))); - KASSERT(td->td_md.md_invl_gen.gen == 0, + KASSERT(pmap_not_in_di(), ("System call %s returning with leaked invl_gen %lu", syscallname(td->td_proc, td->td_sa.code), td->td_md.md_invl_gen.gen)); Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Thu May 16 13:17:57 2019 (r347694) +++ head/sys/amd64/amd64/vm_machdep.c Thu May 16 13:28:48 2019 (r347695) @@ -228,7 +228,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct t /* Setup to release spin count in fork_exit(). */ td2->td_md.md_spinlock_count = 1; td2->td_md.md_saved_flags = PSL_KERNEL | PSL_I; - td2->td_md.md_invl_gen.gen = 0; + pmap_thread_init_invl_gen(td2); /* As an i386, do not copy io permission bitmap. */ pcb2->pcb_tssp = NULL; @@ -544,6 +544,7 @@ cpu_copy_thread(struct thread *td, struct thread *td0) /* Setup to release spin count in fork_exit(). */ td->td_md.md_spinlock_count = 1; td->td_md.md_saved_flags = PSL_KERNEL | PSL_I; + pmap_thread_init_invl_gen(td); } /* Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Thu May 16 13:17:57 2019 (r347694) +++ head/sys/amd64/include/pmap.h Thu May 16 13:28:48 2019 (r347695) @@ -441,6 +441,7 @@ void *pmap_mapbios(vm_paddr_t, vm_size_t); void *pmap_mapdev(vm_paddr_t, vm_size_t); void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, int); void *pmap_mapdev_pciecfg(vm_paddr_t pa, vm_size_t size); +bool pmap_not_in_di(void); boolean_t pmap_page_is_mapped(vm_page_t m); void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma); void pmap_pinit_pml4(vm_page_t); @@ -465,6 +466,7 @@ void pmap_pti_pcid_invlrng(uint64_t ucr3, uint64_t kcr int pmap_pkru_clear(pmap_t pmap, vm_offset_t sva, vm_offset_t eva); int pmap_pkru_set(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, u_int keyidx, int flags); +void pmap_thread_init_invl_gen(struct thread *td); int pmap_vmspace_copy(pmap_t dst_pmap, pmap_t src_pmap); #endif /* _KERNEL */ Modified: head/sys/amd64/include/proc.h ============================================================================== --- head/sys/amd64/include/proc.h Thu May 16 13:17:57 2019 (r347694) +++ head/sys/amd64/include/proc.h Thu May 16 13:28:48 2019 (r347695) @@ -50,10 +50,17 @@ struct proc_ldt { int ldt_refcnt; }; +#define PMAP_INVL_GEN_NEXT_INVALID 0x1ULL struct pmap_invl_gen { u_long gen; /* (k) */ - LIST_ENTRY(pmap_invl_gen) link; /* (pp) */ -}; + union { + LIST_ENTRY(pmap_invl_gen) link; /* (pp) */ + struct { + struct pmap_invl_gen *next; + u_char saved_pri; + }; + }; +} __aligned(16); /* * Machine-dependent part of the proc structure for AMD64. Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Thu May 16 13:17:57 2019 (r347694) +++ head/sys/kern/kern_thread.c Thu May 16 13:28:48 2019 (r347695) @@ -84,7 +84,7 @@ _Static_assert(offsetof(struct thread, td_pflags) == 0 "struct thread KBI td_pflags"); _Static_assert(offsetof(struct thread, td_frame) == 0x478, "struct thread KBI td_frame"); -_Static_assert(offsetof(struct thread, td_emuldata) == 0x530, +_Static_assert(offsetof(struct thread, td_emuldata) == 0x548, "struct thread KBI td_emuldata"); _Static_assert(offsetof(struct proc, p_flag) == 0xb0, "struct proc KBI p_flag"); From owner-svn-src-head@freebsd.org Thu May 16 13:40:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6913815970EE; Thu, 16 May 2019 13:40:55 +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 0B8AD76F2D; Thu, 16 May 2019 13:40:55 +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 D8610218B8; Thu, 16 May 2019 13:40: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 x4GDesAa077626; Thu, 16 May 2019 13:40:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GDesKe077625; Thu, 16 May 2019 13:40:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905161340.x4GDesKe077625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 16 May 2019 13:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347696 - 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: 347696 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B8AD76F2D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Thu, 16 May 2019 13:40:55 -0000 Author: kib Date: Thu May 16 13:40:54 2019 New Revision: 347696 URL: https://svnweb.freebsd.org/changeset/base/347696 Log: amd64 pmap: Rename DI functions. pmap_delayed_invl_started -> pmap_delayed_invl_start pmap_delayed_invl_finished -> pmap_delayed_invl_finish Requested by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 month Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu May 16 13:28:48 2019 (r347695) +++ head/sys/amd64/amd64/pmap.c Thu May 16 13:40:54 2019 (r347696) @@ -522,7 +522,7 @@ pmap_thread_init_invl_gen_l(struct thread *td) * pmap active. */ static void -pmap_delayed_invl_started_l(void) +pmap_delayed_invl_start_l(void) { struct pmap_invl_gen *invl_gen; u_long currgen; @@ -554,13 +554,13 @@ pmap_delayed_invl_started_l(void) * current thread's DI. */ static void -pmap_delayed_invl_finished_l(void) +pmap_delayed_invl_finish_l(void) { struct pmap_invl_gen *invl_gen, *next; struct turnstile *ts; invl_gen = &curthread->td_md.md_invl_gen; - KASSERT(invl_gen->gen != 0, ("missed invl_started")); + KASSERT(invl_gen->gen != 0, ("missed invl_start")); mtx_lock(&invl_gen_mtx); next = LIST_NEXT(invl_gen, link); if (next == NULL) { @@ -662,7 +662,7 @@ static struct lock_delay_config __read_frequently di_d LOCK_DELAY_SYSINIT_DEFAULT(di_delay); static void -pmap_delayed_invl_started_u(void) +pmap_delayed_invl_start_u(void) { struct pmap_invl_gen *invl_gen, *p, prev, new_prev; struct thread *td; @@ -752,7 +752,7 @@ again: } static bool -pmap_delayed_invl_finished_u_crit(struct pmap_invl_gen *invl_gen, +pmap_delayed_invl_finish_u_crit(struct pmap_invl_gen *invl_gen, struct pmap_invl_gen *p) { struct pmap_invl_gen prev, new_prev; @@ -782,7 +782,7 @@ pmap_delayed_invl_finished_u_crit(struct pmap_invl_gen } static void -pmap_delayed_invl_finished_u(void) +pmap_delayed_invl_finish_u(void) { struct pmap_invl_gen *invl_gen, *p; struct thread *td; @@ -821,7 +821,7 @@ again: critical_enter(); atomic_set_ptr((uintptr_t *)&invl_gen->next, PMAP_INVL_GEN_NEXT_INVALID); - if (!pmap_delayed_invl_finished_u_crit(invl_gen, p)) { + if (!pmap_delayed_invl_finish_u_crit(invl_gen, p)) { atomic_clear_ptr((uintptr_t *)&invl_gen->next, PMAP_INVL_GEN_NEXT_INVALID); critical_exit(); @@ -937,18 +937,18 @@ DEFINE_IFUNC(, void, pmap_thread_init_invl_gen, (struc pmap_thread_init_invl_gen_l : pmap_thread_init_invl_gen_u); } -DEFINE_IFUNC(static, void, pmap_delayed_invl_started, (void), static) +DEFINE_IFUNC(static, void, pmap_delayed_invl_start, (void), static) { return ((cpu_feature2 & CPUID2_CX16) == 0 ? - pmap_delayed_invl_started_l : pmap_delayed_invl_started_u); + pmap_delayed_invl_start_l : pmap_delayed_invl_start_u); } -DEFINE_IFUNC(static, void, pmap_delayed_invl_finished, (void), static) +DEFINE_IFUNC(static, void, pmap_delayed_invl_finish, (void), static) { return ((cpu_feature2 & CPUID2_CX16) == 0 ? - pmap_delayed_invl_finished_l : pmap_delayed_invl_finished_u); + pmap_delayed_invl_finish_l : pmap_delayed_invl_finish_u); } DEFINE_IFUNC(static, void, pmap_delayed_invl_wait, (vm_page_t), static) @@ -967,7 +967,7 @@ DEFINE_IFUNC(static, void, pmap_delayed_invl_wait, (vm * The function works by setting the DI generation number for m's PV * list to at least the DI generation number of the current thread. * This forces a caller of pmap_delayed_invl_wait() to block until - * current thread calls pmap_delayed_invl_finished(). + * current thread calls pmap_delayed_invl_finish(). */ static void pmap_delayed_invl_page(vm_page_t m) @@ -3793,7 +3793,7 @@ reclaim_pv_chunk_leave_pmap(pmap_t pmap, pmap_t locked if (pmap != locked_pmap) PMAP_UNLOCK(pmap); if (start_di) - pmap_delayed_invl_finished(); + pmap_delayed_invl_finish(); } /* @@ -3876,13 +3876,13 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l RELEASE_PV_LIST_LOCK(lockp); PMAP_LOCK(pmap); if (start_di) - pmap_delayed_invl_started(); + pmap_delayed_invl_start(); mtx_lock(&pv_chunks_mutex); continue; } else if (pmap != locked_pmap) { if (PMAP_TRYLOCK(pmap)) { if (start_di) - pmap_delayed_invl_started(); + pmap_delayed_invl_start(); mtx_lock(&pv_chunks_mutex); continue; } else { @@ -3895,7 +3895,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l goto next_chunk; } } else if (start_di) - pmap_delayed_invl_started(); + pmap_delayed_invl_start(); PG_G = pmap_global_bit(pmap); PG_A = pmap_accessed_bit(pmap); PG_M = pmap_modified_bit(pmap); @@ -4814,7 +4814,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t anyvalid = 0; SLIST_INIT(&free); - pmap_delayed_invl_started(); + pmap_delayed_invl_start(); PMAP_LOCK(pmap); /* @@ -4911,7 +4911,7 @@ out: pmap_invalidate_all(pmap); pmap_pkru_on_remove(pmap, sva, eva); PMAP_UNLOCK(pmap); - pmap_delayed_invl_finished(); + pmap_delayed_invl_finish(); vm_page_free_pages_toq(&free, true); } @@ -5095,8 +5095,8 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t /* * Although this function delays and batches the invalidation * of stale TLB entries, it does not need to call - * pmap_delayed_invl_started() and - * pmap_delayed_invl_finished(), because it does not + * pmap_delayed_invl_start() and + * pmap_delayed_invl_finish(), because it does not * ordinarily destroy mappings. Stale TLB entries from * protection-only changes need only be invalidated before the * pmap lock is released, because protection-only changes do @@ -5725,11 +5725,11 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t if ((oldpde & PG_G) == 0) pmap_invalidate_pde_page(pmap, va, oldpde); } else { - pmap_delayed_invl_started(); + pmap_delayed_invl_start(); if (pmap_remove_ptes(pmap, va, va + NBPDR, pde, &free, lockp)) pmap_invalidate_all(pmap); - pmap_delayed_invl_finished(); + pmap_delayed_invl_finish(); } vm_page_free_pages_toq(&free, true); if (va >= VM_MAXUSER_ADDRESS) { @@ -6085,7 +6085,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offset_t addr, vm_ * The wired attribute of the page table entry is not a hardware * feature, so there is no need to invalidate any TLB entries. * Since pmap_demote_pde() for the wired entry must never fail, - * pmap_delayed_invl_started()/finished() calls around the + * pmap_delayed_invl_start()/finish() calls around the * function are not needed. */ void @@ -6584,8 +6584,8 @@ pmap_page_is_mapped(vm_page_t m) * * Although this function destroys all of the pmap's managed, * non-wired mappings, it can delay and batch the invalidation of TLB - * entries without calling pmap_delayed_invl_started() and - * pmap_delayed_invl_finished(). Because the pmap is not active on + * entries without calling pmap_delayed_invl_start() and + * pmap_delayed_invl_finish(). Because the pmap is not active on * any other processor, none of these TLB entries will ever be used * before their eventual invalidation. Consequently, there is no need * for either pmap_remove_all() or pmap_remove_write() to wait for @@ -7290,7 +7290,7 @@ pmap_advise(pmap_t pmap, vm_offset_t sva, vm_offset_t PG_V = pmap_valid_bit(pmap); PG_RW = pmap_rw_bit(pmap); anychanged = FALSE; - pmap_delayed_invl_started(); + pmap_delayed_invl_start(); PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { pml4e = pmap_pml4e(pmap, sva); @@ -7387,7 +7387,7 @@ maybe_invlrng: if (anychanged) pmap_invalidate_all(pmap); PMAP_UNLOCK(pmap); - pmap_delayed_invl_finished(); + pmap_delayed_invl_finish(); } /* From owner-svn-src-head@freebsd.org Thu May 16 14:29:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF30D15983B7; Thu, 16 May 2019 14:29:10 +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 7255480976; Thu, 16 May 2019 14:29:10 +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 3769522120; Thu, 16 May 2019 14:29:10 +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 x4GETAEK003592; Thu, 16 May 2019 14:29:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GETAXM003591; Thu, 16 May 2019 14:29:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905161429.x4GETAXM003591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 16 May 2019 14:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347697 - 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: 347697 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7255480976 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; 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: Thu, 16 May 2019 14:29:11 -0000 Author: kib Date: Thu May 16 14:29:09 2019 New Revision: 347697 URL: https://svnweb.freebsd.org/changeset/base/347697 Log: amd64 pmap: Add tunable vm.pmap.di_locked to set DI mode. This is done mostly for debugging in field. Also added the sysctl of the same name to report used mode. Sponsored by: The FreeBSD Foundation MFC after: 1 month Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu May 16 13:40:54 2019 (r347696) +++ head/sys/amd64/amd64/pmap.c Thu May 16 14:29:09 2019 (r347697) @@ -486,13 +486,36 @@ static u_long pmap_invl_gen = 1; #define PMAP_ASSERT_NOT_IN_DI() \ KASSERT(pmap_not_in_di(), ("DI already started")) +static bool +pmap_di_locked(void) +{ + int tun; + + if ((cpu_feature2 & CPUID2_CX16) == 0) + return (true); + tun = 0; + TUNABLE_INT_FETCH("vm.pmap.di_locked", &tun); + return (tun != 0); +} + +static int +sysctl_pmap_di_locked(SYSCTL_HANDLER_ARGS) +{ + int locked; + + locked = pmap_di_locked(); + return (sysctl_handle_int(oidp, &locked, 0, req)); +} +SYSCTL_PROC(_vm_pmap, OID_AUTO, di_locked, CTLTYPE_INT | CTLFLAG_RDTUN | + CTLFLAG_MPSAFE, 0, 0, sysctl_pmap_di_locked, "", + "Locked delayed invalidation"); + static bool pmap_not_in_di_l(void); static bool pmap_not_in_di_u(void); DEFINE_IFUNC(, bool, pmap_not_in_di, (void), static) { - return ((cpu_feature2 & CPUID2_CX16) == 0 ? pmap_not_in_di_l : - pmap_not_in_di_u); + return (pmap_di_locked() ? pmap_not_in_di_l : pmap_not_in_di_u); } static bool @@ -933,29 +956,29 @@ pmap_delayed_invl_wait_u(vm_page_t m) DEFINE_IFUNC(, void, pmap_thread_init_invl_gen, (struct thread *), static) { - return ((cpu_feature2 & CPUID2_CX16) == 0 ? - pmap_thread_init_invl_gen_l : pmap_thread_init_invl_gen_u); + return (pmap_di_locked() ? pmap_thread_init_invl_gen_l : + pmap_thread_init_invl_gen_u); } DEFINE_IFUNC(static, void, pmap_delayed_invl_start, (void), static) { - return ((cpu_feature2 & CPUID2_CX16) == 0 ? - pmap_delayed_invl_start_l : pmap_delayed_invl_start_u); + return (pmap_di_locked() ? pmap_delayed_invl_start_l : + pmap_delayed_invl_start_u); } DEFINE_IFUNC(static, void, pmap_delayed_invl_finish, (void), static) { - return ((cpu_feature2 & CPUID2_CX16) == 0 ? - pmap_delayed_invl_finish_l : pmap_delayed_invl_finish_u); + return (pmap_di_locked() ? pmap_delayed_invl_finish_l : + pmap_delayed_invl_finish_u); } DEFINE_IFUNC(static, void, pmap_delayed_invl_wait, (vm_page_t), static) { - return ((cpu_feature2 & CPUID2_CX16) == 0 ? - pmap_delayed_invl_wait_l : pmap_delayed_invl_wait_u); + return (pmap_di_locked() ? pmap_delayed_invl_wait_l : + pmap_delayed_invl_wait_u); } /* From owner-svn-src-head@freebsd.org Thu May 16 14:33:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 899C3159867A; Thu, 16 May 2019 14:33:33 +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 30DE780DC4; Thu, 16 May 2019 14:33:33 +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 09E0B222C1; Thu, 16 May 2019 14:33:33 +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 x4GEXWoe008566; Thu, 16 May 2019 14:33:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GEXW1i008565; Thu, 16 May 2019 14:33:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905161433.x4GEXW1i008565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 16 May 2019 14:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347698 - 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: 347698 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 30DE780DC4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Thu, 16 May 2019 14:33:33 -0000 Author: kib Date: Thu May 16 14:33:32 2019 New Revision: 347698 URL: https://svnweb.freebsd.org/changeset/base/347698 Log: amd64 pmap: sysctl vm.pmap.pcid_save_cnt should be read-only. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu May 16 14:29:09 2019 (r347697) +++ head/sys/amd64/amd64/pmap.c Thu May 16 14:33:32 2019 (r347698) @@ -466,7 +466,7 @@ pmap_pcid_save_cnt_proc(SYSCTL_HANDLER_ARGS) } return (sysctl_handle_64(oidp, &res, 0, req)); } -SYSCTL_PROC(_vm_pmap, OID_AUTO, pcid_save_cnt, CTLTYPE_U64 | CTLFLAG_RW | +SYSCTL_PROC(_vm_pmap, OID_AUTO, pcid_save_cnt, CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, pmap_pcid_save_cnt_proc, "QU", "Count of saved TLB context on switch"); From owner-svn-src-head@freebsd.org Thu May 16 15:05:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 315761599534; Thu, 16 May 2019 15:05:48 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (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 C10068234B; Thu, 16 May 2019 15:05:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f41.google.com with SMTP id s20so2841161ioj.7; Thu, 16 May 2019 08:05:47 -0700 (PDT) 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:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=ivNxZOP4WHnfaXEVVKy8d4waZwfKCJRKzBr+CRGYDVA=; b=jvmUuQLlmlzo/jhz2thKkYdSoNE6+dujsnvsx08kSQ4sSnO7+QnxTYZsh5QkZtBuqj iSyK876xyantB7R5mFKRJXSQIrfyB5KWDL2Dw5eMWGGFSiLBeHp5YP2ykyjqKBjinJQG uBZtZqJL7savEIMhV+/oxMAitwia+FMPpGAzuI2YFDNY7Ybxczvn522KIpruUvRwh4GH ZXONP3xRIte5AbezZnCaV0fghfTzRAnNFatqw1IIlvcLhXwx2hWi460hA0Ioka8dt/QY EjCVasPSSa1UewADE1WopV7TKSh9k54eQAewbNyIdtAdWA5z+2qyc1UFxJnU7rRqT+Yi anKQ== X-Gm-Message-State: APjAAAXv0IVx6OAx7stJ0fzkKKY2XAUnSXpKrmu4sNGQqDvQsv4DdkBY Gyk1BcCWiaWMUoSFJJoHpQ6ffQpO X-Google-Smtp-Source: APXvYqw0LTiH4eZKVhdgvLHIuhjAi2BhgsXVDvAZh1IiuuzkRwTYMipy+IMSYw4LhlIzIhTI3f5z9g== X-Received: by 2002:a5e:8b4a:: with SMTP id z10mr25052047iom.260.1558019141106; Thu, 16 May 2019 08:05:41 -0700 (PDT) Received: from mail-io1-f53.google.com (mail-io1-f53.google.com. [209.85.166.53]) by smtp.gmail.com with ESMTPSA id a130sm1574374itb.14.2019.05.16.08.05.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 May 2019 08:05:40 -0700 (PDT) Received: by mail-io1-f53.google.com with SMTP id q21so2803589iog.13; Thu, 16 May 2019 08:05:40 -0700 (PDT) X-Received: by 2002:a05:6602:218f:: with SMTP id b15mr8321933iob.233.1558019140348; Thu, 16 May 2019 08:05:40 -0700 (PDT) MIME-Version: 1.0 References: <201905160109.x4G19DhY080690@repo.freebsd.org> In-Reply-To: <201905160109.x4G19DhY080690@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Thu, 16 May 2019 08:05:29 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r347638 - in head: . etc lib/libc/gen To: Brad Davis Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: C10068234B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; REPLY(-4.00)[]; TAGGED_FROM(0.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: Thu, 16 May 2019 15:05:48 -0000 Hi Brad, Can you revert this? It seems to break every config-management tool we have (mergemaster, etcupdate, beinstall ...). Additionally, I don't believe this move has been justified =E2=80=94 the co= ns seem to outweigh the pros, if there are any. I skimmed the differential and it was not immediately obvious what the benefit was. The commit message describes what was changed, but not *why* you thought it was a good idea. Thanks, Conrad On Wed, May 15, 2019 at 6:09 PM Brad Davis wrote: > > Author: brd > Date: Thu May 16 01:09:13 2019 > New Revision: 347638 > URL: https://svnweb.freebsd.org/changeset/base/347638 > > Log: > Move master.passwd and group to lib/libc/gen/ > > libc was picked as the destination location for these because of the sy= scalls > that use these files as the lowest level place they are referenced. > > Approved by: will (mentor), rgrimes, manu > Differential Revision: https://reviews.freebsd.org/D16728 > > Added: > head/lib/libc/gen/group > - copied unchanged from r347637, head/etc/group > head/lib/libc/gen/master.passwd > - copied unchanged from r347637, head/etc/master.passwd > Deleted: > head/etc/group > head/etc/master.passwd > Modified: > head/Makefile.inc1 > head/etc/Makefile > head/lib/libc/gen/Makefile.inc > > Modified: head/Makefile.inc1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/Makefile.inc1 Thu May 16 00:53:54 2019 (r347637) > +++ head/Makefile.inc1 Thu May 16 01:09:13 2019 (r347638) > @@ -871,8 +871,8 @@ DB_FROM_SRC=3D yes > .endif > > .if defined(DB_FROM_SRC) > -INSTALLFLAGS+=3D -N ${.CURDIR}/etc > -MTREEFLAGS+=3D -N ${.CURDIR}/etc > +INSTALLFLAGS+=3D -N ${.CURDIR}/lib/libc/gen > +MTREEFLAGS+=3D -N ${.CURDIR}/lib/libc/gen > .endif > _INSTALL_DDIR=3D ${DESTDIR}/${DISTDIR} > INSTALL_DDIR=3D ${_INSTALL_DDIR:S://:/:g:C:/$::} > > Modified: head/etc/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/etc/Makefile Thu May 16 00:53:54 2019 (r347637) > +++ head/etc/Makefile Thu May 16 01:09:13 2019 (r347638) > @@ -15,7 +15,6 @@ SUBDIR+=3Dsendmail > .endif > > BIN1=3D \ > - group \ > login.access \ > rc.bsdextended \ > rc.firewall \ > @@ -65,21 +64,7 @@ distribution: > .endif > cd ${.CURDIR}; \ > ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ > - ${BIN1} ${DESTDIR}/etc; \ > - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ > - master.passwd ${DESTDIR}/etc; > - > -.if ${MK_TCSH} =3D=3D "no" > - sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd > -.endif > - pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd > -.if defined(NO_ROOT) > - ( \ > - echo "./etc/passwd type=3Dfile mode=3D0644 uname=3Droot g= name=3Dwheel"; \ > - echo "./etc/pwd.db type=3Dfile mode=3D0644 uname=3Droot g= name=3Dwheel"; \ > - echo "./etc/spwd.db type=3Dfile mode=3D0600 uname=3Droot = gname=3Dwheel"; \ > - ) | ${METALOG.add} > -.endif > + ${BIN1} ${DESTDIR}/etc > ${_+_}cd ${.CURDIR}/gss; ${MAKE} install > ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install > ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap > > Modified: head/lib/libc/gen/Makefile.inc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libc/gen/Makefile.inc Thu May 16 00:53:54 2019 (= r347637) > +++ head/lib/libc/gen/Makefile.inc Thu May 16 01:09:13 2019 (= r347638) > @@ -4,7 +4,8 @@ > # machine-independent gen sources > .PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/gen ${LIBC_SRCTOP}/gen > > -CONFS=3D shells > +CONFS+=3D group master.passwd shells > +CONFSMODE_master.passwd=3D 600 > > SRCS+=3D __getosreldate.c \ > __pthread_mutex_init_calloc_cb_stub.c \ > @@ -543,3 +544,16 @@ MLINKS+=3Dvis.3 nvis.3 \ > vis.3 svis.3 > > MLINKS+=3Dwordexp.3 wordfree.3 > + > +afterinstallconfig: > +.if ${MK_TCSH} =3D=3D "no" > + sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd > +.endif > + pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd > +.if defined(NO_ROOT) && defined(METALOG) > + ( \ > + echo "./etc/pwd.db type=3Dfile mode=3D0644 uname=3Droot g= name=3Dwheel"; \ > + echo "./etc/spwd.db type=3Dfile mode=3D0600 uname=3Droot = gname=3Dwheel"; \ > + echo "./etc/passwd type=3Dfile mode=3D0644 uname=3Droot g= name=3Dwheel"; \ > + ) | cat -l >> ${METALOG} > +.endif > > Copied: head/lib/libc/gen/group (from r347637, head/etc/group) > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libc/gen/group Thu May 16 01:09:13 2019 (r347638,= copy of r347637, head/etc/group) > @@ -0,0 +1,36 @@ > +# $FreeBSD$ > +# > +wheel:*:0:root > +daemon:*:1: > +kmem:*:2: > +sys:*:3: > +tty:*:4: > +operator:*:5:root > +mail:*:6: > +bin:*:7: > +news:*:8: > +man:*:9: > +games:*:13: > +ftp:*:14: > +staff:*:20: > +sshd:*:22: > +smmsp:*:25: > +mailnull:*:26: > +guest:*:31: > +video:*:44: > +bind:*:53: > +unbound:*:59: > +proxy:*:62: > +authpf:*:63: > +_pflogd:*:64: > +_dhcp:*:65: > +uucp:*:66: > +dialer:*:68: > +network:*:69: > +audit:*:77: > +www:*:80: > +ntpd:*:123: > +_ypldap:*:160: > +hast:*:845: > +nogroup:*:65533: > +nobody:*:65534: > > Copied: head/lib/libc/gen/master.passwd (from r347637, head/etc/master.pa= sswd) > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libc/gen/master.passwd Thu May 16 01:09:13 2019 (= r347638, copy of r347637, head/etc/master.passwd) > @@ -0,0 +1,28 @@ > +# $FreeBSD$ > +# > +root::0:0::0:0:Charlie &:/root:/bin/csh > +toor:*:0:0::0:0:Bourne-again Superuser:/root: > +daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin > +operator:*:2:5::0:0:System &:/:/usr/sbin/nologin > +bin:*:3:7::0:0:Binaries Commands and Source:/:/usr/sbin/nologin > +tty:*:4:65533::0:0:Tty Sandbox:/:/usr/sbin/nologin > +kmem:*:5:65533::0:0:KMem Sandbox:/:/usr/sbin/nologin > +games:*:7:13::0:0:Games pseudo-user:/:/usr/sbin/nologin > +news:*:8:8::0:0:News Subsystem:/:/usr/sbin/nologin > +man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/usr/sbin/nologin > +sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin > +smmsp:*:25:25::0:0:Sendmail Submission User:/var/spool/clientmqueue:/usr= /sbin/nologin > +mailnull:*:26:26::0:0:Sendmail Default User:/var/spool/mqueue:/usr/sbin/= nologin > +bind:*:53:53::0:0:Bind Sandbox:/:/usr/sbin/nologin > +unbound:*:59:59::0:0:Unbound DNS Resolver:/var/unbound:/usr/sbin/nologin > +proxy:*:62:62::0:0:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nolo= gin > +_pflogd:*:64:64::0:0:pflogd privsep user:/var/empty:/usr/sbin/nologin > +_dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin > +uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/local/libe= xec/uucp/uucico > +pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin > +auditdistd:*:78:77::0:0:Auditdistd unprivileged user:/var/empty:/usr/sbi= n/nologin > +www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin > +ntpd:*:123:123::0:0:NTP Daemon:/var/db/ntp:/usr/sbin/nologin > +_ypldap:*:160:160::0:0:YP LDAP unprivileged user:/var/empty:/usr/sbin/no= login > +hast:*:845:845::0:0:HAST unprivileged user:/var/empty:/usr/sbin/nologin > +nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nolog= in > From owner-svn-src-head@freebsd.org Thu May 16 15:07:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C202F1599712; Thu, 16 May 2019 15:07:58 +0000 (UTC) (envelope-from bdrewery@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 6438B8261B; Thu, 16 May 2019 15:07:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 148D21C64F; Thu, 16 May 2019 15:07:58 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id E8B9510A9; Thu, 16 May 2019 15:07:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id AxBJWJoQOlal; Thu, 16 May 2019 15:07:46 +0000 (UTC) MIME-Version: 1.0 DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com EC56F1099 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Thu, 16 May 2019 11:07:45 -0400 From: Bryan Drewery To: cem@freebsd.org, Brad Davis Cc: src-committers , svn-src-all , svn-src-head , owner-src-committers@freebsd.org Subject: Re: svn commit: r347638 - in head: . etc lib/libc/gen In-Reply-To: References: <201905160109.x4G19DhY080690@repo.freebsd.org> Message-ID: X-Sender: bdrewery@FreeBSD.org User-Agent: Roundcube Webmail/1.3.6 X-Rspamd-Queue-Id: 6438B8261B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.985,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: Thu, 16 May 2019 15:07:59 -0000 usr.sbin/etcupdate/tests/preworld_test.sh: $SRC/etc/master.passwd usr.sbin/mergemaster/mergemaster.sh: cp -p ${SOURCEDIR}/etc/master.passwd ${TEMPROOT}/etc && I suspect there are more places than these 2 that need to be fixed still. This was a very lazy grep. Sadly I think it should be reverted until further tool analysis is done. Both internal and external. Why a subdir of libc rather than just libc/? This is very oddly placed. Is there a libc-gen package? On 2019-05-16 11:05, Conrad Meyer wrote: > Hi Brad, > > Can you revert this? It seems to break every config-management tool > we have (mergemaster, etcupdate, beinstall ...). > > Additionally, I don't believe this move has been justified — the cons > seem to outweigh the pros, if there are any. I skimmed the > differential and it was not immediately obvious what the benefit was. > The commit message describes what was changed, but not *why* you > thought it was a good idea. > > Thanks, > Conrad > > On Wed, May 15, 2019 at 6:09 PM Brad Davis wrote: >> >> Author: brd >> Date: Thu May 16 01:09:13 2019 >> New Revision: 347638 >> URL: https://svnweb.freebsd.org/changeset/base/347638 >> >> Log: >> Move master.passwd and group to lib/libc/gen/ >> >> libc was picked as the destination location for these because of the >> syscalls >> that use these files as the lowest level place they are referenced. >> >> Approved by: will (mentor), rgrimes, manu >> Differential Revision: https://reviews.freebsd.org/D16728 >> >> Added: >> head/lib/libc/gen/group >> - copied unchanged from r347637, head/etc/group >> head/lib/libc/gen/master.passwd >> - copied unchanged from r347637, head/etc/master.passwd >> Deleted: >> head/etc/group >> head/etc/master.passwd >> Modified: >> head/Makefile.inc1 >> head/etc/Makefile >> head/lib/libc/gen/Makefile.inc >> >> Modified: head/Makefile.inc1 >> ============================================================================== >> --- head/Makefile.inc1 Thu May 16 00:53:54 2019 (r347637) >> +++ head/Makefile.inc1 Thu May 16 01:09:13 2019 (r347638) >> @@ -871,8 +871,8 @@ DB_FROM_SRC= yes >> .endif >> >> .if defined(DB_FROM_SRC) >> -INSTALLFLAGS+= -N ${.CURDIR}/etc >> -MTREEFLAGS+= -N ${.CURDIR}/etc >> +INSTALLFLAGS+= -N ${.CURDIR}/lib/libc/gen >> +MTREEFLAGS+= -N ${.CURDIR}/lib/libc/gen >> .endif >> _INSTALL_DDIR= ${DESTDIR}/${DISTDIR} >> INSTALL_DDIR= ${_INSTALL_DDIR:S://:/:g:C:/$::} >> >> Modified: head/etc/Makefile >> ============================================================================== >> --- head/etc/Makefile Thu May 16 00:53:54 2019 (r347637) >> +++ head/etc/Makefile Thu May 16 01:09:13 2019 (r347638) >> @@ -15,7 +15,6 @@ SUBDIR+=sendmail >> .endif >> >> BIN1= \ >> - group \ >> login.access \ >> rc.bsdextended \ >> rc.firewall \ >> @@ -65,21 +64,7 @@ distribution: >> .endif >> cd ${.CURDIR}; \ >> ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ >> - ${BIN1} ${DESTDIR}/etc; \ >> - ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \ >> - master.passwd ${DESTDIR}/etc; >> - >> -.if ${MK_TCSH} == "no" >> - sed -i "" -e 's;/bin/csh;/bin/sh;' >> ${DESTDIR}/etc/master.passwd >> -.endif >> - pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd >> -.if defined(NO_ROOT) >> - ( \ >> - echo "./etc/passwd type=file mode=0644 uname=root >> gname=wheel"; \ >> - echo "./etc/pwd.db type=file mode=0644 uname=root >> gname=wheel"; \ >> - echo "./etc/spwd.db type=file mode=0600 uname=root >> gname=wheel"; \ >> - ) | ${METALOG.add} >> -.endif >> + ${BIN1} ${DESTDIR}/etc >> ${_+_}cd ${.CURDIR}/gss; ${MAKE} install >> ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install >> ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap >> >> Modified: head/lib/libc/gen/Makefile.inc >> ============================================================================== >> --- head/lib/libc/gen/Makefile.inc Thu May 16 00:53:54 2019 >> (r347637) >> +++ head/lib/libc/gen/Makefile.inc Thu May 16 01:09:13 2019 >> (r347638) >> @@ -4,7 +4,8 @@ >> # machine-independent gen sources >> .PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/gen ${LIBC_SRCTOP}/gen >> >> -CONFS= shells >> +CONFS+= group master.passwd shells >> +CONFSMODE_master.passwd= 600 >> >> SRCS+= __getosreldate.c \ >> __pthread_mutex_init_calloc_cb_stub.c \ >> @@ -543,3 +544,16 @@ MLINKS+=vis.3 nvis.3 \ >> vis.3 svis.3 >> >> MLINKS+=wordexp.3 wordfree.3 >> + >> +afterinstallconfig: >> +.if ${MK_TCSH} == "no" >> + sed -i "" -e 's;/bin/csh;/bin/sh;' >> ${DESTDIR}/etc/master.passwd >> +.endif >> + pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd >> +.if defined(NO_ROOT) && defined(METALOG) >> + ( \ >> + echo "./etc/pwd.db type=file mode=0644 uname=root >> gname=wheel"; \ >> + echo "./etc/spwd.db type=file mode=0600 uname=root >> gname=wheel"; \ >> + echo "./etc/passwd type=file mode=0644 uname=root >> gname=wheel"; \ >> + ) | cat -l >> ${METALOG} >> +.endif >> >> Copied: head/lib/libc/gen/group (from r347637, head/etc/group) >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/lib/libc/gen/group Thu May 16 01:09:13 2019 >> (r347638, copy of r347637, head/etc/group) >> @@ -0,0 +1,36 @@ >> +# $FreeBSD$ >> +# >> +wheel:*:0:root >> +daemon:*:1: >> +kmem:*:2: >> +sys:*:3: >> +tty:*:4: >> +operator:*:5:root >> +mail:*:6: >> +bin:*:7: >> +news:*:8: >> +man:*:9: >> +games:*:13: >> +ftp:*:14: >> +staff:*:20: >> +sshd:*:22: >> +smmsp:*:25: >> +mailnull:*:26: >> +guest:*:31: >> +video:*:44: >> +bind:*:53: >> +unbound:*:59: >> +proxy:*:62: >> +authpf:*:63: >> +_pflogd:*:64: >> +_dhcp:*:65: >> +uucp:*:66: >> +dialer:*:68: >> +network:*:69: >> +audit:*:77: >> +www:*:80: >> +ntpd:*:123: >> +_ypldap:*:160: >> +hast:*:845: >> +nogroup:*:65533: >> +nobody:*:65534: >> >> Copied: head/lib/libc/gen/master.passwd (from r347637, >> head/etc/master.passwd) >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/lib/libc/gen/master.passwd Thu May 16 01:09:13 2019 >> (r347638, copy of r347637, head/etc/master.passwd) >> @@ -0,0 +1,28 @@ >> +# $FreeBSD$ >> +# >> +root::0:0::0:0:Charlie &:/root:/bin/csh >> +toor:*:0:0::0:0:Bourne-again Superuser:/root: >> +daemon:*:1:1::0:0:Owner of many system >> processes:/root:/usr/sbin/nologin >> +operator:*:2:5::0:0:System &:/:/usr/sbin/nologin >> +bin:*:3:7::0:0:Binaries Commands and Source:/:/usr/sbin/nologin >> +tty:*:4:65533::0:0:Tty Sandbox:/:/usr/sbin/nologin >> +kmem:*:5:65533::0:0:KMem Sandbox:/:/usr/sbin/nologin >> +games:*:7:13::0:0:Games pseudo-user:/:/usr/sbin/nologin >> +news:*:8:8::0:0:News Subsystem:/:/usr/sbin/nologin >> +man:*:9:9::0:0:Mister Man Pages:/usr/share/man:/usr/sbin/nologin >> +sshd:*:22:22::0:0:Secure Shell Daemon:/var/empty:/usr/sbin/nologin >> +smmsp:*:25:25::0:0:Sendmail Submission >> User:/var/spool/clientmqueue:/usr/sbin/nologin >> +mailnull:*:26:26::0:0:Sendmail Default >> User:/var/spool/mqueue:/usr/sbin/nologin >> +bind:*:53:53::0:0:Bind Sandbox:/:/usr/sbin/nologin >> +unbound:*:59:59::0:0:Unbound DNS >> Resolver:/var/unbound:/usr/sbin/nologin >> +proxy:*:62:62::0:0:Packet Filter >> pseudo-user:/nonexistent:/usr/sbin/nologin >> +_pflogd:*:64:64::0:0:pflogd privsep user:/var/empty:/usr/sbin/nologin >> +_dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin >> +uucp:*:66:66::0:0:UUCP >> pseudo-user:/var/spool/uucppublic:/usr/local/libexec/uucp/uucico >> +pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin >> +auditdistd:*:78:77::0:0:Auditdistd unprivileged >> user:/var/empty:/usr/sbin/nologin >> +www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin >> +ntpd:*:123:123::0:0:NTP Daemon:/var/db/ntp:/usr/sbin/nologin >> +_ypldap:*:160:160::0:0:YP LDAP unprivileged >> user:/var/empty:/usr/sbin/nologin >> +hast:*:845:845::0:0:HAST unprivileged >> user:/var/empty:/usr/sbin/nologin >> +nobody:*:65534:65534::0:0:Unprivileged >> user:/nonexistent:/usr/sbin/nologin >> From owner-svn-src-head@freebsd.org Thu May 16 15:22:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 772791599D4D; Thu, 16 May 2019 15:22:18 +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 1BC4D82F8A; Thu, 16 May 2019 15:22:18 +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 E3CD822AF7; Thu, 16 May 2019 15:22:17 +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 x4GFMHiI034827; Thu, 16 May 2019 15:22:17 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GFMHPQ034826; Thu, 16 May 2019 15:22:17 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905161522.x4GFMHPQ034826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 16 May 2019 15:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347703 - head/sys/dev/ae X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/dev/ae X-SVN-Commit-Revision: 347703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1BC4D82F8A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Thu, 16 May 2019 15:22:18 -0000 Author: brooks Date: Thu May 16 15:22:17 2019 New Revision: 347703 URL: https://svnweb.freebsd.org/changeset/base/347703 Log: FCP-101: ae(4) is sufficently popular to be moved to the keep list. Modified: head/sys/dev/ae/if_ae.c Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Thu May 16 14:48:08 2019 (r347702) +++ head/sys/dev/ae/if_ae.c Thu May 16 15:22:17 2019 (r347703) @@ -396,8 +396,6 @@ ae_attach(device_t dev) goto fail; } - gone_by_fcp101_dev(dev); - fail: if (error != 0) ae_detach(dev); From owner-svn-src-head@freebsd.org Thu May 16 17:04:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECBAB159F4F0; Thu, 16 May 2019 17:04:31 +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 8947D8CDCC; Thu, 16 May 2019 17:04:31 +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 512AD23C35; Thu, 16 May 2019 17:04:30 +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 x4GH4U4m092688; Thu, 16 May 2019 17:04:30 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GH4Uqd092687; Thu, 16 May 2019 17:04:30 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905161704.x4GH4Uqd092687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 16 May 2019 17:04:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347795 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 347795 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8947D8CDCC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Thu, 16 May 2019 17:04:32 -0000 Author: jhibbits Date: Thu May 16 17:04:29 2019 New Revision: 347795 URL: https://svnweb.freebsd.org/changeset/base/347795 Log: arm64: Add the rename interpreter path for compat32 ld-elf Let arm64 and arm32 dynamic binaries coexist. Match all other compat32 archs. Reviewed by: manu Sponsored by: Juniper Networks, Inc Modified: head/sys/arm64/arm64/elf32_machdep.c Modified: head/sys/arm64/arm64/elf32_machdep.c ============================================================================== --- head/sys/arm64/arm64/elf32_machdep.c Thu May 16 17:04:15 2019 (r347794) +++ head/sys/arm64/arm64/elf32_machdep.c Thu May 16 17:04:29 2019 (r347795) @@ -115,7 +115,7 @@ static Elf32_Brandinfo freebsd32_brand_info = { .emul_path = NULL, .interp_path = "/libexec/ld-elf.so.1", .sysvec = &elf32_freebsd_sysvec, - .interp_newpath = NULL, + .interp_newpath = "/libexec/ld-elf32.so.1", .brand_note = &elf32_freebsd_brandnote, .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE, .header_supported= elf32_arm_abi_supported, From owner-svn-src-head@freebsd.org Thu May 16 17:34:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D10515A1164; Thu, 16 May 2019 17:34:37 +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 B8DAD6843B; Thu, 16 May 2019 17:34:36 +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 7F8C22415F; Thu, 16 May 2019 17:34:36 +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 x4GHYa1b010949; Thu, 16 May 2019 17:34:36 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GHYaCW010948; Thu, 16 May 2019 17:34:36 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905161734.x4GHYaCW010948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 16 May 2019 17:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347828 - head/sys/dev/xdma X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/xdma X-SVN-Commit-Revision: 347828 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B8DAD6843B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 16 May 2019 17:34:37 -0000 Author: cem Date: Thu May 16 17:34:36 2019 New Revision: 347828 URL: https://svnweb.freebsd.org/changeset/base/347828 Log: xdma(4): Fix invalid pointer use (breaks arm.SOCFPGA build) In xdma_handle_mem_node(), vmem_size_t and vmem_addr_t pointers were passed to an FDT API that emits u_long values to the output parameter pointer. This broke on systems with both xdma and 32-bit vmem size/addr types (SOCFPGA). Reported by: tinderbox Sponsored by: Dell EMC Isilon Modified: head/sys/dev/xdma/xdma.c Modified: head/sys/dev/xdma/xdma.c ============================================================================== --- head/sys/dev/xdma/xdma.c Thu May 16 17:34:09 2019 (r347827) +++ head/sys/dev/xdma/xdma.c Thu May 16 17:34:36 2019 (r347828) @@ -312,8 +312,7 @@ xdma_handle_mem_node(vmem_t *vmem, phandle_t memory) pcell_t *regp; int addr_cells, size_cells; int i, reg_len, ret, tuple_size, tuples; - vmem_addr_t mem_start; - vmem_size_t mem_size; + u_long mem_start, mem_size; if ((ret = fdt_addrsize_cells(OF_parent(memory), &addr_cells, &size_cells)) != 0) From owner-svn-src-head@freebsd.org Thu May 16 17:41:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E298A15A1822; Thu, 16 May 2019 17:41:19 +0000 (UTC) (envelope-from tychon@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 8F2D86A647; Thu, 16 May 2019 17:41:19 +0000 (UTC) (envelope-from tychon@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 7AD2F241B0; Thu, 16 May 2019 17:41:19 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4GHfJNm015187; Thu, 16 May 2019 17:41:19 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GHfHQp013193; Thu, 16 May 2019 17:41:17 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201905161741.x4GHfHQp013193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Thu, 16 May 2019 17:41:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347836 - in head: sys/arm64/arm64 sys/arm64/include sys/compat/linuxkpi/common/src sys/sys sys/x86/include sys/x86/iommu sys/x86/x86 usr.sbin/camdd X-SVN-Group: head X-SVN-Commit-Author: tychon X-SVN-Commit-Paths: in head: sys/arm64/arm64 sys/arm64/include sys/compat/linuxkpi/common/src sys/sys sys/x86/include sys/x86/iommu sys/x86/x86 usr.sbin/camdd X-SVN-Commit-Revision: 347836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8F2D86A647 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Thu, 16 May 2019 17:41:20 -0000 Author: tychon Date: Thu May 16 17:41:16 2019 New Revision: 347836 URL: https://svnweb.freebsd.org/changeset/base/347836 Log: Allow loading the same DMA address multiple times without any prior unload for the LinuxKPI. Reviewed by: kib, zeising Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20181 Modified: head/sys/arm64/arm64/busdma_bounce.c head/sys/arm64/include/bus_dma.h head/sys/arm64/include/bus_dma_impl.h head/sys/compat/linuxkpi/common/src/linux_pci.c head/sys/sys/bus_dma.h head/sys/x86/include/bus_dma.h head/sys/x86/include/busdma_impl.h head/sys/x86/iommu/busdma_dmar.c head/sys/x86/x86/busdma_bounce.c head/usr.sbin/camdd/camdd.c Modified: head/sys/arm64/arm64/busdma_bounce.c ============================================================================== --- head/sys/arm64/arm64/busdma_bounce.c Thu May 16 17:38:59 2019 (r347835) +++ head/sys/arm64/arm64/busdma_bounce.c Thu May 16 17:41:16 2019 (r347836) @@ -152,6 +152,8 @@ static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, vm_offset_t vaddr, bus_addr_t addr, bus_size_t size); static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr); +static bool _bus_dmamap_pagesneeded(bus_dma_tag_t dmat, vm_paddr_t buf, + bus_size_t buflen, int *pagesneeded); static void _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap, void *buf, bus_size_t buflen, int flags); static void _bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_t map, @@ -271,6 +273,15 @@ out: return (error); } +static bool +bounce_bus_dma_id_mapped(bus_dma_tag_t dmat, vm_paddr_t buf, bus_size_t buflen) +{ + + if ((dmat->bounce_flags & BF_COULD_BOUNCE) == 0) + return (true); + return (!_bus_dmamap_pagesneeded(dmat, buf, buflen, NULL)); +} + static bus_dmamap_t alloc_dmamap(bus_dma_tag_t dmat, int flags) { @@ -539,29 +550,45 @@ bounce_bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr dmat->bounce_flags); } +static bool +_bus_dmamap_pagesneeded(bus_dma_tag_t dmat, vm_paddr_t buf, bus_size_t buflen, + int *pagesneeded) +{ + bus_addr_t curaddr; + bus_size_t sgsize; + int count; + + /* + * Count the number of bounce pages needed in order to + * complete this transfer + */ + count = 0; + curaddr = buf; + while (buflen != 0) { + sgsize = MIN(buflen, dmat->common.maxsegsz); + if (bus_dma_run_filter(&dmat->common, curaddr)) { + sgsize = MIN(sgsize, + PAGE_SIZE - (curaddr & PAGE_MASK)); + if (pagesneeded == NULL) + return (true); + count++; + } + curaddr += sgsize; + buflen -= sgsize; + } + + if (pagesneeded != NULL) + *pagesneeded = count; + return (count != 0); +} + static void _bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t buf, bus_size_t buflen, int flags) { - bus_addr_t curaddr; - bus_size_t sgsize; if ((map->flags & DMAMAP_COULD_BOUNCE) != 0 && map->pagesneeded == 0) { - /* - * Count the number of bounce pages - * needed in order to complete this transfer - */ - curaddr = buf; - while (buflen != 0) { - sgsize = MIN(buflen, dmat->common.maxsegsz); - if (bus_dma_run_filter(&dmat->common, curaddr)) { - sgsize = MIN(sgsize, - PAGE_SIZE - (curaddr & PAGE_MASK)); - map->pagesneeded++; - } - curaddr += sgsize; - buflen -= sgsize; - } + _bus_dmamap_pagesneeded(dmat, buf, buflen, &map->pagesneeded); CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); } } @@ -1316,6 +1343,7 @@ busdma_swi(void) struct bus_dma_impl bus_dma_bounce_impl = { .tag_create = bounce_bus_dma_tag_create, .tag_destroy = bounce_bus_dma_tag_destroy, + .id_mapped = bounce_bus_dma_id_mapped, .map_create = bounce_bus_dmamap_create, .map_destroy = bounce_bus_dmamap_destroy, .mem_alloc = bounce_bus_dmamem_alloc, Modified: head/sys/arm64/include/bus_dma.h ============================================================================== --- head/sys/arm64/include/bus_dma.h Thu May 16 17:38:59 2019 (r347835) +++ head/sys/arm64/include/bus_dma.h Thu May 16 17:41:16 2019 (r347836) @@ -9,6 +9,18 @@ #include /* + * Is DMA address 1:1 mapping of physical address + */ +static inline bool +bus_dma_id_mapped(bus_dma_tag_t dmat, vm_paddr_t buf, bus_size_t buflen) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + return (tc->impl->id_mapped(dmat, buf, buflen)); +} + +/* * Allocate a handle for mapping from kva/uva/physical * address space into bus device space. */ Modified: head/sys/arm64/include/bus_dma_impl.h ============================================================================== --- head/sys/arm64/include/bus_dma_impl.h Thu May 16 17:38:59 2019 (r347835) +++ head/sys/arm64/include/bus_dma_impl.h Thu May 16 17:41:16 2019 (r347836) @@ -58,6 +58,7 @@ struct bus_dma_impl { bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc, void *lockfuncarg, bus_dma_tag_t *dmat); int (*tag_destroy)(bus_dma_tag_t dmat); + bool (*id_mapped)(bus_dma_tag_t, vm_paddr_t, bus_size_t); int (*map_create)(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp); int (*map_destroy)(bus_dma_tag_t dmat, bus_dmamap_t map); int (*mem_alloc)(bus_dma_tag_t dmat, void** vaddr, int flags, Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Thu May 16 17:38:59 2019 (r347835) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Thu May 16 17:41:16 2019 (r347836) @@ -520,6 +520,7 @@ linux_dma_alloc_coherent(struct device *dev, size_t si return (mem); } +#if defined(__i386__) || defined(__amd64__) || defined(__aarch64__) dma_addr_t linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len) { @@ -530,6 +531,15 @@ linux_dma_map_phys(struct device *dev, vm_paddr_t phys priv = dev->dma_priv; + /* + * If the resultant mapping will be entirely 1:1 with the + * physical address, short-circuit the remainder of the + * bus_dma API. This avoids tracking collisions in the pctrie + * with the additional benefit of reducing overhead. + */ + if (bus_dma_id_mapped(priv->dmat, phys, len)) + return (phys); + obj = uma_zalloc(linux_dma_obj_zone, 0); DMA_PRIV_LOCK(priv); @@ -562,7 +572,15 @@ linux_dma_map_phys(struct device *dev, vm_paddr_t phys DMA_PRIV_UNLOCK(priv); return (obj->dma_addr); } +#else +dma_addr_t +linux_dma_map_phys(struct device *dev, vm_paddr_t phys, size_t len) +{ + return (phys); +} +#endif +#if defined(__i386__) || defined(__amd64__) || defined(__aarch64__) void linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len) { @@ -571,6 +589,9 @@ linux_dma_unmap(struct device *dev, dma_addr_t dma_add priv = dev->dma_priv; + if (pctrie_is_empty(&priv->ptree)) + return; + DMA_PRIV_LOCK(priv); obj = LINUX_DMA_PCTRIE_LOOKUP(&priv->ptree, dma_addr); if (obj == NULL) { @@ -584,6 +605,12 @@ linux_dma_unmap(struct device *dev, dma_addr_t dma_add uma_zfree(linux_dma_obj_zone, obj); } +#else +void +linux_dma_unmap(struct device *dev, dma_addr_t dma_addr, size_t len) +{ +} +#endif int linux_dma_map_sg_attrs(struct device *dev, struct scatterlist *sgl, int nents, Modified: head/sys/sys/bus_dma.h ============================================================================== --- head/sys/sys/bus_dma.h Thu May 16 17:38:59 2019 (r347835) +++ head/sys/sys/bus_dma.h Thu May 16 17:41:16 2019 (r347836) @@ -67,7 +67,9 @@ #ifndef _BUS_DMA_H_ #define _BUS_DMA_H_ +#ifdef _KERNEL #include +#endif /* * Machine independent interface for mapping physical addresses to peripheral @@ -133,6 +135,7 @@ typedef struct bus_dma_segment { bus_size_t ds_len; /* length of transfer */ } bus_dma_segment_t; +#ifdef _KERNEL /* * A function that returns 1 if the address cannot be accessed by * a device and 0 if it can be. @@ -302,5 +305,6 @@ BUS_DMAMAP_OP void bus_dmamap_sync(bus_dma_tag_t dmat, BUS_DMAMAP_OP void bus_dmamap_unload(bus_dma_tag_t dmat, bus_dmamap_t dmamap); #undef BUS_DMAMAP_OP +#endif /* _KERNEL */ #endif /* _BUS_DMA_H_ */ Modified: head/sys/x86/include/bus_dma.h ============================================================================== --- head/sys/x86/include/bus_dma.h Thu May 16 17:38:59 2019 (r347835) +++ head/sys/x86/include/bus_dma.h Thu May 16 17:41:16 2019 (r347836) @@ -36,6 +36,18 @@ #include /* + * Is DMA address 1:1 mapping of physical address + */ +static inline bool +bus_dma_id_mapped(bus_dma_tag_t dmat, vm_paddr_t buf, bus_size_t buflen) +{ + struct bus_dma_tag_common *tc; + + tc = (struct bus_dma_tag_common *)dmat; + return (tc->impl->id_mapped(dmat, buf, buflen)); +} + +/* * Allocate a handle for mapping from kva/uva/physical * address space into bus device space. */ Modified: head/sys/x86/include/busdma_impl.h ============================================================================== --- head/sys/x86/include/busdma_impl.h Thu May 16 17:38:59 2019 (r347835) +++ head/sys/x86/include/busdma_impl.h Thu May 16 17:41:16 2019 (r347836) @@ -62,6 +62,7 @@ struct bus_dma_impl { void *lockfuncarg, bus_dma_tag_t *dmat); int (*tag_destroy)(bus_dma_tag_t dmat); int (*tag_set_domain)(bus_dma_tag_t); + bool (*id_mapped)(bus_dma_tag_t, vm_paddr_t, bus_size_t); int (*map_create)(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp); int (*map_destroy)(bus_dma_tag_t dmat, bus_dmamap_t map); int (*mem_alloc)(bus_dma_tag_t dmat, void** vaddr, int flags, Modified: head/sys/x86/iommu/busdma_dmar.c ============================================================================== --- head/sys/x86/iommu/busdma_dmar.c Thu May 16 17:38:59 2019 (r347835) +++ head/sys/x86/iommu/busdma_dmar.c Thu May 16 17:41:16 2019 (r347836) @@ -365,6 +365,13 @@ out: return (error); } +static bool +dmar_bus_dma_id_mapped(bus_dma_tag_t dmat, vm_paddr_t buf, bus_size_t buflen) +{ + + return (false); +} + static int dmar_bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) { @@ -857,6 +864,7 @@ struct bus_dma_impl bus_dma_dmar_impl = { .tag_create = dmar_bus_dma_tag_create, .tag_destroy = dmar_bus_dma_tag_destroy, .tag_set_domain = dmar_bus_dma_tag_set_domain, + .id_mapped = dmar_bus_dma_id_mapped, .map_create = dmar_bus_dmamap_create, .map_destroy = dmar_bus_dmamap_destroy, .mem_alloc = dmar_bus_dmamem_alloc, Modified: head/sys/x86/x86/busdma_bounce.c ============================================================================== --- head/sys/x86/x86/busdma_bounce.c Thu May 16 17:38:59 2019 (r347835) +++ head/sys/x86/x86/busdma_bounce.c Thu May 16 17:41:16 2019 (r347836) @@ -141,6 +141,8 @@ static int reserve_bounce_pages(bus_dma_tag_t dmat, bu static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr, vm_paddr_t addr1, vm_paddr_t addr2, bus_size_t size); static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage); +static bool _bus_dmamap_pagesneeded(bus_dma_tag_t dmat, vm_paddr_t buf, + bus_size_t buflen, int *pagesneeded); static void _bus_dmamap_count_pages(bus_dma_tag_t dmat, bus_dmamap_t map, pmap_t pmap, void *buf, bus_size_t buflen, int flags); static void _bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_t map, @@ -223,6 +225,15 @@ bounce_bus_dma_tag_create(bus_dma_tag_t parent, bus_si return (error); } +static bool +bounce_bus_dma_id_mapped(bus_dma_tag_t dmat, vm_paddr_t buf, bus_size_t buflen) +{ + + if ((dmat->bounce_flags & BUS_DMA_COULD_BOUNCE) == 0) + return (true); + return (!_bus_dmamap_pagesneeded(dmat, buf, buflen, NULL)); +} + /* * Update the domain for the tag. We may need to reallocate the zone and * bounce pages. @@ -501,29 +512,45 @@ bounce_bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr dmat->bounce_flags); } +static bool +_bus_dmamap_pagesneeded(bus_dma_tag_t dmat, vm_paddr_t buf, bus_size_t buflen, + int *pagesneeded) +{ + vm_paddr_t curaddr; + bus_size_t sgsize; + int count; + + /* + * Count the number of bounce pages needed in order to + * complete this transfer + */ + count = 0; + curaddr = buf; + while (buflen != 0) { + sgsize = MIN(buflen, dmat->common.maxsegsz); + if (bus_dma_run_filter(&dmat->common, curaddr)) { + sgsize = MIN(sgsize, + PAGE_SIZE - (curaddr & PAGE_MASK)); + if (pagesneeded == NULL) + return (true); + count++; + } + curaddr += sgsize; + buflen -= sgsize; + } + + if (pagesneeded != NULL) + *pagesneeded = count; + return (count != 0); +} + static void _bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t buf, bus_size_t buflen, int flags) { - vm_paddr_t curaddr; - bus_size_t sgsize; if (map != &nobounce_dmamap && map->pagesneeded == 0) { - /* - * Count the number of bounce pages - * needed in order to complete this transfer - */ - curaddr = buf; - while (buflen != 0) { - sgsize = MIN(buflen, dmat->common.maxsegsz); - if (bus_dma_run_filter(&dmat->common, curaddr)) { - sgsize = MIN(sgsize, - PAGE_SIZE - (curaddr & PAGE_MASK)); - map->pagesneeded++; - } - curaddr += sgsize; - buflen -= sgsize; - } + _bus_dmamap_pagesneeded(dmat, buf, buflen, &map->pagesneeded); CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); } } @@ -1305,6 +1332,7 @@ struct bus_dma_impl bus_dma_bounce_impl = { .tag_create = bounce_bus_dma_tag_create, .tag_destroy = bounce_bus_dma_tag_destroy, .tag_set_domain = bounce_bus_dma_tag_set_domain, + .id_mapped = bounce_bus_dma_id_mapped, .map_create = bounce_bus_dmamap_create, .map_destroy = bounce_bus_dmamap_destroy, .mem_alloc = bounce_bus_dmamem_alloc, Modified: head/usr.sbin/camdd/camdd.c ============================================================================== --- head/usr.sbin/camdd/camdd.c Thu May 16 17:38:59 2019 (r347835) +++ head/usr.sbin/camdd/camdd.c Thu May 16 17:41:16 2019 (r347836) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From owner-svn-src-head@freebsd.org Thu May 16 17:44:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5640D15A1A8D; Thu, 16 May 2019 17:44:18 +0000 (UTC) (envelope-from johalun@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 F0FF76A8F0; Thu, 16 May 2019 17:44:17 +0000 (UTC) (envelope-from johalun@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 C56902432B; Thu, 16 May 2019 17:44:17 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4GHiHRk016450; Thu, 16 May 2019 17:44:17 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GHiH4H016449; Thu, 16 May 2019 17:44:17 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905161744.x4GHiH4H016449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Thu, 16 May 2019 17:44:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347837 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 347837 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F0FF76A8F0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 16 May 2019 17:44:18 -0000 Author: johalun Date: Thu May 16 17:44:17 2019 New Revision: 347837 URL: https://svnweb.freebsd.org/changeset/base/347837 Log: LinuxKPI: Update access_ok macro for v5.0. Check LINUXKPI_VERSION macro for backwards compatibility. It's recommended to update any drivers that depend on the older KPI so we can deprecate < 5.0 code as we update to newer Linux version. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/uaccess.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/uaccess.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/uaccess.h Thu May 16 17:41:16 2019 (r347836) +++ head/sys/compat/linuxkpi/common/include/linux/uaccess.h Thu May 16 17:44:17 2019 (r347837) @@ -60,12 +60,17 @@ #define get_user(_x, _p) linux_copyin((_p), &(_x), sizeof(*(_p))) #define put_user(_x, _p) __put_user(_x, _p) #define clear_user(...) linux_clear_user(__VA_ARGS__) -#define access_ok(...) linux_access_ok(__VA_ARGS__) +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 50000 +#define access_ok(a,b) linux_access_ok(a,b) +#else +#define access_ok(a,b,c) linux_access_ok(b,c) +#endif + extern int linux_copyin(const void *uaddr, void *kaddr, size_t len); extern int linux_copyout(const void *kaddr, void *uaddr, size_t len); extern size_t linux_clear_user(void *uaddr, size_t len); -extern int linux_access_ok(int rw, const void *uaddr, size_t len); +extern int linux_access_ok(const void *uaddr, size_t len); /* * NOTE: Each pagefault_disable() call must have a corresponding Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Thu May 16 17:41:16 2019 (r347836) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Thu May 16 17:44:17 2019 (r347837) @@ -897,7 +897,7 @@ linux_clear_user(void *_uaddr, size_t _len) } int -linux_access_ok(int rw, const void *uaddr, size_t len) +linux_access_ok(const void *uaddr, size_t len) { uintptr_t saddr; uintptr_t eaddr; From owner-svn-src-head@freebsd.org Thu May 16 17:53:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D33815A1F8D; Thu, 16 May 2019 17:53:37 +0000 (UTC) (envelope-from johalun@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 312886B363; Thu, 16 May 2019 17:53:37 +0000 (UTC) (envelope-from johalun@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 01251244EA; Thu, 16 May 2019 17:53:37 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4GHra5Y022201; Thu, 16 May 2019 17:53:36 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GHraQi022199; Thu, 16 May 2019 17:53:36 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905161753.x4GHraQi022199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Thu, 16 May 2019 17:53:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347843 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 347843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 312886B363 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 16 May 2019 17:53:37 -0000 Author: johalun Date: Thu May 16 17:53:36 2019 New Revision: 347843 URL: https://svnweb.freebsd.org/changeset/base/347843 Log: LinuxKPI: Add group_leader member to struct task_struct. Assign self as group leader at creation to act as the only member of a new process group. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/sched.h head/sys/compat/linuxkpi/common/src/linux_current.c Modified: head/sys/compat/linuxkpi/common/include/linux/sched.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/sched.h Thu May 16 17:51:30 2019 (r347842) +++ head/sys/compat/linuxkpi/common/include/linux/sched.h Thu May 16 17:53:36 2019 (r347843) @@ -80,6 +80,7 @@ struct task_struct { int rcu_recurse; int bsd_interrupt_value; struct work_struct *work; /* current work struct, if set */ + struct task_struct *group_leader; }; #define current ({ \ Modified: head/sys/compat/linuxkpi/common/src/linux_current.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_current.c Thu May 16 17:51:30 2019 (r347842) +++ head/sys/compat/linuxkpi/common/src/linux_current.c Thu May 16 17:53:36 2019 (r347843) @@ -67,6 +67,7 @@ linux_alloc_current(struct thread *td, int flags) ts->task_thread = td; ts->comm = td->td_name; ts->pid = td->td_tid; + ts->group_leader = ts; atomic_set(&ts->usage, 1); atomic_set(&ts->state, TASK_RUNNING); init_completion(&ts->parked); From owner-svn-src-head@freebsd.org Thu May 16 18:03:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35B5C15A26A6; Thu, 16 May 2019 18:03:10 +0000 (UTC) (envelope-from johalun@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 CFED66C1CE; Thu, 16 May 2019 18:03:09 +0000 (UTC) (envelope-from johalun@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 AAD24246AC; Thu, 16 May 2019 18:03:09 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4GI39g5027844; Thu, 16 May 2019 18:03:09 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GI39lR027843; Thu, 16 May 2019 18:03:09 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905161803.x4GI39lR027843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Thu, 16 May 2019 18:03:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347852 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 347852 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CFED66C1CE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 16 May 2019 18:03:10 -0000 Author: johalun Date: Thu May 16 18:03:08 2019 New Revision: 347852 URL: https://svnweb.freebsd.org/changeset/base/347852 Log: LinuxKPI: Updates to tasklets for Linux 5.0. DRM drivers expect tasklets to have a counter for enable/disable calls. Also, add a few more tasklet locking functions. This patch is part of D19565 Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h head/sys/compat/linuxkpi/common/src/linux_tasklet.c Modified: head/sys/compat/linuxkpi/common/include/linux/interrupt.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/interrupt.h Thu May 16 18:02:09 2019 (r347851) +++ head/sys/compat/linuxkpi/common/include/linux/interrupt.h Thu May 16 18:03:08 2019 (r347852) @@ -189,11 +189,14 @@ typedef void tasklet_func_t(unsigned long); struct tasklet_struct { TAILQ_ENTRY(tasklet_struct) entry; tasklet_func_t *func; + /* Our "state" implementation is different. Avoid same name as Linux. */ + volatile u_int tasklet_state; + atomic_t count; unsigned long data; }; #define DECLARE_TASKLET(name, func, data) \ -struct tasklet_struct name = { { NULL, NULL }, func, data } +struct tasklet_struct name = { { NULL, NULL }, func, ATOMIC_INIT(0), data } #define tasklet_hi_schedule(t) tasklet_schedule(t) @@ -203,5 +206,8 @@ extern void tasklet_init(struct tasklet_struct *, task unsigned long data); extern void tasklet_enable(struct tasklet_struct *); extern void tasklet_disable(struct tasklet_struct *); +extern int tasklet_trylock(struct tasklet_struct *); +extern void tasklet_unlock(struct tasklet_struct *); +extern void tasklet_unlock_wait(struct tasklet_struct *ts); #endif /* _LINUX_INTERRUPT_H_ */ Modified: head/sys/compat/linuxkpi/common/src/linux_tasklet.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_tasklet.c Thu May 16 18:02:09 2019 (r347851) +++ head/sys/compat/linuxkpi/common/src/linux_tasklet.c Thu May 16 18:03:08 2019 (r347852) @@ -41,20 +41,22 @@ __FBSDID("$FreeBSD$"); #define TASKLET_ST_BUSY 1 #define TASKLET_ST_EXEC 2 #define TASKLET_ST_LOOP 3 -#define TASKLET_ST_PAUSED 4 #define TASKLET_ST_CMPSET(ts, old, new) \ - atomic_cmpset_ptr((volatile uintptr_t *)&(ts)->entry.tqe_prev, old, new) + atomic_cmpset_int((volatile u_int *)&(ts)->tasklet_state, old, new) #define TASKLET_ST_SET(ts, new) \ - WRITE_ONCE(*(volatile uintptr_t *)&(ts)->entry.tqe_prev, new) + WRITE_ONCE(*(volatile u_int *)&(ts)->tasklet_state, new) #define TASKLET_ST_GET(ts) \ - READ_ONCE(*(volatile uintptr_t *)&(ts)->entry.tqe_prev) + READ_ONCE(*(volatile u_int *)&(ts)->tasklet_state) +#define TASKLET_ST_TESTANDSET(ts, new) \ + atomic_testandset_int((volatile u_int *)&(ts)->tasklet_state, new) + struct tasklet_worker { struct mtx mtx; - TAILQ_HEAD(, tasklet_struct) head; + TAILQ_HEAD(tasklet_list, tasklet_struct) head; struct grouptask gtask; } __aligned(CACHE_LINE_SIZE); @@ -68,25 +70,34 @@ tasklet_handler(void *arg) { struct tasklet_worker *tw = (struct tasklet_worker *)arg; struct tasklet_struct *ts; + struct tasklet_struct *last; linux_set_current(curthread); TASKLET_WORKER_LOCK(tw); + last = TAILQ_LAST(&tw->head, tasklet_list); while (1) { ts = TAILQ_FIRST(&tw->head); if (ts == NULL) break; TAILQ_REMOVE(&tw->head, ts, entry); - TASKLET_WORKER_UNLOCK(tw); - do { - /* reset executing state */ - TASKLET_ST_SET(ts, TASKLET_ST_EXEC); + if (!atomic_read(&ts->count)) { + TASKLET_WORKER_UNLOCK(tw); + do { + /* reset executing state */ + TASKLET_ST_SET(ts, TASKLET_ST_EXEC); - ts->func(ts->data); + ts->func(ts->data); - } while (TASKLET_ST_CMPSET(ts, TASKLET_ST_EXEC, TASKLET_ST_IDLE) == 0); - TASKLET_WORKER_LOCK(tw); + } while (TASKLET_ST_CMPSET(ts, TASKLET_ST_EXEC, + TASKLET_ST_IDLE) == 0); + TASKLET_WORKER_LOCK(tw); + } else { + TAILQ_INSERT_TAIL(&tw->head, ts, entry); + } + if (ts == last) + break; } TASKLET_WORKER_UNLOCK(tw); } @@ -140,6 +151,8 @@ tasklet_init(struct tasklet_struct *ts, ts->entry.tqe_next = NULL; ts->func = func; ts->data = data; + atomic_set_int(&ts->tasklet_state, TASKLET_ST_IDLE); + atomic_set(&ts->count, 0); } void @@ -158,6 +171,10 @@ void tasklet_schedule(struct tasklet_struct *ts) { + /* tasklet is paused */ + if (atomic_read(&ts->count)) + return; + if (TASKLET_ST_CMPSET(ts, TASKLET_ST_EXEC, TASKLET_ST_LOOP)) { /* tasklet_handler() will loop */ } else if (TASKLET_ST_CMPSET(ts, TASKLET_ST_IDLE, TASKLET_ST_BUSY)) { @@ -201,17 +218,39 @@ tasklet_kill(struct tasklet_struct *ts) void tasklet_enable(struct tasklet_struct *ts) { - (void) TASKLET_ST_CMPSET(ts, TASKLET_ST_PAUSED, TASKLET_ST_IDLE); + + atomic_dec(&ts->count); } void tasklet_disable(struct tasklet_struct *ts) { - while (1) { - if (TASKLET_ST_GET(ts) == TASKLET_ST_PAUSED) - break; - if (TASKLET_ST_CMPSET(ts, TASKLET_ST_IDLE, TASKLET_ST_PAUSED)) - break; + + atomic_inc(&ts->count); + tasklet_unlock_wait(ts); +} + +int +tasklet_trylock(struct tasklet_struct *ts) +{ + + return (!TASKLET_ST_TESTANDSET(ts, TASKLET_ST_BUSY)); +} + +void +tasklet_unlock(struct tasklet_struct *ts) +{ + + TASKLET_ST_SET(ts, TASKLET_ST_IDLE); +} + +void +tasklet_unlock_wait(struct tasklet_struct *ts) +{ + + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "tasklet_kill() can sleep"); + + /* wait until tasklet is no longer busy */ + while (TASKLET_ST_GET(ts) != TASKLET_ST_IDLE) pause("W", 1); - } } From owner-svn-src-head@freebsd.org Thu May 16 18:54:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96DC415A4B2D; Thu, 16 May 2019 18:54:21 +0000 (UTC) (envelope-from roberto@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 395CC7059E; Thu, 16 May 2019 18:54:21 +0000 (UTC) (envelope-from roberto@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 1354524F46; Thu, 16 May 2019 18:54:21 +0000 (UTC) (envelope-from roberto@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4GIsKtv056802; Thu, 16 May 2019 18:54:20 GMT (envelope-from roberto@FreeBSD.org) Received: (from roberto@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GIsKvr056801; Thu, 16 May 2019 18:54:20 GMT (envelope-from roberto@FreeBSD.org) Message-Id: <201905161854.x4GIsKvr056801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: roberto set sender to roberto@FreeBSD.org using -f From: Ollivier Robert Date: Thu, 16 May 2019 18:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347886 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: roberto X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 347886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 395CC7059E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 16 May 2019 18:54:21 -0000 Author: roberto Date: Thu May 16 18:54:20 2019 New Revision: 347886 URL: https://svnweb.freebsd.org/changeset/base/347886 Log: Announce OpenBSD 6.5. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Thu May 16 18:50:18 2019 (r347885) +++ head/share/misc/bsd-family-tree Thu May 16 18:54:20 2019 (r347886) @@ -379,6 +379,7 @@ FreeBSD 5.2 | | | | | | | | DragonFly 5.4.0 *--FreeBSD | | v | | | 12.0 | | | DragonFly 5.4.1 + | | | OpenBSD 6.5 | | | | | | FreeBSD 13 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -761,6 +762,7 @@ OpenBSD 6.4 2018-10-18 [OBD] DragonFly 5.4.0 2018-12-03 [DFB] FreeBSD 12.0 2018-12-11 [FBD] DragonFly 5.4.1 2018-12-24 [DFB] +OpenBSD 6.5 2019-05-01 [OBD] Bibliography ------------------------ From owner-svn-src-head@freebsd.org Thu May 16 19:09:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37A0F15A4EF0; Thu, 16 May 2019 19:09:42 +0000 (UTC) (envelope-from hrs@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 D075670BF5; Thu, 16 May 2019 19:09:41 +0000 (UTC) (envelope-from hrs@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 AA9F925106; Thu, 16 May 2019 19:09:41 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4GJ9fl3062584; Thu, 16 May 2019 19:09:41 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GJ9fN0062583; Thu, 16 May 2019 19:09:41 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201905161909.x4GJ9fN0062583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Thu, 16 May 2019 19:09:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347887 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: hrs X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 347887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D075670BF5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 16 May 2019 19:09:42 -0000 Author: hrs Date: Thu May 16 19:09:41 2019 New Revision: 347887 URL: https://svnweb.freebsd.org/changeset/base/347887 Log: Fix hostname to be returned in an ICMPv6 NI Reply message defined in RFC 4620, ICMPv6 Node Information Queries. A vnet jail with an IPv6 address sent a hostname of the host environment, not the jail, even if another hostname was set to the jail. This change can be tested by the following commands: # ifconfig epair0 create # jail -c -n j1 vnet host.hostname=vnetjail path=/ persist # ifconfig epair0b vnet j1 # ifconfig epair0a inet6 -ifdisabled auto_linklocal up # jexec j1 ifconfig epair0b inet6 -ifdisabled auto_linklocal up # ping6 -w ff02::1%epair0a Differential Revision: https://reviews.freebsd.org/D20207 MFC after: 1 week Modified: head/sys/netinet6/icmp6.c Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Thu May 16 18:54:20 2019 (r347886) +++ head/sys/netinet6/icmp6.c Thu May 16 19:09:41 2019 (r347887) @@ -140,7 +140,7 @@ static int icmp6_rip6_input(struct mbuf **, int); static int icmp6_ratelimit(const struct in6_addr *, const int, const int); static const char *icmp6_redirect_diag(struct in6_addr *, struct in6_addr *, struct in6_addr *); -static struct mbuf *ni6_input(struct mbuf *, int); +static struct mbuf *ni6_input(struct mbuf *, int, struct prison *); static struct mbuf *ni6_nametodns(const char *, int, int); static int ni6_dnsmatch(const char *, int, const char *, int); static int ni6_addrs(struct icmp6_nodeinfo *, struct mbuf *, @@ -627,6 +627,7 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) case ICMP6_WRUREQUEST: /* ICMP6_FQDN_QUERY */ { enum { WRU, FQDN } mode; + struct prison *pr; if (!V_icmp6_nodeinfo) break; @@ -638,6 +639,14 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) else goto badlen; + pr = NULL; + sx_slock(&allprison_lock); + TAILQ_FOREACH(pr, &allprison, pr_list) + if (pr->pr_vnet == ifp->if_vnet) + break; + sx_sunlock(&allprison_lock); + if (pr == NULL) + pr = curthread->td_ucred->cr_prison; if (mode == FQDN) { #ifndef PULLDOWN_TEST IP6_EXTHDR_CHECK(m, off, sizeof(struct icmp6_nodeinfo), @@ -645,11 +654,10 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) #endif n = m_copym(m, 0, M_COPYALL, M_NOWAIT); if (n) - n = ni6_input(n, off); + n = ni6_input(n, off, pr); /* XXX meaningless if n == NULL */ noff = sizeof(struct ip6_hdr); } else { - struct prison *pr; u_char *p; int maxhlen, hlen; @@ -683,13 +691,6 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) n = NULL; break; } - maxhlen = M_TRAILINGSPACE(n) - - (sizeof(*nip6) + sizeof(*nicmp6) + 4); - pr = curthread->td_ucred->cr_prison; - mtx_lock(&pr->pr_mtx); - hlen = strlen(pr->pr_hostname); - if (maxhlen > hlen) - maxhlen = hlen; /* * Copy IPv6 and ICMPv6 only. */ @@ -699,6 +700,13 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) bcopy(icmp6, nicmp6, sizeof(struct icmp6_hdr)); p = (u_char *)(nicmp6 + 1); bzero(p, 4); + + maxhlen = M_TRAILINGSPACE(n) - + (sizeof(*nip6) + sizeof(*nicmp6) + 4); + mtx_lock(&pr->pr_mtx); + hlen = strlen(pr->pr_hostname); + if (maxhlen > hlen) + maxhlen = hlen; /* meaningless TTL */ bcopy(pr->pr_hostname, p + 4, maxhlen); mtx_unlock(&pr->pr_mtx); @@ -1167,11 +1175,10 @@ icmp6_mtudisc_update(struct ip6ctlparam *ip6cp, int va * with hostname changes by sethostname(3) */ static struct mbuf * -ni6_input(struct mbuf *m, int off) +ni6_input(struct mbuf *m, int off, struct prison *pr) { struct icmp6_nodeinfo *ni6, *nni6; struct mbuf *n = NULL; - struct prison *pr; u_int16_t qtype; int subjlen; int replylen = sizeof(struct ip6_hdr) + sizeof(struct icmp6_nodeinfo); @@ -1323,7 +1330,6 @@ ni6_input(struct mbuf *m, int off) * wildcard match, if gethostname(3) side has * truncated hostname. */ - pr = curthread->td_ucred->cr_prison; mtx_lock(&pr->pr_mtx); n = ni6_nametodns(pr->pr_hostname, strlen(pr->pr_hostname), 0); @@ -1448,7 +1454,6 @@ ni6_input(struct mbuf *m, int off) /* * XXX do we really have FQDN in hostname? */ - pr = curthread->td_ucred->cr_prison; mtx_lock(&pr->pr_mtx); n->m_next = ni6_nametodns(pr->pr_hostname, strlen(pr->pr_hostname), oldfqdn); From owner-svn-src-head@freebsd.org Thu May 16 19:10:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F74015A4F9A; Thu, 16 May 2019 19:10: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 A7A1A70DC1; Thu, 16 May 2019 19:10:49 +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 7E30C2513D; Thu, 16 May 2019 19:10:49 +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 x4GJAnfa062697; Thu, 16 May 2019 19:10:49 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GJAndf062696; Thu, 16 May 2019 19:10:49 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905161910.x4GJAndf062696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 16 May 2019 19:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347888 - in head/sys/mips: include mips X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/mips: include mips X-SVN-Commit-Revision: 347888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A7A1A70DC1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Thu, 16 May 2019 19:10:50 -0000 Author: cem Date: Thu May 16 19:10:48 2019 New Revision: 347888 URL: https://svnweb.freebsd.org/changeset/base/347888 Log: mips: Implement basic pmap_kenter_device, pmap_kremove_device Unbreak mips.BERI_DE4_SDROOT build, which uses device xdma. Device xdma depends on the pmap_kenter_device APIs. Reported by: tinderbox (local) Sponsored by: Dell EMC Isilon Modified: head/sys/mips/include/pmap.h head/sys/mips/mips/pmap.c Modified: head/sys/mips/include/pmap.h ============================================================================== --- head/sys/mips/include/pmap.h Thu May 16 19:09:41 2019 (r347887) +++ head/sys/mips/include/pmap.h Thu May 16 19:10:48 2019 (r347888) @@ -177,7 +177,9 @@ void pmap_unmapdev(vm_offset_t, vm_size_t); vm_offset_t pmap_steal_memory(vm_size_t size); void pmap_kenter(vm_offset_t va, vm_paddr_t pa); void pmap_kenter_attr(vm_offset_t va, vm_paddr_t pa, vm_memattr_t attr); +void pmap_kenter_device(vm_offset_t, vm_size_t, vm_paddr_t); void pmap_kremove(vm_offset_t va); +void pmap_kremove_device(vm_offset_t, vm_size_t); void *pmap_kenter_temporary(vm_paddr_t pa, int i); void pmap_kenter_temporary_free(vm_paddr_t pa); void pmap_flush_pvcache(vm_page_t m); Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Thu May 16 19:09:41 2019 (r347887) +++ head/sys/mips/mips/pmap.c Thu May 16 19:10:48 2019 (r347888) @@ -854,6 +854,44 @@ pmap_kenter(vm_offset_t va, vm_paddr_t pa) pmap_kenter_attr(va, pa, VM_MEMATTR_DEFAULT); } +void +pmap_kenter_device(vm_offset_t va, vm_size_t size, vm_paddr_t pa) +{ + + KASSERT((size & PAGE_MASK) == 0, + ("%s: device mapping not page-sized", __func__)); + + for (; size > 0; size -= PAGE_SIZE) { + /* + * XXXCEM: this is somewhat inefficient on SMP systems in that + * every single page is individually TLB-invalidated via + * rendezvous (pmap_update_page()), instead of invalidating the + * entire range via a single rendezvous. + */ + pmap_kenter_attr(va, pa, VM_MEMATTR_UNCACHEABLE); + va += PAGE_SIZE; + pa += PAGE_SIZE; + } +} + +void +pmap_kremove_device(vm_offset_t va, vm_size_t size) +{ + + KASSERT((size & PAGE_MASK) == 0, + ("%s: device mapping not page-sized", __func__)); + + /* + * XXXCEM: Similar to pmap_kenter_device, this is inefficient on SMP, + * in that pages are invalidated individually instead of a single range + * rendezvous. + */ + for (; size > 0; size -= PAGE_SIZE) { + pmap_kremove(va); + va += PAGE_SIZE; + } +} + /* * remove a page from the kernel pagetables */ From owner-svn-src-head@freebsd.org Thu May 16 19:32:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 143CD15A59CF; Thu, 16 May 2019 19:32:12 +0000 (UTC) (envelope-from johalun@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 A54D071AFF; Thu, 16 May 2019 19:32:11 +0000 (UTC) (envelope-from johalun@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 7BAB825611; Thu, 16 May 2019 19:32:11 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4GJWBYB077722; Thu, 16 May 2019 19:32:11 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GJWBYo077721; Thu, 16 May 2019 19:32:11 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905161932.x4GJWBYo077721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Thu, 16 May 2019 19:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347889 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 347889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A54D071AFF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Thu, 16 May 2019 19:32:12 -0000 Author: johalun Date: Thu May 16 19:32:11 2019 New Revision: 347889 URL: https://svnweb.freebsd.org/changeset/base/347889 Log: LinuxKPI: Fix build on powerpc/sparc. Use cmpset instead of testandset in tasklet lock code. Reviewed by: hps Approved by: imp (mentor), hps Obtained from: hps MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/src/linux_tasklet.c Modified: head/sys/compat/linuxkpi/common/src/linux_tasklet.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_tasklet.c Thu May 16 19:10:48 2019 (r347888) +++ head/sys/compat/linuxkpi/common/src/linux_tasklet.c Thu May 16 19:32:11 2019 (r347889) @@ -51,9 +51,6 @@ __FBSDID("$FreeBSD$"); #define TASKLET_ST_GET(ts) \ READ_ONCE(*(volatile u_int *)&(ts)->tasklet_state) -#define TASKLET_ST_TESTANDSET(ts, new) \ - atomic_testandset_int((volatile u_int *)&(ts)->tasklet_state, new) - struct tasklet_worker { struct mtx mtx; TAILQ_HEAD(tasklet_list, tasklet_struct) head; @@ -234,7 +231,7 @@ int tasklet_trylock(struct tasklet_struct *ts) { - return (!TASKLET_ST_TESTANDSET(ts, TASKLET_ST_BUSY)); + return (TASKLET_ST_CMPSET(ts, TASKLET_ST_IDLE, TASKLET_ST_BUSY)); } void From owner-svn-src-head@freebsd.org Thu May 16 20:41:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9433215A6E75; Thu, 16 May 2019 20:41:30 +0000 (UTC) (envelope-from tychon@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 39FD173AB4; Thu, 16 May 2019 20:41:30 +0000 (UTC) (envelope-from tychon@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 C3AED260A9; Thu, 16 May 2019 20:41:29 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4GKfTQx013356; Thu, 16 May 2019 20:41:29 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GKfTwb013353; Thu, 16 May 2019 20:41:29 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201905162041.x4GKfTwb013353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Thu, 16 May 2019 20:41:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347890 - in head/sys/dev: aac bge X-SVN-Group: head X-SVN-Commit-Author: tychon X-SVN-Commit-Paths: in head/sys/dev: aac bge X-SVN-Commit-Revision: 347890 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 39FD173AB4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Thu, 16 May 2019 20:41:30 -0000 Author: tychon Date: Thu May 16 20:41:28 2019 New Revision: 347890 URL: https://svnweb.freebsd.org/changeset/base/347890 Log: reinstate 4GB DMA boundary workarounds for bge and aac Reviewed by: kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20277 Modified: head/sys/dev/aac/aac_pci.c head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/aac/aac_pci.c ============================================================================== --- head/sys/dev/aac/aac_pci.c Thu May 16 19:32:11 2019 (r347889) +++ head/sys/dev/aac/aac_pci.c Thu May 16 20:41:28 2019 (r347890) @@ -443,7 +443,8 @@ aac_pci_attach(device_t dev) * Note that some of these controllers are 64-bit capable. */ if (bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ - PAGE_SIZE, 0, /* algnmnt, boundary */ + PAGE_SIZE, /* algnmnt */ + ((bus_size_t)((uint64_t)1 << 32)), /* boundary*/ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Thu May 16 19:32:11 2019 (r347889) +++ head/sys/dev/bge/if_bge.c Thu May 16 20:41:28 2019 (r347890) @@ -2927,10 +2927,14 @@ bge_dma_ring_alloc(struct bge_softc *sc, bus_size_t al bus_addr_t *paddr, const char *msg) { struct bge_dmamap_arg ctx; + bus_addr_t lowaddr; + bus_size_t ring_end; int error; + lowaddr = BUS_SPACE_MAXADDR; +again: error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, - alignment, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, + alignment, 0, lowaddr, BUS_SPACE_MAXADDR, NULL, NULL, maxsize, 1, maxsize, 0, NULL, NULL, tag); if (error != 0) { device_printf(sc->bge_dev, @@ -2955,6 +2959,25 @@ bge_dma_ring_alloc(struct bge_softc *sc, bus_size_t al return (ENOMEM); } *paddr = ctx.bge_busaddr; + ring_end = *paddr + maxsize; + if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0 && + BGE_ADDR_HI(*paddr) != BGE_ADDR_HI(ring_end)) { + /* + * 4GB boundary crossed. Limit maximum allowable DMA + * address space to 32bit and try again. + */ + bus_dmamap_unload(*tag, *map); + bus_dmamem_free(*tag, *ring, *map); + bus_dma_tag_destroy(*tag); + if (bootverbose) + device_printf(sc->bge_dev, "4GB boundary crossed, " + "limit DMA address space to 32bit for %s\n", msg); + *ring = NULL; + *tag = NULL; + *map = NULL; + lowaddr = BUS_SPACE_MAXADDR_32BIT; + goto again; + } return (0); } @@ -2962,7 +2985,7 @@ static int bge_dma_alloc(struct bge_softc *sc) { bus_addr_t lowaddr; - bus_size_t rxmaxsegsz, sbsz, txsegsz, txmaxsegsz; + bus_size_t boundary, sbsz, rxmaxsegsz, txsegsz, txmaxsegsz; int i, error; lowaddr = BUS_SPACE_MAXADDR; @@ -3049,7 +3072,9 @@ bge_dma_alloc(struct bge_softc *sc) } /* Create parent tag for buffers. */ + boundary = 0; if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0) { + boundary = BGE_DMA_BNDRY; /* * XXX * watchdog timeout issue was observed on BCM5704 which @@ -3060,10 +3085,10 @@ bge_dma_alloc(struct bge_softc *sc) if (sc->bge_pcixcap != 0) lowaddr = BUS_SPACE_MAXADDR_32BIT; } - error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), 1, 0, lowaddr, - BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 0, - BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, - &sc->bge_cdata.bge_buffer_tag); + error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), + 1, boundary, lowaddr, BUS_SPACE_MAXADDR, NULL, + NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, + 0, NULL, NULL, &sc->bge_cdata.bge_buffer_tag); if (error != 0) { device_printf(sc->bge_dev, "could not allocate buffer dma tag\n"); Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Thu May 16 19:32:11 2019 (r347889) +++ head/sys/dev/bge/if_bgereg.h Thu May 16 20:41:28 2019 (r347890) @@ -2866,6 +2866,12 @@ struct bge_gib { #define BGE_DMA_MAXADDR 0xFFFFFFFFFF #endif +#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) +#define BGE_DMA_BNDRY 0x100000000 +#else +#define BGE_DMA_BNDRY 0 +#endif + /* * Ring structures. Most of these reside in host memory and we tell * the NIC where they are via the ring control blocks. The exceptions From owner-svn-src-head@freebsd.org Thu May 16 21:07:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C5F415A76EA; Thu, 16 May 2019 21:07:38 +0000 (UTC) (envelope-from johalun@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 D23C774B38; Thu, 16 May 2019 21:07:37 +0000 (UTC) (envelope-from johalun@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 AAD4C2657F; Thu, 16 May 2019 21:07:37 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4GL7bNS025311; Thu, 16 May 2019 21:07:37 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GL7bno025310; Thu, 16 May 2019 21:07:37 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905162107.x4GL7bno025310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Thu, 16 May 2019 21:07:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347891 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 347891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D23C774B38 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; 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: Thu, 16 May 2019 21:07:38 -0000 Author: johalun Date: Thu May 16 21:07:37 2019 New Revision: 347891 URL: https://svnweb.freebsd.org/changeset/base/347891 Log: LinuxKPI: Add in_task macro. This patch is part of D19565 Reviewed by: hps, bwidawsk Approved by: imp (mentor), hps Obtained from: bwidawsk MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/preempt.h Modified: head/sys/compat/linuxkpi/common/include/linux/preempt.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/preempt.h Thu May 16 20:41:28 2019 (r347890) +++ head/sys/compat/linuxkpi/common/include/linux/preempt.h Thu May 16 21:07:37 2019 (r347891) @@ -34,6 +34,8 @@ #define in_interrupt() \ (curthread->td_intr_nesting_level || curthread->td_critnest) +#define in_task() (curthread->td_priority >= PI_SOFT) + #define preempt_disable() critical_enter() #define preempt_enable() critical_exit() From owner-svn-src-head@freebsd.org Thu May 16 21:17:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69E9515A7A4B; Thu, 16 May 2019 21:17:19 +0000 (UTC) (envelope-from johalun@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 0140D750B2; Thu, 16 May 2019 21:17:19 +0000 (UTC) (envelope-from johalun@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 CA19F26727; Thu, 16 May 2019 21:17:18 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4GLHIO8030292; Thu, 16 May 2019 21:17:18 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GLHIDC030290; Thu, 16 May 2019 21:17:18 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905162117.x4GLHIDC030290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Thu, 16 May 2019 21:17:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347892 - in head/sys: compat/linuxkpi/common/include/linux modules/linuxkpi X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux modules/linuxkpi X-SVN-Commit-Revision: 347892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0140D750B2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; 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: Thu, 16 May 2019 21:17:19 -0000 Author: johalun Date: Thu May 16 21:17:18 2019 New Revision: 347892 URL: https://svnweb.freebsd.org/changeset/base/347892 Log: LinuxKPI: Finalize import of seq_file. seq_file.h and linux_seq_file.c was imported form ports earlier but linux_seq_file.c was never compiled in with the module. With this commit base seq_file will replace ports seq_file and it required a few modifications to not break functionality and build. Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/seq_file.h head/sys/modules/linuxkpi/Makefile Modified: head/sys/compat/linuxkpi/common/include/linux/seq_file.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/seq_file.h Thu May 16 21:07:37 2019 (r347891) +++ head/sys/compat/linuxkpi/common/include/linux/seq_file.h Thu May 16 21:17:18 2019 (r347892) @@ -30,13 +30,29 @@ #ifndef _LINUX_SEQ_FILE_H_ #define _LINUX_SEQ_FILE_H_ +#include +#include #include -struct seq_operations; -struct linux_file; - +#undef file #define inode vnode +#define DEFINE_SHOW_ATTRIBUTE(__name) \ +static int __name ## _open(struct inode *inode, struct linux_file *file) \ +{ \ + return single_open(file, __name ## _show, inode->i_private); \ +} \ + \ +static const struct file_operations __name ## _fops = { \ + .owner = THIS_MODULE, \ + .open = __name ## _open, \ + .read = seq_read, \ + .llseek = seq_lseek, \ + .release = single_release, \ +} + +struct seq_operations; + struct seq_file { struct sbuf *buf; @@ -67,5 +83,6 @@ int single_release(struct inode *, struct linux_file * #define seq_puts(m, str) sbuf_printf((m)->buf, str) #define seq_putc(m, str) sbuf_putc((m)->buf, str) +#define file linux_file #endif /* _LINUX_SEQ_FILE_H_ */ Modified: head/sys/modules/linuxkpi/Makefile ============================================================================== --- head/sys/modules/linuxkpi/Makefile Thu May 16 21:07:37 2019 (r347891) +++ head/sys/modules/linuxkpi/Makefile Thu May 16 21:17:18 2019 (r347892) @@ -13,6 +13,7 @@ SRCS= linux_compat.c \ linux_pci.c \ linux_radix.c \ linux_rcu.c \ + linux_seq_file.c \ linux_schedule.c \ linux_slab.c \ linux_tasklet.c \ From owner-svn-src-head@freebsd.org Thu May 16 21:24:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BBA915A7C62; Thu, 16 May 2019 21:24:04 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 DA6D4754F3; Thu, 16 May 2019 21:24:03 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [176.74.212.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 2E68E260237; Thu, 16 May 2019 23:24:01 +0200 (CEST) Subject: Re: svn commit: r347890 - in head/sys/dev: aac bge To: Tycho Nightingale , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905162041.x4GKfTwb013353@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <9aeac9a0-5816-51d1-c965-3764f5822382@selasky.org> Date: Thu, 16 May 2019 23:23:31 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201905162041.x4GKfTwb013353@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: DA6D4754F3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; 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: Thu, 16 May 2019 21:24:04 -0000 On 2019-05-16 22:41, Tycho Nightingale wrote: > Author: tychon > Date: Thu May 16 20:41:28 2019 > New Revision: 347890 > URL: https://svnweb.freebsd.org/changeset/base/347890 > > Log: > reinstate 4GB DMA boundary workarounds for bge and aac > > Reviewed by: kib > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D20277 > > Modified: > head/sys/dev/aac/aac_pci.c > head/sys/dev/bge/if_bge.c > head/sys/dev/bge/if_bgereg.h > > Modified: head/sys/dev/aac/aac_pci.c > ============================================================================== > --- head/sys/dev/aac/aac_pci.c Thu May 16 19:32:11 2019 (r347889) > +++ head/sys/dev/aac/aac_pci.c Thu May 16 20:41:28 2019 (r347890) > @@ -443,7 +443,8 @@ aac_pci_attach(device_t dev) > * Note that some of these controllers are 64-bit capable. > */ > if (bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ > - PAGE_SIZE, 0, /* algnmnt, boundary */ > + PAGE_SIZE, /* algnmnt */ > + ((bus_size_t)((uint64_t)1 << 32)), /* boundary*/ > BUS_SPACE_MAXADDR, /* lowaddr */ > BUS_SPACE_MAXADDR, /* highaddr */ > NULL, NULL, /* filter, filterarg */ > > Modified: head/sys/dev/bge/if_bge.c > ============================================================================== > --- head/sys/dev/bge/if_bge.c Thu May 16 19:32:11 2019 (r347889) > +++ head/sys/dev/bge/if_bge.c Thu May 16 20:41:28 2019 (r347890) > @@ -2927,10 +2927,14 @@ bge_dma_ring_alloc(struct bge_softc *sc, bus_size_t al > bus_addr_t *paddr, const char *msg) > { > struct bge_dmamap_arg ctx; > + bus_addr_t lowaddr; > + bus_size_t ring_end; > int error; > > + lowaddr = BUS_SPACE_MAXADDR; > +again: > error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, > - alignment, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, > + alignment, 0, lowaddr, BUS_SPACE_MAXADDR, NULL, > NULL, maxsize, 1, maxsize, 0, NULL, NULL, tag); > if (error != 0) { > device_printf(sc->bge_dev, > @@ -2955,6 +2959,25 @@ bge_dma_ring_alloc(struct bge_softc *sc, bus_size_t al > return (ENOMEM); > } > *paddr = ctx.bge_busaddr; > + ring_end = *paddr + maxsize; > + if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0 && > + BGE_ADDR_HI(*paddr) != BGE_ADDR_HI(ring_end)) { > + /* > + * 4GB boundary crossed. Limit maximum allowable DMA > + * address space to 32bit and try again. > + */ > + bus_dmamap_unload(*tag, *map); > + bus_dmamem_free(*tag, *ring, *map); > + bus_dma_tag_destroy(*tag); > + if (bootverbose) > + device_printf(sc->bge_dev, "4GB boundary crossed, " > + "limit DMA address space to 32bit for %s\n", msg); > + *ring = NULL; > + *tag = NULL; > + *map = NULL; > + lowaddr = BUS_SPACE_MAXADDR_32BIT; > + goto again; > + } > return (0); > } > > @@ -2962,7 +2985,7 @@ static int > bge_dma_alloc(struct bge_softc *sc) > { > bus_addr_t lowaddr; > - bus_size_t rxmaxsegsz, sbsz, txsegsz, txmaxsegsz; > + bus_size_t boundary, sbsz, rxmaxsegsz, txsegsz, txmaxsegsz; > int i, error; > > lowaddr = BUS_SPACE_MAXADDR; > @@ -3049,7 +3072,9 @@ bge_dma_alloc(struct bge_softc *sc) > } > > /* Create parent tag for buffers. */ > + boundary = 0; > if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0) { > + boundary = BGE_DMA_BNDRY; > /* > * XXX > * watchdog timeout issue was observed on BCM5704 which > @@ -3060,10 +3085,10 @@ bge_dma_alloc(struct bge_softc *sc) > if (sc->bge_pcixcap != 0) > lowaddr = BUS_SPACE_MAXADDR_32BIT; > } > - error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), 1, 0, lowaddr, > - BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 0, > - BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, > - &sc->bge_cdata.bge_buffer_tag); > + error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), > + 1, boundary, lowaddr, BUS_SPACE_MAXADDR, NULL, > + NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, > + 0, NULL, NULL, &sc->bge_cdata.bge_buffer_tag); > if (error != 0) { > device_printf(sc->bge_dev, > "could not allocate buffer dma tag\n"); > > Modified: head/sys/dev/bge/if_bgereg.h > ============================================================================== > --- head/sys/dev/bge/if_bgereg.h Thu May 16 19:32:11 2019 (r347889) > +++ head/sys/dev/bge/if_bgereg.h Thu May 16 20:41:28 2019 (r347890) > @@ -2866,6 +2866,12 @@ struct bge_gib { > #define BGE_DMA_MAXADDR 0xFFFFFFFFFF > #endif > > +#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) > +#define BGE_DMA_BNDRY 0x100000000 > +#else > +#define BGE_DMA_BNDRY 0 > +#endif > + > /* > * Ring structures. Most of these reside in host memory and we tell > * the NIC where they are via the ring control blocks. The exceptions > > /usr/src/sys/dev/bge/if_bge.c:3077: warning: large integer implicitly truncated to unsigned type [-Woverflow] --HPS From owner-svn-src-head@freebsd.org Thu May 16 21:50:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13C2E15A8318; Thu, 16 May 2019 21:50:14 +0000 (UTC) (envelope-from brd@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 A885276033; Thu, 16 May 2019 21:50:13 +0000 (UTC) (envelope-from brd@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 3B15E26C53; Thu, 16 May 2019 21:50:13 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4GLoD9s046042; Thu, 16 May 2019 21:50:13 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GLoC1u046039; Thu, 16 May 2019 21:50:12 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201905162150.x4GLoC1u046039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Thu, 16 May 2019 21:50:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347893 - in head/usr.sbin: etcupdate mergemaster X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: in head/usr.sbin: etcupdate mergemaster X-SVN-Commit-Revision: 347893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A885276033 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; 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: Thu, 16 May 2019 21:50:14 -0000 Author: brd Date: Thu May 16 21:50:12 2019 New Revision: 347893 URL: https://svnweb.freebsd.org/changeset/base/347893 Log: Fix mergemaster after r347638 and the master.passwd / group move. Check the legacy directory and use it instead if present. Install these first if using beinstall. UPDATING entry to follow. Approved by: allanjude (mentor, in person) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20279 Modified: head/usr.sbin/etcupdate/etcupdate.sh head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/etcupdate/etcupdate.sh ============================================================================== --- head/usr.sbin/etcupdate/etcupdate.sh Thu May 16 21:17:18 2019 (r347892) +++ head/usr.sbin/etcupdate/etcupdate.sh Thu May 16 21:50:12 2019 (r347893) @@ -1737,7 +1737,9 @@ WARNINGS=$WORKDIR/warnings EDITOR=${EDITOR:-/usr/bin/vi} # Files that need to be updated before installworld. -PREWORLD_FILES="etc/master.passwd etc/group" +PREWORLD_FILES="lib/libc/gen/master.passwd lib/libc/gen/group" +# If on an older tree, use it instead. Delete after 13.0. +[ -f ${SRCDIR}/etc/master.passwd ] && PREWORLD_FILES="etc/master.passwd etc/group" # Handle command-specific argument processing such as complaining # about unsupported options. Since the configuration file is always Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Thu May 16 21:17:18 2019 (r347892) +++ head/usr.sbin/mergemaster/mergemaster.sh Thu May 16 21:50:12 2019 (r347893) @@ -669,9 +669,12 @@ case "${RERUN}" in ;; *) # Only set up files that are crucial to {build|install}world - { mkdir -p ${TEMPROOT}/etc && - cp -p ${SOURCEDIR}/etc/master.passwd ${TEMPROOT}/etc && - install -p -o root -g wheel -m 0644 ${SOURCEDIR}/etc/group ${TEMPROOT}/etc;} || + { MM_PASSDIR="${SOURCEDIR}/lib/libc/gen" + # If on an older tree, use it instead. Delete after 13.0. + [ -f ${SOURCEDIR}/etc/master.passwd ] && MM_PASSDIR="${SOURCEDIR}/etc" + mkdir -p ${TEMPROOT}/etc && + cp -p ${MM_PASSDIR}/master.passwd ${TEMPROOT}/etc && + install -p -o root -g wheel -m 0644 ${MM_PASSDIR}/group ${TEMPROOT}/etc;} || { echo ''; echo ' *** FATAL ERROR: Cannot copy files to the temproot environment'; echo ''; From owner-svn-src-head@freebsd.org Thu May 16 22:20:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F15015A8AA5; Thu, 16 May 2019 22:20:59 +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 482F676EDB; Thu, 16 May 2019 22:20:59 +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 0817A271A5; Thu, 16 May 2019 22:20:59 +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 x4GMKxKe064256; Thu, 16 May 2019 22:20:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GMKt2W064234; Thu, 16 May 2019 22:20:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905162220.x4GMKt2W064234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 16 May 2019 22:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347895 - in head: lib/libc/amd64/sys lib/libc/x86/gen lib/libc/x86/sys sys/amd64/amd64 sys/amd64/linux sys/amd64/linux32 sys/arm64/include sys/cddl/dev/dtrace/amd64 sys/dev/random sys/... X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libc/amd64/sys lib/libc/x86/gen lib/libc/x86/sys sys/amd64/amd64 sys/amd64/linux sys/amd64/linux32 sys/arm64/include sys/cddl/dev/dtrace/amd64 sys/dev/random sys/i386/i386 sys/x86/include X-SVN-Commit-Revision: 347895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 482F676EDB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Thu, 16 May 2019 22:21:00 -0000 Author: kib Date: Thu May 16 22:20:54 2019 New Revision: 347895 URL: https://svnweb.freebsd.org/changeset/base/347895 Log: Remove resolver_qual from DEFINE_IFUNC/DEFINE_UIFUNC macros. In all practical situations, the resolver visibility is static. Requested by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: so (emaste) Differential revision: https://reviews.freebsd.org/D20281 Modified: head/lib/libc/amd64/sys/amd64_get_fsbase.c head/lib/libc/amd64/sys/amd64_get_gsbase.c head/lib/libc/amd64/sys/amd64_set_fsbase.c head/lib/libc/amd64/sys/amd64_set_gsbase.c head/lib/libc/x86/gen/getcontextx.c head/lib/libc/x86/sys/__vdso_gettc.c head/lib/libc/x86/sys/pkru.c head/sys/amd64/amd64/copyout.c head/sys/amd64/amd64/fpu.c head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/pmap.c head/sys/amd64/linux/linux_machdep.c head/sys/amd64/linux32/linux32_machdep.c head/sys/arm64/include/ifunc.h head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c head/sys/dev/random/ivy.c head/sys/i386/i386/npx.c head/sys/i386/i386/pmap_base.c head/sys/x86/include/ifunc.h Modified: head/lib/libc/amd64/sys/amd64_get_fsbase.c ============================================================================== --- head/lib/libc/amd64/sys/amd64_get_fsbase.c Thu May 16 22:03:25 2019 (r347894) +++ head/lib/libc/amd64/sys/amd64_get_fsbase.c Thu May 16 22:20:54 2019 (r347895) @@ -57,7 +57,7 @@ amd64_get_fsbase_syscall(void **addr) return (sysarch(AMD64_GET_FSBASE, addr)); } -DEFINE_UIFUNC(, int, amd64_get_fsbase, (void **), static) +DEFINE_UIFUNC(, int, amd64_get_fsbase, (void **)) { if (__getosreldate() >= P_OSREL_WRFSBASE && Modified: head/lib/libc/amd64/sys/amd64_get_gsbase.c ============================================================================== --- head/lib/libc/amd64/sys/amd64_get_gsbase.c Thu May 16 22:03:25 2019 (r347894) +++ head/lib/libc/amd64/sys/amd64_get_gsbase.c Thu May 16 22:20:54 2019 (r347895) @@ -57,7 +57,7 @@ amd64_get_gsbase_syscall(void **addr) return (sysarch(AMD64_GET_GSBASE, addr)); } -DEFINE_UIFUNC(, int, amd64_get_gsbase, (void **), static) +DEFINE_UIFUNC(, int, amd64_get_gsbase, (void **)) { if (__getosreldate() >= P_OSREL_WRFSBASE && Modified: head/lib/libc/amd64/sys/amd64_set_fsbase.c ============================================================================== --- head/lib/libc/amd64/sys/amd64_set_fsbase.c Thu May 16 22:03:25 2019 (r347894) +++ head/lib/libc/amd64/sys/amd64_set_fsbase.c Thu May 16 22:20:54 2019 (r347895) @@ -57,7 +57,7 @@ amd64_set_fsbase_syscall(void *addr) return (sysarch(AMD64_SET_FSBASE, &addr)); } -DEFINE_UIFUNC(, int, amd64_set_fsbase, (void *), static) +DEFINE_UIFUNC(, int, amd64_set_fsbase, (void *)) { if (__getosreldate() >= P_OSREL_WRFSBASE && Modified: head/lib/libc/amd64/sys/amd64_set_gsbase.c ============================================================================== --- head/lib/libc/amd64/sys/amd64_set_gsbase.c Thu May 16 22:03:25 2019 (r347894) +++ head/lib/libc/amd64/sys/amd64_set_gsbase.c Thu May 16 22:20:54 2019 (r347895) @@ -57,7 +57,7 @@ amd64_set_gsbase_syscall(void *addr) return (sysarch(AMD64_SET_GSBASE, &addr)); } -DEFINE_UIFUNC(, int, amd64_set_gsbase, (void *), static) +DEFINE_UIFUNC(, int, amd64_set_gsbase, (void *)) { if (__getosreldate() >= P_OSREL_WRFSBASE && Modified: head/lib/libc/x86/gen/getcontextx.c ============================================================================== --- head/lib/libc/x86/gen/getcontextx.c Thu May 16 22:03:25 2019 (r347894) +++ head/lib/libc/x86/gen/getcontextx.c Thu May 16 22:20:54 2019 (r347895) @@ -61,7 +61,7 @@ __getcontextx_size_xfpu(void) return (sizeof(ucontext_t) + xstate_sz); } -DEFINE_UIFUNC(, int, __getcontextx_size, (void), static) +DEFINE_UIFUNC(, int, __getcontextx_size, (void)) { u_int p[4]; @@ -100,7 +100,7 @@ __fillcontextx2_noxfpu(char *ctx) return (0); } -DEFINE_UIFUNC(, int, __fillcontextx2, (char *), static) +DEFINE_UIFUNC(, int, __fillcontextx2, (char *)) { return ((cpu_feature2 & CPUID2_OSXSAVE) != 0 ? __fillcontextx2_xfpu : Modified: head/lib/libc/x86/sys/__vdso_gettc.c ============================================================================== --- head/lib/libc/x86/sys/__vdso_gettc.c Thu May 16 22:03:25 2019 (r347894) +++ head/lib/libc/x86/sys/__vdso_gettc.c Thu May 16 22:20:54 2019 (r347895) @@ -72,7 +72,7 @@ rdtsc_mb_none(void) { } -DEFINE_UIFUNC(static, void, rdtsc_mb, (void), static) +DEFINE_UIFUNC(static, void, rdtsc_mb, (void)) { u_int p[4]; /* Not a typo, string matches our do_cpuid() registers use. */ Modified: head/lib/libc/x86/sys/pkru.c ============================================================================== --- head/lib/libc/x86/sys/pkru.c Thu May 16 22:03:25 2019 (r347894) +++ head/lib/libc/x86/sys/pkru.c Thu May 16 22:20:54 2019 (r347895) @@ -71,7 +71,7 @@ x86_pkru_get_perm_hw(u_int keyidx, int *access, int *m return (0); } -DEFINE_UIFUNC(, int, x86_pkru_get_perm, (u_int, int *, int *), static) +DEFINE_UIFUNC(, int, x86_pkru_get_perm, (u_int, int *, int *)) { return ((cpu_stdext_feature2 & CPUID_STDEXT2_OSPKE) == 0 ? @@ -106,7 +106,7 @@ x86_pkru_set_perm_hw(u_int keyidx, int access, int mod return (0); } -DEFINE_UIFUNC(, int, x86_pkru_set_perm, (u_int, int, int), static) +DEFINE_UIFUNC(, int, x86_pkru_set_perm, (u_int, int, int)) { return ((cpu_stdext_feature2 & CPUID_STDEXT2_OSPKE) == 0 ? Modified: head/sys/amd64/amd64/copyout.c ============================================================================== --- head/sys/amd64/amd64/copyout.c Thu May 16 22:03:25 2019 (r347894) +++ head/sys/amd64/amd64/copyout.c Thu May 16 22:20:54 2019 (r347895) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); int fubyte_nosmap(volatile const void *base); int fubyte_smap(volatile const void *base); -DEFINE_IFUNC(, int, fubyte, (volatile const void *), static) +DEFINE_IFUNC(, int, fubyte, (volatile const void *)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -50,7 +50,7 @@ DEFINE_IFUNC(, int, fubyte, (volatile const void *), s int fuword16_nosmap(volatile const void *base); int fuword16_smap(volatile const void *base); -DEFINE_IFUNC(, int, fuword16, (volatile const void *), static) +DEFINE_IFUNC(, int, fuword16, (volatile const void *)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -59,13 +59,13 @@ DEFINE_IFUNC(, int, fuword16, (volatile const void *), int fueword_nosmap(volatile const void *base, long *val); int fueword_smap(volatile const void *base, long *val); -DEFINE_IFUNC(, int, fueword, (volatile const void *, long *), static) +DEFINE_IFUNC(, int, fueword, (volatile const void *, long *)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? fueword_smap : fueword_nosmap); } -DEFINE_IFUNC(, int, fueword64, (volatile const void *, int64_t *), static) +DEFINE_IFUNC(, int, fueword64, (volatile const void *, int64_t *)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -74,7 +74,7 @@ DEFINE_IFUNC(, int, fueword64, (volatile const void *, int fueword32_nosmap(volatile const void *base, int32_t *val); int fueword32_smap(volatile const void *base, int32_t *val); -DEFINE_IFUNC(, int, fueword32, (volatile const void *, int32_t *), static) +DEFINE_IFUNC(, int, fueword32, (volatile const void *, int32_t *)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -83,7 +83,7 @@ DEFINE_IFUNC(, int, fueword32, (volatile const void *, int subyte_nosmap(volatile void *base, int byte); int subyte_smap(volatile void *base, int byte); -DEFINE_IFUNC(, int, subyte, (volatile void *, int), static) +DEFINE_IFUNC(, int, subyte, (volatile void *, int)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -92,7 +92,7 @@ DEFINE_IFUNC(, int, subyte, (volatile void *, int), st int suword16_nosmap(volatile void *base, int word); int suword16_smap(volatile void *base, int word); -DEFINE_IFUNC(, int, suword16, (volatile void *, int), static) +DEFINE_IFUNC(, int, suword16, (volatile void *, int)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -101,7 +101,7 @@ DEFINE_IFUNC(, int, suword16, (volatile void *, int), int suword32_nosmap(volatile void *base, int32_t word); int suword32_smap(volatile void *base, int32_t word); -DEFINE_IFUNC(, int, suword32, (volatile void *, int32_t), static) +DEFINE_IFUNC(, int, suword32, (volatile void *, int32_t)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -110,13 +110,13 @@ DEFINE_IFUNC(, int, suword32, (volatile void *, int32_ int suword_nosmap(volatile void *base, long word); int suword_smap(volatile void *base, long word); -DEFINE_IFUNC(, int, suword, (volatile void *, long), static) +DEFINE_IFUNC(, int, suword, (volatile void *, long)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? suword_smap : suword_nosmap); } -DEFINE_IFUNC(, int, suword64, (volatile void *, int64_t), static) +DEFINE_IFUNC(, int, suword64, (volatile void *, int64_t)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -128,7 +128,7 @@ int casueword32_nosmap(volatile uint32_t *base, uint32 int casueword32_smap(volatile uint32_t *base, uint32_t oldval, uint32_t *oldvalp, uint32_t newval); DEFINE_IFUNC(, int, casueword32, (volatile uint32_t *, uint32_t, uint32_t *, - uint32_t), static) + uint32_t)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -139,8 +139,7 @@ int casueword_nosmap(volatile u_long *p, u_long oldval u_long newval); int casueword_smap(volatile u_long *p, u_long oldval, u_long *oldvalp, u_long newval); -DEFINE_IFUNC(, int, casueword, (volatile u_long *, u_long, u_long *, u_long), - static) +DEFINE_IFUNC(, int, casueword, (volatile u_long *, u_long, u_long *, u_long)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -151,8 +150,7 @@ int copyinstr_nosmap(const void *udaddr, void *kaddr, size_t *lencopied); int copyinstr_smap(const void *udaddr, void *kaddr, size_t len, size_t *lencopied); -DEFINE_IFUNC(, int, copyinstr, (const void *, void *, size_t, size_t *), - static) +DEFINE_IFUNC(, int, copyinstr, (const void *, void *, size_t, size_t *)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -163,7 +161,7 @@ int copyin_nosmap_std(const void *udaddr, void *kaddr, int copyin_smap_std(const void *udaddr, void *kaddr, size_t len); int copyin_nosmap_erms(const void *udaddr, void *kaddr, size_t len); int copyin_smap_erms(const void *udaddr, void *kaddr, size_t len); -DEFINE_IFUNC(, int, copyin, (const void *, void *, size_t), static) +DEFINE_IFUNC(, int, copyin, (const void *, void *, size_t)) { switch (cpu_stdext_feature & (CPUID_STDEXT_SMAP | CPUID_STDEXT_ERMS)) { @@ -183,7 +181,7 @@ int copyout_nosmap_std(const void *kaddr, void *udaddr int copyout_smap_std(const void *kaddr, void *udaddr, size_t len); int copyout_nosmap_erms(const void *kaddr, void *udaddr, size_t len); int copyout_smap_erms(const void *kaddr, void *udaddr, size_t len); -DEFINE_IFUNC(, int, copyout, (const void *, void *, size_t), static) +DEFINE_IFUNC(, int, copyout, (const void *, void *, size_t)) { switch (cpu_stdext_feature & (CPUID_STDEXT_SMAP | CPUID_STDEXT_ERMS)) { Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Thu May 16 22:03:25 2019 (r347894) +++ head/sys/amd64/amd64/fpu.c Thu May 16 22:20:54 2019 (r347895) @@ -216,7 +216,7 @@ init_xsave(void) TUNABLE_INT_FETCH("hw.use_xsave", &use_xsave); } -DEFINE_IFUNC(, void, fpusave, (void *), static) +DEFINE_IFUNC(, void, fpusave, (void *)) { init_xsave(); @@ -226,7 +226,7 @@ DEFINE_IFUNC(, void, fpusave, (void *), static) return (fpusave_fxsave); } -DEFINE_IFUNC(, void, fpurestore, (void *), static) +DEFINE_IFUNC(, void, fpurestore, (void *)) { init_xsave(); Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Thu May 16 22:03:25 2019 (r347894) +++ head/sys/amd64/amd64/machdep.c Thu May 16 22:20:54 2019 (r347895) @@ -2653,7 +2653,7 @@ set_pcb_flags_fsgsbase(struct pcb *pcb, const u_int fl } } -DEFINE_IFUNC(, void, set_pcb_flags, (struct pcb *, const u_int), static) +DEFINE_IFUNC(, void, set_pcb_flags, (struct pcb *, const u_int)) { return ((cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0 ? @@ -2700,7 +2700,7 @@ outb_(u_short port, u_char data) void *memset_std(void *buf, int c, size_t len); void *memset_erms(void *buf, int c, size_t len); -DEFINE_IFUNC(, void *, memset, (void *, int, size_t), static) +DEFINE_IFUNC(, void *, memset, (void *, int, size_t)) { return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ? @@ -2712,7 +2712,7 @@ void *memmove_std(void * _Nonnull dst, const void * void *memmove_erms(void * _Nonnull dst, const void * _Nonnull src, size_t len); DEFINE_IFUNC(, void *, memmove, (void * _Nonnull, const void * _Nonnull, - size_t), static) + size_t)) { return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ? @@ -2723,8 +2723,7 @@ void *memcpy_std(void * _Nonnull dst, const void * size_t len); void *memcpy_erms(void * _Nonnull dst, const void * _Nonnull src, size_t len); -DEFINE_IFUNC(, void *, memcpy, (void * _Nonnull, const void * _Nonnull,size_t), - static) +DEFINE_IFUNC(, void *, memcpy, (void * _Nonnull, const void * _Nonnull,size_t)) { return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ? @@ -2733,7 +2732,7 @@ DEFINE_IFUNC(, void *, memcpy, (void * _Nonnull, const void pagezero_std(void *addr); void pagezero_erms(void *addr); -DEFINE_IFUNC(, void , pagezero, (void *), static) +DEFINE_IFUNC(, void , pagezero, (void *)) { return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ? Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu May 16 22:03:25 2019 (r347894) +++ head/sys/amd64/amd64/pmap.c Thu May 16 22:20:54 2019 (r347895) @@ -512,7 +512,7 @@ SYSCTL_PROC(_vm_pmap, OID_AUTO, di_locked, CTLTYPE_INT static bool pmap_not_in_di_l(void); static bool pmap_not_in_di_u(void); -DEFINE_IFUNC(, bool, pmap_not_in_di, (void), static) +DEFINE_IFUNC(, bool, pmap_not_in_di, (void)) { return (pmap_di_locked() ? pmap_not_in_di_l : pmap_not_in_di_u); @@ -953,28 +953,28 @@ pmap_delayed_invl_wait_u(vm_page_t m) } } -DEFINE_IFUNC(, void, pmap_thread_init_invl_gen, (struct thread *), static) +DEFINE_IFUNC(, void, pmap_thread_init_invl_gen, (struct thread *)) { return (pmap_di_locked() ? pmap_thread_init_invl_gen_l : pmap_thread_init_invl_gen_u); } -DEFINE_IFUNC(static, void, pmap_delayed_invl_start, (void), static) +DEFINE_IFUNC(static, void, pmap_delayed_invl_start, (void)) { return (pmap_di_locked() ? pmap_delayed_invl_start_l : pmap_delayed_invl_start_u); } -DEFINE_IFUNC(static, void, pmap_delayed_invl_finish, (void), static) +DEFINE_IFUNC(static, void, pmap_delayed_invl_finish, (void)) { return (pmap_di_locked() ? pmap_delayed_invl_finish_l : pmap_delayed_invl_finish_u); } -DEFINE_IFUNC(static, void, pmap_delayed_invl_wait, (vm_page_t), static) +DEFINE_IFUNC(static, void, pmap_delayed_invl_wait, (vm_page_t)) { return (pmap_di_locked() ? pmap_delayed_invl_wait_l : @@ -2197,8 +2197,7 @@ pmap_invalidate_page_nopcid(pmap_t pmap, vm_offset_t v { } -DEFINE_IFUNC(static, void, pmap_invalidate_page_mode, (pmap_t, vm_offset_t), - static) +DEFINE_IFUNC(static, void, pmap_invalidate_page_mode, (pmap_t, vm_offset_t)) { if (pmap_pcid_enabled) @@ -2295,7 +2294,7 @@ pmap_invalidate_range_nopcid(pmap_t pmap, vm_offset_t } DEFINE_IFUNC(static, void, pmap_invalidate_range_mode, (pmap_t, vm_offset_t, - vm_offset_t), static) + vm_offset_t)) { if (pmap_pcid_enabled) @@ -2412,7 +2411,7 @@ pmap_invalidate_all_nopcid(pmap_t pmap) invltlb(); } -DEFINE_IFUNC(static, void, pmap_invalidate_all_mode, (pmap_t), static) +DEFINE_IFUNC(static, void, pmap_invalidate_all_mode, (pmap_t)) { if (pmap_pcid_enabled) @@ -2691,7 +2690,7 @@ pmap_invalidate_pde_page(pmap_t pmap, vm_offset_t va, } DEFINE_IFUNC(, void, pmap_invalidate_cache_range, - (vm_offset_t sva, vm_offset_t eva), static) + (vm_offset_t sva, vm_offset_t eva)) { if ((cpu_feature & CPUID_SS) != 0) @@ -8284,7 +8283,7 @@ pmap_activate_sw_nopcid_pti(struct thread *td, pmap_t } DEFINE_IFUNC(static, void, pmap_activate_sw_mode, (struct thread *, pmap_t, - u_int), static) + u_int)) { if (pmap_pcid_enabled && pti && invpcid_works) @@ -8981,7 +8980,7 @@ pmap_large_map_wb_fence_nop(void) { } -DEFINE_IFUNC(static, void, pmap_large_map_wb_fence, (void), static) +DEFINE_IFUNC(static, void, pmap_large_map_wb_fence, (void)) { if (cpu_vendor_id != CPU_VENDOR_INTEL) @@ -9026,8 +9025,7 @@ pmap_large_map_flush_range_nop(vm_offset_t sva __unuse { } -DEFINE_IFUNC(static, void, pmap_large_map_flush_range, (vm_offset_t, vm_size_t), - static) +DEFINE_IFUNC(static, void, pmap_large_map_flush_range, (vm_offset_t, vm_size_t)) { if ((cpu_stdext_feature & CPUID_STDEXT_CLWB) != 0) Modified: head/sys/amd64/linux/linux_machdep.c ============================================================================== --- head/sys/amd64/linux/linux_machdep.c Thu May 16 22:03:25 2019 (r347894) +++ head/sys/amd64/linux/linux_machdep.c Thu May 16 22:20:54 2019 (r347895) @@ -284,7 +284,7 @@ linux_set_cloned_tls(struct thread *td, void *desc) int futex_xchgl_nosmap(int oparg, uint32_t *uaddr, int *oldval); int futex_xchgl_smap(int oparg, uint32_t *uaddr, int *oldval); -DEFINE_IFUNC(, int, futex_xchgl, (int, uint32_t *, int *), static) +DEFINE_IFUNC(, int, futex_xchgl, (int, uint32_t *, int *)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -293,7 +293,7 @@ DEFINE_IFUNC(, int, futex_xchgl, (int, uint32_t *, int int futex_addl_nosmap(int oparg, uint32_t *uaddr, int *oldval); int futex_addl_smap(int oparg, uint32_t *uaddr, int *oldval); -DEFINE_IFUNC(, int, futex_addl, (int, uint32_t *, int *), static) +DEFINE_IFUNC(, int, futex_addl, (int, uint32_t *, int *)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -302,7 +302,7 @@ DEFINE_IFUNC(, int, futex_addl, (int, uint32_t *, int int futex_orl_nosmap(int oparg, uint32_t *uaddr, int *oldval); int futex_orl_smap(int oparg, uint32_t *uaddr, int *oldval); -DEFINE_IFUNC(, int, futex_orl, (int, uint32_t *, int *), static) +DEFINE_IFUNC(, int, futex_orl, (int, uint32_t *, int *)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -311,7 +311,7 @@ DEFINE_IFUNC(, int, futex_orl, (int, uint32_t *, int * int futex_andl_nosmap(int oparg, uint32_t *uaddr, int *oldval); int futex_andl_smap(int oparg, uint32_t *uaddr, int *oldval); -DEFINE_IFUNC(, int, futex_andl, (int, uint32_t *, int *), static) +DEFINE_IFUNC(, int, futex_andl, (int, uint32_t *, int *)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -320,7 +320,7 @@ DEFINE_IFUNC(, int, futex_andl, (int, uint32_t *, int int futex_xorl_nosmap(int oparg, uint32_t *uaddr, int *oldval); int futex_xorl_smap(int oparg, uint32_t *uaddr, int *oldval); -DEFINE_IFUNC(, int, futex_xorl, (int, uint32_t *, int *), static) +DEFINE_IFUNC(, int, futex_xorl, (int, uint32_t *, int *)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? Modified: head/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- head/sys/amd64/linux32/linux32_machdep.c Thu May 16 22:03:25 2019 (r347894) +++ head/sys/amd64/linux32/linux32_machdep.c Thu May 16 22:20:54 2019 (r347895) @@ -739,7 +739,7 @@ linux_set_thread_area(struct thread *td, int futex_xchgl_nosmap(int oparg, uint32_t *uaddr, int *oldval); int futex_xchgl_smap(int oparg, uint32_t *uaddr, int *oldval); -DEFINE_IFUNC(, int, futex_xchgl, (int, uint32_t *, int *), static) +DEFINE_IFUNC(, int, futex_xchgl, (int, uint32_t *, int *)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -748,7 +748,7 @@ DEFINE_IFUNC(, int, futex_xchgl, (int, uint32_t *, int int futex_addl_nosmap(int oparg, uint32_t *uaddr, int *oldval); int futex_addl_smap(int oparg, uint32_t *uaddr, int *oldval); -DEFINE_IFUNC(, int, futex_addl, (int, uint32_t *, int *), static) +DEFINE_IFUNC(, int, futex_addl, (int, uint32_t *, int *)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -757,7 +757,7 @@ DEFINE_IFUNC(, int, futex_addl, (int, uint32_t *, int int futex_orl_nosmap(int oparg, uint32_t *uaddr, int *oldval); int futex_orl_smap(int oparg, uint32_t *uaddr, int *oldval); -DEFINE_IFUNC(, int, futex_orl, (int, uint32_t *, int *), static) +DEFINE_IFUNC(, int, futex_orl, (int, uint32_t *, int *)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -766,7 +766,7 @@ DEFINE_IFUNC(, int, futex_orl, (int, uint32_t *, int * int futex_andl_nosmap(int oparg, uint32_t *uaddr, int *oldval); int futex_andl_smap(int oparg, uint32_t *uaddr, int *oldval); -DEFINE_IFUNC(, int, futex_andl, (int, uint32_t *, int *), static) +DEFINE_IFUNC(, int, futex_andl, (int, uint32_t *, int *)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -775,7 +775,7 @@ DEFINE_IFUNC(, int, futex_andl, (int, uint32_t *, int int futex_xorl_nosmap(int oparg, uint32_t *uaddr, int *oldval); int futex_xorl_smap(int oparg, uint32_t *uaddr, int *oldval); -DEFINE_IFUNC(, int, futex_xorl, (int, uint32_t *, int *), static) +DEFINE_IFUNC(, int, futex_xorl, (int, uint32_t *, int *)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? Modified: head/sys/arm64/include/ifunc.h ============================================================================== --- head/sys/arm64/include/ifunc.h Thu May 16 22:03:25 2019 (r347894) +++ head/sys/arm64/include/ifunc.h Thu May 16 22:20:54 2019 (r347895) @@ -32,17 +32,17 @@ #ifndef __ARM64_IFUNC_H #define __ARM64_IFUNC_H -#define DEFINE_IFUNC(qual, ret_type, name, args, resolver_qual) \ - resolver_qual ret_type (*name##_resolver(void))args __used; \ +#define DEFINE_IFUNC(qual, ret_type, name, args) \ + static ret_type (*name##_resolver(void))args __used; \ qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \ - resolver_qual ret_type (*name##_resolver(void))args + static ret_type (*name##_resolver(void))args -#define DEFINE_UIFUNC(qual, ret_type, name, args, resolver_qual) \ - resolver_qual ret_type (*name##_resolver(uint64_t, uint64_t, \ +#define DEFINE_UIFUNC(qual, ret_type, name, args) \ + static ret_type (*name##_resolver(uint64_t, uint64_t, \ uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, \ uint64_t))args __used; \ qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \ - resolver_qual ret_type (*name##_resolver(uint64_t _arg1 __unused, \ + static ret_type (*name##_resolver(uint64_t _arg1 __unused, \ uint64_t _arg2 __unused, uint64_t _arg3 __unused, \ uint64_t _arg4 __unused, uint64_t _arg5 __unused, \ uint64_t _arg6 __unused, uint64_t _arg7 __unused, \ Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Thu May 16 22:03:25 2019 (r347894) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Thu May 16 22:20:54 2019 (r347895) @@ -671,7 +671,7 @@ dtrace_fuword64(void *uaddr) */ void dtrace_copy_nosmap(uintptr_t, uintptr_t, size_t); void dtrace_copy_smap(uintptr_t, uintptr_t, size_t); -DEFINE_IFUNC(, void, dtrace_copy, (uintptr_t, uintptr_t, size_t), static) +DEFINE_IFUNC(, void, dtrace_copy, (uintptr_t, uintptr_t, size_t)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -681,7 +681,7 @@ DEFINE_IFUNC(, void, dtrace_copy, (uintptr_t, uintptr_ void dtrace_copystr_nosmap(uintptr_t, uintptr_t, size_t, volatile uint16_t *); void dtrace_copystr_smap(uintptr_t, uintptr_t, size_t, volatile uint16_t *); DEFINE_IFUNC(, void, dtrace_copystr, (uintptr_t, uintptr_t, size_t, - volatile uint16_t *), static) + volatile uint16_t *)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -690,7 +690,7 @@ DEFINE_IFUNC(, void, dtrace_copystr, (uintptr_t, uintp uintptr_t dtrace_fulword_nosmap(void *); uintptr_t dtrace_fulword_smap(void *); -DEFINE_IFUNC(, uintptr_t, dtrace_fulword, (void *), static) +DEFINE_IFUNC(, uintptr_t, dtrace_fulword, (void *)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -699,7 +699,7 @@ DEFINE_IFUNC(, uintptr_t, dtrace_fulword, (void *), st uint8_t dtrace_fuword8_nocheck_nosmap(void *); uint8_t dtrace_fuword8_nocheck_smap(void *); -DEFINE_IFUNC(, uint8_t, dtrace_fuword8_nocheck, (void *), static) +DEFINE_IFUNC(, uint8_t, dtrace_fuword8_nocheck, (void *)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -708,7 +708,7 @@ DEFINE_IFUNC(, uint8_t, dtrace_fuword8_nocheck, (void uint16_t dtrace_fuword16_nocheck_nosmap(void *); uint16_t dtrace_fuword16_nocheck_smap(void *); -DEFINE_IFUNC(, uint16_t, dtrace_fuword16_nocheck, (void *), static) +DEFINE_IFUNC(, uint16_t, dtrace_fuword16_nocheck, (void *)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -717,7 +717,7 @@ DEFINE_IFUNC(, uint16_t, dtrace_fuword16_nocheck, (voi uint32_t dtrace_fuword32_nocheck_nosmap(void *); uint32_t dtrace_fuword32_nocheck_smap(void *); -DEFINE_IFUNC(, uint32_t, dtrace_fuword32_nocheck, (void *), static) +DEFINE_IFUNC(, uint32_t, dtrace_fuword32_nocheck, (void *)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? @@ -726,7 +726,7 @@ DEFINE_IFUNC(, uint32_t, dtrace_fuword32_nocheck, (voi uint64_t dtrace_fuword64_nocheck_nosmap(void *); uint64_t dtrace_fuword64_nocheck_smap(void *); -DEFINE_IFUNC(, uint64_t, dtrace_fuword64_nocheck, (void *), static) +DEFINE_IFUNC(, uint64_t, dtrace_fuword64_nocheck, (void *)) { return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? Modified: head/sys/dev/random/ivy.c ============================================================================== --- head/sys/dev/random/ivy.c Thu May 16 22:03:25 2019 (r347894) +++ head/sys/dev/random/ivy.c Thu May 16 22:20:54 2019 (r347895) @@ -104,7 +104,7 @@ x86_unimpl_store(u_long *buf __unused) panic("%s called", __func__); } -DEFINE_IFUNC(static, int, x86_rng_store, (u_long *buf), static) +DEFINE_IFUNC(static, int, x86_rng_store, (u_long *buf)) { has_rdrand = (cpu_feature2 & CPUID2_RDRAND); has_rdseed = (cpu_stdext_feature & CPUID_STDEXT_RDSEED); Modified: head/sys/i386/i386/npx.c ============================================================================== --- head/sys/i386/i386/npx.c Thu May 16 22:03:25 2019 (r347894) +++ head/sys/i386/i386/npx.c Thu May 16 22:20:54 2019 (r347895) @@ -352,7 +352,7 @@ init_xsave(void) TUNABLE_INT_FETCH("hw.use_xsave", &use_xsave); } -DEFINE_IFUNC(, void, fpusave, (union savefpu *), static) +DEFINE_IFUNC(, void, fpusave, (union savefpu *)) { init_xsave(); Modified: head/sys/i386/i386/pmap_base.c ============================================================================== --- head/sys/i386/i386/pmap_base.c Thu May 16 22:03:25 2019 (r347894) +++ head/sys/i386/i386/pmap_base.c Thu May 16 22:20:54 2019 (r347895) @@ -288,8 +288,7 @@ pmap_flush_page(vm_page_t m) pmap_methods_ptr->pm_flush_page(m); } -DEFINE_IFUNC(, void, pmap_invalidate_cache_range, (vm_offset_t, vm_offset_t), - static) +DEFINE_IFUNC(, void, pmap_invalidate_cache_range, (vm_offset_t, vm_offset_t)) { if ((cpu_feature & CPUID_SS) != 0) Modified: head/sys/x86/include/ifunc.h ============================================================================== --- head/sys/x86/include/ifunc.h Thu May 16 22:03:25 2019 (r347894) +++ head/sys/x86/include/ifunc.h Thu May 16 22:20:54 2019 (r347895) @@ -32,16 +32,16 @@ #ifndef __X86_IFUNC_H #define __X86_IFUNC_H -#define DEFINE_IFUNC(qual, ret_type, name, args, resolver_qual) \ - resolver_qual ret_type (*name##_resolver(void))args __used; \ +#define DEFINE_IFUNC(qual, ret_type, name, args) \ + static ret_type (*name##_resolver(void))args __used; \ qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \ - resolver_qual ret_type (*name##_resolver(void))args + static ret_type (*name##_resolver(void))args -#define DEFINE_UIFUNC(qual, ret_type, name, args, resolver_qual) \ - resolver_qual ret_type (*name##_resolver(uint32_t, uint32_t, \ - uint32_t, uint32_t))args __used; \ +#define DEFINE_UIFUNC(qual, ret_type, name, args) \ + static ret_type (*name##_resolver(uint32_t, uint32_t, uint32_t, \ + uint32_t))args __used; \ qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \ - resolver_qual ret_type (*name##_resolver( \ + static ret_type (*name##_resolver( \ uint32_t cpu_feature __unused, \ uint32_t cpu_feature2 __unused, \ uint32_t cpu_stdext_feature __unused, \ From owner-svn-src-head@freebsd.org Thu May 16 22:27:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F1E415A8CFC; Thu, 16 May 2019 22:27:39 +0000 (UTC) (envelope-from tychon@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 420F977331; Thu, 16 May 2019 22:27:39 +0000 (UTC) (envelope-from tychon@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 2C1B32734F; Thu, 16 May 2019 22:27:39 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4GMRcMV067073; Thu, 16 May 2019 22:27:38 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GMRc0G067072; Thu, 16 May 2019 22:27:38 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201905162227.x4GMRc0G067072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Thu, 16 May 2019 22:27:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347896 - head/sys/dev/bge X-SVN-Group: head X-SVN-Commit-Author: tychon X-SVN-Commit-Paths: head/sys/dev/bge X-SVN-Commit-Revision: 347896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 420F977331 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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, 16 May 2019 22:27:39 -0000 Author: tychon Date: Thu May 16 22:27:38 2019 New Revision: 347896 URL: https://svnweb.freebsd.org/changeset/base/347896 Log: Fix integer overflow in r346386. Sponsored by: Dell EMC Isilon Modified: head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Thu May 16 22:20:54 2019 (r347895) +++ head/sys/dev/bge/if_bgereg.h Thu May 16 22:27:38 2019 (r347896) @@ -2866,7 +2866,7 @@ struct bge_gib { #define BGE_DMA_MAXADDR 0xFFFFFFFFFF #endif -#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) +#if (BUS_SPACE_MAXSIZE > 0xFFFFFFFF) #define BGE_DMA_BNDRY 0x100000000 #else #define BGE_DMA_BNDRY 0 From owner-svn-src-head@freebsd.org Thu May 16 22:28:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 916EA15A8D82; Thu, 16 May 2019 22:28:15 +0000 (UTC) (envelope-from tychon@freebsd.org) Received: from pb-smtp20.pobox.com (pb-smtp20.pobox.com [173.228.157.52]) (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 2BC1377466; Thu, 16 May 2019 22:28:15 +0000 (UTC) (envelope-from tychon@freebsd.org) Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 183B77176E; Thu, 16 May 2019 18:28:07 -0400 (EDT) (envelope-from tychon@freebsd.org) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=content-type :mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=sasl; bh= j+sYgyw8GNoFuS89TV95irt0QJM=; b=X00nQOKyYOp+3Wg8dN/wEf/LcFYeYxx1 yhhqpxtD+/svOAh1bP515DJFYuu2UUR7Sb1cTyOXf5h/bEbeKHaL5QjmVxrKczxL M9nxe5ZBuW9NsA59KqK53AxAaQSY/wzcFSAwoQmh0lKQVg1nAgUpAtV/RtK1kuOC fiOmTRAOyQE= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 0EBC47176D; Thu, 16 May 2019 18:28:07 -0400 (EDT) (envelope-from tychon@freebsd.org) Received: from [10.0.1.195] (unknown [146.115.68.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id 0B46A71768; Thu, 16 May 2019 18:28:03 -0400 (EDT) (envelope-from tychon@freebsd.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r347890 - in head/sys/dev: aac bge From: Tycho Nightingale In-Reply-To: <9aeac9a0-5816-51d1-c965-3764f5822382@selasky.org> Date: Thu, 16 May 2019 18:28:02 -0400 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <1EF4A3E8-DD0D-4B2E-B4D2-6E72ED6BF790@freebsd.org> References: <201905162041.x4GKfTwb013353@repo.freebsd.org> <9aeac9a0-5816-51d1-c965-3764f5822382@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3445.9.1) X-Pobox-Relay-ID: DF1F5286-7829-11E9-9377-B0405B776F7B-09779102!pb-smtp20.pobox.com X-Rspamd-Queue-Id: 2BC1377466 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,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: Thu, 16 May 2019 22:28:15 -0000 > On May 16, 2019, at 5:23 PM, Hans Petter Selasky = wrote: >=20 > On 2019-05-16 22:41, Tycho Nightingale wrote: >> Author: tychon >> Date: Thu May 16 20:41:28 2019 >> New Revision: 347890 >> URL: https://svnweb.freebsd.org/changeset/base/347890 >> Log: >> reinstate 4GB DMA boundary workarounds for bge and aac >> Reviewed by: kib >> Sponsored by: Dell EMC Isilon >> Differential Revision: https://reviews.freebsd.org/D20277 >> Modified: >> head/sys/dev/aac/aac_pci.c >> head/sys/dev/bge/if_bge.c >> head/sys/dev/bge/if_bgereg.h >> Modified: head/sys/dev/aac/aac_pci.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/dev/aac/aac_pci.c Thu May 16 19:32:11 2019 = (r347889) >> +++ head/sys/dev/aac/aac_pci.c Thu May 16 20:41:28 2019 = (r347890) >> @@ -443,7 +443,8 @@ aac_pci_attach(device_t dev) >> * Note that some of these controllers are 64-bit capable. >> */ >> if (bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ >> - PAGE_SIZE, 0, /* algnmnt, = boundary */ >> + PAGE_SIZE, /* algnmnt */ >> + ((bus_size_t)((uint64_t)1 << 32)), /* = boundary*/ >> BUS_SPACE_MAXADDR, /* lowaddr */ >> BUS_SPACE_MAXADDR, /* highaddr */ >> NULL, NULL, /* filter, = filterarg */ >> Modified: head/sys/dev/bge/if_bge.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/sys/dev/bge/if_bge.c Thu May 16 19:32:11 2019 = (r347889) >> +++ head/sys/dev/bge/if_bge.c Thu May 16 20:41:28 2019 = (r347890) >> @@ -2927,10 +2927,14 @@ bge_dma_ring_alloc(struct bge_softc *sc, = bus_size_t al >> bus_addr_t *paddr, const char *msg) >> { >> struct bge_dmamap_arg ctx; >> + bus_addr_t lowaddr; >> + bus_size_t ring_end; >> int error; >> + lowaddr =3D BUS_SPACE_MAXADDR; >> +again: >> error =3D bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, >> - alignment, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, >> + alignment, 0, lowaddr, BUS_SPACE_MAXADDR, NULL, >> NULL, maxsize, 1, maxsize, 0, NULL, NULL, tag); >> if (error !=3D 0) { >> device_printf(sc->bge_dev, >> @@ -2955,6 +2959,25 @@ bge_dma_ring_alloc(struct bge_softc *sc, = bus_size_t al >> return (ENOMEM); >> } >> *paddr =3D ctx.bge_busaddr; >> + ring_end =3D *paddr + maxsize; >> + if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) !=3D 0 && >> + BGE_ADDR_HI(*paddr) !=3D BGE_ADDR_HI(ring_end)) { >> + /* >> + * 4GB boundary crossed. Limit maximum allowable DMA >> + * address space to 32bit and try again. >> + */ >> + bus_dmamap_unload(*tag, *map); >> + bus_dmamem_free(*tag, *ring, *map); >> + bus_dma_tag_destroy(*tag); >> + if (bootverbose) >> + device_printf(sc->bge_dev, "4GB boundary = crossed, " >> + "limit DMA address space to 32bit for %s\n", = msg); >> + *ring =3D NULL; >> + *tag =3D NULL; >> + *map =3D NULL; >> + lowaddr =3D BUS_SPACE_MAXADDR_32BIT; >> + goto again; >> + } >> return (0); >> } >> @@ -2962,7 +2985,7 @@ static int >> bge_dma_alloc(struct bge_softc *sc) >> { >> bus_addr_t lowaddr; >> - bus_size_t rxmaxsegsz, sbsz, txsegsz, txmaxsegsz; >> + bus_size_t boundary, sbsz, rxmaxsegsz, txsegsz, txmaxsegsz; >> int i, error; >> lowaddr =3D BUS_SPACE_MAXADDR; >> @@ -3049,7 +3072,9 @@ bge_dma_alloc(struct bge_softc *sc) >> } >> /* Create parent tag for buffers. */ >> + boundary =3D 0; >> if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) !=3D 0) { >> + boundary =3D BGE_DMA_BNDRY; >> /* >> * XXX >> * watchdog timeout issue was observed on BCM5704 which >> @@ -3060,10 +3085,10 @@ bge_dma_alloc(struct bge_softc *sc) >> if (sc->bge_pcixcap !=3D 0) >> lowaddr =3D BUS_SPACE_MAXADDR_32BIT; >> } >> - error =3D bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), 1, 0, = lowaddr, >> - BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 0, >> - BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, >> - &sc->bge_cdata.bge_buffer_tag); >> + error =3D bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), >> + 1, boundary, lowaddr, BUS_SPACE_MAXADDR, NULL, >> + NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, >> + 0, NULL, NULL, &sc->bge_cdata.bge_buffer_tag); >> if (error !=3D 0) { >> device_printf(sc->bge_dev, >> "could not allocate buffer dma tag\n"); >> Modified: head/sys/dev/bge/if_bgereg.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/dev/bge/if_bgereg.h Thu May 16 19:32:11 2019 = (r347889) >> +++ head/sys/dev/bge/if_bgereg.h Thu May 16 20:41:28 2019 = (r347890) >> @@ -2866,6 +2866,12 @@ struct bge_gib { >> #define BGE_DMA_MAXADDR 0xFFFFFFFFFF >> #endif >> +#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) >> +#define BGE_DMA_BNDRY 0x100000000 >> +#else >> +#define BGE_DMA_BNDRY 0 >> +#endif >> + >> /* >> * Ring structures. Most of these reside in host memory and we tell >> * the NIC where they are via the ring control blocks. The = exceptions >=20 > /usr/src/sys/dev/bge/if_bge.c:3077: warning: large integer implicitly = truncated to unsigned type [-Woverflow] Sorry. Fixed in r347896. Tycho= From owner-svn-src-head@freebsd.org Fri May 17 05:36:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45E8F15B01C3; Fri, 17 May 2019 05:36:54 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vtr.rulingia.com (unknown [IPv6:2001:19f0:5801:ebe:59df:1a4a:8731:11c1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vtr.rulingia.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1153E8B806; Fri, 17 May 2019 05:36:52 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp59-167-167-3.static.internode.on.net [59.167.167.3]) by vtr.rulingia.com (8.15.2/8.15.2) with ESMTPS id x4H5ahic014066 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 May 2019 15:36:49 +1000 (AEST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.15.2/8.15.2) with ESMTPS id x4H5acnA024979 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 17 May 2019 15:36:38 +1000 (AEST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id x4H5abf6024978; Fri, 17 May 2019 15:36:37 +1000 (AEST) (envelope-from peter) Date: Fri, 17 May 2019 15:36:37 +1000 From: Peter Jeremy To: Tycho Nightingale Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347890 - in head/sys/dev: aac bge Message-ID: <20190517053637.GH98005@server.rulingia.com> References: <201905162041.x4GKfTwb013353@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="y2zxS2PfCDLh6JVG" Content-Disposition: inline In-Reply-To: <201905162041.x4GKfTwb013353@repo.freebsd.org> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.11.4 (2019-03-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 17 May 2019 05:36:54 -0000 --y2zxS2PfCDLh6JVG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-May-16 20:41:29 +0000, Tycho Nightingale wrote: >Author: tychon >Date: Thu May 16 20:41:28 2019 >New Revision: 347890 >URL: https://svnweb.freebsd.org/changeset/base/347890 > >Log: > reinstate 4GB DMA boundary workarounds for bge and aac > =20 > Reviewed by: kib > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D20277 My main concern with this commit is that there is nothing in the commit message explaining why this has been done. D20277 implies that this is effectively reverting a couple of other commits because these devices have 64-bit issues - the commit log should document this. --=20 Peter Jeremy --y2zxS2PfCDLh6JVG Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAlzeSGVfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzRzog/8Cg+cvNpjnPYLbFbT3ro51bD8i/ALMOBEhjdraAZS13cANPD6d6bQa09O LhzEaF1XTvkEHtFq/TFwEJvV+mvdj8RD2aHCSVFy+aftABM7mvumoV7ftMTOlzGY xZn99dJZMLyywUNb3hSNoQGaeBoZ4SPFjI4OZewbsdZbgExsMCp3K08Stowbnxzi /yPdqUyEJaNdIy6+wlqX1C7WQbynLZ4eCZLZbwLvGLZuTqWC94FxMCMXldcYod3E U+zCESbrZWQenlz/1XLV9uOqpSeajuj2LRepLf8NAQSBFm9wpiQLutWFXYW52QFi wXkAptFvuCJkyG+uytroocIRnk3RPaAByNo1jI3Yk8/D0cSrO2S+oaKi5kGltwp8 tqm0Fa5/qjC9VIV3qZOBvQc+HJTtmzQdky7uJPKSbF3RakAr8OPT60OxLw2+cYFd cdGi+00kJCxd1R+l+hUZD5+tfx3bXAxQfPNkj2fSvAhC1yqLg2ULzfoExR0cdUs1 Y0evo2QC43xzjU38e/QGfXkVv8jNTSXPr6Dk7AuXq/W+xVlLHMSdxXPI5zSLcSgy tLO6hzzj2H0RROX/XNGkZVA+6A3OJNxKOeaH9t4RpOQCoJiyPqrKaf9jaaeZ+D9V 7lT3KT1j9P5EOCyvOYSYjN/qpMaNJZWbeUJfTKy+aPWVmp33ioQ= =T2CM -----END PGP SIGNATURE----- --y2zxS2PfCDLh6JVG-- From owner-svn-src-head@freebsd.org Fri May 17 08:18:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 731D1158B3A0; Fri, 17 May 2019 08:18:34 +0000 (UTC) (envelope-from danfe@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 1727E8FAE7; Fri, 17 May 2019 08:18:34 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id F186A130AB; Fri, 17 May 2019 08:18:33 +0000 (UTC) Date: Fri, 17 May 2019 08:18:33 +0000 From: Alexey Dokuchaev To: Conrad Meyer Cc: Brad Davis , svn-src-head , svn-src-all , src-committers Subject: Re: svn commit: r347638 - in head: . etc lib/libc/gen Message-ID: <20190517081833.GA64121@FreeBSD.org> References: <201905160109.x4G19DhY080690@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 1727E8FAE7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.937,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: Fri, 17 May 2019 08:18:34 -0000 On Thu, May 16, 2019 at 08:05:29AM -0700, Conrad Meyer wrote: > Hi Brad, > > Can you revert this? It seems to break every config-management tool > we have (mergemaster, etcupdate, beinstall ...). +1. > The commit message describes what was changed, but not *why* you > thought it was a good idea. > > > Added: > > head/lib/libc/gen/group > > - copied unchanged from r347637, head/etc/group > > head/lib/libc/gen/master.passwd > > - copied unchanged from r347637, head/etc/master.passwd What was wrong with etc/? What can be more logical than this? libc/gen/ makes so no sense. ./danfe From owner-svn-src-head@freebsd.org Fri May 17 13:08:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80B061594E7F; Fri, 17 May 2019 13:08:13 +0000 (UTC) (envelope-from tychon@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 ECCEE72F5E; Fri, 17 May 2019 13:08:12 +0000 (UTC) (envelope-from tychon@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 D24ED8A43; Fri, 17 May 2019 13:08:12 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4HD8CtT032102; Fri, 17 May 2019 13:08:12 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HD8CA7032101; Fri, 17 May 2019 13:08:12 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201905171308.x4HD8CA7032101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Fri, 17 May 2019 13:08:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347903 - head/sys/dev/bge X-SVN-Group: head X-SVN-Commit-Author: tychon X-SVN-Commit-Paths: head/sys/dev/bge X-SVN-Commit-Revision: 347903 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ECCEE72F5E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Fri, 17 May 2019 13:08:13 -0000 Author: tychon Date: Fri May 17 13:08:12 2019 New Revision: 347903 URL: https://svnweb.freebsd.org/changeset/base/347903 Log: Remove unused define. Sponsored by: Dell EMC Isilon Modified: head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Fri May 17 08:25:31 2019 (r347902) +++ head/sys/dev/bge/if_bgereg.h Fri May 17 13:08:12 2019 (r347903) @@ -3073,11 +3073,3 @@ struct bge_softc { #define BGE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->bge_mtx, MA_OWNED) #define BGE_UNLOCK(_sc) mtx_unlock(&(_sc)->bge_mtx) #define BGE_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->bge_mtx) - -#ifdef BUS_SPACE_MAXADDR -#if (BUS_SPACE_MAXADDR > 0xFFFFFFFF) -#define BGE_DMA_BOUNDARY (0x100000000) -#else -#define BGE_DMA_BOUNDARY 0 -#endif -#endif From owner-svn-src-head@freebsd.org Fri May 17 15:19:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3373B159790E; Fri, 17 May 2019 15:19: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 C86567717A; Fri, 17 May 2019 15:19: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 9C92DA048; Fri, 17 May 2019 15:19: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 x4HFJCaO000910; Fri, 17 May 2019 15:19:12 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HFJCOh000909; Fri, 17 May 2019 15:19:12 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905171519.x4HFJCOh000909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 May 2019 15:19:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347907 - head X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 347907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C86567717A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Fri, 17 May 2019 15:19:13 -0000 Author: brooks Date: Fri May 17 15:19:12 2019 New Revision: 347907 URL: https://svnweb.freebsd.org/changeset/base/347907 Log: FCP-101: remove obsolete 10 and 10/100 Ethernet drivers. Initial commit adding comment to ObsoleteFiles. Each driver will be removed in a seperate commit to allow later reverts if required. FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Reviewed by: jhb, imp Differential Revision: https://reviews.freebsd.org/D20230 Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 17 14:29:56 2019 (r347906) +++ head/ObsoleteFiles.inc Fri May 17 15:19:12 2019 (r347907) @@ -38,6 +38,7 @@ # xargs -n1 | sort | uniq -d; # done +# 20190518: Remove obsolete 10 and 10/100 ethernet drivers. # 20190513: libcap_sysctl interface change OLD_FILES+=lib/casper/libcap_sysctl.1 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package. From owner-svn-src-head@freebsd.org Fri May 17 15:20:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CA101597B1F; Fri, 17 May 2019 15:20: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 D355677327; Fri, 17 May 2019 15:20:52 +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 ACBCAA06D; Fri, 17 May 2019 15:20:52 +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 x4HFKq14001061; Fri, 17 May 2019 15:20:52 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HFKpbd001054; Fri, 17 May 2019 15:20:51 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905171520.x4HFKpbd001054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 May 2019 15:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347908 - in head: . share/man/man4/man4.powerpc sys/conf sys/dev/bm sys/modules sys/modules/bm sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . share/man/man4/man4.powerpc sys/conf sys/dev/bm sys/modules sys/modules/bm sys/powerpc/conf X-SVN-Commit-Revision: 347908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D355677327 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 15:20:53 -0000 Author: brooks Date: Fri May 17 15:20:51 2019 New Revision: 347908 URL: https://svnweb.freebsd.org/changeset/base/347908 Log: FCP-101: Remove bm(4). Relnotes: yes FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Reviewed by: jhb, imp Differential Revision: https://reviews.freebsd.org/D20230 Deleted: head/share/man/man4/man4.powerpc/bm.4 head/sys/dev/bm/ head/sys/modules/bm/ Modified: head/ObsoleteFiles.inc head/share/man/man4/man4.powerpc/Makefile head/sys/conf/files.powerpc head/sys/modules/Makefile head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/NOTES Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 17 15:19:12 2019 (r347907) +++ head/ObsoleteFiles.inc Fri May 17 15:20:51 2019 (r347908) @@ -39,6 +39,7 @@ # done # 20190518: Remove obsolete 10 and 10/100 ethernet drivers. +OLD_FILES+=usr/share/man/man4/bm.4 # 20190513: libcap_sysctl interface change OLD_FILES+=lib/casper/libcap_sysctl.1 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package. Modified: head/share/man/man4/man4.powerpc/Makefile ============================================================================== --- head/share/man/man4/man4.powerpc/Makefile Fri May 17 15:19:12 2019 (r347907) +++ head/share/man/man4/man4.powerpc/Makefile Fri May 17 15:20:51 2019 (r347908) @@ -6,7 +6,6 @@ MAN= adb.4 \ akbd.4 \ abtn.4 \ ams.4 \ - bm.4 \ cuda.4 \ dtsec.4 \ llan.4 \ Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Fri May 17 15:19:12 2019 (r347907) +++ head/sys/conf/files.powerpc Fri May 17 15:20:51 2019 (r347908) @@ -22,7 +22,6 @@ cddl/dev/dtrace/powerpc/dtrace_subr.c optional dtrace cddl/dev/fbt/powerpc/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" crypto/blowfish/bf_enc.c optional crypto | ipsec | ipsec_support crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb -dev/bm/if_bm.c optional bm powermac dev/adb/adb_bus.c optional adb dev/adb/adb_kbd.c optional adb dev/adb/adb_mouse.c optional adb Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri May 17 15:19:12 2019 (r347907) +++ head/sys/modules/Makefile Fri May 17 15:20:51 2019 (r347908) @@ -68,7 +68,6 @@ SUBDIR= \ ${_bios} \ ${_bktr} \ ${_blake2} \ - ${_bm} \ bnxt \ bridgestp \ bwi \ @@ -766,7 +765,6 @@ _cpsw= cpsw .if ${MACHINE_CPUARCH} == "powerpc" _agp= agp _an= an -_bm= bm _cardbus= cardbus _cbb= cbb _cfi= cfi Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Fri May 17 15:19:12 2019 (r347907) +++ head/sys/powerpc/conf/GENERIC Fri May 17 15:20:51 2019 (r347908) @@ -155,7 +155,6 @@ device fwe # Ethernet over FireWire (non-standard!) # PCI Ethernet NICs that use the common MII bus controller code. device miibus # MII bus support device bge # Broadcom BCM570xx Gigabit Ethernet -device bm # Apple BMAC Ethernet device gem # Sun GEM/Sun ERI/Apple GMAC device dc # DEC/Intel 21143 and various workalikes device fxp # Intel EtherExpress PRO/100B (82557, 82558) Modified: head/sys/powerpc/conf/NOTES ============================================================================== --- head/sys/powerpc/conf/NOTES Fri May 17 15:19:12 2019 (r347907) +++ head/sys/powerpc/conf/NOTES Fri May 17 15:20:51 2019 (r347908) @@ -54,7 +54,6 @@ device cpufreq # Standard busses device agp -device bm # Apple BMAC (Big Mac Ethernet) device glc # Sony Playstation 3 Ethernet device kiic # Apple Keywest I2C Controller device ofwd # Open Firmware disks From owner-svn-src-head@freebsd.org Fri May 17 15:22:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C83581597BD5; Fri, 17 May 2019 15:22:47 +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 6B4E7776D3; Fri, 17 May 2019 15:22:47 +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 37EA2A1E7; Fri, 17 May 2019 15:22:47 +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 x4HFMlml005738; Fri, 17 May 2019 15:22:47 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HFMkmC005732; Fri, 17 May 2019 15:22:46 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905171522.x4HFMkmC005732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 May 2019 15:22:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347909 - in head: . share/man/man4/man4.i386 sys/conf sys/dev/cs sys/i386/conf sys/modules sys/modules/cs X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . share/man/man4/man4.i386 sys/conf sys/dev/cs sys/i386/conf sys/modules sys/modules/cs X-SVN-Commit-Revision: 347909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6B4E7776D3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Fri, 17 May 2019 15:22:48 -0000 Author: brooks Date: Fri May 17 15:22:45 2019 New Revision: 347909 URL: https://svnweb.freebsd.org/changeset/base/347909 Log: FCP-101: Remove cs(4). Relnotes: yes FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Reviewed by: jhb, imp Differential Revision: https://reviews.freebsd.org/D20230 Deleted: head/share/man/man4/man4.i386/cs.4 head/sys/dev/cs/ head/sys/modules/cs/ Modified: head/ObsoleteFiles.inc head/share/man/man4/man4.i386/Makefile head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/i386/conf/NOTES head/sys/modules/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 17 15:20:51 2019 (r347908) +++ head/ObsoleteFiles.inc Fri May 17 15:22:45 2019 (r347909) @@ -40,6 +40,7 @@ # 20190518: Remove obsolete 10 and 10/100 ethernet drivers. OLD_FILES+=usr/share/man/man4/bm.4 +OLD_FILES+=usr/share/man/man4/cs.4 # 20190513: libcap_sysctl interface change OLD_FILES+=lib/casper/libcap_sysctl.1 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package. Modified: head/share/man/man4/man4.i386/Makefile ============================================================================== --- head/share/man/man4/man4.i386/Makefile Fri May 17 15:20:51 2019 (r347908) +++ head/share/man/man4/man4.i386/Makefile Fri May 17 15:22:45 2019 (r347909) @@ -6,7 +6,6 @@ MAN= apm.4 \ ce.4 \ cp.4 \ CPU_ELAN.4 \ - cs.4 \ ctau.4 \ cx.4 \ ep.4 \ Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 17 15:20:51 2019 (r347908) +++ head/sys/conf/files Fri May 17 15:22:45 2019 (r347909) @@ -1358,9 +1358,6 @@ dev/ciss/ciss.c optional ciss dev/cmx/cmx.c optional cmx dev/cmx/cmx_pccard.c optional cmx pccard dev/cpufreq/ichss.c optional cpufreq pci -dev/cs/if_cs.c optional cs -dev/cs/if_cs_isa.c optional cs isa -dev/cs/if_cs_pccard.c optional cs pccard dev/cxgb/cxgb_main.c optional cxgb pci \ compile-with "${NORMAL_C} -I$S/dev/cxgb" dev/cxgb/cxgb_sge.c optional cxgb pci \ Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri May 17 15:20:51 2019 (r347908) +++ head/sys/i386/conf/GENERIC Fri May 17 15:22:45 2019 (r347909) @@ -272,7 +272,6 @@ device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # ISA Ethernet NICs. pccard NICs included. -device cs # Crystal Semiconductor CS89x0 NIC # 'device ed' requires 'device miibus' device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards device ex # Intel EtherExpress Pro/10 and Pro/10+ Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Fri May 17 15:20:51 2019 (r347908) +++ head/sys/i386/conf/NOTES Fri May 17 15:22:45 2019 (r347909) @@ -502,7 +502,6 @@ device cpufreq # V.35/RS-232/RS-530/RS-449/X.21/G.703/E1/E3/T3/STS-1 # serial adaptor (requires sppp (default), or NETGRAPH if # NETGRAPH_CRONYX is configured) -# cs: IBM Etherjet and other Crystal Semi CS89x0-based adapters # ctau: Cronyx Tau sync dual port V.35/RS-232/RS-530/RS-449/X.21/G.703/E1 # serial adaptor (requires sppp (default), or NETGRAPH if # NETGRAPH_CRONYX is configured) @@ -529,7 +528,6 @@ device cpufreq device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE device ce device cp -device cs # Crystal Semiconductor CS89x0 NIC hint.cs.0.at="isa" hint.cs.0.port="0x300" device ctau Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri May 17 15:20:51 2019 (r347908) +++ head/sys/modules/Makefile Fri May 17 15:22:45 2019 (r347909) @@ -98,7 +98,6 @@ SUBDIR= \ ${_cpufreq} \ ${_crypto} \ ${_cryptodev} \ - ${_cs} \ ${_ctau} \ ctl \ ${_cxgb} \ @@ -600,7 +599,6 @@ _cardbus= cardbus _cbb= cbb _cpuctl= cpuctl _cpufreq= cpufreq -_cs= cs _dpms= dpms _ed= ed _em= em From owner-svn-src-head@freebsd.org Fri May 17 15:22:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 280EF1597C00; Fri, 17 May 2019 15:22:58 +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 C154E77793; Fri, 17 May 2019 15:22: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 137AEA1EA; Fri, 17 May 2019 15:22:56 +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 x4HFMtVa005797; Fri, 17 May 2019 15:22:55 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HFMsRt005790; Fri, 17 May 2019 15:22:54 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905171522.x4HFMsRt005790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 May 2019 15:22:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347910 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/de sys/i386/conf sys/modules sys/modules/de sys/sparc64/conf X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/de sys/i386/conf sys/modules sys/modules/de sys/sparc64/conf X-SVN-Commit-Revision: 347910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C154E77793 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 15:22:58 -0000 Author: brooks Date: Fri May 17 15:22:54 2019 New Revision: 347910 URL: https://svnweb.freebsd.org/changeset/base/347910 Log: FCP-101: Remove de(4). Relnotes: yes FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Reviewed by: jhb, imp Differential Revision: https://reviews.freebsd.org/D20230 Deleted: head/share/man/man4/de.4 head/sys/dev/de/ head/sys/modules/de/ Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/amd64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/modules/Makefile head/sys/sparc64/conf/GENERIC Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 17 15:22:45 2019 (r347909) +++ head/ObsoleteFiles.inc Fri May 17 15:22:54 2019 (r347910) @@ -41,6 +41,8 @@ # 20190518: Remove obsolete 10 and 10/100 ethernet drivers. OLD_FILES+=usr/share/man/man4/bm.4 OLD_FILES+=usr/share/man/man4/cs.4 +OLD_FILES+=usr/share/man/man4/de.4 +OLD_FILES+=usr/share/man/man4/if_de.4 # 20190513: libcap_sysctl interface change OLD_FILES+=lib/casper/libcap_sysctl.1 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package. Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri May 17 15:22:45 2019 (r347909) +++ head/share/man/man4/Makefile Fri May 17 15:22:54 2019 (r347910) @@ -128,7 +128,6 @@ MAN= aac.4 \ dcons.4 \ dcons_crom.4 \ ddb.4 \ - de.4 \ devctl.4 \ disc.4 \ divert.4 \ @@ -627,7 +626,6 @@ MLINKS+=cxgbev.4 if_cxgbev.4 \ cxgbev.4 ccv.4 \ cxgbev.4 if_ccv.4 MLINKS+=dc.4 if_dc.4 -MLINKS+=de.4 if_de.4 MLINKS+=disc.4 if_disc.4 MLINKS+=ed.4 if_ed.4 MLINKS+=edsc.4 if_edsc.4 Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri May 17 15:22:45 2019 (r347909) +++ head/sys/amd64/conf/GENERIC Fri May 17 15:22:54 2019 (r347910) @@ -245,7 +245,6 @@ device vmx # VMware VMXNET3 Ethernet # PCI Ethernet NICs. device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE -device de # DEC/Intel DC21x4x (``Tulip'') device le # AMD Am7900 LANCE and Am79C9xx PCnet device ti # Alteon Networks Tigon I/II gigabit Ethernet device txp # 3Com 3cR990 (``Typhoon'') Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri May 17 15:22:45 2019 (r347909) +++ head/sys/conf/NOTES Fri May 17 15:22:54 2019 (r347910) @@ -1936,7 +1936,6 @@ device xmphy # XaQti XMAC II # SVEC PN102-TX, CNet Pro110B, 120A, and 120B, Compex RL100-TX, # LinkSys LNE100TX, LNE100TX V2.0, Jaton XpressNet, Alfa Inc GFC2204, # KNE110TX. -# de: Digital Equipment DC21040 # em: Intel Pro/1000 Gigabit Ethernet 82542, 82543, 82544 based adapters. # ep: 3Com 3C509, 3C529, 3C556, 3C562D, 3C563D, 3C572, 3C574X, 3C579, 3C589 # and PC Card devices using these chipsets. @@ -2108,7 +2107,6 @@ device cxgb # Chelsio T3 10 Gigabit Ethernet device cxgb_t3fw # Chelsio T3 10 Gigabit Ethernet firmware device cxgbe # Chelsio T4-T6 1/10/25/40/100 Gigabit Ethernet device cxgbev # Chelsio T4-T6 Virtual Functions -device de # DEC/Intel DC21x4x (``Tulip'') device le # AMD Am7900 LANCE and Am79C9xx PCnet device mxge # Myricom Myri-10G 10GbE NIC device oce # Emulex 10 GbE (OneConnect Ethernet) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 17 15:22:45 2019 (r347909) +++ head/sys/conf/files Fri May 17 15:22:54 2019 (r347910) @@ -1539,7 +1539,6 @@ dev/dc/pnphy.c optional dc pci dev/dcons/dcons.c optional dcons dev/dcons/dcons_crom.c optional dcons_crom dev/dcons/dcons_os.c optional dcons -dev/de/if_de.c optional de pci dev/dme/if_dme.c optional dme dev/drm2/drm_agpsupport.c optional drm2 dev/drm2/drm_auth.c optional drm2 Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri May 17 15:22:45 2019 (r347909) +++ head/sys/i386/conf/GENERIC Fri May 17 15:22:54 2019 (r347910) @@ -227,7 +227,6 @@ device vmx # VMware VMXNET3 Ethernet # PCI Ethernet NICs. device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE -device de # DEC/Intel DC21x4x (``Tulip'') device le # AMD Am7900 LANCE and Am79C9xx PCnet device ti # Alteon Networks Tigon I/II gigabit Ethernet device txp # 3Com 3cR990 (``Typhoon'') Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri May 17 15:22:45 2019 (r347909) +++ head/sys/modules/Makefile Fri May 17 15:22:54 2019 (r347910) @@ -105,7 +105,6 @@ SUBDIR= \ dc \ dcons \ dcons_crom \ - de \ ${_dpms} \ dummynet \ ${_ed} \ Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Fri May 17 15:22:45 2019 (r347909) +++ head/sys/sparc64/conf/GENERIC Fri May 17 15:22:54 2019 (r347910) @@ -184,7 +184,6 @@ device uart # Multi-uart driver device iflib # PCI Ethernet NICs. -#device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel PRO/1000 adapter Gigabit Ethernet Card device le # AMD Am7900 LANCE and Am79C9xx PCnet device ti # Alteon Networks Tigon I/II gigabit Ethernet From owner-svn-src-head@freebsd.org Fri May 17 15:23:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B5DA1597C31; Fri, 17 May 2019 15:23:06 +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 DDAA17782F; Fri, 17 May 2019 15:23:05 +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 41DA0A1EE; Fri, 17 May 2019 15:23: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 x4HFN46m005861; Fri, 17 May 2019 15:23:04 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HFN2Pw005854; Fri, 17 May 2019 15:23:02 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905171523.x4HFN2Pw005854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 May 2019 15:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347911 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/ed sys/i386/conf sys/modules sys/modules/ed X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/ed sys/i386/conf sys/modules sys/modules/ed X-SVN-Commit-Revision: 347911 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DDAA17782F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 15:23:06 -0000 Author: brooks Date: Fri May 17 15:23:02 2019 New Revision: 347911 URL: https://svnweb.freebsd.org/changeset/base/347911 Log: FCP-101: Remove ed(4). Relnotes: yes FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Reviewed by: jhb, imp Differential Revision: https://reviews.freebsd.org/D20230 Deleted: head/share/man/man4/ed.4 head/sys/dev/ed/ head/sys/modules/ed/ Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/amd64/conf/NOTES head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/i386/conf/NOTES head/sys/modules/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 17 15:22:54 2019 (r347910) +++ head/ObsoleteFiles.inc Fri May 17 15:23:02 2019 (r347911) @@ -43,6 +43,8 @@ OLD_FILES+=usr/share/man/man4/bm.4 OLD_FILES+=usr/share/man/man4/cs.4 OLD_FILES+=usr/share/man/man4/de.4 OLD_FILES+=usr/share/man/man4/if_de.4 +OLD_FILES+=usr/share/man/man4/ed.4 +OLD_FILES+=usr/share/man/man4/if_ed.4 # 20190513: libcap_sysctl interface change OLD_FILES+=lib/casper/libcap_sysctl.1 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package. Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri May 17 15:22:54 2019 (r347910) +++ head/share/man/man4/Makefile Fri May 17 15:23:02 2019 (r347911) @@ -136,7 +136,6 @@ MAN= aac.4 \ ds3231.4 \ ${_dtrace_provs} \ dummynet.4 \ - ed.4 \ edsc.4 \ ehci.4 \ em.4 \ @@ -627,7 +626,6 @@ MLINKS+=cxgbev.4 if_cxgbev.4 \ cxgbev.4 if_ccv.4 MLINKS+=dc.4 if_dc.4 MLINKS+=disc.4 if_disc.4 -MLINKS+=ed.4 if_ed.4 MLINKS+=edsc.4 if_edsc.4 MLINKS+=em.4 if_em.4 MLINKS+=enc.4 if_enc.4 Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Fri May 17 15:22:54 2019 (r347910) +++ head/sys/amd64/conf/NOTES Fri May 17 15:23:02 2019 (r347911) @@ -292,9 +292,6 @@ device cpufreq # bxe: Broadcom NetXtreme II (BCM5771X/BCM578XX) PCIe 10Gb Ethernet # adapters. -# ed: Western Digital and SMC 80xx; Novell NE1000 and NE2000; 3Com 3C503 -# HP PC Lan+, various PC Card devices -# (requires miibus) # ipw: Intel PRO/Wireless 2100 IEEE 802.11 adapter # Requires the ipw firmware module # iwi: Intel PRO/Wireless 2200BG/2225BG/2915ABG IEEE 802.11 adapters @@ -312,7 +309,6 @@ device cpufreq # Requires the wpi firmware module device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE -device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards options ED_3C503 options ED_HPP options ED_SIC Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 17 15:22:54 2019 (r347910) +++ head/sys/conf/files Fri May 17 15:23:02 2019 (r347911) @@ -1583,11 +1583,6 @@ dev/drm2/ttm/ttm_execbuf_util.c optional drm2 dev/drm2/ttm/ttm_memory.c optional drm2 dev/drm2/ttm/ttm_page_alloc.c optional drm2 dev/drm2/ttm/ttm_bo_vm.c optional drm2 -dev/ed/if_ed.c optional ed -dev/ed/if_ed_novell.c optional ed -dev/ed/if_ed_rtl80x9.c optional ed -dev/ed/if_ed_pccard.c optional ed pccard -dev/ed/if_ed_pci.c optional ed pci dev/efidev/efidev.c optional efirt dev/efidev/efirt.c optional efirt dev/efidev/efirtc.c optional efirt Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri May 17 15:22:54 2019 (r347910) +++ head/sys/i386/conf/GENERIC Fri May 17 15:23:02 2019 (r347911) @@ -271,8 +271,6 @@ device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # ISA Ethernet NICs. pccard NICs included. -# 'device ed' requires 'device miibus' -device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards device ex # Intel EtherExpress Pro/10 and Pro/10+ device ep # Etherlink III based cards device fe # Fujitsu MB8696x based cards Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Fri May 17 15:22:54 2019 (r347910) +++ head/sys/i386/conf/NOTES Fri May 17 15:23:02 2019 (r347911) @@ -505,9 +505,6 @@ device cpufreq # ctau: Cronyx Tau sync dual port V.35/RS-232/RS-530/RS-449/X.21/G.703/E1 # serial adaptor (requires sppp (default), or NETGRAPH if # NETGRAPH_CRONYX is configured) -# ed: Western Digital and SMC 80xx; Novell NE1000 and NE2000; 3Com 3C503 -# HP PC Lan+, various PC Card devices -# (requires miibus) # ipw: Intel PRO/Wireless 2100 IEEE 802.11 adapter # iwi: Intel PRO/Wireless 2200BG/2225BG/2915ABG IEEE 802.11 adapters # Requires the iwi firmware module @@ -536,7 +533,6 @@ hint.ctau.0.port="0x240" hint.ctau.0.irq="15" hint.ctau.0.drq="7" #options NETGRAPH_CRONYX # Enable NETGRAPH support for Cronyx adapter(s) -device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards options ED_3C503 options ED_HPP options ED_SIC Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri May 17 15:22:54 2019 (r347910) +++ head/sys/modules/Makefile Fri May 17 15:23:02 2019 (r347911) @@ -107,7 +107,6 @@ SUBDIR= \ dcons_crom \ ${_dpms} \ dummynet \ - ${_ed} \ ${_efirt} \ ${_em} \ ${_ena} \ @@ -599,7 +598,6 @@ _cbb= cbb _cpuctl= cpuctl _cpufreq= cpufreq _dpms= dpms -_ed= ed _em= em _ep= ep _et= et From owner-svn-src-head@freebsd.org Fri May 17 15:23:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79F7B1597C62; Fri, 17 May 2019 15:23: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 1C0B2778EB; Fri, 17 May 2019 15:23:13 +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 86542A1F0; Fri, 17 May 2019 15:23: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 x4HFNC1p005925; Fri, 17 May 2019 15:23:12 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HFNAIs005916; Fri, 17 May 2019 15:23:10 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905171523.x4HFNAIs005916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 May 2019 15:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347912 - in head: . share/man/man4/man4.i386 sys/conf sys/dev/ep sys/i386/conf sys/modules sys/modules/ep X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . share/man/man4/man4.i386 sys/conf sys/dev/ep sys/i386/conf sys/modules sys/modules/ep X-SVN-Commit-Revision: 347912 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1C0B2778EB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 15:23:13 -0000 Author: brooks Date: Fri May 17 15:23:10 2019 New Revision: 347912 URL: https://svnweb.freebsd.org/changeset/base/347912 Log: FCP-101: Remove ep(4). Relnotes: yes FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Reviewed by: jhb, imp Differential Revision: https://reviews.freebsd.org/D20230 Deleted: head/share/man/man4/man4.i386/ep.4 head/sys/dev/ep/ head/sys/modules/ep/ Modified: head/ObsoleteFiles.inc head/share/man/man4/man4.i386/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/conf/files.i386 head/sys/i386/conf/GENERIC head/sys/modules/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 17 15:23:02 2019 (r347911) +++ head/ObsoleteFiles.inc Fri May 17 15:23:10 2019 (r347912) @@ -45,6 +45,7 @@ OLD_FILES+=usr/share/man/man4/de.4 OLD_FILES+=usr/share/man/man4/if_de.4 OLD_FILES+=usr/share/man/man4/ed.4 OLD_FILES+=usr/share/man/man4/if_ed.4 +OLD_FILES+=usr/share/man/man4/ep.4 # 20190513: libcap_sysctl interface change OLD_FILES+=lib/casper/libcap_sysctl.1 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package. Modified: head/share/man/man4/man4.i386/Makefile ============================================================================== --- head/share/man/man4/man4.i386/Makefile Fri May 17 15:23:02 2019 (r347911) +++ head/share/man/man4/man4.i386/Makefile Fri May 17 15:23:10 2019 (r347912) @@ -8,7 +8,6 @@ MAN= apm.4 \ CPU_ELAN.4 \ ctau.4 \ cx.4 \ - ep.4 \ ex.4 \ fe.4 \ glxiic.4 \ Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri May 17 15:23:02 2019 (r347911) +++ head/sys/conf/NOTES Fri May 17 15:23:10 2019 (r347912) @@ -1937,8 +1937,6 @@ device xmphy # XaQti XMAC II # LinkSys LNE100TX, LNE100TX V2.0, Jaton XpressNet, Alfa Inc GFC2204, # KNE110TX. # em: Intel Pro/1000 Gigabit Ethernet 82542, 82543, 82544 based adapters. -# ep: 3Com 3C509, 3C529, 3C556, 3C562D, 3C563D, 3C572, 3C574X, 3C579, 3C589 -# and PC Card devices using these chipsets. # ex: Intel EtherExpress Pro/10 and other i82595-based adapters, # Olicom Ethernet PC Card devices. # fe: Fujitsu MB86960A/MB86965A Ethernet @@ -2044,7 +2042,6 @@ device xmphy # XaQti XMAC II # Order for ISA devices is important here -device ep device ex device fe hint.fe.0.at="isa" Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 17 15:23:02 2019 (r347911) +++ head/sys/conf/files Fri May 17 15:23:10 2019 (r347912) @@ -1633,9 +1633,6 @@ dev/ena/ena_sysctl.c optional ena \ compile-with "${NORMAL_C} -I$S/contrib" contrib/ena-com/ena_com.c optional ena contrib/ena-com/ena_eth_com.c optional ena -dev/ep/if_ep.c optional ep -dev/ep/if_ep_isa.c optional ep isa -dev/ep/if_ep_pccard.c optional ep pccard dev/esp/esp_pci.c optional esp pci dev/esp/ncr53c9x.c optional esp dev/etherswitch/arswitch/arswitch.c optional arswitch Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Fri May 17 15:23:02 2019 (r347911) +++ head/sys/conf/files.i386 Fri May 17 15:23:10 2019 (r347912) @@ -199,7 +199,6 @@ dev/ed/if_ed_isa.c optional ed isa dev/ed/if_ed_wd80x3.c optional ed isa dev/ed/if_ed_hpp.c optional ed isa ed_hpp dev/ed/if_ed_sic.c optional ed isa ed_sic -dev/ep/elink.c optional ep dev/fb/fb.c optional fb | vga dev/fb/s3_pci.c optional s3pci dev/fb/vesa.c optional vga vesa Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri May 17 15:23:02 2019 (r347911) +++ head/sys/i386/conf/GENERIC Fri May 17 15:23:10 2019 (r347912) @@ -272,7 +272,6 @@ device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # ISA Ethernet NICs. pccard NICs included. device ex # Intel EtherExpress Pro/10 and Pro/10+ -device ep # Etherlink III based cards device fe # Fujitsu MB8696x based cards device sn # SMC's 9000 series of Ethernet chips device xe # Xircom pccard Ethernet Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri May 17 15:23:02 2019 (r347911) +++ head/sys/modules/Makefile Fri May 17 15:23:10 2019 (r347912) @@ -110,7 +110,6 @@ SUBDIR= \ ${_efirt} \ ${_em} \ ${_ena} \ - ${_ep} \ ${_epic} \ esp \ ${_et} \ @@ -599,7 +598,6 @@ _cpuctl= cpuctl _cpufreq= cpufreq _dpms= dpms _em= em -_ep= ep _et= et _exca= exca _fe= fe From owner-svn-src-head@freebsd.org Fri May 17 15:23:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F96F1597C8F; Fri, 17 May 2019 15:23:21 +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 0B207779C6; Fri, 17 May 2019 15:23:21 +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 3BE66A1F1; Fri, 17 May 2019 15:23:20 +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 x4HFNKF8005988; Fri, 17 May 2019 15:23:20 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HFNJVk005982; Fri, 17 May 2019 15:23:19 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905171523.x4HFNJVk005982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 May 2019 15:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347913 - in head: . share/man/man4/man4.i386 sys/conf sys/dev/ex sys/i386/conf sys/modules sys/modules/ex X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . share/man/man4/man4.i386 sys/conf sys/dev/ex sys/i386/conf sys/modules sys/modules/ex X-SVN-Commit-Revision: 347913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B207779C6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 15:23:21 -0000 Author: brooks Date: Fri May 17 15:23:18 2019 New Revision: 347913 URL: https://svnweb.freebsd.org/changeset/base/347913 Log: FCP-101: Remove ex(4). Relnotes: yes FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Reviewed by: jhb, imp Differential Revision: https://reviews.freebsd.org/D20230 Deleted: head/share/man/man4/man4.i386/ex.4 head/sys/dev/ex/ head/sys/modules/ex/ Modified: head/ObsoleteFiles.inc head/share/man/man4/man4.i386/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/modules/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 17 15:23:10 2019 (r347912) +++ head/ObsoleteFiles.inc Fri May 17 15:23:18 2019 (r347913) @@ -46,6 +46,7 @@ OLD_FILES+=usr/share/man/man4/if_de.4 OLD_FILES+=usr/share/man/man4/ed.4 OLD_FILES+=usr/share/man/man4/if_ed.4 OLD_FILES+=usr/share/man/man4/ep.4 +OLD_FILES+=usr/share/man/man4/ex.4 # 20190513: libcap_sysctl interface change OLD_FILES+=lib/casper/libcap_sysctl.1 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package. Modified: head/share/man/man4/man4.i386/Makefile ============================================================================== --- head/share/man/man4/man4.i386/Makefile Fri May 17 15:23:10 2019 (r347912) +++ head/share/man/man4/man4.i386/Makefile Fri May 17 15:23:18 2019 (r347913) @@ -8,7 +8,6 @@ MAN= apm.4 \ CPU_ELAN.4 \ ctau.4 \ cx.4 \ - ex.4 \ fe.4 \ glxiic.4 \ glxsb.4 \ Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri May 17 15:23:10 2019 (r347912) +++ head/sys/conf/NOTES Fri May 17 15:23:18 2019 (r347913) @@ -1937,8 +1937,6 @@ device xmphy # XaQti XMAC II # LinkSys LNE100TX, LNE100TX V2.0, Jaton XpressNet, Alfa Inc GFC2204, # KNE110TX. # em: Intel Pro/1000 Gigabit Ethernet 82542, 82543, 82544 based adapters. -# ex: Intel EtherExpress Pro/10 and other i82595-based adapters, -# Olicom Ethernet PC Card devices. # fe: Fujitsu MB86960A/MB86965A Ethernet # fxp: Intel EtherExpress Pro/100B # (hint of prefer_iomap can be done to prefer I/O instead of Mem mapping) @@ -2042,7 +2040,6 @@ device xmphy # XaQti XMAC II # Order for ISA devices is important here -device ex device fe hint.fe.0.at="isa" hint.fe.0.port="0x300" Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 17 15:23:10 2019 (r347912) +++ head/sys/conf/files Fri May 17 15:23:18 2019 (r347913) @@ -1664,9 +1664,6 @@ dev/evdev/evdev.c optional evdev dev/evdev/evdev_mt.c optional evdev dev/evdev/evdev_utils.c optional evdev dev/evdev/uinput.c optional evdev uinput -dev/ex/if_ex.c optional ex -dev/ex/if_ex_isa.c optional ex isa -dev/ex/if_ex_pccard.c optional ex pccard dev/exca/exca.c optional cbb dev/extres/clk/clk.c optional ext_resources clk fdt dev/extres/clk/clkdev_if.m optional ext_resources clk fdt Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri May 17 15:23:10 2019 (r347912) +++ head/sys/i386/conf/GENERIC Fri May 17 15:23:18 2019 (r347913) @@ -271,7 +271,6 @@ device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # ISA Ethernet NICs. pccard NICs included. -device ex # Intel EtherExpress Pro/10 and Pro/10+ device fe # Fujitsu MB8696x based cards device sn # SMC's 9000 series of Ethernet chips device xe # Xircom pccard Ethernet Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri May 17 15:23:10 2019 (r347912) +++ head/sys/modules/Makefile Fri May 17 15:23:18 2019 (r347913) @@ -114,7 +114,6 @@ SUBDIR= \ esp \ ${_et} \ evdev \ - ${_ex} \ ${_exca} \ ext2fs \ fdc \ @@ -747,7 +746,6 @@ _sbni= sbni .if ${MK_SOURCELESS_UCODE} != "no" _ctau= ctau .endif -_ex= ex .endif .if ${MACHINE_CPUARCH} == "arm" From owner-svn-src-head@freebsd.org Fri May 17 15:23:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2E6B1597CB4; Fri, 17 May 2019 15:23:29 +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 64CFC77AAD; Fri, 17 May 2019 15:23:29 +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 24264A1F2; Fri, 17 May 2019 15:23:28 +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 x4HFNSRE006045; Fri, 17 May 2019 15:23:28 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HFNQ5S006039; Fri, 17 May 2019 15:23:26 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905171523.x4HFNQ5S006039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 May 2019 15:23:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347914 - in head: . share/man/man4/man4.i386 sys/conf sys/dev/fe sys/i386/conf sys/modules sys/modules/fe X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . share/man/man4/man4.i386 sys/conf sys/dev/fe sys/i386/conf sys/modules sys/modules/fe X-SVN-Commit-Revision: 347914 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 64CFC77AAD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 15:23:30 -0000 Author: brooks Date: Fri May 17 15:23:26 2019 New Revision: 347914 URL: https://svnweb.freebsd.org/changeset/base/347914 Log: FCP-101: Remove fe(4). Relnotes: yes FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Reviewed by: jhb, imp Differential Revision: https://reviews.freebsd.org/D20230 Deleted: head/share/man/man4/man4.i386/fe.4 head/sys/dev/fe/ head/sys/modules/fe/ Modified: head/ObsoleteFiles.inc head/share/man/man4/man4.i386/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/modules/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 17 15:23:18 2019 (r347913) +++ head/ObsoleteFiles.inc Fri May 17 15:23:26 2019 (r347914) @@ -47,6 +47,7 @@ OLD_FILES+=usr/share/man/man4/ed.4 OLD_FILES+=usr/share/man/man4/if_ed.4 OLD_FILES+=usr/share/man/man4/ep.4 OLD_FILES+=usr/share/man/man4/ex.4 +OLD_FILES+=usr/share/man/man4/fe.4 # 20190513: libcap_sysctl interface change OLD_FILES+=lib/casper/libcap_sysctl.1 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package. Modified: head/share/man/man4/man4.i386/Makefile ============================================================================== --- head/share/man/man4/man4.i386/Makefile Fri May 17 15:23:18 2019 (r347913) +++ head/share/man/man4/man4.i386/Makefile Fri May 17 15:23:26 2019 (r347914) @@ -8,7 +8,6 @@ MAN= apm.4 \ CPU_ELAN.4 \ ctau.4 \ cx.4 \ - fe.4 \ glxiic.4 \ glxsb.4 \ longrun.4 \ Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri May 17 15:23:18 2019 (r347913) +++ head/sys/conf/NOTES Fri May 17 15:23:26 2019 (r347914) @@ -1937,7 +1937,6 @@ device xmphy # XaQti XMAC II # LinkSys LNE100TX, LNE100TX V2.0, Jaton XpressNet, Alfa Inc GFC2204, # KNE110TX. # em: Intel Pro/1000 Gigabit Ethernet 82542, 82543, 82544 based adapters. -# fe: Fujitsu MB86960A/MB86965A Ethernet # fxp: Intel EtherExpress Pro/100B # (hint of prefer_iomap can be done to prefer I/O instead of Mem mapping) # gem: Apple GMAC/Sun ERI/Sun GEM @@ -2040,9 +2039,6 @@ device xmphy # XaQti XMAC II # Order for ISA devices is important here -device fe -hint.fe.0.at="isa" -hint.fe.0.port="0x300" device sn hint.sn.0.at="isa" hint.sn.0.port="0x300" Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 17 15:23:18 2019 (r347913) +++ head/sys/conf/files Fri May 17 15:23:26 2019 (r347914) @@ -1703,8 +1703,6 @@ dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static \ dependency "${FDT_DTS_FILE:T:R}.dtb" dev/fdt/simplebus.c optional fdt dev/fdt/simple_mfd.c optional fdt -dev/fe/if_fe.c optional fe -dev/fe/if_fe_pccard.c optional fe pccard dev/filemon/filemon.c optional filemon dev/firewire/firewire.c optional firewire dev/firewire/fwcrom.c optional firewire Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri May 17 15:23:18 2019 (r347913) +++ head/sys/i386/conf/GENERIC Fri May 17 15:23:26 2019 (r347914) @@ -271,7 +271,6 @@ device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # ISA Ethernet NICs. pccard NICs included. -device fe # Fujitsu MB8696x based cards device sn # SMC's 9000 series of Ethernet chips device xe # Xircom pccard Ethernet Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri May 17 15:23:18 2019 (r347913) +++ head/sys/modules/Makefile Fri May 17 15:23:26 2019 (r347914) @@ -118,7 +118,6 @@ SUBDIR= \ ext2fs \ fdc \ fdescfs \ - ${_fe} \ ${_ffec} \ filemon \ firewire \ @@ -599,7 +598,6 @@ _dpms= dpms _em= em _et= et _exca= exca -_fe= fe _if_ndis= if_ndis _io= io _ix= ix From owner-svn-src-head@freebsd.org Fri May 17 15:23:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 968F91597CDE; Fri, 17 May 2019 15:23:39 +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 3854377BB7; Fri, 17 May 2019 15:23:39 +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 AFF2CA1F3; Fri, 17 May 2019 15:23:36 +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 x4HFNa4n006105; Fri, 17 May 2019 15:23:36 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HFNZti006097; Fri, 17 May 2019 15:23:35 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905171523.x4HFNZti006097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 May 2019 15:23:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347915 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/pcn sys/i386/conf sys/modules sys/modules/pcn sys/sparc64/conf X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/pcn sys/i386/conf sys/modules sys/modules/pcn sys/sparc64/conf X-SVN-Commit-Revision: 347915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3854377BB7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 15:23:39 -0000 Author: brooks Date: Fri May 17 15:23:34 2019 New Revision: 347915 URL: https://svnweb.freebsd.org/changeset/base/347915 Log: FCP-101: Remove pcn(4). Relnotes: yes FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Reviewed by: jhb, imp Differential Revision: https://reviews.freebsd.org/D20230 Deleted: head/share/man/man4/pcn.4 head/sys/dev/pcn/ head/sys/modules/pcn/ Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/amd64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/modules/Makefile head/sys/sparc64/conf/GENERIC Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 17 15:23:26 2019 (r347914) +++ head/ObsoleteFiles.inc Fri May 17 15:23:34 2019 (r347915) @@ -48,6 +48,8 @@ OLD_FILES+=usr/share/man/man4/if_ed.4 OLD_FILES+=usr/share/man/man4/ep.4 OLD_FILES+=usr/share/man/man4/ex.4 OLD_FILES+=usr/share/man/man4/fe.4 +OLD_FILES+=usr/share/man/man4/pcn.4 +OLD_FILES+=usr/share/man/man4/if_pcn.4 # 20190513: libcap_sysctl interface change OLD_FILES+=lib/casper/libcap_sysctl.1 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package. Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri May 17 15:23:26 2019 (r347914) +++ head/share/man/man4/Makefile Fri May 17 15:23:34 2019 (r347915) @@ -401,7 +401,6 @@ MAN= aac.4 \ pcib.4 \ pcic.4 \ pcm.4 \ - pcn.4 \ ${_pf.4} \ ${_pflog.4} \ ${_pfsync.4} \ @@ -692,7 +691,6 @@ MLINKS+=ow.4 onewire.4 MLINKS+=pccbb.4 cbb.4 MLINKS+=pcm.4 snd.4 \ pcm.4 sound.4 -MLINKS+=pcn.4 if_pcn.4 MLINKS+=pms.4 pmspcv.4 MLINKS+=ral.4 if_ral.4 MLINKS+=re.4 if_re.4 Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri May 17 15:23:26 2019 (r347914) +++ head/sys/amd64/conf/GENERIC Fri May 17 15:23:34 2019 (r347915) @@ -271,7 +271,6 @@ device lge # Level 1 LXT1001 gigabit Ethernet device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet device nfe # nVidia nForce MCP on-board Ethernet device nge # NatSemi DP83820 gigabit Ethernet -device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 device sf # Adaptec AIC-6915 (``Starfire'') Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri May 17 15:23:26 2019 (r347914) +++ head/sys/conf/NOTES Fri May 17 15:23:34 2019 (r347915) @@ -1965,12 +1965,6 @@ device xmphy # XaQti XMAC II # GigaNIX 1000TA and 1000TPC, the Addtron AEG320T, the Surecom # EP-320G-TX and the Netgear GA622T. # oce: Emulex 10 Gbit adapters (OneConnect Ethernet) -# pcn: Support for PCI fast ethernet adapters based on the AMD Am79c97x -# PCnet-FAST, PCnet-FAST+, PCnet-FAST III, PCnet-PRO and PCnet-Home -# chipsets. These can also be handled by the le(4) driver if the -# pcn(4) driver is left out of the kernel. The le(4) driver does not -# support the additional features like the MII bus and burst mode of -# the PCnet-FAST and greater chipsets though. # ral: Ralink Technology IEEE 802.11 wireless adapter # re: RealTek 8139C+/8169/816xS/811xS/8101E PCI/PCIe Ethernet adapter # rl: Support for PCI fast ethernet adapters based on the RealTek 8129/8139 @@ -2072,7 +2066,6 @@ device my # Myson Fast Ethernet (MTD80X, MTD89X) device nge # NatSemi DP83820 gigabit Ethernet device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 -device pcn # AMD Am79C97x PCI 10/100 NICs device sf # Adaptec AIC-6915 (``Starfire'') device sge # Silicon Integrated Systems SiS190/191 device sis # Silicon Integrated Systems SiS 900/SiS 7016 Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 17 15:23:26 2019 (r347914) +++ head/sys/conf/files Fri May 17 15:23:34 2019 (r347915) @@ -2563,7 +2563,6 @@ dev/pci/pci_user.c optional pci dev/pci/pcib_if.m standard dev/pci/pcib_support.c standard dev/pci/vga_pci.c optional pci -dev/pcn/if_pcn.c optional pcn pci dev/pms/freebsd/driver/ini/src/agtiapi.c optional pmspcv \ compile-with "${NORMAL_C} -Wunused-variable -Woverflow -Wparentheses -w" dev/pms/RefTisa/sallsdk/spc/sadisc.c optional pmspcv \ Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri May 17 15:23:26 2019 (r347914) +++ head/sys/i386/conf/GENERIC Fri May 17 15:23:34 2019 (r347915) @@ -253,7 +253,6 @@ device lge # Level 1 LXT1001 gigabit Ethernet device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet device nfe # nVidia nForce MCP on-board Ethernet device nge # NatSemi DP83820 gigabit Ethernet -device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 device sf # Adaptec AIC-6915 (``Starfire'') Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri May 17 15:23:26 2019 (r347914) +++ head/sys/modules/Makefile Fri May 17 15:23:34 2019 (r347915) @@ -283,7 +283,6 @@ SUBDIR= \ ${_padlock_rng} \ ${_pccard} \ ${_pcfclock} \ - pcn \ ${_pf} \ ${_pflog} \ ${_pfsync} \ Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Fri May 17 15:23:26 2019 (r347914) +++ head/sys/sparc64/conf/GENERIC Fri May 17 15:23:34 2019 (r347915) @@ -201,7 +201,6 @@ device fxp # Intel EtherExpress PRO/100B (82557, 825 device gem # Sun GEM/Sun ERI/Apple GMAC device hme # Sun HME (Happy Meal Ethernet) device nge # NatSemi DP83820 gigabit Ethernet -#device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le') device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 device sf # Adaptec AIC-6915 (``Starfire'') From owner-svn-src-head@freebsd.org Fri May 17 15:23:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 583D51597D27; Fri, 17 May 2019 15:23:50 +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 A7F1977CD1; Fri, 17 May 2019 15:23:49 +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 2E0FDA1F5; Fri, 17 May 2019 15:23: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 x4HFNjAb006166; Fri, 17 May 2019 15:23:45 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HFNhTw006158; Fri, 17 May 2019 15:23:43 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905171523.x4HFNhTw006158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 May 2019 15:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347916 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/sf sys/i386/conf sys/modules sys/modules/sf sys/sparc64/conf X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/sf sys/i386/conf sys/modules sys/modules/sf sys/sparc64/conf X-SVN-Commit-Revision: 347916 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A7F1977CD1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 15:23:50 -0000 Author: brooks Date: Fri May 17 15:23:43 2019 New Revision: 347916 URL: https://svnweb.freebsd.org/changeset/base/347916 Log: FCP-101: Remove sf(4). Relnotes: yes FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Reviewed by: jhb, imp Differential Revision: https://reviews.freebsd.org/D20230 Deleted: head/share/man/man4/sf.4 head/sys/dev/sf/ head/sys/modules/sf/ Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/amd64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/modules/Makefile head/sys/sparc64/conf/GENERIC Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 17 15:23:34 2019 (r347915) +++ head/ObsoleteFiles.inc Fri May 17 15:23:43 2019 (r347916) @@ -50,6 +50,8 @@ OLD_FILES+=usr/share/man/man4/ex.4 OLD_FILES+=usr/share/man/man4/fe.4 OLD_FILES+=usr/share/man/man4/pcn.4 OLD_FILES+=usr/share/man/man4/if_pcn.4 +OLD_FILES+=usr/share/man/man4/sf.4 +OLD_FILES+=usr/share/man/man4/if_sf.4 # 20190513: libcap_sysctl interface change OLD_FILES+=lib/casper/libcap_sysctl.1 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package. Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri May 17 15:23:34 2019 (r347915) +++ head/share/man/man4/Makefile Fri May 17 15:23:43 2019 (r347916) @@ -451,7 +451,6 @@ MAN= aac.4 \ sem.4 \ send.4 \ ses.4 \ - sf.4 \ ${_sfxge.4} \ sge.4 \ siba.4 \ @@ -701,7 +700,6 @@ MLINKS+=scsi.4 CAM.4 \ scsi.4 cam.4 \ scsi.4 scbus.4 \ scsi.4 SCSI.4 -MLINKS+=sf.4 if_sf.4 MLINKS+=sge.4 if_sge.4 MLINKS+=sis.4 if_sis.4 MLINKS+=sk.4 if_sk.4 Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri May 17 15:23:34 2019 (r347915) +++ head/sys/amd64/conf/GENERIC Fri May 17 15:23:43 2019 (r347916) @@ -273,7 +273,6 @@ device nfe # nVidia nForce MCP on-board Ethernet device nge # NatSemi DP83820 gigabit Ethernet device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 -device sf # Adaptec AIC-6915 (``Starfire'') device sge # Silicon Integrated Systems SiS190/191 device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri May 17 15:23:34 2019 (r347915) +++ head/sys/conf/NOTES Fri May 17 15:23:43 2019 (r347916) @@ -1977,11 +1977,6 @@ device xmphy # XaQti XMAC II # chipset and is supported by this driver, not the 'vr' driver. # rtwn: RealTek wireless adapters. # rtwnfw: RealTek wireless firmware. -# sf: Support for Adaptec Duralink PCI fast ethernet adapters based on the -# Adaptec AIC-6915 "starfire" controller. -# This includes dual and quad port cards, as well as one 100baseFX card. -# Most of these are 64-bit PCI devices, except for one single port -# card which is 32-bit. # sge: Silicon Integrated Systems SiS190/191 Fast/Gigabit Ethernet adapter # sis: Support for NICs based on the Silicon Integrated Systems SiS 900, # SiS 7016 and NS DP83815 PCI fast ethernet controller chips. @@ -2066,7 +2061,6 @@ device my # Myson Fast Ethernet (MTD80X, MTD89X) device nge # NatSemi DP83820 gigabit Ethernet device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 -device sf # Adaptec AIC-6915 (``Starfire'') device sge # Silicon Integrated Systems SiS190/191 device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 17 15:23:34 2019 (r347915) +++ head/sys/conf/files Fri May 17 15:23:43 2019 (r347916) @@ -3009,7 +3009,6 @@ dev/sdhci/sdhci_fdt_gpio.c optional sdhci fdt gpio dev/sdhci/sdhci_if.m optional sdhci dev/sdhci/sdhci_acpi.c optional sdhci acpi dev/sdhci/sdhci_pci.c optional sdhci pci -dev/sf/if_sf.c optional sf pci dev/sge/if_sge.c optional sge pci dev/siis/siis.c optional siis pci dev/sis/if_sis.c optional sis pci Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri May 17 15:23:34 2019 (r347915) +++ head/sys/i386/conf/GENERIC Fri May 17 15:23:43 2019 (r347916) @@ -255,7 +255,6 @@ device nfe # nVidia nForce MCP on-board Ethernet device nge # NatSemi DP83820 gigabit Ethernet device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 -device sf # Adaptec AIC-6915 (``Starfire'') device sge # Silicon Integrated Systems SiS190/191 device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri May 17 15:23:34 2019 (r347915) +++ head/sys/modules/Makefile Fri May 17 15:23:43 2019 (r347916) @@ -325,7 +325,6 @@ SUBDIR= \ sdhci_pci \ sem \ send \ - ${_sf} \ ${_sfxge} \ sge \ ${_sgx} \ @@ -516,7 +515,6 @@ _pfsync= pfsync _bce= bce _fxp= fxp _ispfw= ispfw -_sf= sf _ti= ti _txp= txp Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Fri May 17 15:23:34 2019 (r347915) +++ head/sys/sparc64/conf/GENERIC Fri May 17 15:23:43 2019 (r347916) @@ -203,7 +203,6 @@ device hme # Sun HME (Happy Meal Ethernet) device nge # NatSemi DP83820 gigabit Ethernet device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 -device sf # Adaptec AIC-6915 (``Starfire'') device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) From owner-svn-src-head@freebsd.org Fri May 17 15:23:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1D341597D50; Fri, 17 May 2019 15:23: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 7F40F77D93; Fri, 17 May 2019 15:23: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 9F976A1F6; Fri, 17 May 2019 15:23: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 x4HFNrMd006226; Fri, 17 May 2019 15:23:53 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HFNqBm006219; Fri, 17 May 2019 15:23:52 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905171523.x4HFNqBm006219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 May 2019 15:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347917 - in head: . share/man/man4 sys/conf sys/dev/sn sys/i386/conf sys/modules sys/modules/sn X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . share/man/man4 sys/conf sys/dev/sn sys/i386/conf sys/modules sys/modules/sn X-SVN-Commit-Revision: 347917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7F40F77D93 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 15:23:58 -0000 Author: brooks Date: Fri May 17 15:23:52 2019 New Revision: 347917 URL: https://svnweb.freebsd.org/changeset/base/347917 Log: FCP-101: Remove sn(4). Relnotes: yes FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Reviewed by: jhb, imp Differential Revision: https://reviews.freebsd.org/D20230 Deleted: head/share/man/man4/sn.4 head/sys/dev/sn/ head/sys/modules/sn/ Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/modules/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 17 15:23:43 2019 (r347916) +++ head/ObsoleteFiles.inc Fri May 17 15:23:52 2019 (r347917) @@ -52,6 +52,8 @@ OLD_FILES+=usr/share/man/man4/pcn.4 OLD_FILES+=usr/share/man/man4/if_pcn.4 OLD_FILES+=usr/share/man/man4/sf.4 OLD_FILES+=usr/share/man/man4/if_sf.4 +OLD_FILES+=usr/share/man/man4/sn.4 +OLD_FILES+=usr/share/man/man4/if_sn.4 # 20190513: libcap_sysctl interface change OLD_FILES+=lib/casper/libcap_sysctl.1 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package. Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri May 17 15:23:43 2019 (r347916) +++ head/share/man/man4/Makefile Fri May 17 15:23:52 2019 (r347917) @@ -465,7 +465,6 @@ MAN= aac.4 \ smbus.4 \ smp.4 \ smsc.4 \ - sn.4 \ snd_ad1816.4 \ snd_als4000.4 \ snd_atiixp.4 \ @@ -705,7 +704,6 @@ MLINKS+=sis.4 if_sis.4 MLINKS+=sk.4 if_sk.4 MLINKS+=smp.4 SMP.4 MLINKS+=smsc.4 if_smsc.4 -MLINKS+=sn.4 if_sn.4 MLINKS+=snd_envy24.4 snd_ak452x.4 MLINKS+=snd_sbc.4 snd_sb16.4 \ snd_sbc.4 snd_sb8.4 Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri May 17 15:23:43 2019 (r347916) +++ head/sys/conf/NOTES Fri May 17 15:23:52 2019 (r347917) @@ -1986,8 +1986,6 @@ device xmphy # XaQti XMAC II # (also single mode and multimode). # The driver will autodetect the number of ports on the card and # attach each one as a separate network interface. -# sn: Support for ISA and PC Card Ethernet devices using the -# SMC91C90/92/94/95 chips. # ste: Sundance Technologies ST201 PCI fast ethernet controller, includes # the D-Link DFE-550TX. # stge: Support for gigabit ethernet adapters based on the Sundance/Tamarack @@ -2028,10 +2026,6 @@ device xmphy # XaQti XMAC II # Order for ISA devices is important here -device sn -hint.sn.0.at="isa" -hint.sn.0.port="0x300" -hint.sn.0.irq="10" device an device wi device xe Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 17 15:23:43 2019 (r347916) +++ head/sys/conf/files Fri May 17 15:23:52 2019 (r347917) @@ -3019,9 +3019,6 @@ dev/smbus/smbus.c optional smbus dev/smbus/smbus_if.m optional smbus dev/smc/if_smc.c optional smc dev/smc/if_smc_fdt.c optional smc fdt -dev/sn/if_sn.c optional sn -dev/sn/if_sn_isa.c optional sn isa -dev/sn/if_sn_pccard.c optional sn pccard dev/snp/snp.c optional snp dev/sound/clone.c optional sound dev/sound/unit.c optional sound Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri May 17 15:23:43 2019 (r347916) +++ head/sys/i386/conf/GENERIC Fri May 17 15:23:52 2019 (r347917) @@ -269,7 +269,6 @@ device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # ISA Ethernet NICs. pccard NICs included. -device sn # SMC's 9000 series of Ethernet chips device xe # Xircom pccard Ethernet # Wireless NIC cards Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri May 17 15:23:43 2019 (r347916) +++ head/sys/modules/Makefile Fri May 17 15:23:52 2019 (r347917) @@ -335,7 +335,6 @@ SUBDIR= \ sk \ ${_smartpqi} \ smbfs \ - sn \ snp \ sound \ ${_speaker} \ From owner-svn-src-head@freebsd.org Fri May 17 15:24:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 039351597DA4; Fri, 17 May 2019 15:24: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 28FC077E8B; Fri, 17 May 2019 15:24:06 +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 4CA96A1F7; Fri, 17 May 2019 15:24:02 +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 x4HFO29Z006293; Fri, 17 May 2019 15:24:02 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HFO0Sa006285; Fri, 17 May 2019 15:24:00 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905171524.x4HFO0Sa006285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 May 2019 15:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347918 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/tl sys/i386/conf sys/modules sys/modules/tl sys/sparc64/conf X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/tl sys/i386/conf sys/modules sys/modules/tl sys/sparc64/conf X-SVN-Commit-Revision: 347918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 28FC077E8B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Fri, 17 May 2019 15:24:07 -0000 Author: brooks Date: Fri May 17 15:24:00 2019 New Revision: 347918 URL: https://svnweb.freebsd.org/changeset/base/347918 Log: FCP-101: Remove tl(4). Relnotes: yes FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Reviewed by: jhb, imp Differential Revision: https://reviews.freebsd.org/D20230 Deleted: head/share/man/man4/tl.4 head/sys/dev/tl/ head/sys/modules/tl/ Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/amd64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/modules/Makefile head/sys/sparc64/conf/GENERIC Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 17 15:23:52 2019 (r347917) +++ head/ObsoleteFiles.inc Fri May 17 15:24:00 2019 (r347918) @@ -54,6 +54,8 @@ OLD_FILES+=usr/share/man/man4/sf.4 OLD_FILES+=usr/share/man/man4/if_sf.4 OLD_FILES+=usr/share/man/man4/sn.4 OLD_FILES+=usr/share/man/man4/if_sn.4 +OLD_FILES+=usr/share/man/man4/tl.4 +OLD_FILES+=usr/share/man/man4/if_tl.4 # 20190513: libcap_sysctl interface change OLD_FILES+=lib/casper/libcap_sysctl.1 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package. Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri May 17 15:23:52 2019 (r347917) +++ head/share/man/man4/Makefile Fri May 17 15:24:00 2019 (r347918) @@ -517,7 +517,6 @@ MAN= aac.4 \ textdump.4 \ ti.4 \ timecounters.4 \ - tl.4 \ ${_tpm.4} \ trm.4 \ tty.4 \ @@ -717,7 +716,6 @@ MLINKS+=syscons.4 sc.4 MLINKS+=tap.4 if_tap.4 MLINKS+=tdfx.4 tdfx_linux.4 MLINKS+=ti.4 if_ti.4 -MLINKS+=tl.4 if_tl.4 MLINKS+=tun.4 if_tun.4 MLINKS+=tx.4 if_tx.4 MLINKS+=txp.4 if_txp.4 Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri May 17 15:23:52 2019 (r347917) +++ head/sys/amd64/conf/GENERIC Fri May 17 15:24:00 2019 (r347918) @@ -278,7 +278,6 @@ device sis # Silicon Integrated Systems SiS 900/SiS device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) device stge # Sundance/Tamarack TC9021 gigabit Ethernet -device tl # Texas Instruments ThunderLAN device tx # SMC EtherPower II (83c170 ``EPIC'') device vge # VIA VT612x gigabit Ethernet device vr # VIA Rhine, Rhine II Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri May 17 15:23:52 2019 (r347917) +++ head/sys/conf/NOTES Fri May 17 15:24:00 2019 (r347918) @@ -1995,11 +1995,6 @@ device xmphy # XaQti XMAC II # Tigon 1 and Tigon 2 chipsets. This includes the Alteon AceNIC, the # 3Com 3c985, the Netgear GA620 and various others. Note that you will # probably want to bump up kern.ipc.nmbclusters a lot to use this driver. -# tl: Support for the Texas Instruments TNETE100 series 'ThunderLAN' -# cards and integrated ethernet controllers. This includes several -# Compaq Netelligent 10/100 cards and the built-in ethernet controllers -# in several Compaq Prosignia, Proliant and Deskpro systems. It also -# supports several Olicom 10Mbps and 10/100 boards. # tx: SMC 9432 TX, BTX and FTX cards. (SMC EtherPower II series) # txp: Support for 3Com 3cR990 cards with the "Typhoon" chipset # vr: Support for various fast ethernet adapters based on the VIA @@ -2060,7 +2055,6 @@ device sis # Silicon Integrated Systems SiS 900/SiS device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) device stge # Sundance/Tamarack TC9021 gigabit Ethernet -device tl # Texas Instruments ThunderLAN device tx # SMC EtherPower II (83c170 ``EPIC'') device vr # VIA Rhine, Rhine II device vte # DM&P Vortex86 RDC R6040 Fast Ethernet Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 17 15:23:52 2019 (r347917) +++ head/sys/conf/files Fri May 17 15:24:00 2019 (r347918) @@ -3135,7 +3135,6 @@ dev/tcp_log/tcp_log_dev.c optional tcp_blackbox inet | dev/tdfx/tdfx_linux.c optional tdfx_linux tdfx compat_linux dev/tdfx/tdfx_pci.c optional tdfx pci dev/ti/if_ti.c optional ti pci -dev/tl/if_tl.c optional tl pci dev/trm/trm.c optional trm dev/twa/tw_cl_init.c optional twa \ compile-with "${NORMAL_C} -I$S/dev/twa" Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri May 17 15:23:52 2019 (r347917) +++ head/sys/i386/conf/GENERIC Fri May 17 15:24:00 2019 (r347918) @@ -260,7 +260,6 @@ device sis # Silicon Integrated Systems SiS 900/SiS device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) device stge # Sundance/Tamarack TC9021 gigabit Ethernet -device tl # Texas Instruments ThunderLAN device tx # SMC EtherPower II (83c170 ``EPIC'') device vge # VIA VT612x gigabit Ethernet device vr # VIA Rhine, Rhine II Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri May 17 15:23:52 2019 (r347917) +++ head/sys/modules/Makefile Fri May 17 15:24:00 2019 (r347918) @@ -348,7 +348,6 @@ SUBDIR= \ sysvipc \ tcp \ ${_ti} \ - tl \ tmpfs \ ${_toecore} \ ${_tpm} \ Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Fri May 17 15:23:52 2019 (r347917) +++ head/sys/sparc64/conf/GENERIC Fri May 17 15:24:00 2019 (r347918) @@ -207,7 +207,6 @@ device sis # Silicon Integrated Systems SiS 900/SiS device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) device stge # Sundance/Tamarack TC9021 gigabit Ethernet -#device tl # Texas Instruments ThunderLAN #device tx # SMC EtherPower II (83c170 ``EPIC'') device vr # VIA Rhine, Rhine II #device wb # Winbond W89C840F From owner-svn-src-head@freebsd.org Fri May 17 15:24:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8102A1597DE6; Fri, 17 May 2019 15:24:15 +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 0748E77F73; Fri, 17 May 2019 15:24:15 +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 EA328A1F8; Fri, 17 May 2019 15:24:10 +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 x4HFOAvg006358; Fri, 17 May 2019 15:24:10 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HFO92I006350; Fri, 17 May 2019 15:24:09 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905171524.x4HFO92I006350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 May 2019 15:24:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347919 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/tx sys/i386/conf sys/modules sys/modules/tx sys/sparc64/conf X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/tx sys/i386/conf sys/modules sys/modules/tx sys/sparc64/conf X-SVN-Commit-Revision: 347919 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0748E77F73 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 15:24:15 -0000 Author: brooks Date: Fri May 17 15:24:08 2019 New Revision: 347919 URL: https://svnweb.freebsd.org/changeset/base/347919 Log: FCP-101: Remove tx(4). Relnotes: yes FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Reviewed by: jhb, imp Differential Revision: https://reviews.freebsd.org/D20230 Deleted: head/share/man/man4/tx.4 head/sys/dev/tx/ head/sys/modules/tx/ Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/amd64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/modules/Makefile head/sys/sparc64/conf/GENERIC Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 17 15:24:00 2019 (r347918) +++ head/ObsoleteFiles.inc Fri May 17 15:24:08 2019 (r347919) @@ -56,6 +56,8 @@ OLD_FILES+=usr/share/man/man4/sn.4 OLD_FILES+=usr/share/man/man4/if_sn.4 OLD_FILES+=usr/share/man/man4/tl.4 OLD_FILES+=usr/share/man/man4/if_tl.4 +OLD_FILES+=usr/share/man/man4/tx.4 +OLD_FILES+=usr/share/man/man4/if_tx.4 # 20190513: libcap_sysctl interface change OLD_FILES+=lib/casper/libcap_sysctl.1 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package. Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri May 17 15:24:00 2019 (r347918) +++ head/share/man/man4/Makefile Fri May 17 15:24:08 2019 (r347919) @@ -524,7 +524,6 @@ MAN= aac.4 \ twa.4 \ twe.4 \ tws.4 \ - tx.4 \ txp.4 \ udp.4 \ udplite.4 \ @@ -717,7 +716,6 @@ MLINKS+=tap.4 if_tap.4 MLINKS+=tdfx.4 tdfx_linux.4 MLINKS+=ti.4 if_ti.4 MLINKS+=tun.4 if_tun.4 -MLINKS+=tx.4 if_tx.4 MLINKS+=txp.4 if_txp.4 MLINKS+=ure.4 if_ure.4 MLINKS+=vge.4 if_vge.4 Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri May 17 15:24:00 2019 (r347918) +++ head/sys/amd64/conf/GENERIC Fri May 17 15:24:08 2019 (r347919) @@ -278,7 +278,6 @@ device sis # Silicon Integrated Systems SiS 900/SiS device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) device stge # Sundance/Tamarack TC9021 gigabit Ethernet -device tx # SMC EtherPower II (83c170 ``EPIC'') device vge # VIA VT612x gigabit Ethernet device vr # VIA Rhine, Rhine II device wb # Winbond W89C840F Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri May 17 15:24:00 2019 (r347918) +++ head/sys/conf/NOTES Fri May 17 15:24:08 2019 (r347919) @@ -1995,7 +1995,6 @@ device xmphy # XaQti XMAC II # Tigon 1 and Tigon 2 chipsets. This includes the Alteon AceNIC, the # 3Com 3c985, the Netgear GA620 and various others. Note that you will # probably want to bump up kern.ipc.nmbclusters a lot to use this driver. -# tx: SMC 9432 TX, BTX and FTX cards. (SMC EtherPower II series) # txp: Support for 3Com 3cR990 cards with the "Typhoon" chipset # vr: Support for various fast ethernet adapters based on the VIA # Technologies VT3043 `Rhine I' and VT86C100A `Rhine II' chips, @@ -2055,7 +2054,6 @@ device sis # Silicon Integrated Systems SiS 900/SiS device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) device stge # Sundance/Tamarack TC9021 gigabit Ethernet -device tx # SMC EtherPower II (83c170 ``EPIC'') device vr # VIA Rhine, Rhine II device vte # DM&P Vortex86 RDC R6040 Fast Ethernet device wb # Winbond W89C840F Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 17 15:24:00 2019 (r347918) +++ head/sys/conf/files Fri May 17 15:24:08 2019 (r347919) @@ -3155,7 +3155,6 @@ dev/tws/tws_cam.c optional tws dev/tws/tws_hdm.c optional tws dev/tws/tws_services.c optional tws dev/tws/tws_user.c optional tws -dev/tx/if_tx.c optional tx dev/txp/if_txp.c optional txp dev/uart/uart_bus_acpi.c optional uart acpi dev/uart/uart_bus_ebus.c optional uart ebus Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri May 17 15:24:00 2019 (r347918) +++ head/sys/i386/conf/GENERIC Fri May 17 15:24:08 2019 (r347919) @@ -260,7 +260,6 @@ device sis # Silicon Integrated Systems SiS 900/SiS device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) device stge # Sundance/Tamarack TC9021 gigabit Ethernet -device tx # SMC EtherPower II (83c170 ``EPIC'') device vge # VIA VT612x gigabit Ethernet device vr # VIA Rhine, Rhine II device vte # DM&P Vortex86 RDC R6040 Fast Ethernet Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri May 17 15:24:00 2019 (r347918) +++ head/sys/modules/Makefile Fri May 17 15:24:08 2019 (r347919) @@ -355,7 +355,6 @@ SUBDIR= \ ${_twa} \ twe \ tws \ - tx \ ${_txp} \ uart \ ubsec \ Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Fri May 17 15:24:00 2019 (r347918) +++ head/sys/sparc64/conf/GENERIC Fri May 17 15:24:08 2019 (r347919) @@ -207,7 +207,6 @@ device sis # Silicon Integrated Systems SiS 900/SiS device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) device stge # Sundance/Tamarack TC9021 gigabit Ethernet -#device tx # SMC EtherPower II (83c170 ``EPIC'') device vr # VIA Rhine, Rhine II #device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') From owner-svn-src-head@freebsd.org Fri May 17 15:24:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A5B31597E3C; Fri, 17 May 2019 15:24:24 +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 2E1C68006B; Fri, 17 May 2019 15:24:24 +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 9E8A5A1F9; Fri, 17 May 2019 15:24:19 +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 x4HFOJ44006419; Fri, 17 May 2019 15:24:19 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HFOHeY006411; Fri, 17 May 2019 15:24:17 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905171524.x4HFOHeY006411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 May 2019 15:24:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347920 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/txp sys/i386/conf sys/modules sys/modules/txp sys/sparc64/conf X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/txp sys/i386/conf sys/modules sys/modules/txp sys/sparc64/conf X-SVN-Commit-Revision: 347920 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2E1C68006B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 15:24:24 -0000 Author: brooks Date: Fri May 17 15:24:17 2019 New Revision: 347920 URL: https://svnweb.freebsd.org/changeset/base/347920 Log: FCP-101: Remove txp(4). Relnotes: yes FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Reviewed by: jhb, imp Differential Revision: https://reviews.freebsd.org/D20230 Deleted: head/share/man/man4/txp.4 head/sys/dev/txp/ head/sys/modules/txp/ Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/amd64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/modules/Makefile head/sys/sparc64/conf/GENERIC Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 17 15:24:08 2019 (r347919) +++ head/ObsoleteFiles.inc Fri May 17 15:24:17 2019 (r347920) @@ -58,6 +58,8 @@ OLD_FILES+=usr/share/man/man4/tl.4 OLD_FILES+=usr/share/man/man4/if_tl.4 OLD_FILES+=usr/share/man/man4/tx.4 OLD_FILES+=usr/share/man/man4/if_tx.4 +OLD_FILES+=usr/share/man/man4/txp.4 +OLD_FILES+=usr/share/man/man4/if_txp.4 # 20190513: libcap_sysctl interface change OLD_FILES+=lib/casper/libcap_sysctl.1 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package. Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri May 17 15:24:08 2019 (r347919) +++ head/share/man/man4/Makefile Fri May 17 15:24:17 2019 (r347920) @@ -524,7 +524,6 @@ MAN= aac.4 \ twa.4 \ twe.4 \ tws.4 \ - txp.4 \ udp.4 \ udplite.4 \ ure.4 \ @@ -716,7 +715,6 @@ MLINKS+=tap.4 if_tap.4 MLINKS+=tdfx.4 tdfx_linux.4 MLINKS+=ti.4 if_ti.4 MLINKS+=tun.4 if_tun.4 -MLINKS+=txp.4 if_txp.4 MLINKS+=ure.4 if_ure.4 MLINKS+=vge.4 if_vge.4 MLINKS+=vlan.4 if_vlan.4 Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri May 17 15:24:08 2019 (r347919) +++ head/sys/amd64/conf/GENERIC Fri May 17 15:24:17 2019 (r347920) @@ -247,7 +247,6 @@ device vmx # VMware VMXNET3 Ethernet device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE device le # AMD Am7900 LANCE and Am79C9xx PCnet device ti # Alteon Networks Tigon I/II gigabit Ethernet -device txp # 3Com 3cR990 (``Typhoon'') device vx # 3Com 3c590, 3c595 (``Vortex'') # PCI Ethernet NICs that use the common MII bus controller code. Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri May 17 15:24:08 2019 (r347919) +++ head/sys/conf/NOTES Fri May 17 15:24:17 2019 (r347920) @@ -1995,7 +1995,6 @@ device xmphy # XaQti XMAC II # Tigon 1 and Tigon 2 chipsets. This includes the Alteon AceNIC, the # 3Com 3c985, the Netgear GA620 and various others. Note that you will # probably want to bump up kern.ipc.nmbclusters a lot to use this driver. -# txp: Support for 3Com 3cR990 cards with the "Typhoon" chipset # vr: Support for various fast ethernet adapters based on the VIA # Technologies VT3043 `Rhine I' and VT86C100A `Rhine II' chips, # including the D-Link DFE520TX and D-Link DFE530TX (see 'rl' for @@ -2074,7 +2073,6 @@ device le # AMD Am7900 LANCE and Am79C9xx PCnet device mxge # Myricom Myri-10G 10GbE NIC device oce # Emulex 10 GbE (OneConnect Ethernet) device ti # Alteon Networks Tigon I/II gigabit Ethernet -device txp # 3Com 3cR990 (``Typhoon'') device vx # 3Com 3c590, 3c595 (``Vortex'') # PCI IEEE 802.11 Wireless NICs Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 17 15:24:08 2019 (r347919) +++ head/sys/conf/files Fri May 17 15:24:17 2019 (r347920) @@ -3155,7 +3155,6 @@ dev/tws/tws_cam.c optional tws dev/tws/tws_hdm.c optional tws dev/tws/tws_services.c optional tws dev/tws/tws_user.c optional tws -dev/txp/if_txp.c optional txp dev/uart/uart_bus_acpi.c optional uart acpi dev/uart/uart_bus_ebus.c optional uart ebus dev/uart/uart_bus_fdt.c optional uart fdt Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri May 17 15:24:08 2019 (r347919) +++ head/sys/i386/conf/GENERIC Fri May 17 15:24:17 2019 (r347920) @@ -229,7 +229,6 @@ device vmx # VMware VMXNET3 Ethernet device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE device le # AMD Am7900 LANCE and Am79C9xx PCnet device ti # Alteon Networks Tigon I/II gigabit Ethernet -device txp # 3Com 3cR990 (``Typhoon'') device vx # 3Com 3c590, 3c595 (``Vortex'') # PCI Ethernet NICs that use the common MII bus controller code. Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri May 17 15:24:08 2019 (r347919) +++ head/sys/modules/Makefile Fri May 17 15:24:17 2019 (r347920) @@ -355,7 +355,6 @@ SUBDIR= \ ${_twa} \ twe \ tws \ - ${_txp} \ uart \ ubsec \ udf \ @@ -513,7 +512,6 @@ _bce= bce _fxp= fxp _ispfw= ispfw _ti= ti -_txp= txp .if ${MACHINE_CPUARCH} != "mips" _mwlfw= mwlfw Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Fri May 17 15:24:08 2019 (r347919) +++ head/sys/sparc64/conf/GENERIC Fri May 17 15:24:17 2019 (r347920) @@ -187,7 +187,6 @@ device iflib device em # Intel PRO/1000 adapter Gigabit Ethernet Card device le # AMD Am7900 LANCE and Am79C9xx PCnet device ti # Alteon Networks Tigon I/II gigabit Ethernet -device txp # 3Com 3cR990 (``Typhoon'') #device vx # 3Com 3c590, 3c595 (``Vortex'') # PCI Ethernet NICs that use the common MII bus controller code. From owner-svn-src-head@freebsd.org Fri May 17 15:24:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5CE61597E9A; Fri, 17 May 2019 15:24:30 +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 6835A8011D; Fri, 17 May 2019 15:24:30 +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 32C59A1FA; Fri, 17 May 2019 15:24:28 +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 x4HFOSAO006486; Fri, 17 May 2019 15:24:28 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HFOQPJ006473; Fri, 17 May 2019 15:24:26 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905171524.x4HFOQPJ006473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 May 2019 15:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347921 - in head: . share/man/man4/man4.i386 sys/amd64/conf sys/conf sys/dev/vx sys/i386/conf sys/modules sys/modules/vx sys/sparc64/conf X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . share/man/man4/man4.i386 sys/amd64/conf sys/conf sys/dev/vx sys/i386/conf sys/modules sys/modules/vx sys/sparc64/conf X-SVN-Commit-Revision: 347921 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6835A8011D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 15:24:31 -0000 Author: brooks Date: Fri May 17 15:24:26 2019 New Revision: 347921 URL: https://svnweb.freebsd.org/changeset/base/347921 Log: FCP-101: Remove vx(4). Relnotes: yes FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Reviewed by: jhb, imp Differential Revision: https://reviews.freebsd.org/D20230 Deleted: head/share/man/man4/man4.i386/vx.4 head/sys/dev/vx/ head/sys/modules/vx/ Modified: head/ObsoleteFiles.inc head/share/man/man4/man4.i386/Makefile head/sys/amd64/conf/GENERIC head/sys/conf/NOTES head/sys/i386/conf/GENERIC head/sys/modules/Makefile head/sys/sparc64/conf/GENERIC Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 17 15:24:17 2019 (r347920) +++ head/ObsoleteFiles.inc Fri May 17 15:24:26 2019 (r347921) @@ -60,6 +60,7 @@ OLD_FILES+=usr/share/man/man4/tx.4 OLD_FILES+=usr/share/man/man4/if_tx.4 OLD_FILES+=usr/share/man/man4/txp.4 OLD_FILES+=usr/share/man/man4/if_txp.4 +OLD_FILES+=usr/share/man/man4/vx.4 # 20190513: libcap_sysctl interface change OLD_FILES+=lib/casper/libcap_sysctl.1 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package. Modified: head/share/man/man4/man4.i386/Makefile ============================================================================== --- head/share/man/man4/man4.i386/Makefile Fri May 17 15:24:17 2019 (r347920) +++ head/share/man/man4/man4.i386/Makefile Fri May 17 15:24:26 2019 (r347921) @@ -19,8 +19,7 @@ MAN= apm.4 \ pnpbios.4 \ sbni.4 \ smapi.4 \ - vpd.4 \ - vx.4 + vpd.4 MLINKS= CPU_ELAN.4 CPU_SOEKRIS.4 MLINKS+=pae.4 PAE.4 Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri May 17 15:24:17 2019 (r347920) +++ head/sys/amd64/conf/GENERIC Fri May 17 15:24:26 2019 (r347921) @@ -247,7 +247,6 @@ device vmx # VMware VMXNET3 Ethernet device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE device le # AMD Am7900 LANCE and Am79C9xx PCnet device ti # Alteon Networks Tigon I/II gigabit Ethernet -device vx # 3Com 3c590, 3c595 (``Vortex'') # PCI Ethernet NICs that use the common MII bus controller code. # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri May 17 15:24:17 2019 (r347920) +++ head/sys/conf/NOTES Fri May 17 15:24:26 2019 (r347921) @@ -2000,7 +2000,6 @@ device xmphy # XaQti XMAC II # including the D-Link DFE520TX and D-Link DFE530TX (see 'rl' for # DFE530TX+), the Hawking Technologies PN102TX, and the AOpen/Acer ALN-320. # vte: DM&P Vortex86 RDC R6040 Fast Ethernet -# vx: 3Com 3C590 and 3C595 # wb: Support for fast ethernet adapters based on the Winbond W89C840F chip. # Note: this is not the same as the Winbond W89C940F, which is a # NE2000 clone. @@ -2073,7 +2072,6 @@ device le # AMD Am7900 LANCE and Am79C9xx PCnet device mxge # Myricom Myri-10G 10GbE NIC device oce # Emulex 10 GbE (OneConnect Ethernet) device ti # Alteon Networks Tigon I/II gigabit Ethernet -device vx # 3Com 3c590, 3c595 (``Vortex'') # PCI IEEE 802.11 Wireless NICs device ath # Atheros pci/cardbus NIC's Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri May 17 15:24:17 2019 (r347920) +++ head/sys/i386/conf/GENERIC Fri May 17 15:24:26 2019 (r347921) @@ -229,7 +229,6 @@ device vmx # VMware VMXNET3 Ethernet device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE device le # AMD Am7900 LANCE and Am79C9xx PCnet device ti # Alteon Networks Tigon I/II gigabit Ethernet -device vx # 3Com 3c590, 3c595 (``Vortex'') # PCI Ethernet NICs that use the common MII bus controller code. # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri May 17 15:24:17 2019 (r347920) +++ head/sys/modules/Makefile Fri May 17 15:24:26 2019 (r347921) @@ -374,7 +374,6 @@ SUBDIR= \ ${_vpo} \ vr \ vte \ - vx \ wb \ ${_wbwd} \ ${_wi} \ Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Fri May 17 15:24:17 2019 (r347920) +++ head/sys/sparc64/conf/GENERIC Fri May 17 15:24:26 2019 (r347921) @@ -187,7 +187,6 @@ device iflib device em # Intel PRO/1000 adapter Gigabit Ethernet Card device le # AMD Am7900 LANCE and Am79C9xx PCnet device ti # Alteon Networks Tigon I/II gigabit Ethernet -#device vx # 3Com 3c590, 3c595 (``Vortex'') # PCI Ethernet NICs that use the common MII bus controller code. # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! From owner-svn-src-head@freebsd.org Fri May 17 15:24:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19CE51597EF2; Fri, 17 May 2019 15:24: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 AC8B68023A; Fri, 17 May 2019 15:24: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 DF947A1FB; Fri, 17 May 2019 15:24:36 +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 x4HFOahv006547; Fri, 17 May 2019 15:24:36 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HFOZX9006539; Fri, 17 May 2019 15:24:35 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905171524.x4HFOZX9006539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 May 2019 15:24:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347922 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/wb sys/i386/conf sys/modules sys/modules/wb sys/sparc64/conf X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/wb sys/i386/conf sys/modules sys/modules/wb sys/sparc64/conf X-SVN-Commit-Revision: 347922 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AC8B68023A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 15:24:41 -0000 Author: brooks Date: Fri May 17 15:24:34 2019 New Revision: 347922 URL: https://svnweb.freebsd.org/changeset/base/347922 Log: FCP-101: Remove wb(4) Relnotes: yes FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Reviewed by: jhb, imp Differential Revision: https://reviews.freebsd.org/D20230 Deleted: head/share/man/man4/wb.4 head/sys/dev/wb/ head/sys/modules/wb/ Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/amd64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/modules/Makefile head/sys/sparc64/conf/GENERIC Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 17 15:24:26 2019 (r347921) +++ head/ObsoleteFiles.inc Fri May 17 15:24:34 2019 (r347922) @@ -61,6 +61,7 @@ OLD_FILES+=usr/share/man/man4/if_tx.4 OLD_FILES+=usr/share/man/man4/txp.4 OLD_FILES+=usr/share/man/man4/if_txp.4 OLD_FILES+=usr/share/man/man4/vx.4 +OLD_FILES+=usr/share/man/man4/wb.4 # 20190513: libcap_sysctl interface change OLD_FILES+=lib/casper/libcap_sysctl.1 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package. Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri May 17 15:24:26 2019 (r347921) +++ head/share/man/man4/Makefile Fri May 17 15:24:34 2019 (r347922) @@ -550,7 +550,6 @@ MAN= aac.4 \ vte.4 \ ${_vtnet.4} \ watchdog.4 \ - wb.4 \ ${_wbwd.4} \ wi.4 \ witness.4 \ @@ -725,7 +724,6 @@ MLINKS+=vr.4 if_vr.4 MLINKS+=vte.4 if_vte.4 MLINKS+=${_vtnet.4} ${_if_vtnet.4} MLINKS+=watchdog.4 SW_WATCHDOG.4 -MLINKS+=wb.4 if_wb.4 MLINKS+=wi.4 if_wi.4 MLINKS+=${_wpi.4} ${_if_wpi.4} MLINKS+=xe.4 if_xe.4 Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri May 17 15:24:26 2019 (r347921) +++ head/sys/amd64/conf/GENERIC Fri May 17 15:24:34 2019 (r347922) @@ -278,7 +278,6 @@ device ste # Sundance ST201 (D-Link DFE-550TX) device stge # Sundance/Tamarack TC9021 gigabit Ethernet device vge # VIA VT612x gigabit Ethernet device vr # VIA Rhine, Rhine II -device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # Wireless NIC cards Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri May 17 15:24:26 2019 (r347921) +++ head/sys/conf/NOTES Fri May 17 15:24:34 2019 (r347922) @@ -2000,9 +2000,6 @@ device xmphy # XaQti XMAC II # including the D-Link DFE520TX and D-Link DFE530TX (see 'rl' for # DFE530TX+), the Hawking Technologies PN102TX, and the AOpen/Acer ALN-320. # vte: DM&P Vortex86 RDC R6040 Fast Ethernet -# wb: Support for fast ethernet adapters based on the Winbond W89C840F chip. -# Note: this is not the same as the Winbond W89C940F, which is a -# NE2000 clone. # wi: Lucent WaveLAN/IEEE 802.11 PCMCIA adapters. Note: this supports both # the PCMCIA and ISA cards: the ISA card is really a PCMCIA to ISA # bridge with a PCMCIA adapter plugged into it. @@ -2054,7 +2051,6 @@ device ste # Sundance ST201 (D-Link DFE-550TX) device stge # Sundance/Tamarack TC9021 gigabit Ethernet device vr # VIA Rhine, Rhine II device vte # DM&P Vortex86 RDC R6040 Fast Ethernet -device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # PCI/PCI-X/PCIe Ethernet NICs that use iflib infrastructure Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 17 15:24:26 2019 (r347921) +++ head/sys/conf/files Fri May 17 15:24:34 2019 (r347922) @@ -3404,7 +3404,6 @@ dev/vte/if_vte.c optional vte pci dev/vx/if_vx.c optional vx dev/vx/if_vx_pci.c optional vx pci dev/watchdog/watchdog.c standard -dev/wb/if_wb.c optional wb pci dev/wi/if_wi.c optional wi dev/wi/if_wi_pccard.c optional wi pccard dev/wi/if_wi_pci.c optional wi pci Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri May 17 15:24:26 2019 (r347921) +++ head/sys/i386/conf/GENERIC Fri May 17 15:24:34 2019 (r347922) @@ -261,7 +261,6 @@ device stge # Sundance/Tamarack TC9021 gigabit Ethe device vge # VIA VT612x gigabit Ethernet device vr # VIA Rhine, Rhine II device vte # DM&P Vortex86 RDC R6040 Fast Ethernet -device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # ISA Ethernet NICs. pccard NICs included. Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri May 17 15:24:26 2019 (r347921) +++ head/sys/modules/Makefile Fri May 17 15:24:34 2019 (r347922) @@ -374,7 +374,6 @@ SUBDIR= \ ${_vpo} \ vr \ vte \ - wb \ ${_wbwd} \ ${_wi} \ wlan \ Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Fri May 17 15:24:26 2019 (r347921) +++ head/sys/sparc64/conf/GENERIC Fri May 17 15:24:34 2019 (r347922) @@ -206,7 +206,6 @@ device sk # SysKonnect SK-984x & SK-982x gigabit Eth device ste # Sundance ST201 (D-Link DFE-550TX) device stge # Sundance/Tamarack TC9021 gigabit Ethernet device vr # VIA Rhine, Rhine II -#device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # Wireless NIC cards From owner-svn-src-head@freebsd.org Fri May 17 15:24:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 874851597F6D; Fri, 17 May 2019 15:24:50 +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 24BA580346; Fri, 17 May 2019 15:24:50 +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 39A0EA1FC; Fri, 17 May 2019 15:24:46 +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 x4HFOkJM006609; Fri, 17 May 2019 15:24:46 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HFOj19006601; Fri, 17 May 2019 15:24:45 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905171524.x4HFOj19006601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 May 2019 15:24:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347923 - in head: . share/man/man4 sys/conf sys/dev/xe sys/i386/conf sys/modules sys/modules/xe X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: . share/man/man4 sys/conf sys/dev/xe sys/i386/conf sys/modules sys/modules/xe X-SVN-Commit-Revision: 347923 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 24BA580346 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 15:24:50 -0000 Author: brooks Date: Fri May 17 15:24:44 2019 New Revision: 347923 URL: https://svnweb.freebsd.org/changeset/base/347923 Log: FCP-101: Remove xe(4) Relnotes: yes FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Reviewed by: jhb, imp Differential Revision: https://reviews.freebsd.org/D20230 Deleted: head/share/man/man4/xe.4 head/sys/dev/xe/ head/sys/modules/xe/ Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/modules/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 17 15:24:34 2019 (r347922) +++ head/ObsoleteFiles.inc Fri May 17 15:24:44 2019 (r347923) @@ -62,6 +62,8 @@ OLD_FILES+=usr/share/man/man4/txp.4 OLD_FILES+=usr/share/man/man4/if_txp.4 OLD_FILES+=usr/share/man/man4/vx.4 OLD_FILES+=usr/share/man/man4/wb.4 +OLD_FILES+=usr/share/man/man4/xe.4 +OLD_FILES+=usr/share/man/man4/if_xe.4 # 20190513: libcap_sysctl interface change OLD_FILES+=lib/casper/libcap_sysctl.1 # 20190509: tests/sys/opencrypto requires the net/py-dpkt package. Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri May 17 15:24:34 2019 (r347922) +++ head/share/man/man4/Makefile Fri May 17 15:24:44 2019 (r347923) @@ -563,7 +563,6 @@ MAN= aac.4 \ wmt.4 \ ${_wpi.4} \ wsp.4 \ - xe.4 \ ${_xen.4} \ xhci.4 \ xl.4 \ @@ -726,7 +725,6 @@ MLINKS+=${_vtnet.4} ${_if_vtnet.4} MLINKS+=watchdog.4 SW_WATCHDOG.4 MLINKS+=wi.4 if_wi.4 MLINKS+=${_wpi.4} ${_if_wpi.4} -MLINKS+=xe.4 if_xe.4 MLINKS+=xl.4 if_xl.4 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri May 17 15:24:34 2019 (r347922) +++ head/sys/conf/NOTES Fri May 17 15:24:44 2019 (r347923) @@ -2003,9 +2003,6 @@ device xmphy # XaQti XMAC II # wi: Lucent WaveLAN/IEEE 802.11 PCMCIA adapters. Note: this supports both # the PCMCIA and ISA cards: the ISA card is really a PCMCIA to ISA # bridge with a PCMCIA adapter plugged into it. -# xe: Xircom/Intel EtherExpress Pro100/16 PC Card ethernet controller, -# Accton Fast EtherCard-16, Compaq Netelligent 10/100 PC Card, -# Toshiba 10/100 Ethernet PC Card, Xircom 16-bit Ethernet + Modem 56 # xl: Support for the 3Com 3c900, 3c905, 3c905B and 3c905C (Fast) # Etherlink XL cards and integrated controllers. This includes the # integrated 3c905B-TX chips in certain Dell Optiplex and Dell @@ -2017,7 +2014,6 @@ device xmphy # XaQti XMAC II device an device wi -device xe # PCI Ethernet NICs that use the common MII bus controller code. device ae # Attansic/Atheros L2 FastEthernet Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 17 15:24:34 2019 (r347922) +++ head/sys/conf/files Fri May 17 15:24:44 2019 (r347923) @@ -3432,8 +3432,6 @@ dev/xdma/xdma_mbuf.c optional xdma dev/xdma/xdma_queue.c optional xdma dev/xdma/xdma_sg.c optional xdma dev/xdma/xdma_sglist.c optional xdma -dev/xe/if_xe.c optional xe -dev/xe/if_xe_pccard.c optional xe pccard dev/xen/balloon/balloon.c optional xenhvm dev/xen/blkfront/blkfront.c optional xenhvm dev/xen/blkback/blkback.c optional xenhvm Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri May 17 15:24:34 2019 (r347922) +++ head/sys/i386/conf/GENERIC Fri May 17 15:24:44 2019 (r347923) @@ -264,7 +264,6 @@ device vte # DM&P Vortex86 RDC R6040 Fast Ethernet device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # ISA Ethernet NICs. pccard NICs included. -device xe # Xircom pccard Ethernet # Wireless NIC cards device wlan # 802.11 support Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri May 17 15:24:34 2019 (r347922) +++ head/sys/modules/Makefile Fri May 17 15:24:44 2019 (r347923) @@ -387,7 +387,6 @@ SUBDIR= \ ${_wpi} \ ${_wpifw} \ ${_x86bios} \ - ${_xe} \ xl \ xz \ zlib @@ -610,7 +609,6 @@ _sppp= sppp _vmware= vmware _wbwd= wbwd _wi= wi -_xe= xe _aac= aac _aacraid= aacraid From owner-svn-src-head@freebsd.org Fri May 17 15:24:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C1E51597FC3; Fri, 17 May 2019 15:24:58 +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 AE94680417; Fri, 17 May 2019 15:24: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 37B88A1FD; Fri, 17 May 2019 15:24: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 x4HFOt5N006664; Fri, 17 May 2019 15:24:55 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HFOso4006662; Fri, 17 May 2019 15:24:54 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905171524.x4HFOso4006662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 May 2019 15:24:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347924 - in head/sys: i386/conf sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: i386/conf sys X-SVN-Commit-Revision: 347924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE94680417 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Fri, 17 May 2019 15:24:58 -0000 Author: brooks Date: Fri May 17 15:24:54 2019 New Revision: 347924 URL: https://svnweb.freebsd.org/changeset/base/347924 Log: FCP-101: Bump __FreeBSD_version for driver removal. Remove gone_by_fcp101_dev macro. Remove orphaned comment. Modified: head/sys/i386/conf/GENERIC head/sys/sys/systm.h Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Fri May 17 15:24:44 2019 (r347923) +++ head/sys/i386/conf/GENERIC Fri May 17 15:24:54 2019 (r347924) @@ -263,8 +263,6 @@ device vr # VIA Rhine, Rhine II device vte # DM&P Vortex86 RDC R6040 Fast Ethernet device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') -# ISA Ethernet NICs. pccard NICs included. - # Wireless NIC cards device wlan # 802.11 support options IEEE80211_DEBUG # enable debug msgs Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Fri May 17 15:24:44 2019 (r347923) +++ head/sys/sys/systm.h Fri May 17 15:24:54 2019 (r347924) @@ -575,9 +575,6 @@ void _gone_in_dev(struct device *dev, int major, const #endif #define gone_in(major, msg) __gone_ok(major, msg) _gone_in(major, msg) #define gone_in_dev(dev, major, msg) __gone_ok(major, msg) _gone_in_dev(dev, major, msg) -#define gone_by_fcp101_dev(dev) \ - gone_in_dev((dev), 13, \ - "see https://github.com/freebsd/fcp/blob/master/fcp-0101.md") __NULLABILITY_PRAGMA_POP From owner-svn-src-head@freebsd.org Fri May 17 15:31:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C260E15985C2; Fri, 17 May 2019 15:31:29 +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 5948E80E19; Fri, 17 May 2019 15:31:29 +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 345CAA281; Fri, 17 May 2019 15:31:29 +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 x4HFVTOm007758; Fri, 17 May 2019 15:31:29 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HFVT4q007757; Fri, 17 May 2019 15:31:29 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905171531.x4HFVT4q007757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 May 2019 15:31:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347925 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 347925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5948E80E19 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 15:31:29 -0000 Author: brooks Date: Fri May 17 15:31:28 2019 New Revision: 347925 URL: https://svnweb.freebsd.org/changeset/base/347925 Log: FCP-101: Bump __FreeBSD_version for device removal. Bump accidentally omitted from r347924 due to a rebase accident. Differential Revision: https://reviews.freebsd.org/D20230 Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri May 17 15:24:54 2019 (r347924) +++ head/sys/sys/param.h Fri May 17 15:31:28 2019 (r347925) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300027 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300028 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Fri May 17 15:44:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95CDE1598B9E; Fri, 17 May 2019 15:44:12 +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 382F081585; Fri, 17 May 2019 15:44: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 0A73CA59A; Fri, 17 May 2019 15:44: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 x4HFiBXY017256; Fri, 17 May 2019 15:44:11 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HFiBvg017255; Fri, 17 May 2019 15:44:11 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905171544.x4HFiBvg017255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 May 2019 15:44:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347926 - head X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 347926 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 382F081585 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Fri, 17 May 2019 15:44:12 -0000 Author: brooks Date: Fri May 17 15:44:11 2019 New Revision: 347926 URL: https://svnweb.freebsd.org/changeset/base/347926 Log: FCP-101: correct date of device driver removal. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 17 15:31:28 2019 (r347925) +++ head/ObsoleteFiles.inc Fri May 17 15:44:11 2019 (r347926) @@ -38,7 +38,7 @@ # xargs -n1 | sort | uniq -d; # done -# 20190518: Remove obsolete 10 and 10/100 ethernet drivers. +# 20190517: Remove obsolete 10 and 10/100 ethernet drivers. OLD_FILES+=usr/share/man/man4/bm.4 OLD_FILES+=usr/share/man/man4/cs.4 OLD_FILES+=usr/share/man/man4/de.4 From owner-svn-src-head@freebsd.org Fri May 17 15:52:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 808DD1598E0B; Fri, 17 May 2019 15:52:18 +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 1BD87819C0; Fri, 17 May 2019 15:52:18 +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 EAC4BA723; Fri, 17 May 2019 15:52:17 +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 x4HFqHnV020148; Fri, 17 May 2019 15:52:17 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HFqH2g020147; Fri, 17 May 2019 15:52:17 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905171552.x4HFqH2g020147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Fri, 17 May 2019 15:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347927 - in head/sys: arm64/include conf X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: in head/sys: arm64/include conf X-SVN-Commit-Revision: 347927 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1BD87819C0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 15:52:18 -0000 Author: dougm Date: Fri May 17 15:52:17 2019 New Revision: 347927 URL: https://svnweb.freebsd.org/changeset/base/347927 Log: Implement the ffs and fls functions, and their longer counterparts, in cpufunc, in terms of __builtin_ffs and the like, for arm64 architectures, and use those, rather than the simple libkern implementations, in building arm64 kernels. Tested by: greg_unrelenting.technology (earlier version) Reviewed by: alc Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D20250 Modified: head/sys/arm64/include/cpufunc.h head/sys/conf/files.arm64 Modified: head/sys/arm64/include/cpufunc.h ============================================================================== --- head/sys/arm64/include/cpufunc.h Fri May 17 15:44:11 2019 (r347926) +++ head/sys/arm64/include/cpufunc.h Fri May 17 15:52:17 2019 (r347927) @@ -38,6 +38,63 @@ breakpoint(void) #ifdef _KERNEL +#define HAVE_INLINE_FFS + +static __inline __pure2 int +ffs(int mask) +{ + + return (__builtin_ffs(mask)); +} + +#define HAVE_INLINE_FFSL + +static __inline __pure2 int +ffsl(long mask) +{ + + return (__builtin_ffsl(mask)); +} + +#define HAVE_INLINE_FFSLL + +static __inline __pure2 int +ffsll(long long mask) +{ + + return (__builtin_ffsll(mask)); +} + +#define HAVE_INLINE_FLS + +static __inline __pure2 int +fls(int mask) +{ + + return (mask == 0 ? 0 : + 8 * sizeof(mask) - __builtin_clz((u_int)mask)); +} + +#define HAVE_INLINE_FLSL + +static __inline __pure2 int +flsl(long mask) +{ + + return (mask == 0 ? 0 : + 8 * sizeof(mask) - __builtin_clzl((u_long)mask)); +} + +#define HAVE_INLINE_FLSLL + +static __inline __pure2 int +flsll(long long mask) +{ + + return (mask == 0 ? 0 : + 8 * sizeof(mask) - __builtin_clzll((unsigned long long)mask)); +} + #include void pan_enable(void); Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Fri May 17 15:44:11 2019 (r347926) +++ head/sys/conf/files.arm64 Fri May 17 15:52:17 2019 (r347927) @@ -258,12 +258,6 @@ kern/pic_if.m optional intrng kern/subr_devmap.c standard kern/subr_intr.c optional intrng libkern/bcmp.c standard -libkern/ffs.c standard -libkern/ffsl.c standard -libkern/ffsll.c standard -libkern/fls.c standard -libkern/flsl.c standard -libkern/flsll.c standard libkern/memcmp.c standard libkern/memset.c standard libkern/arm64/crc32c_armv8.S standard From owner-svn-src-head@freebsd.org Fri May 17 17:04:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59D30159A410; Fri, 17 May 2019 17:04:02 +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 F173283D6E; Fri, 17 May 2019 17:04:01 +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 CA4ADB34C; Fri, 17 May 2019 17:04:01 +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 x4HH41qx059341; Fri, 17 May 2019 17:04:01 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HH41nH059340; Fri, 17 May 2019 17:04:01 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905171704.x4HH41nH059340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 17 May 2019 17:04:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347929 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 347929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F173283D6E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 17:04:02 -0000 Author: manu Date: Fri May 17 17:04:01 2019 New Revision: 347929 URL: https://svnweb.freebsd.org/changeset/base/347929 Log: pci: ecam: Do not warn on mismatch of bus_end We cannot know the bus end number before parsing the MCFG table so don't set the bus_end before that. If the MCFG table doesn't exist we will set the configuration base address based on the _CBA value and set the bus_end to the maximal number allowed by PCI. Sponsored by: Ampere Computing, LLC Differential Revision: https://reviews.freebsd.org/D20213 Modified: head/sys/dev/pci/pci_host_generic_acpi.c Modified: head/sys/dev/pci/pci_host_generic_acpi.c ============================================================================== --- head/sys/dev/pci/pci_host_generic_acpi.c Fri May 17 16:41:18 2019 (r347928) +++ head/sys/dev/pci/pci_host_generic_acpi.c Fri May 17 17:04:01 2019 (r347929) @@ -207,11 +207,7 @@ pci_host_acpi_get_ecam_resource(device_t dev) mcfg_entry++; } if (found) { - if (mcfg_entry->EndBusNumber < sc->base.bus_end) { - device_printf(dev, "bus end mismatch! expected %d found %d.\n", - sc->base.bus_end, (int)mcfg_entry->EndBusNumber); - sc->base.bus_end = mcfg_entry->EndBusNumber; - } + sc->base.bus_end = mcfg_entry->EndBusNumber; base = mcfg_entry->Address; } else { device_printf(dev, "MCFG exists, but does not have bus %d-%d\n", @@ -220,9 +216,10 @@ pci_host_acpi_get_ecam_resource(device_t dev) } } else { status = acpi_GetInteger(handle, "_CBA", &val); - if (ACPI_SUCCESS(status)) + if (ACPI_SUCCESS(status)) { base = val; - else + sc->base.bus_end = 255; + } else return (ENXIO); } @@ -259,7 +256,6 @@ pci_host_generic_acpi_attach(device_t dev) device_printf(dev, "No _BBN, using start bus 0\n"); sc->base.bus_start = 0; } - sc->base.bus_end = 255; /* Get PCI Segment (domain) needed for MCFG lookup */ status = acpi_GetInteger(handle, "_SEG", &sc->base.ecam); From owner-svn-src-head@freebsd.org Fri May 17 17:05:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39BAE159A493; Fri, 17 May 2019 17:05:18 +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 D2A8783EE3; Fri, 17 May 2019 17:05:17 +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 93AFBB35A; Fri, 17 May 2019 17:05:17 +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 x4HH5HD5059484; Fri, 17 May 2019 17:05:17 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HH5HDR059483; Fri, 17 May 2019 17:05:17 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905171705.x4HH5HDR059483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 17 May 2019 17:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347930 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 347930 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D2A8783EE3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 17:05:18 -0000 Author: manu Date: Fri May 17 17:05:16 2019 New Revision: 347930 URL: https://svnweb.freebsd.org/changeset/base/347930 Log: pci: ecam: Correctly parse memory and IO region When activating a resource do not compare the resource id to the adress. Treat IO region as MEMORY region too. Submitted by: Tuan Phan (Original Version) Sponsored by: Ampere Computing, LLC Differential Revision: https://reviews.freebsd.org/D20214 Modified: head/sys/dev/pci/pci_host_generic.c head/sys/dev/pci/pci_host_generic_acpi.c Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Fri May 17 17:04:01 2019 (r347929) +++ head/sys/dev/pci/pci_host_generic.c Fri May 17 17:05:16 2019 (r347930) @@ -359,29 +359,30 @@ generic_pcie_activate_resource(device_t dev, device_t switch (type) { case SYS_RES_IOPORT: + case SYS_RES_MEMORY: found = 0; for (i = 0; i < MAX_RANGES_TUPLES; i++) { pci_base = sc->ranges[i].pci_base; phys_base = sc->ranges[i].phys_base; size = sc->ranges[i].size; - if ((rid > pci_base) && (rid < (pci_base + size))) { + if ((rman_get_start(r) >= pci_base) && (rman_get_start(r) < (pci_base + size))) { found = 1; break; } } if (found) { - rman_set_start(r, rman_get_start(r) + phys_base); - rman_set_end(r, rman_get_end(r) + phys_base); + rman_set_start(r, rman_get_start(r) - pci_base + phys_base); + rman_set_end(r, rman_get_end(r) - pci_base + phys_base); res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, type, rid, r); } else { device_printf(dev, - "Failed to activate IOPORT resource\n"); + "Failed to activate %s resource\n", + type == SYS_RES_IOPORT ? "IOPORT" : "MEMORY"); res = 0; } break; - case SYS_RES_MEMORY: case SYS_RES_IRQ: res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, type, rid, r); Modified: head/sys/dev/pci/pci_host_generic_acpi.c ============================================================================== --- head/sys/dev/pci/pci_host_generic_acpi.c Fri May 17 17:04:01 2019 (r347929) +++ head/sys/dev/pci/pci_host_generic_acpi.c Fri May 17 17:05:16 2019 (r347930) @@ -148,8 +148,6 @@ pci_host_generic_acpi_parse_resource(ACPI_RESOURCE *re off = res->Data.Address32.Address.TranslationOffset; break; case ACPI_RESOURCE_TYPE_ADDRESS64: - if (res->Data.Address.ResourceType != ACPI_MEMORY_RANGE) - break; min = res->Data.Address64.Address.Minimum; max = res->Data.Address64.Address.Maximum; off = res->Data.Address64.Address.TranslationOffset; @@ -293,7 +291,7 @@ pci_host_generic_acpi_attach(device_t dev) continue; /* empty range element */ if (sc->base.ranges[tuple].flags & FLAG_MEM) { error = rman_manage_region(&sc->base.mem_rman, - phys_base, phys_base + size - 1); + pci_base, pci_base + size - 1); } else if (sc->base.ranges[tuple].flags & FLAG_IO) { error = rman_manage_region(&sc->base.io_rman, pci_base + PCI_IO_WINDOW_OFFSET, From owner-svn-src-head@freebsd.org Fri May 17 17:11:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A229A159A614; Fri, 17 May 2019 17:11:02 +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 2A1E084165; Fri, 17 May 2019 17:11:02 +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 04AD4B390; Fri, 17 May 2019 17:11:02 +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 x4HHB1sD059825; Fri, 17 May 2019 17:11:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HHB1Kv059824; Fri, 17 May 2019 17:11:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905171711.x4HHB1Kv059824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 17 May 2019 17:11:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347931 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 347931 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2A1E084165 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 17:11:02 -0000 Author: kib Date: Fri May 17 17:11:01 2019 New Revision: 347931 URL: https://svnweb.freebsd.org/changeset/base/347931 Log: Free microcode memory later. With lockless DI, pmap_remove() requires operational thread lock, which is initialized at SI_SUB_RUN_QUEUE for thread0. Move it even later where APs are started, the moment after which other boot memory like trampoline stacks is already being freed. Reported by: gtetlow Sponsored by: The FreeBSD Foundation MFC after: 30 days Modified: head/sys/x86/x86/ucode.c Modified: head/sys/x86/x86/ucode.c ============================================================================== --- head/sys/x86/x86/ucode.c Fri May 17 17:05:16 2019 (r347930) +++ head/sys/x86/x86/ucode.c Fri May 17 17:11:01 2019 (r347931) @@ -260,7 +260,7 @@ restart: goto restart; } } -SYSINIT(ucode_release, SI_SUB_KMEM + 1, SI_ORDER_ANY, ucode_release, NULL); +SYSINIT(ucode_release, SI_SUB_SMP + 1, SI_ORDER_ANY, ucode_release, NULL); void ucode_load_ap(int cpu) From owner-svn-src-head@freebsd.org Fri May 17 17:21:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9118159A9CD; Fri, 17 May 2019 17:21:33 +0000 (UTC) (envelope-from stevek@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 6C8D18497D; Fri, 17 May 2019 17:21:33 +0000 (UTC) (envelope-from stevek@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 47092B574; Fri, 17 May 2019 17:21:33 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4HHLXdm065979; Fri, 17 May 2019 17:21:33 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HHLWwk065974; Fri, 17 May 2019 17:21:32 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201905171721.x4HHLWwk065974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Fri, 17 May 2019 17:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347932 - in head/sys: kern sys x86/include x86/x86 X-SVN-Group: head X-SVN-Commit-Author: stevek X-SVN-Commit-Paths: in head/sys: kern sys x86/include x86/x86 X-SVN-Commit-Revision: 347932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C8D18497D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 17:21:34 -0000 Author: stevek Date: Fri May 17 17:21:32 2019 New Revision: 347932 URL: https://svnweb.freebsd.org/changeset/base/347932 Log: Instead of individual conditional statements to look for each hypervisor type, use a table to make it easier to add more in the future, if needed. Add VirtualBox detection to the table ("VBoxVBoxVBox" is the hypervisor vendor string to look for.) Also add VM_GUEST_VBOX to the VM_GUEST enumeration to indicate VirtualBox. Save the CPUID base for the hypervisor entry that we detected. Driver code may need to know about it in order to obtain additional CPUID features. Approved by: bryanv, jhb Differential Revision: https://reviews.freebsd.org/D16305 Modified: head/sys/kern/subr_param.c head/sys/sys/systm.h head/sys/x86/include/x86_var.h head/sys/x86/x86/identcpu.c Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Fri May 17 17:11:01 2019 (r347931) +++ head/sys/kern/subr_param.c Fri May 17 17:21:32 2019 (r347932) @@ -153,6 +153,7 @@ static const char *const vm_guest_sysctl_names[] = { "vmware", "kvm", "bhyve", + "vbox", NULL }; CTASSERT(nitems(vm_guest_sysctl_names) - 1 == VM_LAST); Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Fri May 17 17:11:01 2019 (r347931) +++ head/sys/sys/systm.h Fri May 17 17:21:32 2019 (r347932) @@ -78,7 +78,8 @@ extern int vm_guest; /* Running as virtual machine gu * Keep in sync with vm_guest_sysctl_names[]. */ enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN, VM_GUEST_HV, - VM_GUEST_VMWARE, VM_GUEST_KVM, VM_GUEST_BHYVE, VM_LAST }; + VM_GUEST_VMWARE, VM_GUEST_KVM, VM_GUEST_BHYVE, VM_GUEST_VBOX, + VM_LAST }; /* * These functions need to be declared before the KASSERT macro is invoked in Modified: head/sys/x86/include/x86_var.h ============================================================================== --- head/sys/x86/include/x86_var.h Fri May 17 17:11:01 2019 (r347931) +++ head/sys/x86/include/x86_var.h Fri May 17 17:21:32 2019 (r347932) @@ -68,6 +68,7 @@ extern u_int cpu_mon_min_size; extern u_int cpu_mon_max_size; extern u_int cpu_maxphyaddr; extern char ctx_switch_xsave[]; +extern u_int hv_base; extern u_int hv_high; extern char hv_vendor[]; extern char kstack[]; Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Fri May 17 17:11:01 2019 (r347931) +++ head/sys/x86/x86/identcpu.c Fri May 17 17:21:32 2019 (r347932) @@ -164,6 +164,7 @@ static int hw_clockrate; SYSCTL_INT(_hw, OID_AUTO, clockrate, CTLFLAG_RD, &hw_clockrate, 0, "CPU instruction clock rate"); +u_int hv_base; u_int hv_high; char hv_vendor[16]; SYSCTL_STRING(_hw, OID_AUTO, hv_vendor, CTLFLAG_RD | CTLFLAG_MPSAFE, hv_vendor, @@ -1323,11 +1324,22 @@ static const char *const vm_pnames[] = { NULL }; -void -identify_hypervisor(void) +static struct { + const char *vm_cpuid; + int vm_guest; +} vm_cpuids[] = { + { "XENXENXEN", VM_GUEST_XEN }, /* XEN */ + { "Microsoft Hv", VM_GUEST_HV }, /* Microsoft Hyper-V */ + { "VMwareVMware", VM_GUEST_VMWARE }, /* VMware VM */ + { "KVMKVMKVM", VM_GUEST_KVM }, /* KVM */ + { "bhyve bhyve ", VM_GUEST_BHYVE }, /* bhyve */ + { "VBoxVBoxVBox", VM_GUEST_VBOX }, /* VirtualBox */ +}; + +static void +identify_hypervisor_cpuid_base(void) { - u_int regs[4]; - char *p; + u_int leaf, regs[4]; int i; /* @@ -1337,10 +1349,13 @@ identify_hypervisor(void) * KB1009458: Mechanisms to determine if software is running in * a VMware virtual machine * http://kb.vmware.com/kb/1009458 + * + * Search for a hypervisor that we recognize. If we cannot find + * a specific hypervisor, return the first information about the + * hypervisor that we found, as others may be able to use. */ - if (cpu_feature2 & CPUID2_HV) { - vm_guest = VM_GUEST_VM; - do_cpuid(0x40000000, regs); + for (leaf = 0x40000000; leaf < 0x40010000; leaf += 0x100) { + do_cpuid(leaf, regs); /* * KVM from Linux kernels prior to commit @@ -1351,23 +1366,52 @@ identify_hypervisor(void) */ if (regs[0] == 0 && regs[1] == 0x4b4d564b && regs[2] == 0x564b4d56 && regs[3] == 0x0000004d) - regs[0] = 0x40000001; + regs[0] = leaf + 1; - if (regs[0] >= 0x40000000) { - hv_high = regs[0]; - ((u_int *)&hv_vendor)[0] = regs[1]; - ((u_int *)&hv_vendor)[1] = regs[2]; - ((u_int *)&hv_vendor)[2] = regs[3]; - hv_vendor[12] = '\0'; - if (strcmp(hv_vendor, "VMwareVMware") == 0) - vm_guest = VM_GUEST_VMWARE; - else if (strcmp(hv_vendor, "Microsoft Hv") == 0) - vm_guest = VM_GUEST_HV; - else if (strcmp(hv_vendor, "KVMKVMKVM") == 0) - vm_guest = VM_GUEST_KVM; - else if (strcmp(hv_vendor, "bhyve bhyve ") == 0) - vm_guest = VM_GUEST_BHYVE; + if (regs[0] >= leaf) { + for (i = 0; i < nitems(vm_cpuids); i++) + if (strncmp((const char *)®s[1], + vm_cpuids[i].vm_cpuid, 12) == 0) { + vm_guest = vm_cpuids[i].vm_guest; + break; + } + + /* + * If this is the first entry or we found a + * specific hypervisor, record the base, high value, + * and vendor identifier. + */ + if (vm_guest != VM_GUEST_VM || leaf == 0x40000000) { + hv_high = leaf; + ((u_int *)&hv_vendor)[0] = regs[1]; + ((u_int *)&hv_vendor)[1] = regs[2]; + ((u_int *)&hv_vendor)[2] = regs[3]; + hv_vendor[12] = '\0'; + + /* + * If we found a specific hypervisor, then + * we are finished. + */ + if (vm_guest != VM_GUEST_VM) + return; + } } + } +} + +void +identify_hypervisor(void) +{ + u_int regs[4]; + char *p; + int i; + + /* + * If CPUID2_HV is set, we are running in a hypervisor environment. + */ + if (cpu_feature2 & CPUID2_HV) { + vm_guest = VM_GUEST_VM; + identify_hypervisor_cpuid_base(); return; } From owner-svn-src-head@freebsd.org Fri May 17 17:50:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B61BF159B88F; Fri, 17 May 2019 17:50:02 +0000 (UTC) (envelope-from stevek@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 5BC3A856EE; Fri, 17 May 2019 17:50:02 +0000 (UTC) (envelope-from stevek@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 31473BA3E; Fri, 17 May 2019 17:50:02 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4HHo15R080888; Fri, 17 May 2019 17:50:01 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HHo1C8080887; Fri, 17 May 2019 17:50:01 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201905171750.x4HHo1C8080887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Fri, 17 May 2019 17:50:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347933 - head/sys/security/mac_veriexec X-SVN-Group: head X-SVN-Commit-Author: stevek X-SVN-Commit-Paths: head/sys/security/mac_veriexec X-SVN-Commit-Revision: 347933 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5BC3A856EE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 17:50:02 -0000 Author: stevek Date: Fri May 17 17:50:01 2019 New Revision: 347933 URL: https://svnweb.freebsd.org/changeset/base/347933 Log: Ensure we have obtained a lock on the process before calling mac_veriexec_get_executable_flags(). Only try locking/unlocking if the caller has not already acquired the process lock. Obtained from: Juniper Networks, Inc. MFC after: 1 week Modified: head/sys/security/mac_veriexec/mac_veriexec.c Modified: head/sys/security/mac_veriexec/mac_veriexec.c ============================================================================== --- head/sys/security/mac_veriexec/mac_veriexec.c Fri May 17 17:21:32 2019 (r347932) +++ head/sys/security/mac_veriexec/mac_veriexec.c Fri May 17 17:50:01 2019 (r347933) @@ -823,9 +823,18 @@ mac_veriexec_set_state(int state) int mac_veriexec_proc_is_trusted(struct ucred *cred, struct proc *p) { - int error, flags; + int already_locked, error, flags; + /* Make sure we lock the process if we do not already have the lock */ + already_locked = PROC_LOCKED(p); + if (!already_locked) + PROC_LOCK(p); + error = mac_veriexec_metadata_get_executable_flags(cred, p, &flags, 0); + + /* Unlock the process if we locked it previously */ + if (!already_locked) + PROC_UNLOCK(p); /* Any errors, deny access */ if (error != 0) From owner-svn-src-head@freebsd.org Fri May 17 18:02:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F309B159C1FE; Fri, 17 May 2019 18:02:26 +0000 (UTC) (envelope-from stevek@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 96812862F8; Fri, 17 May 2019 18:02:26 +0000 (UTC) (envelope-from stevek@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 70B92BF36; Fri, 17 May 2019 18:02:26 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4HI2Qnc090927; Fri, 17 May 2019 18:02:26 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HI2QpV090926; Fri, 17 May 2019 18:02:26 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201905171802.x4HI2QpV090926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Fri, 17 May 2019 18:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347934 - head/sys/dev/veriexec X-SVN-Group: head X-SVN-Commit-Author: stevek X-SVN-Commit-Paths: head/sys/dev/veriexec X-SVN-Commit-Revision: 347934 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 96812862F8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Fri, 17 May 2019 18:02:27 -0000 Author: stevek Date: Fri May 17 18:02:26 2019 New Revision: 347934 URL: https://svnweb.freebsd.org/changeset/base/347934 Log: Protect commands that are considered dangerous with checks for kmem write priv. This allows for MAC/veriexec to prevent apps that are not "trusted" from using these commands. Obtained from: Juniper Networks, Inc. MFC after: 1 week Modified: head/sys/dev/veriexec/verified_exec.c Modified: head/sys/dev/veriexec/verified_exec.c ============================================================================== --- head/sys/dev/veriexec/verified_exec.c Fri May 17 17:50:01 2019 (r347933) +++ head/sys/dev/veriexec/verified_exec.c Fri May 17 18:02:26 2019 (r347934) @@ -1,7 +1,7 @@ /* * $FreeBSD$ * - * Copyright (c) 2011-2013, 2015, Juniper Networks, Inc. + * Copyright (c) 2011-2013, 2015, 2019 Juniper Networks, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -70,6 +71,37 @@ verifiedexecioctl(struct cdev *dev __unused, u_long cm struct verified_exec_params *params; int error = 0; + /* + * These commands are considered safe requests for anyone who has + * permission to access to device node. + */ + switch (cmd) { + case VERIEXEC_GETSTATE: + { + int *ip = (int *)data; + + if (ip) + *ip = mac_veriexec_get_state(); + else + error = EINVAL; + + return (error); + } + break; + default: + break; + } + + /* + * Anything beyond this point is considered dangerous, so we need to + * only allow processes that have kmem write privs to do them. + * + * MAC/veriexec will grant kmem write privs to "trusted" processes. + */ + error = priv_check(td, PRIV_KMEM_WRITE); + if (error) + return (error); + params = (struct verified_exec_params *)data; switch (cmd) { case VERIEXEC_ACTIVE: @@ -105,16 +137,6 @@ verifiedexecioctl(struct cdev *dev __unused, u_long cm else error = EINVAL; mtx_unlock(&ve_mutex); - break; - case VERIEXEC_GETSTATE: - { - int *ip = (int *)data; - - if (ip) - *ip = mac_veriexec_get_state(); - else - error = EINVAL; - } break; case VERIEXEC_LOCK: mtx_lock(&ve_mutex); From owner-svn-src-head@freebsd.org Fri May 17 18:06:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EADFF159C34E; Fri, 17 May 2019 18:06:25 +0000 (UTC) (envelope-from stevek@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 8E0AE864C0; Fri, 17 May 2019 18:06:25 +0000 (UTC) (envelope-from stevek@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 779D9BF3D; Fri, 17 May 2019 18:06:25 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4HI6PTV091157; Fri, 17 May 2019 18:06:25 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HI6PQn091156; Fri, 17 May 2019 18:06:25 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201905171806.x4HI6PQn091156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Fri, 17 May 2019 18:06:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347935 - head/sys/security/mac_veriexec X-SVN-Group: head X-SVN-Commit-Author: stevek X-SVN-Commit-Paths: head/sys/security/mac_veriexec X-SVN-Commit-Revision: 347935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8E0AE864C0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Fri, 17 May 2019 18:06:26 -0000 Author: stevek Date: Fri May 17 18:06:24 2019 New Revision: 347935 URL: https://svnweb.freebsd.org/changeset/base/347935 Log: Fix format strings for some debug messages that could have arguments that are different types across architectures by using %ju and typecasting to uintmax_t, where appropriate. Obtained from: Juniper Networks, Inc. MFC after: 1 week Modified: head/sys/security/mac_veriexec/mac_veriexec.c Modified: head/sys/security/mac_veriexec/mac_veriexec.c ============================================================================== --- head/sys/security/mac_veriexec/mac_veriexec.c Fri May 17 18:02:26 2019 (r347934) +++ head/sys/security/mac_veriexec/mac_veriexec.c Fri May 17 18:06:24 2019 (r347935) @@ -193,7 +193,8 @@ mac_veriexec_vfs_mounted(void *arg __unused, struct mo SLOT_SET(mp->mnt_label, va.va_fsid); #ifdef MAC_DEBUG - MAC_VERIEXEC_DBG(3, "set fsid to %u for mount %p", va.va_fsid, mp); + MAC_VERIEXEC_DBG(3, "set fsid to %ju for mount %p", + (uintmax_t)va.va_fsid, mp); #endif } @@ -216,7 +217,8 @@ mac_veriexec_vfs_unmounted(void *arg __unused, struct fsid = SLOT(mp->mnt_label); if (fsid) { - MAC_VERIEXEC_DBG(3, "fsid %u, cleaning up mount", fsid); + MAC_VERIEXEC_DBG(3, "fsid %ju, cleaning up mount", + (uintmax_t)fsid); mac_veriexec_metadata_unmounted(fsid, td); } } @@ -379,9 +381,9 @@ mac_veriexec_kld_check_load(struct ucred *cred, struct * kldload should fail unless there is a valid fingerprint * registered. */ - MAC_VERIEXEC_DBG(2, "fingerprint status is %d for dev %u, " - "file %lu.%lu\n", status, va.va_fsid, va.va_fileid, - va.va_gen); + MAC_VERIEXEC_DBG(2, "fingerprint status is %d for dev %ju, " + "file %ju.%ju\n", status, (uintmax_t)va.va_fsid, + (uintmax_t)va.va_fileid, (uintmax_t)va.va_gen); return (EAUTH); } @@ -492,8 +494,8 @@ mac_veriexec_check_vp(struct ucred *cred, struct vnode case FINGERPRINT_INDIRECT: MAC_VERIEXEC_DBG(2, "attempted write to fingerprinted file for dev " - "%u, file %lu.%lu\n", va.va_fsid, - va.va_fileid, va.va_gen); + "%ju, file %ju.%ju\n", (uintmax_t)va.va_fsid, + (uintmax_t)va.va_fileid, (uintmax_t)va.va_gen); return (EPERM); default: break; @@ -513,8 +515,9 @@ mac_veriexec_check_vp(struct ucred *cred, struct vnode * fingerprint registered. */ MAC_VERIEXEC_DBG(2, "fingerprint status is %d for dev " - "%u, file %lu.%lu\n", status, va.va_fsid, - va.va_fileid, va.va_gen); + "%ju, file %ju.%ju\n", status, + (uintmax_t)va.va_fsid, (uintmax_t)va.va_fileid, + (uintmax_t)va.va_gen); return (EAUTH); } } From owner-svn-src-head@freebsd.org Fri May 17 18:09:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2C67159C425; Fri, 17 May 2019 18:09:49 +0000 (UTC) (envelope-from stevek@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 481228664C; Fri, 17 May 2019 18:09:49 +0000 (UTC) (envelope-from stevek@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 1CB6EBF3E; Fri, 17 May 2019 18:09:49 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4HI9mrW091345; Fri, 17 May 2019 18:09:48 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HI9m8B091344; Fri, 17 May 2019 18:09:48 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201905171809.x4HI9m8B091344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Fri, 17 May 2019 18:09:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347936 - head/sys/security/mac_veriexec X-SVN-Group: head X-SVN-Commit-Author: stevek X-SVN-Commit-Paths: head/sys/security/mac_veriexec X-SVN-Commit-Revision: 347936 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 481228664C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 18:09:50 -0000 Author: stevek Date: Fri May 17 18:09:48 2019 New Revision: 347936 URL: https://svnweb.freebsd.org/changeset/base/347936 Log: sysctls which should be restricted when securelevel is raised should also be restricted when veriexec is enforced. Add mpo_system_check_sysctl method to mac_veriexec which does this. Obtained from: Juniper Networks, Inc. MFC after: 1 week Modified: head/sys/security/mac_veriexec/mac_veriexec.c Modified: head/sys/security/mac_veriexec/mac_veriexec.c ============================================================================== --- head/sys/security/mac_veriexec/mac_veriexec.c Fri May 17 18:06:24 2019 (r347935) +++ head/sys/security/mac_veriexec/mac_veriexec.c Fri May 17 18:09:48 2019 (r347936) @@ -1,7 +1,7 @@ /* * $FreeBSD$ * - * Copyright (c) 2011, 2012, 2013, 2015, 2016, Juniper Networks, Inc. + * Copyright (c) 2011, 2012, 2013, 2015, 2016, 2019 Juniper Networks, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -424,6 +424,23 @@ mac_veriexec_priv_check(struct ucred *cred, int priv) return (0); } +static int +mac_veriexec_sysctl_check(struct ucred *cred, struct sysctl_oid *oidp, + void *arg1, int arg2, struct sysctl_req *req) +{ + struct sysctl_oid *oid; + + /* If we are not enforcing veriexec, nothing for us to check */ + if ((mac_veriexec_state & VERIEXEC_STATE_ENFORCE) == 0) + return (0); + + oid = oidp; + if (oid->oid_kind & CTLFLAG_SECURE) { + return (EPERM); /* XXX call mac_veriexec_priv_check? */ + } + return 0; +} + /** * @internal * @brief A program is being executed and needs to be validated. @@ -700,12 +717,13 @@ cleanup_file: static struct mac_policy_ops mac_veriexec_ops = { .mpo_init = mac_veriexec_init, - .mpo_syscall = mac_veriexec_syscall, .mpo_kld_check_load = mac_veriexec_kld_check_load, .mpo_mount_destroy_label = mac_veriexec_mount_destroy_label, .mpo_mount_init_label = mac_veriexec_mount_init_label, .mpo_priv_check = mac_veriexec_priv_check, .mpo_proc_check_debug = mac_veriexec_proc_check_debug, + .mpo_syscall = mac_veriexec_syscall, + .mpo_system_check_sysctl = mac_veriexec_sysctl_check, .mpo_vnode_check_exec = mac_veriexec_vnode_check_exec, .mpo_vnode_check_open = mac_veriexec_vnode_check_open, .mpo_vnode_check_setmode = mac_veriexec_vnode_check_setmode, From owner-svn-src-head@freebsd.org Fri May 17 18:13:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 821FB159C783; Fri, 17 May 2019 18:13:44 +0000 (UTC) (envelope-from stevek@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 2365E86B74; Fri, 17 May 2019 18:13:44 +0000 (UTC) (envelope-from stevek@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 EF03DC0E2; Fri, 17 May 2019 18:13:43 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4HIDhdK096404; Fri, 17 May 2019 18:13:43 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HIDhTC096403; Fri, 17 May 2019 18:13:43 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201905171813.x4HIDhTC096403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Fri, 17 May 2019 18:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347938 - head/sys/security/mac_veriexec X-SVN-Group: head X-SVN-Commit-Author: stevek X-SVN-Commit-Paths: head/sys/security/mac_veriexec X-SVN-Commit-Revision: 347938 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2365E86B74 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Fri, 17 May 2019 18:13:44 -0000 Author: stevek Date: Fri May 17 18:13:43 2019 New Revision: 347938 URL: https://svnweb.freebsd.org/changeset/base/347938 Log: Obtain a shared lock instead of exclusive in the MAC/veriexec MAC_VERIEXEC_CHECK_PATH_SYSCALL per-MAC policy system call. When we are checking the status of the fingerprint on a vnode using the per-MAC-policy syscall, we do not need an exclusive lock on the vnode. Even if there is more than one thread requesting the status at the same time, the worst we can end up doing is processing the file more than once. This can potentially be improved in the future with offloading the fingerprint evaluation to a separate thread and blocking until the update completes. But for now the race is acceptable. Obtained from: Juniper Networks, Inc. MFC after: 1 week Modified: head/sys/security/mac_veriexec/mac_veriexec.c Modified: head/sys/security/mac_veriexec/mac_veriexec.c ============================================================================== --- head/sys/security/mac_veriexec/mac_veriexec.c Fri May 17 18:10:11 2019 (r347937) +++ head/sys/security/mac_veriexec/mac_veriexec.c Fri May 17 18:13:43 2019 (r347938) @@ -697,7 +697,8 @@ cleanup_file: break; case MAC_VERIEXEC_CHECK_PATH_SYSCALL: /* Look up the path to get the vnode */ - NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, + NDINIT(&nd, LOOKUP, + FOLLOW | LOCKLEAF | LOCKSHARED | AUDITVNODE1, UIO_USERSPACE, arg, td); error = namei(&nd); if (error != 0) From owner-svn-src-head@freebsd.org Fri May 17 18:15:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A79AE159C896; Fri, 17 May 2019 18:15:48 +0000 (UTC) (envelope-from scottl@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 4A34A86CE5; Fri, 17 May 2019 18:15:48 +0000 (UTC) (envelope-from scottl@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 1F814C0E4; Fri, 17 May 2019 18:15:48 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4HIFlEH096548; Fri, 17 May 2019 18:15:47 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HIFlCN096547; Fri, 17 May 2019 18:15:47 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201905171815.x4HIFlCN096547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Fri, 17 May 2019 18:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347939 - head/sbin/nvmecontrol X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sbin/nvmecontrol X-SVN-Commit-Revision: 347939 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4A34A86CE5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; 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: Fri, 17 May 2019 18:15:48 -0000 Author: scottl Date: Fri May 17 18:15:47 2019 New Revision: 347939 URL: https://svnweb.freebsd.org/changeset/base/347939 Log: Better formatting for the logpage section Modified: head/sbin/nvmecontrol/nvmecontrol.8 Modified: head/sbin/nvmecontrol/nvmecontrol.8 ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.8 Fri May 17 18:13:43 2019 (r347938) +++ head/sbin/nvmecontrol/nvmecontrol.8 Fri May 17 18:15:47 2019 (r347939) @@ -114,12 +114,26 @@ high-speed storage devices over PCI Express. .Ss logpage The logpage command knows how to print log pages of various types. It also knows about vendor specific log pages from hgst/wdc and intel. -Page 0xc1 for hgst/wdc contains the advanced smart information about -the drive. -Page 0xc1 is read latency stats for intel. -Page 0xc2 is write latency stats for intel. -Page 0xc5 is temperature stats for intel. -Page 0xca is advanced smart information for intel. +Note that some vendors use the same log page numbers for different data. +.Pp +.Bl -tag -compact -width "Page 0x00" +.It Dv Page 0x01 +Drive Error Log +.It Dv Page 0x02 +Health/SMART Data +.It Dv Page 0x03 +Firmware Information +.It Dv Page 0xc1 +Advanced SMART information (WDC/HGST) +.It Dv Page 0xc1 +Read latency stats (Intel) +.It Dv Page 0xc2 +Wite latency stats (Intel) +.It Dv Page 0xc5 +Temperature stats (Intel) +.It Dv Page 0xca +Advanced SMART information (Intel) +.El .Pp Specifying .Fl p From owner-svn-src-head@freebsd.org Fri May 17 18:16:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28AC3159C934; Fri, 17 May 2019 18:16:56 +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 C167986E48; Fri, 17 May 2019 18:16: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 9B25DC0E5; Fri, 17 May 2019 18:16: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 x4HIGt7b096635; Fri, 17 May 2019 18:16:55 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HIGtER096634; Fri, 17 May 2019 18:16:55 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905171816.x4HIGtER096634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 17 May 2019 18:16:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347940 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 347940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C167986E48 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Fri, 17 May 2019 18:16:56 -0000 Author: brooks Date: Fri May 17 18:16:55 2019 New Revision: 347940 URL: https://svnweb.freebsd.org/changeset/base/347940 Log: Remove the notice that ae(4) will be removed in FreeBSD 13. Modified: head/share/man/man4/ae.4 Modified: head/share/man/man4/ae.4 ============================================================================== --- head/share/man/man4/ae.4 Fri May 17 18:15:47 2019 (r347939) +++ head/share/man/man4/ae.4 Fri May 17 18:16:55 2019 (r347940) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 24, 2018 +.Dd May 17, 2019 .Dt AE 4 .Os .Sh NAME @@ -44,14 +44,6 @@ module at boot time, place the following line in .Bd -literal -offset indent if_ae_load="YES" .Ed -.Sh DEPRECATION NOTICE -The -.Nm -driver is not present in -.Fx 13.0 -and later. -See https://github.com/freebsd/fcp/blob/master/fcp-0101.md for more -information. .Sh DESCRIPTION The .Nm From owner-svn-src-head@freebsd.org Fri May 17 18:25:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EEE0159CDE9; Fri, 17 May 2019 18:25:55 +0000 (UTC) (envelope-from stevek@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 B83848743B; Fri, 17 May 2019 18:25:54 +0000 (UTC) (envelope-from stevek@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 9101DC287; Fri, 17 May 2019 18:25:54 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4HIPsYc001968; Fri, 17 May 2019 18:25:54 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HIPsDJ001967; Fri, 17 May 2019 18:25:54 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201905171825.x4HIPsDJ001967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Fri, 17 May 2019 18:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347941 - head/sys/dev/veriexec X-SVN-Group: head X-SVN-Commit-Author: stevek X-SVN-Commit-Paths: head/sys/dev/veriexec X-SVN-Commit-Revision: 347941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B83848743B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Fri, 17 May 2019 18:25:55 -0000 Author: stevek Date: Fri May 17 18:25:53 2019 New Revision: 347941 URL: https://svnweb.freebsd.org/changeset/base/347941 Log: Add command to get version of the ioctl interface for the veriexec device. Obtained from: Juniper Networks, Inc. MFC after: 1 week Modified: head/sys/dev/veriexec/veriexec_ioctl.h head/sys/dev/veriexec/verified_exec.c Modified: head/sys/dev/veriexec/veriexec_ioctl.h ============================================================================== --- head/sys/dev/veriexec/veriexec_ioctl.h Fri May 17 18:16:55 2019 (r347940) +++ head/sys/dev/veriexec/veriexec_ioctl.h Fri May 17 18:25:53 2019 (r347941) @@ -1,7 +1,7 @@ /* * $FreeBSD$ * - * Copyright (c) 2011-2013, 2015, Juniper Networks, Inc. + * Copyright (c) 2011-2013, 2015, 2019, Juniper Networks, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -54,6 +54,7 @@ struct verified_exec_params { #define VERIEXEC_DEBUG_OFF _IO('S', 0x6) /* reset debug */ #define VERIEXEC_GETSTATE _IOR('S', 0x7, int) /* get state */ #define VERIEXEC_SIGNED_LOAD _IOW('S', 0x8, struct verified_exec_params) +#define VERIEXEC_GETVERSION _IOR('S', 0x9, int) /* get version */ #define _PATH_DEV_VERIEXEC _PATH_DEV "veriexec" Modified: head/sys/dev/veriexec/verified_exec.c ============================================================================== --- head/sys/dev/veriexec/verified_exec.c Fri May 17 18:16:55 2019 (r347940) +++ head/sys/dev/veriexec/verified_exec.c Fri May 17 18:25:53 2019 (r347941) @@ -138,6 +138,16 @@ verifiedexecioctl(struct cdev *dev __unused, u_long cm error = EINVAL; mtx_unlock(&ve_mutex); break; + case VERIEXEC_GETVERSION: + { + int *ip = (int *)data; + + if (ip) + *ip = MAC_VERIEXEC_VERSION; + else + error = EINVAL; + } + break; case VERIEXEC_LOCK: mtx_lock(&ve_mutex); mac_veriexec_set_state(VERIEXEC_STATE_LOCKED); From owner-svn-src-head@freebsd.org Fri May 17 19:27:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCA06159E21B; Fri, 17 May 2019 19:27:08 +0000 (UTC) (envelope-from stevek@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 6727B8921A; Fri, 17 May 2019 19:27:08 +0000 (UTC) (envelope-from stevek@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 41DC2CCB9; Fri, 17 May 2019 19:27:08 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4HJR8bo033633; Fri, 17 May 2019 19:27:08 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HJR76V033628; Fri, 17 May 2019 19:27:07 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201905171927.x4HJR76V033628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Fri, 17 May 2019 19:27:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347942 - in head/sys: dev/veriexec security/mac_veriexec X-SVN-Group: head X-SVN-Commit-Author: stevek X-SVN-Commit-Paths: in head/sys: dev/veriexec security/mac_veriexec X-SVN-Commit-Revision: 347942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6727B8921A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 19:27:09 -0000 Author: stevek Date: Fri May 17 19:27:07 2019 New Revision: 347942 URL: https://svnweb.freebsd.org/changeset/base/347942 Log: Add a new ioctl for the larger params struct that includes the label. We need to make the find_veriexec_file() function available publicly, so rename it to mac_veriexec_metadata_find_file_info() and make it non-static. Bump the version of the veriexec device interface so user space will know the labelized version of fingerprint loading is available. Approved by: sjg Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D20295 Modified: head/sys/dev/veriexec/veriexec_ioctl.h head/sys/dev/veriexec/verified_exec.c head/sys/security/mac_veriexec/mac_veriexec.h head/sys/security/mac_veriexec/mac_veriexec_internal.h head/sys/security/mac_veriexec/veriexec_metadata.c Modified: head/sys/dev/veriexec/veriexec_ioctl.h ============================================================================== --- head/sys/dev/veriexec/veriexec_ioctl.h Fri May 17 18:25:53 2019 (r347941) +++ head/sys/dev/veriexec/veriexec_ioctl.h Fri May 17 19:27:07 2019 (r347942) @@ -46,6 +46,11 @@ struct verified_exec_params { unsigned char fingerprint[MAXFINGERPRINTLEN]; }; +struct verified_exec_label_params { + struct verified_exec_params params; + char label[MAXLABELLEN]; +}; + #define VERIEXEC_LOAD _IOW('S', 0x1, struct verified_exec_params) #define VERIEXEC_ACTIVE _IO('S', 0x2) /* start checking */ #define VERIEXEC_ENFORCE _IO('S', 0x3) /* fail exec */ @@ -55,6 +60,7 @@ struct verified_exec_params { #define VERIEXEC_GETSTATE _IOR('S', 0x7, int) /* get state */ #define VERIEXEC_SIGNED_LOAD _IOW('S', 0x8, struct verified_exec_params) #define VERIEXEC_GETVERSION _IOR('S', 0x9, int) /* get version */ +#define VERIEXEC_LABEL_LOAD _IOW('S', 0xa, struct verified_exec_label_params) #define _PATH_DEV_VERIEXEC _PATH_DEV "veriexec" Modified: head/sys/dev/veriexec/verified_exec.c ============================================================================== --- head/sys/dev/veriexec/verified_exec.c Fri May 17 18:25:53 2019 (r347941) +++ head/sys/dev/veriexec/verified_exec.c Fri May 17 19:27:07 2019 (r347942) @@ -68,6 +68,7 @@ verifiedexecioctl(struct cdev *dev __unused, u_long cm { struct nameidata nid; struct vattr vattr; + struct verified_exec_label_params *lparams; struct verified_exec_params *params; int error = 0; @@ -102,7 +103,12 @@ verifiedexecioctl(struct cdev *dev __unused, u_long cm if (error) return (error); - params = (struct verified_exec_params *)data; + lparams = (struct verified_exec_label_params *)data; + if (cmd == VERIEXEC_LABEL_LOAD) + params = &lparams->params; + else + params = (struct verified_exec_params *)data; + switch (cmd) { case VERIEXEC_ACTIVE: mtx_lock(&ve_mutex); @@ -158,6 +164,7 @@ verifiedexecioctl(struct cdev *dev __unused, u_long cm return (EPERM); /* no updates when secure */ /* FALLTHROUGH */ + case VERIEXEC_LABEL_LOAD: case VERIEXEC_SIGNED_LOAD: /* * If we use a loader that will only use a @@ -176,8 +183,9 @@ verifiedexecioctl(struct cdev *dev __unused, u_long cm if (mac_veriexec_in_state(VERIEXEC_STATE_LOCKED)) error = EPERM; else { + size_t labellen = 0; int flags = FREAD; - int override = (cmd == VERIEXEC_SIGNED_LOAD); + int override = (cmd != VERIEXEC_LOAD); /* * Get the attributes for the file name passed @@ -221,13 +229,18 @@ verifiedexecioctl(struct cdev *dev __unused, u_long cm FINGERPRINT_INVALID); VOP_UNLOCK(nid.ni_vp, 0); (void) vn_close(nid.ni_vp, FREAD, td->td_ucred, td); + if (params->flags & VERIEXEC_LABEL) + labellen = strnlen(lparams->label, + sizeof(lparams->label) - 1) + 1; mtx_lock(&ve_mutex); error = mac_veriexec_metadata_add_file( ((params->flags & VERIEXEC_FILE) != 0), vattr.va_fsid, vattr.va_fileid, vattr.va_gen, - params->fingerprint, params->flags, - params->fp_type, override); + params->fingerprint, + (params->flags & VERIEXEC_LABEL) ? + lparams->label : NULL, labellen, + params->flags, params->fp_type, override); mac_veriexec_set_state(VERIEXEC_STATE_LOADED); mtx_unlock(&ve_mutex); Modified: head/sys/security/mac_veriexec/mac_veriexec.h ============================================================================== --- head/sys/security/mac_veriexec/mac_veriexec.h Fri May 17 18:25:53 2019 (r347941) +++ head/sys/security/mac_veriexec/mac_veriexec.h Fri May 17 19:27:07 2019 (r347942) @@ -1,7 +1,7 @@ /* * $FreeBSD$ * - * Copyright (c) 2011, 2012, 2013, 2015, 2016, Juniper Networks, Inc. + * Copyright (c) 2011, 2012, 2013, 2015, 2016, 2019, Juniper Networks, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -49,6 +49,7 @@ * Enough room for the largest signature... */ #define MAXFINGERPRINTLEN 64 /* enough room for largest signature */ +#define MAXLABELLEN 128 /* * Types of veriexec inodes we can have @@ -57,8 +58,8 @@ #define VERIEXEC_FILE (1<<1) /* Fingerprint of a plain file */ #define VERIEXEC_NOTRACE (1<<2) /**< PTRACE not allowed */ #define VERIEXEC_TRUSTED (1<<3) /**< Safe to write /dev/mem */ -/* XXX these are currently unimplemented */ #define VERIEXEC_NOFIPS (1<<4) /**< Not allowed in FIPS mode */ +#define VERIEXEC_LABEL (1<<5) /**< We have a label */ #define VERIEXEC_STATE_INACTIVE 0 /**< Ignore */ #define VERIEXEC_STATE_LOADED (1<<0) /**< Sigs have been loaded */ @@ -71,7 +72,7 @@ /** * Version of the MAC/veriexec module */ -#define MAC_VERIEXEC_VERSION 1 +#define MAC_VERIEXEC_VERSION 2 /* Valid states for the fingerprint flag - if signed exec is being used */ typedef enum fingerprint_status { @@ -152,7 +153,8 @@ int mac_veriexec_fingerprint_modevent(module_t mod, in */ int mac_veriexec_metadata_add_file(int file_dev, dev_t fsid, long fileid, unsigned long gen, unsigned char fingerprint[MAXFINGERPRINTLEN], - int flags, const char *fp_type, int override); + char *label, size_t labellen, int flags, const char *fp_type, + int override); int mac_veriexec_metadata_has_file(dev_t fsid, long fileid, unsigned long gen); int mac_veriexec_proc_is_trusted(struct ucred *cred, struct proc *p); Modified: head/sys/security/mac_veriexec/mac_veriexec_internal.h ============================================================================== --- head/sys/security/mac_veriexec/mac_veriexec_internal.h Fri May 17 18:25:53 2019 (r347941) +++ head/sys/security/mac_veriexec/mac_veriexec_internal.h Fri May 17 19:27:07 2019 (r347942) @@ -1,7 +1,7 @@ /* * $FreeBSD$ * - * Copyright (c) 2011, 2012, 2013, 2015, 2016, Juniper Networks, Inc. + * Copyright (c) 2011, 2012, 2013, 2015, 2016, 2019, Juniper Networks, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -54,6 +54,8 @@ struct mac_veriexec_file_info unsigned long gen; struct mac_veriexec_fpops *ops; unsigned char fingerprint[MAXFINGERPRINTLEN]; + char *label; + size_t labellen; LIST_ENTRY(mac_veriexec_file_info) entries; }; @@ -76,6 +78,9 @@ int mac_veriexec_metadata_get_executable_flags(struct struct proc *p, int *flags, int check_files); int mac_veriexec_metadata_get_file_flags(dev_t fsid, long fileid, unsigned long gen, int *flags, int check_files); +struct mac_veriexec_file_info * + mac_veriexec_metadata_get_file_info(dev_t fsid, long fileid, + unsigned long gen, int *found_dev, int check_files); void mac_veriexec_metadata_init(void); void mac_veriexec_metadata_print_db(struct sbuf *sbp); int mac_veriexec_metadata_unmounted(dev_t fsid, struct thread *td); Modified: head/sys/security/mac_veriexec/veriexec_metadata.c ============================================================================== --- head/sys/security/mac_veriexec/veriexec_metadata.c Fri May 17 18:25:53 2019 (r347941) +++ head/sys/security/mac_veriexec/veriexec_metadata.c Fri May 17 19:27:07 2019 (r347942) @@ -1,7 +1,7 @@ /* * $FreeBSD$ * - * Copyright (c) 2011, 2012, 2013, 2015, 2016, Juniper Networks, Inc. + * Copyright (c) 2011, 2012, 2013, 2015, 2016, 2019, Juniper Networks, Inc. * All rights reserved. * * Originally derived from: @@ -138,6 +138,8 @@ get_veriexec_file(struct veriexec_devhead *head, dev_t break; /* we need to garbage collect */ LIST_REMOVE(ip, entries); + if (ip->label) + free(ip->label, M_VERIEXEC); free(ip, M_VERIEXEC); } } @@ -152,48 +154,6 @@ get_veriexec_file(struct veriexec_devhead *head, dev_t /** * @internal - * @brief Search the meta-data store for information on the specified file. - * - * @param fsid file system identifier to look for - * @param fileid file to look for - * @param gen generation of file - * @param found_dev indicator that an entry for the file system was found - * @param check_files if 1, check the files list first, otherwise check the - * exectuables list first - * - * @return A pointer to the meta-data inforation if meta-data exists for - * the specified file identifier, otherwise @c NULL - */ -static struct mac_veriexec_file_info * -find_veriexec_file(dev_t fsid, long fileid, unsigned long gen, int *found_dev, - int check_files) -{ - struct veriexec_devhead *search[3]; - struct mac_veriexec_file_info *ip; - int x; - - /* Determine the order of the lists to search */ - if (check_files) { - search[0] = &veriexec_file_dev_head; - search[1] = &veriexec_dev_head; - } else { - search[0] = &veriexec_dev_head; - search[1] = &veriexec_file_dev_head; - } - search[2] = NULL; - - VERIEXEC_DEBUG(3, ("%s: searching for dev %ju, file %lu\n", - __func__, (uintmax_t)fsid, fileid)); - - /* Search for the specified file */ - for (ip = NULL, x = 0; ip == NULL && search[x]; x++) - ip = get_veriexec_file(search[x], fsid, fileid, gen, found_dev); - - return (ip); -} - -/** - * @internal * @brief Display the fingerprint for each entry in the device list * * @param sbp sbuf to write output to @@ -270,7 +230,7 @@ int mac_veriexec_metadata_has_file(dev_t fsid, long fileid, unsigned long gen) { - return (find_veriexec_file(fsid, fileid, gen, NULL, + return (mac_veriexec_metadata_get_file_info(fsid, fileid, gen, NULL, VERIEXEC_FILES_FIRST) != NULL); } @@ -312,6 +272,8 @@ free_veriexec_dev(dev_t fsid, struct veriexec_devhead for (ip = LIST_FIRST(&(lp->file_head)); ip != NULL; ip = nip) { nip = LIST_NEXT(ip, entries); LIST_REMOVE(ip, entries); + if (ip->label) + free(ip->label, M_VERIEXEC); free(ip, M_VERIEXEC); } @@ -393,6 +355,38 @@ search: } /** + * @internal + * @brief Allocate and initialize label record with the provided data. + * + * @param labelp Location to store the initialized label + * @param src Pointer to label string to copy + * @param srclen Length of label string to copy + * + * @return Length of resulting label + * + * @note Called with ve_mutex locked. + */ +static size_t +mac_veriexec_init_label(char **labelp, size_t labellen, char *src, + size_t srclen) +{ + char *label; + + label = *labelp; + if (labellen < srclen) { + mtx_unlock(&ve_mutex); + if (label != NULL) + free(label, M_VERIEXEC); + label = malloc(srclen, M_VERIEXEC, M_WAITOK); + mtx_lock(&ve_mutex); + labellen = srclen; + *labelp = label; + } + memcpy(label, src, srclen); + return labellen; +} + +/** * @brief When a device is unmounted, we want to toss the signatures recorded * against it. * @@ -446,7 +440,8 @@ mac_veriexec_metadata_get_file_flags(dev_t fsid, long struct mac_veriexec_file_info *ip; int found_dev; - ip = find_veriexec_file(fsid, fileid, gen, &found_dev, check_files); + ip = mac_veriexec_metadata_get_file_info(fsid, fileid, gen, &found_dev, + check_files); if (ip == NULL) return (ENOENT); @@ -518,8 +513,8 @@ mac_veriexec_metadata_fetch_fingerprint_status(struct status = mac_veriexec_get_fingerprint_status(vp); if (status == FINGERPRINT_INVALID || status == FINGERPRINT_NODEV) { found_dev = 0; - ip = find_veriexec_file(vap->va_fsid, vap->va_fileid, - vap->va_gen, &found_dev, check_files); + ip = mac_veriexec_metadata_get_file_info(vap->va_fsid, + vap->va_fileid, vap->va_gen, &found_dev, check_files); if (ip == NULL) { status = (found_dev) ? FINGERPRINT_NOENTRY : FINGERPRINT_NODEV; @@ -611,7 +606,7 @@ mac_veriexec_metadata_fetch_fingerprint_status(struct int mac_veriexec_metadata_add_file(int file_dev, dev_t fsid, long fileid, unsigned long gen, unsigned char fingerprint[MAXFINGERPRINTLEN], - int flags, const char *fp_type, int override) + char *label, size_t labellen, int flags, const char *fp_type, int override) { struct mac_veriexec_fpops *fpops; struct veriexec_dev_list *lp; @@ -619,6 +614,10 @@ mac_veriexec_metadata_add_file(int file_dev, dev_t fsi struct mac_veriexec_file_info *ip; struct mac_veriexec_file_info *np = NULL; + /* Label and labellen must be set if VERIEXEC_LABEL is set */ + if ((flags & VERIEXEC_LABEL) != 0 && (label == NULL || labellen == 0)) + return (EINVAL); + /* Look up the device entry */ if (file_dev) head = &veriexec_file_dev_head; @@ -652,6 +651,15 @@ search: ip->ops = fpops; memcpy(ip->fingerprint, fingerprint, fpops->digest_len); + if (flags & VERIEXEC_LABEL) { + ip->labellen = mac_veriexec_init_label( + &ip->label, ip->labellen, label, + labellen); + } else if (ip->labellen > 0) { + free(ip->label, M_VERIEXEC); + ip->labellen = 0; + ip->label = NULL; + } } else if ((flags & (VERIEXEC_INDIRECT|VERIEXEC_FILE))) ip->flags |= flags; @@ -697,6 +705,13 @@ search: ip->fileid = fileid; ip->gen = gen; memcpy(ip->fingerprint, fingerprint, fpops->digest_len); + if (flags & VERIEXEC_LABEL) + ip->labellen = mac_veriexec_init_label(&ip->label, + ip->labellen, label, labellen); + else { + ip->label = NULL; + ip->labellen = 0; + } VERIEXEC_DEBUG(3, ("add file %ju.%lu (files=%d)\n", (uintmax_t)ip->fileid, @@ -716,6 +731,48 @@ search: #endif return (0); } + +/** + * @brief Search the meta-data store for information on the specified file. + * + * @param fsid file system identifier to look for + * @param fileid file to look for + * @param gen generation of file + * @param found_dev indicator that an entry for the file system was found + * @param check_files if 1, check the files list first, otherwise check the + * exectuables list first + * + * @return A pointer to the meta-data inforation if meta-data exists for + * the specified file identifier, otherwise @c NULL + */ +struct mac_veriexec_file_info * +mac_veriexec_metadata_get_file_info(dev_t fsid, long fileid, unsigned long gen, + int *found_dev, int check_files) +{ + struct veriexec_devhead *search[3]; + struct mac_veriexec_file_info *ip; + int x; + + /* Determine the order of the lists to search */ + if (check_files) { + search[0] = &veriexec_file_dev_head; + search[1] = &veriexec_dev_head; + } else { + search[0] = &veriexec_dev_head; + search[1] = &veriexec_file_dev_head; + } + search[2] = NULL; + + VERIEXEC_DEBUG(3, ("%s: searching for dev %ju, file %lu\n", + __func__, (uintmax_t)fsid, fileid)); + + /* Search for the specified file */ + for (ip = NULL, x = 0; ip == NULL && search[x]; x++) + ip = get_veriexec_file(search[x], fsid, fileid, gen, found_dev); + + return (ip); +} + /** * @brief Intialize the meta-data store From owner-svn-src-head@freebsd.org Fri May 17 19:57:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1D4A159EB25; Fri, 17 May 2019 19:57:09 +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 88C3C8A0FC; Fri, 17 May 2019 19:57:09 +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 54DA9D1C3; Fri, 17 May 2019 19:57:09 +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 x4HJv9hM049478; Fri, 17 May 2019 19:57:09 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HJv9jw049477; Fri, 17 May 2019 19:57:09 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905171957.x4HJv9jw049477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 17 May 2019 19:57:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347943 - head/sys/cddl/dev/dtrace/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/cddl/dev/dtrace/powerpc X-SVN-Commit-Revision: 347943 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 88C3C8A0FC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Fri, 17 May 2019 19:57:10 -0000 Author: jhibbits Date: Fri May 17 19:57:08 2019 New Revision: 347943 URL: https://svnweb.freebsd.org/changeset/base/347943 Log: powerpc/dtrace: Actually fix stack traces Fix stack unwinding such that requesting N stack frames in lockstat will actually give you N frames, not anywhere from 0-3 as had been before. lockstat prints the mutex function instead of the caller as the reported locker, but the stack frame is detailed enough to find the real caller. MFC after: 2 weeks Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S ============================================================================== --- head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S Fri May 17 19:27:07 2019 (r347942) +++ head/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S Fri May 17 19:57:08 2019 (r347943) @@ -179,3 +179,13 @@ ASENTRY_NOPROF(dtrace_caller) li %r3, -1 blr END(dtrace_caller) + +/* +greg_t +dtrace_getfp(void) +*/ +ASENTRY_NOPROF(dtrace_getfp) + mr %r3,%r31 + blr +END(dtrace_getfp) + Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c ============================================================================== --- head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c Fri May 17 19:27:07 2019 (r347942) +++ head/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c Fri May 17 19:57:08 2019 (r347943) @@ -61,8 +61,10 @@ #define FRAME_OFFSET 8 #endif -#define INKERNEL(x) ((x) <= VM_MAX_KERNEL_ADDRESS && \ - (x) >= VM_MIN_KERNEL_ADDRESS) +#define INKERNEL(x) (((x) <= VM_MAX_KERNEL_ADDRESS && \ + (x) >= VM_MIN_KERNEL_ADDRESS) || \ + (PMAP_HAS_DMAP && (x) >= DMAP_BASE_ADDRESS && \ + (x) <= DMAP_MAX_ADDRESS)) static __inline int dtrace_sp_inkernel(uintptr_t sp) @@ -70,6 +72,9 @@ dtrace_sp_inkernel(uintptr_t sp) struct trapframe *frame; vm_offset_t callpc; + /* Not within the kernel, or not aligned. */ + if (!INKERNEL(sp) || (sp & 0xf) != 0) + return (0); #ifdef __powerpc64__ callpc = *(vm_offset_t *)(sp + RETURN_OFFSET64); #else @@ -84,8 +89,6 @@ dtrace_sp_inkernel(uintptr_t sp) */ if (callpc + OFFSET == (vm_offset_t) &trapexit || callpc + OFFSET == (vm_offset_t) &asttrapexit) { - if (sp == 0) - return (0); frame = (struct trapframe *)(sp + FRAME_OFFSET); return ((frame->srr1 & PSL_PR) == 0); @@ -119,6 +122,7 @@ dtrace_next_sp_pc(uintptr_t sp, uintptr_t *nsp, uintpt *nsp = frame->fixreg[1]; if (pc != NULL) *pc = frame->srr0; + return; } if (nsp != NULL) @@ -127,12 +131,6 @@ dtrace_next_sp_pc(uintptr_t sp, uintptr_t *nsp, uintpt *pc = callpc; } -greg_t -dtrace_getfp(void) -{ - return (greg_t)__builtin_frame_address(0); -} - void dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, uint32_t *intrpc) @@ -148,7 +146,7 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, in aframes++; - sp = dtrace_getfp(); + sp = (uintptr_t)__builtin_frame_address(0); while (depth < pcstack_limit) { if (sp <= osp) @@ -418,7 +416,7 @@ uint64_t dtrace_getarg(int arg, int aframes) { uintptr_t val; - uintptr_t *fp = (uintptr_t *)dtrace_getfp(); + uintptr_t *fp = (uintptr_t *)__builtin_frame_address(0); uintptr_t *stack; int i; @@ -432,8 +430,8 @@ dtrace_getarg(int arg, int aframes) fp = (uintptr_t *)*fp; /* - * On ppc32 AIM, and booke, trapexit() is the immediately following - * label. On ppc64 AIM trapexit() follows a nop. + * On ppc32 trapexit() is the immediately following label. On + * ppc64 AIM trapexit() follows a nop. */ #ifdef __powerpc64__ if ((long)(fp[2]) + 4 == (long)trapexit) { @@ -506,9 +504,7 @@ dtrace_getstackdepth(int aframes) vm_offset_t callpc; osp = PAGE_SIZE; - aframes++; - sp = dtrace_getfp(); - depth++; + sp = (uintptr_t)__builtin_frame_address(0); for(;;) { if (sp <= osp) break; @@ -516,17 +512,14 @@ dtrace_getstackdepth(int aframes) if (!dtrace_sp_inkernel(sp)) break; - if (aframes == 0) - depth++; - else - aframes--; + depth++; osp = sp; dtrace_next_sp_pc(sp, &sp, NULL); } if (depth < aframes) return (0); - return (depth); + return (depth - aframes); } ulong_t From owner-svn-src-head@freebsd.org Fri May 17 20:29:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41BE2159F2A9; Fri, 17 May 2019 20:29:32 +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 D69AF8AED2; Fri, 17 May 2019 20:29:31 +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 9604BD6C1; Fri, 17 May 2019 20:29:31 +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 x4HKTVHD065335; Fri, 17 May 2019 20:29:31 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HKTVNx065334; Fri, 17 May 2019 20:29:31 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201905172029.x4HKTVNx065334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Fri, 17 May 2019 20:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347944 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 347944 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D69AF8AED2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Fri, 17 May 2019 20:29:32 -0000 Author: vmaffione Date: Fri May 17 20:29:31 2019 New Revision: 347944 URL: https://svnweb.freebsd.org/changeset/base/347944 Log: netmap: align if_ptnet to the changes introduced by r347233 This removes non-functional SCTP checksum offload support. More information in the log message of r347233. MFC after: 2 weeks Modified: head/sys/dev/netmap/if_ptnet.c Modified: head/sys/dev/netmap/if_ptnet.c ============================================================================== --- head/sys/dev/netmap/if_ptnet.c Fri May 17 19:57:08 2019 (r347943) +++ head/sys/dev/netmap/if_ptnet.c Fri May 17 20:29:31 2019 (r347944) @@ -68,7 +68,6 @@ #include #include #include -#include #include #include @@ -281,9 +280,8 @@ static inline void ptnet_kick(struct ptnet_queue *pq) #define PTNET_HDR_SIZE sizeof(struct virtio_net_hdr_mrg_rxbuf) #define PTNET_MAX_PKT_SIZE 65536 -#define PTNET_CSUM_OFFLOAD (CSUM_TCP | CSUM_UDP | CSUM_SCTP) -#define PTNET_CSUM_OFFLOAD_IPV6 (CSUM_TCP_IPV6 | CSUM_UDP_IPV6 |\ - CSUM_SCTP_IPV6) +#define PTNET_CSUM_OFFLOAD (CSUM_TCP | CSUM_UDP) +#define PTNET_CSUM_OFFLOAD_IPV6 (CSUM_TCP_IPV6 | CSUM_UDP_IPV6) #define PTNET_ALL_OFFLOAD (CSUM_TSO | PTNET_CSUM_OFFLOAD |\ PTNET_CSUM_OFFLOAD_IPV6) @@ -1539,9 +1537,6 @@ ptnet_rx_csum_by_offset(struct mbuf *m, uint16_t eth_t m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | CSUM_PSEUDO_HDR; m->m_pkthdr.csum_data = 0xFFFF; break; - case offsetof(struct sctphdr, checksum): - m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; - break; default: /* Here we should increment the rx_csum_bad_offset counter. */ return (1); @@ -1595,11 +1590,6 @@ ptnet_rx_csum_by_parse(struct mbuf *m, uint16_t eth_ty return (1); m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | CSUM_PSEUDO_HDR; m->m_pkthdr.csum_data = 0xFFFF; - break; - case IPPROTO_SCTP: - if (__predict_false(m->m_len < offset + sizeof(struct sctphdr))) - return (1); - m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; break; default: /* From owner-svn-src-head@freebsd.org Fri May 17 21:18:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2D9415A02F3; Fri, 17 May 2019 21:18:12 +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 861778C511; Fri, 17 May 2019 21:18:12 +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 6158CDF2B; Fri, 17 May 2019 21:18:12 +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 x4HLICTL091289; Fri, 17 May 2019 21:18:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4HLIC4N091288; Fri, 17 May 2019 21:18:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905172118.x4HLIC4N091288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 17 May 2019 21:18:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347946 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 861778C511 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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: Fri, 17 May 2019 21:18:13 -0000 Author: kib Date: Fri May 17 21:18:11 2019 New Revision: 347946 URL: https://svnweb.freebsd.org/changeset/base/347946 Log: Grammar fixes for r347690. Submitted by: alc MFC after: 3 days Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Fri May 17 20:59:59 2019 (r347945) +++ head/sys/kern/imgact_elf.c Fri May 17 21:18:11 2019 (r347946) @@ -936,13 +936,13 @@ __elfN(get_interp)(struct image_params *imgp, const El if (phdr->p_offset > PAGE_SIZE || interp_name_len > PAGE_SIZE - phdr->p_offset) { /* - * The vnode lock might be needed by pagedaemon to + * The vnode lock might be needed by the pagedaemon to * clean pages owned by the vnode. Do not allow sleep * waiting for memory with the vnode locked, instead * try non-sleepable allocation first, and if it * fails, go to the slow path were we drop the lock - * and do M_WAITOK. Text reference prevents - * modifications of the vnode content. + * and do M_WAITOK. A text reference prevents + * modifications to the vnode content. */ interp = malloc(interp_name_len + 1, M_TEMP, M_NOWAIT); if (interp == NULL) { From owner-svn-src-head@freebsd.org Sat May 18 00:22:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D0B315A3529; Sat, 18 May 2019 00:22:29 +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 0307390A63; Sat, 18 May 2019 00:22:29 +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 D0D61FF00; Sat, 18 May 2019 00:22:28 +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 x4I0MSPp090125; Sat, 18 May 2019 00:22:28 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4I0MSPk090123; Sat, 18 May 2019 00:22:28 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905180022.x4I0MSPk090123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 18 May 2019 00:22:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347948 - in head: sbin/fdisk sys/sys/disk X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: sbin/fdisk sys/sys/disk X-SVN-Commit-Revision: 347948 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0307390A63 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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, 18 May 2019 00:22:29 -0000 Author: cem Date: Sat May 18 00:22:28 2019 New Revision: 347948 URL: https://svnweb.freebsd.org/changeset/base/347948 Log: Add DragonFly's partition number to fdisk(8) and diskmbr.h This change doesn't make any attempt to add support for these slices to the relevent GEOM classes. Just register the number in fdisk and the canonical list of kernel macros (diskmbr.h). Obtained from: DragonFlyBSD (794d80aa519b394b3174f20776a) (small subset of) Modified: head/sbin/fdisk/fdisk.c head/sys/sys/disk/mbr.h Modified: head/sbin/fdisk/fdisk.c ============================================================================== --- head/sbin/fdisk/fdisk.c Fri May 17 22:14:30 2019 (r347947) +++ head/sbin/fdisk/fdisk.c Sat May 18 00:22:28 2019 (r347948) @@ -175,6 +175,7 @@ static const char *const part_types[256] = { [0x63] = "System V/386 (such as ISC UNIX), GNU HURD or Mach", [0x64] = "Novell Netware/286 2.xx", [0x65] = "Novell Netware/386 3.xx", + [0x6C] = "DragonFlyBSD", [0x70] = "DiskSecure Multi-Boot", [0x75] = "PCIX", [0x77] = "QNX4.x", Modified: head/sys/sys/disk/mbr.h ============================================================================== --- head/sys/sys/disk/mbr.h Fri May 17 22:14:30 2019 (r347947) +++ head/sys/sys/disk/mbr.h Sat May 18 00:22:28 2019 (r347948) @@ -50,6 +50,7 @@ #define DOSPTYP_EXTLBA 0x0f /* DOS extended partition */ #define DOSPTYP_PPCBOOT 0x41 /* PReP/CHRP boot partition */ #define DOSPTYP_LDM 0x42 /* Win2k dynamic extended partition */ +#define DOSPTYP_DFLYBSD 0x6c /* DragonFlyBSD partition type */ #define DOSPTYP_LINSWP 0x82 /* Linux swap partition */ #define DOSPTYP_LINUX 0x83 /* Linux partition */ #define DOSPTYP_LINLVM 0x8e /* Linux LVM partition */ From owner-svn-src-head@freebsd.org Sat May 18 00:25:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F31915A3897; Sat, 18 May 2019 00:25:17 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (cross.sbone.de [195.201.62.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D6F0C90CC0; Sat, 18 May 2019 00:25:16 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 2B0C18D4A422; Sat, 18 May 2019 00:25:08 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 1F320E707C1; Sat, 18 May 2019 00:25:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id cVxVFbzKRpGr; Sat, 18 May 2019 00:25:05 +0000 (UTC) Received: from [10.13.230.113] (fresh-ayiya.sbone.de [IPv6:fde9:577b:c1a9:f001::2]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 07229E707C0; Sat, 18 May 2019 00:25:04 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Brooks Davis" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347911 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/ed sys/i386/conf sys/modules sys/modules/ed Date: Sat, 18 May 2019 00:25:01 +0000 X-Mailer: MailMate (2.0BETAr6137) Message-ID: <128DF459-0C14-460B-8AEC-067F24667884@lists.zabbadoz.net> In-Reply-To: <201905171523.x4HFN2Pw005854@repo.freebsd.org> References: <201905171523.x4HFN2Pw005854@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Rspamd-Queue-Id: D6F0C90CC0 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.969,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, 18 May 2019 00:25:17 -0000 On 17 May 2019, at 15:23, Brooks Davis wrote: > Author: brooks > Date: Fri May 17 15:23:02 2019 > New Revision: 347911 > URL: https://svnweb.freebsd.org/changeset/base/347911 > > Log: > FCP-101: Remove ed(4). can you please also change the samples in the default rc.conf file which uses ed0? Thanks, /bz From owner-svn-src-head@freebsd.org Sat May 18 01:46:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FCE315A4FBB; Sat, 18 May 2019 01:46:40 +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 0AC2A92C1D; Sat, 18 May 2019 01:46:40 +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 CBA1418C74; Sat, 18 May 2019 01:46:39 +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 x4I1kdCV032193; Sat, 18 May 2019 01:46:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4I1kdqJ032191; Sat, 18 May 2019 01:46:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905180146.x4I1kdqJ032191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 18 May 2019 01:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347949 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 347949 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0AC2A92C1D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Sat, 18 May 2019 01:46:40 -0000 Author: markj Date: Sat May 18 01:46:38 2019 New Revision: 347949 URL: https://svnweb.freebsd.org/changeset/base/347949 Log: Implement the M_NEXTFIT allocation strategy for vmem(9). This is described in the vmem paper: "directs vmem to use the next free segment after the one previously allocated." The implementation adds a new boundary tag type, M_CURSOR, which is linked into the segment list and precedes the segment following the previous M_NEXTFIT allocation. The cursor is used to locate the next free segment satisfying the allocation constraints. This implementation isn't O(1) since busy tags aren't coalesced, and we may potentially scan the entire segment list during an M_NEXTFIT allocation. Reviewed by: alc MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D17226 Modified: head/share/man/man9/vmem.9 head/sys/kern/subr_vmem.c head/sys/sys/malloc.h Modified: head/share/man/man9/vmem.9 ============================================================================== --- head/share/man/man9/vmem.9 Sat May 18 00:22:28 2019 (r347948) +++ head/share/man/man9/vmem.9 Sat May 18 01:46:38 2019 (r347949) @@ -27,7 +27,7 @@ .\" $FreeBSD$ .\" .\" ------------------------------------------------------------ -.Dd July 12, 2013 +.Dd May 17, 2019 .Dt VMEM 9 .Os .\" ------------------------------------------------------------ @@ -95,18 +95,9 @@ The smallest unit of allocation. The largest size of allocations which can be served by quantum cache. It is merely a hint and can be ignored. .It Fa flags -Combination of .Xr malloc 9 -wait flag and -.Nm -allocation strategy flag: -.Bl -tag -width M_FIRSTFIT -.It Dv M_FIRSTFIT -Prefer allocation performance. -.It Dv M_BESTFIT -Prefer space efficiency. +wait flag. .El -.El .Pp .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .Fn vmem_add @@ -169,10 +160,16 @@ if the caller does not care. A bitwise OR of an allocation strategy and a .Xr malloc 9 wait flag. -The allocation strategy is one of -.Dv M_FIRSTFIT -and -.Dv M_BESTFIT . +The allocation strategy is one of: +.Bl -tag width indent +.It Dv M_FIRSTFIT +Prefer allocation performance. +.It Dv M_BESTFIT +Prefer space efficiency. +.It Dv M_NEXTFIT +Perform an address-ordered search for free addresses, beginning where +the previous search ended. +.El .It Fa addrp On success, if .Fa addrp Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Sat May 18 00:22:28 2019 (r347948) +++ head/sys/kern/subr_vmem.c Sat May 18 01:46:38 2019 (r347949) @@ -89,10 +89,10 @@ int vmem_startup_count(void); #define VMEM_QCACHE_IDX_MAX 16 -#define VMEM_FITMASK (M_BESTFIT | M_FIRSTFIT) +#define VMEM_FITMASK (M_BESTFIT | M_FIRSTFIT | M_NEXTFIT) -#define VMEM_FLAGS \ - (M_NOWAIT | M_WAITOK | M_USE_RESERVE | M_NOVM | M_BESTFIT | M_FIRSTFIT) +#define VMEM_FLAGS (M_NOWAIT | M_WAITOK | M_USE_RESERVE | M_NOVM | \ + M_BESTFIT | M_FIRSTFIT | M_NEXTFIT) #define BT_FLAGS (M_NOWAIT | M_WAITOK | M_USE_RESERVE | M_NOVM) @@ -120,6 +120,20 @@ typedef struct qcache qcache_t; #define VMEM_NAME_MAX 16 +/* boundary tag */ +struct vmem_btag { + TAILQ_ENTRY(vmem_btag) bt_seglist; + union { + LIST_ENTRY(vmem_btag) u_freelist; /* BT_TYPE_FREE */ + LIST_ENTRY(vmem_btag) u_hashlist; /* BT_TYPE_BUSY */ + } bt_u; +#define bt_hashlist bt_u.u_hashlist +#define bt_freelist bt_u.u_freelist + vmem_addr_t bt_start; + vmem_size_t bt_size; + int bt_type; +}; + /* vmem arena */ struct vmem { struct mtx_padalign vm_lock; @@ -145,6 +159,7 @@ struct vmem { vmem_size_t vm_inuse; vmem_size_t vm_size; vmem_size_t vm_limit; + struct vmem_btag vm_cursor; /* Used on import. */ vmem_import_t *vm_importfn; @@ -158,24 +173,11 @@ struct vmem { qcache_t vm_qcache[VMEM_QCACHE_IDX_MAX]; }; -/* boundary tag */ -struct vmem_btag { - TAILQ_ENTRY(vmem_btag) bt_seglist; - union { - LIST_ENTRY(vmem_btag) u_freelist; /* BT_TYPE_FREE */ - LIST_ENTRY(vmem_btag) u_hashlist; /* BT_TYPE_BUSY */ - } bt_u; -#define bt_hashlist bt_u.u_hashlist -#define bt_freelist bt_u.u_freelist - vmem_addr_t bt_start; - vmem_size_t bt_size; - int bt_type; -}; - #define BT_TYPE_SPAN 1 /* Allocated from importfn */ #define BT_TYPE_SPAN_STATIC 2 /* vmem_add() or create. */ #define BT_TYPE_FREE 3 /* Available space. */ #define BT_TYPE_BUSY 4 /* Used space. */ +#define BT_TYPE_CURSOR 5 /* Cursor for nextfit allocations. */ #define BT_ISSPAN_P(bt) ((bt)->bt_type <= BT_TYPE_SPAN_STATIC) #define BT_END(bt) ((bt)->bt_start + (bt)->bt_size - 1) @@ -990,6 +992,162 @@ vmem_clip(vmem_t *vm, bt_t *bt, vmem_addr_t start, vme MPASS(bt->bt_size >= size); } +static int +vmem_try_fetch(vmem_t *vm, const vmem_size_t size, vmem_size_t align, int flags) +{ + vmem_size_t avail; + + VMEM_ASSERT_LOCKED(vm); + + /* + * XXX it is possible to fail to meet xalloc constraints with the + * imported region. It is up to the user to specify the + * import quantum such that it can satisfy any allocation. + */ + if (vmem_import(vm, size, align, flags) == 0) + return (1); + + /* + * Try to free some space from the quantum cache or reclaim + * functions if available. + */ + if (vm->vm_qcache_max != 0 || vm->vm_reclaimfn != NULL) { + avail = vm->vm_size - vm->vm_inuse; + VMEM_UNLOCK(vm); + if (vm->vm_qcache_max != 0) + qc_drain(vm); + if (vm->vm_reclaimfn != NULL) + vm->vm_reclaimfn(vm, flags); + VMEM_LOCK(vm); + /* If we were successful retry even NOWAIT. */ + if (vm->vm_size - vm->vm_inuse > avail) + return (1); + } + if ((flags & M_NOWAIT) != 0) + return (0); + VMEM_CONDVAR_WAIT(vm); + return (1); +} + +static int +vmem_try_release(vmem_t *vm, struct vmem_btag *bt, const bool remfree) +{ + struct vmem_btag *prev; + + MPASS(bt->bt_type == BT_TYPE_FREE); + + if (vm->vm_releasefn == NULL) + return (0); + + prev = TAILQ_PREV(bt, vmem_seglist, bt_seglist); + MPASS(prev != NULL); + MPASS(prev->bt_type != BT_TYPE_FREE); + + if (prev->bt_type == BT_TYPE_SPAN && prev->bt_size == bt->bt_size) { + vmem_addr_t spanaddr; + vmem_size_t spansize; + + MPASS(prev->bt_start == bt->bt_start); + spanaddr = prev->bt_start; + spansize = prev->bt_size; + if (remfree) + bt_remfree(vm, bt); + bt_remseg(vm, bt); + bt_remseg(vm, prev); + vm->vm_size -= spansize; + VMEM_CONDVAR_BROADCAST(vm); + bt_freetrim(vm, BT_MAXFREE); + vm->vm_releasefn(vm->vm_arg, spanaddr, spansize); + return (1); + } + return (0); +} + +static int +vmem_xalloc_nextfit(vmem_t *vm, const vmem_size_t size, vmem_size_t align, + const vmem_size_t phase, const vmem_size_t nocross, int flags, + vmem_addr_t *addrp) +{ + struct vmem_btag *bt, *cursor, *next, *prev; + int error; + + error = ENOMEM; + VMEM_LOCK(vm); +retry: + /* + * Make sure we have enough tags to complete the operation. + */ + if (vm->vm_nfreetags < BT_MAXALLOC && bt_fill(vm, flags) != 0) + goto out; + + /* + * Find the next free tag meeting our constraints. If one is found, + * perform the allocation. + */ + for (cursor = &vm->vm_cursor, bt = TAILQ_NEXT(cursor, bt_seglist); + bt != cursor; bt = TAILQ_NEXT(bt, bt_seglist)) { + if (bt == NULL) + bt = TAILQ_FIRST(&vm->vm_seglist); + if (bt->bt_type == BT_TYPE_FREE && bt->bt_size >= size && + (error = vmem_fit(bt, size, align, phase, nocross, + VMEM_ADDR_MIN, VMEM_ADDR_MAX, addrp)) == 0) { + vmem_clip(vm, bt, *addrp, size); + break; + } + } + + /* + * Try to coalesce free segments around the cursor. If we succeed, and + * have not yet satisfied the allocation request, try again with the + * newly coalesced segment. + */ + if ((next = TAILQ_NEXT(cursor, bt_seglist)) != NULL && + (prev = TAILQ_PREV(cursor, vmem_seglist, bt_seglist)) != NULL && + next->bt_type == BT_TYPE_FREE && prev->bt_type == BT_TYPE_FREE && + prev->bt_start + prev->bt_size == next->bt_start) { + prev->bt_size += next->bt_size; + bt_remfree(vm, next); + bt_remseg(vm, next); + + /* + * The coalesced segment might be able to satisfy our request. + * If not, we might need to release it from the arena. + */ + if (error == ENOMEM && prev->bt_size >= size && + (error = vmem_fit(prev, size, align, phase, nocross, + VMEM_ADDR_MIN, VMEM_ADDR_MAX, addrp)) == 0) { + vmem_clip(vm, prev, *addrp, size); + bt = prev; + } else + (void)vmem_try_release(vm, prev, true); + } + + /* + * If the allocation was successful, advance the cursor. + */ + if (error == 0) { + TAILQ_REMOVE(&vm->vm_seglist, cursor, bt_seglist); + for (; bt != NULL && bt->bt_start < *addrp + size; + bt = TAILQ_NEXT(bt, bt_seglist)) + ; + if (bt != NULL) + TAILQ_INSERT_BEFORE(bt, cursor, bt_seglist); + else + TAILQ_INSERT_HEAD(&vm->vm_seglist, cursor, bt_seglist); + } + + /* + * Attempt to bring additional resources into the arena. If that fails + * and M_WAITOK is specified, sleep waiting for resources to be freed. + */ + if (error == ENOMEM && vmem_try_fetch(vm, size, align, flags)) + goto retry; + +out: + VMEM_UNLOCK(vm); + return (error); +} + /* ---- vmem API */ void @@ -1051,9 +1209,13 @@ vmem_init(vmem_t *vm, const char *name, vmem_addr_t ba qc_init(vm, qcache_max); TAILQ_INIT(&vm->vm_seglist); - for (i = 0; i < VMEM_MAXORDER; i++) { + vm->vm_cursor.bt_start = vm->vm_cursor.bt_size = 0; + vm->vm_cursor.bt_type = BT_TYPE_CURSOR; + TAILQ_INSERT_TAIL(&vm->vm_seglist, &vm->vm_cursor, bt_seglist); + + for (i = 0; i < VMEM_MAXORDER; i++) LIST_INIT(&vm->vm_freelist[i]); - } + memset(&vm->vm_hash0, 0, sizeof(vm->vm_hash0)); vm->vm_hashsize = VMEM_HASHSIZE_MIN; vm->vm_hashlist = vm->vm_hash0; @@ -1120,7 +1282,7 @@ vmem_alloc(vmem_t *vm, vmem_size_t size, int flags, vm flags &= VMEM_FLAGS; MPASS(size > 0); - MPASS(strat == M_BESTFIT || strat == M_FIRSTFIT); + MPASS(strat == M_BESTFIT || strat == M_FIRSTFIT || strat == M_NEXTFIT); if ((flags & M_NOWAIT) == 0) WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "vmem_alloc"); @@ -1151,7 +1313,6 @@ vmem_xalloc(vmem_t *vm, const vmem_size_t size0, vmem_ struct vmem_freelist *list; struct vmem_freelist *first; struct vmem_freelist *end; - vmem_size_t avail; bt_t *bt; int error; int strat; @@ -1160,7 +1321,7 @@ vmem_xalloc(vmem_t *vm, const vmem_size_t size0, vmem_ strat = flags & VMEM_FITMASK; MPASS(size0 > 0); MPASS(size > 0); - MPASS(strat == M_BESTFIT || strat == M_FIRSTFIT); + MPASS(strat == M_BESTFIT || strat == M_FIRSTFIT || strat == M_NEXTFIT); MPASS((flags & (M_NOWAIT|M_WAITOK)) != (M_NOWAIT|M_WAITOK)); if ((flags & M_NOWAIT) == 0) WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "vmem_xalloc"); @@ -1173,11 +1334,20 @@ vmem_xalloc(vmem_t *vm, const vmem_size_t size0, vmem_ MPASS(nocross == 0 || nocross >= size); MPASS(minaddr <= maxaddr); MPASS(!VMEM_CROSS_P(phase, phase + size - 1, nocross)); + if (strat == M_NEXTFIT) + MPASS(minaddr == VMEM_ADDR_MIN && maxaddr == VMEM_ADDR_MAX); if (align == 0) align = vm->vm_quantum_mask + 1; - *addrp = 0; + + /* + * Next-fit allocations don't use the freelists. + */ + if (strat == M_NEXTFIT) + return (vmem_xalloc_nextfit(vm, size0, align, phase, nocross, + flags, addrp)); + end = &vm->vm_freelist[VMEM_MAXORDER]; /* * choose a free block from which we allocate. @@ -1194,6 +1364,7 @@ vmem_xalloc(vmem_t *vm, const vmem_size_t size0, vmem_ error = ENOMEM; break; } + /* * Scan freelists looking for a tag that satisfies the * allocation. If we're doing BESTFIT we may encounter @@ -1215,6 +1386,7 @@ vmem_xalloc(vmem_t *vm, const vmem_size_t size0, vmem_ break; } } + /* * Retry if the fast algorithm failed. */ @@ -1223,35 +1395,16 @@ vmem_xalloc(vmem_t *vm, const vmem_size_t size0, vmem_ first = bt_freehead_toalloc(vm, size, strat); continue; } - /* - * XXX it is possible to fail to meet restrictions with the - * imported region. It is up to the user to specify the - * import quantum such that it can satisfy any allocation. - */ - if (vmem_import(vm, size, align, flags) == 0) - continue; /* - * Try to free some space from the quantum cache or reclaim - * functions if available. + * Try a few measures to bring additional resources into the + * arena. If all else fails, we will sleep waiting for + * resources to be freed. */ - if (vm->vm_qcache_max != 0 || vm->vm_reclaimfn != NULL) { - avail = vm->vm_size - vm->vm_inuse; - VMEM_UNLOCK(vm); - if (vm->vm_qcache_max != 0) - qc_drain(vm); - if (vm->vm_reclaimfn != NULL) - vm->vm_reclaimfn(vm, flags); - VMEM_LOCK(vm); - /* If we were successful retry even NOWAIT. */ - if (vm->vm_size - vm->vm_inuse > avail) - continue; - } - if ((flags & M_NOWAIT) != 0) { + if (!vmem_try_fetch(vm, size, align, flags)) { error = ENOMEM; break; } - VMEM_CONDVAR_WAIT(vm); } out: VMEM_UNLOCK(vm); @@ -1313,24 +1466,7 @@ vmem_xfree(vmem_t *vm, vmem_addr_t addr, vmem_size_t s bt_remseg(vm, t); } - t = TAILQ_PREV(bt, vmem_seglist, bt_seglist); - MPASS(t != NULL); - MPASS(BT_ISSPAN_P(t) || t->bt_type == BT_TYPE_BUSY); - if (vm->vm_releasefn != NULL && t->bt_type == BT_TYPE_SPAN && - t->bt_size == bt->bt_size) { - vmem_addr_t spanaddr; - vmem_size_t spansize; - - MPASS(t->bt_start == bt->bt_start); - spanaddr = bt->bt_start; - spansize = bt->bt_size; - bt_remseg(vm, bt); - bt_remseg(vm, t); - vm->vm_size -= spansize; - VMEM_CONDVAR_BROADCAST(vm); - bt_freetrim(vm, BT_MAXFREE); - (*vm->vm_releasefn)(vm->vm_arg, spanaddr, spansize); - } else { + if (!vmem_try_release(vm, bt, false)) { bt_insfree(vm, bt); VMEM_CONDVAR_BROADCAST(vm); bt_freetrim(vm, BT_MAXFREE); @@ -1409,6 +1545,8 @@ bt_type_string(int type) return "span"; case BT_TYPE_SPAN_STATIC: return "static span"; + case BT_TYPE_CURSOR: + return "cursor"; default: break; } Modified: head/sys/sys/malloc.h ============================================================================== --- head/sys/sys/malloc.h Sat May 18 00:22:28 2019 (r347948) +++ head/sys/sys/malloc.h Sat May 18 01:46:38 2019 (r347949) @@ -57,9 +57,10 @@ #define M_NOVM 0x0200 /* don't ask VM for pages */ #define M_USE_RESERVE 0x0400 /* can alloc out of reserve memory */ #define M_NODUMP 0x0800 /* don't dump pages in this allocation */ -#define M_FIRSTFIT 0x1000 /* Only for vmem, fast fit. */ -#define M_BESTFIT 0x2000 /* Only for vmem, low fragmentation. */ -#define M_EXEC 0x4000 /* allocate executable space. */ +#define M_FIRSTFIT 0x1000 /* only for vmem, fast fit */ +#define M_BESTFIT 0x2000 /* only for vmem, low fragmentation */ +#define M_EXEC 0x4000 /* allocate executable space */ +#define M_NEXTFIT 0x8000 /* only for vmem, follow cursor */ #define M_MAGIC 877983977 /* time when first defined :-) */ From owner-svn-src-head@freebsd.org Sat May 18 02:02:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7A7715A5325; Sat, 18 May 2019 02:02:15 +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 8A8A2932AF; Sat, 18 May 2019 02:02:15 +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 647C418FCC; Sat, 18 May 2019 02:02: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 x4I22FHs040762; Sat, 18 May 2019 02:02:15 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4I22FH6040761; Sat, 18 May 2019 02:02:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905180202.x4I22FH6040761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 18 May 2019 02:02:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347950 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 347950 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A8A2932AF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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, 18 May 2019 02:02:16 -0000 Author: markj Date: Sat May 18 02:02:14 2019 New Revision: 347950 URL: https://svnweb.freebsd.org/changeset/base/347950 Log: Use M_NEXTFIT in memguard(9). memguard(9) wants to avoid reuse of freed addresses for as long as possible. Previously it maintained a racily updated cursor which was passed to vmem_xalloc(9) as the minimum address. However, vmem will not in general return the lowest free address in the arena, so this trick only really works until the cursor has wrapped around the first time. Reported by: alc Reviewed by: alc MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D17227 Modified: head/sys/vm/memguard.c Modified: head/sys/vm/memguard.c ============================================================================== --- head/sys/vm/memguard.c Sat May 18 01:46:38 2019 (r347949) +++ head/sys/vm/memguard.c Sat May 18 02:02:14 2019 (r347950) @@ -102,26 +102,29 @@ SYSCTL_PROC(_vm_memguard, OID_AUTO, desc, CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, memguard_sysctl_desc, "A", "Short description of memory type to monitor"); -static vm_offset_t memguard_cursor; +static int +memguard_sysctl_mapused(SYSCTL_HANDLER_ARGS) +{ + vmem_size_t size; + + size = vmem_size(memguard_arena, VMEM_ALLOC); + return (sysctl_handle_long(oidp, &size, sizeof(size), req)); +} + static vm_offset_t memguard_base; static vm_size_t memguard_mapsize; static vm_size_t memguard_physlimit; static u_long memguard_wasted; -static u_long memguard_wrap; static u_long memguard_succ; static u_long memguard_fail_kva; static u_long memguard_fail_pgs; -SYSCTL_ULONG(_vm_memguard, OID_AUTO, cursor, CTLFLAG_RD, - &memguard_cursor, 0, "MemGuard cursor"); SYSCTL_ULONG(_vm_memguard, OID_AUTO, mapsize, CTLFLAG_RD, &memguard_mapsize, 0, "MemGuard private arena size"); SYSCTL_ULONG(_vm_memguard, OID_AUTO, phys_limit, CTLFLAG_RD, &memguard_physlimit, 0, "Limit on MemGuard memory consumption"); SYSCTL_ULONG(_vm_memguard, OID_AUTO, wasted, CTLFLAG_RD, &memguard_wasted, 0, "Excess memory used through page promotion"); -SYSCTL_ULONG(_vm_memguard, OID_AUTO, wrapcnt, CTLFLAG_RD, - &memguard_wrap, 0, "MemGuard cursor wrap count"); SYSCTL_ULONG(_vm_memguard, OID_AUTO, numalloc, CTLFLAG_RD, &memguard_succ, 0, "Count of successful MemGuard allocations"); SYSCTL_ULONG(_vm_memguard, OID_AUTO, fail_kva, CTLFLAG_RD, @@ -157,7 +160,7 @@ SYSCTL_ULONG(_vm_memguard, OID_AUTO, frequency_hits, C /* * Return a fudged value to be used for vm_kmem_size for allocating - * the kernel_arena. The memguard memory will be a submap. + * the kernel_arena. */ unsigned long memguard_fudge(unsigned long km_size, const struct vm_map *parent_map) @@ -199,7 +202,8 @@ memguard_fudge(unsigned long km_size, const struct vm_ /* * Initialize the MemGuard mock allocator. All objects from MemGuard come - * out of a single VM map (contiguous chunk of address space). + * out of a single contiguous chunk of kernel address space that is managed + * by a vmem arena. */ void memguard_init(vmem_t *parent) @@ -209,7 +213,6 @@ memguard_init(vmem_t *parent) vmem_alloc(parent, memguard_mapsize, M_BESTFIT | M_WAITOK, &base); vmem_init(memguard_arena, "memguard arena", base, memguard_mapsize, PAGE_SIZE, 0, M_WAITOK); - memguard_cursor = base; memguard_base = base; printf("MEMGUARD DEBUGGING ALLOCATOR INITIALIZED:\n"); @@ -227,15 +230,15 @@ memguard_sysinit(void) struct sysctl_oid_list *parent; parent = SYSCTL_STATIC_CHILDREN(_vm_memguard); - - SYSCTL_ADD_UAUTO(NULL, parent, OID_AUTO, "mapstart", CTLFLAG_RD, - &memguard_base, "MemGuard KVA base"); - SYSCTL_ADD_UAUTO(NULL, parent, OID_AUTO, "maplimit", CTLFLAG_RD, - &memguard_mapsize, "MemGuard KVA size"); -#if 0 - SYSCTL_ADD_ULONG(NULL, parent, OID_AUTO, "mapused", CTLFLAG_RD, - &memguard_map->size, "MemGuard KVA used"); -#endif + SYSCTL_ADD_UAUTO(NULL, parent, OID_AUTO, "mapstart", + CTLFLAG_RD, &memguard_base, + "MemGuard KVA base"); + SYSCTL_ADD_UAUTO(NULL, parent, OID_AUTO, "maplimit", + CTLFLAG_RD, &memguard_mapsize, + "MemGuard KVA size"); + SYSCTL_ADD_PROC(NULL, parent, OID_AUTO, "mapused", + CTLFLAG_RD | CTLTYPE_ULONG, NULL, 0, memguard_sysctl_mapused, "LU", + "MemGuard KVA used"); } SYSINIT(memguard, SI_SUB_KLD, SI_ORDER_ANY, memguard_sysinit, NULL); @@ -288,17 +291,16 @@ memguard_alloc(unsigned long req_size, int flags) { vm_offset_t addr, origaddr; u_long size_p, size_v; - int do_guard, rv; + int do_guard, error, rv; size_p = round_page(req_size); if (size_p == 0) return (NULL); + /* * To ensure there are holes on both sides of the allocation, - * request 2 extra pages of KVA. We will only actually add a - * vm_map_entry and get pages for the original request. Save - * the value of memguard_options so we have a consistent - * value. + * request 2 extra pages of KVA. Save the value of memguard_options + * so that we use a consistent value throughout this function. */ size_v = size_p; do_guard = (memguard_options & MG_GUARD_AROUND) != 0; @@ -317,33 +319,17 @@ memguard_alloc(unsigned long req_size, int flags) memguard_fail_pgs++; goto out; } + /* - * Keep a moving cursor so we don't recycle KVA as long as - * possible. It's not perfect, since we don't know in what - * order previous allocations will be free'd, but it's simple - * and fast, and requires O(1) additional storage if guard - * pages are not used. - * - * XXX This scheme will lead to greater fragmentation of the - * map, unless vm_map_findspace() is tweaked. + * Attempt to avoid address reuse for as long as possible, to increase + * the likelihood of catching a use-after-free. */ - for (;;) { - if (vmem_xalloc(memguard_arena, size_v, 0, 0, 0, - memguard_cursor, VMEM_ADDR_MAX, - M_BESTFIT | M_NOWAIT, &origaddr) == 0) - break; - /* - * The map has no space. This may be due to - * fragmentation, or because the cursor is near the - * end of the map. - */ - if (memguard_cursor == memguard_base) { - memguard_fail_kva++; - addr = (vm_offset_t)NULL; - goto out; - } - memguard_wrap++; - memguard_cursor = memguard_base; + error = vmem_alloc(memguard_arena, size_v, M_NEXTFIT | M_NOWAIT, + &origaddr); + if (error != 0) { + memguard_fail_kva++; + addr = (vm_offset_t)NULL; + goto out; } addr = origaddr; if (do_guard) @@ -355,7 +341,6 @@ memguard_alloc(unsigned long req_size, int flags) addr = (vm_offset_t)NULL; goto out; } - memguard_cursor = addr + size_v; *v2sizep(trunc_page(addr)) = req_size; *v2sizev(trunc_page(addr)) = size_v; memguard_succ++; From owner-svn-src-head@freebsd.org Sat May 18 08:35:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BC2515AC34D; Sat, 18 May 2019 08:35:49 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) (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 902726F3BF; Sat, 18 May 2019 08:35:47 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: by mail-io1-f44.google.com with SMTP id u2so7342407ioc.4; Sat, 18 May 2019 01:35:47 -0700 (PDT) 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=CP86viVA8n0j3KF54iZIccXmIdIY8bSaXr6kPHOzZ1c=; b=nCZpBdJHSVHItsMl+f76KnIsYQ1AxEyM2HHc0QLexs6AkzzgrRwfB98NGIUY7DpzSM M95zB/iqiv8OPUtSE5A6aIIUqrvqkK/BwSOM4Avif+SSRc2BfuyJmeQhsmbtWWcBsAVJ /pu+qDHvFkwGEg66w/z/LoNBMTCrwkSi//wQ0vdwHKW/WepDBtRe/0SPOQGV7+iJb9qI 6uGGTW4I+s3cvGe9GYSLfQY6oKckISlRunptxpNPTBW/TV+sPOuzp7phCbABJRYZRbLc 5q0hoMI6ZDq7EEHNhnmNLx/yjwnihBwLoWZel5iQ4i5u9ZF8ueFZrQE+MvieN/rirBR4 Hn8g== X-Gm-Message-State: APjAAAW4FvcDW5hiaY0Jnb++KV1Fd6cw62ztQlf5grSZHURHtRDLzk3i bdB69guKMS8Y663Yx78Y8J4QIz9fpJf2mHjh/5BsupZF X-Google-Smtp-Source: APXvYqzqL8dKzNT4rIhzldW7QzjJay5v4d216eTNb2ZxxHkfdFEhs5+jf1UkxMUlWzut4kMc8UrVWMSO0FKuNbEI7LU= X-Received: by 2002:a6b:3fd7:: with SMTP id m206mr37519903ioa.120.1558168540856; Sat, 18 May 2019 01:35:40 -0700 (PDT) MIME-Version: 1.0 References: <201905161328.x4GDSmMd072071@repo.freebsd.org> In-Reply-To: <201905161328.x4GDSmMd072071@repo.freebsd.org> From: Dmitry Chagin Date: Sat, 18 May 2019 11:35:29 +0300 Message-ID: Subject: Re: svn commit: r347695 - in head/sys: amd64/amd64 amd64/include kern To: Konstantin Belousov Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 902726F3BF X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of chagindmitry@gmail.com designates 209.85.166.44 as permitted sender) smtp.mailfrom=chagindmitry@gmail.com X-Spamd-Result: default: False [-5.36 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_NEQ_ENVFROM(0.00)[dchagin@freebsd.org,chagindmitry@gmail.com]; 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)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-2.52)[ip: (-6.76), ipnet: 209.85.128.0/17(-3.51), asn: 15169(-2.27), country: US(-0.06)]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.83)[-0.828,0]; RCVD_IN_DNSWL_NONE(0.00)[44.166.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[dchagin@freebsd.org,chagindmitry@gmail.com]; MIME_TRACE(0.00)[0:+,1:+]; 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)[]; 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: Sat, 18 May 2019 08:35:49 -0000 =D1=87=D1=82, 16 =D0=BC=D0=B0=D1=8F 2019 =D0=B3. =D0=B2 16:29, Konstantin B= elousov : > Author: kib > Date: Thu May 16 13:28:48 2019 > New Revision: 347695 > URL: https://svnweb.freebsd.org/changeset/base/347695 > > Log: > amd64 pmap: rework delayed invalidation, removing global mutex. > > For machines having cmpxcgh16b instruction, i.e. everything but very > early Athlons, provide lockless implementation of delayed > invalidation. > > The implementation maintains lock-less single-linked list with the > trick from the T.L. Harris article about volatile mark of the elements > being removed. Double-CAS is used to atomically update both link and > generation. New thread starting DI appends itself to the end of the > queue, setting the generation to the generation of the last element > +1. On DI finish, thread donates its generation to the previous > element. The generation of the fake head of the list is the last > passed DI generation. Basically, the implementation is a queued > spinlock but without spinlock. > > Hi, Kostik! First of all thanks for the previous help. Second, this commit broke i915kms module. Unfortunatelly, I can't give you a lot of information becouse I see only black screen, but I can help with testing > Many thanks both to Peter Holm and Mark Johnson for keeping with me > while I produced intermediate versions of the patch. > > Reviewed by: markj > Tested by: pho > Sponsored by: The FreeBSD Foundation > MFC after: 1 month > MFC note: td_md.md_invl_gen should go to the end of struct thread > Differential revision: https://reviews.freebsd.org/D19630 > > Modified: > head/sys/amd64/amd64/pmap.c > head/sys/amd64/amd64/trap.c > head/sys/amd64/amd64/vm_machdep.c > head/sys/amd64/include/pmap.h > head/sys/amd64/include/proc.h > head/sys/kern/kern_thread.c > > Modified: head/sys/amd64/amd64/pmap.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/sys/amd64/amd64/pmap.c Thu May 16 13:17:57 2019 (r347694) > +++ head/sys/amd64/amd64/pmap.c Thu May 16 13:28:48 2019 (r347695) > @@ -107,6 +107,7 @@ __FBSDID("$FreeBSD$"); > * and to when physical maps must be made correct. > */ > > +#include "opt_ddb.h" > #include "opt_pmap.h" > #include "opt_vm.h" > > @@ -130,6 +131,10 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#ifdef DDB > +#include > +#include > +#endif > > #include > #include > @@ -468,22 +473,46 @@ SYSCTL_PROC(_vm_pmap, OID_AUTO, pcid_save_cnt, > CTLTYPE > static LIST_HEAD(, pmap_invl_gen) pmap_invl_gen_tracker =3D > LIST_HEAD_INITIALIZER(&pmap_invl_gen_tracker); > static struct mtx invl_gen_mtx; > -static u_long pmap_invl_gen =3D 0; > /* Fake lock object to satisfy turnstiles interface. */ > static struct lock_object invl_gen_ts =3D { > .lo_name =3D "invlts", > }; > +static struct pmap_invl_gen pmap_invl_gen_head =3D { > + .gen =3D 1, > + .next =3D NULL, > +}; > +static u_long pmap_invl_gen =3D 1; > > +#define PMAP_ASSERT_NOT_IN_DI() \ > + KASSERT(pmap_not_in_di(), ("DI already started")) > + > +static bool pmap_not_in_di_l(void); > +static bool pmap_not_in_di_u(void); > +DEFINE_IFUNC(, bool, pmap_not_in_di, (void), static) > +{ > + > + return ((cpu_feature2 & CPUID2_CX16) =3D=3D 0 ? pmap_not_in_di_l = : > + pmap_not_in_di_u); > +} > + > static bool > -pmap_not_in_di(void) > +pmap_not_in_di_l(void) > { > + struct pmap_invl_gen *invl_gen; > > - return (curthread->td_md.md_invl_gen.gen =3D=3D 0); > + invl_gen =3D &curthread->td_md.md_invl_gen; > + return (invl_gen->gen =3D=3D 0); > } > > -#define PMAP_ASSERT_NOT_IN_DI() \ > - KASSERT(pmap_not_in_di(), ("DI already started")) > +static void > +pmap_thread_init_invl_gen_l(struct thread *td) > +{ > + struct pmap_invl_gen *invl_gen; > > + invl_gen =3D &td->td_md.md_invl_gen; > + invl_gen->gen =3D 0; > +} > + > /* > * Start a new Delayed Invalidation (DI) block of code, executed by > * the current thread. Within a DI block, the current thread may > @@ -493,7 +522,7 @@ pmap_not_in_di(void) > * pmap active. > */ > static void > -pmap_delayed_invl_started(void) > +pmap_delayed_invl_started_l(void) > { > struct pmap_invl_gen *invl_gen; > u_long currgen; > @@ -525,7 +554,7 @@ pmap_delayed_invl_started(void) > * current thread's DI. > */ > static void > -pmap_delayed_invl_finished(void) > +pmap_delayed_invl_finished_l(void) > { > struct pmap_invl_gen *invl_gen, *next; > struct turnstile *ts; > @@ -551,7 +580,285 @@ pmap_delayed_invl_finished(void) > invl_gen->gen =3D 0; > } > > +static bool > +pmap_not_in_di_u(void) > +{ > + struct pmap_invl_gen *invl_gen; > + > + invl_gen =3D &curthread->td_md.md_invl_gen; > + return (((uintptr_t)invl_gen->next & PMAP_INVL_GEN_NEXT_INVALID) > !=3D 0); > +} > + > +static void > +pmap_thread_init_invl_gen_u(struct thread *td) > +{ > + struct pmap_invl_gen *invl_gen; > + > + invl_gen =3D &td->td_md.md_invl_gen; > + invl_gen->gen =3D 0; > + invl_gen->next =3D (void *)PMAP_INVL_GEN_NEXT_INVALID; > +} > + > +static bool > +pmap_di_load_invl(struct pmap_invl_gen *ptr, struct pmap_invl_gen *out) > +{ > + uint64_t new_high, new_low, old_high, old_low; > + char res; > + > + old_low =3D new_low =3D 0; > + old_high =3D new_high =3D (uintptr_t)0; > + > + __asm volatile("lock;cmpxchg16b\t%1;sete\t%0" > + : "=3Dr" (res), "+m" (*ptr), "+a" (old_low), "+d" (old_high) > + : "b"(new_low), "c" (new_high) > + : "memory", "cc"); > + if (res =3D=3D 0) { > + if ((old_high & PMAP_INVL_GEN_NEXT_INVALID) !=3D 0) > + return (false); > + out->gen =3D old_low; > + out->next =3D (void *)old_high; > + } else { > + out->gen =3D new_low; > + out->next =3D (void *)new_high; > + } > + return (true); > +} > + > +static bool > +pmap_di_store_invl(struct pmap_invl_gen *ptr, struct pmap_invl_gen > *old_val, > + struct pmap_invl_gen *new_val) > +{ > + uint64_t new_high, new_low, old_high, old_low; > + char res; > + > + new_low =3D new_val->gen; > + new_high =3D (uintptr_t)new_val->next; > + old_low =3D old_val->gen; > + old_high =3D (uintptr_t)old_val->next; > + > + __asm volatile("lock;cmpxchg16b\t%1;sete\t%0" > + : "=3Dr" (res), "+m" (*ptr), "+a" (old_low), "+d" (old_high) > + : "b"(new_low), "c" (new_high) > + : "memory", "cc"); > + return (res); > +} > + > #ifdef PV_STATS > +static long invl_start_restart; > +SYSCTL_LONG(_vm_pmap, OID_AUTO, invl_start_restart, CTLFLAG_RD, > + &invl_start_restart, 0, > + ""); > +static long invl_finish_restart; > +SYSCTL_LONG(_vm_pmap, OID_AUTO, invl_finish_restart, CTLFLAG_RD, > + &invl_finish_restart, 0, > + ""); > +static int invl_max_qlen; > +SYSCTL_INT(_vm_pmap, OID_AUTO, invl_max_qlen, CTLFLAG_RD, > + &invl_max_qlen, 0, > + ""); > +#endif > + > +static struct lock_delay_config __read_frequently di_delay; > +LOCK_DELAY_SYSINIT_DEFAULT(di_delay); > + > +static void > +pmap_delayed_invl_started_u(void) > +{ > + struct pmap_invl_gen *invl_gen, *p, prev, new_prev; > + struct thread *td; > + struct lock_delay_arg lda; > + uintptr_t prevl; > + u_char pri; > +#ifdef PV_STATS > + int i, ii; > +#endif > + > + td =3D curthread; > + invl_gen =3D &td->td_md.md_invl_gen; > + PMAP_ASSERT_NOT_IN_DI(); > + lock_delay_arg_init(&lda, &di_delay); > + thread_lock(td); > + pri =3D td->td_base_pri; > + if (pri < PVM) { > + invl_gen->saved_pri =3D 0; > + } else { > + invl_gen->saved_pri =3D pri; > + sched_prio(td, PVM); > + } > + thread_unlock(td); > + > +again: > + PV_STAT(i =3D 0); > + for (p =3D &pmap_invl_gen_head;; p =3D prev.next) { > + PV_STAT(i++); > + prevl =3D atomic_load_ptr(&p->next); > + if ((prevl & PMAP_INVL_GEN_NEXT_INVALID) !=3D 0) { > + PV_STAT(atomic_add_long(&invl_start_restart, 1)); > + lock_delay(&lda); > + goto again; > + } > + if (prevl =3D=3D 0) > + break; > + prev.next =3D (void *)prevl; > + } > +#ifdef PV_STATS > + if ((ii =3D invl_max_qlen) < i) > + atomic_cmpset_int(&invl_max_qlen, ii, i); > +#endif > + > + if (!pmap_di_load_invl(p, &prev) || prev.next !=3D NULL) { > + PV_STAT(atomic_add_long(&invl_start_restart, 1)); > + lock_delay(&lda); > + goto again; > + } > + > + new_prev.gen =3D prev.gen; > + new_prev.next =3D invl_gen; > + invl_gen->gen =3D prev.gen + 1; > + > + /* Formal fence between store to invl->gen and updating *p. */ > + atomic_thread_fence_rel(); > + > + /* > + * After inserting an invl_gen element with invalid bit set, > + * this thread blocks any other thread trying to enter the > + * delayed invalidation block. Do not allow to remove us from > + * the CPU, because it causes starvation for other threads. > + */ > + critical_enter(); > + > + /* > + * ABA for *p is not possible there, since p->gen can only > + * increase. So if the *p thread finished its di, then > + * started a new one and got inserted into the list at the > + * same place, its gen will appear greater than the previously > + * read gen. > + */ > + if (!pmap_di_store_invl(p, &prev, &new_prev)) { > + critical_exit(); > + PV_STAT(atomic_add_long(&invl_start_restart, 1)); > + lock_delay(&lda); > + goto again; > + } > + > + /* > + * There we clear PMAP_INVL_GEN_NEXT_INVALID in > + * invl_gen->next, allowing other threads to iterate past us. > + * pmap_di_store_invl() provides fence between the generation > + * write and the update of next. > + */ > + invl_gen->next =3D NULL; > + critical_exit(); > +} > + > +static bool > +pmap_delayed_invl_finished_u_crit(struct pmap_invl_gen *invl_gen, > + struct pmap_invl_gen *p) > +{ > + struct pmap_invl_gen prev, new_prev; > + u_long mygen; > + > + /* > + * Load invl_gen->gen after setting invl_gen->next > + * PMAP_INVL_GEN_NEXT_INVALID. This prevents larger > + * generations to propagate to our invl_gen->gen. Lock prefix > + * in atomic_set_ptr() worked as seq_cst fence. > + */ > + mygen =3D atomic_load_long(&invl_gen->gen); > + > + if (!pmap_di_load_invl(p, &prev) || prev.next !=3D invl_gen) > + return (false); > + > + KASSERT(prev.gen < mygen, > + ("invalid di gen sequence %lu %lu", prev.gen, mygen)); > + new_prev.gen =3D mygen; > + new_prev.next =3D (void *)((uintptr_t)invl_gen->next & > + ~PMAP_INVL_GEN_NEXT_INVALID); > + > + /* Formal fence between load of prev and storing update to it. */ > + atomic_thread_fence_rel(); > + > + return (pmap_di_store_invl(p, &prev, &new_prev)); > +} > + > +static void > +pmap_delayed_invl_finished_u(void) > +{ > + struct pmap_invl_gen *invl_gen, *p; > + struct thread *td; > + struct lock_delay_arg lda; > + uintptr_t prevl; > + > + td =3D curthread; > + invl_gen =3D &td->td_md.md_invl_gen; > + KASSERT(invl_gen->gen !=3D 0, ("missed invl_start: gen 0")); > + KASSERT(((uintptr_t)invl_gen->next & PMAP_INVL_GEN_NEXT_INVALID) > =3D=3D 0, > + ("missed invl_start: INVALID")); > + lock_delay_arg_init(&lda, &di_delay); > + > +again: > + for (p =3D &pmap_invl_gen_head; p !=3D NULL; p =3D (void *)prevl)= { > + prevl =3D atomic_load_ptr(&p->next); > + if ((prevl & PMAP_INVL_GEN_NEXT_INVALID) !=3D 0) { > + PV_STAT(atomic_add_long(&invl_finish_restart, 1))= ; > + lock_delay(&lda); > + goto again; > + } > + if ((void *)prevl =3D=3D invl_gen) > + break; > + } > + > + /* > + * It is legitimate to not find ourself on the list if a > + * thread before us finished its DI and started it again. > + */ > + if (__predict_false(p =3D=3D NULL)) { > + PV_STAT(atomic_add_long(&invl_finish_restart, 1)); > + lock_delay(&lda); > + goto again; > + } > + > + critical_enter(); > + atomic_set_ptr((uintptr_t *)&invl_gen->next, > + PMAP_INVL_GEN_NEXT_INVALID); > + if (!pmap_delayed_invl_finished_u_crit(invl_gen, p)) { > + atomic_clear_ptr((uintptr_t *)&invl_gen->next, > + PMAP_INVL_GEN_NEXT_INVALID); > + critical_exit(); > + PV_STAT(atomic_add_long(&invl_finish_restart, 1)); > + lock_delay(&lda); > + goto again; > + } > + critical_exit(); > + if (invl_gen->saved_pri !=3D 0) { > + thread_lock(td); > + sched_prio(td, invl_gen->saved_pri); > + thread_unlock(td); > + } > +} > + > +#ifdef DDB > +DB_SHOW_COMMAND(di_queue, pmap_di_queue) > +{ > + struct pmap_invl_gen *p, *pn; > + struct thread *td; > + uintptr_t nextl; > + bool first; > + > + for (p =3D &pmap_invl_gen_head, first =3D true; p !=3D NULL; p = =3D pn, > + first =3D false) { > + nextl =3D atomic_load_ptr(&p->next); > + pn =3D (void *)(nextl & ~PMAP_INVL_GEN_NEXT_INVALID); > + td =3D first ? NULL : __containerof(p, struct thread, > + td_md.md_invl_gen); > + db_printf("gen %lu inv %d td %p tid %d\n", p->gen, > + (nextl & PMAP_INVL_GEN_NEXT_INVALID) !=3D 0, td, > + td !=3D NULL ? td->td_tid : -1); > + } > +} > +#endif > + > +#ifdef PV_STATS > static long invl_wait; > SYSCTL_LONG(_vm_pmap, OID_AUTO, invl_wait, CTLFLAG_RD, &invl_wait, 0, > "Number of times DI invalidation blocked pmap_remove_all/write"); > @@ -579,7 +886,7 @@ pmap_delayed_invl_genp(vm_page_t m) > * processor. > */ > static void > -pmap_delayed_invl_wait(vm_page_t m) > +pmap_delayed_invl_wait_l(vm_page_t m) > { > struct turnstile *ts; > u_long *m_gen; > @@ -603,6 +910,54 @@ pmap_delayed_invl_wait(vm_page_t m) > } > } > > +static void > +pmap_delayed_invl_wait_u(vm_page_t m) > +{ > + u_long *m_gen; > +#ifdef PV_STATS > + bool accounted =3D false; > +#endif > + > + m_gen =3D pmap_delayed_invl_genp(m); > + while (*m_gen > atomic_load_long(&pmap_invl_gen_head.gen)) { > +#ifdef PV_STATS > + if (!accounted) { > + atomic_add_long(&invl_wait, 1); > + accounted =3D true; > + } > +#endif > + kern_yield(PRI_USER); > + } > +} > + > +DEFINE_IFUNC(, void, pmap_thread_init_invl_gen, (struct thread *), stati= c) > +{ > + > + return ((cpu_feature2 & CPUID2_CX16) =3D=3D 0 ? > + pmap_thread_init_invl_gen_l : pmap_thread_init_invl_gen_u); > +} > + > +DEFINE_IFUNC(static, void, pmap_delayed_invl_started, (void), static) > +{ > + > + return ((cpu_feature2 & CPUID2_CX16) =3D=3D 0 ? > + pmap_delayed_invl_started_l : pmap_delayed_invl_started_u); > +} > + > +DEFINE_IFUNC(static, void, pmap_delayed_invl_finished, (void), static) > +{ > + > + return ((cpu_feature2 & CPUID2_CX16) =3D=3D 0 ? > + pmap_delayed_invl_finished_l : pmap_delayed_invl_finished_u); > +} > + > +DEFINE_IFUNC(static, void, pmap_delayed_invl_wait, (vm_page_t), static) > +{ > + > + return ((cpu_feature2 & CPUID2_CX16) =3D=3D 0 ? > + pmap_delayed_invl_wait_l : pmap_delayed_invl_wait_u); > +} > + > /* > * Mark the page m's PV list as participating in the current thread's > * DI block. Any threads concurrently using m's PV list to remove or > @@ -2854,6 +3209,7 @@ void > pmap_pinit0(pmap_t pmap) > { > struct proc *p; > + struct thread *td; > int i; > > PMAP_LOCK_INIT(pmap); > @@ -2872,12 +3228,14 @@ pmap_pinit0(pmap_t pmap) > pmap->pm_pcids[i].pm_gen =3D 1; > } > pmap_activate_boot(pmap); > + td =3D curthread; > if (pti) { > - p =3D curproc; > + p =3D td->td_proc; > PROC_LOCK(p); > p->p_md.md_flags |=3D P_MD_KPTI; > PROC_UNLOCK(p); > } > + pmap_thread_init_invl_gen(td); > > if ((cpu_stdext_feature2 & CPUID_STDEXT2_PKU) !=3D 0) { > pmap_pkru_ranges_zone =3D uma_zcreate("pkru ranges", > @@ -9327,11 +9685,7 @@ pmap_pkru_clear(pmap_t pmap, vm_offset_t sva, > vm_offse > return (error); > } > > -#include "opt_ddb.h" > #ifdef DDB > -#include > -#include > - > DB_SHOW_COMMAND(pte, pmap_print_pte) > { > pmap_t pmap; > > Modified: head/sys/amd64/amd64/trap.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/sys/amd64/amd64/trap.c Thu May 16 13:17:57 2019 (r347694) > +++ head/sys/amd64/amd64/trap.c Thu May 16 13:28:48 2019 (r347695) > @@ -1183,7 +1183,7 @@ amd64_syscall(struct thread *td, int traced) > KASSERT(td->td_pcb->pcb_save =3D=3D get_pcb_user_save_td(td), > ("System call %s returning with mangled pcb_save", > syscallname(td->td_proc, td->td_sa.code))); > - KASSERT(td->td_md.md_invl_gen.gen =3D=3D 0, > + KASSERT(pmap_not_in_di(), > ("System call %s returning with leaked invl_gen %lu", > syscallname(td->td_proc, td->td_sa.code), > td->td_md.md_invl_gen.gen)); > > Modified: head/sys/amd64/amd64/vm_machdep.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/sys/amd64/amd64/vm_machdep.c Thu May 16 13:17:57 2019 > (r347694) > +++ head/sys/amd64/amd64/vm_machdep.c Thu May 16 13:28:48 2019 > (r347695) > @@ -228,7 +228,7 @@ cpu_fork(struct thread *td1, struct proc *p2, struct = t > /* Setup to release spin count in fork_exit(). */ > td2->td_md.md_spinlock_count =3D 1; > td2->td_md.md_saved_flags =3D PSL_KERNEL | PSL_I; > - td2->td_md.md_invl_gen.gen =3D 0; > + pmap_thread_init_invl_gen(td2); > > /* As an i386, do not copy io permission bitmap. */ > pcb2->pcb_tssp =3D NULL; > @@ -544,6 +544,7 @@ cpu_copy_thread(struct thread *td, struct thread *td0= ) > /* Setup to release spin count in fork_exit(). */ > td->td_md.md_spinlock_count =3D 1; > td->td_md.md_saved_flags =3D PSL_KERNEL | PSL_I; > + pmap_thread_init_invl_gen(td); > } > > /* > > Modified: head/sys/amd64/include/pmap.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/amd64/include/pmap.h Thu May 16 13:17:57 2019 > (r347694) > +++ head/sys/amd64/include/pmap.h Thu May 16 13:28:48 2019 > (r347695) > @@ -441,6 +441,7 @@ void *pmap_mapbios(vm_paddr_t, vm_size_t); > void *pmap_mapdev(vm_paddr_t, vm_size_t); > void *pmap_mapdev_attr(vm_paddr_t, vm_size_t, int); > void *pmap_mapdev_pciecfg(vm_paddr_t pa, vm_size_t size); > +bool pmap_not_in_di(void); > boolean_t pmap_page_is_mapped(vm_page_t m); > void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma); > void pmap_pinit_pml4(vm_page_t); > @@ -465,6 +466,7 @@ void pmap_pti_pcid_invlrng(uint64_t ucr3, > uint64_t kcr > int pmap_pkru_clear(pmap_t pmap, vm_offset_t sva, vm_offset_t eva); > int pmap_pkru_set(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, > u_int keyidx, int flags); > +void pmap_thread_init_invl_gen(struct thread *td); > int pmap_vmspace_copy(pmap_t dst_pmap, pmap_t src_pmap); > #endif /* _KERNEL */ > > > Modified: head/sys/amd64/include/proc.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/amd64/include/proc.h Thu May 16 13:17:57 2019 > (r347694) > +++ head/sys/amd64/include/proc.h Thu May 16 13:28:48 2019 > (r347695) > @@ -50,10 +50,17 @@ struct proc_ldt { > int ldt_refcnt; > }; > > +#define PMAP_INVL_GEN_NEXT_INVALID 0x1ULL > struct pmap_invl_gen { > u_long gen; /* (k) */ > - LIST_ENTRY(pmap_invl_gen) link; /* (pp) */ > -}; > + union { > + LIST_ENTRY(pmap_invl_gen) link; /* (pp) */ > + struct { > + struct pmap_invl_gen *next; > + u_char saved_pri; > + }; > + }; > +} __aligned(16); > > /* > * Machine-dependent part of the proc structure for AMD64. > > Modified: head/sys/kern/kern_thread.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/sys/kern/kern_thread.c Thu May 16 13:17:57 2019 (r347694) > +++ head/sys/kern/kern_thread.c Thu May 16 13:28:48 2019 (r347695) > @@ -84,7 +84,7 @@ _Static_assert(offsetof(struct thread, td_pflags) =3D= =3D 0 > "struct thread KBI td_pflags"); > _Static_assert(offsetof(struct thread, td_frame) =3D=3D 0x478, > "struct thread KBI td_frame"); > -_Static_assert(offsetof(struct thread, td_emuldata) =3D=3D 0x530, > +_Static_assert(offsetof(struct thread, td_emuldata) =3D=3D 0x548, > "struct thread KBI td_emuldata"); > _Static_assert(offsetof(struct proc, p_flag) =3D=3D 0xb0, > "struct proc KBI p_flag"); > > From owner-svn-src-head@freebsd.org Sat May 18 08:44:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58F5915AC61F; Sat, 18 May 2019 08:44:19 +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 3C5936F84F; Sat, 18 May 2019 08:44:18 +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 x4I8i6BK043147 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 18 May 2019 11:44:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x4I8i6BK043147 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x4I8i6Ad043146; Sat, 18 May 2019 11:44:06 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 18 May 2019 11:44:06 +0300 From: Konstantin Belousov To: Dmitry Chagin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347695 - in head/sys: amd64/amd64 amd64/include kern Message-ID: <20190518084406.GX2748@kib.kiev.ua> References: <201905161328.x4GDSmMd072071@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) 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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, 18 May 2019 08:44:19 -0000 On Sat, May 18, 2019 at 11:35:29AM +0300, Dmitry Chagin wrote: > чт, 16 мая 2019 г. в 16:29, Konstantin Belousov : > > > Author: kib > > Date: Thu May 16 13:28:48 2019 > > New Revision: 347695 > > URL: https://svnweb.freebsd.org/changeset/base/347695 > > > > Log: > > amd64 pmap: rework delayed invalidation, removing global mutex. > > > > For machines having cmpxcgh16b instruction, i.e. everything but very > > early Athlons, provide lockless implementation of delayed > > invalidation. > > > > The implementation maintains lock-less single-linked list with the > > trick from the T.L. Harris article about volatile mark of the elements > > being removed. Double-CAS is used to atomically update both link and > > generation. New thread starting DI appends itself to the end of the > > queue, setting the generation to the generation of the last element > > +1. On DI finish, thread donates its generation to the previous > > element. The generation of the fake head of the list is the last > > passed DI generation. Basically, the implementation is a queued > > spinlock but without spinlock. > > > > > > Hi, Kostik! First of all thanks for the previous help. > Second, this commit broke i915kms module. Unfortunatelly, > I can't give you a lot of information becouse I see only black screen, > but I can help with testing Did you recompiled the module ? From owner-svn-src-head@freebsd.org Sat May 18 11:14:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6A1E15AF3EB; Sat, 18 May 2019 11:14:44 +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 75CCC752C6; Sat, 18 May 2019 11:14:44 +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 65E0B1ED6A; Sat, 18 May 2019 11:14:44 +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 x4IBEiLG036530; Sat, 18 May 2019 11:14:44 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4IBEixh036528; Sat, 18 May 2019 11:14:44 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905181114.x4IBEixh036528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 18 May 2019 11:14:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347952 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 347952 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 75CCC752C6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Sat, 18 May 2019 11:14:45 -0000 Author: jhibbits Date: Sat May 18 11:14:43 2019 New Revision: 347952 URL: https://svnweb.freebsd.org/changeset/base/347952 Log: powerpc64/pmap: NUMA-ize the page pv lock pool to reduce contention It was found during building llvm that the page pv lock pool was seeing very high contention. Since the pmap is already NUMA aware, it was surmised that the domains were referencing similar pages in the different domains. This reduces contention to the point of noise in a lockstat(8) run (~51% down to under 5%), reducing build times by up to 20%. This doesn't do a perfect domain alignment, just a best-guess based on hardware available, that the domain is roughly specified in the upper bits of the PA. Trying to be more clever would more than likely result in reduced performance just on the work needed. MFC after: 2 weeks Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sat May 18 03:15:07 2019 (r347951) +++ head/sys/powerpc/aim/mmu_oea64.c Sat May 18 11:14:43 2019 (r347952) @@ -118,10 +118,18 @@ uintptr_t moea64_get_unique_vsid(void); * */ -#define PV_LOCK_COUNT PA_LOCK_COUNT*3 +#define PV_LOCK_PER_DOM PA_LOCK_COUNT*3 +#define PV_LOCK_COUNT PV_LOCK_PER_DOM*MAXMEMDOM static struct mtx_padalign pv_lock[PV_LOCK_COUNT]; -#define PV_LOCKPTR(pa) ((struct mtx *)(&pv_lock[pa_index(pa) % PV_LOCK_COUNT])) +/* + * Cheap NUMA-izing of the pv locks, to reduce contention across domains. + * NUMA domains on POWER9 appear to be indexed as sparse memory spaces, with the + * index at (N << 45). + */ +#define PV_LOCK_IDX(pa) (pa_index(pa) % PV_LOCK_PER_DOM + \ + (((pa) >> 45) % MAXMEMDOM) * PV_LOCK_PER_DOM) +#define PV_LOCKPTR(pa) ((struct mtx *)(&pv_lock[PV_LOCK_IDX(pa)])) #define PV_LOCK(pa) mtx_lock(PV_LOCKPTR(pa)) #define PV_UNLOCK(pa) mtx_unlock(PV_LOCKPTR(pa)) #define PV_LOCKASSERT(pa) mtx_assert(PV_LOCKPTR(pa), MA_OWNED) From owner-svn-src-head@freebsd.org Sat May 18 12:27:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A48F115B158F; Sat, 18 May 2019 12:27:23 +0000 (UTC) (envelope-from allanjude@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 3FB0F7785F; Sat, 18 May 2019 12:27:23 +0000 (UTC) (envelope-from allanjude@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 15A971F90E; Sat, 18 May 2019 12:27:23 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4ICRM9s073718; Sat, 18 May 2019 12:27:22 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ICRMsG073717; Sat, 18 May 2019 12:27:22 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201905181227.x4ICRMsG073717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 18 May 2019 12:27:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347953 - head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Commit-Revision: 347953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3FB0F7785F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Sat, 18 May 2019 12:27:23 -0000 Author: allanjude Date: Sat May 18 12:27:22 2019 New Revision: 347953 URL: https://svnweb.freebsd.org/changeset/base/347953 Log: MFV/ZoL: `zfs userspace` ignored all unresolved UIDs after the first zfsonlinux/zfs@88cfff182432e4d1c24c877f33b47ee6cf109eee zfs_main: fix `zfs userspace` squashing unresolved entries The `zfs userspace` squashes all entries with unresolved numeric values into a single output entry due to the comparsion always made by the string name which is empty in case of unresolved IDs. Fix this by falling to a numerical comparison when either one of string values is not found. This then compares any numerical values after all with a name resolved. Signed-off-by: Pavel Boldin Signed-off-by: Brian Behlendorf Reported by: clusteradm Obtained from: ZFS-on-Linux MFC after: 3 days Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sat May 18 11:14:43 2019 (r347952) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sat May 18 12:27:22 2019 (r347953) @@ -2361,6 +2361,7 @@ us_compare(const void *larg, const void *rarg, void *u case ZFS_PROP_NAME: propname = "name"; if (numname) { +compare_nums: (void) nvlist_lookup_uint64(lnvl, propname, &lv64); (void) nvlist_lookup_uint64(rnvl, propname, @@ -2368,10 +2369,12 @@ us_compare(const void *larg, const void *rarg, void *u if (rv64 != lv64) rc = (rv64 < lv64) ? 1 : -1; } else { - (void) nvlist_lookup_string(lnvl, propname, - &lvstr); - (void) nvlist_lookup_string(rnvl, propname, - &rvstr); + if ((nvlist_lookup_string(lnvl, propname, + &lvstr) == ENOENT) || + (nvlist_lookup_string(rnvl, propname, + &rvstr) == ENOENT)) { + goto compare_nums; + } rc = strcmp(lvstr, rvstr); } break; From owner-svn-src-head@freebsd.org Sat May 18 12:37:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A00C15B1999; Sat, 18 May 2019 12:37:09 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (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 D1E6677FD0; Sat, 18 May 2019 12:37:08 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id C32BE7C46; Sat, 18 May 2019 12:37:08 +0000 (UTC) Date: Sat, 18 May 2019 12:37:08 +0000 From: Alexey Dokuchaev To: Allan Jude Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347953 - head/cddl/contrib/opensolaris/cmd/zfs Message-ID: <20190518123708.GA73234@FreeBSD.org> References: <201905181227.x4ICRMsG073717@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905181227.x4ICRMsG073717@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: D1E6677FD0 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.86 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.86)[-0.864,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: Sat, 18 May 2019 12:37:09 -0000 On Sat, May 18, 2019 at 12:27:22PM +0000, Allan Jude wrote: > New Revision: 347953 > URL: https://svnweb.freebsd.org/changeset/base/347953 > > Log: > MFV/ZoL: `zfs userspace` ignored all unresolved UIDs after the first > > zfsonlinux/zfs@88cfff182432e4d1c24c877f33b47ee6cf109eee > > zfs_main: fix `zfs userspace` squashing unresolved entries > > ... > @@ -2368,10 +2369,12 @@ us_compare(const void *larg, const void *rarg, void *u > if (rv64 != lv64) > rc = (rv64 < lv64) ? 1 : -1; > } else { > - (void) nvlist_lookup_string(lnvl, propname, > - &lvstr); > - (void) nvlist_lookup_string(rnvl, propname, > - &rvstr); > + if ((nvlist_lookup_string(lnvl, propname, > + &lvstr) == ENOENT) || > + (nvlist_lookup_string(rnvl, propname, > + &rvstr) == ENOENT)) { > + goto compare_nums; > + } Another thing not to like about ZoL: their completely bogus code style and formatting practices (look at those "&rvstr) == ENOENT"). If they are going to listen to us, can we at least try to convince them not to break existing, much FreeBSD-like formatting? ./danfe From owner-svn-src-head@freebsd.org Sat May 18 12:53:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 313E5158A1CD; Sat, 18 May 2019 12:53:35 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (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 BF27780F77; Sat, 18 May 2019 12:53:34 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [172.16.56.45] (unknown [66.171.165.146]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 6C9A81BC50; Sat, 18 May 2019 12:53:33 +0000 (UTC) Subject: Re: svn commit: r347953 - head/cddl/contrib/opensolaris/cmd/zfs To: Alexey Dokuchaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905181227.x4ICRMsG073717@repo.freebsd.org> <20190518123708.GA73234@FreeBSD.org> From: Allan Jude Message-ID: <289b3593-421b-44e9-4c0b-d128f8648dcf@freebsd.org> Date: Sat, 18 May 2019 04:53:35 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190518123708.GA73234@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: BF27780F77 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.952,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, 18 May 2019 12:53:35 -0000 On 5/18/19 8:37 AM, Alexey Dokuchaev wrote: > On Sat, May 18, 2019 at 12:27:22PM +0000, Allan Jude wrote: >> New Revision: 347953 >> URL: https://svnweb.freebsd.org/changeset/base/347953 >> >> Log: >> MFV/ZoL: `zfs userspace` ignored all unresolved UIDs after the first >> >> zfsonlinux/zfs@88cfff182432e4d1c24c877f33b47ee6cf109eee >> >> zfs_main: fix `zfs userspace` squashing unresolved entries >> >> ... >> @@ -2368,10 +2369,12 @@ us_compare(const void *larg, const void *rarg, void *u >> if (rv64 != lv64) >> rc = (rv64 < lv64) ? 1 : -1; >> } else { >> - (void) nvlist_lookup_string(lnvl, propname, >> - &lvstr); >> - (void) nvlist_lookup_string(rnvl, propname, >> - &rvstr); >> + if ((nvlist_lookup_string(lnvl, propname, >> + &lvstr) == ENOENT) || >> + (nvlist_lookup_string(rnvl, propname, >> + &rvstr) == ENOENT)) { >> + goto compare_nums; >> + } > > Another thing not to like about ZoL: their completely bogus code style > and formatting practices (look at those "&rvstr) == ENOENT"). If they > are going to listen to us, can we at least try to convince them not to > break existing, much FreeBSD-like formatting? > > ./danfe > They have strict CI that enforces Solaris cstyle, as that is what the code base has always used. No commit is merged until it passes that, and many other tests. -- Allan Jude From owner-svn-src-head@freebsd.org Sat May 18 13:00:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A407C158A342; Sat, 18 May 2019 13:00:20 +0000 (UTC) (envelope-from danfe@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 457D2812E9; Sat, 18 May 2019 13:00:20 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 2ECB6886F; Sat, 18 May 2019 13:00:20 +0000 (UTC) Date: Sat, 18 May 2019 13:00:20 +0000 From: Alexey Dokuchaev To: Allan Jude Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347953 - head/cddl/contrib/opensolaris/cmd/zfs Message-ID: <20190518130020.GA91640@FreeBSD.org> References: <201905181227.x4ICRMsG073717@repo.freebsd.org> <20190518123708.GA73234@FreeBSD.org> <289b3593-421b-44e9-4c0b-d128f8648dcf@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <289b3593-421b-44e9-4c0b-d128f8648dcf@freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 457D2812E9 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.87 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.87)[-0.869,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, 18 May 2019 13:00:20 -0000 On Sat, May 18, 2019 at 04:53:35AM -0400, Allan Jude wrote: > On 5/18/19 8:37 AM, Alexey Dokuchaev wrote: > > On Sat, May 18, 2019 at 12:27:22PM +0000, Allan Jude wrote: > >> New Revision: 347953 > >> URL: https://svnweb.freebsd.org/changeset/base/347953 > >> > >> ... > >> - (void) nvlist_lookup_string(lnvl, propname, > >> - &lvstr); > >> - (void) nvlist_lookup_string(rnvl, propname, > >> - &rvstr); > >> + if ((nvlist_lookup_string(lnvl, propname, > >> + &lvstr) == ENOENT) || > >> + (nvlist_lookup_string(rnvl, propname, > >> + &rvstr) == ENOENT)) { > >> + goto compare_nums; > >> + } > > > > Another thing not to like about ZoL: their completely bogus code style > > and formatting practices (look at those "&rvstr) == ENOENT"). If they > > are going to listen to us, can we at least try to convince them not to > > break existing, much FreeBSD-like formatting? > > They have strict CI that enforces Solaris cstyle, as that is what the > code base has always used. No commit is merged until it passes that, and > many other tests. Hmm, OK then, sorry for the noise. It looked rather bad in the email client, but that's common issue with tabs, I should've checked better. ./danfe From owner-svn-src-head@freebsd.org Sat May 18 13:02:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE0C8158A5A9 for ; Sat, 18 May 2019 13:02:09 +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 79ECD8167F for ; Sat, 18 May 2019 13:02:09 +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 56FFB881906; Sat, 18 May 2019 12:53:49 +0000 (UTC) From: Toomas Soome Message-Id: <826320C2-9DF0-4C22-8234-E0F66F8AAEB2@me.com> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r347953 - head/cddl/contrib/opensolaris/cmd/zfs Date: Sat, 18 May 2019 15:53:46 +0300 In-Reply-To: <20190518123708.GA73234@FreeBSD.org> Cc: Allan Jude , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Alexey Dokuchaev References: <201905181227.x4ICRMsG073717@repo.freebsd.org> <20190518123708.GA73234@FreeBSD.org> X-Mailer: Apple Mail (2.3445.104.11) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-18_10:, , 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=683 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1812120000 definitions=main-1905180093 X-Rspamd-Queue-Id: 79ECD8167F X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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: Sat, 18 May 2019 13:02:10 -0000 > On 18 May 2019, at 15:37, Alexey Dokuchaev wrote: >=20 > On Sat, May 18, 2019 at 12:27:22PM +0000, Allan Jude wrote: >> New Revision: 347953 >> URL: https://svnweb.freebsd.org/changeset/base/347953 >>=20 >> Log: >> MFV/ZoL: `zfs userspace` ignored all unresolved UIDs after the first >>=20 >> zfsonlinux/zfs@88cfff182432e4d1c24c877f33b47ee6cf109eee >>=20 >> zfs_main: fix `zfs userspace` squashing unresolved entries >>=20 >> ... >> @@ -2368,10 +2369,12 @@ us_compare(const void *larg, const void = *rarg, void *u >> if (rv64 !=3D lv64) >> rc =3D (rv64 < lv64) ? 1 : -1; >> } else { >> - (void) nvlist_lookup_string(lnvl, = propname, >> - &lvstr); >> - (void) nvlist_lookup_string(rnvl, = propname, >> - &rvstr); >> + if ((nvlist_lookup_string(lnvl, = propname, >> + &lvstr) =3D=3D ENOENT) = || >> + (nvlist_lookup_string(rnvl, = propname, >> + &rvstr) =3D=3D ENOENT)) = { >> + goto compare_nums; >> + } >=20 > Another thing not to like about ZoL: their completely bogus code style > and formatting practices (look at those "&rvstr) =3D=3D ENOENT"). If = they > are going to listen to us, can we at least try to convince them not to > break existing, much FreeBSD-like formatting? >=20 > ./danfe >=20 Actually it is required to use the proper cstyle=E2=80=A6 = https://github.com/zfsonlinux/zfs/blob/master/.github/CONTRIBUTING.md#styl= e-guides = Therefore bogus style is bug. rgds, toomas From owner-svn-src-head@freebsd.org Sat May 18 14:19:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87FF3158E64A; Sat, 18 May 2019 14:19:24 +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 2C32F840FF; Sat, 18 May 2019 14:19:24 +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 06EAD20B48; Sat, 18 May 2019 14:19:24 +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 x4IEJNB2031689; Sat, 18 May 2019 14:19:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4IEJNh9031688; Sat, 18 May 2019 14:19:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905181419.x4IEJNh9031688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 18 May 2019 14:19:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347955 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347955 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2C32F840FF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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, 18 May 2019 14:19:24 -0000 Author: markj Date: Sat May 18 14:19:23 2019 New Revision: 347955 URL: https://svnweb.freebsd.org/changeset/base/347955 Log: Update the DIAGNOSTIC-only vmem_check_sanity() after r347949. Cursor tags are special and shouldn't be subject to the existing checks. Reported by: kib, David Wolfskill MFC with: r347949 Modified: head/sys/kern/subr_vmem.c Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Sat May 18 13:27:09 2019 (r347954) +++ head/sys/kern/subr_vmem.c Sat May 18 14:19:23 2019 (r347955) @@ -1738,8 +1738,18 @@ vmem_check_sanity(vmem_t *vm) } } TAILQ_FOREACH(bt, &vm->vm_seglist, bt_seglist) { + if (bt->bt_type == BT_TYPE_CURSOR) { + if (bt->bt_start != 0 || bt->bt_size != 0) { + printf("corrupted cursor\n"); + return false; + } + continue; + } TAILQ_FOREACH(bt2, &vm->vm_seglist, bt_seglist) { if (bt == bt2) { + continue; + } + if (bt2->bt_type == BT_TYPE_CURSOR) { continue; } if (BT_ISSPAN_P(bt) != BT_ISSPAN_P(bt2)) { From owner-svn-src-head@freebsd.org Sat May 18 14:56:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B8AD158FAF9; Sat, 18 May 2019 14:56:01 +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 9F4798574C; Sat, 18 May 2019 14:56:00 +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 7764D21201; Sat, 18 May 2019 14:56:00 +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 x4IEu0aT052498; Sat, 18 May 2019 14:56:00 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4IEu0O7052497; Sat, 18 May 2019 14:56:00 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905181456.x4IEu0O7052497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 18 May 2019 14:56:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347956 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 347956 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9F4798574C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Sat, 18 May 2019 14:56:01 -0000 Author: jhibbits Date: Sat May 18 14:55:59 2019 New Revision: 347956 URL: https://svnweb.freebsd.org/changeset/base/347956 Log: powerpc: Fix moea64 pmap from 347952 vm_paddr_t is only 32 bits on AIM32 (currently), causing a build failure with the shifting. MFC after: 2 weeks MFC with: r347952 Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sat May 18 14:19:23 2019 (r347955) +++ head/sys/powerpc/aim/mmu_oea64.c Sat May 18 14:55:59 2019 (r347956) @@ -127,8 +127,12 @@ static struct mtx_padalign pv_lock[PV_LOCK_COUNT]; * NUMA domains on POWER9 appear to be indexed as sparse memory spaces, with the * index at (N << 45). */ +#ifdef __powerpc64__ #define PV_LOCK_IDX(pa) (pa_index(pa) % PV_LOCK_PER_DOM + \ (((pa) >> 45) % MAXMEMDOM) * PV_LOCK_PER_DOM) +#else +#define PV_LOCK_IDX(pa) (pa_index(pa) % PV_LOCK_COUNT) +#endif #define PV_LOCKPTR(pa) ((struct mtx *)(&pv_lock[PV_LOCK_IDX(pa)])) #define PV_LOCK(pa) mtx_lock(PV_LOCKPTR(pa)) #define PV_UNLOCK(pa) mtx_unlock(PV_LOCKPTR(pa)) From owner-svn-src-head@freebsd.org Sat May 18 15:09:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 486D0158FE0E; Sat, 18 May 2019 15:09:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 807DB85BB0; Sat, 18 May 2019 15:09:45 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id F203D3DAE0A; Sun, 19 May 2019 01:09:41 +1000 (AEST) Date: Sun, 19 May 2019 01:09:40 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Toomas Soome cc: Alexey Dokuchaev , Allan Jude , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347953 - head/cddl/contrib/opensolaris/cmd/zfs In-Reply-To: <826320C2-9DF0-4C22-8234-E0F66F8AAEB2@me.com> Message-ID: <20190519002125.B1574@besplex.bde.org> References: <201905181227.x4ICRMsG073717@repo.freebsd.org> <20190518123708.GA73234@FreeBSD.org> <826320C2-9DF0-4C22-8234-E0F66F8AAEB2@me.com> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=D+Q3ErZj c=1 sm=1 tr=0 cx=a_idp_d a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=nlC_4_pT8q9DhB4Ho9EA:9 a=6I5d2MoRAAAA:8 a=FNC4LJVLAAAA:20 a=FAJiG0CWx46FUKgxyjcA:9 a=45ClL6m2LaAA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 807DB85BB0 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed 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: Sat, 18 May 2019 15:09:47 -0000 On Sat, 18 May 2019, Toomas Soome wrote: >> On 18 May 2019, at 15:37, Alexey Dokuchaev wrote: >> >> On Sat, May 18, 2019 at 12:27:22PM +0000, Allan Jude wrote: >>> New Revision: 347953 >>> URL: https://svnweb.freebsd.org/changeset/base/347953 >>> >>> Log: >>> MFV/ZoL: `zfs userspace` ignored all unresolved UIDs after the first >>> >>> zfsonlinux/zfs@88cfff182432e4d1c24c877f33b47ee6cf109eee >>> >>> zfs_main: fix `zfs userspace` squashing unresolved entries >>> >>> ... >>> @@ -2368,10 +2369,12 @@ us_compare(const void *larg, const void *rarg, = void *u >>> =09=09=09=09if (rv64 !=3D lv64) >>> =09=09=09=09=09rc =3D (rv64 < lv64) ? 1 : -1; >>> =09=09=09} else { >>> -=09=09=09=09(void) nvlist_lookup_string(lnvl, propname, >>> -=09=09=09=09 &lvstr); >>> -=09=09=09=09(void) nvlist_lookup_string(rnvl, propname, >>> -=09=09=09=09 &rvstr); >>> +=09=09=09=09if ((nvlist_lookup_string(lnvl, propname, >>> +=09=09=09=09=09=09&lvstr) =3D=3D ENOENT) || >>> +=09=09=09=09 (nvlist_lookup_string(rnvl, propname, >>> +=09=09=09=09=09=09&rvstr) =3D=3D ENOENT)) { >>> +=09=09=09=09=09goto compare_nums; >>> +=09=09=09=09} >> >> Another thing not to like about ZoL: their completely bogus code style >> and formatting practices (look at those "&rvstr) =3D=3D ENOENT"). If th= ey >> are going to listen to us, can we at least try to convince them not to >> break existing, much FreeBSD-like formatting? > > Actually it is required to use the proper cstyle=E2=80=A6 https://github.= com/zfsonlinux/zfs/blob/master/.github/CONTRIBUTING.md#style-guides > > Therefore bogus style is bug. Indeed, the change was away from the proper cstyle. Old zfs code is closer to KNF than most FreeBSD code, perhaps because its cstyle guide is better than style(9) and is actually followed. It requires 4-space continuation indents the same as KNF, but these were broken in the patch. It requires casts to not be followed by a blank (i.e., space), except, unfortunately, for function calls whose return values are ignored. So the old code above conformed to cstyle but not to style(9) since it has spaces after "(void)" but otherwise conforms to KNF. The cstyle pdf in the above url was written in 1993 and last updated in 1996. Its age would be a feature, except it has only primitive support for C90 (it never mentions "prototype" or ISO C, but has a couple of examples of "ANSI" function definitions). So it isn't actually better than style(9), and I doubt that anyone actually follows all of it. Especially its requirement to support K&R in headers and its examples of incomplete K&R-compatible declarations. Bruce From owner-svn-src-head@freebsd.org Sat May 18 16:19:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 528FC15919EB; Sat, 18 May 2019 16:19:32 +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 E4A3D886E0; Sat, 18 May 2019 16:19:31 +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 BFC6C21F4E; Sat, 18 May 2019 16:19:31 +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 x4IGJVo6095201; Sat, 18 May 2019 16:19:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4IGJVF6095199; Sat, 18 May 2019 16:19:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905181619.x4IGJVF6095199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 18 May 2019 16:19:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347957 - 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: 347957 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E4A3D886E0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Sat, 18 May 2019 16:19:32 -0000 Author: kib Date: Sat May 18 16:19:31 2019 New Revision: 347957 URL: https://svnweb.freebsd.org/changeset/base/347957 Log: Make lock-less delayed invalidation operational very early. Apparently, there is more code trying to call pmap_remove() early, mostly to free preloaded memory. Instead of moving all deallocations to the point where a scheduler is initialized, add missed setup of thread0 di init at hammer_time(). The code in pmap_delayed_invl_start_u() is modified to not ever take the thread lock if the thread priority is less or equal to PVM. Since thread0 starts at priority 0, and then is reset to PVM at proc0_init(), this eliminates taking the thread lock during early boot. While there, fix off by one in comparision of the base priority. Reported and tested by: bcran (previous version) Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 29 days Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sat May 18 14:55:59 2019 (r347956) +++ head/sys/amd64/amd64/machdep.c Sat May 18 16:19:31 2019 (r347957) @@ -1617,6 +1617,13 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) physfree += kstack0_sz; /* + * Initialize enough of thread0 for delayed invalidation to + * work very early. Rely on thread0.td_base_pri + * zero-initialization, it is reset to PVM at proc0_init(). + */ + pmap_thread_init_invl_gen(&thread0); + + /* * make gdt memory segments */ for (x = 0; x < NGDT; x++) { Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat May 18 14:55:59 2019 (r347956) +++ head/sys/amd64/amd64/pmap.c Sat May 18 16:19:31 2019 (r347957) @@ -700,16 +700,17 @@ pmap_delayed_invl_start_u(void) invl_gen = &td->td_md.md_invl_gen; PMAP_ASSERT_NOT_IN_DI(); lock_delay_arg_init(&lda, &di_delay); - thread_lock(td); + invl_gen->saved_pri = 0; pri = td->td_base_pri; - if (pri < PVM) { - invl_gen->saved_pri = 0; - } else { - invl_gen->saved_pri = pri; - sched_prio(td, PVM); + if (pri > PVM) { + thread_lock(td); + pri = td->td_base_pri; + if (pri > PVM) { + invl_gen->saved_pri = pri; + sched_prio(td, PVM); + } + thread_unlock(td); } - thread_unlock(td); - again: PV_STAT(i = 0); for (p = &pmap_invl_gen_head;; p = prev.next) { From owner-svn-src-head@freebsd.org Sat May 18 17:13:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 113441592E42; Sat, 18 May 2019 17:13:09 +0000 (UTC) (envelope-from brd@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 A921689F02; Sat, 18 May 2019 17:13:08 +0000 (UTC) (envelope-from brd@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 837AC22941; Sat, 18 May 2019 17:13:08 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4IHD8Mp026244; Sat, 18 May 2019 17:13:08 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4IHD8ut026243; Sat, 18 May 2019 17:13:08 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201905181713.x4IHD8ut026243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sat, 18 May 2019 17:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347958 - head/tools/build X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: head/tools/build X-SVN-Commit-Revision: 347958 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A921689F02 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Sat, 18 May 2019 17:13:09 -0000 Author: brd Date: Sat May 18 17:13:08 2019 New Revision: 347958 URL: https://svnweb.freebsd.org/changeset/base/347958 Log: Update beinstall to use the mergemaster/etcupdate from the source tree instead of the installed one. Approved by: will (mentor) Differential Revision: https://reviews.freebsd.org/D20291 Modified: head/tools/build/beinstall.sh Modified: head/tools/build/beinstall.sh ============================================================================== --- head/tools/build/beinstall.sh Sat May 18 16:19:31 2019 (r347957) +++ head/tools/build/beinstall.sh Sat May 18 17:13:08 2019 (r347958) @@ -54,10 +54,6 @@ MERGEMASTER_FLAGS="${MERGEMASTER_FLAGS:-"-iFU"}" ######################################################################## -## Constants -ETCUPDATE_CMD="etcupdate" -MERGEMASTER_CMD="mergemaster" - ## Functions cleanup() { [ -z "${cleanup_commands}" ] && return @@ -126,23 +122,22 @@ create_be_dirs() { } update_mergemaster_pre() { - mergemaster -p -m ${srcdir} -D ${BE_MNTPT} -t ${BE_MM_ROOT} ${MERGEMASTER_FLAGS} + ${MERGEMASTER_CMD} -p -m ${srcdir} -D ${BE_MNTPT} -t ${BE_MM_ROOT} ${MERGEMASTER_FLAGS} } update_mergemaster() { - chroot ${BE_MNTPT} \ - mergemaster -m ${srcdir} -t ${BE_MM_ROOT} ${MERGEMASTER_FLAGS} + ${MERGEMASTER_CMD} -m ${srcdir} -D ${BE_MNTPT} -t ${BE_MM_ROOT} ${MERGEMASTER_FLAGS} } update_etcupdate_pre() { - etcupdate -p -s ${srcdir} -D ${BE_MNTPT} ${ETCUPDATE_FLAGS} || return $? - etcupdate resolve -D ${BE_MNTPT} || return $? + ${ETCUPDATE_CMD} -p -s ${srcdir} -D ${BE_MNTPT} ${ETCUPDATE_FLAGS} || return $? + ${ETCUPDATE_CMD} resolve -D ${BE_MNTPT} || return $? } update_etcupdate() { chroot ${BE_MNTPT} \ - etcupdate -s ${srcdir} ${ETCUPDATE_FLAGS} || return $? - chroot ${BE_MNTPT} etcupdate resolve + ${ETCUPDATE_CMD} -s ${srcdir} ${ETCUPDATE_FLAGS} || return $? + chroot ${BE_MNTPT} ${ETCUPDATE_CMD} resolve } @@ -174,6 +169,10 @@ trap 'errx "Interrupt caught"' HUP INT TERM srcdir=$(pwd) objdir=$(make -V .OBJDIR 2>/dev/null) [ ! -d "${objdir}" ] && errx "Must have built FreeBSD from source tree" + +## Constants +ETCUPDATE_CMD="${srcdir}/usr.sbin/etcupdate/etcupdate.sh" +MERGEMASTER_CMD="${srcdir}/usr.sbin/mergemaster/mergemaster.sh" # May be a worktree, in which case .git is a file, not a directory. if [ -e .git ] ; then From owner-svn-src-head@freebsd.org Sat May 18 19:32:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB6B7159621B; Sat, 18 May 2019 19:32:39 +0000 (UTC) (envelope-from rgrimes@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 5A2938DF08; Sat, 18 May 2019 19:32:39 +0000 (UTC) (envelope-from rgrimes@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 2F953241C1; Sat, 18 May 2019 19:32:39 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4IJWdiR000872; Sat, 18 May 2019 19:32:39 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4IJWdMA000871; Sat, 18 May 2019 19:32:39 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201905181932.x4IJWdMA000871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Sat, 18 May 2019 19:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347960 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 347960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5A2938DF08 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; 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, 18 May 2019 19:32:40 -0000 Author: rgrimes Date: Sat May 18 19:32:38 2019 New Revision: 347960 URL: https://svnweb.freebsd.org/changeset/base/347960 Log: bhyve virtio needs barriers Under certain tight race conditions, we found that the lack of a memory barrier in bhyve's virtio handling causes it to miss a NO_NOTIFY state transition on block devices, resulting in guest stall. The investigation is recorded in OS-7613. As part of the examination into bhyve's use of barriers, one other section was found to be problematic, but only on non-x86 ISAs with less strict memory ordering. That was addressed in this patch as well, although it was not at all a problem on x86. PR: 231117 Submitted by: Patrick Mooney Reviewed by: jhb, kib, rgrimes Approved by: jhb MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D19501 Modified: head/usr.sbin/bhyve/virtio.c Modified: head/usr.sbin/bhyve/virtio.c ============================================================================== --- head/usr.sbin/bhyve/virtio.c Sat May 18 17:30:03 2019 (r347959) +++ head/usr.sbin/bhyve/virtio.c Sat May 18 19:32:38 2019 (r347960) @@ -3,6 +3,7 @@ * * Copyright (c) 2013 Chris Torek * All rights reserved. + * Copyright (c) 2019 Joyent, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,6 +33,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include @@ -422,6 +425,12 @@ vq_relchain(struct vqueue_info *vq, uint16_t idx, uint vue = &vuh->vu_ring[uidx++ & mask]; vue->vu_idx = idx; vue->vu_tlen = iolen; + + /* + * Ensure the used descriptor is visible before updating the index. + * This is necessary on ISAs with memory ordering less strict than x86. + */ + atomic_thread_fence_rel(); vuh->vu_idx = uidx; } @@ -459,6 +468,13 @@ vq_endchains(struct vqueue_info *vq, int used_all_avai vs = vq->vq_vs; old_idx = vq->vq_save_used; vq->vq_save_used = new_idx = vq->vq_used->vu_idx; + + /* + * Use full memory barrier between vu_idx store from preceding + * vq_relchain() call and the loads from VQ_USED_EVENT_IDX() or + * va_flags below. + */ + atomic_thread_fence_seq_cst(); if (used_all_avail && (vs->vs_negotiated_caps & VIRTIO_F_NOTIFY_ON_EMPTY)) intr = 1; From owner-svn-src-head@freebsd.org Sat May 18 19:36:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D2C415963A9; Sat, 18 May 2019 19:36:24 +0000 (UTC) (envelope-from brd@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 430348E121; Sat, 18 May 2019 19:36:24 +0000 (UTC) (envelope-from brd@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 12D54241D7; Sat, 18 May 2019 19:36:24 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4IJaN6A001184; Sat, 18 May 2019 19:36:23 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4IJaNir001183; Sat, 18 May 2019 19:36:23 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201905181936.x4IJaNir001183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sat, 18 May 2019 19:36:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347961 - head X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 347961 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 430348E121 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Sat, 18 May 2019 19:36:24 -0000 Author: brd Date: Sat May 18 19:36:23 2019 New Revision: 347961 URL: https://svnweb.freebsd.org/changeset/base/347961 Log: Add note to UPDATING for users of mergemaster after the move of master.passwd and group in r347638. Approved by: allanjude (mentor) Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat May 18 19:32:38 2019 (r347960) +++ head/UPDATING Sat May 18 19:36:23 2019 (r347961) @@ -31,6 +31,12 @@ 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".) +20190517: + For users of mergemaster, after recent changes to locations of + master.passwd and group in the source tree mergemaster needs to be + updated. Before running `mergemaster -p', cd to usr.sbin/mergemaster + and run `make install'. + 20190513: User-wired pages now have their own counter, vm.stats.vm.v_user_wire_count. The vm.max_wired sysctl was renamed From owner-svn-src-head@freebsd.org Sat May 18 21:01:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A63B915982A0; Sat, 18 May 2019 21:01:38 +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 4412C69B0B; Sat, 18 May 2019 21:01:38 +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 03CBD2518B; Sat, 18 May 2019 21:01:38 +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 x4IL1b4v048394; Sat, 18 May 2019 21:01:37 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4IL1awb048389; Sat, 18 May 2019 21:01:36 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905182101.x4IL1awb048389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sat, 18 May 2019 21:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347963 - in head: libexec/rc sbin/ifconfig share/man/man5 tools/tools/tinybsd/conf/firewall/etc usr.sbin/jail X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: libexec/rc sbin/ifconfig share/man/man5 tools/tools/tinybsd/conf/firewall/etc usr.sbin/jail X-SVN-Commit-Revision: 347963 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4412C69B0B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Sat, 18 May 2019 21:01:39 -0000 Author: brooks Date: Sat May 18 21:01:36 2019 New Revision: 347963 URL: https://svnweb.freebsd.org/changeset/base/347963 Log: Change ed(4), ep(4), and fxp(4) examples to em(4). ed(4) and ep(4) have been removed. fxp(4) remains popular in older systems, but isn't as future proof as em(4). Reviewed by: bz, jhb MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D20311 Modified: head/libexec/rc/rc.conf head/sbin/ifconfig/ifconfig.8 head/share/man/man5/rc.conf.5 head/tools/tools/tinybsd/conf/firewall/etc/rc.firewall head/usr.sbin/jail/jail.8 Modified: head/libexec/rc/rc.conf ============================================================================== --- head/libexec/rc/rc.conf Sat May 18 20:43:13 2019 (r347962) +++ head/libexec/rc/rc.conf Sat May 18 21:01:36 2019 (r347963) @@ -121,9 +121,9 @@ hostid_file="/etc/hostid" # File with hostuuid. nisdomainname="NO" # Set to NIS domain if using NIS (or NO). dhclient_program="/sbin/dhclient" # Path to dhcp client program. dhclient_flags="" # Extra flags to pass to dhcp client. -#dhclient_flags_fxp0="" # Extra dhclient flags for fxp0 only +#dhclient_flags_em0="" # Extra dhclient flags for em0 only background_dhclient="NO" # Start dhcp client in the background. -#background_dhclient_fxp0="YES" # Start dhcp client on fxp0 in the background. +#background_dhclient_em0="YES" # Start dhcp client on em0 in the background. synchronous_dhclient="NO" # Start dhclient directly on configured # interfaces during startup. defaultroute_delay="30" # Time to wait for a default route on a DHCP interface. @@ -147,19 +147,19 @@ firewall_client_net="192.0.2.0/24" # IPv4 Network addr # firewall. #firewall_client_net_ipv6="2001:db8:2:1::/64" # IPv6 network prefix for # "client" firewall. -firewall_simple_iif="ed1" # Inside network interface for "simple" +firewall_simple_iif="em1" # Inside network interface for "simple" # firewall. firewall_simple_inet="192.0.2.16/28" # Inside network address for "simple" # firewall. -firewall_simple_oif="ed0" # Outside network interface for "simple" +firewall_simple_oif="em0" # Outside network interface for "simple" # firewall. firewall_simple_onet="192.0.2.0/28" # Outside network address for "simple" # firewall. -#firewall_simple_iif_ipv6="ed1" # Inside IPv6 network interface for "simple" +#firewall_simple_iif_ipv6="em1" # Inside IPv6 network interface for "simple" # firewall. #firewall_simple_inet_ipv6="2001:db8:2:800::/56" # Inside IPv6 network prefix # for "simple" firewall. -#firewall_simple_oif_ipv6="ed0" # Outside IPv6 network interface for "simple" +#firewall_simple_oif_ipv6="em0" # Outside IPv6 network interface for "simple" # firewall. #firewall_simple_onet_ipv6="2001:db8:2:0::/56" # Outside IPv6 network prefix # for "simple" firewall. @@ -241,14 +241,14 @@ cloned_interfaces="" # List of cloned network interfa #cloned_interfaces="gif0 gif1 gif2 gif3" # Pre-cloning GENERIC config. #ifconfig_lo0="inet 127.0.0.1" # default loopback device configuration. #ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry. -#ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64" # Sample IPv6 addr entry -#ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" # Sample IPv6 alias -#ifconfig_fxp0_name="net0" # Change interface name from fxp0 to net0. -#vlans_fxp0="101 vlan0" # vlan(4) interfaces for fxp0 device +#ifconfig_em0_ipv6="inet6 2001:db8:1::1 prefixlen 64" # Sample IPv6 addr entry +#ifconfig_em0_alias0="inet6 2001:db8:2::1 prefixlen 64" # Sample IPv6 alias +#ifconfig_em0_name="net0" # Change interface name from em0 to net0. +#vlans_em0="101 vlan0" # vlan(4) interfaces for em0 device #create_args_vlan0="vlan 102" # vlan tag for vlan0 device #wlans_ath0="wlan0" # wlan(4) interfaces for ath0 device #wlandebug_wlan0="scan+auth+assoc" # Set debug flags with wlandebug(8) -#ipv4_addrs_fxp0="192.168.0.1/24 192.168.1.1-5/28" # example IPv4 address entry. +#ipv4_addrs_em0="192.168.0.1/24 192.168.1.1-5/28" # example IPv4 address entry. # #autobridge_interfaces="bridge0" # List of bridges to check #autobridge_bridge0="tap* vlan0" # Interface glob to automatically add to the bridge @@ -336,7 +336,7 @@ bootparamd_flags="" # Flags to bootparamd pppoed_enable="NO" # Run the PPP over Ethernet daemon. pppoed_provider="*" # Provider and ppp(8) config file entry. pppoed_flags="-P /var/run/pppoed.pid" # Flags to pppoed (if enabled). -pppoed_interface="fxp0" # The interface that pppoed runs on. +pppoed_interface="em0" # The interface that pppoed runs on. sshd_enable="NO" # Enable sshd sshd_program="/usr/sbin/sshd" # path to sshd, if you want a different one. sshd_flags="" # Additional flags for sshd. @@ -506,11 +506,11 @@ route6d_flags="" # Flags to IPv6 routing daemon. # addrs. #route6d_flags="-q" # If you want to run a routing daemon on an end # node, you should stop advertisement. -#ipv6_network_interfaces="ed0 ep0" # Examples for router +#ipv6_network_interfaces="em0 em1" # Examples for router # or static configuration for end node. # Choose correct prefix value. -#ipv6_prefix_ed0="fec0:0000:0000:0001 fec0:0000:0000:0002" # Examples for rtr. -#ipv6_prefix_ep0="fec0:0000:0000:0003 fec0:0000:0000:0004" # Examples for rtr. +#ipv6_prefix_em0="fec0:0000:0000:0001 fec0:0000:0000:0002" # Examples for rtr. +#ipv6_prefix_em1="fec0:0000:0000:0003 fec0:0000:0000:0004" # Examples for rtr. ipv6_default_interface="NO" # Default output interface for scoped addrs. # This works only with # ipv6_gateway_enable="NO". Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Sat May 18 20:43:13 2019 (r347962) +++ head/sbin/ifconfig/ifconfig.8 Sat May 18 21:01:36 2019 (r347963) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd May 3, 2019 +.Dd May 18, 2019 .Dt IFCONFIG 8 .Os .Sh NAME @@ -196,7 +196,7 @@ This parameter is a string of the form .Dq name unit , for example, -.Dq Li ed0 . +.Dq Li em0 . .It Ar groupname List the interfaces in the given group. .El @@ -2935,26 +2935,26 @@ Assign the IPv4 address with a network mask of .Li 255.255.255.0 , to the interface -.Li fxp0 : -.Dl # ifconfig fxp0 inet 192.0.2.10 netmask 255.255.255.0 +.Li em0 : +.Dl # ifconfig em0 inet 192.0.2.10 netmask 255.255.255.0 .Pp Add the IPv4 address .Li 192.0.2.45 , with the CIDR network prefix .Li /28 , to the interface -.Li ed0 , +.Li em0 , using .Cm add as a synonym for the canonical form of the option .Cm alias : -.Dl # ifconfig ed0 inet 192.0.2.45/28 add +.Dl # ifconfig em0 inet 192.0.2.45/28 add .Pp Remove the IPv4 address .Li 192.0.2.45 from the interface -.Li ed0 : -.Dl # ifconfig ed0 inet 192.0.2.45 -alias +.Li em0 : +.Dl # ifconfig em0 inet 192.0.2.45 -alias .Pp Enable IPv6 functionality of the interface: .Dl # ifconfig em0 inet6 -ifdisabled Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Sat May 18 20:43:13 2019 (r347962) +++ head/share/man/man5/rc.conf.5 Sat May 18 21:01:36 2019 (r347963) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 21, 2019 +.Dd May 18, 2019 .Dt RC.CONF 5 .Os .Sh NAME @@ -1264,11 +1264,11 @@ It is possible to add IP alias entries using syntax with the address family keyword such as .Li inet . Assuming that the interface in question was -.Li ed0 , +.Li em0 , it might look something like this: .Bd -literal -ifconfig_ed0_alias0="inet 127.0.0.253 netmask 0xffffffff" -ifconfig_ed0_alias1="inet 127.0.0.254 netmask 0xffffffff" +ifconfig_em0_alias0="inet 127.0.0.253 netmask 0xffffffff" +ifconfig_em0_alias1="inet 127.0.0.254 netmask 0xffffffff" .Ed .Pp It also possible to configure multiple IP addresses in Classless @@ -1308,11 +1308,11 @@ not for the other address families such as .Li inet6 . .Pp With the interface in question being -.Li ed0 , +.Li em0 , an example could look like: .Bd -literal -ifconfig_ed0_alias2="inet 192.0.2.129/27" -ifconfig_ed0_alias3="inet 192.0.2.1-5/28" +ifconfig_em0_alias2="inet 192.0.2.129/27" +ifconfig_em0_alias3="inet 192.0.2.1-5/28" .Ed .Pp and so on. @@ -1334,10 +1334,10 @@ its contents are passed to Execution stops at the first unsuccessful access, so if something like this is present: .Bd -literal -ifconfig_ed0_alias0="inet 127.0.0.251 netmask 0xffffffff" -ifconfig_ed0_alias1="inet 127.0.0.252 netmask 0xffffffff" -ifconfig_ed0_alias2="inet 127.0.0.253 netmask 0xffffffff" -ifconfig_ed0_alias4="inet 127.0.0.254 netmask 0xffffffff" +ifconfig_em0_alias0="inet 127.0.0.251 netmask 0xffffffff" +ifconfig_em0_alias1="inet 127.0.0.252 netmask 0xffffffff" +ifconfig_em0_alias2="inet 127.0.0.253 netmask 0xffffffff" +ifconfig_em0_alias4="inet 127.0.0.254 netmask 0xffffffff" .Ed .Pp Then note that alias4 would @@ -1353,7 +1353,7 @@ variable, which has the same functionality as .Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Ns Aq Ar n and can have all of entries in a variable like the following: .Bd -literal -ifconfig_ed0_aliases="\\ +ifconfig_em0_aliases="\\ inet 127.0.0.251 netmask 0xffffffff \\ inet 127.0.0.252 netmask 0xffffffff \\ inet 127.0.0.253 netmask 0xffffffff \\ @@ -1460,11 +1460,11 @@ to the .Va ifconfig_ Ns Aq Ar interface variable. For instance, to initialize the -.Li ed0 +.Li em0 device via DHCP, it is possible to use something like: .Bd -literal -ifconfig_ed0="DHCP" +ifconfig_em0="DHCP" .Ed .Pp If you want to configure your wireless interface with @@ -1515,7 +1515,7 @@ variable. .Pp It is also possible to rename an interface by doing: .Bd -literal -ifconfig_ed0_name="net0" +ifconfig_em0_name="net0" ifconfig_net0="inet 192.0.2.1 netmask 0xffffff00" .Ed .It Va ipv6_enable @@ -1688,8 +1688,8 @@ with keyword. For example: .Bd -literal -ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64" -ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64" +ifconfig_em0_ipv6="inet6 2001:db8:1::1 prefixlen 64" +ifconfig_em0_alias0="inet6 2001:db8:2::1 prefixlen 64" .Ed .Pp Interfaces that have an @@ -1716,7 +1716,7 @@ defined in If only a link-local address is needed on the interface, the following configuration can be used: .Bd -literal -ifconfig_ed0_ipv6="inet6 auto_linklocal" +ifconfig_em0_ipv6="inet6 auto_linklocal" .Ed .Pp A link-local address can also be configured manually. @@ -1725,7 +1725,7 @@ so that it does not change when the network interface card is replaced. For example: .Bd -literal -ifconfig_ed0_ipv6="inet6 fe80::1 prefixlen 64" +ifconfig_em0_ipv6="inet6 fe80::1 prefixlen 64" .Ed .It Va ipv6_prefix_ Ns Aq Ar interface .Pq Vt str @@ -1739,15 +1739,15 @@ is empty. .Pp For example, the following configuration .Bd -literal -ipv6_prefix_ed0="2001:db8:1:0 2001:db8:2:0" +ipv6_prefix_em0="2001:db8:1:0 2001:db8:2:0" .Ed .Pp is equivalent to the following: .Bd -literal -ifconfig_ed0_alias0="inet6 2001:db8:1:: eui64 prefixlen 64" -ifconfig_ed0_alias1="inet6 2001:db8:1:: prefixlen 64 anycast" -ifconfig_ed0_alias2="inet6 2001:db8:2:: eui64 prefixlen 64" -ifconfig_ed0_alias3="inet6 2001:db8:2:: prefixlen 64 anycast" +ifconfig_em0_alias0="inet6 2001:db8:1:: eui64 prefixlen 64" +ifconfig_em0_alias1="inet6 2001:db8:1:: prefixlen 64 anycast" +ifconfig_em0_alias2="inet6 2001:db8:2:: eui64 prefixlen 64" +ifconfig_em0_alias3="inet6 2001:db8:2:: prefixlen 64 anycast" .Ed .Pp These Subnet-Router anycast addresses will be added only when Modified: head/tools/tools/tinybsd/conf/firewall/etc/rc.firewall ============================================================================== --- head/tools/tools/tinybsd/conf/firewall/etc/rc.firewall Sat May 18 20:43:13 2019 (r347962) +++ head/tools/tools/tinybsd/conf/firewall/etc/rc.firewall Sat May 18 21:01:36 2019 (r347963) @@ -195,13 +195,13 @@ case ${firewall_type} in ############ # set these to your outside interface network and netmask and ip - oif="ed0" + oif="em0" onet="192.0.2.0" omask="255.255.255.240" oip="192.0.2.1" # set these to your inside interface network and netmask and ip - iif="ed1" + iif="em1" inet="192.0.2.16" imask="255.255.255.240" iip="192.0.2.17" Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Sat May 18 20:43:13 2019 (r347962) +++ head/usr.sbin/jail/jail.8 Sat May 18 21:01:36 2019 (r347963) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 27, 2018 +.Dd May 18, 2019 .Dt JAIL 8 .Os .Sh NAME @@ -1101,7 +1101,7 @@ testjail { mount.devfs; host.hostname = testhostname; ip4.addr = 192.0.2.100; - interface = ed0; + interface = em0; exec.start = "/bin/sh /etc/rc"; exec.stop = "/bin/sh /etc/rc.shutdown"; } From owner-svn-src-head@freebsd.org Sat May 18 21:20:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3B5C15986D3; Sat, 18 May 2019 21:20:39 +0000 (UTC) (envelope-from jhb@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 71E5A6A28B; Sat, 18 May 2019 21:20:39 +0000 (UTC) (envelope-from jhb@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 64490253D6; Sat, 18 May 2019 21:20:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4ILKdMU054658; Sat, 18 May 2019 21:20:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ILKdwG054657; Sat, 18 May 2019 21:20:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905182120.x4ILKdwG054657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 18 May 2019 21:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347964 - head/sys/amd64/vmm X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/amd64/vmm X-SVN-Commit-Revision: 347964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 71E5A6A28B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, 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: Sat, 18 May 2019 21:20:40 -0000 Author: jhb Date: Sat May 18 21:20:38 2019 New Revision: 347964 URL: https://svnweb.freebsd.org/changeset/base/347964 Log: Expose the MD_CLEAR capability used by Intel MDS mitigations to guests. Submitted by: Patrick Mooney Reviewed by: kib Tested by: Patrick on SmartOS with Linux and Windows guests Obtained from: Joyent MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D20296 Modified: head/sys/amd64/vmm/x86.c Modified: head/sys/amd64/vmm/x86.c ============================================================================== --- head/sys/amd64/vmm/x86.c Sat May 18 21:01:36 2019 (r347963) +++ head/sys/amd64/vmm/x86.c Sat May 18 21:20:38 2019 (r347964) @@ -437,7 +437,7 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, CPUID_STDEXT_AVX512ER | CPUID_STDEXT_AVX512CD | CPUID_STDEXT_SHA); regs[2] = 0; - regs[3] = 0; + regs[3] &= CPUID_STDEXT3_MD_CLEAR; /* Advertise INVPCID if it is enabled. */ error = vm_get_capability(vm, vcpu_id,