From 4ab729207fe1464b19c6bec609cd545ab717174a Mon Sep 17 00:00:00 2001 From: David Hildenbrand Date: Wed, 30 Sep 2015 13:48:45 +0200 Subject: s390x: reset crypto only on clear reset and QEMU reset Initializing VM crypto in initial cpu reset has multiple problems 1. We call the exact same function #VCPU times, although one time is enough 2. On SIGP initial cpu reset, we exchange the wrapping key while other VCPUs are running. Bad! 3. It is simply wrong. According to the Pop, a reset happens only during a clear reset. So, we have to reset the keys - on modified clear reset - on load clear (QEMU reset - via machine reset) - on qemu start (via machine reset) Reviewed-by: Christian Borntraeger Signed-off-by: David Hildenbrand Signed-off-by: Cornelia Huck --- hw/s390x/s390-virtio.c | 1 + 1 file changed, 1 insertion(+) (limited to 'hw/s390x') diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c index 7b8f15bb31..9a7b7c2578 100644 --- a/hw/s390x/s390-virtio.c +++ b/hw/s390x/s390-virtio.c @@ -320,6 +320,7 @@ void s390_machine_reset(void) S390CPU *ipl_cpu = S390_CPU(qemu_get_cpu(0)); qemu_devices_reset(); + s390_crypto_reset(); /* all cpus are stopped - configure and start the ipl cpu only */ s390_ipl_prepare_cpu(ipl_cpu); -- cgit v1.2.3