thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

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

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