diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-06-21 15:40:40 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-06-21 15:40:40 +0300 |
commit | ef9a1618f95d32ac6abd4db42d9599a188ef3102 (patch) | |
tree | 7e5c63656c35813ef044a298214456daaa8f8fc0 /arch/riscv/kvm/aia_device.c | |
parent | 8a7a1920d72c87692665de214fdc5dc37e34e5cb (diff) | |
parent | 9c5a72fbc90d829ffb761da64a73c23cd4e0503f (diff) | |
download | linux-ef9a1618f95d32ac6abd4db42d9599a188ef3102.tar.xz |
Merge v6.9.6
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/riscv/kvm/aia_device.c')
-rw-r--r-- | arch/riscv/kvm/aia_device.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/riscv/kvm/aia_device.c b/arch/riscv/kvm/aia_device.c index 0eb689351b7d..5cd407c6a8e4 100644 --- a/arch/riscv/kvm/aia_device.c +++ b/arch/riscv/kvm/aia_device.c @@ -237,10 +237,11 @@ static gpa_t aia_imsic_ppn(struct kvm_aia *aia, gpa_t addr) static u32 aia_imsic_hart_index(struct kvm_aia *aia, gpa_t addr) { - u32 hart, group = 0; + u32 hart = 0, group = 0; - hart = (addr >> (aia->nr_guest_bits + IMSIC_MMIO_PAGE_SHIFT)) & - GENMASK_ULL(aia->nr_hart_bits - 1, 0); + if (aia->nr_hart_bits) + hart = (addr >> (aia->nr_guest_bits + IMSIC_MMIO_PAGE_SHIFT)) & + GENMASK_ULL(aia->nr_hart_bits - 1, 0); if (aia->nr_group_bits) group = (addr >> aia->nr_group_shift) & GENMASK_ULL(aia->nr_group_bits - 1, 0); |