- Jun 21, 2023
-
-
Sunil V L authored
This is required to mount efi partition. Signed-off-by:Sunil V L <sunilvl@ventanamicro.com>
-
Mayuresh Chitale authored
When svinval is supported the local_flush_tlb_page* functions would prefer to use the following sequence to optimize the tlb flushes instead of a simple sfence.vma: sfence.w.inval svinval.vma . . svinval.vma sfence.inval.ir The maximum number of consecutive svinval.vma instructions that can be executed in local_flush_tlb_page* functions is limited to PTRS_PER_PTE. This is required to avoid soft lockups and the approach is similar to that used in arm64. Signed-off-by:Mayuresh Chitale <mchitale@ventanamicro.com>
-
Andrew Jones authored
When the SUSP SBI extension is present it implies that the standard "suspend to RAM" type is available. Wire it up to the generic platform suspend support, also applying the already present support for non-retentive CPU suspend. When the kernel is built with CONFIG_SUSPEND, one can do 'echo mem > /sys/power/state' to suspend. Resumption will occur when a platform-specific wake-up event arrives. Signed-off-by:Andrew Jones <ajones@ventanamicro.com>
-
Anup Patel authored
When running under some other hypervisor, we should use NACL HFENCEs for TLB shoot-down via KVM requests. This makes HFENCEs faster whenever SBI nested acceleration is available. Signed-off-by:Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
We directly update HENVCFG CSR in kvm_arch_vcpu_load() so that we can do more optimized access while running under some other hypervisor. Signed-off-by:Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
We should save trap CSRs in kvm_riscv_vcpu_enter_exit() instead of kvm_arch_vcpu_ioctl_run() so that we can do more optimized access to HTVAL and HTINST CSRs while running under some other hypervisor. Signed-off-by:Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
We implement an optimized KVM world-switch using SBI sync SRET call when SBI nested acceleration extension is available. This improves KVM world-switch when KVM RISC-V is running as a Guest under some other hypervisor. Signed-off-by:Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
When running under some other hypervisor, we should use nacl_csr_xyz() for accessing most CSRs in run-loop. This makes CSR access faster whenever SBI nested acceleration is available. Signed-off-by:Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
We add commob nested acceleration support which is shared by all parts of KVM RISC-V. This nested acceleration support detects and uses SBI NACL extension and uses static key to have minimum impact on the non-nested scenario. Signed-off-by:Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
We add defines for the new SBI nested acceleration extension in the SBI interface header. Signed-off-by:Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
We will be optimizing HSTATUS CSR access via shared memory setup using SBI nested acceleration extension. To facilitate this, we first move HSTATUS save/restore in kvm_riscv_vcpu_enter_exit(). Signed-off-by:Anup Patel <apatel@ventanamicro.com>
-
Atish Patra authored
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 <atishp@rivosinc.com> Signed-off-by:
Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
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 <apatel@ventanamicro.com>
-
Anup Patel authored
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 <apatel@ventanamicro.com>
-
Anup Patel authored
We extend the existing RISC-V SBI earlycon support to use the new RISC-V SBI debug console extension. Signed-off-by:Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
We add SBI debug console extension related defines/enum to the asm/sbi.h header. Signed-off-by:Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
Let us discover and use IMSIC guest files from the IMSIC global config provided by the IMSIC irqchip driver. Signed-off-by:Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
We have common APLIC and IMSIC headers available under include/linux/irqchip/ directory which are used by APLIC and IMSIC irqchip drivers. Let us replace the use of kvm_aia_*.h headers with include/linux/irqchip/riscv-*.h headers. Signed-off-by:Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
We now have dedicated timer DT node so we should probe through it when available. This also helps us refactor the timer probe function such that it can be shared for both DT and ACPI. Signed-off-by:Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
When Sstc is available the RISC-V timer clock_event_device should be the preferred clock_event_device hence we increase clock_event_device rating for Sstc. Signed-off-by:Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
Currently, we enable/disable timer interrupt at runtime to start/stop timer events. This makes timer interrupt state go out-of-sync with the Linux interrupt subsystem. To address the above issue, we can stop a per-HART timer interrupt by setting U64_MAX in timecmp CSR (or sbi_set_timer()) at time handling timer interrupt. Signed-off-by:Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
Add myself as maintainer for RISC-V AIA drivers including the RISC-V INTC driver which supports both AIA and non-AIA platforms. Signed-off-by:Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
The QEMU virt machine supports AIA emulation and we also have quite a few RISC-V platforms with AIA support under development so let us select APLIC and IMSIC drivers for all RISC-V platforms. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Conor Dooley <conor.dooley@microchip.com>
-
Anup Patel authored
The RISC-V advanced interrupt architecture (AIA) specification defines a new interrupt controller for managing wired interrupts on a RISC-V platform. This new interrupt controller is referred to as advanced platform-level interrupt controller (APLIC) which can forward wired interrupts to CPUs (or HARTs) as local interrupts OR as message signaled interrupts. (For more details refer https://github.com/riscv/riscv-aia ) This patch adds an irqchip driver for RISC-V APLIC found on RISC-V platforms. Signed-off-by:
Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
We add DT bindings document for RISC-V advanced platform level interrupt controller (APLIC) defined by the RISC-V advanced interrupt architecture (AIA) specification. Signed-off-by:Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
We have a separate RISC-V IMSIC MSI address for each CPU so changing MSI (or IRQ) affinity results in re-programming of MSI address in the PCIe (or platform) device. Currently, the iommu_dma_prepare_msi() is called only once at the time of IRQ allocation so IOMMU DMA domain will only have mapping for one MSI page. This means iommu_dma_compose_msi_msg() called by imsic_irq_compose_msi_msg() will always use the same MSI page irrespective to target CPU MSI address. In other words, changing MSI (or IRQ) affinity for device using IOMMU DMA domain will not work. To address the above issue, we do the following: 1) Map MSI pages for all CPUs in imsic_irq_domain_alloc() using iommu_dma_prepare_msi(). 2) Extend iommu_dma_compose_msi_msg() to lookup the correct msi_page whenever the msi_page stored as iommu cookie does not match. Reported-by:
Vincent Chen <vincent.chen@sifive.com> Signed-off-by:
Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
The Linux PCI framework requires it's own dedicated MSI irqdomain so let us create PCI MSI irqdomain as child of the IMSIC base irqdomain. Signed-off-by:Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
The RISC-V advanced interrupt architecture (AIA) specification defines a new MSI controller for managing MSIs and IPIs on a RISC-V platform. This new MSI controller is referred to as incoming message signalled interrupt controller (IMSIC) which manages MSI on per-HART (or per-CPU) basis. (For more details refer https://github.com/riscv/riscv-aia ) This patch adds an irqchip driver for RISC-V IMSIC which provides IPIs and platform MSIs to the Linux RISC-V kernel. Signed-off-by:
Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
We add DT bindings document for the RISC-V incoming MSI controller (IMSIC) defined by the RISC-V advanced interrupt architecture (AIA) specification. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Conor Dooley <conor.dooley@microchip.com> Acked-by:
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
-
Anup Patel authored
The RISC-V advanced interrupt architecture (AIA) extends the per-HART local interrupts in following ways: 1. Minimum 64 local interrupts for both RV32 and RV64 2. Ability to process multiple pending local interrupts in same interrupt handler 3. Priority configuration for each local interrupts 4. Special CSRs to configure/access the per-HART MSI controller This patch adds support for RISC-V AIA in the RISC-V intc driver. Signed-off-by:Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
We add common riscv_fw_parent_hartid() which help device drivers to get parent hartid of the INTC (i.e. local interrupt controller) fwnode. This should work for both DT and ACPI. Signed-off-by:Anup Patel <apatel@ventanamicro.com>
-
Sunil V L authored
ACPI defines few RISC-V specific tables which need parsing code added in drivers/acpi/riscv. Add maintainer entries for this newly created folder. Signed-off-by:
Sunil V L <sunilvl@ventanamicro.com> Acked-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-
Sunil V L authored
Add support to build ACPI subsystem in defconfig. Signed-off-by:
Sunil V L <sunilvl@ventanamicro.com> Acked-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by:
Andrew Jones <ajones@ventanamicro.com> Reviewed-by:
Conor Dooley <conor.dooley@microchip.com>
-
Sunil V L authored
On ACPI based platforms, timer related information is available in RHCT. Add ACPI based probe support to the timer initialization. Signed-off-by:
Sunil V L <sunilvl@ventanamicro.com> Acked-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by:
Andrew Jones <ajones@ventanamicro.com> Reviewed-by:
Conor Dooley <conor.dooley@microchip.com>
-
Sunil V L authored
Initialize the timer driver based on RHCT table on ACPI based platforms. Currently, ACPI doesn't support a flag to indicate that the timer interrupt can wake up the cpu irrespective of its power state. It will be added in future update. Signed-off-by:
Sunil V L <sunilvl@ventanamicro.com> Acked-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by:
Andrew Jones <ajones@ventanamicro.com> Reviewed-by:
Conor Dooley <conor.dooley@microchip.com>
-
Sunil V L authored
Refactor the timer init function such that few things can be shared by both DT and ACPI based platforms. Co-developed-by:
Anup Patel <apatel@ventanamicro.com> Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Signed-off-by:
Sunil V L <sunilvl@ventanamicro.com> Acked-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by:
Andrew Jones <ajones@ventanamicro.com> Reviewed-by:
Conor Dooley <conor.dooley@microchip.com>
-
Sunil V L authored
Add support for initializing the RISC-V INTC driver on ACPI platforms. Signed-off-by:
Sunil V L <sunilvl@ventanamicro.com> Acked-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by:
Andrew Jones <ajones@ventanamicro.com> Reviewed-by:
Conor Dooley <conor.dooley@microchip.com>
-
Sunil V L authored
On ACPI based platforms, few details like ISA need to be read from the ACPI table. Enable cpuinfo on ACPI based systems. ACPI has nothing similar to DT compatible property for each CPU. Hence, cpuinfo will not print "uarch". Signed-off-by:
Sunil V L <sunilvl@ventanamicro.com> Acked-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by:
Andrew Jones <ajones@ventanamicro.com> Reviewed-by:
Conor Dooley <conor.dooley@microchip.com>
-
Sunil V L authored
On ACPI based systems, the information about the hart like ISA is provided by the RISC-V Hart Capabilities Table (RHCT). Enable filling up hwcap structure based on the information in RHCT. Signed-off-by:
Sunil V L <sunilvl@ventanamicro.com> Acked-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by:
Andrew Jones <ajones@ventanamicro.com> Reviewed-by:
Conor Dooley <conor.dooley@microchip.com>
-
Sunil V L authored
During boot we call riscv_of_processor_hartid() for each hart that we add to the possible cpus list. Repeating the call again here is not required, if we iterate over the list of possible CPUs, rather than the list of all CPUs. The call to of_property_read_string() for "riscv,isa" cannot fail either, as it has previously succeeded in riscv_of_processor_hartid(), but leaving in the error checking makes the operation of the loop more obvious & provides leeway for future refactoring of riscv_of_processor_hartid(). Signed-off-by:
Sunil V L <sunilvl@ventanamicro.com> Co-developed-by:
Conor Dooley <conor.dooley@microchip.com> Signed-off-by:
Conor Dooley <conor.dooley@microchip.com> Reviewed-by:
Andrew Jones <ajones@ventanamicro.com>
-