From: Alexandru Elisei <alexandru.elisei@arm.com>
To: Rajnesh Kanwal <rkanwal@rivosinc.com>
Cc: apatel@ventanamicro.com, atishp@rivosinc.com,
kvm@vger.kernel.org, will@kernel.org,
julien.thierry.kdev@gmail.com, maz@kernel.org,
andre.przywara@arm.com
Subject: Re: [PATCH kvmtool 1/1] riscv: pci: Add --force-pci option for riscv VMs.
Date: Thu, 19 Jan 2023 13:39:32 +0000 [thread overview]
Message-ID: <Y8lIFLdsAAOqMo0Y@arm.com> (raw)
In-Reply-To: <20230118172007.408667-1-rkanwal@rivosinc.com>
Hi,
CC'ing the kvmtool maintainers and other people that might be interested in this
thread. Sorry for hijacking your patch!
On Wed, Jan 18, 2023 at 05:20:07PM +0000, Rajnesh Kanwal wrote:
> Adding force-pci option to allow forcing virtio
> devices to use pci as the default transport.
arm is in the same situation, MMIO is the default virtio transport. I was bitten
by that in the past. It also cought other people unaware, and I remember maz
complaining about it on the list.
So I was thinking about adding a new command line parameter, --virtio-transport,
with the possible values mmio-legacy, mmio, pci-legacy and pci. Then each
architecture can define the default value for the transport. For arm, that would
be pci.
What do you guys think?
Thanks,
Alex
>
> Signed-off-by: Rajnesh Kanwal <rkanwal@rivosinc.com>
> ---
> riscv/include/kvm/kvm-arch.h | 6 ++++--
> riscv/include/kvm/kvm-config-arch.h | 7 ++++++-
> 2 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/riscv/include/kvm/kvm-arch.h b/riscv/include/kvm/kvm-arch.h
> index 1e130f5..2cf41c5 100644
> --- a/riscv/include/kvm/kvm-arch.h
> +++ b/riscv/include/kvm/kvm-arch.h
> @@ -46,8 +46,10 @@
>
> #define KVM_VM_TYPE 0
>
> -#define VIRTIO_DEFAULT_TRANS(kvm) \
> - ((kvm)->cfg.virtio_legacy ? VIRTIO_MMIO_LEGACY : VIRTIO_MMIO)
> +#define VIRTIO_DEFAULT_TRANS(kvm) \
> + ((kvm)->cfg.arch.virtio_trans_pci ? \
> + ((kvm)->cfg.virtio_legacy ? VIRTIO_PCI_LEGACY : VIRTIO_PCI) : \
> + ((kvm)->cfg.virtio_legacy ? VIRTIO_MMIO_LEGACY : VIRTIO_MMIO))
>
> #define VIRTIO_RING_ENDIAN VIRTIO_ENDIAN_LE
>
> diff --git a/riscv/include/kvm/kvm-config-arch.h b/riscv/include/kvm/kvm-config-arch.h
> index 188125c..901a5e0 100644
> --- a/riscv/include/kvm/kvm-config-arch.h
> +++ b/riscv/include/kvm/kvm-config-arch.h
> @@ -6,6 +6,7 @@
> struct kvm_config_arch {
> const char *dump_dtb_filename;
> bool ext_disabled[KVM_RISCV_ISA_EXT_MAX];
> + bool virtio_trans_pci;
> };
>
> #define OPT_ARCH_RUN(pfx, cfg) \
> @@ -26,6 +27,10 @@ struct kvm_config_arch {
> "Disable Zicbom Extension"), \
> OPT_BOOLEAN('\0', "disable-zihintpause", \
> &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZIHINTPAUSE],\
> - "Disable Zihintpause Extension"),
> + "Disable Zihintpause Extension"), \
> + OPT_BOOLEAN('\0', "force-pci", \
> + &(cfg)->virtio_trans_pci, \
> + "Force virtio devices to use PCI as their " \
> + "default transport"),
>
> #endif /* KVM__KVM_CONFIG_ARCH_H */
> --
> 2.25.1
>
next prev parent reply other threads:[~2023-01-19 13:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-18 17:20 [PATCH kvmtool 1/1] riscv: pci: Add --force-pci option for riscv VMs Rajnesh Kanwal
2023-01-19 13:39 ` Alexandru Elisei [this message]
2023-01-19 14:24 ` Andre Przywara
2023-01-19 18:16 ` Will Deacon
2023-01-21 12:18 ` Marc Zyngier
2023-01-21 15:41 ` 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=Y8lIFLdsAAOqMo0Y@arm.com \
--to=alexandru.elisei@arm.com \
--cc=andre.przywara@arm.com \
--cc=apatel@ventanamicro.com \
--cc=atishp@rivosinc.com \
--cc=julien.thierry.kdev@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=maz@kernel.org \
--cc=rkanwal@rivosinc.com \
--cc=will@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.