From: sashiko-bot@kernel.org
To: "Claudio Imbrenda" <imbrenda@linux.ibm.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH v2 5/8] KVM: s390: vsie: Fix rmap handling in _do_shadow_crste()
Date: Mon, 01 Jun 2026 16:41:14 +0000 [thread overview]
Message-ID: <20260601164114.71AFF1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260601152951.196859-6-imbrenda@linux.ibm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [Critical] `_do_shadow_crste()` creates a corrupted Region-3 large page entry (PUD) due to `_crste_fc1()` hardcoding `_SEGMENT_MASK`, leading to hardware Translation-Specification exceptions.
--
commit 249b86f32c315315b0e5e5c41fd24415c3c08a7f
Author: Claudio Imbrenda <imbrenda@linux.ibm.com>
KVM: s390: vsie: Fix rmap handling in _do_shadow_crste()
Fix _do_shadow_crste() to also apply a mask on the reverse address, to
prevent spurious entries from being created, like already done in
gmap_protect_rmap().
> diff --git a/arch/s390/kvm/gaccess.c b/arch/s390/kvm/gaccess.c
> index 4f8d5592c9a92..20e28b183c1ac 100644
> --- a/arch/s390/kvm/gaccess.c
> +++ b/arch/s390/kvm/gaccess.c
[ ... ]
> @@ -1497,8 +1499,7 @@ static int _do_shadow_crste(struct gmap *sg, gpa_t raddr, union crste *host, uni
> return -EAGAIN;
>
> newcrste = _crste_fc1(f->pfn, oldcrste.h.tt, 0, !p);
[Severity: Critical]
This is a pre-existing issue, but does this create a corrupted Region-3 large
page entry when dealing with 2GB large pages?
Looking at _crste_fc1() in arch/s390/kvm/dat.h, it hardcodes _SEGMENT_MASK:
arch/s390/kvm/dat.h:_crste_fc1() {
union crste res = { .val = PFN_PHYS(pfn) & _SEGMENT_MASK };
...
}
If oldcrste.h.tt is TABLE_TYPE_REGION3, f->pfn may have non-zero bits in
the 20-30 range (which map to IBM bits 33-43) if the fault was not at the
start of the 2GB page. Since _SEGMENT_MASK only masks out the lower 20 bits,
these bits remain set.
Will writing this entry with bits 20-30 set (which should be strictly
zero per architecture) cause the hardware to raise a Translation-Specification
exception?
> - gfn = gpa_to_gfn(raddr);
> - while (!dat_crstep_xchg_atomic(table, READ_ONCE(*table), newcrste, gfn, sg->asce))
> + while (!dat_crstep_xchg_atomic(table, READ_ONCE(*table), newcrste, r_gfn, sg->asce))
> ;
> return 0;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260601152951.196859-1-imbrenda@linux.ibm.com?part=5
next prev parent reply other threads:[~2026-06-01 16:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-01 15:29 [PATCH v2 0/8] KVM: s390: More gmap and vsie fixes Claudio Imbrenda
2026-06-01 15:29 ` [PATCH v2 1/8] KVM: s390: Fix _gmap_unmap_crste() Claudio Imbrenda
2026-06-01 15:29 ` [PATCH v2 2/8] KVM: s390: Fix _gmap_crstep_xchg_atomic() Claudio Imbrenda
2026-06-01 15:29 ` [PATCH v2 3/8] KVM: s390: Avoid potentially sleeping while atomic when zapping pages Claudio Imbrenda
2026-06-01 16:09 ` sashiko-bot
2026-06-01 15:29 ` [PATCH v2 4/8] KVM: s390: Fix guest / virtual address confusion in _essa_clear_cbrl() Claudio Imbrenda
2026-06-01 16:25 ` sashiko-bot
2026-06-01 15:29 ` [PATCH v2 5/8] KVM: s390: vsie: Fix rmap handling in _do_shadow_crste() Claudio Imbrenda
2026-06-01 16:41 ` sashiko-bot [this message]
2026-06-01 15:29 ` [PATCH v2 6/8] KVM: s390: Fix fault-in code Claudio Imbrenda
2026-06-01 16:52 ` sashiko-bot
2026-06-01 15:29 ` [PATCH v2 7/8] KVM: s390: Lock pte when making page secure Claudio Imbrenda
2026-06-01 17:10 ` sashiko-bot
2026-06-01 15:29 ` [PATCH v2 8/8] KVM: s390: Prevent memslots outside the ASCE range Claudio Imbrenda
2026-06-01 17:26 ` sashiko-bot
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=20260601164114.71AFF1F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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