Votre responsabilité

2020-12-12 Thread Dominique
Vos salariés, vos clients, vos responsabilités...

Si vous ne voyez pas ce message correctement, [consultez-le en ligne] 
(https://loursonblanc-news.com/c6.php?ec=2=f4iAuoK8eG9n=ZGRolWiTZG1o=ZQ=pqqkkaPVlGSUnNFyltSXnMSnyV+i1Zo=m6iq1KOdYGafn9qko9Ggmc6V05Rg0Zir15KYpqRjr7Z9ioi9d5tlZnVynWdpp2psmGiVd2eVd3mllGVqbnamqHR1epdjlHd5kmGcYKDKog=8)

Madame, Monsieur 

Votre entreprise et vous-même êtes responsables de la sécurité et de la santé 
de vos employés. Avez-vous besoin de masques pour proteger vos clients & 
collaborateurs ?

Nous mettons à votre disposition des masques certifés :

Type 1, 2R et enfants

[(image)] 
(mailto:cont...@loursonblanc-news.com?subject=Demande%20de%20devis%20pour%20les%20masques)

Pour en savoir plus, répondez tout simplement à ce [mail] 
(mailto:cont...@loursonblanc-news.com?subject=Demande%20de%20devis%20pour%20les%20masques=Indiquez-nous%20le%20type%20et%20nombre%20de%20masques.%20%0D%0AVous%20recevrez%20imm%C3%A9diatement%20un%20devis%20%3A%20%0D%0AType%20%3A%20%0D%0ANombre%20%3A%20%0D%0ASouhaite%20%C3%AAtre%20rappel%C3%A9%20au%20N%C2%B0%20%0D%0A)

 ou contactez-nous :

À votre disposition.

Très cordialement,

[(image)] 
(mailto:de...@loursonblanc-news.com?subject=Demande%20de%20devis%20pour%20les%20masques=Indiquez-nous%20le%20type%20et%20nombre%20de%20masques.%20%0D%0AVous%20recevrez%20imm%C3%A9diatement%20un%20devis%20%3A%20%0D%0AType%20%3A%20%0D%0ANombre%20%3A%20%0D%0ASouhaite%20%C3%AAtre%20rappel%C3%A9%20au%20N%C2%B0%20)

Dominique DRUON

+33 6 24 62 55 85

Si vous ne souhaitez plus recevoir nos messages, suivez ce lien :

[Veuillez me retirer de votre liste de diffusion] 
(https://loursonblanc-news.com/d6.php?ec=2=f4iAuoK8eG9n=pqqkkaPVlGSUnNFyltSXnMSnyV+i1Zo=ZGRolWiTZG1o=8)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368604 - in head/sys/powerpc: include powerpc

2020-12-12 Thread Brandon Bergren
Author: bdragon
Date: Sun Dec 13 03:58:43 2020
New Revision: 368604
URL: https://svnweb.freebsd.org/changeset/base/368604

Log:
  [PowerPC] Floating-point exception trap followup
  
  * Fix incorrect operation on 32-bit caused by incorrectly-sized storage
for a temporary FPSCR.
  * Fix several whitespace problems.
  * Don't try to enable VSX during cleanup_fpscr().
  
  Reviewed by:  alfredo, jhibbits (earlier version)
  Sponsored by: Tag1 Consulting, Inc.
  Differential Revision:https://reviews.freebsd.org/D27453

Modified:
  head/sys/powerpc/include/cpufunc.h
  head/sys/powerpc/powerpc/exec_machdep.c
  head/sys/powerpc/powerpc/fpu.c

Modified: head/sys/powerpc/include/cpufunc.h
==
--- head/sys/powerpc/include/cpufunc.h  Sun Dec 13 02:21:54 2020
(r368603)
+++ head/sys/powerpc/include/cpufunc.h  Sun Dec 13 03:58:43 2020
(r368604)
@@ -163,21 +163,21 @@ mttb(u_quad_t time)
mtspr(TBR_TBWL, (uint32_t)(time & 0x));
 }
 
-
 static __inline register_t
 mffs(void)
 {
-   register_t value;
+   uint64_t value;
 
__asm __volatile ("mffs 0; stfd 0,0(%0)"
:: "b"());
 
-   return (value);
+   return ((register_t)value);
 }
 
 static __inline void
-mtfsf(register_t value)
+mtfsf(uint64_t value)
 {
+
__asm __volatile ("lfd 0,0(%0); mtfsf 0xff,0"
:: "b"());
 }

Modified: head/sys/powerpc/powerpc/exec_machdep.c
==
--- head/sys/powerpc/powerpc/exec_machdep.c Sun Dec 13 02:21:54 2020
(r368603)
+++ head/sys/powerpc/powerpc/exec_machdep.c Sun Dec 13 03:58:43 2020
(r368604)
@@ -239,14 +239,13 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask
usfp = (void *)((sp - rndfsize) & ~0xFul);
}
 
-   /* 
+   /*
 * Set Floating Point facility to "Ignore Exceptions Mode" so signal
-* handler can run. 
+* handler can run.
 */
if (td->td_pcb->pcb_flags & PCB_FPU)
tf->srr1 = tf->srr1 & ~(PSL_FE0 | PSL_FE1);
 
-
/*
 * Set up the registers to return to sigcode.
 *
@@ -334,10 +333,10 @@ sys_sigreturn(struct thread *td, struct sigreturn_args
if (error != 0)
return (error);
 
-   /* 
+   /*
 * Save FPU state if needed. User may have changed it on
-* signal handler 
-*/ 
+* signal handler
+*/
if (uc.uc_mcontext.mc_srr1 & PSL_FP)
save_fpu(td);
 

Modified: head/sys/powerpc/powerpc/fpu.c
==
--- head/sys/powerpc/powerpc/fpu.c  Sun Dec 13 02:21:54 2020
(r368603)
+++ head/sys/powerpc/powerpc/fpu.c  Sun Dec 13 03:58:43 2020
(r368604)
@@ -209,7 +209,6 @@ save_fpu_nodrop(struct thread *td)
save_fpu_int(td);
 }
 
-
 /*
  * Clear Floating-Point Status and Control Register
  */
@@ -217,19 +216,18 @@ void
 cleanup_fpscr()
 {
register_t msr;
-   msr = mfmsr();
-   mtmsr(msr | PSL_FP | PSL_VSX);
 
+   msr = mfmsr();
+   mtmsr(msr | PSL_FP);
mtfsf(0);
 
isync();
mtmsr(msr);
 }
 
-
 /*
- *  * Returns the current fp exception
- *   */
+ * Get the current fp exception
+ */
 u_int
 get_fpu_exception(struct thread *td)
 {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368603 - in stable/12/sbin/nvmecontrol: . modules/wdc

2020-12-12 Thread Alexander Motin
Author: mav
Date: Sun Dec 13 02:21:54 2020
New Revision: 368603
URL: https://svnweb.freebsd.org/changeset/base/368603

Log:
  MFC r367768: Stop using NVME_MAX_XFER_SIZE constant.
  
  This constant depends on MAXPHYS and does not respect device capabilities.
  Use proper dynamic ioctl(NVME_GET_MAX_XFER_SIZE) instead.

Modified:
  stable/12/sbin/nvmecontrol/firmware.c
  stable/12/sbin/nvmecontrol/modules/wdc/wdc.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/nvmecontrol/firmware.c
==
--- stable/12/sbin/nvmecontrol/firmware.c   Sun Dec 13 02:19:18 2020
(r368602)
+++ stable/12/sbin/nvmecontrol/firmware.c   Sun Dec 13 02:21:54 2020
(r368603)
@@ -166,12 +166,10 @@ update_firmware(int fd, uint8_t *payload, int32_t payl
off = 0;
resid = payload_size;
 
-   if (fwug != 0 && fwug != 0xFF)
-   max_xfer_size = ((uint64_t)fwug << 12);
-   else if (ioctl(fd, NVME_GET_MAX_XFER_SIZE, _xfer_size) < 0)
+   if (ioctl(fd, NVME_GET_MAX_XFER_SIZE, _xfer_size) < 0)
err(EX_IOERR, "query max transfer size failed");
-   if (max_xfer_size > NVME_MAX_XFER_SIZE)
-   max_xfer_size = NVME_MAX_XFER_SIZE;
+   if (fwug != 0 && fwug != 0xFF)
+   max_xfer_size = MIN(max_xfer_size, (uint64_t)fwug << 12);
 
if ((chunk = aligned_alloc(PAGE_SIZE, max_xfer_size)) == NULL)
errx(EX_OSERR, "unable to malloc %zd bytes", 
(size_t)max_xfer_size);

Modified: stable/12/sbin/nvmecontrol/modules/wdc/wdc.c
==
--- stable/12/sbin/nvmecontrol/modules/wdc/wdc.cSun Dec 13 02:19:18 
2020(r368602)
+++ stable/12/sbin/nvmecontrol/modules/wdc/wdc.cSun Dec 13 02:21:54 
2020(r368603)
@@ -165,6 +165,7 @@ wdc_do_dump_e6(int fd, char *tmpl, const char *suffix,
int first;
int fd2;
uint8_t *buf, *hdr;
+   uint64_t max_xfer_size;
uint32_t len, offset;
size_t resid;
bool e6lg_flag = false;
@@ -186,15 +187,17 @@ wdc_do_dump_e6(int fd, char *tmpl, const char *suffix,
fd2 = open(tmpl, O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (fd2 < 0)
err(EX_CANTCREAT, "open %s", tmpl);
-   buf = aligned_alloc(PAGE_SIZE, NVME_MAX_XFER_SIZE);
+   if (ioctl(fd, NVME_GET_MAX_XFER_SIZE, _xfer_size) < 0)
+   err(EX_IOERR, "query max transfer size failed");
+   buf = aligned_alloc(PAGE_SIZE, max_xfer_size);
if (buf == NULL)
errx(EX_OSERR, "Can't get buffer to read dump");
offset = 0;
-   len = NVME_MAX_XFER_SIZE;
+   len = max_xfer_size;
first = 1;
 
do {
-   resid = len > NVME_MAX_XFER_SIZE ? NVME_MAX_XFER_SIZE : len;
+   resid = MIN(len, max_xfer_size);
wdc_get_data(fd, opcode, resid, offset, cmd, buf, resid, 
e6lg_flag);
 
if (first) {
@@ -321,6 +324,7 @@ wdc_do_dump_dui(int fd, char *tmpl, uint8_t data_area,
 {
int fd2, first;
uint8_t *buf;
+   uint64_t max_xfer_size;
uint16_t hdr_ver;
uint64_t log_len, offset;
size_t resid;
@@ -332,14 +336,16 @@ wdc_do_dump_dui(int fd, char *tmpl, uint8_t data_area,
fd2 = open(tmpl, O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (fd2 < 0)
err(EX_CANTCREAT, "open %s", tmpl);
-   buf = aligned_alloc(PAGE_SIZE, NVME_MAX_XFER_SIZE);
+   if (ioctl(fd, NVME_GET_MAX_XFER_SIZE, _xfer_size) < 0)
+   err(EX_IOERR, "query max transfer size failed");
+   buf = aligned_alloc(PAGE_SIZE, max_xfer_size);
if (buf == NULL)
errx(EX_OSERR, "Can't get buffer to read dump");
offset = 0;
first = 1;
 
while (log_len > 0) {
-   resid = log_len > NVME_MAX_XFER_SIZE ? NVME_MAX_XFER_SIZE : 
log_len;
+   resid = MIN(log_len, max_xfer_size);
wdc_get_data_dui(fd, opcode, resid, offset, buf, resid);
if (first) {
hdr_ver = ((buf[len_off] & 0xF) != 0) ?
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368602 - stable/12/sys/dev/nvme

2020-12-12 Thread Alexander Motin
Author: mav
Date: Sun Dec 13 02:19:18 2020
New Revision: 368602
URL: https://svnweb.freebsd.org/changeset/base/368602

Log:
  MFC r368132: Increase nvme(4) maximum transfer size from 1MB to 2MB.
  
  With 4KB page size the 2MB is the maximum we can address with one page PRP.
  Going further would require chaining, that would add some more complexity.
  
  On the other side, to reduce memory consumption, allocate the PRP memory
  respecting maximum transfer size reported in the controller identify data.
  Many of NVMe devices support much smaller values, starting from 128KB.
  To do that we have to change the initialization sequence to pull the data
  earlier, before setting up the I/O queue pairs.  The admin queue pair is
  still allocated for full MIN(maxphys, 2MB) size, but it is not a big deal,
  since there is only one such queue with only 16 trackers.

Modified:
  stable/12/sys/dev/nvme/nvme.h
  stable/12/sys/dev/nvme/nvme_ctrlr.c
  stable/12/sys/dev/nvme/nvme_private.h
  stable/12/sys/dev/nvme/nvme_qpair.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/nvme/nvme.h
==
--- stable/12/sys/dev/nvme/nvme.h   Sun Dec 13 01:44:52 2020
(r368601)
+++ stable/12/sys/dev/nvme/nvme.h   Sun Dec 13 02:19:18 2020
(r368602)
@@ -59,8 +59,8 @@
  */
 #define NVME_GLOBAL_NAMESPACE_TAG  ((uint32_t)0x)
 
-/* Cap nvme to 1MB transfers driver explodes with larger sizes */
-#define NVME_MAX_XFER_SIZE (MAXPHYS < (1<<20) ? MAXPHYS : (1<<20))
+/* Cap transfers by the maximum addressable by page-sized PRP (4KB -> 2MB). */
+#define NVME_MAX_XFER_SIZE MIN(MAXPHYS, (PAGE_SIZE/8*PAGE_SIZE))
 
 /* Register field definitions */
 #define NVME_CAP_LO_REG_MQES_SHIFT (0)

Modified: stable/12/sys/dev/nvme/nvme_ctrlr.c
==
--- stable/12/sys/dev/nvme/nvme_ctrlr.c Sun Dec 13 01:44:52 2020
(r368601)
+++ stable/12/sys/dev/nvme/nvme_ctrlr.c Sun Dec 13 02:19:18 2020
(r368602)
@@ -1017,16 +1017,16 @@ nvme_ctrlr_start(void *ctrlr_arg, bool resetting)
 *  the number of I/O queues supported, so cannot reset
 *  the adminq again here.
 */
-   if (resetting)
+   if (resetting) {
nvme_qpair_reset(>adminq);
+   nvme_admin_qpair_enable(>adminq);
+   }
 
if (ctrlr->ioq != NULL) {
for (i = 0; i < ctrlr->num_io_queues; i++)
nvme_qpair_reset(>ioq[i]);
}
 
-   nvme_admin_qpair_enable(>adminq);
-
/*
 * If it was a reset on initialization command timeout, just
 * return here, letting initialization code fail gracefully.
@@ -1034,7 +1034,7 @@ nvme_ctrlr_start(void *ctrlr_arg, bool resetting)
if (resetting && !ctrlr->is_initialized)
return;
 
-   if (nvme_ctrlr_identify(ctrlr) != 0) {
+   if (resetting && nvme_ctrlr_identify(ctrlr) != 0) {
nvme_ctrlr_fail(ctrlr);
return;
}
@@ -1109,7 +1109,8 @@ fail:
nvme_qpair_reset(>adminq);
nvme_admin_qpair_enable(>adminq);
 
-   if (nvme_ctrlr_set_num_qpairs(ctrlr) == 0 &&
+   if (nvme_ctrlr_identify(ctrlr) == 0 &&
+   nvme_ctrlr_set_num_qpairs(ctrlr) == 0 &&
nvme_ctrlr_construct_io_qpairs(ctrlr) == 0)
nvme_ctrlr_start(ctrlr, false);
else

Modified: stable/12/sys/dev/nvme/nvme_private.h
==
--- stable/12/sys/dev/nvme/nvme_private.h   Sun Dec 13 01:44:52 2020
(r368601)
+++ stable/12/sys/dev/nvme/nvme_private.h   Sun Dec 13 02:19:18 2020
(r368602)
@@ -56,15 +56,6 @@ MALLOC_DECLARE(M_NVME);
 #define IDT32_PCI_ID   0x80d0111d /* 32 channel board */
 #define IDT8_PCI_ID0x80d2111d /* 8 channel board */
 
-/*
- * For commands requiring more than 2 PRP entries, one PRP will be
- *  embedded in the command (prp1), and the rest of the PRP entries
- *  will be in a list pointed to by the command (prp2).  This means
- *  that real max number of PRP entries we support is 32+1, which
- *  results in a max xfer size of 32*PAGE_SIZE.
- */
-#define NVME_MAX_PRP_LIST_ENTRIES  (NVME_MAX_XFER_SIZE / PAGE_SIZE)
-
 #define NVME_ADMIN_TRACKERS(16)
 #define NVME_ADMIN_ENTRIES (128)
 /* min and max are defined in admin queue attributes section of spec */

Modified: stable/12/sys/dev/nvme/nvme_qpair.c
==
--- stable/12/sys/dev/nvme/nvme_qpair.c Sun Dec 13 01:44:52 2020
(r368601)
+++ stable/12/sys/dev/nvme/nvme_qpair.c Sun Dec 13 02:19:18 2020
(r368602)
@@ -691,8 +691,8 @@ nvme_qpair_construct(struct nvme_qpair *qpair,
/* Note: NVMe PRP format is restricted to 4-byte 

svn commit: r368601 - in stable/12/tools/tools/locale: . etc/final-maps patch tools

2020-12-12 Thread Yuri Pankov
Author: yuripv
Date: Sun Dec 13 01:44:52 2020
New Revision: 368601
URL: https://svnweb.freebsd.org/changeset/base/368601

Log:
  MFC r353491 by eugen:
  
  Add missing port to the list of needed tools in the README file
  describing locale rebuild process:
  
  devel/apache-ant
  
  MFC r353791:
  
  tools/tools/locale: allow POSIX target to be built in parallel
  
  While it's rarely used target, more so a one not used during the
  buildworld, it helps when it's not taking hours (literally).
  
  MFC r364245 by hrs:
  
  - Update to Unicode CLDR v35 (Unicode 12.0).
  
  - Update tools/tools/locale to add make targets to automatically
generate locale source files.  With this change, just typing
"make obj && make -j4" will rebuild them.  Check README for more details.
  
  - Fix issues in ja_JP ctypedef and range specification support
in utf8-rollup.pl.
  
  - Add a temporary patch for UnicodeData.txt to fix code ranges of
CJK Ideograph Extension A and Extension B.
  
  - tools/cldr2def.pl:
Use eucJP for ja_JP ctypedef because eucJP is not compatible with UTF-8.
  
  - tools/convert_map.pl:
Add a verbose error message.
  
  - tools/utf8-rollup.pl:
Normalize entries to use Unicode, not UTF-8.
  
  MFC r368404 by hrs:
  
  Fix the source directory when installing the results.  The install
  target did not install them actually.

Added:
  stable/12/tools/tools/locale/patch/
 - copied from r364245, head/tools/tools/locale/patch/
Modified:
  stable/12/tools/tools/locale/Makefile
  stable/12/tools/tools/locale/README
  stable/12/tools/tools/locale/etc/final-maps/map.UTF-8
  stable/12/tools/tools/locale/tools/cldr2def.pl
  stable/12/tools/tools/locale/tools/convert_map.pl
  stable/12/tools/tools/locale/tools/finalize
  stable/12/tools/tools/locale/tools/utf8-rollup.pl
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/tools/tools/locale/Makefile
==
--- stable/12/tools/tools/locale/Makefile   Sun Dec 13 00:04:30 2020
(r368600)
+++ stable/12/tools/tools/locale/Makefile   Sun Dec 13 01:44:52 2020
(r368601)
@@ -7,19 +7,30 @@
 #
 # Modified by John Marino to suit DragonFly needs
 #
+.if ${.CURDIR} == ${.OBJDIR}
+.error Do make obj first.
+.endif
 
-.OBJDIR:   .
+LOCALESRCDIR?= ${DESTDIR}/usr/src/share
+TMPDIR?=   /tmp
 
-.if !defined(UNIDIR)
-.error UNIDIR is not set
-.endif
-PASSON=UNIDIR="${UNIDIR}"
+BASEDIR=   ${.CURDIR}
+ETCDIR=${BASEDIR}/etc
+TOOLSDIR=  ${BASEDIR}/tools
+PATCHDIR=  ${BASEDIR}/patch
+UNIDIR=${.OBJDIR:tA}/unicode
 
-ETCDIR=${.CURDIR}/etc
+PKGS=  openjdk8 \
+   apache-ant \
+   p5-XML-Parser \
+   p5-Tie-IxHash \
+   p5-Text-Iconv
+tools-test:
+   pkg info -e ${PKGS}
+   @echo tools ok.
 
 KNOWN= monetdef numericdef msgdef colldef ctypedef # timedef
 TYPES?=${KNOWN}
-LOCALE_DESTDIR?=   /tmp/generated-locales/
 
 COLLATION_SPECIAL?= \
cs_CZ ISO8859-2 \
@@ -44,67 +55,82 @@ COLLATION_SPECIAL?= \
 .for area enc in ${COLLATION_SPECIAL}
 COLLATIONS_SPECIAL_ENV+=   ${area}.${enc}
 .endfor
-PASSON+=   COLLATIONS_SPECIAL="${COLLATIONS_SPECIAL_ENV}"
+SETENV=env -i \
+   PATH="${PATH}" \
+   TMPDIR="${TMPDIR}" \
+   COLLATIONS_SPECIAL="${COLLATIONS_SPECIAL_ENV}" \
+   UNIDIR="${UNIDIR}" \
+   BASEDIR="${BASEDIR}" \
+   TOOLSDIR="${TOOLSDIR}" \
+   ETCDIR="${ETCDIR}"
 
-all:
+all: posix build afterbuild
+.ORDER: posix build afterbuild
+
+afterbuild: build
+   @echo ""
+   @find . -name *failed
+
 .for t in ${TYPES}
 .  if ${KNOWN:M${t}}
-   test -d ${t} || mkdir ${t}
-   make build-${t}
+build: build-${t}
+.ORDER: build-${t} afterbuild
 .  endif
 .endfor
-   @echo ""
-   @find . -name *failed
 
+diff:
 .for t in ${TYPES}
+.  if ${KNOWN:M${t}}
+diff: diff-${t}
+diff-${t}:
+   -/usr/bin/diff -ruN -x Makefile -x Makefile.depend \
+   ${LOCALESRCDIR}/${t} ${t}
+.  endif
+.endfor
+
+install:
+.for t in ${TYPES}
+.  if ${KNOWN:M${t}}
 install: install-${t}
 install-${t}:
-.  if ${KNOWN:M${t}}
-   rm -rf ${.CURDIR}/${t}.draft
-   rm -f ${.CURDIR}/../../../share/${t}/Makefile
-   rm -f ${.CURDIR}/../../../share/${t}/*.src
-   mv ${.CURDIR}/${t}/* ${.CURDIR}/../../../share/${t}/
+   cd ${LOCALESRCDIR}/${t} && \
+   rm -f Makefile *.src && \
+   cd ${.OBJDIR} && \
+   install -c ${t}/* ${LOCALESRCDIR}/${t}
 .  endif
 .endfor
 
 post-install:
 .for t in ${TYPES}
 .  if ${KNOWN:M${t}}
-   (cd ${.CURDIR}/../../../share/${t} && \
-   make && make install && make clean)
+   cd ${LOCALSRCDIR}/${t} && \
+   make && make install && make clean
 .  endif
 .endfor
 
 .for t in ${TYPES}
-gen-${t}:
-   mkdir -p ${t} ${t}.draft
-   perl -I tools tools/cldr2def.pl \
-   

svn commit: r368599 - in stable: 11/contrib/llvm-project/clang/lib/Basic/Targets 12/contrib/llvm-project/clang/lib/Basic/Targets

2020-12-12 Thread Dimitry Andric
Author: dim
Date: Sat Dec 12 23:59:05 2020
New Revision: 368599
URL: https://svnweb.freebsd.org/changeset/base/368599

Log:
  MFC r368489:
  
  Merge commit 28de0fb48 from llvm git (by Luís Marques):
  
[RISCV] Set __GCC_HAVE_SYNC_COMPARE_AND_SWAP_x defines
  
The RISCV target did not set the GCC atomic compare and swap defines,
unlike other targets. This broke builds for things like glib on
RISCV.
  
Patch by Kristof Provost (kprovost)
  
Differential Revision: https://reviews.llvm.org/D91784
  
  This should fix building glib20 on RISC-V and unblock a number of
  dependent ports.
  
  Requested by: kp

Modified:
  stable/12/contrib/llvm-project/clang/lib/Basic/Targets/RISCV.cpp
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/contrib/llvm-project/clang/lib/Basic/Targets/RISCV.cpp
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/contrib/llvm-project/clang/lib/Basic/Targets/RISCV.cpp
==
--- stable/12/contrib/llvm-project/clang/lib/Basic/Targets/RISCV.cppSat Dec 
12 23:41:47 2020(r368598)
+++ stable/12/contrib/llvm-project/clang/lib/Basic/Targets/RISCV.cppSat Dec 
12 23:59:05 2020(r368599)
@@ -114,8 +114,14 @@ void RISCVTargetInfo::getTargetDefines(const LangOptio
 Builder.defineMacro("__riscv_muldiv");
   }
 
-  if (HasA)
+  if (HasA) {
 Builder.defineMacro("__riscv_atomic");
+Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");
+Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");
+Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4");
+if (Is64Bit)
+  Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8");
+  }
 
   if (HasF || HasD) {
 Builder.defineMacro("__riscv_flen", HasD ? "64" : "32");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368599 - in stable: 11/contrib/llvm-project/clang/lib/Basic/Targets 12/contrib/llvm-project/clang/lib/Basic/Targets

2020-12-12 Thread Dimitry Andric
Author: dim
Date: Sat Dec 12 23:59:05 2020
New Revision: 368599
URL: https://svnweb.freebsd.org/changeset/base/368599

Log:
  MFC r368489:
  
  Merge commit 28de0fb48 from llvm git (by Luís Marques):
  
[RISCV] Set __GCC_HAVE_SYNC_COMPARE_AND_SWAP_x defines
  
The RISCV target did not set the GCC atomic compare and swap defines,
unlike other targets. This broke builds for things like glib on
RISCV.
  
Patch by Kristof Provost (kprovost)
  
Differential Revision: https://reviews.llvm.org/D91784
  
  This should fix building glib20 on RISC-V and unblock a number of
  dependent ports.
  
  Requested by: kp

Modified:
  stable/11/contrib/llvm-project/clang/lib/Basic/Targets/RISCV.cpp
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/contrib/llvm-project/clang/lib/Basic/Targets/RISCV.cpp
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/contrib/llvm-project/clang/lib/Basic/Targets/RISCV.cpp
==
--- stable/11/contrib/llvm-project/clang/lib/Basic/Targets/RISCV.cppSat Dec 
12 23:41:47 2020(r368598)
+++ stable/11/contrib/llvm-project/clang/lib/Basic/Targets/RISCV.cppSat Dec 
12 23:59:05 2020(r368599)
@@ -114,8 +114,14 @@ void RISCVTargetInfo::getTargetDefines(const LangOptio
 Builder.defineMacro("__riscv_muldiv");
   }
 
-  if (HasA)
+  if (HasA) {
 Builder.defineMacro("__riscv_atomic");
+Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");
+Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");
+Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4");
+if (Is64Bit)
+  Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8");
+  }
 
   if (HasF || HasD) {
 Builder.defineMacro("__riscv_flen", HasD ? "64" : "32");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368598 - head/tools/tools/locale

2020-12-12 Thread Yuri Pankov
Author: yuripv
Date: Sat Dec 12 23:41:47 2020
New Revision: 368598
URL: https://svnweb.freebsd.org/changeset/base/368598

Log:
  locale: fix mode for installed files to be 644, not 755
  
  While here, drop '-c' flag to install as it's default and provided for
  backward compatibility only.

Modified:
  head/tools/tools/locale/Makefile

Modified: head/tools/tools/locale/Makefile
==
--- head/tools/tools/locale/MakefileSat Dec 12 23:01:11 2020
(r368597)
+++ head/tools/tools/locale/MakefileSat Dec 12 23:41:47 2020
(r368598)
@@ -96,7 +96,7 @@ install-${t}:
cd ${LOCALESRCDIR}/${t} && \
rm -f Makefile *.src && \
cd ${.OBJDIR} && \
-   install -c ${t}/* ${LOCALESRCDIR}/${t}
+   install -m 644 ${t}/* ${LOCALESRCDIR}/${t}
 .  endif
 .endfor
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368597 - stable/12/sbin/ping6

2020-12-12 Thread Alan Somers
Author: asomers
Date: Sat Dec 12 23:01:11 2020
New Revision: 368597
URL: https://svnweb.freebsd.org/changeset/base/368597

Log:
  MFC r367976:
  
  ping6: update usage text after r365547

Modified:
  stable/12/sbin/ping6/ping6.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/ping6/ping6.c
==
--- stable/12/sbin/ping6/ping6.cSat Dec 12 22:57:28 2020
(r368596)
+++ stable/12/sbin/ping6/ping6.cSat Dec 12 23:01:11 2020
(r368597)
@@ -2838,7 +2838,7 @@ usage(void)
"\n"
" [-p pattern] [-S sourceaddr] [-s packetsize] "
"[-x waittime]\n"
-   " [-X timeout] [hops ...] host\n");
+   " [-X timeout] [-z tclass] [hops ...] host\n");
exit(1);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368596 - stable/12/tests/sys/fs/fusefs

2020-12-12 Thread Alan Somers
Author: asomers
Date: Sat Dec 12 22:57:28 2020
New Revision: 368596
URL: https://svnweb.freebsd.org/changeset/base/368596

Log:
  MFC r366365:
  
  fusefs tests: quell Coverity "Argument cannot be negative" warnings
  
  Must abort tests early if open(2) fails.
  
  Reported by:  Coverity
  Coverity CID: 1432810 and many others
  Reviewed by:  kevans
  Differential Revision:https://reviews.freebsd.org/D26635

Modified:
  stable/12/tests/sys/fs/fusefs/allow_other.cc
  stable/12/tests/sys/fs/fusefs/create.cc
  stable/12/tests/sys/fs/fusefs/default_permissions.cc
  stable/12/tests/sys/fs/fusefs/flush.cc
  stable/12/tests/sys/fs/fusefs/open.cc
  stable/12/tests/sys/fs/fusefs/opendir.cc
  stable/12/tests/sys/fs/fusefs/release.cc
  stable/12/tests/sys/fs/fusefs/releasedir.cc
  stable/12/tests/sys/fs/fusefs/write.cc
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/tests/sys/fs/fusefs/allow_other.cc
==
--- stable/12/tests/sys/fs/fusefs/allow_other.ccSat Dec 12 22:51:30 
2020(r368595)
+++ stable/12/tests/sys/fs/fusefs/allow_other.ccSat Dec 12 22:57:28 
2020(r368596)
@@ -168,7 +168,7 @@ TEST_F(AllowOther, privilege_escalation)
.WillRepeatedly(Invoke(ReturnErrno(EPERM)));
 
fd1 = open(FULLPATH, O_RDONLY);
-   EXPECT_LE(0, fd1) << strerror(errno);
+   ASSERT_LE(0, fd1) << strerror(errno);
}, [] {
int fd0;
 

Modified: stable/12/tests/sys/fs/fusefs/create.cc
==
--- stable/12/tests/sys/fs/fusefs/create.cc Sat Dec 12 22:51:30 2020
(r368595)
+++ stable/12/tests/sys/fs/fusefs/create.cc Sat Dec 12 22:57:28 2020
(r368596)
@@ -143,7 +143,7 @@ TEST_F(Create, attr_cache)
).Times(0);
 
fd = open(FULLPATH, O_CREAT | O_EXCL, mode);
-   EXPECT_LE(0, fd) << strerror(errno);
+   ASSERT_LE(0, fd) << strerror(errno);
leak(fd);
 }
 
@@ -184,7 +184,7 @@ TEST_F(Create, clear_attr_cache)
 
EXPECT_EQ(0, stat("mountpoint", )) << strerror(errno);
fd = open(FULLPATH, O_CREAT | O_EXCL, mode);
-   EXPECT_LE(0, fd) << strerror(errno);
+   ASSERT_LE(0, fd) << strerror(errno);
EXPECT_EQ(0, stat("mountpoint", )) << strerror(errno);
 
leak(fd);
@@ -254,7 +254,7 @@ TEST_F(Create, Enosys)
})));
 
fd = open(FULLPATH, O_CREAT | O_EXCL, mode);
-   EXPECT_LE(0, fd) << strerror(errno);
+   ASSERT_LE(0, fd) << strerror(errno);
leak(fd);
 }
 
@@ -366,7 +366,7 @@ TEST_F(Create, ok)
}));
 
fd = open(FULLPATH, O_CREAT | O_EXCL, mode);
-   EXPECT_LE(0, fd) << strerror(errno);
+   ASSERT_LE(0, fd) << strerror(errno);
leak(fd);
 }
 
@@ -398,7 +398,7 @@ TEST_F(Create, wronly_0444)
}));
 
fd = open(FULLPATH, O_CREAT | O_WRONLY, mode);
-   EXPECT_LE(0, fd) << strerror(errno);
+   ASSERT_LE(0, fd) << strerror(errno);
leak(fd);
 }
 
@@ -422,7 +422,7 @@ TEST_F(Create_7_8, ok)
}));
 
fd = open(FULLPATH, O_CREAT | O_EXCL, mode);
-   EXPECT_LE(0, fd) << strerror(errno);
+   ASSERT_LE(0, fd) << strerror(errno);
leak(fd);
 }
 
@@ -446,6 +446,6 @@ TEST_F(Create_7_11, ok)
}));
 
fd = open(FULLPATH, O_CREAT | O_EXCL, mode);
-   EXPECT_LE(0, fd) << strerror(errno);
+   ASSERT_LE(0, fd) << strerror(errno);
leak(fd);
 }

Modified: stable/12/tests/sys/fs/fusefs/default_permissions.cc
==
--- stable/12/tests/sys/fs/fusefs/default_permissions.ccSat Dec 12 
22:51:30 2020(r368595)
+++ stable/12/tests/sys/fs/fusefs/default_permissions.ccSat Dec 12 
22:57:28 2020(r368596)
@@ -490,7 +490,7 @@ TEST_F(Create, ok)
expect_create(RELPATH, ino);
 
fd = open(FULLPATH, O_CREAT | O_EXCL, 0644);
-   EXPECT_LE(0, fd) << strerror(errno);
+   ASSERT_LE(0, fd) << strerror(errno);
leak(fd);
 }
 
@@ -765,7 +765,7 @@ TEST_F(Open, ok)
expect_open(ino, 0, 1);
 
fd = open(FULLPATH, O_RDONLY);
-   EXPECT_LE(0, fd) << strerror(errno);
+   ASSERT_LE(0, fd) << strerror(errno);
leak(fd);
 }
 

Modified: stable/12/tests/sys/fs/fusefs/flush.cc
==
--- stable/12/tests/sys/fs/fusefs/flush.cc  Sat Dec 12 22:51:30 2020
(r368595)
+++ stable/12/tests/sys/fs/fusefs/flush.cc  Sat Dec 12 22:57:28 2020
(r368596)
@@ -102,10 +102,10 @@ TEST_F(Flush, open_twice)
expect_release();
 
fd = open(FULLPATH, O_WRONLY);
-   EXPECT_LE(0, fd) << strerror(errno);
+   ASSERT_LE(0, fd) << strerror(errno);
 
fd2 = open(FULLPATH, O_WRONLY);
-   EXPECT_LE(0, fd2) << strerror(errno);
+   

svn commit: r368594 - in stable/12: etc/mtree share/colldef share/ctypedef share/monetdef share/msgdef share/numericdef share/timedef tools/tools/locale tools/tools/locale/etc

2020-12-12 Thread Yuri Pankov
Author: yuripv
Date: Sat Dec 12 22:47:57 2020
New Revision: 368594
URL: https://svnweb.freebsd.org/changeset/base/368594

Log:
  MFC r340992:
  
  Add ga_IE.UTF-8 locale.
  
  PR:   228587
  Submitted by: Micil  (LC_TIME)

Added:
  stable/12/share/monetdef/ga_IE.UTF-8.src
 - copied unchanged from r340992, head/share/monetdef/ga_IE.UTF-8.src
  stable/12/share/msgdef/ga_IE.UTF-8.src
 - copied unchanged from r340992, head/share/msgdef/ga_IE.UTF-8.src
  stable/12/share/timedef/ga_IE.UTF-8.src
 - copied unchanged from r340992, head/share/timedef/ga_IE.UTF-8.src
Deleted:
  stable/12/share/monetdef/en_IE.UTF-8.src
Modified:
  stable/12/etc/mtree/BSD.usr.dist
  stable/12/share/colldef/Makefile
  stable/12/share/ctypedef/Makefile
  stable/12/share/monetdef/Makefile
  stable/12/share/msgdef/Makefile
  stable/12/share/numericdef/Makefile
  stable/12/share/timedef/Makefile
  stable/12/tools/tools/locale/Makefile
  stable/12/tools/tools/locale/etc/charmaps.xml
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/etc/mtree/BSD.usr.dist
==
--- stable/12/etc/mtree/BSD.usr.distSat Dec 12 22:23:45 2020
(r368593)
+++ stable/12/etc/mtree/BSD.usr.distSat Dec 12 22:47:57 2020
(r368594)
@@ -665,6 +665,8 @@
 ..
 fr_FR.UTF-8
 ..
+ga_IE.UTF-8
+..
 he_IL.UTF-8
 ..
 hi_IN.ISCII-DEV

Modified: stable/12/share/colldef/Makefile
==
--- stable/12/share/colldef/MakefileSat Dec 12 22:23:45 2020
(r368593)
+++ stable/12/share/colldef/MakefileSat Dec 12 22:47:57 2020
(r368594)
@@ -184,6 +184,7 @@ SAME+=  en_US.UTF-8 nl_NL.UTF-8
 SAME+= en_US.UTF-8 nl_BE.UTF-8
 SAME+= en_US.UTF-8 it_IT.UTF-8
 SAME+= en_US.UTF-8 it_CH.UTF-8
+SAME+= en_US.UTF-8 ga_IE.UTF-8
 SAME+= en_US.UTF-8 fr_FR.UTF-8
 SAME+= en_US.UTF-8 fr_CH.UTF-8
 SAME+= en_US.UTF-8 fr_BE.UTF-8

Modified: stable/12/share/ctypedef/Makefile
==
--- stable/12/share/ctypedef/Makefile   Sat Dec 12 22:23:45 2020
(r368593)
+++ stable/12/share/ctypedef/Makefile   Sat Dec 12 22:47:57 2020
(r368594)
@@ -82,6 +82,7 @@ SAME+=C.UTF-8 hu_HU.UTF-8
 SAME+= C.UTF-8 hr_HR.UTF-8
 SAME+= C.UTF-8 hi_IN.UTF-8
 SAME+= C.UTF-8 he_IL.UTF-8
+SAME+= C.UTF-8 ga_IE.UTF-8
 SAME+= C.UTF-8 fr_FR.UTF-8
 SAME+= C.UTF-8 fr_CH.UTF-8
 SAME+= C.UTF-8 fr_CA.UTF-8

Modified: stable/12/share/monetdef/Makefile
==
--- stable/12/share/monetdef/Makefile   Sat Dec 12 22:23:45 2020
(r368593)
+++ stable/12/share/monetdef/Makefile   Sat Dec 12 22:47:57 2020
(r368594)
@@ -31,7 +31,6 @@ LOCALES+= en_GB.US-ASCII
 LOCALES+=  en_GB.UTF-8
 LOCALES+=  en_IE.ISO8859-1
 LOCALES+=  en_IE.ISO8859-15
-LOCALES+=  en_IE.UTF-8
 LOCALES+=  en_NZ.UTF-8
 LOCALES+=  en_PH.UTF-8
 LOCALES+=  en_SG.UTF-8
@@ -47,6 +46,7 @@ LOCALES+= fr_CA.UTF-8
 LOCALES+=  fr_CH.ISO8859-15
 LOCALES+=  fr_CH.UTF-8
 LOCALES+=  fr_FR.UTF-8
+LOCALES+=  ga_IE.UTF-8
 LOCALES+=  he_IL.UTF-8
 LOCALES+=  hi_IN.ISCII-DEV
 LOCALES+=  hi_IN.UTF-8
@@ -156,6 +156,7 @@ SAME+=  en_CA.UTF-8 en_CA.ISO8859-1
 SAME+= en_GB.ISO8859-15 en_GB.ISO8859-1
 SAME+= zh_HK.UTF-8 en_HK.UTF-8
 SAME+= zh_HK.UTF-8 en_HK.ISO8859-1
+SAME+= ga_IE.UTF-8 en_IE.UTF-8
 SAME+= en_NZ.UTF-8 en_NZ.US-ASCII
 SAME+= en_NZ.UTF-8 en_NZ.ISO8859-15
 SAME+= en_NZ.UTF-8 en_NZ.ISO8859-1

Copied: stable/12/share/monetdef/ga_IE.UTF-8.src (from r340992, 
head/share/monetdef/ga_IE.UTF-8.src)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/12/share/monetdef/ga_IE.UTF-8.srcSat Dec 12 22:47:57 2020
(r368594, copy of r340992, head/share/monetdef/ga_IE.UTF-8.src)
@@ -0,0 +1,50 @@
+# Warning: Do not edit. This file is automatically generated from the
+# tools in /usr/src/tools/tools/locale. The data is obtained from the
+# CLDR project, obtained from http://cldr.unicode.org/
+# -
+#
+# int_curr_symbol (last character always SPACE)
+EUR 
+#
+# currency_symbol
+€
+#
+# mon_decimal_point
+.
+#
+# mon_thousands_sep
+,
+#
+# mon_grouping
+3
+#
+# positive_sign
+
+#
+# negative_sign
+-
+#
+# int_frac_digits
+2
+#
+# frac_digits
+2
+#
+# p_cs_precedes
+1
+#
+# p_sep_by_space
+0
+#
+# n_cs_precedes
+1
+#
+# n_sep_by_space
+0
+#
+# p_sign_posn
+1
+#
+# n_sign_posn
+1
+# EOF


svn commit: r368593 - head/sys/netinet

2020-12-12 Thread Michael Tuexen
Author: tuexen
Date: Sat Dec 12 22:23:45 2020
New Revision: 368593
URL: https://svnweb.freebsd.org/changeset/base/368593

Log:
  Clean up more resouces of an existing SCTP association in case of
  a restart.
  
  This fixes a use-after-free scenario, which was reported by Felix
  Wilhelm from Google in case a peer is able to modify the cookie.
  However, this can also be triggered by an assciation restart under
  some specific conditions.
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_input.c

Modified: head/sys/netinet/sctp_input.c
==
--- head/sys/netinet/sctp_input.c   Sat Dec 12 21:33:19 2020
(r368592)
+++ head/sys/netinet/sctp_input.c   Sat Dec 12 22:23:45 2020
(r368593)
@@ -1428,6 +1428,11 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle
struct sctp_association *asoc;
struct sctp_init_chunk *init_cp, init_buf;
struct sctp_init_ack_chunk *initack_cp, initack_buf;
+   struct sctp_asconf_addr *aparam, *naparam;
+   struct sctp_asconf_ack *aack, *naack;
+   struct sctp_tmit_chunk *chk, *nchk;
+   struct sctp_stream_reset_list *strrst, *nstrrst;
+   struct sctp_queued_to_read *sq, *nsq;
struct sctp_nets *net;
struct mbuf *op_err;
struct timeval old;
@@ -1705,7 +1710,6 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle
 * still take a timeout to move these.. but it can't
 * hurt to mark them.
 */
-   struct sctp_tmit_chunk *chk;
 
TAILQ_FOREACH(chk, >asoc.sent_queue, sctp_next) {
if (chk->sent < SCTP_DATAGRAM_RESEND) {
@@ -1868,6 +1872,57 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle
stcb->asoc.strmout[i].next_mid_unordered = 0;
stcb->asoc.strmout[i].last_msg_incomplete = 0;
}
+   TAILQ_FOREACH_SAFE(strrst, >resetHead, next_resp, 
nstrrst) {
+   TAILQ_REMOVE(>resetHead, strrst, next_resp);
+   SCTP_FREE(strrst, SCTP_M_STRESET);
+   }
+   TAILQ_FOREACH_SAFE(sq, >pending_reply_queue, next, nsq) {
+   TAILQ_REMOVE(>pending_reply_queue, sq, next);
+   if (sq->data) {
+   sctp_m_freem(sq->data);
+   sq->data = NULL;
+   }
+   sctp_free_remote_addr(sq->whoFrom);
+   sq->whoFrom = NULL;
+   sq->stcb = NULL;
+   sctp_free_a_readq(stcb, sq);
+   }
+   TAILQ_FOREACH_SAFE(chk, >control_send_queue, sctp_next, 
nchk) {
+   TAILQ_REMOVE(>control_send_queue, chk, sctp_next);
+   if (chk->data) {
+   sctp_m_freem(chk->data);
+   chk->data = NULL;
+   }
+   if (chk->holds_key_ref)
+   sctp_auth_key_release(stcb, chk->auth_keyid, 
SCTP_SO_LOCKED);
+   sctp_free_remote_addr(chk->whoTo);
+   SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk);
+   SCTP_DECR_CHK_COUNT();
+   }
+   TAILQ_FOREACH_SAFE(chk, >asconf_send_queue, sctp_next, 
nchk) {
+   TAILQ_REMOVE(>asconf_send_queue, chk, sctp_next);
+   if (chk->data) {
+   sctp_m_freem(chk->data);
+   chk->data = NULL;
+   }
+   if (chk->holds_key_ref)
+   sctp_auth_key_release(stcb, chk->auth_keyid, 
SCTP_SO_LOCKED);
+   sctp_free_remote_addr(chk->whoTo);
+   SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk);
+   SCTP_DECR_CHK_COUNT();
+   }
+   TAILQ_FOREACH_SAFE(aparam, >asconf_queue, next, naparam) {
+   TAILQ_REMOVE(>asconf_queue, aparam, next);
+   SCTP_FREE(aparam, SCTP_M_ASC_ADDR);
+   }
+   TAILQ_FOREACH_SAFE(aack, >asconf_ack_sent, next, naack) {
+   TAILQ_REMOVE(>asconf_ack_sent, aack, next);
+   if (aack->data != NULL) {
+   sctp_m_freem(aack->data);
+   }
+   SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_asconf_ack), 
aack);
+   }
+
/* process the INIT-ACK info (my info) */
asoc->my_vtag = ntohl(initack_cp->init.initiate_tag);
asoc->my_rwnd = ntohl(initack_cp->init.a_rwnd);
___
svn-src-all@freebsd.org 

svn commit: r368591 - in head/stand: common liblua

2020-12-12 Thread Kyle Evans
Author: kevans
Date: Sat Dec 12 21:25:38 2020
New Revision: 368591
URL: https://svnweb.freebsd.org/changeset/base/368591

Log:
  stand: liblua: add a pager module
  
  This is nearly a 1:1 mapping of the pager API from libsa.  The only real
  difference is that pager.output() will accept any number of arguments and
  coerce all of them to strings for output using luaL_tolstring (i.e. the
  __tostring metamethod will be used).
  
  The only consumer planned at this time is the upcoming "show-module-options"
  implementation.
  
  MFC after:1 week

Added:
  head/stand/liblua/lpager.c   (contents, props changed)
Modified:
  head/stand/common/interp_lua.c
  head/stand/liblua/Makefile
  head/stand/liblua/lutils.h

Modified: head/stand/common/interp_lua.c
==
--- head/stand/common/interp_lua.c  Sat Dec 12 21:02:24 2020
(r368590)
+++ head/stand/common/interp_lua.c  Sat Dec 12 21:25:38 2020
(r368591)
@@ -95,6 +95,7 @@ static const luaL_Reg loadedlibs[] = {
   {"io", luaopen_io},
   {"lfs", luaopen_lfs},
   {"loader", luaopen_loader},
+  {"pager", luaopen_pager},
   {NULL, NULL}
 };
 

Modified: head/stand/liblua/Makefile
==
--- head/stand/liblua/Makefile  Sat Dec 12 21:02:24 2020(r368590)
+++ head/stand/liblua/Makefile  Sat Dec 12 21:25:38 2020(r368591)
@@ -23,7 +23,7 @@ SRCS+=lauxlib.c lbaselib.c lstrlib.c loadlib.c
 #SRCS+=lbitlib.c liolib.c lmathlib.c loslib.c ltablib.c
 
 # Our utilities.
-SRCS+= lerrno.c lstd.c lutils.c
+SRCS+= lerrno.c lpager.c lstd.c lutils.c
 
 .PATH: ${FLUASRC}/modules
 SRCS+= lfs.c

Added: head/stand/liblua/lpager.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/stand/liblua/lpager.c  Sat Dec 12 21:25:38 2020(r368591)
@@ -0,0 +1,89 @@
+/*-
+ * Copyright (c) 2020 Kyle Evans 
+ *
+ * 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 "lauxlib.h"
+
+/* Open the pager.  No arguments, no return value. */
+static int
+lpager_open(lua_State *L)
+{
+
+   pager_open();
+   return (0);
+}
+
+/*
+ * Output to the pager.  All arguments are interpreted as strings and passed to
+ * pager_output().  No return value.
+ */
+static int
+lpager_output(lua_State *L)
+{
+   const char *outstr;
+   int i;
+
+   for (i = 1; i <= lua_gettop(L); i++) {
+   outstr = luaL_tolstring(L,  i, NULL);
+   pager_output(outstr);
+   lua_pop(L, -1);
+   }
+
+   return (0);
+}
+
+/* Output to the pager from a file.  Takes a filename, no return value. */
+static int
+lpager_file(lua_State *L)
+{
+
+   return (pager_file(luaL_checkstring(L, 1)));
+}
+
+static int
+lpager_close(lua_State *L)
+{
+
+   pager_close();
+   return (0);
+}
+
+static const struct luaL_Reg pagerlib[] = {
+   { "open", lpager_open },
+   { "output", lpager_output },
+   { "file", lpager_file },
+   { "close", lpager_close },
+   { NULL, NULL },
+};
+
+int
+luaopen_pager(lua_State *L)
+{
+   luaL_newlib(L, pagerlib);
+   return 1;
+}

Modified: head/stand/liblua/lutils.h
==
--- head/stand/liblua/lutils.h  Sat Dec 12 21:02:24 2020(r368590)
+++ head/stand/liblua/lutils.h  Sat Dec 12 21:25:38 2020(r368591)
@@ -30,3 +30,4 @@
 
 intluaopen_loader(lua_State *);
 intluaopen_io(lua_State *);
+intluaopen_pager(lua_State *);

svn commit: r368590 - stable/11/usr.sbin/freebsd-update

2020-12-12 Thread Mateusz Piotrowski
Author: 0mp (doc,ports committer)
Date: Sat Dec 12 21:02:24 2020
New Revision: 368590
URL: https://svnweb.freebsd.org/changeset/base/368590

Log:
  MFC r367678:
  
  Document the PAGER environment variable
  
  Sometimes users want to use freebsd-update(8) in a non-interactive way and
  what they often miss is that they have to set PAGER to cat(1) in order to
  avoid interactive prompts from less(1).

Modified:
  stable/11/usr.sbin/freebsd-update/freebsd-update.8
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/freebsd-update/freebsd-update.8
==
--- stable/11/usr.sbin/freebsd-update/freebsd-update.8  Sat Dec 12 20:40:42 
2020(r368589)
+++ stable/11/usr.sbin/freebsd-update/freebsd-update.8  Sat Dec 12 21:02:24 
2020(r368590)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 24, 2019
+.Dd November 14, 2020
 .Dt FREEBSD-UPDATE 8
 .Os
 .Sh NAME
@@ -193,6 +193,20 @@ System", since if the system has been tampered with
 it cannot be trusted to operate correctly.
 If you intend to use this command for intrusion-detection
 purposes, make sure you boot from a secure disk (e.g., a CD).
+.El
+.Sh ENVIRONMENT
+.Bl -tag -width "PAGER"
+.It Ev PAGER
+The pager program used to present various reports during the execution.
+.Po
+Default:
+.Dq Pa /usr/bin/less .
+.Pc
+.Pp
+.Ev PAGER
+can be set to
+.Dq cat
+when a non-interactive pager is desired.
 .El
 .Sh FILES
 .Bl -tag -width "/etc/freebsd-update.conf"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368589 - stable/12/usr.sbin/freebsd-update

2020-12-12 Thread Mateusz Piotrowski
Author: 0mp (doc,ports committer)
Date: Sat Dec 12 20:40:42 2020
New Revision: 368589
URL: https://svnweb.freebsd.org/changeset/base/368589

Log:
  MFC r367678:
  
  Document the PAGER environment variable
  
  Sometimes users want to use freebsd-update(8) in a non-interactive way and
  what they often miss is that they have to set PAGER to cat(1) in order to
  avoid interactive prompts from less(1).

Modified:
  stable/12/usr.sbin/freebsd-update/freebsd-update.8
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/freebsd-update/freebsd-update.8
==
--- stable/12/usr.sbin/freebsd-update/freebsd-update.8  Sat Dec 12 20:14:39 
2020(r368588)
+++ stable/12/usr.sbin/freebsd-update/freebsd-update.8  Sat Dec 12 20:40:42 
2020(r368589)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 24, 2019
+.Dd November 14, 2020
 .Dt FREEBSD-UPDATE 8
 .Os
 .Sh NAME
@@ -193,6 +193,20 @@ System", since if the system has been tampered with
 it cannot be trusted to operate correctly.
 If you intend to use this command for intrusion-detection
 purposes, make sure you boot from a secure disk (e.g., a CD).
+.El
+.Sh ENVIRONMENT
+.Bl -tag -width "PAGER"
+.It Ev PAGER
+The pager program used to present various reports during the execution.
+.Po
+Default:
+.Dq Pa /usr/bin/less .
+.Pc
+.Pp
+.Ev PAGER
+can be set to
+.Dq cat
+when a non-interactive pager is desired.
 .El
 .Sh FILES
 .Bl -tag -width "/etc/freebsd-update.conf"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r368585 - in head: sys/dev/gpio sys/sys tools/test tools/test/gpioevents usr.sbin/gpioctl

2020-12-12 Thread Warner Losh
FWIW I generally approved the code, but didn't have the time to review it
in detail. I got the impression people were at least generally happy from
the review.

Thanks so much for picking this up.

Warner

On Sat, Dec 12, 2020, 11:34 AM Ian Lepore  wrote:

> Author: ian
> Date: Sat Dec 12 18:34:15 2020
> New Revision: 368585
> URL: https://svnweb.freebsd.org/changeset/base/368585
>
> Log:
>   Provide userland notification of gpio pin changes ("userland gpio
> interrupts").
>
>   This is an import of the Google Summer of Code 2018 project completed by
>   Christian Kramer (and, sadly, ignored by us for two years now).  The
> goals
>   stated for that project were:
>
>   FreeBSD already has support for interrupts implemented in the GPIO
>   controller drivers of several SoCs, but there are no interfaces to
> take
>   advantage of them out of user space yet. The goal of this work is to
>   implement such an interface by providing descriptors which integrate
>   with the common I/O system calls and multiplexing mechanisms.
>
>   The initial imported code supports the following functionality:
>
>-  A kernel driver that provides an interface to the user space; the
>   existing gpioc(4) driver was enhanced with this functionality.
>-  Implement support for the most common I/O system calls / multiplexing
>   mechanisms:
>-  read() Places the pin number on which the interrupt occurred in
> the
>   buffer. Blocking and non-blocking behaviour supported.
>-poll()/select()
>-kqueue()
>-signal driven I/O. Posting SIGIO when the O_ASYNC was set.
>-  Many-to-many relationship between pins and file descriptors.
>-  A file descriptor can monitor several GPIO pins.
>-  A GPIO pin can be monitored by multiple file descriptors.
>-  Integration with gpioctl and libgpio.
>
>   I added some fixes (mostly to locking) and feature enhancements on top of
>   the original gsoc code.  The feature ehancements allow the user to choose
>   between detailed and summary event reporting.  Detailed reporting
> provides
>   a record describing each pin change event.  Summary reporting provides
> the
>   time of the first and last change of each pin, and a count of how many
> times
>   it changed state since the last read(2) call.  Another enhancement allows
>   the recording of multiple state change events on multiple pins between
> each
>   call to read(2) (the original code would track only a single event at a
> time).
>
>   The phabricator review for these changes timed out without approval, but
> I
>   cite it below anyway, because the review contains a series of diffs that
>   show how I evolved the code from its original state in Christian's github
>   repo for the gsoc project to what is being commited here.  (In effect,
>   the phab review extends the VC history back to the original code.)
>
>   Submitted by: Christian Kramer
>   Obtained from:https://github.com/ckraemer/freebsd/tree/gsoc2018
>   Differential Revision:https://reviews.freebsd.org/D27398
>
> Added:
>   head/tools/test/gpioevents/
>   head/tools/test/gpioevents/Makefile   (contents, props changed)
>   head/tools/test/gpioevents/gpioevents.c   (contents, props changed)
> Modified:
>   head/sys/dev/gpio/gpiobus.c
>   head/sys/dev/gpio/gpioc.c
>   head/sys/sys/gpio.h
>   head/tools/test/README
>   head/usr.sbin/gpioctl/gpioctl.c
>
> Modified: head/sys/dev/gpio/gpiobus.c
>
> ==
> --- head/sys/dev/gpio/gpiobus.c Sat Dec 12 17:11:22 2020(r368584)
> +++ head/sys/dev/gpio/gpiobus.c Sat Dec 12 18:34:15 2020(r368585)
> @@ -143,6 +143,15 @@ gpio_check_flags(uint32_t caps, uint32_t flags)
> /* Cannot mix pull-up/pull-down together. */
> if (flags & GPIO_PIN_PULLUP && flags & GPIO_PIN_PULLDOWN)
> return (EINVAL);
> +   /* Cannot mix output and interrupt flags together */
> +   if (flags & GPIO_PIN_OUTPUT && flags & GPIO_INTR_MASK)
> +   return (EINVAL);
> +   /* Only one interrupt flag can be defined at once */
> +   if ((flags & GPIO_INTR_MASK) & ((flags & GPIO_INTR_MASK) - 1))
> +   return (EINVAL);
> +   /* The interrupt attached flag cannot be set */
> +   if (flags & GPIO_INTR_ATTACHED)
> +   return (EINVAL);
>
> return (0);
>  }
>
> Modified: head/sys/dev/gpio/gpioc.c
>
> ==
> --- head/sys/dev/gpio/gpioc.c   Sat Dec 12 17:11:22 2020(r368584)
> +++ head/sys/dev/gpio/gpioc.c   Sat Dec 12 18:34:15 2020(r368585)
> @@ -35,8 +35,15 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> +#include 
> +#include 
> +#include 
> +#include 
>  #include 
>  #include 
> +#include 
> +#include 
> +#include 
>  #include 
>
>  #include 
> @@ -47,30 +54,510 @@ 

svn commit: r368588 - head/sys/netpfil/pf

2020-12-12 Thread Kristof Provost
Author: kp
Date: Sat Dec 12 20:14:39 2020
New Revision: 368588
URL: https://svnweb.freebsd.org/changeset/base/368588

Log:
  pf: Allow net.pf.request_maxcount to be set from loader.conf
  
  Mark request_maxcount as RWTUN so we can set it both at runtime and from
  loader.conf. This avoids usings getting caught out by the change from tunable
  to run time configuration.
  
  Suggested by: Franco Fichtner
  MFC after:3 days

Modified:
  head/sys/netpfil/pf/pf.c

Modified: head/sys/netpfil/pf/pf.c
==
--- head/sys/netpfil/pf/pf.cSat Dec 12 19:43:38 2020(r368587)
+++ head/sys/netpfil/pf/pf.cSat Dec 12 20:14:39 2020(r368588)
@@ -382,7 +382,7 @@ SYSCTL_ULONG(_net_pf, OID_AUTO, states_hashsize, CTLFL
 _hashsize, 0, "Size of pf(4) states hashtable");
 SYSCTL_ULONG(_net_pf, OID_AUTO, source_nodes_hashsize, CTLFLAG_RDTUN,
 _srchashsize, 0, "Size of pf(4) source nodes hashtable");
-SYSCTL_ULONG(_net_pf, OID_AUTO, request_maxcount, CTLFLAG_RW,
+SYSCTL_ULONG(_net_pf, OID_AUTO, request_maxcount, CTLFLAG_RWTUN,
 _ioctl_maxcount, 0, "Maximum number of tables, addresses, ... in a 
single ioctl() call");
 
 VNET_DEFINE(void *, pf_swi_cookie);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368587 - head/sys/dev/amdtemp

2020-12-12 Thread Conrad Meyer
Author: cem
Date: Sat Dec 12 19:43:38 2020
New Revision: 368587
URL: https://svnweb.freebsd.org/changeset/base/368587

Log:
  amdtemp(4): Add missing Family 17h models
  
  Add missing model numbers M20h (Dali, Zen1), M60H (Renoir, Zen2), and
  M90H (Van Gogh, Zen2).
  
  Submitted by: Greg V 

Modified:
  head/sys/dev/amdtemp/amdtemp.c

Modified: head/sys/dev/amdtemp/amdtemp.c
==
--- head/sys/dev/amdtemp/amdtemp.c  Sat Dec 12 19:34:12 2020
(r368586)
+++ head/sys/dev/amdtemp/amdtemp.c  Sat Dec 12 19:43:38 2020
(r368587)
@@ -811,11 +811,12 @@ amdtemp_probe_ccd_sensors17h(device_t dev, uint32_t mo
uint32_t maxreg;
 
switch (model) {
-   case 0x00 ... 0x1f: /* Zen1, Zen+ */
+   case 0x00 ... 0x2f: /* Zen1, Zen+ */
maxreg = 4;
break;
-   case 0x30 ... 0x3f: /* Zen2 TR/EPYC */
-   case 0x70 ... 0x7f: /* Zen2 Ryzen */
+   case 0x30 ... 0x3f: /* Zen2 TR (Castle Peak)/EPYC (Rome) */
+   case 0x60 ... 0x7f: /* Zen2 Ryzen (Renoir APU, Matisse) */
+   case 0x90 ... 0x9f: /* Zen2 Ryzen (Van Gogh APU) */
maxreg = 8;
_Static_assert((int)NUM_CCDS >= 8, "");
break;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368586 - in head/sys/dev: amdsmn amdtemp

2020-12-12 Thread Conrad Meyer
Author: cem
Date: Sat Dec 12 19:34:12 2020
New Revision: 368586
URL: https://svnweb.freebsd.org/changeset/base/368586

Log:
  amdsmn(4), amdtemp(4): add support for Family 19h (Zen 3)
  
  Zen 3 "Vermeer" support, tested on Ryzen 9 5950X.
  
  Model numbers from https://en.wikichip.org/wiki/amd/cpuid "Extended
  Model" column.
  
  Submitted by: Greg V 
  Differential Revision:https://reviews.freebsd.org/D27552

Modified:
  head/sys/dev/amdsmn/amdsmn.c
  head/sys/dev/amdtemp/amdtemp.c

Modified: head/sys/dev/amdsmn/amdsmn.c
==
--- head/sys/dev/amdsmn/amdsmn.cSat Dec 12 18:34:15 2020
(r368585)
+++ head/sys/dev/amdsmn/amdsmn.cSat Dec 12 19:34:12 2020
(r368586)
@@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$");
 #definePCI_DEVICE_ID_AMD_15H_M60H_ROOT 0x1576
 #definePCI_DEVICE_ID_AMD_17H_ROOT  0x1450
 #definePCI_DEVICE_ID_AMD_17H_M10H_ROOT 0x15d0
-#definePCI_DEVICE_ID_AMD_17H_M30H_ROOT 0x1480  /* Also M70H. */
+#definePCI_DEVICE_ID_AMD_17H_M30H_ROOT 0x1480  /* Also M70H, 
F19H M00H/M20H */
 #definePCI_DEVICE_ID_AMD_17H_M60H_ROOT 0x1630
 
 struct pciid;
@@ -187,6 +187,7 @@ amdsmn_probe(device_t dev)
switch (family) {
case 0x15:
case 0x17:
+   case 0x19:
break;
default:
return (ENXIO);

Modified: head/sys/dev/amdtemp/amdtemp.c
==
--- head/sys/dev/amdtemp/amdtemp.c  Sat Dec 12 18:34:15 2020
(r368585)
+++ head/sys/dev/amdtemp/amdtemp.c  Sat Dec 12 19:34:12 2020
(r368586)
@@ -106,7 +106,7 @@ struct amdtemp_softc {
 #defineDEVICEID_AMD_MISC16_M30H0x1583
 #defineDEVICEID_AMD_HOSTB17H_ROOT  0x1450
 #defineDEVICEID_AMD_HOSTB17H_M10H_ROOT 0x15d0
-#defineDEVICEID_AMD_HOSTB17H_M30H_ROOT 0x1480  /* Also M70h. */
+#defineDEVICEID_AMD_HOSTB17H_M30H_ROOT 0x1480  /* Also M70H, F19H 
M00H/M20H */
 #defineDEVICEID_AMD_HOSTB17H_M60H_ROOT 0x1630
 
 static const struct amdtemp_product {
@@ -207,6 +207,7 @@ static int32_t  amdtemp_gettemp(device_t dev, amdsensor
 static int32_t amdtemp_gettemp15hm60h(device_t dev, amdsensor_t sensor);
 static int32_t amdtemp_gettemp17h(device_t dev, amdsensor_t sensor);
 static voidamdtemp_probe_ccd_sensors17h(device_t dev, uint32_t model);
+static voidamdtemp_probe_ccd_sensors19h(device_t dev, uint32_t model);
 static int amdtemp_sysctl(SYSCTL_HANDLER_ARGS);
 
 static device_method_t amdtemp_methods[] = {
@@ -294,6 +295,7 @@ amdtemp_probe(device_t dev)
case 0x15:
case 0x16:
case 0x17:
+   case 0x19:
break;
default:
return (ENXIO);
@@ -451,6 +453,7 @@ amdtemp_attach(device_t dev)
sc->sc_gettemp = amdtemp_gettemp;
break;
case 0x17:
+   case 0x19:
sc->sc_ntemps = 1;
sc->sc_gettemp = amdtemp_gettemp17h;
needsmn = true;
@@ -509,6 +512,8 @@ amdtemp_attach(device_t dev)
 
if (family == 0x17)
amdtemp_probe_ccd_sensors17h(dev, model);
+   else if (family == 0x19)
+   amdtemp_probe_ccd_sensors19h(dev, model);
else if (sc->sc_ntemps > 1) {
SYSCTL_ADD_PROC(sysctlctx,
SYSCTL_CHILDREN(sysctlnode),
@@ -773,28 +778,13 @@ amdtemp_gettemp17h(device_t dev, amdsensor_t sensor)
 }
 
 static void
-amdtemp_probe_ccd_sensors17h(device_t dev, uint32_t model)
+amdtemp_probe_ccd_sensors(device_t dev, uint32_t maxreg)
 {
char sensor_name[16], sensor_descr[32];
struct amdtemp_softc *sc;
-   uint32_t maxreg, i, val;
+   uint32_t i, val;
int error;
 
-   switch (model) {
-   case 0x00 ... 0x1f: /* Zen1, Zen+ */
-   maxreg = 4;
-   break;
-   case 0x30 ... 0x3f: /* Zen2 TR/Epyc */
-   case 0x70 ... 0x7f: /* Zen2 Ryzen */
-   maxreg = 8;
-   _Static_assert((int)NUM_CCDS >= 8, "");
-   break;
-   default:
-   device_printf(dev,
-   "Unrecognized Family 17h Model: %02xh\n", model);
-   return;
-   }
-
sc = device_get_softc(dev);
for (i = 0; i < maxreg; i++) {
error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CCD_TMP_BASE +
@@ -813,4 +803,47 @@ amdtemp_probe_ccd_sensors17h(device_t dev, uint32_t mo
sensor_name, CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE,
dev, CCD_BASE + i, amdtemp_sysctl, "IK", sensor_descr);
}
+}
+
+static void
+amdtemp_probe_ccd_sensors17h(device_t dev, uint32_t model)
+{
+   uint32_t maxreg;
+
+   switch (model) {
+   case 0x00 ... 0x1f: /* Zen1, Zen+ */
+   maxreg = 4;
+  

svn commit: r368585 - in head: sys/dev/gpio sys/sys tools/test tools/test/gpioevents usr.sbin/gpioctl

2020-12-12 Thread Ian Lepore
Author: ian
Date: Sat Dec 12 18:34:15 2020
New Revision: 368585
URL: https://svnweb.freebsd.org/changeset/base/368585

Log:
  Provide userland notification of gpio pin changes ("userland gpio 
interrupts").
  
  This is an import of the Google Summer of Code 2018 project completed by
  Christian Kramer (and, sadly, ignored by us for two years now).  The goals
  stated for that project were:
  
  FreeBSD already has support for interrupts implemented in the GPIO
  controller drivers of several SoCs, but there are no interfaces to take
  advantage of them out of user space yet. The goal of this work is to
  implement such an interface by providing descriptors which integrate
  with the common I/O system calls and multiplexing mechanisms.
  
  The initial imported code supports the following functionality:
  
   -  A kernel driver that provides an interface to the user space; the
  existing gpioc(4) driver was enhanced with this functionality.
   -  Implement support for the most common I/O system calls / multiplexing
  mechanisms:
   -  read() Places the pin number on which the interrupt occurred in the
  buffer. Blocking and non-blocking behaviour supported.
   -poll()/select()
   -kqueue()
   -signal driven I/O. Posting SIGIO when the O_ASYNC was set.
   -  Many-to-many relationship between pins and file descriptors.
   -  A file descriptor can monitor several GPIO pins.
   -  A GPIO pin can be monitored by multiple file descriptors.
   -  Integration with gpioctl and libgpio.
  
  I added some fixes (mostly to locking) and feature enhancements on top of
  the original gsoc code.  The feature ehancements allow the user to choose
  between detailed and summary event reporting.  Detailed reporting provides
  a record describing each pin change event.  Summary reporting provides the
  time of the first and last change of each pin, and a count of how many times
  it changed state since the last read(2) call.  Another enhancement allows
  the recording of multiple state change events on multiple pins between each
  call to read(2) (the original code would track only a single event at a time).
  
  The phabricator review for these changes timed out without approval, but I
  cite it below anyway, because the review contains a series of diffs that
  show how I evolved the code from its original state in Christian's github
  repo for the gsoc project to what is being commited here.  (In effect,
  the phab review extends the VC history back to the original code.)
  
  Submitted by: Christian Kramer
  Obtained from:https://github.com/ckraemer/freebsd/tree/gsoc2018
  Differential Revision:https://reviews.freebsd.org/D27398

Added:
  head/tools/test/gpioevents/
  head/tools/test/gpioevents/Makefile   (contents, props changed)
  head/tools/test/gpioevents/gpioevents.c   (contents, props changed)
Modified:
  head/sys/dev/gpio/gpiobus.c
  head/sys/dev/gpio/gpioc.c
  head/sys/sys/gpio.h
  head/tools/test/README
  head/usr.sbin/gpioctl/gpioctl.c

Modified: head/sys/dev/gpio/gpiobus.c
==
--- head/sys/dev/gpio/gpiobus.c Sat Dec 12 17:11:22 2020(r368584)
+++ head/sys/dev/gpio/gpiobus.c Sat Dec 12 18:34:15 2020(r368585)
@@ -143,6 +143,15 @@ gpio_check_flags(uint32_t caps, uint32_t flags)
/* Cannot mix pull-up/pull-down together. */
if (flags & GPIO_PIN_PULLUP && flags & GPIO_PIN_PULLDOWN)
return (EINVAL);
+   /* Cannot mix output and interrupt flags together */
+   if (flags & GPIO_PIN_OUTPUT && flags & GPIO_INTR_MASK)
+   return (EINVAL);
+   /* Only one interrupt flag can be defined at once */
+   if ((flags & GPIO_INTR_MASK) & ((flags & GPIO_INTR_MASK) - 1))
+   return (EINVAL);
+   /* The interrupt attached flag cannot be set */
+   if (flags & GPIO_INTR_ATTACHED)
+   return (EINVAL);
 
return (0);
 }

Modified: head/sys/dev/gpio/gpioc.c
==
--- head/sys/dev/gpio/gpioc.c   Sat Dec 12 17:11:22 2020(r368584)
+++ head/sys/dev/gpio/gpioc.c   Sat Dec 12 18:34:15 2020(r368585)
@@ -35,8 +35,15 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
+#include 
+#include 
+#include 
 #include 
 
 #include 
@@ -47,30 +54,510 @@ __FBSDID("$FreeBSD$");
 #undef GPIOC_DEBUG
 #ifdef GPIOC_DEBUG
 #define dprintf printf
+#define ddevice_printf device_printf
 #else
 #define dprintf(x, arg...)
+#define ddevice_printf(dev, x, arg...)
 #endif
 
-static int gpioc_probe(device_t dev);
-static int gpioc_attach(device_t dev);
-static int gpioc_detach(device_t dev);
+struct gpioc_softc {
+   device_tsc_dev; /* gpiocX dev */
+   device_tsc_pdev;/* 

svn commit: r368584 - stable/12/sbin/sysctl

2020-12-12 Thread John Baldwin
Author: jhb
Date: Sat Dec 12 17:11:22 2020
New Revision: 368584
URL: https://svnweb.freebsd.org/changeset/base/368584

Log:
  MFC 367188: Use a dynamic buffer for the copy of a node's new value.
  
  This permits setting a node's value to a string longer than BUFSIZ.

Modified:
  stable/12/sbin/sysctl/sysctl.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/sysctl/sysctl.c
==
--- stable/12/sbin/sysctl/sysctl.c  Sat Dec 12 17:07:33 2020
(r368583)
+++ stable/12/sbin/sysctl/sysctl.c  Sat Dec 12 17:11:22 2020
(r368584)
@@ -344,13 +344,13 @@ parse_numeric(const char *newvalstr, const char *fmt, 
 static int
 parse(const char *string, int lineno)
 {
-   int len, i, j;
+   int len, i, j, save_errno;
const void *newval;
char *newvalstr = NULL;
void *newbuf;
size_t newsize = Bflag;
int mib[CTL_MAXNAME];
-   char *cp, *bufp, buf[BUFSIZ], fmt[BUFSIZ], line[BUFSIZ];
+   char *cp, *bufp, *buf, fmt[BUFSIZ], line[BUFSIZ];
u_int kind;
 
if (lineno)
@@ -365,11 +365,7 @@ parse(const char *string, int lineno)
 * Whitespace surrounding the delimiter is trimmed.
 * Quotes around the value are stripped.
 */
-   cp = buf;
-   if (snprintf(buf, BUFSIZ, "%s", string) >= BUFSIZ) {
-   warnx("oid too long: '%s'%s", string, line);
-   return (1);
-   }
+   cp = buf = strdup(string);
bufp = strsep(, "=:");
if (cp != NULL) {
/* Tflag just lists tunables, do not allow assignment */
@@ -403,22 +399,24 @@ parse(const char *string, int lineno)
 */
len = name2oid(bufp, mib);
if (len < 0) {
-   if (iflag)
+   if (iflag) {
+   free(buf);
return (0);
-   if (qflag)
-   return (1);
-   else {
+   }
+   if (!qflag) {
if (errno == ENOENT) {
warnx("unknown oid '%s'%s", bufp, line);
} else {
warn("unknown oid '%s'%s", bufp, line);
}
-   return (1);
}
+   free(buf);
+   return (1);
}
 
if (oidfmt(mib, len, fmt, )) {
warn("couldn't find format of oid '%s'%s", bufp, line);
+   free(buf);
if (iflag)
return (1);
else
@@ -430,6 +428,7 @@ parse(const char *string, int lineno)
 * show the node and its children.  Otherwise, set the new value.
 */
if (newvalstr == NULL || dflag) {
+   free(buf);
if ((kind & CTLTYPE) == CTLTYPE_NODE) {
if (dflag) {
i = show_var(mib, len, false);
@@ -450,6 +449,7 @@ parse(const char *string, int lineno)
 */
if ((kind & CTLTYPE) == CTLTYPE_NODE) {
warnx("oid '%s' isn't a leaf node%s", bufp, line);
+   free(buf);
return (1);
}
 
@@ -459,6 +459,7 @@ parse(const char *string, int lineno)
warnx("Tunable values are set in /boot/loader.conf");
} else
warnx("oid '%s' is read only%s", bufp, line);
+   free(buf);
return (1);
}
 
@@ -477,6 +478,7 @@ parse(const char *string, int lineno)
case CTLTYPE_U64:
if (strlen(newvalstr) == 0) {
warnx("empty numeric value");
+   free(buf);
return (1);
}
/* FALLTHROUGH */
@@ -485,6 +487,7 @@ parse(const char *string, int lineno)
default:
warnx("oid '%s' is type %d, cannot set that%s",
bufp, kind & CTLTYPE, line);
+   free(buf);
return (1);
}
 
@@ -503,6 +506,7 @@ parse(const char *string, int lineno)
warnx("invalid %s '%s'%s",
ctl_typename[kind & CTLTYPE], cp, line);
free(newbuf);
+   free(buf);
return (1);
}
}
@@ -515,10 +519,12 @@ parse(const char *string, int lineno)
 */
i = show_var(mib, len, false);
if (sysctl(mib, len, 0, 0, newval, newsize) == -1) {
+   save_errno = errno;
free(newbuf);
+   free(buf);
if (!i && !bflag)
putchar('\n');
-   switch (errno) {
+   switch (save_errno) {
case EOPNOTSUPP:
warnx("%s: value is not 

svn commit: r368583 - stable/12/sys/dev/cxgbe/tom

2020-12-12 Thread John Baldwin
Author: jhb
Date: Sat Dec 12 17:07:33 2020
New Revision: 368583
URL: https://svnweb.freebsd.org/changeset/base/368583

Log:
  MFC 367578: Clear tp->tod in t4_pcb_detach().
  
  Otherwise, a socket can have a non-NULL tp->tod while TF_TOE is clear.
  In particular, if a newly accepted socket falls back to non-TOE due to
  an active open failure, the non-TOE socket will still have tp->tod set
  even though TF_TOE is clear.

Modified:
  stable/12/sys/dev/cxgbe/tom/t4_tom.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/tom/t4_tom.c
==
--- stable/12/sys/dev/cxgbe/tom/t4_tom.cSat Dec 12 17:04:54 2020
(r368582)
+++ stable/12/sys/dev/cxgbe/tom/t4_tom.cSat Dec 12 17:07:33 2020
(r368583)
@@ -381,6 +381,7 @@ t4_pcb_detach(struct toedev *tod __unused, struct tcpc
}
 #endif
 
+   tp->tod = NULL;
tp->t_toe = NULL;
tp->t_flags &= ~TF_TOE;
toep->flags &= ~TPF_ATTACHED;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368582 - stable/12/sys/dev/cxgbe/tom

2020-12-12 Thread John Baldwin
Author: jhb
Date: Sat Dec 12 17:04:54 2020
New Revision: 368582
URL: https://svnweb.freebsd.org/changeset/base/368582

Log:
  MFC 366955: Handle CPL_RX_DATA on active TLS sockets.
  
  In certain edge cases, the NIC might have only received a partial TLS
  record which it needs to return to the driver.  For example, if the
  local socket was closed while data was still in flight, a partial TLS
  record might be pending when the connection is closed.  Receiving a
  RST in the middle of a TLS record is another example.  When this
  happens, the firmware returns the the partial TLS record as plain TCP
  data via CPL_RX_DATA.  Handle these requests by returning an error to
  OpenSSL (via so_error for KTLS or via an error TLS record header for
  the older Chelsio OpenSSL interface).

Modified:
  stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c
  stable/12/sys/dev/cxgbe/tom/t4_tls.c
  stable/12/sys/dev/cxgbe/tom/t4_tom.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c
==
--- stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Dec 12 16:55:23 2020
(r368581)
+++ stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Dec 12 17:04:54 2020
(r368582)
@@ -1550,6 +1550,15 @@ do_rx_data(struct sge_iq *iq, const struct rss_header 
 
tp = intotcpcb(inp);
 
+   if (__predict_false(ulp_mode(toep) == ULP_MODE_TLS &&
+  toep->flags & TPF_TLS_RECEIVE)) {
+   /* Received "raw" data on a TLS socket. */
+   CTR3(KTR_CXGBE, "%s: tid %u, raw TLS data (%d bytes)",
+   __func__, tid, len);
+   do_rx_data_tls(cpl, toep, m);
+   return (0);
+   }
+
if (__predict_false(tp->rcv_nxt != be32toh(cpl->seq)))
ddp_placed = be32toh(cpl->seq) - tp->rcv_nxt;
 

Modified: stable/12/sys/dev/cxgbe/tom/t4_tls.c
==
--- stable/12/sys/dev/cxgbe/tom/t4_tls.cSat Dec 12 16:55:23 2020
(r368581)
+++ stable/12/sys/dev/cxgbe/tom/t4_tls.cSat Dec 12 17:04:54 2020
(r368582)
@@ -691,6 +691,8 @@ program_key_context(struct tcpcb *tp, struct toepcb *t
 V_TCB_TLS_SEQ(M_TCB_TLS_SEQ),
 V_TCB_TLS_SEQ(0));
t4_clear_rx_quiesce(toep);
+
+   toep->flags |= TPF_TLS_RECEIVE;
} else {
unsigned short pdus_per_ulp;
 
@@ -1597,6 +1599,135 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_head
INP_WUNLOCK(inp);
CURVNET_RESTORE();
return (0);
+}
+
+void
+do_rx_data_tls(const struct cpl_rx_data *cpl, struct toepcb *toep,
+struct mbuf *m)
+{
+   struct inpcb *inp = toep->inp;
+   struct tls_ofld_info *tls_ofld = >tls;
+   struct tls_hdr *hdr;
+   struct tcpcb *tp;
+   struct socket *so;
+   struct sockbuf *sb;
+   int error, len, rx_credits;
+
+   len = m->m_pkthdr.len;
+
+   INP_WLOCK_ASSERT(inp);
+
+   so = inp_inpcbtosocket(inp);
+   tp = intotcpcb(inp);
+   sb = >so_rcv;
+   SOCKBUF_LOCK(sb);
+   CURVNET_SET(toep->vnet);
+
+   tp->rcv_nxt += len;
+   KASSERT(tp->rcv_wnd >= len, ("%s: negative window size", __func__));
+   tp->rcv_wnd -= len;
+
+   /* Do we have a full TLS header? */
+   if (len < sizeof(*hdr)) {
+   CTR3(KTR_CXGBE, "%s: tid %u len %d: too short for a TLS header",
+   __func__, toep->tid, len);
+   so->so_error = EMSGSIZE;
+   goto out;
+   }
+   hdr = mtod(m, struct tls_hdr *);
+
+   /* Is the header valid? */
+   if (be16toh(hdr->version) != tls_ofld->k_ctx.proto_ver) {
+   CTR3(KTR_CXGBE, "%s: tid %u invalid version %04x",
+   __func__, toep->tid, be16toh(hdr->version));
+   error = EINVAL;
+   goto report_error;
+   }
+   if (be16toh(hdr->length) < sizeof(*hdr)) {
+   CTR3(KTR_CXGBE, "%s: tid %u invalid length %u",
+   __func__, toep->tid, be16toh(hdr->length));
+   error = EBADMSG;
+   goto report_error;
+   }
+
+   /* Did we get a truncated record? */
+   if (len < be16toh(hdr->length)) {
+   CTR4(KTR_CXGBE, "%s: tid %u truncated TLS record (%d vs %u)",
+   __func__, toep->tid, len, be16toh(hdr->length));
+
+   error = EMSGSIZE;
+   goto report_error;
+   }
+
+   /* Is the header type unknown? */
+   switch (hdr->type) {
+   case CONTENT_TYPE_CCS:
+   case CONTENT_TYPE_ALERT:
+   case CONTENT_TYPE_APP_DATA:
+   case CONTENT_TYPE_HANDSHAKE:
+   break;
+   default:
+   CTR3(KTR_CXGBE, "%s: tid %u invalid TLS record type %u",
+   __func__, toep->tid, hdr->type);
+   error = 

svn commit: r368581 - stable/12/sys/dev/cxgbe/tom

2020-12-12 Thread John Baldwin
Author: jhb
Date: Sat Dec 12 16:55:23 2020
New Revision: 368581
URL: https://svnweb.freebsd.org/changeset/base/368581

Log:
  MFC 366854: Re-enable receive flow control for TOE TLS sockets.
  
  Flow control was disabled during initial TOE TLS development to
  workaround a hang (and to match the Linux TOE TLS support for T6).
  The rest of the TOE TLS code maintained credits as if flow control was
  enabled which was inherited from before the workaround was added with
  the exception that the receive window was allowed to go negative.
  This negative receive window handling (rcv_over) was because I hadn't
  realized the full implications of disabling flow control.
  
  To clean this up, re-enable flow control on TOE TLS sockets.  The
  existing TPF_FORCE_CREDITS workaround is sufficient for the original
  hang.  Now that flow control is enabled, remove the rcv_over
  workaround and instead assert that the receive window never goes
  negative matching plain TCP TOE sockets.

Modified:
  stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c
  stable/12/sys/dev/cxgbe/tom/t4_tls.c
  stable/12/sys/dev/cxgbe/tom/t4_tls.h
  stable/12/sys/dev/cxgbe/tom/t4_tom.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c
==
--- stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Dec 12 15:38:32 2020
(r368580)
+++ stable/12/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Dec 12 16:55:23 2020
(r368581)
@@ -467,16 +467,6 @@ t4_rcvd_locked(struct toedev *tod, struct tcpcb *tp)
SOCKBUF_LOCK_ASSERT(sb);
 
rx_credits = sbspace(sb) > tp->rcv_wnd ? sbspace(sb) - tp->rcv_wnd : 0;
-   if (ulp_mode(toep) == ULP_MODE_TLS) {
-   if (toep->tls.rcv_over >= rx_credits) {
-   toep->tls.rcv_over -= rx_credits;
-   rx_credits = 0;
-   } else {
-   rx_credits -= toep->tls.rcv_over;
-   toep->tls.rcv_over = 0;
-   }
-   }
-
if (rx_credits > 0 &&
(tp->rcv_wnd <= 32 * 1024 || rx_credits >= 64 * 1024 ||
(rx_credits >= 16 * 1024 && tp->rcv_wnd <= 128 * 1024) ||

Modified: stable/12/sys/dev/cxgbe/tom/t4_tls.c
==
--- stable/12/sys/dev/cxgbe/tom/t4_tls.cSat Dec 12 15:38:32 2020
(r368580)
+++ stable/12/sys/dev/cxgbe/tom/t4_tls.cSat Dec 12 16:55:23 2020
(r368581)
@@ -1491,11 +1491,9 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_head
 #endif
 
tp->rcv_nxt += pdu_length;
-   if (tp->rcv_wnd < pdu_length) {
-   toep->tls.rcv_over += pdu_length - tp->rcv_wnd;
-   tp->rcv_wnd = 0;
-   } else
-   tp->rcv_wnd -= pdu_length;
+   KASSERT(tp->rcv_wnd >= pdu_length,
+   ("%s: negative window size", __func__));
+   tp->rcv_wnd -= pdu_length;
 
/* XXX: Not sure what to do about urgent data. */
 

Modified: stable/12/sys/dev/cxgbe/tom/t4_tls.h
==
--- stable/12/sys/dev/cxgbe/tom/t4_tls.hSat Dec 12 15:38:32 2020
(r368580)
+++ stable/12/sys/dev/cxgbe/tom/t4_tls.hSat Dec 12 16:55:23 2020
(r368581)
@@ -268,7 +268,6 @@ struct tls_ofld_info {
struct tls_scmd scmd0;
u_int sb_off;
struct callout handshake_timer;
-   u_int rcv_over;
 };
 
 struct tls_key_req {

Modified: stable/12/sys/dev/cxgbe/tom/t4_tom.c
==
--- stable/12/sys/dev/cxgbe/tom/t4_tom.cSat Dec 12 15:38:32 2020
(r368580)
+++ stable/12/sys/dev/cxgbe/tom/t4_tom.cSat Dec 12 16:55:23 2020
(r368581)
@@ -1021,8 +1021,6 @@ calc_options2(struct vi_info *vi, struct conn_params *
if (cp->ulp_mode == ULP_MODE_TCPDDP)
opt2 |= F_RX_FC_DDP;
 #endif
-   if (cp->ulp_mode == ULP_MODE_TLS)
-   opt2 |= F_RX_FC_DISABLE;
 
return (htobe32(opt2));
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368580 - head/usr.bin/xargs

2020-12-12 Thread Yuri Pankov
Author: yuripv
Date: Sat Dec 12 15:38:32 2020
New Revision: 368580
URL: https://svnweb.freebsd.org/changeset/base/368580

Log:
  xargs: compile yesexpr as ERE
  
  yesexpr is an extended regular expression for quite some time now,
  use appropriate flag when compiling it.
  
  PR:   238762
  Reviewed by:  kevans
  Differential Revision:https://reviews.freebsd.org/D27509

Modified:
  head/usr.bin/xargs/xargs.c

Modified: head/usr.bin/xargs/xargs.c
==
--- head/usr.bin/xargs/xargs.c  Sat Dec 12 14:53:34 2020(r368579)
+++ head/usr.bin/xargs/xargs.c  Sat Dec 12 15:38:32 2020(r368580)
@@ -782,7 +782,7 @@ prompt(void)
(void)fprintf(stderr, "?...");
(void)fflush(stderr);
if ((response = fgetln(ttyfp, )) == NULL ||
-   regcomp(, nl_langinfo(YESEXPR), REG_BASIC) != 0) {
+   regcomp(, nl_langinfo(YESEXPR), REG_EXTENDED) != 0) {
(void)fclose(ttyfp);
return (0);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368579 - head/stand/lua

2020-12-12 Thread Kyle Evans
Author: kevans
Date: Sat Dec 12 14:53:34 2020
New Revision: 368579
URL: https://svnweb.freebsd.org/changeset/base/368579

Log:
  lualoader: config: fix module enabled check
  
  A last minute rewrite left this logically wrong; if it's present in
  modules_blacklist, then we do not load it.

Modified:
  head/stand/lua/config.lua

Modified: head/stand/lua/config.lua
==
--- head/stand/lua/config.lua   Sat Dec 12 11:51:29 2020(r368578)
+++ head/stand/lua/config.lua   Sat Dec 12 14:53:34 2020(r368579)
@@ -718,7 +718,7 @@ function config.isModuleEnabled(modname)
end
 
local blacklist = getBlacklist()
-   return blacklist[modname]
+   return not blacklist[modname]
 end
 
 hook.registerType("config.loaded")
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r368575 - head/stand/lua

2020-12-12 Thread Kyle Evans
On Sat, Dec 12, 2020 at 8:17 AM Toomas Soome  wrote:
> > On 12. Dec 2020, at 16:10, Kyle Evans  wrote:
> >
> > On Sat, Dec 12, 2020 at 1:35 AM Toomas Soome  wrote:
> >>
> >> How about ’show-module-options’?
> >>
> >> rgds,
> >> toomas
> >>
> >
> > I missed that one. My 4th is a bit rusty, but it looks like this
> > should just be enumerating over config's local modules table and
> > dumping everything in sight?
> >
>
> Yes, with pager or it is a bit useless.
>

Hmm... we don't currently expose the pager routines to lua, so I'll
write a quick pager module to do so. I'll write the lua-side to use
the pager if it's available but fallback to dumping it all out
otherwise (which, thinking about the modules I typically have
installed and looking at a test-run of 4thloader's show-module-options
on an even more minimal system, 100% agree).
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r368575 - head/stand/lua

2020-12-12 Thread Toomas Soome via svn-src-all
Yes, with pager or it is a bit useless.

Sent from my iPhone

> On 12. Dec 2020, at 16:10, Kyle Evans  wrote:
> 
> On Sat, Dec 12, 2020 at 1:35 AM Toomas Soome  wrote:
>> 
>> How about ’show-module-options’?
>> 
>> rgds,
>> toomas
>> 
> 
> I missed that one. My 4th is a bit rusty, but it looks like this
> should just be enumerating over config's local modules table and
> dumping everything in sight?
> 
> Thanks,
> 
> Kyle Evans
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r368575 - head/stand/lua

2020-12-12 Thread Kyle Evans
On Sat, Dec 12, 2020 at 1:35 AM Toomas Soome  wrote:
>
> How about ’show-module-options’?
>
> rgds,
> toomas
>

I missed that one. My 4th is a bit rusty, but it looks like this
should just be enumerating over config's local modules table and
dumping everything in sight?

Thanks,

Kyle Evans
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368578 - head/usr.bin/calendar

2020-12-12 Thread Stefan Eßer
Author: se
Date: Sat Dec 12 11:51:29 2020
New Revision: 368578
URL: https://svnweb.freebsd.org/changeset/base/368578

Log:
  Use getlocalbase() instead of compiled in LOCALBASE to locate calendars

Modified:
  head/usr.bin/calendar/io.c
  head/usr.bin/calendar/pathnames.h

Modified: head/usr.bin/calendar/io.c
==
--- head/usr.bin/calendar/io.c  Sat Dec 12 11:23:52 2020(r368577)
+++ head/usr.bin/calendar/io.c  Sat Dec 12 11:51:29 2020(r368578)
@@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -121,6 +122,7 @@ cal_fopen(const char *file)
unsigned int i;
struct stat sb;
static bool warned = false;
+   char calendarhome[MAXPATHLEN];
 
if (home == NULL || *home == '\0') {
warnx("Cannot get home directory");
@@ -133,12 +135,16 @@ cal_fopen(const char *file)
}
 
for (i = 0; i < nitems(calendarHomes); i++) {
-   if (chdir(calendarHomes[i]) != 0)
+   if (snprintf(calendarhome, sizeof (calendarhome), 
calendarHomes[i],
+   getlocalbase()) >= (int)sizeof (calendarhome))
continue;
 
+   if (chdir(calendarhome) != 0)
+   continue;
+
if ((fp = fopen(file, "r")) != NULL) {
cal_home = home;
-   cal_dir = calendarHomes[i];
+   cal_dir = calendarhome;
cal_file = file;
return (fp);
}

Modified: head/usr.bin/calendar/pathnames.h
==
--- head/usr.bin/calendar/pathnames.h   Sat Dec 12 11:23:52 2020
(r368577)
+++ head/usr.bin/calendar/pathnames.h   Sat Dec 12 11:51:29 2020
(r368578)
@@ -35,4 +35,4 @@
 #include 
 
 #define_PATH_INCLUDE   "/usr/share/calendar"
-#define_PATH_INCLUDE_LOCAL _PATH_LOCALBASE "/share/calendar"
+#define_PATH_INCLUDE_LOCAL "%s/share/calendar"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368577 - head/lib/libutil

2020-12-12 Thread Stefan Eßer
Author: se
Date: Sat Dec 12 11:23:52 2020
New Revision: 368577
URL: https://svnweb.freebsd.org/changeset/base/368577

Log:
  Change getlocalbase() to not allocate any heap memory
  
  After the commit of the current version, Scott Long pointed out, that an
  attacker might be able to cause a use-after-free access if this function
  returned the value of the sysctl variable "user.localbase" by freeing
  the allocated memory without the cached address being cleared in the
  library function.
  
  To resolve this issue, I have proposed the originally suggested version
  with a statically allocated buffer in a review (D27370). There was no
  feedback on this review and after waiting for more than 2 weeks, the
  potential security issue is fixed by this commit. (There was no security
  risk in practice, since none of the programs converted to use this
  function attempted to free the buffer. The address could only have
  pointed into the heap if user.localbase was set to a non-default value,
  into r/o data or the environment, else.)
  
  This version uses a static buffer of size LOCALBASE_CTL_LEN, which
  defaults to MAXPATHLEN. This does not increase the memory footprint
  of the library at this time, since its data segment grows from less
  than 7 KB to less than 8 KB, i.e. it will get two 4 KB pages on typical
  architectures, anyway.
  
  Compiling with LOCALBASE_CTL_LEN defined as 0 will remove the code
  that accesses the sysctl variable, values between 1 and MAXPATHLEN-1
  will limit the maximum size of the prefix. When built with such a
  value and if too large a value has been configured in user.localbase,
  the value defined as ILLEGAL_PREFIX will be returned to cause any
  file operations on that result to fail. (Default value is "/dev/null/",
  the review contained "/\177", but I assume that "/dev/null" exists and
  can not be accessed as a directory. Any other string that can be assumed
  not be a valid path prefix could be used.)
  
  I do suggest to use LOCALBASE_CTL_LEN to size the in-kernel buffer for
  the user.localbase variable, too. Doing this would guarantee that the
  result always fit into the buffer in this library function (unless run
  on a kernel built with a different buffer size.)
  
  The function always returns a valid string, and only in case it is built
  with a small static buffer and run on a system with too large a value in
  user.localbase, the ILLEGAL_PREFIX will be returned, effectively causing
  the created path to be non-existent.
  
  Differential Revision:https://reviews.freebsd.org/D27370

Modified:
  head/lib/libutil/getlocalbase.3
  head/lib/libutil/getlocalbase.c

Modified: head/lib/libutil/getlocalbase.3
==
--- head/lib/libutil/getlocalbase.3 Sat Dec 12 07:22:38 2020
(r368576)
+++ head/lib/libutil/getlocalbase.3 Sat Dec 12 11:23:52 2020
(r368577)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 18, 2020
+.Dd November 25, 2020
 .Dt GETLOCALBASE 3
 .Os
 .Sh NAME
@@ -59,7 +59,7 @@ If that is undefined then the default of
 .Pa /usr/local
 is used.
 .Pp
-The value returned by the
+The contents of the string returned by the
 .Fn getlocalbase
 function shall not be modified.
 .Sh IMPLEMENTATION NOTES
@@ -67,13 +67,34 @@ Calls to
 .Fn getlocalbase
 will perform a setugid check on the running binary before checking the
 environment.
+.Pp
+The address returned by
+.Fn getlocalbase
+will point into the executing processes environment if it is the result of
+.Fn getenv "LOCALBASE" ,
+to a static buffer if it is the result of
+.Fn sysctl "user.localbase" ,
+and to a constant string if the compiled in default value is returned.
+.Pp
+The same value will be returned on successive calls during the run-time
+of the program, ignoring any changes to the environment variable or the
+sysctl value that might have been made.
+.Pp
+The
+.Fn getlocalbase
+function can be compiled with a non-default value of LOCALBASE_CTL_LEN.
+A value of 0 will disable fetching of the sysctl value, a value less than
+MAXPATHLEN will put a limit on the maximum string length supported for
+this sysctl value.
+If built with a non-default value of LOCALBASE_CTL_LEN, a value of the
+user.localbase sysctl variable longer than this value will make
+.Fn getlocalbase
+return a valid string that is not a valid path prefix in any filesystem.
 .Sh RETURN VALUES
 The
 .Fn getlocalbase
-function always succeeds and returns a pointer to a string, whose length
-may exceed MAXPATHLEN if it has been derived from the environment variable
-LOCALBASE.
-No length checks are performed on the result.
+function returns a pointer to a string, whose length may exceed MAXPATHLEN,
+if it has been obtained from the environment.
 .Sh ENVIRONMENT
 The
 .Fn getlocalbase
@@ -83,7 +104,7 @@ environment variable.
 .Sh ERRORS
 The
 .Fn getlocalbase
-function always succeeds.
+function always succeeds and returns a valid 

Re: svn commit: r368571 - head/sys/netpfil/ipfw

2020-12-12 Thread Mateusz Guzik
This breaks LINT-NOINET6:

linking kernel
ld: error: undefined symbol: fib6_lookup_rt
>>> referenced by ip_fw_table_algo.c
>>>   ip_fw_table_algo.o:(ta_find_kfib_tentry)
>>> did you mean: fib4_lookup_rt


On 12/12/20, Alexander V. Chernikov  wrote:
> Author: melifaro
> Date: Fri Dec 11 23:57:30 2020
> New Revision: 368571
> URL: https://svnweb.freebsd.org/changeset/base/368571
>
> Log:
>   ipfw kfib algo: Use rt accessors instead of accessing rib/rtentry
> directly.
>
>   This removes assumptions on prefix storage and rtentry layout
>from an external code.
>
>   Differential Revision:  https://reviews.freebsd.org/D27450
>
> Modified:
>   head/sys/netpfil/ipfw/ip_fw_table_algo.c
>
> Modified: head/sys/netpfil/ipfw/ip_fw_table_algo.c
> ==
> --- head/sys/netpfil/ipfw/ip_fw_table_algo.c  Fri Dec 11 22:52:20
> 2020  (r368570)
> +++ head/sys/netpfil/ipfw/ip_fw_table_algo.c  Fri Dec 11 23:57:30
> 2020  (r368571)
> @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> -#include 
> +#include 
>
>  #include 
>  #include 
> @@ -3781,11 +3781,10 @@ static int ta_init_kfib(struct ip_fw_chain *ch, void
> *
>  static void ta_destroy_kfib(void *ta_state, struct table_info *ti);
>  static void ta_dump_kfib_tinfo(void *ta_state, struct table_info *ti,
>  ipfw_ta_tinfo *tinfo);
> -static int contigmask(uint8_t *p, int len);
>  static int ta_dump_kfib_tentry(void *ta_state, struct table_info *ti, void
> *e,
>  ipfw_obj_tentry *tent);
> -static int ta_dump_kfib_tentry_int(struct sockaddr *paddr,
> -struct sockaddr *pmask, ipfw_obj_tentry *tent);
> +static int ta_dump_kfib_tentry_int(int familt, const struct rtentry *rt,
> +ipfw_obj_tentry *tent);
>  static int ta_find_kfib_tentry(void *ta_state, struct table_info *ti,
>  ipfw_obj_tentry *tent);
>  static void ta_foreach_kfib(void *ta_state, struct table_info *ti,
> @@ -3900,84 +3899,35 @@ ta_dump_kfib_tinfo(void *ta_state, struct table_info
> *
>   tinfo->flags = IPFW_TATFLAGS_AFDATA;
>   tinfo->taclass4 = IPFW_TACLASS_RADIX;
>   tinfo->count4 = 0;
> - tinfo->itemsize4 = sizeof(struct rtentry);
> + tinfo->itemsize4 = 128; /* table is readonly, value does not matter */
>   tinfo->taclass6 = IPFW_TACLASS_RADIX;
>   tinfo->count6 = 0;
> - tinfo->itemsize6 = sizeof(struct rtentry);
> + tinfo->itemsize6 = 128;
>  }
>
>  static int
> -contigmask(uint8_t *p, int len)
> -{
> - int i, n;
> -
> - for (i = 0; i < len ; i++)
> - if ( (p[i/8] & (1 << (7 - (i%8 == 0) /* first bit unset */
> - break;
> - for (n= i + 1; n < len; n++)
> - if ( (p[n/8] & (1 << (7 - (n % 8 != 0)
> - return (-1); /* mask not contiguous */
> - return (i);
> -}
> -
> -static int
> -ta_dump_kfib_tentry(void *ta_state, struct table_info *ti, void *e,
> +ta_dump_kfib_tentry_int(int family, const struct rtentry *rt,
>  ipfw_obj_tentry *tent)
>  {
> - struct rtentry *rte;
> + uint32_t scopeid;
> + int plen;
>
> - rte = (struct rtentry *)e;
> -
> - return ta_dump_kfib_tentry_int(rt_key(rte), rt_mask(rte), tent);
> -}
> -
> -static int
> -ta_dump_kfib_tentry_int(struct sockaddr *paddr, struct sockaddr *pmask,
> -ipfw_obj_tentry *tent)
> -{
>  #ifdef INET
> - struct sockaddr_in *addr, *mask;
> -#endif
> -#ifdef INET6
> - struct sockaddr_in6 *addr6, *mask6;
> -#endif
> - int len;
> -
> - len = 0;
> -
> - /* Guess IPv4/IPv6 radix by sockaddr family */
> -#ifdef INET
> - if (paddr->sa_family == AF_INET) {
> - addr = (struct sockaddr_in *)paddr;
> - mask = (struct sockaddr_in *)pmask;
> - tent->k.addr.s_addr = addr->sin_addr.s_addr;
> - len = 32;
> - if (mask != NULL)
> - len = contigmask((uint8_t *)>sin_addr, 32);
> - if (len == -1)
> - len = 0;
> - tent->masklen = len;
> + if (family == AF_INET) {
> + rt_get_inet_prefix_plen(rt, >k.addr, , );
> + tent->masklen = plen;
>   tent->subtype = AF_INET;
> - tent->v.kidx = 0; /* Do we need to put GW here? */
> + tent->v.kidx = 0;
>   }
>  #endif
> -#ifdef INET6
> - if (paddr->sa_family == AF_INET6) {
> - addr6 = (struct sockaddr_in6 *)paddr;
> - mask6 = (struct sockaddr_in6 *)pmask;
> - memcpy(>k.addr6, >sin6_addr,
> - sizeof(struct in6_addr));
> - len = 128;
> - if (mask6 != NULL)
> - len = contigmask((uint8_t *)>sin6_addr, 128);
> - if (len == -1)
> - len = 0;
> - tent->masklen = len;
> +#ifdef INET
> + if (family == AF_INET6) {
> + rt_get_inet6_prefix_plen(rt, >k.addr6, , );
> + tent->masklen = plen;
>