Port-amd64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

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



Le 22/06/2019 à 22:29, maya%netbsd.org@localhost a écrit :
On Fri, Dec 01, 2017 at 09:22:45PM +0000, Maxime Villard wrote:
Module Name:	src
Committed By:	maxv
Date:		Fri Dec  1 21:22:45 UTC 2017

Modified Files:
	src/sys/arch/amd64/amd64: machdep.c process_machdep.c

Log Message:
Don't even bother with the trap frame, and force the default values.


What's the rationale?
Not getting the correct values for registers in getmcontext is
unexpected and weird.

FYI, in 64bit mode, x86 does not enforce segmentation. You can set whatever
base/limit in the segregs, it doesn't get applied.

Moreover, certain instructions like 'syscall' force certain segregs to default
values, regardless of what userland had set.

Also, if you look at the commit before, you can see I had found an info leak
caused by the fact that we were fetching the segregs without masking them
properly.

So, given that (1) these segregs have no functional change, (2) some are forced
to default values anyway, and (3) the way we were fetching them had already
proven to be buggy, I just dropped the thing and set the default values.

This is expected and normal, likely prevents future bugs, and also simplifies
the understanding of USER_LDT.


Home | Main Index | Thread Index | Old Index