CVS commit: src/doc

2020-10-07 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Oct  8 04:30:04 UTC 2020

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note update to tzdata 2020b


To generate a diff of this commit:
cvs rdiff -u -r1.1749 -r1.1750 src/doc/3RDPARTY
cvs rdiff -u -r1.2743 -r1.2744 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1749 src/doc/3RDPARTY:1.1750
--- src/doc/3RDPARTY:1.1749	Wed Oct  7 19:53:32 2020
+++ src/doc/3RDPARTY	Thu Oct  8 04:30:04 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1749 2020/10/07 19:53:32 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1750 2020/10/08 04:30:04 kre Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1409,8 +1409,8 @@ Notes:
 Added changes from a5 -> a12 manually.
 
 Package:	tz
-Version:	tzcode2020a / tzdata2020a
-Current Vers:	tzcode2020a / tzdata2020a
+Version:	tzcode2020a / tzdata2020b
+Current Vers:	tzcode2020b / tzdata2020b
 Maintainer:	Paul Eggert 
 Archive Site:	ftp://ftp.iana.org/tz/releases/
 Archive Site:	ftp://munnari.oz.au/pub/oldtz/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2743 src/doc/CHANGES:1.2744
--- src/doc/CHANGES:1.2743	Mon Oct  5 16:04:11 2020
+++ src/doc/CHANGES	Thu Oct  8 04:30:04 2020
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2743 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2744 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -290,3 +290,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	ld.so(1): Upgrade r_debug to the protocol version 1. [kamil 20200921]
 	vether(4): Imported from OpenBSD. [roy 20200927]
 	dhcpcd: Update to version 9.3.0 [roy 20201005]
+	tzdata updated to 2020b  [kre 20201008]



CVS import: src/external/public-domain/tz/dist

2020-10-07 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Oct  8 04:27:36 UTC 2020

Update of /cvsroot/src/external/public-domain/tz/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv16741

Log Message:
Import tzdata2020b from ftp://ftp.iana.org/tz/releases/tzdata2020b.tar.gz

Summary of changes in tzdata2020b (2020-10-06 18:35:04 -0700):

 Revised predictions for Morocco's changes starting in 2023.
 Canada's Yukon changes to -07 on 2020-11-01, not 2020-03-08.
 Macquarie Island has stayed in sync with Tasmania since 2011.
 Casey, Antarctica is at +08 in winter and +11 in summer.

Status:

Vendor Tag: TZDATA
Release Tags:   TZDATA2020B

U src/external/public-domain/tz/dist/leap-seconds.list
U src/external/public-domain/tz/dist/calendars
U src/external/public-domain/tz/dist/CONTRIBUTING
U src/external/public-domain/tz/dist/LICENSE
U src/external/public-domain/tz/dist/Makefile
U src/external/public-domain/tz/dist/NEWS
U src/external/public-domain/tz/dist/README
U src/external/public-domain/tz/dist/theory.html
U src/external/public-domain/tz/dist/version
U src/external/public-domain/tz/dist/africa
U src/external/public-domain/tz/dist/antarctica
U src/external/public-domain/tz/dist/asia
U src/external/public-domain/tz/dist/australasia
U src/external/public-domain/tz/dist/europe
U src/external/public-domain/tz/dist/northamerica
U src/external/public-domain/tz/dist/southamerica
U src/external/public-domain/tz/dist/etcetera
U src/external/public-domain/tz/dist/factory
U src/external/public-domain/tz/dist/backward
U src/external/public-domain/tz/dist/backzone
U src/external/public-domain/tz/dist/iso3166.tab
U src/external/public-domain/tz/dist/checklinks.awk
U src/external/public-domain/tz/dist/leapseconds
U src/external/public-domain/tz/dist/zone1970.tab
U src/external/public-domain/tz/dist/zone.tab
U src/external/public-domain/tz/dist/leapseconds.awk
U src/external/public-domain/tz/dist/checktab.awk
U src/external/public-domain/tz/dist/zoneinfo2tdf.pl
U src/external/public-domain/tz/dist/ziguard.awk
U src/external/public-domain/tz/dist/zishrink.awk

No conflicts created by this import



CVS commit: src/external/public-domain/tz/dist

2020-10-07 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Oct  8 04:28:00 UTC 2020

Modified Files:
src/external/public-domain/tz/dist: TZDATA_VERSION
Removed Files:
src/external/public-domain/tz/dist: pacificnew systemv yearistype.sh

Log Message:
Merge tzdata2020b


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/external/public-domain/tz/dist/TZDATA_VERSION
cvs rdiff -u -r1.1.1.3 -r0 src/external/public-domain/tz/dist/pacificnew \
src/external/public-domain/tz/dist/systemv
cvs rdiff -u -r1.1.1.2 -r0 src/external/public-domain/tz/dist/yearistype.sh

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

Modified files:

Index: src/external/public-domain/tz/dist/TZDATA_VERSION
diff -u src/external/public-domain/tz/dist/TZDATA_VERSION:1.19 src/external/public-domain/tz/dist/TZDATA_VERSION:1.20
--- src/external/public-domain/tz/dist/TZDATA_VERSION:1.19	Sat Apr 25 12:17:17 2020
+++ src/external/public-domain/tz/dist/TZDATA_VERSION	Thu Oct  8 04:28:00 2020
@@ -1 +1 @@
-tzdata-2020a
+tzdata-2020b



CVS commit: src/doc

2020-10-07 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Oct  7 19:53:33 UTC 2020

Modified Files:
src/doc: 3RDPARTY

Log Message:
expat-2.2.10 out.


To generate a diff of this commit:
cvs rdiff -u -r1.1748 -r1.1749 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1748 src/doc/3RDPARTY:1.1749
--- src/doc/3RDPARTY:1.1748	Mon Oct  5 16:04:11 2020
+++ src/doc/3RDPARTY	Wed Oct  7 19:53:32 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1748 2020/10/05 16:04:11 roy Exp $
+#	$NetBSD: 3RDPARTY,v 1.1749 2020/10/07 19:53:32 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -408,7 +408,7 @@ Notes:
 
 Package:	expat
 Version:	2.2.8
-Current Vers:	2.2.9
+Current Vers:	2.2.10
 Maintainer:	Expat Project
 Archive Site:	https://github.com/libexpat/libexpat/releases
 Home Page:	http://www.libexpat.org/



CVS commit: src/games/factor

2020-10-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct  7 19:48:29 UTC 2020

Modified Files:
src/games/factor: factor.c

Log Message:
- for readability when the exponent < 10 don't prefix it with 0x (from kre)
- fix usage
- merge printing code.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/games/factor/factor.c

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

Modified files:

Index: src/games/factor/factor.c
diff -u src/games/factor/factor.c:1.34 src/games/factor/factor.c:1.35
--- src/games/factor/factor.c:1.34	Mon Oct  5 17:11:47 2020
+++ src/games/factor/factor.c	Wed Oct  7 15:48:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: factor.c,v 1.34 2020/10/05 21:11:47 christos Exp $	*/
+/*	$NetBSD: factor.c,v 1.35 2020/10/07 19:48:29 christos Exp $	*/
 /*
  * Copyright (c) 1989, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -41,7 +41,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19
 __SCCSID("@(#)factor.c	8.4 (Berkeley) 5/4/95");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: factor.c,v 1.34 2020/10/05 21:11:47 christos Exp $");
+__RCSID("$NetBSD: factor.c,v 1.35 2020/10/07 19:48:29 christos Exp $");
 #endif
 #ifdef __FBSDID
 __FBSDID("$FreeBSD: head/usr.bin/factor/factor.c 35 2020-01-12 20:25:11Z gad $");
@@ -177,6 +177,18 @@ main(int argc, char *argv[])
 	exit(0);
 }
 
+static void
+pr_exp(int i, int xflag)
+{
+	printf(xflag && i > 9 ? "^0x%x" : "^%d", i);
+}
+
+static void
+pr_uint64(uint64_t i, int xflag)
+{
+	printf(xflag ? " 0x%" PRIx64 : " %" PRIu64, i);
+}
+
 /*
  * pr_fact - print the factors of a number
  *
@@ -246,15 +258,14 @@ pr_fact(BIGNUM *val, int hflag, int xfla
 		do {
 			i++;
 			if (!hflag)
-printf(xflag ? " 0x%" PRIx64 : " %" PRIu64,
-*fact);
+pr_uint64(*fact, xflag);
 			BN_div_word(val, (BN_ULONG)*fact);
 		} while (BN_mod_word(val, (BN_ULONG)*fact) == 0);
 
 		if (hflag) {
-			printf(xflag ? " 0x%" PRIx64 : " %" PRIu64, *fact);
+			pr_uint64(*fact, xflag);
 			if (i > 1)
-printf(xflag ? "^0x%x" : "^%d", i);
+pr_exp(i, xflag);
 		}
 
 		/* Let the user know we're doing something. */
@@ -288,7 +299,7 @@ pr_print(BIGNUM *val, int xflag)
 		BN_print_dec_fp(stdout, val);
 	}
 	if (ex > 1)
-		printf(xflag ? "^0x%x" : "^%d", ex);
+		pr_exp(ex, xflag);
 
 	if (val != NULL) {
 		BN_copy(sval, val);
@@ -302,7 +313,7 @@ pr_print(BIGNUM *val, int xflag)
 static void
 usage(void)
 {
-	fprintf(stderr, "usage: factor [-h] [value ...]\n");
+	fprintf(stderr, "Usage: %s [-hx] [value ...]\n", getprogname());
 	exit(1);
 }
 



CVS commit: src/usr.bin/calendar/calendars

2020-10-07 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Wed Oct  7 19:06:50 UTC 2020

Modified Files:
src/usr.bin/calendar/calendars: calendar.music

Log Message:
Eddie Van Halen, co-founder of Van Halen dies.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/calendar/calendars/calendar.music

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

Modified files:

Index: src/usr.bin/calendar/calendars/calendar.music
diff -u src/usr.bin/calendar/calendars/calendar.music:1.24 src/usr.bin/calendar/calendars/calendar.music:1.25
--- src/usr.bin/calendar/calendars/calendar.music:1.24	Thu May 21 08:43:57 2020
+++ src/usr.bin/calendar/calendars/calendar.music	Wed Oct  7 19:06:50 2020
@@ -143,6 +143,7 @@
 09/26	George Gershwin born in Brooklyn, NY, 1898
 10/03	Stevie Ray Vaughan born in Dallas, TX, 1954
 10/04	Janis Joplin dies of a heroin overdose in Hollywood, 1970
+10/06	Eddie Van Halen dies in Santa Monica, CA,  2020
 10/05	Steve Miller is born in Dallas, 1943
 10/07	First Bandstand (later, American Bandstand) broadcast, 1957
 10/09	John Lennon born in Liverpool, England, 1940



CVS commit: src/sys/uvm

2020-10-07 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Wed Oct  7 17:51:50 UTC 2020

Modified Files:
src/sys/uvm: uvm_init.c uvm_page.h uvm_pglist.c uvm_swap.c

Log Message:
Add a new, more aggressive allocator for uvm_pglistalloc() to allocate
contiguous physical pages, and try this new allocator if the existing
one fails.  The existing contig allocator only tries to allocate pages
that are already free, which works fine shortly after boot but rarely
works after the system has been up for a while.  The new allocator uses
the pagedaemon to evict pages from memory in the hope that this will
free up a range of pages that satisfies the constraits of the request.
This should help with things like plugging in a USB device, which often
fails for some USB controllers because they can't get contigous memory.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/uvm/uvm_init.c
cvs rdiff -u -r1.106 -r1.107 src/sys/uvm/uvm_page.h
cvs rdiff -u -r1.85 -r1.86 src/sys/uvm/uvm_pglist.c
cvs rdiff -u -r1.199 -r1.200 src/sys/uvm/uvm_swap.c

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

Modified files:

Index: src/sys/uvm/uvm_init.c
diff -u src/sys/uvm/uvm_init.c:1.53 src/sys/uvm/uvm_init.c:1.54
--- src/sys/uvm/uvm_init.c:1.53	Fri Mar  6 20:46:12 2020
+++ src/sys/uvm/uvm_init.c	Wed Oct  7 17:51:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_init.c,v 1.53 2020/03/06 20:46:12 ad Exp $	*/
+/*	$NetBSD: uvm_init.c,v 1.54 2020/10/07 17:51:50 chs Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_init.c,v 1.53 2020/03/06 20:46:12 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_init.c,v 1.54 2020/10/07 17:51:50 chs Exp $");
 
 #include 
 #include 
@@ -107,6 +107,7 @@ uvm_init(void)
 	 */
 
 	uvm_page_init(_start, _end);
+	uvm_pglistalloc_init();
 
 	/*
 	 * Init the map sub-system.

Index: src/sys/uvm/uvm_page.h
diff -u src/sys/uvm/uvm_page.h:1.106 src/sys/uvm/uvm_page.h:1.107
--- src/sys/uvm/uvm_page.h:1.106	Sun Sep 20 10:30:05 2020
+++ src/sys/uvm/uvm_page.h	Wed Oct  7 17:51:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.h,v 1.106 2020/09/20 10:30:05 skrll Exp $	*/
+/*	$NetBSD: uvm_page.h,v 1.107 2020/10/07 17:51:50 chs Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -259,6 +259,7 @@ struct vm_page {
 #define	PG_FREE		0x4000	/* page is on free list */
 #define	PG_MARKER	0x8000	/* dummy marker page */
 #define	PG_PAGER1	0x0001	/* pager-specific flag */
+#define	PG_PGLCA	0x0002	/* allocated by uvm_pglistalloc_contig */
 
 #define	PG_STAT		(PG_ANON|PG_AOBJ|PG_FILE)
 #define	PG_SWAPBACKED	(PG_ANON|PG_AOBJ)
@@ -268,7 +269,7 @@ struct vm_page {
 	"\5PAGEOUT\6RELEASED\7FAKE\10RDONLY" \
 	"\11ZERO\12TABLED\13AOBJ\14ANON" \
 	"\15FILE\16READAHEAD\17FREE\20MARKER" \
-	"\21PAGER1"
+	"\21PAGER1\22PGLCA"
 
 /*
  * Flags stored in pg->pqflags, which is protected by pg->interlock.
@@ -330,6 +331,7 @@ struct vm_page {
  */
 
 void uvm_page_init(vaddr_t *, vaddr_t *);
+void uvm_pglistalloc_init(void);
 #if defined(UVM_PAGE_TRKOWN)
 void uvm_page_own(struct vm_page *, const char *);
 #endif

Index: src/sys/uvm/uvm_pglist.c
diff -u src/sys/uvm/uvm_pglist.c:1.85 src/sys/uvm/uvm_pglist.c:1.86
--- src/sys/uvm/uvm_pglist.c:1.85	Sun Jun 14 21:41:42 2020
+++ src/sys/uvm/uvm_pglist.c	Wed Oct  7 17:51:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pglist.c,v 1.85 2020/06/14 21:41:42 ad Exp $	*/
+/*	$NetBSD: uvm_pglist.c,v 1.86 2020/10/07 17:51:50 chs Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2019 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.85 2020/06/14 21:41:42 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.86 2020/10/07 17:51:50 chs Exp $");
 
 #include 
 #include 
@@ -59,6 +59,8 @@ u_long	uvm_pglistalloc_npages;
 #define	STAT_DECR(v)
 #endif
 
+kmutex_t uvm_pglistalloc_contig_lock;
+
 /*
  * uvm_pglistalloc: allocate a list of pages
  *
@@ -293,13 +295,161 @@ uvm_pglistalloc_c_ps(uvm_physseg_t psi, 
 }
 
 static int
+uvm_pglistalloc_contig_aggressive(int num, paddr_t low, paddr_t high,
+paddr_t alignment, paddr_t boundary, struct pglist *rlist)
+{
+	struct vm_page *pg;
+	struct pglist tmp;
+	paddr_t pa, off, spa, amask, bmask, rlo, rhi;
+	uvm_physseg_t upm;
+	int error, i, run, acnt;
+
+	/*
+	 * Allocate pages the normal way and for each new page, check if
+	 * the page completes a range satisfying the request.
+	 * The pagedaemon will evict pages as we go and we are very likely
+	 * to get compatible pages eventually.
+	 */
+
+	error = ENOMEM;
+	TAILQ_INIT();
+	acnt = atop(alignment);
+	amask = ~(alignment - 1);
+	bmask = ~(boundary - 1);
+	KASSERT(bmask <= amask);
+	mutex_enter(_pglistalloc_contig_lock);
+	while (uvm_reclaimable()) {
+		pg = uvm_pagealloc(NULL, 0, NULL, 0);
+		if (pg == NULL) {
+			uvm_wait("pglac2");
+			continue;
+		}
+		

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

2020-10-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Oct  7 16:03:10 UTC 2020

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

Log Message:
Only touch PMC registers if Performance Monitor Extensions are present.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/aarch64/aarch64/cpu.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/cpu.c
diff -u src/sys/arch/aarch64/aarch64/cpu.c:1.54 src/sys/arch/aarch64/aarch64/cpu.c:1.55
--- src/sys/arch/aarch64/aarch64/cpu.c:1.54	Sat Jul 25 22:51:57 2020
+++ src/sys/arch/aarch64/aarch64/cpu.c	Wed Oct  7 16:03:10 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.54 2020/07/25 22:51:57 riastradh Exp $ */
+/* $NetBSD: cpu.c,v 1.55 2020/10/07 16:03:10 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.54 2020/07/25 22:51:57 riastradh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.55 2020/10/07 16:03:10 jmcneill Exp $");
 
 #include "locators.h"
 #include "opt_arm_debug.h"
@@ -472,6 +472,13 @@ cpu_identify2(device_t self, struct cpu_
 static void
 cpu_init_counter(struct cpu_info *ci)
 {
+	const uint64_t dfr0 = reg_id_aa64dfr0_el1_read();
+	const u_int pmuver = __SHIFTOUT(dfr0, ID_AA64DFR0_EL1_PMUVER);
+	if (pmuver == ID_AA64DFR0_EL1_PMUVER_NONE) {
+		/* Performance Monitors Extension not implemented. */
+		return;
+	}
+
 	reg_pmcr_el0_write(PMCR_E | PMCR_C);
 	reg_pmcntenset_el0_write(PMCNTEN_C);
 



CVS commit: src/sys/arch/alpha/alpha

2020-10-07 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Oct  7 14:07:42 UTC 2020

Modified Files:
src/sys/arch/alpha/alpha: qemu.c

Log Message:
- qemu_hardclock(): fix check for spurious hardclock call.
- qemu_clock_init(): Initialize qemu_nsec_per_tick *after* adjusting hz.
  Error pointed out by Jonathan Kollasch.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/alpha/alpha/qemu.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/alpha/alpha/qemu.c
diff -u src/sys/arch/alpha/alpha/qemu.c:1.3 src/sys/arch/alpha/alpha/qemu.c:1.4
--- src/sys/arch/alpha/alpha/qemu.c:1.3	Sat Oct  3 17:32:49 2020
+++ src/sys/arch/alpha/alpha/qemu.c	Wed Oct  7 14:07:42 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: qemu.c,v 1.3 2020/10/03 17:32:49 thorpej Exp $ */
+/* $NetBSD: qemu.c,v 1.4 2020/10/07 14:07:42 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -121,7 +121,7 @@ qemu_set_alarm_relative(unsigned long ns
 static void
 qemu_hardclock(struct clockframe * const framep)
 {
-	if (__predict_false(qemu_nsec_per_tick == 0)) {
+	if (__predict_false(qemu_nsec_per_tick == (unsigned long)-1)) {
 		/* Spurious; qemu_clock_init() hasn't been called yet. */
 		return;
 	}
@@ -138,7 +138,6 @@ qemu_clock_init(void * const v __unused)
 	/* First-time initialization... */
 	if (qemu_nsec_per_tick == (unsigned long)-1) {
 		KASSERT(CPU_IS_PRIMARY(curcpu()));
-		qemu_nsec_per_tick = 10UL / hz;
 
 		/*
 		 * Override the clockintr routine; the Qemu alarm is
@@ -157,6 +156,8 @@ qemu_clock_init(void * const v __unused)
 		tickadj = (24 / (60 * hz)) ? (24 / (60 * hz)) : 1;
 		schedhz = 0;
 
+		qemu_nsec_per_tick = 10UL / hz;
+
 		printf("Using the Qemu CPU alarm for %d Hz hardclock.\n", hz);
 	}
 



CVS commit: src

2020-10-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Oct  7 07:35:28 UTC 2020

Modified Files:
src/doc: HACKS
src/external/bsd/jemalloc/lib: Makefile.inc

Log Message:
PR port-alpha/54307

GCC 9.3 seems to be able to compile rtree.c with -O2:

- No new regressions in ATF.
- System survives over a night, at least, under heavy loads.

On the other hand, unfortunately, GCC 9.3 still miscompiles tcache.c
with -O2 or -O1. For example, even ``gcc -g hello.c'' fails with ICE
if tcache.c is compiled with -O[12] in libc.


To generate a diff of this commit:
cvs rdiff -u -r1.212 -r1.213 src/doc/HACKS
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/jemalloc/lib/Makefile.inc

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

Modified files:

Index: src/doc/HACKS
diff -u src/doc/HACKS:1.212 src/doc/HACKS:1.213
--- src/doc/HACKS:1.212	Mon Oct  5 13:32:31 2020
+++ src/doc/HACKS	Wed Oct  7 07:35:28 2020
@@ -1,4 +1,4 @@
-# $NetBSD: HACKS,v 1.212 2020/10/05 13:32:31 rin Exp $
+# $NetBSD: HACKS,v 1.213 2020/10/07 07:35:28 rin Exp $
 #
 # This file is intended to document workarounds for currently unsolved
 # (mostly) compiler bugs.
@@ -951,12 +951,14 @@ descr	Disable optimization for rtld.c on
 kcah
 
 port	alpha
-hack	GCC 7.4/8.3: userland binaries crash randomly (port-alpha/54307)
+hack	GCC 7.4/8.3/9.3: userland binaries crash randomly (port-alpha/54307)
 cdate	Fri Nov  1 20:43:35 UTC 2019
+mdate	Wed Oct  7 16:00:00 JST 2020
 who	rin
 file	src/external/bsd/jemalloc/lib/Makefile.inc: 1.11
-descr	rtree.c and tcache.c need to be compiled with -O0, alternatively,
-	you can compile whole jemalloc with -DJEMALLOC_DEBUG.
+descr	GCC miscompiles rtree.c (for 7.4 and 8.3) and tcache.c (for 7.4, 8.3,
+	and 9.3) with optimization levels -O[12]. Compile these files with -O0,
+	alternatively, compile whole jemalloc with -DJEMALLOC_DEBUG.
 kcah
 
 port	powerpc

Index: src/external/bsd/jemalloc/lib/Makefile.inc
diff -u src/external/bsd/jemalloc/lib/Makefile.inc:1.11 src/external/bsd/jemalloc/lib/Makefile.inc:1.12
--- src/external/bsd/jemalloc/lib/Makefile.inc:1.11	Fri Nov  1 20:53:10 2019
+++ src/external/bsd/jemalloc/lib/Makefile.inc	Wed Oct  7 07:35:28 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.11 2019/11/01 20:53:10 rin Exp $
+#	$NetBSD: Makefile.inc,v 1.12 2020/10/07 07:35:28 rin Exp $
 
 JEMALLOC:=${.PARSEDIR}/..
 
@@ -51,11 +51,11 @@ COPTS.ctl.c+=-Wno-error=stack-protector
 COPTS.stats.c+=-Wno-error=stack-protector
 COPTS.tcache.c+=-Wno-error=stack-protector
 
-.if ${MACHINE} == "alpha"
+.if ${MACHINE} == "alpha" && ${ACTIVE_CC} == "gcc"
 # These files need to be compiled with -O0, or build everything with
 # -DJEMALLOC_DEBUG. Otherwise, userland binaries crash randomly, as
 # reported in port-alpha/54307.
-COPTS.rtree.c+=-O0
+COPTS.rtree.c+=	${${HAVE_GCC:U0} < 9:? -O0 :}
 COPTS.tcache.c+=-O0
 .endif
 



CVS commit: src/common/lib/libc/arch/aarch64/atomic

2020-10-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Oct  7 07:34:30 UTC 2020

Modified Files:
src/common/lib/libc/arch/aarch64/atomic: atomic_op_asm.h

Log Message:
Comment nit


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/common/lib/libc/arch/aarch64/atomic/atomic_op_asm.h

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

Modified files:

Index: src/common/lib/libc/arch/aarch64/atomic/atomic_op_asm.h
diff -u src/common/lib/libc/arch/aarch64/atomic/atomic_op_asm.h:1.3 src/common/lib/libc/arch/aarch64/atomic/atomic_op_asm.h:1.4
--- src/common/lib/libc/arch/aarch64/atomic/atomic_op_asm.h:1.3	Fri Feb  8 06:56:56 2019
+++ src/common/lib/libc/arch/aarch64/atomic/atomic_op_asm.h	Wed Oct  7 07:34:29 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_op_asm.h,v 1.3 2019/02/08 06:56:56 ryo Exp $ */
+/* $NetBSD: atomic_op_asm.h,v 1.4 2020/10/07 07:34:29 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@ END(_atomic_##OP##_8)
 
 #define	ATOMIC_OP8_NV(OP, INSN)		\
 ENTRY_NP(_atomic_##OP##_8_nv)		;\
-	mov	x4, x0			/* need r0 for return value */	;\
+	mov	x4, x0			/* need x0 for return value */	;\
 1:	ldxrb	w0, [x4]		/* load old value */		;\
 	INSN	w0, w0, w1		/* calc new (return) value */	;\
 	stxrb	w3, w0, [x4]		/* try to store */		;\
@@ -69,7 +69,7 @@ END(_atomic_##OP##_16)
 
 #define	ATOMIC_OP16_NV(OP, INSN)	\
 ENTRY_NP(_atomic_##OP##_16_nv)		;\
-	mov	x4, x0			/* need r0 for return value */	;\
+	mov	x4, x0			/* need x0 for return value */	;\
 1:	ldxrh	w0, [x4]		/* load old value */		;\
 	INSN	w0, w0, w1		/* calc new (return) value */	;\
 	stxrh	w3, w0, [x4]		/* try to store */		;\
@@ -91,7 +91,7 @@ END(_atomic_##OP##_32)
 
 #define	ATOMIC_OP32_NV(OP, INSN)	\
 ENTRY_NP(_atomic_##OP##_32_nv)		;\
-	mov	x4, x0			/* need r0 for return value */	;\
+	mov	x4, x0			/* need x0 for return value */	;\
 1:	ldxr	w0, [x4]		/* load old value */		;\
 	INSN	w0, w0, w1		/* calc new (return) value */	;\
 	stxr	w3, w0, [x4]		/* try to store */		;\
@@ -113,7 +113,7 @@ END(_atomic_##OP##_64)
 
 #define	ATOMIC_OP64_NV(OP, INSN)	\
 ENTRY_NP(_atomic_##OP##_64_nv)		;\
-	mov	x4, x0			/* need r0 for return value */	;\
+	mov	x4, x0			/* need x0 for return value */	;\
 1:	ldxr	x0, [x4]		/* load old value */		;\
 	INSN	x0, x0, x1		/* calc new (return) value */	;\
 	stxr	w3, x0, [x4]		/* try to store */		;\



CVS commit: src/common/lib/libc/arch/aarch64/atomic

2020-10-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Oct  7 07:31:47 UTC 2020

Modified Files:
src/common/lib/libc/arch/aarch64/atomic: atomic_cas_16.S
atomic_cas_32.S atomic_cas_64.S atomic_cas_8.S

Log Message:
Comment nit


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/common/lib/libc/arch/aarch64/atomic/atomic_cas_16.S \
src/common/lib/libc/arch/aarch64/atomic/atomic_cas_32.S \
src/common/lib/libc/arch/aarch64/atomic/atomic_cas_8.S
cvs rdiff -u -r1.4 -r1.5 \
src/common/lib/libc/arch/aarch64/atomic/atomic_cas_64.S

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

Modified files:

Index: src/common/lib/libc/arch/aarch64/atomic/atomic_cas_16.S
diff -u src/common/lib/libc/arch/aarch64/atomic/atomic_cas_16.S:1.2 src/common/lib/libc/arch/aarch64/atomic/atomic_cas_16.S:1.3
--- src/common/lib/libc/arch/aarch64/atomic/atomic_cas_16.S:1.2	Wed Aug 12 12:59:57 2020
+++ src/common/lib/libc/arch/aarch64/atomic/atomic_cas_16.S	Wed Oct  7 07:31:47 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_cas_16.S,v 1.2 2020/08/12 12:59:57 skrll Exp $ */
+/* $NetBSD: atomic_cas_16.S,v 1.3 2020/10/07 07:31:47 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "atomic_op_asm.h"
 
 ENTRY_NP(_atomic_cas_16)
-	mov	x4, x0			/* we need r0 for return value */
+	mov	x4, x0			/* we need x0 for return value */
 1:	ldxrh	w0, [x4]		/* load old value */
 	cmp	w0, w1			/*   compare? */
 	b.ne	2f
Index: src/common/lib/libc/arch/aarch64/atomic/atomic_cas_32.S
diff -u src/common/lib/libc/arch/aarch64/atomic/atomic_cas_32.S:1.2 src/common/lib/libc/arch/aarch64/atomic/atomic_cas_32.S:1.3
--- src/common/lib/libc/arch/aarch64/atomic/atomic_cas_32.S:1.2	Wed Aug 12 12:59:57 2020
+++ src/common/lib/libc/arch/aarch64/atomic/atomic_cas_32.S	Wed Oct  7 07:31:47 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_cas_32.S,v 1.2 2020/08/12 12:59:57 skrll Exp $ */
+/* $NetBSD: atomic_cas_32.S,v 1.3 2020/10/07 07:31:47 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "atomic_op_asm.h"
 
 ENTRY_NP(_atomic_cas_32)
-	mov	x4, x0			/* we need r0 for return value */
+	mov	x4, x0			/* we need x0 for return value */
 1:	ldxr	w0, [x4]		/* load old value */
 	cmp	w0, w1			/*   compare? */
 	b.ne	2f			/* return if different */
Index: src/common/lib/libc/arch/aarch64/atomic/atomic_cas_8.S
diff -u src/common/lib/libc/arch/aarch64/atomic/atomic_cas_8.S:1.2 src/common/lib/libc/arch/aarch64/atomic/atomic_cas_8.S:1.3
--- src/common/lib/libc/arch/aarch64/atomic/atomic_cas_8.S:1.2	Wed Aug 12 12:59:57 2020
+++ src/common/lib/libc/arch/aarch64/atomic/atomic_cas_8.S	Wed Oct  7 07:31:47 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_cas_8.S,v 1.2 2020/08/12 12:59:57 skrll Exp $ */
+/* $NetBSD: atomic_cas_8.S,v 1.3 2020/10/07 07:31:47 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "atomic_op_asm.h"
 
 ENTRY_NP(_atomic_cas_8)
-	mov	x4, x0			/* we need r0 for return value */
+	mov	x4, x0			/* we need x0 for return value */
 1:	ldxrb	w0, [x4]		/* load old value */
 	cmp	w0, w1			/*   compare? */
 	b.ne	2f

Index: src/common/lib/libc/arch/aarch64/atomic/atomic_cas_64.S
diff -u src/common/lib/libc/arch/aarch64/atomic/atomic_cas_64.S:1.4 src/common/lib/libc/arch/aarch64/atomic/atomic_cas_64.S:1.5
--- src/common/lib/libc/arch/aarch64/atomic/atomic_cas_64.S:1.4	Wed Aug 12 12:59:57 2020
+++ src/common/lib/libc/arch/aarch64/atomic/atomic_cas_64.S	Wed Oct  7 07:31:47 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_cas_64.S,v 1.4 2020/08/12 12:59:57 skrll Exp $ */
+/* $NetBSD: atomic_cas_64.S,v 1.5 2020/10/07 07:31:47 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "atomic_op_asm.h"
 
 ENTRY_NP(_atomic_cas_64)
-	mov	x4, x0			/* we need r0 for return value */
+	mov	x4, x0			/* we need x0 for return value */
 1:	ldxr	x0, [x4]		/* load old value */
 	cmp	x0, x1			/*   compare? */
 	b.ne	2f			/* return if different */