From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: Nico Boehr <nrb@linux.ibm.com>
Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org,
frankja@linux.ibm.com, thuth@redhat.com, david@redhat.com,
farman@linux.ibm.com
Subject: Re: [kvm-unit-tests PATCH v2 4/9] s390x: smp: add test for SIGP_STORE_ADTL_STATUS order
Date: Thu, 24 Mar 2022 14:03:17 +0100 [thread overview]
Message-ID: <20220324140317.49a86cdd@p-imbrenda> (raw)
In-Reply-To: <7a624f37d23d8095e56a6ecc6b872b8b933b58bb.camel@linux.ibm.com>
On Thu, 24 Mar 2022 08:39:29 +0100
Nico Boehr <nrb@linux.ibm.com> wrote:
> On Wed, 2022-03-23 at 18:45 +0100, Claudio Imbrenda wrote:
> > On Wed, 23 Mar 2022 18:03:20 +0100
> > Nico Boehr <nrb@linux.ibm.com> wrote:
> >
> [...]
> > > +
> > > +static int memisset(void *s, int c, size_t n)
> >
> > function should return bool..
>
> Sure, changed.
>
> [...]
> > > +static void test_store_adtl_status(void)
> > > +{
> > >
> [...]
> > > +
> > > + report_prefix_push("unaligned");
> > > + smp_cpu_stop(1);
> > > +
> > > + cc = smp_sigp(1, SIGP_STORE_ADDITIONAL_STATUS,
> > > + (unsigned long)&adtl_status + 256, &status);
> > > + report(cc == 1, "CC = 1");
> > > + report(status == SIGP_STATUS_INVALID_PARAMETER, "status =
> > > INVALID_PARAMETER");
> >
> > and check again that nothing has been written to
>
> Oh, thanks. Fixed.
>
> [...]
> > > +static void test_store_adtl_status_unavail(void)
> > > +{
> > > + uint32_t status = 0;
> > > + int cc;
> > > +
> > > + report_prefix_push("store additional status unvailable");
> > > +
> > > + if (have_adtl_status()) {
> > > + report_skip("guarded-storage or vector facility
> > > installed");
> > > + goto out;
> > > + }
> > > +
> > > + report_prefix_push("not accepted");
> > > + smp_cpu_stop(1);
> > > +
> > > + cc = smp_sigp(1, SIGP_STORE_ADDITIONAL_STATUS,
> > > + (unsigned long)&adtl_status, &status);
> > > +
> > > + report(cc == 1, "CC = 1");
> > > + report(status == SIGP_STATUS_INVALID_ORDER,
> > > + "status = INVALID_ORDER");
> > > +
> >
> > I would still check that nothing is written even when the order is
> > rejected
>
> Won't hurt, added.
>
> [...]
> > > +static void restart_write_vector(void)
> > > +{
> > > + uint8_t *vec_reg;
> > > + /*
> > > + * vlm handles at most 16 registers at a time
> > > + */
> >
> > this comment can /* go on a single line */
>
> OK
>
> [...]
> > > + /*
> > > + * i+1 to avoid zero content
> > > + */
> >
> > same /* here */
>
> OK, changed.
>
> [...]
> > > +static void __store_adtl_status_vector_lc(unsigned long lc)
> > > +{
> > > + uint32_t status = -1;
> > > + struct psw psw;
> > > + int cc;
> > > +
> > > + report_prefix_pushf("LC %lu", lc);
> > > +
> > > + if (!test_facility(133) && lc) {
> > > + report_skip("not supported, no guarded-storage
> > > facility");
> > > + goto out;
> > > + }
> >
> > I think this ^ should not be there at all
>
> It must be. If we don't have guarded-storage only LC 0 is allowed:
>
> "When the guarded-storage facility is not installed, the
> length and alignment of the MCESA is 1024 bytes.
> When the guarded-storage facility is installed, the
> length characteristic (LC) in bits 60-63 of the
> MCESAD specifies the length and alignment of the
> MCESA as a power of two"
hmm, it seems like that without guarded storage LC is ignored, and the
size is hardcoded to 1024.
this is getting a little out of hand now
I think you should make this into a separate test
>
> See below for the reason why we don't have gs here.
>
> [...]
> > > diff --git a/s390x/unittests.cfg b/s390x/unittests.cfg
> > > index 1600e714c8b9..843fd323bce9 100644
> > > --- a/s390x/unittests.cfg
> > > +++ b/s390x/unittests.cfg
> > > @@ -74,9 +74,29 @@ extra_params=-device diag288,id=watchdog0 --
> > > watchdog-action inject-nmi
> > > file = stsi.elf
> > > extra_params=-name kvm-unit-test --uuid 0fb84a86-727c-11ea-bc55-
> > > 0242ac130003 -smp 1,maxcpus=8
> > >
> > > -[smp]
> > > +[smp-kvm]
> > > file = smp.elf
> > > smp = 2
> > > +accel = kvm
> > > +extra_params = -cpu host,gs=on,vx=on
> > > +
> > > +[smp-no-vec-no-gs-kvm]
> > > +file = smp.elf
> > > +smp = 2
> > > +accel = kvm
> > > +extra_params = -cpu host,gs=off,vx=off
> > > +
> > > +[smp-tcg]
> > > +file = smp.elf
> > > +smp = 2
> > > +accel = tcg
> > > +extra_params = -cpu qemu,vx=on
> >
> > why not gs=on as well?
>
> I am not an expert in QEMU CPU model, but it seems to me TCG doesn't
> support it.
it seems indeed so. maybe add a comment to explain
>
next prev parent reply other threads:[~2022-03-24 13:03 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-23 17:03 [kvm-unit-tests PATCH v2 0/9] s390x: Further extend instruction interception tests Nico Boehr
2022-03-23 17:03 ` [kvm-unit-tests PATCH v2 1/9] s390x: smp: add tests for several invalid SIGP orders Nico Boehr
2022-03-23 17:03 ` [kvm-unit-tests PATCH v2 2/9] s390x: smp: stop already stopped CPU Nico Boehr
2022-03-23 17:03 ` [kvm-unit-tests PATCH v2 3/9] s390x: gs: move to new header file Nico Boehr
2022-03-24 17:40 ` Heiko Carstens
2022-03-25 7:29 ` Janosch Frank
2022-03-25 14:30 ` Claudio Imbrenda
2022-03-25 15:07 ` Janosch Frank
2022-03-25 16:38 ` Claudio Imbrenda
2022-03-28 8:01 ` Nico Boehr
2022-03-23 17:03 ` [kvm-unit-tests PATCH v2 4/9] s390x: smp: add test for SIGP_STORE_ADTL_STATUS order Nico Boehr
2022-03-23 17:45 ` Claudio Imbrenda
2022-03-24 7:39 ` Nico Boehr
2022-03-24 13:03 ` Claudio Imbrenda [this message]
2022-03-25 13:10 ` Nico Boehr
2022-03-23 17:03 ` [kvm-unit-tests PATCH v2 5/9] s390x: smp: add tests for SET_PREFIX Nico Boehr
2022-03-23 17:03 ` [kvm-unit-tests PATCH v2 6/9] s390x: smp: add test for EMERGENCY_SIGNAL with invalid CPU address Nico Boehr
2022-03-23 17:03 ` [kvm-unit-tests PATCH v2 7/9] s390x: smp: add tests for CONDITIONAL EMERGENCY Nico Boehr
2022-03-23 17:03 ` [kvm-unit-tests PATCH v2 8/9] s390x: add TPROT tests Nico Boehr
2022-03-23 17:03 ` [kvm-unit-tests PATCH v2 9/9] s390x: stsi: check zero and ignored bits in r0 and r1 Nico Boehr
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=20220324140317.49a86cdd@p-imbrenda \
--to=imbrenda@linux.ibm.com \
--cc=david@redhat.com \
--cc=farman@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