From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org,
linux-kernel@vger.kernel.org, frankja@linux.ibm.com,
mhartmay@linux.ibm.com, nsg@linux.ibm.com,
borntraeger@de.ibm.com, nrb@linux.ibm.com
Subject: Re: [PATCH v2 2/2] KVM: s390: pv: fix index value of replaced ASCE
Date: Tue, 11 Jul 2023 16:31:46 +0200 [thread overview]
Message-ID: <20230711163146.557e9d75@p-imbrenda> (raw)
In-Reply-To: <dba58cf1-59ed-f1f3-fdbe-59d213f0a7b5@linaro.org>
On Tue, 11 Jul 2023 16:12:54 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> On 5/7/23 13:19, Claudio Imbrenda wrote:
> > The index field of the struct page corresponding to a guest ASCE should
> > be 0. When replacing the ASCE in s390_replace_asce(), the index of the
> > new ASCE should also be set to 0.
> >
> > Having the wrong index might lead to the wrong addresses being passed
> > around when notifying pte invalidations, and eventually to validity
> > intercepts (VM crash) if the prefix gets unmapped and the notifier gets
> > called with the wrong address.
>
> Can that also happen in crst_table_alloc()?
no. ->index is only used for gmap page tables (guest mapping), from
the root to pmd tables. the last level (ptes) is shared between guest
mapping and QEMU address space. i.e. the ptes are the ones from QEMU.
the last level of page tables is not expected to have ->index set
(since that one actually belongs to QEMU and not to the guest mapping)
guest page tables (all levels, except ptes) are allocated with
gmap_alloc_table(), which correctly sets ->index
the top level of a guest mapping is allocated in gmap_alloc(), which
also correctly sets ->index to 0.
>
> > Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> > ---
> > arch/s390/mm/gmap.c | 1 +
> > 1 file changed, 1 insertion(+)
>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
thank you!
next prev parent reply other threads:[~2023-07-11 14:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-05 11:19 [PATCH v2 0/2] KVM: s390: pv: fix two small bugs Claudio Imbrenda
2023-07-05 11:19 ` [PATCH v2 1/2] KVM: s390: pv: simplify shutdown and fix race Claudio Imbrenda
2023-07-11 15:18 ` Nico Boehr
2023-07-05 11:19 ` [PATCH v2 2/2] KVM: s390: pv: fix index value of replaced ASCE Claudio Imbrenda
2023-07-11 14:12 ` Philippe Mathieu-Daudé
2023-07-11 14:31 ` Claudio Imbrenda [this message]
2023-07-12 11:58 ` Janosch Frank
2023-07-12 12:06 ` Claudio Imbrenda
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=20230711163146.557e9d75@p-imbrenda \
--to=imbrenda@linux.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=frankja@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=mhartmay@linux.ibm.com \
--cc=nrb@linux.ibm.com \
--cc=nsg@linux.ibm.com \
--cc=philmd@linaro.org \
/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