qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alistair Francis <alistair23@gmail.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: Daniel Henrique Barboza <dbarboza@ventanamicro.com>,
	qemu-devel@nongnu.org, qemu-riscv@nongnu.org,
	 alistair.francis@wdc.com, bmeng@tinylab.org,
	liweiwei@iscas.ac.cn,  zhiwei_liu@linux.alibaba.com,
	palmer@rivosinc.com
Subject: Re: [PATCH 2/2] target/riscv/tcg-cpu.c: add extension properties for all cpus
Date: Mon, 9 Oct 2023 12:37:18 +1000	[thread overview]
Message-ID: <CAKmqyKO1808GvE89rCDB7aa8P+GD9qAXzonJqsSuNQN4S94Pug@mail.gmail.com> (raw)
In-Reply-To: <ZRapCe9kGyw52bLS@redhat.com>

On Fri, Sep 29, 2023 at 8:39 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> On Tue, Sep 26, 2023 at 03:31:09PM -0300, Daniel Henrique Barboza wrote:
> > At this moment we do not expose extension properties for vendor CPUs
> > because that would allow users to change them via command line. The
> > drawback is that if we were to add an API that shows all CPU properties,
> > e.g. qmp-query-cpu-model-expansion, we won't be able to show extensions
> > state of vendor CPUs.
> >
> > We have the required machinery to create extension properties for vendor
> > CPUs while not allowing users to enable extensions. Disabling existing
> > extensions is allowed since it can be useful for debugging.
> >
> > Change the set() callback cpu_set_multi_ext_cfg() to allow enabling
> > extensions only for generic CPUs. In cpu_add_multi_ext_prop() let's not
> > set the default values for the properties if we're not dealing with
> > generic CPUs, otherwise the values set in cpu_init() of vendor CPUs will
> > be overwritten. And finally, in tcg_cpu_instance_init(), add cpu user
> > properties for all CPUs.
> >
> > For the veyron-v1 CPU, we're now able to disable existing extensions
> > like smstateen:
> >
> > $ ./build/qemu-system-riscv64 --nographic -M virt \
> >     -cpu veyron-v1,smstateen=false
> >
> > But setting extensions that the CPU didn't set during cpu_init(), like
> > V, is not allowed:
> >
> > $ ./build/qemu-system-riscv64 --nographic -M virt \
> >     -cpu veyron-v1,v=true
> > qemu-system-riscv64: can't apply global veyron-v1-riscv-cpu.v=true:
> >   'veyron-v1' CPU does not allow enabling extensions
>
> Why should we block the user if they want to enable an extra
> feature, over and above what is built-in to the CPU model ?

It ends up being tricky to maintain. On top of that we can report a
specific vendor CPU to guests, but then we don't correctly model it
(as extensions might be disabled).

Alistair

> Is there some technical reason that prevents this from working ?
>
> With regards,
> Daniel
> --
> |: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org         -o-            https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
>
>


  reply	other threads:[~2023-10-09  2:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26 18:31 [PATCH 0/2] riscv: add extension properties for all cpus Daniel Henrique Barboza
2023-09-26 18:31 ` [PATCH 1/2] target/riscv: add riscv_cpu_get_name() Daniel Henrique Barboza
2023-09-27  4:58   ` Alistair Francis
2023-09-26 18:31 ` [PATCH 2/2] target/riscv/tcg-cpu.c: add extension properties for all cpus Daniel Henrique Barboza
2023-09-29  5:13   ` Alistair Francis
2023-09-29 10:38   ` Daniel P. Berrangé
2023-10-09  2:37     ` Alistair Francis [this message]
2023-09-29  5:29 ` [PATCH 0/2] riscv: " Alistair Francis

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=CAKmqyKO1808GvE89rCDB7aa8P+GD9qAXzonJqsSuNQN4S94Pug@mail.gmail.com \
    --to=alistair23@gmail.com \
    --cc=alistair.francis@wdc.com \
    --cc=berrange@redhat.com \
    --cc=bmeng@tinylab.org \
    --cc=dbarboza@ventanamicro.com \
    --cc=liweiwei@iscas.ac.cn \
    --cc=palmer@rivosinc.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=zhiwei_liu@linux.alibaba.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;
as well as URLs for NNTP newsgroup(s).