[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 47/67] ppc/xive: Fix ESB length overflow on 32-bit hosts
From: |
Nicholas Piggin |
Subject: |
[PULL 47/67] ppc/xive: Fix ESB length overflow on 32-bit hosts |
Date: |
Mon, 4 Nov 2024 10:18:36 +1000 |
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>
---
hw/intc/spapr_xive_kvm.c | 4 ++--
hw/intc/xive.c | 2 +-
include/hw/ppc/xive.h | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/intc/spapr_xive_kvm.c b/hw/intc/spapr_xive_kvm.c
index 5789062379..7a86197fc9 100644
--- a/hw/intc/spapr_xive_kvm.c
+++ b/hw/intc/spapr_xive_kvm.c
@@ -720,7 +720,7 @@ int kvmppc_xive_connect(SpaprInterruptController *intc,
uint32_t nr_servers,
{
SpaprXive *xive = SPAPR_XIVE(intc);
XiveSource *xsrc = &xive->source;
- size_t esb_len = xive_source_esb_len(xsrc);
+ uint64_t esb_len = xive_source_esb_len(xsrc);
size_t tima_len = 4ull << TM_SHIFT;
CPUState *cs;
int fd;
@@ -824,7 +824,7 @@ void kvmppc_xive_disconnect(SpaprInterruptController *intc)
{
SpaprXive *xive = SPAPR_XIVE(intc);
XiveSource *xsrc;
- size_t esb_len;
+ uint64_t esb_len;
assert(xive->fd != -1);
diff --git a/hw/intc/xive.c b/hw/intc/xive.c
index 5a02dd8e02..b600546e78 100644
--- a/hw/intc/xive.c
+++ b/hw/intc/xive.c
@@ -1242,7 +1242,7 @@ static void xive_source_reset(void *dev)
static void xive_source_realize(DeviceState *dev, Error **errp)
{
XiveSource *xsrc = XIVE_SOURCE(dev);
- size_t esb_len = xive_source_esb_len(xsrc);
+ uint64_t esb_len = xive_source_esb_len(xsrc);
assert(xsrc->xive);
diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h
index 28c181faa2..3a65c2f29a 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;
}
--
2.45.2
- [PULL 37/67] target/ppc: optimize hreg_compute_pmu_hflags_value, (continued)
- [PULL 37/67] target/ppc: optimize hreg_compute_pmu_hflags_value, Nicholas Piggin, 2024/11/03
- [PULL 38/67] target/ppc: optimize p9 exception handling routines, Nicholas Piggin, 2024/11/03
- [PULL 39/67] target/ppc: optimize p8 exception handling routines, Nicholas Piggin, 2024/11/03
- [PULL 40/67] target/ppc: optimize p7 exception handling routines, Nicholas Piggin, 2024/11/03
- [PULL 42/67] target/ppc: combine multiple ail checks into one, Nicholas Piggin, 2024/11/03
- [PULL 43/67] target/ppc: reduce duplicate code between init_proc_POWER{9, 10}, Nicholas Piggin, 2024/11/03
- [PULL 46/67] hw/ppc: Implement -dtb support for PowerNV, Nicholas Piggin, 2024/11/03
- [PULL 45/67] spapr: nested: Add Power11 capability support for Nested PAPR guests in TCG L0, Nicholas Piggin, 2024/11/03
- [PULL 41/67] target/ppc: simplify var usage in ppc_next_unmasked_interrupt, Nicholas Piggin, 2024/11/03
- [PULL 48/67] pnv/xive: TIMA patch sets pre-req alignment and formatting changes, Nicholas Piggin, 2024/11/03
- [PULL 47/67] ppc/xive: Fix ESB length overflow on 32-bit hosts,
Nicholas Piggin <=
- [PULL 49/67] pnv/xive2: Define OGEN field in the TIMA, Nicholas Piggin, 2024/11/03
- [PULL 51/67] pnv/xive2: Support for "OS LGS Push" TIMA operation, Nicholas Piggin, 2024/11/03
- [PULL 50/67] ppc/xive2: Support TIMA "Pull OS Context to Odd Thread Reporting Line", Nicholas Piggin, 2024/11/03
- [PULL 52/67] ppc/xive2: Dump more NVP state with 'info pic', Nicholas Piggin, 2024/11/03
- [PULL 57/67] ppc/xive2: Support "Pull Thread Context to Odd Thread Reporting Line", Nicholas Piggin, 2024/11/03
- [PULL 44/67] spapr: nested: Add support for DPDES SPR in GSB for TCG L0, Nicholas Piggin, 2024/11/03
- [PULL 54/67] ppc/xive2: Allow 1-byte write of Target field in TIMA, Nicholas Piggin, 2024/11/03
- [PULL 59/67] pnv/xive: Update PIPR when updating CPPR, Nicholas Piggin, 2024/11/03
- [PULL 60/67] pnv/xive2: TIMA support for 8-byte OS context push for PHYP, Nicholas Piggin, 2024/11/03
- [PULL 61/67] pnv/xive2: TIMA CI ops using alternative offsets or byte lengths, Nicholas Piggin, 2024/11/03