Re: svn commit: r358744 - in head: lib/libsecureboot lib/libsecureboot/h lib/libsecureboot/tests share/mk stand stand/common stand/efi/loader stand/efi/loader/arch/i386 stand/ficl stand/i386/libi386 s
On Mon, 9 Mar 2020 07:05:46 +0100 "O. Hartmann" wrote: > On Sun, 8 Mar 2020 17:42:43 + (UTC) > "Simon J. Gerraty" wrote: > > > Author: sjg > > Date: Sun Mar 8 17:42:42 2020 > > New Revision: 358744 > > URL: https://svnweb.freebsd.org/changeset/base/358744 > > > > Log: > > veloader use vectx API for kernel and modules > > > > The vectx API, computes the hash for verifying a file as it is read. > > This avoids the overhead of reading files twice - once to verify, then > > again to load. > > > > For doing an install via loader, avoiding the need to rewind > > large files is critical. > > > > This API is only used for modules, kernel and mdimage as these are the > > biggest files read by the loader. > > The reduction in boot time depends on how expensive the I/O is > > on any given platform. On a fast VM we see 6% improvement. > > > > For install via loader the first file to be verified is likely to be the > > kernel, so some of the prep work (finding manifest etc) done by > > verify_file() needs to be factored so it can be reused for > > vectx_open(). > > > > For missing or unrecognized fingerprint entries, we fail > > in vectx_open() unless verifying is disabled. > > > > Otherwise fingerprint check happens in vectx_close() and > > since this API is only used for files which must be verified > > (VE_MUST) we panic if we get an incorrect hash. > > > > Reviewed by: imp,tsoome > > MFC after:1 week > > Sponsored by: Juniper Networks > > Differential Revision:https://reviews.freebsd.org//D23827 > > > > Modified: > > head/lib/libsecureboot/h/libsecureboot.h > > head/lib/libsecureboot/h/verify_file.h > > head/lib/libsecureboot/tests/tvo.c > > head/lib/libsecureboot/vectx.c > > head/lib/libsecureboot/verify_file.c > > head/share/mk/src.opts.mk > > head/stand/common/bootstrap.h > > head/stand/common/interp_forth.c > > head/stand/common/interp_simple.c > > head/stand/common/load_elf.c > > head/stand/common/load_elf_obj.c > > head/stand/common/misc.c > > head/stand/common/module.c > > head/stand/efi/loader/arch/i386/i386_copy.c > > head/stand/efi/loader/copy.c > > head/stand/efi/loader/loader_efi.h > > head/stand/efi/loader/main.c > > head/stand/ficl/loader.c > > head/stand/i386/libi386/i386_copy.c > > head/stand/i386/libi386/libi386.h > > head/stand/i386/loader/chain.c > > head/stand/libofw/libofw.h > > head/stand/libofw/ofw_copy.c > > head/stand/loader.mk > > head/stand/mips/beri/loader/arch.c > > head/stand/powerpc/kboot/main.c > > head/stand/uboot/lib/copy.c > > head/stand/uboot/lib/libuboot.h > > head/stand/userboot/userboot/copy.c > > head/stand/userboot/userboot/libuserboot.h > > > > To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org" > [... deleted ...] > > > buildworld seems to be broken on this commit: > > [...] > --- all_subdir_stand --- > --- lstd.o --- > /usr/src/stand/liblua/lstd.c:86:44: error: too few arguments to function call, > expected 5, have 4 if (verify_file(fd, filename, 0, VE_GUESS) < 0) { > ~~~ ^ > /usr/src/lib/libsecureboot/h/verify_file.h:50:1: note: 'verify_file' declared > here int verify_file(int, const char *, off_t, int, const char *); > ^ > 1 error generated. > [...] > > Building host is CURRENT, FreeBSD 13.0-CURRENT #118 r358695: Fri Mar 6 > 12:48:00 CET 2020 amd64: > > kind regards, > > oh > ___ > 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-unsubscr...@freebsd.org" The problem reported seems to occur when WITH_BEARSSL=YES is enabled in /etc/src.conf. ___ 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-unsubscr...@freebsd.org"
svn commit: r358807 - head/sys/arm64/rockchip
Author: mmel Date: Mon Mar 9 13:36:45 2020 New Revision: 358807 URL: https://svnweb.freebsd.org/changeset/base/358807 Log: Add the missing brackets to the logical expression. Reported by: clang10 via dim MFC with: r355755 Modified: head/sys/arm64/rockchip/rk_pcie.c Modified: head/sys/arm64/rockchip/rk_pcie.c == --- head/sys/arm64/rockchip/rk_pcie.c Mon Mar 9 13:35:07 2020 (r358806) +++ head/sys/arm64/rockchip/rk_pcie.c Mon Mar 9 13:36:45 2020 (r358807) @@ -895,7 +895,7 @@ rk_pcie_enable_resources(struct rk_pcie_softc *sc) /* Set basic PCIe core mode (RC, lanes, gen1 or 2) */ val = STRAP_CONF_GEN_2 << 16 | - sc->link_is_gen2 ? STRAP_CONF_GEN_2: 0; + (sc->link_is_gen2 ? STRAP_CONF_GEN_2: 0); val |= STRAP_CONF_MODE_RC << 16 | STRAP_CONF_MODE_RC; val |= STRAP_CONF_LANES(~0) << 16 | STRAP_CONF_LANES(sc->num_lanes); val |= STRAP_CONF_ARI_EN << 16 | STRAP_CONF_ARI_EN; @@ -1408,4 +1408,4 @@ DEFINE_CLASS_1(pcib, rk_pcie_driver, rk_pcie_methods, sizeof(struct rk_pcie_softc), ofw_pci_driver); static devclass_t rk_pcie_devclass; DRIVER_MODULE( rk_pcie, simplebus, rk_pcie_driver, rk_pcie_devclass, -NULL, NULL); \ No newline at end of file +NULL, NULL); ___ 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-unsubscr...@freebsd.org"
svn commit: r358808 - in head/sys: kern net netinet
Author: gallatin Date: Mon Mar 9 13:44:51 2020 New Revision: 358808 URL: https://svnweb.freebsd.org/changeset/base/358808 Log: make lacp's use_numa hashing aware of send tags When I did the use_numa support, I missed the fact that there is a separate hash function for send tag nic selection. So when use_numa is enabled, ktls offload does not work properly, as it does not reliably allocate a send tag on the proper egress nic since different egress nics are selected for send-tag allocation and packet transmit. To fix this, this change: - refectors lacp_select_tx_port_by_hash() and lacp_select_tx_port() to make lacp_select_tx_port_by_hash() always called by lacp_select_tx_port() - pre-shifts flowids to convert them to hashes when calling lacp_select_tx_port_by_hash() - adds a numa_domain field to if_snd_tag_alloc_params - plumbs the numa domain into places where we allocate send tags In testing with NIC TLS setup on a NUMA machine, I see thousands of output errors before the change when enabling kern.ipc.tls.ifnet.permitted=1. After the change, I see no errors, and I see the NIC sysctl counters showing active TLS offload sessions. Reviewed by: rrs, hselasky, jhb Sponsored by: Netflix Modified: head/sys/kern/uipc_ktls.c head/sys/net/ieee8023ad_lacp.c head/sys/net/ieee8023ad_lacp.h head/sys/net/if_lagg.c head/sys/net/if_var.h head/sys/netinet/in_pcb.c head/sys/netinet/tcp_ratelimit.c Modified: head/sys/kern/uipc_ktls.c == --- head/sys/kern/uipc_ktls.c Mon Mar 9 13:36:45 2020(r358807) +++ head/sys/kern/uipc_ktls.c Mon Mar 9 13:44:51 2020(r358808) @@ -800,6 +800,7 @@ ktls_alloc_snd_tag(struct inpcb *inp, struct ktls_sess params.hdr.type = IF_SND_TAG_TYPE_TLS; params.hdr.flowid = inp->inp_flowid; params.hdr.flowtype = inp->inp_flowtype; + params.hdr.numa_domain = inp->inp_numa_domain; params.tls.inp = inp; params.tls.tls = tls; INP_RUNLOCK(inp); Modified: head/sys/net/ieee8023ad_lacp.c == --- head/sys/net/ieee8023ad_lacp.c Mon Mar 9 13:36:45 2020 (r358807) +++ head/sys/net/ieee8023ad_lacp.c Mon Mar 9 13:44:51 2020 (r358808) @@ -832,13 +832,12 @@ lacp_stop(struct lagg_softc *sc) } struct lagg_port * -lacp_select_tx_port(struct lagg_softc *sc, struct mbuf *m) +lacp_select_tx_port_by_hash(struct lagg_softc *sc, uint32_t hash, uint8_t numa_domain) { struct lacp_softc *lsc = LACP_SOFTC(sc); struct lacp_portmap *pm; struct lacp_port *lp; struct lacp_port **map; - uint32_t hash; int count; if (__predict_false(lsc->lsc_suppress_distributing)) { @@ -854,10 +853,10 @@ lacp_select_tx_port(struct lagg_softc *sc, struct mbuf #ifdef NUMA if ((sc->sc_opts & LAGG_OPT_USE_NUMA) && - pm->pm_num_dom > 1 && m->m_pkthdr.numa_domain < MAXMEMDOM) { - count = pm->pm_numa[m->m_pkthdr.numa_domain].count; + pm->pm_num_dom > 1 && numa_domain < MAXMEMDOM) { + count = pm->pm_numa[numa_domain].count; if (count > 0) { - map = pm->pm_numa[m->m_pkthdr.numa_domain].map; + map = pm->pm_numa[numa_domain].map; } else { /* No ports on this domain; use global hash. */ map = pm->pm_map; @@ -869,11 +868,6 @@ lacp_select_tx_port(struct lagg_softc *sc, struct mbuf map = pm->pm_map; count = pm->pm_count; } - if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) && - M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) - hash = m->m_pkthdr.flowid >> sc->flowid_shift; - else - hash = m_ether_tcpip_hash(sc->sc_flags, m, lsc->lsc_hashkey); hash %= count; lp = map[hash]; @@ -884,33 +878,22 @@ lacp_select_tx_port(struct lagg_softc *sc, struct mbuf return (lp->lp_lagg); } -#if defined(RATELIMIT) || defined(KERN_TLS) struct lagg_port * -lacp_select_tx_port_by_hash(struct lagg_softc *sc, uint32_t flowid) +lacp_select_tx_port(struct lagg_softc *sc, struct mbuf *m) { struct lacp_softc *lsc = LACP_SOFTC(sc); - struct lacp_portmap *pm; - struct lacp_port *lp; uint32_t hash; + uint8_t numa_domain; - if (__predict_false(lsc->lsc_suppress_distributing)) { - LACP_DPRINTF((NULL, "%s: waiting transit\n", __func__)); - return (NULL); - } + if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) && + M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) + hash = m->m_pkthdr.flowid >> sc->flowid_shift; + else + hash = m_ether_tcpip_hash(sc->sc_flags, m, lsc->lsc_hashkey); - pm = &lsc->lsc_pmap[lsc->lsc
Re: svn commit: r358808 - in head/sys: kern net netinet
On 2020-03-09 09:44, Andrew Gallatin wrote: Author: gallatin Date: Mon Mar 9 13:44:51 2020 New Revision: 358808 URL: https://urldefense.com/v3/__https://svnweb.freebsd.org/changeset/base/358808__;!!OToaGQ!5mmRl2ROq7G4c4x2Xe2uHppYyETGlCRsREj-jHw0ZWcNqt3GhQju3BHBkM_vsrVvkQ$ Log: make lacp's use_numa hashing aware of send tags When I did the use_numa support, I missed the fact that there is a separate hash function for send tag nic selection. So when use_numa is enabled, ktls offload does not work properly, as it does not reliably allocate a send tag on the proper egress nic since different egress nics are selected for send-tag allocation and packet transmit. To fix this, this change: - refectors lacp_select_tx_port_by_hash() and lacp_select_tx_port() to make lacp_select_tx_port_by_hash() always called by lacp_select_tx_port() - pre-shifts flowids to convert them to hashes when calling lacp_select_tx_port_by_hash() - adds a numa_domain field to if_snd_tag_alloc_params - plumbs the numa domain into places where we allocate send tags In testing with NIC TLS setup on a NUMA machine, I see thousands of output errors before the change when enabling kern.ipc.tls.ifnet.permitted=1. After the change, I see no errors, and I see the NIC sysctl counters showing active TLS offload sessions. Reviewed by: rrs, hselasky, jhb Sponsored by:Netflix Forgot: Differential: https://reviews.freebsd.org/D23811 ___ 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-unsubscr...@freebsd.org"
svn commit: r358811 - head/stand/liblua
Author: sjg Date: Mon Mar 9 15:48:53 2020 New Revision: 358811 URL: https://svnweb.freebsd.org/changeset/base/358811 Log: veloader use vectx API for kernel and modules The vectx API, computes the hash for verifying a file as it is read. This avoids the overhead of reading files twice - once to verify, then again to load. For doing an install via loader, avoiding the need to rewind large files is critical. This API is only used for modules, kernel and mdimage as these are the biggest files read by the loader. The reduction in boot time depends on how expensive the I/O is on any given platform. On a fast VM we see 6% improvement. For install via loader the first file to be verified is likely to be the kernel, so some of the prep work (finding manifest etc) done by verify_file() needs to be factored so it can be reused for vectx_open(). For missing or unrecognized fingerprint entries, we fail in vectx_open() unless verifying is disabled. Otherwise fingerprint check happens in vectx_close() and since this API is only used for files which must be verified (VE_MUST) we panic if we get an incorrect hash. Reviewed by: imp,tsoome MFC after:1 week Sponsored by: Juniper Networks Differential Revision:https://reviews.freebsd.org//D23827 Modified: head/stand/liblua/lstd.c Modified: head/stand/liblua/lstd.c == --- head/stand/liblua/lstd.cMon Mar 9 15:28:52 2020(r358810) +++ head/stand/liblua/lstd.cMon Mar 9 15:48:53 2020(r358811) @@ -83,7 +83,7 @@ fopen(const char *filename, const char *mode) #ifdef LOADER_VERIEXEC /* only regular files and only reading makes sense */ if (S_ISREG(st.st_mode) && !(m & O_WRONLY)) { - if (verify_file(fd, filename, 0, VE_GUESS) < 0) { + if (verify_file(fd, filename, 0, VE_GUESS, __func__) < 0) { free(f); close(fd); return (NULL); ___ 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-unsubscr...@freebsd.org"
svn commit: r358812 - head/sys/ufs/ffs
Author: chs Date: Mon Mar 9 15:55:13 2020 New Revision: 358812 URL: https://svnweb.freebsd.org/changeset/base/358812 Log: Use the devfs vnode rather than the mntfs vnode for permissions checks. I missed this one in r358714. Reported by: pho Reviewed by: mckusick Approved by: imp (mentor) Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_suspend.c Modified: head/sys/ufs/ffs/ffs_suspend.c == --- head/sys/ufs/ffs/ffs_suspend.c Mon Mar 9 15:48:53 2020 (r358811) +++ head/sys/ufs/ffs/ffs_suspend.c Mon Mar 9 15:55:13 2020 (r358812) @@ -196,10 +196,10 @@ ffs_susp_suspend(struct mount *mp) * device. The permissions can change after we unlock the vnode; * it's harmless. */ - vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); - error = VOP_ACCESS(ump->um_devvp, VREAD | VWRITE, + vn_lock(ump->um_odevvp, LK_EXCLUSIVE | LK_RETRY); + error = VOP_ACCESS(ump->um_odevvp, VREAD | VWRITE, curthread->td_ucred, curthread); - VOP_UNLOCK(ump->um_devvp); + VOP_UNLOCK(ump->um_odevvp); if (error != 0) return (error); #ifdef MAC ___ 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-unsubscr...@freebsd.org"
svn commit: r358813 - in head/stand: ficl i386/loader
Author: sjg Date: Mon Mar 9 16:02:54 2020 New Revision: 358813 URL: https://svnweb.freebsd.org/changeset/base/358813 Log: veloader use vectx API for kernel and modules The vectx API, computes the hash for verifying a file as it is read. This avoids the overhead of reading files twice - once to verify, then again to load. For doing an install via loader, avoiding the need to rewind large files is critical. This API is only used for modules, kernel and mdimage as these are the biggest files read by the loader. The reduction in boot time depends on how expensive the I/O is on any given platform. On a fast VM we see 6% improvement. For install via loader the first file to be verified is likely to be the kernel, so some of the prep work (finding manifest etc) done by verify_file() needs to be factored so it can be reused for vectx_open(). For missing or unrecognized fingerprint entries, we fail in vectx_open() unless verifying is disabled. Otherwise fingerprint check happens in vectx_close() and since this API is only used for files which must be verified (VE_MUST) we panic if we get an incorrect hash. Reviewed by: imp,tsoome MFC after:1 week Sponsored by: Juniper Networks Differential Revision:https://reviews.freebsd.org//D23827 Modified: head/stand/ficl/fileaccess.c head/stand/i386/loader/chain.c Modified: head/stand/ficl/fileaccess.c == --- head/stand/ficl/fileaccess.cMon Mar 9 15:55:13 2020 (r358812) +++ head/stand/ficl/fileaccess.cMon Mar 9 16:02:54 2020 (r358813) @@ -69,7 +69,7 @@ static void ficlFopen(FICL_VM *pVM, char *writeMode) / else #ifdef LOADER_VERIEXEC if (*mode == 'r' && - verify_file(fileno(f), filename, 0, VE_GUESS) < 0) { + verify_file(fileno(f), filename, 0, VE_GUESS, __func__) < 0) { fclose(f); stackPushPtr(pVM->pStack, NULL); } else Modified: head/stand/i386/loader/chain.c == --- head/stand/i386/loader/chain.c Mon Mar 9 15:55:13 2020 (r358812) +++ head/stand/i386/loader/chain.c Mon Mar 9 16:02:54 2020 (r358813) @@ -95,7 +95,7 @@ command_chain(int argc, char *argv[]) } #else #ifdef LOADER_VERIEXEC - if (verify_file(fd, argv[1], 0, VE_MUST) < 0) { + if (verify_file(fd, argv[1], 0, VE_MUST, __func__) < 0) { sprintf(command_errbuf, "can't verify: %s", argv[1]); close(fd); return (CMD_ERROR); ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r358744 - in head: lib/libsecureboot lib/libsecureboot/h lib/libsecureboot/tests share/mk stand stand/common stand/efi/loader stand/efi/loader/arch/i386 stand/ficl stand/i386/libi386 s
O. Hartmann wrote: > > To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org" > [... deleted ...] > > > buildworld seems to be broken on this commit: Ah! I did a buildworld, but build the 4th version of loader. Sorry, will fix. > > [...] > --- all_subdir_stand --- > --- lstd.o --- > /usr/src/stand/liblua/lstd.c:86:44: error: too few arguments to function call, > expected 5, have 4 if (verify_file(fd, filename, 0, VE_GUESS) < 0) { > ~~~ ^ > /usr/src/lib/libsecureboot/h/verify_file.h:50:1: note: 'verify_file' declared > here int verify_file(int, const char *, off_t, int, const char *); > ^ ___ 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-unsubscr...@freebsd.org"
svn commit: r358814 - head/sys/dev/aacraid
Author: luporl Date: Mon Mar 9 19:01:17 2020 New Revision: 358814 URL: https://svnweb.freebsd.org/changeset/base/358814 Log: [aacraid] Handle both AIF and SYNC interrupts Without this change, if an AIF interrupt comes at the same time a SYNC command is finished, the SYNC interrupt will be lost. This happens because all interrupt bits (bellbits) are cleared, but only one of them is handled. Debugging shows that, (at least) when !sc->msi_enabled and (sc->flags & AAC_FLAGS_SYNC_MODE) is true (sync mode), both bits may be set at the same time. PR: 237463 Reviewed by: scottl Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision:https://reviews.freebsd.org/D23859 Modified: head/sys/dev/aacraid/aacraid.c Modified: head/sys/dev/aacraid/aacraid.c == --- head/sys/dev/aacraid/aacraid.c Mon Mar 9 16:02:54 2020 (r358813) +++ head/sys/dev/aacraid/aacraid.c Mon Mar 9 19:01:17 2020 (r358814) @@ -899,7 +899,7 @@ aacraid_new_intr_type1(void *arg) AAC_MEM0_SETREG4(sc, AAC_SRC_ODBR_C, bellbits); if (bellbits_shifted & AAC_DB_AIF_PENDING) mode |= AAC_INT_MODE_AIF; - else if (bellbits_shifted & AAC_DB_SYNC_COMMAND) + if (bellbits_shifted & AAC_DB_SYNC_COMMAND) mode |= AAC_INT_MODE_SYNC; } /* ODR readback, Prep #238630 */ @@ -923,7 +923,10 @@ aacraid_new_intr_type1(void *arg) sc->flags &= ~AAC_QUEUE_FRZN; sc->aac_sync_cm = NULL; } - mode = 0; + if (mode & AAC_INT_MODE_INTX) + mode &= ~AAC_INT_MODE_SYNC; + else + mode = 0; } if (mode & AAC_INT_MODE_AIF) { @@ -932,6 +935,9 @@ aacraid_new_intr_type1(void *arg) mode = 0; } } + + if (sc->flags & AAC_FLAGS_SYNC_MODE) + mode = 0; if (mode) { /* handle async. status */ ___ 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-unsubscr...@freebsd.org"
svn commit: r358815 - head/share/vt/fonts
Author: tsoome Date: Mon Mar 9 19:43:28 2020 New Revision: 358815 URL: https://svnweb.freebsd.org/changeset/base/358815 Log: gallant is 12x22, not 8x16 INDEX.fonts does list gallant with wrong size. Modified: head/share/vt/fonts/INDEX.fonts Modified: head/share/vt/fonts/INDEX.fonts == --- head/share/vt/fonts/INDEX.fonts Mon Mar 9 19:01:17 2020 (r358814) +++ head/share/vt/fonts/INDEX.fonts Mon Mar 9 19:43:28 2020 (r358815) @@ -34,9 +34,9 @@ MENU:fr:Choisissez votre fonte écran FONT:en:vgarom-8x14.fnt # -gallant.fnt:en:Gallant Character set, 8x16 -gallant.fnt:da:Gallant-tegnsæt, 8x16 -gallant.fnt:de:Gallant Zeichensatz, 8x16 +gallant.fnt:en:Gallant Character set, 12x22 +gallant.fnt:da:Gallant-tegnsæt, 12x22 +gallant.fnt:de:Gallant Zeichensatz, 12x22 terminus-b32.fnt:en:Terminus BSD Console, size 32 terminus-b32.fnt:da:Terminus BSD-konsol, størrelse 32 ___ 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-unsubscr...@freebsd.org"
svn commit: r358816 - head/sys/kern
Author: kib Date: Mon Mar 9 19:46:28 2020 New Revision: 358816 URL: https://svnweb.freebsd.org/changeset/base/358816 Log: Style. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after:1 week Differential revision:https://reviews.freebsd.org/D23993 Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c == --- head/sys/kern/sys_pipe.cMon Mar 9 19:43:28 2020(r358815) +++ head/sys/kern/sys_pipe.cMon Mar 9 19:46:28 2020(r358816) @@ -507,8 +507,8 @@ retry: error = vm_map_find(pipe_map, NULL, 0, (vm_offset_t *)&buffer, size, 0, VMFS_ANY_SPACE, VM_PROT_RW, VM_PROT_RW, 0); if (error != KERN_SUCCESS) { - if ((cpipe->pipe_buffer.buffer == NULL) && - (size > SMALL_PIPE_SIZE)) { + if (cpipe->pipe_buffer.buffer == NULL && + size > SMALL_PIPE_SIZE) { size = SMALL_PIPE_SIZE; pipefragretry++; goto retry; @@ -555,7 +555,7 @@ pipespace(struct pipe *cpipe, int size) { KASSERT(cpipe->pipe_state & PIPE_LOCKFL, - ("Unlocked pipe passed to pipespace")); + ("Unlocked pipe passed to pipespace")); return (pipespace_new(cpipe, size)); } @@ -660,10 +660,10 @@ pipe_read(struct file *fp, struct uio *uio, struct ucr goto locked_error; #endif if (amountpipekva > (3 * maxpipekva) / 4) { - if (!(rpipe->pipe_state & PIPE_DIRECTW) && - (rpipe->pipe_buffer.size > SMALL_PIPE_SIZE) && - (rpipe->pipe_buffer.cnt <= SMALL_PIPE_SIZE) && - (piperesizeallowed == 1)) { + if ((rpipe->pipe_state & PIPE_DIRECTW) == 0 && + rpipe->pipe_buffer.size > SMALL_PIPE_SIZE && + rpipe->pipe_buffer.cnt <= SMALL_PIPE_SIZE && + piperesizeallowed == 1) { PIPE_UNLOCK(rpipe); pipespace(rpipe, SMALL_PIPE_SIZE); PIPE_LOCK(rpipe); @@ -1011,10 +1011,9 @@ static int pipe_write(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td) { - int error = 0; - int desiredsize; - ssize_t orig_resid; struct pipe *wpipe, *rpipe; + ssize_t orig_resid; + int desiredsize, error; rpipe = fp->f_data; wpipe = PIPE_PEER(rpipe); @@ -1056,15 +1055,15 @@ pipe_write(struct file *fp, struct uio *uio, struct uc } /* Choose a smaller size if we're in a OOM situation */ - if ((amountpipekva > (3 * maxpipekva) / 4) && - (wpipe->pipe_buffer.size > SMALL_PIPE_SIZE) && - (wpipe->pipe_buffer.cnt <= SMALL_PIPE_SIZE) && - (piperesizeallowed == 1)) + if (amountpipekva > (3 * maxpipekva) / 4 && + wpipe->pipe_buffer.size > SMALL_PIPE_SIZE && + wpipe->pipe_buffer.cnt <= SMALL_PIPE_SIZE && + piperesizeallowed == 1) desiredsize = SMALL_PIPE_SIZE; /* Resize if the above determined that a new size was necessary */ - if ((desiredsize != wpipe->pipe_buffer.size) && - ((wpipe->pipe_state & PIPE_DIRECTW) == 0)) { + if (desiredsize != wpipe->pipe_buffer.size && + (wpipe->pipe_state & PIPE_DIRECTW) == 0) { PIPE_UNLOCK(wpipe); pipespace(wpipe, desiredsize); PIPE_LOCK(wpipe); ___ 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-unsubscr...@freebsd.org"
svn commit: r358818 - head/sys/dev/acpica
Author: wulf Date: Mon Mar 9 20:27:25 2020 New Revision: 358818 URL: https://svnweb.freebsd.org/changeset/base/358818 Log: acpi: Fix stalled value returned by acpi_get_device() after device deletion Newbus device reference attached to ACPI handle is not cleared when newbus device is deleted with devctl(8) delete command. Fix that with calling of AcpiDetachData() from "child_deleted" bus method like acpi_pci driver does. MFC after:2 weeks Differential Revision:https://reviews.freebsd.org/D22902 Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c == --- head/sys/dev/acpica/acpi.c Mon Mar 9 19:55:13 2020(r358817) +++ head/sys/dev/acpica/acpi.c Mon Mar 9 20:27:25 2020(r358818) @@ -121,6 +121,7 @@ static device_t acpi_add_child(device_t bus, u_int ord static int acpi_print_child(device_t bus, device_t child); static voidacpi_probe_nomatch(device_t bus, device_t child); static voidacpi_driver_added(device_t dev, driver_t *driver); +static voidacpi_child_deleted(device_t dev, device_t child); static int acpi_read_ivar(device_t dev, device_t child, int index, uintptr_t *result); static int acpi_write_ivar(device_t dev, device_t child, int index, @@ -199,6 +200,7 @@ static device_method_t acpi_methods[] = { DEVMETHOD(bus_print_child, acpi_print_child), DEVMETHOD(bus_probe_nomatch, acpi_probe_nomatch), DEVMETHOD(bus_driver_added,acpi_driver_added), +DEVMETHOD(bus_child_deleted, acpi_child_deleted), DEVMETHOD(bus_read_ivar, acpi_read_ivar), DEVMETHOD(bus_write_ivar, acpi_write_ivar), DEVMETHOD(bus_get_resource_list, acpi_get_rlist), @@ -907,6 +909,18 @@ acpi_child_pnpinfo_str_method(device_t cbdev, device_t } /* + * Handle device deletion. + */ +static void +acpi_child_deleted(device_t dev, device_t child) +{ +struct acpi_device *dinfo = device_get_ivars(child); + +if (acpi_get_device(dinfo->ad_handle) == child) + AcpiDetachData(dinfo->ad_handle, acpi_fake_objhandler); +} + +/* * Handle per-device ivars */ static int @@ -1791,10 +1805,8 @@ acpi_device_scan_cb(ACPI_HANDLE h, UINT32 level, void return (status); /* Remove the old child and its connection to the handle. */ -if (old_dev != NULL) { +if (old_dev != NULL) device_delete_child(device_get_parent(old_dev), old_dev); - AcpiDetachData(h, acpi_fake_objhandler); -} /* Recreate the handle association if the user created a device. */ if (dev != NULL) ___ 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-unsubscr...@freebsd.org"
svn commit: r358819 - head/sys/dev/acpica
Author: wulf Date: Mon Mar 9 20:28:45 2020 New Revision: 358819 URL: https://svnweb.freebsd.org/changeset/base/358819 Log: acpi: Export functions required by upcoming acpi_iicbus driver. Modified: head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpivar.h Modified: head/sys/dev/acpica/acpi.c == --- head/sys/dev/acpica/acpi.c Mon Mar 9 20:27:25 2020(r358818) +++ head/sys/dev/acpica/acpi.c Mon Mar 9 20:28:45 2020(r358819) @@ -150,7 +150,6 @@ static ACPI_STATUS acpi_device_scan_cb(ACPI_HANDLE h, void *context, void **retval); static ACPI_STATUS acpi_device_scan_children(device_t bus, device_t dev, int max_depth, acpi_scan_cb_t user_fn, void *arg); -static int acpi_set_powerstate(device_t child, int state); static int acpi_isa_pnp_probe(device_t bus, device_t child, struct isa_pnp_id *ids); static voidacpi_probe_children(device_t bus); @@ -162,7 +161,6 @@ static ACPI_STATUS acpi_sleep_disable(struct acpi_soft static ACPI_STATUS acpi_EnterSleepState(struct acpi_softc *sc, int state); static voidacpi_shutdown_final(void *arg, int howto); static voidacpi_enable_fixed_events(struct acpi_softc *sc); -static BOOLEAN acpi_has_hid(ACPI_HANDLE handle); static voidacpi_resync_clock(struct acpi_softc *sc); static int acpi_wake_sleep_prep(ACPI_HANDLE handle, int sstate); static int acpi_wake_run_prep(ACPI_HANDLE handle, int sstate); @@ -883,14 +881,12 @@ acpi_child_location_str_method(device_t cbdev, device_ } /* PnP information for devctl(8) */ -static int -acpi_child_pnpinfo_str_method(device_t cbdev, device_t child, char *buf, -size_t buflen) +int +acpi_pnpinfo_str(ACPI_HANDLE handle, char *buf, size_t buflen) { -struct acpi_device *dinfo = device_get_ivars(child); ACPI_DEVICE_INFO *adinfo; -if (ACPI_FAILURE(AcpiGetObjectInfo(dinfo->ad_handle, &adinfo))) { +if (ACPI_FAILURE(AcpiGetObjectInfo(handle, &adinfo))) { snprintf(buf, buflen, "unknown"); return (0); } @@ -908,6 +904,15 @@ acpi_child_pnpinfo_str_method(device_t cbdev, device_t return (0); } +static int +acpi_child_pnpinfo_str_method(device_t cbdev, device_t child, char *buf, +size_t buflen) +{ +struct acpi_device *dinfo = device_get_ivars(child); + +return (acpi_pnpinfo_str(dinfo->ad_handle, buf, buflen)); +} + /* * Handle device deletion. */ @@ -1840,7 +1845,7 @@ acpi_device_scan_children(device_t bus, device_t dev, * Even though ACPI devices are not PCI, we use the PCI approach for setting * device power states since it's close enough to ACPI. */ -static int +int acpi_set_powerstate(device_t child, int state) { ACPI_HANDLE h; @@ -2285,7 +2290,7 @@ acpi_BatteryIsPresent(device_t dev) /* * Returns true if a device has at least one valid device ID. */ -static BOOLEAN +BOOLEAN acpi_has_hid(ACPI_HANDLE h) { ACPI_DEVICE_INFO *devinfo; Modified: head/sys/dev/acpica/acpivar.h == --- head/sys/dev/acpica/acpivar.h Mon Mar 9 20:27:25 2020 (r358818) +++ head/sys/dev/acpica/acpivar.h Mon Mar 9 20:28:45 2020 (r358819) @@ -371,6 +371,7 @@ int acpi_bus_alloc_gas(device_t dev, int *type, int * u_int flags); void acpi_walk_subtables(void *first, void *end, acpi_subtable_handler *handler, void *arg); +BOOLEANacpi_has_hid(ACPI_HANDLE handle); intacpi_MatchHid(ACPI_HANDLE h, const char *hid); #define ACPI_MATCHHID_NOMATCH 0 #define ACPI_MATCHHID_HID 1 @@ -434,6 +435,7 @@ ACPI_STATUS acpi_pwr_wake_enable(ACPI_HANDLE consumer, ACPI_STATUSacpi_pwr_switch_consumer(ACPI_HANDLE consumer, int state); intacpi_device_pwr_for_sleep(device_t bus, device_t dev, int *dstate); +intacpi_set_powerstate(device_t child, int state); /* APM emulation */ void acpi_apm_init(struct acpi_softc *); @@ -468,6 +470,7 @@ int acpi_wakeup_machdep(struct acpi_softc *sc, int st int sleep_result, int intr_enabled); intacpi_table_quirks(int *quirks); intacpi_machdep_quirks(int *quirks); +intacpi_pnpinfo_str(ACPI_HANDLE handle, char *buf, size_t buflen); uint32_t hpet_get_uid(device_t dev); ___ 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-unsubscr...@freebsd.org"
svn commit: r358820 - in head/sys: conf dev/ichiic dev/iicbus modules/i2c/iicbus
Author: wulf Date: Mon Mar 9 20:31:38 2020 New Revision: 358820 URL: https://svnweb.freebsd.org/changeset/base/358820 Log: iicbus(4): Add support for ACPI-based children enumeration When iicbus is attached as child of Designware I2C controller it scans all ACPI nodes for "I2C Serial Bus Connection Resource Descriptor" described in section 19.6.57 of ACPI specs. If such a descriptor is found, I2C child is added to iicbus, it's I2C address, IRQ resource and ACPI handle are added to ivars. Existing ACPI bus-hosted child is deleted afterwards. The driver also installs so called "I2C address space handler" which is disabled by default as nontested. Set hw.iicbus.enable_acpi_space_handler loader tunable to 1 to enable it. Reviewed by: markj MFC after:2 weeks Differential Revision:https://reviews.freebsd.org/D22901 Added: head/sys/dev/iicbus/acpi_iicbus.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/ichiic/ig4_iic.c head/sys/dev/iicbus/iicbus.c head/sys/dev/iicbus/iicbus.h head/sys/modules/i2c/iicbus/Makefile Modified: head/sys/conf/files == --- head/sys/conf/files Mon Mar 9 20:28:45 2020(r358819) +++ head/sys/conf/files Mon Mar 9 20:31:38 2020(r358820) @@ -1773,6 +1773,7 @@ dev/ichsmb/ichsmb_pci.c optional ichsmb pci dev/ida/ida.c optional ida dev/ida/ida_disk.c optional ida dev/ida/ida_pci.c optional ida pci +dev/iicbus/acpi_iicbus.c optional acpi iicbus dev/iicbus/ad7418.coptional ad7418 dev/iicbus/ads111x.c optional ads111x dev/iicbus/ds1307.coptional ds1307 Modified: head/sys/dev/ichiic/ig4_iic.c == --- head/sys/dev/ichiic/ig4_iic.c Mon Mar 9 20:28:45 2020 (r358819) +++ head/sys/dev/ichiic/ig4_iic.c Mon Mar 9 20:31:38 2020 (r358820) @@ -1201,5 +1201,9 @@ ig4iic_dump(ig4iic_softc_t *sc) devclass_t ig4iic_devclass; DRIVER_MODULE(iicbus, ig4iic, iicbus_driver, iicbus_devclass, NULL, NULL); +#ifdef DEV_ACPI +DRIVER_MODULE(acpi_iicbus, ig4iic, acpi_iicbus_driver, iicbus_devclass, NULL, +NULL); +#endif MODULE_DEPEND(ig4iic, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); MODULE_VERSION(ig4iic, 1); Added: head/sys/dev/iicbus/acpi_iicbus.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iicbus/acpi_iicbus.c Mon Mar 9 20:31:38 2020 (r358820) @@ -0,0 +1,789 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019-2020 Vladimir Kondratyev + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include + +#defineACPI_IICBUS_LOCAL_BUFSIZE 32 /* Fits max SMBUS block size */ + +/* + * Make a copy of ACPI_RESOURCE_I2C_SERIALBUS type and replace "pointer to ACPI + * object name string" field with pointer to ACPI object itself. + * This saves us extra strdup()/free() pair on acpi_iicbus_get_i2cres call. + */ +typedefACPI_RESOURCE_I2C_SERIALBUS ACPI_IICBUS_RESOURCE_I2C_SERIALBUS; +#defineResourceSource_Handle ResourceSource.StringPtr + +/* Hooks for the ACPI CA debugging infrastructure. */ +#define_COMPONENT ACPI_BUS +ACPI_MODULE_NAME("IIC") + +struct gsb_buffer { + UINT8 statu
svn commit: r358821 - in head: . contrib/amd libexec/rc/rc.d release tools/build/mk tools/build/options usr.sbin usr.sbin/amd usr.sbin/newsyslog/newsyslog.conf.d
Author: emaste Date: Mon Mar 9 20:46:43 2020 New Revision: 358821 URL: https://svnweb.freebsd.org/changeset/base/358821 Log: retire amd(8) autofs was introduced with FreeBSD 10.1 and is the supported method for automounting filesystems. As of r296194 the amd man page claimed that it is deprecated. Remove it from base now; the sysutils/am-utils port is still available if necessary. Discussed with: cy Relnotes: Yes Sponsored by: The FreeBSD Foundation Deleted: head/contrib/amd/ head/libexec/rc/rc.d/amd head/tools/build/options/WITHOUT_AMD head/tools/build/options/WITH_AMD head/usr.sbin/amd/ Modified: head/Makefile.inc1 head/ObsoleteFiles.inc head/UPDATING head/libexec/rc/rc.d/Makefile head/release/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.sbin/Makefile head/usr.sbin/newsyslog/newsyslog.conf.d/Makefile Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Mon Mar 9 20:31:38 2020(r358820) +++ head/Makefile.inc1 Mon Mar 9 20:46:43 2020(r358821) @@ -2284,11 +2284,6 @@ _basic_bootstrap_tools+=sbin/sysctl bin/chflags # mkfifo is used by sys/conf/newvers.sh _basic_bootstrap_tools+=usr.bin/mkfifo -.if ${MK_AMD} != "no" -# unifdef is only used by usr.sbin/amd/libamu/Makefile -_basic_bootstrap_tools+=usr.bin/unifdef -.endif - .if ${MK_BOOT} != "no" _basic_bootstrap_tools+=bin/dd # xz/unxz is used by EFI Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Mon Mar 9 20:31:38 2020(r358820) +++ head/ObsoleteFiles.inc Mon Mar 9 20:46:43 2020(r358821) @@ -36,6 +36,28 @@ # xargs -n1 | sort | uniq -d; # done +# 20200309: amd(8) retired +OLD_FILES+=etc/amd.map +OLD_FILES+=etc/newsyslog.conf.d/amd.conf +OLD_FILES+=etc/rc.d/amd +OLD_FILES+=usr/bin/pawd +OLD_FILES+=usr/sbin/amd +OLD_FILES+=usr/sbin/amq +OLD_FILES+=usr/sbin/fixmount +OLD_FILES+=usr/sbin/fsinfo +OLD_FILES+=usr/sbin/hlfsd +OLD_FILES+=usr/sbin/mk-amd-map +OLD_FILES+=usr/sbin/wire-test +OLD_FILES+=usr/share/examples/etc/amd.map +OLD_FILES+=usr/share/man/man1/pawd.1.gz +OLD_FILES+=usr/share/man/man5/amd.conf.5.gz +OLD_FILES+=usr/share/man/man8/amd.8.gz +OLD_FILES+=usr/share/man/man8/amq.8.gz +OLD_FILES+=usr/share/man/man8/fixmount.8.gz +OLD_FILES+=usr/share/man/man8/fsinfo.8.gz +OLD_FILES+=usr/share/man/man8/hlfsd.8.gz +OLD_FILES+=usr/share/man/man8/mk-amd-map.8.gz +OLD_FILES+=usr/share/man/man8/wire-test.8.gz # 20200301: bktr removed OLD_DIRS+=usr/include/dev/bktr OLD_FILES+=usr/include/dev/bktr/ioctl_bktr.h Modified: head/UPDATING == --- head/UPDATING Mon Mar 9 20:31:38 2020(r358820) +++ head/UPDATING Mon Mar 9 20:46:43 2020(r358821) @@ -26,6 +26,11 @@ 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".) +20200309: + The amd(8) automount daemon has been removed from the source tree. + As of FreeBSD 10.1 autofs(5) is the preferred tool for automounting. + amd is still available in the sysutils/am-utils port. + 20200301: Removed brooktree driver (bktr.4) from the tree. Modified: head/libexec/rc/rc.d/Makefile == --- head/libexec/rc/rc.d/Makefile Mon Mar 9 20:31:38 2020 (r358820) +++ head/libexec/rc/rc.d/Makefile Mon Mar 9 20:46:43 2020 (r358821) @@ -141,12 +141,6 @@ ACPIPACKAGE= acpi CONFS+=powerd .endif -.if ${MK_AMD} != "no" -CONFGROUPS+= AMD -AMD+= amd -AMDPACKAGE=amd -.endif - .if ${MK_APM} != "no" CONFGROUPS+= APM APM+= apm Modified: head/release/Makefile == --- head/release/Makefile Mon Mar 9 20:31:38 2020(r358820) +++ head/release/Makefile Mon Mar 9 20:46:43 2020(r358821) @@ -192,7 +192,7 @@ disc1: packagesystem # Install system mkdir -p ${.TARGET} cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ - DESTDIR=${.OBJDIR}/${.TARGET} MK_AMD=no MK_AT=no \ + DESTDIR=${.OBJDIR}/${.TARGET} MK_AT=no \ MK_INSTALLLIB=no MK_LIB32=no MK_MAIL=no \ MK_TOOLCHAIN=no MK_PROFILE=no \ MK_RESCUE=no MK_DICT=no \ @@ -221,7 +221,7 @@ bootonly: packagesystem # Install system mkdir -p ${.TARGET} cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ - DESTDIR=${.OBJDIR}/${.TARGET} MK_AMD=no MK_AT=no \ + DESTDIR=${.OBJDIR}/${.TARGET} MK_AT=no \
svn commit: r358822 - head/share/mk
Author: emaste Date: Mon Mar 9 20:49:06 2020 New Revision: 358822 URL: https://svnweb.freebsd.org/changeset/base/358822 Log: Remove WITH_AMD option, missed in r358821 Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk == --- head/share/mk/src.opts.mk Mon Mar 9 20:46:43 2020(r358821) +++ head/share/mk/src.opts.mk Mon Mar 9 20:49:06 2020(r358822) @@ -194,7 +194,6 @@ __DEFAULT_YES_OPTIONS = \ ZONEINFO __DEFAULT_NO_OPTIONS = \ -AMD \ BEARSSL \ BSD_GREP \ CLANG_EXTRAS \ ___ 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-unsubscr...@freebsd.org"
svn commit: r358823 - head/share/man/man5
Author: emaste Date: Mon Mar 9 20:49:59 2020 New Revision: 358823 URL: https://svnweb.freebsd.org/changeset/base/358823 Log: regen src.conf.5 after r358821, AMD option removal Also pick up LOADER_VERIEXEC_VECTX change. Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 == --- head/share/man/man5/src.conf.5 Mon Mar 9 20:49:06 2020 (r358822) +++ head/share/man/man5/src.conf.5 Mon Mar 9 20:49:59 2020 (r358823) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd February 29, 2020 +.Dd March 9, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -100,13 +100,6 @@ Set to not build .Xr acpiconf 8 , .Xr acpidump 8 and related programs. -.It Va WITH_AMD -Set to build the legacy -.Xr amd 8 -automount daemon and related programs. -Note that -.Xr autofs 5 -is the preferred automount technique. .It Va WITHOUT_APM Set to not build .Xr apm 8 , @@ -162,6 +155,10 @@ is set explicitly) (unless .Va WITHOUT_LOADER_VERIEXEC is set explicitly) +.It Va WITH_LOADER_VERIEXEC_VECTX +(unless +.Va WITHOUT_LOADER_VERIEXEC_VECTX +is set explicitly) .It Va WITH_VERIEXEC (unless .Va WITHOUT_VERIEXEC @@ -1105,6 +1102,10 @@ When set, these options are also in effect: .It Va WITH_LOADER_EFI_SECUREBOOT (unless .Va WITHOUT_LOADER_EFI_SECUREBOOT +is set explicitly) +.It Va WITH_LOADER_VERIEXEC_VECTX +(unless +.Va WITHOUT_LOADER_VERIEXEC_VECTX is set explicitly) .El .It Va WITH_LOADER_VERIEXEC_PASS_MANIFEST ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r358821 - in head: . contrib/amd libexec/rc/rc.d release tools/build/mk tools/build/options usr.sbin usr.sbin/amd usr.sbin/newsyslog/newsyslog.conf.d
In message <202003092046.029kkikt073...@repo.freebsd.org>, Ed Maste writes: > Author: emaste > Date: Mon Mar 9 20:46:43 2020 > New Revision: 358821 > URL: https://svnweb.freebsd.org/changeset/base/358821 > > Log: > retire amd(8) > > autofs was introduced with FreeBSD 10.1 and is the supported method for > automounting filesystems. As of r296194 the amd man page claimed that it > is deprecated. Remove it from base now; the sysutils/am-utils port is > still available if necessary. > > Discussed with: cy > Relnotes: Yes > Sponsored by: The FreeBSD Foundation > > Deleted: > head/contrib/amd/ > head/libexec/rc/rc.d/amd > head/tools/build/options/WITHOUT_AMD > head/tools/build/options/WITH_AMD > head/usr.sbin/amd/ > Modified: > head/Makefile.inc1 > head/ObsoleteFiles.inc > head/UPDATING > head/libexec/rc/rc.d/Makefile > head/release/Makefile > head/tools/build/mk/OptionalObsoleteFiles.inc > head/usr.sbin/Makefile > head/usr.sbin/newsyslog/newsyslog.conf.d/Makefile Can we have a __FreeBSD_version bump? -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. ___ 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-unsubscr...@freebsd.org"
svn commit: r358824 - head/sys/dev/usb/input
Author: wulf Date: Mon Mar 9 21:01:22 2020 New Revision: 358824 URL: https://svnweb.freebsd.org/changeset/base/358824 Log: wmt(4): Fix Synaptics Touch Digitizer V04 attachment Touch Digitizer V04 report descriptor declares 'Contact Count Maximum' usage as constant. That was not supported by descriptor parser. PR: 232040 Reported by: Sergei Akhmatdinov MFC after:1 week Modified: head/sys/dev/usb/input/wmt.c Modified: head/sys/dev/usb/input/wmt.c == --- head/sys/dev/usb/input/wmt.cMon Mar 9 20:49:59 2020 (r358823) +++ head/sys/dev/usb/input/wmt.cMon Mar 9 21:01:22 2020 (r358824) @@ -655,9 +655,8 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, thqa_cert_rid = hi.report_ID; break; } - if (hi.collevel == 1 && touch_coll && - WMT_HI_ABSOLUTE(hi) && hi.usage == - HID_USAGE2(HUP_DIGITIZERS, HUD_CONTACT_MAX)) { + if (hi.collevel == 1 && touch_coll && hi.usage == + HID_USAGE2(HUP_DIGITIZERS, HUD_CONTACT_MAX)) { cont_count_max = hi.logical_maximum; cont_max_rid = hi.report_ID; if (sc != NULL) ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r358821 - in head: . contrib/amd libexec/rc/rc.d release tools/build/mk tools/build/options usr.sbin usr.sbin/amd usr.sbin/newsyslog/newsyslog.conf.d
In message <202003092054.029ksosc056...@slippy.cwsent.com>, Cy Schubert writes: > In message <202003092046.029kkikt073...@repo.freebsd.org>, Ed Maste writes: > > Author: emaste > > Date: Mon Mar 9 20:46:43 2020 > > New Revision: 358821 > > URL: https://svnweb.freebsd.org/changeset/base/358821 > > > > Log: > > retire amd(8) > > > > autofs was introduced with FreeBSD 10.1 and is the supported method for > > automounting filesystems. As of r296194 the amd man page claimed that it > > is deprecated. Remove it from base now; the sysutils/am-utils port is > > still available if necessary. > > > > Discussed with: cy > > Relnotes: Yes > > Sponsored by: The FreeBSD Foundation > > > > Deleted: > > head/contrib/amd/ > > head/libexec/rc/rc.d/amd > > head/tools/build/options/WITHOUT_AMD > > head/tools/build/options/WITH_AMD > > head/usr.sbin/amd/ > > Modified: > > head/Makefile.inc1 > > head/ObsoleteFiles.inc > > head/UPDATING > > head/libexec/rc/rc.d/Makefile > > head/release/Makefile > > head/tools/build/mk/OptionalObsoleteFiles.inc > > head/usr.sbin/Makefile > > head/usr.sbin/newsyslog/newsyslog.conf.d/Makefile > > Can we have a __FreeBSD_version bump? Sorry for being snippy. It's a bad day here, client-wise, and it's spilling over here. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r358733 - head/sys/sys
On Mon, Mar 09, 2020 at 01:56:17AM +0100, Mateusz Guzik wrote: > On 3/8/20, Mateusz Guzik wrote: > > Author: mjg > > Date: Sun Mar 8 00:22:32 2020 > > New Revision: 358733 > > URL: https://svnweb.freebsd.org/changeset/base/358733 > > > > Log: > > seqc: tidy up > > > > - avoid hand-rolled read > > - match begin/end in terms of fence style > > > > There were off lists questions about this so let me clarify. > > The first bit is a cosmetic change, but the second one is not. > > > Modified: > > head/sys/sys/seqc.h > > > > Modified: head/sys/sys/seqc.h > > == > > --- head/sys/sys/seqc.h Sat Mar 7 15:37:23 2020(r358732) > > +++ head/sys/sys/seqc.h Sun Mar 8 00:22:32 2020(r358733) > > @@ -66,7 +66,8 @@ static __inline void > > seqc_write_end(seqc_t *seqcp) > > { > > > > - atomic_store_rel_int(seqcp, *seqcp + 1); > > + atomic_thread_fence_rel(); > > + *seqcp += 1; > > MPASS(!seqc_in_modify(*seqcp)); > > critical_exit(); > > } > > For correct operation the counter has to be modified *before* any work > is done and *after* it is completed. > > Consider a trivial case: > seqc++; > foo[0] = 0; > foo[1] = 1; > seqc++; > > There are 2 ways in which this can be mucked with: > - the compiler can be looking at reordering or reworking the increment > (e.g., to collapse it to just += 2 instead). a compiler barrier > prevents that. > - even with generated machine code which increments in correct places > the cpu can be looking at reordering the operation (which is heavily > dependent on architecture), in particular it could end up issuing > seqc++; foo[1] = 1; which would defeat the point. This is where > release fences come in. > > With the patched code there is: > seqc++; > atomic_thread_fence_rel(); /* make sure seqc++ is issued before foo > starts getting modified */ > foo[0] = 0; > foo[1] = 1; > atomic_thread_fence_rel(); /* make sure modifications to foo don't > leak past this spot */ > seqc++; > > In comparison, the previous code was: > seqc++; > atomic_thread_fence_rel(); /* make sure seqc++ is issued before foo > starts getting modified */ > foo[0] = 0; > foo[1] = 1; > atomic_store_rel_int(seqcp, *seqcp + 1); /* make sure modifications to > too don't leak past this spot and update seqc immediately */ > > There are 2 differences here -- one is an improvement and second one > does not matter: > the win is: the previous code forces the compiler to compute an > incremented value and then store it. On amd64 this translates to the > following (with rdx holding the address of the counter): > > mov(%rdx),%eax /* load the value */ > add$0x1,%eax/* add 1 */ > mov%eax,(%rdx) /* store it */ > > On patched kernel this is: > addl $0x1,(%rdx) > > which is clearly much nicer. I am not sure that the new code on amd64 is much nicer. But the point was that on non-amd64, i.e. armv8 and potentially on powerpc 3.0, the patch substitutes release store with full barrier. The later is (much) slower. > > the not a problem: the code does not issue the release fence after > incrementing the counter the second time, meaning that in principle it > can happen arbitrarily late, possibly disturbing code which waits for > the counter to become even. This is not a problem because in whoever > modifies it is supposed to have a lock and release it shortly after, > which also posts the release fence and consequently makes sure the > counter update is visible. Also note these routines come with > preemption disablement around the modification -- if the thread gets > preempted as a result of critical_exit from seqc_write_end, it will > also publish the updated counter. If the updater never does anything > which flushes the store buffer then in the absolute worst case they > will get preempted, at which point once more we are covered. Note that > code which wants more deterministic behavior will want to > seqc_read_any, test the counter once and if it is caught uneven resort > to locking. > > > @@ -84,7 +85,7 @@ seqc_read(const seqc_t *seqcp) > > seqc_t ret; > > > > for (;;) { > > - ret = atomic_load_acq_int(__DECONST(seqc_t *, seqcp)); > > + ret = seqc_read_any(seqcp); > > if (__predict_false(seqc_in_modify(ret))) { > > cpu_spinwait(); > > continue; > > ___ > > svn-src-...@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" > > > > > -- > Mateusz Guzik ___ 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-unsubscr...@freebsd.org"
svn commit: r358825 - in head/sys: fs/fifofs kern sys
Author: kib Date: Mon Mar 9 21:55:26 2020 New Revision: 358825 URL: https://svnweb.freebsd.org/changeset/base/358825 Log: Preallocate pipe buffers on pipe creation. Return ENOMEM if one of the buffer cannot be created even with the minimal size. This should avoid subsequent spurious ENOMEM errors from write(2) when buffer cannot be allocated on the fly, after we reported that the pipe was create succesfully. Reported by: Keno Fischer Reviewed by: markj (previous version) Sponsored by: The FreeBSD Foundation MFC after:1 week Differential revision:https://reviews.freebsd.org/D23993 Modified: head/sys/fs/fifofs/fifo_vnops.c head/sys/kern/sys_pipe.c head/sys/sys/pipe.h Modified: head/sys/fs/fifofs/fifo_vnops.c == --- head/sys/fs/fifofs/fifo_vnops.c Mon Mar 9 21:01:22 2020 (r358824) +++ head/sys/fs/fifofs/fifo_vnops.c Mon Mar 9 21:55:26 2020 (r358825) @@ -151,7 +151,9 @@ fifo_open(ap) if (fp == NULL || (ap->a_mode & FEXEC) != 0) return (EINVAL); if ((fip = vp->v_fifoinfo) == NULL) { - pipe_named_ctor(&fpipe, td); + error = pipe_named_ctor(&fpipe, td); + if (error != 0) + return (error); fip = malloc(sizeof(*fip), M_VNODE, M_WAITOK); fip->fi_pipe = fpipe; fpipe->pipe_wgen = fip->fi_readers = fip->fi_writers = 0; Modified: head/sys/kern/sys_pipe.c == --- head/sys/kern/sys_pipe.cMon Mar 9 21:01:22 2020(r358824) +++ head/sys/kern/sys_pipe.cMon Mar 9 21:55:26 2020(r358825) @@ -226,8 +226,8 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, piperesizeallowed, CTL static void pipeinit(void *dummy __unused); static void pipeclose(struct pipe *cpipe); static void pipe_free_kmem(struct pipe *cpipe); -static void pipe_create(struct pipe *pipe, int backing); -static void pipe_paircreate(struct thread *td, struct pipepair **p_pp); +static int pipe_create(struct pipe *pipe, bool backing); +static int pipe_paircreate(struct thread *td, struct pipepair **p_pp); static __inline int pipelock(struct pipe *cpipe, int catch); static __inline void pipeunlock(struct pipe *cpipe); #ifndef PIPE_NODIRECT @@ -335,11 +335,12 @@ pipe_zone_fini(void *mem, int size) mtx_destroy(&pp->pp_mtx); } -static void +static int pipe_paircreate(struct thread *td, struct pipepair **p_pp) { struct pipepair *pp; struct pipe *rpipe, *wpipe; + int error; *p_pp = pp = uma_zalloc(pipe_zone, M_WAITOK); #ifdef MAC @@ -357,22 +358,44 @@ pipe_paircreate(struct thread *td, struct pipepair **p knlist_init_mtx(&rpipe->pipe_sel.si_note, PIPE_MTX(rpipe)); knlist_init_mtx(&wpipe->pipe_sel.si_note, PIPE_MTX(wpipe)); - /* Only the forward direction pipe is backed by default */ - pipe_create(rpipe, 1); - pipe_create(wpipe, 0); + /* +* Only the forward direction pipe is backed by big buffer by +* default. +*/ + error = pipe_create(rpipe, true); + if (error != 0) + goto fail; + error = pipe_create(wpipe, false); + if (error != 0) { + pipe_free_kmem(rpipe); + goto fail; + } rpipe->pipe_state |= PIPE_DIRECTOK; wpipe->pipe_state |= PIPE_DIRECTOK; + return (0); + +fail: + knlist_destroy(&rpipe->pipe_sel.si_note); + knlist_destroy(&wpipe->pipe_sel.si_note); +#ifdef MAC + mac_pipe_destroy(pp); +#endif + return (error); } -void +int pipe_named_ctor(struct pipe **ppipe, struct thread *td) { struct pipepair *pp; + int error; - pipe_paircreate(td, &pp); + error = pipe_paircreate(td, &pp); + if (error != 0) + return (error); pp->pp_rpipe.pipe_state |= PIPE_NAMED; *ppipe = &pp->pp_rpipe; + return (0); } void @@ -402,7 +425,9 @@ kern_pipe(struct thread *td, int fildes[2], int flags, struct pipepair *pp; int fd, fflags, error; - pipe_paircreate(td, &pp); + error = pipe_paircreate(td, &pp); + if (error != 0) + return (error); rpipe = &pp->pp_rpipe; wpipe = &pp->pp_wpipe; error = falloc_caps(td, &rf, &fd, flags, fcaps1); @@ -616,25 +641,16 @@ pipeselwakeup(struct pipe *cpipe) * Initialize and allocate VM and memory for pipe. The structure * will start out zero'd from the ctor, so we just manage the kmem. */ -static void -pipe_create(struct pipe *pipe, int backing) +static int +pipe_create(struct pipe *pipe, bool large_backing) { + int error; - if (backing) { - /* -* Note that these functions can fail if pipe map is exhausted -* (as a result of too many pipes cre
svn commit: r358826 - head/usr.bin/posixshmcontrol
Author: kib Date: Mon Mar 9 23:08:24 2020 New Revision: 358826 URL: https://svnweb.freebsd.org/changeset/base/358826 Log: posixshmcontrol: add an undocumented alias 'list' for the 'ls' command. Sponsored by: The FreeBSD Foundation MFC after:3 days Modified: head/usr.bin/posixshmcontrol/posixshmcontrol.c Modified: head/usr.bin/posixshmcontrol/posixshmcontrol.c == --- head/usr.bin/posixshmcontrol/posixshmcontrol.c Mon Mar 9 21:55:26 2020(r358825) +++ head/usr.bin/posixshmcontrol/posixshmcontrol.c Mon Mar 9 23:08:24 2020(r358826) @@ -446,6 +446,7 @@ struct opmode { static const struct opmode opmodes[] = { { .cmd = "create", .impl = create_shm}, { .cmd = "rm", .impl = delete_shm, }, + { .cmd = "list",.impl = list_shm }, { .cmd = "ls", .impl = list_shm }, { .cmd = "dump",.impl = read_shm, }, { .cmd = "stat",.impl = stat_shm, }, ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r358733 - head/sys/sys
On 3/9/20, Konstantin Belousov wrote: > On Mon, Mar 09, 2020 at 01:56:17AM +0100, Mateusz Guzik wrote: >> On 3/8/20, Mateusz Guzik wrote: >> > Author: mjg >> > Date: Sun Mar 8 00:22:32 2020 >> > New Revision: 358733 >> > URL: https://svnweb.freebsd.org/changeset/base/358733 >> > >> > Log: >> > seqc: tidy up >> > >> > - avoid hand-rolled read >> > - match begin/end in terms of fence style >> > >> >> There were off lists questions about this so let me clarify. >> >> The first bit is a cosmetic change, but the second one is not. >> >> > Modified: >> > head/sys/sys/seqc.h >> > >> > Modified: head/sys/sys/seqc.h >> > == >> > --- head/sys/sys/seqc.hSat Mar 7 15:37:23 2020(r358732) >> > +++ head/sys/sys/seqc.hSun Mar 8 00:22:32 2020(r358733) >> > @@ -66,7 +66,8 @@ static __inline void >> > seqc_write_end(seqc_t *seqcp) >> > { >> > >> > - atomic_store_rel_int(seqcp, *seqcp + 1); >> > + atomic_thread_fence_rel(); >> > + *seqcp += 1; >> >MPASS(!seqc_in_modify(*seqcp)); >> >critical_exit(); >> > } >> >> For correct operation the counter has to be modified *before* any work >> is done and *after* it is completed. >> >> Consider a trivial case: >> seqc++; >> foo[0] = 0; >> foo[1] = 1; >> seqc++; >> >> There are 2 ways in which this can be mucked with: >> - the compiler can be looking at reordering or reworking the increment >> (e.g., to collapse it to just += 2 instead). a compiler barrier >> prevents that. >> - even with generated machine code which increments in correct places >> the cpu can be looking at reordering the operation (which is heavily >> dependent on architecture), in particular it could end up issuing >> seqc++; foo[1] = 1; which would defeat the point. This is where >> release fences come in. >> >> With the patched code there is: >> seqc++; >> atomic_thread_fence_rel(); /* make sure seqc++ is issued before foo >> starts getting modified */ >> foo[0] = 0; >> foo[1] = 1; >> atomic_thread_fence_rel(); /* make sure modifications to foo don't >> leak past this spot */ >> seqc++; >> >> In comparison, the previous code was: >> seqc++; >> atomic_thread_fence_rel(); /* make sure seqc++ is issued before foo >> starts getting modified */ >> foo[0] = 0; >> foo[1] = 1; >> atomic_store_rel_int(seqcp, *seqcp + 1); /* make sure modifications to >> too don't leak past this spot and update seqc immediately */ >> >> There are 2 differences here -- one is an improvement and second one >> does not matter: >> the win is: the previous code forces the compiler to compute an >> incremented value and then store it. On amd64 this translates to the >> following (with rdx holding the address of the counter): >> >> mov(%rdx),%eax /* load the value */ >> add$0x1,%eax/* add 1 */ >> mov%eax,(%rdx) /* store it */ >> >> On patched kernel this is: >> addl $0x1,(%rdx) >> >> which is clearly much nicer. > I am not sure that the new code on amd64 is much nicer. > > But the point was that on non-amd64, i.e. armv8 and potentially on > powerpc 3.0, the patch substitutes release store with full barrier. The > later is (much) slower. > If an arch performs something significantly more expensive here it's probably a performance bug in the port. But perhaps more importantly there are significantly more frequent users of atomic_thread_fence_rel, like refcount(9). If the issue is real that should be looked at. >> >> the not a problem: the code does not issue the release fence after >> incrementing the counter the second time, meaning that in principle it >> can happen arbitrarily late, possibly disturbing code which waits for >> the counter to become even. This is not a problem because in whoever >> modifies it is supposed to have a lock and release it shortly after, >> which also posts the release fence and consequently makes sure the >> counter update is visible. Also note these routines come with >> preemption disablement around the modification -- if the thread gets >> preempted as a result of critical_exit from seqc_write_end, it will >> also publish the updated counter. If the updater never does anything >> which flushes the store buffer then in the absolute worst case they >> will get preempted, at which point once more we are covered. Note that >> code which wants more deterministic behavior will want to >> seqc_read_any, test the counter once and if it is caught uneven resort >> to locking. >> >> > @@ -84,7 +85,7 @@ seqc_read(const seqc_t *seqcp) >> >seqc_t ret; >> > >> >for (;;) { >> > - ret = atomic_load_acq_int(__DECONST(seqc_t *, seqcp)); >> > + ret = seqc_read_any(seqcp); >> >if (__predict_false(seqc_in_modify(ret))) { >> >cpu_spinwait(); >> >continue; >> > ___ >> > svn-src-...@freebsd.org mailing list >> > https://lists.freebsd.org/mailman/listinfo/svn-src-all >> > To uns
svn commit: r358827 - head/sys/kern
Author: kib Date: Mon Mar 9 23:40:25 2020 New Revision: 358827 URL: https://svnweb.freebsd.org/changeset/base/358827 Log: pipe: explain why not deallocating inode number is fine. Suggested and reviewed by:markj Sponsored by: The FreeBSD Foundation MFC after:1 week Differential revision:https://reviews.freebsd.org/D24009 Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c == --- head/sys/kern/sys_pipe.cMon Mar 9 23:08:24 2020(r358826) +++ head/sys/kern/sys_pipe.cMon Mar 9 23:40:25 2020(r358827) @@ -367,6 +367,15 @@ pipe_paircreate(struct thread *td, struct pipepair **p goto fail; error = pipe_create(wpipe, false); if (error != 0) { + /* +* This cleanup leaves the pipe inode number for rpipe +* still allocated, but never used. We do not free +* inode numbers for opened pipes, which is required +* for correctness because numbers must be unique. +* But also it avoids any memory use by the unr +* allocator, so stashing away the transient inode +* number is reasonable. +*/ pipe_free_kmem(rpipe); goto fail; } ___ 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-unsubscr...@freebsd.org"
svn commit: r358828 - head/sys/powerpc/booke
Author: jhibbits Date: Tue Mar 10 03:30:11 2020 New Revision: 358828 URL: https://svnweb.freebsd.org/changeset/base/358828 Log: powerpc/booke: Split out 32- and 64- bit pmap details from main body Summary: This is largely a straight-forward cleave of the 32-bit and 64-bit page table specifics, along with the mmu_booke_*() functions that are wholely different between the two implementations. The ultimate goal of this is to make it easier to reason about and update a specific implementation without wading through the other implementation details. This is in support of further changes to the 64-bit pmap. Reviewed by: bdragon Differential Revision: https://reviews.freebsd.org/D23983 Added: head/sys/powerpc/booke/pmap_32.c (contents, props changed) head/sys/powerpc/booke/pmap_64.c (contents, props changed) Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c == --- head/sys/powerpc/booke/pmap.c Mon Mar 9 23:40:25 2020 (r358827) +++ head/sys/powerpc/booke/pmap.c Tue Mar 10 03:30:11 2020 (r358828) @@ -221,25 +221,7 @@ uint32_t tlb1_entries; #define TLB1_ENTRIES (tlb1_entries) -/* - * Base of the pmap_mapdev() region. On 32-bit it immediately follows the - * userspace address range. On On 64-bit it's far above, at (1 << 63), and - * ranges up to the DMAP, giving 62 bits of PA allowed. This is far larger than - * the widest Book-E address bus, the e6500 has a 40-bit PA space. This allows - * us to map akin to the DMAP, with addresses identical to the PA, offset by the - * base. - */ -#ifdef __powerpc64__ -#defineVM_MAPDEV_BASE 0x8000 -#defineVM_MAPDEV_PA_MAX0x4000 /* Don't encroach on DMAP */ -#else -#defineVM_MAPDEV_BASE ((vm_offset_t)VM_MAXUSER_ADDRESS + PAGE_SIZE) -#endif - -static vm_offset_t tlb1_map_base = VM_MAPDEV_BASE; - static tlbtid_t tid_alloc(struct pmap *); -static void tid_flush(tlbtid_t tid); #ifdef DDB #ifdef __powerpc64__ @@ -254,6 +236,8 @@ static void tlb1_write_entry(tlb_entry_t *, unsigned i static int tlb1_iomapped(int, vm_paddr_t, vm_size_t, vm_offset_t *); static vm_size_t tlb1_mapin_region(vm_offset_t, vm_paddr_t, vm_size_t, int); +static __inline uint32_t tlb_calc_wimg(vm_paddr_t pa, vm_memattr_t ma); + static vm_size_t tsize2size(unsigned int); static unsigned int size2tsize(vm_size_t); static unsigned long ilog2(unsigned long); @@ -279,26 +263,6 @@ static int pv_entry_count = 0, pv_entry_max = 0, pv_en #define PMAP_SHPGPERPROC 200 #endif -#ifdef __powerpc64__ -#define PMAP_ROOT_SIZE (sizeof(pte_t***) * PP2D_NENTRIES) -static pte_t *ptbl_alloc(mmu_t, pmap_t, pte_t **, -unsigned int, boolean_t); -static void ptbl_free(mmu_t, pmap_t, pte_t **, unsigned int, vm_page_t); -static void ptbl_hold(mmu_t, pmap_t, pte_t **, unsigned int); -static int ptbl_unhold(mmu_t, pmap_t, vm_offset_t); -#else -#define PMAP_ROOT_SIZE (sizeof(pte_t**) * PDIR_NENTRIES) -static void ptbl_init(void); -static struct ptbl_buf *ptbl_buf_alloc(void); -static void ptbl_buf_free(struct ptbl_buf *); -static void ptbl_free_pmap_ptbl(pmap_t, pte_t *); - -static pte_t *ptbl_alloc(mmu_t, pmap_t, unsigned int, boolean_t); -static void ptbl_free(mmu_t, pmap_t, unsigned int); -static void ptbl_hold(mmu_t, pmap_t, unsigned int); -static int ptbl_unhold(mmu_t, pmap_t, unsigned int); -#endif - static vm_paddr_t pte_vatopa(mmu_t, pmap_t, vm_offset_t); static int pte_enter(mmu_t, pmap_t, vm_page_t, vm_offset_t, uint32_t, boolean_t); static int pte_remove(mmu_t, pmap_t, vm_offset_t, uint8_t); @@ -312,26 +276,9 @@ static void pv_remove(pmap_t, vm_offset_t, vm_page_t); static void booke_pmap_init_qpages(void); -struct ptbl_buf { - TAILQ_ENTRY(ptbl_buf) link; /* list link */ - vm_offset_t kva;/* va of mapping */ -}; +static inline void tlb_miss_lock(void); +static inline void tlb_miss_unlock(void); -#ifndef __powerpc64__ -/* Number of kva ptbl buffers, each covering one ptbl (PTBL_PAGES). */ -#define PTBL_BUFS (128 * 16) - -/* ptbl free list and a lock used for access synchronization. */ -static TAILQ_HEAD(, ptbl_buf) ptbl_buf_freelist; -static struct mtx ptbl_buf_freelist_lock; - -/* Base address of kva space allocated fot ptbl bufs. */ -static vm_offset_t ptbl_buf_pool_vabase; - -/* Pointer to ptbl_buf structures. */ -static struct ptbl_buf *ptbl_bufs; -#endif - #ifdef SMP extern tlb_entry_t __boot_tlb1[]; void pmap_bootstrap_ap(volatile uint32_t *); @@ -476,6 +423,14 @@ static mmu_method_t mmu_booke_methods[] = { MMU_DEF(booke_mmu, MMU_TYPE_BOOKE, mmu_booke_methods, 0); +#ifdef __powerpc64__ +#include "pmap_64.c" +#else +#include "pmap_32.c" +#endif + +static vm_offset_t tlb1_map_base = VM_MAPDEV_BASE; + static __inline uint32_t tlb_calc_wimg(vm_paddr_t pa, vm_memattr_t ma)
svn commit: r358829 - head/tests/sys/net
Author: kp Date: Tue Mar 10 06:28:45 2020 New Revision: 358829 URL: https://svnweb.freebsd.org/changeset/base/358829 Log: bridge test: spanning tree Basic test case where we create a bridge loop, verify that we really are looping and then enable spanning tree to resolve the loop. Reviewed by: philip Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D23959 Modified: head/tests/sys/net/if_bridge_test.sh Modified: head/tests/sys/net/if_bridge_test.sh == --- head/tests/sys/net/if_bridge_test.shTue Mar 10 03:30:11 2020 (r358828) +++ head/tests/sys/net/if_bridge_test.shTue Mar 10 06:28:45 2020 (r358829) @@ -67,7 +67,76 @@ bridge_transmit_ipv4_unicast_cleanup() vnet_cleanup } +atf_test_case "stp" "cleanup" +stp_head() +{ + atf_set descr 'Spanning tree test' + atf_set require.user root + atf_set require.progs jq +} + +stp_body() +{ + vnet_init + + epair_one=$(vnet_mkepair) + epair_two=$(vnet_mkepair) + bridge_a=$(vnet_mkbridge) + bridge_b=$(vnet_mkbridge) + + vnet_mkjail a ${bridge_a} ${epair_one}a ${epair_two}a + vnet_mkjail b ${bridge_b} ${epair_one}b ${epair_two}b + + jexec a ifconfig ${bridge_a} up + jexec a ifconfig ${epair_one}a up + jexec a ifconfig ${epair_two}a up + jexec a ifconfig ${bridge_a} addm ${epair_one}a + jexec a ifconfig ${bridge_a} addm ${epair_two}a + + jexec b ifconfig ${bridge_b} up + jexec b ifconfig ${epair_one}b up + jexec b ifconfig ${epair_two}b up + jexec b ifconfig ${bridge_b} addm ${epair_one}b + jexec b ifconfig ${bridge_b} addm ${epair_two}b + + jexec a ifconfig ${bridge_a} 192.0.2.1/24 + + # Give the interfaces some time to come up and pass some traffic + sleep 5 + + # Confirm that there's looping traffic + nbr=$(jexec a netstat -I ${bridge_a} --libxo json \ + | jq ".statistics.interface[0].\"received-packets\"") + if [ ${nbr} -lt 100 ] + then + atf_fail "Expected bridging loop, but found very few packets." + fi + + # Enable spanning tree + jexec a ifconfig ${bridge_a} stp ${epair_one}a + jexec a ifconfig ${bridge_a} stp ${epair_two}a + jexec b ifconfig ${bridge_b} stp ${epair_one}b + jexec b ifconfig ${bridge_b} stp ${epair_two}b + + # Give STP time to do its thing + sleep 5 + + a_discard=$(jexec a ifconfig ${bridge_a} | grep discarding) + b_discard=$(jexec b ifconfig ${bridge_b} | grep discarding) + + if [ -z "${a_discard}" ] && [ -z "${b_discard}" ] + then + atf_fail "STP failed to detect bridging loop" + fi +} + +stp_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "bridge_transmit_ipv4_unicast" + atf_add_test_case "stp" } ___ 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-unsubscr...@freebsd.org"
svn commit: r358830 - head/tests/sys/net
Author: kp Date: Tue Mar 10 06:29:59 2020 New Revision: 358830 URL: https://svnweb.freebsd.org/changeset/base/358830 Log: bridge test: adding and removing static addresses Reviewed by: philip Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D23960 Modified: head/tests/sys/net/if_bridge_test.sh Modified: head/tests/sys/net/if_bridge_test.sh == --- head/tests/sys/net/if_bridge_test.shTue Mar 10 06:28:45 2020 (r358829) +++ head/tests/sys/net/if_bridge_test.shTue Mar 10 06:29:59 2020 (r358830) @@ -135,8 +135,65 @@ stp_cleanup() vnet_cleanup } +atf_test_case "static" "cleanup" +static_head() +{ + atf_set descr 'Bridge static address test' + atf_set require.user root +} + +static_body() +{ + vnet_init + + epair=$(vnet_mkepair) + bridge=$(vnet_mkbridge) + + vnet_mkjail one ${bridge} ${epair}a + + ifconfig ${epair}b up + + jexec one ifconfig ${bridge} up + jexec one ifconfig ${epair}a up + jexec one ifconfig ${bridge} addm ${epair}a + + # Wrong interface + atf_check -s exit:1 -o ignore -e ignore \ + jexec one ifconfig ${bridge} static ${epair}b 00:01:02:03:04:05 + + # Bad address format + atf_check -s exit:1 -o ignore -e ignore \ + jexec one ifconfig ${bridge} static ${epair}a 00:01:02:03:04 + + # Correct add + atf_check -s exit:0 -o ignore \ + jexec one ifconfig ${bridge} static ${epair}a 00:01:02:03:04:05 + + # List addresses + atf_check -s exit:0 -o ignore \ + jexec one ifconfig ${bridge} addr + + # Delete with bad address format + atf_check -s exit:1 -o ignore -e ignore \ + jexec one ifconfig ${bridge} deladdr 00:01:02:03:04 + + # Delete with unlisted address + atf_check -s exit:1 -o ignore -e ignore \ + jexec one ifconfig ${bridge} deladdr 00:01:02:03:04:06 + + # Correct delete + atf_check -s exit:0 -o ignore \ + jexec one ifconfig ${bridge} deladdr 00:01:02:03:04:05 +} + +static_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "bridge_transmit_ipv4_unicast" atf_add_test_case "stp" + atf_add_test_case "static" } ___ 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-unsubscr...@freebsd.org"