svn commit: r362607 - stable/11/libexec/rtld-elf

2020-06-24 Thread Konstantin Belousov
Author: kib
Date: Thu Jun 25 05:44:06 2020
New Revision: 362607
URL: https://svnweb.freebsd.org/changeset/base/362607

Log:
  MFC r362346:
  rtld: Parse own phdr and notes.

Modified:
  stable/11/libexec/rtld-elf/rtld.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/libexec/rtld-elf/rtld.c
==
--- stable/11/libexec/rtld-elf/rtld.c   Thu Jun 25 05:35:46 2020
(r362606)
+++ stable/11/libexec/rtld-elf/rtld.c   Thu Jun 25 05:44:06 2020
(r362607)
@@ -2111,6 +2111,34 @@ process_z(Obj_Entry *root)
}
}
 }
+
+static void
+parse_rtld_phdr(Obj_Entry *obj)
+{
+   const Elf_Phdr *ph;
+   Elf_Addr note_start, note_end;
+
+   obj->stack_flags = PF_X | PF_R | PF_W;
+   for (ph = obj->phdr;  (const char *)ph < (const char *)obj->phdr +
+   obj->phsize; ph++) {
+   switch (ph->p_type) {
+   case PT_GNU_STACK:
+   obj->stack_flags = ph->p_flags;
+   break;
+   case PT_GNU_RELRO:
+   obj->relro_page = obj->relocbase +
+   trunc_page(ph->p_vaddr);
+   obj->relro_size = round_page(ph->p_memsz);
+   break;
+   case PT_NOTE:
+   note_start = (Elf_Addr)obj->relocbase + ph->p_vaddr;
+   note_end = note_start + ph->p_filesz;
+   digest_notes(obj, note_start, note_end);
+   break;
+   }
+   }
+}
+
 /*
  * Initialize the dynamic linker.  The argument is the address at which
  * the dynamic linker has been mapped into memory.  The primary task of
@@ -2179,6 +2207,8 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo **aux_info)
 
 /* Replace the path with a dynamically allocated copy. */
 obj_rtld.path = xstrdup(ld_path_rtld);
+
+parse_rtld_phdr(_rtld);
 
 r_debug.r_brk = r_debug_state;
 r_debug.r_state = RT_CONSISTENT;
___
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: r362606 - stable/11/sys/compat/linux

2020-06-24 Thread Konstantin Belousov
Author: kib
Date: Thu Jun 25 05:35:46 2020
New Revision: 362606
URL: https://svnweb.freebsd.org/changeset/base/362606

Log:
  MFC r362342:
  Fix execution of linux binary from multithreaded non-Linux process.

Modified:
  stable/11/sys/compat/linux/linux_emul.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linux/linux_emul.c
==
--- stable/11/sys/compat/linux/linux_emul.c Thu Jun 25 05:24:35 2020
(r362605)
+++ stable/11/sys/compat/linux/linux_emul.c Thu Jun 25 05:35:46 2020
(r362606)
@@ -261,22 +261,13 @@ linux_common_execve(struct thread *td, struct image_ar
 void
 linux_proc_exec(void *arg __unused, struct proc *p, struct image_params *imgp)
 {
-   struct thread *td = curthread;
+   struct thread *td;
struct thread *othertd;
 #if defined(__amd64__)
struct linux_pemuldata *pem;
 #endif
 
-   /*
-* In a case of execing from Linux binary properly detach
-* other threads from the user space.
-*/
-   if (__predict_false(SV_PROC_ABI(p) == SV_ABI_LINUX)) {
-   FOREACH_THREAD_IN_PROC(p, othertd) {
-   if (td != othertd)
-   (p->p_sysent->sv_thread_detach)(othertd);
-   }
-   }
+   td = curthread;
 
/*
 * In a case of execing to Linux binary we create Linux
@@ -284,11 +275,32 @@ linux_proc_exec(void *arg __unused, struct proc *p, st
 */
if (__predict_false((imgp->sysent->sv_flags & SV_ABI_MASK) ==
SV_ABI_LINUX)) {
-
-   if (SV_PROC_ABI(p) == SV_ABI_LINUX)
+   if (SV_PROC_ABI(p) == SV_ABI_LINUX) {
+   /*
+* Process already was under Linuxolator
+* before exec.  Update emuldata to reflect
+* single-threaded cleaned state after exec.
+*/
linux_proc_init(td, NULL, 0);
-   else
+   } else {
+   /*
+* We are switching the process to Linux emulator.
+*/
linux_proc_init(td, td, 0);
+
+   /*
+* Create a transient td_emuldata for all suspended
+* threads, so that p->p_sysent->sv_thread_detach() ==
+* linux_thread_detach() can find expected but unused
+* emuldata.
+*/
+   FOREACH_THREAD_IN_PROC(td->td_proc, othertd) {
+   if (othertd != td) {
+   linux_proc_init(td, othertd,
+   LINUX_CLONE_THREAD);
+   }
+   }
+   }
 #if defined(__amd64__)
/*
 * An IA32 executable which has executable stack will have the
___
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: r362605 - stable/12/sys/compat/linux

2020-06-24 Thread Konstantin Belousov
Author: kib
Date: Thu Jun 25 05:24:35 2020
New Revision: 362605
URL: https://svnweb.freebsd.org/changeset/base/362605

Log:
  MFC r362342:
  Fix execution of linux binary from multithreaded non-Linux process.

Modified:
  stable/12/sys/compat/linux/linux_emul.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linux/linux_emul.c
==
--- stable/12/sys/compat/linux/linux_emul.c Thu Jun 25 05:20:00 2020
(r362604)
+++ stable/12/sys/compat/linux/linux_emul.c Thu Jun 25 05:24:35 2020
(r362605)
@@ -261,22 +261,13 @@ linux_common_execve(struct thread *td, struct image_ar
 void
 linux_proc_exec(void *arg __unused, struct proc *p, struct image_params *imgp)
 {
-   struct thread *td = curthread;
+   struct thread *td;
struct thread *othertd;
 #if defined(__amd64__)
struct linux_pemuldata *pem;
 #endif
 
-   /*
-* In a case of execing from Linux binary properly detach
-* other threads from the user space.
-*/
-   if (__predict_false(SV_PROC_ABI(p) == SV_ABI_LINUX)) {
-   FOREACH_THREAD_IN_PROC(p, othertd) {
-   if (td != othertd)
-   (p->p_sysent->sv_thread_detach)(othertd);
-   }
-   }
+   td = curthread;
 
/*
 * In a case of execing to Linux binary we create Linux
@@ -284,11 +275,32 @@ linux_proc_exec(void *arg __unused, struct proc *p, st
 */
if (__predict_false((imgp->sysent->sv_flags & SV_ABI_MASK) ==
SV_ABI_LINUX)) {
-
-   if (SV_PROC_ABI(p) == SV_ABI_LINUX)
+   if (SV_PROC_ABI(p) == SV_ABI_LINUX) {
+   /*
+* Process already was under Linuxolator
+* before exec.  Update emuldata to reflect
+* single-threaded cleaned state after exec.
+*/
linux_proc_init(td, NULL, 0);
-   else
+   } else {
+   /*
+* We are switching the process to Linux emulator.
+*/
linux_proc_init(td, td, 0);
+
+   /*
+* Create a transient td_emuldata for all suspended
+* threads, so that p->p_sysent->sv_thread_detach() ==
+* linux_thread_detach() can find expected but unused
+* emuldata.
+*/
+   FOREACH_THREAD_IN_PROC(td->td_proc, othertd) {
+   if (othertd != td) {
+   linux_proc_init(td, othertd,
+   LINUX_CLONE_THREAD);
+   }
+   }
+   }
 #if defined(__amd64__)
/*
 * An IA32 executable which has executable stack will have the
___
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: r362604 - stable/12/libexec/rtld-elf

2020-06-24 Thread Konstantin Belousov
Author: kib
Date: Thu Jun 25 05:20:00 2020
New Revision: 362604
URL: https://svnweb.freebsd.org/changeset/base/362604

Log:
  MFC r362347:
  rtld: Apply relro to itself.

Modified:
  stable/12/libexec/rtld-elf/rtld.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/libexec/rtld-elf/rtld.c
==
--- stable/12/libexec/rtld-elf/rtld.c   Thu Jun 25 05:17:36 2020
(r362603)
+++ stable/12/libexec/rtld-elf/rtld.c   Thu Jun 25 05:20:00 2020
(r362604)
@@ -2233,6 +2233,7 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo **aux_info)
 obj_rtld.path = xstrdup(ld_path_rtld);
 
 parse_rtld_phdr(_rtld);
+obj_enforce_relro(_rtld);
 
 r_debug.r_brk = r_debug_state;
 r_debug.r_state = RT_CONSISTENT;
___
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: r362603 - stable/12/libexec/rtld-elf

2020-06-24 Thread Konstantin Belousov
Author: kib
Date: Thu Jun 25 05:17:36 2020
New Revision: 362603
URL: https://svnweb.freebsd.org/changeset/base/362603

Log:
  MFC r362346:
  rtld: Parse own phdr and notes.

Modified:
  stable/12/libexec/rtld-elf/rtld.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/libexec/rtld-elf/rtld.c
==
--- stable/12/libexec/rtld-elf/rtld.c   Thu Jun 25 02:45:49 2020
(r362602)
+++ stable/12/libexec/rtld-elf/rtld.c   Thu Jun 25 05:17:36 2020
(r362603)
@@ -2135,6 +2135,34 @@ process_z(Obj_Entry *root)
}
}
 }
+
+static void
+parse_rtld_phdr(Obj_Entry *obj)
+{
+   const Elf_Phdr *ph;
+   Elf_Addr note_start, note_end;
+
+   obj->stack_flags = PF_X | PF_R | PF_W;
+   for (ph = obj->phdr;  (const char *)ph < (const char *)obj->phdr +
+   obj->phsize; ph++) {
+   switch (ph->p_type) {
+   case PT_GNU_STACK:
+   obj->stack_flags = ph->p_flags;
+   break;
+   case PT_GNU_RELRO:
+   obj->relro_page = obj->relocbase +
+   trunc_page(ph->p_vaddr);
+   obj->relro_size = round_page(ph->p_memsz);
+   break;
+   case PT_NOTE:
+   note_start = (Elf_Addr)obj->relocbase + ph->p_vaddr;
+   note_end = note_start + ph->p_filesz;
+   digest_notes(obj, note_start, note_end);
+   break;
+   }
+   }
+}
+
 /*
  * Initialize the dynamic linker.  The argument is the address at which
  * the dynamic linker has been mapped into memory.  The primary task of
@@ -2203,6 +2231,8 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo **aux_info)
 
 /* Replace the path with a dynamically allocated copy. */
 obj_rtld.path = xstrdup(ld_path_rtld);
+
+parse_rtld_phdr(_rtld);
 
 r_debug.r_brk = r_debug_state;
 r_debug.r_state = RT_CONSISTENT;
___
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: r362602 - stable/12/usr.sbin/mountd

2020-06-24 Thread Rick Macklem
Author: rmacklem
Date: Thu Jun 25 02:45:49 2020
New Revision: 362602
URL: https://svnweb.freebsd.org/changeset/base/362602

Log:
  MFC: r361780, r361956
  Fix mountd to handle getgrouplist() not returning groups[0] == groups[1].
  
  Prior to r174547, getgrouplist(3) always returned a groups list with
  element 0 and 1 set to the basegid argument, so long as ngroups was > 1.
  Post-r174547 this is not the case. r328304 disabled the deduplication that
  removed the duplicate, but the duplicate still does not occur unless the
  group for a user in the password database is also entered in the group
  database.
  This patch fixes mountd so that it handles the case where a user specified
  with the -maproot or -mapall exports option has a getgrouplist(3) groups
  list where groups[0] != groups[1].
  
  Relnotes: yes

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

Modified: stable/12/usr.sbin/mountd/mountd.c
==
--- stable/12/usr.sbin/mountd/mountd.c  Thu Jun 25 02:00:51 2020
(r362601)
+++ stable/12/usr.sbin/mountd/mountd.c  Thu Jun 25 02:45:49 2020
(r362602)
@@ -3434,10 +3434,18 @@ parsecred(char *namelist, struct xucred *cr)
/*
 * Compress out duplicate.
 */
-   cr->cr_ngroups = ngroups - 1;
cr->cr_groups[0] = groups[0];
-   for (cnt = 2; cnt < ngroups; cnt++)
-   cr->cr_groups[cnt - 1] = groups[cnt];
+   if (ngroups > 1 && groups[0] == groups[1]) {
+   cr->cr_ngroups = ngroups - 1;
+   for (cnt = 2; cnt < ngroups; cnt++)
+   cr->cr_groups[cnt - 1] = groups[cnt];
+   } else {
+   cr->cr_ngroups = ngroups;
+   if (cr->cr_ngroups > XU_NGROUPS)
+   cr->cr_ngroups = XU_NGROUPS;
+   for (cnt = 1; cnt < cr->cr_ngroups; cnt++)
+   cr->cr_groups[cnt] = groups[cnt];
+   }
return;
}
/*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r362600 - in head: sys/amd64/include sys/amd64/vmm usr.sbin/bhyve

2020-06-24 Thread Rodney W. Grimes
> Author: cem
> Date: Thu Jun 25 00:18:42 2020
> New Revision: 362600
> URL: https://svnweb.freebsd.org/changeset/base/362600
> 
> Log:
>   bhyve(8): For prototyping, reattempt decode in userspace
>   
>   If userspace has a newer bhyve than the kernel, it may be able to decode
>   and emulate some instructions vmm.ko is unaware of.  In this scenario,
>   reset decoder state and try again.

This is pretty darn cool.  Thanks!


-- 
Rod Grimes rgri...@freebsd.org
___
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: r362600 - in head: sys/amd64/include sys/amd64/vmm usr.sbin/bhyve

2020-06-24 Thread Conrad Meyer
Author: cem
Date: Thu Jun 25 00:18:42 2020
New Revision: 362600
URL: https://svnweb.freebsd.org/changeset/base/362600

Log:
  bhyve(8): For prototyping, reattempt decode in userspace
  
  If userspace has a newer bhyve than the kernel, it may be able to decode
  and emulate some instructions vmm.ko is unaware of.  In this scenario,
  reset decoder state and try again.
  
  Reviewed by:  grehan
  Differential Revision:https://reviews.freebsd.org/D24464

Modified:
  head/sys/amd64/include/vmm.h
  head/sys/amd64/include/vmm_instruction_emul.h
  head/sys/amd64/vmm/vmm_instruction_emul.c
  head/usr.sbin/bhyve/bhyverun.c

Modified: head/sys/amd64/include/vmm.h
==
--- head/sys/amd64/include/vmm.hThu Jun 25 00:09:43 2020
(r362599)
+++ head/sys/amd64/include/vmm.hThu Jun 25 00:18:42 2020
(r362600)
@@ -546,6 +546,9 @@ _Static_assert(_Alignof(struct vie_op) == 2, "ABI");
 struct vie {
uint8_t inst[VIE_INST_SIZE];/* instruction bytes */
uint8_t num_valid;  /* size of the instruction */
+
+/* The following fields are all zeroed upon restart. */
+#definevie_startzero   num_processed
uint8_t num_processed;
 
uint8_t addrsize:4, opsize:4;   /* address and operand sizes */

Modified: head/sys/amd64/include/vmm_instruction_emul.h
==
--- head/sys/amd64/include/vmm_instruction_emul.h   Thu Jun 25 00:09:43 
2020(r362599)
+++ head/sys/amd64/include/vmm_instruction_emul.h   Thu Jun 25 00:18:42 
2020(r362600)
@@ -105,6 +105,7 @@ int vm_gla2gpa_nofault(struct vm *vm, int vcpuid, stru
 uint64_t gla, int prot, uint64_t *gpa, int *is_fault);
 #endif /* _KERNEL */
 
+void vie_restart(struct vie *vie);
 void vie_init(struct vie *vie, const char *inst_bytes, int inst_length);
 
 /*

Modified: head/sys/amd64/vmm/vmm_instruction_emul.c
==
--- head/sys/amd64/vmm/vmm_instruction_emul.c   Thu Jun 25 00:09:43 2020
(r362599)
+++ head/sys/amd64/vmm/vmm_instruction_emul.c   Thu Jun 25 00:18:42 2020
(r362600)
@@ -53,7 +53,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #defineKASSERT(exp,msg)assert((exp))
@@ -1990,22 +1992,36 @@ vie_calculate_gla(enum vm_cpu_mode cpu_mode, enum vm_r
return (0);
 }
 
+/*
+ * Prepare a partially decoded vie for a 2nd attempt.
+ */
 void
-vie_init(struct vie *vie, const char *inst_bytes, int inst_length)
+vie_restart(struct vie *vie)
 {
-   KASSERT(inst_length >= 0 && inst_length <= VIE_INST_SIZE,
-   ("%s: invalid instruction length (%d)", __func__, inst_length));
+   _Static_assert(
+   offsetof(struct vie, inst) < offsetof(struct vie, vie_startzero) &&
+   offsetof(struct vie, num_valid) < offsetof(struct vie, 
vie_startzero),
+   "restart should not erase instruction length or contents");
 
-   bzero(vie, sizeof(struct vie));
+   memset((char *)vie + offsetof(struct vie, vie_startzero), 0,
+   sizeof(*vie) - offsetof(struct vie, vie_startzero));
 
vie->base_register = VM_REG_LAST;
vie->index_register = VM_REG_LAST;
vie->segment_register = VM_REG_LAST;
+}
 
-   if (inst_length) {
-   bcopy(inst_bytes, vie->inst, inst_length);
-   vie->num_valid = inst_length;
-   }
+void
+vie_init(struct vie *vie, const char *inst_bytes, int inst_length)
+{
+   KASSERT(inst_length >= 0 && inst_length <= VIE_INST_SIZE,
+   ("%s: invalid instruction length (%d)", __func__, inst_length));
+
+   vie_restart(vie);
+   memset(vie->inst, 0, sizeof(vie->inst));
+   if (inst_length != 0)
+   memcpy(vie->inst, inst_bytes, inst_length);
+   vie->num_valid = inst_length;
 }
 
 #ifdef _KERNEL

Modified: head/usr.sbin/bhyve/bhyverun.c
==
--- head/usr.sbin/bhyve/bhyverun.c  Thu Jun 25 00:09:43 2020
(r362599)
+++ head/usr.sbin/bhyve/bhyverun.c  Thu Jun 25 00:18:42 2020
(r362600)
@@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$");
 #ifndef WITHOUT_CAPSICUM
 #include 
 #endif
+#include 
 #include 
 
 #include "bhyverun.h"
@@ -746,12 +747,26 @@ vmexit_mtrap(struct vmctx *ctx, struct vm_exit *vmexit
 static int
 vmexit_inst_emul(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu)
 {
-   int err, i;
+   int err, i, cs_d;
struct vie *vie;
+   enum vm_cpu_mode mode;
 
stats.vmexit_inst_emul++;
 
vie = >u.inst_emul.vie;
+   if (!vie->decoded) {
+   /*
+* Attempt to decode in userspace as a fallback.  This allows
+* updating instruction decode in 

svn commit: r362599 - head/sys/dev/evdev

2020-06-24 Thread Vladimir Kondratyev
Author: wulf
Date: Thu Jun 25 00:09:43 2020
New Revision: 362599
URL: https://svnweb.freebsd.org/changeset/base/362599

Log:
  atkbd/evdev: recognize the Chromebook menu key as F13 like Linux does.
  
  This is the key on the right side of the function keys, with the
  "hamburger menu" icon on it.
  
  Submitted by: GregV 
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D25390

Modified:
  head/sys/dev/evdev/evdev_utils.c

Modified: head/sys/dev/evdev/evdev_utils.c
==
--- head/sys/dev/evdev/evdev_utils.cThu Jun 25 00:01:24 2020
(r362598)
+++ head/sys/dev/evdev/evdev_utils.cThu Jun 25 00:09:43 2020
(r362599)
@@ -140,7 +140,7 @@ static uint16_t evdev_at_set1_scancodes[] = {
KEY_KP2,KEY_KP3,KEY_KP0,KEY_KPDOT,
NONE,   NONE,   KEY_102ND,  KEY_F11,
KEY_F12,NONE,   NONE,   NONE,
-   NONE,   NONE,   NONE,   NONE,
+   NONE,   KEY_F13,NONE,   NONE,
/* 0x60 - 0x7f */
NONE,   NONE,   NONE,   NONE,
NONE,   NONE,   NONE,   NONE,
___
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: r362598 - stable/11/sys/dev/evdev

2020-06-24 Thread Vladimir Kondratyev
Author: wulf
Date: Thu Jun 25 00:01:24 2020
New Revision: 362598
URL: https://svnweb.freebsd.org/changeset/base/362598

Log:
  MFC r362260:
  
  evdev: Add AT translated set1 scancodes for 'Eisu' & 'Kana' keys.
  
  PR:   247292
  Submitted by: Yuichiro NAITO 

Modified:
  stable/11/sys/dev/evdev/evdev_utils.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/evdev/evdev_utils.c
==
--- stable/11/sys/dev/evdev/evdev_utils.c   Thu Jun 25 00:00:04 2020
(r362597)
+++ stable/11/sys/dev/evdev/evdev_utils.c   Thu Jun 25 00:01:24 2020
(r362598)
@@ -148,7 +148,7 @@ static uint16_t evdev_at_set1_scancodes[] = {
NONE,   NONE,   NONE,   NONE,
NONE,   NONE,   NONE,   NONE,
NONE,   NONE,   NONE,   NONE,
-   KEY_KATAKANAHIRAGANA,   NONE,   NONE,   KEY_RO,
+   KEY_KATAKANAHIRAGANA,   KEY_HANGEUL,KEY_HANJA,  KEY_RO,
NONE,   NONE,   KEY_ZENKAKUHANKAKU, KEY_HIRAGANA,
KEY_KATAKANA,   KEY_HENKAN, NONE,   KEY_MUHENKAN,
NONE,   KEY_YEN,KEY_KPCOMMA,NONE,
___
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: r362597 - stable/12/sys/dev/evdev

2020-06-24 Thread Vladimir Kondratyev
Author: wulf
Date: Thu Jun 25 00:00:04 2020
New Revision: 362597
URL: https://svnweb.freebsd.org/changeset/base/362597

Log:
  MFC r362260:
  
  evdev: Add AT translated set1 scancodes for 'Eisu' & 'Kana' keys.
  
  PR:   247292
  Submitted by: Yuichiro NAITO 

Modified:
  stable/12/sys/dev/evdev/evdev_utils.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/evdev/evdev_utils.c
==
--- stable/12/sys/dev/evdev/evdev_utils.c   Wed Jun 24 23:22:36 2020
(r362596)
+++ stable/12/sys/dev/evdev/evdev_utils.c   Thu Jun 25 00:00:04 2020
(r362597)
@@ -146,7 +146,7 @@ static uint16_t evdev_at_set1_scancodes[] = {
NONE,   NONE,   NONE,   NONE,
NONE,   NONE,   NONE,   NONE,
NONE,   NONE,   NONE,   NONE,
-   KEY_KATAKANAHIRAGANA,   NONE,   NONE,   KEY_RO,
+   KEY_KATAKANAHIRAGANA,   KEY_HANGEUL,KEY_HANJA,  KEY_RO,
NONE,   NONE,   KEY_ZENKAKUHANKAKU, KEY_HIRAGANA,
KEY_KATAKANA,   KEY_HENKAN, NONE,   KEY_MUHENKAN,
NONE,   KEY_YEN,KEY_KPCOMMA,NONE,
___
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: r362596 - head

2020-06-24 Thread Conrad Meyer
Author: cem
Date: Wed Jun 24 23:22:36 2020
New Revision: 362596
URL: https://svnweb.freebsd.org/changeset/base/362596

Log:
  Clang-format: Avoid hardcoded LLVM include-order style
  
  Reported by:  emaste

Modified:
  head/.clang-format

Modified: head/.clang-format
==
--- head/.clang-format  Wed Jun 24 22:42:46 2020(r362595)
+++ head/.clang-format  Wed Jun 24 23:22:36 2020(r362596)
@@ -134,6 +134,12 @@ IncludeCategories:
   - Regex: '^\".*\.h\"'
 Priority: 10
 SortPriority: 100
+# LLVM's header include ordering style is almost the exact opposite of ours.
+# Unfortunately, they have hard-coded their preferences into clang-format.
+# Clobbering this regular expression to avoid matching prevents non-system
+# headers from being forcibly moved to the top of the include list.
+# http://llvm.org/docs/CodingStandards.html#include-style
+IncludeIsMainRegex: 'BLAH_DONT_MATCH_ANYTHING'
 SortIncludes: true
 KeepEmptyLinesAtTheStartOfBlocks: true
 TypenameMacros:
___
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: r362595 - head

2020-06-24 Thread Conrad Meyer
Author: cem
Date: Wed Jun 24 22:42:46 2020
New Revision: 362595
URL: https://svnweb.freebsd.org/changeset/base/362595

Log:
  Update .clang-format type and foreach macros lists
  
  No functional change.
  
  Reviewed by:  markj
  Differential Revision:https://reviews.freebsd.org/D25429

Modified:
  head/.clang-format

Modified: head/.clang-format
==
--- head/.clang-format  Wed Jun 24 20:23:37 2020(r362594)
+++ head/.clang-format  Wed Jun 24 22:42:46 2020(r362595)
@@ -29,30 +29,53 @@ CompactNamespaces: true
 DerivePointerAlignment: false
 DisableFormat: false
 ForEachMacros:
+  - ARB_ARRFOREACH
+  - ARB_ARRFOREACH_REVWCOND
+  - ARB_ARRFOREACH_REVERSE
+  - ARB_FOREACH
+  - ARB_FOREACH_FROM
+  - ARB_FOREACH_SAFE
+  - ARB_FOREACH_REVERSE
+  - ARB_FOREACH_REVERSE_FROM
+  - ARB_FOREACH_REVERSE_SAFE
+  - CPU_FOREACH
+  - FOREACH_THREAD_IN_PROC
+  - FOREACH_PROC_IN_SYSTEM
+  - FOREACH_PRISON_CHILD
+  - FOREACH_PRISON_DESCENDANT
+  - FOREACH_PRISON_DESCENDANT_LOCKED
+  - FOREACH_PRISON_DESCENDANT_LOCKED_LEVEL
+  - MNT_VNODE_FOREACH_ALL
+  - MNT_VNODE_FOREACH_ACTIVE
+  - RB_FOREACH
+  - RB_FOREACH_FROM
+  - RB_FOREACH_SAFE
+  - RB_FOREACH_REVERSE
+  - RB_FOREACH_REVERSE_FROM
+  - RB_FOREACH_REVERSE_SAFE
   - SLIST_FOREACH
+  - SLIST_FOREACH_FROM
+  - SLIST_FOREACH_FROM_SAFE
   - SLIST_FOREACH_SAFE
+  - SLIST_FOREACH_PREVPTR
+  - SPLAY_FOREACH
   - LIST_FOREACH
+  - LIST_FOREACH_FROM
+  - LIST_FOREACH_FROM_SAFE
   - LIST_FOREACH_SAFE
   - STAILQ_FOREACH
+  - STAILQ_FOREACH_FROM
+  - STAILQ_FOREACH_FROM_SAFE
   - STAILQ_FOREACH_SAFE
   - TAILQ_FOREACH
-  - TAILQ_FOREACH_SAFE
+  - TAILQ_FOREACH_FROM
+  - TAILQ_FOREACH_FROM_SAFE
   - TAILQ_FOREACH_REVERSE
+  - TAILQ_FOREACH_REVERSE_FROM
+  - TAILQ_FOREACH_REVERSE_FROM_SAFE
   - TAILQ_FOREACH_REVERSE_SAFE
-  - RB_FOREACH
-  - RB_FOREACH_SAFE
-  - RB_FOREACH_FROM
-  - RB_FOREACH_REVERSE
-  - RB_FOREACH_REVERSE_FROM
-  - RB_FOREACH_REVERSE_SAFE
-  - FOREACH_THREAD_IN_PROC
-  - FOREACH_PROC_IN_SYSTEM
-  - FOREACH_PRISON_CHILD
-  - FOREACH_PRISON_DESCENDANT
-  - FOREACH_PRISON_DESCENDANT_LOCKED
-  - FOREACH_PRISON_DESCENDANT_LOCKED_LEVEL
-  - MNT_VNODE_FOREACH_ALL
-  - MNT_VNODE_FOREACH_ACTIVE
+  - TAILQ_FOREACH_SAFE
+  - VM_MAP_ENTRY_FOREACH
 IndentCaseLabels: false
 IndentPPDirectives: None
 Language: Cpp
@@ -113,12 +136,35 @@ IncludeCategories:
 SortPriority: 100
 SortIncludes: true
 KeepEmptyLinesAtTheStartOfBlocks: true
-# The options below will only be supported starting with clang 9.0:
-# TODO-CLANG-9: TypenameMacros:
-# TODO-CLANG-9:   - SLIST_HEAD
-# TODO-CLANG-9:   - SLIST_ENTRY
-# TODO-CLANG-9:   - TAILQ_ENTRY
-# TODO-CLANG-9:   - TAILQ_HEAD
-# TODO-CLANG-9:   - STAILQ_ENTRY
-# TODO-CLANG-9:   - STAILQ_HEAD
-...
+TypenameMacros:
+  - ARB_ELMTYPE
+  - ARB_HEAD
+  - ARB8_HEAD
+  - ARB16_HEAD
+  - ARB32_HEAD
+  - ARB_ENTRY
+  - ARB8_ENTRY
+  - ARB16_ENTRY
+  - ARB32_ENTRY
+  - LIST_CLASS_ENTRY
+  - LIST_CLASS_HEAD
+  - LIST_ENTRY
+  - LIST_HEAD
+  - QUEUE_TYPEOF
+  - RB_ENTRY
+  - RB_HEAD
+  - SLIST_CLASS_HEAD
+  - SLIST_CLASS_ENTRY
+  - SLIST_HEAD
+  - SLIST_ENTRY
+  - SMR_POINTER
+  - SPLAY_ENTRY
+  - SPLAY_HEAD
+  - STAILQ_CLASS_ENTRY
+  - STAILQ_CLASS_HEAD
+  - STAILQ_ENTRY
+  - STAILQ_HEAD
+  - TAILQ_CLASS_ENTRY
+  - TAILQ_CLASS_HEAD
+  - TAILQ_ENTRY
+  - TAILQ_HEAD
___
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: r362594 - vendor/llvm-project/llvmorg-10.0.0-129-gd24d5c8e308

2020-06-24 Thread Dimitry Andric
Author: dim
Date: Wed Jun 24 20:23:37 2020
New Revision: 362594
URL: https://svnweb.freebsd.org/changeset/base/362594

Log:
  Tag llvm-project branch release/10.x llvmorg-10.0.0-129-gd24d5c8e308.

Added:
  vendor/llvm-project/llvmorg-10.0.0-129-gd24d5c8e308/
 - copied from r362593, vendor/llvm-project/release-10.x/
___
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: r362593 - in vendor/llvm-project/release-10.x: clang/include/clang/Driver clang/lib/Basic/Targets clang/lib/Driver clang/lib/Driver/ToolChains/Arch llvm/include/llvm/CodeGen llvm/includ...

2020-06-24 Thread Dimitry Andric
Author: dim
Date: Wed Jun 24 20:22:44 2020
New Revision: 362593
URL: https://svnweb.freebsd.org/changeset/base/362593

Log:
  Vendor import of llvm-project branch release/10.x
  llvmorg-10.0.0-129-gd24d5c8e308.

Added:
  vendor/llvm-project/release-10.x/llvm/include/llvm/CodeGen/RDFGraph.h   
(contents, props changed)
  vendor/llvm-project/release-10.x/llvm/include/llvm/CodeGen/RDFLiveness.h   
(contents, props changed)
  vendor/llvm-project/release-10.x/llvm/include/llvm/CodeGen/RDFRegisters.h   
(contents, props changed)
  vendor/llvm-project/release-10.x/llvm/lib/CodeGen/RDFGraph.cpp   (contents, 
props changed)
  vendor/llvm-project/release-10.x/llvm/lib/CodeGen/RDFLiveness.cpp   
(contents, props changed)
  vendor/llvm-project/release-10.x/llvm/lib/CodeGen/RDFRegisters.cpp   
(contents, props changed)
  vendor/llvm-project/release-10.x/llvm/lib/Target/X86/ImmutableGraph.h   
(contents, props changed)
  vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86IndirectThunks.cpp   
(contents, props changed)
  
vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86LoadValueInjectionLoadHardening.cpp
   (contents, props changed)
  
vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86LoadValueInjectionRetHardening.cpp
   (contents, props changed)
Deleted:
  vendor/llvm-project/release-10.x/llvm/lib/Target/Hexagon/RDFGraph.cpp
  vendor/llvm-project/release-10.x/llvm/lib/Target/Hexagon/RDFGraph.h
  vendor/llvm-project/release-10.x/llvm/lib/Target/Hexagon/RDFLiveness.cpp
  vendor/llvm-project/release-10.x/llvm/lib/Target/Hexagon/RDFLiveness.h
  vendor/llvm-project/release-10.x/llvm/lib/Target/Hexagon/RDFRegisters.cpp
  vendor/llvm-project/release-10.x/llvm/lib/Target/Hexagon/RDFRegisters.h
  vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86RetpolineThunks.cpp
Modified:
  vendor/llvm-project/release-10.x/clang/include/clang/Driver/Options.td
  vendor/llvm-project/release-10.x/clang/lib/Basic/Targets/PPC.h
  vendor/llvm-project/release-10.x/clang/lib/Driver/SanitizerArgs.cpp
  vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChain.cpp
  vendor/llvm-project/release-10.x/clang/lib/Driver/ToolChains/Arch/X86.cpp
  vendor/llvm-project/release-10.x/llvm/include/llvm/IR/IntrinsicsPowerPC.td
  vendor/llvm-project/release-10.x/llvm/include/llvm/Support/ManagedStatic.h
  
vendor/llvm-project/release-10.x/llvm/include/llvm/Target/TargetSelectionDAG.td
  vendor/llvm-project/release-10.x/llvm/lib/Analysis/BasicAliasAnalysis.cpp
  vendor/llvm-project/release-10.x/llvm/lib/LTO/LTO.cpp
  vendor/llvm-project/release-10.x/llvm/lib/Target/BPF/BPFISelDAGToDAG.cpp
  vendor/llvm-project/release-10.x/llvm/lib/Target/BPF/BTFDebug.cpp
  
vendor/llvm-project/release-10.x/llvm/lib/Target/Hexagon/HexagonOptAddrMode.cpp
  vendor/llvm-project/release-10.x/llvm/lib/Target/Hexagon/HexagonRDFOpt.cpp
  vendor/llvm-project/release-10.x/llvm/lib/Target/Hexagon/RDFCopy.cpp
  vendor/llvm-project/release-10.x/llvm/lib/Target/Hexagon/RDFCopy.h
  vendor/llvm-project/release-10.x/llvm/lib/Target/Hexagon/RDFDeadCode.cpp
  vendor/llvm-project/release-10.x/llvm/lib/Target/Hexagon/RDFDeadCode.h
  vendor/llvm-project/release-10.x/llvm/lib/Target/PowerPC/P9InstrResources.td
  vendor/llvm-project/release-10.x/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
  vendor/llvm-project/release-10.x/llvm/lib/Target/PowerPC/PPCISelLowering.h
  vendor/llvm-project/release-10.x/llvm/lib/Target/PowerPC/PPCInstrAltivec.td
  vendor/llvm-project/release-10.x/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
  vendor/llvm-project/release-10.x/llvm/lib/Target/PowerPC/PPCInstrVSX.td
  vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86.h
  vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86.td
  vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86FastISel.cpp
  vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86FrameLowering.cpp
  vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
  vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86ISelLowering.cpp
  vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86ISelLowering.h
  vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86InstrCompiler.td
  vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86InstrControl.td
  vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86InstrInfo.td
  vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86MCInstLower.cpp
  vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86Subtarget.h
  vendor/llvm-project/release-10.x/llvm/lib/Target/X86/X86TargetMachine.cpp
  
vendor/llvm-project/release-10.x/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp

Modified: vendor/llvm-project/release-10.x/clang/include/clang/Driver/Options.td
==
--- vendor/llvm-project/release-10.x/clang/include/clang/Driver/Options.td  
Wed Jun 24 19:51:03 2020(r362592)
+++ vendor/llvm-project/release-10.x/clang/include/clang/Driver/Options.td  
Wed Jun 24 20:22:44 2020 

svn commit: r362592 - in head: share/man/man4 sys/dev/acpi_support

2020-06-24 Thread Mark Johnston
Author: markj
Date: Wed Jun 24 19:51:03 2020
New Revision: 362592
URL: https://svnweb.freebsd.org/changeset/base/362592

Log:
  acpi_ibm(4): Rename disengaged mode to unthrottled mode.
  
  This mode was added in r362496.  Rename it to make the meaning more
  clear.
  
  PR:   247306
  Suggested by: rpokala
  Submitted by: Ali Abdallah 
  MFC with: r362496

Modified:
  head/share/man/man4/acpi_ibm.4
  head/sys/dev/acpi_support/acpi_ibm.c

Modified: head/share/man/man4/acpi_ibm.4
==
--- head/share/man/man4/acpi_ibm.4  Wed Jun 24 18:51:01 2020
(r362591)
+++ head/share/man/man4/acpi_ibm.4  Wed Jun 24 19:51:03 2020
(r362592)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 19, 2020
+.Dd June 24, 2020
 .Dt ACPI_IBM 4
 .Os
 .Sh NAME
@@ -293,7 +293,7 @@ is not set accordingly.
 .It Va dev.acpi_ibm.0.fan_level
 Indicates at what speed the fan should run when being in manual mode.
 Valid values range from 0 (off) to 7 (max) and 8.
-Level 8 is used by the driver to set the fan in disengaged mode.
+Level 8 is used by the driver to set the fan in unthrottled mode.
 In this mode, the fan is set to spin freely and will quickly reach a very
 high speed.
 Use this mode only if absolutely necessary, e.g., if the system has reached its
@@ -311,7 +311,7 @@ off
 .It Li 6, 7
 ~4300 RPM
 .It Li 8
-~6400 RPM (Full-speed, disengaged)
+~6400 RPM (Full-speed, unthrottled)
 .El
 .It Va dev.acpi_ibm.0.fan_speed
 (read-only)

Modified: head/sys/dev/acpi_support/acpi_ibm.c
==
--- head/sys/dev/acpi_support/acpi_ibm.cWed Jun 24 18:51:01 2020
(r362591)
+++ head/sys/dev/acpi_support/acpi_ibm.cWed Jun 24 19:51:03 2020
(r362592)
@@ -106,7 +106,7 @@ ACPI_MODULE_NAME("IBM")
 #define   IBM_EC_MASK_MUTE (1 << 6)
 #define IBM_EC_FANSTATUS   0x2F
 #define   IBM_EC_MASK_FANLEVEL 0x3f
-#define   IBM_EC_MASK_FANDISENGAGED(1 << 6)
+#define   IBM_EC_MASK_FANUNTHROTTLED   (1 << 6)
 #define   IBM_EC_MASK_FANSTATUS(1 << 7)
 #define IBM_EC_FANSPEED0x84
 
@@ -265,7 +265,7 @@ static struct {
.name   = "fan_level",
.method = ACPI_IBM_METHOD_FANLEVEL,
.description= "Fan level, 0-7 (recommended max), "
- "8 (disengaged, full-speed)",
+ "8 (unthrottled, full-speed)",
},
{
.name   = "fan",
@@ -831,7 +831,7 @@ acpi_ibm_sysctl_get(struct acpi_ibm_softc *sc, int met
 */
if (!sc->fan_handle) {
ACPI_EC_READ(sc->ec_dev, IBM_EC_FANSTATUS, _ec, 1);
-   if (val_ec & IBM_EC_MASK_FANDISENGAGED)
+   if (val_ec & IBM_EC_MASK_FANUNTHROTTLED)
val = 8;
else
val = val_ec & IBM_EC_MASK_FANLEVEL;
@@ -924,11 +924,11 @@ acpi_ibm_sysctl_set(struct acpi_ibm_softc *sc, int met
/* Read the current fan status. */
ACPI_EC_READ(sc->ec_dev, IBM_EC_FANSTATUS, _ec, 1);
val = val_ec & ~(IBM_EC_MASK_FANLEVEL |
-   IBM_EC_MASK_FANDISENGAGED);
+   IBM_EC_MASK_FANUNTHROTTLED);
 
if (arg == 8)
-   /* Full speed, set the disengaged bit. */
-   val |= 7 | IBM_EC_MASK_FANDISENGAGED;
+   /* Full speed, set the unthrottled bit. */
+   val |= 7 | IBM_EC_MASK_FANUNTHROTTLED;
else
val |= arg;
 
___
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: r362591 - head/sys/kern

2020-06-24 Thread Enji Cooper
Author: ngie
Date: Wed Jun 24 18:51:01 2020
New Revision: 362591
URL: https://svnweb.freebsd.org/changeset/base/362591

Log:
  Add `kern.features.witness`
  
  Adding `kern.features.witness` helps expose whether or not the kernel has
  `options WITNESS` enabled, so the `feature_present(3)` API can be used
  to query whether or not witness(9) is built into the kernel.
  
  This support is helpful with userspace applications (generally speaking,
  tests), as it can be queried to determine whether or not tests related
  to WITNESS should be run.
  
  MFC after:1 week
  Reviewed by: cem, darrick.freebsd_gmail.com
  Differential Revision: https://reviews.freebsd.org/D25302
  Sponsored by: DellEMC Isilon

Modified:
  head/sys/kern/subr_witness.c

Modified: head/sys/kern/subr_witness.c
==
--- head/sys/kern/subr_witness.cWed Jun 24 18:40:43 2020
(r362590)
+++ head/sys/kern/subr_witness.cWed Jun 24 18:51:01 2020
(r362591)
@@ -361,6 +361,8 @@ static int  witness_output(const char *fmt, ...) __prin
 static int witness_voutput(const char *fmt, va_list ap) __printflike(1, 0);
 static voidwitness_setflag(struct lock_object *lock, int flag, int set);
 
+FEATURE(witness, "kernel has witness(9) support");
+
 static SYSCTL_NODE(_debug, OID_AUTO, witness, CTLFLAG_RW | CTLFLAG_MPSAFE, 
NULL,
 "Witness Locking");
 
___
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: r362590 - head

2020-06-24 Thread Conrad Meyer
Author: cem
Date: Wed Jun 24 18:40:43 2020
New Revision: 362590
URL: https://svnweb.freebsd.org/changeset/base/362590

Log:
  Update .clang-format with style(9) header-sorting
  
  Thanks to work done in the NetBSD clang-format project.  No functional change.
  
  Reviewed by:  markj
  Differential Revision:https://reviews.freebsd.org/D25428

Modified:
  head/.clang-format

Modified: head/.clang-format
==
--- head/.clang-format  Wed Jun 24 17:54:24 2020(r362589)
+++ head/.clang-format  Wed Jun 24 18:40:43 2020(r362590)
@@ -64,7 +64,54 @@ TabWidth: 8
 ColumnLimit: 80
 UseTab: Always
 SpaceAfterCStyleCast: false
-SortIncludes: false
+IncludeBlocks: Regroup
+IncludeCategories:
+  - Regex: '^\"opt_.*\.h\"'
+Priority: 1
+SortPriority: 10
+  - Regex: '^'
+Priority: 2
+SortPriority: 20
+  - Regex: '^'
+Priority: 2
+SortPriority: 21
+  - Regex: '^'
+Priority: 2
+SortPriority: 22
+  - Regex: '^'
+Priority: 3
+SortPriority: 30
+  - Regex: '^https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r362589 - in head/lib/csu: aarch64 arm i386 riscv

2020-06-24 Thread John Baldwin
Author: jhb
Date: Wed Jun 24 17:54:24 2020
New Revision: 362589
URL: https://svnweb.freebsd.org/changeset/base/362589

Log:
  Always compile the brand and ignore init ELF notes standalone.
  
  Reviewed by:  kib
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D25374

Modified:
  head/lib/csu/aarch64/Makefile
  head/lib/csu/aarch64/crt1_s.S
  head/lib/csu/arm/Makefile
  head/lib/csu/arm/crt1_s.S
  head/lib/csu/i386/Makefile
  head/lib/csu/i386/crt1_s.S
  head/lib/csu/riscv/Makefile
  head/lib/csu/riscv/crt1_s.S

Modified: head/lib/csu/aarch64/Makefile
==
--- head/lib/csu/aarch64/Makefile   Wed Jun 24 17:31:21 2020
(r362588)
+++ head/lib/csu/aarch64/Makefile   Wed Jun 24 17:54:24 2020
(r362589)
@@ -18,20 +18,21 @@ FILESDIR=   ${LIBDIR}
 .undef LIBRARIES_ONLY
 
 CLEANFILES=${OBJS} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o
+CLEANFILES+=   crtbrand.o ignore_init_note.o
 
 gcrt1_c.o: crt1_c.c
${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c
 
-gcrt1.o: gcrt1_c.o crt1_s.o
-   ${LD} ${_LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o
+gcrt1.o: gcrt1_c.o crt1_s.o crtbrand.o ignore_init_note.o
+   ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC}
 
-crt1.o:crt1_c.o crt1_s.o
-   ${LD} ${_LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o
+crt1.o:crt1_c.o crt1_s.o crtbrand.o ignore_init_note.o
+   ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC}
 
 Scrt1_c.o: crt1_c.c
${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c
 
-Scrt1.o: Scrt1_c.o crt1_s.o
-   ${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o
+Scrt1.o: Scrt1_c.o crt1_s.o crtbrand.o ignore_init_note.o
+   ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC}
 
 .include 

Modified: head/lib/csu/aarch64/crt1_s.S
==
--- head/lib/csu/aarch64/crt1_s.S   Wed Jun 24 17:31:21 2020
(r362588)
+++ head/lib/csu/aarch64/crt1_s.S   Wed Jun 24 17:54:24 2020
(r362589)
@@ -32,9 +32,6 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "crtbrand.S"
-#include "ignore_init_note.S"
-
 ENTRY(_start)
mov x3, x2  /* cleanup */
add x1, x0, #8  /* load argv */

Modified: head/lib/csu/arm/Makefile
==
--- head/lib/csu/arm/Makefile   Wed Jun 24 17:31:21 2020(r362588)
+++ head/lib/csu/arm/Makefile   Wed Jun 24 17:54:24 2020(r362589)
@@ -18,23 +18,24 @@ FILESDIR=   ${LIBDIR}
 .undef LIBRARIES_ONLY
 
 CLEANFILES=${OBJS} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o
+CLEANFILES+=   crtbrand.o ignore_init_note.o
 
 crt1_c.o: crt1_c.c
${CC} ${CFLAGS} ${STATIC_CFLAGS} -c -o ${.TARGET} ${.CURDIR}/crt1_c.c
 
-crt1.o:crt1_c.o crt1_s.o
-   ${LD} ${_LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o
+crt1.o:crt1_c.o crt1_s.o crtbrand.o ignore_init_note.o
+   ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC}
 
 gcrt1_c.o: crt1_c.c
${CC} ${CFLAGS} ${STATIC_CFLAGS} -DGCRT -c -o ${.TARGET} 
${.CURDIR}/crt1_c.c
 
-gcrt1.o: gcrt1_c.o crt1_s.o
-   ${LD} ${_LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o
+gcrt1.o: gcrt1_c.o crt1_s.o crtbrand.o ignore_init_note.o
+   ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC}
 
 Scrt1_c.o: crt1_c.c
${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c
 
-Scrt1.o: Scrt1_c.o crt1_s.o
-   ${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o
+Scrt1.o: Scrt1_c.o crt1_s.o crtbrand.o ignore_init_note.o
+   ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC}
 
 .include 

Modified: head/lib/csu/arm/crt1_s.S
==
--- head/lib/csu/arm/crt1_s.S   Wed Jun 24 17:31:21 2020(r362588)
+++ head/lib/csu/arm/crt1_s.S   Wed Jun 24 17:54:24 2020(r362589)
@@ -44,8 +44,9 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "crtbrand.S"
-#include "ignore_init_note.S"
+#include 
+#include 
+#include "notes.h"
 
 ENTRY(_start)
mov r5, r2  /* cleanup */

Modified: head/lib/csu/i386/Makefile
==
--- head/lib/csu/i386/Makefile  Wed Jun 24 17:31:21 2020(r362588)
+++ head/lib/csu/i386/Makefile  Wed Jun 24 17:54:24 2020(r362589)
@@ -18,22 +18,23 @@ FILESDIR=   ${LIBDIR}
 .undef LIBRARIES_ONLY
 
 CLEANFILES=${OBJS} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o
+CLEANFILES+=   crtbrand.o ignore_init_note.o
 
 gcrt1_c.o: crt1_c.c
${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c
 
-gcrt1.o: gcrt1_c.o crt1_s.o
-   ${LD} ${_LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o
+gcrt1.o: gcrt1_c.o crt1_s.o crtbrand.o ignore_init_note.o
+   ${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC}
 
-crt1.o:crt1_c.o crt1_s.o
-   ${LD} ${_LDFLAGS} -o crt1.o -r 

svn commit: r362588 - head/share/man/man5

2020-06-24 Thread Conrad Meyer
Author: cem
Date: Wed Jun 24 17:31:21 2020
New Revision: 362588
URL: https://svnweb.freebsd.org/changeset/base/362588

Log:
  Regenerate src.conf.5 after r362587

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Wed Jun 24 17:03:42 2020
(r362587)
+++ head/share/man/man5/src.conf.5  Wed Jun 24 17:31:21 2020
(r362588)
@@ -1,6 +1,6 @@
 .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
 .\" $FreeBSD$
-.Dd June 6, 2020
+.Dd June 24, 2020
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -321,6 +321,8 @@ When set, it enforces these options:
 .It
 .Va WITHOUT_CLANG_EXTRAS
 .It
+.Va WITHOUT_CLANG_FORMAT
+.It
 .Va WITHOUT_CLANG_FULL
 .It
 .Va WITHOUT_LLVM_COV
@@ -333,6 +335,8 @@ enabled unless an alternate compiler is provided via X
 .It Va WITH_CLANG_EXTRAS
 Set to build additional clang and llvm tools, such as bugpoint and
 clang-format.
+.It Va WITH_CLANG_FORMAT
+Set to build clang-format.
 .It Va WITHOUT_CLANG_FULL
 Set to avoid building the ARCMigrate, Rewriter and StaticAnalyzer components of
 the Clang C/C++ compiler.
@@ -441,6 +445,8 @@ When set, it enforces these options:
 .It
 .Va WITHOUT_CLANG_EXTRAS
 .It
+.Va WITHOUT_CLANG_FORMAT
+.It
 .Va WITHOUT_CLANG_FULL
 .It
 .Va WITHOUT_DTRACE_TESTS
@@ -1623,6 +1629,8 @@ When set, it enforces these options:
 .Va WITHOUT_CLANG
 .It
 .Va WITHOUT_CLANG_EXTRAS
+.It
+.Va WITHOUT_CLANG_FORMAT
 .It
 .Va WITHOUT_CLANG_FULL
 .It
___
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: r362587 - in head: . lib/clang/libclang share/mk targets/pseudo/bootstrap-tools targets/pseudo/clang tools/build/mk tools/build/options usr.bin/clang

2020-06-24 Thread Conrad Meyer
Author: cem
Date: Wed Jun 24 17:03:42 2020
New Revision: 362587
URL: https://svnweb.freebsd.org/changeset/base/362587

Log:
  Add WITH_CLANG_FORMAT option
  
  clang-format is enabled conditional on either WITH_CLANG_EXTRAS or
  WITH_CLANG_FORMAT.  Some sources in libclang are build conditional on
  either rule, and obviously the clang-format binary itself depends on the
  rule.
  
  clang-format could still use a manual page.
  
  Reviewed by:  emaste
  Differential Revision:https://reviews.freebsd.org/D25427

Added:
  head/tools/build/options/WITH_CLANG_FORMAT   (contents, props changed)
Modified:
  head/Makefile.inc1
  head/lib/clang/libclang/Makefile
  head/share/mk/src.opts.mk
  head/targets/pseudo/bootstrap-tools/Makefile
  head/targets/pseudo/clang/Makefile.depend
  head/tools/build/mk/OptionalObsoleteFiles.inc
  head/usr.bin/clang/Makefile

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Wed Jun 24 16:17:58 2020(r362586)
+++ head/Makefile.inc1  Wed Jun 24 17:03:42 2020(r362587)
@@ -676,7 +676,7 @@ BSARGS= DESTDIR= \
MK_HTML=no NO_LINT=yes MK_MAN=no \
-DNO_PIC MK_PROFILE=no -DNO_SHARED \
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
-   MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
+   MK_CLANG_EXTRAS=no MK_CLANG_FORMAT=no MK_CLANG_FULL=no \
MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no \
MK_INCLUDES=yes
 
@@ -697,7 +697,7 @@ TMAKE=  \
SSP_CFLAGS= \
-DNO_LINT \
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
-   MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
+   MK_CLANG_EXTRAS=no MK_CLANG_FORMAT=no MK_CLANG_FULL=no \
MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no
 
 # cross-tools stage
@@ -2577,6 +2577,7 @@ NXBMAKEARGS+= \
SSP_CFLAGS= \
MK_CASPER=no \
MK_CLANG_EXTRAS=no \
+   MK_CLANG_FORMAT=no \
MK_CLANG_FULL=no \
MK_CTF=no \
MK_DEBUG_FILES=no \

Modified: head/lib/clang/libclang/Makefile
==
--- head/lib/clang/libclang/MakefileWed Jun 24 16:17:58 2020
(r362586)
+++ head/lib/clang/libclang/MakefileWed Jun 24 17:03:42 2020
(r362587)
@@ -22,7 +22,7 @@ SRCDIR=   clang/lib
 
 # Explanation of different SRCS variants below:
 # SRCS_MIN:always required, even for bootstrap
-# SRCS_EXT:required for MK_CLANG_EXTRAS
+# SRCS_EXT:required for MK_CLANG_EXTRAS || MK_CLANG_FORMAT
 # SRCS_FUL:required for MK_CLANG_FULL
 # SRCS_LDB:required for MK_LLDB
 
@@ -686,7 +686,7 @@ SRCS_MIN+=  Tooling/RefactoringCallbacks.cpp
 SRCS_MIN+= Tooling/Tooling.cpp
 
 SRCS_ALL+= ${SRCS_MIN}
-.if ${MK_CLANG_EXTRAS} != "no"
+.if ${MK_CLANG_EXTRAS} != "no" || ${MK_CLANG_FORMAT} != "no"
 SRCS_ALL+= ${SRCS_EXT}
 .endif
 .if ${MK_CLANG_FULL} != "no"

Modified: head/share/mk/src.opts.mk
==
--- head/share/mk/src.opts.mk   Wed Jun 24 16:17:58 2020(r362586)
+++ head/share/mk/src.opts.mk   Wed Jun 24 17:03:42 2020(r362587)
@@ -202,6 +202,7 @@ __DEFAULT_NO_OPTIONS = \
 BHYVE_SNAPSHOT \
 BSD_GREP \
 CLANG_EXTRAS \
+CLANG_FORMAT \
 DTRACE_TESTS \
 EXPERIMENTAL \
 GNU_GREP_COMPAT \
@@ -482,6 +483,7 @@ MK_LLDB:=   no
 
 .if ${MK_CLANG} == "no"
 MK_CLANG_EXTRAS:= no
+MK_CLANG_FORMAT:= no
 MK_CLANG_FULL:= no
 MK_LLVM_COV:= no
 .endif

Modified: head/targets/pseudo/bootstrap-tools/Makefile
==
--- head/targets/pseudo/bootstrap-tools/MakefileWed Jun 24 16:17:58 
2020(r362586)
+++ head/targets/pseudo/bootstrap-tools/MakefileWed Jun 24 17:03:42 
2020(r362587)
@@ -43,7 +43,7 @@ BSARGS=   DESTDIR= \
MK_HTML=no NO_LINT=yes MK_MAN=no \
-DNO_PIC MK_PROFILE=no -DNO_SHARED \
-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
-   MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
+   MK_CLANG_EXTRAS=no MK_CLANG_FORMAT=no MK_CLANG_FULL=no \
MK_LLDB=no MK_TESTS=no \
MK_INCLUDES=yes
 

Modified: head/targets/pseudo/clang/Makefile.depend
==
--- head/targets/pseudo/clang/Makefile.depend   Wed Jun 24 16:17:58 2020
(r362586)
+++ head/targets/pseudo/clang/Makefile.depend   Wed Jun 24 17:03:42 2020
(r362587)
@@ -42,7 +42,6 @@ DIRDEPS+= \
 .if ${MK_CLANG_EXTRAS} == "yes"
 DIRDEPS+= \
usr.bin/clang/bugpoint \
-   usr.bin/clang/clang-format \
usr.bin/clang/llc \
usr.bin/clang/lli \
usr.bin/clang/llvm-ar \
@@ -69,6 +68,10 @@ DIRDEPS+= \
usr.bin/clang/llvm-xray \

svn commit: r362586 - in stable/12/sys/netinet: . tcp_stacks

2020-06-24 Thread Richard Scheffenegger
Author: rscheff
Date: Wed Jun 24 16:17:58 2020
New Revision: 362586
URL: https://svnweb.freebsd.org/changeset/base/362586

Log:
  MFC r361347: With RFC3168 ECN, CWR SHOULD only be sent with new data
  
  Overly conservative data receivers may ignore the CWR flag on other
  packets, and keep ECE latched. This can result in continous reduction
  of the congestion window, and very poor performance when ECN is
  enabled.
  
  PR:   243590
  Reviewed by:  rgrimes (mentor), rrs
  Approved by:  rgrimes (mentor, blanket)
  MFC after:3 weeks
  Sponsored by: NetApp, Inc.
  Differential Revision:https://reviews.freebsd.org/D23364

Modified:
  stable/12/sys/netinet/tcp_input.c
  stable/12/sys/netinet/tcp_output.c
  stable/12/sys/netinet/tcp_stacks/rack.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/tcp_input.c
==
--- stable/12/sys/netinet/tcp_input.c   Wed Jun 24 15:46:33 2020
(r362585)
+++ stable/12/sys/netinet/tcp_input.c   Wed Jun 24 16:17:58 2020
(r362586)
@@ -417,9 +417,15 @@ cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, ui
}
break;
case CC_ECN:
-   if (!IN_CONGRECOVERY(tp->t_flags)) {
+   if (!IN_CONGRECOVERY(tp->t_flags) ||
+   /*
+* Allow ECN reaction on ACK to CWR, if
+* that data segment was also CE marked.
+*/
+   SEQ_GEQ(th->th_ack, tp->snd_recover)) {
+   EXIT_CONGRECOVERY(tp->t_flags);
TCPSTAT_INC(tcps_ecn_rcwnd);
-   tp->snd_recover = tp->snd_max;
+   tp->snd_recover = tp->snd_max + 1;
if (tp->t_flags & TF_ECN_PERMIT)
tp->t_flags |= TF_ECN_SND_CWR;
}

Modified: stable/12/sys/netinet/tcp_output.c
==
--- stable/12/sys/netinet/tcp_output.c  Wed Jun 24 15:46:33 2020
(r362585)
+++ stable/12/sys/netinet/tcp_output.c  Wed Jun 24 16:17:58 2020
(r362586)
@@ -1132,7 +1132,8 @@ send:
 * Ignore pure ack packets, retransmissions and window probes.
 */
if (len > 0 && SEQ_GEQ(tp->snd_nxt, tp->snd_max) &&
-   !((tp->t_flags & TF_FORCEDATA) && len == 1)) {
+   !((tp->t_flags & TF_FORCEDATA) && len == 1 &&
+   SEQ_LT(tp->snd_una, tp->snd_max))) {
 #ifdef INET6
if (isipv6)
ip6->ip6_flow |= htonl(IPTOS_ECN_ECT0 << 20);
@@ -1140,15 +1141,15 @@ send:
 #endif
ip->ip_tos |= IPTOS_ECN_ECT0;
TCPSTAT_INC(tcps_ecn_ect0);
+   /*
+* Reply with proper ECN notifications.
+* Only set CWR on new data segments.
+*/
+   if (tp->t_flags & TF_ECN_SND_CWR) {
+   flags |= TH_CWR;
+   tp->t_flags &= ~TF_ECN_SND_CWR;
+   }
}
-   
-   /*
-* Reply with proper ECN notifications.
-*/
-   if (tp->t_flags & TF_ECN_SND_CWR) {
-   flags |= TH_CWR;
-   tp->t_flags &= ~TF_ECN_SND_CWR;
-   } 
if (tp->t_flags & TF_ECN_SND_ECE)
flags |= TH_ECE;
}

Modified: stable/12/sys/netinet/tcp_stacks/rack.c
==
--- stable/12/sys/netinet/tcp_stacks/rack.c Wed Jun 24 15:46:33 2020
(r362585)
+++ stable/12/sys/netinet/tcp_stacks/rack.c Wed Jun 24 16:17:58 2020
(r362586)
@@ -1415,9 +1415,15 @@ rack_cong_signal(struct tcpcb *tp, struct tcphdr *th, 
}
break;
case CC_ECN:
-   if (!IN_CONGRECOVERY(tp->t_flags)) {
+   if (!IN_CONGRECOVERY(tp->t_flags) ||
+   /*
+* Allow ECN reaction on ACK to CWR, if
+* that data segment was also CE marked.
+*/
+   SEQ_GEQ(th->th_ack, tp->snd_recover)) {
+   EXIT_CONGRECOVERY(tp->t_flags);
TCPSTAT_INC(tcps_ecn_rcwnd);
-   tp->snd_recover = tp->snd_max;
+   tp->snd_recover = tp->snd_max + 1;
if (tp->t_flags & TF_ECN_PERMIT)
tp->t_flags |= TF_ECN_SND_CWR;
}
@@ -8283,13 +8289,14 @@ send:
 #endif
ip->ip_tos |= IPTOS_ECN_ECT0;
TCPSTAT_INC(tcps_ecn_ect0);
-   

svn commit: r362585 - head/sys/netpfil/ipfw

2020-06-24 Thread Mark Johnston
Author: markj
Date: Wed Jun 24 15:46:33 2020
New Revision: 362585
URL: https://svnweb.freebsd.org/changeset/base/362585

Log:
  ipfw(4): make O_IPVER/ipversion match IPv4 or 6, not just IPv4.
  
  Submitted by: Neel Chauhan 
  Reviewed by:  Lutz Donnerhacke
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D25227

Modified:
  head/sys/netpfil/ipfw/ip_fw2.c

Modified: head/sys/netpfil/ipfw/ip_fw2.c
==
--- head/sys/netpfil/ipfw/ip_fw2.c  Wed Jun 24 15:21:12 2020
(r362584)
+++ head/sys/netpfil/ipfw/ip_fw2.c  Wed Jun 24 15:46:33 2020
(r362585)
@@ -2225,7 +2225,7 @@ do {  
\
break;
 
case O_IPVER:
-   match = (is_ipv4 &&
+   match = ((is_ipv4 || is_ipv6) &&
cmd->arg1 == ip->ip_v);
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: r362584 - head/sys/riscv/riscv

2020-06-24 Thread Mitchell Horne
Author: mhorne
Date: Wed Jun 24 15:21:12 2020
New Revision: 362584
URL: https://svnweb.freebsd.org/changeset/base/362584

Log:
  Only invalidate the early DTB mapping if it exists
  
  This temporary mapping will become optional. Booting via loader(8)
  means that the DTB will have already been copied into the kernel's
  staging area, and is therefore covered by the early KVA mappings.
  
  Reviewed by:  markj
  Differential Revision:https://reviews.freebsd.org/D24911

Modified:
  head/sys/riscv/riscv/pmap.c

Modified: head/sys/riscv/riscv/pmap.c
==
--- head/sys/riscv/riscv/pmap.c Wed Jun 24 15:20:00 2020(r362583)
+++ head/sys/riscv/riscv/pmap.c Wed Jun 24 15:21:12 2020(r362584)
@@ -619,8 +619,8 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart,
 * possibility of an aliased mapping in the future.
 */
l2p = pmap_l2(kernel_pmap, VM_EARLY_DTB_ADDRESS);
-   KASSERT((pmap_load(l2p) & PTE_V) != 0, ("dtpb not mapped"));
-   pmap_clear(l2p);
+   if ((pmap_load(l2p) & PTE_V) != 0)
+   pmap_clear(l2p);
 
sfence_vma();
 
___
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: r362583 - in head/sys/riscv: include riscv

2020-06-24 Thread Mitchell Horne
Author: mhorne
Date: Wed Jun 24 15:20:00 2020
New Revision: 362583
URL: https://svnweb.freebsd.org/changeset/base/362583

Log:
  Handle load from loader(8)
  
  In locore, we must detect and handle different arguments passed by
  loader(8) compared to what we recieve when booting directly via SBI
  firmware. Currently we receive the hart ID in a0 and a pointer to the
  device tree blob in a1. loader(8) provides only a pointer to its
  metadata in a0.
  
  The solution to this is to add an additional entry point, _alt_start.
  This will be placed first in the .text section, so SBI firmware will
  enter here, and jump to the common pagetable setup shortly after. Since
  loader(8) understands our ELF kernel, it will enter at the ELF's entry
  address, which points to _start. This approach leads to very little
  guesswork as to which way we booted.
  
  Fix-up initriscv() to parse the loader's metadata, continuing to use
  fake_preload_metadata() in the SBI direct boot case.
  
  Reviewed by:  markj, jrtc27 (asm portion)
  Differential Revision:https://reviews.freebsd.org/D24912

Modified:
  head/sys/riscv/include/machdep.h
  head/sys/riscv/riscv/genassym.c
  head/sys/riscv/riscv/locore.S
  head/sys/riscv/riscv/machdep.c

Modified: head/sys/riscv/include/machdep.h
==
--- head/sys/riscv/include/machdep.hWed Jun 24 15:05:42 2020
(r362582)
+++ head/sys/riscv/include/machdep.hWed Jun 24 15:20:00 2020
(r362583)
@@ -43,12 +43,12 @@ struct riscv_bootparams {
vm_offset_t kern_stack;
vm_offset_t dtbp_virt;  /* Device tree blob virtual addr */
vm_offset_t dtbp_phys;  /* Device tree blob physical addr */
+   vm_offset_t modulep;/* loader(8) metadata */
 };
 
 extern vm_paddr_t physmap[PHYS_AVAIL_ENTRIES];
 extern u_int physmap_idx;
 
-vm_offset_t fake_preload_metadata(struct riscv_bootparams *rbp);
 void initriscv(struct riscv_bootparams *);
 
 #endif /* _MACHINE_MACHDEP_H_ */

Modified: head/sys/riscv/riscv/genassym.c
==
--- head/sys/riscv/riscv/genassym.c Wed Jun 24 15:05:42 2020
(r362582)
+++ head/sys/riscv/riscv/genassym.c Wed Jun 24 15:20:00 2020
(r362583)
@@ -107,3 +107,4 @@ ASSYM(RISCV_BOOTPARAMS_KERN_STACK, offsetof(struct ris
 kern_stack));
 ASSYM(RISCV_BOOTPARAMS_DTBP_VIRT, offsetof(struct riscv_bootparams, 
dtbp_virt));
 ASSYM(RISCV_BOOTPARAMS_DTBP_PHYS, offsetof(struct riscv_bootparams, 
dtbp_phys));
+ASSYM(RISCV_BOOTPARAMS_MODULEP, offsetof(struct riscv_bootparams, modulep));

Modified: head/sys/riscv/riscv/locore.S
==
--- head/sys/riscv/riscv/locore.S   Wed Jun 24 15:05:42 2020
(r362582)
+++ head/sys/riscv/riscv/locore.S   Wed Jun 24 15:20:00 2020
(r362583)
@@ -46,24 +46,24 @@
.globl  kernbase
.setkernbase, KERNBASE
 
-   /* Trap entries */
.text
-
-   /* Reset vector */
-   .text
-   .globl _start
-_start:
+/*
+ * Alternate entry point. Used when booting via SBI firmware. It must be placed
+ * at the beginning of the .text section. Arguments are as follows:
+ *  - a0 = hart ID
+ *  - a1 = dtbp
+ *
+ * Multiple CPUs might enter from this point, so we perform a hart lottery and
+ * send the losers to mpentry.
+ */
+   .globl _alt_start
+_alt_start:
/* Set the global pointer */
 .option push
 .option norelax
lla gp, __global_pointer$
 .option pop
 
-   /*
-* a0 = hart id
-* a1 = dtbp
-*/
-
/* Pick a hart to run the boot process. */
lla t0, hart_lottery
li  t1, 1
@@ -75,11 +75,43 @@ _start:
 */
beqzt0, 1f
j   mpentry
+1:
+   /* Store the boot hart */
+   lla t0, boot_hart
+   sw  a0, 0(t0)
 
+   /* Load zero as modulep */
+   mv  a0, zero
+   j   pagetables
+
+/*
+ * Main entry point. This routine is marked as the ELF entry, and is where
+ * loader(8) will enter the kernel. Arguments are as follows:
+ *  - a0 = modulep
+ *  - a1 = ???
+ *
+ * It is expected that only a single CPU will enter here.
+ */
+   .globl _start
+_start:
+   /* Set the global pointer */
+.option push
+.option norelax
+   lla gp, __global_pointer$
+.option pop
+
/*
-* Page tables
+* Zero a1 to indicate that we have no DTB pointer. It is already
+* included in the loader(8) metadata.
 */
-1:
+   mv  a1, zero
+
+   /*
+* Page tables setup
+*  a0 - modulep or zero
+*  a1 - zero or dtbp
+*/
+pagetables:
/* Get the kernel's load address */
jal get_physmem
 
@@ -107,7 +139,7 @@ _start:
li  t2, 512 /* Build 512 entries */
add 

svn commit: r362582 - head/sbin/ipfw

2020-06-24 Thread Mark Johnston
Author: markj
Date: Wed Jun 24 15:05:42 2020
New Revision: 362582
URL: https://svnweb.freebsd.org/changeset/base/362582

Log:
  ipfw(8): In fill_ip6(), use a single statement for both "me" and "me6".
  
  Submitted by: Neel Chauhan 
  Reviewed by:  rgrimes, Lutz Donnerhacke
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D24403

Modified:
  head/sbin/ipfw/ipv6.c

Modified: head/sbin/ipfw/ipv6.c
==
--- head/sbin/ipfw/ipv6.c   Wed Jun 24 14:47:51 2020(r362581)
+++ head/sbin/ipfw/ipv6.c   Wed Jun 24 15:05:42 2020(r362582)
@@ -342,13 +342,8 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av, int cblen, stru
if (strcmp(av, "any") == 0)
return (1);
 
-
-   if (strcmp(av, "me") == 0) {/* Set the data for "me" opt*/
-   cmd->o.len |= F_INSN_SIZE(ipfw_insn);
-   return (1);
-   }
-
-   if (strcmp(av, "me6") == 0) {   /* Set the data for "me" opt*/
+   /* Set the data for "me" opt */
+   if (strcmp(av, "me") == 0 || strcmp(av, "me6") == 0) {
cmd->o.len |= F_INSN_SIZE(ipfw_insn);
return (1);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r362581 - head/sys/netinet

2020-06-24 Thread Michael Tuexen
Author: tuexen
Date: Wed Jun 24 14:47:51 2020
New Revision: 362581
URL: https://svnweb.freebsd.org/changeset/base/362581

Log:
  Fix the acconting for fragmented unordered messages when using
  interleaving.
  This was reported for the userland stack in
  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19321
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_indata.c

Modified: head/sys/netinet/sctp_indata.c
==
--- head/sys/netinet/sctp_indata.c  Wed Jun 24 13:52:53 2020
(r362580)
+++ head/sys/netinet/sctp_indata.c  Wed Jun 24 14:47:51 2020
(r362581)
@@ -,6 +,16 @@ sctp_deliver_reasm_check(struct sctp_tcb *stcb, struct
 #endif
SCTP_STAT_INCR_COUNTER64(sctps_reasmusrmsgs);
TAILQ_REMOVE(>uno_inqueue, control, 
next_instrm);
+   if (asoc->size_on_all_streams >= 
control->length) {
+   asoc->size_on_all_streams -= 
control->length;
+   } else {
+#ifdef INVARIANTS
+   panic("size_on_all_streams = %u smaller 
than control length %u", asoc->size_on_all_streams, control->length);
+#else
+   asoc->size_on_all_streams = 0;
+#endif
+   }
+   sctp_ucount_decr(asoc->cnt_on_all_streams);
control->on_strm_q = 0;
}
if (control->on_read_q == 0) {
@@ -1391,7 +1401,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struc
}
/* Must be added to the stream-in queue */
if (created_control) {
-   if (unordered == 0) {
+   if ((unordered == 0) || (asoc->idata_supported)) {
sctp_ucount_incr(asoc->cnt_on_all_streams);
}
if (sctp_place_control_in_stream(strm, asoc, control)) {
___
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: r362333 - in head: contrib/flex contrib/flex/src usr.bin/lex usr.bin/lex/lib

2020-06-24 Thread Joerg Sonnenberger
On Wed, Jun 24, 2020 at 12:09:03PM +0200, Dimitry Andric wrote:
> On 24 Jun 2020, at 02:41, Kyle Evans  wrote:
> > 
> > On Thu, Jun 18, 2020 at 1:09 PM Jung-uk Kim  wrote:
> >> 
> >> Author: jkim
> >> Date: Thu Jun 18 18:09:16 2020
> >> New Revision: 362333
> >> URL: https://svnweb.freebsd.org/changeset/base/362333
> >> 
> >> Log:
> >>  MFV:  r362286
> >> 
> >>  Merge flex 2.6.4.
> >> 
> > 
> > Hi,
> > 
> > I'm looking at getting amd64 world buildable again by gcc6; this seems
> > to give it some gas:
> > 
> > /usr/src/contrib/flex/src/main.c: In function 'check_options':
> > /usr/src/contrib/flex/src/main.c:347:14: error: assignment discards
> > 'const' qualifier from pointer target type
> > [-Werror=discarded-qualifiers]
> >   if ((slash = strrchr(M4, '/')) != NULL) {
> > 
> > The following trivial patch seems to make gcc6 happy again.
> 
> This is a strange one. As gcc6 has been removed from ports, I had to
> resort to an older 12-STABLE box which still had it, but no matter what
> I try, I cannot get the warning that is being produced by the CI system.
> What does it do differently?
> 
> Also, the warning is indeed bogus, as strrchr() returns a non-const char
> pointer. As I can't reproduce it, I also can't verify which gcc version
> fixes the bogus warning.

The warning is correct if you have a C++-aware string.h. It will provide
two overloads for strrchr, which return the constness of the argument.
So if you give it a const char *, it returns a const char *; if you give
it a char *, it returns a char *.

Joerg
___
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: r362580 - head/sys/netinet/cc

2020-06-24 Thread Richard Scheffenegger
Author: rscheff
Date: Wed Jun 24 13:52:53 2020
New Revision: 362580
URL: https://svnweb.freebsd.org/changeset/base/362580

Log:
  TCP: fix cubic RTO reaction.
  
  Proper TCP Cubic operation requires the knowledge
  of the maximum congestion window prior to the
  last congestion event.
  
  This restores and improves a bugfix previously added
  by jtl@ but subsequently removed due to a revert.
  
  Reported by:  chengc_netapp.com
  Reviewed by:  chengc_netapp.com, tuexen (mentor)
  Approved by:  tuexen (mentor), rgrimes (mentor)
  MFC after:2 weeks
  Sponsored by: NetApp, Inc.
  Differential Revision:https://reviews.freebsd.org/D25133

Modified:
  head/sys/netinet/cc/cc_cubic.c

Modified: head/sys/netinet/cc/cc_cubic.c
==
--- head/sys/netinet/cc/cc_cubic.c  Wed Jun 24 13:49:30 2020
(r362579)
+++ head/sys/netinet/cc/cc_cubic.c  Wed Jun 24 13:52:53 2020
(r362580)
@@ -313,10 +313,15 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type)
 * timeout has fired more than once, as there is a reasonable
 * chance the first one is a false alarm and may not indicate
 * congestion.
+* This will put Cubic firmly into the concave / TCP friendly
+* region, for a slower ramp-up after two consecutive RTOs.
 */
if (CCV(ccv, t_rxtshift) >= 2) {
cubic_data->flags |= CUBICFLAG_CONG_EVENT;
cubic_data->t_last_cong = ticks;
+   cubic_data->max_cwnd = CCV(ccv, snd_cwnd_prev);
+   cubic_data->K = cubic_k(cubic_data->max_cwnd /
+   CCV(ccv, t_maxseg));
}
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: r362579 - stable/12/sys/dev/nvme

2020-06-24 Thread Alexander Motin
Author: mav
Date: Wed Jun 24 13:49:30 2020
New Revision: 362579
URL: https://svnweb.freebsd.org/changeset/base/362579

Log:
  MFC r362337: Make polled request timeout less invasive.
  
  Instead of panic after one second of polling, make the normal timeout
  handler to activate, reset the controller and abort the outstanding
  requests.  If all of it won't happen within 10 seconds then something
  in the driver is likely stuck bad and panic is the only way out.
  
  In particular this fixed device hot unplug during execution of those
  polled commands, allowing clean device detach instead of panic.

Modified:
  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_ctrlr.c
==
--- stable/12/sys/dev/nvme/nvme_ctrlr.c Wed Jun 24 13:48:16 2020
(r362578)
+++ stable/12/sys/dev/nvme/nvme_ctrlr.c Wed Jun 24 13:49:30 2020
(r362579)
@@ -489,7 +489,7 @@ nvme_ctrlr_create_qpairs(struct nvme_controller *ctrlr
}
 
status.done = 0;
-   nvme_ctrlr_cmd_create_io_sq(qpair->ctrlr, qpair,
+   nvme_ctrlr_cmd_create_io_sq(ctrlr, qpair,
nvme_completion_poll_cb, );
nvme_completion_poll();
if (nvme_completion_is_error()) {

Modified: stable/12/sys/dev/nvme/nvme_private.h
==
--- stable/12/sys/dev/nvme/nvme_private.h   Wed Jun 24 13:48:16 2020
(r362578)
+++ stable/12/sys/dev/nvme/nvme_private.h   Wed Jun 24 13:49:30 2020
(r362579)
@@ -463,20 +463,22 @@ int   nvme_detach(device_t dev);
  * Wait for a command to complete using the nvme_completion_poll_cb.
  * Used in limited contexts where the caller knows it's OK to block
  * briefly while the command runs. The ISR will run the callback which
- * will set status->done to true.usually within microseconds. A 1s
- * pause means something is seriously AFU and we should panic to
- * provide the proper context to diagnose.
+ * will set status->done to true, usually within microseconds. If not,
+ * then after one second timeout handler should reset the controller
+ * and abort all outstanding requests including this polled one. If
+ * still not after ten seconds, then something is wrong with the driver,
+ * and panic is the only way to recover.
  */
 static __inline
 void
 nvme_completion_poll(struct nvme_completion_poll_status *status)
 {
-   int sanity = hz * 1;
+   int sanity = hz * 10;
 
while (!atomic_load_acq_int(>done) && --sanity > 0)
pause("nvme", 1);
if (sanity <= 0)
-   panic("NVME polled command failed to complete within 1s.");
+   panic("NVME polled command failed to complete within 10s.");
 }
 
 static __inline void

Modified: stable/12/sys/dev/nvme/nvme_qpair.c
==
--- stable/12/sys/dev/nvme/nvme_qpair.c Wed Jun 24 13:48:16 2020
(r362578)
+++ stable/12/sys/dev/nvme/nvme_qpair.c Wed Jun 24 13:49:30 2020
(r362579)
@@ -956,6 +956,7 @@ nvme_qpair_submit_tracker(struct nvme_qpair *qpair, st
 {
struct nvme_request *req;
struct nvme_controller  *ctrlr;
+   int timeout;
 
mtx_assert(>lock, MA_OWNED);
 
@@ -964,9 +965,14 @@ nvme_qpair_submit_tracker(struct nvme_qpair *qpair, st
qpair->act_tr[tr->cid] = tr;
ctrlr = qpair->ctrlr;
 
-   if (req->timeout)
-   callout_reset_on(>timer, ctrlr->timeout_period * hz,
-   nvme_timeout, tr, qpair->cpu);
+   if (req->timeout) {
+   if (req->cb_fn == nvme_completion_poll_cb)
+   timeout = hz;
+   else
+   timeout = ctrlr->timeout_period * hz;
+   callout_reset_on(>timer, timeout, nvme_timeout, tr,
+   qpair->cpu);
+   }
 
/* Copy the command from the tracker to the submission queue. */
memcpy(>cmd[qpair->sq_tail], >cmd, sizeof(req->cmd));
___
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: r362578 - stable/12/sys/dev/nvme

2020-06-24 Thread Alexander Motin
Author: mav
Date: Wed Jun 24 13:48:16 2020
New Revision: 362578
URL: https://svnweb.freebsd.org/changeset/base/362578

Log:
  MFC r362282: Fix admin qpair leak if detached during initial reset.

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

Modified: stable/12/sys/dev/nvme/nvme_ctrlr.c
==
--- stable/12/sys/dev/nvme/nvme_ctrlr.c Wed Jun 24 13:42:42 2020
(r362577)
+++ stable/12/sys/dev/nvme/nvme_ctrlr.c Wed Jun 24 13:48:16 2020
(r362578)
@@ -1422,8 +1422,8 @@ nvme_ctrlr_destruct(struct nvme_controller *ctrlr, dev
nvme_io_qpair_destroy(>ioq[i]);
free(ctrlr->ioq, M_NVME);
nvme_ctrlr_hmb_free(ctrlr);
-   nvme_admin_qpair_destroy(>adminq);
}
+   nvme_admin_qpair_destroy(>adminq);
 
/*
 *  Notify the controller of a shutdown, even though this is due to

Modified: stable/12/sys/dev/nvme/nvme_qpair.c
==
--- stable/12/sys/dev/nvme/nvme_qpair.c Wed Jun 24 13:42:42 2020
(r362577)
+++ stable/12/sys/dev/nvme/nvme_qpair.c Wed Jun 24 13:48:16 2020
(r362578)
@@ -729,6 +729,8 @@ nvme_qpair_construct(struct nvme_qpair *qpair,
if (bus_dmamap_load(qpair->dma_tag, qpair->queuemem_map,
queuemem, allocsz, nvme_single_map, _phys, 0) != 0) {
nvme_printf(ctrlr, "failed to load qpair memory\n");
+   bus_dmamem_free(qpair->dma_tag, qpair->cmd,
+   qpair->queuemem_map);
goto out;
}
 
@@ -811,24 +813,15 @@ nvme_qpair_destroy(struct nvme_qpair *qpair)
 {
struct nvme_tracker *tr;
 
-   if (qpair->tag)
+   if (qpair->tag) {
bus_teardown_intr(qpair->ctrlr->dev, qpair->res, qpair->tag);
-
-   if (mtx_initialized(>lock))
-   mtx_destroy(>lock);
-
-   if (qpair->res)
-   bus_release_resource(qpair->ctrlr->dev, SYS_RES_IRQ,
-   rman_get_rid(qpair->res), qpair->res);
-
-   if (qpair->cmd != NULL) {
-   bus_dmamap_unload(qpair->dma_tag, qpair->queuemem_map);
-   bus_dmamem_free(qpair->dma_tag, qpair->cmd,
-   qpair->queuemem_map);
+   qpair->tag = NULL;
}
 
-   if (qpair->act_tr)
+   if (qpair->act_tr) {
free_domain(qpair->act_tr, M_NVME);
+   qpair->act_tr = NULL;
+   }
 
while (!TAILQ_EMPTY(>free_tr)) {
tr = TAILQ_FIRST(>free_tr);
@@ -838,11 +831,31 @@ nvme_qpair_destroy(struct nvme_qpair *qpair)
free_domain(tr, M_NVME);
}
 
-   if (qpair->dma_tag)
+   if (qpair->cmd != NULL) {
+   bus_dmamap_unload(qpair->dma_tag, qpair->queuemem_map);
+   bus_dmamem_free(qpair->dma_tag, qpair->cmd,
+   qpair->queuemem_map);
+   qpair->cmd = NULL;
+   }
+
+   if (qpair->dma_tag) {
bus_dma_tag_destroy(qpair->dma_tag);
+   qpair->dma_tag = NULL;
+   }
 
-   if (qpair->dma_tag_payload)
+   if (qpair->dma_tag_payload) {
bus_dma_tag_destroy(qpair->dma_tag_payload);
+   qpair->dma_tag_payload = NULL;
+   }
+
+   if (mtx_initialized(>lock))
+   mtx_destroy(>lock);
+
+   if (qpair->res) {
+   bus_release_resource(qpair->ctrlr->dev, SYS_RES_IRQ,
+   rman_get_rid(qpair->res), qpair->res);
+   qpair->res = NULL;
+   }
 }
 
 static void
___
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: r362577 - head/sys/netinet

2020-06-24 Thread Richard Scheffenegger
Author: rscheff
Date: Wed Jun 24 13:42:42 2020
New Revision: 362577
URL: https://svnweb.freebsd.org/changeset/base/362577

Log:
  TCP: make after-idle work for transactional sessions.
  
  The use of t_rcvtime as proxy for the last transmission
  fails for transactional IO, where the client requests
  data before the server can respond with a bulk transfer.
  
  Set aside a dedicated variable to actually track the last
  locally sent segment going forward.
  
  Reported by:  rrs
  Reviewed by:  rrs, tuexen (mentor)
  Approved by:  tuexen (mentor), rgrimes (mentor)
  MFC after:2 weeks
  Sponsored by: NetApp, Inc.
  Differential Revision:https://reviews.freebsd.org/D25016

Modified:
  head/sys/netinet/tcp_output.c
  head/sys/netinet/tcp_var.h

Modified: head/sys/netinet/tcp_output.c
==
--- head/sys/netinet/tcp_output.c   Wed Jun 24 13:11:19 2020
(r362576)
+++ head/sys/netinet/tcp_output.c   Wed Jun 24 13:42:42 2020
(r362577)
@@ -260,7 +260,8 @@ tcp_output(struct tcpcb *tp)
 * to send, then transmit; otherwise, investigate further.
 */
idle = (tp->t_flags & TF_LASTIDLE) || (tp->snd_max == tp->snd_una);
-   if (idle && ticks - tp->t_rcvtime >= tp->t_rxtcur)
+   if (idle && (((ticks - tp->t_rcvtime) >= tp->t_rxtcur) ||
+   (tp->t_sndtime && ((ticks - tp->t_sndtime) >= tp->t_rxtcur
cc_after_idle(tp);
tp->t_flags &= ~TF_LASTIDLE;
if (idle) {
@@ -1502,6 +1503,7 @@ out:
 * Time this transmission if not a retransmission and
 * not currently timing anything.
 */
+   tp->t_sndtime = ticks;
if (tp->t_rtttime == 0) {
tp->t_rtttime = ticks;
tp->t_rtseq = startseq;

Modified: head/sys/netinet/tcp_var.h
==
--- head/sys/netinet/tcp_var.h  Wed Jun 24 13:11:19 2020(r362576)
+++ head/sys/netinet/tcp_var.h  Wed Jun 24 13:42:42 2020(r362577)
@@ -188,8 +188,9 @@ struct tcpcb {
tcp_seq snd_wl2;/* window update seg ack number */
 
tcp_seq irs;/* initial receive sequence number */
-   tcp_seq iss;/* initial send sequence number */
-   u_int   t_acktime;
+   tcp_seq iss;/* initial send sequence number */
+   u_int   t_acktime;  /* RACK and BBR incoming new data was 
acked */
+   u_int   t_sndtime;  /* time last data was sent */
u_int   ts_recent_age;  /* when last updated */
tcp_seq snd_recover;/* for use in NewReno Fast Recovery */
uint16_t cl4_spare; /* Spare to adjust CL 4 */
___
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: r362333 - in head: contrib/flex contrib/flex/src usr.bin/lex usr.bin/lex/lib

2020-06-24 Thread Kyle Evans
On Wed, Jun 24, 2020 at 5:09 AM Dimitry Andric  wrote:
>
> On 24 Jun 2020, at 02:41, Kyle Evans  wrote:
> >
> > On Thu, Jun 18, 2020 at 1:09 PM Jung-uk Kim  wrote:
> >>
> >> Author: jkim
> >> Date: Thu Jun 18 18:09:16 2020
> >> New Revision: 362333
> >> URL: https://svnweb.freebsd.org/changeset/base/362333
> >>
> >> Log:
> >>  MFV:  r362286
> >>
> >>  Merge flex 2.6.4.
> >>
> >
> > Hi,
> >
> > I'm looking at getting amd64 world buildable again by gcc6; this seems
> > to give it some gas:
> >
> > /usr/src/contrib/flex/src/main.c: In function 'check_options':
> > /usr/src/contrib/flex/src/main.c:347:14: error: assignment discards
> > 'const' qualifier from pointer target type
> > [-Werror=discarded-qualifiers]
> >   if ((slash = strrchr(M4, '/')) != NULL) {
> >
> > The following trivial patch seems to make gcc6 happy again.
>
> This is a strange one. As gcc6 has been removed from ports, I had to
> resort to an older 12-STABLE box which still had it, but no matter what
> I try, I cannot get the warning that is being produced by the CI system.
> What does it do differently?
>
> Also, the warning is indeed bogus, as strrchr() returns a non-const char
> pointer. As I can't reproduce it, I also can't verify which gcc version
> fixes the bogus warning.
>

It's bogus, but it's also not-even-wrong given that strrchr doesn't do
anything to make it actually safe to mutate *strrchr() in a scenario
like this where the input is apparently a string literal. I consider
it an anti-footgun measure to make sure we've constified slash here.

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: r362576 - in head/lib: libc/tests/gen libc/tests/stdlib msun/tests

2020-06-24 Thread Mitchell Horne
Author: mhorne
Date: Wed Jun 24 13:11:19 2020
New Revision: 362576
URL: https://svnweb.freebsd.org/changeset/base/362576

Log:
  Enable long double tests on RISC-V
  
  Some of the NetBSD contributed tests are gated behind the
  __HAVE_LONG_DOUBLE flag. This flag seems to be defined only for
  platforms whose long double is larger than their double. I could not
  find this explicitly documented anywhere, but it is implied by the
  definitions in NetBSD's sys/arch/${arch}/include/math.h headers, and the
  following assertion from the UBSAN code:
  
#ifdef __HAVE_LONG_DOUBLE
long double LD;
ASSERT(sizeof(LD) > sizeof(uint64_t));
#endif
  
  RISC-V has 128-bit long doubles, so enable the tests on this platform,
  and update the comments to better explain the purpose of this flag.
  
  Reviewed by:  ngie
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D25419

Modified:
  head/lib/libc/tests/gen/Makefile
  head/lib/libc/tests/stdlib/Makefile
  head/lib/msun/tests/Makefile

Modified: head/lib/libc/tests/gen/Makefile
==
--- head/lib/libc/tests/gen/MakefileWed Jun 24 12:17:40 2020
(r362575)
+++ head/lib/libc/tests/gen/MakefileWed Jun 24 13:11:19 2020
(r362576)
@@ -35,11 +35,12 @@ posix_spawn_test_FILESPACKAGE=  ${PACKAGE}
 
 CFLAGS+=   -DTEST_LONG_DOUBLE
 
-# Not sure why this isn't defined for all architectures, since most
-# have long double.
+# Define __HAVE_LONG_DOUBLE for architectures whose long double has greater
+# precision than their double.
 .if ${MACHINE_CPUARCH} == "aarch64" || \
 ${MACHINE_CPUARCH} == "amd64" || \
-${MACHINE_CPUARCH} == "i386"
+${MACHINE_CPUARCH} == "i386" || \
+${MACHINE_CPUARCH} == "riscv"
 CFLAGS+=   -D__HAVE_LONG_DOUBLE
 .endif
 

Modified: head/lib/libc/tests/stdlib/Makefile
==
--- head/lib/libc/tests/stdlib/Makefile Wed Jun 24 12:17:40 2020
(r362575)
+++ head/lib/libc/tests/stdlib/Makefile Wed Jun 24 13:11:19 2020
(r362576)
@@ -19,11 +19,12 @@ ATF_TESTS_CXX+= cxa_thread_atexit_nothr_test
 # All architectures on FreeBSD have fenv.h
 CFLAGS+=   -D__HAVE_FENV
 
-# Not sure why this isn't defined for all architectures, since most
-# have long double.
+# Define __HAVE_LONG_DOUBLE for architectures whose long double has greater
+# precision than their double.
 .if ${MACHINE_CPUARCH} == "aarch64" || \
 ${MACHINE_CPUARCH} == "amd64" || \
-${MACHINE_CPUARCH} == "i386"
+${MACHINE_CPUARCH} == "i386" || \
+${MACHINE_CPUARCH} == "riscv"
 CFLAGS+=   -D__HAVE_LONG_DOUBLE
 .endif
 

Modified: head/lib/msun/tests/Makefile
==
--- head/lib/msun/tests/MakefileWed Jun 24 12:17:40 2020
(r362575)
+++ head/lib/msun/tests/MakefileWed Jun 24 13:11:19 2020
(r362576)
@@ -10,11 +10,12 @@ CFLAGS+=-DHAVE_FENV_H
 # For isqemu.h
 CFLAGS+=   -I${TESTSRC:H}/libc/gen
 
-# Not sure why this isn't defined for all architectures, since most
-# have long double.
+# Define __HAVE_LONG_DOUBLE for architectures whose long double has greater
+# precision than their double.
 .if ${MACHINE_CPUARCH} == "aarch64" || \
 ${MACHINE_CPUARCH} == "amd64" || \
-${MACHINE_CPUARCH} == "i386"
+${MACHINE_CPUARCH} == "i386" || \
+${MACHINE_CPUARCH} == "riscv"
 CFLAGS+=   -D__HAVE_LONG_DOUBLE
 .endif
 
___
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: r362575 - head/tests/sys/auditpipe

2020-06-24 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Jun 24 12:17:40 2020
New Revision: 362575
URL: https://svnweb.freebsd.org/changeset/base/362575

Log:
  Make sys.auditpipe depend on /dev/auditpipe.  This fixes a few failures
  on armv7.
  
  MFC after:2 weeks
  Sponsored by: DARPA

Modified:
  head/tests/sys/auditpipe/Makefile

Modified: head/tests/sys/auditpipe/Makefile
==
--- head/tests/sys/auditpipe/Makefile   Wed Jun 24 12:15:27 2020
(r362574)
+++ head/tests/sys/auditpipe/Makefile   Wed Jun 24 12:17:40 2020
(r362575)
@@ -5,6 +5,7 @@ TESTSDIR=   ${TESTSBASE}/sys/auditpipe
 ATF_TESTS_C=   auditpipe_test
 
 TEST_METADATA+= required_user="root"
+TEST_METADATA+= required_files="/dev/auditpipe"
 WARNS?=6
 
 .include 
___
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: r362574 - head/sys/dev/uart

2020-06-24 Thread Marcin Wojtas
Author: mw
Date: Wed Jun 24 12:15:27 2020
New Revision: 362574
URL: https://svnweb.freebsd.org/changeset/base/362574

Log:
  Fix AccessWidth and BitWidth parsing in SPCR table
  
  The ACPI Specification defines a Generic Address Structure (GAS),
  which is used to describe UART controller register layout in the
  SPCR table. The driver responsible for parsing it (uart_cpu_acpi)
  wrongly associates the Access Size field to the uart_bas's regshft
  and the register BitWidth to the regiowidth - according to
  the definitions it should be opposite.
  
  This problem remained hidden most likely because the majority of platforms
  use 32-bit registers (BitWidth) which are accessed with the according
  size (Dword). However on Marvell Armada 8k / Cn913x platforms,
  the 32-bit registers should be accessed with Byte granulity, which
  unveiled the issue.
  
  This patch fixes above by proper values assignment and slightly improved
  parsing.
  
  Note that handling of the AccessWidth set to EFI_ACPI_6_0_UNDEFINED is
  needed to work around a buggy SPCR table on EC2 x86 "bare metal" instances.
  
  Reviewed by: manu, imp, cperciva, greg_unrelenting.technology
  Obtained from: Semihalf
  MFC after: 2 weeks
  Differential Revision: https://reviews.freebsd.org/D25373

Modified:
  head/sys/dev/uart/uart_cpu_acpi.c

Modified: head/sys/dev/uart/uart_cpu_acpi.c
==
--- head/sys/dev/uart/uart_cpu_acpi.c   Wed Jun 24 07:25:54 2020
(r362573)
+++ head/sys/dev/uart/uart_cpu_acpi.c   Wed Jun 24 12:15:27 2020
(r362574)
@@ -120,11 +120,46 @@ uart_cpu_acpi_spcr(int devtype, struct uart_devinfo *d
(int)spcr->SerialPort.SpaceId);
goto out;
}
-   if (spcr->SerialPort.AccessWidth == 0)
+   switch (spcr->SerialPort.AccessWidth) {
+   case 0: /* EFI_ACPI_6_0_UNDEFINED */
+   /* FALLTHROUGH */
+   case 1: /* EFI_ACPI_6_0_BYTE */
+   di->bas.regiowidth = 1;
+   break;
+   case 2: /* EFI_ACPI_6_0_WORD */
+   di->bas.regiowidth = 2;
+   break;
+   case 3: /* EFI_ACPI_6_0_DWORD */
+   di->bas.regiowidth = 4;
+   break;
+   case 4: /* EFI_ACPI_6_0_QWORD */
+   di->bas.regiowidth = 8;
+   break;
+   default:
+   printf("UART unsupported access width: %d!\n",
+   (int)spcr->SerialPort.AccessWidth);
+   goto out;
+   }
+   switch (spcr->SerialPort.BitWidth) {
+   case 0:
+   /* FALLTHROUGH */
+   case 8:
di->bas.regshft = 0;
-   else
-   di->bas.regshft = spcr->SerialPort.AccessWidth - 1;
-   di->bas.regiowidth = spcr->SerialPort.BitWidth / 8;
+   break;
+   case 16:
+   di->bas.regshft = 1;
+   break;
+   case 32:
+   di->bas.regshft = 2;
+   break;
+   case 64:
+   di->bas.regshft = 3;
+   break;
+   default:
+   printf("UART unsupported bit width: %d!\n",
+   (int)spcr->SerialPort.BitWidth);
+   goto out;
+   }
switch (spcr->BaudRate) {
case 0:
/* Special value; means "keep current value unchanged". */
___
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: r362333 - in head: contrib/flex contrib/flex/src usr.bin/lex usr.bin/lex/lib

2020-06-24 Thread Dimitry Andric
On 24 Jun 2020, at 02:41, Kyle Evans  wrote:
> 
> On Thu, Jun 18, 2020 at 1:09 PM Jung-uk Kim  wrote:
>> 
>> Author: jkim
>> Date: Thu Jun 18 18:09:16 2020
>> New Revision: 362333
>> URL: https://svnweb.freebsd.org/changeset/base/362333
>> 
>> Log:
>>  MFV:  r362286
>> 
>>  Merge flex 2.6.4.
>> 
> 
> Hi,
> 
> I'm looking at getting amd64 world buildable again by gcc6; this seems
> to give it some gas:
> 
> /usr/src/contrib/flex/src/main.c: In function 'check_options':
> /usr/src/contrib/flex/src/main.c:347:14: error: assignment discards
> 'const' qualifier from pointer target type
> [-Werror=discarded-qualifiers]
>   if ((slash = strrchr(M4, '/')) != NULL) {
> 
> The following trivial patch seems to make gcc6 happy again.

This is a strange one. As gcc6 has been removed from ports, I had to
resort to an older 12-STABLE box which still had it, but no matter what
I try, I cannot get the warning that is being produced by the CI system.
What does it do differently?

Also, the warning is indeed bogus, as strrchr() returns a non-const char
pointer. As I can't reproduce it, I also can't verify which gcc version
fixes the bogus warning.

-Dimitry



signature.asc
Description: Message signed with OpenPGP


svn commit: r362573 - head/tests/sys/geom/class/gate

2020-06-24 Thread Li-Wen Hsu
Author: lwhsu
Date: Wed Jun 24 07:25:54 2020
New Revision: 362573
URL: https://svnweb.freebsd.org/changeset/base/362573

Log:
  Temporarily skip unstable sys.geom.class.gate.ggate_test.ggated on i386 in CI
  
  PR:   244737
  Sponsored by: The FreeBSD Foundation

Modified:
  head/tests/sys/geom/class/gate/ggate_test.sh

Modified: head/tests/sys/geom/class/gate/ggate_test.sh
==
--- head/tests/sys/geom/class/gate/ggate_test.shWed Jun 24 06:35:50 
2020(r362572)
+++ head/tests/sys/geom/class/gate/ggate_test.shWed Jun 24 07:25:54 
2020(r362573)
@@ -16,6 +16,11 @@ ggated_head()
 
 ggated_body()
 {
+   if [ "$(atf_config_get ci false)" = "true" ] && \
+   [ "$(uname -p)" = "i386" ]; then
+   atf_skip "https://bugs.freebsd.org/244737;
+   fi
+
load_ggate
 
us=$(alloc_ggate_dev)
___
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: r362572 - in stable/12/sys: amd64/amd64 i386/i386 x86/include x86/x86

2020-06-24 Thread Konstantin Belousov
Author: kib
Date: Wed Jun 24 06:35:50 2020
New Revision: 362572
URL: https://svnweb.freebsd.org/changeset/base/362572

Log:
  MFC r362031, r362065, r362075:
  amd64 pmap: reorder IPI send and local TLB flush in TLB invalidations.

Modified:
  stable/12/sys/amd64/amd64/pmap.c
  stable/12/sys/i386/i386/pmap.c
  stable/12/sys/i386/i386/vm_machdep.c
  stable/12/sys/x86/include/x86_smp.h
  stable/12/sys/x86/x86/mp_x86.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/amd64/amd64/pmap.c
==
--- stable/12/sys/amd64/amd64/pmap.cWed Jun 24 05:12:00 2020
(r362571)
+++ stable/12/sys/amd64/amd64/pmap.cWed Jun 24 06:35:50 2020
(r362572)
@@ -2412,6 +2412,20 @@ DEFINE_IFUNC(static, void, pmap_invalidate_page_mode, 
return (pmap_invalidate_page_nopcid);
 }
 
+static void
+pmap_invalidate_page_curcpu_cb(pmap_t pmap, vm_offset_t va,
+vm_offset_t addr2 __unused)
+{
+
+   if (pmap == kernel_pmap) {
+   invlpg(va);
+   } else {
+   if (pmap == PCPU_GET(curpmap))
+   invlpg(va);
+   pmap_invalidate_page_mode(pmap, va);
+   }
+}
+
 void
 pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
 {
@@ -2424,16 +2438,8 @@ pmap_invalidate_page(pmap_t pmap, vm_offset_t va)
KASSERT(pmap->pm_type == PT_X86,
("pmap_invalidate_page: invalid type %d", pmap->pm_type));
 
-   sched_pin();
-   if (pmap == kernel_pmap) {
-   invlpg(va);
-   } else {
-   if (pmap == PCPU_GET(curpmap))
-   invlpg(va);
-   pmap_invalidate_page_mode(pmap, va);
-   }
-   smp_masked_invlpg(pmap_invalidate_cpu_mask(pmap), va, pmap);
-   sched_unpin();
+   smp_masked_invlpg(pmap_invalidate_cpu_mask(pmap), va, pmap,
+   pmap_invalidate_page_curcpu_cb);
 }
 
 /* 4k PTEs -- Chosen to exceed the total size of Broadwell L2 TLB */
@@ -2509,10 +2515,26 @@ DEFINE_IFUNC(static, void, pmap_invalidate_range_mode,
return (pmap_invalidate_range_nopcid);
 }
 
+static void
+pmap_invalidate_range_curcpu_cb(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
+{
+   vm_offset_t addr;
+
+   if (pmap == kernel_pmap) {
+   for (addr = sva; addr < eva; addr += PAGE_SIZE)
+   invlpg(addr);
+   } else {
+   if (pmap == PCPU_GET(curpmap)) {
+   for (addr = sva; addr < eva; addr += PAGE_SIZE)
+   invlpg(addr);
+   }
+   pmap_invalidate_range_mode(pmap, sva, eva);
+   }
+}
+
 void
 pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva)
 {
-   vm_offset_t addr;
 
if (eva - sva >= PMAP_INVLPG_THRESHOLD) {
pmap_invalidate_all(pmap);
@@ -2527,19 +2549,8 @@ pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm
KASSERT(pmap->pm_type == PT_X86,
("pmap_invalidate_range: invalid type %d", pmap->pm_type));
 
-   sched_pin();
-   if (pmap == kernel_pmap) {
-   for (addr = sva; addr < eva; addr += PAGE_SIZE)
-   invlpg(addr);
-   } else {
-   if (pmap == PCPU_GET(curpmap)) {
-   for (addr = sva; addr < eva; addr += PAGE_SIZE)
-   invlpg(addr);
-   }
-   pmap_invalidate_range_mode(pmap, sva, eva);
-   }
-   smp_masked_invlpg_range(pmap_invalidate_cpu_mask(pmap), sva, eva, pmap);
-   sched_unpin();
+   smp_masked_invlpg_range(pmap_invalidate_cpu_mask(pmap), sva, eva, pmap,
+   pmap_invalidate_range_curcpu_cb);
 }
 
 static inline void
@@ -2626,6 +2637,14 @@ DEFINE_IFUNC(static, void, pmap_invalidate_all_mode, (
return (pmap_invalidate_all_nopcid);
 }
 
+static void
+pmap_invalidate_all_curcpu_cb(pmap_t pmap, vm_offset_t addr1 __unused,
+vm_offset_t addr2 __unused)
+{
+
+   pmap_invalidate_all_mode(pmap);
+}
+
 void
 pmap_invalidate_all(pmap_t pmap)
 {
@@ -2638,20 +2657,23 @@ pmap_invalidate_all(pmap_t pmap)
KASSERT(pmap->pm_type == PT_X86,
("pmap_invalidate_all: invalid type %d", pmap->pm_type));
 
-   sched_pin();
-   pmap_invalidate_all_mode(pmap);
-   smp_masked_invltlb(pmap_invalidate_cpu_mask(pmap), pmap);
-   sched_unpin();
+   smp_masked_invltlb(pmap_invalidate_cpu_mask(pmap), pmap,
+   pmap_invalidate_all_curcpu_cb);
 }
 
+static void
+pmap_invalidate_cache_curcpu_cb(pmap_t pmap __unused, vm_offset_t va __unused,
+vm_offset_t addr2 __unused)
+{
+
+   wbinvd();
+}
+
 void
 pmap_invalidate_cache(void)
 {
 
-   sched_pin();
-   wbinvd();
-   smp_cache_flush();
-   sched_unpin();
+   smp_cache_flush(pmap_invalidate_cache_curcpu_cb);
 }
 
 struct pde_action {

Modified: stable/12/sys/i386/i386/pmap.c