tech-kern archive

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

Re: PAE support for kvm(3)



On Fri, Oct 01, 2010 at 02:35:22AM +0200, Jean-Yves Migeon wrote:

> Attached is the patch required to add PAE support in kvm(3). Except for
> one "major" nit (see below), it seems to be functional: I can sync a
> kernel, with or without PAE enabled, and all libkvm binaries (vmstat(1),
> netstat(1), ...) still work on the core files.
> 
> I am facing an interesting limitation there: some weeks ago, I added a
> symbol, i386_use_pae. This variable is also exposed through a sysctl(7):
> "machdep.pae".
> 
> Goal was to easily provide an indication whether a kernel is currently
> using PAE mode or not, and also query its value through kvm_nlist(3) (to
> select the proper kvatop function, depending on the mode).
> 
> However, I have some kind of "chicken-egg" situation there: getting
> i386_use_pae value needs a go through KREAD/kvm_read, but these
> functions cannot work properly until the correct kvatop function has
> been selected. Downside is, this depends on i386_use_pae value...
> 
> At this late hour, I cannot think of a quick and clean solution. Adding
> an element to the cpu_kcore_hdr_t will break all core dumps from before
> the change (the offset of the memory segments, "memsegs", will differ);
> that would need compat code to cope with that. Another possibility is to
> set the last bit in pdppaddr to indicate PAE activation, but, this seems
> like a dirty hack (I don't think that PDPpaddr will ever go that high
> though).
> 
> Any advice for that one? Thanks in advance!

I haven't thought it through, but:

- put a marker in the symbol table
- or, put a boolean value at a well-known physical address (locore)



Home | Main Index | Thread Index | Old Index