aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2024-11-04 02:09:12 +1000
committerNicholas Piggin <npiggin@gmail.com>2024-11-04 09:14:10 +1000
commit07f2770503e24889720028ddf9ef54788ddf3b6d (patch)
treeae7f3ff1eb2f5f9900a2f16adca3a62bd8237094 /include
parent889c5c4c7a32be298aa499a246dbfd0c5fea8a74 (diff)
downloadqemu-07f2770503e24889720028ddf9ef54788ddf3b6d.zip
qemu-07f2770503e24889720028ddf9ef54788ddf3b6d.tar.gz
qemu-07f2770503e24889720028ddf9ef54788ddf3b6d.tar.bz2
ppc/xive: Fix ESB length overflow on 32-bit hosts
The length of this region can be > 32-bits, which overflows size_t on 32-bit hosts. Change to uint64_t. Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/hw/ppc/xive.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h
index 28c181f..3a65c2f 100644
--- a/include/hw/ppc/xive.h
+++ b/include/hw/ppc/xive.h
@@ -218,7 +218,7 @@ static inline bool xive_source_esb_has_2page(XiveSource *xsrc)
xsrc->esb_shift == XIVE_ESB_4K_2PAGE;
}
-static inline size_t xive_source_esb_len(XiveSource *xsrc)
+static inline uint64_t xive_source_esb_len(XiveSource *xsrc)
{
return (1ull << xsrc->esb_shift) * xsrc->nr_irqs;
}