Skip to content

[PW_SID:1100002] RISC-V: KVM: Convert HGEI management to fully per-HART#2002

Closed
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1100002
Closed

[PW_SID:1100002] RISC-V: KVM: Convert HGEI management to fully per-HART#2002
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1100002

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 1100002 applied to workflow__riscv__fixes

Name: RISC-V: KVM: Convert HGEI management to fully per-HART
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1100002
Version: 3

guoren83 added 2 commits May 24, 2026 14:54
Add nr_guest_files in per-HART local config to represent the number of
guest files available on a particular HART whereas the nr_guest_files
in the global config represents the number of guest files available
across all HARTs.

This allows KVM RISC-V to use nr_guest_files from per-HART local
config for asymmetric big.Little systems.

Signed-off-by: Guo Ren (Alibaba DAMO Academy) <guoren@kernel.org>
Acked-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
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>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] irqchip/riscv-imsic: Add nr_guest_files in per-HART local config"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 114.47 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] irqchip/riscv-imsic: Add nr_guest_files in per-HART local config"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1138.08 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] irqchip/riscv-imsic: Add nr_guest_files in per-HART local config"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1655.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] irqchip/riscv-imsic: Add nr_guest_files in per-HART local config"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 19.33 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] irqchip/riscv-imsic: Add nr_guest_files in per-HART local config"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 20.83 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] irqchip/riscv-imsic: Add nr_guest_files in per-HART local config"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.77 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] irqchip/riscv-imsic: Add nr_guest_files in per-HART local config"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 76.90 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] irqchip/riscv-imsic: Add nr_guest_files in per-HART local config"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] irqchip/riscv-imsic: Add nr_guest_files in per-HART local config"
kdoc
Desc: Detects for kdoc errors
Duration: 0.73 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] irqchip/riscv-imsic: Add nr_guest_files in per-HART local config"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] irqchip/riscv-imsic: Add nr_guest_files in per-HART local config"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v3,1/2] irqchip/riscv-imsic: Add nr_guest_files in per-HART local config"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.45 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] RISC-V: KVM: AIA: Make HGEI number management fully per-CPU"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 115.08 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] RISC-V: KVM: AIA: Make HGEI number management fully per-CPU"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1041.20 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] RISC-V: KVM: AIA: Make HGEI number management fully per-CPU"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1405.63 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] RISC-V: KVM: AIA: Make HGEI number management fully per-CPU"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 19.61 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] RISC-V: KVM: AIA: Make HGEI number management fully per-CPU"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 20.89 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] RISC-V: KVM: AIA: Make HGEI number management fully per-CPU"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.62 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] RISC-V: KVM: AIA: Make HGEI number management fully per-CPU"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 76.18 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] RISC-V: KVM: AIA: Make HGEI number management fully per-CPU"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] RISC-V: KVM: AIA: Make HGEI number management fully per-CPU"
kdoc
Desc: Detects for kdoc errors
Duration: 0.72 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] RISC-V: KVM: AIA: Make HGEI number management fully per-CPU"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] RISC-V: KVM: AIA: Make HGEI number management fully per-CPU"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.32 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v3,2/2] RISC-V: KVM: AIA: Make HGEI number management fully per-CPU"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot deleted the pw1100002 branch May 24, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants