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

2018-07-10 Thread Kamil Rytarowski
On 08.07.2018 17:44, Kamil Rytarowski wrote: > I will try to scratch a new header unaligned.h with the set of macros > and submit it to evaluation. I've prepared a scratch of unaligned.h with get_unaligned(): http://netbsd.org/~kamil/kubsan/unaligned.h There are at least two problems to

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

2018-07-09 Thread Kamil Rytarowski
On 09.07.2018 16:58, Thor Lancelot Simon wrote: > On Mon, Jul 09, 2018 at 12:24:15PM +0200, Kamil Rytarowski wrote: >> >> The C11 standard could indeed use consistent wording. In one place >> "correctly aligned" in other alignment "restrictions" and >> "requirements". None of these terms is marked

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

2018-07-09 Thread Christos Zoulas
In article <20180709145848.ga21...@panix.com>, Thor Lancelot Simon wrote: >On Mon, Jul 09, 2018 at 12:24:15PM +0200, Kamil Rytarowski wrote: >> >> The C11 standard could indeed use consistent wording. In one place >> "correctly aligned" in other alignment "restrictions" and >> "requirements".

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

2018-07-09 Thread Thor Lancelot Simon
On Mon, Jul 09, 2018 at 12:24:15PM +0200, Kamil Rytarowski wrote: > > The C11 standard could indeed use consistent wording. In one place > "correctly aligned" in other alignment "restrictions" and > "requirements". None of these terms is marked as a keyword or term and I > read them in the

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

2018-07-09 Thread Kamil Rytarowski
On 09.07.2018 11:32, Martin Husemann wrote: > On Mon, Jul 09, 2018 at 11:00:15AM +0200, Kamil Rytarowski wrote: >> According to my understanding, alignment requirement for a type/object >> is implementation defined (6.2.8); however during the process of >> converting types, if the returned pointer

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

2018-07-09 Thread Martin Husemann
On Mon, Jul 09, 2018 at 11:00:15AM +0200, Kamil Rytarowski wrote: > According to my understanding, alignment requirement for a type/object > is implementation defined (6.2.8); however during the process of > converting types, if the returned pointer is not correctly aligned the > result is

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

2018-07-09 Thread Kamil Rytarowski
On 09.07.2018 10:09, Martin Husemann wrote: > On Sun, Jul 08, 2018 at 03:30:36PM +0200, Kamil Rytarowski wrote: >> Misaligned pointer is explicitly documented as undefined behavior in the >> C standard (C11 6.3.2.3 p7). (In C++ it's basically the same.) > > Yes, but the standard dos not define

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

2018-07-09 Thread Martin Husemann
On Sun, Jul 08, 2018 at 03:30:36PM +0200, Kamil Rytarowski wrote: > Misaligned pointer is explicitly documented as undefined behavior in the > C standard (C11 6.3.2.3 p7). (In C++ it's basically the same.) Yes, but the standard dos not define what a misaligned pointer is (or "correctly aligned").

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

2018-07-08 Thread Mouse
>>> Misaligned pointer is explicitly documented as undefined behavior >>> in the C standard (C11 6.3.2.3 p7). >> So what? Do you have reason to think that sys/arch/x86 will at some >> point be ported to a compiler [] that does something unexpected with >> that code? > Due to UB a compiler is free

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

2018-07-08 Thread Kamil Rytarowski
On 08.07.2018 17:30, Mouse wrote: > Caveat: this is all opinion. I'm not the one doing the work here. > > src/sys/arch/x86/x86: mpbios.c > > Remove unaligned access to mpbios_page[] > > sys/arch/x86/x86/mpbios.c:308:11, load of misaligned address > 0x800031c7a413

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

2018-07-08 Thread Kamil Rytarowski
On 08.07.2018 17:16, Jason Thorpe wrote: > > >> On Jul 8, 2018, at 6:30 AM, Kamil Rytarowski wrote: >> >> In future __NO_STRICT_ALIGNMENT could be defined for aarch64, at least >> for the use of acpica (which still contains a fallback for Itanium >> without misaligned access, but not actively

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

2018-07-08 Thread Mouse
Caveat: this is all opinion. I'm not the one doing the work here. src/sys/arch/x86/x86: mpbios.c Remove unaligned access to mpbios_page[] sys/arch/x86/x86/mpbios.c:308:11, load of misaligned address 0x800031c7a413 for type 'const __uint16_t' which requires 2

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

2018-07-08 Thread Jason Thorpe
> On Jul 8, 2018, at 6:30 AM, Kamil Rytarowski wrote: > > In future __NO_STRICT_ALIGNMENT could be defined for aarch64, at least > for the use of acpica (which still contains a fallback for Itanium > without misaligned access, but not actively maintained). > > Linux uses a different approach

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

2018-07-08 Thread Kamil Rytarowski
On 08.07.2018 15:53, Jaromír Doleček wrote: > Le dim. 8 juil. 2018 à 15:29, Kamil Rytarowski a écrit : >> I've introduced the change to mpbios.c as it was small, selfcontained >> and without the need to decorate the whole function. > > Am I reading the code wrong or you actually introduced bug

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

2018-07-08 Thread Jaromír Doleček
Le dim. 8 juil. 2018 à 15:29, Kamil Rytarowski a écrit : > I've introduced the change to mpbios.c as it was small, selfcontained > and without the need to decorate the whole function. Am I reading the code wrong or you actually introduced bug in mpbios.c? Shouldn't this: memtop |=

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

2018-07-08 Thread Kamil Rytarowski
On 08.07.2018 11:24, Martin Husemann wrote: > On Sun, Jul 08, 2018 at 10:49:53AM +0200, Jaromír Dole?ek wrote: >>> Module Name:src >>> Committed By: kamil >>> Date: Sat Jul 7 23:05:50 UTC 2018 >>> >>> Modified Files: >>> src/sys/arch/x86/x86: mpbios.c >>> >>> Log Message:

Module auto-unloading (was Re: CVS commit: src/sys/arch/x86/x86)

2011-10-18 Thread Jared McNeill
We could use the reference counter in struct cfdriver to keep driver modules busy, but I'm not sure if the system can figure out what's unneeded if a needed driver might be one for a hotpluggable device. Would you treat those drivers differently? What about drivers (if_ath_pci comes to mind)

Re: Module auto-unloading (was Re: CVS commit: src/sys/arch/x86/x86)

2011-10-18 Thread David Young
On Tue, Oct 18, 2011 at 11:28:22AM -0400, Jared McNeill wrote: I played around with driver module autoloading a while back, and it worked pretty well but the implementation I came up with required duplicating match data in module.plist. This sounds like a step in the right direction (recording

Re: Module auto-unloading (was Re: CVS commit: src/sys/arch/x86/x86)

2011-10-18 Thread Jared McNeill
I think you'd just need to find a way to supply that data for built-in modules too. On Tue, 18 Oct 2011, David Young wrote: On Tue, Oct 18, 2011 at 11:28:22AM -0400, Jared McNeill wrote: I played around with driver module autoloading a while back, and it worked pretty well but the

Re: Module auto-unloading (was Re: CVS commit: src/sys/arch/x86/x86)

2011-10-18 Thread Jachym Holecek
# David Young 2011-10-18: On Tue, Oct 18, 2011 at 11:28:22AM -0400, Jared McNeill wrote: I played around with driver module autoloading a while back, and it worked pretty well but the implementation I came up with required duplicating match data in module.plist. This sounds like a step

Re: Module auto-unloading (was Re: CVS commit: src/sys/arch/x86/x86)

2011-10-18 Thread David Young
On Tue, Oct 18, 2011 at 12:50:58PM -0400, Jachym Holecek wrote: # David Young 2011-10-18: On Tue, Oct 18, 2011 at 11:28:22AM -0400, Jared McNeill wrote: I played around with driver module autoloading a while back, and it worked pretty well but the implementation I came up with required