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

2018-06-21 Thread Maxime Villard

Le 22/06/2018 à 03:40, matthew green a écrit :

"Maxime Villard" writes:

Module Name:src
Committed By:   maxv
Date:   Tue Jun 19 09:25:13 UTC 2018

Modified Files:
src/sys/arch/x86/x86: fpu.c

Log Message:
When using EagerFPU, create the fpu state in execve at IPL_HIGH.


why splhigh instead of kpreempt_disable()?


Nick Hudson asked me the same question yesterday, here's the relevant part
of my answer (quoting his mail, I guess he doesn't mind).

The fpu code already runs at splhigh, and this disables preemption. So I
used splhigh too.




 Message transféré 
Sujet : Re: Fwd: CVS commit: src/sys/arch/x86/x86
Date : Thu, 21 Jun 2018 07:23:33 +0100
De : Nick Hudson 
Pour : Maxime Villard 

On 21/06/2018 07:21, Maxime Villard wrote:

Le 21/06/2018 à 08:11, Nick Hudson a écrit :

On 21/06/2018 06:42, Maxime Villard wrote:

Le 21/06/2018 à 07:34, Maxime Villard a écrit :

Le 21/06/2018 à 07:21, Nick Hudson a écrit :

Surely, kpreempt_{disable,enable}() is what you really mean?

Nick


No, I mean splhigh. splhigh does prevent preemption, is that 
incorrect?


If you want to disable preemption then kpreempt_disable() is what you 
want.


If you want to disable interrupts (and as a consequence pre-emption) 
then splhigh is what you want.


I firmly believe you want the former.

Why disable interupts unnecessarily? This is "bad practice" and 
shouldn't be left for others to cargo cult copy.


There is a KASSERT in fpusave_cpu(), which I didn't introduce. We want
IPL_HIGH, unconditionally.

So no, I don't want the former, the FPU code wants the latter. Then we 
can say that maybe splhigh is not needed after all in fpusave_cpu; I won't 
risk introducing random races.


In the commit I said "disable preemption" because I had in mind the 
problem where a context switch occurs as a result of preemption.


Up to you... really don't know why FPU code needs interrupts disabled.


re: CVS commit: src/share/mk

2018-06-21 Thread matthew green
"Maya Rashish" writes:
> Module Name:  src
> Committed By: maya
> Date: Wed Jun 20 02:15:13 UTC 2018
> 
> Modified Files:
>   src/share/mk: sys.mk
> 
> Log Message:
> Strip -Wsystem-headers from CXXFLAGS.
> 
> GCC's C++ headers are not clean (yet). They are trying, but haven't got there
> yet.
> 
> Necessary for including  which uses .

can you add a comment about this?  the stripping is normally
about stuff that c++ frontend does not support, vs stuff that
breaks because of other issues.

ie, the rest of them should always stay, but this one will
hopefully go away in the future.

thanks.


.mrg.


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

2018-06-21 Thread matthew green
"Maxime Villard" writes:
> Module Name:  src
> Committed By: maxv
> Date: Tue Jun 19 09:25:13 UTC 2018
> 
> Modified Files:
>   src/sys/arch/x86/x86: fpu.c
> 
> Log Message:
> When using EagerFPU, create the fpu state in execve at IPL_HIGH.

why splhigh instead of kpreempt_disable()?


.mrg.


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

2018-06-21 Thread Joerg Sonnenberger
On Sun, Jun 17, 2018 at 03:46:39PM +, Maxime Villard wrote:
> Module Name:  src
> Committed By: maxv
> Date: Sun Jun 17 15:46:39 UTC 2018
> 
> Modified Files:
>   src/sys/arch/i386/include: frameasm.h
> 
> Log Message:
> i586 and below don't have this 3-byte nop, so use three 1-byte nops,
> reported by Nathanial Sloss

Can't we use 0x66 0x89 0xc0 for this purpose, i.e. movw %ax, %ax?

Joerg


Re: CVS commit: src/external/mpl/dhcp

2018-06-21 Thread Kamil Rytarowski
On 21.06.2018 13:09, Paul Goyette wrote:
> On Thu, 21 Jun 2018, Kamil Rytarowski wrote:
> 
>> Module Name:    src
>> Committed By:    kamil
>> Date:    Thu Jun 21 11:02:48 UTC 2018
>>
>> Modified Files:
>> src/external/mpl/dhcp: Makefile.inc
>>
>> Log Message:
>> Make building of dhcp compatible with MKSANITIZER
>>
>> Disable LD flags (-Wl,-Bstatic and -Wl,-Bdynamic) with enabled
>> MKSANITIZER.
>> These options are incompatible with the current design of sanitizers,
>> because they cause duplication of symbols into programs and thus symbols
>> from the interceptors from sanitizers cannot be linked.
>>
>> This change makes effectively mounting /usr required for dhcp programs
>> like
>> dhclient(8).
> 
> This could be difficult if /usr is nfs-mount and requires dhcp and
> friends for setting up the network.
> 
> 

There is no functional change for MKSANITIZER=no users (the default ones).

For MKSANITIZER=yes ones it's a tradeoff.



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/external/mpl/dhcp

2018-06-21 Thread Paul Goyette

On Thu, 21 Jun 2018, Kamil Rytarowski wrote:


Module Name:src
Committed By:   kamil
Date:   Thu Jun 21 11:02:48 UTC 2018

Modified Files:
src/external/mpl/dhcp: Makefile.inc

Log Message:
Make building of dhcp compatible with MKSANITIZER

Disable LD flags (-Wl,-Bstatic and -Wl,-Bdynamic) with enabled MKSANITIZER.
These options are incompatible with the current design of sanitizers,
because they cause duplication of symbols into programs and thus symbols
from the interceptors from sanitizers cannot be linked.

This change makes effectively mounting /usr required for dhcp programs like
dhclient(8).


This could be difficult if /usr is nfs-mount and requires dhcp and 
friends for setting up the network.




+--+--++
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:  |
| (Retired)| FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+--+--++