Re: [PATCH 2/3] KVM: s390: Remove one byte cmpxchg() usage

Heiko Carstens
2024-11-25T13:38:04Z

On Mon, Nov 25, 2024 at 01:16:17PM +0100, Claudio Imbrenda wrote:
> On Mon, 25 Nov 2024 12:50:38 +0100
> Heiko Carstens <hca@linux.ibm.com> wrote:
> > @@ -128,23 +126,16 @@ static void sca_clear_ext_call(struct kvm_vcpu *vcpu)
> > struct esca_block *sca = vcpu->kvm->arch.sca;
> > union esca_sigp_ctrl *sigp_ctrl =
> > &(sca->cpu[vcpu->vcpu_id].sigp_ctrl);
> > - union esca_sigp_ctrl old;
> >
> > - old = READ_ONCE(*sigp_ctrl);
> > - expect = old.value;
> > - rc = cmpxchg(&sigp_ctrl->value, old.value, 0);
> > + WRITE_ONCE(sigp_ctrl->value, 9);
>
> that's supposed to be a 0, right?

Duh... yes, of course. I added the "9" to better find the corresponding
code in assembly, and obviously forgot to replace it with 0 again.
Thanks for pointing this out!

Strange enough this still worked. Hmm.