CVS commit: src/sys/dev

2019-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 11 07:33:55 UTC 2019

Modified Files:
src/sys/dev/mii: ikphyreg.h inbmphyreg.h
src/sys/dev/pci: pci_subr.c pcireg.h

Log Message:
s/enalbe/enable/


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/mii/ikphyreg.h
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/mii/inbmphyreg.h
cvs rdiff -u -r1.217 -r1.218 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.147 -r1.148 src/sys/dev/pci/pcireg.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/dev/mii/ikphyreg.h
diff -u src/sys/dev/mii/ikphyreg.h:1.3 src/sys/dev/mii/ikphyreg.h:1.4
--- src/sys/dev/mii/ikphyreg.h:1.3	Fri Oct 28 05:50:18 2016
+++ src/sys/dev/mii/ikphyreg.h	Wed Dec 11 07:33:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ikphyreg.h,v 1.3 2016/10/28 05:50:18 msaitoh Exp $	*/
+/*	$NetBSD: ikphyreg.h,v 1.4 2019/12/11 07:33:55 msaitoh Exp $	*/
 /***
 Copyright (c) 2001-2005, Intel Corporation 
 All rights reserved.
@@ -57,7 +57,7 @@ POSSIBILITY OF SUCH DAMAGE.
 #define GG82563_PSCR_CROSSOVER_MODE_MDI 0x /* 00=Manual MDI configuration */
 #define GG82563_PSCR_CROSSOVER_MODE_MDIX0x0020 /* 01=Manual MDIX configuration */
 #define GG82563_PSCR_CROSSOVER_MODE_AUTO0x0060 /* 11=Automatic crossover */
-#define GG82563_PSCR_ENALBE_EXTENDED_DISTANCE   0x0080 /* 1=Enable Extended Distance */
+#define GG82563_PSCR_ENABLE_EXTENDED_DISTANCE   0x0080 /* 1=Enable Extended Distance */
 #define GG82563_PSCR_ENERGY_DETECT_MASK 0x0300
 #define GG82563_PSCR_ENERGY_DETECT_OFF  0x /* 00,01=Off */
 #define GG82563_PSCR_ENERGY_DETECT_RX   0x0200 /* 10=Sense on Rx only (Energy Detect) */

Index: src/sys/dev/mii/inbmphyreg.h
diff -u src/sys/dev/mii/inbmphyreg.h:1.18 src/sys/dev/mii/inbmphyreg.h:1.19
--- src/sys/dev/mii/inbmphyreg.h:1.18	Thu Jan 31 15:30:23 2019
+++ src/sys/dev/mii/inbmphyreg.h	Wed Dec 11 07:33:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: inbmphyreg.h,v 1.18 2019/01/31 15:30:23 msaitoh Exp $	*/
+/*	$NetBSD: inbmphyreg.h,v 1.19 2019/12/11 07:33:55 msaitoh Exp $	*/
 /***
 Copyright (c) 2001-2015, Intel Corporation 
 All rights reserved.
@@ -68,7 +68,7 @@ POSSIBILITY OF SUCH DAMAGE.
 #define BME1000_PSCR_CROSSOVER_MODE_MDI 0x /* 00=Manual MDI configuration */
 #define BME1000_PSCR_CROSSOVER_MODE_MDIX0x0020 /* 01=Manual MDIX configuration */
 #define BME1000_PSCR_CROSSOVER_MODE_AUTO0x0060 /* 11=Automatic crossover */
-#define BME1000_PSCR_ENALBE_EXTENDED_DISTANCE   0x0080 /* 1=Enable Extended Distance */
+#define BME1000_PSCR_ENABLE_EXTENDED_DISTANCE   0x0080 /* 1=Enable Extended Distance */
 #define BME1000_PSCR_ENERGY_DETECT_MASK 0x0300
 #define BME1000_PSCR_ENERGY_DETECT_OFF  0x /* 00,01=Off */
 #define BME1000_PSCR_ENERGY_DETECT_RX   0x0200 /* 10=Sense on Rx only (Energy Detect) */

Index: src/sys/dev/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.217 src/sys/dev/pci/pci_subr.c:1.218
--- src/sys/dev/pci/pci_subr.c:1.217	Fri Sep 20 10:04:45 2019
+++ src/sys/dev/pci/pci_subr.c	Wed Dec 11 07:33:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.217 2019/09/20 10:04:45 msaitoh Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.218 2019/12/11 07:33:55 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.217 2019/09/20 10:04:45 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.218 2019/12/11 07:33:55 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -3531,7 +3531,7 @@ pci_conf_print_page_req_cap(const pcireg
 	ctl = reg & 0x;
 	sta = reg >> 16;
 	printf("Control Register: 0x%04x\n", ctl);
-	onoff("Enalbe", reg, PCI_PAGE_REQ_CTL_E);
+	onoff("Enable", reg, PCI_PAGE_REQ_CTL_E);
 	onoff("Reset", reg, PCI_PAGE_REQ_CTL_R);
 
 	printf("Status Register: 0x%04x\n", sta);

Index: src/sys/dev/pci/pcireg.h
diff -u src/sys/dev/pci/pcireg.h:1.147 src/sys/dev/pci/pcireg.h:1.148
--- src/sys/dev/pci/pcireg.h:1.147	Fri Mar  1 09:26:00 2019
+++ src/sys/dev/pci/pcireg.h	Wed Dec 11 07:33:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcireg.h,v 1.147 2019/03/01 09:26:00 msaitoh Exp $	*/
+/*	$NetBSD: pcireg.h,v 1.148 2019/12/11 07:33:55 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -1886,7 +1886,7 @@ struct pci_rom {
  * Page Request
  */
 #define	PCI_PAGE_REQ_CTL	0x04	/* Control Register */
-#define	PCI_PAGE_REQ_CTL_E	__BIT(0)	/* Enalbe */
+#define	PCI_PAGE_REQ_CTL_E	__BIT(0)	/* Enable */
 #define	PCI_PAGE_REQ_CTL_R	__BIT(1)	/* Reset */
 #define	PCI_PAGE_REQ_STA	0x04	/* Status Register */
 #define	PCI_PAGE_REQ_STA_RF	__BIT(0+16)	/* Response Failure */



CVS commit: src/sys/dev

2019-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 11 07:33:55 UTC 2019

Modified Files:
src/sys/dev/mii: ikphyreg.h inbmphyreg.h
src/sys/dev/pci: pci_subr.c pcireg.h

Log Message:
s/enalbe/enable/


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/mii/ikphyreg.h
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/mii/inbmphyreg.h
cvs rdiff -u -r1.217 -r1.218 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.147 -r1.148 src/sys/dev/pci/pcireg.h

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



re: CVS commit: src/sys/kern

2019-12-10 Thread matthew green
> > > Log Message:
> > > Expunge the panicstr checks, we don't need them.
> > 
> > can you explain why?
> 
> Sure, [ .. ]

ah, wow.  i didn't realise it had such a bad effect on cpus before
they actually go properly down.

we should probably work hard to make them go down faster if possible,
though maybe that's already as good as it can be.

> > what sort of crash-time testing did you perform?
> 
> That the system can be debugged and reset cleanly.  If we've got code in DDB
> that hangs up or crashdups don't work then that's something we should fix.
> I've not run into any in a long time, they seem to get fixed.
> 
> Do you have a particular concern or something else in mind?

i was also curious about crash dumps working, but mostly
this change is about reducing true lossage during a crash.

thanks.


.mrg.


CVS commit: src/sys/dev/pci

2019-12-10 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Wed Dec 11 05:50:03 UTC 2019

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

Log Message:
Fix build error related to ixl(4) on i386


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/if_ixl.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_ixl.c
diff -u src/sys/dev/pci/if_ixl.c:1.2 src/sys/dev/pci/if_ixl.c:1.3
--- src/sys/dev/pci/if_ixl.c:1.2	Wed Dec 11 01:51:22 2019
+++ src/sys/dev/pci/if_ixl.c	Wed Dec 11 05:50:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ixl.c,v 1.2 2019/12/11 01:51:22 yamaguchi Exp $	*/
+/*	$NetBSD: if_ixl.c,v 1.3 2019/12/11 05:50:03 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -807,14 +807,17 @@ static const struct ixl_aq_regs ixl_pf_a
 static inline uint32_t
 ixl_dmamem_hi(struct ixl_dmamem *ixm)
 {
-	uint32_t val;
+	uint32_t retval;
+	uint64_t val;
 
-	if (sizeof(IXL_DMA_DVA(ixm)) > 4)
-		val = (uint32_t)(IXL_DMA_DVA(ixm) >> 32);
-	else
-		val = 0;
+	if (sizeof(bus_addr_t) > 4) {
+		val = (intptr_t)IXL_DMA_DVA(ixm);
+		retval = (uint32_t)(val >> 32);
+	} else {
+		retval = 0;
+	}
 
-	return val;
+	return retval;
 }
 
 static inline uint32_t
@@ -827,11 +830,14 @@ ixl_dmamem_lo(struct ixl_dmamem *ixm)
 static inline void
 ixl_aq_dva(struct ixl_aq_desc *iaq, bus_addr_t addr)
 {
+	uint64_t val;
 
-	if (sizeof(addr) > 4)
-		iaq->iaq_param[2] = htole32(addr >> 32);
-	else
+	if (sizeof(bus_addr_t) > 4) {
+		val = (intptr_t)addr;
+		iaq->iaq_param[2] = htole32(val >> 32);
+	} else {
 		iaq->iaq_param[2] = htole32(0);
+	}
 
 	iaq->iaq_param[3] = htole32(addr);
 }



CVS commit: src/sys/dev/pci

2019-12-10 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Wed Dec 11 05:50:03 UTC 2019

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

Log Message:
Fix build error related to ixl(4) on i386


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/if_ixl.c

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



Re: CVS commit: src/sys/arch (multiboot2 support)

2019-12-10 Thread Emmanuel Dreyfus
Paul Goyette  wrote:

> This commit seems to have broken amd64 booting!  When booting into
> a qemu environment (as set up by misc/py-anita), it just hangs while
> printing the "progress numbers with the spinny cursor".  Others on
> irc/icb have indicated an immediate crash.

I rolled back the change to sys/arch/amd64/conf/kern.ldscript, this
should fix BIOS boot. 

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
m...@netbsd.org


CVS commit: src/sys/arch/amd64/conf

2019-12-10 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Wed Dec 11 02:31:45 UTC 2019

Modified Files:
src/sys/arch/amd64/conf: kern.ldscript

Log Message:
Rollback kernel link scrpt change for multiboot

The multiboot section breaks BIOS boot. Rolling back the link script
removes the section, which breaks multiboot but should restore BIOS boot.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/amd64/conf/kern.ldscript

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/kern.ldscript
diff -u src/sys/arch/amd64/conf/kern.ldscript:1.28 src/sys/arch/amd64/conf/kern.ldscript:1.29
--- src/sys/arch/amd64/conf/kern.ldscript:1.28	Tue Dec 10 02:06:07 2019
+++ src/sys/arch/amd64/conf/kern.ldscript	Wed Dec 11 02:31:44 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern.ldscript,v 1.28 2019/12/10 02:06:07 manu Exp $	*/
+/*	$NetBSD: kern.ldscript,v 1.29 2019/12/11 02:31:44 manu Exp $	*/
 
 #include "assym.h"
 
@@ -13,13 +13,9 @@ __LARGE_PAGE_SIZE = 0x20 ;
 ENTRY(_start)
 SECTIONS
 {
-	multiboot 0x4000 :
-	{
-		KEEP(*(multiboot));
-	}
 	.text : AT (ADDR(.text) & 0x0fff)
 	{
-		. = ALIGN(__LARGE_PAGE_SIZE);
+		. = ALIGN(__PAGE_SIZE);
 		__text_user_start = . ;
 		*(.text.user)
 		. = ALIGN(__PAGE_SIZE);



CVS commit: src/sys/arch/amd64/conf

2019-12-10 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Wed Dec 11 02:31:45 UTC 2019

Modified Files:
src/sys/arch/amd64/conf: kern.ldscript

Log Message:
Rollback kernel link scrpt change for multiboot

The multiboot section breaks BIOS boot. Rolling back the link script
removes the section, which breaks multiboot but should restore BIOS boot.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/amd64/conf/kern.ldscript

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



CVS commit: src/sys/dev/mii

2019-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 11 02:22:39 UTC 2019

Modified Files:
src/sys/dev/mii: files.mii

Log Message:
 Add ukphy_subr flag to ipgphy to make kernel compilable with ipgphy and
without ukphy. Pointed out by Hauke.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/mii/files.mii

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/mii/files.mii
diff -u src/sys/dev/mii/files.mii:1.53 src/sys/dev/mii/files.mii:1.54
--- src/sys/dev/mii/files.mii:1.53	Fri Nov  1 02:53:22 2019
+++ src/sys/dev/mii/files.mii	Wed Dec 11 02:22:38 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.mii,v 1.53 2019/11/01 02:53:22 msaitoh Exp $
+#	$NetBSD: files.mii,v 1.54 2019/12/11 02:22:38 msaitoh Exp $
 
 defflag	opt_mii.h	MIIVERBOSE
 
@@ -99,7 +99,7 @@ device	ikphy: mii_phy
 attach	ikphy at mii
 file	dev/mii/ikphy.cikphy
 
-device	ipgphy: mii_phy
+device	ipgphy: mii_phy, ukphy_subr
 attach	ipgphy at mii
 file	dev/mii/ipgphy.c			ipgphy
 



CVS commit: src/sys/dev/mii

2019-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 11 02:22:39 UTC 2019

Modified Files:
src/sys/dev/mii: files.mii

Log Message:
 Add ukphy_subr flag to ipgphy to make kernel compilable with ipgphy and
without ukphy. Pointed out by Hauke.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/mii/files.mii

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

2019-12-10 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Wed Dec 11 01:51:23 UTC 2019

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

Log Message:
Not use _LP64 but sizeof(bus_addr_t) for getting size of address
It makes ixl(4) be able to work on ILP32

pointed out by thorpej@. thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/if_ixl.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

2019-12-10 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Wed Dec 11 01:51:23 UTC 2019

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

Log Message:
Not use _LP64 but sizeof(bus_addr_t) for getting size of address
It makes ixl(4) be able to work on ILP32

pointed out by thorpej@. thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/if_ixl.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_ixl.c
diff -u src/sys/dev/pci/if_ixl.c:1.1 src/sys/dev/pci/if_ixl.c:1.2
--- src/sys/dev/pci/if_ixl.c:1.1	Tue Dec 10 12:08:52 2019
+++ src/sys/dev/pci/if_ixl.c	Wed Dec 11 01:51:22 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ixl.c,v 1.1 2019/12/10 12:08:52 yamaguchi Exp $	*/
+/*	$NetBSD: if_ixl.c,v 1.2 2019/12/11 01:51:22 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -803,21 +803,36 @@ static const struct ixl_aq_regs ixl_pf_a
 bus_space_barrier((_s)->sc_memt, (_s)->sc_memh, (_r), (_l), (_o))
 #define ixl_flush(_s)	(void)ixl_rd((_s), I40E_GLGEN_STAT)
 #define ixl_nqueues(_sc)	(1 << ((_sc)->sc_nqueue_pairs - 1))
-#ifdef _LP64
-#define ixl_dmamem_hi(_ixm)	(uint32_t)(IXL_DMA_DVA(_ixm) >> 32)
-#else
-#define ixl_dmamem_hi(_ixm)	0
-#endif
-#define ixl_dmamem_lo(_ixm)	(uint32_t)IXL_DMA_DVA(_ixm)
+
+static inline uint32_t
+ixl_dmamem_hi(struct ixl_dmamem *ixm)
+{
+	uint32_t val;
+
+	if (sizeof(IXL_DMA_DVA(ixm)) > 4)
+		val = (uint32_t)(IXL_DMA_DVA(ixm) >> 32);
+	else
+		val = 0;
+
+	return val;
+}
+
+static inline uint32_t
+ixl_dmamem_lo(struct ixl_dmamem *ixm)
+{
+
+	return (uint32_t)IXL_DMA_DVA(ixm);
+}
 
 static inline void
 ixl_aq_dva(struct ixl_aq_desc *iaq, bus_addr_t addr)
 {
-#ifdef _LP64
-	iaq->iaq_param[2] = htole32(addr >> 32);
-#else
-	iaq->iaq_param[2] = htole32(0);
-#endif
+
+	if (sizeof(addr) > 4)
+		iaq->iaq_param[2] = htole32(addr >> 32);
+	else
+		iaq->iaq_param[2] = htole32(0);
+
 	iaq->iaq_param[3] = htole32(addr);
 }
 



Re: CVS commit: src/sys/kern

2019-12-10 Thread Andrew Doran
On Wed, Dec 11, 2019 at 09:06:33AM +1100, matthew green wrote:

> "Andrew Doran" writes:
> > Module Name:src
> > Committed By:   ad
> > Date:   Mon Dec  9 21:02:10 UTC 2019
> > 
> > Modified Files:
> > src/sys/kern: kern_rwlock.c
> > 
> > Log Message:
> > Expunge the panicstr checks, we don't need them.
> 
> can you explain why?

Sure, I have developed a bit of a feel for it after years off watching the
thing panic.  The checks to not go too hard on the assertions once panicstr
are set are pretty good in my experience - we don't want that to snowball.

The ones that disable locking were of some kind of use (at least to me) back
in 2007 before we had a decent LOCKDEBUG setup for the newlock2 primitives. 
So it sprang out of development requirements and an uncertainty about all
how this new synchronization stuff was going to behave in practice more than
a desire to do the right thing.

On a uniprocessor or dual core box back then the panicstr checks didn't
really seem to have many bad effects, but with more CPUs it often seems to
make the crash much worse than it needs to be and I keep bumping into the
effects of it.  Here's a craptacular example:

http://www.netbsd.org/~ad/

That's kind of amusing to look at and it's only my framebuffer memory but I
worry that it could just as well be inodes or mbufs or anything else that
belongs to the user, and I think that until the CPUs are locked up and
activity stopped, the thing needs to keep working as properly as it can.

> what sort of crash-time testing did you perform?

That the system can be debugged and reset cleanly.  If we've got code in DDB
that hangs up or crashdups don't work then that's something we should fix.
I've not run into any in a long time, they seem to get fixed.

Do you have a particular concern or something else in mind?

Cheers,
Andrew


Re: CVS commit: src/sys/arch (multiboot2 support)

2019-12-10 Thread Emmanuel Dreyfus
Paul Goyette  wrote:

> This commit seems to have broken amd64 booting!  When booting into
> a qemu environment (as set up by misc/py-anita), it just hangs while
> printing the "progress numbers with the spinny cursor".  Others on
> irc/icb have indicated an immediate crash.
> 
> Seems like non-efi booting is borked.

This is caused by sys/arch/amd64/conf/kern.ldscript  1.27-1.28
I will fix that within a few hours.

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
m...@netbsd.org


CVS commit: src/sys/arch/arm/sunxi

2019-12-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Dec 10 22:30:34 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: sun8i_crypto.c

Log Message:
Oops -- forgot to kmem_free.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/sunxi/sun8i_crypto.c

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



CVS commit: src/sys/arch/arm/sunxi

2019-12-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Dec 10 22:30:34 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: sun8i_crypto.c

Log Message:
Oops -- forgot to kmem_free.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/sunxi/sun8i_crypto.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/arm/sunxi/sun8i_crypto.c
diff -u src/sys/arch/arm/sunxi/sun8i_crypto.c:1.6 src/sys/arch/arm/sunxi/sun8i_crypto.c:1.7
--- src/sys/arch/arm/sunxi/sun8i_crypto.c:1.6	Mon Dec  9 14:56:44 2019
+++ src/sys/arch/arm/sunxi/sun8i_crypto.c	Tue Dec 10 22:30:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sun8i_crypto.c,v 1.6 2019/12/09 14:56:44 riastradh Exp $	*/
+/*	$NetBSD: sun8i_crypto.c,v 1.7 2019/12/10 22:30:34 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.6 2019/12/09 14:56:44 riastradh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.7 2019/12/10 22:30:34 riastradh Exp $");
 
 #include 
 #include 
@@ -1295,6 +1295,7 @@ out2:	sun8i_crypto_task_put(sc, req->cu_
 out1:	sun8i_crypto_freebuf(sc, req->cu_size, >cu_buf);
 out0:	cv_destroy(>cu_cv);
 	mutex_destroy(>cu_lock);
+	kmem_free(req, sizeof(*req));
 	return error;
 }
 
@@ -1328,4 +1329,5 @@ sun8i_crypto_sysctl_rng_done(struct sun8
 	sun8i_crypto_freebuf(sc, req->cu_size, >cu_buf);
 	cv_destroy(>cu_cv);
 	mutex_destroy(>cu_lock);
+	kmem_free(req, sizeof(*req));
 }



re: CVS commit: src/sys/kern

2019-12-10 Thread matthew green
"Andrew Doran" writes:
> Module Name:  src
> Committed By: ad
> Date: Mon Dec  9 21:02:10 UTC 2019
> 
> Modified Files:
>   src/sys/kern: kern_rwlock.c
> 
> Log Message:
> Expunge the panicstr checks, we don't need them.

can you explain why?  what sort of crash-time testing did
you perform?

thanks.


.mrg.


CVS commit: src/lib/libedit

2019-12-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 10 19:42:09 UTC 2019

Modified Files:
src/lib/libedit: filecomplete.c

Log Message:
When 'attempted_completion_function' non-NULL, with a 'single_match'
match, the expected space is not being added. Problem observed with
"chronyc" and "sqlite3" tab completion. That functionality got
moved to escape_filename() for the !attempted_completion_function
case, but the non-NULL 'attempted_completion_function' case must
also be handled. (Lonnie Abelbeck)


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/lib/libedit/filecomplete.c

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

Modified files:

Index: src/lib/libedit/filecomplete.c
diff -u src/lib/libedit/filecomplete.c:1.61 src/lib/libedit/filecomplete.c:1.62
--- src/lib/libedit/filecomplete.c:1.61	Wed Oct  9 10:31:07 2019
+++ src/lib/libedit/filecomplete.c	Tue Dec 10 14:42:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: filecomplete.c,v 1.61 2019/10/09 14:31:07 christos Exp $	*/
+/*	$NetBSD: filecomplete.c,v 1.62 2019/12/10 19:42:09 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: filecomplete.c,v 1.61 2019/10/09 14:31:07 christos Exp $");
+__RCSID("$NetBSD: filecomplete.c,v 1.62 2019/12/10 19:42:09 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -703,107 +703,110 @@ fn_complete(EditLine *el,
 	if (over != NULL)
 		*over = 0;
 
-	if (matches) {
-		int i;
-		size_t matches_num, maxlen, match_len, match_display=1;
-		int single_match = matches[2] == NULL &&
-			(matches[1] == NULL || strcmp(matches[0], matches[1]) == 0);
-
-		retval = CC_REFRESH;
-
-		if (matches[0][0] != '\0') {
-			el_deletestr(el, (int)len);
-			if (!attempted_completion_function)
-completion = escape_filename(el, matches[0],
-single_match, app_func);
-			else
-completion = strdup(matches[0]);
-			if (completion == NULL)
-goto out;
-			if (single_match) {
-/* We found exact match. Add a space after it,
- * unless we do filename completion and the
- * object is a directory. Also do necessary
- * escape quoting
- */
-el_winsertstr(el,
-ct_decode_string(completion, >el_scratch));
-			} else {
-/* Only replace the completed string with
- * common part of possible matches if there is
- * possible completion.
- */
-el_winsertstr(el,
-ct_decode_string(completion, >el_scratch));
-			}
-			free(completion);
-		}
+	if (matches == NULL) {
+		goto out;
+	}
+	int i;
+	size_t matches_num, maxlen, match_len, match_display=1;
+	int single_match = matches[2] == NULL &&
+		(matches[1] == NULL || strcmp(matches[0], matches[1]) == 0);
+
+	retval = CC_REFRESH;
+
+	if (matches[0][0] != '\0') {
+		el_deletestr(el, (int)len);
+		if (!attempted_completion_function)
+			completion = escape_filename(el, matches[0],
+			single_match, app_func);
+		else
+			completion = strdup(matches[0]);
+		if (completion == NULL)
+			goto out;
 
+		/*
+		 * Replace the completed string with the common part of
+		 * all possible matches if there is a possible completion.
+		 */
+		el_winsertstr(el,
+		ct_decode_string(completion, >el_scratch));
 
-		if (!single_match && (what_to_do == '!' || what_to_do == '?')) {
+		if (single_match && attempted_completion_function) {
 			/*
-			 * More than one match and requested to list possible
-			 * matches.
+			 * We found an exact match. Add a space after
+			 * it, unless we do filename completion and the
+			 * object is a directory. Also do necessary
+			 * escape quoting
 			 */
+			el_winsertstr(el, ct_decode_string(
+			(*app_func)(completion), >el_scratch));
+		}
+		free(completion);
+	}
 
-			for(i = 1, maxlen = 0; matches[i]; i++) {
-match_len = strlen(matches[i]);
-if (match_len > maxlen)
-	maxlen = match_len;
-			}
-			/* matches[1] through matches[i-1] are available */
-			matches_num = (size_t)(i - 1);
 
-			/* newline to get on next line from command line */
-			(void)fprintf(el->el_outfile, "\n");
+	if (!single_match && (what_to_do == '!' || what_to_do == '?')) {
+		/*
+		 * More than one match and requested to list possible
+		 * matches.
+		 */
 
-			/*
-			 * If there are too many items, ask user for display
-			 * confirmation.
-			 */
-			if (matches_num > query_items) {
-(void)fprintf(el->el_outfile,
-"Display all %zu possibilities? (y or n) ",
-matches_num);
-(void)fflush(el->el_outfile);
-if (getc(stdin) != 'y')
-	match_display = 0;
-(void)fprintf(el->el_outfile, "\n");
-			}
+		for(i = 1, maxlen = 0; matches[i]; i++) {
+			match_len = strlen(matches[i]);
+			if (match_len > maxlen)
+maxlen = match_len;
+		}
+		/* matches[1] through matches[i-1] are available */
+		matches_num = (size_t)(i - 1);
 
-			if (match_display) {
-/*
- * 

CVS commit: src/lib/libedit

2019-12-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 10 19:42:09 UTC 2019

Modified Files:
src/lib/libedit: filecomplete.c

Log Message:
When 'attempted_completion_function' non-NULL, with a 'single_match'
match, the expected space is not being added. Problem observed with
"chronyc" and "sqlite3" tab completion. That functionality got
moved to escape_filename() for the !attempted_completion_function
case, but the non-NULL 'attempted_completion_function' case must
also be handled. (Lonnie Abelbeck)


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/lib/libedit/filecomplete.c

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



Re: CVS commit: src/sys/arch (multiboot2 support)

2019-12-10 Thread Paul Goyette

This commit seems to have broken amd64 booting!  When booting into
a qemu environment (as set up by misc/py-anita), it just hangs while
printing the "progress numbers with the spinny cursor".  Others on
irc/icb have indicated an immediate crash.

Seems like non-efi booting is borked.



Module Name:src
Committed By:   manu
Date:   Tue Dec 10 02:06:07 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64: locore.S machdep.c
src/sys/arch/amd64/conf: GENERIC files.amd64 kern.ldscript
src/sys/arch/x86/x86: efi.c multiboot2.c

Log Message:
Add multiboot 2 support to amd64 kernel


To generate a diff of this commit:
cvs rdiff -u -r1.192 -r1.193 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.342 -r1.343 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.548 -r1.549 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.113 -r1.114 src/sys/arch/amd64/conf/files.amd64
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/amd64/conf/kern.ldscript
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/x86/x86/efi.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/x86/multiboot2.c


++--+---+
| Paul Goyette   | PGP Key fingerprint: | E-mail addresses: |
| (Retired)  | FA29 0E3B 35AF E8AE 6651 | p...@whooppee.com |
| Software Developer | 0786 F758 55DE 53BA 7731 | pgoye...@netbsd.org   |
++--+---+


CVS commit: src/lib/libkvm

2019-12-10 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Dec 10 18:13:07 UTC 2019

Modified Files:
src/lib/libkvm: kvm_proc.c

Log Message:
Mask out always zero bits off pg->phys_addr.


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/lib/libkvm/kvm_proc.c

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



CVS commit: src/lib/libkvm

2019-12-10 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Dec 10 18:13:07 UTC 2019

Modified Files:
src/lib/libkvm: kvm_proc.c

Log Message:
Mask out always zero bits off pg->phys_addr.


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/lib/libkvm/kvm_proc.c

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

Modified files:

Index: src/lib/libkvm/kvm_proc.c
diff -u src/lib/libkvm/kvm_proc.c:1.92 src/lib/libkvm/kvm_proc.c:1.93
--- src/lib/libkvm/kvm_proc.c:1.92	Mon Apr  4 22:14:38 2016
+++ src/lib/libkvm/kvm_proc.c	Tue Dec 10 18:13:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kvm_proc.c,v 1.92 2016/04/04 22:14:38 christos Exp $	*/
+/*	$NetBSD: kvm_proc.c,v 1.93 2019/12/10 18:13:07 ad Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 #if 0
 static char sccsid[] = "@(#)kvm_proc.c	8.3 (Berkeley) 9/23/93";
 #else
-__RCSID("$NetBSD: kvm_proc.c,v 1.92 2016/04/04 22:14:38 christos Exp $");
+__RCSID("$NetBSD: kvm_proc.c,v 1.93 2019/12/10 18:13:07 ad Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -260,7 +260,7 @@ _kvm_ureadm(kvm_t *kd, const struct mini
 			return (NULL);
 
 		if (_kvm_pread(kd, kd->pmfd, kd->swapspc, (size_t)kd->nbpg,
-		(off_t)pg.phys_addr) != kd->nbpg)
+		(off_t)pg.phys_addr & -kd->nbpg) != kd->nbpg)
 			return (NULL);
 	} else {
 		if (kd->swfd < 0 ||



CVS commit: src/sys/arch/aarch64/aarch64

2019-12-10 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Dec 10 18:08:33 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c

Log Message:
pg->phys_addr -> VM_PAGE_TO_PHYS(pg)


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/aarch64/aarch64/pmap.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/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.50 src/sys/arch/aarch64/aarch64/pmap.c:1.51
--- src/sys/arch/aarch64/aarch64/pmap.c:1.50	Thu Nov 14 17:09:22 2019
+++ src/sys/arch/aarch64/aarch64/pmap.c	Tue Dec 10 18:08:32 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.50 2019/11/14 17:09:22 maxv Exp $	*/
+/*	$NetBSD: pmap.c,v 1.51 2019/12/10 18:08:32 ad Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.50 2019/11/14 17:09:22 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.51 2019/12/10 18:08:32 ad Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -1034,7 +1034,7 @@ pg_dump(struct vm_page *pg, void (*pr)(c
 	pr(" pg->loan_count = %u\n", pg->loan_count);
 	pr(" pg->wire_count = %u\n", pg->wire_count);
 	pr(" pg->pqflags= %u\n", pg->pqflags);
-	pr(" pg->phys_addr  = %016lx\n", pg->phys_addr);
+	pr(" pg->phys_addr  = %016lx\n", VM_PAGE_TO_PHYS(pg));
 }
 
 static void



CVS commit: src/sys/arch/aarch64/aarch64

2019-12-10 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Dec 10 18:08:33 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c

Log Message:
pg->phys_addr -> VM_PAGE_TO_PHYS(pg)


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/aarch64/aarch64/pmap.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/nvmm/x86

2019-12-10 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Dec 10 18:06:50 UTC 2019

Modified Files:
src/sys/dev/nvmm/x86: nvmm_x86_svm.c nvmm_x86_vmx.c

Log Message:
pg->phys_addr > VM_PAGE_TO_PHYS(pg)


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/nvmm/x86/nvmm_x86_svm.c
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/nvmm/x86/nvmm_x86_vmx.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/nvmm/x86

2019-12-10 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Dec 10 18:06:50 UTC 2019

Modified Files:
src/sys/dev/nvmm/x86: nvmm_x86_svm.c nvmm_x86_vmx.c

Log Message:
pg->phys_addr > VM_PAGE_TO_PHYS(pg)


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/nvmm/x86/nvmm_x86_svm.c
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/nvmm/x86/nvmm_x86_vmx.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/nvmm/x86/nvmm_x86_svm.c
diff -u src/sys/dev/nvmm/x86/nvmm_x86_svm.c:1.54 src/sys/dev/nvmm/x86/nvmm_x86_svm.c:1.55
--- src/sys/dev/nvmm/x86/nvmm_x86_svm.c:1.54	Wed Nov 20 10:26:56 2019
+++ src/sys/dev/nvmm/x86/nvmm_x86_svm.c	Tue Dec 10 18:06:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86_svm.c,v 1.54 2019/11/20 10:26:56 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86_svm.c,v 1.55 2019/12/10 18:06:50 ad Exp $	*/
 
 /*
  * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_svm.c,v 1.54 2019/11/20 10:26:56 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_svm.c,v 1.55 2019/12/10 18:06:50 ad Exp $");
 
 #include 
 #include 
@@ -1489,7 +1489,7 @@ svm_memalloc(paddr_t *pa, vaddr_t *va, s
 	, 1, 0);
 	if (ret != 0)
 		return ENOMEM;
-	_pa = TAILQ_FIRST()->phys_addr;
+	_pa = VM_PAGE_TO_PHYS(TAILQ_FIRST());
 	_va = uvm_km_alloc(kernel_map, npages * PAGE_SIZE, 0,
 	UVM_KMF_VAONLY | UVM_KMF_NOWAIT);
 	if (_va == 0)

Index: src/sys/dev/nvmm/x86/nvmm_x86_vmx.c
diff -u src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.45 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.46
--- src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.45	Wed Nov 20 10:26:56 2019
+++ src/sys/dev/nvmm/x86/nvmm_x86_vmx.c	Tue Dec 10 18:06:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86_vmx.c,v 1.45 2019/11/20 10:26:56 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86_vmx.c,v 1.46 2019/12/10 18:06:50 ad Exp $	*/
 
 /*
  * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.45 2019/11/20 10:26:56 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.46 2019/12/10 18:06:50 ad Exp $");
 
 #include 
 #include 
@@ -2112,7 +2112,7 @@ vmx_memalloc(paddr_t *pa, vaddr_t *va, s
 	, 1, 0);
 	if (ret != 0)
 		return ENOMEM;
-	_pa = TAILQ_FIRST()->phys_addr;
+	_pa = VM_PAGE_TO_PHYS(TAILQ_FIRST());
 	_va = uvm_km_alloc(kernel_map, npages * PAGE_SIZE, 0,
 	UVM_KMF_VAONLY | UVM_KMF_NOWAIT);
 	if (_va == 0)



CVS commit: src/sys/arch/i386/i386

2019-12-10 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Dec 10 18:04:54 UTC 2019

Modified Files:
src/sys/arch/i386/i386: machdep.c

Log Message:
pg->phys_addr -> VM_PAGE_TO_PHYS(pg)


To generate a diff of this commit:
cvs rdiff -u -r1.823 -r1.824 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.



CVS commit: src/sys/arch/i386/i386

2019-12-10 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Dec 10 18:04:54 UTC 2019

Modified Files:
src/sys/arch/i386/i386: machdep.c

Log Message:
pg->phys_addr -> VM_PAGE_TO_PHYS(pg)


To generate a diff of this commit:
cvs rdiff -u -r1.823 -r1.824 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/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.823 src/sys/arch/i386/i386/machdep.c:1.824
--- src/sys/arch/i386/i386/machdep.c:1.823	Fri Oct 18 01:38:28 2019
+++ src/sys/arch/i386/i386/machdep.c	Tue Dec 10 18:04:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.823 2019/10/18 01:38:28 manu Exp $	*/
+/*	$NetBSD: machdep.c,v 1.824 2019/12/10 18:04:54 ad 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.823 2019/10/18 01:38:28 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.824 2019/12/10 18:04:54 ad Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_freebsd.h"
@@ -1680,7 +1680,7 @@ cpu_alloc_l3_page(struct cpu_info *ci)
 		panic("%s: failed to allocate L3 pglist for CPU %d (ret %d)\n",
 			__func__, cpu_index(ci), ret);
 
-	ci->ci_pae_l3_pdirpa = vmap->phys_addr;
+	ci->ci_pae_l3_pdirpa = VM_PAGE_TO_PHYS(vmap);
 
 	ci->ci_pae_l3_pdir = (paddr_t *)uvm_km_alloc(kernel_map, PAGE_SIZE, 0,
 		UVM_KMF_VAONLY | UVM_KMF_NOWAIT);



CVS commit: src/sys/arch/arm/include/arm32

2019-12-10 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Dec 10 18:02:14 UTC 2019

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
pg->phys_addr -> VM_PAGE_TO_PHYS(pg)


To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.157 src/sys/arch/arm/include/arm32/pmap.h

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



CVS commit: src/sys/arch/arm/include/arm32

2019-12-10 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Dec 10 18:02:14 UTC 2019

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
pg->phys_addr -> VM_PAGE_TO_PHYS(pg)


To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.157 src/sys/arch/arm/include/arm32/pmap.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/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.156 src/sys/arch/arm/include/arm32/pmap.h:1.157
--- src/sys/arch/arm/include/arm32/pmap.h:1.156	Thu Oct 18 09:01:52 2018
+++ src/sys/arch/arm/include/arm32/pmap.h	Tue Dec 10 18:02:14 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.156 2018/10/18 09:01:52 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.157 2019/12/10 18:02:14 ad Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -1158,7 +1158,7 @@ struct vm_page_md {
  */
 #if ARM_MMU_V6 > 0
 #define	VM_MDPAGE_PVH_ATTRS_INIT(pg) \
-	(pg)->mdpage.pvh_attrs = (pg)->phys_addr & arm_cache_prefer_mask
+	(pg)->mdpage.pvh_attrs = VM_PAGE_TO_PHYS(pg) & arm_cache_prefer_mask
 #else
 #define	VM_MDPAGE_PVH_ATTRS_INIT(pg) \
 	(pg)->mdpage.pvh_attrs = 0



CVS commit: src/sys/dev/pci

2019-12-10 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Dec 10 18:00:17 UTC 2019

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

Log Message:
p->phys_addr -> VM_PAGE_TO_PHYS(p)


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/viomb.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/viomb.c
diff -u src/sys/dev/pci/viomb.c:1.9 src/sys/dev/pci/viomb.c:1.10
--- src/sys/dev/pci/viomb.c:1.9	Sun Jun 10 14:59:23 2018
+++ src/sys/dev/pci/viomb.c	Tue Dec 10 18:00:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: viomb.c,v 1.9 2018/06/10 14:59:23 jakllsch Exp $	*/
+/*	$NetBSD: viomb.c,v 1.10 2019/12/10 18:00:17 ad Exp $	*/
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: viomb.c,v 1.9 2018/06/10 14:59:23 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: viomb.c,v 1.10 2019/12/10 18:00:17 ad Exp $");
 
 #include 
 #include 
@@ -281,7 +281,7 @@ inflate(struct viomb_softc *sc)
 	b->bl_nentries = nvpages;
 	i = 0;
 	TAILQ_FOREACH(p, >bl_pglist, pageq.queue) {
-		b->bl_pages[i++] = p->phys_addr / VIRTIO_PAGE_SIZE;
+		b->bl_pages[i++] = VM_PAGE_TO_PHYS(p) / VIRTIO_PAGE_SIZE;
 	}
 	KASSERT(i == nvpages);
 
@@ -387,7 +387,7 @@ deflate(struct viomb_softc *sc)
 			break;
 		TAILQ_REMOVE(>sc_balloon_pages, p, pageq.queue);
 		TAILQ_INSERT_TAIL(>bl_pglist, p, pageq.queue);
-		b->bl_pages[i] = p->phys_addr / VIRTIO_PAGE_SIZE;
+		b->bl_pages[i] = VM_PAGE_TO_PHYS(p) / VIRTIO_PAGE_SIZE;
 	}
 
 	if (virtio_enqueue_prep(vsc, vq, ) != 0) {



CVS commit: src/sys/dev/pci

2019-12-10 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Dec 10 18:00:17 UTC 2019

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

Log Message:
p->phys_addr -> VM_PAGE_TO_PHYS(p)


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/viomb.c

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



CVS commit: src/sys/kern

2019-12-10 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Dec 10 13:36:44 UTC 2019

Modified Files:
src/sys/kern: kern_mutex.c

Log Message:
Balance the parentheses - hopefully unbreak the build.


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/kern/kern_mutex.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/kern/kern_mutex.c
diff -u src/sys/kern/kern_mutex.c:1.83 src/sys/kern/kern_mutex.c:1.84
--- src/sys/kern/kern_mutex.c:1.83	Tue Dec 10 11:35:29 2019
+++ src/sys/kern/kern_mutex.c	Tue Dec 10 13:36:44 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_mutex.c,v 1.83 2019/12/10 11:35:29 ad Exp $	*/
+/*	$NetBSD: kern_mutex.c,v 1.84 2019/12/10 13:36:44 kre Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2019 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 #define	__MUTEX_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.83 2019/12/10 11:35:29 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.84 2019/12/10 13:36:44 kre Exp $");
 
 #include 
 #include 
@@ -836,7 +836,7 @@ mutex_owner_running(const kmutex_t *mtx)
 	MUTEX_ASSERT(mtx, MUTEX_ADAPTIVE_P(mtx));
 	kpreempt_disable();
 	owner = mtx->mtx_owner;
-	rv = (!MUTEX_OWNED(owner) || mutex_oncpu(MUTEX_OWNER(owner));
+	rv = !MUTEX_OWNED(owner) || mutex_oncpu(MUTEX_OWNER(owner));
 	kpreempt_enable();
 	return rv;
 #else



CVS commit: src/sys/kern

2019-12-10 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Dec 10 13:36:44 UTC 2019

Modified Files:
src/sys/kern: kern_mutex.c

Log Message:
Balance the parentheses - hopefully unbreak the build.


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/kern/kern_mutex.c

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



CVS commit: src/share/man/man4

2019-12-10 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Tue Dec 10 13:07:28 UTC 2019

Added Files:
src/share/man/man4: ixl.4

Log Message:
Added the manual for ixl(4)


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/share/man/man4/ixl.4

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



CVS commit: src/share/man/man4

2019-12-10 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Tue Dec 10 13:07:28 UTC 2019

Added Files:
src/share/man/man4: ixl.4

Log Message:
Added the manual for ixl(4)


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/share/man/man4/ixl.4

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

Added files:

Index: src/share/man/man4/ixl.4
diff -u /dev/null src/share/man/man4/ixl.4:1.1
--- /dev/null	Tue Dec 10 13:07:28 2019
+++ src/share/man/man4/ixl.4	Tue Dec 10 13:07:28 2019
@@ -0,0 +1,65 @@
+.\"	$NetBSD: ixl.4,v 1.1 2019/12/10 13:07:28 yamaguchi Exp $
+.\"
+.\" Copyright (c) 2019 Internet Initiative Japan, Inc.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd December 10, 2019
+.Dt IXL 4
+.Os
+.Sh NAME
+.Nm ixl
+.Nd Intel Ethernet 700 Series driver
+.Sh SYNOPSIS
+.Cd "ixl* at pci? dev ? function ?"
+.Sh DESCRIPTION
+The
+.Nm
+driver supports Intel Ethernet 700 series controllers based on the
+Intel X710, XXV710, XL710, and X722 Ethernet chipsets.
+.Sh SEE ALSO
+.Xr arp 4 ,
+.Xr ifmedia 4 ,
+.Xr netintro 4 ,
+.Xr pci 4 ,
+.Xr ifconfig 8
+.Sh HISTORY
+The
+.Nm
+driver comes from
+.Ox .
+It first appeared in
+.Nx 10.0 .
+.Sh AUTHORS
+The
+.Nm
+driver was written by
+.An David Gwynne Aq Mt d...@openbsd.org
+and
+.An Jonathan Matthew Aq Mt jmatt...@openbsd.org .
+It was imported from
+.Ox
+into
+.Nx
+by
+.An Shoichi Yamaguchi Aq Mt yamagu...@netbsd.org .



CVS commit: src/sys/dev/hyperv

2019-12-10 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Tue Dec 10 12:20:20 UTC 2019

Modified Files:
src/sys/dev/hyperv: hyperv_common.c hypervvar.h if_hvn.c vmbus.c
vmbusvar.h

Log Message:
hvn(4) can be added and deleted dynamically.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/hyperv/hyperv_common.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/hyperv/hypervvar.h \
src/sys/dev/hyperv/vmbusvar.h
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/hyperv/if_hvn.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/hyperv/vmbus.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/hyperv/hyperv_common.c
diff -u src/sys/dev/hyperv/hyperv_common.c:1.4 src/sys/dev/hyperv/hyperv_common.c:1.5
--- src/sys/dev/hyperv/hyperv_common.c:1.4	Sat Dec  7 11:45:45 2019
+++ src/sys/dev/hyperv/hyperv_common.c	Tue Dec 10 12:20:20 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: hyperv_common.c,v 1.4 2019/12/07 11:45:45 nonaka Exp $	*/
+/*	$NetBSD: hyperv_common.c,v 1.5 2019/12/10 12:20:20 nonaka Exp $	*/
 
 /*-
  * Copyright (c) 2009-2012,2016-2017 Microsoft Corp.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hyperv_common.c,v 1.4 2019/12/07 11:45:45 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hyperv_common.c,v 1.5 2019/12/10 12:20:20 nonaka Exp $");
 
 #include "hyperv.h"
 
@@ -111,17 +111,18 @@ hyperv_guid2str(const struct hyperv_guid
  */
 void *
 hyperv_dma_alloc(bus_dma_tag_t dmat, struct hyperv_dma *dma, bus_size_t size,
-bus_size_t alignment, bus_size_t boundary, int nsegs)
+bus_size_t alignment, bus_size_t boundary, int nsegs, int flags)
 {
-	const int kmemflags = cold ? KM_NOSLEEP : KM_SLEEP;
-	const int dmaflags = cold ? BUS_DMA_NOWAIT : BUS_DMA_WAITOK;
+	const int waitok = (flags & HYPERV_DMA_NOSLEEP) != HYPERV_DMA_NOSLEEP;
+	const int kmemflags = waitok ? KM_SLEEP: KM_NOSLEEP;
+	const int dmaflags = waitok ? BUS_DMA_WAITOK : BUS_DMA_NOWAIT;
 	int rseg, error;
 
 	KASSERT(dma != NULL);
 	KASSERT(dma->segs == NULL);
 	KASSERT(nsegs > 0);
 
-	dma->segs = kmem_zalloc(sizeof(*dma->segs) * nsegs, kmemflags);
+	dma->segs = kmem_intr_zalloc(sizeof(*dma->segs) * nsegs, kmemflags);
 	if (dma->segs == NULL)
 		return NULL;
 

Index: src/sys/dev/hyperv/hypervvar.h
diff -u src/sys/dev/hyperv/hypervvar.h:1.3 src/sys/dev/hyperv/hypervvar.h:1.4
--- src/sys/dev/hyperv/hypervvar.h:1.3	Sat Dec  7 11:45:45 2019
+++ src/sys/dev/hyperv/hypervvar.h	Tue Dec 10 12:20:20 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypervvar.h,v 1.3 2019/12/07 11:45:45 nonaka Exp $	*/
+/*	$NetBSD: hypervvar.h,v 1.4 2019/12/10 12:20:20 nonaka Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -108,8 +108,10 @@ hyperv_dma_get_paddr(struct hyperv_dma *
 	return dma->map->dm_segs[0].ds_addr;
 }
 
+#define HYPERV_DMA_SLEEPOK	0
+#define HYPERV_DMA_NOSLEEP	__BIT(0)
 void *hyperv_dma_alloc(bus_dma_tag_t, struct hyperv_dma *, bus_size_t,
-bus_size_t, bus_size_t, int);
+bus_size_t, bus_size_t, int, int);
 void hyperv_dma_free(bus_dma_tag_t, struct hyperv_dma *);
 
 #endif	/* _KERNEL */
Index: src/sys/dev/hyperv/vmbusvar.h
diff -u src/sys/dev/hyperv/vmbusvar.h:1.3 src/sys/dev/hyperv/vmbusvar.h:1.4
--- src/sys/dev/hyperv/vmbusvar.h:1.3	Sat Dec  7 11:45:45 2019
+++ src/sys/dev/hyperv/vmbusvar.h	Tue Dec 10 12:20:20 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmbusvar.h,v 1.3 2019/12/07 11:45:45 nonaka Exp $	*/
+/*	$NetBSD: vmbusvar.h,v 1.4 2019/12/10 12:20:20 nonaka Exp $	*/
 /*	$OpenBSD: hypervvar.h,v 1.13 2017/06/23 19:05:42 mikeb Exp $	*/
 
 /*
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -43,6 +44,7 @@
 typedef void (*vmbus_channel_callback_t)(void *);
 
 struct vmbus_softc;
+struct vmbus_channel;
 
 struct vmbus_msg {
 	uint64_t			msg_flags;
@@ -57,11 +59,14 @@ struct vmbus_msg {
 __CTASSERT((offsetof(struct vmbus_msg, msg_req) % 8) == 0);
 TAILQ_HEAD(vmbus_queue, vmbus_msg);
 
-struct vmbus_offer {
-	struct vmbus_chanmsg_choffer	co_chan;
-	SIMPLEQ_ENTRY(vmbus_offer)	co_entry;
+struct vmbus_dev {
+	int	vd_type;
+#define VMBUS_DEV_TYPE_ATTACH			0
+#define VMBUS_DEV_TYPE_DETACH			1
+	struct vmbus_channel			*vd_chan;
+	SIMPLEQ_ENTRY(vmbus_dev)		vd_entry;
 };
-SIMPLEQ_HEAD(vmbus_offers, vmbus_offer);
+SIMPLEQ_HEAD(vmbus_devq, vmbus_dev);
 
 struct vmbus_ring_data {
 	struct vmbus_bufring		*rd_ring;
@@ -72,7 +77,6 @@ struct vmbus_ring_data {
 	uint32_t			rd_dsize;
 };
 
-struct vmbus_channel;
 TAILQ_HEAD(vmbus_channels, vmbus_channel);
 
 struct vmbus_channel {
@@ -111,6 +115,7 @@ struct vmbus_channel {
 	uint32_t			ch_flags;
 #define  CHF_BATCHED			__BIT(0)
 #define  CHF_MONITOR			__BIT(1)
+#define  CHF_REVOKED			__BIT(2)
 
 	uint8_tch_mgroup;
 	uint8_tch_mindex;
@@ -137,12 +142,6 @@ struct vmbus_attach_args {
 	bus_space_tag_t			aa_memt;
 };
 
-struct vmbus_dev {
-	struct vmbus_attach_args	dv_aa;
-	SLIST_ENTRY(vmbus_dev)		dv_entry;
-};
-SLIST_HEAD(vmbus_devices, 

CVS commit: src/sys/dev/hyperv

2019-12-10 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Tue Dec 10 12:20:20 UTC 2019

Modified Files:
src/sys/dev/hyperv: hyperv_common.c hypervvar.h if_hvn.c vmbus.c
vmbusvar.h

Log Message:
hvn(4) can be added and deleted dynamically.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/hyperv/hyperv_common.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/hyperv/hypervvar.h \
src/sys/dev/hyperv/vmbusvar.h
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/hyperv/if_hvn.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/hyperv/vmbus.c

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



CVS commit: src

2019-12-10 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Tue Dec 10 12:08:53 UTC 2019

Modified Files:
src/distrib/sets/lists/man: mi
src/distrib/sets/lists/modules: mi
src/doc: CHANGES
src/share/man/man4: Makefile
src/sys/arch/amd64/conf: ALL GENERIC
src/sys/arch/i386/conf: ALL GENERIC
src/sys/dev/pci: files.pci
src/sys/modules: Makefile
Added Files:
src/sys/dev/pci: if_ixl.c if_ixlreg.h if_ixlvar.h
src/sys/modules/if_ixl: Makefile if_ixl.ioconf

Log Message:
Ported driver for Intel Ethernet 700 series

reviewed by msaitoh and knakahara


To generate a diff of this commit:
cvs rdiff -u -r1.1663 -r1.1664 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.128 -r1.129 src/distrib/sets/lists/modules/mi
cvs rdiff -u -r1.2618 -r1.2619 src/doc/CHANGES
cvs rdiff -u -r1.689 -r1.690 src/share/man/man4/Makefile
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.549 -r1.550 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.474 -r1.475 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.1216 -r1.1217 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.417 -r1.418 src/sys/dev/pci/files.pci
cvs rdiff -u -r0 -r1.1 src/sys/dev/pci/if_ixl.c src/sys/dev/pci/if_ixlreg.h \
src/sys/dev/pci/if_ixlvar.h
cvs rdiff -u -r1.230 -r1.231 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/if_ixl/Makefile \
src/sys/modules/if_ixl/if_ixl.ioconf

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



CVS commit: src/sys/kern

2019-12-10 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Dec 10 11:35:29 UTC 2019

Modified Files:
src/sys/kern: kern_mutex.c

Log Message:
Inverted test.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/kern/kern_mutex.c

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



CVS commit: src/sys/kern

2019-12-10 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Dec 10 11:35:29 UTC 2019

Modified Files:
src/sys/kern: kern_mutex.c

Log Message:
Inverted test.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/kern/kern_mutex.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/kern/kern_mutex.c
diff -u src/sys/kern/kern_mutex.c:1.82 src/sys/kern/kern_mutex.c:1.83
--- src/sys/kern/kern_mutex.c:1.82	Tue Dec 10 11:12:02 2019
+++ src/sys/kern/kern_mutex.c	Tue Dec 10 11:35:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_mutex.c,v 1.82 2019/12/10 11:12:02 ad Exp $	*/
+/*	$NetBSD: kern_mutex.c,v 1.83 2019/12/10 11:35:29 ad Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2019 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 #define	__MUTEX_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.82 2019/12/10 11:12:02 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.83 2019/12/10 11:35:29 ad Exp $");
 
 #include 
 #include 
@@ -836,7 +836,7 @@ mutex_owner_running(const kmutex_t *mtx)
 	MUTEX_ASSERT(mtx, MUTEX_ADAPTIVE_P(mtx));
 	kpreempt_disable();
 	owner = mtx->mtx_owner;
-	rv = (MUTEX_OWNED(owner) && mutex_oncpu(MUTEX_OWNER(owner));
+	rv = (!MUTEX_OWNED(owner) || mutex_oncpu(MUTEX_OWNER(owner));
 	kpreempt_enable();
 	return rv;
 #else



CVS commit: src/sys/dev/hyperv

2019-12-10 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Tue Dec 10 11:19:25 UTC 2019

Modified Files:
src/sys/dev/hyperv: if_hvn.c

Log Message:
hvn(4): Handle VMBUS_CHANPKT_TYPE_INBAND packet type.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/hyperv/if_hvn.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/hyperv

2019-12-10 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Tue Dec 10 11:19:25 UTC 2019

Modified Files:
src/sys/dev/hyperv: if_hvn.c

Log Message:
hvn(4): Handle VMBUS_CHANPKT_TYPE_INBAND packet type.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/hyperv/if_hvn.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/hyperv/if_hvn.c
diff -u src/sys/dev/hyperv/if_hvn.c:1.11 src/sys/dev/hyperv/if_hvn.c:1.12
--- src/sys/dev/hyperv/if_hvn.c:1.11	Tue Nov 26 01:46:31 2019
+++ src/sys/dev/hyperv/if_hvn.c	Tue Dec 10 11:19:25 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_hvn.c,v 1.11 2019/11/26 01:46:31 nonaka Exp $	*/
+/*	$NetBSD: if_hvn.c,v 1.12 2019/12/10 11:19:25 nonaka Exp $	*/
 /*	$OpenBSD: if_hvn.c,v 1.39 2018/03/11 14:31:34 mikeb Exp $	*/
 
 /*-
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.11 2019/11/26 01:46:31 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.12 2019/12/10 11:19:25 nonaka Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1040,6 +1040,16 @@ hvn_nvs_intr(void *arg)
 "on receive\n", nvs->nvs_type);
 break;
 			}
+		} else if (cph->cph_type == VMBUS_CHANPKT_TYPE_INBAND) {
+			switch (nvs->nvs_type) {
+			case HVN_NVS_TYPE_TXTBL_NOTE:
+/* Useless; ignore */
+break;
+			default:
+device_printf(sc->sc_dev,
+"got notify, nvs type %u\n", nvs->nvs_type);
+break;
+			}
 		} else
 			device_printf(sc->sc_dev,
 			"unknown NVSP packet type %u\n", cph->cph_type);



CVS commit: src/sys/kern

2019-12-10 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Dec 10 11:12:02 UTC 2019

Modified Files:
src/sys/kern: kern_mutex.c

Log Message:
Fix build break.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/kern/kern_mutex.c

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



CVS commit: src/sys/kern

2019-12-10 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Dec 10 11:12:02 UTC 2019

Modified Files:
src/sys/kern: kern_mutex.c

Log Message:
Fix build break.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/kern/kern_mutex.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/kern/kern_mutex.c
diff -u src/sys/kern/kern_mutex.c:1.81 src/sys/kern/kern_mutex.c:1.82
--- src/sys/kern/kern_mutex.c:1.81	Mon Dec  9 21:05:23 2019
+++ src/sys/kern/kern_mutex.c	Tue Dec 10 11:12:02 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_mutex.c,v 1.81 2019/12/09 21:05:23 ad Exp $	*/
+/*	$NetBSD: kern_mutex.c,v 1.82 2019/12/10 11:12:02 ad Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2019 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 #define	__MUTEX_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.81 2019/12/09 21:05:23 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.82 2019/12/10 11:12:02 ad Exp $");
 
 #include 
 #include 
@@ -823,19 +823,25 @@ mutex_owner(const kmutex_t *mtx)
 /*
  * mutex_owner_running:
  *
- *	Return true if an adaptive mutex is held and the owner is running
- *	on a CPU.  For the pagedaemon.
+ *	Return true if an adaptive mutex is unheld, or held and the owner is
+ *	running on a CPU.  For the pagedaemon.
  */
 bool
 mutex_owner_running(const kmutex_t *mtx)
 {
+#ifdef MULTIPROCESSOR
+	uintptr_t owner;
 	bool rv;
 
 	MUTEX_ASSERT(mtx, MUTEX_ADAPTIVE_P(mtx));
 	kpreempt_disable();
-	rv = mutex_oncpu(MUTEX_OWNER(mtx->mtx_owner));
+	owner = mtx->mtx_owner;
+	rv = (MUTEX_OWNED(owner) && mutex_oncpu(MUTEX_OWNER(owner));
 	kpreempt_enable();
 	return rv;
+#else
+	return mutex_owner(mtx) == curlwp;
+#endif
 }
 
 /*



CVS commit: src/bin/sh

2019-12-10 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Dec 10 09:18:37 UTC 2019

Modified Files:
src/bin/sh: parser.c

Log Message:
Correct a typo in a comment, 08x0 was meant to be 0x80 (duh!).  NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.168 -r1.169 src/bin/sh/parser.c

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



CVS commit: src/bin/sh

2019-12-10 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Dec 10 09:18:37 UTC 2019

Modified Files:
src/bin/sh: parser.c

Log Message:
Correct a typo in a comment, 08x0 was meant to be 0x80 (duh!).  NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.168 -r1.169 src/bin/sh/parser.c

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

Modified files:

Index: src/bin/sh/parser.c
diff -u src/bin/sh/parser.c:1.168 src/bin/sh/parser.c:1.169
--- src/bin/sh/parser.c:1.168	Sat May  4 02:52:22 2019
+++ src/bin/sh/parser.c	Tue Dec 10 09:18:37 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: parser.c,v 1.168 2019/05/04 02:52:22 kre Exp $	*/
+/*	$NetBSD: parser.c,v 1.169 2019/12/10 09:18:37 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)parser.c	8.7 (Berkeley) 5/16/95";
 #else
-__RCSID("$NetBSD: parser.c,v 1.168 2019/05/04 02:52:22 kre Exp $");
+__RCSID("$NetBSD: parser.c,v 1.169 2019/12/10 09:18:37 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -1749,7 +1749,7 @@ readcstyleesc(char *out)
  *
  * The current definition of ISCTL() allows the compiler to
  * optimise away either half, or all, of the test in most of
- * the cases here (0xc0 | anything) cannot be between 08x0 and 0x9f
+ * the cases here (0xc0 | anything) cannot be between 0x80 and 0x9f
  * for example, so there a test is not needed).
  *
  * Which tests can be removed depends upon the actual values