svn commit: r363659 - head/share/misc
Author: rew Date: Wed Jul 29 05:27:19 2020 New Revision: 363659 URL: https://svnweb.freebsd.org/changeset/base/363659 Log: Add myself (rew) as src committer. Reviewed by:kevans (mentor), allanjude (mentor) Approved by:kevans (mentor), allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D25837 Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot == --- head/share/misc/committers-src.dot Wed Jul 29 04:36:45 2020 (r363658) +++ head/share/misc/committers-src.dot Wed Jul 29 05:27:19 2020 (r363659) @@ -300,6 +300,7 @@ ram [label="Ram Kishore Vegesna\n...@freebsd.org\n2018 ray [label="Aleksandr Rybalko\n...@freebsd.org\n2011/05/25"] rdivacky [label="Roman Divacky\nrdiva...@freebsd.org\n2008/03/13"] remko [label="Remko Lodder\nre...@freebsd.org\n2007/02/23"] +rew [label="Robert Wing\n...@freebsd.org\n2020/07/23"] rgrimes [label="Rodney W. Grimes\nrgri...@freebsd.org\n1993/06/12\n2017/03/03"] rik [label="Roman Kurakin\n...@freebsd.org\n2003/12/18"] rlibby [label="Ryan Libby\nrli...@freebsd.org\n2017/06/07"] @@ -404,6 +405,7 @@ adrian -> sgalabov ae -> melifaro +allanjude -> rew allanjude -> tsoome alc -> davide @@ -672,6 +674,8 @@ ken -> chuck ken -> ram ken -> slm ken -> will + +kevans -> rew kib -> ae kib -> badger ___ 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: r363657 - head/crypto/openssh
Author: emaste Date: Wed Jul 29 00:34:24 2020 New Revision: 363657 URL: https://svnweb.freebsd.org/changeset/base/363657 Log: sshd: allow UseBlocklist alias for UseBlacklist blacklistd has been renamed to blocklistd upstream, and a future import into FreeBSD will follow that change. Support the new name as an alias in config files. Reviewed by: bz, delphij MFC after:1 week Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D25865 Modified: head/crypto/openssh/servconf.c head/crypto/openssh/sshd_config.5 Modified: head/crypto/openssh/servconf.c == --- head/crypto/openssh/servconf.c Tue Jul 28 22:32:50 2020 (r363656) +++ head/crypto/openssh/servconf.c Wed Jul 29 00:34:24 2020 (r363657) @@ -660,6 +660,7 @@ static struct { { "rdomain", sRDomain, SSHCFG_ALL }, { "casignaturealgorithms", sCASignatureAlgorithms, SSHCFG_ALL }, { "useblacklist", sUseBlacklist, SSHCFG_GLOBAL }, + { "useblocklist", sUseBlacklist, SSHCFG_GLOBAL }, /* alias */ { "noneenabled", sUnsupported, SSHCFG_ALL }, { "hpndisabled", sDeprecated, SSHCFG_ALL }, { "hpnbuffersize", sDeprecated, SSHCFG_ALL }, Modified: head/crypto/openssh/sshd_config.5 == --- head/crypto/openssh/sshd_config.5 Tue Jul 28 22:32:50 2020 (r363656) +++ head/crypto/openssh/sshd_config.5 Wed Jul 29 00:34:24 2020 (r363657) @@ -35,7 +35,7 @@ .\" .\" $OpenBSD: sshd_config.5,v 1.282 2018/09/20 03:28:06 djm Exp $ .\" $FreeBSD$ -.Dd $Mdocdate: September 20 2018 $ +.Dd $Mdocdate: July 28 2020 $ .Dt SSHD_CONFIG 5 .Os .Sh NAME @@ -1602,6 +1602,11 @@ to the daemon. The default is .Cm no . +For forward compatibility with an upcoming +.Xr blacklistd +rename, the +.Cm UseBlocklist +alias can be used instead. .It Cm UseDNS Specifies whether .Xr sshd 8 ___ 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: r363656 - head/usr.sbin/ctld
Author: mav Date: Tue Jul 28 22:32:50 2020 New Revision: 363656 URL: https://svnweb.freebsd.org/changeset/base/363656 Log: When modifying LUN pass "special" options too. Before switching to nvlists CTL merged previous and new options, so any options not passed just kept previous value. Now CTL completely replaces them, so we must pass everything still relevant. MFC after:1 week Sponsored by: iXsystems, Inc. Modified: head/usr.sbin/ctld/kernel.c Modified: head/usr.sbin/ctld/kernel.c == --- head/usr.sbin/ctld/kernel.c Tue Jul 28 20:06:16 2020(r363655) +++ head/usr.sbin/ctld/kernel.c Tue Jul 28 22:32:50 2020(r363656) @@ -777,6 +777,30 @@ kernel_lun_modify(struct lun *lun) req.reqdata.modify.lun_id = lun->l_ctl_lun; req.reqdata.modify.lun_size_bytes = lun->l_size; + if (lun->l_path != NULL) { + o = option_find(>l_options, "file"); + if (o != NULL) { + option_set(o, lun->l_path); + } else { + o = option_new(>l_options, "file", lun->l_path); + assert(o != NULL); + } + } + + o = option_find(>l_options, "ctld_name"); + if (o != NULL) { + option_set(o, lun->l_name); + } else { + o = option_new(>l_options, "ctld_name", lun->l_name); + assert(o != NULL); + } + + o = option_find(>l_options, "scsiname"); + if (o == NULL && lun->l_scsiname != NULL) { + o = option_new(>l_options, "scsiname", lun->l_scsiname); + assert(o != NULL); + } + if (!TAILQ_EMPTY(>l_options)) { req.args_nvl = nvlist_create(0); if (req.args_nvl == 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: r363655 - in head/contrib/openbsm: . bin/auditd bin/auditdistd libauditd libbsm man sys/bsm
On Tue, Jul 28, 2020 at 08:06:16PM +, Christian S.J. Peron wrote: > Author: csjp > Date: Tue Jul 28 20:06:16 2020 > New Revision: 363655 > URL: https://svnweb.freebsd.org/changeset/base/363655 > > Log: > Fixup some incorrect information and some comments. These changes > were cherry picked up the upstream OpenBSD repository. At some point we ^ This should be OpenBSM :) ___ 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: r363655 - in head/contrib/openbsm: . bin/auditd bin/auditdistd libauditd libbsm man sys/bsm
Author: csjp Date: Tue Jul 28 20:06:16 2020 New Revision: 363655 URL: https://svnweb.freebsd.org/changeset/base/363655 Log: Fixup some incorrect information and some comments. These changes were cherry picked up the upstream OpenBSD repository. At some point we will look at doing another import, but the diffs are substantial and will require some careful testing. Differential Revision:https://reviews.freebsd.org/D25021 MFC after:2 weeks Submitted by: gbe Reviewed by: myself, bcr Modified: head/contrib/openbsm/CREDITS head/contrib/openbsm/bin/auditd/auditd.c head/contrib/openbsm/bin/auditdistd/auditdistd.c head/contrib/openbsm/bin/auditdistd/proto_tls.c head/contrib/openbsm/libauditd/auditd_lib.c head/contrib/openbsm/libbsm/au_control.3 head/contrib/openbsm/libbsm/au_domain.3 head/contrib/openbsm/libbsm/au_errno.3 head/contrib/openbsm/libbsm/au_socket_type.3 head/contrib/openbsm/man/audit.log.5 head/contrib/openbsm/man/getaudit.2 head/contrib/openbsm/sys/bsm/audit.h Modified: head/contrib/openbsm/CREDITS == --- head/contrib/openbsm/CREDITSTue Jul 28 19:50:39 2020 (r363654) +++ head/contrib/openbsm/CREDITSTue Jul 28 20:06:16 2020 (r363655) @@ -36,6 +36,9 @@ the development of OpenBSM: Ryan Steinmetz The FreeBSD Foundation Brooks Davis +Mateusz Piotrowski +Alan Somers +Aniket Pandey In addition, Coverity, Inc.'s Prevent(tm) static analysis tool and Gimpel Software's FlexeLint tool were used to identify a number of bugs in the Modified: head/contrib/openbsm/bin/auditd/auditd.c == --- head/contrib/openbsm/bin/auditd/auditd.cTue Jul 28 19:50:39 2020 (r363654) +++ head/contrib/openbsm/bin/auditd/auditd.cTue Jul 28 20:06:16 2020 (r363655) @@ -712,7 +712,7 @@ auditd_config_controls(void) */ err = auditd_set_qsize(); if (err) { - auditd_log_err("audit_set_qsize() %s: %m", + auditd_log_err("auditd_set_qsize() %s: %m", auditd_strerror(err)); ret = -1; } else Modified: head/contrib/openbsm/bin/auditdistd/auditdistd.c == --- head/contrib/openbsm/bin/auditdistd/auditdistd.cTue Jul 28 19:50:39 2020(r363654) +++ head/contrib/openbsm/bin/auditdistd/auditdistd.cTue Jul 28 20:06:16 2020(r363655) @@ -523,7 +523,7 @@ main_loop(void) } TAILQ_FOREACH(adhost, >adc_hosts, adh_next) { if (adhost->adh_role == ADIST_ROLE_SENDER) { - /* Only sender workers asks for connections. */ + /* Only sender workers ask for connections. */ PJDLOG_ASSERT(adhost->adh_conn != NULL); fd = proto_descriptor(adhost->adh_conn); PJDLOG_ASSERT(fd >= 0); Modified: head/contrib/openbsm/bin/auditdistd/proto_tls.c == --- head/contrib/openbsm/bin/auditdistd/proto_tls.c Tue Jul 28 19:50:39 2020(r363654) +++ head/contrib/openbsm/bin/auditdistd/proto_tls.c Tue Jul 28 20:06:16 2020(r363655) @@ -413,7 +413,7 @@ tls_exec_client(const char *user, int startfd, const c tls_certificate_verify(ssl, fingerprint); /* -* The following byte is send to make proto_connect_wait() to work. +* The following byte is sent to make proto_connect_wait() work. */ connected = 1; for (;;) { @@ -460,7 +460,7 @@ tls_call_exec_client(struct proto_conn *sock, const ch proto_close(sock); } else { /* -* The FD_CLOEXEC is cleared by dup2(2), so when we not +* The FD_CLOEXEC is cleared by dup2(2), so when we do not * call it, we have to clear it by hand in case it is set. */ if (fcntl(startfd, F_SETFD, 0) == -1) Modified: head/contrib/openbsm/libauditd/auditd_lib.c == --- head/contrib/openbsm/libauditd/auditd_lib.c Tue Jul 28 19:50:39 2020 (r363654) +++ head/contrib/openbsm/libauditd/auditd_lib.c Tue Jul 28 20:06:16 2020 (r363655) @@ -498,7 +498,7 @@ auditd_expire_trails(int (*warn_expired)(char *)) * update the mtime of the trail file to the current * time. This is so we don't prematurely remove a trail * file that was created while the system clock reset -* to the * "beginning of time" but later the system +
svn commit: r363654 - head/sys/vm
Author: markj Date: Tue Jul 28 19:50:39 2020 New Revision: 363654 URL: https://svnweb.freebsd.org/changeset/base/363654 Log: vm_page_xbusy_claim(): Use atomics to update busy lock state. vm_page_xbusy_claim() could clobber the waiter bit. For its original use, kernel memory pages, this was not a problem since nothing would ever block on the busy lock for such pages. r363607 introduced a new use where this could in principle be a problem. Fix the problem by using atomic_cmpset to update the lock owner. Since this macro is defined only for INVARIANTS kernels the extra overhead doesn't seem prohibitive. Reported by: vangyzen Reviewed by: alc, kib, vangyzen Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D25859 Modified: head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.h == --- head/sys/vm/vm_page.h Tue Jul 28 19:35:24 2020(r363653) +++ head/sys/vm/vm_page.h Tue Jul 28 19:50:39 2020(r363654) @@ -772,8 +772,13 @@ void vm_page_assert_pga_writeable(vm_page_t m, uint16_ #defineVM_PAGE_ASSERT_PGA_WRITEABLE(m, bits) \ vm_page_assert_pga_writeable(m, bits) #definevm_page_xbusy_claim(m) do { \ + u_int _busy_lock; \ + \ vm_page_assert_xbusied_unchecked((m)); \ - (m)->busy_lock = VPB_CURTHREAD_EXCLUSIVE; \ + do {\ + _busy_lock = atomic_load_int(&(m)->busy_lock); \ + } while (!atomic_cmpset_int(&(m)->busy_lock, _busy_lock,\ + (_busy_lock & VPB_BIT_FLAGMASK) | VPB_CURTHREAD_EXCLUSIVE)); \ } while (0) #else #defineVM_PAGE_OBJECT_BUSY_ASSERT(m) (void)0 ___ 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: r363598 - head/usr.sbin/nologin
> Hi, > > On 7/27/20 7:17 PM, Rodney W. Grimes wrote: > > On 7/27/20 6:41 PM, Rodney W. Grimes wrote: > Author: 0mp (doc,ports committer) > Date: Mon Jul 27 10:45:47 2020 > New Revision: 363598 > URL: https://svnweb.freebsd.org/changeset/base/363598 > > Log: > nologin.8: Improve wording > >>> I disagree that this improves wording. The norm of action for > >>> "logging" in Unix is to "write to syslog", not "log to syslog". > >> Hmm, I agree, but here it is "log using syslog". > > Please read syslog(3) it is rather consistent about using > > "write to syslog". The action of calling syslog(3) is to > > "writes message to the system message logger." > > Obviously, we write to syslog but from what I remember the reason why we > decided to change the > wording to "log using syscall" was that you don't write to the syslog(3) > function, but you use it > instead. > > > > >> Have you got any idea how to further improve this sentence? > > No, but can we not degrade it? > > Sure. Would you like me to just revert it? Without beter wording that would be easy to do. -- Rod Grimes rgri...@freebsd.org ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r363482 - in head/sys: kern sys
On Fri, Jul 24, 2020 at 05:34:05PM +, Conrad Meyer wrote: > Author: cem > Date: Fri Jul 24 17:34:04 2020 > New Revision: 363482 > URL: https://svnweb.freebsd.org/changeset/base/363482 > > Log: > Add unlocked/SMR fast path to getblk() > > Convert the bufobj tries to an SMR zone/PCTRIE and add a gbincore_unlocked() > API wrapping this functionality. Use it for a fast path in getblkx(), > falling back to locked lookup if we raced a thread changing the buf's > identity. > > Reported by:Attilio > Reviewed by:kib, markj > Testing:pho (in progress) > Sponsored by: Isilon > Differential Revision: https://reviews.freebsd.org/D25782 > > Modified: > head/sys/kern/vfs_bio.c > head/sys/kern/vfs_subr.c > head/sys/sys/buf.h > > Modified: head/sys/kern/vfs_bio.c > == > --- head/sys/kern/vfs_bio.c Fri Jul 24 17:32:10 2020(r363481) > +++ head/sys/kern/vfs_bio.c Fri Jul 24 17:34:04 2020(r363482) > @@ -3849,7 +3849,7 @@ getblkx(struct vnode *vp, daddr_t blkno, daddr_t dblkn > struct buf *bp; > struct bufobj *bo; > daddr_t d_blkno; > - int bsize, error, maxsize, vmio; > + int bsize, error, maxsize, vmio, lockflags; > off_t offset; > > CTR3(KTR_BUF, "getblk(%p, %ld, %d)", vp, (long)blkno, size); > @@ -3864,11 +3864,33 @@ getblkx(struct vnode *vp, daddr_t blkno, daddr_t dblkn > > bo = >v_bufobj; > d_blkno = dblkno; > + > + /* Attempt lockless lookup first. */ > + bp = gbincore_unlocked(bo, blkno); > + if (bp == NULL) > + goto newbuf_unlocked; > + > + lockflags = LK_EXCLUSIVE | LK_SLEEPFAIL | > + ((flags & GB_LOCK_NOWAIT) ? LK_NOWAIT : 0); > + > + error = BUF_TIMELOCK(bp, lockflags, NULL, "getblku", slpflag, > + slptimeo); I realized that this is not safe. There is an ordering between buffer types that defines which order buffer locks should obey. For instance, on UFS the critical order is inode buffer -> snaplk -> cg buffer, or data block -> indirect data block. Since buffer identity can change under us, we might end up waiting for a lock of type that is incompatible with the currently owned lock. I think the easiest fix is to use LK_NOWAIT always, after all it is lockless path. ERESTART/EINTR checks below than can be removed. > + if (error == EINTR || error == ERESTART) > + return (error); > + else if (error != 0) > + goto loop; > + > + /* Verify buf identify has not changed since lookup. */ > + if (bp->b_bufobj == bo && bp->b_lblkno == blkno) > + goto foundbuf_fastpath; > + > + /* It changed, fallback to locked lookup. */ > + BUF_UNLOCK_RAW(bp); > + > loop: > BO_RLOCK(bo); > bp = gbincore(bo, blkno); > if (bp != NULL) { > - int lockflags; > /* >* Buffer is in-core. If the buffer is not busy nor managed, >* it must be on a queue. > @@ -3890,8 +3912,10 @@ loop: > /* We timed out or were interrupted. */ > else if (error != 0) > return (error); > + > +foundbuf_fastpath: > /* If recursed, assume caller knows the rules. */ > - else if (BUF_LOCKRECURSED(bp)) > + if (BUF_LOCKRECURSED(bp)) > goto end; > > /* > @@ -3989,6 +4013,7 @@ loop: >* buffer is also considered valid (not marked B_INVAL). >*/ > BO_RUNLOCK(bo); > +newbuf_unlocked: > /* >* If the user does not want us to create the buffer, bail out >* here. > > Modified: head/sys/kern/vfs_subr.c > == > --- head/sys/kern/vfs_subr.c Fri Jul 24 17:32:10 2020(r363481) > +++ head/sys/kern/vfs_subr.c Fri Jul 24 17:34:04 2020(r363482) > @@ -234,6 +234,7 @@ static struct mtx __exclusive_cache_line vnode_list_mt > struct nfs_public nfs_pub; > > static uma_zone_t buf_trie_zone; > +static smr_t buf_trie_smr; > > /* Zone for allocation of new vnodes - used exclusively by getnewvnode() */ > static uma_zone_t vnode_zone; > @@ -491,17 +492,16 @@ static int vnsz2log; > static void * > buf_trie_alloc(struct pctrie *ptree) > { > - > - return uma_zalloc(buf_trie_zone, M_NOWAIT); > + return (uma_zalloc_smr(buf_trie_zone, M_NOWAIT)); > } > > static void > buf_trie_free(struct pctrie *ptree, void *node) > { > - > - uma_zfree(buf_trie_zone, node); > + uma_zfree_smr(buf_trie_zone, node); > } > -PCTRIE_DEFINE(BUF, buf, b_lblkno, buf_trie_alloc, buf_trie_free); > +PCTRIE_DEFINE_SMR(BUF, buf, b_lblkno, buf_trie_alloc, buf_trie_free, > +buf_trie_smr); > > /* > * Initialize the vnode management data structures. > @@ -675,7 +675,8 @@ vntblinit(void *dummy
svn commit: r363652 - head/share/man/man3
Author: jhb Date: Tue Jul 28 17:09:15 2020 New Revision: 363652 URL: https://svnweb.freebsd.org/changeset/base/363652 Log: Add further clarification on si_addr and si_trapno. - In the initial description of si_addr, do not claim that it is always the faulting instruction. - For si_addr, document that it is generally set to the PC for synchronous signals, but that it can be set to the the address of the faulting memory reference for some signals including SIGSEGV and SIGBUS. In particular, while SIGSEGV generally sets si_addr to the faulting memory reference, SIGBUS can vary. On some platforms, some SIGBUS signals set si_addr to the PC and other SIGBUS signals set si_addr to the faulting address depending on the specific hardware exception. - For si_trapno, synchronous signals should set this to some value. Reviewed by: kib Sponsored by: DARPA Differential Revision:https://reviews.freebsd.org/D25777 Modified: head/share/man/man3/siginfo.3 Modified: head/share/man/man3/siginfo.3 == --- head/share/man/man3/siginfo.3 Tue Jul 28 16:10:51 2020 (r363651) +++ head/share/man/man3/siginfo.3 Tue Jul 28 17:09:15 2020 (r363652) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 8, 2020 +.Dd July 28, 2020 .Dt SIGINFO 3 .Os .Sh NAME @@ -68,7 +68,7 @@ sending process ID .It Vt uid_t Ta Va si_uid Ta sending process's real user ID .It Vt void Ta Va *si_addr Ta -address of faulting instruction +virtual address .It Vt int Ta Va si_status Ta exit value or signal .It Vt long Ta Va si_band Ta @@ -208,25 +208,24 @@ signal sent by .Xr pthread_kill 3 .El .Pp +For synchronous signals, +.Va si_addr +is generally set to the address of the faulting instruction. +However, synchronous signals raised by a faulting memory access such as +.Dv SIGSEGV +and +.Dv SIGBUS +may report the address of the faulting memory access (if available) in +.Va si_addr +instead. +.Pp +Sychronous signals set +.Va si_trapno +to a machine-dependent trap number. +.Pp In addition, the following signal-specific information is available: .Bl -column ".Dv SIGPOLL" ".Dv CLD_CONTINUED" .It Sy Signal Ta Sy Member Ta Sy Value -.It Dv SIGILL Ta Va si_addr Ta -address of faulting instruction -.It Ta Va si_trapno Ta -machine dependent of trap code -.It Dv SIGFPE Ta Va si_addr Ta -address of faulting instruction -.It Ta Va si_trapno Ta -machine dependent of trap code -.It Dv SIGSEGV Ta Va si_addr Ta -address of faulting memory reference -.It Ta Va si_trapno Ta -machine dependent of trap code -.It Dv SIGBUS Ta Va si_addr Ta -address of faulting instruction -.It Ta Va si_trapno Ta -machine dependent of trap code .It Dv SIGCHLD Ta Va si_pid Ta child process ID .It Ta Va si_status Ta ___ 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: r363650 - in head/sys: dev/iommu dev/ntb/ntb_hw x86/include x86/iommu x86/x86
Author: br Date: Tue Jul 28 16:08:14 2020 New Revision: 363650 URL: https://svnweb.freebsd.org/changeset/base/363650 Log: o Move the buswide_ctxs bitmap to iommu_unit and rename related functions. o Rename bus_dma_dmar_load_ident() as well. Reviewed by: kib Sponsored by: DARPA/AFRL Differential Revision:https://reviews.freebsd.org/D25852 Modified: head/sys/dev/iommu/busdma_iommu.c head/sys/dev/iommu/iommu.h head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c head/sys/x86/include/bus_dma.h head/sys/x86/iommu/intel_ctx.c head/sys/x86/iommu/intel_dmar.h head/sys/x86/iommu/intel_drv.c head/sys/x86/x86/busdma_machdep.c Modified: head/sys/dev/iommu/busdma_iommu.c == --- head/sys/dev/iommu/busdma_iommu.c Tue Jul 28 15:26:19 2020 (r363649) +++ head/sys/dev/iommu/busdma_iommu.c Tue Jul 28 16:08:14 2020 (r363650) @@ -299,7 +299,7 @@ acpi_iommu_get_dma_tag(device_t dev, device_t child) } bool -bus_dma_dmar_set_buswide(device_t dev) +bus_dma_iommu_set_buswide(device_t dev) { struct iommu_unit *unit; device_t parent; @@ -317,12 +317,12 @@ bus_dma_dmar_set_buswide(device_t dev) if (slot != 0 || func != 0) { if (bootverbose) { device_printf(dev, - "dmar%d pci%d:%d:%d requested buswide busdma\n", + "iommu%d pci%d:%d:%d requested buswide busdma\n", unit->unit, busno, slot, func); } return (false); } - dmar_set_buswide_ctx(unit, busno); + iommu_set_buswide_ctx(unit, busno); return (true); } @@ -987,7 +987,7 @@ iommu_fini_busdma(struct iommu_unit *unit) } int -bus_dma_dmar_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map1, +bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map1, vm_paddr_t start, vm_size_t length, int flags) { struct bus_dma_tag_common *tc; Modified: head/sys/dev/iommu/iommu.h == --- head/sys/dev/iommu/iommu.h Tue Jul 28 15:26:19 2020(r363649) +++ head/sys/dev/iommu/iommu.h Tue Jul 28 16:08:14 2020(r363650) @@ -34,12 +34,14 @@ #ifndef _SYS_IOMMU_H_ #define _SYS_IOMMU_H_ +#include #include #include #include #include -#include +#include + /* Host or physical memory address, after translation. */ typedef uint64_t iommu_haddr_t; /* Guest or bus address, before translation. */ @@ -96,6 +98,14 @@ struct iommu_unit { struct task dmamap_load_task; TAILQ_HEAD(, bus_dmamap_iommu) delayed_maps; struct taskqueue *delayed_taskqueue; + + /* +* Bitmap of buses for which context must ignore slot:func, +* duplicating the page table pointer into all context table +* entries. This is a client-controlled quirk to support some +* NTBs. +*/ + uint32_t buswide_ctxs[(PCI_BUSMAX + 1) / NBBY / sizeof(uint32_t)]; }; /* Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c == --- head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Tue Jul 28 15:26:19 2020 (r363649) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Tue Jul 28 16:08:14 2020 (r363650) @@ -811,7 +811,7 @@ intel_ntb_map_pci_bars(struct ntb_softc *ntb) device_printf(ntb->device, "Unable to create BAR0 map\n"); return (ENOMEM); } - if (bus_dma_dmar_load_ident(ntb->bar0_dma_tag, ntb->bar0_dma_map, + if (bus_dma_iommu_load_ident(ntb->bar0_dma_tag, ntb->bar0_dma_map, bar->pbase, bar->size, 0)) { device_printf(ntb->device, "Unable to load BAR0 map\n"); return (ENOMEM); Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c == --- head/sys/dev/ntb/ntb_hw/ntb_hw_plx.cTue Jul 28 15:26:19 2020 (r363649) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.cTue Jul 28 16:08:14 2020 (r363650) @@ -343,7 +343,7 @@ ntb_plx_attach(device_t dev) * The device occupies whole bus. In translated TLP slot field * keeps LUT index (original bus/slot), function is passed through. */ - bus_dma_dmar_set_buswide(dev); + bus_dma_iommu_set_buswide(dev); /* Identify chip port we are connected to. */ val = bus_read_4(sc->conf_res, 0x360); Modified: head/sys/x86/include/bus_dma.h == --- head/sys/x86/include/bus_dma.h Tue Jul 28 15:26:19 2020 (r363649) +++ head/sys/x86/include/bus_dma.h Tue Jul 28 16:08:14 2020 (r363650) @@ -192,8 +192,8 @@ _bus_dmamap_complete(bus_dma_tag_t dmat, bus_dmamap_t } #ifdef
svn commit: r363649 - head/bin/ps
Author: markj Date: Tue Jul 28 15:26:19 2020 New Revision: 363649 URL: https://svnweb.freebsd.org/changeset/base/363649 Log: ps(1): Fix formatting of the "command" field for kernel threads. When -H is specified, for kernel threads the command is formatted as "/" and truncated to MAXCOMLEN. But each of the proc name and td name may be up to MAXCOMLEN bytes in length. Also handle the ki_moretdname field to ensure that the full thread name gets printed. This is already handled correctly when formatting for "-o tdname". Reported by: freqlabs Reviewed by: freqlabs MFC after:1 week Differential Revision:https://reviews.freebsd.org/D25840 Modified: head/bin/ps/ps.c Modified: head/bin/ps/ps.c == --- head/bin/ps/ps.cTue Jul 28 15:16:29 2020(r363648) +++ head/bin/ps/ps.cTue Jul 28 15:26:19 2020(r363649) @@ -1264,6 +1264,7 @@ fmt(char **(*fn)(kvm_t *, const struct kinfo_proc *, i static void saveuser(KINFO *ki) { + char tdname[COMMLEN + 1]; char *argsp; if (ki->ki_p->ki_flag & P_INMEM) { @@ -1280,12 +1281,14 @@ saveuser(KINFO *ki) * save arguments if needed */ if (needcomm) { - if (ki->ki_p->ki_stat == SZOMB) + if (ki->ki_p->ki_stat == SZOMB) { ki->ki_args = strdup(""); - else if (UREADOK(ki) || (ki->ki_p->ki_args != NULL)) + } else if (UREADOK(ki) || (ki->ki_p->ki_args != NULL)) { + (void)snprintf(tdname, sizeof(tdname), "%s%s", + ki->ki_p->ki_tdname, ki->ki_p->ki_moretdname); ki->ki_args = fmt(kvm_getargv, ki, - ki->ki_p->ki_comm, ki->ki_p->ki_tdname, MAXCOMLEN); - else { + ki->ki_p->ki_comm, tdname, COMMLEN * 2 + 1); + } else { asprintf(, "(%s)", ki->ki_p->ki_comm); ki->ki_args = argsp; } ___ 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: r363607 - head/sys/vm
On Tue, Jul 28, 2020 at 08:44:11AM -0500, Eric van Gyzen wrote: > On 7/27/20 9:25 AM, Mark Johnston wrote: > > + > > + /* > > +* We may be attempting to free the page as part of the handling for an > > +* I/O error, in which case the page was xbusied by a different thread. > > +*/ > > + vm_page_xbusy_claim(m); > > I've just noticed that vm_page_xbusy_claim() ignores the WAITERS bit. > Is this not a problem in practice? Thanks, I think you're right. I posted a proposed patch here: https://reviews.freebsd.org/D25859 ___ 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: r363607 - head/sys/vm
On 7/27/20 9:25 AM, Mark Johnston wrote: + + /* +* We may be attempting to free the page as part of the handling for an +* I/O error, in which case the page was xbusied by a different thread. +*/ + vm_page_xbusy_claim(m); I've just noticed that vm_page_xbusy_claim() ignores the WAITERS bit. Is this not a problem in practice? Eric ___ 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: r363647 - head/sys/arm/broadcom/bcm2835
Author: andrew Date: Tue Jul 28 11:32:45 2020 New Revision: 363647 URL: https://svnweb.freebsd.org/changeset/base/363647 Log: Add a workaround for a bug when setting the Raspberry GIO config and state The Raspberry Pi GPIO config and state messages incorrectly return with the tag length set to 0. We then check this value to have the response flag set. Work around this by setting the response flag when setting the GPIO config or state and this value is zero. Sponsored by: Innovate UK Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c == --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.cTue Jul 28 11:23:37 2020(r363646) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.cTue Jul 28 11:32:45 2020(r363647) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -362,6 +363,16 @@ bcm2835_mbox_err(device_t dev, bus_addr_t msg_phys, ui tag = (struct bcm2835_mbox_tag_hdr *)(msg + 1); last = (uint8_t *)msg + len; for (idx = 0; tag->tag != 0; idx++) { + /* +* When setting the GPIO config or state the firmware doesn't +* set tag->val_len correctly. +*/ + if ((tag->tag == BCM2835_FIRMWARE_TAG_SET_GPIO_CONFIG || +tag->tag == BCM2835_FIRMWARE_TAG_SET_GPIO_STATE) && + tag->val_len == 0) { + tag->val_len = BCM2835_MBOX_TAG_VAL_LEN_RESPONSE | + tag->val_buf_size; + } if ((tag->val_len & BCM2835_MBOX_TAG_VAL_LEN_RESPONSE) == 0) { device_printf(dev, "tag %d response error\n", idx); return (EIO); ___ 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: r363646 - head/sys/dev/virtio/pci
Author: alfredo Date: Tue Jul 28 11:23:37 2020 New Revision: 363646 URL: https://svnweb.freebsd.org/changeset/base/363646 Log: virtio: fix mips regression introduced by r357596 PowerPC support was fixed in r357596 by changing PCI bustag to BE as part of the solution, but this caused regression on mips. This change implements byte swapping of virtio PCI config area in the driver, leaving lower layer untouched. Submittnd by: Fernando Valle Reported by: arichardson Reviewed by: alfredo, arichardson Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision:https://reviews.freebsd.org/D25416 Modified: head/sys/dev/virtio/pci/virtio_pci.c Modified: head/sys/dev/virtio/pci/virtio_pci.c == --- head/sys/dev/virtio/pci/virtio_pci.cTue Jul 28 11:13:37 2020 (r363645) +++ head/sys/dev/virtio/pci/virtio_pci.cTue Jul 28 11:23:37 2020 (r363646) @@ -179,23 +179,25 @@ static void vtpci_config_intr(void *); * I/O port read/write wrappers. */ #define vtpci_read_config_1(sc, o) bus_read_1((sc)->vtpci_res, (o)) -#define vtpci_read_config_2(sc, o) bus_read_2((sc)->vtpci_res, (o)) -#define vtpci_read_config_4(sc, o) bus_read_4((sc)->vtpci_res, (o)) #define vtpci_write_config_1(sc, o, v) bus_write_1((sc)->vtpci_res, (o), (v)) -#define vtpci_write_config_2(sc, o, v) bus_write_2((sc)->vtpci_res, (o), (v)) -#define vtpci_write_config_4(sc, o, v) bus_write_4((sc)->vtpci_res, (o), (v)) /* - * Legacy VirtIO header is always PCI endianness (little), so if we - * are in a BE machine we need to swap bytes from LE to BE when reading - * and from BE to LE when writing. - * If we are in a LE machine, there will be no swaps. + * Virtio-pci specifies that PCI Configuration area is guest endian. However, + * since PCI devices are inherently little-endian, on BE systems the bus layer + * transparently converts it to BE. For virtio-legacy, this conversion is + * undesired, so an extra byte swap is required to fix it. */ -#define vtpci_read_header_2(sc, o) le16toh(vtpci_read_config_2(sc, o)) -#define vtpci_read_header_4(sc, o) le32toh(vtpci_read_config_4(sc, o)) -#define vtpci_write_header_2(sc, o, v) vtpci_write_config_2(sc, o, (htole16(v))) -#define vtpci_write_header_4(sc, o, v) vtpci_write_config_4(sc, o, (htole32(v))) +#define vtpci_read_config_2(sc, o) le16toh(bus_read_2((sc)->vtpci_res, (o))) +#define vtpci_read_config_4(sc, o) le32toh(bus_read_4((sc)->vtpci_res, (o))) +#define vtpci_write_config_2(sc, o, v) bus_write_2((sc)->vtpci_res, (o), (htole16(v))) +#define vtpci_write_config_4(sc, o, v) bus_write_4((sc)->vtpci_res, (o), (htole32(v))) +/* PCI Header LE. On BE systems the bus layer takes care of byte swapping */ +#define vtpci_read_header_2(sc, o) (bus_read_2((sc)->vtpci_res, (o))) +#define vtpci_read_header_4(sc, o) (bus_read_4((sc)->vtpci_res, (o))) +#define vtpci_write_header_2(sc, o, v) bus_write_2((sc)->vtpci_res, (o), (v)) +#define vtpci_write_header_4(sc, o, v) bus_write_4((sc)->vtpci_res, (o), (v)) + /* Tunables. */ static int vtpci_disable_msix = 0; TUNABLE_INT("hw.virtio.pci.disable_msix", _disable_msix); @@ -289,17 +291,6 @@ vtpci_attach(device_t dev) device_printf(dev, "cannot map I/O space\n"); return (ENXIO); } - -/* - * For legacy VirtIO, the device-specific configuration is guest - * endian, while the common configuration header is always - * PCI (little) endian and will be handled specifically in - * other parts of this file via functions - * 'vtpci_[read|write]_header_[2|4]' - */ -#if _BYTE_ORDER == _BIG_ENDIAN - rman_set_bustag(sc->vtpci_res, _be_tag); -#endif if (pci_find_cap(dev, PCIY_MSI, NULL) != 0) sc->vtpci_flags |= VTPCI_FLAG_NO_MSI; ___ 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: r363645 - head/sys/arm/broadcom/bcm2835
Author: andrew Date: Tue Jul 28 11:13:37 2020 New Revision: 363645 URL: https://svnweb.freebsd.org/changeset/base/363645 Log: Aadd Raspberry Pi firmware messages to manage GPIOs Some GPIOs are managed by an external IO expaandder through the firmware. Add the message details for these. Sponsored by: Innovate UK Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.h Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.h == --- head/sys/arm/broadcom/bcm2835/bcm2835_firmware.hTue Jul 28 10:58:37 2020(r363644) +++ head/sys/arm/broadcom/bcm2835/bcm2835_firmware.hTue Jul 28 11:13:37 2020(r363645) @@ -142,6 +142,61 @@ union msg_set_turbo_body { } resp; }; +#defineBCM2835_FIRMWARE_TAG_GET_GPIO_STATE 0x00030041 +#defineBCM2835_FIRMWARE_TAG_SET_GPIO_STATE 0x00038041 +#defineBCM2835_FIRMWARE_TAG_GET_GPIO_CONFIG0x00030043 +#defineBCM2835_FIRMWARE_TAG_SET_GPIO_CONFIG0x00038043 + +#defineBCM2835_FIRMWARE_GPIO_IN0 +#defineBCM2835_FIRMWARE_GPIO_OUT 1 + +union msg_get_gpio_state { + struct { + uint32_t gpio; + } req; + struct { + uint32_t gpio; + uint32_t state; + } resp; +}; + +union msg_set_gpio_state { + struct { + uint32_t gpio; + uint32_t state; + } req; + struct { + uint32_t gpio; + } resp; +}; + +union msg_get_gpio_config { + struct { + uint32_t gpio; + } req; + struct { + uint32_t gpio; + uint32_t dir; + uint32_t pol; + uint32_t term_en; + uint32_t term_pull_up; + } resp; +}; + +union msg_set_gpio_config { + struct { + uint32_t gpio; + uint32_t dir; + uint32_t pol; + uint32_t term_en; + uint32_t term_pull_up; + uint32_t state; + } req; + struct { + uint32_t gpio; + } resp; +}; + int bcm2835_firmware_property(device_t, uint32_t, void *, size_t); #endif ___ 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: r363644 - in head: cddl/lib cddl/lib/libdtrace cddl/lib/libzpool etc/mtree release/sparc64 rescue/rescue sbin/init sys/kern sys/modules/esp sys/modules/uart usr.sbin/bsdinstall/partedit...
Author: nyan Date: Tue Jul 28 10:58:37 2020 New Revision: 363644 URL: https://svnweb.freebsd.org/changeset/base/363644 Log: - Cleanups related to sparc64 removal. - Remove remains of sparc64 files. Reviewed by: imp Differential Revision:https://reviews.freebsd.org/D25831 Deleted: head/release/sparc64/ head/sbin/init/ttys.sparc64 head/usr.sbin/bsdinstall/partedit/partedit_sparc64.c head/usr.sbin/kldxref/ef_sparc64.c Modified: head/cddl/lib/Makefile head/cddl/lib/libdtrace/Makefile head/cddl/lib/libzpool/Makefile head/etc/mtree/BSD.usr.dist head/rescue/rescue/Makefile head/sys/kern/kern_dump.c head/sys/modules/esp/Makefile head/sys/modules/uart/Makefile Modified: head/cddl/lib/Makefile == --- head/cddl/lib/Makefile Tue Jul 28 10:45:29 2020(r363643) +++ head/cddl/lib/Makefile Tue Jul 28 10:58:37 2020(r363644) @@ -2,10 +2,10 @@ .include -SUBDIR=${_drti} \ +SUBDIR=drti \ libavl \ libctf \ - ${_libdtrace} \ + libdtrace \ libnvpair \ libumem \ libuutil \ @@ -21,11 +21,6 @@ _libzfs= libzfs .if ${MK_LIBTHR} != "no" _libzpool= libzpool .endif -.endif - -.if ${MACHINE_CPUARCH} != "sparc64" -_drti= drti -_libdtrace=libdtrace .endif SUBDIR_DEPEND_libdtrace= libctf Modified: head/cddl/lib/libdtrace/Makefile == --- head/cddl/lib/libdtrace/MakefileTue Jul 28 10:45:29 2020 (r363643) +++ head/cddl/lib/libdtrace/MakefileTue Jul 28 10:58:37 2020 (r363644) @@ -103,9 +103,6 @@ CFLAGS+=-I${OPENSOLARIS_SYS_DISTDIR}/uts/powerpc CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/riscv .PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/riscv .PATH: ${SRCTOP}/sys/cddl/dev/dtrace/riscv -.elif ${MACHINE_CPUARCH} == "sparc64" -CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc -.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/sparc .else # temporary hack CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel Modified: head/cddl/lib/libzpool/Makefile == --- head/cddl/lib/libzpool/Makefile Tue Jul 28 10:45:29 2020 (r363643) +++ head/cddl/lib/libzpool/Makefile Tue Jul 28 10:58:37 2020 (r363644) @@ -18,9 +18,7 @@ .if exists(${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}/opensolaris_atomic.S) .PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH} ATOMIC_SRCS= opensolaris_atomic.S -.if ${MACHINE_ARCH} != "sparc64" ACFLAGS+= -Wa,--noexecstack -.endif .else .PATH: ${SRCTOP}/sys/cddl/compat/opensolaris/kern ATOMIC_SRCS= opensolaris_atomic.c Modified: head/etc/mtree/BSD.usr.dist == --- head/etc/mtree/BSD.usr.dist Tue Jul 28 10:45:29 2020(r363643) +++ head/etc/mtree/BSD.usr.dist Tue Jul 28 10:58:37 2020(r363644) @@ -864,8 +864,6 @@ .. powerpc .. -sparc64 -.. .. man5 .. @@ -879,8 +877,6 @@ i386 .. powerpc -.. -sparc64 .. .. man9 Modified: head/rescue/rescue/Makefile == --- head/rescue/rescue/Makefile Tue Jul 28 10:45:29 2020(r363643) +++ head/rescue/rescue/Makefile Tue Jul 28 10:58:37 2020(r363644) @@ -147,10 +147,6 @@ CRUNCH_ALIAS_bsdlabel= disklabel #CRUNCH_LIBS+= -lsmb .endif -.if ${MACHINE_CPUARCH} == "sparc64" -CRUNCH_PROGS_sbin+= bsdlabel sunlabel -.endif - .if ${MACHINE_CPUARCH} == "amd64" CRUNCH_PROGS_sbin+= bsdlabel fdisk CRUNCH_ALIAS_bsdlabel= disklabel Modified: head/sys/kern/kern_dump.c == --- head/sys/kern/kern_dump.c Tue Jul 28 10:45:29 2020(r363643) +++ head/sys/kern/kern_dump.c Tue Jul 28 10:58:37 2020(r363644) @@ -54,7 +54,7 @@ static size_t fragsz; struct dump_pa dump_map[DUMPSYS_MD_PA_NPAIRS]; -#if !defined(__powerpc__) && !defined(__sparc__) +#if !defined(__powerpc__) void dumpsys_gen_pa_init(void) { @@ -97,14 +97,12 @@ dumpsys_gen_unmap_chunk(vm_paddr_t pa __unused, size_t } -#if !defined(__sparc__) int dumpsys_gen_write_aux_headers(struct dumperinfo *di) { return (0); } -#endif int dumpsys_buf_seek(struct dumperinfo *di, size_t sz) @@ -240,7 +238,6 @@ dumpsys_foreach_chunk(dumpsys_callback_t cb, void *arg return (seqnr); } -#if !defined(__sparc__) static off_t fileofs; static int @@ -387,4 +384,3 @@
svn commit: r363643 - head/sys/arm/broadcom/bcm2835
Author: andrew Date: Tue Jul 28 10:45:29 2020 New Revision: 363643 URL: https://svnweb.freebsd.org/changeset/base/363643 Log: Switch the bcm2835 cpufreq driver to use the firmware interface Use the new Raspberry Pi firmware driver in the cpufreq driver. It is intended all drivers that need to interact with the firmware will move to use the firmware driver, this is the first. Reviewed by: manu Sponsored by: Innovate UK Differential Revision:https://reviews.freebsd.org/D25609 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c head/sys/arm/broadcom/bcm2835/bcm2835_firmware.h head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Modified: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c == --- head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Tue Jul 28 10:43:52 2020(r363642) +++ head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Tue Jul 28 10:45:29 2020(r363643) @@ -47,12 +47,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include #include #include "cpufreq_if.h" -#include "mbox_if.h" #ifdef DEBUG #define DPRINTF(fmt, ...) do { \ @@ -101,6 +99,7 @@ static struct sysctl_ctx_list bcm2835_sysctl_ctx; struct bcm2835_cpufreq_softc { device_tdev; + device_tfirmware; int arm_max_freq; int arm_min_freq; int core_max_freq; @@ -161,7 +160,7 @@ static int bcm2835_cpufreq_get_clock_rate(struct bcm2835_cpufreq_softc *sc, uint32_t clock_id) { - struct msg_get_clock_rate msg; + union msg_get_clock_rate_body msg; int rate; int err; @@ -181,16 +180,11 @@ bcm2835_cpufreq_get_clock_rate(struct bcm2835_cpufreq_ /* setup single tag buffer */ memset(, 0, sizeof(msg)); - msg.hdr.buf_size = sizeof(msg); - msg.hdr.code = BCM2835_MBOX_CODE_REQ; - msg.tag_hdr.tag = BCM2835_MBOX_TAG_GET_CLOCK_RATE; - msg.tag_hdr.val_buf_size = sizeof(msg.body); - msg.tag_hdr.val_len = sizeof(msg.body.req); - msg.body.req.clock_id = clock_id; - msg.end_tag = 0; + msg.req.clock_id = clock_id; /* call mailbox property */ - err = bcm2835_mbox_property(, sizeof(msg)); + err = bcm2835_firmware_property(sc->firmware, + BCM2835_FIRMWARE_TAG_GET_CLOCK_RATE, , sizeof(msg)); if (err) { device_printf(sc->dev, "can't get clock rate (id=%u)\n", clock_id); @@ -198,7 +192,7 @@ bcm2835_cpufreq_get_clock_rate(struct bcm2835_cpufreq_ } /* result (Hz) */ - rate = (int)msg.body.resp.rate_hz; + rate = (int)msg.resp.rate_hz; DPRINTF("clock = %d(Hz)\n", rate); return (rate); } @@ -207,7 +201,7 @@ static int bcm2835_cpufreq_get_max_clock_rate(struct bcm2835_cpufreq_softc *sc, uint32_t clock_id) { - struct msg_get_max_clock_rate msg; + union msg_get_clock_rate_body msg; int rate; int err; @@ -227,16 +221,11 @@ bcm2835_cpufreq_get_max_clock_rate(struct bcm2835_cpuf /* setup single tag buffer */ memset(, 0, sizeof(msg)); - msg.hdr.buf_size = sizeof(msg); - msg.hdr.code = BCM2835_MBOX_CODE_REQ; - msg.tag_hdr.tag = BCM2835_MBOX_TAG_GET_MAX_CLOCK_RATE; - msg.tag_hdr.val_buf_size = sizeof(msg.body); - msg.tag_hdr.val_len = sizeof(msg.body.req); - msg.body.req.clock_id = clock_id; - msg.end_tag = 0; + msg.req.clock_id = clock_id; /* call mailbox property */ - err = bcm2835_mbox_property(, sizeof(msg)); + err = bcm2835_firmware_property(sc->firmware, + BCM2835_FIRMWARE_TAG_GET_MAX_CLOCK_RATE, , sizeof(msg)); if (err) { device_printf(sc->dev, "can't get max clock rate (id=%u)\n", clock_id); @@ -244,7 +233,7 @@ bcm2835_cpufreq_get_max_clock_rate(struct bcm2835_cpuf } /* result (Hz) */ - rate = (int)msg.body.resp.rate_hz; + rate = (int)msg.resp.rate_hz; DPRINTF("clock = %d(Hz)\n", rate); return (rate); } @@ -253,7 +242,7 @@ static int bcm2835_cpufreq_get_min_clock_rate(struct bcm2835_cpufreq_softc *sc, uint32_t clock_id) { - struct msg_get_min_clock_rate msg; + union msg_get_clock_rate_body msg; int rate; int err; @@ -273,16 +262,11 @@ bcm2835_cpufreq_get_min_clock_rate(struct bcm2835_cpuf /* setup single tag buffer */ memset(, 0, sizeof(msg)); - msg.hdr.buf_size = sizeof(msg); - msg.hdr.code = BCM2835_MBOX_CODE_REQ; - msg.tag_hdr.tag = BCM2835_MBOX_TAG_GET_MIN_CLOCK_RATE; - msg.tag_hdr.val_buf_size = sizeof(msg.body); - msg.tag_hdr.val_len = sizeof(msg.body.req); - msg.body.req.clock_id = clock_id; - msg.end_tag = 0; + msg.req.clock_id = clock_id; /*
svn commit: r363642 - head/sys/arm/broadcom/bcm2835
Author: andrew Date: Tue Jul 28 10:43:52 2020 New Revision: 363642 URL: https://svnweb.freebsd.org/changeset/base/363642 Log: Move the bcm2835 firmware driver earlier in the boot. It will be needed by other eaarly drivers. While here make the dependency of the mailbox formal with MODULE_DEPEND. Reviewed by: manu Sponsored by: Innovate UK Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c == --- head/sys/arm/broadcom/bcm2835/bcm2835_firmware.cTue Jul 28 10:41:43 2020(r363641) +++ head/sys/arm/broadcom/bcm2835/bcm2835_firmware.cTue Jul 28 10:43:52 2020(r363642) @@ -177,5 +177,6 @@ static driver_t bcm2835_firmware_driver = { sizeof(struct bcm2835_firmware_softc), }; -DRIVER_MODULE(bcm2835_firmware, simplebus, bcm2835_firmware_driver, -bcm2835_firmware_devclass, 0, 0); +EARLY_DRIVER_MODULE(bcm2835_firmware, simplebus, bcm2835_firmware_driver, +bcm2835_firmware_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); +MODULE_DEPEND(bcm2835_firmware, mbox, 1, 1, 1); ___ 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: r363641 - head/sys/arm/broadcom/bcm2835
Author: andrew Date: Tue Jul 28 10:41:43 2020 New Revision: 363641 URL: https://svnweb.freebsd.org/changeset/base/363641 Log: Revert r363639 so I can use a more correct commit message Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c == --- head/sys/arm/broadcom/bcm2835/bcm2835_firmware.cTue Jul 28 10:40:00 2020(r363640) +++ head/sys/arm/broadcom/bcm2835/bcm2835_firmware.cTue Jul 28 10:41:43 2020(r363641) @@ -177,6 +177,5 @@ static driver_t bcm2835_firmware_driver = { sizeof(struct bcm2835_firmware_softc), }; -EARLY_DRIVER_MODULE(bcm2835_firmware, simplebus, bcm2835_firmware_driver, -bcm2835_firmware_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); -MODULE_DEPEND(bcm2835_firmware, mbox, 1, 1, 1); +DRIVER_MODULE(bcm2835_firmware, simplebus, bcm2835_firmware_driver, +bcm2835_firmware_devclass, 0, 0); ___ 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: r363640 - head/sys/arm/broadcom/bcm2835
Author: andrew Date: Tue Jul 28 10:40:00 2020 New Revision: 363640 URL: https://svnweb.freebsd.org/changeset/base/363640 Log: Move the bcm2835 mailbox driver earlier in the boot This will be needed before the firmware driver is loaded Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c == --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.cTue Jul 28 10:37:58 2020(r363639) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.cTue Jul 28 10:40:00 2020(r363640) @@ -293,7 +293,8 @@ static driver_t bcm_mbox_driver = { static devclass_t bcm_mbox_devclass; -DRIVER_MODULE(mbox, simplebus, bcm_mbox_driver, bcm_mbox_devclass, 0, 0); +EARLY_DRIVER_MODULE(mbox, simplebus, bcm_mbox_driver, bcm_mbox_devclass, 0, 0, +BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); static void bcm2835_mbox_dma_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err) ___ 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: r363639 - head/sys/arm/broadcom/bcm2835
Author: andrew Date: Tue Jul 28 10:37:58 2020 New Revision: 363639 URL: https://svnweb.freebsd.org/changeset/base/363639 Log: Have the bcm2835 firmware driver depend on the mailbox driver The firmware driver uses the mailbox driver to communicate with the firmware. Make this a more formal dependency. Reviewed by: manu Sponsored by: Innovate UK Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c == --- head/sys/arm/broadcom/bcm2835/bcm2835_firmware.cTue Jul 28 10:08:07 2020(r363638) +++ head/sys/arm/broadcom/bcm2835/bcm2835_firmware.cTue Jul 28 10:37:58 2020(r363639) @@ -177,5 +177,6 @@ static driver_t bcm2835_firmware_driver = { sizeof(struct bcm2835_firmware_softc), }; -DRIVER_MODULE(bcm2835_firmware, simplebus, bcm2835_firmware_driver, -bcm2835_firmware_devclass, 0, 0); +EARLY_DRIVER_MODULE(bcm2835_firmware, simplebus, bcm2835_firmware_driver, +bcm2835_firmware_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); +MODULE_DEPEND(bcm2835_firmware, mbox, 1, 1, 1); ___ 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: r363638 - head/sys/conf
Author: mw Date: Tue Jul 28 10:08:07 2020 New Revision: 363638 URL: https://svnweb.freebsd.org/changeset/base/363638 Log: Fix ENA build when integrated into kernel Provide missing rules for ena_datapath.c and ena_netmap.c, which prevented the ENA driver from building. This issue was showing up only when building the driver statically into the kernel. PR: 248116 Submitted by: Artur Rojek MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25796 Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/conf/files Modified: head/sys/conf/files == --- head/sys/conf/files Tue Jul 28 09:46:58 2020(r363637) +++ head/sys/conf/files Tue Jul 28 10:08:07 2020(r363638) @@ -1641,6 +1641,10 @@ dev/e1000/e1000_osdep.c optional em \ dev/et/if_et.c optional et dev/ena/ena.c optional ena \ compile-with "${NORMAL_C} -I$S/contrib" +dev/ena/ena_datapath.c optional ena \ + compile-with "${NORMAL_C} -I$S/contrib" +dev/ena/ena_netmap.c optional ena \ + compile-with "${NORMAL_C} -I$S/contrib" dev/ena/ena_sysctl.c optional ena \ compile-with "${NORMAL_C} -I$S/contrib" contrib/ena-com/ena_com.c optional ena ___ 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: r363598 - head/usr.sbin/nologin
Hi, On 7/27/20 7:17 PM, Rodney W. Grimes wrote: On 7/27/20 6:41 PM, Rodney W. Grimes wrote: Author: 0mp (doc,ports committer) Date: Mon Jul 27 10:45:47 2020 New Revision: 363598 URL: https://svnweb.freebsd.org/changeset/base/363598 Log: nologin.8: Improve wording I disagree that this improves wording. The norm of action for "logging" in Unix is to "write to syslog", not "log to syslog". Hmm, I agree, but here it is "log using syslog". Please read syslog(3) it is rather consistent about using "write to syslog". The action of calling syslog(3) is to "writes message to the system message logger." Obviously, we write to syslog but from what I remember the reason why we decided to change the wording to "log using syscall" was that you don't write to the syslog(3) function, but you use it instead. Have you got any idea how to further improve this sentence? No, but can we not degrade it? Sure. Would you like me to just revert it? Cheers, Mateusz ___ 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: r363637 - head/sys/arm/broadcom/bcm2835
Author: andrew Date: Tue Jul 28 09:46:58 2020 New Revision: 363637 URL: https://svnweb.freebsd.org/changeset/base/363637 Log: Enable use of the regulator in the Broadcom SDHCI controller This will be needed before a future GPIO controller driver is added as the later enables regulators that leave the SDHCI controller disabled. Reviewed by: manu Sponsored by: Innovate UK Differential Revision:https://reviews.freebsd.org/D25834 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c == --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue Jul 28 09:29:56 2020(r363636) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue Jul 28 09:46:58 2020(r363637) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include @@ -155,6 +156,7 @@ struct bcm_sdhci_softc { void * sc_intrhand; struct mmc_request *sc_req; struct sdhci_slot sc_slot; + struct mmc_fdt_helper sc_mmc_helper; int sc_dma_ch; bus_dma_tag_t sc_dma_tag; bus_dmamap_tsc_dma_map; @@ -315,6 +317,7 @@ bcm_sdhci_attach(device_t dev) sc->sc_slot.quirks = sc->conf->quirks; sdhci_init_slot(dev, >sc_slot, 0); + mmc_fdt_parse(dev, 0, >sc_mmc_helper, >sc_slot.host); sc->sc_dma_ch = bcm_dma_allocate(BCM_DMA_CH_ANY); if (sc->sc_dma_ch == BCM_DMA_CH_INVALID) @@ -389,6 +392,37 @@ bcm_sdhci_intr(void *arg) } static int +bcm_sdhci_update_ios(device_t bus, device_t child) +{ + struct bcm_sdhci_softc *sc; + struct mmc_ios *ios; + int rv; + + sc = device_get_softc(bus); + ios = >sc_slot.host.ios; + + if (ios->power_mode == power_up) { + if (sc->sc_mmc_helper.vmmc_supply) + regulator_enable(sc->sc_mmc_helper.vmmc_supply); + if (sc->sc_mmc_helper.vqmmc_supply) + regulator_enable(sc->sc_mmc_helper.vqmmc_supply); + } + + rv = sdhci_generic_update_ios(bus, child); + if (rv != 0) + return (rv); + + if (ios->power_mode == power_off) { + if (sc->sc_mmc_helper.vmmc_supply) + regulator_disable(sc->sc_mmc_helper.vmmc_supply); + if (sc->sc_mmc_helper.vqmmc_supply) + regulator_disable(sc->sc_mmc_helper.vqmmc_supply); + } + + return (0); +} + +static int bcm_sdhci_get_ro(device_t bus, device_t child) { @@ -787,7 +821,7 @@ static device_method_t bcm_sdhci_methods[] = { DEVMETHOD(bus_add_child,bus_generic_add_child), /* MMC bridge interface */ - DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios), + DEVMETHOD(mmcbr_update_ios, bcm_sdhci_update_ios), DEVMETHOD(mmcbr_request,sdhci_generic_request), DEVMETHOD(mmcbr_get_ro, bcm_sdhci_get_ro), DEVMETHOD(mmcbr_acquire_host, sdhci_generic_acquire_host), ___ 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: r363636 - in head/sys: conf dev/smc
Author: andrew Date: Tue Jul 28 09:29:56 2020 New Revision: 363636 URL: https://svnweb.freebsd.org/changeset/base/363636 Log: Add an ACPI attachment for if_smc This is needed by some of the Arm simulators as they implement a smc based network interface, but use ACPI rather than FDT. Sponsored by: Innovate UK Added: head/sys/dev/smc/if_smc_acpi.c - copied, changed from r363635, head/sys/dev/smc/if_smc_fdt.c Modified: head/sys/conf/files head/sys/dev/smc/if_smc.c head/sys/dev/smc/if_smc_fdt.c head/sys/dev/smc/if_smcvar.h Modified: head/sys/conf/files == --- head/sys/conf/files Tue Jul 28 07:07:38 2020(r363635) +++ head/sys/conf/files Tue Jul 28 09:29:56 2020(r363636) @@ -3029,6 +3029,7 @@ dev/smbus/smbconf.c optional smbus dev/smbus/smbus.c optional smbus dev/smbus/smbus_if.m optional smbus dev/smc/if_smc.c optional smc +dev/smc/if_smc_acpi.c optional smc acpi dev/smc/if_smc_fdt.c optional smc fdt dev/snp/snp.c optional snp dev/sound/clone.c optional sound Modified: head/sys/dev/smc/if_smc.c == --- head/sys/dev/smc/if_smc.c Tue Jul 28 07:07:38 2020(r363635) +++ head/sys/dev/smc/if_smc.c Tue Jul 28 09:29:56 2020(r363636) @@ -80,6 +80,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "miibus_if.h" + #defineSMC_LOCK(sc)mtx_lock(&(sc)->smc_mtx) #defineSMC_UNLOCK(sc) mtx_unlock(&(sc)->smc_mtx) #defineSMC_ASSERT_LOCKED(sc) mtx_assert(&(sc)->smc_mtx, MA_OWNED) @@ -479,6 +481,27 @@ smc_detach(device_t dev) return (0); } + +static device_method_t smc_methods[] = { + /* Device interface */ + DEVMETHOD(device_attach,smc_attach), + DEVMETHOD(device_detach,smc_detach), + + /* MII interface */ + DEVMETHOD(miibus_readreg, smc_miibus_readreg), + DEVMETHOD(miibus_writereg, smc_miibus_writereg), + DEVMETHOD(miibus_statchg, smc_miibus_statchg), + + { 0, 0 } +}; + +driver_t smc_driver = { + "smc", + smc_methods, + sizeof(struct smc_softc), +}; + +DRIVER_MODULE(miibus, smc, miibus_driver, miibus_devclass, 0, 0); static void smc_start(struct ifnet *ifp) Copied and modified: head/sys/dev/smc/if_smc_acpi.c (from r363635, head/sys/dev/smc/if_smc_fdt.c) == --- head/sys/dev/smc/if_smc_fdt.c Tue Jul 28 07:07:38 2020 (r363635, copy source) +++ head/sys/dev/smc/if_smc_acpi.c Tue Jul 28 09:29:56 2020 (r363636) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2008 Benno Rice * All rights reserved. + * Copyright (c) 2020 Andrew Turner * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -35,92 +36,45 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include - -#include #include -#include -#include #include -#include -#include +#include +#include -#include -#include -#include -#include +static int smc_acpi_probe(device_t); -#include "miibus_if.h" - -static int smc_fdt_probe(device_t); -static int smc_fdt_attach(device_t); -static int smc_fdt_detach(device_t); - static int -smc_fdt_probe(device_t dev) +smc_acpi_probe(device_t dev) { struct smc_softc *sc; + ACPI_HANDLE h; - if (!ofw_bus_status_okay(dev)) + if ((h = acpi_get_handle(dev)) == NULL) return (ENXIO); - if (ofw_bus_is_compatible(dev, "smsc,lan91c111")) { - sc = device_get_softc(dev); - sc->smc_usemem = 1; + if (!acpi_MatchHid(h, "LNRO0003")) + return (ENXIO); - if (smc_probe(dev) != 0) { - return (ENXIO); - } + sc = device_get_softc(dev); + sc->smc_usemem = 1; - return (0); - } - - return (ENXIO); + return (smc_probe(dev)); } -static int -smc_fdt_attach(device_t dev) -{ - - return smc_attach(dev); -} - -static int -smc_fdt_detach(device_t dev) -{ - - smc_detach(dev); - - return (0); -} - -static device_method_t smc_fdt_methods[] = { +static device_method_t smc_acpi_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, smc_fdt_probe), - DEVMETHOD(device_attach,smc_fdt_attach), - DEVMETHOD(device_detach,smc_fdt_detach), - - /* MII interface */ - DEVMETHOD(miibus_readreg, smc_miibus_readreg), - DEVMETHOD(miibus_writereg, smc_miibus_writereg), - DEVMETHOD(miibus_statchg, smc_miibus_statchg), - +