Re: CVS commit: src/external/gpl3/gcc

2020-09-10 Thread Rin Okuyama

Hi again,

On 2020/09/10 21:53, Kamil Rytarowski wrote:

Module Name:src
Committed By:   kamil
Date:   Thu Sep 10 12:53:06 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux_libcdep.cc
src/external/gpl3/gcc/lib: Makefile.sanitizer

Log Message:
Avoid using internal RTLD/libpthread/libc symbol in sanitizers


...

Index: 
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
diff -u 
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.15
 
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.16
--- 
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.15
Mon Sep  7 07:10:43 2020
+++ 
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
 Thu Sep 10 12:53:05 2020
@@ -47,6 +47,7 @@
  #if SANITIZER_NETBSD
  #include 
  #include 
+#include 
  #endif
  
  #if SANITIZER_SOLARIS

@@ -417,13 +418,7 @@ uptr ThreadSelf() {
  
  #if SANITIZER_NETBSD

  static struct tls_tcb * ThreadSelfTlsTcb() {
-  struct tls_tcb * tcb = NULL;
-# ifdef __HAVE___LWP_GETTCB_FAST
-  tcb = (struct tls_tcb *)__lwp_gettcb_fast();
-# elif defined(__HAVE___LWP_GETPRIVATE_FAST)
-  tcb = (struct tls_tcb *)__lwp_getprivate_fast();
-# endif
-  return tcb;
+  return (struct tls_tcb *)_lwp_getprivate();
  }
  
  uptr ThreadSelf() {




This change breaks at least mips and powerpc, in which the return value of
__lwp_getprivate(2), i.e., curlwp->l_private is not tcb address itself, but
biased one. On the other hand, the return value of __lwp_gettcb_fast() is
unbiased address; see sys/arch/{mips,powerpc}/include/mcontext.h.

For powerpc, I recently attempted to change l_private to store tcb address
itself:

http://www.nerv.org/netbsd/?q=id:20200621T004000Z.95c1a18070b53713ce2c763df7f40743bf74172c

But I reverted it soon as requested by joerg:

http://www.nerv.org/netbsd/?q=id:20200622T053457Z.05db3be87b5ad499f5d1adba755bc573fd241c87

His reasoning was that kernel must not know the ABI details in userland.
I fully agree with this. See above links for more details.

Thanks,
rin


Re: CVS commit: src

2020-09-10 Thread Rin Okuyama

On 2020/09/10 18:28, Kamil Rytarowski wrote:

On 10.09.2020 10:50, Rin Okuyama wrote:

On 2020/09/10 16:41, Kamil Rytarowski wrote:

On 10.09.2020 03:53, Rin Okuyama wrote:

Module Name:src
Committed By:rin
Date:Thu Sep 10 01:53:22 UTC 2020

Modified Files:
 src/distrib/sets/lists/base: mi
 src/distrib/sets/lists/comp: mi
 src/sys/dev: Makefile

Log Message:
Unconditionally install kernel headers for iSCSI as required by
sanitizer shipped with GCC9.

Fix build release with HAVE_GCC=9 for sun2, where MKISCSI=no by default.



Please redo this commit with __has_include(), example:

https://github.com/llvm/llvm-project/commit/7f6b25ad1bb3f8057655a9bad2a3b69621f4a543#diff-fa188a123646bb8c30d7fa22d61ef680




Hmm, I'm not sure whether it is worth the maintenance cost and
complexities it adds... Is there any reason why we should not
install these headers?



The headers are optional and sanitizers shall not dictate what headers
are installed.

Meanwhile, I'm going to do this in upstream LLVM.


Yes, I really appreciate your continuous efforts in syncing our
codes with upstream.

However, still, there is ``the maintenance cost'' in our local
repository. With __has_include(), we must maintain two copies of
headers in the tree. This is dangerous potentially.

My question was whether it is worth the risk not to install few
number of small headers.

Thanks,
rin


Re: CVS commit: src

2020-09-10 Thread Taylor R Campbell
> Module Name:src
> Committed By:   maxv
> Date:   Sat Sep  5 07:22:26 UTC 2020
> 
> nvmm: update copyright headers
> 
> [...]
> -.\" Copyright (c) 2018-2020 The NetBSD Foundation, Inc.
> +.\" Copyright (c) 2018-2020 Maxime Villard, m00nbsd.net
>  .\" All rights reserved.
>  .\"
> -.\" This code is derived from software contributed to The NetBSD Foundation
> -.\" by Maxime Villard.
> +.\" This code is part of the NVMM hypervisor.

Please restore the NetBSD Foundation copyright notice.

You can add your own copyright notice in addition to it, for copyright
covering subsequent changes to the file, or on new files.  But you
already committed this code to the tree years ago, and it's gone out
in a NetBSD release with the NetBSD Foundation copyright notice.

If you want TNF to reassign the copyright back to you, please contact
board to discuss it rather than just quietly changing the existing
copyright notice on the file in the tree.


Re: CVS commit: src

2020-09-10 Thread Kamil Rytarowski
On 10.09.2020 10:50, Rin Okuyama wrote:
> On 2020/09/10 16:41, Kamil Rytarowski wrote:
>> On 10.09.2020 03:53, Rin Okuyama wrote:
>>> Module Name:    src
>>> Committed By:    rin
>>> Date:    Thu Sep 10 01:53:22 UTC 2020
>>>
>>> Modified Files:
>>> src/distrib/sets/lists/base: mi
>>> src/distrib/sets/lists/comp: mi
>>> src/sys/dev: Makefile
>>>
>>> Log Message:
>>> Unconditionally install kernel headers for iSCSI as required by
>>> sanitizer shipped with GCC9.
>>>
>>> Fix build release with HAVE_GCC=9 for sun2, where MKISCSI=no by default.
>>>
>>
>> Please redo this commit with __has_include(), example:
>>
>> https://github.com/llvm/llvm-project/commit/7f6b25ad1bb3f8057655a9bad2a3b69621f4a543#diff-fa188a123646bb8c30d7fa22d61ef680
>>
>>
> 
> Hmm, I'm not sure whether it is worth the maintenance cost and
> complexities it adds... Is there any reason why we should not
> install these headers?
> 

The headers are optional and sanitizers shall not dictate what headers
are installed.

Meanwhile, I'm going to do this in upstream LLVM.

> Thanks,
> rin




signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src

2020-09-10 Thread Rin Okuyama

On 2020/09/10 16:41, Kamil Rytarowski wrote:

On 10.09.2020 03:53, Rin Okuyama wrote:

Module Name:src
Committed By:   rin
Date:   Thu Sep 10 01:53:22 UTC 2020

Modified Files:
src/distrib/sets/lists/base: mi
src/distrib/sets/lists/comp: mi
src/sys/dev: Makefile

Log Message:
Unconditionally install kernel headers for iSCSI as required by
sanitizer shipped with GCC9.

Fix build release with HAVE_GCC=9 for sun2, where MKISCSI=no by default.



Please redo this commit with __has_include(), example:

https://github.com/llvm/llvm-project/commit/7f6b25ad1bb3f8057655a9bad2a3b69621f4a543#diff-fa188a123646bb8c30d7fa22d61ef680



Hmm, I'm not sure whether it is worth the maintenance cost and
complexities it adds... Is there any reason why we should not
install these headers?

Thanks,
rin


Re: CVS commit: src

2020-09-10 Thread Kamil Rytarowski
On 10.09.2020 03:53, Rin Okuyama wrote:
> Module Name:  src
> Committed By: rin
> Date: Thu Sep 10 01:53:22 UTC 2020
> 
> Modified Files:
>   src/distrib/sets/lists/base: mi
>   src/distrib/sets/lists/comp: mi
>   src/sys/dev: Makefile
> 
> Log Message:
> Unconditionally install kernel headers for iSCSI as required by
> sanitizer shipped with GCC9.
> 
> Fix build release with HAVE_GCC=9 for sun2, where MKISCSI=no by default.
> 

Please redo this commit with __has_include(), example:

https://github.com/llvm/llvm-project/commit/7f6b25ad1bb3f8057655a9bad2a3b69621f4a543#diff-fa188a123646bb8c30d7fa22d61ef680



signature.asc
Description: OpenPGP digital signature