diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2012-05-15 08:15:25 -0400 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2012-05-17 20:06:01 -0400 |
commit | 1526bf9ccf310f1d35c1275b8b477a249d25aaf2 (patch) | |
tree | 61c7b138818c52df2dfcdc8a58ee891b198f424e /arch/s390/kvm | |
parent | d8368af8b46b904def42a0f341d2f4f29001fa77 (diff) |
KVM: s390: add capability indicating COW support
Currently qemu/kvm on s390 uses a guest mapping that does not
allow the guest backing page table to be write-protected to
support older systems. On those older systems a host write
protection fault will be delivered to the guest.
Newer systems allow to write-protect the guest backing memory
and let the fault be delivered to the host, thus allowing COW.
Use a capability bit to tell qemu if that is possible.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/s390/kvm')
-rw-r--r-- | arch/s390/kvm/kvm-s390.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index e5e3800b0125..5c761bffa02d 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <asm/pgtable.h> | 28 | #include <asm/pgtable.h> |
29 | #include <asm/nmi.h> | 29 | #include <asm/nmi.h> |
30 | #include <asm/switch_to.h> | 30 | #include <asm/switch_to.h> |
31 | #include <asm/sclp.h> | ||
31 | #include "kvm-s390.h" | 32 | #include "kvm-s390.h" |
32 | #include "gaccess.h" | 33 | #include "gaccess.h" |
33 | 34 | ||
@@ -140,6 +141,9 @@ int kvm_dev_ioctl_check_extension(long ext) | |||
140 | case KVM_CAP_MAX_VCPUS: | 141 | case KVM_CAP_MAX_VCPUS: |
141 | r = KVM_MAX_VCPUS; | 142 | r = KVM_MAX_VCPUS; |
142 | break; | 143 | break; |
144 | case KVM_CAP_S390_COW: | ||
145 | r = sclp_get_fac85() & 0x2; | ||
146 | break; | ||
143 | default: | 147 | default: |
144 | r = 0; | 148 | r = 0; |
145 | } | 149 | } |