From: Andrew Jones <andrew.jones@linux.dev>
To: Alexandru Elisei <alexandru.elisei@arm.com>
Cc: Jean-Philippe Brucker <jean-philippe@linaro.org>,
eric.auger@redhat.com, kvmarm@lists.linux.dev,
kvm@vger.kernel.org, kvm-riscv@lists.infradead.org,
vladimir.murzin@arm.com
Subject: Re: [kvm-unit-tests PATCH v2 4/5] configure: Add --qemu-cpu option
Date: Mon, 24 Mar 2025 14:13:13 +0100 [thread overview]
Message-ID: <20250324-37628351a72ca339819b528d@orel> (raw)
In-Reply-To: <Z-E2v1sKiPG_pt9x@raptor>
On Mon, Mar 24, 2025 at 10:41:03AM +0000, Alexandru Elisei wrote:
> Hi Drew,
>
> On Mon, Mar 24, 2025 at 09:19:27AM +0100, Andrew Jones wrote:
> > On Sun, Mar 23, 2025 at 11:16:19AM +0000, Alexandru Elisei wrote:
> > ...
> > > > > +if [ -z "$qemu_cpu" ]; then
> > > > > + if ( [ "$ACCEL" = "kvm" ] || [ "$ACCEL" = "hvf" ] ) &&
> > > > > + ( [ "$HOST" = "aarch64" ] || [ "$HOST" = "arm" ] ); then
> > > > > + qemu_cpu="host"
> > > > > if [ "$ARCH" = "arm" ] && [ "$HOST" = "aarch64" ]; then
> > > > > - processor+=",aarch64=off"
> > > > > + qemu_cpu+=",aarch64=off"
> > > > > fi
> > > > > + elif [ "$ARCH" = "arm64" ]; then
> > > > > + qemu_cpu="cortex-a57"
> > > > > + else
> > > > > + qemu_cpu="cortex-a15"
> > > >
> > > > configure could set this in config.mak as DEFAULT_PROCESSOR, avoiding the
> > > > need to duplicate it here.
> > >
> > > That was my first instinct too, having the default value in config.mak seemed
> > > like the correct solution.
> > >
> > > But the problem with this is that the default -cpu type depends on -accel (set
> > > via unittests.cfg or as an environment variable), host and test architecture
> > > combination. All of these variables are known only at runtime.
> > >
> > > Let's say we have DEFAULT_QEMU_CPU=cortex-a57 in config.mak. If we keep the
> > > above heuristic, arm/run will override it with host,aarch64=off. IMO, having it
> > > in config.mak, but arm/run using it only under certain conditions is worse than
> > > not having it at all. arm/run choosing the default value **all the time** is at
> > > least consistent.
> >
> > I think having 'DEFAULT' in the name implies that it will only be used if
> > there's nothing better, and we don't require everything in config.mak to
> > be used (there's even some s390x-specific stuff in there for all
> > architectures...)
>
> I'm still leaning towards having the default value and the heuristics for
> when to pick it in one place ($ARCH/run) as being more convenient, but I
> can certainly see your point of view.
I wouldn't mind it only being in $ARCH/run, but this series adds the same
logic to $ARCH/run and to ./configure. I think an additional, potentially
unused, variable in config.mak is better than code duplication.
Thanks,
drew
next prev parent reply other threads:[~2025-03-24 13:13 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-14 15:49 [kvm-unit-tests PATCH v2 0/5] arm64: Change the default QEMU CPU type to "max" Jean-Philippe Brucker
2025-03-14 15:49 ` [kvm-unit-tests PATCH v2 1/5] configure: arm64: Don't display 'aarch64' as the default architecture Jean-Philippe Brucker
2025-03-17 8:19 ` Eric Auger
2025-03-17 8:27 ` Eric Auger
2025-03-24 15:48 ` Jean-Philippe Brucker
2025-03-22 11:04 ` Andrew Jones
2025-03-14 15:49 ` [kvm-unit-tests PATCH v2 2/5] configure: arm/arm64: Display the correct default processor Jean-Philippe Brucker
2025-03-17 8:30 ` Eric Auger
2025-03-22 11:07 ` Andrew Jones
2025-03-14 15:49 ` [kvm-unit-tests PATCH v2 3/5] arm64: Implement the ./configure --processor option Jean-Philippe Brucker
2025-03-17 8:34 ` Eric Auger
2025-03-14 15:49 ` [kvm-unit-tests PATCH v2 4/5] configure: Add --qemu-cpu option Jean-Philippe Brucker
2025-03-17 8:53 ` Eric Auger
2025-03-20 13:42 ` Alexandru Elisei
2025-03-22 11:25 ` Andrew Jones
2025-03-22 11:26 ` Andrew Jones
2025-03-23 11:16 ` Alexandru Elisei
2025-03-24 8:19 ` Andrew Jones
2025-03-24 10:41 ` Alexandru Elisei
2025-03-24 13:13 ` Andrew Jones [this message]
2025-03-24 15:52 ` Jean-Philippe Brucker
2025-03-14 15:49 ` [kvm-unit-tests PATCH v2 5/5] arm64: Use -cpu max as the default for TCG Jean-Philippe Brucker
2025-03-17 10:13 ` Eric Auger
2025-03-22 11:27 ` Andrew Jones
2025-03-24 15:50 ` Jean-Philippe Brucker
2025-03-24 16:33 ` Andrew Jones
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=20250324-37628351a72ca339819b528d@orel \
--to=andrew.jones@linux.dev \
--cc=alexandru.elisei@arm.com \
--cc=eric.auger@redhat.com \
--cc=jean-philippe@linaro.org \
--cc=kvm-riscv@lists.infradead.org \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=vladimir.murzin@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