CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: knakahara Date: Fri Feb 19 05:34:37 UTC 2021 Modified Files: src/sys/arch/x86/x86: intr.c Log Message: Fix x86's pci_intr_disestablish clean up routine. Pointed out by t-kusaba@IIJ, thanks. Fix panic on x86 by the following code. sc_ih = pci_intr_establish_xname(sc_pc, ...); pci_intr_disestablish(sc_pc, sc_ih); sc_ih = pci_intr_establish(sc_pc, ...); ena(4) do such processing when ifconfig down/up. XXX pullup-8,9 To generate a diff of this commit: cvs rdiff -u -r1.153 -r1.154 src/sys/arch/x86/x86/intr.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/x86/intr.c diff -u src/sys/arch/x86/x86/intr.c:1.153 src/sys/arch/x86/x86/intr.c:1.154 --- src/sys/arch/x86/x86/intr.c:1.153 Wed Nov 18 16:36:43 2020 +++ src/sys/arch/x86/x86/intr.c Fri Feb 19 05:34:37 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.153 2020/11/18 16:36:43 bouyer Exp $ */ +/* $NetBSD: intr.c,v 1.154 2021/02/19 05:34:37 knakahara Exp $ */ /* * Copyright (c) 2007, 2008, 2009, 2019 The NetBSD Foundation, Inc. @@ -133,7 +133,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.153 2020/11/18 16:36:43 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.154 2021/02/19 05:34:37 knakahara Exp $"); #include "opt_intrdebug.h" #include "opt_multiprocessor.h" @@ -636,6 +636,9 @@ intr_source_free(struct cpu_info *ci, in ci->ci_isources[slot] = NULL; if (pic != _pic) idt_vec_free(iv, idtvec); + + isp->is_recurse = NULL; + isp->is_resume = NULL; } #ifdef MULTIPROCESSOR @@ -1136,12 +1139,12 @@ intr_disestablish_xcall(void *arg1, void else if (source->is_mask_count == 0) (*pic->pic_hwunmask)(pic, ih->ih_pin); - /* Re-enable interrupts. */ - x86_write_psl(psl); - /* If the source is free we can drop it now. */ intr_source_free(ci, ih->ih_slot, pic, idtvec); + /* Re-enable interrupts. */ + x86_write_psl(psl); + DPRINTF(("%s: remove slot %d (pic %s pin %d vec %d)\n", device_xname(ci->ci_dev), ih->ih_slot, pic->pic_name, ih->ih_pin, idtvec));
CVS commit: src/sys/arch/powerpc/oea
Module Name:src Committed By: thorpej Date: Fri Feb 19 05:23:53 UTC 2021 Modified Files: src/sys/arch/powerpc/oea: ofw_consinit.c Log Message: Revert unintended change. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/arch/powerpc/oea/ofw_consinit.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/powerpc/oea/ofw_consinit.c diff -u src/sys/arch/powerpc/oea/ofw_consinit.c:1.20 src/sys/arch/powerpc/oea/ofw_consinit.c:1.21 --- src/sys/arch/powerpc/oea/ofw_consinit.c:1.20 Fri Feb 19 05:21:39 2021 +++ src/sys/arch/powerpc/oea/ofw_consinit.c Fri Feb 19 05:23:53 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_consinit.c,v 1.20 2021/02/19 05:21:39 thorpej Exp $ */ +/* $NetBSD: ofw_consinit.c,v 1.21 2021/02/19 05:23:53 thorpej Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofw_consinit.c,v 1.20 2021/02/19 05:21:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofw_consinit.c,v 1.21 2021/02/19 05:23:53 thorpej Exp $"); #include "adb.h" #include "adbkbd.h" @@ -124,7 +124,7 @@ cninit(void) OFPRINTF("console node: %08x\n", console_node); - if (console_node <= 0) + if (console_node == -1) goto nocons; memset(name, 0, sizeof(name));
CVS commit: src/sys/arch/powerpc
Module Name:src Committed By: thorpej Date: Fri Feb 19 05:21:39 UTC 2021 Modified Files: src/sys/arch/powerpc/include: ofw_machdep.h src/sys/arch/powerpc/oea: ofw_consinit.c ofwoea_machdep.c src/sys/arch/powerpc/powerpc: ofw_machdep.c Log Message: Shuffle around a couple of things that aren't particularly OEA-specific: - Early bootstrap console initialization moves to ofw_machdep.c, and is called a bit earlier, from ofw_bootstrap(). - Decoding the "translations" property from /chosen/mmu is specified in the general OpenFirmware PowerPC bindings, and is not specific to any particular PowerPC flavor. It's now decoded a bit earlier in ofw_bootstrap(). The *interpretation* of the mode field of a translation is, however, implementation-specific, so that remains in ofwoea_machdep.c. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/powerpc/include/ofw_machdep.h cvs rdiff -u -r1.19 -r1.20 src/sys/arch/powerpc/oea/ofw_consinit.c cvs rdiff -u -r1.51 -r1.52 src/sys/arch/powerpc/oea/ofwoea_machdep.c cvs rdiff -u -r1.27 -r1.28 src/sys/arch/powerpc/powerpc/ofw_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/powerpc/include/ofw_machdep.h diff -u src/sys/arch/powerpc/include/ofw_machdep.h:1.1 src/sys/arch/powerpc/include/ofw_machdep.h:1.2 --- src/sys/arch/powerpc/include/ofw_machdep.h:1.1 Thu Feb 18 18:31:22 2021 +++ src/sys/arch/powerpc/include/ofw_machdep.h Fri Feb 19 05:21:39 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_machdep.h,v 1.1 2021/02/18 18:31:22 thorpej Exp $ */ +/* $NetBSD: ofw_machdep.h,v 1.2 2021/02/19 05:21:39 thorpej Exp $ */ /*- * Copyright (c) 2021 The NetBSD Foundation, Inc. @@ -32,6 +32,31 @@ #ifdef _KERNEL #include +/* + * The general format of an OpenFirmware virtual translation record is: + * + * cell(s) virt + * cell(s) size + * cell(s) phys + * cell mode + * + * "mode" contains PTE WIMG bits. + * + * We define this structure to describe these translations that's independent + * of the number of cells each field consumes. + */ +struct OF_translation { + vaddr_t virt; + vsize_t size; + paddr_t phys; + uint32_t mode; +}; + +#define OFW_MAX_TRANSLATIONS 32 + +extern int ofw_chosen; /* cached handle for "/chosen" */ +extern struct OF_translation ofw_translations[OFW_MAX_TRANSLATIONS]; + void ofw_bootstrap(void); #endif /* _KERNEL */ Index: src/sys/arch/powerpc/oea/ofw_consinit.c diff -u src/sys/arch/powerpc/oea/ofw_consinit.c:1.19 src/sys/arch/powerpc/oea/ofw_consinit.c:1.20 --- src/sys/arch/powerpc/oea/ofw_consinit.c:1.19 Mon Jul 6 09:34:17 2020 +++ src/sys/arch/powerpc/oea/ofw_consinit.c Fri Feb 19 05:21:39 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_consinit.c,v 1.19 2020/07/06 09:34:17 rin Exp $ */ +/* $NetBSD: ofw_consinit.c,v 1.20 2021/02/19 05:21:39 thorpej Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofw_consinit.c,v 1.19 2020/07/06 09:34:17 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofw_consinit.c,v 1.20 2021/02/19 05:21:39 thorpej Exp $"); #include "adb.h" #include "adbkbd.h" @@ -54,6 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: ofw_consinit #include #include +#include #include #include @@ -88,26 +89,14 @@ extern struct consdev consdev_zs; #include #endif -int console_node = 0, console_instance = 0; +extern int console_node, console_instance; -int chosen, stdin, stdout; int ofkbd_ihandle; static void cninit_kd(void); -static void ofwoea_bootstrap_console(void); -static int ofwbootcons_cngetc(dev_t); -static void ofwbootcons_cnputc(dev_t, int); /*#define OFDEBUG*/ -struct consdev consdev_ofwbootcons = { - NULL, NULL, - ofwbootcons_cngetc, - ofwbootcons_cnputc, - nullcnpollc, - NULL, NULL, NULL, NODEV, CN_INTERNAL, -}; - #ifdef OFDEBUG void ofprint(const char *, ...); @@ -133,11 +122,9 @@ cninit(void) { char name[32]; - ofwoea_bootstrap_console(); - OFPRINTF("console node: %08x\n", console_node); - if (console_node == -1) + if (console_node <= 0) goto nocons; memset(name, 0, sizeof(name)); @@ -171,9 +158,7 @@ cninit(void) return; #endif /* NZTTY */ - /* fallback to OFW boot console */ - cp = _ofwbootcons; - cn_tab = cp; + /* fallback to OFW boot console (already set) */ return; } else @@ -207,7 +192,7 @@ cninit_kd(void) /* * We must determine which keyboard type we have. */ - if (OF_getprop(chosen, "stdin", , sizeof(kstdin)) + if (OF_getprop(ofw_chosen, "stdin", , sizeof(kstdin)) != sizeof(kstdin)) { printf("WARNING: no `stdin' property in /chosen\n"); return; @@ -324,7 +309,7 @@ cninit_kd(void) */ #if NUKBD > 0 - if (OF_call_method("`usb-kbd-ihandles", stdin, 0, 1, ) >= 0 && + if (OF_call_method("`usb-kbd-ihandles", kstdin, 0, 1, ) >= 0 && ukbds != NULL && ukbds->ihandle != 0 &&
CVS commit: src/external/gpl3/binutils/dist/ld/emulparams
Module Name:src Committed By: simonb Date: Fri Feb 19 03:42:02 UTC 2021 Modified Files: src/external/gpl3/binutils/dist/ld/emulparams: elf32bmip.sh elf32bmipn32-defs.sh Log Message: Provide an __eprol symbol in TEXT_START_SYMBOLS. MIPS overrides TEXT_START_SYMBOLS so it misses out on the default definition of this that does provide an __eprol symbol. Fixes linking of profiled binaries. OK: christos@ To generate a diff of this commit: cvs rdiff -u -r1.1.1.5 -r1.2 \ src/external/gpl3/binutils/dist/ld/emulparams/elf32bmip.sh cvs rdiff -u -r1.7 -r1.8 \ src/external/gpl3/binutils/dist/ld/emulparams/elf32bmipn32-defs.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl3/binutils/dist/ld/emulparams/elf32bmip.sh diff -u src/external/gpl3/binutils/dist/ld/emulparams/elf32bmip.sh:1.1.1.5 src/external/gpl3/binutils/dist/ld/emulparams/elf32bmip.sh:1.2 --- src/external/gpl3/binutils/dist/ld/emulparams/elf32bmip.sh:1.1.1.5 Fri Apr 3 23:40:04 2020 +++ src/external/gpl3/binutils/dist/ld/emulparams/elf32bmip.sh Fri Feb 19 03:42:02 2021 @@ -56,7 +56,7 @@ OTHER_SDATA_SECTIONS=" .lit8 ${RELOCATING-0} : { *(.lit8) } .lit4 ${RELOCATING-0} : { *(.lit4) } " -TEXT_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_ftext = .${CREATE_SHLIB+)};" +TEXT_START_SYMBOLS="PROVIDE_HIDDEN (__eprol = .); ${CREATE_SHLIB+PROVIDE (}_ftext = .${CREATE_SHLIB+)}" DATA_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fdata = .${CREATE_SHLIB+)};" OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fbss = .${CREATE_SHLIB+)};" OTHER_SECTIONS=" Index: src/external/gpl3/binutils/dist/ld/emulparams/elf32bmipn32-defs.sh diff -u src/external/gpl3/binutils/dist/ld/emulparams/elf32bmipn32-defs.sh:1.7 src/external/gpl3/binutils/dist/ld/emulparams/elf32bmipn32-defs.sh:1.8 --- src/external/gpl3/binutils/dist/ld/emulparams/elf32bmipn32-defs.sh:1.7 Fri Apr 3 23:48:49 2020 +++ src/external/gpl3/binutils/dist/ld/emulparams/elf32bmipn32-defs.sh Fri Feb 19 03:42:02 2021 @@ -78,7 +78,7 @@ OTHER_SDATA_SECTIONS=" " # Magic symbols. -TEXT_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_ftext = .${CREATE_SHLIB+)};" +TEXT_START_SYMBOLS="PROVIDE_HIDDEN (__eprol = .); ${CREATE_SHLIB+PROVIDE (}_ftext = .${CREATE_SHLIB+)};" DATA_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fdata = .${CREATE_SHLIB+)};" OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fbss = .${CREATE_SHLIB+)};"
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: christos Date: Fri Feb 19 03:28:53 UTC 2021 Modified Files: src/sys/arch/x86/x86: x86_machdep.c Log Message: It is not VirtualBo give some more space. To generate a diff of this commit: cvs rdiff -u -r1.147 -r1.148 src/sys/arch/x86/x86/x86_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/x86/x86/x86_machdep.c diff -u src/sys/arch/x86/x86/x86_machdep.c:1.147 src/sys/arch/x86/x86/x86_machdep.c:1.148 --- src/sys/arch/x86/x86/x86_machdep.c:1.147 Thu Feb 18 21:18:09 2021 +++ src/sys/arch/x86/x86/x86_machdep.c Thu Feb 18 22:28:53 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: x86_machdep.c,v 1.147 2021/02/19 02:18:09 christos Exp $ */ +/* $NetBSD: x86_machdep.c,v 1.148 2021/02/19 03:28:53 christos Exp $ */ /*- * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi, @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.147 2021/02/19 02:18:09 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.148 2021/02/19 03:28:53 christos Exp $"); #include "opt_modular.h" #include "opt_physmem.h" @@ -1329,7 +1329,7 @@ sysctl_machdep_hypervisor(SYSCTLFN_ARGS) { struct sysctlnode node; const char *t = NULL; - char buf[10]; + char buf[64]; node = *rnode; node.sysctl_data = buf;
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: christos Date: Fri Feb 19 02:18:10 UTC 2021 Modified Files: src/sys/arch/x86/x86: x86_machdep.c Log Message: add VirtualBox To generate a diff of this commit: cvs rdiff -u -r1.146 -r1.147 src/sys/arch/x86/x86/x86_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/x86/x86/x86_machdep.c diff -u src/sys/arch/x86/x86/x86_machdep.c:1.146 src/sys/arch/x86/x86/x86_machdep.c:1.147 --- src/sys/arch/x86/x86/x86_machdep.c:1.146 Sun Aug 9 11:32:44 2020 +++ src/sys/arch/x86/x86/x86_machdep.c Thu Feb 18 21:18:09 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: x86_machdep.c,v 1.146 2020/08/09 15:32:44 christos Exp $ */ +/* $NetBSD: x86_machdep.c,v 1.147 2021/02/19 02:18:09 christos Exp $ */ /*- * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi, @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.146 2020/08/09 15:32:44 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.147 2021/02/19 02:18:09 christos Exp $"); #include "opt_modular.h" #include "opt_physmem.h" @@ -1321,6 +1321,7 @@ static const char * const vm_guest_name[ [VM_GUEST_HV] = "Hyper-V", [VM_GUEST_VMWARE] = "VMware", [VM_GUEST_KVM] = "KVM", + [VM_GUEST_VIRTUALBOX] = "VirtualBox", }; static int
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: christos Date: Fri Feb 19 02:15:58 UTC 2021 Modified Files: src/sys/arch/x86/x86: tsc.c Log Message: Penalize TSC on VirtualBox because it is not accurate enough. To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/sys/arch/x86/x86/tsc.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/x86/tsc.c diff -u src/sys/arch/x86/x86/tsc.c:1.53 src/sys/arch/x86/x86/tsc.c:1.54 --- src/sys/arch/x86/x86/tsc.c:1.53 Wed Feb 17 01:33:47 2021 +++ src/sys/arch/x86/x86/tsc.c Thu Feb 18 21:15:58 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: tsc.c,v 1.53 2021/02/17 06:33:47 rillig Exp $ */ +/* $NetBSD: tsc.c,v 1.54 2021/02/19 02:15:58 christos Exp $ */ /*- * Copyright (c) 2008, 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tsc.c,v 1.53 2021/02/17 06:33:47 rillig Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tsc.c,v 1.54 2021/02/19 02:15:58 christos Exp $"); #include #include @@ -224,6 +224,8 @@ tsc_tc_init(void) invariant = false; } else if (vm_guest == VM_GUEST_NO) { delay_func = tsc_delay; + } else if (vm_guest == VM_GUEST_VIRTUALBOX) { + tsc_timecounter.tc_quality = -100; } if (tsc_freq != 0) {
CVS commit: src/sys/arch/x86
Module Name:src Committed By: christos Date: Fri Feb 19 02:15:24 UTC 2021 Modified Files: src/sys/arch/x86/include: cpu.h src/sys/arch/x86/x86: identcpu.c Log Message: Identify VirtualBox as a separate guest type. To generate a diff of this commit: cvs rdiff -u -r1.129 -r1.130 src/sys/arch/x86/include/cpu.h cvs rdiff -u -r1.118 -r1.119 src/sys/arch/x86/x86/identcpu.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/include/cpu.h diff -u src/sys/arch/x86/include/cpu.h:1.129 src/sys/arch/x86/include/cpu.h:1.130 --- src/sys/arch/x86/include/cpu.h:1.129 Sat Aug 8 15:08:48 2020 +++ src/sys/arch/x86/include/cpu.h Thu Feb 18 21:15:24 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.129 2020/08/08 19:08:48 christos Exp $ */ +/* $NetBSD: cpu.h,v 1.130 2021/02/19 02:15:24 christos Exp $ */ /* * Copyright (c) 1990 The Regents of the University of California. @@ -503,6 +503,7 @@ typedef enum vm_guest { VM_GUEST_HV, VM_GUEST_VMWARE, VM_GUEST_KVM, + VM_GUEST_VIRTUALBOX, VM_LAST } vm_guest_t; extern vm_guest_t vm_guest; Index: src/sys/arch/x86/x86/identcpu.c diff -u src/sys/arch/x86/x86/identcpu.c:1.118 src/sys/arch/x86/x86/identcpu.c:1.119 --- src/sys/arch/x86/x86/identcpu.c:1.118 Tue Oct 27 04:57:11 2020 +++ src/sys/arch/x86/x86/identcpu.c Thu Feb 18 21:15:24 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: identcpu.c,v 1.118 2020/10/27 08:57:11 ryo Exp $ */ +/* $NetBSD: identcpu.c,v 1.119 2021/02/19 02:15:24 christos Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.118 2020/10/27 08:57:11 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.119 2021/02/19 02:15:24 christos Exp $"); #include "opt_xen.h" @@ -1104,21 +1104,27 @@ cpu_identify(struct cpu_info *ci) */ vm_guest_t vm_guest = VM_GUEST_NO; -static const char * const vm_bios_vendors[] = { - "QEMU",/* QEMU */ - "Plex86", /* Plex86 */ - "Bochs", /* Bochs */ - "Xen",/* Xen */ - "BHYVE", /* bhyve */ - "Seabios", /* KVM */ +struct vm_name_guest { + const char *name; + vm_guest_t guest; }; -static const char * const vm_system_products[] = { - "VMware Virtual Platform", /* VMWare VM */ - "Virtual Machine", /* Microsoft VirtualPC */ - "VirtualBox", /* Sun xVM VirtualBox */ - "Parallels Virtual Platform", /* Parallels VM */ - "KVM",/* KVM */ +static const struct vm_name_guest vm_bios_vendors[] = { + { "QEMU", VM_GUEST_VM }, /* QEMU */ + { "Plex86", VM_GUEST_VM }, /* Plex86 */ + { "Bochs", VM_GUEST_VM }, /* Bochs */ + { "Xen", VM_GUEST_VM },/* Xen */ + { "BHYVE", VM_GUEST_VM }, /* bhyve */ + { "Seabios", VM_GUEST_VM }, /* KVM */ + { "innotek GmbH", VM_GUEST_VIRTUALBOX }, /* Oracle VirtualBox */ +}; + +static const struct vm_name_guest vm_system_products[] = { + { "VMware Virtual Platform", VM_GUEST_VM }, /* VMWare VM */ + { "Virtual Machine", VM_GUEST_VM }, /* Microsoft VirtualPC */ + { "VirtualBox", VM_GUEST_VIRTUALBOX }, /* Sun xVM VirtualBox */ + { "Parallels Virtual Platform", VM_GUEST_VM }, /* Parallels VM */ + { "KVM", VM_GUEST_VM },/* KVM */ }; void @@ -1129,8 +1135,18 @@ identify_hypervisor(void) const char *p; int i; +#if 0 + /* + * This is called from cpu_probe() and cpu_configure() + * During cpu_probe() we have not called platform_init() + * yet, so the bios tables have not been loaded. + * We allow this to be called twice in order to override + * the cpuid setting because some hypervisors don't return + * specific enough info with cpuid it. + */ if (vm_guest != VM_GUEST_NO) return; +#endif /* * [RFC] CPUID usage for interaction between Hypervisors and Linux. @@ -1162,7 +1178,9 @@ identify_hypervisor(void) /* OpenBSD vmm: "OpenBSDVMM58" */ /* NetBSD nvmm: "___ NVMM ___" */ } - return; + // VirtualBox returns KVM, so keep going. + if (vm_guest != VM_GUEST_KVM) + return; } /* @@ -1181,8 +1199,8 @@ identify_hypervisor(void) p = pmf_get_platform("bios-vendor"); if (p != NULL) { for (i = 0; i < __arraycount(vm_bios_vendors); i++) { - if (strcmp(p, vm_bios_vendors[i]) == 0) { -vm_guest = VM_GUEST_VM; + if (strcmp(p, vm_bios_vendors[i].name) == 0) { +vm_guest = vm_bios_vendors[i].guest; return; } } @@ -1190,8 +1208,8 @@ identify_hypervisor(void) p = pmf_get_platform("system-product"); if (p != NULL) { for (i = 0; i < __arraycount(vm_system_products); i++) { - if (strcmp(p, vm_system_products[i]) == 0) { -vm_guest = VM_GUEST_VM; + if (strcmp(p, vm_system_products[i].name) == 0) { +vm_guest = vm_system_products[i].guest; return; } }
CVS commit: src/sys/arch/mips/include
Module Name:src Committed By: skrll Date: Thu Feb 18 20:37:02 UTC 2021 Modified Files: src/sys/arch/mips/include: profile.h Log Message: Revert previous... somehow the register names aren't available apparently To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/arch/mips/include/profile.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/mips/include/profile.h diff -u src/sys/arch/mips/include/profile.h:1.24 src/sys/arch/mips/include/profile.h:1.25 --- src/sys/arch/mips/include/profile.h:1.24 Wed Feb 17 08:09:22 2021 +++ src/sys/arch/mips/include/profile.h Thu Feb 18 20:37:02 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: profile.h,v 1.24 2021/02/17 08:09:22 skrll Exp $ */ +/* $NetBSD: profile.h,v 1.25 2021/02/18 20:37:02 skrll Exp $ */ /* * Copyright (c) 1992, 1993 @@ -57,7 +57,7 @@ #ifdef _KERNEL # define _PROF_CPLOAD "" #else -# define _PROF_CPLOAD ".cpload t9;" +# define _PROF_CPLOAD ".cpload $25;" #endif
CVS commit: src/sys/arch/powerpc
Module Name:src Committed By: thorpej Date: Thu Feb 18 18:31:22 UTC 2021 Modified Files: src/sys/arch/powerpc/oea: ofw_subr.S src/sys/arch/powerpc/powerpc: ofw_machdep.c Added Files: src/sys/arch/powerpc/include: ofw_machdep.h Log Message: Add an ofw_bootstrap() function, called during early bootstrap from ofwinit() to perform additional early initialization in C code. Use this to get the memory config while we're still running in the OpenFirmware client environment, rather than waiting until we've started fiddling with the system state. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/arch/powerpc/include/ofw_machdep.h cvs rdiff -u -r1.14 -r1.15 src/sys/arch/powerpc/oea/ofw_subr.S cvs rdiff -u -r1.26 -r1.27 src/sys/arch/powerpc/powerpc/ofw_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/powerpc/oea/ofw_subr.S diff -u src/sys/arch/powerpc/oea/ofw_subr.S:1.14 src/sys/arch/powerpc/oea/ofw_subr.S:1.15 --- src/sys/arch/powerpc/oea/ofw_subr.S:1.14 Thu Feb 18 16:29:12 2021 +++ src/sys/arch/powerpc/oea/ofw_subr.S Thu Feb 18 18:31:22 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_subr.S,v 1.14 2021/02/18 16:29:12 thorpej Exp $ */ +/* $NetBSD: ofw_subr.S,v 1.15 2021/02/18 18:31:22 thorpej Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -113,7 +113,13 @@ ENTRY_NOPROFILE(ofwinit) lis %r9,_C_LABEL(OF_buf)@ha stw %r8,_C_LABEL(OF_buf)@l(%r9) - /* XXX Do other stuff in C code. */ + /* + * Call into C code to perform additional early initialization. + */ + lis %r8,_C_LABEL(ofw_bootstrap)@ha + addi %r8,%r8,_C_LABEL(ofw_bootstrap)@l + mtctr %r8 + bctrl /* * Jump off the trampoline for all subsequent calls Index: src/sys/arch/powerpc/powerpc/ofw_machdep.c diff -u src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.26 src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.27 --- src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.26 Wed Jan 27 03:17:24 2021 +++ src/sys/arch/powerpc/powerpc/ofw_machdep.c Thu Feb 18 18:31:22 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_machdep.c,v 1.26 2021/01/27 03:17:24 thorpej Exp $ */ +/* $NetBSD: ofw_machdep.c,v 1.27 2021/02/18 18:31:22 thorpej Exp $ */ /* * Copyright (C) 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.26 2021/01/27 03:17:24 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.27 2021/02/18 18:31:22 thorpej Exp $"); #include #include @@ -50,6 +50,8 @@ __KERNEL_RCSID(0, "$NetBSD: ofw_machdep. #include #include +#include + #ifdef DEBUG #define DPRINTF aprint_error #else @@ -59,15 +61,8 @@ __KERNEL_RCSID(0, "$NetBSD: ofw_machdep. #define OFMEM_REGIONS 32 static struct mem_region OFmem[OFMEM_REGIONS + 1], OFavail[OFMEM_REGIONS + 3]; -/* - * This is called during initppc, before the system is really initialized. - * It shall provide the total and the available regions of RAM. - * Both lists must have a zero-size entry as terminator. - * The available regions need not take the kernel into account, but needs - * to provide space for two additional entry beyond the terminating one. - */ -void -mem_regions(struct mem_region **memp, struct mem_region **availp) +static void +ofw_bootstrap_get_memory(void) { const char *macrisc[] = {"MacRISC", "MacRISC2", "MacRISC4", NULL}; int hroot, hmem, i, cnt, memcnt, regcnt, acells, scells; @@ -225,8 +220,6 @@ mem_regions(struct mem_region **memp, st } } - *memp = OFmem; - *availp = OFavail; return; error: @@ -239,14 +232,40 @@ error: OFavail[0].start = 0x3000; OFavail[0].size = 0x2000 - 0x3000; - *memp = OFmem; - *availp = OFavail; #else panic("no memory?"); #endif return; } +/* + * Called from ofwinit() very early in bootstrap. We are still + * running on the stack provided by OpenFirmware and in the same + * OpenFirmware client environment as the boot loader. Our calls + * to OpenFirmware are direct, and not via the trampoline that + * saves / restores kernel state. + */ +void +ofw_bootstrap(void) +{ + /* Get the system memory configuration. */ + ofw_bootstrap_get_memory(); +} + +/* + * This is called during initppc, before the system is really initialized. + * It shall provide the total and the available regions of RAM. + * Both lists must have a zero-size entry as terminator. + * The available regions need not take the kernel into account, but needs + * to provide space for two additional entry beyond the terminating one. + */ +void +mem_regions(struct mem_region **memp, struct mem_region **availp) +{ + *memp = OFmem; + *availp = OFavail; +} + void ppc_exit(void) { Added files: Index: src/sys/arch/powerpc/include/ofw_machdep.h diff -u /dev/null src/sys/arch/powerpc/include/ofw_machdep.h:1.1 --- /dev/null Thu Feb 18 18:31:22 2021 +++ src/sys/arch/powerpc/include/ofw_machdep.h Thu Feb 18 18:31:22 2021 @@ -0,0 +1,38 @@ +/* $NetBSD:
CVS commit: src/usr.bin/vis
Module Name:src Committed By: christos Date: Thu Feb 18 18:27:24 UTC 2021 Modified Files: src/usr.bin/vis: vis.1 Log Message: Add examples (Fernando Apestegu�a at FreeBSD) To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/usr.bin/vis/vis.1 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/vis/vis.1 diff -u src/usr.bin/vis/vis.1:1.23 src/usr.bin/vis/vis.1:1.24 --- src/usr.bin/vis/vis.1:1.23 Sun May 24 15:42:39 2015 +++ src/usr.bin/vis/vis.1 Thu Feb 18 13:27:24 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: vis.1,v 1.23 2015/05/24 19:42:39 christos Exp $ +.\" $NetBSD: vis.1,v 1.24 2021/02/18 18:27:24 christos Exp $ .\" .\" Copyright (c) 1989, 1991, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)vis.1 8.4 (Berkeley) 4/19/94 .\" -.Dd May 24, 2015 +.Dd February 18, 2021 .Dt VIS 1 .Os .Sh NAME @@ -171,6 +171,25 @@ instead. Specify the locale of the input data. Set to C if the input data locale is unknown. .El +.Sh EXAMPLES +Visualize characters encoding white spaces and tabs: +.Bd -literal -offset indent +$ printf "\\x10\\n\\t\\n" | vis -w -t +\\^P\\012\\011\\012 +.Ed +.Pp +Same as above but using `\\$' for newline followed by an actual newline: +.Bd -literal -offset indent +$ printf "\\x10\\n\\t\\n" | vis -w -t -l +\\^P\\$ +\\011\\$ +.Ed +.Pp +Visualize string using URI encoding: +.Bd -literal -offset indent +$ printf http://www.freebsd.org | vis -h +http%3a%2f%2fwww.freebsd.org +.Ed .Sh SEE ALSO .Xr unvis 1 , .Xr svis 3 ,
CVS commit: src/usr.bin/unzip
Module Name:src Committed By: christos Date: Thu Feb 18 18:06:02 UTC 2021 Modified Files: src/usr.bin/unzip: unzip.c Log Message: Remove the "original line" Fix lint comment To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/usr.bin/unzip/unzip.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/unzip/unzip.c diff -u src/usr.bin/unzip/unzip.c:1.26 src/usr.bin/unzip/unzip.c:1.27 --- src/usr.bin/unzip/unzip.c:1.26 Thu Feb 18 12:58:51 2021 +++ src/usr.bin/unzip/unzip.c Thu Feb 18 13:06:02 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: unzip.c,v 1.26 2021/02/18 17:58:51 christos Exp $ */ +/* $NetBSD: unzip.c,v 1.27 2021/02/18 18:06:02 christos Exp $ */ /*- * Copyright (c) 2009, 2010 Joerg Sonnenberger @@ -37,7 +37,7 @@ */ #include -__RCSID("$NetBSD: unzip.c,v 1.26 2021/02/18 17:58:51 christos Exp $"); +__RCSID("$NetBSD: unzip.c,v 1.27 2021/02/18 18:06:02 christos Exp $"); #ifdef __GLIBC__ #define _GNU_SOURCE @@ -97,7 +97,7 @@ static int tty; int acret = (call);\ if (acret != ARCHIVE_OK) \ errorx("%s", archive_error_string(a)); \ - } while (/*CONSTCONST*/0) + } while (/*CONSTCOND*/0) /* * Indicates that last info() did not end with EOL. This helps error() et @@ -991,7 +991,6 @@ getopts(int argc, char *argv[]) #endif while ((opt = getopt(argc, argv, "aCcd:fjLlnopP:qtuvyx:")) != -1) - while ((opt = getopt(argc, argv, "aCcd:fjLlnopqtuvyx:")) != -1) switch (opt) { case 'a': a_opt = 1;
CVS commit: src/usr.bin/unzip
Module Name:src Committed By: wiz Date: Thu Feb 18 18:02:09 UTC 2021 Modified Files: src/usr.bin/unzip: unzip.1 Log Message: New sentence, new line. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/usr.bin/unzip/unzip.1 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/unzip/unzip.1 diff -u src/usr.bin/unzip/unzip.1:1.13 src/usr.bin/unzip/unzip.1:1.14 --- src/usr.bin/unzip/unzip.1:1.13 Thu Feb 18 17:58:51 2021 +++ src/usr.bin/unzip/unzip.1 Thu Feb 18 18:02:09 2021 @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD: revision 180125$ -.\" $NetBSD: unzip.1,v 1.13 2021/02/18 17:58:51 christos Exp $ +.\" $NetBSD: unzip.1,v 1.14 2021/02/18 18:02:09 wiz Exp $ .\" .Dd February 18, 2021 .Dt UNZIP 1 @@ -84,8 +84,9 @@ The normal output is suppressed as if .Fl q was specified. .It Fl P Ar password -Extract encrypted files using a password. Putting a password on -the command line using this option can be insecure. +Extract encrypted files using a password. +Putting a password on the command line using this option can be +insecure. .It Fl q Quiet: print less information while extracting. .It Fl t
CVS commit: src/usr.bin/unzip
Module Name:src Committed By: christos Date: Thu Feb 18 17:58:51 UTC 2021 Modified Files: src/usr.bin/unzip: unzip.1 unzip.c Log Message: Add support for password protected zip files (Alex Kozlov) Also some KNF To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/usr.bin/unzip/unzip.1 cvs rdiff -u -r1.25 -r1.26 src/usr.bin/unzip/unzip.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/unzip/unzip.1 diff -u src/usr.bin/unzip/unzip.1:1.12 src/usr.bin/unzip/unzip.1:1.13 --- src/usr.bin/unzip/unzip.1:1.12 Thu Feb 18 12:04:39 2021 +++ src/usr.bin/unzip/unzip.1 Thu Feb 18 12:58:51 2021 @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD: revision 180125$ -.\" $NetBSD: unzip.1,v 1.12 2021/02/18 17:04:39 christos Exp $ +.\" $NetBSD: unzip.1,v 1.13 2021/02/18 17:58:51 christos Exp $ .\" .Dd February 18, 2021 .Dt UNZIP 1 @@ -83,6 +83,9 @@ When extracting files from the zipfile, The normal output is suppressed as if .Fl q was specified. +.It Fl P Ar password +Extract encrypted files using a password. Putting a password on +the command line using this option can be insecure. .It Fl q Quiet: print less information while extracting. .It Fl t Index: src/usr.bin/unzip/unzip.c diff -u src/usr.bin/unzip/unzip.c:1.25 src/usr.bin/unzip/unzip.c:1.26 --- src/usr.bin/unzip/unzip.c:1.25 Thu Feb 18 12:05:51 2021 +++ src/usr.bin/unzip/unzip.c Thu Feb 18 12:58:51 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: unzip.c,v 1.25 2021/02/18 17:05:51 christos Exp $ */ +/* $NetBSD: unzip.c,v 1.26 2021/02/18 17:58:51 christos Exp $ */ /*- * Copyright (c) 2009, 2010 Joerg Sonnenberger @@ -37,10 +37,11 @@ */ #include -__RCSID("$NetBSD: unzip.c,v 1.25 2021/02/18 17:05:51 christos Exp $"); +__RCSID("$NetBSD: unzip.c,v 1.26 2021/02/18 17:58:51 christos Exp $"); #ifdef __GLIBC__ #define _GNU_SOURCE +#define explicit_memset memset_s #endif #include @@ -58,6 +59,9 @@ __RCSID("$NetBSD: unzip.c,v 1.25 2021/02 #include #include +#ifdef __GLIBC__ +#include +#endif /* command-line options */ static int a_opt; /* convert EOL */ @@ -71,6 +75,7 @@ static int n_opt; /* never overwrite static int o_opt; /* always overwrite */ static int p_opt; /* extract to stdout, quiet */ static int q_opt; /* quiet */ +static char *P_arg; /* passphrase */ static int t_opt; /* test */ static int u_opt; /* update */ static int v_opt; /* verbose/list */ @@ -92,7 +97,7 @@ static int tty; int acret = (call);\ if (acret != ARCHIVE_OK) \ errorx("%s", archive_error_string(a)); \ - } while (0) + } while (/*CONSTCONST*/0) /* * Indicates that last info() did not end with EOL. This helps error() et @@ -101,6 +106,9 @@ static int tty; */ static int noeol; +/* for an interactive passphrase input */ +static char passbuf[1024]; + /* fatal error message + errno */ __dead __printflike(1, 2) static void error(const char *fmt, ...) @@ -110,12 +118,12 @@ error(const char *fmt, ...) if (noeol) fprintf(stdout, "\n"); fflush(stdout); - fprintf(stderr, "unzip: "); + fprintf(stderr, "%s: ", getprogname()); va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); fprintf(stderr, ": %s\n", strerror(errno)); - exit(1); + exit(EXIT_FAILURE); } /* fatal error message, no errno */ @@ -127,12 +135,12 @@ errorx(const char *fmt, ...) if (noeol) fprintf(stdout, "\n"); fflush(stdout); - fprintf(stderr, "unzip: "); + fprintf(stderr, "%s: ", getprogname()); va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); fprintf(stderr, "\n"); - exit(1); + exit(EXIT_FAILURE); } /* non-fatal error message + errno */ @@ -227,7 +235,7 @@ pathdup(const char *path) } str[len] = '\0'; - return (str); + return str; } /* concatenate two path names */ @@ -249,7 +257,7 @@ pathcat(const char *prefix, const char * } memcpy(str + prelen, path, len); /* includes zero */ - return (str); + return str; } /* @@ -293,9 +301,9 @@ match_pattern(struct pattern_list *list, STAILQ_FOREACH(entry, list, link) { if (fnmatch(entry->pattern, str, C_opt ? FNM_CASEFOLD : 0) == 0) - return (1); + return 1; } - return (0); + return 0; } /* @@ -307,10 +315,10 @@ accept_pathname(const char *pathname) { if (!STAILQ_EMPTY() && !match_pattern(, pathname)) - return (0); + return 0; if (!STAILQ_EMPTY() && match_pattern(, pathname)) - return (0); - return (1); + return 0; + return 1; } /* @@ -853,6 +861,34 @@ test(struct archive *a, struct archive_e } /* + * Callback function for reading passphrase. + * Originally from cpio.c and passphrase.c, libarchive. + */ +static const char * +passphrase_callback(struct archive *a, void *client_data) +{ + char *p; + static const char prompt[] = "\nEnter passphrase:"; + + (void)a; /* UNUSED */ + (void)client_data; /* UNUSED */ + +#if defined(RPP_ECHO_OFF) + p = readpassphrase(prompt,
CVS commit: src/sys/dev/pci
Module Name:src Committed By: ryo Date: Thu Feb 18 17:56:04 UTC 2021 Modified Files: src/sys/dev/pci: if_aq.c Log Message: - use if_initialize() and if_register() instead of if_attach() - add IFEF_MPSAFE to if_extflags pointed out by msaitoh@, thanks To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/if_aq.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_aq.c diff -u src/sys/dev/pci/if_aq.c:1.19 src/sys/dev/pci/if_aq.c:1.20 --- src/sys/dev/pci/if_aq.c:1.19 Thu Sep 24 05:13:03 2020 +++ src/sys/dev/pci/if_aq.c Thu Feb 18 17:56:04 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: if_aq.c,v 1.19 2020/09/24 05:13:03 ryo Exp $ */ +/* $NetBSD: if_aq.c,v 1.20 2021/02/18 17:56:04 ryo Exp $ */ /** * aQuantia Corporation Network Driver @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.19 2020/09/24 05:13:03 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.20 2021/02/18 17:56:04 ryo Exp $"); #ifdef _KERNEL_OPT #include "opt_if_aq.h" @@ -1407,6 +1407,7 @@ aq_attach(device_t parent, device_t self strlcpy(ifp->if_xname, device_xname(self), IFNAMSIZ); ifp->if_softc = sc; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_extflags = IFEF_MPSAFE; ifp->if_baudrate = IF_Gbps(10); ifp->if_init = aq_init; ifp->if_ioctl = aq_ioctl; @@ -1463,11 +1464,18 @@ aq_attach(device_t parent, device_t self /* RX hardware checksum offloadding */ ifp->if_capabilities |= IFCAP_CSUM_IPv4_Rx; - if_attach(ifp); + error = if_initialize(ifp); + if (error != 0) { + aprint_error_dev(sc->sc_dev, "if_initialize failed(%d)\n", + error); + goto attach_failure; + } + ifp->if_percpuq = if_percpuq_create(ifp); if_deferred_start_init(ifp, NULL); ether_ifattach(ifp, sc->sc_enaddr.ether_addr_octet); ether_set_vlan_cb(>sc_ethercom, aq_vlan_cb); ether_set_ifflags_cb(>sc_ethercom, aq_ifflags_cb); + if_register(ifp); aq_enable_intr(sc, true, false); /* only intr about link */
CVS commit: src/usr.bin/unzip
Module Name:src Committed By: christos Date: Thu Feb 18 17:05:52 UTC 2021 Modified Files: src/usr.bin/unzip: unzip.c Log Message: Build with linux/glibc (Alex Kozlov) To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/usr.bin/unzip/unzip.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/unzip/unzip.c diff -u src/usr.bin/unzip/unzip.c:1.24 src/usr.bin/unzip/unzip.c:1.25 --- src/usr.bin/unzip/unzip.c:1.24 Thu Jul 19 14:04:25 2018 +++ src/usr.bin/unzip/unzip.c Thu Feb 18 12:05:51 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: unzip.c,v 1.24 2018/07/19 18:04:25 joerg Exp $ */ +/* $NetBSD: unzip.c,v 1.25 2021/02/18 17:05:51 christos Exp $ */ /*- * Copyright (c) 2009, 2010 Joerg Sonnenberger @@ -37,7 +37,11 @@ */ #include -__RCSID("$NetBSD: unzip.c,v 1.24 2018/07/19 18:04:25 joerg Exp $"); +__RCSID("$NetBSD: unzip.c,v 1.25 2021/02/18 17:05:51 christos Exp $"); + +#ifdef __GLIBC__ +#define _GNU_SOURCE +#endif #include #include @@ -936,7 +940,13 @@ getopts(int argc, char *argv[]) { int opt; - optreset = optind = 1; +#ifdef __GLIBC__ + optind = 0; +#else + optreset = optind = 1; +#endif + + while ((opt = getopt(argc, argv, "aCcd:fjLlnopP:qtuvyx:")) != -1) while ((opt = getopt(argc, argv, "aCcd:fjLlnopqtuvyx:")) != -1) switch (opt) { case 'a':
CVS commit: src/usr.bin/unzip
Module Name:src Committed By: christos Date: Thu Feb 18 17:04:39 UTC 2021 Modified Files: src/usr.bin/unzip: unzip.1 Log Message: mention zipx, from Alex Kozlov To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/usr.bin/unzip/unzip.1 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/unzip/unzip.1 diff -u src/usr.bin/unzip/unzip.1:1.11 src/usr.bin/unzip/unzip.1:1.12 --- src/usr.bin/unzip/unzip.1:1.11 Mon Dec 21 12:17:02 2015 +++ src/usr.bin/unzip/unzip.1 Thu Feb 18 12:04:39 2021 @@ -25,9 +25,9 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD: revision 180125$ -.\" $NetBSD: unzip.1,v 1.11 2015/12/21 17:17:02 christos Exp $ +.\" $NetBSD: unzip.1,v 1.12 2021/02/18 17:04:39 christos Exp $ .\" -.Dd December 21, 2015 +.Dd February 18, 2021 .Dt UNZIP 1 .Os .Sh NAME @@ -160,7 +160,7 @@ utility is only able to process ZIP arch .Xr libarchive 3 . Depending on the installed version of .Xr libarchive 3 , -this may or may not include self-extracting archives. +this may or may not include self-extracting or ZIPX archives. .Sh SEE ALSO .Xr libarchive 3 .Sh HISTORY
CVS commit: src/sys/arch/powerpc/oea
Module Name:src Committed By: thorpej Date: Thu Feb 18 16:29:12 UTC 2021 Modified Files: src/sys/arch/powerpc/oea: ofw_subr.S Log Message: - Tidy up some comments. - Use correct stack frame linkage everywhere so that if something goes wrong, we can get a meaningful back trace. - Use an additional layer of indirection so that, when we're very early in bootstrap, we can just call OpenFirmware directly, rather than using our trampoline that saves/restores kernel state. - Carve out a space for ofwinit() to call into C code to do additional initialization. (This is not done yet.) To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/arch/powerpc/oea/ofw_subr.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/oea/ofw_subr.S diff -u src/sys/arch/powerpc/oea/ofw_subr.S:1.13 src/sys/arch/powerpc/oea/ofw_subr.S:1.14 --- src/sys/arch/powerpc/oea/ofw_subr.S:1.13 Sat Feb 13 01:48:33 2021 +++ src/sys/arch/powerpc/oea/ofw_subr.S Thu Feb 18 16:29:12 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_subr.S,v 1.13 2021/02/13 01:48:33 thorpej Exp $ */ +/* $NetBSD: ofw_subr.S,v 1.14 2021/02/18 16:29:12 thorpej Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -35,25 +35,43 @@ #include "opt_ppcarch.h" #endif - .local firmstk - .globl openfirmware_entry - .globl ofwmsr - .local ofwsrsave - .local OF_buffer - + /* Stack used to call into OpenFirmware. */ .lcomm firmstk,NBPG,16 + + /* Buffer used to pass data to/from OpenFirmware. */ .lcomm OF_buffer,NBPG + 36,4 - .comm openfirmware_entry,4,4 /* openfirmware entry point */ - .lcomm ofwsrsave,64,4 /* openfirmware SR savearea */ - .comm ofwmsr,20,4 /* msr & sprg[0-3] used in OF */ - .comm ofwreal_incharge,4,4 + + /* The OpenFirmware entry point, provided by OpenFirmware. */ + .lcomm ofentry,4,4 + + /* Entry trampoline used by openfirmware(). */ + .lcomm oftramp,4,4 + + /* OpenFirmware SR save area */ + .lcomm ofwsrsave,64,4 + + /* MSR and SPRG[0-3] used in OpenFirmware */ + .globl ofwmsr + .comm ofwmsr,20,4 /* * Called by start to save the initial OFW state so we can restore it * when call back to OFW. + * + * We expect the registers to be as for the entry point into the kernel: + * + * %r1 Stack provided by OpenFirmware / boot loader + * %r5 OpenFirmware client entry point + * + * (others -- don't care) */ ENTRY_NOPROFILE(ofwinit) -#ifdef FIRMWORKSBUGS + /* Save return address, Push a stack frame. */ + mflr %r0 + stw %r0,4(%r1) + stwu %r1,-16(%r1) + +#ifdef FIRMWORKSBUGS mfmsr %r0 andi. %r0,%r0,PSL_IR|PSL_DR beq 1f @@ -62,25 +80,24 @@ ENTRY_NOPROFILE(ofwinit) lis %r9,ofwreal_incharge@ha stw %r8,ofwreal_incharge@l(%r9) - mflr %r30 bl _C_LABEL(ofwr_init) - mtlr %r30 1: #endif - lis %r8,openfirmware_entry@ha - stw %r5,openfirmware_entry@l(%r8) /* save client interface handler*/ + lis %r8,ofentry@ha + stw %r5,ofentry@l(%r8) /* save client interface handler */ + + /* + * Call directly into OpenFirmware until we're ready to use + * the trampoline. + */ + lis %r8,oftramp@ha + stw %r5,oftramp@l(%r8) + + /* Save the MSR that OpenFirmware is using. */ mfmsr %r0 -/* - * XXX - * doing this here instead of later on in ofwoea_initppc() after setting - * up the console and such makes my PowerBook 3400c hang. - * Probably just another OF 2.0 weirdness - */ - /*li %r8,PSL_IP*/ - /*andc %r0,%r0,%r8*/ /* make sure PSL_IP is off */ lis %r9,ofwmsr@ha - stwu %r0,ofwmsr@l(%r9) /* save initial MSR value */ + stwu %r0,ofwmsr@l(%r9) mfsprg0 %r0/* save SPRGs */ stw %r0,4(%r9) @@ -96,28 +113,42 @@ ENTRY_NOPROFILE(ofwinit) lis %r9,_C_LABEL(OF_buf)@ha stw %r8,_C_LABEL(OF_buf)@l(%r9) + /* XXX Do other stuff in C code. */ + + /* + * Jump off the trampoline for all subsequent calls + * into OpenFirmware. + */ + lis %r5,_C_LABEL(openfirmware_trampoline)@ha + addi %r5,%r5,_C_LABEL(openfirmware_trampoline)@l + lis %r8,oftramp@ha + stw %r5,oftramp@l(%r8) + + /* Retrieve LR, pop stack frame. */ + addi %r1,%r1,16 + lwz %r0,4(%r1) + mtlr %r0 + blr /* - * OpenFirmware entry point + * OpenFirmware trampoline. We are already on the OpenFirmware stack. */ - .text -ENTRY(openfirmware) +ENTRY_NOPROFILE(openfirmware_trampoline) mflr %r0 stw %r0,4(%r1) /* save return address */ /* - * Switch to OpenFirmware stack. + * Push stack frame and save area: * - * -48 == -16 to stack old SP and align, -32 for save area + * [SP+8 save area] + * [SP+4 slot for saved LR in callee] + * [SP+0 saved SP] */ - lis %r7,firmstk+NBPG-48@ha - addi %r7,%r7,firmstk+NBPG-48@l - stw %r1,32(%r7) /* stash away prev stack pointer */ - mr %r1,%r7 + stwu %r1,-48(%r1) - lis %r4,openfirmware_entry@ha /* get firmware entry point */ - lwz %r4,openfirmware_entry@l(%r4) + lis %r4,ofentry@ha /* get firmware entry point */ + lwz %r4,ofentry@l(%r4) mtlr %r4 mfsprg0 %r5 /* save current sprg0
CVS commit: src/external/bsd/ntp/dist/ntpd
Module Name:src Committed By: kardel Date: Thu Feb 18 15:13:38 UTC 2021 Modified Files: src/external/bsd/ntp/dist/ntpd: ntp_timer.c Log Message: PR bin/55973: fix routing message triggered one shot interface update. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/external/bsd/ntp/dist/ntpd/ntp_timer.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/bsd/ntp/dist/ntpd/ntp_timer.c diff -u src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.9 src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.10 --- src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.9 Sun Jan 3 15:33:05 2021 +++ src/external/bsd/ntp/dist/ntpd/ntp_timer.c Thu Feb 18 15:13:37 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ntp_timer.c,v 1.9 2021/01/03 15:33:05 roy Exp $ */ +/* $NetBSD: ntp_timer.c,v 1.10 2021/02/18 15:13:37 kardel Exp $ */ /* * ntp_timer.c - event timer support routines @@ -428,6 +428,8 @@ timer(void) if (interface_interval) timer_interfacetimeout(current_time + interface_interval); + else + timer_interfacetimeout(0); DPRINTF(2, ("timer: interface update\n")); interface_update(NULL, NULL); }
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: simonb Date: Thu Feb 18 12:54:03 UTC 2021 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_50.c netbsd32_time.c Log Message: In the compat setitimer(2) calls, don't validate which timer is being used since dosetitimer() does this anyway. The compat functions hadn't been updated since ITIMER_MONOTONIC was introduced, so they reported that that ITIMER_MONOTONIC timer was invalid. To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/sys/compat/netbsd32/netbsd32_compat_50.c cvs rdiff -u -r1.54 -r1.55 src/sys/compat/netbsd32/netbsd32_time.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/compat/netbsd32/netbsd32_compat_50.c diff -u src/sys/compat/netbsd32/netbsd32_compat_50.c:1.50 src/sys/compat/netbsd32/netbsd32_compat_50.c:1.51 --- src/sys/compat/netbsd32/netbsd32_compat_50.c:1.50 Tue Jan 19 03:20:13 2021 +++ src/sys/compat/netbsd32/netbsd32_compat_50.c Thu Feb 18 12:54:03 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_50.c,v 1.50 2021/01/19 03:20:13 simonb Exp $ */ +/* $NetBSD: netbsd32_compat_50.c,v 1.51 2021/02/18 12:54:03 simonb Exp $ */ /*- * Copyright (c) 2008, 2020 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.50 2021/01/19 03:20:13 simonb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.51 2021/02/18 12:54:03 simonb Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -875,8 +875,6 @@ compat_50_netbsd32_setitimer(struct lwp struct itimerval aitv; int error; - if ((u_int)which > ITIMER_PROF) - return EINVAL; itv32 = SCARG_P32(uap, itv); if (itv32) { if ((error = copyin(itv32, , sizeof(s32it Index: src/sys/compat/netbsd32/netbsd32_time.c diff -u src/sys/compat/netbsd32/netbsd32_time.c:1.54 src/sys/compat/netbsd32/netbsd32_time.c:1.55 --- src/sys/compat/netbsd32/netbsd32_time.c:1.54 Tue Jan 19 03:20:13 2021 +++ src/sys/compat/netbsd32/netbsd32_time.c Thu Feb 18 12:54:03 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_time.c,v 1.54 2021/01/19 03:20:13 simonb Exp $ */ +/* $NetBSD: netbsd32_time.c,v 1.55 2021/02/18 12:54:03 simonb Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.54 2021/01/19 03:20:13 simonb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.55 2021/02/18 12:54:03 simonb Exp $"); #if defined(_KERNEL_OPT) #include "opt_ntp.h" @@ -142,8 +142,6 @@ netbsd32___setitimer50(struct lwp *l, co struct itimerval aitv; int error; - if ((u_int)which > ITIMER_PROF) - return EINVAL; itv32 = SCARG_P32(uap, itv); if (itv32) { if ((error = copyin(itv32, , sizeof(s32it
CVS commit: src/sys/arch/mips/include
Module Name:src Committed By: simonb Date: Thu Feb 18 12:28:02 UTC 2021 Modified Files: src/sys/arch/mips/include: asm.h Log Message: Add an abicalls version of asm mcount prologue. XXX not tested because profiled programs fail to link, but fixes build. Thanks dholland@ for help analysing this. While here, rename _KERN_MCOUNT to _MIPS_ASM_MCOUNT - it's not kernel specific. To generate a diff of this commit: cvs rdiff -u -r1.64 -r1.65 src/sys/arch/mips/include/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/sys/arch/mips/include/asm.h diff -u src/sys/arch/mips/include/asm.h:1.64 src/sys/arch/mips/include/asm.h:1.65 --- src/sys/arch/mips/include/asm.h:1.64 Tue Feb 16 06:06:58 2021 +++ src/sys/arch/mips/include/asm.h Thu Feb 18 12:28:01 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: asm.h,v 1.64 2021/02/16 06:06:58 simonb Exp $ */ +/* $NetBSD: asm.h,v 1.65 2021/02/18 12:28:01 simonb Exp $ */ /* * Copyright (c) 1992, 1993 @@ -76,9 +76,9 @@ /* * The old ABI version must also decrement two less words off the * stack and the final addiu to t9 must always equal the size of this - * _KERN_MCOUNT. + * _MIPS_ASM_MCOUNT. */ -#define _KERN_MCOUNT \ +#define _MIPS_ASM_MCOUNT \ .set push; \ .set noreorder; \ .set noat; \ @@ -98,9 +98,25 @@ #else/* New (n32/n64) ABI */ /* * The new ABI version just needs to put the return address in AT and - * call _mcount(). + * call _mcount(). For the no abicalls case, skip the reloc dance. */ -#define _KERN_MCOUNT \ +#ifdef __mips_abicalls +#define _MIPS_ASM_MCOUNT \ + .set push; \ + .set noreorder; \ + .set noat; \ + subu sp,16; \ + sw t9,8(sp); \ + move AT,ra; \ + lui t9,%hi(_mcount); \ + addiu t9,t9,%lo(_mcount);\ + jalr t9; \ + nop; \ + lw t9,8(sp); \ + addiu sp,16; \ + .set pop; +#else /* !__mips_abicalls */ +#define _MIPS_ASM_MCOUNT \ .set push; \ .set noreorder; \ .set noat; \ @@ -108,10 +124,11 @@ jal _mcount; \ nop; \ .set pop; +#endif /* !__mips_abicalls */ #endif /* n32/n64 */ #ifdef GPROF -#define MCOUNT _KERN_MCOUNT +#define MCOUNT _MIPS_ASM_MCOUNT #else #define MCOUNT #endif
CVS commit: src/sys/arch/aarch64/aarch64
Module Name:src Committed By: jmcneill Date: Thu Feb 18 11:23:15 UTC 2021 Modified Files: src/sys/arch/aarch64/aarch64: trap.c Log Message: revert previous; user reports of panics under load To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/sys/arch/aarch64/aarch64/trap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/aarch64/aarch64/trap.c diff -u src/sys/arch/aarch64/aarch64/trap.c:1.42 src/sys/arch/aarch64/aarch64/trap.c:1.43 --- src/sys/arch/aarch64/aarch64/trap.c:1.42 Mon Feb 15 17:46:36 2021 +++ src/sys/arch/aarch64/aarch64/trap.c Thu Feb 18 11:23:15 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.42 2021/02/15 17:46:36 jmcneill Exp $ */ +/* $NetBSD: trap.c,v 1.43 2021/02/18 11:23:15 jmcneill Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.42 2021/02/15 17:46:36 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.43 2021/02/18 11:23:15 jmcneill Exp $"); #include "opt_arm_intr_impl.h" #include "opt_compat_netbsd32.h" @@ -521,10 +521,7 @@ interrupt(struct trapframe *tf) ARM_IRQ_HANDLER(tf); ci->ci_intr_depth--; - if (ci->ci_intr_depth == 0 && (ci->ci_softints >> ci->ci_cpl) > 0) { - ENABLE_INTERRUPT(); - cpu_dosoftints(); - } + cpu_dosoftints(); } #ifdef COMPAT_NETBSD32