diff options
| author | Guo Ren (Alibaba DAMO Academy) <guoren@kernel.org> | 2026-05-25 12:49:45 +0300 |
|---|---|---|
| committer | Anup Patel <anup@brainfault.org> | 2026-05-26 06:35:10 +0300 |
| commit | 11a713db4394a0ec61f9b9bda056363e45ff1961 (patch) | |
| tree | 3c396fefbf6e49b14cec907b5a98ef6bdb99a81f /scripts/basic | |
| parent | 59ebc16276c51fa3c462e5a0d21280249755502d (diff) | |
| download | linux-11a713db4394a0ec61f9b9bda056363e45ff1961.tar.xz | |
RISC-V: KVM: AIA: Make HGEI number management fully per-CPU
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 global `kvm_riscv_aia_nr_hgei` now represents the minimum number
of HGEI lines across HARTs and can be used to check whether HGEI
support is available or not.
This makes KVM AIA robust on big.LITTLE-style asymmetric platforms.
Signed-off-by: Guo Ren (Alibaba DAMO Academy) <guoren@kernel.org>
Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260525094945.3721783-3-anup.patel@oss.qualcomm.com
Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'scripts/basic')
0 files changed, 0 insertions, 0 deletions
