mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 18:44:58 -06:00
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 <borntraeger@de.ibm.com> Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
This commit is contained in:
parent
db3b2566e0
commit
4ab729207f
4 changed files with 14 additions and 3 deletions
|
@ -1166,6 +1166,7 @@ void kvm_s390_reset_vcpu(S390CPU *cpu);
|
|||
int kvm_s390_set_mem_limit(KVMState *s, uint64_t new_limit, uint64_t *hw_limit);
|
||||
void kvm_s390_vcpu_interrupt_pre_save(S390CPU *cpu);
|
||||
int kvm_s390_vcpu_interrupt_post_load(S390CPU *cpu);
|
||||
void kvm_s390_crypto_reset(void);
|
||||
#else
|
||||
static inline void kvm_s390_io_interrupt(uint16_t subchannel_id,
|
||||
uint16_t subchannel_nr,
|
||||
|
@ -1215,6 +1216,9 @@ static inline int kvm_s390_vcpu_interrupt_post_load(S390CPU *cpu)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void kvm_s390_crypto_reset(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline int s390_set_memory_limit(uint64_t new_limit, uint64_t *hw_limit)
|
||||
|
@ -1261,6 +1265,13 @@ static inline int s390_assign_subch_ioeventfd(EventNotifier *notifier,
|
|||
return kvm_s390_assign_subch_ioeventfd(notifier, sch_id, vq, assign);
|
||||
}
|
||||
|
||||
static inline void s390_crypto_reset(void)
|
||||
{
|
||||
if (kvm_enabled()) {
|
||||
kvm_s390_crypto_reset();
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_KVM
|
||||
static inline bool vregs_needed(void *opaque)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue