Port-amd64 archive

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

Re: amd64 dtrace module VM limitation



Please don't assume that amd64 is Direct Mapped in all cases - it isn't for XEN kernels

One of the boot time constraints for XEN PV is the amount of VA mapped in, which is used to allocate KVA backing tables. If the number of entries in NKL2_KIMG_ENTRIES causes backing page VA allocation to exceed the amount of fixed, mapped-in VA, which can be as low as 512KB, then there's no way for the bootstrap to continue.

In practice, what this would mean would be to test a XEN kernel on your new value before assuming it's safe.


On 23 August 2014 00:53, Taylor R Campbell <riastradh%netbsd.org@localhost> wrote:
Right now if you build an amd64 GENERIC kernel with KDTRACE_HOOKS and
try to load solaris.kmod and dtrace.kmod, it will fail with ENOMEM.

This happens because there's only something like 32 MB of KVA
available for the the module loader as set up between module_start and
module_end by initx86_load_memmap and determined by the definition of
NKL2_KIMG_ENTRIES in <amd64/pmap.h>:

#define NKL2_KIMG_ENTRIES       16

        module_start = kern_end;
        module_end = KERNBASE + NKL2_KIMG_ENTRIES * NBPD_L2;

where NBPD_L2 is 2 MB.  NKL2_KIMG_ENTRIES was bumped from 10 a couple
years ago.

I don't understand what all the constraints on this limitation are,
other than that it is necessary for the module loader to relocate JMPs
without overflowing the instruction width.  But I would like to avoid
having to bump this every time the kernel gets a little larger.

At the very least, in order to make dtrace work `out of the box' in
netbsd-7 (as far as it can without being on by default), can we bump
this to 32 for now?

And can someone who understands the issue better than I either find or
help me find a better way to impose the relevant constraint than to
hard-code 16 (or 32 or whatever) here?



--
~Cherry


Home | Main Index | Thread Index | Old Index