Re: svn commit: r351319 - in head/usr.sbin/makefs: ffs msdos
On Wed, 21 Aug 2019, Ed Maste wrote: Author: emaste Date: Wed Aug 21 01:45:29 2019 New Revision: 351319 URL: https://svnweb.freebsd.org/changeset/base/351319 Log: makefs: use `char *` not `void *` for buf b_data, drop casts in msdos (The kernel uses caddr_t.) This is much better than churning the copy of the working code. However, the kernel type is still bogus. caddr_t should not exist, and should have been more like vm_offset_t to begin with. void * is no good as an opaque type for it, since void * is only good for C addresses within a single address space, but caddr_t is supposed to be able to represent anything in a (possibly multiple) "core" address space. [u]intptr_t has the same problem. Bus space addresses are also withing a single address space and in general need a tag for uniqueness. caddr_t has been char * for too long, so too much code including buf b_data depends on it being precisely char * or u_char * to work. char * is an honestly broken variant of void *. It is similarly limited to a single address space. This is hard to fix. It works for [Free]BSD since no arches with more than a single address space are supported (i386 with PAE or pae_mode=1 or pae_mode has a larger physical address space where addresses aren't unique, but only the kernel can see this). Bruce ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r351622 - head/sys/kern
Author: mjg Date: Fri Aug 30 00:45:53 2019 New Revision: 351622 URL: https://svnweb.freebsd.org/changeset/base/351622 Log: vfs: tidy up assertions in vfs_subr - assert unlocked vnode interlock in vref - assert right counts in vputx - print debug info for panic in vdrop Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c == --- head/sys/kern/vfs_subr.cFri Aug 30 00:40:08 2019(r351621) +++ head/sys/kern/vfs_subr.cFri Aug 30 00:45:53 2019(r351622) @@ -2778,6 +2778,7 @@ void vref(struct vnode *vp) { + ASSERT_VI_UNLOCKED(vp, __func__); CTR2(KTR_VFS, "%s: vp %p", __func__, vp); _vhold(vp, false); v_incr_usecount(vp); @@ -2853,6 +2854,9 @@ vputx(struct vnode *vp, int func) else KASSERT(func == VPUTX_VRELE, ("vputx: wrong func")); ASSERT_VI_UNLOCKED(vp, __func__); + VNASSERT(vp->v_holdcnt > 0 && vp->v_usecount > 0, vp, + ("%s: wrong ref counts", __func__)); + CTR2(KTR_VFS, "%s: vp %p", __func__, vp); if (vp->v_type != VCHR && @@ -3069,8 +3073,10 @@ _vdrop(struct vnode *vp, bool locked) else ASSERT_VI_UNLOCKED(vp, __func__); CTR2(KTR_VFS, "%s: vp %p", __func__, vp); - if ((int)vp->v_holdcnt <= 0) - panic("vdrop: holdcnt %d", vp->v_holdcnt); + if (__predict_false((int)vp->v_holdcnt <= 0)) { + vn_printf(vp, "vdrop: holdcnt %d", vp->v_holdcnt); + panic("vdrop: wrong holdcnt"); + } if (!locked) { if (refcount_release_if_not_last(>v_holdcnt)) return; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r351621 - head/sys/dev/xdma
Author: emaste Date: Fri Aug 30 00:40:08 2019 New Revision: 351621 URL: https://svnweb.freebsd.org/changeset/base/351621 Log: xdma: avoid NULL deref in error case Reported by: Dr Silvio Cesare of InfoSect MFC after:3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/xdma/xdma_sg.c Modified: head/sys/dev/xdma/xdma_sg.c == --- head/sys/dev/xdma/xdma_sg.c Fri Aug 30 00:38:16 2019(r351620) +++ head/sys/dev/xdma/xdma_sg.c Fri Aug 30 00:40:08 2019(r351621) @@ -186,8 +186,7 @@ xchan_bufs_alloc(xdma_channel_t *xchan) xdma = xchan->xdma; if (xdma == NULL) { - device_printf(xdma->dev, - "%s: Channel was not allocated properly.\n", __func__); + printf("%s: Channel was not allocated properly.\n", __func__); return (-1); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r351620 - head/sys/dev/qlxgbe
Author: emaste Date: Fri Aug 30 00:38:16 2019 New Revision: 351620 URL: https://svnweb.freebsd.org/changeset/base/351620 Log: qlxgbe: avoid NULL deref in error case Reported by: Dr Silvio Cesare of InfoSect MFC after:3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/qlxgbe/ql_isr.c Modified: head/sys/dev/qlxgbe/ql_isr.c == --- head/sys/dev/qlxgbe/ql_isr.cFri Aug 30 00:36:17 2019 (r351619) +++ head/sys/dev/qlxgbe/ql_isr.cFri Aug 30 00:38:16 2019 (r351620) @@ -793,7 +793,7 @@ ql_mbx_isr(void *arg) ha = arg; if (ha == NULL) { - device_printf(ha->pci_dev, "%s: arg == NULL\n", __func__); + printf("%s: arg == NULL\n", __func__); return; } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r351619 - head/sys/arm/samsung/exynos
Author: emaste Date: Fri Aug 30 00:36:17 2019 New Revision: 351619 URL: https://svnweb.freebsd.org/changeset/base/351619 Log: exynos5: avoid NULL deref in error case Reported by: Dr Silvio Cesare of InfoSect MFC after:3 days MFC with: r351618 Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/samsung/exynos/exynos5_pad.c Modified: head/sys/arm/samsung/exynos/exynos5_pad.c == --- head/sys/arm/samsung/exynos/exynos5_pad.c Fri Aug 30 00:34:27 2019 (r351618) +++ head/sys/arm/samsung/exynos/exynos5_pad.c Fri Aug 30 00:36:17 2019 (r351619) @@ -410,7 +410,7 @@ pad_setup_intr(int gpio_number, void (*ih)(void *), vo sc = gpio_sc; if (sc == NULL) { - device_printf(sc->dev, "Error: pad is not attached\n"); + printf("%s: Error: pad is not attached\n", __func__); return (-1); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r351618 - head/sys/arm/samsung/exynos
Author: emaste Date: Fri Aug 30 00:34:27 2019 New Revision: 351618 URL: https://svnweb.freebsd.org/changeset/base/351618 Log: exynos5: avoid NULL deref in error case Reported by: Dr Silvio Cesare of InfoSect MFC after:3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/samsung/exynos/exynos5_combiner.c Modified: head/sys/arm/samsung/exynos/exynos5_combiner.c == --- head/sys/arm/samsung/exynos/exynos5_combiner.c Fri Aug 30 00:30:03 2019(r351617) +++ head/sys/arm/samsung/exynos/exynos5_combiner.c Fri Aug 30 00:34:27 2019(r351618) @@ -314,7 +314,7 @@ combiner_setup_intr(char *source_name, void (*ih)(void sc = combiner_sc; if (sc == NULL) { - device_printf(sc->dev, "Error: combiner is not attached\n"); + printf("%s: error: combiner is not attached\n", __func__); return; } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r351617 - head/sys/fs/nullfs
Author: mjg Date: Fri Aug 30 00:30:03 2019 New Revision: 351617 URL: https://svnweb.freebsd.org/changeset/base/351617 Log: nullfs: use VOP_NEED_INACTIVE Reviewed by: kib Tested by:pho (previous version) Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null_vnops.c == --- head/sys/fs/nullfs/null_vnops.c Fri Aug 30 00:05:04 2019 (r351616) +++ head/sys/fs/nullfs/null_vnops.c Fri Aug 30 00:30:03 2019 (r351617) @@ -732,14 +732,13 @@ null_unlock(struct vop_unlock_args *ap) * ours. */ static int -null_inactive(struct vop_inactive_args *ap __unused) +null_want_recycle(struct vnode *vp) { - struct vnode *vp, *lvp; + struct vnode *lvp; struct null_node *xp; struct mount *mp; struct null_mount *xmp; - vp = ap->a_vp; xp = VTONULL(vp); lvp = NULLVPTOLOWERVP(vp); mp = vp->v_mount; @@ -753,12 +752,31 @@ null_inactive(struct vop_inactive_args *ap __unused) * deleted, then free up the vnode so as not to tie up * the lower vnodes. */ + return (1); + } + return (0); +} + +static int +null_inactive(struct vop_inactive_args *ap) +{ + struct vnode *vp; + + vp = ap->a_vp; + if (null_want_recycle(vp)) { vp->v_object = NULL; vrecycle(vp); } return (0); } +static int +null_need_inactive(struct vop_need_inactive_args *ap) +{ + + return (null_want_recycle(ap->a_vp)); +} + /* * Now, the nullfs vnode and, due to the sharing lock, the lower * vnode, are exclusively locked, and we shall destroy the null vnode. @@ -907,7 +925,7 @@ struct vop_vector null_vnodeops = { .vop_getattr = null_getattr, .vop_getwritemount =null_getwritemount, .vop_inactive = null_inactive, - .vop_need_inactive =vop_stdneed_inactive, + .vop_need_inactive =null_need_inactive, .vop_islocked = vop_stdislocked, .vop_lock1 =null_lock, .vop_lookup = null_lookup, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r351616 - head/sys/dev/usb/net
Author: glebius Date: Fri Aug 30 00:05:04 2019 New Revision: 351616 URL: https://svnweb.freebsd.org/changeset/base/351616 Log: Use mbuf queue instead of ifqueue in USB network drivers. Reviewed by: stevek Modified: head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/net/if_axge.c head/sys/dev/usb/net/usb_ethernet.c head/sys/dev/usb/net/usb_ethernet.h Modified: head/sys/dev/usb/net/if_axe.c == --- head/sys/dev/usb/net/if_axe.c Fri Aug 30 00:03:41 2019 (r351615) +++ head/sys/dev/usb/net/if_axe.c Fri Aug 30 00:05:04 2019 (r351616) @@ -1149,7 +1149,7 @@ axe_rxeof(struct usb_ether *ue, struct usb_page_cache } } - _IF_ENQUEUE(>ue_rxq, m); + (void)mbufq_enqueue(>ue_rxq, m); return (0); } Modified: head/sys/dev/usb/net/if_axge.c == --- head/sys/dev/usb/net/if_axge.c Fri Aug 30 00:03:41 2019 (r351615) +++ head/sys/dev/usb/net/if_axge.c Fri Aug 30 00:05:04 2019 (r351616) @@ -1041,7 +1041,7 @@ axge_rxeof(struct usb_ether *ue, struct usb_page_cache } if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); - _IF_ENQUEUE(>ue_rxq, m); + (void)mbufq_enqueue(>ue_rxq, m); } static void Modified: head/sys/dev/usb/net/usb_ethernet.c == --- head/sys/dev/usb/net/usb_ethernet.c Fri Aug 30 00:03:41 2019 (r351615) +++ head/sys/dev/usb/net/usb_ethernet.c Fri Aug 30 00:05:04 2019 (r351616) @@ -598,7 +598,7 @@ uether_rxmbuf(struct usb_ether *ue, struct mbuf *m, m->m_pkthdr.len = m->m_len = len; /* enqueue for later when the lock can be released */ - _IF_ENQUEUE(>ue_rxq, m); + (void)mbufq_enqueue(>ue_rxq, m); return (0); } @@ -628,7 +628,7 @@ uether_rxbuf(struct usb_ether *ue, struct usb_page_cac m->m_pkthdr.len = m->m_len = len; /* enqueue for later when the lock can be released */ - _IF_ENQUEUE(>ue_rxq, m); + (void)mbufq_enqueue(>ue_rxq, m); return (0); } @@ -641,7 +641,7 @@ uether_rxflush(struct usb_ether *ue) UE_LOCK_ASSERT(ue, MA_OWNED); for (;;) { - _IF_DEQUEUE(>ue_rxq, m); + m = mbufq_dequeue(>ue_rxq); if (m == NULL) break; Modified: head/sys/dev/usb/net/usb_ethernet.h == --- head/sys/dev/usb/net/usb_ethernet.h Fri Aug 30 00:03:41 2019 (r351615) +++ head/sys/dev/usb/net/usb_ethernet.h Fri Aug 30 00:05:04 2019 (r351616) @@ -41,12 +41,10 @@ #include #include -#include #include #include #include #include -#include #include #include @@ -89,7 +87,7 @@ struct usb_ether { struct usb_process ue_tq; struct sysctl_ctx_list ue_sysctl_ctx; - struct ifqueue ue_rxq; + struct mbufque_rxq; struct usb_callout ue_watchdog; struct usb_ether_cfg_task ue_sync_task[2]; struct usb_ether_cfg_task ue_media_task[2]; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r351615 - head/sys/sys
Author: glebius Date: Fri Aug 30 00:03:41 2019 New Revision: 351615 URL: https://svnweb.freebsd.org/changeset/base/351615 Log: Allow mbuf queues to be unlimited. There is number of legacy code that uses ifqueue without setting a limit on it first. Easier to allow for that rather than improve legacy drivers. Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h == --- head/sys/sys/mbuf.h Thu Aug 29 23:23:12 2019(r351614) +++ head/sys/sys/mbuf.h Fri Aug 30 00:03:41 2019(r351615) @@ -1434,7 +1434,7 @@ static inline int mbufq_full(const struct mbufq *mq) { - return (mq->mq_len >= mq->mq_maxlen); + return (mq->mq_maxlen > 0 && mq->mq_len >= mq->mq_maxlen); } static inline int ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r351614 - head/usr.bin/indent
Author: jgh (doc,ports committer) Date: Thu Aug 29 23:23:12 2019 New Revision: 351614 URL: https://svnweb.freebsd.org/changeset/base/351614 Log: - address missing whitespace for indent PR: 239727 Submitted by: gbergl...@gmail.com Reviewed by: 0mp@ MFC after:1 week Modified: head/usr.bin/indent/indent.1 Modified: head/usr.bin/indent/indent.1 == --- head/usr.bin/indent/indent.1Thu Aug 29 22:13:15 2019 (r351613) +++ head/usr.bin/indent/indent.1Thu Aug 29 23:23:12 2019 (r351614) @@ -159,7 +159,7 @@ except that it only applies to the first set of declar in a procedure (just after the first `{') and it causes a blank line to be generated even if there are no declarations. The default is -.Fl nbadp. +.Fl nbadp . .It Fl bap , nbap If .Fl bap @@ -202,7 +202,7 @@ if (...) { .It Fl bs , nbs Whether a blank should always be inserted after sizeof. The default is -.Fl nbs. +.Fl nbs . .It Fl c Ns Ar n The column in which comments on code start. The default is 33. @@ -353,7 +353,7 @@ The default is 78. .It Fl lc Ns Ar n Maximum length of an output line in a block comment. The default is 0, which means to limit block comment lines in accordance with -.Fl l. +.Fl l . .It Fl \ Ns Ar n Specifies the indentation, in character positions, of local variable names ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r351613 - head/sys/fs/fuse
Author: markj Date: Thu Aug 29 22:13:15 2019 New Revision: 351613 URL: https://svnweb.freebsd.org/changeset/base/351613 Log: Remove unused VM page locking macros. They were orphaned by r292373. Reviewed by: asomers MFC after:1 week Sponsored by: Netflix Differential Revision:https://reviews.freebsd.org/D21469 Modified: head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_vnops.c == --- head/sys/fs/fuse/fuse_vnops.c Thu Aug 29 20:39:24 2019 (r351612) +++ head/sys/fs/fuse/fuse_vnops.c Thu Aug 29 22:13:15 2019 (r351613) @@ -226,11 +226,6 @@ struct vop_vector fuse_vnops = { uma_zone_t fuse_pbuf_zone; -#define fuse_vm_page_lock(m) vm_page_lock((m)); -#define fuse_vm_page_unlock(m) vm_page_unlock((m)); -#define fuse_vm_page_lock_queues() ((void)0) -#define fuse_vm_page_unlock_queues() ((void)0) - /* Check permission for extattr operations, much like extattr_check_cred */ static int fuse_extattr_check_cred(struct vnode *vp, int ns, struct ucred *cred, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r351611 - in stable: 11/contrib/wpa/hostapd 11/contrib/wpa/hs20/client 11/contrib/wpa/src/ap 11/contrib/wpa/src/common 11/contrib/wpa/src/crypto 11/contrib/wpa/src/drivers 11/contrib/wp...
Author: cy Date: Thu Aug 29 19:13:27 2019 New Revision: 351611 URL: https://svnweb.freebsd.org/changeset/base/351611 Log: MFC r351397: MFV r346563: Update wpa 2.8 --> 2.9 hostapd: * SAE changes - disable use of groups using Brainpool curves - improved protection against side channel attacks [https://w1.fi/security/2019-6/] * EAP-pwd changes - disable use of groups using Brainpool curves - improved protection against side channel attacks [https://w1.fi/security/2019-6/] * fixed FT-EAP initial mobility domain association using PMKSA caching * added configuration of airtime policy * fixed FILS to and RSNE into (Re)Association Response frames * fixed DPP bootstrapping URI parser of channel list * added support for regulatory WMM limitation (for ETSI) * added support for MACsec Key Agreement using IEEE 802.1X/PSK * added experimental support for EAP-TEAP server (RFC 7170) * added experimental support for EAP-TLS server with TLS v1.3 * added support for two server certificates/keys (RSA/ECC) * added AKMSuiteSelector into "STA " control interface data to determine with AKM was used for an association * added eap_sim_id parameter to allow EAP-SIM/AKA server pseudonym and fast reauthentication use to be disabled * fixed an ECDH operation corner case with OpenSSL wpa_supplicant: * SAE changes - disable use of groups using Brainpool curves - improved protection against side channel attacks [https://w1.fi/security/2019-6/] * EAP-pwd changes - disable use of groups using Brainpool curves - allow the set of groups to be configured (eap_pwd_groups) - improved protection against side channel attacks [https://w1.fi/security/2019-6/] * fixed FT-EAP initial mobility domain association using PMKSA caching (disabled by default for backwards compatibility; can be enabled with ft_eap_pmksa_caching=1) * fixed a regression in OpenSSL 1.1+ engine loading * added validation of RSNE in (Re)Association Response frames * fixed DPP bootstrapping URI parser of channel list * extended EAP-SIM/AKA fast re-authentication to allow use with FILS * extended ca_cert_blob to support PEM format * improved robustness of P2P Action frame scheduling * added support for EAP-SIM/AKA using anonymous@realm identity * fixed Hotspot 2.0 credential selection based on roaming consortium to ignore credentials without a specific EAP method * added experimental support for EAP-TEAP peer (RFC 7170) * added experimental support for EAP-TLS peer with TLS v1.3 * fixed a regression in WMM parameter configuration for a TDLS peer * fixed a regression in operation with drivers that offload 802.1X 4-way handshake * fixed an ECDH operation corner case with OpenSSL Security: https://w1.fi/security/2019-6/\ sae-eap-pwd-side-channel-attack-update.txt Added: stable/12/contrib/wpa/src/ap/airtime_policy.c - copied unchanged from r351397, head/contrib/wpa/src/ap/airtime_policy.c stable/12/contrib/wpa/src/ap/airtime_policy.h - copied unchanged from r351397, head/contrib/wpa/src/ap/airtime_policy.h stable/12/contrib/wpa/src/ap/wpa_auth_kay.c - copied unchanged from r351397, head/contrib/wpa/src/ap/wpa_auth_kay.c stable/12/contrib/wpa/src/ap/wpa_auth_kay.h - copied unchanged from r351397, head/contrib/wpa/src/ap/wpa_auth_kay.h stable/12/contrib/wpa/src/common/dragonfly.c - copied unchanged from r351397, head/contrib/wpa/src/common/dragonfly.c stable/12/contrib/wpa/src/common/dragonfly.h - copied unchanged from r351397, head/contrib/wpa/src/common/dragonfly.h stable/12/contrib/wpa/src/drivers/driver_atheros.c - copied unchanged from r351397, head/contrib/wpa/src/drivers/driver_atheros.c stable/12/contrib/wpa/src/drivers/driver_hostap.c - copied unchanged from r351397, head/contrib/wpa/src/drivers/driver_hostap.c stable/12/contrib/wpa/src/drivers/nl80211_copy.h - copied unchanged from r351397, head/contrib/wpa/src/drivers/nl80211_copy.h stable/12/contrib/wpa/src/eap_common/eap_teap_common.c - copied unchanged from r351397, head/contrib/wpa/src/eap_common/eap_teap_common.c stable/12/contrib/wpa/src/eap_common/eap_teap_common.h - copied unchanged from r351397, head/contrib/wpa/src/eap_common/eap_teap_common.h stable/12/contrib/wpa/src/eap_peer/eap_teap.c - copied unchanged from r351397, head/contrib/wpa/src/eap_peer/eap_teap.c stable/12/contrib/wpa/src/eap_peer/eap_teap_pac.c - copied unchanged from r351397, head/contrib/wpa/src/eap_peer/eap_teap_pac.c stable/12/contrib/wpa/src/eap_peer/eap_teap_pac.h - copied unchanged from r351397, head/contrib/wpa/src/eap_peer/eap_teap_pac.h stable/12/contrib/wpa/src/eap_server/eap_server_teap.c - copied unchanged from r351397, head/contrib/wpa/src/eap_server/eap_server_teap.c Modified: stable/12/contrib/wpa/hostapd/ChangeLog
svn commit: r351611 - in stable: 11/contrib/wpa/hostapd 11/contrib/wpa/hs20/client 11/contrib/wpa/src/ap 11/contrib/wpa/src/common 11/contrib/wpa/src/crypto 11/contrib/wpa/src/drivers 11/contrib/wp...
Author: cy Date: Thu Aug 29 19:13:27 2019 New Revision: 351611 URL: https://svnweb.freebsd.org/changeset/base/351611 Log: MFC r351397: MFV r346563: Update wpa 2.8 --> 2.9 hostapd: * SAE changes - disable use of groups using Brainpool curves - improved protection against side channel attacks [https://w1.fi/security/2019-6/] * EAP-pwd changes - disable use of groups using Brainpool curves - improved protection against side channel attacks [https://w1.fi/security/2019-6/] * fixed FT-EAP initial mobility domain association using PMKSA caching * added configuration of airtime policy * fixed FILS to and RSNE into (Re)Association Response frames * fixed DPP bootstrapping URI parser of channel list * added support for regulatory WMM limitation (for ETSI) * added support for MACsec Key Agreement using IEEE 802.1X/PSK * added experimental support for EAP-TEAP server (RFC 7170) * added experimental support for EAP-TLS server with TLS v1.3 * added support for two server certificates/keys (RSA/ECC) * added AKMSuiteSelector into "STA " control interface data to determine with AKM was used for an association * added eap_sim_id parameter to allow EAP-SIM/AKA server pseudonym and fast reauthentication use to be disabled * fixed an ECDH operation corner case with OpenSSL wpa_supplicant: * SAE changes - disable use of groups using Brainpool curves - improved protection against side channel attacks [https://w1.fi/security/2019-6/] * EAP-pwd changes - disable use of groups using Brainpool curves - allow the set of groups to be configured (eap_pwd_groups) - improved protection against side channel attacks [https://w1.fi/security/2019-6/] * fixed FT-EAP initial mobility domain association using PMKSA caching (disabled by default for backwards compatibility; can be enabled with ft_eap_pmksa_caching=1) * fixed a regression in OpenSSL 1.1+ engine loading * added validation of RSNE in (Re)Association Response frames * fixed DPP bootstrapping URI parser of channel list * extended EAP-SIM/AKA fast re-authentication to allow use with FILS * extended ca_cert_blob to support PEM format * improved robustness of P2P Action frame scheduling * added support for EAP-SIM/AKA using anonymous@realm identity * fixed Hotspot 2.0 credential selection based on roaming consortium to ignore credentials without a specific EAP method * added experimental support for EAP-TEAP peer (RFC 7170) * added experimental support for EAP-TLS peer with TLS v1.3 * fixed a regression in WMM parameter configuration for a TDLS peer * fixed a regression in operation with drivers that offload 802.1X 4-way handshake * fixed an ECDH operation corner case with OpenSSL Security: https://w1.fi/security/2019-6/\ sae-eap-pwd-side-channel-attack-update.txt Added: stable/11/contrib/wpa/src/ap/airtime_policy.c - copied unchanged from r351397, head/contrib/wpa/src/ap/airtime_policy.c stable/11/contrib/wpa/src/ap/airtime_policy.h - copied unchanged from r351397, head/contrib/wpa/src/ap/airtime_policy.h stable/11/contrib/wpa/src/ap/wpa_auth_kay.c - copied unchanged from r351397, head/contrib/wpa/src/ap/wpa_auth_kay.c stable/11/contrib/wpa/src/ap/wpa_auth_kay.h - copied unchanged from r351397, head/contrib/wpa/src/ap/wpa_auth_kay.h stable/11/contrib/wpa/src/common/dragonfly.c - copied unchanged from r351397, head/contrib/wpa/src/common/dragonfly.c stable/11/contrib/wpa/src/common/dragonfly.h - copied unchanged from r351397, head/contrib/wpa/src/common/dragonfly.h stable/11/contrib/wpa/src/drivers/driver_atheros.c - copied unchanged from r351397, head/contrib/wpa/src/drivers/driver_atheros.c stable/11/contrib/wpa/src/drivers/driver_hostap.c - copied unchanged from r351397, head/contrib/wpa/src/drivers/driver_hostap.c stable/11/contrib/wpa/src/drivers/nl80211_copy.h - copied unchanged from r351397, head/contrib/wpa/src/drivers/nl80211_copy.h stable/11/contrib/wpa/src/eap_common/eap_teap_common.c - copied unchanged from r351397, head/contrib/wpa/src/eap_common/eap_teap_common.c stable/11/contrib/wpa/src/eap_common/eap_teap_common.h - copied unchanged from r351397, head/contrib/wpa/src/eap_common/eap_teap_common.h stable/11/contrib/wpa/src/eap_peer/eap_teap.c - copied unchanged from r351397, head/contrib/wpa/src/eap_peer/eap_teap.c stable/11/contrib/wpa/src/eap_peer/eap_teap_pac.c - copied unchanged from r351397, head/contrib/wpa/src/eap_peer/eap_teap_pac.c stable/11/contrib/wpa/src/eap_peer/eap_teap_pac.h - copied unchanged from r351397, head/contrib/wpa/src/eap_peer/eap_teap_pac.h stable/11/contrib/wpa/src/eap_server/eap_server_teap.c - copied unchanged from r351397, head/contrib/wpa/src/eap_server/eap_server_teap.c Modified: stable/11/contrib/wpa/hostapd/ChangeLog
svn commit: r351609 - head/sys/amd64/vmm/io
Author: jhb Date: Thu Aug 29 18:23:38 2019 New Revision: 351609 URL: https://svnweb.freebsd.org/changeset/base/351609 Log: Simplify bhyve vlapic ESR logic. The bhyve virtual local APIC uses an instance-global flag to indicate when an error LVT is being delivered to prevent infinite recursion. Use a function argument instead to reduce the amount of instance-global state. This was inspired by reviewing the bhyve save/restore work, which saves a copy of the instance-global state for each vlapic. Smart OS bug: https://smartos.org/bugview/OS- Submitted by: Patrick Mooney Reviewed by: markj, rgrimes Obtained from:SmartOS / Joyent Differential Revision:https://reviews.freebsd.org/D20365 Modified: head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/io/vlapic.h head/sys/amd64/vmm/io/vlapic_priv.h Modified: head/sys/amd64/vmm/io/vlapic.c == --- head/sys/amd64/vmm/io/vlapic.c Thu Aug 29 17:25:50 2019 (r351608) +++ head/sys/amd64/vmm/io/vlapic.c Thu Aug 29 18:23:38 2019 (r351609) @@ -3,6 +3,7 @@ * * Copyright (c) 2011 NetApp, Inc. * 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 @@ -78,6 +79,8 @@ __FBSDID("$FreeBSD$"); */ #define VLAPIC_BUS_FREQ(128 * 1024 * 1024) +static void vlapic_set_error(struct vlapic *, uint32_t, bool); + static __inline uint32_t vlapic_get_id(struct vlapic *vlapic) { @@ -275,7 +278,8 @@ vlapic_set_intr_ready(struct vlapic *vlapic, int vecto } if (vector < 16) { - vlapic_set_error(vlapic, APIC_ESR_RECEIVE_ILLEGAL_VECTOR); + vlapic_set_error(vlapic, APIC_ESR_RECEIVE_ILLEGAL_VECTOR, + false); VLAPIC_CTR1(vlapic, "vlapic ignoring interrupt to vector %d", vector); return (1); @@ -432,20 +436,22 @@ vlapic_mask_lvts(struct vlapic *vlapic) } static int -vlapic_fire_lvt(struct vlapic *vlapic, uint32_t lvt) +vlapic_fire_lvt(struct vlapic *vlapic, u_int lvt) { - uint32_t vec, mode; + uint32_t mode, reg, vec; - if (lvt & APIC_LVT_M) + reg = atomic_load_acq_32(>lvt_last[lvt]); + + if (reg & APIC_LVT_M) return (0); + vec = reg & APIC_LVT_VECTOR; + mode = reg & APIC_LVT_DM; - vec = lvt & APIC_LVT_VECTOR; - mode = lvt & APIC_LVT_DM; - switch (mode) { case APIC_LVT_DM_FIXED: if (vec < 16) { - vlapic_set_error(vlapic, APIC_ESR_SEND_ILLEGAL_VECTOR); + vlapic_set_error(vlapic, APIC_ESR_SEND_ILLEGAL_VECTOR, + lvt == APIC_LVT_ERROR); return (0); } if (vlapic_set_intr_ready(vlapic, vec, false)) @@ -606,22 +612,22 @@ vlapic_periodic_timer(struct vlapic *vlapic) static VMM_STAT(VLAPIC_INTR_ERROR, "error interrupts generated by vlapic"); -void -vlapic_set_error(struct vlapic *vlapic, uint32_t mask) +static void +vlapic_set_error(struct vlapic *vlapic, uint32_t mask, bool lvt_error) { - uint32_t lvt; vlapic->esr_pending |= mask; - if (vlapic->esr_firing) + + /* +* Avoid infinite recursion if the error LVT itself is configured with +* an illegal vector. +*/ + if (lvt_error) return; - vlapic->esr_firing = 1; - // The error LVT always uses the fixed delivery mode. - lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_ERROR_LVT); - if (vlapic_fire_lvt(vlapic, lvt | APIC_LVT_DM_FIXED)) { + if (vlapic_fire_lvt(vlapic, APIC_LVT_ERROR)) { vmm_stat_incr(vlapic->vm, vlapic->vcpuid, VLAPIC_INTR_ERROR, 1); } - vlapic->esr_firing = 0; } static VMM_STAT(VLAPIC_INTR_TIMER, "timer interrupts generated by vlapic"); @@ -629,13 +635,10 @@ static VMM_STAT(VLAPIC_INTR_TIMER, "timer interrupts g static void vlapic_fire_timer(struct vlapic *vlapic) { - uint32_t lvt; KASSERT(VLAPIC_TIMER_LOCKED(vlapic), ("vlapic_fire_timer not locked")); - - // The timer LVT always uses the fixed delivery mode. - lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_TIMER_LVT); - if (vlapic_fire_lvt(vlapic, lvt | APIC_LVT_DM_FIXED)) { + + if (vlapic_fire_lvt(vlapic, APIC_LVT_TIMER)) { VLAPIC_CTR0(vlapic, "vlapic timer fired"); vmm_stat_incr(vlapic->vm, vlapic->vcpuid, VLAPIC_INTR_TIMER, 1); } @@ -647,10 +650,8 @@ static VMM_STAT(VLAPIC_INTR_CMC, void vlapic_fire_cmci(struct vlapic *vlapic) { - uint32_t lvt; - lvt = vlapic_get_lvt(vlapic, APIC_OFFSET_CMCI_LVT); - if (vlapic_fire_lvt(vlapic, lvt)) { + if (vlapic_fire_lvt(vlapic,
svn commit: r351608 - head
Author: zeising (doc,ports committer) Date: Thu Aug 29 17:25:50 2019 New Revision: 351608 URL: https://svnweb.freebsd.org/changeset/base/351608 Log: Use relative paths in ObsoleteFiles.inc Approved by: imp Differential Revision:https://reviews.freebsd.org/D21467 Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Thu Aug 29 17:17:39 2019(r351607) +++ head/ObsoleteFiles.inc Thu Aug 29 17:25:50 2019(r351608) @@ -39,8 +39,8 @@ # done # 20190825: zlib 1.0.4 removed from kernel -OLD_FILES+=/usr/include/sys/zlib.h -OLD_FILES+=/usr/include/sys/zutil.h +OLD_FILES+=usr/include/sys/zlib.h +OLD_FILES+=usr/include/sys/zutil.h # 20190817: pft_ping.py and sniffer.py moved to /usr/tests/sys/netpfil/common OLD_FILES+=usr/tests/sys/netpfil/pf/sniffer.py OLD_FILES+=usr/tests/sys/netpfil/pf/pft_ping.py ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r351607 - head
Author: zeising (doc,ports committer) Date: Thu Aug 29 17:17:39 2019 New Revision: 351607 URL: https://svnweb.freebsd.org/changeset/base/351607 Log: pwm.9 symlink shouldn't be removed When the pwm.9 manual was removed, a symlink between pwmbus.9 and pwm.9 was created, but there's an entry in ObsoleteFiles.inc to remove pwn.9, meaning that on every installation pwm.9 is created, and make delete-old deletes it. Remove the entry from ObsoleteFiles.inc, the symlink is clearly intentional and shouldn't be removed. Reviewed by: imp, ian Approved by: imp (implicit, review OK) Differential Revision:https://reviews.freebsd.org/D21198 Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Thu Aug 29 17:02:02 2019(r351606) +++ head/ObsoleteFiles.inc Thu Aug 29 17:17:39 2019(r351607) @@ -57,8 +57,8 @@ OLD_FILES+=usr/share/man/man3/cap_random_buf.3.gz OLD_FILES+=usr/share/man/man9/vm_page_hold.9.gz # 20190618: sys/capability.h removed (sys/capsicum.h is the one to use) OLD_FILES+=usr/include/sys/capability.h -# 20190615: sys/pwm.h renamed to dev/pwmc.h and pwm(9) removed -OLD_FILES+=usr/include/sys/pwm.h usr/share/man/man9/pwm.9.gz +# 20190615: sys/pwm.h renamed to dev/pwmc.h +OLD_FILES+=usr/include/sys/pwm.h # 20190612: new clang import which bumps version from 8.0.0 to 8.0.1. OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/asan_interface.h ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r351606 - in head/sys/cam: ata mmc nvme scsi
Author: mav Date: Thu Aug 29 17:02:02 2019 New Revision: 351606 URL: https://svnweb.freebsd.org/changeset/base/351606 Log: Take proper lock in ses_setphyspath_callback(). XPT_DEV_ADVINFO call should be protected by the lock of the specific device it is addressed to, not the lock of SES device. In some weird case, probably with hardware violating standards, it sometimes caused NULL dereference due to race. To protect from it further, add lock assertion to *_dev_advinfo(). MFC after:1 week Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ata/ata_xpt.c head/sys/cam/mmc/mmc_xpt.c head/sys/cam/nvme/nvme_xpt.c head/sys/cam/scsi/scsi_enc_ses.c head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/ata/ata_xpt.c == --- head/sys/cam/ata/ata_xpt.c Thu Aug 29 13:46:54 2019(r351605) +++ head/sys/cam/ata/ata_xpt.c Thu Aug 29 17:02:02 2019(r351606) @@ -1726,8 +1726,9 @@ ata_dev_advinfo(union ccb *start_ccb) { struct cam_ed *device; struct ccb_dev_advinfo *cdai; - off_t amt; + off_t amt; + xpt_path_assert(start_ccb->ccb_h.path, MA_OWNED); start_ccb->ccb_h.status = CAM_REQ_INVALID; device = start_ccb->ccb_h.path->device; cdai = _ccb->cdai; Modified: head/sys/cam/mmc/mmc_xpt.c == --- head/sys/cam/mmc/mmc_xpt.c Thu Aug 29 13:46:54 2019(r351605) +++ head/sys/cam/mmc/mmc_xpt.c Thu Aug 29 17:02:02 2019(r351606) @@ -341,6 +341,7 @@ mmc_dev_advinfo(union ccb *start_ccb) struct ccb_dev_advinfo *cdai; off_t amt; + xpt_path_assert(start_ccb->ccb_h.path, MA_OWNED); start_ccb->ccb_h.status = CAM_REQ_INVALID; device = start_ccb->ccb_h.path->device; cdai = _ccb->cdai; Modified: head/sys/cam/nvme/nvme_xpt.c == --- head/sys/cam/nvme/nvme_xpt.cThu Aug 29 13:46:54 2019 (r351605) +++ head/sys/cam/nvme/nvme_xpt.cThu Aug 29 17:02:02 2019 (r351606) @@ -588,8 +588,9 @@ nvme_dev_advinfo(union ccb *start_ccb) { struct cam_ed *device; struct ccb_dev_advinfo *cdai; - off_t amt; + off_t amt; + xpt_path_assert(start_ccb->ccb_h.path, MA_OWNED); start_ccb->ccb_h.status = CAM_REQ_INVALID; device = start_ccb->ccb_h.path->device; cdai = _ccb->cdai; Modified: head/sys/cam/scsi/scsi_enc_ses.c == --- head/sys/cam/scsi/scsi_enc_ses.cThu Aug 29 13:46:54 2019 (r351605) +++ head/sys/cam/scsi/scsi_enc_ses.cThu Aug 29 17:02:02 2019 (r351606) @@ -1027,7 +1027,7 @@ ses_setphyspath_callback(enc_softc_t *enc, enc_element args = (ses_setphyspath_callback_args_t *)arg; old_physpath = malloc(MAXPATHLEN, M_SCSIENC, M_WAITOK|M_ZERO); - cam_periph_lock(enc->periph); + xpt_path_lock(path); xpt_setup_ccb(_h, path, CAM_PRIORITY_NORMAL); cdai.ccb_h.func_code = XPT_DEV_ADVINFO; cdai.buftype = CDAI_TYPE_PHYS_PATH; @@ -1052,7 +1052,7 @@ ses_setphyspath_callback(enc_softc_t *enc, enc_element if (cdai.ccb_h.status == CAM_REQ_CMP) args->num_set++; } - cam_periph_unlock(enc->periph); + xpt_path_unlock(path); free(old_physpath, M_SCSIENC); } Modified: head/sys/cam/scsi/scsi_xpt.c == --- head/sys/cam/scsi/scsi_xpt.cThu Aug 29 13:46:54 2019 (r351605) +++ head/sys/cam/scsi/scsi_xpt.cThu Aug 29 17:02:02 2019 (r351606) @@ -2515,6 +2515,7 @@ scsi_dev_advinfo(union ccb *start_ccb) struct ccb_dev_advinfo *cdai; off_t amt; + xpt_path_assert(start_ccb->ccb_h.path, MA_OWNED); start_ccb->ccb_h.status = CAM_REQ_INVALID; device = start_ccb->ccb_h.path->device; cdai = _ccb->cdai; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r351605 - head/share/man/man4
Author: mav Date: Thu Aug 29 13:46:54 2019 New Revision: 351605 URL: https://svnweb.freebsd.org/changeset/base/351605 Log: Man page for AMD Non-Transparent Bridge (ntb_hw_amd) driver. Submitted by: Rajesh Kumar Reviewed by: bcr MFC after:3 days Differential Revision:https://reviews.freebsd.org/D21462 Added: head/share/man/man4/ntb_hw_amd.4 (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man4/ntb.4 head/share/man/man4/ntb_transport.4 Modified: head/share/man/man4/Makefile == --- head/share/man/man4/MakefileThu Aug 29 12:49:21 2019 (r351604) +++ head/share/man/man4/MakefileThu Aug 29 13:46:54 2019 (r351605) @@ -371,6 +371,7 @@ MAN=aac.4 \ ng_vlan.4 \ nmdm.4 \ ${_ntb.4} \ + ${_ntb_hw_amd.4} \ ${_ntb_hw_intel.4} \ ${_ntb_hw_plx.4} \ ${_ntb_transport.4} \ @@ -795,6 +796,7 @@ _nfe.4= nfe.4 _nfsmb.4= nfsmb.4 _if_ntb.4= if_ntb.4 _ntb.4=ntb.4 +_ntb_hw_amd.4= ntb_hw_amd.4 _ntb_hw_intel.4= ntb_hw_intel.4 _ntb_hw_plx.4= ntb_hw_plx.4 _ntb_transport.4=ntb_transport.4 Modified: head/share/man/man4/ntb.4 == --- head/share/man/man4/ntb.4 Thu Aug 29 12:49:21 2019(r351604) +++ head/share/man/man4/ntb.4 Thu Aug 29 13:46:54 2019(r351605) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 2, 2017 +.Dd August 29, 2019 .Dt NTB 4 .Os .Sh NAME @@ -66,7 +66,7 @@ The default configuration is empty string, which means with all available resources, allowing any driver to attach. .El .Sh DESCRIPTION -Non-Transparent Bridges allow to connect two computer systems with PCIe +Non-Transparent Bridges connect two computer systems with PCIe link(s), providing each of them limited access to others memory space, scratchpad registers and interrupts. The @@ -76,9 +76,10 @@ and splits them between several functions, according t configuration. .Sh SEE ALSO .Xr if_ntb 4 , -.Xr ntb_transport 4 , +.Xr ntb_hw_amd 4 , .Xr ntb_hw_intel 4 , -.Xr ntb_hw_plx 4 +.Xr ntb_hw_plx 4 , +.Xr ntb_transport 4 .Sh AUTHORS .An -nosplit The Added: head/share/man/man4/ntb_hw_amd.4 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/ntb_hw_amd.4Thu Aug 29 13:46:54 2019 (r351605) @@ -0,0 +1,94 @@ +.\" +.\" Copyright (c) 2019 Rajesh Kumar +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\"notice, this list of conditions and the following disclaimer in the +.\"documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd August 29, 2019 +.Dt NTB_HW_AMD 4 +.Os +.Sh NAME +.Nm ntb_hw_amd +.Nd AMD Non-Transparent Bridge driver +.Sh SYNOPSIS +To compile this driver into your kernel, +place the following lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device ntb" +.Cd "device ntb_hw_amd" +.Ed +.Pp +Or, to load the driver as a module at boot, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +ntb_hw_amd_load="YES" +.Ed +.Pp +The following sysctls are supported in this driver +.Bl -ohang +.It Va dev.ntb_hw.X.info +Reading this sysctl will give the basic details like the number of memory +windows, scratchpads and doorbells exposed by the NTB on the local host to +access the devices beyond the bridge. +It also provides details about the masked doorbells, translation address and +size limit of each exposed memory window and link status information. +.El +.Sh DESCRIPTION +The +.Nm ntb_hw_amd +driver provides support for
svn commit: r351604 - head/sys/dev/ichsmb
Author: yuripv Date: Thu Aug 29 12:49:21 2019 New Revision: 351604 URL: https://svnweb.freebsd.org/changeset/base/351604 Log: ichsmb: defer smbus attach until interrupts are available This fixes a "timed sleep before timers are working" panic seen while attaching jedec_dimm(4) instances too early in the boot. Submitted by: ian Reviewed by: hselasky Differential Revision:https://reviews.freebsd.org/D21452 Modified: head/sys/dev/ichsmb/ichsmb.c Modified: head/sys/dev/ichsmb/ichsmb.c == --- head/sys/dev/ichsmb/ichsmb.cThu Aug 29 12:05:06 2019 (r351603) +++ head/sys/dev/ichsmb/ichsmb.cThu Aug 29 12:49:21 2019 (r351604) @@ -131,11 +131,8 @@ ichsmb_attach(device_t dev) goto fail; } - /* Attach "smbus" child */ - if ((error = bus_generic_attach(dev)) != 0) { - device_printf(dev, "failed to attach child: %d\n", error); - goto fail; - } + /* Probe and attach the smbus when interrupts are available */ + config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); return (0); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r351603 - head/sys/dev/vnic
Author: emaste Date: Thu Aug 29 12:05:06 2019 New Revision: 351603 URL: https://svnweb.freebsd.org/changeset/base/351603 Log: vnic: avoid NULL deref in error case Reported by: Dr Silvio Cesare of InfoSect MFC after:3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vnic/thunder_bgx.c Modified: head/sys/dev/vnic/thunder_bgx.c == --- head/sys/dev/vnic/thunder_bgx.c Thu Aug 29 09:29:39 2019 (r351602) +++ head/sys/dev/vnic/thunder_bgx.c Thu Aug 29 12:05:06 2019 (r351603) @@ -502,9 +502,8 @@ bgx_add_dmac_addr(uint64_t dmac, int node, int bgx_idx bgx_idx += node * MAX_BGX_PER_CN88XX; bgx = bgx_vnic[bgx_idx]; - if (!bgx) { - device_printf(bgx->dev, - "BGX%d not yet initialized, ignoring DMAC addition\n", + if (bgx == NULL) { + printf("BGX%d not yet initialized, ignoring DMAC addition\n", bgx_idx); return; } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r351601 - head/sys/cam/scsi
Author: avg Date: Thu Aug 29 08:26:40 2019 New Revision: 351601 URL: https://svnweb.freebsd.org/changeset/base/351601 Log: scsi_cd: whitespace cleanup Remove trailing whitespace and fix mixed indentation. MFC after:3 weeks Modified: head/sys/cam/scsi/scsi_cd.c Modified: head/sys/cam/scsi/scsi_cd.c == --- head/sys/cam/scsi/scsi_cd.c Thu Aug 29 08:19:11 2019(r351600) +++ head/sys/cam/scsi/scsi_cd.c Thu Aug 29 08:26:40 2019(r351601) @@ -270,25 +270,25 @@ staticint cdsize(struct cam_periph *periph, u_int32_ static int cd6byteworkaround(union ccb *ccb); static int cderror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags); -static int cdreadtoc(struct cam_periph *periph, u_int32_t mode, - u_int32_t start, u_int8_t *data, +static int cdreadtoc(struct cam_periph *periph, u_int32_t mode, + u_int32_t start, u_int8_t *data, u_int32_t len, u_int32_t sense_flags); -static int cdgetmode(struct cam_periph *periph, +static int cdgetmode(struct cam_periph *periph, struct cd_mode_params *data, u_int32_t page); static int cdsetmode(struct cam_periph *periph, struct cd_mode_params *data); -static int cdplay(struct cam_periph *periph, u_int32_t blk, +static int cdplay(struct cam_periph *periph, u_int32_t blk, u_int32_t len); -static int cdreadsubchannel(struct cam_periph *periph, -u_int32_t mode, u_int32_t format, -int track, -struct cd_sub_channel_info *data, +static int cdreadsubchannel(struct cam_periph *periph, +u_int32_t mode, u_int32_t format, +int track, +struct cd_sub_channel_info *data, u_int32_t len); -static int cdplaymsf(struct cam_periph *periph, u_int32_t startm, - u_int32_t starts, u_int32_t startf, - u_int32_t endm, u_int32_t ends, +static int cdplaymsf(struct cam_periph *periph, u_int32_t startm, + u_int32_t starts, u_int32_t startf, + u_int32_t endm, u_int32_t ends, u_int32_t endf); -static int cdplaytracks(struct cam_periph *periph, +static int cdplaytracks(struct cam_periph *periph, u_int32_t strack, u_int32_t sindex, u_int32_t etrack, u_int32_t eindex); static int cdpause(struct cam_periph *periph, u_int32_t go); @@ -599,7 +599,7 @@ cdregister(struct cam_periph *periph, void *arg) M_NOWAIT | M_ZERO); if (softc == NULL) { printf("cdregister: Unable to probe new device. " - "Unable to allocate softc\n"); + "Unable to allocate softc\n"); return(CAM_REQ_CMP_ERR); } @@ -876,7 +876,7 @@ cdstrategy(struct bio *bp) bioq_disksort(>bio_queue, bp); /* -* If we don't know that we have valid media, schedule the media +* If we don't know that we have valid media, schedule the media * check first. The I/O will get executed after the media check. */ if ((softc->flags & CD_FLAG_VALID_MEDIA) == 0) @@ -951,7 +951,6 @@ cdstart(struct cam_periph *periph, union ccb *start_cc } start_ccb->ccb_h.ccb_state = CD_CCB_BUFFER_IO; - LIST_INSERT_HEAD(>pending_ccbs, _ccb->ccb_h, periph_links.le); softc->outstanding_cmds++; @@ -1038,7 +1037,7 @@ cdstart(struct cam_periph *periph, union ccb *start_cc break; } - scsi_prevent(_ccb->csio, + scsi_prevent(_ccb->csio, /*retries*/ cd_retry_count, /*cbfcnp*/ cddone, /*tag_action*/ MSG_SIMPLE_Q_TAG, @@ -1057,7 +1056,7 @@ cdstart(struct cam_periph *periph, union ccb *start_cc } case CD_STATE_MEDIA_TOC_HDR: { struct ioc_toc_header *toch; - + bzero(>toc, sizeof(softc->toc)); toch = >toc.header; @@ -1069,7 +1068,7 @@ cdstart(struct cam_periph
svn commit: r351600 - head/sys/cam/scsi
Author: avg Date: Thu Aug 29 08:19:11 2019 New Revision: 351600 URL: https://svnweb.freebsd.org/changeset/base/351600 Log: scsi_cd: ifdef out cdsize() It was used only by the old cdcheckmedia(). MFC after:3 weeks Modified: head/sys/cam/scsi/scsi_cd.c Modified: head/sys/cam/scsi/scsi_cd.c == --- head/sys/cam/scsi/scsi_cd.c Thu Aug 29 07:51:11 2019(r351599) +++ head/sys/cam/scsi/scsi_cd.c Thu Aug 29 08:19:11 2019(r351600) @@ -264,7 +264,9 @@ static int cdgetpagesize(int page_num); static voidcdprevent(struct cam_periph *periph, int action); static voidcdmediaprobedone(struct cam_periph *periph); static int cdcheckmedia(struct cam_periph *periph, int do_wait); +#if 0 static int cdsize(struct cam_periph *periph, u_int32_t *size); +#endif static int cd6byteworkaround(union ccb *ccb); static int cderror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags); @@ -2846,7 +2848,6 @@ bailout: return (error); } -#endif static int cdsize(struct cam_periph *periph, u_int32_t *size) @@ -2903,6 +2904,7 @@ cdsize(struct cam_periph *periph, u_int32_t *size) return (error); } +#endif static int cd6byteworkaround(union ccb *ccb) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r351599 - head/sys/cam/scsi
Author: avg Date: Thu Aug 29 07:51:11 2019 New Revision: 351599 URL: https://svnweb.freebsd.org/changeset/base/351599 Log: scsi_cd: make the media check asynchronous This makes the media check process asynchronous, so we no longer block in cdstrategy() to check for media. PR: 219857 Obtained from:ken MFC after:3 weeks Modified: head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_cd.h Modified: head/sys/cam/scsi/scsi_cd.c == --- head/sys/cam/scsi/scsi_cd.c Thu Aug 29 07:50:25 2019(r351598) +++ head/sys/cam/scsi/scsi_cd.c Thu Aug 29 07:51:11 2019(r351599) @@ -114,13 +114,21 @@ typedef enum { CD_FLAG_RETRY_UA= 0x0200, CD_FLAG_VALID_MEDIA = 0x0400, CD_FLAG_VALID_TOC = 0x0800, - CD_FLAG_SCTX_INIT = 0x1000 + CD_FLAG_SCTX_INIT = 0x1000, + CD_FLAG_MEDIA_WAIT = 0x2000, + CD_FLAG_MEDIA_SCAN_ACT = 0x4000 } cd_flags; typedef enum { CD_CCB_PROBE= 0x01, CD_CCB_BUFFER_IO= 0x02, - CD_CCB_TUR = 0x04, + CD_CCB_TUR = 0x03, + CD_CCB_MEDIA_PREVENT= 0x04, + CD_CCB_MEDIA_ALLOW = 0x05, + CD_CCB_MEDIA_SIZE = 0x06, + CD_CCB_MEDIA_TOC_HDR= 0x07, + CD_CCB_MEDIA_TOC_FULL = 0x08, + CD_CCB_MEDIA_TOC_LEAD = 0x09, CD_CCB_TYPE_MASK= 0x0F, CD_CCB_RETRY_UA = 0x10 } cd_ccb_state; @@ -140,7 +148,13 @@ struct cd_toc_single { typedef enum { CD_STATE_PROBE, - CD_STATE_NORMAL + CD_STATE_NORMAL, + CD_STATE_MEDIA_PREVENT, + CD_STATE_MEDIA_ALLOW, + CD_STATE_MEDIA_SIZE, + CD_STATE_MEDIA_TOC_HDR, + CD_STATE_MEDIA_TOC_FULL, + CD_STATE_MEDIA_TOC_LEAD } cd_state; struct cd_softc { @@ -161,6 +175,8 @@ struct cd_softc { struct sysctl_oid *sysctl_tree; STAILQ_HEAD(, cd_mode_params) mode_queue; struct cd_tocdata toc; + int toc_read_len; + struct cd_toc_singleleadout; struct disk *disk; struct callout mediapoll_c; @@ -246,7 +262,8 @@ static voidcddone(struct cam_periph *periph, static union cd_pages *cdgetpage(struct cd_mode_params *mode_params); static int cdgetpagesize(int page_num); static voidcdprevent(struct cam_periph *periph, int action); -static int cdcheckmedia(struct cam_periph *periph); +static voidcdmediaprobedone(struct cam_periph *periph); +static int cdcheckmedia(struct cam_periph *periph, int do_wait); static int cdsize(struct cam_periph *periph, u_int32_t *size); static int cd6byteworkaround(union ccb *ccb); static int cderror(union ccb *ccb, u_int32_t cam_flags, @@ -755,7 +772,7 @@ cdopen(struct disk *dp) * if we don't have media, but then we don't allow anything but the * CDIOCEJECT/CDIOCCLOSE ioctls if there is no media. */ - cdcheckmedia(periph); + cdcheckmedia(periph, /*do_wait*/ 1); CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("leaving cdopen\n")); cam_periph_unhold(periph); @@ -851,27 +868,19 @@ cdstrategy(struct bio *bp) return; } -/* -* If we don't have valid media, look for it before trying to -* schedule the I/O. -*/ - if ((softc->flags & CD_FLAG_VALID_MEDIA) == 0) { - int error; - - error = cdcheckmedia(periph); - if (error != 0) { - cam_periph_unlock(periph); - biofinish(bp, NULL, error); - return; - } - } - /* * Place it in the queue of disk activities for this disk */ bioq_disksort(>bio_queue, bp); - xpt_schedule(periph, CAM_PRIORITY_NORMAL); +/* +* If we don't know that we have valid media, schedule the media +* check first. The I/O will get executed after the media check. +*/ + if ((softc->flags & CD_FLAG_VALID_MEDIA) == 0) + cdcheckmedia(periph, /*do_wait*/ 0); + else + xpt_schedule(periph, CAM_PRIORITY_NORMAL); cam_periph_unlock(periph); return; @@ -883,7 +892,6 @@ cdstart(struct cam_periph *periph, union ccb *start_cc struct cd_softc *softc; struct bio *bp; struct ccb_scsiio *csio; - struct scsi_read_capacity_data *rcap; softc = (struct cd_softc *)periph->softc; @@ -964,16 +972,40 @@ cdstart(struct cam_periph *periph, union ccb *start_cc break; } case CD_STATE_PROBE: + case CD_STATE_MEDIA_SIZE: { + struct scsi_read_capacity_data *rcap; rcap = (struct
svn commit: r351598 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/cd9660 fs/devfs fs/ext2fs fs/fuse fs/msdosfs fs/nfsclient fs/smbfs fs/tmpfs fs/udf kern ufs/ufs vm
Author: kib Date: Thu Aug 29 07:50:25 2019 New Revision: 351598 URL: https://svnweb.freebsd.org/changeset/base/351598 Log: Rework v_object lifecycle for vnodes. Current implementation of vnode_create_vobject() and vnode_destroy_vobject() is written so that it prepared to handle the vm object destruction for live vnode. Practically, no filesystems use this, except for some remnants that were present in UFS till today. One of the consequences of that model is that each filesystem must call vnode_destroy_vobject() in VOP_RECLAIM() or earlier, as result all of them get rid of the v_object in reclaim. Move the call to vnode_destroy_vobject() to vgonel() before VOP_RECLAIM(). This makes v_object stable: either the object is NULL, or it is valid vm object till the vnode reclamation. Remove code from vnode_create_vobject() to handle races with the parallel destruction. Reviewed by: markj Tested by:pho Sponsored by: The FreeBSD Foundation Differential revision:https://reviews.freebsd.org/D21412 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/fs/cd9660/cd9660_node.c head/sys/fs/devfs/devfs_vnops.c head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/fuse/fuse_vnops.c head/sys/fs/msdosfs/msdosfs_denode.c head/sys/fs/nfsclient/nfs_clnode.c head/sys/fs/smbfs/smbfs_node.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/fs/udf/udf_vnops.c head/sys/kern/vfs_subr.c head/sys/ufs/ufs/ufs_extern.h head/sys/ufs/ufs/ufs_inode.c head/sys/vm/vm_object.h head/sys/vm/vnode_pager.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Aug 29 07:45:23 2019(r351597) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Aug 29 07:50:25 2019(r351598) @@ -5375,9 +5375,6 @@ zfs_freebsd_reclaim(ap) ASSERT(zp != NULL); - /* Destroy the vm object and flush associated pages. */ - vnode_destroy_vobject(vp); - /* * z_teardown_inactive_lock protects from a race with * zfs_znode_dmu_fini in zfsvfs_teardown during Modified: head/sys/fs/cd9660/cd9660_node.c == --- head/sys/fs/cd9660/cd9660_node.cThu Aug 29 07:45:23 2019 (r351597) +++ head/sys/fs/cd9660/cd9660_node.cThu Aug 29 07:50:25 2019 (r351598) @@ -92,10 +92,6 @@ cd9660_reclaim(ap) struct vnode *vp = ap->a_vp; /* -* Destroy the vm object and flush associated pages. -*/ - vnode_destroy_vobject(vp); - /* * Remove the inode from its hash chain. */ vfs_hash_remove(vp); Modified: head/sys/fs/devfs/devfs_vnops.c == --- head/sys/fs/devfs/devfs_vnops.c Thu Aug 29 07:45:23 2019 (r351597) +++ head/sys/fs/devfs/devfs_vnops.c Thu Aug 29 07:50:25 2019 (r351598) @@ -1428,7 +1428,6 @@ devfs_reclaim(struct vop_reclaim_args *ap) vp->v_data = NULL; } mtx_unlock(_de_interlock); - vnode_destroy_vobject(vp); return (0); } Modified: head/sys/fs/ext2fs/ext2_inode.c == --- head/sys/fs/ext2fs/ext2_inode.c Thu Aug 29 07:45:23 2019 (r351597) +++ head/sys/fs/ext2fs/ext2_inode.c Thu Aug 29 07:50:25 2019 (r351598) @@ -639,6 +639,5 @@ ext2_reclaim(struct vop_reclaim_args *ap) vfs_hash_remove(vp); free(vp->v_data, M_EXT2NODE); vp->v_data = 0; - vnode_destroy_vobject(vp); return (0); } Modified: head/sys/fs/fuse/fuse_vnops.c == --- head/sys/fs/fuse/fuse_vnops.c Thu Aug 29 07:45:23 2019 (r351597) +++ head/sys/fs/fuse/fuse_vnops.c Thu Aug 29 07:50:25 2019 (r351598) @@ -1537,7 +1537,6 @@ fuse_vnop_reclaim(struct vop_reclaim_args *ap) fuse_vnode_setparent(vp, NULL); cache_purge(vp); vfs_hash_remove(vp); - vnode_destroy_vobject(vp); fuse_vnode_destroy(vp); return 0; Modified: head/sys/fs/msdosfs/msdosfs_denode.c == --- head/sys/fs/msdosfs/msdosfs_denode.cThu Aug 29 07:45:23 2019 (r351597) +++ head/sys/fs/msdosfs/msdosfs_denode.cThu Aug 29 07:50:25 2019 (r351598) @@ -552,10 +552,6 @@ msdosfs_reclaim(struct vop_reclaim_args *ap) #endif /* -* Destroy the vm object and flush associated pages. -*/ - vnode_destroy_vobject(vp); - /* * Remove the denode from its hash chain. */
svn commit: r351597 - head/sys/ufs/ffs
Author: kib Date: Thu Aug 29 07:45:23 2019 New Revision: 351597 URL: https://svnweb.freebsd.org/changeset/base/351597 Log: UFS: stop reusing the vnode for reallocated inode. In ffs_valloc(), force reclaim existing vnode on inode reuse, instead of trying to re-initialize the same vnode for new purposes. This is done in preparation of changes to the vp->v_object lifecycle handling. A new FFSV_REPLACE flag to ffs_vgetf() directs the function to vgone(9) the vnode if found in vfs hash, instead of returning it. Reviewed by: markj, mckusick Tested by:pho Sponsored by: The FreeBSD Foundation Differential revision:https://reviews.freebsd.org/D21412 Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_alloc.c == --- head/sys/ufs/ffs/ffs_alloc.cThu Aug 29 07:39:31 2019 (r351596) +++ head/sys/ufs/ffs/ffs_alloc.cThu Aug 29 07:45:23 2019 (r351597) @@ -1137,10 +1137,15 @@ retry: (allocfcn_t *)ffs_nodealloccg); if (ino == 0) goto noinodes; - error = ffs_vget(pvp->v_mount, ino, LK_EXCLUSIVE, vpp); + + /* +* Get rid of the cached old vnode, force allocation of a new vnode +* for this inode. +*/ + error = ffs_vgetf(pvp->v_mount, ino, LK_EXCLUSIVE, vpp, FFSV_REPLACE); if (error) { error1 = ffs_vgetf(pvp->v_mount, ino, LK_EXCLUSIVE, vpp, - FFSV_FORCEINSMQ); + FFSV_FORCEINSMQ | FFSV_REPLACE); ffs_vfree(pvp, ino, mode); if (error1 == 0) { ip = VTOI(*vpp); @@ -1176,7 +1181,6 @@ dup_alloc: ip->i_din2->di_birthtime = ts.tv_sec; ip->i_din2->di_birthnsec = ts.tv_nsec; } - ufs_prepare_reclaim(*vpp); ip->i_flag = 0; (*vpp)->v_vflag = 0; (*vpp)->v_type = VNON; Modified: head/sys/ufs/ffs/ffs_extern.h == --- head/sys/ufs/ffs/ffs_extern.h Thu Aug 29 07:39:31 2019 (r351596) +++ head/sys/ufs/ffs/ffs_extern.h Thu Aug 29 07:45:23 2019 (r351597) @@ -121,6 +121,7 @@ voidprocess_deferred_inactive(struct mount *mp); * Flags to ffs_vgetf */ #defineFFSV_FORCEINSMQ 0x0001 +#defineFFSV_REPLACE0x0002 /* * Flags to ffs_reload Modified: head/sys/ufs/ffs/ffs_vfsops.c == --- head/sys/ufs/ffs/ffs_vfsops.c Thu Aug 29 07:39:31 2019 (r351596) +++ head/sys/ufs/ffs/ffs_vfsops.c Thu Aug 29 07:45:23 2019 (r351597) @@ -1671,9 +1671,17 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags) struct vnode *vp; int error; + MPASS((ffs_flags & FFSV_REPLACE) == 0 || (flags & LK_EXCLUSIVE) != 0); + error = vfs_hash_get(mp, ino, flags, curthread, vpp, NULL, NULL); - if (error || *vpp != NULL) + if (error != 0) return (error); + if (*vpp != NULL) { + if ((ffs_flags & FFSV_REPLACE) == 0) + return (0); + vgone(*vpp); + vput(*vpp); + } /* * We must promote to an exclusive lock for vnode creation. This @@ -1735,8 +1743,19 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags) } vp->v_vflag &= ~VV_FORCEINSMQ; error = vfs_hash_insert(vp, ino, flags, curthread, vpp, NULL, NULL); - if (error || *vpp != NULL) + if (error != 0) return (error); + if (*vpp != NULL) { + /* +* Calls from ffs_valloc() (i.e. FFSV_REPLACE set) +* operate on empty inode, which must not be found by +* other threads until fully filled. Vnode for empty +* inode must be not re-inserted on the hash by other +* thread, after removal by us at the beginning. +*/ + MPASS((ffs_flags & FFSV_REPLACE) == 0); + return (0); + } /* Read in the disk contents for the inode, copy into the inode. */ error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ino)), ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r351596 - in head: sys/sys tests/sys/sys
Author: trasz Date: Thu Aug 29 07:39:31 2019 New Revision: 351596 URL: https://svnweb.freebsd.org/changeset/base/351596 Log: Fix qmath(3) build problems with GCC 8. Discussed with: asomers Sponsored by: Klara Systems Differential Revision:https://reviews.freebsd.org/D21442 Modified: head/sys/sys/qmath.h head/tests/sys/sys/qmath_test.c Modified: head/sys/sys/qmath.h == --- head/sys/sys/qmath.hThu Aug 29 07:34:14 2019(r351595) +++ head/sys/sys/qmath.hThu Aug 29 07:39:31 2019(r351596) @@ -267,7 +267,7 @@ typedef u64q_t umaxq_t; /* Left shift an integral value to align with the int bits of 'q'. */ #defineQ_SHL(q, iv) \ -(Q_LTZ(iv) ? -(Q_ABS(iv) << Q_NFBITS(q)) : \ +(Q_LTZ(iv) ? -(int64_t)(Q_ABS(iv) << Q_NFBITS(q)) :\ Q_TC(q, iv) << Q_NFBITS(q)) /* Calculate the relative fractional precision between 'a' and 'b' in bits. */ Modified: head/tests/sys/sys/qmath_test.c == --- head/tests/sys/sys/qmath_test.c Thu Aug 29 07:34:14 2019 (r351595) +++ head/tests/sys/sys/qmath_test.c Thu Aug 29 07:39:31 2019 (r351596) @@ -208,7 +208,9 @@ ATF_TC_BODY(qmulq_s64q, tc) { s64q_t a_s64q, b_s64q, r_s64q; double a_dbl, b_dbl, r_dbl, maxe_dbl, delta_dbl; +#ifdef notyet int64_t a_int, b_int; +#endif int error; srandomdev(); @@ -231,8 +233,6 @@ ATF_TC_BODY(qmulq_s64q, tc) * test with equal precision. */ Q_SCVAL(b_s64q, Q_GCVAL(a_s64q)); - a_int = Q_GIVAL(a_s64q); - b_int = Q_GIVAL(b_s64q); /* QQ testing. */ a_dbl = Q_Q2D(a_s64q); @@ -247,6 +247,9 @@ ATF_TC_BODY(qmulq_s64q, tc) r_dbl = a_dbl * b_dbl; #ifdef notyet + a_int = Q_GIVAL(a_s64q); + b_int = Q_GIVAL(b_s64q); + maxe_dbl = fabs(((1.0 / Q_NFBITS(a_s64q)) * (double)b_int) + ((1.0 / Q_NFBITS(b_s64q)) * (double)a_int)); #else @@ -270,7 +273,6 @@ ATF_TC_BODY(qdivq_s64q, tc) { s64q_t a_s64q, b_s64q, r_s64q; double a_dbl, b_dbl, r_dbl, maxe_dbl, delta_dbl; - int64_t a_int, b_int; int error; srandomdev(); @@ -283,8 +285,6 @@ ATF_TC_BODY(qdivq_s64q, tc) * test with equal precision. */ Q_SCVAL(b_s64q, Q_GCVAL(a_s64q)); - a_int = Q_GIVAL(a_s64q); - b_int = Q_GIVAL(b_s64q); /* QQ testing. */ a_dbl = Q_Q2D(a_s64q); @@ -318,7 +318,6 @@ ATF_TC_BODY(qaddq_s64q, tc) { s64q_t a_s64q, b_s64q, r_s64q; double a_dbl, b_dbl, r_dbl, maxe_dbl, delta_dbl; - int64_t a_int, b_int; int error; srandomdev(); @@ -331,8 +330,6 @@ ATF_TC_BODY(qaddq_s64q, tc) * test with equal precision. */ Q_SCVAL(b_s64q, Q_GCVAL(a_s64q)); - a_int = Q_GIVAL(a_s64q); - b_int = Q_GIVAL(b_s64q); /* QQ testing. */ a_dbl = Q_Q2D(a_s64q); @@ -369,7 +366,6 @@ ATF_TC_BODY(qsubq_s64q, tc) { s64q_t a_s64q, b_s64q, r_s64q; double a_dbl, b_dbl, r_dbl, maxe_dbl, delta_dbl; - int64_t a_int, b_int; int error; srandomdev(); @@ -382,8 +378,6 @@ ATF_TC_BODY(qsubq_s64q, tc) * test with equal precision. */ Q_SCVAL(b_s64q, Q_GCVAL(a_s64q)); - a_int = Q_GIVAL(a_s64q); - b_int = Q_GIVAL(b_s64q); /* QQ testing. */ a_dbl = Q_Q2D(a_s64q); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r351595 - head/sys/i386/i386
Author: kib Date: Thu Aug 29 07:34:14 2019 New Revision: 351595 URL: https://svnweb.freebsd.org/changeset/base/351595 Log: Remove useless redefinition of NSFBUFS in i386/vm_machdep.c. Sponsored by: The FreeBSD Foundation Modified: head/sys/i386/i386/vm_machdep.c Modified: head/sys/i386/i386/vm_machdep.c == --- head/sys/i386/i386/vm_machdep.c Thu Aug 29 07:25:27 2019 (r351594) +++ head/sys/i386/i386/vm_machdep.c Thu Aug 29 07:34:14 2019 (r351595) @@ -86,10 +86,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef NSFBUFS -#defineNSFBUFS (512 + maxusers * 16) -#endif - _Static_assert(__OFFSETOF_MONITORBUF == offsetof(struct pcpu, pc_monitorbuf), "__OFFSETOF_MONITORBUF does not correspond with offset of pc_monitorbuf."); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r351594 - in head/sys: amd64/amd64 amd64/include arm/arm arm/include arm64/arm64 arm64/include i386/i386 i386/include mips/include powerpc/include powerpc/powerpc riscv/include riscv/ri...
Author: kib Date: Thu Aug 29 07:25:27 2019 New Revision: 351594 URL: https://svnweb.freebsd.org/changeset/base/351594 Log: Centralize __pcpu definitions. Many extern struct pcpu __pcpu declarations were copied/pasted in sources. The issue is that the definition is MD, but it cannot be provided by machine/pcpu.h due to actual struct pcpu defined in sys/pcpu.h later than the inclusion of machine/pcpu.h. This forced the copying when other code needed direct access to __pcpu. There is no way around it, due to machine/pcpu.h supplying part of struct pcpu fields. To work around the problem, add a new machine/pcpu_aux.h header, which should fill any needed MD definitions after struct pcpu definition is completed. This allows to remove copies of __pcpu spread around the source. Also on x86 it makes it possible to remove work arounds like OFFSETOF_CURTHREAD or clang specific warnings supressions. Reported and tested by: lwhsu, bcran Reviewed by: imp, markj (previous version) Discussed with: jhb Sponsored by: The FreeBSD Foundation Differential revision:https://reviews.freebsd.org/D21418 Added: head/sys/amd64/include/pcpu_aux.h (contents, props changed) head/sys/arm/include/pcpu_aux.h (contents, props changed) head/sys/arm64/include/pcpu_aux.h (contents, props changed) head/sys/i386/include/pcpu_aux.h (contents, props changed) head/sys/mips/include/pcpu_aux.h (contents, props changed) head/sys/powerpc/include/pcpu_aux.h (contents, props changed) head/sys/riscv/include/pcpu_aux.h (contents, props changed) head/sys/sparc64/include/pcpu_aux.h (contents, props changed) Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/amd64/pmap.c head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/include/counter.h head/sys/amd64/include/pcpu.h head/sys/arm/arm/mp_machdep.c head/sys/arm/include/counter.h head/sys/arm64/arm64/mp_machdep.c head/sys/arm64/include/counter.h head/sys/i386/i386/mp_machdep.c head/sys/i386/i386/vm_machdep.c head/sys/i386/include/counter.h head/sys/i386/include/pcpu.h head/sys/powerpc/include/counter.h head/sys/powerpc/powerpc/mp_machdep.c head/sys/riscv/include/counter.h head/sys/riscv/riscv/mp_machdep.c head/sys/sys/pcpu.h Modified: head/sys/amd64/amd64/mp_machdep.c == --- head/sys/amd64/amd64/mp_machdep.c Thu Aug 29 07:19:06 2019 (r351593) +++ head/sys/amd64/amd64/mp_machdep.c Thu Aug 29 07:25:27 2019 (r351594) @@ -94,8 +94,6 @@ __FBSDID("$FreeBSD$"); #defineAP_BOOTPT_SZ(PAGE_SIZE * 3) -extern struct pcpu *__pcpu; - /* Temporary variables for init_secondary() */ char *doublefault_stack; char *mce_stack; Modified: head/sys/amd64/amd64/pmap.c == --- head/sys/amd64/amd64/pmap.c Thu Aug 29 07:19:06 2019(r351593) +++ head/sys/amd64/amd64/pmap.c Thu Aug 29 07:25:27 2019(r351594) @@ -443,10 +443,6 @@ static pml4_entry_t *pti_pml4; static vm_pindex_t pti_pg_idx; static bool pti_finalized; -extern struct pcpu *__pcpu; -extern struct pcpu temp_bsp_pcpu; -extern pt_entry_t *pcpu_pte; - struct pmap_pkru_range { struct rs_elpkru_rs_el; u_int pkru_keyidx; Modified: head/sys/amd64/amd64/vm_machdep.c == --- head/sys/amd64/amd64/vm_machdep.c Thu Aug 29 07:19:06 2019 (r351593) +++ head/sys/amd64/amd64/vm_machdep.c Thu Aug 29 07:25:27 2019 (r351594) @@ -84,10 +84,6 @@ __FBSDID("$FreeBSD$"); #include #include -_Static_assert(OFFSETOF_CURTHREAD == offsetof(struct pcpu, pc_curthread), -"OFFSETOF_CURTHREAD does not correspond with offset of pc_curthread."); -_Static_assert(OFFSETOF_CURPCB == offsetof(struct pcpu, pc_curpcb), -"OFFSETOF_CURPCB does not correspond with offset of pc_curpcb."); _Static_assert(OFFSETOF_MONITORBUF == offsetof(struct pcpu, pc_monitorbuf), "OFFSETOF_MONITORBUF does not correspond with offset of pc_monitorbuf."); Modified: head/sys/amd64/include/counter.h == --- head/sys/amd64/include/counter.hThu Aug 29 07:19:06 2019 (r351593) +++ head/sys/amd64/include/counter.hThu Aug 29 07:25:27 2019 (r351594) @@ -33,9 +33,6 @@ #include -extern struct pcpu *__pcpu; -extern struct pcpu temp_bsp_pcpu; - #defineEARLY_COUNTER _bsp_pcpu.pc_early_dummy_counter #definecounter_enter() do {} while (0) Modified: head/sys/amd64/include/pcpu.h == --- head/sys/amd64/include/pcpu.h Thu Aug 29 07:19:06 2019 (r351593) +++ head/sys/amd64/include/pcpu.h Thu Aug 29 07:25:27 2019 (r351594) @@ -233,35
svn commit: r351593 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: avg Date: Thu Aug 29 07:19:06 2019 New Revision: 351593 URL: https://svnweb.freebsd.org/changeset/base/351593 Log: zfs_ioc_snapshot: check user-prop permissions on snapshotted datasets Previously, the permissions were checked on the pool which was obviously incorrect. After this change, zfs_check_userprops() only validates the properties without any permission checks. The permissions are checked individually for each snapshotted dataset. This was also committed to ZoL: zfsonlinux/zfs@e6203d2 Reported by: CyberSecure MFC after:1 week Sponsored by: CyberSecure Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Aug 29 02:44:18 2019(r351592) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Aug 29 07:19:06 2019(r351593) @@ -2747,10 +2747,9 @@ retry: * Check that all the properties are valid user properties. */ static int -zfs_check_userprops(const char *fsname, nvlist_t *nvl) +zfs_check_userprops(nvlist_t *nvl) { nvpair_t *pair = NULL; - int error = 0; while ((pair = nvlist_next_nvpair(nvl, pair)) != NULL) { const char *propname = nvpair_name(pair); @@ -2759,10 +2758,6 @@ zfs_check_userprops(const char *fsname, nvlist_t *nvl) nvpair_type(pair) != DATA_TYPE_STRING) return (SET_ERROR(EINVAL)); - if (error = zfs_secpolicy_write_perms(fsname, - ZFS_DELEG_PERM_USERPROP, CRED())) - return (error); - if (strlen(propname) >= ZAP_MAXNAMELEN) return (SET_ERROR(ENAMETOOLONG)); @@ -3429,12 +3424,11 @@ zfs_ioc_snapshot(const char *poolname, nvlist_t *innvl nvpair_t *pair; (void) nvlist_lookup_nvlist(innvl, "props", ); - if ((error = zfs_check_userprops(poolname, props)) != 0) - return (error); - if (!nvlist_empty(props) && zfs_earlier_version(poolname, SPA_VERSION_SNAP_PROPS)) return (SET_ERROR(ENOTSUP)); + if ((error = zfs_check_userprops(props)) != 0) + return (error); if (nvlist_lookup_nvlist(innvl, "snaps", ) != 0) return (SET_ERROR(EINVAL)); @@ -3442,7 +3436,7 @@ zfs_ioc_snapshot(const char *poolname, nvlist_t *innvl for (pair = nvlist_next_nvpair(snaps, NULL); pair != NULL; pair = nvlist_next_nvpair(snaps, pair)) { const char *name = nvpair_name(pair); - const char *cp = strchr(name, '@'); + char *cp = strchr(name, '@'); /* * The snap name must contain an @, and the part after it must @@ -3458,6 +3452,18 @@ zfs_ioc_snapshot(const char *poolname, nvlist_t *innvl if (strncmp(name, poolname, poollen) != 0 || (name[poollen] != '/' && name[poollen] != '@')) return (SET_ERROR(EXDEV)); + + /* +* Check for permission to set the properties on the fs. +*/ + if (!nvlist_empty(props)) { + *cp = '\0'; + error = zfs_secpolicy_write_perms(name, + ZFS_DELEG_PERM_USERPROP, CRED()); + *cp = '@'; + if (error != 0) + return (error); + } /* This must be the only snap of this fs. */ for (nvpair_t *pair2 = nvlist_next_nvpair(snaps, pair); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"