public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: David Hildenbrand <david@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-s390@vger.kernel.org, frankja@linux.ibm.com,
	borntraeger@de.ibm.com, nrb@linux.ibm.com, seiden@linux.ibm.com,
	nsg@linux.ibm.com, schlameuss@linux.ibm.com, hca@linux.ibm.com
Subject: Re: [PATCH v2 1/1] KVM: s390: pv: fix race when making a page secure
Date: Wed, 26 Feb 2025 18:26:10 +0100	[thread overview]
Message-ID: <20250226182610.7f5313ca@p-imbrenda> (raw)
In-Reply-To: <bab79dbd-64cc-4a58-aba9-bc5fd4d6beca@redhat.com>

On Wed, 26 Feb 2025 18:01:04 +0100
David Hildenbrand <david@redhat.com> wrote:

> On 26.02.25 17:58, Claudio Imbrenda wrote:
> > On Wed, 26 Feb 2025 16:05:11 +0100
> > David Hildenbrand <david@redhat.com> wrote:
> >   
> >>> +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.  
> > 
> > it's not really needed, but it doesn't hurt either, I'll add a check  
> 
> Can you elaborate why it is not needed? Would the HW enforce that 
> writability check already?

as I have discovered the hard way while working on this v2, yes

but as I said, it looks better with the check, so I'll add it

      reply	other threads:[~2025-02-26 17:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-26 12:37 [PATCH v2 0/1] KVM: s390: fix a newly introduced bug Claudio Imbrenda
2025-02-26 12:37 ` [PATCH v2 1/1] KVM: s390: pv: fix race when making a page secure Claudio Imbrenda
2025-02-26 15:05   ` David Hildenbrand
2025-02-26 16:58     ` Claudio Imbrenda
2025-02-26 17:01       ` David Hildenbrand
2025-02-26 17:26         ` Claudio Imbrenda [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250226182610.7f5313ca@p-imbrenda \
    --to=imbrenda@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=nrb@linux.ibm.com \
    --cc=nsg@linux.ibm.com \
    --cc=schlameuss@linux.ibm.com \
    --cc=seiden@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox