All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Carsten Otte <cotte@de.ibm.com>
Cc: KVM list <kvm@vger.kernel.org>,
	Christian Borntraeger <CBORNTRA@de.ibm.com>,
	Martin Schwidefsky <martin.schwidefsky@de.ibm.com>,
	Jens Freimann <JFREI@de.ibm.com>
Subject: Re: [PATCH] kvm-s390: userspace access to guest storage keys
Date: Mon, 09 May 2011 11:43:04 +0300	[thread overview]
Message-ID: <4DC7A918.6050807@redhat.com> (raw)
In-Reply-To: <4DC3CC83.4080405@de.ibm.com>

On 05/06/2011 01:25 PM, Carsten Otte wrote:
> From: Carsten Otte<cotte@de.ibm.com>
>
> This patch gives userspace access to the guest visible storage keys. Three
> operations are supported:
> KVM_S390_KEYOP_SSKE for setting storage keys, similar to the set storage key
> extended (SSKE) instruction.
> KVM_S390_KEYOP_ISKE for reading storage key content, similar to the insert
> storage key extended (ISKE) instruction.
> KVM_s390_KEYOP_RRBE for reading and resetting the page reference bit, similar
> to the reset reference bit extended (RRBE) instruction.
> Note that all functions take userspace addresses as input, which typically
> differ from guest addresses.
>
> This work was requested by Alex Graf for guest live migration: Different from
> x86 the guest's view of dirty and reference information is not stored in the
> page table entrys that are part of the guest address space but are stored in
> the storage key instead. Thus, the storage key needs to be read, transfered,
> and written back on the migration target side.
>

And not in main memory, either?

> Signed-off-by: Carsten Otte<cotte@de.ibm.com>
> ---
>   arch/s390/include/asm/kvm_host.h |    4 +
>   arch/s390/kvm/kvm-s390.c         |  149 ++++++++++++++++++++++++++++++++++++++-
>   include/linux/kvm.h              |    7 +

Documentation/kvm/api.txt ++++++++++++

>   3 files changed, 157 insertions(+), 3 deletions(-)
>
> Index: linux-2.6/arch/s390/include/asm/kvm_host.h
> ===================================================================
> --- linux-2.6.orig/arch/s390/include/asm/kvm_host.h
> +++ linux-2.6/arch/s390/include/asm/kvm_host.h
> @@ -47,6 +47,10 @@ struct sca_block {
>   #define KVM_HPAGE_MASK(x)	(~(KVM_HPAGE_SIZE(x) - 1))
>   #define KVM_PAGES_PER_HPAGE(x)	(KVM_HPAGE_SIZE(x) / PAGE_SIZE)
>
> +#define KVM_S390_KEYOP_SSKE 0x01
> +#define KVM_S390_KEYOP_ISKE 0x02
> +#define KVM_S390_KEYOP_RRBE 0x03

kvm_host.h is not exported to userspace.  Use asm/kvm.h instead.

<snip black magic>

-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.


  reply	other threads:[~2011-05-09  8:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-06 10:25 [PATCH] kvm-s390: userspace access to guest storage keys Carsten Otte
2011-05-09  8:43 ` Avi Kivity [this message]
2011-05-09 10:11   ` Alexander Graf
2011-05-09 11:20     ` Avi Kivity
2011-05-09 11:32       ` Alexander Graf
2011-05-10 11:29         ` Christian Borntraeger

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=4DC7A918.6050807@redhat.com \
    --to=avi@redhat.com \
    --cc=CBORNTRA@de.ibm.com \
    --cc=JFREI@de.ibm.com \
    --cc=cotte@de.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=martin.schwidefsky@de.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.