Re: [PATCH v3 1/1] KVM: s390: pv: fix race when making a page secure

From: David Hildenbrand
Date: Tue Mar 04 2025 - 04:52:37 EST


On 04.03.25 10:21, Claudio Imbrenda wrote:
On Fri, 28 Feb 2025 22:15:04 +0100
David Hildenbrand <david@xxxxxxxxxx> wrote:

On 27.02.25 14:09, Claudio Imbrenda wrote:
Holding the pte lock for the page that is being converted to secure is
needed to avoid races. A previous commit removed the locking, which
caused issues. Fix by locking the pte again.

Fixes: 5cbe24350b7d ("KVM: s390: move pv gmap functions into kvm")
Reported-by: David Hildenbrand <david@xxxxxxxxxx>
Signed-off-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx>

Tested with shmem / memory-backend-memfd that ends up using large folios
/ THPs.

Tested-by: David Hildenbrand <david@xxxxxxxxxx>
Reviewed-by: David Hildenbrand <david@xxxxxxxxxx>

Two comments below.

I will need to send a v4, unfortunately there are other issues with this
patch (as you have probably noticed by now as well)

I ran into some weird KVM_PV_VERIFY issues a couple of times, but did not find the root cause so far.

Is that what you are seeing? (and what is the root cause? :) )

--
Cheers,

David / dhildenb