thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-s390x-protvirt-allow-to-IPL-secure-guests-with-no-re.patch

8fced6
From 8b994757136780998e0dd1d41613d2006c0dbcf6 Mon Sep 17 00:00:00 2001
8fced6
From: Thomas Huth <thuth@redhat.com>
8fced6
Date: Tue, 4 Aug 2020 10:16:04 -0400
8fced6
Subject: [PATCH 4/4] s390x/protvirt: allow to IPL secure guests with
8fced6
 -no-reboot
8fced6
8fced6
RH-Author: Thomas Huth <thuth@redhat.com>
8fced6
Message-id: <20200804101604.6259-2-thuth@redhat.com>
8fced6
Patchwork-id: 98126
8fced6
O-Subject: [RHEL-8.3.0 qemu-kvm PATCH 1/1] s390x/protvirt: allow to IPL secure guests with -no-reboot
8fced6
Bugzilla: 1863034
8fced6
RH-Acked-by: Danilo de Paula <ddepaula@redhat.com>
8fced6
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
8fced6
RH-Acked-by: David Hildenbrand <david@redhat.com>
8fced6
8fced6
From: Christian Borntraeger <borntraeger@de.ibm.com>
8fced6
8fced6
Right now, -no-reboot prevents secure guests from running. This is
8fced6
correct from an implementation point of view, as we have modeled the
8fced6
transition from non-secure to secure as a program directed IPL. From
8fced6
a user perspective, this is not the behavior of least surprise.
8fced6
8fced6
We should implement the IPL into protected mode similar to the
8fced6
functions that we use for kdump/kexec. In other words, we do not stop
8fced6
here when -no-reboot is specified on the command line. Like function 0
8fced6
or function 1, function 10 is not a classic reboot. For example, it
8fced6
can only be called once. Before calling it a second time, a real
8fced6
reboot/reset must happen in-between. So function code 10 is more or
8fced6
less a state transition reset, but not a "standard" reset or reboot.
8fced6
8fced6
Fixes: 4d226deafc44 ("s390x: protvirt: Support unpack facility")
8fced6
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
8fced6
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
8fced6
Reviewed-by: David Hildenbrand <david@redhat.com>
8fced6
Acked-by: Viktor Mihajlovski <mihajlov@linux.ibm.com>
8fced6
Message-Id: <20200721103202.30610-1-borntraeger@de.ibm.com>
8fced6
[CH: tweaked description]
8fced6
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
8fced6
(cherry picked from commit d1bb69db4ceb6897ef6a17bf263146b53a123632)
8fced6
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
8fced6
---
8fced6
 hw/s390x/ipl.c | 3 ++-
8fced6
 1 file changed, 2 insertions(+), 1 deletion(-)
8fced6
8fced6
diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
8fced6
index 586d95b5b6..5b3ea990af 100644
8fced6
--- a/hw/s390x/ipl.c
8fced6
+++ b/hw/s390x/ipl.c
8fced6
@@ -624,7 +624,8 @@ void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type)
8fced6
         }
8fced6
     }
8fced6
     if (reset_type == S390_RESET_MODIFIED_CLEAR ||
8fced6
-        reset_type == S390_RESET_LOAD_NORMAL) {
8fced6
+        reset_type == S390_RESET_LOAD_NORMAL ||
8fced6
+        reset_type == S390_RESET_PV) {
8fced6
         /* ignore -no-reboot, send no event  */
8fced6
         qemu_system_reset_request(SHUTDOWN_CAUSE_SUBSYSTEM_RESET);
8fced6
     } else {
8fced6
-- 
8fced6
2.27.0
8fced6