From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Janosch Frank <frankja@linux.ibm.com>,
David Hildenbrand <david@kernel.org>,
linux-s390@vger.kernel.org, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 5/8] s390/mm: Remove folio handling for kernel faults in do_secure_storage_access()
Date: Fri, 24 Jul 2026 10:17:22 +0200 [thread overview]
Message-ID: <20260724101722.363655e5@p-imbrenda> (raw)
In-Reply-To: <da93640f-4fd4-4cae-bedf-921916dd4682@linux.ibm.com>
On Mon, 20 Jul 2026 12:53:29 +0200
Christian Borntraeger <borntraeger@linux.ibm.com> wrote:
> Am 20.07.26 um 10:58 schrieb Heiko Carstens:
> > Remove folio handling for secure storage access exceptions that happen
> > via the kernel mapping. Using folio_try_get() for exceptions via the
> > kernel mapping is racy: for example such an exception may happen on one
> > CPU, while a different CPU frees the corresponding page. Subsequently the
> > page can be part of a folio of different size, before the faulting CPU
> > executes folio_try_get(). This may lead to data corruption.
> >
> > As of now this scenario does not seem to be possible, however with the
> > upcoming load_unaligned_zeropad() this is possible.
> >
> > As a side effect PG_arch_1 is not cleared anymore for such faults via the
> > kernel mapping. However given that this bit is over-indicating it
> > shouldn't matter.
> >
> > Tested-by: Christian Borntraeger <borntraeger@linux.ibm.com>
> > Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
>
> Ideally Claudio should confirm that PG_arch_1 is over-indicating.
PG_arch_1 is over-indicating.
Acked-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
>
> Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
>
> > ---
> > arch/s390/mm/fault.c | 8 +-------
> > 1 file changed, 1 insertion(+), 7 deletions(-)
> >
> > diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
> > index e650cdfa2523..776549d55c94 100644
> > --- a/arch/s390/mm/fault.c
> > +++ b/arch/s390/mm/fault.c
> > @@ -440,13 +440,7 @@ void do_secure_storage_access(struct pt_regs *regs)
> > if (is_kernel_fault(regs)) {
> > if (is_vmalloc_addr((void *)addr))
> > return handle_fault_error_nolock(regs, 0);
> > - folio = virt_to_folio((void *)addr);
> > - if (unlikely(!folio_try_get(folio)))
> > - return;
> > - rc = uv_convert_from_secure(folio_to_phys(folio));
> > - if (!rc)
> > - clear_bit(PG_arch_1, &folio->flags.f);
> > - folio_put(folio);
> > + rc = uv_convert_from_secure(__pa(addr));
> > /*
> > * There are some valid fixup types for kernel
> > * accesses to donated secure memory. zeropad is one
>
next prev parent reply other threads:[~2026-07-24 8:17 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 8:58 [PATCH v4 0/8] s390: Reintroduce support for DCACHE_WORD_ACCESS Heiko Carstens
2026-07-20 8:58 ` [PATCH v4 1/8] KVM: s390: pv: Use VM_SPARSE area for guest variable storage area Heiko Carstens
2026-07-20 9:14 ` sashiko-bot
2026-07-20 9:56 ` Christian Borntraeger
2026-07-20 10:15 ` Heiko Carstens
2026-09-03 12:28 ` Alexander Gordeev
2026-09-03 17:24 ` Heiko Carstens
2026-09-04 18:53 ` Heiko Carstens
2026-07-20 8:58 ` [PATCH v4 2/8] s390/mm: Add missing mm check to do_secure_storage_access() Heiko Carstens
2026-07-20 9:12 ` sashiko-bot
2026-07-20 10:44 ` Christian Borntraeger
2026-07-20 8:58 ` [PATCH v4 3/8] s390/mm: Use lock_mm_and_find_vma() in do_secure_storage_access() Heiko Carstens
2026-07-20 9:19 ` sashiko-bot
2026-07-20 10:45 ` Christian Borntraeger
2026-07-20 8:58 ` [PATCH v4 4/8] s390/mm: Fix handling of vmalloc area " Heiko Carstens
2026-07-20 9:23 ` sashiko-bot
2026-07-20 10:22 ` Christian Borntraeger
2026-07-20 8:58 ` [PATCH v4 5/8] s390/mm: Remove folio handling for kernel faults " Heiko Carstens
2026-07-20 9:30 ` sashiko-bot
2026-07-20 10:53 ` Christian Borntraeger
2026-07-24 8:17 ` Claudio Imbrenda [this message]
2026-07-20 8:58 ` [PATCH v4 6/8] s390/mm: Use handle_fault_error() " Heiko Carstens
2026-07-20 9:26 ` sashiko-bot
2026-07-20 8:58 ` [PATCH v4 7/8] s390/mm: Use goto statement " Heiko Carstens
2026-07-20 9:36 ` sashiko-bot
2026-07-20 10:36 ` Christian Borntraeger
2026-07-20 8:58 ` [PATCH v4 8/8] s390: Add support for DCACHE_WORD_ACCESS (again) Heiko Carstens
2026-07-20 9:48 ` sashiko-bot
2026-07-21 9:59 ` Sven Schnelle
2026-07-20 9:03 ` [PATCH v4 0/8] s390: Reintroduce support for DCACHE_WORD_ACCESS Christian Borntraeger
2026-07-20 9:40 ` Heiko Carstens
2026-07-27 10:37 ` Vasily Gorbik
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=20260724101722.363655e5@p-imbrenda \
--to=imbrenda@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=david@kernel.org \
--cc=frankja@linux.ibm.com \
--cc=gor@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=svens@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