tech-kern archive

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

Re: "Hijacking" a PCU.



On Dec 15, 2012, at 12:54 PM, David Laight wrote:

> On Sat, Dec 15, 2012 at 11:24:09AM -0800, Matt Thomas wrote:
>>> There are several problems though:
>>> 1) gdb (etc) will find the wrong registers for the lwp.
>> 
>> Not really since you can't return to user land before surrendering the PCU.
> 
> An lwp could easily sleep with a PCU assigned (especially if the FP
> regs are being used for copyin/out).
> 
> I'm fairly sure there is an expectation of being able to read an lwp's
> user-space registers at any time. While they might be stale (eg when the
> process is in userspace), I doubt they are expected to be completely wrong.
> 
> I'm not sure what effect delayed saving of FP registers has on this.
> Possibly the call to retrieve the registers ensures the FP state
> is flushed to memory.

It does.  And the user-space register are flushed to memory before the
kernel can steal it PCU.


Home | Main Index | Thread Index | Old Index