public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: Alexandru Elisei <alexandru.elisei@arm.com>
Cc: thuth@redhat.com, pbonzini@redhat.com, lvivier@redhat.com,
	kvm-ppc@vger.kernel.org, david@redhat.com, frankja@linux.ibm.com,
	cohuck@redhat.com, imbrenda@linux.ibm.com,
	linux-s390@vger.kernel.org, kvm@vger.kernel.org,
	kvmarm@lists.cs.columbia.edu, andre.przywara@arm.com,
	maz@kernel.org, vivek.gautam@arm.com
Subject: Re: [kvm-unit-tests RFC PATCH 3/5] run_tests.sh: Add kvmtool support
Date: Wed, 8 Sep 2021 17:49:43 +0200	[thread overview]
Message-ID: <20210908154943.z7d6bhww3pnbaftd@gator> (raw)
In-Reply-To: <56289c06-04ec-1772-6e15-98d02780876d@arm.com>

On Wed, Sep 08, 2021 at 04:46:19PM +0100, Alexandru Elisei wrote:
> Hi Drew,
> 
> On 9/8/21 4:09 PM, Andrew Jones wrote:
> > On Wed, Sep 08, 2021 at 03:33:19PM +0100, Alexandru Elisei wrote:
> > ...
> >>>> +fixup_kvmtool_opts()
> >>>> +{
> >>>> +    local opts=$1
> >>>> +    local groups=$2
> >>>> +    local gic
> >>>> +    local gic_version
> >>>> +
> >>>> +    if find_word "pmu" $groups; then
> >>>> +        opts+=" --pmu"
> >>>> +    fi
> >>>> +
> >>>> +    if find_word "its" $groups; then
> >>>> +        gic_version=3
> >>>> +        gic="gicv3-its"
> >>>> +    elif [[ "$opts" =~ -machine\ *gic-version=(2|3) ]]; then
> >>>> +        gic_version="${BASH_REMATCH[1]}"
> >>>> +        gic="gicv$gic_version"
> >>>> +    fi
> >>>> +
> >>>> +    if [ -n "$gic" ]; then
> >>>> +        opts=${opts/-machine gic-version=$gic_version/}
> >>>> +        opts+=" --irqchip=$gic"
> >>>> +    fi
> >>>> +
> >>>> +    opts=${opts/-append/--params}
> >>>> +
> >>>> +    echo "$opts"
> >>>> +}
> >>> Hmm, I don't think we want to write a QEMU parameter translator for
> >>> all other VMMs, and all other VMM architectures, that we want to
> >>> support. I think we should add new "extra_params" variables to the
> >>> unittest configuration instead, e.g. "kvmtool_params", where the
> >>> extra parameters can be listed correctly and explicitly. While at
> >>> it, I would create an alias for "extra_params", which would be
> >>> "qemu_params" allowing unittests that support more than one VMM
> >>> to clearly show what's what.
> >> I agree, this is a much better idea than a parameter translator. Using a dedicated
> >> variable in unittests.cfg will make it easier for new tests to get support for all
> >> VMMs (for example, writing a list of parameters in unittests.cfg should be easier
> >> than digging through the scripts to figure exactly how and where to add a
> >> translation for a new parameter), and it allow us to express parameters for other
> >> VMMs which don't have a direct correspondent in qemu.
> >>
> >> By creating an alias, do you mean replacing extra_params with qemu_params in
> >> arm/unittests.cfg? Or something else?
> > Probably something like this
> >
> > diff --git a/scripts/common.bash b/scripts/common.bash
> > index 7b983f7d6dd6..e5119ff216e5 100644
> > --- a/scripts/common.bash
> > +++ b/scripts/common.bash
> > @@ -37,7 +37,12 @@ function for_each_unittest()
> >                 elif [[ $line =~ ^smp\ *=\ *(.*)$ ]]; then
> >                         smp=${BASH_REMATCH[1]}
> >                 elif [[ $line =~ ^extra_params\ *=\ *(.*)$ ]]; then
> > -                       opts=${BASH_REMATCH[1]}
> > +               elif [[ $line =~ ^extra_params\ *=\ *(.*)$ ]]; then
> > +                       qemu_opts=${BASH_REMATCH[1]}
> > +               elif [[ $line =~ ^qemu_params\ *=\ *(.*)$ ]]; then
> > +                       qemu_opts=${BASH_REMATCH[1]}
> > +               elif [[ $line =~ ^kvmtool_params\ *=\ *(.*)$ ]]; then
> > +                       kvmtool_opts=${BASH_REMATCH[1]}
> >                 elif [[ $line =~ ^groups\ *=\ *(.*)$ ]]; then
> >                         groups=${BASH_REMATCH[1]}
> >                 elif [[ $line =~ ^arch\ *=\ *(.*)$ ]]; then
> >
> > and all other changes needed to support the s/opts/qemu_opts/ change
> > should work. Also, an addition to the unittests.cfg documentation.
> 
> Got it, replace extra_opts with qemu_opts in the scripts.
> 
> Yes, the documentation for unittests.cfg (at the top of the file) should
> definitely be updated to document the new configuration option, kvmtool_params.
> 
> >
> > The above diff doesn't consider that a unittests.cfg file could have
> > both an 'extra_params' and a 'qemu_params' field, but I'm not sure
> > we care about that. Users should read the documentation and we
> > should review changes to the committed unittests.cfg files to avoid
> > that.
> 
> What do you feel about renaming extra_params -> qemu_params in unittests.cfg?

Yes, that's what I would expect the patch to do.

> I'm
> thinking it would make the usage clearer, improve consistency (we would have
> qemu_params and kvmtool_params, instead of extra_params and kvmtool_params), and
> remove any confusions regarding when they are used (I can see someone thinking
> that extra_params are used all the time, and are appended to kvmtool_params when
> --target=kvmtool). On the other hand, this could be problematic for people using
> out-of-tree scripts that parse the unittest.cfg file for whatever reason (are
> there people that do that?).

I'm not as worried about that as about people using out-of-tree
unittests.cfg files that will break when the 'extra_params' field
disappears. That's why I suggested to make 'extra_params' an alias.

Thanks,
drew

> 
> Thanks,
> 
> Alex
> 
> >
> > Thanks,
> > drew
> >
> 


  reply	other threads:[~2021-09-08 15:49 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-02 16:31 [kvm-unit-tests RFC PATCH 0/5] arm: Add kvmtool to the runner script Alexandru Elisei
2021-07-02 16:31 ` [kvm-unit-tests RFC PATCH 1/5] lib: arm: Print test exit status on exit if chr-testdev is not available Alexandru Elisei
2021-07-12 16:36   ` Andrew Jones
2021-09-06 10:20     ` Alexandru Elisei
2021-09-06 10:58       ` Andrew Jones
2021-09-06 11:06         ` Alexandru Elisei
2021-07-12 16:51   ` Andre Przywara
2021-07-12 17:07     ` Andrew Jones
2021-07-12 17:12       ` Nadav Amit
2021-07-02 16:31 ` [kvm-unit-tests RFC PATCH 2/5] scripts: Rename run_qemu_status -> run_test_status Alexandru Elisei
2021-07-12 16:37   ` Andrew Jones
2021-07-13  7:45   ` Thomas Huth
2021-07-02 16:31 ` [kvm-unit-tests RFC PATCH 3/5] run_tests.sh: Add kvmtool support Alexandru Elisei
2021-07-12 16:52   ` Andre Przywara
2021-09-06 10:28     ` Alexandru Elisei
2021-09-06 11:01       ` Andrew Jones
2021-09-06 11:07         ` Alexandru Elisei
2021-09-07 10:17   ` Andrew Jones
2021-09-08 14:33     ` Alexandru Elisei
2021-09-08 15:09       ` Andrew Jones
2021-09-08 15:46         ` Alexandru Elisei
2021-09-08 15:49           ` Andrew Jones [this message]
2021-09-09 11:33             ` Alexandru Elisei
2021-09-09 12:49               ` Andrew Jones
2021-07-02 16:31 ` [kvm-unit-tests RFC PATCH 4/5] scripts: Generate kvmtool standalone tests Alexandru Elisei
2021-09-07 10:21   ` Andrew Jones
2021-09-08 15:37     ` Alexandru Elisei
2021-09-08 16:07       ` Andrew Jones
2021-09-09 11:11         ` Alexandru Elisei
2021-09-09 13:05           ` Andrew Jones
2021-09-09 13:47             ` Alexandru Elisei
2021-09-09 13:54               ` Andrew Jones
2021-09-09 14:42                 ` Alexandru Elisei
2021-07-02 16:31 ` [kvm-unit-tests RFC PATCH 5/5] configure: Ignore --erratatxt when --target=kvmtool Alexandru Elisei
2021-09-07 10:25   ` Andrew Jones
2021-09-08 16:13     ` Alexandru Elisei

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=20210908154943.z7d6bhww3pnbaftd@gator \
    --to=drjones@redhat.com \
    --cc=alexandru.elisei@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-s390@vger.kernel.org \
    --cc=lvivier@redhat.com \
    --cc=maz@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=thuth@redhat.com \
    --cc=vivek.gautam@arm.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