[PATCH v3 3/3] KVM: riscv: selftests: Add vector extension tests

2025-04-30 Thread Atish Patra
Anup Patel Reviewed-by: Andrew Jones Signed-off-by: Atish Patra --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 132 +++ 1 file changed, 132 insertions(+) diff --git a/tools/testing/selftests/kvm/riscv/get-reg-list.c b/tools/testing/selftests/kvm/riscv/get-reg-list.c

[PATCH v3 0/3] RISC-V KVM selftests improvements

2025-04-30 Thread Atish Patra
This series improves the following tests. 1. Get-reg-list : Adds vector support 2. SBI PMU test : Distinguish between different types of illegal exception The first patch is just helper patch that adds stval support during exception handling. Signed-off-by: Atish Patra --- Changes in v3

[PATCH v3 1/3] KVM: riscv: selftests: Align the trap information wiht pt_regs

2025-04-30 Thread Atish Patra
The current exeception register structure in selftests are missing few registers (e.g stval). Instead of adding it manually, change the ex_regs to align with pt_regs to make it future proof. Suggested-by: Andrew Jones Reviewed-by: Andrew Jones Signed-off-by: Atish Patra --- .../selftests/kvm

[PATCH v3 2/3] KVM: riscv: selftests: Decode stval to identify exact exception type

2025-04-30 Thread Atish Patra
Reviewed-by: Andrew Jones Signed-off-by: Atish Patra --- .../testing/selftests/kvm/include/riscv/processor.h | 13 + tools/testing/selftests/kvm/riscv/sbi_pmu_test.c | 20 +++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm

Re: [PATCH v2 3/3] KVM: riscv: selftests: Add vector extension tests

2025-04-30 Thread Atish Patra
On 4/30/25 12:17 AM, Andrew Jones wrote: On Tue, Apr 29, 2025 at 05:18:47PM -0700, Atish Patra wrote: Add vector related tests with the ISA extension standard template. However, the vector registers are bit tricky as the register length is variable based on vlenb value of the system. That&#

Re: [PATCH v2 2/3] KVM: riscv: selftests: Decode stval to identify exact exception type

2025-04-30 Thread Atish Patra
On 4/30/25 12:09 AM, Andrew Jones wrote: On Tue, Apr 29, 2025 at 05:18:46PM -0700, Atish Patra wrote: Currently, the sbi_pmu_test continues if the exception type is illegal instruction because access to hpmcounter will generate that. However illegal instruction exception may occur due to the

Re: [PATCH v2 1/3] KVM: riscv: selftests: Align the trap information wiht pt_regs

2025-04-30 Thread Atish Patra
On 4/30/25 12:05 AM, Andrew Jones wrote: On Tue, Apr 29, 2025 at 05:18:45PM -0700, Atish Patra wrote: The current exeception register structure in selftests are missing few registers (e.g stval). Instead of adding it manually, change the ex_regs to align with pt_regs to make it future proof

[PATCH v2 1/3] KVM: riscv: selftests: Align the trap information wiht pt_regs

2025-04-29 Thread Atish Patra
The current exeception register structure in selftests are missing few registers (e.g stval). Instead of adding it manually, change the ex_regs to align with pt_regs to make it future proof. Suggested-by: Andrew Jones Signed-off-by: Atish Patra --- .../selftests/kvm/include/riscv/processor.h

[PATCH v2 0/3] RISC-V KVM selftests improvements

2025-04-29 Thread Atish Patra
This series improves the following tests. 1. Get-reg-list : Adds vector support 2. SBI PMU test : Distinguish between different types of illegal exception The first patch is just helper patch that adds stval support during exception handling. Signed-off-by: Atish Patra --- Changes in v2

[PATCH v2 3/3] KVM: riscv: selftests: Add vector extension tests

2025-04-29 Thread Atish Patra
Anup Patel Signed-off-by: Atish Patra --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 133 +++ 1 file changed, 133 insertions(+) diff --git a/tools/testing/selftests/kvm/riscv/get-reg-list.c b/tools/testing/selftests/kvm/riscv/get-reg-list.c index 569f2d67c9b8..814dd98

[PATCH v2 2/3] KVM: riscv: selftests: Decode stval to identify exact exception type

2025-04-29 Thread Atish Patra
instructions and which csrs are being accessed if it is csr access instructions. Assert in all cases except if it is a csr access instructions that access valid PMU related registers. Reviewed-by: Anup Patel Signed-off-by: Atish Patra --- .../testing/selftests/kvm/include/riscv/processor.h | 13

Re: [PATCH 3/3] KVM: riscv: selftests: Add vector extension tests

2025-04-28 Thread Atish Patra
On 4/25/25 7:20 AM, Andrew Jones wrote: On Mon, Mar 24, 2025 at 05:40:31PM -0700, Atish Patra wrote: Add vector related tests with the ISA extension standard template. However, the vector registers are bit tricky as the register length is variable based on vlenb value of the system. That&#

Re: [PATCH 2/3] KVM: riscv: selftests: Decode stval to identify exact exception type

2025-04-28 Thread Atish Patra
On 4/25/25 6:33 AM, Andrew Jones wrote: On Mon, Mar 24, 2025 at 05:40:30PM -0700, Atish Patra wrote: Currently, the sbi_pmu_test continues if the exception type is illegal instruction because access to hpmcounter will generate that. However, we may get illegal for other reasons as well which

Re: [PATCH 1/3] KVM: riscv: selftests: Add stval to exception handling

2025-04-28 Thread Atish Patra
On 4/25/25 6:50 AM, Andrew Jones wrote: On Mon, Mar 24, 2025 at 05:40:29PM -0700, Atish Patra wrote: Save stval during exception handling so that it can be decoded to figure out the details of exception type. Signed-off-by: Atish Patra --- tools/testing/selftests/kvm/include/riscv

[PATCH 3/3] KVM: riscv: selftests: Add vector extension tests

2025-03-24 Thread Atish Patra
Add vector related tests with the ISA extension standard template. However, the vector registers are bit tricky as the register length is variable based on vlenb value of the system. That's why the macros are defined with a default and overidden with actual value at runtime. Signed-off-by:

[PATCH 1/3] KVM: riscv: selftests: Add stval to exception handling

2025-03-24 Thread Atish Patra
Save stval during exception handling so that it can be decoded to figure out the details of exception type. Signed-off-by: Atish Patra --- tools/testing/selftests/kvm/include/riscv/processor.h | 1 + tools/testing/selftests/kvm/lib/riscv/handlers.S | 2 ++ 2 files changed, 3 insertions

[PATCH 2/3] KVM: riscv: selftests: Decode stval to identify exact exception type

2025-03-24 Thread Atish Patra
are being accessed if it is csr access instructions. Assert in all cases except if it is a csr access instructions that access valid PMU related registers. Signed-off-by: Atish Patra --- tools/testing/selftests/kvm/riscv/sbi_pmu_test.c | 32 1 file changed, 32 insertions

[PATCH 0/3] RISC-V KVM selftests improvements

2025-03-24 Thread Atish Patra
This series improves the following tests. 1. Get-reg-list : Adds vector support 2. SBI PMU test : Distinguish between different types of illegal exception The first patch is just helper patch that adds stval support during exception handling. Signed-off-by: Atish Patra --- Atish Patra (3

[PATCH v2 0/4] RISC-V KVM PMU fix and selftest improvement

2025-03-03 Thread Atish Patra
This series adds a fix for KVM PMU code and improves the pmu selftest by allowing generating precise number of interrupts. It also provided another additional option to the overflow test that allows user to generate custom number of LCOFI interrupts. Signed-off-by: Atish Patra --- Changes in v2

[PATCH v2 2/4] KVM: riscv: selftests: Do not start the counter in the overflow handler

2025-03-03 Thread Atish Patra
as well. Reviewed-by: Andrew Jones Signed-off-by: Atish Patra --- tools/testing/selftests/kvm/riscv/sbi_pmu_test.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/kvm/riscv/sbi_pmu_test.c b/tools/testing/selftests/kvm/riscv/sbi_pmu_test.c

[PATCH v2 1/4] RISC-V: KVM: Disable the kernel perf counter during configure

2025-03-03 Thread Atish Patra
to run via perf_event_enable during either the above mentioned scenario. Fixes: 0cb74b65d2e5 ("RISC-V: KVM: Implement perf support without sampling") Reviewed-by: Andrew Jones Signed-off-by: Atish Patra --- arch/riscv/kvm/vcpu_pmu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/

[PATCH v2 4/4] KVM: riscv: selftests: Allow number of interrupts to be configurable

2025-03-03 Thread Atish Patra
It is helpful to vary the number of the LCOFI interrupts generated by the overflow test. Allow additional argument for overflow test to accommodate that. It can be easily cross-validated with /proc/interrupts output in the host. Signed-off-by: Atish Patra --- tools/testing/selftests/kvm/riscv

[PATCH v2 3/4] KVM: riscv: selftests: Change command line option

2025-03-03 Thread Atish Patra
: Andrew Jones Signed-off-by: Atish Patra --- tools/testing/selftests/kvm/riscv/sbi_pmu_test.c | 40 +++- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/tools/testing/selftests/kvm/riscv/sbi_pmu_test.c b/tools/testing/selftests/kvm/riscv/sbi_pmu_test.c index

[PATCH 2/4] KVM: riscv: selftests: Do not start the counter in the overflow handler

2025-02-26 Thread Atish Patra
as well. Signed-off-by: Atish Patra --- tools/testing/selftests/kvm/riscv/sbi_pmu_test.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/kvm/riscv/sbi_pmu_test.c b/tools/testing/selftests/kvm/riscv/sbi_pmu_test.c index f45c0ecc902d

[PATCH 4/4] KVM: riscv: selftests: Allow number of interrupts to be configurable

2025-02-26 Thread Atish Patra
It is helpful to vary the number of the LCOFI interrupts generated by the overflow test. Allow additional argument for overflow test to accommodate that. It can be easily cross-validated with /proc/interrupts output in the host. Signed-off-by: Atish Patra --- tools/testing/selftests/kvm/riscv

[PATCH 3/4] KVM: riscv: selftests: Change command line option

2025-02-26 Thread Atish Patra
-by: Atish Patra --- tools/testing/selftests/kvm/riscv/sbi_pmu_test.c | 40 +++- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/tools/testing/selftests/kvm/riscv/sbi_pmu_test.c b/tools/testing/selftests/kvm/riscv/sbi_pmu_test.c index 284bc80193bd..533b76d0de82

[PATCH 0/4] RISC-V KVM PMU fix and selftest improvement

2025-02-26 Thread Atish Patra
This series adds a fix for KVM PMU code and improves the pmu selftest by allowing generating precise number of interrupts. It also provided another additional option to the overflow test that allows user to generate custom number of LCOFI interrupts. Signed-off-by: Atish Patra --- Atish Patra (4

[PATCH 1/4] RISC-V: KVM: Disable the kernel perf counter during configure

2025-02-26 Thread Atish Patra
to run via perf_event_enable during either the above mentioned scenario. Fixes: 0cb74b65d2e5 ("RISC-V: KVM: Implement perf support without sampling") Signed-off-by: Atish Patra --- arch/riscv/kvm/vcpu_pmu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/riscv/kvm/vcpu_pm

Re: [PATCH v4 3/5] RISC-V: Initial DTS for Microchip ICICLE board

2021-04-17 Thread Atish Patra
On Sat, Apr 17, 2021 at 8:36 PM Atish Patra wrote: > > On Mon, Mar 29, 2021 at 10:04 AM Vitaly Wool wrote: > > > > On Sat, Mar 27, 2021 at 6:24 PM Alex Ghiti wrote: > > > > > > Hi Atish, > > > > > > Le 3/3/21 à 3:02 PM, Atish Patra a écri

Re: [PATCH v4 3/5] RISC-V: Initial DTS for Microchip ICICLE board

2021-04-17 Thread Atish Patra
On Mon, Mar 29, 2021 at 10:04 AM Vitaly Wool wrote: > > On Sat, Mar 27, 2021 at 6:24 PM Alex Ghiti wrote: > > > > Hi Atish, > > > > Le 3/3/21 à 3:02 PM, Atish Patra a écrit : > > > Add initial DTS for Microchip ICICLE board having only > > > es

Re: [PATCH v4 0/5] Add Microchip PolarFire Soc Support

2021-04-17 Thread Atish Patra
On Mon, Mar 29, 2021 at 9:17 PM Palmer Dabbelt wrote: > > On Wed, 03 Mar 2021 12:02:48 PST (-0800), Atish Patra wrote: > > This series adds minimal support for Microchip Polar Fire Soc Icicle kit. > > It is rebased on v5.12-rc1 and depends on clock support. > > Only MMC

[RFC 2/6] RISC-V: Add CSR encodings for all HPMCOUNTERS

2021-03-19 Thread Atish Patra
Signed-off-by: Atish Patra --- arch/riscv/include/asm/csr.h | 58 1 file changed, 58 insertions(+) diff --git a/arch/riscv/include/asm/csr.h b/arch/riscv/include/asm/csr.h index caadfc1d7487..7ce8df8f1683 100644 --- a/arch/riscv/include/asm/csr.h +++ b/arch

[RFC 3/6] RISC-V: Add a perf core platform driver

2021-03-19 Thread Atish Patra
in this core driver wile PMU specific driver can implement PMU specific features. For example, the SBI specific functionality will be implemented in the SBI specific driver. Signed-off-by: Atish Patra --- drivers/perf/Kconfig | 8 + drivers/perf/Makefile | 1 + drivers

[RFC 4/6] RISC-V: Add a simple platform driver for RISC-V legacy perf

2021-03-19 Thread Atish Patra
provides an easy way out in future where we can remove the legacy driver. Signed-off-by: Atish Patra --- drivers/perf/Kconfig| 9 drivers/perf/Makefile | 3 ++ drivers/perf/riscv_pmu.c| 2 + drivers/perf/riscv_pmu_legacy.c | 88

[RFC 5/6] RISC-V: Add RISC-V SBI PMU extension definitions

2021-03-19 Thread Atish Patra
This patch adds all the definitions defined by the SBI PMU extension. Signed-off-by: Atish Patra --- arch/riscv/include/asm/sbi.h | 80 1 file changed, 80 insertions(+) diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h index

[RFC 0/6] Improve RISC-V Perf support using SBI PMU extension

2021-03-19 Thread Atish Patra
/g/tech-unixplatformspec/message/598 [2] https://github.com/atishp04/qemu/tree/riscv_pmu_v1 [3] https://github.com/atishp04/opensbi/tree/riscv_pmu_v1 [4] https://github.com/atishp04/linux/tree/riscv_pmu_v1 Atish Patra (6): RISC-V: Remove the current perf implementation RISC-V: Add CSR encodings for a

[RFC 1/6] RISC-V: Remove the current perf implementation

2021-03-19 Thread Atish Patra
most of the missing functionality. Signed-off-by: Atish Patra --- arch/riscv/Kconfig | 13 - arch/riscv/include/asm/perf_event.h | 72 - arch/riscv/kernel/Makefile | 1 - arch/riscv/kernel/perf_event.c | 485 4 files changed, 571

[RFC 6/6] RISC-V: Add perf platform driver based on SBI PMU extension

2021-03-19 Thread Atish Patra
of firmware counters that can provide insights into firmware activity during a performance analysis. Signed-off-by: Atish Patra --- drivers/perf/Kconfig | 8 + drivers/perf/Makefile | 1 + drivers/perf/riscv_pmu.c | 12 +- drivers/perf/riscv_pmu_sbi.c | 464

Re: [PATCH] RISC-V: Fix out-of-bounds accesses in init_resources()

2021-03-15 Thread Atish Patra
> sizeof(*mem_res); > mem_res = memblock_alloc(mem_res_sz, SMP_CACHE_BYTES); > if (!mem_res) > panic("%s: Failed to allocate %zu bytes\n", __func__, > mem_res_sz); > -- > 2.25.1 > > > _______ > linux-riscv mailing list > linux-ri...@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv Thanks for catching the bug & fixing it. Reviewed-by: Atish Patra -- Regards, Atish

Re: [PATCH v6 1/2] RISC-V: Don't print SBI version for all detected extensions

2021-03-15 Thread Atish Patra
pr_info("SBI RFENCE extension detected\n"); > } else { > __sbi_rfence= __sbi_rfence_v01; > } > -- > 2.25.1 > > > ___ > linux-riscv mailing list > linux-ri...@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv Reviewed-by: Atish Patra -- Regards, Atish

Re: [PATCH v4 3/5] RISC-V: Initial DTS for Microchip ICICLE board

2021-03-09 Thread Atish Patra
On Tue, 2021-03-09 at 13:30 +, lewis.ha...@microchip.com wrote: > > > From: Ben Dooks > Sent: Tuesday, March 9, 2021 10:56 AM > To: Atish Patra ; linux-kernel@vger.kernel.org < > linux-kernel@vger.kernel.org> > Cc: Albert Ou ; Alistair Francis < > alis

Re: [PATCH 1/1] RISC-V: correct enum sbi_ext_rfence_fid

2021-03-09 Thread Atish Patra
On Mon, Mar 8, 2021 at 2:55 AM Anup Patel wrote: > > On Mon, Mar 8, 2021 at 1:19 PM Atish Patra wrote: > > > > On Sat, Mar 6, 2021 at 4:12 AM Anup Patel wrote: > > > > > > On Sat, Mar 6, 2021 at 11:19 AM Heinrich Schuchardt > > > wrote: > > &

Re: [PATCH 1/1] RISC-V: correct enum sbi_ext_rfence_fid

2021-03-08 Thread Atish Patra
On Sun, Mar 7, 2021 at 11:49 PM Atish Patra wrote: > > On Sat, Mar 6, 2021 at 4:12 AM Anup Patel wrote: > > > > On Sat, Mar 6, 2021 at 11:19 AM Heinrich Schuchardt > > wrote: > > > > > > The constants in enum sbi_ext_rfence_fid should match th

Re: [PATCH 1/1] RISC-V: correct enum sbi_ext_rfence_fid

2021-03-07 Thread Atish Patra
On Sat, Mar 6, 2021 at 4:12 AM Anup Patel wrote: > > On Sat, Mar 6, 2021 at 11:19 AM Heinrich Schuchardt > wrote: > > > > The constants in enum sbi_ext_rfence_fid should match the SBI > > specification. See > > https://github.com/riscv/riscv-sbi-doc/blob/master/riscv-sbi.adoc#78-function-listing

[PATCH v4 5/5] MAINTAINERS: add microchip polarfire soc support

2021-03-03 Thread Atish Patra
From: Conor Dooley Add Cyril Jean and Lewis Hanly as maintainers for the Microchip SoC directory Signed-off-by: Conor Dooley --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index d92f85ca831d..cf186eca1784 100644 --- a/MAINTAINERS +++ b/MAI

[PATCH v4 4/5] RISC-V: Enable Microchip PolarFire ICICLE SoC

2021-03-03 Thread Atish Patra
Enable Microchip PolarFire ICICLE soc config in defconfig. It allows the default upstream kernel to boot on PolarFire ICICLE board. Signed-off-by: Atish Patra Reviewed-by: Anup Patel Reviewed-by: Bin Meng --- arch/riscv/configs/defconfig | 4 1 file changed, 4 insertions(+) diff --git a

[PATCH v4 1/5] RISC-V: Add Microchip PolarFire SoC kconfig option

2021-03-03 Thread Atish Patra
Add Microchip PolarFire kconfig option which selects SoC specific and common drivers that is required for this SoC. Signed-off-by: Atish Patra Reviewed-by: Bin Meng Reviewed-by: Anup Patel --- arch/riscv/Kconfig.socs | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/riscv

[PATCH v4 3/5] RISC-V: Initial DTS for Microchip ICICLE board

2021-03-03 Thread Atish Patra
Add initial DTS for Microchip ICICLE board having only essential devices (clocks, sdhci, ethernet, serial, etc). The device tree is based on the U-Boot patch. https://patchwork.ozlabs.org/project/uboot/patch/20201110103414.10142-6-padmarao.beg...@microchip.com/ Signed-off-by: Atish Patra

[PATCH v4 2/5] dt-bindings: riscv: microchip: Add YAML documentation for the PolarFire SoC

2021-03-03 Thread Atish Patra
Add YAML DT binding documentation for the Microchip PolarFire SoC. It is documented at: https://www.microsemi.com/products/fpga-soc/polarfire-soc-icicle-quick-start-guide Signed-off-by: Atish Patra --- .../devicetree/bindings/riscv/microchip.yaml | 27 +++ 1 file changed, 27

[PATCH v4 0/5] Add Microchip PolarFire Soc Support

2021-03-03 Thread Atish Patra
the DT to match the device tree in U-Boot. 2. Added both eMMC & SDcard entries in DT. However, SD card is only enabled as it allows larger storage option for linux distros. Atish Patra (4): RISC-V: Add Microchip PolarFire SoC kconfig option dt-bindings: riscv: microchip: Add YAML document

Re: [PATCH v4] RISC-V: Use SBI SRST extension when available

2021-03-02 Thread Atish Patra
wer_off = sbi_srst_power_off; > + sbi_srst_reboot_nb.notifier_call = sbi_srst_reboot; > + sbi_srst_reboot_nb.priority = 192; > + register_restart_handler(&sbi_srst_reboot_nb); > + } > } else { > __sbi_set_timer = __sbi_set_timer_v01; > __sbi_send_ipi = __sbi_send_ipi_v01; > -- > 2.25.1 > > > ___ > linux-riscv mailing list > linux-ri...@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv Reviewed-by: Atish Patra -- Regards, Atish

Re: [PATCH] RISC-V: Add a non-void return for sbi v02 functions

2021-02-22 Thread Atish Patra
On Mon, Feb 22, 2021 at 5:52 PM Palmer Dabbelt wrote: > > On Mon, 22 Feb 2021 14:38:28 PST (-0800), ati...@atishpatra.org wrote: > > On Mon, Feb 22, 2021 at 12:23 PM Guenter Roeck wrote: > >> > >> On Wed, Feb 03, 2021 at 09:26:43PM -0800, Atish Patra wrote: > &

Re: [PATCH] RISC-V: Add a non-void return for sbi v02 functions

2021-02-22 Thread Atish Patra
On Mon, Feb 22, 2021 at 12:23 PM Guenter Roeck wrote: > > On Wed, Feb 03, 2021 at 09:26:43PM -0800, Atish Patra wrote: > > SBI v0.2 functions can return an error code from SBI implementation. > > We are already processing the SBI error code and coverts it to the Li

Re: [PATCH] docs: update EFI stub description

2021-02-08 Thread Atish Patra
On Sat, Feb 6, 2021 at 2:02 AM Heinrich Schuchardt wrote: > > * Mention RISC-V. > * Update code references. > * initrd= does not specify a path relative on the ESP but to the partition > from which the EFI stub was loaded (as specified in the loaded image > protocol). > * Mention that ACPI tab

[PATCH v2 6/6] RISC-V: Add SBI RESET extension in KVM

2021-02-03 Thread Atish Patra
SBI RESET extension allows OS to initiate a system wide reboot or shutdown. Implement the SBI RESET extension so that guests can issue shutdown/reset requests as well. Signed-off-by: Atish Patra --- arch/riscv/include/asm/kvm_vcpu_sbi.h | 1 + arch/riscv/kvm/vcpu_sbi.c | 17

[PATCH v2 5/6] RISC-V: Add SBI HSM extension in KVM

2021-02-03 Thread Atish Patra
the guest OS doesn't implement HSM extension, only single vcpu will be available to OS. Signed-off-by: Atish Patra --- arch/riscv/include/asm/sbi.h | 1 + arch/riscv/kvm/Makefile | 2 +- arch/riscv/kvm/vcpu.c | 19 ++ arch/riscv/kvm/vcpu_sbi.c | 4 ++ arch/risc

[PATCH v2 3/6] RISC-V: Add SBI v0.2 base extension

2021-02-03 Thread Atish Patra
SBI v0.2 base extension defined to allow backward compatibility and probing of future extensions. This is also the only mandatory SBI extension that must be implemented by SBI implementors. Signed-off-by: Atish Patra --- arch/riscv/include/asm/kvm_vcpu_sbi.h | 2 + arch/riscv/include/asm/sbi.h

[PATCH v2 2/6] RISC-V: Reorganize SBI code by moving legacy SBI to its own file

2021-02-03 Thread Atish Patra
. Signed-off-by: Atish Patra --- arch/riscv/include/asm/kvm_vcpu_sbi.h | 1 + arch/riscv/kvm/Makefile | 2 +- arch/riscv/kvm/vcpu_sbi.c | 126 + arch/riscv/kvm/vcpu_sbi_legacy.c | 129 ++ 4 files changed, 136

[PATCH v2 4/6] RISC-V: Add v0.1 replacement SBI extensions defined in v02

2021-02-03 Thread Atish Patra
The SBI v0.2 contains some of the improved versions of required v0.1 extensions such as remote fence, timer and IPI. This patch implements those extensions. Signed-off-by: Atish Patra --- arch/riscv/kvm/Makefile | 2 +- arch/riscv/kvm/vcpu_sbi.c | 6 ++ arch/riscv/kvm

[PATCH v2 0/6] Add SBI v0.2 support for KVM

2021-02-03 Thread Atish Patra
ith Rocket core design. [1] https://github.com/riscv/riscv-sbi-doc/blob/master/riscv-sbi.adoc [2] http://lists.infradead.org/pipermail/linux-riscv/2021-January/004251.html Atish Patra (6): RISC-V: Mark the existing SBI v0.1 implementation as legacy RISC-V: Reorganize SBI code by moving legacy SBI

[PATCH v2 1/6] RISC-V: Mark the existing SBI v0.1 implementation as legacy

2021-02-03 Thread Atish Patra
The existing SBI specification impelementation follows v0.1 or legacy specification. The latest specification known as v0.2 allows more scalability and performance improvements. Rename the existing implementation as legacy and provide a way to allow future extensions. Signed-off-by: Atish Patra

[PATCH] RISC-V: Add a non-void return for sbi v02 functions

2021-02-03 Thread Atish Patra
SBI v0.2 functions can return an error code from SBI implementation. We are already processing the SBI error code and coverts it to the Linux error code. Propagate to the error code to the caller as well. As of now, kvm is the only user of these error codes. Signed-off-by: Atish Patra --- arch

Re: [PATCH -next] RISCV: Add some depends for NUMA

2021-02-03 Thread Atish Patra
GENERIC_ARCH_NUMA > select OF_NUMA > select ARCH_SUPPORTS_NUMA_BALANCING > -- > 2.26.2 > > > ___ > linux-riscv mailing list > linux-ri...@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv Reviewed-by: Atish Patra -- Regards, Atish

Re: [PATCH] riscv: virt_addr_valid must check the address belongs to linear mapping

2021-01-29 Thread Atish Patra
linux-riscv mailing list > linux-ri...@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv Reviewed-by: Atish Patra -- Regards, Atish

[PATCH 2/3] riscv: Align on L1_CACHE_BYTES when STRICT_KERNEL_RWX

2021-01-29 Thread Atish Patra
From: Sebastien Van Cauwenberghe Allows the sections to be aligned on smaller boundaries and therefore results in a smaller kernel image size. Signed-off-by: Sebastien Van Cauwenberghe Reviewed-by: Atish Patra --- arch/riscv/include/asm/set_memory.h | 6 +++--- 1 file changed, 3 insertions

[PATCH 3/3] RISC-V: Define MAXPHYSMEM_1GB only for RV32

2021-01-29 Thread Atish Patra
64 2, MAXPHYSMEM_2GB & RV32 Fixes: e557793799c5 ("RISC-V: Fix maximum allowed phsyical memory for RV32") Fix this by restricting MAXPHYSMEM_1GB for RV32 and MAXPHYSMEM_2GB only for RV64. Reported-by: Randy Dunlap Acked-by: Randy Dunlap Tested-by: Geert Uytterhoeven Signed-off-by: Atis

[PATCH 1/3] RISC-V: Fix .init section permission update

2021-01-29 Thread Atish Patra
Signed-off-by: Atish Patra --- arch/riscv/kernel/setup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index 3fa3f26dde85..c7c0655dd45b 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -29

Re: [PATCH] arch_numa: fix common code printing of phys_addr_t

2021-01-28 Thread Atish Patra
g is defined > here >   435 |  pr_info("Faking a node at [mem %#018Lx-%#018Lx]\n", start, > end - 1); > > Fixes: ae3c107cd8be ("numa: Move numa implementation to common code") > Signed-off-by: Randy Dunlap > Reported-by: kernel test robot > Cc: Atish Patra

Re: Kconfig-induced build errors: CONFIG_PAGE_OFFSET

2021-01-28 Thread Atish Patra
On Wed, Jan 27, 2021 at 7:18 PM Randy Dunlap wrote: > > Hi, > > I took a riscv-32 .config from kernel test robot (it was for a clang build) > and did a "make olddefconfig" (using gcc tools) and got build errors > due to this config item from arch/riscv/Kconfig; > > > config PAGE_OFFSET > h

Re: [PATCH 3/4] RISC-V: Fix L1_CACHE_BYTES for RV32

2021-01-15 Thread Atish Patra
On Thu, Jan 14, 2021 at 11:59 PM Geert Uytterhoeven wrote: > > Hi Atish, > > On Thu, Jan 14, 2021 at 10:11 PM Atish Patra wrote: > > On Thu, Jan 14, 2021 at 11:46 AM Palmer Dabbelt wrote: > > > On Thu, 14 Jan 2021 10:33:01 PST (-0800), ati...@atishpatra.org wrote: &

Re: [PATCH 3/4] RISC-V: Fix L1_CACHE_BYTES for RV32

2021-01-14 Thread Atish Patra
On Thu, Jan 14, 2021 at 11:46 AM Palmer Dabbelt wrote: > > On Thu, 14 Jan 2021 10:33:01 PST (-0800), ati...@atishpatra.org wrote: > > On Wed, Jan 13, 2021 at 9:10 PM Palmer Dabbelt wrote: > >> > >> On Thu, 07 Jan 2021 01:26:51 PST (-0800), Atish Patra wrote: > &g

Re: [PATCH 3/4] RISC-V: Fix L1_CACHE_BYTES for RV32

2021-01-14 Thread Atish Patra
On Wed, Jan 13, 2021 at 9:10 PM Palmer Dabbelt wrote: > > On Thu, 07 Jan 2021 01:26:51 PST (-0800), Atish Patra wrote: > > SMP_CACHE_BYTES/L1_CACHE_BYTES should be defined as 32 instead of > > 64 for RV32. Otherwise, there will be hole of 32 bytes with each memblock >

Re: [PATCH] riscv: Remove duplicate definition in pagtable.h

2021-01-12 Thread Atish Patra
On Mon, Jan 11, 2021 at 6:38 PM wrote: > > From: Guo Ren > > PAGE_KERNEL_EXEC has been defined above. > > Signed-off-by: Guo Ren > Cc: Palmer Dabbelt > Cc: Pekka Enberg > --- > arch/riscv/include/asm/pgtable.h | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/arch/riscv/include/asm/pgta

Re: [PATCH] net: macb: Add default usrio config to default gem config

2021-01-11 Thread Atish Patra
On Mon, 2021-01-11 at 15:13 -0800, Jakub Kicinski wrote: > On Mon, 11 Jan 2021 11:55:53 -0800 Atish Patra wrote: > > There is no usrio config defined for default gem config leading to > > a kernel panic devices that don't define a data. This issue can be > > reprdouced

[PATCH v2 0/4] Assorted fixes for RV32

2021-01-11 Thread Atish Patra
generic kernel issue where kernel pointers can not use last 4k of addressable memory. I am open to other better alternate suggestions. Changes from v1->v2: 1. Added Reviewed/Tested by tags. 2. Replaced PHYS_ADDR_MAX with explicit __pa(~(ulong)0). Atish Patra (4): RISC-V: Do not allocate membl

[PATCH v2 2/4] RISC-V: Set current memblock limit

2021-01-11 Thread Atish Patra
technically valid. Fix this issue by limiting the memblock if available memory spans the entire address space. Reviewed-by: Anup Patel Signed-off-by: Atish Patra --- arch/riscv/mm/init.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/arch/riscv/mm/init.c

[PATCH v2 4/4] RISC-V: Fix maximum allowed phsyical memory for RV32

2021-01-11 Thread Atish Patra
to allow 2GB physical address space. Reviewed-by: Anup Patel Signed-off-by: Atish Patra --- arch/riscv/Kconfig | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 81b76d44725d..e9e2c1f0a690 100644 --- a/arch/riscv/Kconfig +++ b

[PATCH v2 3/4] RISC-V: Fix L1_CACHE_BYTES for RV32

2021-01-11 Thread Atish Patra
SMP_CACHE_BYTES/L1_CACHE_BYTES should be defined as 32 instead of 64 for RV32. Otherwise, there will be hole of 32 bytes with each memblock allocation if it is requested to be aligned with SMP_CACHE_BYTES. Reviewed-by: Anup Patel Tested-by: Geert Uytterhoeven (on vexriscv) Signed-off-by: Atish

[PATCH v2 1/4] RISC-V: Do not allocate memblock while iterating reserved memblocks

2021-01-11 Thread Atish Patra
not going through memblock allocation code every time. Fixes: 00ab027a3b82 ("RISC-V: Add kernel image sections to the resource tree") Reviewed-by: Anup Patel Tested-by: Geert Uytterhoeven Signed-off-by: Atish Patra --- arch/riscv/kernel/setup.c | 24 +--- 1 file c

[PATCH] net: macb: Add default usrio config to default gem config

2021-01-11 Thread Atish Patra
atform configuration") Signed-off-by: Atish Patra --- drivers/net/ethernet/cadence/macb_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 814a5b10141d..47ee72ab7002 100644 --- a/drivers/net/ethernet/

Re: [PATCH v5 0/5] Unify NUMA implementation between ARM64 & RISC-V

2021-01-11 Thread Atish Patra
On Sat, Jan 9, 2021 at 12:51 PM Palmer Dabbelt wrote: > > On Sun, 13 Dec 2020 17:02:19 PST (-0800), ati...@atishpatra.org wrote: > > On Wed, Nov 18, 2020 at 4:39 PM Atish Patra wrote: > >> > >> This series attempts to move the ARM64 numa implementation to commo

Re: [PATCH 2/4] RISC-V: Set current memblock limit

2021-01-11 Thread Atish Patra
On Sun, Jan 10, 2021 at 7:59 PM Anup Patel wrote: > > On Thu, Jan 7, 2021 at 2:57 PM Atish Patra wrote: > > > > Currently, linux kernel can not use last 4k bytes of addressable space > > because > > IS_ERR_VALUE macro treats those as an error. This will be an issu

Re: [PATCH v2 0/2] CLK: microchip: Add clkcfg driver for Microchip PolarFire SoC

2021-01-08 Thread Atish Patra
On Thu, 2021-01-07 at 11:34 +, daire.mcnam...@microchip.com wrote: > From: Daire McNamara > > This patchset adds support for the Microchip PolarFire clkcfg > hardware block. > > Major changes since v1: >  * Dependency on SOC_MICROCHIP_POLARFIRE Does the sdcard work for with latest kernel ?

Re: [PATCH v3 3/5] RISC-V: Initial DTS for Microchip ICICLE board

2021-01-07 Thread Atish Patra
On Thu, Jan 7, 2021 at 3:44 AM wrote: > > Hi Atish, > > On 12/4/20 8:58 AM, Atish Patra wrote: > > EXTERNAL EMAIL: Do not click links or open attachments unless you know the > > content is safe > > > > Add initial DTS for Microchip ICICLE board having only

Re: [PATCH v3 1/5] RISC-V: Add Microchip PolarFire SoC kconfig option

2021-01-07 Thread Atish Patra
On Thu, Jan 7, 2021 at 3:40 AM wrote: > > Hi Atish, > > On 12/4/20 8:58 AM, Atish Patra wrote: > > EXTERNAL EMAIL: Do not click links or open attachments unless you know the > > content is safe > > > > Add Microchip PolarFire kconfig option which selects SoC

[PATCH 4/4] RISC-V: Fix maximum allowed phsyical memory for RV32

2021-01-07 Thread Atish Patra
to allow 2GB physical address space. Signed-off-by: Atish Patra --- arch/riscv/Kconfig | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 81b76d44725d..e9e2c1f0a690 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig

[PATCH 3/4] RISC-V: Fix L1_CACHE_BYTES for RV32

2021-01-07 Thread Atish Patra
SMP_CACHE_BYTES/L1_CACHE_BYTES should be defined as 32 instead of 64 for RV32. Otherwise, there will be hole of 32 bytes with each memblock allocation if it is requested to be aligned with SMP_CACHE_BYTES. Signed-off-by: Atish Patra --- arch/riscv/include/asm/cache.h | 4 1 file changed, 4

[PATCH 2/4] RISC-V: Set current memblock limit

2021-01-07 Thread Atish Patra
technically valid. Fix this issue by limiting the memblock if available memory spans the entire address space. Signed-off-by: Atish Patra --- arch/riscv/mm/init.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c

[PATCH 0/4] Assorted fixes for RV32

2021-01-07 Thread Atish Patra
generic kernel issue where kernel pointers can not use last 4k of addressable memory. I am open to other better alternate suggestions. Atish Patra (4): RISC-V: Do not allocate memblock while iterating reserved memblocks RISC-V: Set current memblock limit RISC-V: Fix L1_CACHE_BYTES for RV32 RISC-V

[PATCH 1/4] RISC-V: Do not allocate memblock while iterating reserved memblocks

2021-01-07 Thread Atish Patra
not going through memblock allocation code every time. Fixes: 00ab027a3b82 ("RISC-V: Add kernel image sections to the resource tree") Signed-off-by: Atish Patra --- arch/riscv/kernel/setup.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/

Re: [PATCH v5 4/9] riscv: Fixup patch_text panic in ftrace

2020-12-22 Thread Atish Patra
a0 <+22>:addisp,sp,16 >0xffe0002081a2 <+24>:ret > > (gdb) frame 5 > (rec=0xffe01ae40c30, enable=3) at kernel/trace/ftrace.c:2503 > 2503return ftrace_make_call(rec, ftrace_addr); > (gdb) p /x rec->ip > $2 = 0xffe0002081

Re: [PATCH v3 0/5] Add Microchip PolarFire Soc Support

2020-12-22 Thread Atish Patra
On Mon, Dec 21, 2020 at 7:19 PM Palmer Dabbelt wrote: > > On Fri, 04 Dec 2020 00:58:30 PST (-0800), Atish Patra wrote: > > This series adds minimal support for Microchip Polar Fire Soc Icicle kit. > > It is rebased on v5.10-rc6 and depends on clock support. > > Only MMC

[PATCH] riscv: Trace irq on only interrupt is enabled

2020-12-18 Thread Atish Patra
nable LOCKDEP_SUPPORT & fixup TRACE_IRQFLAGS_SUPPORT") Cc: sta...@vger.kernel.org Signed-off-by: Atish Patra --- arch/riscv/kernel/entry.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S index 524d918f3601..7dea5

[PATCH v2] RISC-V: Fix usage of memblock_enforce_memory_limit

2020-12-18 Thread Atish Patra
: Bin Meng Tested-by: Bin Meng Acked-by: Mike Rapoport Signed-off-by: Atish Patra --- Changes from v1->v2: 1. Added stable-kernel in cc. 2. Added reported/tested by tag. --- arch/riscv/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/mm/init.c b/arch/ri

Re: [PATCH v3 3/5] RISC-V: Align the .init.text section

2020-12-18 Thread Atish Patra
On Thu, Dec 17, 2020 at 12:33 AM Atish Patra wrote: > > On Wed, Dec 16, 2020 at 10:51 PM Palmer Dabbelt wrote: > > > > On Tue, 15 Dec 2020 22:02:54 PST (-0800), Palmer Dabbelt wrote: > > > On Wed, 04 Nov 2020 16:04:37 PST (-0800), Atish Patra wrote: > > &

Re: [PATCH] RISC-V: Fix usage of memblock_enforce_memory_limit

2020-12-17 Thread Atish Patra
On Thu, Dec 17, 2020 at 12:53 AM Bin Meng wrote: > > Hi Atish, > > On Thu, Dec 17, 2020 at 4:43 PM Atish Patra wrote: > > > > On Thu, Dec 17, 2020 at 12:12 AM Bin Meng wrote: > > > > > > Hi Atish, > > > >

Re: [PATCH] RISC-V: Fix usage of memblock_enforce_memory_limit

2020-12-17 Thread Atish Patra
On Thu, Dec 17, 2020 at 12:12 AM Bin Meng wrote: > > Hi Atish, > > On Thu, Dec 17, 2020 at 3:49 PM Atish Patra wrote: > > > > memblock_enforce_memory_limit accepts the maximum memory size not the last > > address. Fix the function invocation correctly. > &

Re: [PATCH v3 3/5] RISC-V: Align the .init.text section

2020-12-17 Thread Atish Patra
On Wed, Dec 16, 2020 at 10:51 PM Palmer Dabbelt wrote: > > On Tue, 15 Dec 2020 22:02:54 PST (-0800), Palmer Dabbelt wrote: > > On Wed, 04 Nov 2020 16:04:37 PST (-0800), Atish Patra wrote: > >> In order to improve kernel text protection, we need separate .init.text/ >

[PATCH] RISC-V: Fix usage of memblock_enforce_memory_limit

2020-12-16 Thread Atish Patra
memblock_enforce_memory_limit accepts the maximum memory size not the last address. Fix the function invocation correctly. Fixes: 1bd14a66ee52 ("RISC-V: Remove any memblock representing unusable memory area") Signed-off-by: Atish Patra --- arch/riscv/mm/init.c | 2 +- 1 file

Re: [PATCH v5 0/5] Unify NUMA implementation between ARM64 & RISC-V

2020-12-13 Thread Atish Patra
On Wed, Nov 18, 2020 at 4:39 PM Atish Patra wrote: > > This series attempts to move the ARM64 numa implementation to common > code so that RISC-V can leverage that as well instead of reimplementing > it again. > > RISC-V specific bits are based on initial work done by Gr

  1   2   3   4   5   6   7   8   9   10   >