Port-amd64 archive

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

lkm_map



Hi,

when playing with the new module framework, I tried to load/unload
the example module.  Loading works like a charm, but when unloading
the module, the system panics with an assertion failure in
uvm_km_pgremove_intrsafe at line 473, i.e. the

        KASSERT(end <= VM_MAX_KERNEL_ADDRESS);

I tracked it down to the fact that VM_MAX_KERNEL_ADDRESS is
defined (in sys/arch/amd64/include/vmparam.h) as 0xffffff8000000000.
At the same time the lkm_map (which is used to map modules) is
allocated in sys/arch/amd64/amd64/machdep.c just beyond the kernel
itself (probably in order to be able to use short(er?) calls from
the module into the kernel).  The kernel virtual space starts at
KERNBASE, defined (in sys/arch/amd64/include/param.h) as
0xffffffff80000000.  This results in the lkm_map not being part
of the kernel_map, which then leads to the assertion failure
observed.

So the question is, why is VM_MAX_KERNEL_ADDRESS defined this low,
so that the "kernel virtual space", i.e. KERNBASE, is not within
(VM_MIN_KERNEL_ADDRESS, KERN_MAX_KERNEL_ADDRESS(?

Ciao,
Wolfgang
--
Wolfgang%Solfrank.net@localhost


Home | Main Index | Thread Index | Old Index