KVM: s390: interfaces to clear CRYCB masks
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 88 lines · Christian Borntraeger
Quoted 74 lines · David Hildenbrand
Quoted 73 lines · Pierre Morel
Quoted 51 lines · David Hildenbrand
Quoted 41 lines · Pierre Morel
Quoted 40 lines · Halil Pasic
Quoted 25 lines · Pierre Morel
Quoted 18 lines · David Hildenbrand
Quoted 6 lines · Christian Borntraeger
From: Tony Krowiak <[email protected]>
Introduces two new KVM interface to lear the APM, AQM and ADM masks in the guest's CRYCB.� The VCPUs are taken out of SIE to ensure the VCPUs do
not get out of synch.s/synch/sync/
When will this be called and why?
If I read correctly, this can happen while other VCPUs are running (currently in the SIE). Please note that kvm_s390_vcpu_block_all/kvm_s390_vcpu_unblock_all will not care about vSIE. So a CPU inside the vSIE loop will not be hindered of executing the SIE. (because so far, all VCPU requests we handle don't rely on that)
Quoted 4 lines
So it could happen here, that after this call a vSIE CPU still can access some adapters if we allowed to forward some of them to the nested
guest.You are right for the principle.
Quoted 9 lines
However this function is only called when the mediated device is release which is, as we do not support hotplug, when the vfio-device is closed and the guest already disappeared.
So I do not think it is useful the way it is currently used.
What about just letting this call and function fall and take more time on this problem when we introduce hotplug?
The point is, I don't think we can prohibit userspace to close the vfio device before the VM is teared down (hot-unplug). The idea was, do the best we can to give up the resources. I was not aware of the problems with the VSIE.
Quoted 9 lines
Quoted 4 lines
QEMU however does make sure there is no hot-unplug. So no user can observe the problem.
Halil
David,
what about if I extend this function to handle
the SIE when I introduce the SIE� in patch 20
by callingkvm_s390_vsie_kick()?Quoted 4 lines
SIE kick is not enough. The semantics of that are simply "please exit the SIE to check for any events". It can immediately enter it again reusing the old created crycb block. There would have to be some additional check. But such stuff is usually prone to races.
I intended to use it in extension of the
vcpu_block()so that when thevsie()is exited the vcpu falls in the SIE which will be blocked.arch/s390/kvm/kvm-s390.c +1
-2@@ -1925,9 +1925,13 @@ static void kvm_s390_set_crycb_format(struct kvm *kvm) �void kvm_arch_crypto_clear_masks(struct kvm *kvm) �{ -��� mutex_lock(&kvm->lock); -��� kvm_s390_vcpu_block_all(kvm); +��� int i;Quoted 7 lines
arch/s390/kvm/kvm-s390.c static void kvm_s390_set_crycb_format(struct kvm · line 1935
Quoted 5 lines
arch/s390/kvm/kvm-s390.c +5
-0+��� mutex_lock(&kvm->lock); +��� kvm_for_each_vcpu(i, vcpu, kvm) { +��� ��� kvm_s390_vcpu_block(vcpu); +��� ��� kvm_s390_vsie_kick(vcpu); +��� }No that does not work. The VSIE can be immediately reentered afther the kick with the old crycb block.
Hmm, shall we change that so that
kvm_s390_vcpu_blockwill also block vsie from entering?Quoted 1 line
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
arch/s390/kvm/kvm-s390.c +0
-0���� memset(&kvm->arch.crypto.crycb->apcb0, 0, ���� ������ sizeof(kvm->arch.crypto.crycb->apcb0));���� memset(&kvm->arch.crypto.crycb->apcb1, 0,
I am asking myself if if would be valid to first memset the crycb and then do a kick. On reentry sie will then use the new value. I will double check.
The first solution, blocking VSIE, and wait for the vcpu to exit the SCB (that I did not do)
(and if it is OK) seems better to me.
The function is called rarely so we may use a dedicated function and let the xxx_vcpu_block()
have a short path.
Signature · 2 lines
Pierre Morel Linux/KVM/QEMU in B�blingen - Germany
Quoted 5 lines · Thomas Huth
Quoted 3 lines · Christian Borntraeger
From: Tony Krowiak <[email protected]>
Introduces two new KVM interface to lear the APM, AQM and ADM masks in
s/lear/clear/
As good as done.
Quoted 3 lines
Thomas