[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <db143076-afa0-4129-b5b0-eab85ec54aac@redhat.com>
Date: Wed, 29 Oct 2025 11:00:14 +0100
From: David Hildenbrand <david@...hat.com>
To: Claudio Imbrenda <imbrenda@...ux.ibm.com>, akpm@...ux-foundation.org
Cc: balbirs@...dia.com, borntraeger@...ibm.com, Liam.Howlett@...cle.com,
airlied@...il.com, apopple@...dia.com, baohua@...nel.org,
baolin.wang@...ux.alibaba.com, byungchul@...com, dakr@...nel.org,
dev.jain@....com, dri-devel@...ts.freedesktop.org,
francois.dugast@...el.com, gourry@...rry.net, joshua.hahnjy@...il.com,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
lorenzo.stoakes@...cle.com, lyude@...hat.com, matthew.brost@...el.com,
mpenttil@...hat.com, npache@...hat.com, osalvador@...e.de, rakie.kim@...com,
rcampbell@...dia.com, ryan.roberts@....com, simona@...ll.ch,
ying.huang@...ux.alibaba.com, ziy@...dia.com, kvm@...r.kernel.org,
linux-s390@...r.kernel.org, linux-next@...r.kernel.org, hca@...ux.ibm.com,
gor@...ux.ibm.com, agordeev@...ux.ibm.com
Subject: Re: [PATCH v1 1/1] KVM: s390: Fix missing present bit for gmap puds
On 28.10.25 14:01, Claudio Imbrenda wrote:
> For hugetlbs, gmap puds have the present bit set. For normal puds
> (which point to ptes), the bit is not set. This is in contrast to the
> normal userspace puds, which always have the bit set for present pmds.
>
> This causes issues when ___pte_offset_map() is modified to only check
> for the present bit.
>
> The solution to the problem is simply to always set the present bit for
> present gmap pmds.
>
> Signed-off-by: Claudio Imbrenda <imbrenda@...ux.ibm.com>
> Link: https://lore.kernel.org/lkml/20251017144924.10034-1-borntraeger@linux.ibm.com/
> Tested-by: Christian Borntraeger <borntraeger@...ux.ibm.com>
> Acked-by: Christian Borntraeger <borntraeger@...ux.ibm.com>
> ---
> arch/s390/mm/gmap.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c
> index 8ff6bba107e8..22c448b32340 100644
> --- a/arch/s390/mm/gmap.c
> +++ b/arch/s390/mm/gmap.c
> @@ -599,8 +599,9 @@ int __gmap_link(struct gmap *gmap, unsigned long gaddr, unsigned long vmaddr)
> | _SEGMENT_ENTRY_GMAP_UC
> | _SEGMENT_ENTRY;
> } else
> - *table = pmd_val(*pmd) &
> - _SEGMENT_ENTRY_HARDWARE_BITS;
I'd add a comment here like
/* Make sure that pmd_present() will work on these entries. */
> + *table = (pmd_val(*pmd) &
> + _SEGMENT_ENTRY_HARDWARE_BITS)
> + | _SEGMENT_ENTRY;
> }
> } else if (*table & _SEGMENT_ENTRY_PROTECT &&
> !(pmd_val(*pmd) & _SEGMENT_ENTRY_PROTECT)) {
Reviewed-by: David Hildenbrand <david@...hat.com>
--
Cheers
David / dhildenb
Powered by blists - more mailing lists