mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@linux.ibm.com>
To: 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>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>,
	David Hildenbrand <david@kernel.org>
Cc: linux-s390@vger.kernel.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 1/8] KVM: s390: pv: Use VM_SPARSE area for guest variable storage area
Date: Mon, 20 Jul 2026 11:56:36 +0200	[thread overview]
Message-ID: <30f0084c-5621-4602-8c0a-9082dd9d3d43@linux.ibm.com> (raw)
In-Reply-To: <20260720085834.898025-2-hca@linux.ibm.com>

Am 20.07.26 um 10:58 schrieb Heiko Carstens:
> The guest variable storage area is allocated with vmalloc and then
> donated to the ultravisor. Any kernel access to that area will result
> in a secure storage access exception (aka fault).
> 
> This is a problem if such a memory area is read via /proc/kcore. This
> causes an exception via vread_iter() and results in an unexpected short
> read. Avoid this by allocating a custom VM_SPARSE area. If such an area
> is read, vread_iter() returns zeroes for the entire area.
> 
> Note that the function which frees the area does not update ptes. This
> is intentional to allow for deferred / lazy pte updates and TLB flushing
> like the generic vfree() code is doing that. See vunmap_pte_range().
> 
> This assumes that s390 will gain full support for lazy_mmu_mode_enable()
> and lazy_mmu_mode_disable() in the future, since as of now the used
> ptep_get_and_clear() in vunmap_pte_range() does indeed invalidate and
> flush every single pte entry, but only for s390.
> 
> Tested-by: Christian Borntraeger <borntraeger@linux.ibm.com>
> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>

Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>


[..]> +static int uv_free_range_cb(pte_t *ptep, unsigned long addr, void *data)
> +{
> +	pte_t pte = ptep_get(ptep);
> +
> +	if (!pte_present(pte))
> +		return 0;
I guess we do not need it today, but it certainly does not hurt?

  reply	other threads:[~2026-07-20  9:56 UTC|newest]

Thread overview: 24+ 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:56   ` Christian Borntraeger [this message]
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 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 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 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 10:53   ` Christian Borntraeger
2026-07-24  8:17     ` Claudio Imbrenda
2026-07-20  8:58 ` [PATCH v4 6/8] s390/mm: Use handle_fault_error() " Heiko Carstens
2026-07-20  8:58 ` [PATCH v4 7/8] s390/mm: Use goto statement " Heiko Carstens
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-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=30f0084c-5621-4602-8c0a-9082dd9d3d43@linux.ibm.com \
    --to=borntraeger@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=david@kernel.org \
    --cc=frankja@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=imbrenda@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

all inboxes | Powered by JetHome®