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

2016-08-09 Thread Maxime Villard

Le 08/08/2016 à 04:27, Cherry G. Mathew a écrit :

On 2 August 2016 at 19:51, Maxime Villard > wrote:

Module Name:src
Committed By:   maxv
Date:   Tue Aug  2 14:21:53 UTC 2016

Modified Files:
src/sys/arch/xen/x86: x86_xpmap.c

Log Message:
Map the kernel text, rodata and data+bss independently on Xen, with
respectively RX, R and RW.



Hi - wondering why you're getting more divergence from generic x86 -


We are not getting more divergence.


is there a way to do this (and the pg_nx stuff for eg:) without having to 
special case this in Xen ?


Not really. On a normal x86, when the kernel starts, the CPU does not yet have
64bit registers, paging, WP, NX, MSRs, etc. The kernel itself enables them,
and to do so, it uses temporary variables and a temporary page tree before
relocating itself at KERNBASE. All this needs to be done in assembly.

On Xen, however, when the kernel starts, the CPU already has 64bit registers,
paging etc, so the only thing the kernel has to do is creating its own page
table, and for that purpose it also uses temporary variables, such as pg_nx.
This time, it all can be done in C.

This initialization process is referred to as the locore, and even if machdep
and pmap can be shared between amd64<->i386<->PAE<->Xen, the locore cannot. When
it comes to pg_nx, we cannot use pmap_pg_nx, since it is part of the pmap, which
is shared and initialized later. For that same reason, we use nox_flag in
assembly in the amd64 and i386 locores.


Re: CVS commit: src/tests/lib/libc/sys

2016-08-09 Thread Robert Elz
Date:Tue, 9 Aug 2016 12:02:44 +
From:"Robert Elz" 
Message-ID:  <20160809120244.9f9d0f...@cvs.netbsd.org>

Ignore this part ...

  | Note that NetBSD mlock(2) talks about EINVAL for cases where the length
  | parameter is negative ... but that is a size_t - good luck having that
  | ever occur (the man page will soon be corrected as well.)

I was reading the man page on a NetBSD-7 system ... didn't notice that
the man page was already corrected in current until I went to fix it!

kre