yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-s390x-cpumodel-Set-up-CPU-model-for-AQIC-interceptio.patch

Pablo Greco e6a3ae
From ad53e96559cfe9d5f1b5518c3c925618e7e1bcc7 Mon Sep 17 00:00:00 2001
Pablo Greco e6a3ae
From: Thomas Huth <thuth@redhat.com>
Pablo Greco e6a3ae
Date: Wed, 18 Sep 2019 14:35:49 +0100
Pablo Greco e6a3ae
Subject: [PATCH 10/22] s390x/cpumodel: Set up CPU model for AQIC interception
Pablo Greco e6a3ae
Pablo Greco e6a3ae
RH-Author: Thomas Huth <thuth@redhat.com>
Pablo Greco e6a3ae
Message-id: <20190918143549.16340-3-thuth@redhat.com>
Pablo Greco e6a3ae
Patchwork-id: 90760
Pablo Greco e6a3ae
O-Subject: [RHEL-8.2.0 qemu-kvm PATCH 2/2] s390x/cpumodel: Set up CPU model for AQIC interception
Pablo Greco e6a3ae
Bugzilla: 1660909
Pablo Greco e6a3ae
RH-Acked-by: David Hildenbrand <david@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Jens Freimann <jfreimann@redhat.com>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
From: Pierre Morel <pmorel@linux.ibm.com>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Let's add support for the AP-Queue interruption facility to the CPU
Pablo Greco e6a3ae
model.
Pablo Greco e6a3ae
Pablo Greco e6a3ae
The S390_FEAT_AP_QUEUE_INTERRUPT_CONTROL, CPU facility indicates
Pablo Greco e6a3ae
whether the PQAP instruction with the AQIC command is available
Pablo Greco e6a3ae
to the guest.
Pablo Greco e6a3ae
This feature will be enabled only if the AP instructions are
Pablo Greco e6a3ae
available on the linux host and AQIC facility is installed on
Pablo Greco e6a3ae
the host.
Pablo Greco e6a3ae
Pablo Greco e6a3ae
This feature must be turned on from userspace to intercept AP
Pablo Greco e6a3ae
instructions on the KVM guest. The QEMU command line to turn
Pablo Greco e6a3ae
this feature on looks something like this:
Pablo Greco e6a3ae
Pablo Greco e6a3ae
    qemu-system-s390x ... -cpu xxx,apqi=on ...
Pablo Greco e6a3ae
or
Pablo Greco e6a3ae
    ... -cpu host
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Right now AP pass-through devices do not support migration,
Pablo Greco e6a3ae
which means that we do not have to take care of migrating
Pablo Greco e6a3ae
the interrupt data:
Pablo Greco e6a3ae
virsh migrate apguest --live qemu+ssh://root@target.lan/system
Pablo Greco e6a3ae
error: Requested operation is not valid: domain has assigned non-USB host devices
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
Pablo Greco e6a3ae
Reviewed-by: Tony Krowiak <akrowiak@linux.ibm.com>
Pablo Greco e6a3ae
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Pablo Greco e6a3ae
Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Pablo Greco e6a3ae
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Pablo Greco e6a3ae
[rebase to newest qemu and fixup description]
Pablo Greco e6a3ae
Message-Id: <20190705153249.12525-1-borntraeger@de.ibm.com>
Pablo Greco e6a3ae
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Pablo Greco e6a3ae
(cherry picked from commit 9ef2d19e5f5dfdebc9877c77951c28f25c74e000)
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Pablo Greco e6a3ae
---
Pablo Greco e6a3ae
 target/s390x/cpu_features_def.inc.h | 1 +
Pablo Greco e6a3ae
 target/s390x/cpu_models.c           | 1 +
Pablo Greco e6a3ae
 target/s390x/gen-features.c         | 1 +
Pablo Greco e6a3ae
 3 files changed, 3 insertions(+)
Pablo Greco e6a3ae
Pablo Greco e6a3ae
diff --git a/target/s390x/cpu_features_def.inc.h b/target/s390x/cpu_features_def.inc.h
Pablo Greco e6a3ae
index 011ce4d..dead061 100644
Pablo Greco e6a3ae
--- a/target/s390x/cpu_features_def.inc.h
Pablo Greco e6a3ae
+++ b/target/s390x/cpu_features_def.inc.h
Pablo Greco e6a3ae
@@ -77,6 +77,7 @@ DEF_FEAT(SEMAPHORE_ASSIST, "sema", STFL, 59, "Semaphore-assist facility")
Pablo Greco e6a3ae
 DEF_FEAT(TIME_SLICE_INSTRUMENTATION, "tsi", STFL, 60, "Time-slice Instrumentation facility")
Pablo Greco e6a3ae
 DEF_FEAT(MISC_INSTRUCTION_EXT3, "minste3", STFL, 61, "Miscellaneous-Instruction-Extensions Facility 3")
Pablo Greco e6a3ae
 DEF_FEAT(RUNTIME_INSTRUMENTATION, "ri", STFL, 64, "CPU runtime-instrumentation facility")
Pablo Greco e6a3ae
+DEF_FEAT(AP_QUEUE_INTERRUPT_CONTROL, "apqi", STFL, 65, "AP-Queue interruption facility")
Pablo Greco e6a3ae
 DEF_FEAT(ZPCI, "zpci", STFL, 69, "z/PCI facility")
Pablo Greco e6a3ae
 DEF_FEAT(ADAPTER_EVENT_NOTIFICATION, "aen", STFL, 71, "General-purpose-adapter-event-notification facility")
Pablo Greco e6a3ae
 DEF_FEAT(ADAPTER_INT_SUPPRESSION, "ais", STFL, 72, "General-purpose-adapter-interruption-suppression facility")
Pablo Greco e6a3ae
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
Pablo Greco e6a3ae
index 91afc6b..f16ef64 100644
Pablo Greco e6a3ae
--- a/target/s390x/cpu_models.c
Pablo Greco e6a3ae
+++ b/target/s390x/cpu_models.c
Pablo Greco e6a3ae
@@ -792,6 +792,7 @@ static void check_consistency(const S390CPUModel *model)
Pablo Greco e6a3ae
         { S390_FEAT_PTFF_QTOUE, S390_FEAT_MULTIPLE_EPOCH },
Pablo Greco e6a3ae
         { S390_FEAT_PTFF_STOE, S390_FEAT_MULTIPLE_EPOCH },
Pablo Greco e6a3ae
         { S390_FEAT_PTFF_STOUE, S390_FEAT_MULTIPLE_EPOCH },
Pablo Greco e6a3ae
+        { S390_FEAT_AP_QUEUE_INTERRUPT_CONTROL, S390_FEAT_AP },
Pablo Greco e6a3ae
     };
Pablo Greco e6a3ae
     int i;
Pablo Greco e6a3ae
 
Pablo Greco e6a3ae
diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c
Pablo Greco e6a3ae
index 24d78e9..17bb04e 100644
Pablo Greco e6a3ae
--- a/target/s390x/gen-features.c
Pablo Greco e6a3ae
+++ b/target/s390x/gen-features.c
Pablo Greco e6a3ae
@@ -519,6 +519,7 @@ static uint16_t full_GEN12_GA1[] = {
Pablo Greco e6a3ae
     S390_FEAT_EDAT_2,
Pablo Greco e6a3ae
     S390_FEAT_SIDE_EFFECT_ACCESS_ESOP2,
Pablo Greco e6a3ae
     S390_FEAT_AP_QUERY_CONFIG_INFO,
Pablo Greco e6a3ae
+    S390_FEAT_AP_QUEUE_INTERRUPT_CONTROL,
Pablo Greco e6a3ae
     S390_FEAT_AP_FACILITIES_TEST,
Pablo Greco e6a3ae
     S390_FEAT_AP,
Pablo Greco e6a3ae
 };
Pablo Greco e6a3ae
-- 
Pablo Greco e6a3ae
1.8.3.1
Pablo Greco e6a3ae