public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] KVM: PPC: Enable user space handled SPRs
@ 2012-10-06 23:41 Alexander Graf
  2012-10-06 23:41 ` [PATCH 1/3] KVM: PPC: Move mtspr/mfspr emulation into own functions Alexander Graf
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Alexander Graf @ 2012-10-06 23:41 UTC (permalink / raw)
  To: kvm-ppc; +Cc: kvm

While trying to get 440 autotest to work, I stumbled over an issue we have
in our API. Today, SPRs are handled exclusively in kernel space. Resets are
handled in user space. Usually that works because the notification that we
want to do a reset comes through PIO/MMIO.

However, in the case of 440, it comes through an SPR write. This breaks for
us because user space never knows it should actually handle this. We have more
situations like this where user space wants to know about SPR reads and writes.
For example the e500 fast interrupt acknowledge register needs to communicate
with the MPIC. That one is not implemented in the kernel today though. So we
need user space cooperation again.

As a generic solution, I figured it's the easiest way forward to just pass all
SPRs we can not handle in kernel space on to user space, so it can decide what
to do with them. If it doesn't want to handle them, it can always return back
to kernel space with a failure which would be treated the same as if the SPR
could not get handled by kernel space in the first place.

This way we can extend the whole thing to registers we can't even dream of that
through some funky SoC interactions talk to devices on the same chip that are
modeled in user space.

Alex

Alexander Graf (3):
  KVM: PPC: Move mtspr/mfspr emulation into own functions
  KVM: PPC: Add SPR emulation exits
  KVM: PPC: BookE: Forward DBCR0 to user space

 Documentation/virtual/kvm/api.txt   |   37 +++++
 arch/powerpc/include/asm/kvm_host.h |    3 +
 arch/powerpc/include/asm/kvm_ppc.h  |    1 +
 arch/powerpc/kvm/book3s_pr.c        |    4 +
 arch/powerpc/kvm/booke.c            |    4 +
 arch/powerpc/kvm/booke_emulate.c    |   12 ++-
 arch/powerpc/kvm/emulate.c          |  249 +++++++++++++++++++++--------------
 arch/powerpc/kvm/powerpc.c          |   20 +++
 include/linux/kvm.h                 |   12 ++
 9 files changed, 240 insertions(+), 102 deletions(-)


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2012-10-08 21:07 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-06 23:41 [PATCH 0/3] KVM: PPC: Enable user space handled SPRs Alexander Graf
2012-10-06 23:41 ` [PATCH 1/3] KVM: PPC: Move mtspr/mfspr emulation into own functions Alexander Graf
2012-10-06 23:41 ` [PATCH 2/3] KVM: PPC: Add SPR emulation exits Alexander Graf
2012-10-07 13:13   ` Avi Kivity
2012-10-07 13:19     ` Alexander Graf
2012-10-07 13:26       ` Avi Kivity
2012-10-07 13:30         ` Alexander Graf
2012-10-07 13:34           ` Avi Kivity
2012-10-07 13:37             ` Alexander Graf
2012-10-08 20:45           ` Scott Wood
2012-10-08 21:01             ` Alexander Graf
2012-10-08 21:07               ` Scott Wood
2012-10-07 13:26       ` Alexander Graf
2012-10-07 13:30         ` Avi Kivity
2012-10-07 13:33           ` Alexander Graf
2012-10-06 23:41 ` [PATCH 3/3] KVM: PPC: BookE: Forward DBCR0 to user space Alexander Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox