Thread (45 messages) flat view 45 messages, 5 authors, 2012-02-17

Re: [RFC PATCH 14/16] KVM: PPC: booke: category E.HV (GS-mode) support

From: Alexander Graf <hidden>
Date: 2012-02-15 19:36:12
Also in: kvm

On 10.01.2012, at 01:51, Scott Wood wrote:
On 01/09/2012 11:46 AM, Alexander Graf wrote:
quoted
=20
On 21.12.2011, at 02:34, Scott Wood wrote:
=20
[...]
quoted
quoted
Current issues include:
- Machine checks from guest state are not routed to the host =
handler.
quoted
quoted
- The guest can cause a host oops by executing an emulated =
instruction
quoted
quoted
 in a page that lacks read permission.  Existing e500/4xx support =
has
quoted
quoted
 the same problem.
=20
We solve that in book3s pr by doing
=20
 LAST_INST =3D <known bad value>;
 PACA->kvm_mode =3D <recover at next inst>;
 lwz(guest pc);
 do_more_stuff();
=20
That way when an exception occurs at lwz() the DO_KVM handler checks =
that we're in kvm mode "recover" which does basically srr0+=3D4; rfi;.
=20
I was thinking we'd check ESR[EPID] or SRR1[IS] as appropriate, and
treat it as a kernel fault (search exception table) -- but this works
too and is a bit cleaner (could be other uses of external pid), at the
expense of a couple extra instructions in the emulation path (but
probably a slightly faster host TLB handler).
=20
The check wouldn't go in DO_KVM, though, since on bookehv that only
deals with diverting flow when xSRR1[GS] is set, which wouldn't be the
case here.
Thinking about it a bit more, how is this different from a failed =
get_user()? We can just use the same fixup mechanism as there, right?

Alex
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help