CVS commit: [bouyer-xenpvh] src/sys/arch/amd64/amd64

2020-04-09 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Apr  9 21:01:33 UTC 2020

Modified Files:
src/sys/arch/amd64/amd64 [bouyer-xenpvh]: spl.S

Log Message:
Fix a second place where %eax is used with the wrong value.


To generate a diff of this commit:
cvs rdiff -u -r1.43.4.1 -r1.43.4.2 src/sys/arch/amd64/amd64/spl.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/amd64/spl.S
diff -u src/sys/arch/amd64/amd64/spl.S:1.43.4.1 src/sys/arch/amd64/amd64/spl.S:1.43.4.2
--- src/sys/arch/amd64/amd64/spl.S:1.43.4.1	Thu Apr  9 16:51:00 2020
+++ src/sys/arch/amd64/amd64/spl.S	Thu Apr  9 21:01:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: spl.S,v 1.43.4.1 2020/04/09 16:51:00 bouyer Exp $	*/
+/*	$NetBSD: spl.S,v 1.43.4.2 2020/04/09 21:01:33 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -322,8 +322,9 @@ IDTVEC(spllower)
 	pushq	%r12
 	movl	%edi,%ebx
 	leaq	1f(%rip),%r13		/* address to resume loop at */
-1:	movl	%ebx,%eax		/* get cpl */
+1:
 #if !defined(XENPV)
+	movl	%ebx,%eax		/* get cpl */
 	movl	CPUVAR(IUNMASK)(,%rax,4),%eax
 	CLI(si)
 	andl	CPUVAR(IPENDING),%eax	/* any non-masked bits left? */
@@ -335,6 +336,7 @@ IDTVEC(spllower)
 #endif
 2:
 #if defined(XEN)
+	movl	%ebx,%eax		/* get cpl */
 	movl	CPUVAR(XUNMASK)(,%rax,4),%eax
 	CLI(si)
 	andl	CPUVAR(XPENDING),%eax	/* any non-masked bits left? */



CVS commit: src/sys/arch/xen

2020-04-09 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Thu Apr  9 19:26:38 UTC 2020

Modified Files:
src/sys/arch/xen/conf: std.xenversion
src/sys/arch/xen/include: xen.h
src/sys/arch/xen/x86: xen_bus_dma.c
src/sys/arch/xen/xen: balloon.c xengnt.c

Log Message:
update to __XEN_INTERFACE_VERSION__ 0x0003020a aka Xen 3.2.10

this brings grant memory v2 support:
- status separated from flags - revoking access needs just memory barrier,
  no need for expensive cmpxchg16 any more
- sub-page hypervisor copy-only grants, to be used by xennet(4)
- 64-bit frame, i.e. support for DomU RAM >16TB

the grant table is now always allocated on boot to maximum size, it's now
never grown in runtime; switch back to regular kmem_alloc()/kmem_free()

code now requires v2 support, no compatibility for grant version 1 retained -
Xen v2 support predates all currently supported Xen versions

also interface for baloon changed slightly, code updated


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/xen/conf/std.xenversion
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/xen/include/xen.h
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/xen/x86/xen_bus_dma.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/xen/xen/balloon.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/xen/xen/xengnt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/conf/std.xenversion
diff -u src/sys/arch/xen/conf/std.xenversion:1.1 src/sys/arch/xen/conf/std.xenversion:1.2
--- src/sys/arch/xen/conf/std.xenversion:1.1	Thu Apr  9 14:39:10 2020
+++ src/sys/arch/xen/conf/std.xenversion	Thu Apr  9 19:26:37 2020
@@ -1,6 +1,6 @@
-# $NetBSD: std.xenversion,v 1.1 2020/04/09 14:39:10 jdolecek Exp $
+# $NetBSD: std.xenversion,v 1.2 2020/04/09 19:26:37 jdolecek Exp $
 #
 # Xen options shared for all archs (i386, amd64)
 
-options 	__XEN_INTERFACE_VERSION__=0x00030208 # Xen 3.1 interface
+options 	__XEN_INTERFACE_VERSION__=0x0003020a # Xen 3.2.10 interface
 

Index: src/sys/arch/xen/include/xen.h
diff -u src/sys/arch/xen/include/xen.h:1.44 src/sys/arch/xen/include/xen.h:1.45
--- src/sys/arch/xen/include/xen.h:1.44	Thu May  9 17:09:50 2019
+++ src/sys/arch/xen/include/xen.h	Thu Apr  9 19:26:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen.h,v 1.44 2019/05/09 17:09:50 bouyer Exp $	*/
+/*	$NetBSD: xen.h,v 1.45 2020/04/09 19:26:37 jdolecek Exp $	*/
 
 /*
  *
@@ -170,20 +170,6 @@ xen_atomic_xchg(volatile XATOMIC_T *ptr,
 	return result;
 }
 
-static inline uint16_t
-xen_atomic_cmpxchg16(volatile uint16_t *ptr, uint16_t  val, uint16_t newval)
-{
-	unsigned long result;
-
-__asm volatile(__LOCK_PREFIX
-	"cmpxchgw %w1,%2"
-	:"=a" (result)
-	:"q"(newval), "m" (*ptr), "0" (val)
-	:"memory");
-
-	return result;
-}
-
 static __inline void
 xen_atomic_setbits_l (volatile XATOMIC_T *ptr, unsigned long bits) {  
 #ifdef __x86_64__

Index: src/sys/arch/xen/x86/xen_bus_dma.c
diff -u src/sys/arch/xen/x86/xen_bus_dma.c:1.28 src/sys/arch/xen/x86/xen_bus_dma.c:1.29
--- src/sys/arch/xen/x86/xen_bus_dma.c:1.28	Mon Sep  3 16:29:29 2018
+++ src/sys/arch/xen/x86/xen_bus_dma.c	Thu Apr  9 19:26:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_bus_dma.c,v 1.28 2018/09/03 16:29:29 riastradh Exp $	*/
+/*	$NetBSD: xen_bus_dma.c,v 1.29 2020/04/09 19:26:37 jdolecek Exp $	*/
 /*	NetBSD bus_dma.c,v 1.21 2005/04/16 07:53:35 yamt Exp */
 
 /*-
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xen_bus_dma.c,v 1.28 2018/09/03 16:29:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_bus_dma.c,v 1.29 2020/04/09 19:26:37 jdolecek Exp $");
 
 #include 
 #include 
@@ -94,7 +94,7 @@ _xen_alloc_contig(bus_size_t size, bus_s
 		set_xen_guest_handle(res.extent_start, );
 		res.nr_extents = 1;
 		res.extent_order = 0;
-		res.address_bits = 0;
+		res.mem_flags = 0;
 		res.domid = DOMID_SELF;
 		error = HYPERVISOR_memory_op(XENMEM_decrease_reservation, );
 		if (error != 1) {
@@ -113,14 +113,14 @@ _xen_alloc_contig(bus_size_t size, bus_s
 	set_xen_guest_handle(res.extent_start, );
 	res.nr_extents = 1;
 	res.extent_order = order;
-	res.address_bits = get_order(high) + PAGE_SHIFT;
+	res.mem_flags = XENMEMF_address_bits(get_order(high) + PAGE_SHIFT);
 	res.domid = DOMID_SELF;
 	error = HYPERVISOR_memory_op(XENMEM_increase_reservation, );
 	if (error != 1) {
 #ifdef DEBUG
 		printf("xen_alloc_contig: XENMEM_increase_reservation "
-		"failed: %d (order %d address_bits %d)\n",
-		error, order, res.address_bits);
+		"failed: %d (order %d mem_flags %d)\n",
+		error, order, res.mem_flags);
 #endif
 		error = ENOMEM;
 		pg = NULL;
@@ -166,7 +166,7 @@ failed:
 		set_xen_guest_handle(res.extent_start, );
 		res.nr_extents = 1;
 		res.extent_order = 0;
-		res.address_bits = 32;
+		res.mem_flags = XENMEMF_address_bits(32);
 		res.domid = DOMID_SELF;
 		if (HYPERVISOR_memory_op(XENMEM_increase_reservation, )
 		< 0) {

Index: src/sys/arch/xen/xen/balloon.c
diff 

CVS commit: src/sys/external/bsd/ipf/netinet

2020-04-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  9 18:20:40 UTC 2020

Modified Files:
src/sys/external/bsd/ipf/netinet: fil.c

Log Message:
PR/55149: Kouichi Hashikawa: Get morefrag before we strip it out from off


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/external/bsd/ipf/netinet/fil.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/ipf/netinet/fil.c
diff -u src/sys/external/bsd/ipf/netinet/fil.c:1.32 src/sys/external/bsd/ipf/netinet/fil.c:1.33
--- src/sys/external/bsd/ipf/netinet/fil.c:1.32	Sat Apr  4 22:50:27 2020
+++ src/sys/external/bsd/ipf/netinet/fil.c	Thu Apr  9 14:20:40 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fil.c,v 1.32 2020/04/05 02:50:27 christos Exp $	*/
+/*	$NetBSD: fil.c,v 1.33 2020/04/09 18:20:40 christos Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -141,7 +141,7 @@ extern struct timeout ipf_slowtimer_ch;
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.32 2020/04/05 02:50:27 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.33 2020/04/09 18:20:40 christos Exp $");
 #else
 static const char sccsid[] = "@(#)fil.c	1.36 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: fil.c,v 1.1.1.2 2012/07/22 13:45:07 darrenr Exp $";
@@ -1724,11 +1724,10 @@ ipf_pr_ipv4hdr(fr_info_t *fin)
 	 */
 	off &= IP_MF|IP_OFFMASK;
 	if (off != 0) {
+		int morefrag = off & IP_MF;
 		fi->fi_flx |= FI_FRAG;
 		off &= IP_OFFMASK;
 		if (off != 0) {
-			int morefrag = off & IP_MF;
-
 			if (off == 1 && p == IPPROTO_TCP) {
 fin->fin_flx |= FI_SHORT;   /* RFC 3128 */
 DT1(ipf_fi_tcp_frag_off_1, fr_info_t *, fin);



CVS commit: [bouyer-xenpvh] src/sys/arch/amd64/amd64

2020-04-09 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Apr  9 16:51:00 UTC 2020

Modified Files:
src/sys/arch/amd64/amd64 [bouyer-xenpvh]: spl.S

Log Message:
restore %eax before using it. This bug caused event handlers to be called
spuriously at high spl or in a reentrant manner.
Now a amd64 PVHVM domU can checkout pkgsrc and build packages without panic.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.43.4.1 src/sys/arch/amd64/amd64/spl.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/amd64/spl.S
diff -u src/sys/arch/amd64/amd64/spl.S:1.43 src/sys/arch/amd64/amd64/spl.S:1.43.4.1
--- src/sys/arch/amd64/amd64/spl.S:1.43	Wed Jan  8 17:38:41 2020
+++ src/sys/arch/amd64/amd64/spl.S	Thu Apr  9 16:51:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: spl.S,v 1.43 2020/01/08 17:38:41 ad Exp $	*/
+/*	$NetBSD: spl.S,v 1.43.4.1 2020/04/09 16:51:00 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -366,8 +366,9 @@ IDTVEC(doreti)
 	popq	%rbx			/* get previous priority */
 	decl	CPUVAR(IDEPTH)
 	leaq	1f(%rip),%r13
-1:	movl	%ebx,%eax
+1:
 #if !defined(XENPV)
+	movl%ebx,%eax
 	movl	CPUVAR(IUNMASK)(,%rax,4),%eax
 	CLI(si)
 	andl	CPUVAR(IPENDING),%eax
@@ -379,6 +380,7 @@ IDTVEC(doreti)
 #endif
 2:
 #if defined(XEN)
+	movl%ebx,%eax
 	movl	CPUVAR(XUNMASK)(,%rax,4),%eax
 	CLI(si)
 	andl	CPUVAR(XPENDING),%eax



CVS commit: [bouyer-xenpvh] src/sys/arch

2020-04-09 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Apr  9 16:12:50 UTC 2020

Modified Files:
src/sys/arch/amd64/amd64 [bouyer-xenpvh]: machdep.c
src/sys/arch/i386/i386 [bouyer-xenpvh]: machdep.c

Log Message:
For RB_POWERDONW, call HYPERVISOR_shutdown() in all cases where the
hypercall page is available. A PVHHVM domU now properly exits on
halt -p


To generate a diff of this commit:
cvs rdiff -u -r1.346 -r1.346.4.1 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.825 -r1.825.4.1 src/sys/arch/i386/i386/machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.346 src/sys/arch/amd64/amd64/machdep.c:1.346.4.1
--- src/sys/arch/amd64/amd64/machdep.c:1.346	Fri Jan 31 08:21:11 2020
+++ src/sys/arch/amd64/amd64/machdep.c	Thu Apr  9 16:12:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.346 2020/01/31 08:21:11 maxv Exp $	*/
+/*	$NetBSD: machdep.c,v 1.346.4.1 2020/04/09 16:12:50 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -110,7 +110,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.346 2020/01/31 08:21:11 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.346.4.1 2020/04/09 16:12:50 bouyer Exp $");
 
 #include "opt_modular.h"
 #include "opt_user_ldt.h"
@@ -729,9 +729,12 @@ haltsys:
 
 		acpi_enter_sleep_state(ACPI_STATE_S5);
 #endif
-#ifdef XENPV
-		HYPERVISOR_shutdown();
-#endif /* XENPV */
+#ifdef XEN
+		if (vm_guest == VM_GUEST_XENPV ||
+		vm_guest == VM_GUEST_XENPVH ||
+		vm_guest == VM_GUEST_XENPVHVM)
+			HYPERVISOR_shutdown();
+#endif /* XEN */
 	}
 
 	cpu_broadcast_halt();

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.825 src/sys/arch/i386/i386/machdep.c:1.825.4.1
--- src/sys/arch/i386/i386/machdep.c:1.825	Fri Jan 31 08:21:11 2020
+++ src/sys/arch/i386/i386/machdep.c	Thu Apr  9 16:12:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.825 2020/01/31 08:21:11 maxv Exp $	*/
+/*	$NetBSD: machdep.c,v 1.825.4.1 2020/04/09 16:12:50 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009, 2017
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.825 2020/01/31 08:21:11 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.825.4.1 2020/04/09 16:12:50 bouyer Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_freebsd.h"
@@ -793,10 +793,12 @@ haltsys:
 #else
 		__USE(s);
 #endif
-#ifdef XENPV
-		HYPERVISOR_shutdown();
-		for (;;);
-#endif
+#ifdef XEN
+		if (vm_guest == VM_GUEST_XENPV ||
+		vm_guest == VM_GUEST_XENPVH ||
+		vm_guest == VM_GUEST_XENPVHVM)
+			HYPERVISOR_shutdown();
+#endif /* XEN */
 	}
 
 #ifdef MULTIPROCESSOR



CVS commit: src/external/gpl3/binutils/dist/ld

2020-04-09 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Apr  9 16:12:28 UTC 2020

Modified Files:
src/external/gpl3/binutils/dist/ld: configure.tgt

Log Message:
Fix aarch64 binutils tools build


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/external/gpl3/binutils/dist/ld/configure.tgt

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/ld/configure.tgt
diff -u src/external/gpl3/binutils/dist/ld/configure.tgt:1.33 src/external/gpl3/binutils/dist/ld/configure.tgt:1.34
--- src/external/gpl3/binutils/dist/ld/configure.tgt:1.33	Fri Apr  3 23:48:48 2020
+++ src/external/gpl3/binutils/dist/ld/configure.tgt	Thu Apr  9 16:12:28 2020
@@ -75,11 +75,14 @@ aarch64_be-*-linux*)	targ_emul=aarch64li
 			;;
 aarch64-*-linux*)	targ_emul=aarch64linux
 			targ_extra_libpath="aarch64linuxb aarch64linux32 aarch64linux32b armelfb_linux_eabi armelf_linux_eabi"
-			targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb $targ_extra_libpath" ;;
+			targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb $targ_extra_libpath"
+			;;
 aarch64_be-*-netbsd*)	targ_emul=aarch64nbsdb
-			targ_extra_emuls="aarch64nbsd aarch64elfb aarch64elf armelfb_nbsd_eabihf armelf_nbsd_eabihf armelfb_nbsd_eabi armelf_nbsd_eabi armelfb_nbsd armelf_nbsd armelf armelfb" ;;
+			targ_extra_emuls="aarch64nbsd aarch64elfb aarch64elf armelfb_nbsd_eabihf armelf_nbsd_eabihf armelfb_nbsd_eabi armelf_nbsd_eabi armelfb_nbsd armelf_nbsd armelf armelfb"
+			;;
 aarch64-*-netbsd*)	targ_emul=aarch64nbsd
-			targ_extra_emuls="aarch64nbsdb aarch64elf aarch64elfb armelf_nbsd_eabihf armelfb_nbsd_eabihf armelf_nbsd_eabi armelfb_nbsd_eabi armelf_nbsd armelfb_nbsd armelf armelfb" ;;
+			targ_extra_emuls="aarch64nbsdb aarch64elf aarch64elfb armelf_nbsd_eabihf armelfb_nbsd_eabihf armelf_nbsd_eabi armelfb_nbsd_eabi armelf_nbsd armelfb_nbsd armelf armelfb"
+			;;
 alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
 			targ_emul=elf64alpha_fbsd
 			targ_extra_emuls="elf64alpha alpha"



CVS commit: src/sys/arch/xen/xen

2020-04-09 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Apr  9 15:54:41 UTC 2020

Modified Files:
src/sys/arch/xen/xen: xengnt.c

Log Message:
xengnt_more_entries() can be called from interrupt context so use
kmem_intr_alloc()/free() here


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/xen/xen/xengnt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/xen/xengnt.c
diff -u src/sys/arch/xen/xen/xengnt.c:1.29 src/sys/arch/xen/xen/xengnt.c:1.30
--- src/sys/arch/xen/xen/xengnt.c:1.29	Tue Apr  7 09:05:14 2020
+++ src/sys/arch/xen/xen/xengnt.c	Thu Apr  9 15:54:41 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: xengnt.c,v 1.29 2020/04/07 09:05:14 jdolecek Exp $  */
+/*  $NetBSD: xengnt.c,v 1.30 2020/04/09 15:54:41 bouyer Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1.29 2020/04/07 09:05:14 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1.30 2020/04/09 15:54:41 bouyer Exp $");
 
 #include 
 #include 
@@ -170,7 +170,7 @@ xengnt_more_entries(void)
 		return ENOMEM;
 
 	sz = nframes_new * sizeof(u_long);
-	pages = kmem_alloc(sz, KM_NOSLEEP);
+	pages = kmem_intr_alloc(sz, KM_NOSLEEP);
 	if (pages == NULL)
 		return ENOMEM;
 
@@ -209,7 +209,7 @@ xengnt_more_entries(void)
 		if (setup.status != GNTST_okay) {
 			aprint_error("%s: setup table returned %d\n",
 			__func__, setup.status);
-			kmem_free(pages, sz);
+			kmem_intr_free(pages, sz);
 			return ENOMEM;
 		}
 	}
@@ -244,7 +244,7 @@ xengnt_more_entries(void)
 		last_gnt_entry++;
 	}
 	gnt_nr_grant_frames = nframes_new;
-	kmem_free(pages, sz);
+	kmem_intr_free(pages, sz);
 	return 0;
 }
 



CVS commit: src/usr.sbin/postinstall

2020-04-09 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Apr  9 15:24:31 UTC 2020

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
Fix dhcpcd $DEST_DIR support


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/postinstall/postinstall.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/postinstall/postinstall.in
diff -u src/usr.sbin/postinstall/postinstall.in:1.18 src/usr.sbin/postinstall/postinstall.in:1.19
--- src/usr.sbin/postinstall/postinstall.in:1.18	Mon Apr  6 13:10:48 2020
+++ src/usr.sbin/postinstall/postinstall.in	Thu Apr  9 15:24:31 2020
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall.in,v 1.18 2020/04/06 13:10:48 roy Exp $
+# $NetBSD: postinstall.in,v 1.19 2020/04/09 15:24:31 roy Exp $
 #
 # Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -945,7 +945,7 @@ do_dhcpcd()
 	populate_dir "$op" true "${dir}" "${DEST_DIR}/etc" 644 dhcpcd.conf
 	failed=$(( ${failed} + $? ))
 
-	dstdir="${DESTDIR}/var/chroot/dhcpcd"
+	dstdir="${DEST_DIR}/var/chroot/dhcpcd"
 
 	check_dir "${op}" "${dstdir}/var/db/dhcpcd" 755
 	failed=$(( ${failed} + $? ))



CVS commit: src/sbin/tunefs

2020-04-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  9 14:44:38 UTC 2020

Modified Files:
src/sbin/tunefs: tunefs.c

Log Message:
Refresh the superblock in memory if changing a mounted partition.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sbin/tunefs/tunefs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/tunefs/tunefs.c
diff -u src/sbin/tunefs/tunefs.c:1.50 src/sbin/tunefs/tunefs.c:1.51
--- src/sbin/tunefs/tunefs.c:1.50	Thu Apr 11 21:14:37 2019
+++ src/sbin/tunefs/tunefs.c	Thu Apr  9 10:44:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tunefs.c,v 1.50 2019/04/12 01:14:37 pgoyette Exp $	*/
+/*	$NetBSD: tunefs.c,v 1.51 2020/04/09 14:44:38 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)tunefs.c	8.3 (Berkeley) 5/3/95";
 #else
-__RCSID("$NetBSD: tunefs.c,v 1.50 2019/04/12 01:14:37 pgoyette Exp $");
+__RCSID("$NetBSD: tunefs.c,v 1.51 2020/04/09 14:44:38 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -47,10 +47,12 @@ __RCSID("$NetBSD: tunefs.c,v 1.50 2019/0
  * tunefs: change layout parameters to an existing file system.
  */
 #include 
+#include 
 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -103,9 +105,10 @@ main(int argc, char *argv[])
 	const char	*special, *chg[2];
 	char		device[MAXPATHLEN];
 	int		maxbpg, minfree, optim, secsize;
-	int		avgfilesize, avgfpdir;
+	int		avgfilesize, avgfpdir, active;
 	long long	logfilesize;
 	int		secshift, fsbtodb;
+	struct statvfs	sfs;
 
 	Aflag = Fflag = Nflag = 0;
 	maxbpg = minfree = optim = secsize = -1;
@@ -203,6 +206,7 @@ main(int argc, char *argv[])
 		fi = openpartition(special, openflags, device, sizeof(device));
 		special = device;
 	}
+	active = fstatvfs(fi, ) != -1;
 	if (fi == -1)
 		err(1, "%s", special);
 	getsb(, special);
@@ -365,6 +369,18 @@ main(int argc, char *argv[])
 	/* write superblock to original coordinates (use old dev_bsize!) */
 	bwrite(sblockloc, buf.data, SBLOCKSIZE, special);
 
+	if (active) {
+		struct ufs_args args;
+		args.fspec = sfs.f_mntfromname;
+		if (mount(MOUNT_FFS, sfs.f_mntonname, sfs.f_flag | MNT_UPDATE,
+		 , sizeof args) == -1)
+			 warn("mount");
+		else
+			printf("%s: mount of %s on %s updated\n",
+			getprogname(), sfs.f_mntfromname, sfs.f_mntonname);
+	}
+
+
 	/* correct dev_bsize from possibly changed superblock data */
 	dev_bsize = sblock.fs_fsize / FFS_FSBTODB(, 1);
 



CVS commit: src/sys/arch

2020-04-09 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Thu Apr  9 14:39:10 UTC 2020

Modified Files:
src/sys/arch/amd64/conf: std.xen
src/sys/arch/i386/conf: XEN3PAE_DOM0 XEN3PAE_DOMU XEN3PAE_PVHVM
Added Files:
src/sys/arch/i386/conf: std.xen
src/sys/arch/xen/conf: std.xenversion
Removed Files:
src/sys/arch/xen/conf: std.xen

Log Message:
move xen/conf/std.xen to i386/conf/std.xen, it's i386-specific

split off __XEN_INTERFACE_VERSION__ to new xen/conf/std.xenversion
and use from both i386/conf/std.xen and amd64/conf/stf.xen, so that
there is single place for the definition


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/amd64/conf/std.xen
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/i386/conf/XEN3PAE_DOM0
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/i386/conf/XEN3PAE_DOMU
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/conf/XEN3PAE_PVHVM
cvs rdiff -u -r0 -r1.1 src/sys/arch/i386/conf/std.xen
cvs rdiff -u -r1.10 -r0 src/sys/arch/xen/conf/std.xen
cvs rdiff -u -r0 -r1.1 src/sys/arch/xen/conf/std.xenversion

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/conf/std.xen
diff -u src/sys/arch/amd64/conf/std.xen:1.11 src/sys/arch/amd64/conf/std.xen:1.12
--- src/sys/arch/amd64/conf/std.xen:1.11	Mon Feb  4 18:14:53 2019
+++ src/sys/arch/amd64/conf/std.xen	Thu Apr  9 14:39:10 2020
@@ -1,4 +1,4 @@
-# $NetBSD: std.xen,v 1.11 2019/02/04 18:14:53 cherry Exp $
+# $NetBSD: std.xen,v 1.12 2020/04/09 14:39:10 jdolecek Exp $
 # NetBSD: std.i386,v 1.24 2003/02/26 21:33:36 fvdl Exp 
 #
 # standard, required NetBSD/i386 'options'
@@ -7,8 +7,8 @@ machine xen amd64
 include 	"conf/std"	# MI standard options
 
 options 	XEN	#Xen support
-options 	__XEN_INTERFACE_VERSION__=0x00030208 # Xen 3.1 interface
-#options 	__XEN_INTERFACE_VERSION__=0x00030205 # Xen 3.1 interface
+
+include		"arch/xen/conf/std.xenversion"
 
 options 	CPU_IN_CKSUM
 options 	EXEC_ELF64	# exec ELF binaries

Index: src/sys/arch/i386/conf/XEN3PAE_DOM0
diff -u src/sys/arch/i386/conf/XEN3PAE_DOM0:1.21 src/sys/arch/i386/conf/XEN3PAE_DOM0:1.22
--- src/sys/arch/i386/conf/XEN3PAE_DOM0:1.21	Wed Mar 25 17:06:19 2020
+++ src/sys/arch/i386/conf/XEN3PAE_DOM0	Thu Apr  9 14:39:10 2020
@@ -1,8 +1,8 @@
-#	$NetBSD: XEN3PAE_DOM0,v 1.21 2020/03/25 17:06:19 jdolecek Exp $
+#	$NetBSD: XEN3PAE_DOM0,v 1.22 2020/04/09 14:39:10 jdolecek Exp $
 #
 #	XEN3_0: Xen 3.0 domain0 kernel
 
-include 	"arch/xen/conf/std.xen"
+include 	"arch/i386/conf/std.xen"
 
 options		XENPV		# PV dom0 support
 #options 	MULTIPROCESSOR	# (not yet - dom0 stuff is not MP-safe)

Index: src/sys/arch/i386/conf/XEN3PAE_DOMU
diff -u src/sys/arch/i386/conf/XEN3PAE_DOMU:1.8 src/sys/arch/i386/conf/XEN3PAE_DOMU:1.9
--- src/sys/arch/i386/conf/XEN3PAE_DOMU:1.8	Wed Mar 25 17:06:19 2020
+++ src/sys/arch/i386/conf/XEN3PAE_DOMU	Thu Apr  9 14:39:10 2020
@@ -1,6 +1,6 @@
-# $NetBSD: XEN3PAE_DOMU,v 1.8 2020/03/25 17:06:19 jdolecek Exp $
+# $NetBSD: XEN3PAE_DOMU,v 1.9 2020/04/09 14:39:10 jdolecek Exp $
 
-include 	"arch/xen/conf/std.xen"
+include 	"arch/i386/conf/std.xen"
 
 options		XENPV		# PV domU support
 options 	MULTIPROCESSOR

Index: src/sys/arch/i386/conf/XEN3PAE_PVHVM
diff -u src/sys/arch/i386/conf/XEN3PAE_PVHVM:1.3 src/sys/arch/i386/conf/XEN3PAE_PVHVM:1.4
--- src/sys/arch/i386/conf/XEN3PAE_PVHVM:1.3	Mon Apr  6 19:28:21 2020
+++ src/sys/arch/i386/conf/XEN3PAE_PVHVM	Thu Apr  9 14:39:10 2020
@@ -1,6 +1,6 @@
-# $NetBSD: XEN3PAE_PVHVM,v 1.3 2020/04/06 19:28:21 bouyer Exp $
+# $NetBSD: XEN3PAE_PVHVM,v 1.4 2020/04/09 14:39:10 jdolecek Exp $
 
-include 	"arch/xen/conf/std.xen"
+include 	"arch/i386/conf/std.xen"
 
 options		XENPVHVM		# PVHVM domU support
 

Added files:

Index: src/sys/arch/i386/conf/std.xen
diff -u /dev/null src/sys/arch/i386/conf/std.xen:1.1
--- /dev/null	Thu Apr  9 14:39:10 2020
+++ src/sys/arch/i386/conf/std.xen	Thu Apr  9 14:39:10 2020
@@ -0,0 +1,25 @@
+# $NetBSD: std.xen,v 1.1 2020/04/09 14:39:10 jdolecek Exp $
+# NetBSD: std.i386,v 1.24 2003/02/26 21:33:36 fvdl Exp 
+#
+# standard, required NetBSD/i386 'options'
+
+machine xen i386
+include		"conf/std"	# MI standard options
+
+include		"arch/xen/conf/std.xenversion"
+
+options 	EXEC_AOUT	# exec a.out binaries
+options 	EXEC_ELF32	# exec ELF binaries
+options 	EXEC_SCRIPT	# exec #! scripts
+
+options 	CPU_IN_CKSUM
+#options 	CRYPTO_MD_DES_ENC	# machine-dependent code for DES
+#options 	CRYPTO_MD_DES_CBC	# machine-dependent DES CBC code
+#options 	CRYPTO_MD_BF_ENC	# machine-dependent code for BF_encrypt
+#options 	CRYPTO_MD_BF_CBC	# careful: uses bswapl, requires 486
+
+options 	CHILD_MAX=1024	# 160 is too few
+options 	OPEN_MAX=1024	# 128 is too few
+
+# Atheros HAL options
+include "external/isc/atheros_hal/conf/std.ath_hal"

Index: src/sys/arch/xen/conf/std.xenversion
diff -u /dev/null src/sys/arch/xen/conf/std.xenversion:1.1
--- /dev/null	Thu Apr  9 14:39:10 2020
+++ 

CVS commit: [netbsd-9] src/doc

2020-04-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr  9 11:29:33 UTC 2020

Modified Files:
src/doc [netbsd-9]: CHANGES-9.1

Log Message:
Ticket #824


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.31 -r1.1.2.32 src/doc/CHANGES-9.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-9.1
diff -u src/doc/CHANGES-9.1:1.1.2.31 src/doc/CHANGES-9.1:1.1.2.32
--- src/doc/CHANGES-9.1:1.1.2.31	Mon Apr  6 14:59:48 2020
+++ src/doc/CHANGES-9.1	Thu Apr  9 11:29:33 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.1,v 1.1.2.31 2020/04/06 14:59:48 martin Exp $
+# $NetBSD: CHANGES-9.1,v 1.1.2.32 2020/04/09 11:29:33 martin Exp $
 
 A complete list of changes from the NetBSD 9.0 release to the NetBSD 9.1
 release:
@@ -812,3 +812,8 @@ sys/dev/cgdvar.h1.19
 	Make device mpsafe.
 	[riastradh, ticket #823]
 
+usr.bin/man/man.c1.68
+
+	Exit successfully after printing the search path (-p option).
+	[maya, ticket #824]
+



CVS commit: [netbsd-9] src/usr.bin/man

2020-04-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr  9 11:28:32 UTC 2020

Modified Files:
src/usr.bin/man [netbsd-9]: man.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #824):

usr.bin/man/man.c: revision 1.68

Exit successfully after printing the search path, stop further processing.

Continuing to process had the unintended effect that `man` failed to find
a matching manual page for {EMPTY LIST OF REQUESTED MANUAL PAGES}, and
exited with 1.

Prompted by a fish shell snippet that tried and failed to distinguish between
FreeBSD man (-p takes argument) and NetBSD man (-p no argument) by comparing
`man -p` exit code.

ok riastradh, logix (which also pointed out the manual page SYNOPSIS is
saying man -p should be used this way).


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.67.4.1 src/usr.bin/man/man.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/man/man.c
diff -u src/usr.bin/man/man.c:1.67 src/usr.bin/man/man.c:1.67.4.1
--- src/usr.bin/man/man.c:1.67	Fri Jun 15 20:16:35 2018
+++ src/usr.bin/man/man.c	Thu Apr  9 11:28:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: man.c,v 1.67 2018/06/15 20:16:35 mrg Exp $	*/
+/*	$NetBSD: man.c,v 1.67.4.1 2020/04/09 11:28:32 martin Exp $	*/
 
 /*
  * Copyright (c) 1987, 1993, 1994, 1995
@@ -40,7 +40,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 19
 #if 0
 static char sccsid[] = "@(#)man.c	8.17 (Berkeley) 1/31/95";
 #else
-__RCSID("$NetBSD: man.c,v 1.67 2018/06/15 20:16:35 mrg Exp $");
+__RCSID("$NetBSD: man.c,v 1.67.4.1 2020/04/09 11:28:32 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -363,8 +363,10 @@ main(int argc, char **argv)
 
 	}
 
-	if (m.getpath) 
+	if (m.getpath) {
 		printmanpath();
+		exit(cleanup());
+	}
 		
 	/*
 	 * now m.mymanpath is complete!



CVS commit: src/external/gpl3/binutils/dist/ld/emulparams

2020-04-09 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Apr  9 11:10:07 UTC 2020

Modified Files:
src/external/gpl3/binutils/dist/ld/emulparams: aarch64nbsd.sh

Log Message:
Fix TEMPLATE_NAME for new binutils


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/binutils/dist/ld/emulparams/aarch64nbsd.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/ld/emulparams/aarch64nbsd.sh
diff -u src/external/gpl3/binutils/dist/ld/emulparams/aarch64nbsd.sh:1.2 src/external/gpl3/binutils/dist/ld/emulparams/aarch64nbsd.sh:1.3
--- src/external/gpl3/binutils/dist/ld/emulparams/aarch64nbsd.sh:1.2	Tue Apr  5 09:52:22 2016
+++ src/external/gpl3/binutils/dist/ld/emulparams/aarch64nbsd.sh	Thu Apr  9 11:10:07 2020
@@ -9,7 +9,7 @@ BIG_OUTPUT_FORMAT="elf64-bigaarch64"
 LITTLE_OUTPUT_FORMAT="elf64-littleaarch64"
 NO_REL_RELOCS=yes
 
-TEMPLATE_NAME=elf32
+TEMPLATE_NAME=elf
 EXTRA_EM_FILE=aarch64elf
 
 GENERATE_SHLIB_SCRIPT=yes



CVS commit: src/sys/arch/xen/xen

2020-04-09 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Thu Apr  9 10:57:02 UTC 2020

Modified Files:
src/sys/arch/xen/xen: xennetback_xenbus.c

Log Message:
remove check for matching ethernet address on Tx - the higher levels do this
check anyway, and the check did not handle VLANs


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/xen/xen/xennetback_xenbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/xen/xennetback_xenbus.c
diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.94 src/sys/arch/xen/xen/xennetback_xenbus.c:1.95
--- src/sys/arch/xen/xen/xennetback_xenbus.c:1.94	Tue Apr  7 11:47:06 2020
+++ src/sys/arch/xen/xen/xennetback_xenbus.c	Thu Apr  9 10:57:02 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: xennetback_xenbus.c,v 1.94 2020/04/07 11:47:06 jdolecek Exp $  */
+/*  $NetBSD: xennetback_xenbus.c,v 1.95 2020/04/09 10:57:02 jdolecek Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.94 2020/04/07 11:47:06 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.95 2020/04/09 10:57:02 jdolecek Exp $");
 
 #include "opt_xen.h"
 
@@ -665,17 +665,6 @@ xennetback_tx_copy_process(struct ifnet 
 
 		xennetback_tx_response(xneti, req->id, NETIF_RSP_OKAY);
 
-		if ((ifp->if_flags & IFF_PROMISC) == 0) {
-			struct ether_header *eh =
-			mtod(m, struct ether_header *);
-			if (ETHER_IS_MULTICAST(eh->ether_dhost) == 0 &&
-			memcmp(CLLADDR(ifp->if_sadl), eh->ether_dhost,
-			ETHER_ADDR_LEN) != 0) {
-m_freem(m);
-continue; /* packet is not for us */
-			}
-		}
-
 		if (req->flags & NETTXF_csum_blank)
 			xennet_checksum_fill(ifp, m);
 		else if (req->flags & NETTXF_data_validated)



CVS commit: src/sys/dev/acpi

2020-04-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Apr  9 10:46:19 UTC 2020

Modified Files:
src/sys/dev/acpi: acpi.c

Log Message:
Stop walking MADT / GTDT subtables if we hit a header with length 0


To generate a diff of this commit:
cvs rdiff -u -r1.283 -r1.284 src/sys/dev/acpi/acpi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/acpi/acpi.c
diff -u src/sys/dev/acpi/acpi.c:1.283 src/sys/dev/acpi/acpi.c:1.284
--- src/sys/dev/acpi/acpi.c:1.283	Fri Jan 17 17:06:32 2020
+++ src/sys/dev/acpi/acpi.c	Thu Apr  9 10:46:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.283 2020/01/17 17:06:32 jmcneill Exp $	*/
+/*	$NetBSD: acpi.c,v 1.284 2020/04/09 10:46:19 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.283 2020/01/17 17:06:32 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.284 2020/04/09 10:46:19 jmcneill Exp $");
 
 #include "pci.h"
 #include "opt_acpi.h"
@@ -1809,7 +1809,7 @@ acpi_madt_walk(ACPI_STATUS (*func)(ACPI_
 
 		hdrp = (ACPI_SUBTABLE_HEADER *)where;
 
-		if (ACPI_FAILURE(func(hdrp, aux)))
+		if (hdrp->Length == 0 || ACPI_FAILURE(func(hdrp, aux)))
 			break;
 
 		where += hdrp->Length;
@@ -1829,7 +1829,7 @@ acpi_gtdt_walk(ACPI_STATUS (*func)(ACPI_
 
 		hdrp = (ACPI_GTDT_HEADER *)where;
 
-		if (ACPI_FAILURE(func(hdrp, aux)))
+		if (hdrp->Length == 0 || ACPI_FAILURE(func(hdrp, aux)))
 			break;
 
 		where += hdrp->Length;



CVS commit: src/sys/uvm/pmap

2020-04-09 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Apr  9 08:55:45 UTC 2020

Modified Files:
src/sys/uvm/pmap: pmap_tlb.c

Log Message:
Make a comment less MIPS specific


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/uvm/pmap/pmap_tlb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/uvm/pmap/pmap_tlb.c
diff -u src/sys/uvm/pmap/pmap_tlb.c:1.30 src/sys/uvm/pmap/pmap_tlb.c:1.31
--- src/sys/uvm/pmap/pmap_tlb.c:1.30	Wed Dec 18 11:27:56 2019
+++ src/sys/uvm/pmap/pmap_tlb.c	Thu Apr  9 08:55:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_tlb.c,v 1.30 2019/12/18 11:27:56 skrll Exp $	*/
+/*	$NetBSD: pmap_tlb.c,v 1.31 2020/04/09 08:55:45 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.30 2019/12/18 11:27:56 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.31 2020/04/09 08:55:45 skrll Exp $");
 
 /*
  * Manages address spaces in a TLB.
@@ -69,13 +69,14 @@ __KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v
  *
  * Each pmap has two bitmaps: pm_active and pm_onproc.  Each bit in pm_active
  * indicates whether that pmap has an allocated ASID for a CPU.  Each bit in
- * pm_onproc indicates that pmap's ASID is active (equal to the ASID in COP 0
- * register EntryHi) on a CPU.  The bit number comes from the CPU's cpu_index().
- * Even though these bitmaps contain the bits for all CPUs, the bits that
- * correspond to the bits belonging to the CPUs sharing a TLB can only be
- * manipulated while holding that TLB's lock.  Atomic ops must be used to
- * update them since multiple CPUs may be changing different sets of bits at
- * same time but these sets never overlap.
+ * pm_onproc indicates that the pmap's ASID is in use, i.e. a CPU has it in its
+ * "current ASID" field, e.g. the ASID field of the COP 0 register EntryHi for
+ * MIPS, or the ASID field of TTBR0 for AA64.  The bit number used in these
+ * bitmaps comes from the CPU's cpu_index().  Even though these bitmaps contain
+ * the bits for all CPUs, the bits that  correspond to the bits belonging to
+ * the CPUs sharing a TLB can only be manipulated while holding that TLB's
+ * lock.  Atomic ops must be used to update them since multiple CPUs may be
+ * changing different sets of bits at same time but these sets never overlap.
  *
  * When a change to the local TLB may require a change in the TLB's of other
  * CPUs, we try to avoid sending an IPI if at all possible.  For instance, if



CVS commit: src/sys/dev/pci

2020-04-09 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Thu Apr  9 06:55:51 UTC 2020

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
adjust the condition for reusing checksum context, wm_tx_offload() can
be used even for multiqueue case

enable only when the chip supports exactly one queue (same as FreeBSD) -
anything multiqueue-capable later than 82574 should work, but I don't
have the hw to test


To generate a diff of this commit:
cvs rdiff -u -r1.673 -r1.674 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.673 src/sys/dev/pci/if_wm.c:1.674
--- src/sys/dev/pci/if_wm.c:1.673	Wed Apr  8 21:57:24 2020
+++ src/sys/dev/pci/if_wm.c	Thu Apr  9 06:55:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.673 2020/04/08 21:57:24 jdolecek Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.674 2020/04/09 06:55:51 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.673 2020/04/08 21:57:24 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.674 2020/04/09 06:55:51 jdolecek Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -7558,33 +7558,37 @@ wm_tx_offload(struct wm_softc *sc, struc
 	 * contexts on this hardware platform and must generate a new
 	 * context every time.  82574L hardware spec, section 7.2.6,
 	 * second note.
- 	 *
-  	 * Setting up new checksum offload context for every
-	 * frames takes a lot of processing time for hardware.
-	 * This also reduces performance a lot for small sized
-	 * frames so avoid it if driver can use previously
-	 * configured checksum offload context.
-	 * For TSO, in theory we can use the same TSO context if and only if
-	 * frame is the same type(IP/TCP) and the same MSS. However
-	 * checking whether a frame has the same IP/TCP structure is
-	 * hard thing so just ignore that and always restablish a
-	 * new TSO context.
-  	 */
-	KASSERT(!wm_is_using_multiqueue(sc));
-	if ((m0->m_pkthdr.csum_flags & (M_CSUM_TSOv4 | M_CSUM_TSOv6)) == 0) {
-		if (txq->txq_last_hw_cmd == cmd &&
-		txq->txq_last_hw_fields == fields &&
-		txq->txq_last_hw_ipcs == (ipcs & 0x) &&
-		txq->txq_last_hw_tucs == (tucs & 0x)) {
-			WM_Q_EVCNT_INCR(txq, skipcontext);
-			return;
+	 */
+	if (sc->sc_nqueues < 2) {
+		/*
+	 	 *
+	  	 * Setting up new checksum offload context for every
+		 * frames takes a lot of processing time for hardware.
+		 * This also reduces performance a lot for small sized
+		 * frames so avoid it if driver can use previously
+		 * configured checksum offload context.
+		 * For TSO, in theory we can use the same TSO context only if
+		 * frame is the same type(IP/TCP) and the same MSS. However
+		 * checking whether a frame has the same IP/TCP structure is
+		 * hard thing so just ignore that and always restablish a
+		 * new TSO context.
+	  	 */
+		if ((m0->m_pkthdr.csum_flags & (M_CSUM_TSOv4 | M_CSUM_TSOv6))
+		== 0) {
+			if (txq->txq_last_hw_cmd == cmd &&
+			txq->txq_last_hw_fields == fields &&
+			txq->txq_last_hw_ipcs == (ipcs & 0x) &&
+			txq->txq_last_hw_tucs == (tucs & 0x)) {
+WM_Q_EVCNT_INCR(txq, skipcontext);
+return;
+			}
 		}
-	}
 
- 	txq->txq_last_hw_cmd = cmd;
- 	txq->txq_last_hw_fields = fields;
- 	txq->txq_last_hw_ipcs = (ipcs & 0x);
-	txq->txq_last_hw_tucs = (tucs & 0x);
+	 	txq->txq_last_hw_cmd = cmd;
+ 		txq->txq_last_hw_fields = fields;
+ 		txq->txq_last_hw_ipcs = (ipcs & 0x);
+		txq->txq_last_hw_tucs = (tucs & 0x);
+	}
 
 	/* Fill in the context descriptor. */
 	t = (struct livengood_tcpip_ctxdesc *)



CVS commit: src/sys/arch/mips/mips

2020-04-09 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Apr  9 06:49:37 UTC 2020

Modified Files:
src/sys/arch/mips/mips: trap.c

Log Message:
Wrap a REALLY long line


To generate a diff of this commit:
cvs rdiff -u -r1.252 -r1.253 src/sys/arch/mips/mips/trap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mips/mips/trap.c
diff -u src/sys/arch/mips/mips/trap.c:1.252 src/sys/arch/mips/mips/trap.c:1.253
--- src/sys/arch/mips/mips/trap.c:1.252	Thu Apr  9 06:47:50 2020
+++ src/sys/arch/mips/mips/trap.c	Thu Apr  9 06:49:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.252 2020/04/09 06:47:50 skrll Exp $	*/
+/*	$NetBSD: trap.c,v 1.253 2020/04/09 06:49:37 skrll Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.252 2020/04/09 06:47:50 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.253 2020/04/09 06:49:37 skrll Exp $");
 
 #include "opt_cputype.h"	/* which mips CPU levels do we support? */
 #include "opt_ddb.h"
@@ -376,7 +376,14 @@ trap(uint32_t status, uint32_t cause, va
 			if (++pfi->pfi_repeats > 4) {
 tlb_asid_t asid = tlb_get_asid();
 pt_entry_t *ptep = pfi->pfi_faultpte;
-printf("trap: fault #%u (%s/%s) for %#"PRIxVADDR" (%#"PRIxVADDR") at pc %#"PRIxVADDR" curpid=%u/%u ptep@%p=%#"PRIxPTE")\n", pfi->pfi_repeats, trap_names[TRAPTYPE(cause)], trap_names[pfi->pfi_faulttype], va, vaddr, pc, map->pmap->pm_pai[0].pai_asid, asid, ptep, ptep ? pte_value(*ptep) : 0);
+printf("trap: fault #%u (%s/%s) for %#"
+PRIxVADDR" (%#"PRIxVADDR") at pc %#"
+PRIxVADDR" curpid=%u/%u ptep@%p=%#"
+PRIxPTE")\n", pfi->pfi_repeats,
+trap_names[TRAPTYPE(cause)],
+trap_names[pfi->pfi_faulttype], va,
+vaddr, pc, map->pmap->pm_pai[0].pai_asid,
+asid, ptep, ptep ? pte_value(*ptep) : 0);
 if (pfi->pfi_repeats >= 4) {
 	cpu_Debugger();
 } else {



CVS commit: src/sys/arch/mips/mips

2020-04-09 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Apr  9 06:47:50 UTC 2020

Modified Files:
src/sys/arch/mips/mips: trap.c

Log Message:
Fix UVMHIST build


To generate a diff of this commit:
cvs rdiff -u -r1.251 -r1.252 src/sys/arch/mips/mips/trap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mips/mips/trap.c
diff -u src/sys/arch/mips/mips/trap.c:1.251 src/sys/arch/mips/mips/trap.c:1.252
--- src/sys/arch/mips/mips/trap.c:1.251	Tue Mar 10 04:04:45 2020
+++ src/sys/arch/mips/mips/trap.c	Thu Apr  9 06:47:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.251 2020/03/10 04:04:45 thorpej Exp $	*/
+/*	$NetBSD: trap.c,v 1.252 2020/04/09 06:47:50 skrll Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.251 2020/03/10 04:04:45 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.252 2020/04/09 06:47:50 skrll Exp $");
 
 #include "opt_cputype.h"	/* which mips CPU levels do we support? */
 #include "opt_ddb.h"
@@ -279,8 +279,8 @@ trap(uint32_t status, uint32_t cause, va
 			}
 		}
 		UVMHIST_FUNC(__func__); UVMHIST_CALLED(maphist);
-		UVMHIST_LOG(maphist, "%ctlbmod(va=%#lx, pc=%#lx, tf=%p)",
-		user_p ? 'u' : 'k', vaddr, pc, tf);
+		UVMHIST_LOG(maphist, "%ctlbmod(va=%#lx, pc=%#lx, tf=%#jx)",
+		user_p ? 'u' : 'k', vaddr, pc, (uintptr_t)tf);
 		if (!pte_modified_p(pte)) {
 			pte |= mips_pg_m_bit();
 #ifdef MULTIPROCESSOR