CVS commit: src/tests/net/if_pppoe

2021-05-10 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Tue May 11 05:57:02 UTC 2021

Modified Files:
src/tests/net/if_pppoe: t_pppoe.sh

Log Message:
Add tests for "pppoectl {no}[ipcp|ipv6cp]"


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/tests/net/if_pppoe/t_pppoe.sh

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

Modified files:

Index: src/tests/net/if_pppoe/t_pppoe.sh
diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.30 src/tests/net/if_pppoe/t_pppoe.sh:1.31
--- src/tests/net/if_pppoe/t_pppoe.sh:1.30	Tue May 11 00:55:51 2021
+++ src/tests/net/if_pppoe/t_pppoe.sh	Tue May 11 05:57:02 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: t_pppoe.sh,v 1.30 2021/05/11 00:55:51 yamaguchi Exp $
+#	$NetBSD: t_pppoe.sh,v 1.31 2021/05/11 05:57:02 yamaguchi Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -725,6 +725,37 @@ pppoe_params_body()
 	-x "${dumpcmd} | grep PADR"
 	atf_check -s exit:0 -o not-match:'\[AC-Name "ACNAME-TEST5\]"' -e ignore \
 	-x "${dumpcmd} | grep PADI"
+
+	export RUMP_SERVER=$CLIENT
+	atf_ifconfig pppoe0 down
+	export RUMP_SERVER=$SERVER
+	wait_for_disconnected
+
+	# ipcp & ipv6cp are enabled by default
+	export RUMP_SERVER=$CLIENT
+	atf_check -s exit:0 -o match:'ipcp: enable' \
+	-x "$HIJACKING pppoectl pppoe0"
+	atf_check -s exit:0 -o match:'ipv6cp: enable' \
+	-x "$HIJACKING pppoectl pppoe0"
+
+	# ipcp enable & ipv6cp disable
+	atf_pppoectl pppoe0 noipv6cp
+	atf_ifconfig pppoe0 up
+	wait_for_opened "IPCP"
+	atf_check -s exit:0 -o match:'IPv6CP state: initial' \
+	-x "$HIJACKING pppoectl -dd pppoe0"
+
+	atf_ifconfig pppoe0 down
+	export RUMP_SERVER=$SERVER
+	wait_for_disconnected
+
+	# ipcp disable & ipv6cp enable
+	export RUMP_SERVER=$CLIENT
+	atf_pppoectl pppoe0 noipcp ipv6cp
+	atf_ifconfig pppoe0 up
+	wait_for_opened "IPv6CP"
+	atf_check -s exit:0 -o match:'IPCP state: initial' \
+	-x "$HIJACKING pppoectl -dd pppoe0"
 }
 
 pppoe_params_cleanup()



CVS commit: src/tests/net/if_pppoe

2021-05-10 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Tue May 11 05:57:02 UTC 2021

Modified Files:
src/tests/net/if_pppoe: t_pppoe.sh

Log Message:
Add tests for "pppoectl {no}[ipcp|ipv6cp]"


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/tests/net/if_pppoe/t_pppoe.sh

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



CVS commit: src/sbin/pppoectl

2021-05-10 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Tue May 11 05:51:42 UTC 2021

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

Log Message:
Added keywords that are ipcp, noipcp, ipv6cp, noipv6cp
for configuring NCP


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sbin/pppoectl/pppoectl.c

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



CVS commit: src/sbin/pppoectl

2021-05-10 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Tue May 11 05:51:42 UTC 2021

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

Log Message:
Added keywords that are ipcp, noipcp, ipv6cp, noipv6cp
for configuring NCP


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sbin/pppoectl/pppoectl.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/pppoectl/pppoectl.c
diff -u src/sbin/pppoectl/pppoectl.c:1.27 src/sbin/pppoectl/pppoectl.c:1.28
--- src/sbin/pppoectl/pppoectl.c:1.27	Fri Apr 23 02:28:40 2021
+++ src/sbin/pppoectl/pppoectl.c	Tue May 11 05:51:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pppoectl.c,v 1.27 2021/04/23 02:28:40 yamaguchi Exp $	*/
+/*	$NetBSD: pppoectl.c,v 1.28 2021/05/11 05:51:42 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 1997 Joerg Wunsch
@@ -31,7 +31,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: pppoectl.c,v 1.27 2021/04/23 02:28:40 yamaguchi Exp $");
+__RCSID("$NetBSD: pppoectl.c,v 1.28 2021/05/11 05:51:42 yamaguchi Exp $");
 #endif
 
 
@@ -55,8 +55,9 @@ __RCSID("$NetBSD: pppoectl.c,v 1.27 2021
 __dead static void usage(void);
 __dead static void print_error(const char *ifname, int error, const char * str);
 static void print_vals(const char *ifname, int phase, struct spppauthcfg *sp,
-	int lcp_timeout, time_t idle_timeout, int authfailures, 
-	int max_auth_failures, u_int maxalive, time_t max_noreceive);
+	int lcp_timeout, time_t idle_timeout, int authfailures,
+	int max_auth_failures, u_int maxalive, time_t max_noreceive,
+	int ncp_flags);
 static void print_dns(const char *ifname, int dns1, int dns2, int s, int tabs);
 static void print_stats(const char *ifname, int s, int dump);
 static const char *phase_name(int phase);
@@ -81,10 +82,12 @@ static int hz = 0;
 
 static int set_auth, set_lcp, set_idle_to, set_auth_failure, set_dns,
 clear_auth_failure_count, set_keepalive;
+static u_int set_ncpflags, clr_ncpflags;
 static int maxalive = -1;
 static int max_noreceive = -1;
 static struct spppauthcfg spr;
 static struct sppplcpcfg lcp;
+static struct spppncpcfg ncp;
 static struct spppstatus status;
 static struct spppidletimeout timeout;
 static struct spppauthfailurestats authfailstats;
@@ -202,6 +205,8 @@ main(int argc, char **argv)
 	strncpy(spr.ifname, ifname, sizeof spr.ifname);
 	memset(, 0, sizeof lcp);
 	strncpy(lcp.ifname, ifname, sizeof lcp.ifname);
+	memset(, 0, sizeof ncp);
+	strncpy(ncp.ifname, ifname, sizeof ncp.ifname);
 	memset(, 0, sizeof status);
 	strncpy(status.ifname, ifname, sizeof status.ifname);
 	memset(, 0, sizeof timeout);
@@ -245,6 +250,8 @@ main(int argc, char **argv)
 
 		if (ioctl(s, SPPPGETLCPCFG, ) == -1)
 			err(EX_OSERR, "SPPPGETLCPCFG");
+		if (ioctl(s, SPPPGETNCPCFG, ) == -1)
+			err(EX_OSERR, "SPPPGETNCPCFG");
 		if (ioctl(s, SPPPGETSTATUS, ) == -1)
 			err(EX_OSERR, "SPPPGETSTATUS");
 		if (ioctl(s, SPPPGETIDLETO, ) == -1)
@@ -258,7 +265,8 @@ main(int argc, char **argv)
 		timeout.idle_seconds, authfailstats.auth_failures,
 		authfailstats.max_failures,
 		keepalivesettings.maxalive,
-		keepalivesettings.max_noreceive);
+		keepalivesettings.max_noreceive,
+		ncp.ncp_flags);
 
 		if (spr.hisname) free(spr.hisname);
 		if (spr.myname) free(spr.myname);
@@ -300,6 +308,16 @@ main(int argc, char **argv)
 		if (ioctl(s, SPPPSETLCPCFG, ) == -1)
 			err(EX_OSERR, "SPPPSETLCPCFG");
 	}
+	if (set_ncpflags != 0 || clr_ncpflags != 0) {
+		if (ioctl(s, SPPPGETNCPCFG, ) == -1)
+			err(EX_OSERR, "SPPPGETNCPCFG");
+
+		ncp.ncp_flags |= set_ncpflags;
+		ncp.ncp_flags &= ~clr_ncpflags;
+
+		if (ioctl(s, SPPPSETNCPCFG, ) == -1)
+			err(EX_OSERR, "SPPPSETNCPCFG");
+	}
 	if (set_idle_to) {
 		if (ioctl(s, SPPPSETIDLETO, ) == -1)
 			err(EX_OSERR, "SPPPSETIDLETO");
@@ -344,7 +362,8 @@ main(int argc, char **argv)
 		timeout.idle_seconds, authfailstats.auth_failures,
 		authfailstats.max_failures,
 		keepalivesettings.maxalive,
-		keepalivesettings.max_noreceive);
+		keepalivesettings.max_noreceive,
+		ncp.ncp_flags);
 	}
 
 	return 0;
@@ -459,6 +478,18 @@ pppoectl_argument(char *arg)
 	} else if (startswith(arg, "query-dns=")) {
 		dnssettings.query_dns = atoi(arg+off);
 		set_dns = 1;
+	} else if (strcmp(arg, "ipcp") == 0) {
+		set_ncpflags |= SPPP_NCP_IPCP;
+		clr_ncpflags &= ~SPPP_NCP_IPCP;
+	} else if (strcmp(arg, "noipcp") == 0) {
+		set_ncpflags &= ~SPPP_NCP_IPCP;
+		clr_ncpflags |= SPPP_NCP_IPCP;
+	} else if (strcmp(arg, "ipv6cp") == 0) {
+		set_ncpflags |= SPPP_NCP_IPV6CP;
+		clr_ncpflags &= ~SPPP_NCP_IPV6CP;
+	} else if (strcmp(arg, "noipv6cp") == 0) {
+		set_ncpflags &= ~SPPP_NCP_IPV6CP;
+		clr_ncpflags |= SPPP_NCP_IPV6CP;
 	} else
 		errx(EX_DATAERR, "bad parameter: \"%s\"", arg);
 }
@@ -472,7 +503,7 @@ usage(void)
 	"   %s [-f config] ifname [...]\n"
 	"   %s [-v] ifname [{my|his}auth{proto|name|secret}=...] \\\n"
 "  [callin] 

CVS commit: src/sys/arch/sparc64/sparc64

2021-05-10 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue May 11 03:43:30 UTC 2021

Modified Files:
src/sys/arch/sparc64/sparc64: autoconf.c

Log Message:
All of the OFW-enumerated busses now associate the OFW node with the
device at config_found() time, so we can remove all of the stuff from
device_register() that does it, leaving only the @pci case to fix that
up (similar situation with ACPI on ARM and x86).

Adapt the boot device matching code to use the devhandle from the
device_t rather than the previous mechanism, and add some comments
explaining what's going on and some assertions to validate the
comments.

Collapse the sun4v vdsk boot device detection into the normal "sd"
case because it's almost identical to the normal "sd" case anyhow.


To generate a diff of this commit:
cvs rdiff -u -r1.229 -r1.230 src/sys/arch/sparc64/sparc64/autoconf.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/sparc64/sparc64/autoconf.c
diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.229 src/sys/arch/sparc64/sparc64/autoconf.c:1.230
--- src/sys/arch/sparc64/sparc64/autoconf.c:1.229	Mon May 10 23:53:44 2021
+++ src/sys/arch/sparc64/sparc64/autoconf.c	Tue May 11 03:43:30 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.229 2021/05/10 23:53:44 thorpej Exp $ */
+/*	$NetBSD: autoconf.c,v 1.230 2021/05/11 03:43:30 thorpej Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.229 2021/05/10 23:53:44 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.230 2021/05/11 03:43:30 thorpej Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -144,7 +144,6 @@ int kgdb_break_at_attach;
 #endif
 
 #define	OFPATHLEN	128
-#define	OFNODEKEY	"OFpnode"
 
 char	machine_banner[100];
 char	machine_model[100];
@@ -997,62 +996,25 @@ dev_bi_unit_drive_match(device_t dev, in
 }
 
 /*
- * Get the firmware package handle from a device_t.
- * Assuming we have previously stored it in the device properties
- * dictionary.
- */
-static int
-device_ofnode(device_t dev)
-{
-	prop_dictionary_t props;
-	prop_object_t obj;
-
-	if (dev == NULL)
-		return 0;
-	props = device_properties(dev);
-	if (props == NULL)
-		return 0;
-	obj = prop_dictionary_get(props, OFNODEKEY);
-	if (obj == NULL)
-		return 0;
-
-	return prop_number_signed_value(obj);
-}
-
-/*
- * Save the firmware package handle inside the properties dictionary
- * of a device_t.
- */
-static void
-device_setofnode(device_t dev, int node)
-{
-	prop_dictionary_t props;
-	prop_object_t obj;
-
-	if (dev == NULL)
-		return;
-	props = device_properties(dev);
-	if (props == NULL)
-		return;
-	obj = prop_number_create_signed(node);
-	if (obj == NULL)
-		return;
-	prop_dictionary_set(props, OFNODEKEY, obj);
-	prop_object_release(obj);
-	DPRINTF(ACDB_BOOTDEV, (" [device %s has node %x] ",
-	device_xname(dev), node));
-}
-
-/*
  * Called back during autoconfiguration for each device found
  */
 void
 device_register(device_t dev, void *aux)
 {
 	device_t busdev = device_parent(dev);
+	devhandle_t devhandle;
 	int ofnode = 0;
 
 	/*
+	 * If the device has a valid OpenFirmware node association,
+	 * grab it now.
+	 */
+	devhandle = device_handle(dev);
+	if (devhandle_type(devhandle) == DEVHANDLE_TYPE_OF) {
+		ofnode = devhandle_to_of(devhandle);
+	}
+
+	/*
 	 * We don't know the type of 'aux' - it depends on the
 	 * bus this device attaches to. We are only interested in
 	 * certain bus types, this only is used to find the boot
@@ -1063,23 +1025,18 @@ device_register(device_t dev, void *aux)
 		 * Ignore mainbus0 itself, it certainly is not a boot
 		 * device.
 		 */
-	} else if (device_is_a(busdev, "mainbus")) {
-		struct mainbus_attach_args *ma = aux;
-
-		ofnode = ma->ma_node;
 	} else if (device_is_a(busdev, "pci")) {
 		struct pci_attach_args *pa = aux;
 
-		ofnode = PCITAG_NODE(pa->pa_tag);
-	} else if (device_is_a(busdev, "sbus") || device_is_a(busdev, "dma")
-	|| device_is_a(busdev, "ledma")) {
-		struct sbus_attach_args *sa = aux;
-
-		ofnode = sa->sa_node;
-	} else if (device_is_a(busdev, "ebus")) {
-		struct ebus_attach_args *ea = aux;
-
-		ofnode = ea->ea_node;
+		/*
+		 * XXX PCI devices don't currently get their devhandles
+		 * set when the PCI layer attaches them, so we need to
+		 * do it here.  (It's not just us; ACPI has the same
+		 * problem...)
+		 */
+		ofnode = (int)PCITAG_NODE(pa->pa_tag);
+		devhandle = devhandle_from_of(ofnode);
+		device_set_handle(dev, devhandle);
 	} else if (device_is_a(busdev, "iic")) {
 		struct i2c_attach_args *ia = aux;
 
@@ -1098,6 +1055,7 @@ device_register(device_t dev, void *aux)
 add_gpio_props_e250(dev, aux);
 			}
 		} 
+		return;
 	} else if (device_is_a(dev, "sd") || device_is_a(dev, "cd")) {
 		struct scsipibus_attach_args *sa = aux;
 		struct scsipi_periph *periph = sa->sa_periph;
@@ -1121,9 +1079,37 @@ device_register(device_t dev, void *aux)
 

CVS commit: src/sys/arch/sparc64/sparc64

2021-05-10 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue May 11 03:43:30 UTC 2021

Modified Files:
src/sys/arch/sparc64/sparc64: autoconf.c

Log Message:
All of the OFW-enumerated busses now associate the OFW node with the
device at config_found() time, so we can remove all of the stuff from
device_register() that does it, leaving only the @pci case to fix that
up (similar situation with ACPI on ARM and x86).

Adapt the boot device matching code to use the devhandle from the
device_t rather than the previous mechanism, and add some comments
explaining what's going on and some assertions to validate the
comments.

Collapse the sun4v vdsk boot device detection into the normal "sd"
case because it's almost identical to the normal "sd" case anyhow.


To generate a diff of this commit:
cvs rdiff -u -r1.229 -r1.230 src/sys/arch/sparc64/sparc64/autoconf.c

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config/rs6000

2021-05-10 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue May 11 01:47:21 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: rs6000.c

Log Message:
Cherry-pick upstream fix for GCC10 regression to -misel option.

Assembler codes generated by GCC are identical with that of our local
fix in rev 1.26 for 32-bit processors, and no significant changes for
64-bit processors also.

master: https://gcc.gnu.org/g:6156df483fa50a08f561b6c248819f2992aa380d
gcc-10: https://gcc.gnu.org/g:5f665c1ca452673e9812cd92b07bd31441c0ac5b
(diffs are same)

commit r12-9-g6156df483fa50a08f561b6c248819f2992aa380d
Author: Segher Boessenkool 
Date:   Tue Apr 20 12:00:50 2021 +

rs6000: Fix cpu selection w/ isel (PR100108)

There are various non-IBM CPUs with isel as well, so it is easiest if we
just don't consider that flag here (it is not needed).

2021-04-20  Segher Boessenkool  

PR target/100108
* config/rs6000/rs6000.c (rs6000_machine_from_flags): Do not 
consider
OPTION_MASK_ISEL.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c

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



CVS commit: src/external/gpl3/gcc/dist/gcc/config/rs6000

2021-05-10 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue May 11 01:47:21 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: rs6000.c

Log Message:
Cherry-pick upstream fix for GCC10 regression to -misel option.

Assembler codes generated by GCC are identical with that of our local
fix in rev 1.26 for 32-bit processors, and no significant changes for
64-bit processors also.

master: https://gcc.gnu.org/g:6156df483fa50a08f561b6c248819f2992aa380d
gcc-10: https://gcc.gnu.org/g:5f665c1ca452673e9812cd92b07bd31441c0ac5b
(diffs are same)

commit r12-9-g6156df483fa50a08f561b6c248819f2992aa380d
Author: Segher Boessenkool 
Date:   Tue Apr 20 12:00:50 2021 +

rs6000: Fix cpu selection w/ isel (PR100108)

There are various non-IBM CPUs with isel as well, so it is easiest if we
just don't consider that flag here (it is not needed).

2021-04-20  Segher Boessenkool  

PR target/100108
* config/rs6000/rs6000.c (rs6000_machine_from_flags): Do not 
consider
OPTION_MASK_ISEL.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c

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/gcc/dist/gcc/config/rs6000/rs6000.c
diff -u src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.28 src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.29
--- src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.28	Tue May 11 01:39:09 2021
+++ src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c	Tue May 11 01:47:20 2021
@@ -5550,7 +5550,7 @@ rs6000_machine_from_flags (void)
   HOST_WIDE_INT flags = rs6000_isa_flags;
 
   /* Disable the flags that should never influence the .machine selection.  */
-  flags &= ~(OPTION_MASK_PPC_GFXOPT | OPTION_MASK_PPC_GPOPT);
+  flags &= ~(OPTION_MASK_PPC_GFXOPT | OPTION_MASK_PPC_GPOPT | OPTION_MASK_ISEL);
 
   if ((flags & (ISA_3_1_MASKS_SERVER & ~ISA_3_0_MASKS_SERVER)) != 0)
 return "power10";



CVS commit: src/external/gpl3/gcc/dist/gcc/config/rs6000

2021-05-10 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue May 11 01:39:09 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: rs6000.c

Log Message:
In preparation to import upstream fix, revert our local fix in rev 1.26:

http://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c#rev1.26

> Fix regression introduced to GCC10, where it wrongly recognizes 32-bit
> processors as POWER9 if -misel flag is specified.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c

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/gcc/dist/gcc/config/rs6000/rs6000.c
diff -u src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.27 src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.28
--- src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c:1.27	Fri Apr 16 02:33:28 2021
+++ src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c	Tue May 11 01:39:09 2021
@@ -5552,8 +5552,6 @@ rs6000_machine_from_flags (void)
   /* Disable the flags that should never influence the .machine selection.  */
   flags &= ~(OPTION_MASK_PPC_GFXOPT | OPTION_MASK_PPC_GPOPT);
 
-  if ((flags & OPTION_MASK_POWERPC64) == 0)
-return "ppc";
   if ((flags & (ISA_3_1_MASKS_SERVER & ~ISA_3_0_MASKS_SERVER)) != 0)
 return "power10";
   if ((flags & (ISA_3_0_MASKS_SERVER & ~ISA_2_7_MASKS_SERVER)) != 0)
@@ -5568,7 +5566,9 @@ rs6000_machine_from_flags (void)
 return "power5";
   if ((flags & ISA_2_1_MASKS) != 0)
 return "power4";
-  return "ppc64";
+  if ((flags & OPTION_MASK_POWERPC64) != 0)
+return "ppc64";
+  return "ppc";
 }
 
 void



CVS commit: src/external/gpl3/gcc/dist/gcc/config/rs6000

2021-05-10 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue May 11 01:39:09 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: rs6000.c

Log Message:
In preparation to import upstream fix, revert our local fix in rev 1.26:

http://cvsweb.netbsd.org/bsdweb.cgi/src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c#rev1.26

> Fix regression introduced to GCC10, where it wrongly recognizes 32-bit
> processors as POWER9 if -misel flag is specified.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/rs6000.c

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



CVS commit: src/sys/dev/pci/ixgbe

2021-05-10 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue May 11 01:30:30 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
Call bus_dmamap_unload(9) via ixgbe_dmamap_unload(), before freeing
DMA buffer. Also, when the buffer is already freed, do not call
bus_dmamap_unload(9) (no resource leaks with this change).

Otherwise, MMU fault occurs for some bus_dma(9) implementations.

With this fix, X550-T1 and X540-T1 work fine on alpha (at least
DS10 with PCI-PCIe reverse bridge).

Discussed with msaitoh. Thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/pci/ixgbe/ix_txrx.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/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.71 src/sys/dev/pci/ixgbe/ix_txrx.c:1.72
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.71	Fri Apr 30 06:55:32 2021
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Tue May 11 01:30:30 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.71 2021/04/30 06:55:32 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.72 2021/05/11 01:30:30 rin Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.71 2021/04/30 06:55:32 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.72 2021/05/11 01:30:30 rin Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -1766,16 +1766,17 @@ ixgbe_rx_discard(struct rx_ring *rxr, in
 	if (rbuf->fmp != NULL) {/* Partial chain ? */
 		bus_dmamap_sync(rxr->ptag->dt_dmat, rbuf->pmap, 0,
 		rbuf->buf->m_pkthdr.len, BUS_DMASYNC_POSTREAD);
+		ixgbe_dmamap_unload(rxr->ptag, rbuf->pmap);
 		m_freem(rbuf->fmp);
 		rbuf->fmp = NULL;
 		rbuf->buf = NULL; /* rbuf->buf is part of fmp's chain */
 	} else if (rbuf->buf) {
 		bus_dmamap_sync(rxr->ptag->dt_dmat, rbuf->pmap, 0,
 		rbuf->buf->m_pkthdr.len, BUS_DMASYNC_POSTREAD);
+		ixgbe_dmamap_unload(rxr->ptag, rbuf->pmap);
 		m_free(rbuf->buf);
 		rbuf->buf = NULL;
 	}
-	ixgbe_dmamap_unload(rxr->ptag, rbuf->pmap);
 
 	rbuf->flags = 0;
 



CVS commit: src/sys/dev/pci/ixgbe

2021-05-10 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue May 11 01:30:30 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
Call bus_dmamap_unload(9) via ixgbe_dmamap_unload(), before freeing
DMA buffer. Also, when the buffer is already freed, do not call
bus_dmamap_unload(9) (no resource leaks with this change).

Otherwise, MMU fault occurs for some bus_dma(9) implementations.

With this fix, X550-T1 and X540-T1 work fine on alpha (at least
DS10 with PCI-PCIe reverse bridge).

Discussed with msaitoh. Thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/pci/ixgbe/ix_txrx.c

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



CVS commit: src/sys/net

2021-05-10 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Tue May 11 01:27:45 UTC 2021

Modified Files:
src/sys/net: if_sppp.h if_spppsubr.c if_spppvar.h

Log Message:
Added ioctl commands for configuring NCP of pppoe(4)


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/net/if_sppp.h
cvs rdiff -u -r1.232 -r1.233 src/sys/net/if_spppsubr.c
cvs rdiff -u -r1.36 -r1.37 src/sys/net/if_spppvar.h

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

Modified files:

Index: src/sys/net/if_sppp.h
diff -u src/sys/net/if_sppp.h:1.33 src/sys/net/if_sppp.h:1.34
--- src/sys/net/if_sppp.h:1.33	Tue May 11 01:15:11 2021
+++ src/sys/net/if_sppp.h	Tue May 11 01:27:45 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_sppp.h,v 1.33 2021/05/11 01:15:11 yamaguchi Exp $	*/
+/*	$NetBSD: if_sppp.h,v 1.34 2021/05/11 01:27:45 yamaguchi Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -233,5 +233,15 @@ struct spppipv6cpstatus {
 
 #define SPPPGETIPV6CPSTATUS	_IOWR('i', 137, struct spppipv6cpstatus)
 
+#define SPPP_NCP_IPCP		__BIT(0)
+#define SPPP_NCP_IPV6CP		__BIT(1)
+struct spppncpcfg {
+	char		ifname[IFNAMSIZ];
+	u_int		ncp_flags;
+};
+
+#define SPPPGETNCPCFG		_IOWR('i', 138, struct spppncpcfg)
+#define SPPPSETNCPCFG		_IOW('i', 139, struct spppncpcfg)
+
 #endif /* !_NET_IF_SPPP_H_ */
 

Index: src/sys/net/if_spppsubr.c
diff -u src/sys/net/if_spppsubr.c:1.232 src/sys/net/if_spppsubr.c:1.233
--- src/sys/net/if_spppsubr.c:1.232	Tue May 11 01:15:11 2021
+++ src/sys/net/if_spppsubr.c	Tue May 11 01:27:45 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_spppsubr.c,v 1.232 2021/05/11 01:15:11 yamaguchi Exp $	 */
+/*	$NetBSD: if_spppsubr.c,v 1.233 2021/05/11 01:27:45 yamaguchi Exp $	 */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.232 2021/05/11 01:15:11 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.233 2021/05/11 01:27:45 yamaguchi Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -585,11 +585,7 @@ sppp_input(struct ifnet *ifp, struct mbu
 			log(LOG_DEBUG,
 			"%s: input packet is too small, %d bytes\n",
 			ifp->if_xname, m->m_pkthdr.len);
-	  drop:
-		if_statadd2(ifp, if_ierrors, 1, if_iqdrops, 1);
-		m_freem(m);
-		SPPP_UNLOCK(sp);
-		return;
+		goto drop;
 	}
 
 	if (sp->pp_flags & PP_NOFRAMING) {
@@ -663,7 +659,7 @@ sppp_input(struct ifnet *ifp, struct mbu
 	}
 
 	switch (protocol) {
-	default:
+	reject_protocol:
 		if (sp->scp[IDX_LCP].state == STATE_OPENED) {
 			uint16_t prot = htons(protocol);
 
@@ -679,6 +675,8 @@ sppp_input(struct ifnet *ifp, struct mbu
 			"\n", ifp->if_xname, ntohs(protocol));
 		if_statinc(ifp, if_noproto);
 		goto drop;
+	default:
+		goto reject_protocol;
 	case PPP_LCP:
 		SPPP_UNLOCK(sp);
 		sppp_cp_input(, sp, m);
@@ -700,6 +698,8 @@ sppp_input(struct ifnet *ifp, struct mbu
 		return;
 #ifdef INET
 	case PPP_IPCP:
+		if (!ISSET(sp->pp_ncpflags, SPPP_NCP_IPCP))
+			goto reject_protocol;
 		SPPP_UNLOCK(sp);
 		if (sp->pp_phase == SPPP_PHASE_NETWORK) {
 			sppp_cp_input(, sp, m);
@@ -717,6 +717,8 @@ sppp_input(struct ifnet *ifp, struct mbu
 #endif
 #ifdef INET6
 	case PPP_IPV6CP:
+		if (!ISSET(sp->pp_ncpflags, SPPP_NCP_IPV6CP))
+			goto reject_protocol;
 		SPPP_UNLOCK(sp);
 		if (sp->pp_phase == SPPP_PHASE_NETWORK) {
 			sppp_cp_input(, sp, m);
@@ -766,6 +768,13 @@ queue_pkt:
 	IF_ENQUEUE(inq, m);
 	IFQ_UNLOCK(inq);
 	schednetisr(isr);
+	return;
+
+drop:
+	if_statadd2(ifp, if_ierrors, 1, if_iqdrops, 1);
+	m_freem(m);
+	SPPP_UNLOCK(sp);
+	return;
 }
 
 /*
@@ -1029,6 +1038,7 @@ sppp_attach(struct ifnet *ifp)
 	sp->pp_phase = SPPP_PHASE_DEAD;
 	sp->pp_up = sppp_notify_up;
 	sp->pp_down = sppp_notify_down;
+	sp->pp_ncpflags = SPPP_NCP_IPCP | SPPP_NCP_IPV6CP;
 	sppp_wq_set(>work_ifdown, sppp_ifdown, NULL);
 	memset(sp->scp, 0, sizeof(sp->scp));
 	rw_init(>pp_lock);
@@ -1265,6 +1275,7 @@ sppp_ioctl(struct ifnet *ifp, u_long cmd
 
 	case SPPPSETAUTHCFG:
 	case SPPPSETLCPCFG:
+	case SPPPSETNCPCFG:
 	case SPPPSETIDLETO:
 	case SPPPSETAUTHFAILURE:
 	case SPPPSETDNSOPTS:
@@ -1284,6 +1295,7 @@ sppp_ioctl(struct ifnet *ifp, u_long cmd
 
 	case SPPPGETAUTHCFG:
 	case SPPPGETLCPCFG:
+	case SPPPGETNCPCFG:
 	case SPPPGETAUTHFAILURES:
 		error = kauth_authorize_network(l->l_cred,
 		KAUTH_NETWORK_INTERFACE,
@@ -3491,6 +3503,9 @@ sppp_ipcp_open(struct sppp *sp, void *xc
 	KASSERT(SPPP_WLOCKED(sp));
 	KASSERT(!cpu_softintr_p());
 
+	if (!ISSET(sp->pp_ncpflags, SPPP_NCP_IPCP))
+		return;
+
 	sp->ipcp.flags &= ~(IPCP_HISADDR_SEEN|IPCP_MYADDR_SEEN|IPCP_MYADDR_DYN|IPCP_HISADDR_DYN);
 	sp->ipcp.req_myaddr = 0;
 	sp->ipcp.req_hisaddr = 0;
@@ -4065,6 +4080,9 @@ sppp_ipv6cp_open(struct sppp *sp, void *
 	KASSERT(SPPP_WLOCKED(sp));
 	KASSERT(!cpu_softintr_p());
 
+	if (!ISSET(sp->pp_ncpflags, SPPP_NCP_IPV6CP))
+		return;
+
 #ifdef IPV6CP_MYIFID_DYN
 	sp->ipv6cp.flags &= 

CVS commit: src/sys/net

2021-05-10 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Tue May 11 01:27:45 UTC 2021

Modified Files:
src/sys/net: if_sppp.h if_spppsubr.c if_spppvar.h

Log Message:
Added ioctl commands for configuring NCP of pppoe(4)


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/net/if_sppp.h
cvs rdiff -u -r1.232 -r1.233 src/sys/net/if_spppsubr.c
cvs rdiff -u -r1.36 -r1.37 src/sys/net/if_spppvar.h

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



CVS commit: src/sys/net

2021-05-10 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Tue May 11 01:23:21 UTC 2021

Modified Files:
src/sys/net: if_spppvar.h

Log Message:
back to r1.34 because of mistake of commit log


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/net/if_spppvar.h

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

Modified files:

Index: src/sys/net/if_spppvar.h
diff -u src/sys/net/if_spppvar.h:1.35 src/sys/net/if_spppvar.h:1.36
--- src/sys/net/if_spppvar.h:1.35	Tue May 11 01:00:49 2021
+++ src/sys/net/if_spppvar.h	Tue May 11 01:23:21 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_spppvar.h,v 1.35 2021/05/11 01:00:49 yamaguchi Exp $	*/
+/*	$NetBSD: if_spppvar.h,v 1.36 2021/05/11 01:23:21 yamaguchi Exp $	*/
 
 #ifndef _NET_IF_SPPPVAR_H_
 #define _NET_IF_SPPPVAR_H_
@@ -141,7 +141,6 @@ struct sppp {
 	struct	ifqueue pp_cpq;	/* PPP control protocol queue */
 	struct  sppp *pp_next;  /* next interface in keepalive list */
 	u_int   pp_flags;   /* use Cisco protocol instead of PPP */
-	u_int	pp_ncpflags;	/* enable or disable each NCP */
 	u_int	pp_framebytes;	/* number of bytes added by (hardware) framing */
 	u_int   pp_alivecnt;/* keepalive packets counter */
 	u_int   pp_loopcnt; /* loopback detection counter */



CVS commit: src/sys/net

2021-05-10 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Tue May 11 01:23:21 UTC 2021

Modified Files:
src/sys/net: if_spppvar.h

Log Message:
back to r1.34 because of mistake of commit log


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/net/if_spppvar.h

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



CVS commit: src/sys/net

2021-05-10 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Tue May 11 01:15:11 UTC 2021

Modified Files:
src/sys/net: if_sppp.h if_spppsubr.c

Log Message:
Revert previous commit because of mistake of commit log

back to r1.230(if_spppsubr.c) and r1.31(if_sppp.h)


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/net/if_sppp.h
cvs rdiff -u -r1.231 -r1.232 src/sys/net/if_spppsubr.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/net/if_sppp.h
diff -u src/sys/net/if_sppp.h:1.32 src/sys/net/if_sppp.h:1.33
--- src/sys/net/if_sppp.h:1.32	Tue May 11 01:00:49 2021
+++ src/sys/net/if_sppp.h	Tue May 11 01:15:11 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_sppp.h,v 1.32 2021/05/11 01:00:49 yamaguchi Exp $	*/
+/*	$NetBSD: if_sppp.h,v 1.33 2021/05/11 01:15:11 yamaguchi Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -233,15 +233,5 @@ struct spppipv6cpstatus {
 
 #define SPPPGETIPV6CPSTATUS	_IOWR('i', 137, struct spppipv6cpstatus)
 
-#define SPPP_NCP_IPCP		__BIT(0)
-#define SPPP_NCP_IPV6CP		__BIT(1)
-struct spppncpcfg {
-	char		ifname[IFNAMSIZ];
-	u_int		ncp_flags;
-};
-
-#define SPPPGETNCPCFG		_IOWR('i', 138, struct spppncpcfg)
-#define SPPPSETNCPCFG		_IOW('i', 139, struct spppncpcfg)
-
 #endif /* !_NET_IF_SPPP_H_ */
 

Index: src/sys/net/if_spppsubr.c
diff -u src/sys/net/if_spppsubr.c:1.231 src/sys/net/if_spppsubr.c:1.232
--- src/sys/net/if_spppsubr.c:1.231	Tue May 11 01:00:49 2021
+++ src/sys/net/if_spppsubr.c	Tue May 11 01:15:11 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_spppsubr.c,v 1.231 2021/05/11 01:00:49 yamaguchi Exp $	 */
+/*	$NetBSD: if_spppsubr.c,v 1.232 2021/05/11 01:15:11 yamaguchi Exp $	 */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.231 2021/05/11 01:00:49 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.232 2021/05/11 01:15:11 yamaguchi Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -585,7 +585,11 @@ sppp_input(struct ifnet *ifp, struct mbu
 			log(LOG_DEBUG,
 			"%s: input packet is too small, %d bytes\n",
 			ifp->if_xname, m->m_pkthdr.len);
-		goto drop;
+	  drop:
+		if_statadd2(ifp, if_ierrors, 1, if_iqdrops, 1);
+		m_freem(m);
+		SPPP_UNLOCK(sp);
+		return;
 	}
 
 	if (sp->pp_flags & PP_NOFRAMING) {
@@ -659,7 +663,7 @@ sppp_input(struct ifnet *ifp, struct mbu
 	}
 
 	switch (protocol) {
-	reject_protocol:
+	default:
 		if (sp->scp[IDX_LCP].state == STATE_OPENED) {
 			uint16_t prot = htons(protocol);
 
@@ -675,8 +679,6 @@ sppp_input(struct ifnet *ifp, struct mbu
 			"\n", ifp->if_xname, ntohs(protocol));
 		if_statinc(ifp, if_noproto);
 		goto drop;
-	default:
-		goto reject_protocol;
 	case PPP_LCP:
 		SPPP_UNLOCK(sp);
 		sppp_cp_input(, sp, m);
@@ -698,8 +700,6 @@ sppp_input(struct ifnet *ifp, struct mbu
 		return;
 #ifdef INET
 	case PPP_IPCP:
-		if (!ISSET(sp->pp_ncpflags, SPPP_NCP_IPCP))
-			goto reject_protocol;
 		SPPP_UNLOCK(sp);
 		if (sp->pp_phase == SPPP_PHASE_NETWORK) {
 			sppp_cp_input(, sp, m);
@@ -717,8 +717,6 @@ sppp_input(struct ifnet *ifp, struct mbu
 #endif
 #ifdef INET6
 	case PPP_IPV6CP:
-		if (!ISSET(sp->pp_ncpflags, SPPP_NCP_IPV6CP))
-			goto reject_protocol;
 		SPPP_UNLOCK(sp);
 		if (sp->pp_phase == SPPP_PHASE_NETWORK) {
 			sppp_cp_input(, sp, m);
@@ -768,13 +766,6 @@ queue_pkt:
 	IF_ENQUEUE(inq, m);
 	IFQ_UNLOCK(inq);
 	schednetisr(isr);
-	return;
-
-drop:
-	if_statadd2(ifp, if_ierrors, 1, if_iqdrops, 1);
-	m_freem(m);
-	SPPP_UNLOCK(sp);
-	return;
 }
 
 /*
@@ -1038,7 +1029,6 @@ sppp_attach(struct ifnet *ifp)
 	sp->pp_phase = SPPP_PHASE_DEAD;
 	sp->pp_up = sppp_notify_up;
 	sp->pp_down = sppp_notify_down;
-	sp->pp_ncpflags = SPPP_NCP_IPCP | SPPP_NCP_IPV6CP;
 	sppp_wq_set(>work_ifdown, sppp_ifdown, NULL);
 	memset(sp->scp, 0, sizeof(sp->scp));
 	rw_init(>pp_lock);
@@ -1275,7 +1265,6 @@ sppp_ioctl(struct ifnet *ifp, u_long cmd
 
 	case SPPPSETAUTHCFG:
 	case SPPPSETLCPCFG:
-	case SPPPSETNCPCFG:
 	case SPPPSETIDLETO:
 	case SPPPSETAUTHFAILURE:
 	case SPPPSETDNSOPTS:
@@ -1295,7 +1284,6 @@ sppp_ioctl(struct ifnet *ifp, u_long cmd
 
 	case SPPPGETAUTHCFG:
 	case SPPPGETLCPCFG:
-	case SPPPGETNCPCFG:
 	case SPPPGETAUTHFAILURES:
 		error = kauth_authorize_network(l->l_cred,
 		KAUTH_NETWORK_INTERFACE,
@@ -3503,9 +3491,6 @@ sppp_ipcp_open(struct sppp *sp, void *xc
 	KASSERT(SPPP_WLOCKED(sp));
 	KASSERT(!cpu_softintr_p());
 
-	if (!ISSET(sp->pp_ncpflags, SPPP_NCP_IPCP))
-		return;
-
 	sp->ipcp.flags &= ~(IPCP_HISADDR_SEEN|IPCP_MYADDR_SEEN|IPCP_MYADDR_DYN|IPCP_HISADDR_DYN);
 	sp->ipcp.req_myaddr = 0;
 	sp->ipcp.req_hisaddr = 0;
@@ -4080,9 +4065,6 @@ sppp_ipv6cp_open(struct sppp *sp, void *
 	KASSERT(SPPP_WLOCKED(sp));
 	KASSERT(!cpu_softintr_p());
 
-	if (!ISSET(sp->pp_ncpflags, SPPP_NCP_IPV6CP))
-		return;
-
 #ifdef IPV6CP_MYIFID_DYN
 	sp->ipv6cp.flags &= ~(IPV6CP_MYIFID_SEEN|IPV6CP_MYIFID_DYN);
 #else

CVS commit: src/sys/net

2021-05-10 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Tue May 11 01:15:11 UTC 2021

Modified Files:
src/sys/net: if_sppp.h if_spppsubr.c

Log Message:
Revert previous commit because of mistake of commit log

back to r1.230(if_spppsubr.c) and r1.31(if_sppp.h)


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/net/if_sppp.h
cvs rdiff -u -r1.231 -r1.232 src/sys/net/if_spppsubr.c

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



CVS commit: src/sys/net

2021-05-10 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Tue May 11 01:00:49 UTC 2021

Modified Files:
src/sys/net: if_sppp.h if_spppsubr.c if_spppvar.h

Log Message:
Added keywords that are ipcp, noipcp, ipv6cp, noipv6cp
for configuring NCP


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/net/if_sppp.h
cvs rdiff -u -r1.230 -r1.231 src/sys/net/if_spppsubr.c
cvs rdiff -u -r1.34 -r1.35 src/sys/net/if_spppvar.h

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

Modified files:

Index: src/sys/net/if_sppp.h
diff -u src/sys/net/if_sppp.h:1.31 src/sys/net/if_sppp.h:1.32
--- src/sys/net/if_sppp.h:1.31	Fri Apr 23 01:13:25 2021
+++ src/sys/net/if_sppp.h	Tue May 11 01:00:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_sppp.h,v 1.31 2021/04/23 01:13:25 yamaguchi Exp $	*/
+/*	$NetBSD: if_sppp.h,v 1.32 2021/05/11 01:00:49 yamaguchi Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -233,5 +233,15 @@ struct spppipv6cpstatus {
 
 #define SPPPGETIPV6CPSTATUS	_IOWR('i', 137, struct spppipv6cpstatus)
 
+#define SPPP_NCP_IPCP		__BIT(0)
+#define SPPP_NCP_IPV6CP		__BIT(1)
+struct spppncpcfg {
+	char		ifname[IFNAMSIZ];
+	u_int		ncp_flags;
+};
+
+#define SPPPGETNCPCFG		_IOWR('i', 138, struct spppncpcfg)
+#define SPPPSETNCPCFG		_IOW('i', 139, struct spppncpcfg)
+
 #endif /* !_NET_IF_SPPP_H_ */
 

Index: src/sys/net/if_spppsubr.c
diff -u src/sys/net/if_spppsubr.c:1.230 src/sys/net/if_spppsubr.c:1.231
--- src/sys/net/if_spppsubr.c:1.230	Thu May  6 06:18:16 2021
+++ src/sys/net/if_spppsubr.c	Tue May 11 01:00:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_spppsubr.c,v 1.230 2021/05/06 06:18:16 yamaguchi Exp $	 */
+/*	$NetBSD: if_spppsubr.c,v 1.231 2021/05/11 01:00:49 yamaguchi Exp $	 */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.230 2021/05/06 06:18:16 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.231 2021/05/11 01:00:49 yamaguchi Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -585,11 +585,7 @@ sppp_input(struct ifnet *ifp, struct mbu
 			log(LOG_DEBUG,
 			"%s: input packet is too small, %d bytes\n",
 			ifp->if_xname, m->m_pkthdr.len);
-	  drop:
-		if_statadd2(ifp, if_ierrors, 1, if_iqdrops, 1);
-		m_freem(m);
-		SPPP_UNLOCK(sp);
-		return;
+		goto drop;
 	}
 
 	if (sp->pp_flags & PP_NOFRAMING) {
@@ -663,7 +659,7 @@ sppp_input(struct ifnet *ifp, struct mbu
 	}
 
 	switch (protocol) {
-	default:
+	reject_protocol:
 		if (sp->scp[IDX_LCP].state == STATE_OPENED) {
 			uint16_t prot = htons(protocol);
 
@@ -679,6 +675,8 @@ sppp_input(struct ifnet *ifp, struct mbu
 			"\n", ifp->if_xname, ntohs(protocol));
 		if_statinc(ifp, if_noproto);
 		goto drop;
+	default:
+		goto reject_protocol;
 	case PPP_LCP:
 		SPPP_UNLOCK(sp);
 		sppp_cp_input(, sp, m);
@@ -700,6 +698,8 @@ sppp_input(struct ifnet *ifp, struct mbu
 		return;
 #ifdef INET
 	case PPP_IPCP:
+		if (!ISSET(sp->pp_ncpflags, SPPP_NCP_IPCP))
+			goto reject_protocol;
 		SPPP_UNLOCK(sp);
 		if (sp->pp_phase == SPPP_PHASE_NETWORK) {
 			sppp_cp_input(, sp, m);
@@ -717,6 +717,8 @@ sppp_input(struct ifnet *ifp, struct mbu
 #endif
 #ifdef INET6
 	case PPP_IPV6CP:
+		if (!ISSET(sp->pp_ncpflags, SPPP_NCP_IPV6CP))
+			goto reject_protocol;
 		SPPP_UNLOCK(sp);
 		if (sp->pp_phase == SPPP_PHASE_NETWORK) {
 			sppp_cp_input(, sp, m);
@@ -766,6 +768,13 @@ queue_pkt:
 	IF_ENQUEUE(inq, m);
 	IFQ_UNLOCK(inq);
 	schednetisr(isr);
+	return;
+
+drop:
+	if_statadd2(ifp, if_ierrors, 1, if_iqdrops, 1);
+	m_freem(m);
+	SPPP_UNLOCK(sp);
+	return;
 }
 
 /*
@@ -1029,6 +1038,7 @@ sppp_attach(struct ifnet *ifp)
 	sp->pp_phase = SPPP_PHASE_DEAD;
 	sp->pp_up = sppp_notify_up;
 	sp->pp_down = sppp_notify_down;
+	sp->pp_ncpflags = SPPP_NCP_IPCP | SPPP_NCP_IPV6CP;
 	sppp_wq_set(>work_ifdown, sppp_ifdown, NULL);
 	memset(sp->scp, 0, sizeof(sp->scp));
 	rw_init(>pp_lock);
@@ -1265,6 +1275,7 @@ sppp_ioctl(struct ifnet *ifp, u_long cmd
 
 	case SPPPSETAUTHCFG:
 	case SPPPSETLCPCFG:
+	case SPPPSETNCPCFG:
 	case SPPPSETIDLETO:
 	case SPPPSETAUTHFAILURE:
 	case SPPPSETDNSOPTS:
@@ -1284,6 +1295,7 @@ sppp_ioctl(struct ifnet *ifp, u_long cmd
 
 	case SPPPGETAUTHCFG:
 	case SPPPGETLCPCFG:
+	case SPPPGETNCPCFG:
 	case SPPPGETAUTHFAILURES:
 		error = kauth_authorize_network(l->l_cred,
 		KAUTH_NETWORK_INTERFACE,
@@ -3491,6 +3503,9 @@ sppp_ipcp_open(struct sppp *sp, void *xc
 	KASSERT(SPPP_WLOCKED(sp));
 	KASSERT(!cpu_softintr_p());
 
+	if (!ISSET(sp->pp_ncpflags, SPPP_NCP_IPCP))
+		return;
+
 	sp->ipcp.flags &= ~(IPCP_HISADDR_SEEN|IPCP_MYADDR_SEEN|IPCP_MYADDR_DYN|IPCP_HISADDR_DYN);
 	sp->ipcp.req_myaddr = 0;
 	sp->ipcp.req_hisaddr = 0;
@@ -4065,6 +4080,9 @@ sppp_ipv6cp_open(struct sppp *sp, void *
 	KASSERT(SPPP_WLOCKED(sp));
 	KASSERT(!cpu_softintr_p());
 
+	if (!ISSET(sp->pp_ncpflags, SPPP_NCP_IPV6CP))
+		return;
+
 #ifdef IPV6CP_MYIFID_DYN
 	sp->ipv6cp.flags &= 

CVS commit: src/sys/net

2021-05-10 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Tue May 11 01:00:49 UTC 2021

Modified Files:
src/sys/net: if_sppp.h if_spppsubr.c if_spppvar.h

Log Message:
Added keywords that are ipcp, noipcp, ipv6cp, noipv6cp
for configuring NCP


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/net/if_sppp.h
cvs rdiff -u -r1.230 -r1.231 src/sys/net/if_spppsubr.c
cvs rdiff -u -r1.34 -r1.35 src/sys/net/if_spppvar.h

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



CVS commit: src/tests/net/if_pppoe

2021-05-10 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Tue May 11 00:55:51 UTC 2021

Modified Files:
src/tests/net/if_pppoe: t_pppoe.sh

Log Message:
Added missing '$'


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/tests/net/if_pppoe/t_pppoe.sh

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

Modified files:

Index: src/tests/net/if_pppoe/t_pppoe.sh
diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.29 src/tests/net/if_pppoe/t_pppoe.sh:1.30
--- src/tests/net/if_pppoe/t_pppoe.sh:1.29	Thu May  6 01:09:43 2021
+++ src/tests/net/if_pppoe/t_pppoe.sh	Tue May 11 00:55:51 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: t_pppoe.sh,v 1.29 2021/05/06 01:09:43 yamaguchi Exp $
+#	$NetBSD: t_pppoe.sh,v 1.30 2021/05/11 00:55:51 yamaguchi Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -238,7 +238,7 @@ run_test()
 	atf_ifconfig -w 10
 	atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT $CLIENT_IP
 	atf_check -s exit:0 -o match:'session' -x "$HIJACKING pppoectl -d pppoe0"
-	$DEBUG && HIJACKING pppoectl -d pppoe0
+	$DEBUG && $HIJACKING pppoectl -d pppoe0
 	unset RUMP_SERVER
 
 	# test for invalid password



CVS commit: src/tests/net/if_pppoe

2021-05-10 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Tue May 11 00:55:51 UTC 2021

Modified Files:
src/tests/net/if_pppoe: t_pppoe.sh

Log Message:
Added missing '$'


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/tests/net/if_pppoe/t_pppoe.sh

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



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

2021-05-10 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon May 10 23:58:52 UTC 2021

Modified Files:
src/sys/arch/mips/cavium: mainbus.c

Log Message:
Specify the "fdt" interface attribute when configuring via FDT, since
mainbus also carries the "mainbus" interface attribute.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/cavium/mainbus.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/cavium/mainbus.c
diff -u src/sys/arch/mips/cavium/mainbus.c:1.7 src/sys/arch/mips/cavium/mainbus.c:1.8
--- src/sys/arch/mips/cavium/mainbus.c:1.7	Sat Apr 24 23:36:42 2021
+++ src/sys/arch/mips/cavium/mainbus.c	Mon May 10 23:58:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.7 2021/04/24 23:36:42 thorpej Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.8 2021/05/10 23:58:52 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2007
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.7 2021/04/24 23:36:42 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.8 2021/05/10 23:58:52 thorpej Exp $");
 
 #define	_MIPS_BUS_DMA_PRIVATE
 
@@ -149,7 +149,9 @@ mainbus_attach_devicetree(device_t self)
 	}
 
 	faa.faa_phandle = OF_peer(0);
-	config_found(self, , NULL, CFARG_EOL);
+	config_found(self, , NULL,
+	CFARG_IATTR, "fdt",
+	CFARG_EOL);
 }
 
 static int



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

2021-05-10 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon May 10 23:58:52 UTC 2021

Modified Files:
src/sys/arch/mips/cavium: mainbus.c

Log Message:
Specify the "fdt" interface attribute when configuring via FDT, since
mainbus also carries the "mainbus" interface attribute.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/cavium/mainbus.c

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



CVS commit: src/sys

2021-05-10 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon May 10 23:53:44 UTC 2021

Modified Files:
src/sys/arch/sparc/dev: bootbus.c ebus.c sbus.c vme_machdep.c
src/sys/arch/sparc/sparc: autoconf.c iommu.c msiiep.c
src/sys/arch/sparc64/dev: cbus.c central.c ebus.c ebus_mainbus.c fhc.c
psycho.c pyro.c sbus.c schizo.c upa.c vbus.c vpci.c
src/sys/arch/sparc64/sparc64: autoconf.c
src/sys/dev/sbus: dma_sbus.c lebuffer.c qec.c xbox.c

Log Message:
Associate the OpenBoot / OpenFirmware node with attached devices
at config_found() time.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/sparc/dev/bootbus.c
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/sparc/dev/ebus.c
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/sparc/dev/sbus.c
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/sparc/dev/vme_machdep.c
cvs rdiff -u -r1.265 -r1.266 src/sys/arch/sparc/sparc/autoconf.c
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/sparc/sparc/iommu.c
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/sparc/sparc/msiiep.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sparc64/dev/cbus.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sparc64/dev/central.c \
src/sys/arch/sparc64/dev/vbus.c
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/sparc64/dev/ebus.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/sparc64/dev/ebus_mainbus.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sparc64/dev/fhc.c
cvs rdiff -u -r1.133 -r1.134 src/sys/arch/sparc64/dev/psycho.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/sparc64/dev/pyro.c
cvs rdiff -u -r1.101 -r1.102 src/sys/arch/sparc64/dev/sbus.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/sparc64/dev/schizo.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/sparc64/dev/upa.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/sparc64/dev/vpci.c
cvs rdiff -u -r1.228 -r1.229 src/sys/arch/sparc64/sparc64/autoconf.c
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/sbus/dma_sbus.c
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/sbus/lebuffer.c
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/sbus/qec.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/sbus/xbox.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/sparc/dev/bootbus.c
diff -u src/sys/arch/sparc/dev/bootbus.c:1.21 src/sys/arch/sparc/dev/bootbus.c:1.22
--- src/sys/arch/sparc/dev/bootbus.c:1.21	Sat Apr 24 23:36:49 2021
+++ src/sys/arch/sparc/dev/bootbus.c	Mon May 10 23:53:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootbus.c,v 1.21 2021/04/24 23:36:49 thorpej Exp $	*/
+/*	$NetBSD: bootbus.c,v 1.22 2021/05/10 23:53:44 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bootbus.c,v 1.21 2021/04/24 23:36:49 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bootbus.c,v 1.22 2021/05/10 23:53:44 thorpej Exp $");
 
 #include 
 #include 
@@ -123,6 +123,7 @@ bootbus_attach(device_t parent, device_t
 			panic("bootbus_attach: failed to set up attach args");
 
 		config_found(self, , bootbus_print,
+		CFARG_DEVHANDLE, prom_node_to_devhandle(node),
 		CFARG_SUBMATCH, bootbus_submatch,
 		CFARG_EOL);
 

Index: src/sys/arch/sparc/dev/ebus.c
diff -u src/sys/arch/sparc/dev/ebus.c:1.39 src/sys/arch/sparc/dev/ebus.c:1.40
--- src/sys/arch/sparc/dev/ebus.c:1.39	Sat Apr 24 23:36:49 2021
+++ src/sys/arch/sparc/dev/ebus.c	Mon May 10 23:53:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ebus.c,v 1.39 2021/04/24 23:36:49 thorpej Exp $ */
+/*	$NetBSD: ebus.c,v 1.40 2021/05/10 23:53:44 thorpej Exp $ */
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ebus.c,v 1.39 2021/04/24 23:36:49 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ebus.c,v 1.40 2021/05/10 23:53:44 thorpej Exp $");
 
 #if defined(DEBUG) && !defined(EBUS_DEBUG)
 #define EBUS_DEBUG
@@ -316,7 +316,9 @@ ebus_attach(device_t parent, device_t se
 		}
 		DPRINTF(EDB_CHILD,
 			("- found child `%s', attaching\n", ea.ea_name));
-		(void)config_found(self, , ebus_print, CFARG_EOL);
+		(void)config_found(self, , ebus_print,
+		CFARG_DEVHANDLE, prom_node_to_devhandle(node),
+		CFARG_EOL);
 		ebus_destroy_attach_args();
 	}
 }

Index: src/sys/arch/sparc/dev/sbus.c
diff -u src/sys/arch/sparc/dev/sbus.c:1.81 src/sys/arch/sparc/dev/sbus.c:1.82
--- src/sys/arch/sparc/dev/sbus.c:1.81	Sat Apr 24 23:36:49 2021
+++ src/sys/arch/sparc/dev/sbus.c	Mon May 10 23:53:44 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: sbus.c,v 1.81 2021/04/24 23:36:49 thorpej Exp $ */
+/*	$NetBSD: sbus.c,v 1.82 2021/05/10 23:53:44 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sbus.c,v 1.81 2021/04/24 23:36:49 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbus.c,v 1.82 2021/05/10 23:53:44 thorpej Exp $");
 
 #include 
 #include 
@@ -413,6 +413,7 @@ sbus_attach_common(struct sbus_softc *sc
 			panic("sbus_attach: %s: incomplete", sp);
 		}
 		(void) config_found(sc->sc_dev, (void *), 

CVS commit: src/sys

2021-05-10 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon May 10 23:53:44 UTC 2021

Modified Files:
src/sys/arch/sparc/dev: bootbus.c ebus.c sbus.c vme_machdep.c
src/sys/arch/sparc/sparc: autoconf.c iommu.c msiiep.c
src/sys/arch/sparc64/dev: cbus.c central.c ebus.c ebus_mainbus.c fhc.c
psycho.c pyro.c sbus.c schizo.c upa.c vbus.c vpci.c
src/sys/arch/sparc64/sparc64: autoconf.c
src/sys/dev/sbus: dma_sbus.c lebuffer.c qec.c xbox.c

Log Message:
Associate the OpenBoot / OpenFirmware node with attached devices
at config_found() time.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/sparc/dev/bootbus.c
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/sparc/dev/ebus.c
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/sparc/dev/sbus.c
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/sparc/dev/vme_machdep.c
cvs rdiff -u -r1.265 -r1.266 src/sys/arch/sparc/sparc/autoconf.c
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/sparc/sparc/iommu.c
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/sparc/sparc/msiiep.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sparc64/dev/cbus.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sparc64/dev/central.c \
src/sys/arch/sparc64/dev/vbus.c
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/sparc64/dev/ebus.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/sparc64/dev/ebus_mainbus.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sparc64/dev/fhc.c
cvs rdiff -u -r1.133 -r1.134 src/sys/arch/sparc64/dev/psycho.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/sparc64/dev/pyro.c
cvs rdiff -u -r1.101 -r1.102 src/sys/arch/sparc64/dev/sbus.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/sparc64/dev/schizo.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/sparc64/dev/upa.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/sparc64/dev/vpci.c
cvs rdiff -u -r1.228 -r1.229 src/sys/arch/sparc64/sparc64/autoconf.c
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/sbus/dma_sbus.c
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/sbus/lebuffer.c
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/sbus/qec.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/sbus/xbox.c

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



re: CVS commit: xsrc/external/mit/xterm

2021-05-10 Thread matthew green
thanks for looking into this.

"Christos Zoulas" writes:
> Module Name:  xsrc
> Committed By: christos
> Date: Mon May 10 12:29:12 UTC 2021
>
> Modified Files:
>   xsrc/external/mit/xterm/dist: misc.c
>   xsrc/external/mit/xterm/include: xtermcfg.h
>
> Log Message:
> revert previous, do it differently and explain why.

please explain changes in the commit message, *especially* for
generated files.

for posterity on this list, message is:

--
/*
 * clang treats _Noreturn and __attribute__((__noreturn__)) differently,
 * so we end up labeling xt_error() with _Noreturn and using it in
 * XtSetErrorHandler which is marked with the attribute noreturn, and clang
 * complains. IMHO this is a bug in clang. We tell everyone that we don't
 * have the header, so we use the attribute consistently and everyone is happy.
 */
--

thanks.


.mrg.


CVS commit: src/distrib/sets/lists/modules

2021-05-10 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon May 10 14:27:47 UTC 2021

Modified Files:
src/distrib/sets/lists/modules: ad.mips

Log Message:
Column alignment.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/distrib/sets/lists/modules/ad.mips

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



CVS commit: src/distrib/sets/lists/modules

2021-05-10 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon May 10 14:27:47 UTC 2021

Modified Files:
src/distrib/sets/lists/modules: ad.mips

Log Message:
Column alignment.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/distrib/sets/lists/modules/ad.mips

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

Modified files:

Index: src/distrib/sets/lists/modules/ad.mips
diff -u src/distrib/sets/lists/modules/ad.mips:1.17 src/distrib/sets/lists/modules/ad.mips:1.18
--- src/distrib/sets/lists/modules/ad.mips:1.17	Sun Nov  1 18:51:34 2020
+++ src/distrib/sets/lists/modules/ad.mips	Mon May 10 14:27:47 2021
@@ -1,4 +1,4 @@
-# $NetBSD: ad.mips,v 1.17 2020/11/01 18:51:34 pgoyette Exp $
+# $NetBSD: ad.mips,v 1.18 2021/05/10 14:27:47 simonb Exp $
 ./@MODULEDIR@/compat_netbsd32			modules-base-kernel	kmod,arch64,nocompatmodules
 ./@MODULEDIR@/compat_netbsd32/compat_netbsd32.kmod modules-base-kernel	kmod,arch64,nocompatmodules
 ./@MODULEDIR@/compat_netbsd32_09		modules-base-kernel	kmod,arch64,nocompatmodules
@@ -29,27 +29,27 @@
 ./@MODULEDIR@/compat_netbsd32_80/compat_netbsd32_80.kmod modules-base-kernel	kmod,arch64,nocompatmodules
 ./@MODULEDIR@/compat_netbsd32_90		modules-base-kernel	kmod,arch64,nocompatmodules
 ./@MODULEDIR@/compat_netbsd32_90/compat_netbsd32_90.kmod modules-base-kernel	kmod,arch64,nocompatmodules
-./@MODULEDIR@/compat_netbsd32_coredump			modules-base-kernel	kmod,arch64,nocompatmodules
+./@MODULEDIR@/compat_netbsd32_coredump		modules-base-kernel	kmod,arch64,nocompatmodules
 ./@MODULEDIR@/compat_netbsd32_coredump/compat_netbsd32_coredump.kmod	modules-base-kernel	kmod,arch64,nocompatmodules
-./@MODULEDIR@/compat_netbsd32_mqueue			modules-base-kernel	kmod,arch64,nocompatmodules
+./@MODULEDIR@/compat_netbsd32_mqueue		modules-base-kernel	kmod,arch64,nocompatmodules
 ./@MODULEDIR@/compat_netbsd32_mqueue/compat_netbsd32_mqueue.kmod	modules-base-kernel	kmod,arch64,nocompatmodules
-./@MODULEDIR@/compat_netbsd32_nfssrv			modules-base-kernel	kmod,arch64,nocompatmodules
+./@MODULEDIR@/compat_netbsd32_nfssrv		modules-base-kernel	kmod,arch64,nocompatmodules
 ./@MODULEDIR@/compat_netbsd32_nfssrv/compat_netbsd32_nfssrv.kmod	modules-base-kernel	kmod,arch64,nocompatmodules
-./@MODULEDIR@/compat_netbsd32_ptrace			modules-base-kernel	kmod,arch64,nocompatmodules
+./@MODULEDIR@/compat_netbsd32_ptrace		modules-base-kernel	kmod,arch64,nocompatmodules
 ./@MODULEDIR@/compat_netbsd32_ptrace/compat_netbsd32_ptrace.kmod	modules-base-kernel	kmod,arch64,nocompatmodules
-./@MODULEDIR@/compat_netbsd32_quota			modules-base-kernel	kmod,arch64,nocompatmodules
+./@MODULEDIR@/compat_netbsd32_quota		modules-base-kernel	kmod,arch64,nocompatmodules
 ./@MODULEDIR@/compat_netbsd32_quota/compat_netbsd32_quota.kmod	modules-base-kernel	kmod,arch64,nocompatmodules
-./@MODULEDIR@/compat_netbsd32_quota_50			modules-base-kernel	kmod,arch64,nocompatmodules
+./@MODULEDIR@/compat_netbsd32_quota_50		modules-base-kernel	kmod,arch64,nocompatmodules
 ./@MODULEDIR@/compat_netbsd32_quota_50/compat_netbsd32_quota_50.kmod	modules-base-kernel	kmod,arch64,nocompatmodules
-./@MODULEDIR@/compat_netbsd32_raid			modules-base-kernel	kmod,arch64,nocompatmodules
+./@MODULEDIR@/compat_netbsd32_raid		modules-base-kernel	kmod,arch64,nocompatmodules
 ./@MODULEDIR@/compat_netbsd32_raid/compat_netbsd32_raid.kmod	modules-base-kernel	kmod,arch64,nocompatmodules
-./@MODULEDIR@/compat_netbsd32_sysvipc			modules-base-kernel	kmod,arch64,nocompatmodules
+./@MODULEDIR@/compat_netbsd32_sysvipc		modules-base-kernel	kmod,arch64,nocompatmodules
 ./@MODULEDIR@/compat_netbsd32_sysvipc/compat_netbsd32_sysvipc.kmod	modules-base-kernel	kmod,arch64,nocompatmodules
-./@MODULEDIR@/compat_netbsd32_sysvipc_10		modules-base-kernel	kmod,arch64,nocompatmodules
+./@MODULEDIR@/compat_netbsd32_sysvipc_10	modules-base-kernel	kmod,arch64,nocompatmodules
 ./@MODULEDIR@/compat_netbsd32_sysvipc_10/compat_netbsd32_sysvipc_10.kmod	modules-base-kernel	kmod,arch64,nocompatmodules
-./@MODULEDIR@/compat_netbsd32_sysvipc_14		modules-base-kernel	kmod,arch64,nocompatmodules
+./@MODULEDIR@/compat_netbsd32_sysvipc_14	modules-base-kernel	kmod,arch64,nocompatmodules
 ./@MODULEDIR@/compat_netbsd32_sysvipc_14/compat_netbsd32_sysvipc_14.kmod	modules-base-kernel	kmod,arch64,nocompatmodules
-./@MODULEDIR@/compat_netbsd32_sysvipc_50		modules-base-kernel	kmod,arch64,nocompatmodules
+./@MODULEDIR@/compat_netbsd32_sysvipc_50	modules-base-kernel	kmod,arch64,nocompatmodules
 ./@MODULEDIR@/compat_netbsd32_sysvipc_50/compat_netbsd32_sysvipc_50.kmod	modules-base-kernel	kmod,arch64,nocompatmodules
 ./@MODULEDIR@/exec_elf32			modules-base-kernel	kmod
 ./@MODULEDIR@/exec_elf32/exec_elf32.kmod	modules-base-kernel	kmod



CVS commit: src/sys

2021-05-10 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon May 10 13:59:30 UTC 2021

Modified Files:
src/sys/arch/sparc/include: promlib.h
src/sys/arch/sparc/sparc: promlib.c
src/sys/sys: device.h

Log Message:
sparc{,64} promlib -> devhandle_t glue


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/sparc/include/promlib.h
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/sparc/sparc/promlib.c
cvs rdiff -u -r1.169 -r1.170 src/sys/sys/device.h

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/sparc/include/promlib.h
diff -u src/sys/arch/sparc/include/promlib.h:1.25 src/sys/arch/sparc/include/promlib.h:1.26
--- src/sys/arch/sparc/include/promlib.h:1.25	Mon Sep 11 19:25:07 2017
+++ src/sys/arch/sparc/include/promlib.h	Mon May 10 13:59:30 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: promlib.h,v 1.25 2017/09/11 19:25:07 palle Exp $ */
+/*	$NetBSD: promlib.h,v 1.26 2021/05/10 13:59:30 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -41,6 +41,8 @@
 #include "opt_multiprocessor.h"
 #endif
 
+#include 			/* for devhandle_t */
+
 #include 
 #include 
 #include 
@@ -110,6 +112,9 @@ struct promops {
 
 	int	(*po_finddevice)(const char *);
 
+	/* devhandle_t interface */
+	devhandle_t (*po_node_to_devhandle)(int);
+	int	(*po_devhandle_to_node)(devhandle_t);
 };
 
 extern struct promops	promops;
@@ -211,6 +216,9 @@ void	prom_boot(char *)	__attribute__((__
 #define nextsibling(node)	prom_nextsibling(node)
 #define prom_getproplen(node,name)	prom_proplen(node, name)
 
+/* devhandle_t interface */
+#define	prom_node_to_devhandle(n)  ((*promops.po_node_to_devhandle)(n))
+#define	prom_devhandle_to_node(dh) ((*promops.po_devhandle_to_node)(dh))
 
 /* MP stuff - not currently used */
 #define prom_cpustart(m,a,c,pc)	((*promops.po_cpustart)(m,a,c,pc))
@@ -220,4 +228,9 @@ void	prom_boot(char *)	__attribute__((__
 
 extern void	*romp;		/* PROM-supplied argument (see locore) */
 
+#ifdef _KERNEL
+#define	OBP_DEVICE_CALL_REGISTER(_n_, _c_)\
+	DEVICE_CALL_REGISTER(obp_device_calls, _n_, _c_)
+#endif /* _KERNEL */
+
 #endif /* _SPARC_PROMLIB_H_ */

Index: src/sys/arch/sparc/sparc/promlib.c
diff -u src/sys/arch/sparc/sparc/promlib.c:1.47 src/sys/arch/sparc/sparc/promlib.c:1.48
--- src/sys/arch/sparc/sparc/promlib.c:1.47	Sun Jan 24 07:36:54 2021
+++ src/sys/arch/sparc/sparc/promlib.c	Mon May 10 13:59:30 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: promlib.c,v 1.47 2021/01/24 07:36:54 mrg Exp $ */
+/*	$NetBSD: promlib.c,v 1.48 2021/05/10 13:59:30 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: promlib.c,v 1.47 2021/01/24 07:36:54 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: promlib.c,v 1.48 2021/05/10 13:59:30 thorpej Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_sparc_arch.h"
@@ -43,6 +43,7 @@ __KERNEL_RCSID(0, "$NetBSD: promlib.c,v 
 
 #include 
 #include 
+#include 
 
 #ifdef _STANDALONE
 #include 
@@ -93,6 +94,23 @@ static int	opf_instance_to_package(int);
 static char	*opf_nextprop(int, const char *);
 static void	opf_interpret_simple(const char *);
 
+#ifndef _STANDALONE
+static devhandle_t
+null_prom_to_devhandle(int node __unused)
+{
+	devhandle_t devhandle;
+
+	devhandle_invalidate();
+
+	return devhandle;
+}
+
+static int
+null_devhandle_to_prom(devhandle_t devhandle __unused)
+{
+	return 0;
+}
+#endif /* ! _STANDALONE */
 
 /*
  * PROM entry points.
@@ -142,7 +160,20 @@ struct promops promops = {
 	(void *)notimplemented,		/* getprop */
 	(void *)notimplemented,		/* setprop */
 	(void *)notimplemented,		/* nextprop */
-	(void *)notimplemented		/* finddevice */
+	(void *)notimplemented,		/* finddevice */
+
+	/*
+	 * These should never be called in the STANDALONE environment,
+	 * but when we're in the kernel environment, it's not really
+	 * invalid to do so.
+	 */
+#ifdef STANDALONE
+	(void *)notimplemented,		/* node_to_devhandle */
+	(void *)notimplemented,		/* devhandle_to_node */
+#else
+	(void *)null_prom_to_devhandle,	/* node_to_devhandle */
+	(void *)null_devhandle_to_prom,	/* devhandle_to_node */
+#endif /* STANDALONE */
 };
 
 static void
@@ -181,6 +212,73 @@ notimplemented(void)
 	}
 }
 
+#ifndef _STANDALONE
+/*
+ * OBP device handle support.  We subsume v0-v3 into a single implementation
+ * and use promops to handle differences.
+ *
+ * On 32-bit SPARC, the OpenFirmware variant also gets redirected here.
+ * See prom_init_opf().
+ */
+
+static device_call_t
+obp_devhandle_lookup_device_call(devhandle_t handle, const char *name,
+devhandle_t *call_handlep)
+{
+	__link_set_decl(obp_device_calls, struct device_call_descriptor);
+	struct device_call_descriptor * const *desc;
+
+	__link_set_foreach(desc, obp_device_calls) {
+		if (strcmp((*desc)->name, name) == 0) {
+			return (*desc)->call;
+		}
+	}
+	return NULL;
+}
+
+static const struct devhandle_impl 

CVS commit: src/sys

2021-05-10 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Mon May 10 13:59:30 UTC 2021

Modified Files:
src/sys/arch/sparc/include: promlib.h
src/sys/arch/sparc/sparc: promlib.c
src/sys/sys: device.h

Log Message:
sparc{,64} promlib -> devhandle_t glue


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/sparc/include/promlib.h
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/sparc/sparc/promlib.c
cvs rdiff -u -r1.169 -r1.170 src/sys/sys/device.h

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



CVS commit: xsrc/external/mit/xterm

2021-05-10 Thread Christos Zoulas
Module Name:xsrc
Committed By:   christos
Date:   Mon May 10 12:29:12 UTC 2021

Modified Files:
xsrc/external/mit/xterm/dist: misc.c
xsrc/external/mit/xterm/include: xtermcfg.h

Log Message:
revert previous, do it differently and explain why.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 xsrc/external/mit/xterm/dist/misc.c
cvs rdiff -u -r1.17 -r1.18 xsrc/external/mit/xterm/include/xtermcfg.h

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

Modified files:

Index: xsrc/external/mit/xterm/dist/misc.c
diff -u xsrc/external/mit/xterm/dist/misc.c:1.19 xsrc/external/mit/xterm/dist/misc.c:1.20
--- xsrc/external/mit/xterm/dist/misc.c:1.19	Sun May  9 12:55:36 2021
+++ xsrc/external/mit/xterm/dist/misc.c	Mon May 10 08:29:11 2021
@@ -6563,7 +6563,7 @@ xioerror(Display *dpy)
 return 0;			/* appease the compiler */
 }
 
-void _X_NORETURN
+void
 xt_error(String message)
 {
 xtermWarning("Xt error: %s\n", message);

Index: xsrc/external/mit/xterm/include/xtermcfg.h
diff -u xsrc/external/mit/xterm/include/xtermcfg.h:1.17 xsrc/external/mit/xterm/include/xtermcfg.h:1.18
--- xsrc/external/mit/xterm/include/xtermcfg.h:1.17	Mon Apr 26 22:11:31 2021
+++ xsrc/external/mit/xterm/include/xtermcfg.h	Mon May 10 08:29:11 2021
@@ -98,7 +98,16 @@
 #define HAVE_SETPGID 1		/* AC_CHECK_FUNCS(setpgid) */
 #define HAVE_STDINT_H 1		/* AC_PROG_CC_STDC */
 #define HAVE_STDLIB_H 1		/* AC_CHECK_HEADERS(stdlib.h) */
+#if 0
+/*
+ * clang treats _Noreturn and __attribute__((__noreturn__)) differently,
+ * so we end up labeling xt_error() with _Noreturn and using it in
+ * XtSetErrorHandler which is marked with the attribute noreturn, and clang
+ * complains. IMHO this is a bug in clang. We tell everyone that we don't
+ * have the header, so we use the attribute consistently and everyone is happy.
+ */
 #define HAVE_STDNORETURN_H 1		/* CF_C11_NORETURN */
+#endif
 #define HAVE_STRFTIME 1		/* AC_CHECK_FUNCS(strftime) */
 /* #undef HAVE_SYS_TIME_H */		/* AC_HEADER_TIME */
 #define HAVE_SYS_TTYDEFAULTS_H 1	/* AC_CHECK_HEADERS(sys/ttydefaults.h) */



CVS commit: xsrc/external/mit/xterm

2021-05-10 Thread Christos Zoulas
Module Name:xsrc
Committed By:   christos
Date:   Mon May 10 12:29:12 UTC 2021

Modified Files:
xsrc/external/mit/xterm/dist: misc.c
xsrc/external/mit/xterm/include: xtermcfg.h

Log Message:
revert previous, do it differently and explain why.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 xsrc/external/mit/xterm/dist/misc.c
cvs rdiff -u -r1.17 -r1.18 xsrc/external/mit/xterm/include/xtermcfg.h

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