[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 4/7] s390x/kvm: interface to interpret AP instruc
From: |
Tony Krowiak |
Subject: |
[Qemu-devel] [PATCH v3 4/7] s390x/kvm: interface to interpret AP instructions |
Date: |
Thu, 15 Mar 2018 19:24:57 -0400 |
The VFIO AP device exploits interpretive execution of AP
instructions (APIE). APIE is enabled by setting a device attribute
via the KVM_SET_DEVICE_ATTR ioctl.
Signed-off-by: Tony Krowiak <address@hidden>
---
target/s390x/kvm.c | 16 ++++++++++++++++
target/s390x/kvm_s390x.h | 2 ++
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
index 33e5ec3..2812e28 100644
--- a/target/s390x/kvm.c
+++ b/target/s390x/kvm.c
@@ -277,6 +277,22 @@ static void kvm_s390_init_dea_kw(void)
}
}
+int kvm_s390_set_interpret_ap(uint8_t enable)
+{
+ struct kvm_device_attr attribute = {
+ .group = KVM_S390_VM_CRYPTO,
+ .attr = KVM_S390_VM_CRYPTO_INTERPRET_AP,
+ .addr = 1,
+ };
+
+ if (!kvm_vm_check_attr(kvm_state, KVM_S390_VM_CRYPTO,
+ KVM_S390_VM_CRYPTO_INTERPRET_AP)) {
+ return -EOPNOTSUPP;
+ }
+
+ return kvm_vm_ioctl(kvm_state, KVM_SET_DEVICE_ATTR, &attribute);
+}
+
void kvm_s390_crypto_reset(void)
{
if (s390_has_feat(S390_FEAT_MSA_EXT_3)) {
diff --git a/target/s390x/kvm_s390x.h b/target/s390x/kvm_s390x.h
index 34ee7e7..0d6c6e7 100644
--- a/target/s390x/kvm_s390x.h
+++ b/target/s390x/kvm_s390x.h
@@ -40,4 +40,6 @@ void kvm_s390_crypto_reset(void);
void kvm_s390_restart_interrupt(S390CPU *cpu);
void kvm_s390_stop_interrupt(S390CPU *cpu);
+int kvm_s390_set_interpret_ap(uint8_t enable);
+
#endif /* KVM_S390X_H */
--
1.7.1
- Re: [Qemu-devel] [qemu-s390x] [PATCH v3 6/7] s390x/kvm: handle AP instruction interception, (continued)
- [Qemu-devel] [PATCH v3 1/7] linux-headers: linux header updates for AP support, Tony Krowiak, 2018/03/15
- [Qemu-devel] [PATCH v3 5/7] s390x/vfio: ap: Introduce VFIO AP device, Tony Krowiak, 2018/03/15
- Re: [Qemu-devel] [PATCH v3 5/7] s390x/vfio: ap: Introduce VFIO AP device, Pierre Morel, 2018/03/16
- Re: [Qemu-devel] [PATCH v3 5/7] s390x/vfio: ap: Introduce VFIO AP device, Halil Pasic, 2018/03/16
- Re: [Qemu-devel] [PATCH v3 5/7] s390x/vfio: ap: Introduce VFIO AP device, Tony Krowiak, 2018/03/16
- Re: [Qemu-devel] [PATCH v3 5/7] s390x/vfio: ap: Introduce VFIO AP device, Halil Pasic, 2018/03/16
- Re: [Qemu-devel] [PATCH v3 5/7] s390x/vfio: ap: Introduce VFIO AP device, Tony Krowiak, 2018/03/16
- Re: [Qemu-devel] [PATCH v3 5/7] s390x/vfio: ap: Introduce VFIO AP device, Halil Pasic, 2018/03/16
- Re: [Qemu-devel] [PATCH v3 5/7] s390x/vfio: ap: Introduce VFIO AP device, Tony Krowiak, 2018/03/16
[Qemu-devel] [PATCH v3 4/7] s390x/kvm: interface to interpret AP instructions,
Tony Krowiak <=
[Qemu-devel] [PATCH v3 3/7] s390x/cpumodel: Set up CPU model for AP device support, Tony Krowiak, 2018/03/15
[Qemu-devel] [PATCH v3 7/7] s390: doc: detailed specifications for AP virtualization, Tony Krowiak, 2018/03/15