From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: Nico Boehr <nrb@linux.ibm.com>
Cc: Janosch Frank <frankja@linux.ibm.com>,
thuth@redhat.com, kvm@vger.kernel.org,
linux-s390@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH v1 1/4] s390x: sie: switch to home space mode before entering SIE
Date: Wed, 29 Mar 2023 15:00:32 +0200 [thread overview]
Message-ID: <20230329150032.7093e25b@p-imbrenda> (raw)
In-Reply-To: <168009425098.295696.4253423899606982653@t14-nrb>
On Wed, 29 Mar 2023 14:50:50 +0200
Nico Boehr <nrb@linux.ibm.com> wrote:
> Quoting Janosch Frank (2023-03-28 16:13:04)
> > On 3/27/23 10:21, Nico Boehr wrote:
> > > This is to prepare for running guests without MSO/MSL, which is
> > > currently not possible.
> > >
> > > We already have code in sie64a to setup a guest primary ASCE before
> > > entering SIE, so we can in theory switch to the page tables which
> > > translate gpa to hpa.
> > >
> > > But the host is running in primary space mode already, so changing the
> > > primary ASCE before entering SIE will also affect the host's code and
> > > data.
> > >
> > > To make this switch useful, the host should run in a different address
> > > space mode. Hence, set up and change to home address space mode before
> > > installing the guest ASCE.
> > >
> > > The home space ASCE is just copied over from the primary space ASCE, so
> > > no functional change is intended, also for tests that want to use
> > > MSO/MSL. If a test intends to use a different primary space ASCE, it can
> > > now just set the guest.asce in the save_area.
> > >
> > [...]
> > > + /* set up home address space to match primary space */
> > > + old_cr13 = stctg(13);
> > > + lctlg(13, stctg(1));
> > > +
> > > + /* switch to home space so guest tables can be different from host */
> > > + psw_mask_set_bits(PSW_MASK_HOME);
> > > +
> > > + /* also handle all interruptions in home space while in SIE */
> > > + lowcore.pgm_new_psw.mask |= PSW_MASK_DAT_HOME;
> >
> > > + lowcore.ext_new_psw.mask |= PSW_MASK_DAT_HOME;
> > > + lowcore.io_new_psw.mask |= PSW_MASK_DAT_HOME;
> > We didn't enable DAT in these two cases as far as I can see so this is
> > superfluous or we should change the mmu code. Also it's missing the svc
> > and machine check.
>
> Right. Is there a particular reason why we only run DAT on for PGM ints?
a fixup handler for PGM it might need to run with DAT on (e.g. to
access data that is not identity mapped), whereas for other interrupts
it's not needed (at least not yet ;) )
>
> > The whole bit manipulation thing looks a bit crude. It might make more
> > sense to drop into real mode for a few instructions and have a dedicated
> > storage location for an extended PSW mask and an interrupt ASCE as part
> > of the interrupt call code instead.
> >
> > Opinions?
>
> Maybe I don't get it, but I personally don't quite see the advantage. It seems
> to me this would make things much more complicated just to avoid a few simple
> bitops.
>
> It maybe also depends on how many new_psws we have to touch. If it's really just
> the PGM, the current solution seems simple enough.
>
> But if others also prefer Janosch's suggestion, I am happy to implement it.
next prev parent reply other threads:[~2023-03-29 13:00 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-27 8:21 [kvm-unit-tests PATCH v1 0/4] s390x: Add support for running guests without MSO/MSL Nico Boehr
2023-03-27 8:21 ` [kvm-unit-tests PATCH v1 1/4] s390x: sie: switch to home space mode before entering SIE Nico Boehr
2023-03-28 14:13 ` Janosch Frank
2023-03-29 12:50 ` Nico Boehr
2023-03-29 13:00 ` Claudio Imbrenda [this message]
2023-03-29 13:42 ` Janosch Frank
2023-03-29 14:58 ` Nico Boehr
2023-03-27 8:21 ` [kvm-unit-tests PATCH v1 2/4] s390x: lib: don't forward PSW when handling exception in SIE Nico Boehr
2023-03-27 8:21 ` [kvm-unit-tests PATCH v1 3/4] s390x: lib: sie: don't reenter SIE on pgm int Nico Boehr
2023-03-28 13:42 ` Janosch Frank
2023-03-28 14:16 ` Nico Boehr
2023-03-28 17:01 ` Claudio Imbrenda
2023-03-29 12:51 ` Nico Boehr
2023-03-27 8:21 ` [kvm-unit-tests PATCH v1 4/4] s390x: add a test for SIE without MSO/MSL Nico Boehr
2023-04-05 19:55 ` Nina Schoetterl-Glausch
2023-04-06 8:01 ` Janosch Frank
2023-04-13 9:43 ` Nico Boehr
2023-04-13 16:33 ` Nina Schoetterl-Glausch
2023-04-14 10:10 ` Nico Boehr
2023-04-14 10:24 ` Nina Schoetterl-Glausch
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=20230329150032.7093e25b@p-imbrenda \
--to=imbrenda@linux.ibm.com \
--cc=frankja@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=nrb@linux.ibm.com \
--cc=thuth@redhat.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