Thread (13 messages) 13 messages, 3 authors, 2013-02-13

RE: BOOKE KVM calling load_up_fpu from C?

From: Bhushan Bharat-R65777 <hidden>
Date: 2013-02-13 01:26:45

-----Original Message-----
From: Wood Scott-B07421
Sent: Wednesday, February 13, 2013 6:53 AM
To: Bhushan Bharat-R65777
Cc: Wood Scott-B07421; Michael Neuling; linuxppc-dev@lists.ozlabs.org
Subject: Re: BOOKE KVM calling load_up_fpu from C?
=20
On 02/12/2013 07:18:14 PM, Bhushan Bharat-R65777 wrote:
quoted
quoted
-----Original Message-----
From: Wood Scott-B07421
Sent: Wednesday, February 13, 2013 12:03 AM
To: Bhushan Bharat-R65777
Cc: Michael Neuling; Wood Scott-B07421;
linuxppc-dev@lists.ozlabs.org
quoted
Subject: Re: BOOKE KVM calling load_up_fpu from C?

On 02/12/2013 03:01:07 AM, Bhushan Bharat-R65777 wrote:
quoted
To me this looks wrong. And this seems to works because the
thread->reg->msr is not actually used to write SRR1 (and
eventually
quoted
quoted
the thread MSR) when doing rfi to enter guest. Infact
Guest(shadow_msr) MSR is used as SRR1 and which will have proper
MSR
quoted
quoted
(including FP set).

But Yes, Scott is right person to comment, So let us wait for him
comment.
I don't think it's actually a problem on 32-bit, since r9 is
modified but never
quoted
actually used for anything.
Is not the epilog loads srr1 in r9 and load_up_fpu() changes r9 and
then r9 is written back in srr1 ?
=20
What epilog?  We're talking about the case where it's called from C code
=20
When it's called from an exception handler, then r9 is used, but in that =
case
it's also initialized before calling load_up_fpu, by the prolog.
Agree. Was just confirming the exception handler case.
=20
quoted
quoted
 On 64-bit, though, there's a store to the caller's stack frame
(yuck) which the kvm/booke.h caller is not prepared for.
So if caller is using r12 then it can lead to come corruption, right ?
=20
No, r12 is a volatile register in the ABI, as is r9.  The issue is that t=
he
stack can be corrupted.
Ok, Thanks
-Bharat
=20
-Scott
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help