[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [qemu-s390x] [PATCH v8 3/6] s390x/kvm: enable/disable AP instruction
From: |
Cornelia Huck |
Subject: |
Re: [qemu-s390x] [PATCH v8 3/6] s390x/kvm: enable/disable AP instruction interpretation for guest |
Date: |
Thu, 20 Sep 2018 13:12:27 +0200 |
On Wed, 12 Sep 2018 16:08:17 -0400
Tony Krowiak <address@hidden> wrote:
> From: Tony Krowiak <address@hidden>
>
> Let's use the KVM_SET_DEVICE_ATTR ioctl to enable or disable
> hardware interpretation of AP instructions executed on the guest.
> If the S390_FEAT_AP feature is installed, AP instructions will
> be interpreted by default; otherwise, they will be intercepted.
> This attribute setting may be overridden by a device. For example,
> a device may want to provide AP instructions to the guest (i.e.,
> S390_FEAT_AP turned on), but it may want to emulate them. In this
> case, the AP instructions executed on the guest must be
> intercepted; so when the device is realized, it must disable
> interpretation.
>
> Signed-off-by: Tony Krowiak <address@hidden>
> ---
> target/s390x/kvm.c | 16 ++++++++++++++++
> 1 files changed, 16 insertions(+), 0 deletions(-)
>
> diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
> index c4bd84d..28a3900 100644
> --- a/target/s390x/kvm.c
> +++ b/target/s390x/kvm.c
> @@ -2297,6 +2297,19 @@ void kvm_s390_get_host_cpu_model(S390CPUModel *model,
> Error **errp)
> S390_FEAT_MAX);
> }
>
> +static void kvm_s390_configure_apie(int interpret)
> +{
> + uint64_t attr = KVM_S390_VM_CRYPTO_DISABLE_APIE;
> +
> + if (interpret) {
> + attr = KVM_S390_VM_CRYPTO_ENABLE_APIE;
> + }
uint64_t attr = interpret ? KVM_S390_VM_CRYPTO_ENABLE_APIE :
KVM_S390_VM_CRYPTO_DISABLE_APIE;
?
> +
> + if (kvm_vm_check_attr(kvm_state, KVM_S390_VM_CRYPTO, attr)) {
> + kvm_s390_set_attr(attr);
> + }
> +}
> +
> void kvm_s390_apply_cpu_model(const S390CPUModel *model, Error **errp)
> {
> struct kvm_s390_vm_cpu_processor prop = {
> @@ -2346,6 +2359,9 @@ void kvm_s390_apply_cpu_model(const S390CPUModel
> *model, Error **errp)
> if (test_bit(S390_FEAT_CMM, model->features)) {
> kvm_s390_enable_cmma();
> }
> +
> + /* configure hardware interpretation of AP instructions */
> + kvm_s390_configure_apie(test_bit(S390_FEAT_AP, model->features));
> }
>
> void kvm_s390_restart_interrupt(S390CPU *cpu)
- Re: [qemu-s390x] [PATCH v8 2/6] s390x/cpumodel: Set up CPU model for AP device support, (continued)
Re: [qemu-s390x] [PATCH v8 3/6] s390x/kvm: enable/disable AP instruction interpretation for guest,
Cornelia Huck <=
[qemu-s390x] [PATCH v8 4/6] s390x/ap: base Adjunct Processor (AP) object model, Tony Krowiak, 2018/09/12
- Re: [qemu-s390x] [PATCH v8 4/6] s390x/ap: base Adjunct Processor (AP) object model, Thomas Huth, 2018/09/13
- Re: [qemu-s390x] [PATCH v8 4/6] s390x/ap: base Adjunct Processor (AP) object model, Christian Borntraeger, 2018/09/13
- Re: [qemu-s390x] [PATCH v8 4/6] s390x/ap: base Adjunct Processor (AP) object model, Christian Borntraeger, 2018/09/13
- Re: [qemu-s390x] [PATCH v8 4/6] s390x/ap: base Adjunct Processor (AP) object model, Tony Krowiak, 2018/09/13
- Re: [qemu-s390x] [PATCH v8 4/6] s390x/ap: base Adjunct Processor (AP) object model, Tony Krowiak, 2018/09/13
- Re: [qemu-s390x] [Qemu-devel] [PATCH v8 4/6] s390x/ap: base Adjunct Processor (AP) object model, Halil Pasic, 2018/09/13
- Re: [qemu-s390x] [Qemu-devel] [PATCH v8 4/6] s390x/ap: base Adjunct Processor (AP) object model, Tony Krowiak, 2018/09/14
[qemu-s390x] [PATCH v8 5/6] s390x/vfio: ap: Introduce VFIO AP device, Tony Krowiak, 2018/09/12