From: Andrew Jones <ajones@ventanamicro.com>
To: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Cc: Alexandre Ghiti <alex@ghiti.fr>,
kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org,
kvm@vger.kernel.org, Conor Dooley <conor.dooley@microchip.com>,
anup@brainfault.org, atishp@atishpatra.org
Subject: Re: [PATCH] RISC-V: KVM: provide UAPI for host SATP mode
Date: Wed, 5 Jul 2023 14:58:24 +0200 [thread overview]
Message-ID: <20230705-602410a4b627f419f8f9936c@orel> (raw)
In-Reply-To: <029b87e1-d4bc-9deb-316b-b93c5bd2a37f@ventanamicro.com>
On Wed, Jul 05, 2023 at 09:33:26AM -0300, Daniel Henrique Barboza wrote:
>
>
> On 7/5/23 09:18, Alexandre Ghiti wrote:
> >
> > On 05/07/2023 11:15, Daniel Henrique Barboza wrote:
> > > KVM userspaces need to be aware of the host SATP to allow them to
> > > advertise it back to the guest OS.
> > >
> > > Since this information is used to build the guest FDT we can't wait for
> >
> >
> > The thing is the "mmu-type" property in the FDT is never used: the kernel will probe the hardware and choose the largest available mode, or use "no4lvl"/"no5lvl" from the command line to restrict this mode. And FYI the current mode is exposed through cpuinfo. @Conor Can we deprecate this node or something similar?
> >
> > Just a remark, not sure that helps :)
>
> It does, thanks. I am aware that the current mode is exposed through cpuinfo.
> mvendorid/marchid/mimpid is also exposed there. As far as I understand we should
> rely on KVM to provide all CPU related info to configure a vcpu though.
>
> A little background of where I'm coming from. One of the QEMU KVM cpu types (host)
> doesn't have an assigned satp_mode. The FDT creation of the 'virt' board relies on
> that info being present, and the result is that the board will segfault. I sent a
> fix for it that I hope will be queued shortly:
>
> https://lore.kernel.org/qemu-devel/20230630100811.287315-3-dbarboza@ventanamicro.com/
>
> Thus, if it's decided that the satp_mode FDT is deprecated, we can ignore this
> patch altogether. Thanks,
We'll eventually want the ability to get and set vsatp.mode from the VMM,
so we'll want KVM_REG_RISCV_CONFIG_REG(satp_mode) anyway. For now, since
we only support CPU passthrough with KVM, it's a convenient way to read
the host's mode (while PPC qemu-kvm does read cpuinfo, I'm not aware of
any other qemu-kvm doing that).
Thanks,
drew
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2023-07-05 12:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-05 9:15 [PATCH] RISC-V: KVM: provide UAPI for host SATP mode Daniel Henrique Barboza
2023-07-05 11:23 ` Andrew Jones
2023-07-05 12:18 ` Alexandre Ghiti
2023-07-05 12:33 ` Daniel Henrique Barboza
2023-07-05 12:58 ` Andrew Jones [this message]
2023-07-05 14:44 ` Conor Dooley
2023-07-05 14:51 ` Conor Dooley
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=20230705-602410a4b627f419f8f9936c@orel \
--to=ajones@ventanamicro.com \
--cc=alex@ghiti.fr \
--cc=anup@brainfault.org \
--cc=atishp@atishpatra.org \
--cc=conor.dooley@microchip.com \
--cc=dbarboza@ventanamicro.com \
--cc=kvm-riscv@lists.infradead.org \
--cc=kvm@vger.kernel.org \
--cc=linux-riscv@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox