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

David Hildenbrand
2025-02-26T15:05:17Z

> +int make_hva_secure(struct mm_struct *mm, unsigned long hva, struct uv_cb_header *uvcb)
> +{
> + struct folio *folio;
> + spinlock_t *ptelock;
> + pte_t *ptep;
> + int rc;
> +
> + ptep = get_locked_valid_pte(mm, hva, &ptelock);
> + if (!ptep)
> + return -ENXIO;

You very likely need a pte_write() check we had there before, as you
might effectively modify page content by clearing the page.

--
Cheers,

David / dhildenb