[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAhSdy2kAze4bt17kVA3tB4H6qXPMSUroi5ybPcTvFB_=p48oQ@mail.gmail.com>
Date: Thu, 3 Oct 2019 11:00:05 +0530
From: Anup Patel <anup@...infault.org>
To: Christoph Hellwig <hch@...radead.org>
Cc: Atish Patra <atish.patra@....com>,
"linux-kernel@...r.kernel.org List" <linux-kernel@...r.kernel.org>,
Albert Ou <aou@...s.berkeley.edu>,
Alan Kao <alankao@...estech.com>,
Palmer Dabbelt <palmer@...ive.com>,
Mike Rapoport <rppt@...ux.ibm.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Gary Guo <gary@...yguo.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-riscv <linux-riscv@...ts.infradead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Allison Randal <allison@...utok.net>
Subject: Re: [PATCH v2 3/3] RISC-V: Move SBI related macros under uapi.
On Sat, Sep 28, 2019 at 3:51 AM Christoph Hellwig <hch@...radead.org> wrote:
>
> On Thu, Sep 26, 2019 at 05:09:15PM -0700, Atish Patra wrote:
> > All SBI related macros can be reused by KVM RISC-V and userspace tools
> > such as kvmtool, qemu-kvm. SBI calls can also be emulated by userspace
> > if required. Any future vendor extensions can leverage this to emulate
> > the specific extension in userspace instead of kernel.
>
> Just because userspace can use them that doesn't mean they are a
> userspace API. Please don't do this as this limits how we can ever
> remove previously existing symbols. Just copy over the current
> version of the file into the other project of your choice instead
> of creating and API we need to maintain.
These defines are indeed part of KVM userspace API because we will
be forwarding SBI calls not handled by KVM RISC-V kernel module to
KVM userspace (QEMU/KVMTOOL). The forwarded SBI call details
are passed to userspace via "struct kvm_run" of KVM_RUN ioctl.
Please refer PATCH17 and PATCH18 of KVM RISC-V v8 series.
Currently, we implement SBI v0.1 for KVM Guest hence we end-up
forwarding CONSOLE_GETCHAR and CONSOLE_PUTCHART to
KVM userspace.
In future we will implement SBI v0.2 for KVM Guest where we will be
forwarding the SBI v0.2 experimental and vendor extension calls
to KVM userspace.
Eventually, we will stop emulating SBI v0.1 for Guest once we have
all required calls in SBI v0.2. At that time, all SBI v0.1 calls will be
always forwarded to KVM userspace.
Regards,
Anup
Powered by blists - more mailing lists