public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: kvm-ppc@vger.kernel.org
Cc: kvm@vger.kernel.org
Subject: [PATCH 0/3] KVM: PPC: Enable user space handled SPRs
Date: Sun,  7 Oct 2012 01:41:19 +0200	[thread overview]
Message-ID: <1349566882-10948-1-git-send-email-agraf@suse.de> (raw)

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(-)


             reply	other threads:[~2012-10-06 23:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-06 23:41 Alexander Graf [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1349566882-10948-1-git-send-email-agraf@suse.de \
    --to=agraf@suse.de \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox