[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 03/29] s390x/ipl: drop reipl parameters on resets
From: |
Christian Borntraeger |
Subject: |
[Qemu-devel] [PULL 03/29] s390x/ipl: drop reipl parameters on resets |
Date: |
Wed, 18 Feb 2015 21:21:57 +0100 |
From: Fan Zhang <address@hidden>
Whenever a reboot initiated by the guest is done, the reipl parameters should
remain valid. The disk configured by the guest is to be used for
ipl'ing. External reboot/reset request (e.g. via virsh reset guest) should
completely reset the guest to the initial state, and therefore also reset the
reipl parameters, resulting in an ipl behaviour of the initially configured
guest. This could be an external kernel or a disk.
Reviewed-by: Cornelia Huck <address@hidden>
Reviewed-by: David Hildenbrand <address@hidden>
Acked-by: Christian Borntraeger <address@hidden>
Signed-off-by: Jens Freimann <address@hidden>
Signed-off-by: Fan Zhang <address@hidden>
Signed-off-by: Christian Borntraeger <address@hidden>
---
hw/s390x/ipl.c | 15 +++++++++++++++
hw/s390x/ipl.h | 1 +
target-s390x/kvm.c | 3 ++-
3 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index 231713d..a1aa051 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -55,6 +55,7 @@ typedef struct S390IPLState {
bool enforce_bios;
IplParameterBlock iplb;
bool iplb_valid;
+ bool reipl_requested;
/*< public >*/
char *kernel;
@@ -233,6 +234,15 @@ IplParameterBlock *s390_ipl_get_iplb(void)
return &ipl->iplb;
}
+void s390_reipl_request(void)
+{
+ S390IPLState *ipl;
+
+ ipl = S390_IPL(object_resolve_path(TYPE_S390_IPL, NULL));
+ ipl->reipl_requested = true;
+ qemu_system_reset_request();
+}
+
static void s390_ipl_reset(DeviceState *dev)
{
S390IPLState *ipl = S390_IPL(dev);
@@ -242,6 +252,11 @@ static void s390_ipl_reset(DeviceState *dev)
env->psw.addr = ipl->start_addr;
env->psw.mask = IPL_PSW_MASK;
+ if (!ipl->reipl_requested) {
+ ipl->iplb_valid = false;
+ }
+ ipl->reipl_requested = false;
+
if (!ipl->kernel || ipl->iplb_valid) {
env->psw.addr = ipl->bios_start_addr;
env->regs[7] = s390_update_iplstate(env, ipl);
diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h
index f1d082f..70497bc 100644
--- a/hw/s390x/ipl.h
+++ b/hw/s390x/ipl.h
@@ -20,5 +20,6 @@ typedef struct IplParameterBlock {
int s390_ipl_update_diag308(IplParameterBlock *iplb);
IplParameterBlock *s390_ipl_get_iplb(void);
+void s390_reipl_request(void);
#endif
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index 6f2d5b4..8c2f228 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -42,6 +42,7 @@
#include "qapi-event.h"
#include "hw/s390x/s390-pci-inst.h"
#include "hw/s390x/s390-pci-bus.h"
+#include "hw/s390x/ipl.h"
/* #define DEBUG_KVM */
@@ -1397,7 +1398,7 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run
*run)
ret = handle_intercept(cpu);
break;
case KVM_EXIT_S390_RESET:
- qemu_system_reset_request();
+ s390_reipl_request();
break;
case KVM_EXIT_S390_TSCH:
ret = handle_tsch(cpu);
--
1.9.3
- [Qemu-devel] [PULL 18/29] s390x/mmu: Add function for accessing guest memory, (continued)
- [Qemu-devel] [PULL 18/29] s390x/mmu: Add function for accessing guest memory, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 02/29] s390x/ipl: support diagnose 308 subcodes 5 and 6, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 19/29] s390x/css: Make schib parameter of css_do_msch const, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 09/29] s390x/mmu: Skip exceptions properly when translating addresses for debug, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 08/29] s390x/mmu: Check table length and offset fields, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 14/29] s390x/mmu: Renaming related to the ASCE confusion, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 04/29] s390x/ipl: make s390x ipl device aware of migration, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 25/29] s390x/ioinst: Rework memory access in STCRW instruction, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 01/29] s390x/ipl: always load the bios for ccw machine, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 05/29] s390x/mmu: Move mmu_translate() and friends to separate file, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 03/29] s390x/ipl: drop reipl parameters on resets,
Christian Borntraeger <=
- [Qemu-devel] [PULL 28/29] s390x/pci: Rework memory access in zpci instruction, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 11/29] s390x/mmu: Fix exception types when checking the ASCEs, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 24/29] s390x/ioinst: Rework memory access in TSCH instruction, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 17/29] s390x/kvm: Add function for injecting pgm access exceptions, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 23/29] s390x/ioinst: Set condition code in ioinst_handle_tsch() handler, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 06/29] s390x/mmu: Fix the check for the real-space designation bit, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 22/29] s390x/ioinst: Rework memory access in STSCH instruction, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 10/29] s390x/mmu: Fix translation exception code in lowcore, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 26/29] s390x/ioinst: Rework memory access in CHSC instruction, Christian Borntraeger, 2015/02/18
- [Qemu-devel] [PULL 07/29] s390x/mmu: Fix the handling of the table levels, Christian Borntraeger, 2015/02/18