From: Alistair Francis <alistair23@gmail.com>
To: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Cc: qemu-devel@nongnu.org, qemu-riscv@nongnu.org,
	alistair.francis@wdc.com,  bmeng@tinylab.org,
	liwei1518@gmail.com, zhiwei_liu@linux.alibaba.com,
	 palmer@rivosinc.com, ajones@ventanamicro.com
Subject: Re: [PATCH 2/4] target/riscv/kvm: clarify how 'riscv-aia' default works
Date: Fri, 11 Oct 2024 11:54:08 +1000	[thread overview]
Message-ID: <CAKmqyKPPun+5QNhLQ-R1p80q6BU4ZmKf=C_UdxwSEs3emi-54Q@mail.gmail.com> (raw)
In-Reply-To: <20240924124407.766495-3-dbarboza@ventanamicro.com>
On Tue, Sep 24, 2024 at 10:46 PM Daniel Henrique Barboza
<dbarboza@ventanamicro.com> wrote:
>
> We do not have control in the default 'riscv-aia' default value. We can
> try to set it to a specific value, in this case 'auto', but there's no
> guarantee that the host will accept it.
>
> Couple with this we're always doing a 'qemu_log' to inform whether we're
> ended up using the host default or if we managed to set the AIA mode to
> the QEMU default we wanted to set.
>
> Change the 'riscv-aia' description to better reflect how the option
> works, and remove the two informative 'qemu_log' that are now unneeded:
> if no message shows, riscv-aia was set to the default or uset-set value.
>
> Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
>  target/riscv/kvm/kvm-cpu.c | 14 ++++----------
>  1 file changed, 4 insertions(+), 10 deletions(-)
>
> diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c
> index 970a7ab2f1..32f3dd6a43 100644
> --- a/target/riscv/kvm/kvm-cpu.c
> +++ b/target/riscv/kvm/kvm-cpu.c
> @@ -1676,9 +1676,9 @@ void kvm_arch_accel_class_init(ObjectClass *oc)
>      object_class_property_add_str(oc, "riscv-aia", riscv_get_kvm_aia,
>                                    riscv_set_kvm_aia);
>      object_class_property_set_description(oc, "riscv-aia",
> -                                          "Set KVM AIA mode. Valid values are "
> -                                          "emul, hwaccel, and auto. Default "
> -                                          "is auto.");
> +        "Set KVM AIA mode. Valid values are 'emul', 'hwaccel' and 'auto'. "
> +        "Changing KVM AIA modes relies on host support. Defaults to 'auto' "
> +        "if the host supports it");
>      object_property_set_default_str(object_class_property_find(oc, "riscv-aia"),
>                                      "auto");
>  }
> @@ -1712,10 +1712,7 @@ void kvm_riscv_aia_create(MachineState *machine, uint64_t group_shift,
>          exit(1);
>      }
>
> -    if (default_aia_mode == aia_mode) {
> -        qemu_log("KVM AIA: using default host mode '%s'\n",
> -                  kvm_aia_mode_str(default_aia_mode));
> -    } else {
> +    if (default_aia_mode != aia_mode) {
>          ret = kvm_device_access(aia_fd, KVM_DEV_RISCV_AIA_GRP_CONFIG,
>                                  KVM_DEV_RISCV_AIA_CONFIG_MODE,
>                                  &aia_mode, true, NULL);
> @@ -1727,9 +1724,6 @@ void kvm_riscv_aia_create(MachineState *machine, uint64_t group_shift,
>
>              /* failed to change AIA mode, use default */
>              aia_mode = default_aia_mode;
> -        } else {
> -            qemu_log("KVM AIA: setting current mode to %s\n",
> -                     kvm_aia_mode_str(aia_mode));
>          }
>      }
>
> --
> 2.45.2
>
>
next prev parent reply	other threads:[~2024-10-11  1:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-24 12:44 [PATCH 0/4] target/riscv/kvm: add riscv-aia bool props Daniel Henrique Barboza
2024-09-24 12:44 ` [PATCH 1/4] target/riscv/kvm: set 'aia_mode' to default in error path Daniel Henrique Barboza
2024-10-11  1:42   ` Alistair Francis
2024-09-24 12:44 ` [PATCH 2/4] target/riscv/kvm: clarify how 'riscv-aia' default works Daniel Henrique Barboza
2024-10-11  1:54   ` Alistair Francis [this message]
2024-09-24 12:44 ` [PATCH 3/4] target/riscv/kvm: add kvm-aia bools props Daniel Henrique Barboza
2024-10-11  1:57   ` Alistair Francis
2024-10-11 11:19     ` Daniel Henrique Barboza
2024-10-30  1:40       ` Alistair Francis
2024-10-31 13:50         ` Andrew Jones
2024-09-24 12:44 ` [PATCH 4/4] target/riscv/kvm: deprecate riscv-aia string prop Daniel Henrique Barboza
2024-10-28 18:00 ` [PATCH 0/4] target/riscv/kvm: add riscv-aia bool props Daniel Henrique Barboza
2024-10-30  1:44   ` Alistair Francis
2024-10-31 14:06     ` 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='CAKmqyKPPun+5QNhLQ-R1p80q6BU4ZmKf=C_UdxwSEs3emi-54Q@mail.gmail.com' \
    --to=alistair23@gmail.com \
    --cc=ajones@ventanamicro.com \
    --cc=alistair.francis@wdc.com \
    --cc=bmeng@tinylab.org \
    --cc=dbarboza@ventanamicro.com \
    --cc=liwei1518@gmail.com \
    --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).