Re: CVS commit: src/sys

2024-05-20 Thread Jason Thorpe
What issue is this change attempting to resolve?

> On May 20, 2024, at 4:34 AM, Taylor R Campbell  wrote:
> 
> Module Name: src
> Committed By: riastradh
> Date: Mon May 20 11:34:19 UTC 2024
> 
> Modified Files:
> src/sys/arch/sparc64/dev: pci_machdep.c
> src/sys/arch/sparc64/include: pci_machdep.h
> src/sys/arch/xen/include: pci_machdep.h
> src/sys/arch/xen/xen: xpci_xenbus.c
> src/sys/dev/acpi: acpi_mcfg.c
> src/sys/dev/pci: pci.c pcivar.h
> 
> Log Message:
> pci: Pass cookie through pci_find_device, pci_enumerate_bus.
> 
> New functions pci_find_device1 and pci_enumerate_bus1 have the cookie
> argument.  Existing symbols pci_find_device and pci_enumerate_bus are
> now wrappers for the cookieless version.
> 
> This drops the symbol pci_probe_device, in favour of a new
> pci_probe_device1 with the cookie argument.  But I don't think that
> requires a revbump because it's only called by MD pci_enumerate_bus1
> implementations, which don't live in modules anyway.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.80 -r1.81 src/sys/arch/sparc64/dev/pci_machdep.c
> cvs rdiff -u -r1.28 -r1.29 src/sys/arch/sparc64/include/pci_machdep.h
> cvs rdiff -u -r1.21 -r1.22 src/sys/arch/xen/include/pci_machdep.h
> cvs rdiff -u -r1.26 -r1.27 src/sys/arch/xen/xen/xpci_xenbus.c
> cvs rdiff -u -r1.26 -r1.27 src/sys/dev/acpi/acpi_mcfg.c
> cvs rdiff -u -r1.165 -r1.166 src/sys/dev/pci/pci.c
> cvs rdiff -u -r1.117 -r1.118 src/sys/dev/pci/pcivar.h
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 

-- thorpej



Re: CVS commit: src

2024-05-19 Thread Jason Thorpe



> On May 19, 2024, at 6:21 PM, Christos Zoulas  wrote:
> 
> We discussed it with Taylor and decided to call it dup3100 after all since 
> we've
> already followed the old scheme for kevent100 and it is better to be 
> consistent
> for the 11 release.We can start calling new syscalls 12 after 11 is released.

But how can the old one be in compat_11?

-- thorpej



Re: CVS commit: src

2024-05-19 Thread Jason Thorpe


> On May 19, 2024, at 5:35 PM, Christos Zoulas  wrote:
> 
> In article <9c72736d-707b-4267-bd05-45bffea52...@me.com>,
> Jason Thorpe   wrote:
>> 
>> 
>>> On May 19, 2024, at 3:25 PM, Christos Zoulas  wrote:
>>> 
>>> src/sys/compat/common: compat_110_mod.c sys_decrip_110.c
>>> src/sys/compat/netbsd32: netbsd32_compat_110.c
>>> src/sys/conf: compat_netbsd110.config
>>> src/sys/modules/compat_110: Makefile
>>> src/sys/modules/compat_netbsd32_110: Makefile
>> 
>> Wait, why is there now a compat_110 module?  netbsd-11 isn’t out yet. 
>> dup3() belongs in the compat_100 module.
> 
> You asked for the syscall to be called dup3110 so I put it in compat_110...

The new system call is dup3110 (“dup3 for 11.0”), the old one is “netbsd-10 
compatibility”, so belongs in compat_10.

-- thorpej



Re: CVS commit: src

2024-05-19 Thread Jason Thorpe



> On May 19, 2024, at 3:25 PM, Christos Zoulas  wrote:
> 
> src/sys/compat/common: compat_110_mod.c sys_decrip_110.c
> src/sys/compat/netbsd32: netbsd32_compat_110.c
> src/sys/conf: compat_netbsd110.config
> src/sys/modules/compat_110: Makefile
> src/sys/modules/compat_netbsd32_110: Makefile

Wait, why is there now a compat_110 module?  netbsd-11 isn’t out yet.  dup3() 
belongs in the compat_100 module.

-- thorpej



Re: CVS commit: src/share/mk

2024-01-03 Thread Jason Thorpe



> On Jan 3, 2024, at 9:16 AM, Jason Thorpe  wrote:
> 
> There’s really nothing Qemu specific about it, other than Qemu version number 
> extraction.

Let me elaborate, actually, now that I am not constrained by thumbs-only typing.

It uses the generic Linux m68k “bootinfo”, which specify the machine type and 
address of the various devices, and provisions for how reset/halt are handled 
are also dealt with generically.  Every Linux m68k platform uses this mechanism 
and I would be shocked (SHOCKED) if some hypothetical future non-Qemu m68k 
VirtIO platform did not support Linux natively.  The Qemu version extraction is 
actually done with one of those “bootinfo” records.

There are really only two assumptions that are made:

- RAM starts at PA $., the kernel starts with the MMU disabled, and is 
loaded at its link address.

- I/O devices start at PA $FF00., and that they can be mapped VA==PA with a 
TT register.

The latter would be pretty easy to deal with dynamically if the situation 
arose.  And the former would be possible to adapt to if that assumption were to 
suddenly not be valid.  Heck, the hp300 kernel is linked at VA=$. and 
knows how to deal with the start of RAM varying based on how much memory is 
installed (whereas the end of RAM is always at the same location, at the top of 
the physical address space. Weirdos.)

-- thorpej



Re: CVS commit: src/share/mk

2024-01-03 Thread Jason Thorpe
There’s really nothing Qemu specific about it, other than Qemu version number 
extraction.

-- thorpej
Sent from my iPhone.

> On Jan 2, 2024, at 11:03 PM, Valery Ushakov  wrote:
> 
> On Wed, Jan 03, 2024 at 02:48:06 +, Jason R Thorpe wrote:
> 
>> Add virt68k to MACHINES.m68k.
> 
> "virt" is too generic a name, if this is specifically a qemu version,
> may be it should have been called qemu68k... Guess it's too late now.
> 
> -uwe


Re: CVS commit: src/sys/sys

2024-01-02 Thread Jason Thorpe



> On Jan 2, 2024, at 8:41 PM, Robert Elz  wrote:
> 
> I doubt that  should really be including 
> and almost certainly not , and shouldn't have prototypes
> for any functions at all.

 seems safe — all of that stuff is in the implementation namespace.

-- thorpej



Re: CVS commit: src

2023-07-30 Thread Jason Thorpe



> On Jul 30, 2023, at 7:46 AM, Tobias Nygren  wrote:

> Absence of this flag makes devel/libevent from pkgsrc fail to build --
> but should it really use epoll in the first place or should
> we change it to prefer kqueue when both are available?

The latter, I think!

-- thorpej



Re: CVS commit: src

2023-07-10 Thread Jason Thorpe
It’s great to see this land, but “struct memfd” does not appear to be needed in 
.  I would suggest moving it to sys_memfd.c.

> On Jul 9, 2023, at 7:31 PM, Christos Zoulas  wrote:
> 
> Module Name: src
> Committed By: christos
> Date: Mon Jul 10 02:31:55 UTC 2023
> 
> Modified Files:
> src/distrib/sets/lists/comp: mi
> src/lib/libc/sys: Makefile.inc fcntl.2
> src/sys/compat/linux/arch/amd64: syscalls.master
> src/sys/compat/linux/common: linux_fcntl.h linux_file.c linux_misc.c
>linux_sysctl.c
> src/sys/kern: sys_descrip.c vfs_syscalls.c vfs_vnops.c
> src/sys/sys: fcntl.h file.h mman.h
> src/usr.bin/fstat: fstat.c misc.c
> Added Files:
> src/lib/libc/sys: memfd_create.2
> src/sys/kern: sys_memfd.c
> 
> Log Message:
> Add memfd_create(2) from GSoC 2023 by Theodore Preduta
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.2436 -r1.2437 src/distrib/sets/lists/comp/mi
> cvs rdiff -u -r1.250 -r1.251 src/lib/libc/sys/Makefile.inc
> cvs rdiff -u -r1.49 -r1.50 src/lib/libc/sys/fcntl.2
> cvs rdiff -u -r0 -r1.1 src/lib/libc/sys/memfd_create.2
> cvs rdiff -u -r1.67 -r1.68 src/sys/compat/linux/arch/amd64/syscalls.master
> cvs rdiff -u -r1.20 -r1.21 src/sys/compat/linux/common/linux_fcntl.h
> cvs rdiff -u -r1.122 -r1.123 src/sys/compat/linux/common/linux_file.c
> cvs rdiff -u -r1.256 -r1.257 src/sys/compat/linux/common/linux_misc.c
> cvs rdiff -u -r1.47 -r1.48 src/sys/compat/linux/common/linux_sysctl.c
> cvs rdiff -u -r1.47 -r1.48 src/sys/kern/sys_descrip.c
> cvs rdiff -u -r0 -r1.1 src/sys/kern/sys_memfd.c
> cvs rdiff -u -r1.559 -r1.560 src/sys/kern/vfs_syscalls.c
> cvs rdiff -u -r1.241 -r1.242 src/sys/kern/vfs_vnops.c
> cvs rdiff -u -r1.54 -r1.55 src/sys/sys/fcntl.h
> cvs rdiff -u -r1.92 -r1.93 src/sys/sys/file.h
> cvs rdiff -u -r1.62 -r1.63 src/sys/sys/mman.h
> cvs rdiff -u -r1.117 -r1.118 src/usr.bin/fstat/fstat.c
> cvs rdiff -u -r1.24 -r1.25 src/usr.bin/fstat/misc.c
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 

-- thorpej



Re: CVS commit: src/share/misc

2023-03-06 Thread Jason Thorpe



> On Mar 1, 2023, at 2:25 PM, Steffen Nurpmeso  wrote:
> 
> Jason R Thorpe wrote in
> <20230301040454.c3b17f...@cvs.netbsd.org>:
> |Module Name:  src
> |Committed By: thorpej
> |Date: Wed Mar  1 04:04:54 UTC 2023
> |
> |Modified Files:
> | src/share/misc: acronyms.comp
> |
> |Log Message:
> |Add NHACP (NABU HCCA Application Communication Protocol)
> 
> NABU is Naturschutzbund Deutschland!
> (Nature and Biodiversity Conservation Union Germany.
> [Heck, they loose the Game!])

In this context, that’s not actually what it is, but it’s good to know there is 
at least one expansion :-)

-- thorpej



Re: CVS commit: src/distrib/notes/sparc64

2022-09-28 Thread Jason Thorpe


> On Sep 28, 2022, at 11:37 AM, Charlotte Koch  wrote:

> Maybe it makes sense to write an article in our own wiki instead? From
> what I gather, reprogramming these NVRAM/clock chips is a *very* common
> task. (In fact, I'm going to do it myself with the Sun Blade 100 that
> I'm getting tomorrow!)

Indeed, I think maintaining our own set of technical articles (citing other 
sources as appropriate, of course), would be a good thing.

-- thorpej



Re: CVS commit: src/sys/dev/ic

2022-08-01 Thread Jason Thorpe
Oops, never mind, I hadn't yet seen the follow-up revert.

> On Aug 1, 2022, at 8:29 AM, Jason Thorpe  wrote:
> 
> 
> 
>> On Aug 1, 2022, at 12:34 AM, Michael van Elst  wrote:
>> 
>> Module Name: src
>> Committed By: mlelstv
>> Date: Mon Aug  1 07:34:28 UTC 2022
>> 
>> Modified Files:
>> src/sys/dev/ic: ahcisata_core.c bcmgenet.c nslm7x.c nvmereg.h nvmevar.h
>>   rtl8169.c tulip.c tulipreg.h
>> 
>> Log Message:
>> Also fix shift values for SCT constants.
> 
> ???
> 
> diff -u src/sys/dev/ic/tulip.c:1.205 src/sys/dev/ic/tulip.c:1.206
> --- src/sys/dev/ic/tulip.c:1.205Sat Jun 25 02:46:15 2022
> +++ src/sys/dev/ic/tulip.c  Mon Aug  1 07:34:28 2022
> @@ -1,4 +1,4 @@
> -/* $NetBSD: tulip.c,v 1.205 2022/06/25 02:46:15 tsutsui Exp $  */
> +/* $NetBSD: tulip.c,v 1.206 2022/08/01 07:34:28 mlelstv Exp $  */
> 
> /*-
>  * Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
> @@ -36,7 +36,7 @@
>  */
> 
> #include 
> -__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.205 2022/06/25 02:46:15 tsutsui Exp 
> $");
> +__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.206 2022/08/01 07:34:28 mlelstv Exp 
> $");
> 
> 
> #include 
> @@ -4394,7 +4394,7 @@
> */
> 
>/* XXX This should be auto-sense. */
> -   ifmedia_set(>mii_media, IFM_ETHER | IFM_10_T);
> +   ifmedia_set(>mii_media, IFM_ETHER | IFM_10_5);
> 
>tlp_print_media(sc);
> }
> 
> 
>> 
>> 
>> To generate a diff of this commit:
>> cvs rdiff -u -r1.105 -r1.106 src/sys/dev/ic/ahcisata_core.c
>> cvs rdiff -u -r1.11 -r1.12 src/sys/dev/ic/bcmgenet.c
>> cvs rdiff -u -r1.74 -r1.75 src/sys/dev/ic/nslm7x.c
>> cvs rdiff -u -r1.17 -r1.18 src/sys/dev/ic/nvmereg.h
>> cvs rdiff -u -r1.24 -r1.25 src/sys/dev/ic/nvmevar.h
>> cvs rdiff -u -r1.172 -r1.173 src/sys/dev/ic/rtl8169.c
>> cvs rdiff -u -r1.205 -r1.206 src/sys/dev/ic/tulip.c
>> cvs rdiff -u -r1.41 -r1.42 src/sys/dev/ic/tulipreg.h
>> 
>> Please note that diffs are not public domain; they are subject to the
>> copyright notices on the relevant files.
>> 
> 
> -- thorpej


-- thorpej



Re: CVS commit: src/sys/dev/ic

2022-08-01 Thread Jason Thorpe



> On Aug 1, 2022, at 12:34 AM, Michael van Elst  wrote:
> 
> Module Name: src
> Committed By: mlelstv
> Date: Mon Aug  1 07:34:28 UTC 2022
> 
> Modified Files:
> src/sys/dev/ic: ahcisata_core.c bcmgenet.c nslm7x.c nvmereg.h nvmevar.h
>rtl8169.c tulip.c tulipreg.h
> 
> Log Message:
> Also fix shift values for SCT constants.

???

diff -u src/sys/dev/ic/tulip.c:1.205 src/sys/dev/ic/tulip.c:1.206
--- src/sys/dev/ic/tulip.c:1.205Sat Jun 25 02:46:15 2022
+++ src/sys/dev/ic/tulip.c  Mon Aug  1 07:34:28 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: tulip.c,v 1.205 2022/06/25 02:46:15 tsutsui Exp $  */
+/* $NetBSD: tulip.c,v 1.206 2022/08/01 07:34:28 mlelstv Exp $  */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.205 2022/06/25 02:46:15 tsutsui Exp 
$");
+__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.206 2022/08/01 07:34:28 mlelstv Exp 
$");
 
 
 #include 
@@ -4394,7 +4394,7 @@
 */
 
/* XXX This should be auto-sense. */
-   ifmedia_set(>mii_media, IFM_ETHER | IFM_10_T);
+   ifmedia_set(>mii_media, IFM_ETHER | IFM_10_5);
 
tlp_print_media(sc);
 }


> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.105 -r1.106 src/sys/dev/ic/ahcisata_core.c
> cvs rdiff -u -r1.11 -r1.12 src/sys/dev/ic/bcmgenet.c
> cvs rdiff -u -r1.74 -r1.75 src/sys/dev/ic/nslm7x.c
> cvs rdiff -u -r1.17 -r1.18 src/sys/dev/ic/nvmereg.h
> cvs rdiff -u -r1.24 -r1.25 src/sys/dev/ic/nvmevar.h
> cvs rdiff -u -r1.172 -r1.173 src/sys/dev/ic/rtl8169.c
> cvs rdiff -u -r1.205 -r1.206 src/sys/dev/ic/tulip.c
> cvs rdiff -u -r1.41 -r1.42 src/sys/dev/ic/tulipreg.h
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 

-- thorpej



Re: CVS commit: src/sys/external/bsd/drm2/drm

2022-07-20 Thread Jason Thorpe



> On Jul 19, 2022, at 10:14 PM, matthew green  wrote:
> 
> looks like only a small number of files check for "alpha"
> vs "__alpha__" currently, and all can likely be switched.

Yah, and some I should just fix.

-- thorpej



Re: null-terminated vs. nul-terminated (was: Re: CVS commit: src/lib/libc/gen)

2022-03-26 Thread Jason Thorpe


> On Mar 26, 2022, at 9:39 AM, Taylor R Campbell 
>  wrote:
> 
> `C string' is ambiguous because there are also char arrays that
> function as strings but which are not guaranteed to be NUL-terminated,
> as strncpy is intended for.

A non-terminated char array is not a C-string.  The term C-string is not 
ambiguous.  This is something that, amazingly, even Internet trolls appear to 
agree on.  However, they do disagree as to the spelling of the terminating 
character's name, which is why I think it's best to elide it altogether.

-- thorpej



Re: null-terminated vs. nul-terminated (was: Re: CVS commit: src/lib/libc/gen)

2022-03-26 Thread Jason Thorpe


> On Mar 26, 2022, at 9:09 AM, Warner Losh  wrote:
> 
> Since all the 'C' standards[*] use "null-terminated" and "null character", 
> it's likely best to use that terminology because there is a source of truth 
> for its definition in case of ambiguity or doubt.

Ah, but you're giving up the opportunity to use indirection to solve the 
problem.  By calling it a "C-string", then those who care what the standard 
calls the terminating character can go look it up! :-)

-- thorpej



Re: null-terminated vs. nul-terminated (was: Re: CVS commit: src/lib/libc/gen)

2022-03-26 Thread Jason Thorpe


> On Mar 26, 2022, at 9:17 AM, Martin Husemann  wrote:
> When talking about it I prefer "zero terminated", or C-string, in
> contrast to C++ std::string (which are objects) or Pascal strings
> (which have an explicit length at the beginning).

Yes, I also prefer the term “C-string"

-- thorpej







Re: CVS commit: src/sys/kern

2022-02-11 Thread Jason Thorpe


> On Feb 11, 2022, at 9:53 AM, Taylor R Campbell  wrote:
> 
>  That is, this was presumably meant to ensure (A) happens-before (B).
>  This relation is already guaranteed by ipi(9), so there is no need
>  for any explicit memory barrier.

Is this documented in ipi(9)?

-- thorpej



Re: CVS commit: src/tests/fs/vfs

2022-02-02 Thread Jason Thorpe



> On Feb 2, 2022, at 6:47 AM, Robert Elz  wrote:
> 
>Date:Wed, 2 Feb 2022 07:11:45 +
>From:David Holland 
>Message-ID:  
> 
>  | v7fs isn't a compat interface for old users,
> 
> That's sad, I could do with something just for me!
> 
>  | it's a compat interface for old disk images :-)
> 
> And makefs -t v7fs fits into that purpose how?
> 
> So maybe it is for us truly old fogies (can we have v6fs as well?
> Then I'd really feel at home.)   Can I have a v7fs as root, and
> boot from it?   Does sysinst support it?

I thought we maybe supported a system whose ROM boots from it?

-- thorpej



Re: CVS commit: src/sbin/cgdconfig

2021-11-28 Thread Jason Thorpe


> On Nov 28, 2021, at 8:05 AM, Christos Zoulas  wrote:
> 
> The change is correct; this is how it is done everywhere else in the tree. 
> You are right about -pthread doing more than adding -lpthread, but
> in that case, the -pthread should be added to CFLAGS/COPTS etc, 
> not LDADD so that it is effective during the compilation phase too, 
> not just the link phase. When I made the change, I considered going
> through the tree and adding -pthread to the CFLAGS/COPTS in the
> Makefiles where -pthread is in LDADD, but I did not want to do a
> half-assed job without thinking about it more:
> 
> 1. which compilation flag should we add -pthread to? CFLAGS or 
>   COPTS? What about c++?

GCC defines some preprocessor macros in response to -pthread, so … CPPFLAGS?  
Perhaps a better choice is to have a USE_PTHREADS that individual program / 
library Makefiles can set to YES to cause the right magic to happen in 
bsd.sys.mk?

> 2. do we remove the LDADD/DPADD pthread settings? I am thinking
>perhaps not, it does  not hurt, plus the DPADD will cause a rebuild 
>when libpthread changes.

That could be hidden away by the above suggestion.

-- thorpej



Re: CVS commit: src/sbin/cgdconfig

2021-11-28 Thread Jason Thorpe



> On Nov 27, 2021, at 6:01 PM, Christos Zoulas  wrote:
> 
> Module Name:  src
> Committed By: christos
> Date: Sun Nov 28 02:01:30 UTC 2021
> 
> Modified Files:
>   src/sbin/cgdconfig: Makefile
> 
> Log Message:
> -lpthread to LDADD (fixes lint build)

This change is wrong.  The -pthread option to the compiler does more than just 
add -lpthread to the link phase.

-- thorpej



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

2021-10-15 Thread Jason Thorpe
I demand this change be reverted.

(/s)

> On Oct 15, 2021, at 11:12 AM, Jared D. McNeill  wrote:
> 
> Module Name:  src
> Committed By: jmcneill
> Date: Fri Oct 15 18:12:48 UTC 2021
> 
> Modified Files:
>   src/sys/arch/x86/x86: tsc.c
> 
> Log Message:
> Fix typo in comment: "porniters" -> "pointers"
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.56 -r1.57 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.
> 

-- thorpej



Re: CVS commit: src/sys

2021-09-29 Thread Jason Thorpe


> On Sep 29, 2021, at 8:15 AM, Robert Elz  wrote:
> 
>Date:Wed, 29 Sep 2021 05:37:44 -0700
>From:    Jason Thorpe 
>Message-ID:  <39db6c46-94bf-4126-811b-466e5293b...@me.com>
> 
>  | Not needed in this case.
>  | No callers that need the return value are in a module.
> 
> The problem with this argument is that it assumes that you know
> every module that exists, anywhere.   It might be true of the
> modules distributed with NetBSD, without being true of some 3rd
> party module.

Anything that depends on the new return value would have simply been doing what 
the socket / fifo code was doing (groveling around in selinfo internals), so 
it's not like they're broken as a result of this change.

-- thorpej



Re: CVS commit: src/usr.sbin/acpitools/acpidump

2021-09-14 Thread Jason Thorpe



> On Sep 14, 2021, at 1:34 PM, Roland Illig  wrote:
> 
> When lint runs on the code, it defines the preprocessor macro 'lint' to
> be 1.  Due to that, this name cannot be used as a regular identifier.

Perhaps all of the "#ifdef lint" conditions should become "#ifdef __lint__"?

-- thorpej



Re: CVS commit: src/sys

2021-08-25 Thread Jason Thorpe



> On Aug 24, 2021, at 10:21 PM, matthew green  wrote:
> 
>> - For alpha and sparc64, don't define MUTEX_CAS() in terms of their own
>>  _lock_cas(), which has its own memory barriers; the call sites in
>>  kern_mutex.c already have the appropriate memory barrier calls.  Thus,
>>  alpha and sparc64 can use default definition.
> 
> this seems to leave _lock_cas() unused on both platforms, should
> the backing code for _lock_cas() be removed now?

Yes, I intended for that to be a separate commit.

-- thorpej



Re: CVS commit: src/sys

2021-07-31 Thread Jason Thorpe


> On Jul 31, 2021, at 3:17 AM, Tobias Nygren  wrote:
> 
> It's not possible to deduce from the manual what DesignWare revision
> is used but I guess I can go over the data sheets of currently
> released SoCs and build a matrix of the proper values regardless
> of DesignWare revision.

Have the driver use a default value but provide an override in the device tree?

-- thorpej



Re: CVS commit: [thorpej-i2c-spi-conf] src/sys/dev/i2c

2021-05-16 Thread Jason Thorpe


> On May 16, 2021, at 1:06 PM, matthew green  wrote:
> 
>> Modified Files:
>>  src/sys/dev/i2c [thorpej-i2c-spi-conf]: spdmem_i2c.c
>> 
>> Log Message:
>> The last change had an unfortunate side-effect on empty DIMM slots, so
>> roll that back.  Instead, if we used direct config, then probe for the
>> module in the attach routine and report if the module is not present,
>> rather than assuming that it is.
> 
> this seems odd to me.
> 
> if we're using direct config, shouldn't match() be fully
> able to determine present or not, avoiding having to have
> an attach() that fake-fails?

The problem is if a device tree has a node for a SPD DIMM, but the DIMM *isn’t 
actually present* (i.e. the node is for “DIMM might live here, go check!”).  
Returning “no match” in this situation would result in a “… not configured” 
message for a non-existent DIMM.

> 
> thanks.
> 
> 
> .mrg.

-- thorpej



Re: CVS commit: src/sys/arch/powerpc/oea

2021-04-01 Thread Jason Thorpe
Ugh.  Can we please stop making these hacky one-offs in "shared by all PowerPC 
platforms" code?  This actually points to a deeper problem in the pmap code 
that needs to be addressed correctly.

> On Apr 1, 2021, at 3:02 PM, Michael Lorenz  wrote:
> 
> Module Name:  src
> Committed By: macallan
> Date: Thu Apr  1 22:02:20 UTC 2021
> 
> Modified Files:
>   src/sys/arch/powerpc/oea: ofwoea_machdep.c
> 
> Log Message:
> avoid mapping 0xf000 - my beige G3 DSIs on it
> with this my the machine boots again
> tested on a variety of G4 and G5 models with no problems
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.59 -r1.60 src/sys/arch/powerpc/oea/ofwoea_machdep.c
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 

-- thorpej



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

2021-02-22 Thread Jason Thorpe


> On Feb 22, 2021, at 11:49 AM, Ryo Shimizu  wrote:
> 
> Ah, You are quite right!
> idle/# lwp is provided and assigned for each CPU, so curcpu() obtained from
> idle lwp was always the same.
> So, there's no need to move curcpu() to after DISABLE_INTERRUPT.

Please make sure to add a comment explaining why!

-- thorpej



Re: POINTER_ALIGNED_P (was: Re: CVS commit: src/sys)

2021-02-16 Thread Jason Thorpe


> On Feb 16, 2021, at 1:56 PM, Roland Illig  wrote:
> 
> A downside of this test is that the macro from  gets only
> evaluated at compile time of the test.  The test therefore cannot cover
> future updates to  without being reinstalled itself.  But
> at least for the release builds, it ensures a correct definition.

You can make this get evaluated at run-time by passing in a non-constant 
argument.

-- thorpej



Re: CVS commit: src/doc

2021-01-28 Thread Jason Thorpe


> On Jan 27, 2021, at 3:11 PM, Simon Burge  wrote:
> 
> It can run either big- or little-endian, but has virtually no IO support
> whatsoever - just a UART and an extremely simple eithernet driver.
> 
> I couldn't find any MIPS references to virtio with a quick look through
> the QEMU 5.0 sources.

In theory, you should be able to configure virtio @ pci on the Malta emulation, 
but in practice… *shrug*.

-- thorpej



Re: CVS commit: src/sys/sys

2021-01-26 Thread Jason Thorpe


> On Jan 26, 2021, at 6:49 PM, Valery Ushakov  wrote:
> 
> It's hardly fair to characterize three people politely inquiring about
> that choice and pointing out a more standard way to spell what you
> want to express (that is perfectly in rhyme with the preceding table
> and is only one character longer too) as "angry hordes objecting".

Sorry, should have added the "/s" at the end.  Was kind of a long day, and this 
was a misguided attempt at decompression humor.

-- thorpej



Re: CVS commit: src/sys/arch

2021-01-25 Thread Jason Thorpe


> On Jan 25, 2021, at 9:45 AM, Robert Elz  wrote:
> 
>Date:Mon, 25 Jan 2021 08:19:44 -0800
>From:    Jason Thorpe 
>Message-ID:  
> 
>  | Using { 0 } makes an assumption about the first member of the
>  | structure which is not guaranteed to remain true.
> 
> That's right, but you could explicitly init a named field, most likely
> the one that is tested to determine that this is the sentinel, eg: from
> one of the recent updates ...
> 
> static const struct device_compatible_entry compat_data[] = {
>{ .compat = "pnpPNP,401" },
> -   { 0 }
> +   { }
> };
> 
> that could instead be changed to
>   { .compat = NULL }
> 
> (or something similar to that).

I noticed this because of a different local change in my tree that makes the 
first field another anonymous union.

Anyhow, I'll go ahead and define a standard sentinel macro that can be used for 
the common { .compat = XXX } case, and fire up sed to fix up the tree.

-- thorpej



Re: CVS commit: src/sys/arch

2021-01-25 Thread Jason Thorpe


> On Jan 25, 2021, at 6:22 AM, Kamil Rytarowski  wrote:
> 
> I have no problem with this change but I am curious why should we use "{
> }"? It's a C GNU extension and C++ syntax.

Using { 0 } makes an assumption about the first member of the structure which 
is not guaranteed to remain true.

-- thorpej



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

2021-01-25 Thread Jason Thorpe


> On Jan 24, 2021, at 10:20 PM, Martin Husemann  wrote:
> 
>> I kept getting a ?static after non-static declaration? error when building 
>> for aarch64.
> 
> I guess that was with outdated arm/include/bus_funcs.h and
> sys/bus_proto.h (or where was the previous declaration)?

I did a “cvs update” just before, *shrug*.  In any case, the problem was easily 
avoidable, and now it is avoided.

-- thorpej



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

2021-01-24 Thread Jason Thorpe


> On Jan 24, 2021, at 9:37 PM, Martin Husemann  wrote:
> 
> While I don't care for names, I would like to understand fallout in
> details before hiding it - what exactly did not compile correctly?
> At least the affected arm kernels worked for me in the state directly
> before your commit.

I kept getting a “static after non-static declaration” error when building for 
aarch64.

-- thorpej



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

2021-01-23 Thread Jason Thorpe


> On Jan 23, 2021, at 5:40 PM, Christos Zoulas  wrote:
> 
>> it's a bad example.  someone might copy it into another
>> driver that _doesn't_ work with this version, but may seem
>> to fix a build error.
>> 
>> that's why i wanted to wrap the usage to make it clear if
>> someone were to copy it elsewhere.
> 
> I will add a comment.

Yah, I was gonna say, “big fat comment in order!"

-- thorpej



Re: CVS commit: src/sys/dev

2021-01-21 Thread Jason Thorpe


> On Jan 21, 2021, at 12:00 AM, Martin Husemann  
> wrote:
> 
> On Wed, Jan 20, 2021 at 07:46:48PM +, Reinoud Zandijk wrote:
>> Module Name: src
>> Committed By:reinoud
>> Date:Wed Jan 20 19:46:48 UTC 2021
>> 
> [..] 
>> Log Message:
>> Add VirtIO PCI v1.0 attachments and fix the drivers affected.
>> 
>> * virtio on sparc64 attaches but is it not functioning though not a
>>  regression.
> 
> While not a regression by this commit, it *did* work in netbsd-8,
> so overall a bad regression that we should fix.

This could be a bug in Qemu … it does not work on Alpha, either, and Jonathan 
Kollasch tracked down to Qemu 5’s Virtio subsystem not considering the DMA 
window on the Alpha platform.

-- thorpej



Re: CVS commit: src/sys/netinet

2020-12-04 Thread Jason Thorpe


> On Dec 4, 2020, at 8:57 AM, Christos Zoulas  wrote:
> 
> In article <20201204004439.90c25f...@cvs.netbsd.org>,
> Jason R Thorpe  wrote:
>> -=-=-=-=-=-
>> 
>> Module Name: src
>> Committed By:thorpej
>> Date:Fri Dec  4 00:44:39 UTC 2020
>> 
>> Modified Files:
>>  src/sys/netinet: files.ipfilter
>> 
>> Log Message:
>> Build ip_sync.c with -Wno-error to avoid failing due to excessive stack
>> usage.
> 
> Can you please make this more specific? Like -Wno-error=foo?

Feel free to try.  -Wno-error=stack-usage produced an error for me.

-- thorpej



Re: CVS commit: src

2020-11-12 Thread Jason Thorpe


> On Nov 12, 2020, at 9:40 AM, nia  wrote:
> 
> For the record I'm just trying to fix things so that running
> third-party software on NetBSD sucks less. If fewer third-party
> libraries were exposed by the base system this wouldn't be
> necessary.

Why do we even have sqlite in the base system in the first place?

-- thorpej



Re: CVS commit: src/sys

2020-11-04 Thread Jason Thorpe



> On Nov 4, 2020, at 5:33 AM, Paul Goyette  wrote:
> 
> I guess I don't understand why a 32-bit architecture would also have
> COMPAT_NETBSD32.

In this particular case, it's for the old 32-bit ABI that predates the EABI 
standard the ARM port now uses.

-- thorpej



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

2020-09-03 Thread Jason Thorpe


> On Sep 3, 2020, at 1:14 PM, matthew green  wrote:
> 
> "Jason R Thorpe" writes:
>> Module Name: src
>> Committed By:thorpej
>> Date:Thu Sep  3 04:20:54 UTC 2020
>> 
>> Modified Files:
>>  src/sys/arch/alpha/include: cpu.h
>> 
>> Log Message:
>> Garabage-collect curpcb / cpu_info::ci_curpcb.
> 
> does alpha have modules?  this may be a ABI change needing
> a kernel version bump...

"Sort of."  They don't work (not all of the required relocations are handled 
correctly), so I'm not that concerned.

-- thorpej



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

2020-07-17 Thread Jason Thorpe



> On Jul 17, 2020, at 3:50 PM, matthew green  wrote:
> 
> any chance you can look at NET_MPSAFE here etc? :)

I have a bunch of local changes for this in one of my trees, and I hope to get 
back to it after netbsd-10 branches.

-- thorpej



Re: CVS commit: src/sys

2020-07-08 Thread Jason Thorpe



> On Jul 8, 2020, at 12:22 AM, Martin Husemann  wrote:
> 
> On Tue, Jul 07, 2020 at 03:38:49AM +, Jason R Thorpe wrote:
>>  Provide a new resource provider API:
> 
> This is *extremly* verbose and overflows message buffer, can you move the
> new messages to aprint_debug or ifdef with some proper DEBUG_* please?

Oops, sorry, pci_conf_debug was enabled by mistake in previous commit.  I've 
fixed this now.

-- thorpej



Re: CVS commit: src/sys/arch/powerpc/booke

2020-07-06 Thread Jason Thorpe



> On Jul 6, 2020, at 5:28 PM, Rin Okuyama  wrote:
> 
> Module Name:  src
> Committed By: rin
> Date: Tue Jul  7 00:28:31 UTC 2020
> 
> Modified Files:
>   src/sys/arch/powerpc/booke: e500_tlb.c
> 
> Log Message:
> Fix kernel panic due to tmpfs.
> 
> pmap for booke assumes that the ``va'' argument for pmap_kenter_pa(9) is
> page-aligned. However, by recent changes, tmpfs became to use ``va'' with
> page offset via ubc_uiomove(9). So, truncate it to page boundary.

This change seems wrong.  I think it needs to be fixed in tmpfs.

-- thorpej



Re: CVS commit: src/tests/lib/libarchive

2020-06-16 Thread Jason Thorpe



> On Jun 16, 2020, at 8:43 AM, Martin Husemann  wrote:
> 
> No, that is definitively not OK, which is what the PR is about.
> 
> It is not OK for a regular atf run to cause a reboot of the test machine
> though, so this is a temporary hack around the issue (and admitedly a very
> ugly hack).

At the very least, the user-land watchdog tickler should wire itself down.

-- thorpej



Re: CVS commit: src/common/lib/libprop

2020-06-11 Thread Jason Thorpe


> On Jun 11, 2020, at 4:28 PM, Kamil Rytarowski  wrote:
> 
>> Repeating that statement doesn't make it true. The amount of legit
>> problems found by them is dwarfed by far by the number of false
>> positives seen. That's complete ignoring basic QoI issues like "where is
>> this actually triggered" and no "I know, shut up".
>> 
>> Joerg
>> 
> 
> Please list legitimate false positives. There is practically nothing
> like that possible for using deprecated APIs (at least kept longer
> term). Besides that, the report shall be lowered to warning (like it
> used to be for Clang).

Like it or not, __warn_references() is the thing we do in the NetBSD source 
tree, and I have other reasons for not marking them deprecated in the headers 
for the moment.  Clang can't cope, so I will change it so it's suppressed only 
for clang.

-- thorpej



Re: CVS commit: src

2020-06-07 Thread Jason Thorpe


> On Jun 7, 2020, at 1:57 PM, Joerg Sonnenberger  wrote:
> 
>> Example?
> 
> https://gcc.gnu.org/onlinedocs/gcc-4.7.0/gcc/Function-Attributes.html#index-g_t_0040code_007bdeprecated_007d-attribute_002e-2502

I meant an example in our tree.  We use __warn_reference() in several places 
already.  I also don't want to introduce compiler warnings just yet.

-- thorpej



Re: CVS commit: src

2020-06-07 Thread Jason Thorpe


> On Jun 7, 2020, at 1:22 PM, Joerg Sonnenberger  wrote:
> 
> On Sat, Jun 06, 2020 at 09:26:00PM +, Jason R Thorpe wrote:
>> ==> Deprecate mutable prop_data(3) and prop_string(3) objects.  The old
>>APIs that support them still exist, but will now produce link-time
>>warnings when used.
> 
> Please replace them with proper deprecration annotation in the headers.

Example?

-- thorpej



Re: CVS commit: src

2020-06-07 Thread Jason Thorpe



> On Jun 6, 2020, at 10:51 PM, matthew green  wrote:
> 
> "Jason R Thorpe" writes:
>> Module Name: src
>> Committed By:thorpej
>> Date:Sat Jun  6 21:26:00 UTC 2020
>> 
>> Modified Files:
>>  src/lib/libprop: Makefile shlib_version
> 
> i wonder, since this adds to the kernel ABI, you should have
> also bumped the kernel version, since modules using this new
> version won't run on older versions of this version now.

I guess I could bump it... but I have some related kernel changes coming that 
will require a bump regardless.  Worth bumping twice?  I guess version #s are 
cheap.

-- thorpej



Re: CVS commit: src/sys/kern

2020-05-31 Thread Jason Thorpe



> On May 31, 2020, at 1:33 AM, Rin Okuyama  wrote:
> 
> db_show_callout(): struct callout_cpu and cpu_info are too much for stack.
> 
> XXX
> DDB can be running in the interrupt context, e.g., when activated from
> console. Therefore, use kmem_intr_alloc(9) instead of kmem_alloc(9).
> 
> Frame size, e.g. for m68k, becomes:
>9212 (oops!) --> 0
> 

I'm not sure we want to be calling memory allocators from within ddb.  I think 
it would be better to simply allocate that space in the .bss segment -- ddb 
only runs on 1 CPU at a time.

-- thorpej



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

2020-05-23 Thread Jason Thorpe


> On May 23, 2020, at 11:08 AM, Ryo Shimizu  wrote:
> 
> Module Name:  src
> Committed By: ryo
> Date: Sat May 23 18:08:59 UTC 2020
> 
> Modified Files:
>   src/sys/arch/aarch64/aarch64: cpufunc.c cpuswitch.S exec_machdep.c
>   genassym.cf netbsd32_machdep.c vectors.S vm_machdep.c
>   src/sys/arch/aarch64/include: armreg.h machdep.h proc.h
> 
> Log Message:
> Not only the kernel thread, but also the userland PAC keys
> (APIA,APIB,APDA,APDB,APGA) are now randomly initialized at exec, and switched
> when context switch.
> userland programs are able to perform pointer authentication on ARMv8.3+PAC 
> cpu.

Has any consideration be given to perhaps creating a new MACHINE_ARCH for this, 
or somehow otherwise decorating the ELF files to indicate their exec-ability?

> 
> reviewd by maxv@, thanks.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.18 -r1.19 src/sys/arch/aarch64/aarch64/cpufunc.c
> cvs rdiff -u -r1.20 -r1.21 src/sys/arch/aarch64/aarch64/cpuswitch.S
> cvs rdiff -u -r1.6 -r1.7 src/sys/arch/aarch64/aarch64/exec_machdep.c
> cvs rdiff -u -r1.24 -r1.25 src/sys/arch/aarch64/aarch64/genassym.cf
> cvs rdiff -u -r1.12 -r1.13 src/sys/arch/aarch64/aarch64/netbsd32_machdep.c
> cvs rdiff -u -r1.16 -r1.17 src/sys/arch/aarch64/aarch64/vectors.S
> cvs rdiff -u -r1.7 -r1.8 src/sys/arch/aarch64/aarch64/vm_machdep.c
> cvs rdiff -u -r1.44 -r1.45 src/sys/arch/aarch64/include/armreg.h
> cvs rdiff -u -r1.10 -r1.11 src/sys/arch/aarch64/include/machdep.h
> cvs rdiff -u -r1.6 -r1.7 src/sys/arch/aarch64/include/proc.h
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 

-- thorpej



Re: Freeze or panic during boot was: Re: CVS commit: src/sys/dev/ata

2020-05-02 Thread Jason Thorpe


> On May 1, 2020, at 1:07 PM, Ryo ONODERA  wrote:
> 
> Hi,
> 
> Have you missed this thread?
> 
> If the problem requires more time to investigate,
> could you consider to revert ata change for a while?
> 
> Thank you.

I backed it out, but would appreciate some help tracking down the issue because 
no other problems were reported other than on these specific machines.

-- thorpej



Re: CVS commit: src

2020-04-26 Thread Jason Thorpe


> On Apr 26, 2020, at 5:23 AM, Maxime Villard  wrote:
> 
> Because I modeled my tests after the ufetchstore and threadpool tests which 
> are
> both in this directory and provide user access to kernel internals via 
> modules,
> which is exactly what I'm doing.

..and those are there because, IIRC, that's where someone asked me to move them 
to.

-- thorpej


Re: CVS commit: src/sys/kern

2020-04-26 Thread Jason Thorpe



> On Apr 26, 2020, at 2:04 PM, Michael van Elst  wrote:
> 
> Log Message:
> fix DIAGNOSTIC build

non-DIAGNOSTIC you mean?

-- thorpej



Re: CVS commit: src/sys/rump

2020-04-25 Thread Jason Thorpe
Why were any of these files touched by Xen changes?

> On Apr 25, 2020, at 8:42 AM, Manuel Bouyer  wrote:
> 
> Module Name:  src
> Committed By: bouyer
> Date: Sat Apr 25 15:42:15 UTC 2020
> 
> Modified Files:
>   src/sys/rump: listsrcdirs
>   src/sys/rump/dev/lib/libumass: Makefile
>   src/sys/rump/fs/lib/libffs: Makefile
>   src/sys/rump/include/rump: rump_syscalls.h
>   src/sys/rump/librump/rumpkern: lwproc.c rump.c rump_syscalls.c sleepq.c
>   src/sys/rump/librump/rumpvfs: rump_vfs.c rumpfs.c
> 
> Log Message:
> Merge the bouyer-xenpvh branch, bringing in Xen PV drivers support under HVM
> guests in GENERIC.
> Xen support can be disabled at runtime with
> boot -c
> disable hypervisor
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.49 -r1.50 src/sys/rump/listsrcdirs
> cvs rdiff -u -r1.11 -r1.12 src/sys/rump/dev/lib/libumass/Makefile
> cvs rdiff -u -r1.18 -r1.19 src/sys/rump/fs/lib/libffs/Makefile
> cvs rdiff -u -r1.115 -r1.116 src/sys/rump/include/rump/rump_syscalls.h
> cvs rdiff -u -r1.47 -r1.48 src/sys/rump/librump/rumpkern/lwproc.c
> cvs rdiff -u -r1.345 -r1.346 src/sys/rump/librump/rumpkern/rump.c
> cvs rdiff -u -r1.146 -r1.147 src/sys/rump/librump/rumpkern/rump_syscalls.c
> cvs rdiff -u -r1.19 -r1.20 src/sys/rump/librump/rumpkern/sleepq.c
> cvs rdiff -u -r1.92 -r1.93 src/sys/rump/librump/rumpvfs/rump_vfs.c
> cvs rdiff -u -r1.157 -r1.158 src/sys/rump/librump/rumpvfs/rumpfs.c
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 

-- thorpej



Re: CVS commit: src/sys

2020-04-24 Thread Jason Thorpe


> On Apr 24, 2020, at 3:39 AM, Kamil Rytarowski  wrote:
> 
> This is a good idea (and preexisting in other kernels), unfortunately we
> had locking issues in rust. If a multithreaded process is forked, we
> shall create a replica of a calling thread and keep mutexes functional.
> We tried to preserve the caller's LWP to guarantee this.
> 
> This problem can be back. I don't ask to revert or revisit this change,
> but if it will be back, we shall find a solution for it.

This has been fixed by joerg@ in ld.elf_so already.

-- thorpej



Re: CVS commit: src

2020-04-22 Thread Jason Thorpe


> On Apr 22, 2020, at 7:52 AM, Kamil Rytarowski  wrote:
> 
> Would it be possible to keep a global unique TID as 64-bit integer
> (int64_t) equal to: pid << 32 | lwpid ?
> 
> That way we could have predicatable numbers in the system and possibly
> simplify the involved code avoiding one extra unique 32-bit id.

Yes, I've been discussing this w/ ad@, chs@, and riastradh@.  I have a 
different approach that's almost ready to go, and will remove this separate 
"TID".  The system call was not yet exposed in libc, so it's not a problem to 
pull it out.

For various reasons, the ID must be limited to less than 32 bits.

-- thorpej



Re: CVS commit: src/sys

2020-04-17 Thread Jason Thorpe


> On Apr 17, 2020, at 7:46 AM, Robert Elz  wrote:
> 
>Date:Fri, 17 Apr 2020 15:37:33 +0200
>From:Manuel Bouyer 
>Message-ID:  <20200417133733.ga5...@antioche.eu.org>
> 
>  | And that would be a problem for me. I regulary update a single file to a
>  | specific revision in a source tree.
> 
> Me too - I pull the current sh into NetBSD 8 (and I guess 9 now too,
> though I haven't done that yet) and build it there for some people who
> like to test and report bugs.

The New Hotness (which isn't particularly new, at this point) is to create 
branches and merge what you want into that branch.

-- thorpej



Re: CVS commit: src/sys

2020-04-17 Thread Jason Thorpe


> On Apr 17, 2020, at 6:28 AM, Rin Okuyama  wrote:
> 
> On 2020/04/17 22:14, Jason Thorpe wrote:
>>> On Apr 17, 2020, at 12:24 AM, Robert Elz  wrote:
>>> 
>>> For this, RCS and RCS semantics are irrelevant aren't they?
>> No, not really.  With the modern systems, the "commit ID" identifies the 
>> state of the entire collection of files, not individual ones.  Thus, you 
>> only need exactly one instance of the ID, not one ID per file.
> 
> Exactly, but at the same time I think that RCSID is still useful till
> we switch to a sane VCS with unique commit ID's.
> 
> The attached patch adds SHF_MERGE|SHF_STRINGS flags as Joerg suggested.
> I've confirmed that it works fine both for GCC/binutils and LLVM (for
> kernel and userland).
> 
> OK to commit, or objections?

I'm fine with this change as a workaround for the current issue with the 
RCS-style IDs, but it will still be a huge mistake to embed a "commit ID" into 
every file when we (eventually, hopefully) switch to a modern revision control 
system because it would obviously require every file with such an embedded to 
change on each commit, which seems like a really really bad idea.

> 
> Thanks,
> rin
> 

-- thorpej



Re: CVS commit: src/sys

2020-04-17 Thread Jason Thorpe


> On Apr 17, 2020, at 12:24 AM, Robert Elz  wrote:
> 
> For this, RCS and RCS semantics are irrelevant aren't they?

No, not really.  With the modern systems, the "commit ID" identifies the state 
of the entire collection of files, not individual ones.  Thus, you only need 
exactly one instance of the ID, not one ID per file.

-- thorpej



Re: CVS commit: src/sys

2020-04-16 Thread Jason Thorpe


> On Apr 16, 2020, at 5:51 PM, Joerg Sonnenberger  wrote:
> 
> 
> That can be fixed generically? .ident needs the SHF_MERGE|SHF_STRINGS as
> section flags and then the linker should do the rest by itself.

Does it matter?  The sooner we get off of "things that use RCS semantics" the 
better.

-- thorpej



Re: CVS commit: src/share/man/man4

2020-04-10 Thread Jason Thorpe


> On Apr 10, 2020, at 4:44 AM, m...@netbsd.org  wrote:
> 
> I had to stop using m_defrag because implementation details broke
> bwfm@pci. It can only handle a chain of length 1, and m_defrag gives
> a minimum of 2.

Exactly.  If it can compact the packet into a single cluster mbuf, it should do 
so.  It makes it slightly more difficult to use correctly, but those would be 
better semantics.

-- thorpej



Re: CVS commit: src/share/man/man4

2020-04-09 Thread Jason Thorpe



> On Apr 9, 2020, at 7:19 PM, SAITOH Masanobu  wrote:
> 
> You're welcome.
> Some drivers still have no m_defrag() code, so we should add it
> to them().

Others do something different than m_defrag() do essentially the same effect.  
Personally, I am not a huge fan of the m_defrag() API.

-- thorpej



Re: CVS commit: src/sys

2020-04-03 Thread Jason Thorpe


> On Apr 3, 2020, at 5:45 AM, Tetsuya Isaki  wrote:
> 
> By the way, I am planning the following.  How about this?

I very much dislike creating an additional header file for this.

I would prefer if the default were tuned for modern systems and overridable by 
a value exported (in a namespace-appropriate way) by a header that already 
exists on all platforms.

-- thorpej



Re: CVS commit: src/sys/modules/examples/fopsmapper

2020-04-01 Thread Jason Thorpe


> On Apr 1, 2020, at 7:17 AM, Christos Zoulas  wrote:
> 
> Which we have been slowly fixing. I think in this case the sign-compare
> warnings are annoying, but putting casts on each warning is cluttering
> the code needlessly. Unfortunately the alternative (to make the PAGESIZE
> constant unsigned is more dangerous -- unless of course you are willing to 
> examine all the places it is used and make sure that the semantics don't
> change). Another way would be to make:
> 
>#define PAGESIZE_U ((unsigned)PAGESIZE)

If PAGE_SIZE is ostensibly a vsize_t / size_t, why not define it as (1U << 
PAGE_SHIFT)?

-- thorpej



Re: CVS commit: src/sys

2020-03-29 Thread Jason Thorpe


> On Mar 29, 2020, at 8:03 AM, Joerg Sonnenberger  wrote:
> 
> Yes and I see no fundamental reason for not allowing buffering with 1ms
> frames in that case. I expect Alpha to be fast enough to do that with
> little overhead.

That's fine, I just wanted to point it out.

-- thorpej



Re: CVS commit: src/sys

2020-03-29 Thread Jason Thorpe


> On Mar 29, 2020, at 6:11 AM, Joerg Sonnenberger  wrote:
> 
> I would allow at least 1/HZ as baseline.

Be careful, some platforms have a relatively high HZ (e.g. Alpha HZ=1024).

-- thorpej



Re: CVS commit: src/external/gpl3

2020-03-25 Thread Jason Thorpe


> On Mar 25, 2020, at 5:26 PM, Kamil Rytarowski  wrote:
> 
> Upstream (GCC) is strongly against this change (even under __NetBSD__
> ifdef) as /var/tmp is typically larger than /tmp:
> 
>> I'd strongly recommend against this as-is.
>> 
>> The whole reason we prefer /var/tmp is because it's often dramatically
> larger
>> than a ram-backed /tmp.
> 
> -- by Jeff Law.

That's bonkers.  It needlessly hurts performance and, on modern systems, adds 
needless SSD writes.

-- thorpej



Re: CVS import: src/external/broadcom/bwfm/dist

2020-03-22 Thread Jason Thorpe


> On Mar 22, 2020, at 12:00 PM, Jason R Thorpe  wrote:
> 
> 3 conflicts created by this import.

Note: These are false conflicts that are the result of the files being "cvs 
add"ed rather than imported originally.  I verified before the import that all 
files that we currently distribute are identical to versions in the current 
linux-firmware snapshot.

-- thorpej



Re: Modularize sun2 kernel (Re: CVS commit: src/sys/arch/sun2/conf)

2020-03-14 Thread Jason Thorpe


> On Mar 14, 2020, at 8:10 PM, Jason Thorpe  wrote:
> 
> redundant things (e.g. extent vs vmem)

In case this wasn't obvious, I favor ejecting extent in favor of vmem.

-- thorpej



Re: Modularize sun2 kernel (Re: CVS commit: src/sys/arch/sun2/conf)

2020-03-14 Thread Jason Thorpe



> On Mar 14, 2020, at 7:57 PM, Rin Okuyama  wrote:
> 
> I think that we can no longer support 4MB system because of (2); hangs
> due to (2) are much more serious for 4MB system than it is in 7MB system.
> Modern kernel allocates too much things on demand rather than statically
> allocating them in data segment...

We should be striving to make that work.  There are some redundant things (e.g. 
extent vs vmem) that we should explore getting rid of... and find ways to trim 
optionally functionality so we can keep these old systems running.

-- thorpej



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

2020-03-13 Thread Jason Thorpe


> On Mar 13, 2020, at 9:11 AM, Christos Zoulas  wrote:
> 
> I think this is better done in the driver, as other ports
> do the same check and it catches bugs.

x86 *explcitly* checks for 0 to skip work.  If you want to find bugs, change 
the most-often-used implementation maybe?

-- thorpej



Re: CVS commit: src/external/bsd/libarchive/dist/libarchive

2020-02-25 Thread Jason Thorpe
I repled to you and gson off-list.

> On Feb 25, 2020, at 8:24 AM, Kamil Rytarowski  wrote:
> 
> On 25.02.2020 16:24, Andreas Gustafsson wrote:
>> Kamil Rytarowski wrote:
>>> To generate a diff of this commit:
>>> cvs rdiff -u -r1.1.1.4 -r1.2 \
>>>src/external/bsd/libarchive/dist/libarchive/archive_read.c
>> 
>> What kind of sorcery is this?  Why is the diff not relative to 1.1?
>> 
> 
> I don't know. I was on the HEAD branch.
> 

-- thorpej



Re: CVS commit: src/sys

2020-02-08 Thread Jason Thorpe



> On Feb 8, 2020, at 12:45 PM, Andrew Doran  wrote:
> 
> Bit concerning that we're growing a ton of kthreads in the network stack (my
> test system now has something like 700 kthreads total) but I'm less worried
> about that and moreso that a lot of these seem to be in the kernel RT range
> and will therefore cause kernel preemptions when triggered.
> 
> For something like a link state change that's no biggie but I'm not fond of
> the idea of bulk wire & protcol processing needing mi_switch() + kpreempt(). 
> Way back when we made a concious decision not copy the design pattern our
> sister project went with on this front.  Maybe it is the right way to go now
> but I think that should also be a concious design decision.

Roger that.  I agree with you -- I would prefer "regular" stuff to continue 
using softints.  For some other stuff, though, we've made the policy decision 
that softints can't block for anything other than an adaptive mutex, which is 
fine... this particular case sends a message to the routing socket, which 
requires gathering interface statistics, which blocks on something other than 
an adaptive mutex.

I'm not a fan of the workqueue interface, and I have something better sitting 
unfinished in my Bucket Of Stuff I'm Working On ... a generalized "task" 
interface originally written-but-not-finished by Taylor that uses either thread 
pools or softints to do the work... so at least the threads won't linger around 
in the "mostly idle" case.

-- thorpej



Re: CVS commit: src/sys/net

2020-01-28 Thread Jason Thorpe


> On Jan 28, 2020, at 10:25 PM, Kamil Rytarowski  wrote:
> 
> The distribution build breaks for me with:

Should be fixed with:

 /cvsroot/src/sys/rump/net/lib/libnet/Makefile,v  <--  Makefile
 new revision: 1.33; previous revision: 1.32

> /public/netbsd-root/tooldir.NetBSD-9.99.38-amd64/lib/gcc/x86_64--netbsd/8.3.0/../../../../x86_64--netbsd/bin/ld:
> /public/netbsd-root/destdir.amd64/usr/lib/librumpnet_net.so: undefined
> reference to `rumpns_if_stats_init'
> /public/netbsd-root/tooldir.NetBSD-9.99.38-amd64/lib/gcc/x86_64--netbsd/8.3.0/../../../../x86_64--netbsd/bin/ld:
> /public/netbsd-root/destdir.amd64/usr/lib/librumpnet_net.so: undefined
> reference to `rumpns_if_stats_fini'
> /public/netbsd-root/tooldir.NetBSD-9.99.38-amd64/lib/gcc/x86_64--netbsd/8.3.0/../../../../x86_64--netbsd/bin/ld:
> /public/netbsd-root/destdir.amd64/usr/lib/librumpnet_net.so: undefined
> reference to `rumpns_if_stats_to_if_data'
> 

-- thorpej



Re: CVS commit: src/sys/arch/evbarm/conf

2020-01-25 Thread Jason Thorpe



> On Jan 25, 2020, at 6:31 AM, Christos Zoulas  wrote:
> 
>> This seems a little silly to have in the kernel configuration file.  I
>> think there's an argument to be made that there should be a header that
>> sets these defaults that can be tuned per-platform (or even some
>> functionality to tune this at run-time).
> 
> sysctl :-)

Shouldn't HAVE to know about the sysctl, either.  It should default to "good 
performance".

-- thorpej



Re: CVS commit: src/sys/arch/evbarm/conf

2020-01-25 Thread Jason Thorpe


> On Jan 25, 2020, at 4:26 AM, Jared D. McNeill  wrote:
> 
> Module Name:  src
> Committed By: jmcneill
> Date: Sat Jan 25 12:26:58 UTC 2020
> 
> Modified Files:
>   src/sys/arch/evbarm/conf: GENERIC GENERIC64
> 
> Log Message:
> Follow amd64 and set AUDIO_BLK_MS=4 by default

This seems a little silly to have in the kernel configuration file.  I think 
there's an argument to be made that there should be a header that sets these 
defaults that can be tuned per-platform (or even some functionality to tune 
this at run-time).

-- thorpej



Re: CVS commit: src/sys [freeze on boot]

2020-01-20 Thread Jason Thorpe


> On Jan 20, 2020, at 3:44 PM, Christos Zoulas  wrote:
> 
> In article <20200120185023.gd28...@homeworld.netbsd.org>,
> Andrew Doran   wrote:
>> Fix committed with sys/kern/kern_rwlock.c rev 1.62.  I didn't see the
>> problem as I am running with LOCKDEBUG.
>> 
>> Apologies for the disruption.
> 
> FYI: powerpc/arm do not build anymore...

This should fix the powerpc problem:

Index: lock_stubs.S
===
RCS file: /cvsroot/src/sys/arch/powerpc/powerpc/lock_stubs.S,v
retrieving revision 1.10
diff -u -p -r1.10 lock_stubs.S
--- lock_stubs.S28 Feb 2014 05:38:15 -  1.10
+++ lock_stubs.S21 Jan 2020 04:09:26 -
@@ -101,8 +101,8 @@ ENTRY(mutex_exit)
 /*
  * void rw_enter(krwlock_t *krw, krw_t op);
  */
-#if RW_READ_INCR != 16
-#error RW_READ_INCR != 16, clrrXi need fixing
+#if RW_READ_INCR != 32
+#error RW_READ_INCR != 32, clrrXi need fixing
 #endif
 #if RW_OWNER != 0
 #error RW_OWNER != 0, ldptr should be ldptru
@@ -115,7 +115,7 @@ ENTRY(rw_enter)
bne-1f
 
ldptr   %r9,RW_OWNER(%r3)
-   clrrptri %r9,%r9,4  /* clear low 4 bits */
+   clrrptri %r9,%r9,5  /* clear low 5 bits */
addi%r7,%r9,RW_READ_INCR
b   2f
 1:
@@ -140,7 +140,7 @@ ENTRY(rw_tryenter)
bne-1f
 
ldptr   %r9,RW_OWNER(%r3)
-   clrrptri %r9,%r9,4  /* clear low 4 bits */
+   clrrptri %r9,%r9,5  /* clear low 5 bits */
addi%r7,%r9,RW_READ_INCR
b   2f
 
@@ -169,7 +169,7 @@ ENTRY(rw_exit)
andi.   %r0,%r9,RW_WRITE_LOCKED
bne-1f
 
-   clrrptri. %r9,%r9,4 /* clear low 4 bits */
+   clrrptri. %r9,%r9,5 /* clear low 5 bits */
beq-3f  /* if 0, no reader, go slow */
 
addi%r7,%r9,-RW_READ_INCR

> 
> http://releng.netbsd.org/builds/HEAD/202001201020Z/
> 
> christos
> 

-- thorpej



Re: CVS commit: src/sys [freeze on boot]

2020-01-20 Thread Jason Thorpe



> On Jan 20, 2020, at 6:48 AM, Ryo ONODERA  wrote:
> 
> The black screen and ims(4) panic are not related to your change.
> Older src tree with LOCKDEBUG reproduces these problem.

I'll look at the ims(4) issuer.

-- thorpej



Re: MAX_PAGE_SIZE for m68k (Re: CVS commit:src/sys/arch/arm/include/arm32)

2020-01-14 Thread Jason Thorpe



> On Jan 14, 2020, at 2:37 PM, Christos Zoulas  wrote:
> 
> So what's the short term solution?
> 
> - Don't define {MIN,MAX}_PAGE_SIZE on m68k?
> - Define a different constant?
> - Add a define to tell uvm to ignore {MIN,MAX}_PAGE_SIZE?

#ifdef _KERNEL, define {MIN,MAX}_PAGE_SIZE to a constant that matches the 
system.  For !_KERNEL, define MIN_PAGE_SIZE as 4096 and MAX_PAGE_SIZE as 8192.

Seems like that would do the trick.

-- thorpej



Re: MAX_PAGE_SIZE for m68k (Re: CVS commit:src/sys/arch/arm/include/arm32)

2020-01-14 Thread Jason Thorpe



> On Jan 14, 2020, at 10:16 AM, Christos Zoulas  wrote:
> 
> We do this to save space, but as you say, not important for now. Perhaps
> the expedient solution is to define MALLOC_PAGE_SIZE...

I'd rather keep the use of these constants separate... who knows what they 
might be used for in the future?  Optimize #ifdef _KERNEL as-needed...

-- thorpej



Re: MAX_PAGE_SIZE for m68k (Re: CVS commit:src/sys/arch/arm/include/arm32)

2020-01-14 Thread Jason Thorpe



> On Jan 14, 2020, at 8:41 AM, Izumi Tsutsui  wrote:
> 
>> b) Modules should be built such that they can use a non-fixed PAGE_SIZE.
> 
> No, this is not necessary, because modules are built for each $MACHINE
> and (a) each $MACHINE has fixed PAGE_SIZE.

Yes, understood.  I think it would eventually be a nice idea to make modules 
$MACHINE_ARCH-sharable, but it's not critical for now.

-- thorpej



Re: MAX_PAGE_SIZE for m68k (Re: CVS commit: src/sys/arch/arm/include/arm32)

2020-01-13 Thread Jason Thorpe



> On Jan 13, 2020, at 8:15 AM, Izumi Tsutsui  wrote:
> 
> christos@ wrote:
> 
>>> Now I get the following erro during local tests of
>>> "build.sh -U -m hp300 release" on NetBSD/i386 9.0_RC1 host:
>>> 
>>> ---
>>> #create  compat_util/compat_exec.d
> :
>>> In file included from /s/cvs/src/sys/sys/param.h:149:0,
>>>from /s/cvs/src/sys/compat/common/compat_exec.c:41:
>>> ./m68k/pmap_motorola.h:165:5: error: operator '*' has no left operand
>>> #if PAGE_SIZE == 8192 /* NBPG / (SG4_LEV1SIZE * sizeof(st_entry_t)) */
>>>^
>>> nbmkdep: compile failed.
>>> *** [compat_exec.d] Error code 1
>> 
>> try cc -E?
> 
> It turns out the problem is more complicated.
> 
>  has the following definitions:
> 
> https://nxr.netbsd.org/xref/src/sys/uvm/uvm_param.h?r=1.38#135

I would suggest a possible workaround for this could be to define an additional:

#define __HAVE_FIXED_PAGE_SIZE

...at could also be tested here... the kernel truly does have a fixed page 
size, but userland not necessarily so.

> ---
>135  * If MIN_PAGE_SIZE and MAX_PAGE_SIZE are not equal, then we must use
>136  * non-constant PAGE_SIZE, et al for LKMs.
>137  */
>138 #if (MIN_PAGE_SIZE != MAX_PAGE_SIZE)
>139 #define__uvmexp_pagesize
>140 #if defined(_LKM) || defined(_MODULE)
>141 #undef PAGE_SIZE
>142 #undef PAGE_MASK
>143 #undef PAGE_SHIFT
>144 #endif
>145 #endif
>146 
>147 /*
>148  * Now provide PAGE_SIZE, PAGE_MASK, and PAGE_SHIFT if we do not
>149  * have ones that are compile-time constants.
>150  */
>151 #if !defined(PAGE_SIZE)
>152 extern const int *const uvmexp_pagesize;
>153 extern const int *const uvmexp_pagemask;
>154 extern const int *const uvmexp_pageshift;
>155 #definePAGE_SIZE   (*uvmexp_pagesize)  /* size of page 
> */
>156 #definePAGE_MASK   (*uvmexp_pagemask)  /* size of page 
> - 1 */
>157 #definePAGE_SHIFT  (*uvmexp_pageshift) /* bits to 
> shift for pages */
>158 #endif /* PAGE_SIZE */
> ---
> 
> I.e.  assumes PAGE_SIZE is not compile time constant
> for MODULEs if (MIN_PAGE_SIZE != MAX_PAGE_SIZE).
> 
> Probably this is the same reason of recent arm build failures:
> https://releng.netbsd.org/builds/HEAD/202001130720Z/
> https://releng.netbsd.org/builds/HEAD/202001130720Z/evbarm-earm.build.failed
> ---
> /tmp/genassym.Lq8h9d/assym.c:57:1: error: asm operand 0 probably doesn't 
> match constraints [-Werror]
> __asm("XYZZY VM_MIN_ADDRESS %0" : : "n" (VM_MIN_ADDRESS));
> ^
> /tmp/genassym.Lq8h9d/assym.c:58:1: error: asm operand 0 probably doesn't 
> match constraints [-Werror]
> __asm("XYZZY VM_MAXUSER_ADDRESS %0" : : "n" (VM_MAXUSER_ADDRESS));
> ^
> /tmp/genassym.Lq8h9d/assym.c:97:1: error: asm operand 0 probably doesn't 
> match constraints [-Werror]
> __asm("XYZZY PAGE_MASK %0" : : "n" (PAGE_MASK));
> ^
> /tmp/genassym.Lq8h9d/assym.c:98:1: error: asm operand 0 probably doesn't 
> match constraints [-Werror]
> __asm("XYZZY PAGE_SIZE %0" : : "n" (PAGE_SIZE));
> ^
> ---
> 
> Should we prepare independent constant for
> "possible pagesize value among different MACHINE with the same MACHINE_ARCH"
> for jemalloc(3)?
> 
> ---
> Izumi Tsutsui

-- thorpej



Re: CVS commit: src/sys

2020-01-13 Thread Jason Thorpe


> On Jan 12, 2020, at 10:20 PM, Kamil Rytarowski  wrote:
> 
> While there, could we garbage collect unused defines from sys/param.h?
> 
> I'm thinking in particular about:

As long as we still have tsleep(9) and friends, we can't rid ourselves of these 
historical defines.

Perhaps we should make a push to rid ourselves of those legacy interfaces?


> 
> /*
> * Historic priority levels.  These are meaningless and remain only
> * for source compatibility.  Do not use in new code.
> */
> #define PSWP0
> #define PVM 4
> #define PINOD   8
> #define PRIBIO  16
> #define PVFS20
> #define PZERO   22
> #define PSOCK   24
> #define PWAIT   32
> #define PLOCK   36
> #define PPAUSE  40
> #define PUSER   50
> #define MAXPRI  127
> 
> These symbols from time to time conflict with external loadable kernel
> modules. My immediate offender is VirtualBox and PVM symbol name conflict.
> 

-- thorpej



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

2020-01-12 Thread Jason Thorpe
We should absolutely verify this under DEBUG.

-- thorpej
Sent from my iPhone.

> On Jan 12, 2020, at 11:25 AM, Joerg Sonnenberger  wrote:
> 
> On Sun, Jan 12, 2020 at 01:01:12PM +, Andrew Doran wrote:
>> Module Name:src
>> Committed By:ad
>> Date:Sun Jan 12 13:01:12 UTC 2020
>> 
>> Modified Files:
>>src/sys/arch/x86/include: pmap.h pmap_pv.h
>>src/sys/arch/x86/x86: pmap.c vm_machdep.c x86_tlb.c
>> 
>> Log Message:
>> x86 pmap:
>> 
>> - It turns out that every page the pmap frees is necessarily zeroed.  Tell
>>  the VM system about this and use the pmap as a source of pre-zeroed pages.
> 
> Would it make sense to actually verify this under DEBUG? I fear the
> debugging we have to do if a chance ever violates this assumption.
> 
> Joerg



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

2020-01-12 Thread Jason Thorpe



> On Jan 11, 2020, at 10:47 PM, Izumi Tsutsui  wrote:
> 
> thorpej@ wrote:
> 
>>> PGSHIFT is defined in  and
>>> PAGE_SHIFT and PAGE_SIZE is in ,
>>> but there is no common .
>> 
>> Make a common  that all of the platforms can #include, and 
>> just put these common definitions in it (for now)?
> 
> How about the attached diff? (untested, just for review)

This looks good to me.

-- thorpej



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

2020-01-11 Thread Jason Thorpe



> On Jan 11, 2020, at 8:32 PM, Izumi Tsutsui  wrote:
> 
> PGSHIFT is defined in  and
> PAGE_SHIFT and PAGE_SIZE is in ,
> but there is no common .

Make a common  that all of the platforms can #include, and just 
put these common definitions in it (for now)?

-- thorpej



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

2020-01-09 Thread Jason Thorpe



> On Jan 9, 2020, at 9:02 PM, Masanobu SAITOH  wrote:
> 
> The reason why I moved stge_softc to if_stgereg.h was that ipgphy.c
> required to check stge's chip revision. So, if there is no any objection,
> I'll make new if_stgevar.h and share it with if_stge.c and ipgphy.c.

That seems fine.  Although it might be preferable to set a property on the 
parent dev_t and then query that from ipgphy, rather than accessing the softc.

-- thorpej



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

2020-01-09 Thread Jason Thorpe



> On Jan 9, 2020, at 6:11 PM, Masanobu SAITOH  wrote:
> 
> 
> Before my change, struct stge_softc is already in if_stgereg.h,
> so I had thought it would be OK to move to it.

Ah, I don't think I would have put it there when I wrote the driver originally, 
so it must have been moved there at some point.  In any case, moving it into 
if_stgereg.h was also an error.

> 
>> Please move them back to if_stge.c.  Doing incorrect things simply to reduce 
>> the diff against someone else's copy of the code is not something we should 
>> be undertaking.
> Two options:
> 
> a) Move some structs (including struct stge_softc) and defines
>to if_stge.c

There is no reason to have if_stgevar.h, because no other modules need these 
definitions, so it should all move to if_stge.c.

Thanks!

> 
> b) Move them to new if_stgevar.h
> 
> Which one is prefer?

-- thorpej



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

2020-01-09 Thread Jason Thorpe



> On Jan 9, 2020, at 2:54 AM, SAITOH Masanobu  wrote:
> 
> Module Name:  src
> Committed By: msaitoh
> Date: Thu Jan  9 10:54:16 UTC 2020
> 
> Modified Files:
>   src/sys/dev/pci: if_stge.c if_stgereg.h
> 
> Log Message:
> Reduce diff against OpenBSD. No functional change.
> 
> - USE CSR_{READ,WRITE}_*() macro.
> - Move some macros from if_stge.c to if_stgereg.h

This diff is incorrect.  The macros that were moved to if_stgereg.h are not 
related to hardware / register definitions, but are purely software constructs. 
 Please move them back to if_stge.c.  Doing incorrect things simply to reduce 
the diff against someone else's copy of the code is not something we should be 
undertaking.

-- thorpej



Re: CVS commit: src/sys

2020-01-03 Thread Jason Thorpe



> On Jan 3, 2020, at 5:08 PM, Simon Burge  wrote:
> 
> Hey Jason,
> 
> Jason Thorpe wrote:
> 
>>> On Jan 3, 2020, at 10:11 AM, Frank Kardel  wrote:
>>> 
>>> Hi Jason !
>>> 
>>> Could you please check that kmem using tools can cope with the missing 
>>> _boottime symbol.
>> 
>> Hey Frank... this should fix it:
>> 
>>  $NetBSD: vmstat.c,v 1.231 2020/01/03 19:13:54 thorpej Exp $
> 
> Is it worth keeping the boottime symbol about so that a netbsd-9 vmstat
> binary will still work with a -current kernel?  We could possibly wrap
> boottime with a COMPAT_90 check too?.

Define "work".  A dummy symbol would have no valid contents.  I guess if you 
call that "work" then go ahead?

The real problem here is that vmstat insists on finding the kernel symbols even 
if it's not going to use them, which is kind of silly.

-- thorpej



Re: CVS commit: src/sys

2020-01-03 Thread Jason Thorpe



> On Jan 3, 2020, at 10:11 AM, Frank Kardel  wrote:
> 
> Hi Jason !
> 
> Could you please check that kmem using tools can cope with the missing 
> _boottime symbol.

Hey Frank... this should fix it:

$NetBSD: vmstat.c,v 1.231 2020/01/03 19:13:54 thorpej Exp $

-- thorpej



Re: CVS commit: src/sys/arch

2019-12-23 Thread Jason Thorpe



> On Dec 23, 2019, at 7:53 PM, Taylor R Campbell 
>  wrote:
> 
>> Module Name:src
>> Committed By:   thorpej
>> Date:   Sun Dec 22 15:09:39 UTC 2019
>> 
>> Add intr_mask() and corresponding intr_unmask() calls that allow specific
>> interrupt lines / sources to be masked as needed (rather than making a
>> set of sources by IPL as with spl*()).
>> 
>> +   if (ci == curcpu() || !mp_online) {
>> +   intr_hwunmask_xcall(ih, NULL);
>> +   } else {
>> +   where = xc_unicast(0, intr_hwunmask_xcall, ih, NULL, ci);
>> +   xc_wait(where);
>> +   }
> 
> If this conditional is necessary, we should teach xc_unicast to make
> it unnecessary.

Agreed.  I followed the existing patter in intr.c.  Andrew pointed out in code 
review that the xcall code does at the the !mp_online bit now, but:

1- It does not do the curcpu() check.
2- It also fiddles with interrupt state.

For that reason, I was hesitant to make that change until further investigation 
was done.

-- thorpej



Re: CVS commit: src/sys/uvm

2019-12-23 Thread Jason Thorpe



> On Dec 23, 2019, at 7:22 PM, Taylor R Campbell 
>  wrote:
> 
> So I guess we won't be switching pg->phys_addr from paddr to pfn?

If that's the case, we should rename the field.

-- thorpej



Re: CVS commit: src/sys/kern

2019-12-09 Thread Jason Thorpe


> On Dec 9, 2019, at 1:08 PM, Paul Goyette  wrote:
> 
> On Mon, 9 Dec 2019, Andrew Doran wrote:
> 
>> Module Name: src
>> Committed By:ad
>> Date:Mon Dec  9 21:05:23 UTC 2019
>> 
>> Modified Files:
>>  src/sys/kern: kern_mutex.c
>> 
>> Log Message:
>> - Add a mutex_owner_running() for the benefit of the pagedaemon, which
>> needs help with locking things in reverse order.
> 
> Should this be added to the mutex(9) man page?

Honestly, I think it should be protectively wrapped in something like 
__MUTEX_PRIVATE or some such, because it's not really something that things 
should be using except under very specialized circumstances.

-- thorpej



Re: CVS commit: src/sys/arch/arm/broadcom

2019-11-28 Thread Jason Thorpe


> On Nov 28, 2019, at 2:21 AM, Jared McNeill  wrote:
> 
> I should have commented the code in gicv3 so that you would have realized it 
> was “unnecessarily complicated” for a reason :)

Ok, I'll fix and add a comment.

> 
> The interrupt_distribute(9) API makes an assumption that the return value of 
> anything_intr_establish can be used as input for the MD interrupt_distribute 
> implementation. For arm pic, struct intrsource * made most sense. It is a bit 
> of a hassle for fdtbus and really shows the need for an MI interrupt API.
> 
> So where this breaks things is if you have something in the kernel do:
> 
>   Ih = fdtbus_intr_establish(…)
>   interrupt_distribute(ih, target, NULL)
> 
> Currently the only place where this can happen is arch/arm/fdt/pmu_fdt.c but 
> IMHO the code is perfectly valid and could appear in other places in the 
> future.

-- thorpej



Re: case-sensitive APFS volumes

2019-11-13 Thread Jason Thorpe



> On Nov 13, 2019, at 1:57 AM, Christoph Badura  wrote:
> 
> Just HTF does one add the same cryptographic users that the / volume has?
> TFM does not tell.  It just says that "indeed, they should be added before
> encryption".

Hm, I'm not actually sure.  I'll do a bit of research.

> Maybe we can document this for the benfit of other NetBSD developers.
> 
> And yes, I do *not* want to dink around in the Disk Utility GUI.
> Automation or GTFO.

All of these things should be possible with the diskutil command.

-- thorpej



Re: CVS commit: src/sys/dev/ic

2019-09-21 Thread Jason Thorpe
Should we make a PRIxxx macro for it?

-- thorpej
Sent from my iPhone.

> On Sep 21, 2019, at 5:57 AM, Robert Elz  wrote:
> 
> Module Name:src
> Committed By:kre
> Date:Sat Sep 21 12:57:25 UTC 2019
> 
> Modified Files:
>src/sys/dev/ic: mpt.c
> 
> Log Message:
> bus_addt_t is different widths on different archs, so there is no
> one simple %?x format that will always work to print it.  Cast to
> intmax_t and use %jx which should work everywhere.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.19 -r1.20 src/sys/dev/ic/mpt.c
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 


Re: Leak Sanitizer - how to suppress leaks

2019-09-12 Thread Jason Thorpe


> On Sep 12, 2019, at 11:09 AM, Robert Elz  wrote:
> 
> To me it seems apparent that the sanatiser is detecting the local variable
> in main() go out of scope when main() returns, and so the value it contains
> (the pointer to the allocated memory) is lost, and so it is determined that
> there is a leak.   For any other function that would often be true, but for
> main() it never is.

It seems obvious that the sanitizer should special-case main().

-- thorpej



  1   2   >