Re: [PATCH] kvm-s390: userspace access to guest storage keys

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/06/2011 01:25 PM, Carsten Otte wrote:
From: Carsten Otte<cotte@xxxxxxxxxx>

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@xxxxxxxxxx>
---
  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.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux