Source-Changes-D archive

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

re: CVS commit: src/sys/arch



On Tue, 17 Aug 2010 09:59:54 +1000, matthew green <mrg%eterna.com.au@localhost>
wrote:
>> For kernel core dumps, at the present time, no; this needs thinking,
and
>> testing:
>> - kvm(3) API will have to move from using 'unsigned long' to 'paddr_t'.
I
>> am currently checking that for all architectures except i386,
>> sizeof(paddr_t) == sizeof(u_long).
> 
> sparc and 32 bit sparc64 kernels use 64 bit paddr_t.  there are some
> mips ports that do too.  you can't assume the above equality at all,
> not since "paddr_t" was introduced a decade+ ago.

Eeek. I can't see how I can fix that then. Would it be acceptable to say
"the affected functions are private to kvm(3), so don't bother with this
anyway?"

>> - i386 will use 64 bits paddr_t for kvm(3), so we will have to discuss
on
z> how to make it work without too much fuzz with pre-64 bits i386 dumps.
> 
> i think this seems the sanest way.  make userland see the 64 bit
> definition in all cases, and have the libkvm code DTRT.

Thing is, kvm(3) has two functions (kvm_kvatop and kvm_pa2off) that use
PAs internally and assume they are unsigned long. I can't move i386 to 64
bits PA without having to tweak kvm_private.h prototypes, which will affect
all ports in turn.

IMHO, the path of least resistance would be to move to paddr_t.

>> - sparse dumps for memory above 4GB.
>> 
>> Eventually, PAE and !PAE kernels core files should be handled by kvm,
if
>> that's what you are asking.
> 
> right.  i was suggesting that if you simply used nlist(3) to find out
the
> value of "i386_use_pae" then the same code will work for live debugging
> as well as core dumps.
> 
> since core file debugging basically requires this method, and it works
> just as well for live debugging, the sysctl seems like something we
don't
> need to do.

I insist: the sysctl(7) was never meant to be used for checking whether
PAE is enabled for "live" kvm(3) session. I admit, my commit message is not
very clear: the " Will be used by i386 kvm(3) to know the functions that
should [...]" sentence applies to i386_use_pae, not machdep.pae.

It is only there for convenience, eg. when someone wants to know easily if
its system is running under PAE.

-- 
Jean-Yves Migeon
jeanyves.migeon%free.fr@localhost


Home | Main Index | Thread Index | Old Index