tech-kern archive

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

Re: "Hijacking" a PCU.

On Sat, Dec 15, 2012 at 07:47:44PM +0100, Martin Husemann wrote:
> On Sat, Dec 15, 2012 at 06:49:13PM +0000, David Laight wrote:
> > An alternative would be to make the code that wants to use the
> > PCU provide the save area (or probably a place where a malloced
> > pointer to the save area will be written).
> IMHO it depends on the nature of the "U" in PCU.
> For example: sparc64 (not yet using pcu(9)) has a pointer in the uarea
> pointing to an fpu save area, allocated on first fpu access in the lwp
> (sparc* fpu state is quite big and on sparc64 can be saved in two
> halves, i.e. there are two "this part of the regs has been touched" flags).

That would also be true for x86 with the AVX extensions.

Indeed the mechanism that supports AVX supports future extensions
and lets the kernel ask the cpu how big a save area is needed for
the specific set of enabled extensions.

As well as allowing the kernel to allocate an area that is 'big enough',
it probably allows this to be deferred until userspace faults trying
to execute one of the relevant instructions.

Given that the structure has to be 64byte aligned, allocating them
separately from the lwp structure might be sensible.


David Laight:

Home | Main Index | Thread Index | Old Index