[PW_SID:1083913] RISC-V: KVM: AIA: Convert HGEI management to fully per-HART#1803
[PW_SID:1083913] RISC-V: KVM: AIA: Convert HGEI management to fully per-HART#1803linux-riscv-bot wants to merge 4 commits into
Conversation
Previously the number of Hypervisor Guest External Interrupt (HGEI)
lines was stored in a single global variable `kvm_riscv_aia_nr_hgei`
and assumed to be the same for all HARTs. This assumption does not
hold on heterogeneous RISC-V SoCs where different cores may expose
different HGEIE CSR widths.
Introduce `nr_hgei` field into the per-CPU `struct aia_hgei_control`
and probe the actual supported HGEI count for the current HART in
`kvm_riscv_aia_enable()` using the standard RISC-V CSR probe
technique:
csr_write(CSR_HGEIE, -1UL);
nr = fls_long(csr_read(CSR_HGEIE));
if (nr)
nr--;
All HGEI allocation, free and disable paths (`kvm_riscv_aia_free_hgei()`,
`kvm_riscv_aia_disable()`, etc.) now use the per-CPU value instead of
the global one.
The early global `kvm_riscv_aia_nr_hgei` is kept only for deciding
whether SGEI interrupt registration is needed; the real per-HART
initialization of lock and free_bitmap is moved to enable time.
This makes KVM AIA robust on big.LITTLE-style and multi-vendor
asymmetric platforms.
Signed-off-by: Guo Ren (Alibaba DAMO Academy) <guoren@kernel.org>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Now that HGEI line management is fully per-CPU (via struct aia_hgei_control::nr_hgei), the global `kvm_riscv_aia_nr_hgei` is no longer needed. Replace it with a simple `bool kvm_riscv_aia_hgei_enabled` that only indicates whether HGEI support is available at all. Signed-off-by: Guo Ren (Alibaba DAMO Academy) <guoren@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
…ART conversion With the recent KVM AIA changes, HGEI line management is now fully per-CPU (via struct aia_hgei_control::nr_hgei) and the global kvm_riscv_aia_nr_hgei has been replaced by a simple enabled flag. The IMSIC driver no longer needs to compute and enforce a global minimum number of guest interrupt files across all HARTs. Remove: - `u32 nr_guest_files` from `struct imsic_global_config` - the initial `BIT(global->guest_index_bits) - 1` assignment - the entire per-CPU MMIO-based min() calculation and its comment (which was specifically there to protect old KVM) The per-HART guest file count is already handled locally in `imsic_local_config` during the parent IRQ loop, so this global field was redundant. This completes the cleanup series, eliminates the last global assumption about guest files, and improves support for heterogeneous (big.LITTLE / multi-vendor) RISC-V platforms. Signed-off-by: Guo Ren (Alibaba DAMO Academy) <guoren@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[1/3] RISC-V: KVM: AIA: Make HGEI number and management fully per-CPU" |
|
Patch 1: "[1/3] RISC-V: KVM: AIA: Make HGEI number and management fully per-CPU" |
|
Patch 1: "[1/3] RISC-V: KVM: AIA: Make HGEI number and management fully per-CPU" |
|
Patch 1: "[1/3] RISC-V: KVM: AIA: Make HGEI number and management fully per-CPU" |
|
Patch 1: "[1/3] RISC-V: KVM: AIA: Make HGEI number and management fully per-CPU" |
|
Patch 1: "[1/3] RISC-V: KVM: AIA: Make HGEI number and management fully per-CPU" |
|
Patch 1: "[1/3] RISC-V: KVM: AIA: Make HGEI number and management fully per-CPU" |
|
Patch 1: "[1/3] RISC-V: KVM: AIA: Make HGEI number and management fully per-CPU" |
|
Patch 1: "[1/3] RISC-V: KVM: AIA: Make HGEI number and management fully per-CPU" |
|
Patch 1: "[1/3] RISC-V: KVM: AIA: Make HGEI number and management fully per-CPU" |
|
Patch 1: "[1/3] RISC-V: KVM: AIA: Make HGEI number and management fully per-CPU" |
|
Patch 1: "[1/3] RISC-V: KVM: AIA: Make HGEI number and management fully per-CPU" |
|
Patch 2: "[2/3] RISC-V: KVM: AIA: Replace global HGEI count with simple enabled bool" |
|
Patch 2: "[2/3] RISC-V: KVM: AIA: Replace global HGEI count with simple enabled bool" |
|
Patch 2: "[2/3] RISC-V: KVM: AIA: Replace global HGEI count with simple enabled bool" |
|
Patch 2: "[2/3] RISC-V: KVM: AIA: Replace global HGEI count with simple enabled bool" |
|
Patch 2: "[2/3] RISC-V: KVM: AIA: Replace global HGEI count with simple enabled bool" |
|
Patch 2: "[2/3] RISC-V: KVM: AIA: Replace global HGEI count with simple enabled bool" |
|
Patch 2: "[2/3] RISC-V: KVM: AIA: Replace global HGEI count with simple enabled bool" |
|
Patch 2: "[2/3] RISC-V: KVM: AIA: Replace global HGEI count with simple enabled bool" |
|
Patch 2: "[2/3] RISC-V: KVM: AIA: Replace global HGEI count with simple enabled bool" |
|
Patch 2: "[2/3] RISC-V: KVM: AIA: Replace global HGEI count with simple enabled bool" |
|
Patch 2: "[2/3] RISC-V: KVM: AIA: Replace global HGEI count with simple enabled bool" |
|
Patch 2: "[2/3] RISC-V: KVM: AIA: Replace global HGEI count with simple enabled bool" |
|
Patch 3: "[3/3] irqchip/riscv-imsic: Remove global nr_guest_files after KVM AIA per-HART conversion" |
|
Patch 3: "[3/3] irqchip/riscv-imsic: Remove global nr_guest_files after KVM AIA per-HART conversion" |
|
Patch 3: "[3/3] irqchip/riscv-imsic: Remove global nr_guest_files after KVM AIA per-HART conversion" |
|
Patch 3: "[3/3] irqchip/riscv-imsic: Remove global nr_guest_files after KVM AIA per-HART conversion" |
|
Patch 3: "[3/3] irqchip/riscv-imsic: Remove global nr_guest_files after KVM AIA per-HART conversion" |
|
Patch 3: "[3/3] irqchip/riscv-imsic: Remove global nr_guest_files after KVM AIA per-HART conversion" |
|
Patch 3: "[3/3] irqchip/riscv-imsic: Remove global nr_guest_files after KVM AIA per-HART conversion" |
|
Patch 3: "[3/3] irqchip/riscv-imsic: Remove global nr_guest_files after KVM AIA per-HART conversion" |
|
Patch 3: "[3/3] irqchip/riscv-imsic: Remove global nr_guest_files after KVM AIA per-HART conversion" |
|
Patch 3: "[3/3] irqchip/riscv-imsic: Remove global nr_guest_files after KVM AIA per-HART conversion" |
|
Patch 3: "[3/3] irqchip/riscv-imsic: Remove global nr_guest_files after KVM AIA per-HART conversion" |
|
Patch 3: "[3/3] irqchip/riscv-imsic: Remove global nr_guest_files after KVM AIA per-HART conversion" |
506e7f6 to
01805bc
Compare
PR for series 1083913 applied to workflow__riscv__fixes
Name: RISC-V: KVM: AIA: Convert HGEI management to fully per-HART
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1083913
Version: 1