diff options
author | David Hildenbrand <david@redhat.com> | 2018-04-24 12:18:59 +0200 |
---|---|---|
committer | Cornelia Huck <cohuck@redhat.com> | 2018-05-14 17:10:02 +0200 |
commit | a30fb811cbe940020a498d2cdac9326cac38b4d9 (patch) | |
tree | f4284495670fe38f7923834ce42012bc56c35e9c /hw/s390x/ipl.h | |
parent | 838fb84f83c84f00d15b1bede5e080b495644458 (diff) | |
download | qemu-a30fb811cbe940020a498d2cdac9326cac38b4d9.zip qemu-a30fb811cbe940020a498d2cdac9326cac38b4d9.tar.gz qemu-a30fb811cbe940020a498d2cdac9326cac38b4d9.tar.bz2 |
s390x: refactor reset/reipl handling
Calling pause_all_vcpus()/resume_all_vcpus() from a VCPU thread might
not be the best idea. As pause_all_vcpus() temporarily drops the qemu
mutex, two parallel calls to pause_all_vcpus() can be active at a time,
resulting in a deadlock. (either by two VCPUs or by the main thread and a
VCPU)
Let's handle it via the main loop instead, as suggested by Paolo. If we
would have two parallel reset requests by two different VCPUs at the
same time, the last one would win.
We use the existing ipl device to handle it. The nice side effect is
that we can get rid of reipl_requested.
This change implies that all reset handling now goes via the common
path, so "no-reboot" handling is now active for all kinds of reboots.
Let's execute any CPU initialization code on the target CPU using
run_on_cpu.
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20180424101859.10239-1-david@redhat.com>
Acked-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'hw/s390x/ipl.h')
-rw-r--r-- | hw/s390x/ipl.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h index 0570d0a..4e87b89 100644 --- a/hw/s390x/ipl.h +++ b/hw/s390x/ipl.h @@ -87,7 +87,17 @@ int s390_ipl_set_loadparm(uint8_t *loadparm); void s390_ipl_update_diag308(IplParameterBlock *iplb); void s390_ipl_prepare_cpu(S390CPU *cpu); IplParameterBlock *s390_ipl_get_iplb(void); -void s390_reipl_request(void); + +enum s390_reset { + /* default is a reset not triggered by a CPU e.g. issued by QMP */ + S390_RESET_EXTERNAL = 0, + S390_RESET_REIPL, + S390_RESET_MODIFIED_CLEAR, + S390_RESET_LOAD_NORMAL, +}; +void s390_ipl_reset_request(CPUState *cs, enum s390_reset reset_type); +void s390_ipl_get_reset_request(CPUState **cs, enum s390_reset *reset_type); +void s390_ipl_clear_reset_request(void); #define QIPL_ADDRESS 0xcc @@ -129,9 +139,11 @@ struct S390IPLState { bool enforce_bios; IplParameterBlock iplb; bool iplb_valid; - bool reipl_requested; bool netboot; QemuIplParameters qipl; + /* reset related properties don't have to be migrated or reset */ + enum s390_reset reset_type; + int reset_cpu_index; /*< public >*/ char *kernel; |