mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Claudio Imbrenda <imbrenda@linux.ibm.com>, linux-kernel@vger.kernel.org
Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org,
	frankja@linux.ibm.com, david@kernel.org, seiden@linux.ibm.com,
	nrb@linux.ibm.com, schlameuss@linux.ibm.com, gra@linux.ibm.com
Subject: Re: [PATCH v2 4/5] KVM: s390: vsie: Fix redundant rmap entries
Date: Mon, 18 May 2026 13:54:13 +0200	[thread overview]
Message-ID: <3bfd73df-3107-435f-953c-80b6bed4b1f8@de.ibm.com> (raw)
In-Reply-To: <20260512175251.300882-5-imbrenda@linux.ibm.com>

Am 12.05.26 um 19:52 schrieb Claudio Imbrenda:
> The address passed to the gmap rmap was not being masked. As a
> consequence several different (but functionally equivalent) rmap
> entries were being created for each shadowed table.
> 
> Fix this by properly masking the address depending on the table level.
> 
> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>

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

> ---
>   arch/s390/kvm/gmap.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/s390/kvm/gmap.c b/arch/s390/kvm/gmap.c
> index 8cff0cf5ce24..957126ab991c 100644
> --- a/arch/s390/kvm/gmap.c
> +++ b/arch/s390/kvm/gmap.c
> @@ -1025,6 +1025,7 @@ int gmap_insert_rmap(struct gmap *sg, gfn_t p_gfn, gfn_t r_gfn, int level)
>   int gmap_protect_rmap(struct kvm_s390_mmu_cache *mc, struct gmap *sg, gfn_t p_gfn, gfn_t r_gfn,
>   		      kvm_pfn_t pfn, int level, bool wr)
>   {
> +	unsigned long bitmask;
>   	union crste *crstep;
>   	union pgste pgste;
>   	union pte *ptep;
> @@ -1041,8 +1042,9 @@ int gmap_protect_rmap(struct kvm_s390_mmu_cache *mc, struct gmap *sg, gfn_t p_gf
>   	if (rc)
>   		return rc;
>   	if (level <= TABLE_TYPE_REGION1) {
> +		bitmask = -1UL << (8 + 11 * level);
>   		scoped_guard(spinlock, &sg->host_to_rmap_lock)
> -			rc = gmap_insert_rmap(sg, p_gfn, r_gfn, level);
> +			rc = gmap_insert_rmap(sg, p_gfn, r_gfn & bitmask, level);
>   	}
>   	if (rc)
>   		return rc;


  reply	other threads:[~2026-05-18 11:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12 17:52 [PATCH v2 0/5] KVM: s390: some vSIE and UCONTROL fixes Claudio Imbrenda
2026-05-12 17:52 ` [PATCH v2 1/5] KVM: s390: vsie: Fix memory leak when unshadowing Claudio Imbrenda
2026-05-13  7:50   ` Christian Borntraeger
2026-05-12 17:52 ` [PATCH v2 2/5] KVM: s390: Fix leaking kvm_s390_mmu_cache in case of errors Claudio Imbrenda
2026-05-13  7:56   ` Christian Borntraeger
2026-05-12 17:52 ` [PATCH v2 3/5] KVM: s390: vsie: Fix unshadowing logic Claudio Imbrenda
2026-05-18 11:28   ` Christian Borntraeger
2026-05-19 11:40     ` Claudio Imbrenda
2026-05-12 17:52 ` [PATCH v2 4/5] KVM: s390: vsie: Fix redundant rmap entries Claudio Imbrenda
2026-05-18 11:54   ` Christian Borntraeger [this message]
2026-05-12 17:52 ` [PATCH v2 5/5] KVM: s390: Properly reset zero bit in PGSTE Claudio Imbrenda
2026-05-15 11:51   ` Steffen Eiden
2026-05-18 11:44   ` Christian Borntraeger
2026-05-19 11:38     ` Claudio Imbrenda
2026-05-19 11:57       ` Christian Borntraeger

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=3bfd73df-3107-435f-953c-80b6bed4b1f8@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=david@kernel.org \
    --cc=frankja@linux.ibm.com \
    --cc=gra@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=nrb@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

all inboxes | Powered by JetHome®