[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 03/49] megasas: fix megasas_get_sata_addr
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 03/49] megasas: fix megasas_get_sata_addr |
Date: |
Fri, 16 Oct 2015 10:49:25 +0200 |
There are two bugs here. First, the 16-bit id loses the high 8 bits
when shifted left by 24. Second, the address must be combined with
an "or" or we just get zero.
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/scsi/megasas.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index a04369c..dcd724e 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -431,7 +431,7 @@ static uint64_t megasas_fw_time(void)
static uint64_t megasas_get_sata_addr(uint16_t id)
{
uint64_t addr = (0x1221ULL << 48);
- return addr & (id << 24);
+ return addr | ((uint64_t)id << 24);
}
/*
--
2.5.0
- [Qemu-devel] [PULL 00/49] Misc patches for 2015-10-16, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 01/49] nbd: switch from g_slice allocator to malloc, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 02/49] scsi: switch from g_slice allocator to malloc, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 03/49] megasas: fix megasas_get_sata_addr,
Paolo Bonzini <=
- [Qemu-devel] [PULL 06/49] cpu-exec-common.c: Clarify comment about cpu_reload_memory_map()'s RCU operations, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 04/49] configure: Require Python 2.6, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 05/49] exec.c: Don't call cpu_reload_memory_map() from cpu_exec_init(), Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 07/49] exec.c: Collect AddressSpace related fields into a CPUAddressSpace struct, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 09/49] linux-headers: update from kvm/next, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 08/49] checkpatch: allow open braces on typedef lines, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 10/49] target-i386/kvm: Hyper-V HV_X64_MSR_RESET support, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 11/49] target-i386/kvm: set Hyper-V features cpuid bit HV_X64_MSR_VP_INDEX_AVAILABLE, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 13/49] exec: remove non-TCG stuff from exec-all.h header., Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 12/49] target-i386/kvm: Hyper-V HV_X64_MSR_VP_RUNTIME support, Paolo Bonzini, 2015/10/16