[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 13/14] target-ppc: fix left shift overflow in hpte_pa
From: |
David Gibson |
Subject: |
[Qemu-devel] [PULL 13/14] target-ppc: fix left shift overflow in hpte_page_shift |
Date: |
Mon, 18 Jul 2016 14:38:49 +1000 |
From: Paolo Bonzini <address@hidden>
ps->pte_enc is a 32-bit value, which is shifted left and then compared
to a 64-bit value. It needs a cast before the shift.
Reported by Coverity.
Signed-off-by: Paolo Bonzini <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
target-ppc/mmu-hash64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target-ppc/mmu-hash64.c b/target-ppc/mmu-hash64.c
index f6ffe35..5de1358 100644
--- a/target-ppc/mmu-hash64.c
+++ b/target-ppc/mmu-hash64.c
@@ -478,7 +478,7 @@ static unsigned hpte_page_shift(const struct
ppc_one_seg_page_size *sps,
mask = ((1ULL << ps->page_shift) - 1) & HPTE64_R_RPN;
- if ((pte1 & mask) == (ps->pte_enc << HPTE64_R_RPN_SHIFT)) {
+ if ((pte1 & mask) == ((uint64_t)ps->pte_enc << HPTE64_R_RPN_SHIFT)) {
return ps->page_shift;
}
}
--
2.7.4
- [Qemu-devel] [PULL 00/14] ppc-for-2.7 queue 20160718, David Gibson, 2016/07/18
- [Qemu-devel] [PULL 02/14] dbdma: always define DBDMA_DPRINTF and enable debug with DEBUG_DBDMA, David Gibson, 2016/07/18
- [Qemu-devel] [PULL 07/14] dbdma: reset io->processing flag for unassigned DBDMA channel rw accesses, David Gibson, 2016/07/18
- [Qemu-devel] [PULL 14/14] ppc: Yet another fix for the huge page support detection mechanism, David Gibson, 2016/07/18
- [Qemu-devel] [PULL 06/14] dbdma: set FLUSH bit upon reception of flush command for unassigned DBDMA channels, David Gibson, 2016/07/18
- [Qemu-devel] [PULL 03/14] dbdma: add per-channel debugging enabled via DEBUG_DBDMA_CHANMASK, David Gibson, 2016/07/18
- [Qemu-devel] [PULL 01/14] spapr: fix core unplug crash, David Gibson, 2016/07/18
- [Qemu-devel] [PULL 13/14] target-ppc: fix left shift overflow in hpte_page_shift,
David Gibson <=
- [Qemu-devel] [PULL 08/14] ppc: Fix support for odd MSR combinations, David Gibson, 2016/07/18
- [Qemu-devel] [PULL 04/14] dbdma: fix endian of DBDMA_CMDPTR_LO during branch, David Gibson, 2016/07/18
- [Qemu-devel] [PULL 11/14] ppc: abort if compat property contains an unknown value, David Gibson, 2016/07/18
- [Qemu-devel] [PULL 05/14] dbdma: fix load_word/store_word value endianness, David Gibson, 2016/07/18
- [Qemu-devel] [PULL 12/14] ppc/mmu-hash64: Remove duplicated #include statement, David Gibson, 2016/07/18
- [Qemu-devel] [PULL 10/14] spapr: Ensure CPU cores are added contiguously and removed in LIFO order, David Gibson, 2016/07/18
- [Qemu-devel] [PULL 09/14] vfio/spapr: Remove stale ioctl() call, David Gibson, 2016/07/18
- Re: [Qemu-devel] [PULL 00/14] ppc-for-2.7 queue 20160718, Peter Maydell, 2016/07/18