CVS commit: src/sys/arch/x86

2019-06-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jun 17 06:38:30 UTC 2019

Modified Files:
src/sys/arch/x86/pci: msipic.c pci_intr_machdep.c pcib.c
src/sys/arch/x86/x86: idt.c intr.c ioapic.c

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/x86/pci/msipic.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/x86/pci/pci_intr_machdep.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/x86/pci/pcib.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/x86/x86/idt.c
cvs rdiff -u -r1.145 -r1.146 src/sys/arch/x86/x86/intr.c
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/x86/x86/ioapic.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/x86

2019-06-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jun 17 06:38:30 UTC 2019

Modified Files:
src/sys/arch/x86/pci: msipic.c pci_intr_machdep.c pcib.c
src/sys/arch/x86/x86: idt.c intr.c ioapic.c

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/x86/pci/msipic.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/x86/pci/pci_intr_machdep.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/x86/pci/pcib.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/x86/x86/idt.c
cvs rdiff -u -r1.145 -r1.146 src/sys/arch/x86/x86/intr.c
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/x86/x86/ioapic.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/x86/pci/msipic.c
diff -u src/sys/arch/x86/pci/msipic.c:1.14 src/sys/arch/x86/pci/msipic.c:1.15
--- src/sys/arch/x86/pci/msipic.c:1.14	Mon Jun 17 05:45:46 2019
+++ src/sys/arch/x86/pci/msipic.c	Mon Jun 17 06:38:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msipic.c,v 1.14 2019/06/17 05:45:46 msaitoh Exp $	*/
+/*	$NetBSD: msipic.c,v 1.15 2019/06/17 06:38:29 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2015 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: msipic.c,v 1.14 2019/06/17 05:45:46 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msipic.c,v 1.15 2019/06/17 06:38:29 msaitoh Exp $");
 
 #include "opt_intrdebug.h"
 
@@ -203,7 +203,7 @@ msipic_find_msi_pic_locked(int devid)
 	KASSERT(mutex_owned(&msipic_list_lock));
 
 	LIST_FOREACH(mpp, &msipic_list, mp_list) {
-		if(mpp->mp_devid == devid)
+		if (mpp->mp_devid == devid)
 			return mpp->mp_pic;
 	}
 	return NULL;
@@ -645,7 +645,7 @@ msipic_construct_msix_pic(const struct p
 	tbl = pci_conf_read(pc, tag, off + PCI_MSIX_TBLOFFSET);
 	table_offset = tbl & PCI_MSIX_TBLOFFSET_MASK;
 	bir = tbl & PCI_MSIX_PBABIR_MASK;
-	switch(bir) {
+	switch (bir) {
 	case 0:
 		bar = PCI_BAR0;
 		break;
@@ -665,18 +665,19 @@ msipic_construct_msix_pic(const struct p
 		bar = PCI_BAR5;
 		break;
 	default:
-		aprint_error("detect an illegal device! The device use reserved BIR values.\n");
+		aprint_error("detect an illegal device! "
+		"The device use reserved BIR values.\n");
 		msipic_destruct_common_msi_pic(msix_pic);
 		return NULL;
 	}
 	memtype = pci_mapreg_type(pc, tag, bar);
-	 /*
-	  * PCI_MSIX_TABLE_ENTRY_SIZE consists below
-	  * - Vector Control (32bit)
-	  * - Message Data (32bit)
-	  * - Message Upper Address (32bit)
-	  * - Message Lower Address (32bit)
-	  */
+	/*
+	 * PCI_MSIX_TABLE_ENTRY_SIZE consists below
+	 * - Vector Control (32bit)
+	 * - Message Data (32bit)
+	 * - Message Upper Address (32bit)
+	 * - Message Lower Address (32bit)
+	 */
 	table_size = table_nentry * PCI_MSIX_TABLE_ENTRY_SIZE;
 #if 0
 	err = pci_mapreg_submap(pa, bar, memtype, BUS_SPACE_MAP_LINEAR,

Index: src/sys/arch/x86/pci/pci_intr_machdep.c
diff -u src/sys/arch/x86/pci/pci_intr_machdep.c:1.49 src/sys/arch/x86/pci/pci_intr_machdep.c:1.50
--- src/sys/arch/x86/pci/pci_intr_machdep.c:1.49	Mon Feb 11 14:59:33 2019
+++ src/sys/arch/x86/pci/pci_intr_machdep.c	Mon Jun 17 06:38:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_intr_machdep.c,v 1.49 2019/02/11 14:59:33 cherry Exp $	*/
+/*	$NetBSD: pci_intr_machdep.c,v 1.50 2019/06/17 06:38:29 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2009 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_intr_machdep.c,v 1.49 2019/02/11 14:59:33 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_intr_machdep.c,v 1.50 2019/06/17 06:38:29 msaitoh Exp $");
 
 #include 
 #include 
@@ -234,7 +234,7 @@ pci_intr_string(pci_chipset_tag_t pc, pc
 		buf, len);
 	}
 
-#if defined(__HAVE_PCI_MSI_MSIX)	
+#if defined(__HAVE_PCI_MSI_MSIX)
 	if (INT_VIA_MSI(ih))
 		return x86_pci_msi_string(pc, ih, buf, len);
 #endif
@@ -266,9 +266,9 @@ pci_intr_setattr(pci_chipset_tag_t pc, p
 	switch (attr) {
 	case PCI_INTR_MPSAFE:
 		if (data) {
-			 *ih |= MPSAFE_MASK;
+			*ih |= MPSAFE_MASK;
 		} else {
-			 *ih &= ~MPSAFE_MASK;
+			*ih &= ~MPSAFE_MASK;
 		}
 		/* XXX Set live if already mapped. */
 		return 0;
@@ -524,7 +524,7 @@ pci_intr_alloc(const struct pci_attach_a
 		msi_count = 1;
 		intx_count = 1;
 	} else {
-		switch(max_type) {
+		switch (max_type) {
 		case PCI_INTR_TYPE_MSIX:
 			msix_count = counts[PCI_INTR_TYPE_MSIX];
 			/* FALLTHROUGH */

Index: src/sys/arch/x86/pci/pcib.c
diff -u src/sys/arch/x86/pci/pcib.c:1.17 src/sys/arch/x86/pci/pcib.c:1.18
--- src/sys/arch/x86/pci/pcib.c:1.17	Mon Feb 11 14:59:33 2019
+++ src/sys/arch/x86/pci/pcib.c	Mon Jun 17 06:38:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcib.c,v 1.17 2019/02/11 14:59:33 cherry Exp $	*/
+/*	$NetBSD: pcib.c,v 1.18 2019/06/17 06:38:29 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.17 2019/02/11 14:59:33 cher

CVS commit: src/external/gpl3/gdb/dist/gdb

2019-06-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jun 17 06:33:53 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: ppc-nbsd-nat.c sh-nbsd-tdep.c

Log Message:
fix cross gdb build on sh and ppc:
- gdb_assert.h has moved into common/gdb_assert.h.
- force promotion to avoid compile errors

XXX why aren't these files built into the native binary, and
triggered normal build failures.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.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/gdb/dist/gdb

2019-06-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jun 17 06:33:53 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: ppc-nbsd-nat.c sh-nbsd-tdep.c

Log Message:
fix cross gdb build on sh and ppc:
- gdb_assert.h has moved into common/gdb_assert.h.
- force promotion to avoid compile errors

XXX why aren't these files built into the native binary, and
triggered normal build failures.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.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/gdb/dist/gdb/ppc-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c:1.8 src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c:1.9
--- src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c:1.8	Thu May 30 21:27:58 2019
+++ src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c	Mon Jun 17 06:33:53 2019
@@ -32,7 +32,7 @@
 #include "inferior.h"
 #include "regcache.h"
 
-#include "gdb_assert.h"
+#include "common/gdb_assert.h"
 
 #include "nbsd-nat.h"
 #include "ppc-tdep.h"

Index: src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c:1.5 src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c:1.6
--- src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c:1.5	Thu May 30 19:34:27 2019
+++ src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.c	Mon Jun 17 06:33:53 2019
@@ -32,7 +32,7 @@
 #include "trad-frame.h"
 #include "tramp-frame.h"
 
-#include "gdb_assert.h"
+#include "common/gdb_assert.h"
 
 #include "solib-svr4.h"
 
@@ -143,25 +143,25 @@ static const struct tramp_frame shnbsd_s
   SIGTRAMP_FRAME,
   2,
   {
-{ 0x64f3, -1 },			/* mov r15,r4 */
-{ 0xd002, -1 },			/* mov.l   .LSYS_setcontext */
-{ 0xc380, -1 },			/* trapa   #-128 */
-{ 0xa003, -1 },			/* bra .Lskip1 */
-{ 0x0009, -1 },			/* nop */
-{ 0x0009, -1 },			/* nop */
+{ 0x64f3, (ULONGEST)-1 },			/* mov r15,r4 */
+{ 0xd002, (ULONGEST)-1 },			/* mov.l   .LSYS_setcontext */
+{ 0xc380, (ULONGEST)-1 },			/* trapa   #-128 */
+{ 0xa003, (ULONGEST)-1 },			/* bra .Lskip1 */
+{ 0x0009, (ULONGEST)-1 },			/* nop */
+{ 0x0009, (ULONGEST)-1 },			/* nop */
  /* .LSYS_setcontext */
-{ 0x0134, -1 }, { 0x, -1 }, /* 0x134 */
+{ 0x0134, (ULONGEST)-1 }, { 0x, (ULONGEST)-1 }, /* 0x134 */
  /* .Lskip1 */
-{ 0x6403, -1 },			/* mov r0,r4 */
-{ 0xd002, -1 },			/* mov.l   .LSYS_exit  */
-{ 0xc380, -1 },			/* trapa   #-128 */
-{ 0xa003, -1 },			/* bra .Lskip2 */
-{ 0x0009, -1 },			/* nop */
-{ 0x0009, -1 },			/* nop */
+{ 0x6403, (ULONGEST)-1 },			/* mov r0,r4 */
+{ 0xd002, (ULONGEST)-1 },			/* mov.l   .LSYS_exit  */
+{ 0xc380, (ULONGEST)-1 },			/* trapa   #-128 */
+{ 0xa003, (ULONGEST)-1 },			/* bra .Lskip2 */
+{ 0x0009, (ULONGEST)-1 },			/* nop */
+{ 0x0009, (ULONGEST)-1 },			/* nop */
  /* .LSYS_exit */
-{ 0x0001, -1 }, { 0x, -1 }, /* 0x1 */
+{ 0x0001, (ULONGEST)-1 }, { 0x, (ULONGEST)-1 }, /* 0x1 */
 /* .Lskip2 */
-{ TRAMP_SENTINEL_INSN, -1 }
+{ TRAMP_SENTINEL_INSN, (ULONGEST)-1 }
   },
   shnbsd_sigtramp_cache_init
 };



CVS commit: src/sys/arch/x86/pci

2019-06-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jun 17 05:45:47 UTC 2019

Modified Files:
src/sys/arch/x86/pci: msipic.c

Log Message:
 Fix comma with semicolon. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/x86/pci/msipic.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/x86/pci/msipic.c
diff -u src/sys/arch/x86/pci/msipic.c:1.13 src/sys/arch/x86/pci/msipic.c:1.14
--- src/sys/arch/x86/pci/msipic.c:1.13	Fri Jun 14 05:59:40 2019
+++ src/sys/arch/x86/pci/msipic.c	Mon Jun 17 05:45:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msipic.c,v 1.13 2019/06/14 05:59:40 msaitoh Exp $	*/
+/*	$NetBSD: msipic.c,v 1.14 2019/06/17 05:45:46 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2015 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: msipic.c,v 1.13 2019/06/14 05:59:40 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msipic.c,v 1.14 2019/06/17 05:45:46 msaitoh Exp $");
 
 #include "opt_intrdebug.h"
 
@@ -250,7 +250,8 @@ msipic_construct_common_msi_pic(const st
 	}
 
 	memcpy(pic, pic_tmpl, sizeof(*pic));
-	pic->pic_edge_stubs = x2apic_mode ? x2apic_edge_stubs : ioapic_edge_stubs,
+	pic->pic_edge_stubs
+	= x2apic_mode ? x2apic_edge_stubs : ioapic_edge_stubs;
 	pic->pic_msipic = msipic;
 	msipic->mp_pic = pic;
 	pci_decompose_tag(pa->pa_pc, pa->pa_tag,



CVS commit: src/sys/arch/x86/pci

2019-06-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jun 17 05:45:47 UTC 2019

Modified Files:
src/sys/arch/x86/pci: msipic.c

Log Message:
 Fix comma with semicolon. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/x86/pci/msipic.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-06-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jun 17 05:27:01 UTC 2019

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

Log Message:
avoid allocations in the reboot (maybe crash) path and map the
reset registers in new *platform_bootstrap() functions that
merely move the bus_space_map() here, and then call the
original sunxi_platform_bootstrap().

tested on cubietruck and cubietruck plus.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/arm/sunxi/sunxi_platform.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/sunxi_platform.c
diff -u src/sys/arch/arm/sunxi/sunxi_platform.c:1.36 src/sys/arch/arm/sunxi/sunxi_platform.c:1.37
--- src/sys/arch/arm/sunxi/sunxi_platform.c:1.36	Tue Apr 30 10:10:45 2019
+++ src/sys/arch/arm/sunxi/sunxi_platform.c	Mon Jun 17 05:27:01 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_platform.c,v 1.36 2019/04/30 10:10:45 mrg Exp $ */
+/* $NetBSD: sunxi_platform.c,v 1.37 2019/06/17 05:27:01 mrg Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -31,7 +31,7 @@
 #include "opt_console.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_platform.c,v 1.36 2019/04/30 10:10:45 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_platform.c,v 1.37 2019/06/17 05:27:01 mrg Exp $");
 
 #include 
 #include 
@@ -114,6 +114,8 @@ extern struct bus_space arm_generic_a4x_
 #define	sunxi_bs_tag		arm_generic_bs_tag
 #define	sunxi_a4x_bs_tag	arm_generic_a4x_bs_tag
 
+static bus_space_handle_t reset_bsh;
+
 static const struct pmap_devmap *
 sunxi_platform_devmap(void)
 {
@@ -268,6 +270,42 @@ sunxi_platform_bootstrap(void)
 	}
 }
 
+static void
+sun4i_platform_bootstrap(void)
+{
+	bus_space_tag_t bst = &sunxi_bs_tag;
+
+	sunxi_platform_bootstrap();
+	bus_space_map(bst, SUN4I_WDT_BASE, SUN4I_WDT_SIZE, 0, &reset_bsh);
+}
+
+static void
+sun6i_platform_bootstrap(void)
+{
+	bus_space_tag_t bst = &sunxi_bs_tag;
+
+	sunxi_platform_bootstrap();
+	bus_space_map(bst, SUN6I_WDT_BASE, SUN6I_WDT_SIZE, 0, &reset_bsh);
+}
+
+static void
+sun9i_platform_bootstrap(void)
+{
+	bus_space_tag_t bst = &sunxi_bs_tag;
+
+	sunxi_platform_bootstrap();
+	bus_space_map(bst, SUN9I_WDT_BASE, SUN9I_WDT_SIZE, 0, &reset_bsh);
+}
+
+static void
+sun50i_h6_platform_bootstrap(void)
+{
+	bus_space_tag_t bst = &sunxi_bs_tag;
+
+	sunxi_platform_bootstrap();
+	bus_space_map(bst, SUN50I_H6_WDT_BASE, SUN50I_H6_WDT_SIZE, 0, &reset_bsh);
+}
+
 #if defined(SOC_SUNXI_MC)
 static int
 cpu_enable_sun8i_a83t(int phandle)
@@ -296,14 +334,11 @@ static void
 sun4i_platform_reset(void)
 {
 	bus_space_tag_t bst = &sunxi_bs_tag;
-	bus_space_handle_t bsh;
-
-	bus_space_map(bst, SUN4I_WDT_BASE, SUN4I_WDT_SIZE, 0, &bsh);
 
-	bus_space_write_4(bst, bsh, SUN4I_WDT_CTRL,
+	bus_space_write_4(bst, reset_bsh, SUN4I_WDT_CTRL,
 	SUN4I_WDT_CTRL_KEY | SUN4I_WDT_CTRL_RESTART);
 	for (;;) {
-		bus_space_write_4(bst, bsh, SUN4I_WDT_MODE,
+		bus_space_write_4(bst, reset_bsh, SUN4I_WDT_MODE,
 		SUN4I_WDT_MODE_EN | SUN4I_WDT_MODE_RST_EN);
 	}
 }
@@ -344,41 +379,32 @@ static void
 sun6i_platform_reset(void)
 {
 	bus_space_tag_t bst = &sunxi_bs_tag;
-	bus_space_handle_t bsh;
 
-	bus_space_map(bst, SUN6I_WDT_BASE, SUN6I_WDT_SIZE, 0, &bsh);
-
-	bus_space_write_4(bst, bsh, SUN6I_WDT_CFG, SUN6I_WDT_CFG_SYS);
-	bus_space_write_4(bst, bsh, SUN6I_WDT_MODE, SUN6I_WDT_MODE_EN);
+	bus_space_write_4(bst, reset_bsh, SUN6I_WDT_CFG, SUN6I_WDT_CFG_SYS);
+	bus_space_write_4(bst, reset_bsh, SUN6I_WDT_MODE, SUN6I_WDT_MODE_EN);
 }
 
 static void
 sun9i_platform_reset(void)
 {
 	bus_space_tag_t bst = &sunxi_bs_tag;
-	bus_space_handle_t bsh;
-
-	bus_space_map(bst, SUN9I_WDT_BASE, SUN9I_WDT_SIZE, 0, &bsh);
 
-	bus_space_write_4(bst, bsh, SUN9I_WDT_CFG, SUN9I_WDT_CFG_SYS);
-	bus_space_write_4(bst, bsh, SUN9I_WDT_MODE, SUN9I_WDT_MODE_EN);
+	bus_space_write_4(bst, reset_bsh, SUN9I_WDT_CFG, SUN9I_WDT_CFG_SYS);
+	bus_space_write_4(bst, reset_bsh, SUN9I_WDT_MODE, SUN9I_WDT_MODE_EN);
 }
 
 static void
 sun50i_h6_platform_reset(void)
 {
 	bus_space_tag_t bst = &sunxi_bs_tag;
-	bus_space_handle_t bsh;
-
-	bus_space_map(bst, SUN50I_H6_WDT_BASE, SUN50I_H6_WDT_SIZE, 0, &bsh);
 
-	bus_space_write_4(bst, bsh, SUN50I_H6_WDT_CFG, SUN50I_H6_WDT_CFG_SYS);
-	bus_space_write_4(bst, bsh, SUN50I_H6_WDT_MODE, SUN50I_H6_WDT_MODE_EN);
+	bus_space_write_4(bst, reset_bsh, SUN50I_H6_WDT_CFG, SUN50I_H6_WDT_CFG_SYS);
+	bus_space_write_4(bst, reset_bsh, SUN50I_H6_WDT_MODE, SUN50I_H6_WDT_MODE_EN);
 }
 
 static const struct arm_platform sun4i_platform = {
 	.ap_devmap = sunxi_platform_devmap,
-	.ap_bootstrap = sunxi_platform_bootstrap,
+	.ap_bootstrap = sun4i_platform_bootstrap,
 	.ap_init_attach_args = sunxi_platform_init_attach_args,
 	.ap_device_register = sunxi_platform_device_register,
 	.ap_reset = sun4i_platform_reset,
@@ -390,7 +416,7 @@ ARM_PLATFORM(sun4i_a10, "allwinner,sun4i
 
 static const struct arm_platform sun5i_platform = {
 	.ap_devmap = sunxi_plat

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

2019-06-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jun 17 05:27:01 UTC 2019

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

Log Message:
avoid allocations in the reboot (maybe crash) path and map the
reset registers in new *platform_bootstrap() functions that
merely move the bus_space_map() here, and then call the
original sunxi_platform_bootstrap().

tested on cubietruck and cubietruck plus.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/arm/sunxi/sunxi_platform.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/ufs

2019-06-16 Thread Christos Zoulas
I did not rearrange where things live (or I don't understand what you mean by 
that).
I just uncommented the no filesystem FFS from MODULAR, and tried to compile.
Does it compile for you without my changes?

christos

> On Jun 16, 2019, at 8:10 PM, Paul Goyette  wrote:
> 
>  



CVS commit: src/sys/conf

2019-06-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 17 03:34:02 UTC 2019

Modified Files:
src/sys/conf: filesystems.config

Log Message:
Add more missing fs's


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/conf/filesystems.config

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



CVS commit: src/sys/conf

2019-06-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 17 03:34:02 UTC 2019

Modified Files:
src/sys/conf: filesystems.config

Log Message:
Add more missing fs's


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/conf/filesystems.config

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

Modified files:

Index: src/sys/conf/filesystems.config
diff -u src/sys/conf/filesystems.config:1.11 src/sys/conf/filesystems.config:1.12
--- src/sys/conf/filesystems.config:1.11	Tue May 21 12:56:10 2019
+++ src/sys/conf/filesystems.config	Sun Jun 16 23:34:01 2019
@@ -1,9 +1,10 @@
-# $NetBSD: filesystems.config,v 1.11 2019/05/21 16:56:10 sevan Exp $
+# $NetBSD: filesystems.config,v 1.12 2019/06/17 03:34:01 christos Exp $
 #file-system	ADOSFS		# AmigaDOS-compatible file system
 #options 	APPLE_UFS	# Apple UFS support in FFS
 #file-system	AUTOFS		# Automounter Filesystem
 #pseudo-device	autofs		# experimental - AUTOFS
 file-system	CD9660		# ISO 9660 + Rock Ridge file system
+file-system	CHFS		# Chip File System
 file-system	CODA		# Coda File System; also needs vcoda (below)
 pseudo-device	vcoda		# coda minicache <-> venus comm.
 file-system	EFS		# Silicon Graphics Extent File System
@@ -27,8 +28,10 @@ file-system	PUFFS		# Userspace file syst
 pseudo-device	putter		# for puffs and pud
 file-system	SMBFS		# experimental - CIFS; also needs nsmb (below)
 pseudo-device	nsmb		# experimental - SMB requester
+#file-system	SYSVBFS		# sysvfs
 file-system	TMPFS		# Efficient memory file-system
 #file-system	UDF		# experimental - OSTA UDF CD/DVD file-system
 file-system	UMAPFS		# NULLFS + uid and gid remapping
 file-system	UNION		# union file system
 #file-system	V7FS		# 7th Edition(V7) File System
+#file-system	ZFS		# Solaris ZFS



CVS commit: src/sys/ufs

2019-06-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 17 03:32:58 UTC 2019

Modified Files:
src/sys/ufs: files.ufs

Log Message:
Don't include any of the ufs code if all the dependent filesystems are missing.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/ufs/files.ufs

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



CVS commit: src/sys/ufs

2019-06-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 17 03:32:58 UTC 2019

Modified Files:
src/sys/ufs: files.ufs

Log Message:
Don't include any of the ufs code if all the dependent filesystems are missing.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/ufs/files.ufs

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

Modified files:

Index: src/sys/ufs/files.ufs
diff -u src/sys/ufs/files.ufs:1.44 src/sys/ufs/files.ufs:1.45
--- src/sys/ufs/files.ufs:1.44	Sun Jun 16 18:43:33 2019
+++ src/sys/ufs/files.ufs	Sun Jun 16 23:32:58 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.ufs,v 1.44 2019/06/16 22:43:33 christos Exp $
+#	$NetBSD: files.ufs,v 1.45 2019/06/17 03:32:58 christos Exp $
 
 deffs	FFS
 deffs	EXT2FS
@@ -98,17 +98,17 @@ file	ufs/mfs/mfs_vnops.c		mfs
 file	ufs/mfs/mfs_miniroot.c
 
 define	ufs: vfs
-file	ufs/ufs/ufs_bmap.c		ufs
+file	ufs/ufs/ufs_bmap.c		ufs & (ffs | mfs | ext2fs | chfs)
 file	ufs/ufs/ufs_dirhash.c		(ffs | mfs | ext2fs | chfs) & ufs_dirhash
-file	ufs/ufs/ufs_extattr.c		ufs_extattr
-file	ufs/ufs/ufs_inode.c		ufs
-file	ufs/ufs/ufs_lookup.c		ufs
-file	ufs/ufs/ufs_quota.c		quota | quota2
-file	ufs/ufs/ufs_quota1.c		quota
-file	ufs/ufs/ufs_quota2.c		quota2
-file	ufs/ufs/quota1_subr.c
-file	ufs/ufs/quota2_subr.c		quota2
+file	ufs/ufs/ufs_extattr.c		(ffs | mfs) & ufs_extattr
+file	ufs/ufs/ufs_inode.c		ffs | mfs | ext2fs
+file	ufs/ufs/ufs_lookup.c		ufs & (ffs | mfs | ext2fs | chfs)
+file	ufs/ufs/ufs_quota.c		(quota | quota2) & (ffs | mfs | ext2fs | chfs)
+file	ufs/ufs/ufs_quota1.c		quota & (ffs | mfs | ext2fs | chfs)
+file	ufs/ufs/ufs_quota2.c		quota2 & (ffs | mfs | ext2fs | chfs)
+file	ufs/ufs/quota1_subr.c		quota & (ffs | mfs | ext2fs | chfs)
+file	ufs/ufs/quota2_subr.c		quota2 & (ffs | mfs | ext2fs | chfs)
 file	ufs/ufs/ufs_rename.c		ffs | mfs | chfs
-file	ufs/ufs/ufs_vfsops.c		ufs
-file	ufs/ufs/ufs_vnops.c		ufs
+file	ufs/ufs/ufs_vfsops.c		ufs & (ffs | mfs | ext2fs | chfs)
+file	ufs/ufs/ufs_vnops.c		ufs & (ffs | mfs | ext2fs | chfs)
 file	ufs/ufs/ufs_wapbl.c		ffs & wapbl



CVS commit: src/sys/modules/ffs

2019-06-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 17 03:32:14 UTC 2019

Modified Files:
src/sys/modules/ffs: Makefile

Log Message:
Add missing file for QUOTA


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/modules/ffs/Makefile

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

Modified files:

Index: src/sys/modules/ffs/Makefile
diff -u src/sys/modules/ffs/Makefile:1.10 src/sys/modules/ffs/Makefile:1.11
--- src/sys/modules/ffs/Makefile:1.10	Sat Feb 16 23:05:49 2019
+++ src/sys/modules/ffs/Makefile	Sun Jun 16 23:32:14 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.10 2019/02/17 04:05:49 rin Exp $
+#	$NetBSD: Makefile,v 1.11 2019/06/17 03:32:14 christos Exp $
 
 .include "../Makefile.inc"
 
@@ -12,7 +12,7 @@ CWARNFLAGS.clang=	-Wno-conversion
 .PATH:	${S}/ufs/ufs
 SRCS=	ufs_bmap.c ufs_dirhash.c ufs_extattr.c ufs_inode.c \
 	ufs_lookup.c ufs_quota.c ufs_quota1.c ufs_quota2.c ufs_rename.c \
-	ufs_vfsops.c ufs_vnops.c ufs_wapbl.c quota2_subr.c
+	ufs_vfsops.c ufs_vnops.c ufs_wapbl.c quota1_subr.c quota2_subr.c
 
 .PATH:	${S}/ufs/ffs
 SRCS+=	ffs_alloc.c ffs_balloc.c ffs_inode.c ffs_subr.c ffs_tables.c \



CVS commit: src/sys/modules/ffs

2019-06-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 17 03:32:14 UTC 2019

Modified Files:
src/sys/modules/ffs: Makefile

Log Message:
Add missing file for QUOTA


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/modules/ffs/Makefile

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



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

2019-06-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 17 03:31:58 UTC 2019

Modified Files:
src/sys/arch/amd64/conf: MODULAR

Log Message:
complete the list of filesystems and enable ffs as a module.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/amd64/conf/MODULAR

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/MODULAR
diff -u src/sys/arch/amd64/conf/MODULAR:1.11 src/sys/arch/amd64/conf/MODULAR:1.12
--- src/sys/arch/amd64/conf/MODULAR:1.11	Sat Jan 13 07:38:16 2018
+++ src/sys/arch/amd64/conf/MODULAR	Sun Jun 16 23:31:57 2019
@@ -1,4 +1,4 @@
-# $NetBSD: MODULAR,v 1.11 2018/01/13 12:38:16 christos Exp $
+# $NetBSD: MODULAR,v 1.12 2019/06/17 03:31:57 christos Exp $
 #
 # Try to exclude all the drivers in GENERIC that have been modularized
 # XXX: incomplete
@@ -38,28 +38,49 @@ options 	MODULAR_DEFAULT_AUTOLOAD
 -no options	SYSVSEM		# System V-like semaphores
 -no options	SYSVSHM		# System V-like memory sharing
 
-# XXX: for now
-#no file-system FFS		# UFS
--no file-system MFS		# memory file system
--no file-system NFS		# Network File System client
--no file-system TMPFS		# Efficient memory file-system
--no file-system EXT2FS		# second extended file system (linux)
--no file-system LFS		# log-structured file system
--no file-system NTFS		# Windows/NT file system (experimental)
+-no options 	ACPIVERBOSE	# verbose ACPI configuration messages
+-no options 	MIIVERBOSE	# verbose PHY autoconfig messages
+-no options 	PCIVERBOSE	# verbose PCI device autoconfig messages
+-no options 	PCMCIAVERBOSE	# verbose PCMCIA configuration messages
+-no options 	SCSIVERBOSE	# human readable SCSI error messages
+-no options 	USBVERBOSE	# verbose USB device autoconfig messages
+-no options 	HDAUDIOVERBOSE	# verbose HDAUDIO driver messages
+
+-no file-system ADOSFS		# AmigaDOS-compatible file system
+-no file-system AUTOFS		# Automounter Filesystem
 -no file-system CD9660		# ISO 9660 + Rock Ridge file system
--no file-system MSDOSFS 	# MS-DOS file system
+-no file-system CHFS		# Chip File System
+-no file-system CODA		# Coda File System; also needs vcoda (below)
+-no file-system EFS		# Silicon Graphics Extent File System
+-no file-system EXT2FS		# second extended file system (linux)
 -no file-system FDESC		# /dev/fd
+-no file-system FFS		# UFS
+-no options UFS
+-no options 	QUOTA		# legacy UFS quotas
+-no options 	QUOTA2		# new, in-filesystem UFS quotas
+-no options 	UFS_EXTATTR	# Extended attribute support for UFS1
+-no file-system FILECORE	# Acorn filecore file system
+-no file-system HFS		# experimental - Apple HFS+ (read-only)
 -no file-system KERNFS		# /kern
+-no file-system LAYERFS		# genfs
+-no file-system LFS		# log-structured file system
+-no file-system MFS		# memory file system
+-no file-system MSDOSFS		# MS-DOS file system
+-no file-system NFS		# Network File System client
+-no file-system NILFS		# experimental - NTT's NiLFS(2)
+-no file-system NTFS		# Windows/NT file system (experimental)
 -no file-system NULLFS		# loopback file system
--no file-system OVERLAY 	# overlay file system
+-no file-system OVERLAY		# overlay file system
 -no file-system PROCFS		# /proc
+-no file-system PTYFS		# /dev/ptm support
 -no file-system PUFFS		# Userspace file systems (e.g. ntfs-3g & sshfs)
 -no file-system SMBFS		# experimental - CIFS; also needs nsmb (below)
+-no file-system TMPFS		# Efficient memory file-system
+-no file-system UDF		# experimental - OSTA UDF CD/DVD file-system
 -no file-system UMAPFS		# NULLFS + uid and gid remapping
 -no file-system UNION		# union file system
--no file-system CODA		# Coda File System; also needs vcoda (below)
--no file-system PTYFS		# /dev/ptm support
--no file-system AUTOFS		# Automounter Filesystem
+-no file-system V7FS		# 7th Edition(V7) File System
+-no file-system ZFS		# Solaris ZFS
 
 -no options 	PPP_BSDCOMP	# BSD-Compress compression support for PPP
 -no options 	PPP_DEFLATE	# Deflate compression support for PPP



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

2019-06-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 17 03:31:58 UTC 2019

Modified Files:
src/sys/arch/amd64/conf: MODULAR

Log Message:
complete the list of filesystems and enable ffs as a module.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/amd64/conf/MODULAR

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



Re: CVS commit: src/sys/ufs

2019-06-16 Thread Christos Zoulas
No, there is still an issue. The change adds those files in the kernel when
there are no filesystems present. Otherwise I just built a MODULAR kernel
with FFS disabled and I get:

Don't you get the same? Or don't you have quotas or extended attributes on
in your kernel?

christos

ld: ufs_vfsops.o: in function `ufs_quotactl':
/usr/src/sys/arch/amd64/compile/MODULAR/../../../../ufs/ufs/ufs_vfsops.c:140: un
defined reference to `quota_handle_cmd'
ld: ufs_vfsops.o: in function `ufs_init':
/usr/src/sys/arch/amd64/compile/MODULAR/../../../../ufs/ufs/ufs_vfsops.c:270: 
undefined reference to `dqinit'
ld: ufs_vfsops.o: in function `ufs_done':
/usr/src/sys/arch/amd64/compile/MODULAR/../../../../ufs/ufs/ufs_vfsops.c:298: 
undefined reference to `dqdone'
ld: ufs_vfsops.o: in function `ufs_init':
/usr/src/sys/arch/amd64/compile/MODULAR/../../../../ufs/ufs/ufs_vfsops.c:276: 
undefined reference to `ufs_extattr_init'
ld: ufs_vfsops.o: in function `ufs_reinit':
/usr/src/sys/arch/amd64/compile/MODULAR/../../../../ufs/ufs/ufs_vfsops.c:284: 
undefined reference to `dqreinit'
ld: ufs_vfsops.o: in function `ufs_done':
/usr/src/sys/arch/amd64/compile/MODULAR/../../../../ufs/ufs/ufs_vfsops.c:305: 
undefined reference to `ufs_extattr_done'
ld: ufs_vnops.o: in function `ufs_check_possible':
/usr/src/sys/arch/amd64/compile/MODULAR/../../../../ufs/ufs/ufs_vnops.c:279: 
undefined reference to `chkdq'
ld: ufs_vnops.o: in function `ufs_chown':
/usr/src/sys/arch/amd64/compile/MODULAR/../../../../ufs/ufs/ufs_vnops.c:686: 
undefined reference to `chkdq'
ld: 
/usr/src/sys/arch/amd64/compile/MODULAR/../../../../ufs/ufs/ufs_vnops.c:687: 
undefined reference to `chkiq'
ld: 
/usr/src/sys/arch/amd64/compile/MODULAR/../../../../ufs/ufs/ufs_vnops.c:694: 
undefined reference to `chkdq'
ld: 
/usr/src/sys/arch/amd64/compile/MODULAR/../../../../ufs/ufs/ufs_vnops.c:704: 
undefined reference to `chkdq'
ld: 
/usr/src/sys/arch/amd64/compile/MODULAR/../../../../ufs/ufs/ufs_vnops.c:705: 
undefined reference to `chkiq'
ld: ufs_vnops.o: in function `ufs_setattr':
/usr/src/sys/arch/amd64/compile/MODULAR/../../../../ufs/ufs/ufs_vnops.c:559: 
undefined reference to `ufs_truncate_retry'
ld: ufs_vnops.o: in function `ufs_chown':
/usr/src/sys/arch/amd64/compile/MODULAR/../../../../ufs/ufs/ufs_vnops.c:695: 
undefined reference to `chkiq'
ld: 
/usr/src/sys/arch/amd64/compile/MODULAR/../../../../ufs/ufs/ufs_vnops.c:698: 
undefined reference to `chkdq'
*** [netbsd] Error code 1


> On Jun 16, 2019, at 10:00 PM, Paul Goyette  wrote:
> 
> On Sun, 16 Jun 2019, Paul Goyette wrote:
> 
>> If I'm understanding your changes correctly, a kernel will have a copy
>> of ufs_quota.c built-in, whether or not the ffs code is built-in.  So
>> if you have a kernel with no ffs, that kernel will still have the quota
>> code, and loading the ffs module will result in duplicate symbols.  The
>> error will occur at module load/link time, not at kernel build/link.
> 
> OK, obviously I did not understand the changes correctly!  I just did a
> re-build of my no-included-filesystem kernel and the files in question
> were not included, either.  So there won't be any dup symbols when the
> module is eventually loaded.
> 
> Sorry for the noise.
> 
> 
> 
> ++--+---+
> | 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   |
> ++--+---+



Re: CVS commit: src/sys/ufs

2019-06-16 Thread Paul Goyette

On Sun, 16 Jun 2019, Paul Goyette wrote:


If I'm understanding your changes correctly, a kernel will have a copy
of ufs_quota.c built-in, whether or not the ffs code is built-in.  So
if you have a kernel with no ffs, that kernel will still have the quota
code, and loading the ffs module will result in duplicate symbols.  The
error will occur at module load/link time, not at kernel build/link.


OK, obviously I did not understand the changes correctly!  I just did a
re-build of my no-included-filesystem kernel and the files in question
were not included, either.  So there won't be any dup symbols when the
module is eventually loaded.

Sorry for the noise.



++--+---+
| 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   |
++--+---+


Re: CVS commit: src/sys/ufs

2019-06-16 Thread Paul Goyette

On Sun, 16 Jun 2019, Christos Zoulas wrote:


I did not rearrange where things live (or I don't understand what you
mean by that).  I just uncommented the no filesystem FFS from MODULAR,
and tried to compile.


The various sys/modules/*/Makefiles also specifically include the same 
files in the modules.  For example, the ffs module has


SRCS=   ufs_bmap.c ufs_dirhash.c ufs_extattr.c ufs_inode.c \
ufs_lookup.c ufs_quota.c ufs_quota1.c ufs_quota2.c ufs_rename.c \
ufs_vfsops.c ufs_vnops.c ufs_wapbl.c quota2_subr.c

If I'm understanding your changes correctly, a kernel will have a copy
of ufs_quota.c built-in, whether or not the ffs code is built-in.  So
if you have a kernel with no ffs, that kernel will still have the quota
code, and loading the ffs module will result in duplicate symbols.  The
error will occur at module load/link time, not at kernel build/link.



Does it compile for you without my changes?


Yes, it compiled and linked successfully for me, for both of

it == GENERIC kernel with all standard filesystems
  and   it == kernel with no filesystems of any sort included


++--+---+
| 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/sys/arch/arm/cortex

2019-06-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Jun 17 00:49:55 UTC 2019

Modified Files:
src/sys/arch/arm/cortex: gic_v2m.c

Log Message:
- Disable MSI/MSI-X when making changes
- MSI: Write the vector count to the Multi Message Enable (MME) field
- MSI: Set DATA to the first LPI number, not the last


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/cortex/gic_v2m.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/cortex/gic_v2m.c
diff -u src/sys/arch/arm/cortex/gic_v2m.c:1.5 src/sys/arch/arm/cortex/gic_v2m.c:1.6
--- src/sys/arch/arm/cortex/gic_v2m.c:1.5	Fri Dec  7 17:56:41 2018
+++ src/sys/arch/arm/cortex/gic_v2m.c	Mon Jun 17 00:49:55 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: gic_v2m.c,v 1.5 2018/12/07 17:56:41 jakllsch Exp $ */
+/* $NetBSD: gic_v2m.c,v 1.6 2019/06/17 00:49:55 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,10 +32,11 @@
 #define _INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gic_v2m.c,v 1.5 2018/12/07 17:56:41 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gic_v2m.c,v 1.6 2019/06/17 00:49:55 jmcneill Exp $");
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -90,7 +91,7 @@ gic_v2m_msi_available_spi(struct gic_v2m
 }
 
 static void
-gic_v2m_msi_enable(struct gic_v2m_frame *frame, int spi)
+gic_v2m_msi_enable(struct gic_v2m_frame *frame, int spi, int count)
 {
 	const struct pci_attach_args *pa = frame->frame_pa[spi];
 	pci_chipset_tag_t pc = pa->pa_pc;
@@ -101,6 +102,15 @@ gic_v2m_msi_enable(struct gic_v2m_frame 
 	if (!pci_get_capability(pc, tag, PCI_CAP_MSI, &off, NULL))
 		panic("gic_v2m_msi_enable: device is not MSI-capable");
 
+	ctl = pci_conf_read(pc, tag, off + PCI_MSI_CTL);
+	ctl &= ~PCI_MSI_CTL_MSI_ENABLE;
+	pci_conf_write(pc, tag, off + PCI_MSI_CTL, ctl);
+
+	ctl = pci_conf_read(pc, tag, off + PCI_MSI_CTL);
+	ctl &= ~PCI_MSI_CTL_MME_MASK;
+	ctl |= __SHIFTIN(ilog2(count), PCI_MSI_CTL_MME_MASK);
+	pci_conf_write(pc, tag, off + PCI_MSI_CTL, ctl);
+
 	const uint64_t addr = frame->frame_reg + GIC_MSI_SETSPI;
 	ctl = pci_conf_read(pc, tag, off + PCI_MSI_CTL);
 	if (ctl & PCI_MSI_CTL_64BIT_ADDR) {
@@ -148,6 +158,10 @@ gic_v2m_msix_enable(struct gic_v2m_frame
 	if (!pci_get_capability(pc, tag, PCI_CAP_MSIX, &off, NULL))
 		panic("gic_v2m_msix_enable: device is not MSI-X-capable");
 
+	ctl = pci_conf_read(pc, tag, off + PCI_MSIX_CTL);
+	ctl &= ~PCI_MSIX_CTL_ENABLE;
+	pci_conf_write(pc, tag, off + PCI_MSIX_CTL, ctl);
+
 	const uint64_t addr = frame->frame_reg + GIC_MSI_SETSPI;
 	const uint64_t entry_base = PCI_MSIX_TABLE_ENTRY_SIZE * msix_vec;
 	bus_space_write_4(bst, bsh, entry_base + PCI_MSIX_TABLE_ENTRY_ADDR_LO, (uint32_t)addr);
@@ -210,10 +224,10 @@ gic_v2m_msi_alloc(struct arm_pci_msi *ms
 		__SHIFTIN(spi, ARM_PCI_INTR_IRQ) |
 		__SHIFTIN(n, ARM_PCI_INTR_MSI_VEC) |
 		__SHIFTIN(msi->msi_id, ARM_PCI_INTR_FRAME);
-
-		gic_v2m_msi_enable(frame, spi);
 	}
 
+	gic_v2m_msi_enable(frame, spi_base, *count);
+
 	return vectors;
 }
 



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

2019-06-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Jun 17 00:49:55 UTC 2019

Modified Files:
src/sys/arch/arm/cortex: gic_v2m.c

Log Message:
- Disable MSI/MSI-X when making changes
- MSI: Write the vector count to the Multi Message Enable (MME) field
- MSI: Set DATA to the first LPI number, not the last


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/cortex/gic_v2m.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/ufs

2019-06-16 Thread Paul Goyette

On Sun, 16 Jun 2019, Paul Goyette wrote:


Hmmm, I wonder why this is needed?

I have NO built-in filesystems in my custom kernel, and it has not had any 
linkage problems in many years.


# modstat | grep vfs
ffs  vfs  boot -0   - wapbl
kernfs   vfs  filesys  a0   - -
null vfs  filesys  a0   - layerfs
procfs   vfs  filesys  a0   - ptrace_common
ptyfsvfs  filesys  a0   - -
tmpfsvfs  filesys  a0   - -
wapblvfs  boot -1   - -
#


In any case, since these files will now be included in kernels that
don't have the relevant file systems, you should also update the
various sys/modules/*fs/Makefile to not include these files in the
modules.

And, since you've rearranged where these things live, you should
also probably bump the kernel version...

:)






On Sun, 16 Jun 2019, Christos Zoulas wrote:


Module Name:src
Committed By:   christos
Date:   Sun Jun 16 22:43:33 UTC 2019

Modified Files:
src/sys/ufs: files.ufs

Log Message:
Include the fs scaffolding when none of the ffs/mfs/ext2fs/chfs is included
so a MODULAR kernel links.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/ufs/files.ufs

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


!DSPAM:5d06c65790118679131813!




++--+---+
| 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   |
++--+---+



++--+---+
| 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   |
++--+---+


Re: CVS commit: src/sys/ufs

2019-06-16 Thread Paul Goyette

Hmmm, I wonder why this is needed?

I have NO built-in filesystems in my custom kernel, and it has not had 
any linkage problems in many years.


# modstat | grep vfs
ffs  vfs  boot -0   - wapbl
kernfs   vfs  filesys  a0   - -
null vfs  filesys  a0   - layerfs
procfs   vfs  filesys  a0   - ptrace_common
ptyfsvfs  filesys  a0   - -
tmpfsvfs  filesys  a0   - -
wapblvfs  boot -1   - -
#

On Sun, 16 Jun 2019, Christos Zoulas wrote:


Module Name:src
Committed By:   christos
Date:   Sun Jun 16 22:43:33 UTC 2019

Modified Files:
src/sys/ufs: files.ufs

Log Message:
Include the fs scaffolding when none of the ffs/mfs/ext2fs/chfs is included
so a MODULAR kernel links.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/ufs/files.ufs

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


!DSPAM:5d06c65790118679131813!




++--+---+
| 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/sys/ufs

2019-06-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 16 22:43:33 UTC 2019

Modified Files:
src/sys/ufs: files.ufs

Log Message:
Include the fs scaffolding when none of the ffs/mfs/ext2fs/chfs is included
so a MODULAR kernel links.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/ufs/files.ufs

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

Modified files:

Index: src/sys/ufs/files.ufs
diff -u src/sys/ufs/files.ufs:1.43 src/sys/ufs/files.ufs:1.44
--- src/sys/ufs/files.ufs:1.43	Fri Aug 12 15:04:03 2016
+++ src/sys/ufs/files.ufs	Sun Jun 16 18:43:33 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.ufs,v 1.43 2016/08/12 19:04:03 jdolecek Exp $
+#	$NetBSD: files.ufs,v 1.44 2019/06/16 22:43:33 christos Exp $
 
 deffs	FFS
 deffs	EXT2FS
@@ -100,14 +100,14 @@ file	ufs/mfs/mfs_miniroot.c
 define	ufs: vfs
 file	ufs/ufs/ufs_bmap.c		ufs
 file	ufs/ufs/ufs_dirhash.c		(ffs | mfs | ext2fs | chfs) & ufs_dirhash
-file	ufs/ufs/ufs_extattr.c		(ffs | mfs) & ufs_extattr
-file	ufs/ufs/ufs_inode.c		ffs | mfs | ext2fs
+file	ufs/ufs/ufs_extattr.c		ufs_extattr
+file	ufs/ufs/ufs_inode.c		ufs
 file	ufs/ufs/ufs_lookup.c		ufs
-file	ufs/ufs/ufs_quota.c		(quota | quota2) & (ffs | mfs | ext2fs | chfs)
-file	ufs/ufs/ufs_quota1.c		quota & (ffs | mfs | ext2fs | chfs)
-file	ufs/ufs/ufs_quota2.c		quota2 & (ffs | mfs | ext2fs | chfs)
+file	ufs/ufs/ufs_quota.c		quota | quota2
+file	ufs/ufs/ufs_quota1.c		quota
+file	ufs/ufs/ufs_quota2.c		quota2
 file	ufs/ufs/quota1_subr.c
-file	ufs/ufs/quota2_subr.c		quota2 & (ffs | mfs | ext2fs | chfs)
+file	ufs/ufs/quota2_subr.c		quota2
 file	ufs/ufs/ufs_rename.c		ffs | mfs | chfs
 file	ufs/ufs/ufs_vfsops.c		ufs
 file	ufs/ufs/ufs_vnops.c		ufs



CVS commit: src/sys/ufs

2019-06-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 16 22:43:33 UTC 2019

Modified Files:
src/sys/ufs: files.ufs

Log Message:
Include the fs scaffolding when none of the ffs/mfs/ext2fs/chfs is included
so a MODULAR kernel links.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/ufs/files.ufs

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



CVS commit: src/sys/dev/usb

2019-06-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 16 21:04:09 UTC 2019

Modified Files:
src/sys/dev/usb: if_ure.c

Log Message:
Always increment, not just if we are queueing.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/usb/if_ure.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/usb/if_ure.c
diff -u src/sys/dev/usb/if_ure.c:1.9 src/sys/dev/usb/if_ure.c:1.10
--- src/sys/dev/usb/if_ure.c:1.9	Sun Jun 16 10:47:49 2019
+++ src/sys/dev/usb/if_ure.c	Sun Jun 16 17:04:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ure.c,v 1.9 2019/06/16 14:47:49 christos Exp $	*/
+/*	$NetBSD: if_ure.c,v 1.10 2019/06/16 21:04:08 christos Exp $	*/
 /*	$OpenBSD: if_ure.c,v 1.10 2018/11/02 21:32:30 jcs Exp $	*/
 /*-
  * Copyright (c) 2015-2016 Kevin Lo 
@@ -29,7 +29,7 @@
 /* RealTek RTL8152/RTL8153 10/100/Gigabit USB Ethernet device */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.9 2019/06/16 14:47:49 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.10 2019/06/16 21:04:08 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1517,9 +1517,9 @@ ure_txeof(struct usbd_xfer *xfer, void *
 	}
 
 	ifp->if_flags &= ~IFF_OACTIVE;
+	ifp->if_opackets++;
 
 	if (!IFQ_IS_EMPTY(&ifp->if_snd)) {
-		ifp->if_opackets++;
 		ure_start(ifp);
 	}
 



CVS commit: src/sys/dev/usb

2019-06-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 16 21:04:09 UTC 2019

Modified Files:
src/sys/dev/usb: if_ure.c

Log Message:
Always increment, not just if we are queueing.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/usb/if_ure.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/cortex

2019-06-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jun 16 19:19:30 UTC 2019

Modified Files:
src/sys/arch/arm/cortex: gicv3_its.c

Log Message:
Pass correct event ID with MOVI commands


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/cortex/gicv3_its.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/cortex

2019-06-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jun 16 19:19:30 UTC 2019

Modified Files:
src/sys/arch/arm/cortex: gicv3_its.c

Log Message:
Pass correct event ID with MOVI commands


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/cortex/gicv3_its.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/cortex/gicv3_its.c
diff -u src/sys/arch/arm/cortex/gicv3_its.c:1.13 src/sys/arch/arm/cortex/gicv3_its.c:1.14
--- src/sys/arch/arm/cortex/gicv3_its.c:1.13	Sun Jun 16 11:05:58 2019
+++ src/sys/arch/arm/cortex/gicv3_its.c	Sun Jun 16 19:19:30 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3_its.c,v 1.13 2019/06/16 11:05:58 jmcneill Exp $ */
+/* $NetBSD: gicv3_its.c,v 1.14 2019/06/16 19:19:30 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #define _INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.13 2019/06/16 11:05:58 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.14 2019/06/16 19:19:30 jmcneill Exp $");
 
 #include 
 #include 
@@ -754,7 +754,7 @@ gicv3_its_cpu_init(void *priv, struct cp
 		KASSERT(pa != NULL);
 
 		const uint32_t devid = gicv3_its_devid(pa->pa_pc, pa->pa_tag);
-		gits_command_movi(its, devid, devid, cpu_index(ci));
+		gits_command_movi(its, devid, irq + its->its_pic->pic_irqbase, cpu_index(ci));
 		gits_command_sync(its, its->its_rdbase[cpu_index(ci)]);
 	}
 
@@ -793,7 +793,7 @@ gicv3_its_set_affinity(void *priv, size_
 
 	if (its->its_cpuonline[cpu_index(ci)] == true) {
 		const uint32_t devid = gicv3_its_devid(pa->pa_pc, pa->pa_tag);
-		gits_command_movi(its, devid, devid, cpu_index(ci));
+		gits_command_movi(its, devid, irq + its->its_pic->pic_irqbase, cpu_index(ci));
 		gits_command_sync(its, its->its_rdbase[cpu_index(ci)]);
 	}
 



CVS commit: src/sys/dev/nvmm/x86

2019-06-16 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jun 16 18:30:31 UTC 2019

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

Log Message:
Make sure VMX-outside-SMX is allowed. It may not be if the BIOS decided to
disable VMX. Seen on an HP laptop, where NVMM would panic because of that.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 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-06-16 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jun 16 18:30:31 UTC 2019

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

Log Message:
Make sure VMX-outside-SMX is allowed. It may not be if the BIOS decided to
disable VMX. Seen on an HP laptop, where NVMM would panic because of that.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 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_vmx.c
diff -u src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.35 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.36
--- src/sys/dev/nvmm/x86/nvmm_x86_vmx.c:1.35	Sat May 18 08:55:59 2019
+++ src/sys/dev/nvmm/x86/nvmm_x86_vmx.c	Sun Jun 16 18:30:31 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86_vmx.c,v 1.35 2019/05/18 08:55:59 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86_vmx.c,v 1.36 2019/06/16 18:30:31 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.35 2019/05/18 08:55:59 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.36 2019/06/16 18:30:31 maxv Exp $");
 
 #include 
 #include 
@@ -2894,6 +2894,9 @@ vmx_ident(void)
 	if ((msr & IA32_FEATURE_CONTROL_LOCK) == 0) {
 		return false;
 	}
+	if ((msr & IA32_FEATURE_CONTROL_OUT_SMX) == 0) {
+		return false;
+	}
 
 	msr = rdmsr(MSR_IA32_VMX_BASIC);
 	if ((msr & IA32_VMX_BASIC_IO_REPORT) == 0) {



CVS commit: src/common

2019-06-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 16 16:01:44 UTC 2019

Modified Files:
src/common/include/rpc: types.h xdr.h
src/common/lib/libc/rpc: xdr.c xdr_array.c

Log Message:
get rid of caddr_t


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/common/include/rpc/types.h
cvs rdiff -u -r1.1 -r1.2 src/common/include/rpc/xdr.h
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/rpc/xdr.c \
src/common/lib/libc/rpc/xdr_array.c

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

Modified files:

Index: src/common/include/rpc/types.h
diff -u src/common/include/rpc/types.h:1.2 src/common/include/rpc/types.h:1.3
--- src/common/include/rpc/types.h:1.2	Wed Jun  5 12:25:43 2019
+++ src/common/include/rpc/types.h	Sun Jun 16 12:01:44 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.2 2019/06/05 16:25:43 hannken Exp $	*/
+/*	$NetBSD: types.h,v 1.3 2019/06/16 16:01:44 christos Exp $	*/
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -66,8 +66,6 @@ typedef   int32_t rpc_inline_t;
 
 #define warn(msg,...) /**/
 
-typedef __caddr_t caddr_t;
-
 #include 
 
 #define mem_alloc(bsize)	kmem_alloc(bsize, KM_SLEEP)

Index: src/common/include/rpc/xdr.h
diff -u src/common/include/rpc/xdr.h:1.1 src/common/include/rpc/xdr.h:1.2
--- src/common/include/rpc/xdr.h:1.1	Tue Jun  4 11:07:55 2019
+++ src/common/include/rpc/xdr.h	Sun Jun 16 12:01:44 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: xdr.h,v 1.1 2019/06/04 15:07:55 hannken Exp $	*/
+/*	$NetBSD: xdr.h,v 1.2 2019/06/16 16:01:44 christos Exp $	*/
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -364,7 +364,7 @@ extern bool_t xdrrec_skiprecord(XDR *);
 
 /* true if no more input */
 extern bool_t xdrrec_eof(XDR *);
-extern unsigned xdrrec_readbytes(XDR *, caddr_t, unsigned int);
+extern unsigned xdrrec_readbytes(XDR *, char *, unsigned int);
 __END_DECLS
 
 #endif /* !_RPC_XDR_H_ */

Index: src/common/lib/libc/rpc/xdr.c
diff -u src/common/lib/libc/rpc/xdr.c:1.2 src/common/lib/libc/rpc/xdr.c:1.3
--- src/common/lib/libc/rpc/xdr.c:1.2	Wed Jun  5 12:25:43 2019
+++ src/common/lib/libc/rpc/xdr.c	Sun Jun 16 12:01:44 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: xdr.c,v 1.2 2019/06/05 16:25:43 hannken Exp $	*/
+/*	$NetBSD: xdr.c,v 1.3 2019/06/16 16:01:44 christos Exp $	*/
 
 /*
  * Copyright (c) 2010, Oracle America, Inc.
@@ -37,7 +37,7 @@
 static char *sccsid = "@(#)xdr.c 1.35 87/08/12";
 static char *sccsid = "@(#)xdr.c	2.1 88/07/29 4.0 RPCSRC";
 #else
-__RCSID("$NetBSD: xdr.c,v 1.2 2019/06/05 16:25:43 hannken Exp $");
+__RCSID("$NetBSD: xdr.c,v 1.3 2019/06/16 16:01:44 christos Exp $");
 #endif
 #endif
 
@@ -546,7 +546,7 @@ xdr_enum(XDR *xdrs, enum_t *ep)
  * cp points to the opaque object and cnt gives the byte length.
  */
 bool_t
-xdr_opaque(XDR *xdrs, caddr_t cp, u_int cnt)
+xdr_opaque(XDR *xdrs, char *cp, u_int cnt)
 {
 	u_int rndup;
 	static int crud[BYTES_PER_XDR_UNIT];
@@ -572,7 +572,7 @@ xdr_opaque(XDR *xdrs, caddr_t cp, u_int 
 		}
 		if (rndup == 0)
 			return (TRUE);
-		return (XDR_GETBYTES(xdrs, (caddr_t)(void *)crud, rndup));
+		return (XDR_GETBYTES(xdrs, (void *)crud, rndup));
 	}
 
 	if (xdrs->x_op == XDR_ENCODE) {
Index: src/common/lib/libc/rpc/xdr_array.c
diff -u src/common/lib/libc/rpc/xdr_array.c:1.2 src/common/lib/libc/rpc/xdr_array.c:1.3
--- src/common/lib/libc/rpc/xdr_array.c:1.2	Wed Jun  5 12:25:43 2019
+++ src/common/lib/libc/rpc/xdr_array.c	Sun Jun 16 12:01:44 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: xdr_array.c,v 1.2 2019/06/05 16:25:43 hannken Exp $	*/
+/*	$NetBSD: xdr_array.c,v 1.3 2019/06/16 16:01:44 christos Exp $	*/
 
 /*
  * Copyright (c) 2010, Oracle America, Inc.
@@ -37,7 +37,7 @@
 static char *sccsid = "@(#)xdr_array.c 1.10 87/08/11 Copyr 1984 Sun Micro";
 static char *sccsid = "@(#)xdr_array.c	2.1 88/07/29 4.0 RPCSRC";
 #else
-__RCSID("$NetBSD: xdr_array.c,v 1.2 2019/06/05 16:25:43 hannken Exp $");
+__RCSID("$NetBSD: xdr_array.c,v 1.3 2019/06/16 16:01:44 christos Exp $");
 #endif
 #endif
 
@@ -85,11 +85,11 @@ __weak_alias(xdr_vector,_xdr_vector)
  * xdr procedure to call to handle each element of the array.
  */
 bool_t
-xdr_array(XDR *xdrs, caddr_t *addrp, u_int *sizep, u_int maxsize, u_int elsize,
+xdr_array(XDR *xdrs, char **addrp, u_int *sizep, u_int maxsize, u_int elsize,
 xdrproc_t elproc)
 {
 	u_int i;
-	caddr_t target = *addrp;
+	char *target = *addrp;
 	u_int c;  /* the actual element count */
 	bool_t stat = TRUE;
 	u_int nodesize;



CVS commit: src/common

2019-06-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 16 16:01:44 UTC 2019

Modified Files:
src/common/include/rpc: types.h xdr.h
src/common/lib/libc/rpc: xdr.c xdr_array.c

Log Message:
get rid of caddr_t


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/common/include/rpc/types.h
cvs rdiff -u -r1.1 -r1.2 src/common/include/rpc/xdr.h
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/rpc/xdr.c \
src/common/lib/libc/rpc/xdr_array.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/aarch64/include

2019-06-16 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jun 16 15:16:15 UTC 2019

Modified Files:
src/sys/arch/aarch64/include: armreg.h

Log Message:
Provide icc_pmr_read


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/aarch64/include/armreg.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/aarch64/include/armreg.h
diff -u src/sys/arch/aarch64/include/armreg.h:1.24 src/sys/arch/aarch64/include/armreg.h:1.25
--- src/sys/arch/aarch64/include/armreg.h:1.24	Wed Mar 20 07:16:07 2019
+++ src/sys/arch/aarch64/include/armreg.h	Sun Jun 16 15:16:15 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: armreg.h,v 1.24 2019/03/20 07:16:07 ryo Exp $ */
+/* $NetBSD: armreg.h,v 1.25 2019/06/16 15:16:15 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -1056,6 +1056,7 @@ AARCH64REG_READ_INLINE2(icc_iar1_el1, s3
 
 #define	icc_sre_read		reg_icc_sre_el1_read
 #define	icc_sre_write		reg_icc_sre_el1_write
+#define	icc_pmr_read		reg_icc_pmr_el1_read
 #define	icc_pmr_write		reg_icc_pmr_el1_write
 #define	icc_bpr0_write		reg_icc_bpr0_el1_write
 #define	icc_bpr1_write		reg_icc_bpr1_el1_write



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

2019-06-16 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jun 16 15:16:15 UTC 2019

Modified Files:
src/sys/arch/aarch64/include: armreg.h

Log Message:
Provide icc_pmr_read


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/aarch64/include/armreg.h

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



CVS commit: src/sys/dev/usb

2019-06-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 16 14:47:49 UTC 2019

Modified Files:
src/sys/dev/usb: if_ure.c

Log Message:
PR/54297: sc dying: opacket of ure(4) is always 0


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/usb/if_ure.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/usb/if_ure.c
diff -u src/sys/dev/usb/if_ure.c:1.8 src/sys/dev/usb/if_ure.c:1.9
--- src/sys/dev/usb/if_ure.c:1.8	Sun Jun  9 09:35:47 2019
+++ src/sys/dev/usb/if_ure.c	Sun Jun 16 10:47:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ure.c,v 1.8 2019/06/09 13:35:47 mrg Exp $	*/
+/*	$NetBSD: if_ure.c,v 1.9 2019/06/16 14:47:49 christos Exp $	*/
 /*	$OpenBSD: if_ure.c,v 1.10 2018/11/02 21:32:30 jcs Exp $	*/
 /*-
  * Copyright (c) 2015-2016 Kevin Lo 
@@ -29,7 +29,7 @@
 /* RealTek RTL8152/RTL8153 10/100/Gigabit USB Ethernet device */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.8 2019/06/09 13:35:47 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.9 2019/06/16 14:47:49 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1518,8 +1518,10 @@ ure_txeof(struct usbd_xfer *xfer, void *
 
 	ifp->if_flags &= ~IFF_OACTIVE;
 
-	if (IFQ_IS_EMPTY(&ifp->if_snd) == 0)
+	if (!IFQ_IS_EMPTY(&ifp->if_snd)) {
+		ifp->if_opackets++;
 		ure_start(ifp);
+	}
 
 	splx(s);
 }



CVS commit: src/sys/dev/usb

2019-06-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 16 14:47:49 UTC 2019

Modified Files:
src/sys/dev/usb: if_ure.c

Log Message:
PR/54297: sc dying: opacket of ure(4) is always 0


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/usb/if_ure.c

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



CVS commit: src/usr.sbin/sysinst

2019-06-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jun 16 13:02:29 UTC 2019

Modified Files:
src/usr.sbin/sysinst: part_edit.c

Log Message:
Lower estimates on required install size


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/part_edit.c

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



CVS commit: src/usr.sbin/sysinst

2019-06-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jun 16 13:02:29 UTC 2019

Modified Files:
src/usr.sbin/sysinst: part_edit.c

Log Message:
Lower estimates on required install size


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/sysinst/part_edit.c

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

Modified files:

Index: src/usr.sbin/sysinst/part_edit.c
diff -u src/usr.sbin/sysinst/part_edit.c:1.2 src/usr.sbin/sysinst/part_edit.c:1.3
--- src/usr.sbin/sysinst/part_edit.c:1.2	Sat Jun 15 08:20:33 2019
+++ src/usr.sbin/sysinst/part_edit.c	Sun Jun 16 13:02:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: part_edit.c,v 1.2 2019/06/15 08:20:33 martin Exp $ */
+/*	$NetBSD: part_edit.c,v 1.3 2019/06/16 13:02:29 martin Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -1127,7 +1127,7 @@ edit_outer_parts(struct disk_partitions 
 		*sec_short = msg_string(sec->short_name);
 
 		humanize_number(min_size, sizeof(min_size),
-		2 * m_size * MEG,
+		m_size * MEG,
 		"", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL);
 		humanize_number(build_size, sizeof(build_size),
 		 SYSTEM_BUILD_SIZE * MEG, "", HN_AUTOSCALE,



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

2019-06-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jun 16 11:05:59 UTC 2019

Modified Files:
src/sys/arch/arm/cortex: gicv3_its.c

Log Message:
- Disable MSI/MSI-X when making changes
- MSI: Write the vector count to the Multi Message Enable (MME) field
- MSI: Set DATA to the first LPI number, not the last


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/cortex/gicv3_its.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/cortex/gicv3_its.c
diff -u src/sys/arch/arm/cortex/gicv3_its.c:1.12 src/sys/arch/arm/cortex/gicv3_its.c:1.13
--- src/sys/arch/arm/cortex/gicv3_its.c:1.12	Wed Jun 12 21:02:07 2019
+++ src/sys/arch/arm/cortex/gicv3_its.c	Sun Jun 16 11:05:58 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3_its.c,v 1.12 2019/06/12 21:02:07 jmcneill Exp $ */
+/* $NetBSD: gicv3_its.c,v 1.13 2019/06/16 11:05:58 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #define _INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.12 2019/06/12 21:02:07 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.13 2019/06/16 11:05:58 jmcneill Exp $");
 
 #include 
 #include 
@@ -336,7 +336,7 @@ gicv3_its_device_map(struct gicv3_its *i
 }
 
 static void
-gicv3_its_msi_enable(struct gicv3_its *its, int lpi)
+gicv3_its_msi_enable(struct gicv3_its *its, int lpi, int count)
 {
 	const struct pci_attach_args *pa = its->its_pa[lpi - its->its_pic->pic_irqbase];
 	pci_chipset_tag_t pc = pa->pa_pc;
@@ -347,6 +347,15 @@ gicv3_its_msi_enable(struct gicv3_its *i
 	if (!pci_get_capability(pc, tag, PCI_CAP_MSI, &off, NULL))
 		panic("gicv3_its_msi_enable: device is not MSI-capable");
 
+	ctl = pci_conf_read(pc, tag, off + PCI_MSI_CTL);
+	ctl &= ~PCI_MSI_CTL_MSI_ENABLE;
+	pci_conf_write(pc, tag, off + PCI_MSI_CTL, ctl);
+
+	ctl = pci_conf_read(pc, tag, off + PCI_MSI_CTL);
+	ctl &= ~PCI_MSI_CTL_MME_MASK;
+	ctl |= __SHIFTIN(ilog2(count), PCI_MSI_CTL_MME_MASK);
+	pci_conf_write(pc, tag, off + PCI_MSI_CTL, ctl);
+
 	const uint64_t addr = its->its_base + GITS_TRANSLATER;
 	ctl = pci_conf_read(pc, tag, off + PCI_MSI_CTL);
 	if (ctl & PCI_MSI_CTL_64BIT_ADDR) {
@@ -394,6 +403,10 @@ gicv3_its_msix_enable(struct gicv3_its *
 	if (!pci_get_capability(pc, tag, PCI_CAP_MSIX, &off, NULL))
 		panic("gicv3_its_msix_enable: device is not MSI-X-capable");
 
+	ctl = pci_conf_read(pc, tag, off + PCI_MSIX_CTL);
+	ctl &= ~PCI_MSIX_CTL_ENABLE;
+	pci_conf_write(pc, tag, off + PCI_MSIX_CTL, ctl);
+
 	const uint64_t addr = its->its_base + GITS_TRANSLATER;
 	const uint64_t entry_base = PCI_MSIX_TABLE_ENTRY_SIZE * msix_vec;
 	bus_space_write_4(bst, bsh, entry_base + PCI_MSIX_TABLE_ENTRY_ADDR_LO, (uint32_t)addr);
@@ -453,7 +466,8 @@ gicv3_its_msi_alloc(struct arm_pci_msi *
 		__SHIFTIN(n, ARM_PCI_INTR_MSI_VEC) |
 		__SHIFTIN(msi->msi_id, ARM_PCI_INTR_FRAME);
 
-		gicv3_its_msi_enable(its, lpi);
+		if (n == 0)
+			gicv3_its_msi_enable(its, lpi, *count);
 
 		/*
 		 * Record target PE



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

2019-06-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jun 16 11:05:59 UTC 2019

Modified Files:
src/sys/arch/arm/cortex: gicv3_its.c

Log Message:
- Disable MSI/MSI-X when making changes
- MSI: Write the vector count to the Multi Message Enable (MME) field
- MSI: Set DATA to the first LPI number, not the last


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/cortex/gicv3_its.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/cortex

2019-06-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jun 16 10:57:59 UTC 2019

Modified Files:
src/sys/arch/arm/cortex: gtmr.c

Log Message:
Disable counter before updating cval/tval


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/arm/cortex/gtmr.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/cortex/gtmr.c
diff -u src/sys/arch/arm/cortex/gtmr.c:1.39 src/sys/arch/arm/cortex/gtmr.c:1.40
--- src/sys/arch/arm/cortex/gtmr.c:1.39	Wed Jan 30 02:01:58 2019
+++ src/sys/arch/arm/cortex/gtmr.c	Sun Jun 16 10:57:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: gtmr.c,v 1.39 2019/01/30 02:01:58 jmcneill Exp $	*/
+/*	$NetBSD: gtmr.c,v 1.40 2019/06/16 10:57:59 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gtmr.c,v 1.39 2019/01/30 02:01:58 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gtmr.c,v 1.40 2019/06/16 10:57:59 jmcneill Exp $");
 
 #include 
 #include 
@@ -268,6 +268,9 @@ gtmr_intr(void *arg)
 	if ((ctl & CNTCTL_ISTATUS) == 0)
 		return 0;
 
+	arm_isb();
+	gtmr_cntv_ctl_write(0);
+
 	const uint64_t now = gtmr_read_cntvct(sc);
 	uint64_t delta = now - ci->ci_lastintr;
 
@@ -299,12 +302,16 @@ gtmr_intr(void *arg)
 		delta = 0;
 	}
 
+	arm_isb();
 	if (ISSET(sc->sc_flags, GTMR_FLAG_SUN50I_A64_UNSTABLE_TIMER)) {
 		gtmr_cntv_cval_write(now + sc->sc_autoinc - delta);
 	} else {
 		gtmr_cntv_tval_write(sc->sc_autoinc - delta);
 	}
 
+	arm_isb();
+	gtmr_cntv_ctl_write(CNTCTL_ENABLE);
+
 	ci->ci_lastintr = now;
 
 #ifdef DIAGNOSTIC



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

2019-06-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jun 16 10:57:59 UTC 2019

Modified Files:
src/sys/arch/arm/cortex: gtmr.c

Log Message:
Disable counter before updating cval/tval


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/arm/cortex/gtmr.c

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



CVS commit: src/tests/crypto/libcrypto

2019-06-16 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Jun 16 10:45:50 UTC 2019

Modified Files:
src/tests/crypto/libcrypto: t_pubkey.sh

Log Message:
The runtime of the ecdsa test case increased approximately sixfold
with the openssl update on 2019-06-09, and it is now timing out on
sparc.  Increase the timeout by roughly the same factor.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/crypto/libcrypto/t_pubkey.sh

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



CVS commit: src/tests/crypto/libcrypto

2019-06-16 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Jun 16 10:45:50 UTC 2019

Modified Files:
src/tests/crypto/libcrypto: t_pubkey.sh

Log Message:
The runtime of the ecdsa test case increased approximately sixfold
with the openssl update on 2019-06-09, and it is now timing out on
sparc.  Increase the timeout by roughly the same factor.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/crypto/libcrypto/t_pubkey.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/crypto/libcrypto/t_pubkey.sh
diff -u src/tests/crypto/libcrypto/t_pubkey.sh:1.5 src/tests/crypto/libcrypto/t_pubkey.sh:1.6
--- src/tests/crypto/libcrypto/t_pubkey.sh:1.5	Sat Sep 29 10:54:35 2018
+++ src/tests/crypto/libcrypto/t_pubkey.sh	Sun Jun 16 10:45:50 2019
@@ -1,4 +1,4 @@
-# $NetBSD: t_pubkey.sh,v 1.5 2018/09/29 10:54:35 gson Exp $
+# $NetBSD: t_pubkey.sh,v 1.6 2019/06/16 10:45:50 gson Exp $
 #
 # Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -81,7 +81,7 @@ atf_test_case ecdsa
 ecdsa_head()
 {
 	atf_set "descr" "Checks ECDSA algorithm"
-	atf_set "timeout" "480"
+	atf_set "timeout" "3000"
 }
 ecdsa_body()
 {



CVS commit: src/sys/arch/x86/pci

2019-06-16 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Jun 16 09:12:51 UTC 2019

Modified Files:
src/sys/arch/x86/pci: amdzentemp.c

Log Message:
correct for known temperature bias values.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x86/pci/amdzentemp.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/x86/pci

2019-06-16 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Jun 16 09:12:51 UTC 2019

Modified Files:
src/sys/arch/x86/pci: amdzentemp.c

Log Message:
correct for known temperature bias values.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x86/pci/amdzentemp.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/x86/pci/amdzentemp.c
diff -u src/sys/arch/x86/pci/amdzentemp.c:1.8 src/sys/arch/x86/pci/amdzentemp.c:1.9
--- src/sys/arch/x86/pci/amdzentemp.c:1.8	Wed Jul 25 19:10:41 2018
+++ src/sys/arch/x86/pci/amdzentemp.c	Sun Jun 16 09:12:51 2019
@@ -1,4 +1,4 @@
-/*  $NetBSD: amdzentemp.c,v 1.8 2018/07/25 19:10:41 para Exp $ */
+/*  $NetBSD: amdzentemp.c,v 1.9 2019/06/16 09:12:51 mlelstv Exp $ */
 /*  $OpenBSD: kate.c,v 1.2 2008/03/27 04:52:03 cnst Exp $   */
 
 /*
@@ -50,7 +50,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.8 2018/07/25 19:10:41 para Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.9 2019/06/16 09:12:51 mlelstv Exp $ ");
 
 #include 
 #include 
@@ -81,6 +81,7 @@ struct amdzentemp_softc {
 	envsys_data_t *sc_sensor;
 	size_t sc_sensor_len;
 size_t sc_numsensors;
+	int32_t sc_offset;
 };
 
 
@@ -123,7 +124,7 @@ amdzentemp_attach(device_t parent, devic
 	sc->sc_pc = pa->pa_pc;
 	sc->sc_pcitag = pa->pa_tag;
 	sc->sc_smn = parent;
- 
+
 	amdzentemp_family17_init(sc);
 
 	aprint_normal("\n");
@@ -190,7 +191,19 @@ amdzentemp_detach(device_t self, int fla
 static void
 amdzentemp_family17_init(struct amdzentemp_softc *sc) 
 {
+
 	sc->sc_numsensors = 1;
+	sc->sc_offset = 0;
+
+	if (strstr(cpu_brand_string, "AMD Ryzen 5 1600X")
+	|| strstr(cpu_brand_string, "AMD Ryzen 7 1700X")
+	|| strstr(cpu_brand_string, "AMD Ryzen 7 1800X"))
+		sc->sc_offset = -2000;
+	else if (strstr(cpu_brand_string, "AMD Ryzen 7 2700X"))
+		sc->sc_offset = -1000;
+	else if (strstr(cpu_brand_string, "AMD Ryzen Threadripper 19")
+	|| strstr(cpu_brand_string, "AMD Ryzen Threadripper 29"))
+		sc->sc_offset = -2700;
 }
 
 static void
@@ -222,6 +235,7 @@ amdzentemp_family17_refresh(struct sysmo
 	/* adjust for possible offset of 49K */
 	if (temp & 0x8) 
 		edata->value_cur -= 4900;
+	edata->value_cur += sc->sc_offset;
 }
 
 MODULE(MODULE_CLASS_DRIVER, amdzentemp, "sysmon_envsys,amdsmn");



CVS commit: src/sys/arch/riscv

2019-06-16 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jun 16 07:42:52 UTC 2019

Modified Files:
src/sys/arch/riscv/conf: Makefile.riscv files.riscv kern.ldscript
src/sys/arch/riscv/include: pmap.h pte.h sysreg.h
src/sys/arch/riscv/riscv: db_machdep.c genassym.cf locore.S
pmap_machdep.c trap.c

Log Message:
Misc changes in RISC-V.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/conf/Makefile.riscv
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/conf/files.riscv
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/conf/kern.ldscript
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/include/pmap.h \
src/sys/arch/riscv/include/pte.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/include/sysreg.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/riscv/db_machdep.c \
src/sys/arch/riscv/riscv/trap.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/riscv/genassym.cf
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/riscv/riscv/locore.S
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/riscv/pmap_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/riscv

2019-06-16 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jun 16 07:42:52 UTC 2019

Modified Files:
src/sys/arch/riscv/conf: Makefile.riscv files.riscv kern.ldscript
src/sys/arch/riscv/include: pmap.h pte.h sysreg.h
src/sys/arch/riscv/riscv: db_machdep.c genassym.cf locore.S
pmap_machdep.c trap.c

Log Message:
Misc changes in RISC-V.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/conf/Makefile.riscv
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/conf/files.riscv
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/conf/kern.ldscript
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/include/pmap.h \
src/sys/arch/riscv/include/pte.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/include/sysreg.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/riscv/db_machdep.c \
src/sys/arch/riscv/riscv/trap.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/riscv/genassym.cf
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/riscv/riscv/locore.S
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/riscv/pmap_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/riscv/conf/Makefile.riscv
diff -u src/sys/arch/riscv/conf/Makefile.riscv:1.4 src/sys/arch/riscv/conf/Makefile.riscv:1.5
--- src/sys/arch/riscv/conf/Makefile.riscv:1.4	Sat Jun  1 12:42:27 2019
+++ src/sys/arch/riscv/conf/Makefile.riscv	Sun Jun 16 07:42:52 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.riscv,v 1.4 2019/06/01 12:42:27 maxv Exp $
+#	$NetBSD: Makefile.riscv,v 1.5 2019/06/16 07:42:52 maxv Exp $
 
 # Makefile for NetBSD
 #
@@ -69,8 +69,8 @@ locore.o: ${RISCV}/riscv/locore.S assym.
 ## (5) link settings
 ##
 .if ${MACHINE_ARCH} == "riscv64" && ${LP64:Uyes} == "yes"
-TEXTADDR?=  0xFFC0
-.else   
+TEXTADDR?=		0xFFC0
+.else
 TEXTADDR?=		0xC0001000
 .endif
 KERNLDSCRIPT?=		${RISCV}/conf/kern.ldscript

Index: src/sys/arch/riscv/conf/files.riscv
diff -u src/sys/arch/riscv/conf/files.riscv:1.2 src/sys/arch/riscv/conf/files.riscv:1.3
--- src/sys/arch/riscv/conf/files.riscv:1.2	Sat Jun  1 12:42:27 2019
+++ src/sys/arch/riscv/conf/files.riscv	Sun Jun 16 07:42:52 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.riscv,v 1.2 2019/06/01 12:42:27 maxv Exp $
+#	$NetBSD: files.riscv,v 1.3 2019/06/16 07:42:52 maxv Exp $
 #
 
 maxpartitions	16
@@ -41,7 +41,6 @@ file	dev/md_root.cmemory_disk_hooks
 file	kern/subr_disk_mbr.c			disk
 
 file	uvm/pmap/pmap.c
-file	uvm/pmap/pmap_pvt.c
 file	uvm/pmap/pmap_segtab.c
 file	uvm/pmap/pmap_tlb.c
 

Index: src/sys/arch/riscv/conf/kern.ldscript
diff -u src/sys/arch/riscv/conf/kern.ldscript:1.5 src/sys/arch/riscv/conf/kern.ldscript:1.6
--- src/sys/arch/riscv/conf/kern.ldscript:1.5	Mon Aug 24 08:13:07 2015
+++ src/sys/arch/riscv/conf/kern.ldscript	Sun Jun 16 07:42:52 2019
@@ -1,82 +1,63 @@
-/* Script for -n: mix text and data on same page */
-OUTPUT_FORMAT("elf64-littleriscv")
 OUTPUT_ARCH(riscv)
-ENTRY(_start)
+ENTRY(start)
+
+__PAGE_SIZE = 0x1000 ;
+__LARGE_PAGE_SIZE = 0x20 ;
+
 SECTIONS
 {
-  /* Read-only sections, merged into text segment: */
-  PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x8000)); . = SEGMENT_START("text-segment", 0x8000) + SIZEOF_HEADERS;
-  .text   :
-  {
-_ftext = . ;
-*(.text)
-*(.text.unlikely .text.*_unlikely)
-*(.text.exit .text.exit.*)
-*(.text.startup .text.startup.*)
-*(.text.hot .text.hot.*)
-*(.stub .text.* .gnu.linkonce.t.*)
-  }
-  PROVIDE (__etext = .);
-  PROVIDE (_etext = .);
-  PROVIDE (etext = .);
-  .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
-  .rodata1: { *(.rodata1) }
-  .sdata2 :
-  {
-*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
-  }
-  .sbss2  : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
-  .eh_frame_hdr : { *(.eh_frame_hdr) }
-  .eh_frame   : ONLY_IF_RO { KEEP (*(.eh_frame)) }
-  /* These sections are generated by the Sun/Oracle C++ compiler.  */
-  .exception_ranges   : ONLY_IF_RO { *(.exception_ranges
-  .exception_ranges*) }
-  /* Adjust the address for the data segment.  We want to adjust up to
- the same address within the page on the next page up.  */
-  . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
-  /* Exception handling  */
-  .eh_frame   : ONLY_IF_RW { KEEP (*(.eh_frame)) }
-  .exception_ranges   : ONLY_IF_RW { *(.exception_ranges .exception_ranges*) }
-  . = DATA_SEGMENT_RELRO_END (0, .);
-  .data   :
-  {
-_fdata = . ;
-*(.data .data.* .gnu.linkonce.d.*)
-SORT(CONSTRUCTORS)
-  }
-  .data1  : { *(.data1) }
-  /* We want the small data sections together, so single-instruction offsets
- can access them all, and initialized data all before uninitialized, so
- we can shorten the on-disk segment size.  */
-  .sdata  :
-  {
-/*