[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 6/9] gt64xxx: fix decoding of ISD register
From: |
Michael Tokarev |
Subject: |
[Qemu-devel] [PULL 6/9] gt64xxx: fix decoding of ISD register |
Date: |
Fri, 4 Dec 2015 09:57:37 +0300 |
From: Paolo Bonzini <address@hidden>
The GT64xxx's internal registers can be placed above the first 4 GiB
in the address space, but not above the first 64 GiB. Correctly cast
the register to a 64-bit integer, and mask away bits above bit 35.
Datasheet at
http://pdf.datasheetarchive.com/datasheetsmain/Datasheets-33/DSA-655889.pdf
(bug reported by Coverity).
Signed-off-by: Paolo Bonzini <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
hw/mips/gt64xxx_pci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/mips/gt64xxx_pci.c b/hw/mips/gt64xxx_pci.c
index 10fcca3..f76a9fd 100644
--- a/hw/mips/gt64xxx_pci.c
+++ b/hw/mips/gt64xxx_pci.c
@@ -275,7 +275,8 @@ static void check_reserved_space (hwaddr *start,
static void gt64120_isd_mapping(GT64120State *s)
{
- hwaddr start = s->regs[GT_ISD] << 21;
+ /* Bits 14:0 of ISD map to bits 35:21 of the start address. */
+ hwaddr start = ((hwaddr)s->regs[GT_ISD] << 21) & 0xFFFE00000ull;
hwaddr length = 0x1000;
if (s->ISD_length) {
--
2.1.4
- [Qemu-devel] [PULL for-2.5 0/9] Trivial patches for 2015-12-04, Michael Tokarev, 2015/12/04
- [Qemu-devel] [PULL 7/9] scsi: remove scsi_req_free prototype, Michael Tokarev, 2015/12/04
- [Qemu-devel] [PULL 9/9] bt: check struct sizes, Michael Tokarev, 2015/12/04
- [Qemu-devel] [PULL 5/9] configure: use appropriate code fragment for -fstack-protector checks, Michael Tokarev, 2015/12/04
- [Qemu-devel] [PULL 1/9] util/id: fully allocate names table, Michael Tokarev, 2015/12/04
- [Qemu-devel] [PULL 6/9] gt64xxx: fix decoding of ISD register,
Michael Tokarev <=
- [Qemu-devel] [PULL 3/9] configure: Diagnose broken linkers directly, Michael Tokarev, 2015/12/04
- [Qemu-devel] [PULL 2/9] bt: avoid unintended sign extension, Michael Tokarev, 2015/12/04
- [Qemu-devel] [PULL 4/9] crypto: avoid two coverity false positive error reports, Michael Tokarev, 2015/12/04
- [Qemu-devel] [PULL 8/9] typedefs: Put them back into alphabetical order, Michael Tokarev, 2015/12/04
- Re: [Qemu-devel] [PULL for-2.5 0/9] Trivial patches for 2015-12-04, Peter Maydell, 2015/12/04