From: Max Hsu <max.hsu@sifive.com>
To: Anup Patel <apatel@ventanamicro.com>
Cc: Anup Patel <anup@brainfault.org>, Conor Dooley <conor@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Atish Patra <atishp@atishpatra.org>,
Palmer Dabbelt <palmer@sifive.com>,
linux-riscv@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
kvm-riscv@lists.infradead.org,
Samuel Holland <samuel.holland@sifive.com>
Subject: Re: [PATCH RFC v2 3/3] riscv: KVM: Add Svukte extension support for Guest/VM
Date: Wed, 20 Nov 2024 21:52:13 +0800 [thread overview]
Message-ID: <CAHibDyxWBHeKOx=sT63EmEwhwyAYMQ3TE2tkOSK8V45PhjztPA@mail.gmail.com> (raw)
In-Reply-To: <CAK9=C2WEU53TD+tnWRLC1iLRf+j607s=bZXevkogTnr-cmhPGw@mail.gmail.com>
Hi Anup,
From your reply, I think my commit message was misleading.
Therefore, I will send RFC v3 patches and explain the guest scenario in the
cover letter.
Thanks for the suggestion.
Best regards,
Max Hsu
On Mon, Nov 4, 2024 at 9:19 PM Anup Patel <apatel@ventanamicro.com> wrote:
>
> On Mon, Nov 4, 2024 at 1:14 PM Max Hsu <max.hsu@sifive.com> wrote:
> >
> > Hi Anup,
> >
> > Thank you for the suggestion.
> >
> > I’m not entirely sure if I fully understand it, but I believe the
> > hypervisor should be able to disable the Svukte extension.
> >
> > Inside the switch-case of kvm_riscv_vcpu_isa_disable_allowed(),
> > the default case breaks and returns true.
> >
> > So that means when the KVM_RISCV_ISA_EXT_SVUKTE passed into
> > kvm_riscv_vcpu_isa_disable_allowed() it will return true.
> >
> > If I've misunderstood, please let me know.
>
> I don't see any code in this patch which disables/enables Svukte for
> Guest based on KVM ONE_REG interface.
>
> Regards,
> Anup
>
> >
> > Best regards,
> > Max Hsu
> >
> > On Fri, Oct 25, 2024 at 3:17 AM Anup Patel <anup@brainfault.org> wrote:
> > >
> > > On Fri, Sep 27, 2024 at 7:12 PM Max Hsu <max.hsu@sifive.com> wrote:
> > > >
> > > > Add KVM ISA extension ONE_REG interface to allow VMM tools to
> > > > detect and enable Svukte extension for Guest/VM.
> > > >
> > > > Reviewed-by: Samuel Holland <samuel.holland@sifive.com>
> > > > Signed-off-by: Max Hsu <max.hsu@sifive.com>
> > > > ---
> > > > arch/riscv/include/uapi/asm/kvm.h | 1 +
> > > > arch/riscv/kvm/vcpu_onereg.c | 1 +
> > > > 2 files changed, 2 insertions(+)
> > > >
> > > > diff --git a/arch/riscv/include/uapi/asm/kvm.h b/arch/riscv/include/uapi/asm/kvm.h
> > > > index e97db3296456e19f79ca02e4c4f70ae1b4abb48b..41b466b7ffaec421e8389d3f5b178580091a2c98 100644
> > > > --- a/arch/riscv/include/uapi/asm/kvm.h
> > > > +++ b/arch/riscv/include/uapi/asm/kvm.h
> > > > @@ -175,6 +175,7 @@ enum KVM_RISCV_ISA_EXT_ID {
> > > > KVM_RISCV_ISA_EXT_ZCF,
> > > > KVM_RISCV_ISA_EXT_ZCMOP,
> > > > KVM_RISCV_ISA_EXT_ZAWRS,
> > > > + KVM_RISCV_ISA_EXT_SVUKTE,
> > > > KVM_RISCV_ISA_EXT_MAX,
> > > > };
> > > >
> > > > diff --git a/arch/riscv/kvm/vcpu_onereg.c b/arch/riscv/kvm/vcpu_onereg.c
> > > > index b319c4c13c54ce22d2a7552f4c9f256a0c50780e..67237d6e53882a9fcd2cf265aa1704f25cc4a701 100644
> > > > --- a/arch/riscv/kvm/vcpu_onereg.c
> > > > +++ b/arch/riscv/kvm/vcpu_onereg.c
> > > > @@ -41,6 +41,7 @@ static const unsigned long kvm_isa_ext_arr[] = {
> > > > KVM_ISA_EXT_ARR(SVINVAL),
> > > > KVM_ISA_EXT_ARR(SVNAPOT),
> > > > KVM_ISA_EXT_ARR(SVPBMT),
> > > > + KVM_ISA_EXT_ARR(SVUKTE),
> > > > KVM_ISA_EXT_ARR(ZACAS),
> > > > KVM_ISA_EXT_ARR(ZAWRS),
> > > > KVM_ISA_EXT_ARR(ZBA),
> > >
> > > The KVM_RISCV_ISA_EXT_SVUKTE should be added to the
> > > switch-case in kvm_riscv_vcpu_isa_disable_allowed() because
> > > hypervisor seems to have no way to disable Svukte for the Guest
> > > when it's available on the Host.
> > >
> > > Regards,
> > > Anup
> >
prev parent reply other threads:[~2024-11-20 13:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-27 13:41 [PATCH RFC v2 0/3] riscv: add Svukte extension Max Hsu
2024-09-27 13:41 ` [PATCH RFC v2 1/3] dt-bindings: riscv: Add Svukte entry Max Hsu
2024-09-30 17:04 ` Deepak Gupta
2024-09-27 13:41 ` [PATCH RFC v2 2/3] riscv: Add Svukte extension support Max Hsu
2024-09-30 17:10 ` Deepak Gupta
2024-09-27 13:41 ` [PATCH RFC v2 3/3] riscv: KVM: Add Svukte extension support for Guest/VM Max Hsu
2024-10-24 19:16 ` Anup Patel
2024-11-04 7:44 ` Max Hsu
2024-11-04 13:19 ` Anup Patel
2024-11-20 13:52 ` Max Hsu [this message]
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='CAHibDyxWBHeKOx=sT63EmEwhwyAYMQ3TE2tkOSK8V45PhjztPA@mail.gmail.com' \
--to=max.hsu@sifive.com \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=apatel@ventanamicro.com \
--cc=atishp@atishpatra.org \
--cc=conor@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kvm-riscv@lists.infradead.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=palmer@sifive.com \
--cc=paul.walmsley@sifive.com \
--cc=robh@kernel.org \
--cc=samuel.holland@sifive.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).