Re: [PATCH 1/4] KVM: delete .change_pte MMU notifier callback

2024-04-06 Thread Anup Patel
generic KVM code that dispatches to kvm_set_spte_gfn(), as > well as all the architecture specific implementations. > > Signed-off-by: Paolo Bonzini For KVM RISC-V: Acked-by: Anup Patel Regards, Anup > --- > arch/arm64/kvm/mmu.c | 34 - >

Re: [PATCH] tty: hvc: Don't enable the RISC-V SBI console by default

2024-02-14 Thread Anup Patel
; Signed-off-by: Palmer Dabbelt LTGM. Reviewed-by: Anup Patel Regards, Anup > --- > drivers/tty/hvc/Kconfig | 8 +--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/tty/hvc/Kconfig b/drivers/tty/hvc/Kconfig > index 6e05c5c7bca1..c2a4e88b328f 100

Re: [PATCH v5 0/5] RISC-V SBI debug console extension support

2024-01-19 Thread Anup Patel
On Sat, Jan 20, 2024 at 3:29 AM Palmer Dabbelt wrote: > > On Fri, 19 Jan 2024 02:09:18 PST (-0800), apa...@ventanamicro.com wrote: > > On Sat, Jan 13, 2024 at 12:00 AM Palmer Dabbelt wrote: > >> > >> On Thu, 11 Jan 2024 06:50:37 PST (-0800), > >> patchwork-bot+linux-ri...@kernel.org wrote: > >>

Re: [PATCH v2] tty: hvc: Fix the RISC-V SBI driver for a refactoring

2024-01-19 Thread Anup Patel
nt32_t vtermno, const u8 *buf, size_t > count) > { > return sbi_debug_console_write(buf, count); > } > > -static int hvc_sbi_dbcn_tty_get(uint32_t vtermno, char *buf, int count) > +static ssize_t hvc_sbi_dbcn_tty_get(uint32_t vtermno, u8 *buf, size_t count) > { > return sbi_debug_console_read(buf, count); > } > -- > 2.43.0 > > Reviewed-by: Anup Patel Thanks, Anup

[PATCH v6 5/5] RISC-V: Enable SBI based earlycon support

2024-01-19 Thread Anup Patel
Let us enable SBI based earlycon support in defconfig for both RV32 and RV64 so that "earlycon=sbi" can be used again. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- arch/riscv/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/configs/defcon

[PATCH v6 4/5] tty: Add SBI debug console support to HVC SBI driver

2024-01-19 Thread Anup Patel
From: Atish Patra RISC-V SBI specification supports advanced debug console support via SBI DBCN extension. Extend the HVC SBI driver to support it. Signed-off-by: Atish Patra Signed-off-by: Anup Patel Reviewed-by: Andrew Jones Acked-by: Greg Kroah-Hartman --- drivers/tty/hvc/Kconfig

[PATCH v6 3/5] tty/serial: Add RISC-V SBI debug console based earlycon

2024-01-19 Thread Anup Patel
We extend the existing RISC-V SBI earlycon support to use the new RISC-V SBI debug console extension. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones Acked-by: Greg Kroah-Hartman --- drivers/tty/serial/Kconfig | 2 +- drivers/tty/serial/earlycon-riscv-sbi.c | 27

[PATCH v6 2/5] RISC-V: Add SBI debug console helper routines

2024-01-19 Thread Anup Patel
Let us provide SBI debug console helper routines which can be shared by serial/earlycon-riscv-sbi.c and hvc/hvc_riscv_sbi.c. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- arch/riscv/include/asm/sbi.h | 5 +++ arch/riscv/kernel/sbi.c | 66 2

[PATCH v6 1/5] RISC-V: Add stubs for sbi_console_putchar/getchar()

2024-01-19 Thread Anup Patel
The functions sbi_console_putchar() and sbi_console_getchar() are not defined when CONFIG_RISCV_SBI_V01 is disabled so let us add stub of these functions to avoid "#ifdef" on user side. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- arch/riscv/include/asm/sbi.h | 5 +++

[PATCH v6 0/5] RISC-V SBI debug console extension support

2024-01-19 Thread Anup Patel
icitly opt-in for emulating SBI DBCN. - Introduced new PATCH5 in this series which adds inline version of sbi_console_getchar() and sbi_console_putchar() for the case where CONFIG_RISCV_SBI_V01 is disabled. Anup Patel (4): RISC-V: Add stubs for sbi_console_putchar/getchar() RISC-V: Add SBI deb

Re: [PATCH v5 0/5] RISC-V SBI debug console extension support

2024-01-19 Thread Anup Patel
On Sat, Jan 13, 2024 at 12:00 AM Palmer Dabbelt wrote: > > On Thu, 11 Jan 2024 06:50:37 PST (-0800), > patchwork-bot+linux-ri...@kernel.org wrote: > > Hello: > > > > This series was applied to riscv/linux.git (for-next) > > by Palmer Dabbelt : > > > > On Fri, 24 Nov 2023 12:39:00 +0530 you

Re: [PATCH -fixes v2] RISC-V: KVM: Require HAVE_KVM

2024-01-18 Thread Anup Patel
On Thu, Jan 18, 2024 at 11:10 PM Sean Christopherson wrote: > > On Thu, Jan 18, 2024, Anup Patel wrote: > > On Thu, Jan 4, 2024 at 6:07 PM Andrew Jones wrote: > > > > > > KVM requires EVENTFD, which is selected by HAVE_KVM. Other KVM > > > s

Re: [PATCH -fixes v2] RISC-V: KVM: Require HAVE_KVM

2024-01-18 Thread Anup Patel
On Thu, Jan 4, 2024 at 6:07 PM Andrew Jones wrote: > > KVM requires EVENTFD, which is selected by HAVE_KVM. Other KVM > supporting architectures select HAVE_KVM and then their KVM > Kconfigs ensure its there with a depends on HAVE_KVM. Make RISCV > consistent with that approach which fixes

Re: Re: [PATCH] RISC-V: KVM: Require HAVE_KVM

2024-01-04 Thread Anup Patel
On Thu, Jan 4, 2024 at 4:51 PM Andrew Jones wrote: > > On Thu, Jan 04, 2024 at 12:07:51PM +0100, Alexandre Ghiti wrote: > > On 04/01/2024 11:52, Andrew Jones wrote: > > > This applies to linux-next, but I forgot to append -next to the PATCH > > > prefix. > > > > > > Shoudn't this go to -fixes

Re: [PATCH 26/26] KVM: Hide KVM internal data structures and values from kernel at-large

2023-12-13 Thread Anup Patel
as needed, and > opportunistically include kvm_host.h in trace/events.kvm.h instead of > relying on the parent to provide the right includes. > > Cc: Anish Ghulati > Cc: Venkatesh Srinivas > Cc: Andrew Thornton > Signed-off-by: Sean Christopherson For KVM RISC-V: Anup Pa

Re: [PATCH 22/26] entry/kvm: KVM: Move KVM details related to signal/-EINTR into KVM proper

2023-12-13 Thread Anup Patel
iously better than having KVM > react to -EINTR (though it's not obviously worse either). > > Signed-off-by: Sean Christopherson For KVM RISC-V: Anup Patel Regards, Anup > --- > arch/arm64/kvm/arm.c | 3 +-- > arch/riscv/kvm/vcpu.c | 2 +- > arch/x86/kvm/vmx/vmx.c

Re: [PATCH 19/26] KVM: Standardize include paths across all architectures

2023-12-13 Thread Anup Patel
th s390 > and PPC switched to the overwrite behavior without so much as a passing > mention when EXTRA_CFLAGS was replaced with ccflags-y (commit c73028a02887 > ("s390: change to new flag variable") and commit 4108d9ba9091 > ("powerpc/Makefiles: Change to new flag variab

Re: [PATCH 15/26] KVM: Move include/kvm/iodev.h to include/linux as kvm_iodev.h

2023-12-13 Thread Anup Patel
On Sat, Sep 16, 2023 at 6:01 AM Sean Christopherson wrote: > > Move iodev.h, the last remaining holdout in include/kvm, to the standard > include/linux directory as kvm_iodev.h and delete include/kvm. > > Signed-off-by: Sean Christopherson For KVM RISC-V: Acked-by: Anup Patel

[PATCH v5 5/5] RISC-V: Enable SBI based earlycon support

2023-11-23 Thread Anup Patel
Let us enable SBI based earlycon support in defconfig for both RV32 and RV64 so that "earlycon=sbi" can be used again. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- arch/riscv/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/configs/defcon

[PATCH v5 4/5] tty: Add SBI debug console support to HVC SBI driver

2023-11-23 Thread Anup Patel
From: Atish Patra RISC-V SBI specification supports advanced debug console support via SBI DBCN extension. Extend the HVC SBI driver to support it. Signed-off-by: Atish Patra Signed-off-by: Anup Patel --- drivers/tty/hvc/Kconfig | 2 +- drivers/tty/hvc/hvc_riscv_sbi.c | 37

[PATCH v5 3/5] tty/serial: Add RISC-V SBI debug console based earlycon

2023-11-23 Thread Anup Patel
We extend the existing RISC-V SBI earlycon support to use the new RISC-V SBI debug console extension. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- drivers/tty/serial/Kconfig | 2 +- drivers/tty/serial/earlycon-riscv-sbi.c | 27 ++--- 2 files changed

[PATCH v5 2/5] RISC-V: Add SBI debug console helper routines

2023-11-23 Thread Anup Patel
Let us provide SBI debug console helper routines which can be shared by serial/earlycon-riscv-sbi.c and hvc/hvc_riscv_sbi.c. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- arch/riscv/include/asm/sbi.h | 5 +++ arch/riscv/kernel/sbi.c | 66 2

[PATCH v5 1/5] RISC-V: Add stubs for sbi_console_putchar/getchar()

2023-11-23 Thread Anup Patel
The functions sbi_console_putchar() and sbi_console_getchar() are not defined when CONFIG_RISCV_SBI_V01 is disabled so let us add stub of these functions to avoid "#ifdef" on user side. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- arch/riscv/include/asm/sbi.h | 5 +++

[PATCH v5 0/5] RISC-V SBI debug console extension support

2023-11-23 Thread Anup Patel
that older KVM user space work fine and newer KVM user space have to explicitly opt-in for emulating SBI DBCN. - Introduced new PATCH5 in this series which adds inline version of sbi_console_getchar() and sbi_console_putchar() for the case where CONFIG_RISCV_SBI_V01 is disabled. Anup

Re: [PATCH v4 2/5] RISC-V: Add SBI debug console helper routines

2023-11-23 Thread Anup Patel
On Mon, Nov 20, 2023 at 1:35 PM Andrew Jones wrote: > > On Sat, Nov 18, 2023 at 09:08:56AM +0530, Anup Patel wrote: > > Let us provide SBI debug console helper routines which can be > > shared by serial/earlycon-riscv-sbi.c and hvc/hvc_riscv_sbi.c. > > >

Re: [PATCH v4 2/5] RISC-V: Add SBI debug console helper routines

2023-11-23 Thread Anup Patel
On Wed, Nov 22, 2023 at 4:15 AM Samuel Holland wrote: > > Hi Anup, > > On 2023-11-17 9:38 PM, Anup Patel wrote: > > Let us provide SBI debug console helper routines which can be > > shared by serial/earlycon-riscv-sbi.c and hvc/hvc_riscv_sbi.c. > > > > Signed-o

Re: [PATCH v4 3/5] tty/serial: Add RISC-V SBI debug console based earlycon

2023-11-23 Thread Anup Patel
On Wed, Nov 22, 2023 at 4:11 AM Samuel Holland wrote: > > Hi Anup, > > On 2023-11-17 9:38 PM, Anup Patel wrote: > > We extend the existing RISC-V SBI earlycon support to use the new > > RISC-V SBI debug console extension. > > > > Signed-off-by: Anup

Re: [PATCH v4 5/5] RISC-V: Enable SBI based earlycon support

2023-11-23 Thread Anup Patel
On Wed, Nov 22, 2023 at 4:18 AM Samuel Holland wrote: > > Hi Anup, > > On 2023-11-17 9:38 PM, Anup Patel wrote: > > Let us enable SBI based earlycon support in defconfigs for both RV32 > > and RV64 so that "earlycon=sbi" can be used again. > > >

Re: [PATCH v4 1/5] RISC-V: Add stubs for sbi_console_putchar/getchar()

2023-11-23 Thread Anup Patel
On Wed, Nov 22, 2023 at 4:06 AM Samuel Holland wrote: > > Hi Anup, > > On 2023-11-17 9:38 PM, Anup Patel wrote: > > The functions sbi_console_putchar() and sbi_console_getchar() are > > not defined when CONFIG_RISCV_SBI_V01 is disabled so let us add > > stub of th

[PATCH v4 5/5] RISC-V: Enable SBI based earlycon support

2023-11-17 Thread Anup Patel
Let us enable SBI based earlycon support in defconfigs for both RV32 and RV64 so that "earlycon=sbi" can be used again. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- arch/riscv/configs/defconfig | 1 + arch/riscv/configs/rv32_defconfig | 1 + 2 files changed, 2

[PATCH v4 4/5] tty: Add SBI debug console support to HVC SBI driver

2023-11-17 Thread Anup Patel
From: Atish Patra RISC-V SBI specification supports advanced debug console support via SBI DBCN extension. Extend the HVC SBI driver to support it. Signed-off-by: Atish Patra Signed-off-by: Anup Patel --- drivers/tty/hvc/Kconfig | 2 +- drivers/tty/hvc/hvc_riscv_sbi.c | 59

[PATCH v4 3/5] tty/serial: Add RISC-V SBI debug console based earlycon

2023-11-17 Thread Anup Patel
We extend the existing RISC-V SBI earlycon support to use the new RISC-V SBI debug console extension. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- drivers/tty/serial/Kconfig | 2 +- drivers/tty/serial/earlycon-riscv-sbi.c | 24 2 files changed

[PATCH v4 2/5] RISC-V: Add SBI debug console helper routines

2023-11-17 Thread Anup Patel
Let us provide SBI debug console helper routines which can be shared by serial/earlycon-riscv-sbi.c and hvc/hvc_riscv_sbi.c. Signed-off-by: Anup Patel --- arch/riscv/include/asm/sbi.h | 5 + arch/riscv/kernel/sbi.c | 43 2 files changed, 48

[PATCH v4 1/5] RISC-V: Add stubs for sbi_console_putchar/getchar()

2023-11-17 Thread Anup Patel
The functions sbi_console_putchar() and sbi_console_getchar() are not defined when CONFIG_RISCV_SBI_V01 is disabled so let us add stub of these functions to avoid "#ifdef" on user side. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- arch/riscv/include/asm/sbi.h | 5 +++

[PATCH v4 0/5] RISC-V SBI debug console extension support

2023-11-17 Thread Anup Patel
to explicitly opt-in for emulating SBI DBCN. - Introduced new PATCH5 in this series which adds inline version of sbi_console_getchar() and sbi_console_putchar() for the case where CONFIG_RISCV_SBI_V01 is disabled. Anup Patel (4): RISC-V: Add stubs for sbi_console_putchar/getchar() RISC-V: Add

Re: [PATCH v3 8/9] tty: Add SBI debug console support to HVC SBI driver

2023-11-17 Thread Anup Patel
On Sat, Oct 21, 2023 at 10:16 PM Greg Kroah-Hartman wrote: > > On Fri, Oct 20, 2023 at 12:51:39PM +0530, Anup Patel wrote: > > From: Atish Patra > > > > RISC-V SBI specification supports advanced debug console > > support via SBI DBCN extension. > > >

Re: [PATCH v3 7/9] tty/serial: Add RISC-V SBI debug console based earlycon

2023-11-17 Thread Anup Patel
On Sat, Oct 21, 2023 at 10:16 PM Greg Kroah-Hartman wrote: > > On Fri, Oct 20, 2023 at 12:51:38PM +0530, Anup Patel wrote: > > We extend the existing RISC-V SBI earlycon support to use the new > > RISC-V SBI debug console extension. > > > > Signed-off-by: Anup Patel

Re: [PATCH v3 6/9] RISC-V: Add stubs for sbi_console_putchar/getchar()

2023-11-17 Thread Anup Patel
On Sat, Oct 21, 2023 at 10:05 PM Greg Kroah-Hartman wrote: > > On Fri, Oct 20, 2023 at 12:51:37PM +0530, Anup Patel wrote: > > The functions sbi_console_putchar() and sbi_console_getchar() are > > not defined when CONFIG_RISCV_SBI_V01 is disabled so let us add > > stub of

Re: [PATCH v3 8/9] tty: Add SBI debug console support to HVC SBI driver

2023-10-20 Thread Anup Patel
On Fri, Oct 20, 2023 at 4:16 PM Andrew Jones wrote: > > On Fri, Oct 20, 2023 at 12:51:39PM +0530, Anup Patel wrote: > > From: Atish Patra > > > > RISC-V SBI specification supports advanced debug console > > support via SBI DBCN extension. > > >

Re: [PATCH v3 0/9] RISC-V SBI debug console extension support

2023-10-20 Thread Anup Patel
On Fri, Oct 20, 2023 at 12:51 PM Anup Patel wrote: > > The SBI v2.0 specification is now frozen. The SBI v2.0 specification defines > SBI debug console (DBCN) extension which replaces the legacy SBI v0.1 > functions sbi_console_putchar() and sbi_console_getchar(). > (Refer v2

Re: [PATCH v3 8/9] tty: Add SBI debug console support to HVC SBI driver

2023-10-20 Thread Anup Patel
On Fri, Oct 20, 2023 at 3:25 PM Björn Töpel wrote: > > Anup Patel writes: > > > From: Atish Patra > > > > RISC-V SBI specification supports advanced debug console > > support via SBI DBCN extension. > > > > Extend the HVC SBI driver to support it. &

[PATCH v3 9/9] RISC-V: Enable SBI based earlycon support

2023-10-20 Thread Anup Patel
Let us enable SBI based earlycon support in defconfigs for both RV32 and RV64 so that "earlycon=sbi" can be used again. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- arch/riscv/configs/defconfig | 1 + arch/riscv/configs/rv32_defconfig | 1 + 2 files changed, 2

[PATCH v3 8/9] tty: Add SBI debug console support to HVC SBI driver

2023-10-20 Thread Anup Patel
From: Atish Patra RISC-V SBI specification supports advanced debug console support via SBI DBCN extension. Extend the HVC SBI driver to support it. Signed-off-by: Atish Patra Signed-off-by: Anup Patel --- drivers/tty/hvc/Kconfig | 2 +- drivers/tty/hvc/hvc_riscv_sbi.c | 82

[PATCH v3 7/9] tty/serial: Add RISC-V SBI debug console based earlycon

2023-10-20 Thread Anup Patel
We extend the existing RISC-V SBI earlycon support to use the new RISC-V SBI debug console extension. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- drivers/tty/serial/Kconfig | 2 +- drivers/tty/serial/earlycon-riscv-sbi.c | 32 + 2 files changed

[PATCH v3 6/9] RISC-V: Add stubs for sbi_console_putchar/getchar()

2023-10-20 Thread Anup Patel
The functions sbi_console_putchar() and sbi_console_getchar() are not defined when CONFIG_RISCV_SBI_V01 is disabled so let us add stub of these functions to avoid "#ifdef" on user side. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- arch/riscv/include/asm/sbi.h | 5 +++

[PATCH v3 5/9] KVM: riscv: selftests: Add SBI DBCN extension to get-reg-list test

2023-10-20 Thread Anup Patel
We have a new SBI debug console (DBCN) extension supported by in-kernel KVM so let us add this extension to get-reg-list test. Signed-off-by: Anup Patel --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/kvm/riscv

[PATCH v3 4/9] RISC-V: KVM: Forward SBI DBCN extension to user-space

2023-10-20 Thread Anup Patel
devices such as 8250, VirtIO console, etc. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- arch/riscv/include/asm/kvm_vcpu_sbi.h | 1 + arch/riscv/include/uapi/asm/kvm.h | 1 + arch/riscv/kvm/vcpu_sbi.c | 4 arch/riscv/kvm/vcpu_sbi_replace.c | 32

[PATCH v3 3/9] RISC-V: KVM: Allow some SBI extensions to be disabled by default

2023-10-20 Thread Anup Patel
to the KVM user-space must be disabled by default. To address above, we allow certain SBI extensions to be disabled by default so that KVM user-space must explicitly enable such SBI extensions to receive forwarded calls from Guest VCPU. Signed-off-by: Anup Patel --- arch/riscv/include/asm

[PATCH v3 2/9] RISC-V: KVM: Change the SBI specification version to v2.0

2023-10-20 Thread Anup Patel
We will be implementing SBI DBCN extension for KVM RISC-V so let us change the KVM RISC-V SBI specification version to v2.0. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- arch/riscv/include/asm/kvm_vcpu_sbi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch

[PATCH v3 1/9] RISC-V: Add defines for SBI debug console extension

2023-10-20 Thread Anup Patel
We add SBI debug console extension related defines/enum to the asm/sbi.h header. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- arch/riscv/include/asm/sbi.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h index

[PATCH v3 0/9] RISC-V SBI debug console extension support

2023-10-20 Thread Anup Patel
DBCN. - Introduced new PATCH5 in this series which adds inline version of sbi_console_getchar() and sbi_console_putchar() for the case where CONFIG_RISCV_SBI_V01 is disabled. Anup Patel (8): RISC-V: Add defines for SBI debug console extension RISC-V: KVM: Change the SBI specification

Re: [PATCH v2 3/8] RISC-V: KVM: Allow some SBI extensions to be disabled by default

2023-10-19 Thread Anup Patel
On Thu, Oct 19, 2023 at 1:27 PM Andrew Jones wrote: > > On Thu, Oct 12, 2023 at 10:45:04AM +0530, Anup Patel wrote: > > Currently, all SBI extensions are enabled by default which is > > problematic for SBI extensions (such as DBCN) which are forwarded > > to the KVM use

Re: [PATCH v2 7/8] tty: Add SBI debug console support to HVC SBI driver

2023-10-13 Thread Anup Patel
On Thu, Oct 12, 2023 at 5:08 PM Björn Töpel wrote: > > Anup Patel writes: > > > From: Atish Patra > > > > RISC-V SBI specification supports advanced debug console > > support via SBI DBCN extension. > > > > Extend the HVC SBI driver to support it. &

[PATCH v2 8/8] RISC-V: Enable SBI based earlycon support

2023-10-11 Thread Anup Patel
Let us enable SBI based earlycon support in defconfigs for both RV32 and RV64 so that "earlycon=sbi" can be used again. Signed-off-by: Anup Patel --- arch/riscv/configs/defconfig | 1 + arch/riscv/configs/rv32_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/

[PATCH v2 7/8] tty: Add SBI debug console support to HVC SBI driver

2023-10-11 Thread Anup Patel
From: Atish Patra RISC-V SBI specification supports advanced debug console support via SBI DBCN extension. Extend the HVC SBI driver to support it. Signed-off-by: Atish Patra Signed-off-by: Anup Patel --- drivers/tty/hvc/Kconfig | 2 +- drivers/tty/hvc/hvc_riscv_sbi.c | 76

[PATCH v2 6/8] tty/serial: Add RISC-V SBI debug console based earlycon

2023-10-11 Thread Anup Patel
We extend the existing RISC-V SBI earlycon support to use the new RISC-V SBI debug console extension. Signed-off-by: Anup Patel --- drivers/tty/serial/Kconfig | 2 +- drivers/tty/serial/earlycon-riscv-sbi.c | 32 + 2 files changed, 29 insertions(+), 5

[PATCH v2 5/8] RISC-V: Add inline version of sbi_console_putchar/getchar() functions

2023-10-11 Thread Anup Patel
The functions sbi_console_putchar() and sbi_console_getchar() are not defined when CONFIG_RISCV_SBI_V01 is disabled so let us add inline version of these functions to avoid "#ifdef" on user side. Signed-off-by: Anup Patel --- arch/riscv/include/asm/sbi.h | 5 + 1 file changed, 5

[PATCH v2 4/8] RISC-V: KVM: Forward SBI DBCN extension to user-space

2023-10-11 Thread Anup Patel
devices such as 8250, VirtIO console, etc. Signed-off-by: Anup Patel --- arch/riscv/include/asm/kvm_vcpu_sbi.h | 1 + arch/riscv/include/uapi/asm/kvm.h | 1 + arch/riscv/kvm/vcpu_sbi.c | 4 arch/riscv/kvm/vcpu_sbi_replace.c | 32 +++ 4 files

[PATCH v2 3/8] RISC-V: KVM: Allow some SBI extensions to be disabled by default

2023-10-11 Thread Anup Patel
to the KVM user-space must be disabled by default. To address above, we allow certain SBI extensions to be disabled by default so that KVM user-space must explicitly enable such SBI extensions to receive forwarded calls from Guest VCPU. Signed-off-by: Anup Patel --- arch/riscv/include/asm

[PATCH v2 2/8] RISC-V: KVM: Change the SBI specification version to v2.0

2023-10-11 Thread Anup Patel
We will be implementing SBI DBCN extension for KVM RISC-V so let us change the KVM RISC-V SBI specification version to v2.0. Signed-off-by: Anup Patel --- arch/riscv/include/asm/kvm_vcpu_sbi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/include/asm

[PATCH v2 1/8] RISC-V: Add defines for SBI debug console extension

2023-10-11 Thread Anup Patel
We add SBI debug console extension related defines/enum to the asm/sbi.h header. Signed-off-by: Anup Patel --- arch/riscv/include/asm/sbi.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h index 5b4a1bf5f439..12dfda6bb924

[PATCH v2 0/8] RISC-V SBI debug console extension support

2023-10-11 Thread Anup Patel
work fine and newer KVM user space have to explicitly opt-in for emulating SBI DBCN. - Introduced new PATCH5 in this series which adds inline version of sbi_console_getchar() and sbi_console_putchar() for the case where CONFIG_RISCV_SBI_V01 is disabled. Anup Patel (7): RISC-V: Add defines

Re: [PATCH 2/6] RISC-V: KVM: Change the SBI specification version to v2.0

2023-10-11 Thread Anup Patel
On Wed, Oct 11, 2023 at 8:56 PM Greg Kroah-Hartman wrote: > > On Wed, Oct 11, 2023 at 04:32:22PM +0530, Anup Patel wrote: > > On Wed, Oct 11, 2023 at 12:57 PM Greg Kroah-Hartman > > wrote: > > > > > > On Wed, Oct 11, 2023 at 11:49:14AM +0530, Anup Patel wrote

Re: [PATCH 2/6] RISC-V: KVM: Change the SBI specification version to v2.0

2023-10-11 Thread Anup Patel
On Wed, Oct 11, 2023 at 12:57 PM Greg Kroah-Hartman wrote: > > On Wed, Oct 11, 2023 at 11:49:14AM +0530, Anup Patel wrote: > > On Tue, Oct 10, 2023 at 10:43 PM Greg Kroah-Hartman > > wrote: > > > > > > On Tue, Oct 10, 2023 at 10:34:59PM +0530, Anup Patel wr

Re: [PATCH 3/6] RISC-V: KVM: Forward SBI DBCN extension to user-space

2023-10-11 Thread Anup Patel
On Wed, Oct 11, 2023 at 12:56 PM Greg Kroah-Hartman wrote: > > On Wed, Oct 11, 2023 at 12:02:30PM +0530, Anup Patel wrote: > > On Tue, Oct 10, 2023 at 10:45 PM Greg Kroah-Hartman > > wrote: > > > > > > On Tue, Oct 10, 2023 at 10:35:00PM +0530, Anup Patel w

Re: [PATCH 3/6] RISC-V: KVM: Forward SBI DBCN extension to user-space

2023-10-11 Thread Anup Patel
On Tue, Oct 10, 2023 at 10:45 PM Greg Kroah-Hartman wrote: > > On Tue, Oct 10, 2023 at 10:35:00PM +0530, Anup Patel wrote: > > The SBI DBCN extension needs to be emulated in user-space > > Why? The SBI debug console is similar to a console port available to KVM Guest so the K

Re: [PATCH 2/6] RISC-V: KVM: Change the SBI specification version to v2.0

2023-10-11 Thread Anup Patel
On Tue, Oct 10, 2023 at 10:43 PM Greg Kroah-Hartman wrote: > > On Tue, Oct 10, 2023 at 10:34:59PM +0530, Anup Patel wrote: > > We will be implementing SBI DBCN extension for KVM RISC-V so let > > us change the KVM RISC-V SBI specification version to v2.0. > > >

Re: [PATCH 4/6] tty/serial: Add RISC-V SBI debug console based earlycon

2023-10-10 Thread Anup Patel
On Tue, Oct 10, 2023 at 10:46 PM Greg Kroah-Hartman wrote: > > On Tue, Oct 10, 2023 at 10:35:01PM +0530, Anup Patel wrote: > > We extend the existing RISC-V SBI earlycon support to use the new > > RISC-V SBI debug console extension. > > > > Signed-off-by: Anup P

Re: [PATCH 5/6] tty: Add SBI debug console support to HVC SBI driver

2023-10-10 Thread Anup Patel
On Tue, Oct 10, 2023 at 10:42 PM Greg Kroah-Hartman wrote: > > On Tue, Oct 10, 2023 at 10:35:02PM +0530, Anup Patel wrote: > > --- a/drivers/tty/hvc/hvc_riscv_sbi.c > > +++ b/drivers/tty/hvc/hvc_riscv_sbi.c > > @@ -15,6 +15,7 @@ > > > > #inc

[PATCH 6/6] RISC-V: Enable SBI based earlycon support

2023-10-10 Thread Anup Patel
Let us enable SBI based earlycon support in defconfigs for both RV32 and RV64 so that "earlycon=sbi" can be used again. Signed-off-by: Anup Patel --- arch/riscv/configs/defconfig | 1 + arch/riscv/configs/rv32_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/

[PATCH 5/6] tty: Add SBI debug console support to HVC SBI driver

2023-10-10 Thread Anup Patel
From: Atish Patra RISC-V SBI specification supports advanced debug console support via SBI DBCN extension. Extend the HVC SBI driver to support it. Signed-off-by: Atish Patra Signed-off-by: Anup Patel --- drivers/tty/hvc/Kconfig | 2 +- drivers/tty/hvc/hvc_riscv_sbi.c | 80

[PATCH 4/6] tty/serial: Add RISC-V SBI debug console based earlycon

2023-10-10 Thread Anup Patel
We extend the existing RISC-V SBI earlycon support to use the new RISC-V SBI debug console extension. Signed-off-by: Anup Patel --- drivers/tty/serial/Kconfig | 2 +- drivers/tty/serial/earlycon-riscv-sbi.c | 35 ++--- 2 files changed, 32 insertions(+), 5

[PATCH 3/6] RISC-V: KVM: Forward SBI DBCN extension to user-space

2023-10-10 Thread Anup Patel
The SBI DBCN extension needs to be emulated in user-space so let us forward console_puts() call to user-space. Signed-off-by: Anup Patel --- arch/riscv/include/asm/kvm_vcpu_sbi.h | 1 + arch/riscv/include/uapi/asm/kvm.h | 1 + arch/riscv/kvm/vcpu_sbi.c | 4 arch/riscv

[PATCH 2/6] RISC-V: KVM: Change the SBI specification version to v2.0

2023-10-10 Thread Anup Patel
We will be implementing SBI DBCN extension for KVM RISC-V so let us change the KVM RISC-V SBI specification version to v2.0. Signed-off-by: Anup Patel --- arch/riscv/include/asm/kvm_vcpu_sbi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/include/asm

[PATCH 1/6] RISC-V: Add defines for SBI debug console extension

2023-10-10 Thread Anup Patel
We add SBI debug console extension related defines/enum to the asm/sbi.h header. Signed-off-by: Anup Patel --- arch/riscv/include/asm/sbi.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h index 5b4a1bf5f439..12dfda6bb924

[PATCH 0/6] RISC-V SBI debug console extension support

2023-10-10 Thread Anup Patel
://github.com/avpatel/linux.git Anup Patel (5): RISC-V: Add defines for SBI debug console extension RISC-V: KVM: Change the SBI specification version to v2.0 RISC-V: KVM: Forward SBI DBCN extension to user-space tty/serial: Add RISC-V SBI debug console based earlycon RISC-V: Enable SBI based

Re: [RFC PATCH v12 05/33] KVM: Convert KVM_ARCH_WANT_MMU_NOTIFIER to CONFIG_KVM_GENERIC_MMU_NOTIFIER

2023-10-09 Thread Anup Patel
kvm_gfn_range *range); > > Alternatively, PPC could forward declare kvm_gfn_range, but there's no > good reason not to define it in common KVM. > > Signed-off-by: Sean Christopherson Looks good to me. For KVM RISC-V: Acked-by: Anup Patel Thanks, Anup > --- > arc

Re: [PATCH v2 1/4] KVM: Refactor stats descriptor generation macros

2023-04-05 Thread Anup Patel
evious short-hands > which were less clear ("COUNTER", "ICOUNTER", and "PCOUNTER"). > > No functional change intended. > > Suggested-by: Sean Christopherson > Signed-off-by: David Matlack For KVM RISC-V: Acked-by: Anup Patel Regards, Anup > ---

Re: [PATCH 16/19] cpuidle: Adjust includes to remove of_device.h

2023-03-29 Thread Anup Patel
hotplug.h, of.h, and of_platform.h) and drop including of_device.h. > > Signed-off-by: Rob Herring For cpuidle-riscv-sbi.c Acked-by: Anup Patel Regards, Anup > --- > Please ack and I will take the series via the DT tree. > --- > drivers/cpuidle/cpuidle-psci.c | 1 - >

Re: [PATCH 44/44] KVM: Opt out of generic hardware enabling on s390 and PPC

2022-11-06 Thread Anup Patel
by: Sean Christopherson For KVM RISC-V: Acked-by: Anup Patel Thanks, Anup > --- > arch/arm64/kvm/Kconfig | 1 + > arch/mips/kvm/Kconfig | 1 + > arch/powerpc/include/asm/kvm_host.h | 1 - > arch/powerpc/kvm/powerpc.c | 5 - > arch

Re: [PATCH 30/44] KVM: Drop kvm_arch_check_processor_compat() hook

2022-11-06 Thread Anup Patel
On Thu, Nov 3, 2022 at 4:50 AM Sean Christopherson wrote: > > Drop kvm_arch_check_processor_compat() and its support code now that all > architecture implementations are nops. > > Signed-off-by: Sean Christopherson For KVM RISC-V: Acked-by: Anup Patel Thanks, Anup > ---

Re: [PATCH 27/44] KVM: Drop kvm_arch_{init,exit}() hooks

2022-11-06 Thread Anup Patel
On Thu, Nov 3, 2022 at 4:50 AM Sean Christopherson wrote: > > Drop kvm_arch_init() and kvm_arch_exit() now that all implementations > are nops. > > No functional change intended. > > Signed-off-by: Sean Christopherson For KVM RISC-V: Acked-by: Anup Patel Thanks, Anup &g

Re: [PATCH 23/44] KVM: RISC-V: Tag init functions and data with __init, __ro_after_init

2022-11-06 Thread Anup Patel
On Thu, Nov 3, 2022 at 4:49 AM Sean Christopherson wrote: > > Now that KVM setup is handled directly in riscv_kvm_init(), tag functions > and data that are used/set only during init with __init/__ro_after_init. > > Signed-off-by: Sean Christopherson For KVM RISC-V: Acked-by: Anup

Re: [PATCH 22/44] KVM: RISC-V: Do arch init directly in riscv_kvm_init()

2022-11-06 Thread Anup Patel
> > No functional change intended. > > Signed-off-by: Sean Christopherson For KVM RISC-V: Acked-by: Anup Patel Regards, Anup > --- > arch/riscv/kvm/main.c | 18 +- > 1 file changed, 9 insertions(+), 9 deletions(-) > > diff --git a/arch/riscv/kvm/main.c b/arc

Re: [PATCH 09/44] KVM: Drop arch hardware (un)setup hooks

2022-11-06 Thread Anup Patel
On Thu, Nov 3, 2022 at 4:49 AM Sean Christopherson wrote: > > Drop kvm_arch_hardware_setup() and kvm_arch_hardware_unsetup() now that > all implementations are nops. > > No functional change intended. > > Signed-off-by: Sean Christopherson For KVM RISC-V: Acked-by: Anup

Re: [PATCH v2 05/44] cpuidle,riscv: Push RCU-idle into driver

2022-09-19 Thread Anup Patel
On Mon, Sep 19, 2022 at 3:47 PM Peter Zijlstra wrote: > > Doing RCU-idle outside the driver, only to then temporarily enable it > again, at least twice, before going idle is daft. > > Signed-off-by: Peter Zijlstra (Intel) Looks good to me. For RISC-V cpuidle: Reviewed-by: Anup

Re: [PATCH kernel] KVM: PPC: Make KVM_CAP_IRQFD_RESAMPLE platform dependent

2022-09-15 Thread Anup Patel
ative > XIVE mode does not handle INTx in KVM at all. > > This moved the capability support advertising to platforms and stops > advertising it on XIVE, i.e. POWER9 and later. > > Signed-off-by: Alexey Kardashevskiy > --- > > > Or I could move this one together with KVM_

Re: [PATCH v4 2/6] Partially revert "KVM: Pass kvm_init()'s opaque param to additional arch funcs"

2022-02-15 Thread Anup Patel
icts for ARM (due to file movement) and manually handle RISC-V > which comes after the commit. > > And changes about kvm_arch_hardware_setup() in original commit are still > needed so they are not reverted. > > Signed-off-by: Chao Gao > Reviewed-by: Sean Christopherson For KV

Re: [PATCH V5 21/21] KVM: compat: riscv: Prevent KVM_COMPAT from being selected

2022-02-01 Thread Anup Patel
On Tue, Feb 1, 2022 at 9:31 PM Paolo Bonzini wrote: > > On 2/1/22 16:44, Anup Patel wrote: > > +Paolo > > > > On Tue, Feb 1, 2022 at 8:38 PM wrote: > >> > >> From: Guo Ren > >> > >> Current riscv doesn't support the 32bit K

Re: [PATCH V5 21/21] KVM: compat: riscv: Prevent KVM_COMPAT from being selected

2022-02-01 Thread Anup Patel
+Paolo On Tue, Feb 1, 2022 at 8:38 PM wrote: > > From: Guo Ren > > Current riscv doesn't support the 32bit KVM API. Let's make it > clear by not selecting KVM_COMPAT. > > Signed-off-by: Guo Ren > Signed-off-by: Guo Ren > Cc: Arnd Bergmann > Cc: Anup Patel Th

Re: [PATCH v5 05/12] KVM: RISC-V: Use Makefile.kvm for common files

2021-11-23 Thread Anup Patel
On Sun, Nov 21, 2021 at 6:25 PM David Woodhouse wrote: > > From: David Woodhouse > > Signed-off-by: David Woodhouse Looks good to me. For KVM RISC-V, Acked-by: Anup Patel Reviewed-by: Anup Patel Thanks, Anup > --- > arch/riscv/kvm/Makefile | 6 +- > 1 file chang

Re: [PATCH v3 3/3] arch, scripts: Add script to check relocations at compile time

2020-05-29 Thread Anup Patel
et a list of all the relocations, remove from it the relocations > +# that are known to be legitimate and return this list to arch specific > +# script that will look for suspicious relocations. > + > +objdump="$1" > +nm="$2" > +vmlinux="$3" > + > +# Remove from the possible bad relocations those that match an undefined > +# weak symbol which will result in an absolute relocation to 0. > +# Weak unresolved symbols are of that form in nm output: > +# " w _binary__btf_vmlinux_bin_end" > +undef_weak_symbols=$($nm "$vmlinux" | awk '$1 ~ /w/ { print $2 }') > + > +$objdump -R "$vmlinux" | > + grep -E '\ + ([ "$undef_weak_symbols" ] && grep -F -w -v "$undef_weak_symbols" || > cat) > -- > 2.20.1 > Otherwise, looks good to me. Reviewed-by: Anup Patel Regards, Anup

Re: [PATCH v3 2/3] riscv: Introduce CONFIG_RELOCATABLE

2020-05-29 Thread Anup Patel
relocation offset > + * makes the kernel cross over a PGDIR_SIZE boundary, raise a bug > +* since a part of the kernel would not get mapped. > +* This cannot happen on rv32 as we use the entire page directory > level. > +*/ > + BUG_ON(PGDIR_SIZE - (kernel_virt_addr & (PGDIR_SIZE - 1)) < load_sz); > +#endif > + relocate_kernel(load_pa); > +#endif > /* > * Enforce boot alignment requirements of RV32 and > * RV64 by only allowing PMD or PGD mappings. > -- > 2.20.1 > > Looks good to me as well. Reviewed-by: Anup Patel Regards, Anup