From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Soajv-0005zZ-0W for qemu-devel@nongnu.org; Tue, 10 Jul 2012 09:44:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Soajo-0000H3-IC for qemu-devel@nongnu.org; Tue, 10 Jul 2012 09:44:30 -0400 Received: from e31.co.us.ibm.com ([32.97.110.149]:54857) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Soajo-0000Gm-Au for qemu-devel@nongnu.org; Tue, 10 Jul 2012 09:44:24 -0400 Received: from /spool/local by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 10 Jul 2012 07:44:19 -0600 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id C691DC90065 for ; Tue, 10 Jul 2012 09:39:17 -0400 (EDT) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6ADdH0O294036 for ; Tue, 10 Jul 2012 09:39:17 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6ADdGkG011622 for ; Tue, 10 Jul 2012 10:39:16 -0300 Message-ID: <4FFC3083.2060104@us.ibm.com> Date: Tue, 10 Jul 2012 08:39:15 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1341898880-15080-1-git-send-email-sw@weilnetz.de> In-Reply-To: <1341898880-15080-1-git-send-email-sw@weilnetz.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] megasas: Fix compilation for 32 bit hosts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: Paolo Bonzini , Alexander Graf , Hannes Reinecke , qemu-devel@nongnu.org On 07/10/2012 12:41 AM, Stefan Weil wrote: > Cc: Hannes Reinecke > Signed-off-by: Stefan Weil > --- > default-configs/pci.mak | 4 ++++ > hw/megasas.c | 13 +++++++------ > 2 files changed, 11 insertions(+), 6 deletions(-) > > diff --git a/default-configs/pci.mak b/default-configs/pci.mak > index 9d3e1db..120b69d 100644 > --- a/default-configs/pci.mak > +++ b/default-configs/pci.mak > @@ -5,6 +5,10 @@ CONFIG_USB_UHCI=y > CONFIG_USB_OHCI=y > CONFIG_USB_EHCI=y > CONFIG_USB_XHCI=y > + > +# RAID adapter > +CONFIG_MEGASAS_SCSI_PCI=y > + > CONFIG_NE2000_PCI=y > CONFIG_EEPRO100_PCI=y > CONFIG_PCNET_PCI=y > diff --git a/hw/megasas.c b/hw/megasas.c > index b48836f..26cf118 100644 > --- a/hw/megasas.c > +++ b/hw/megasas.c > @@ -372,12 +372,13 @@ static uint64_t megasas_fw_time(void) > return bcd_time; > } > > -static uint64_t megasas_gen_sas_addr(uint64_t id) > +static uint64_t megasas_gen_sas_addr(void *p) > { > + uint64_t id = (uintptr_t)p; I said in another note that this isn't acceptable. This sort of thing is an ABI issue so it needs to be fixed properly. Regards, Anthony Liguori > uint64_t addr; > > addr = 0x5001a4aULL<< 36; > - addr |= id& 0xfffffffff; > + addr |= id& 0xfffffffffULL; > > return addr; > } > @@ -672,7 +673,7 @@ static int megasas_ctrl_get_info(MegasasState *s, MegasasCmd *cmd) > info.host.type = MFI_INFO_HOST_PCIX; > info.device.type = MFI_INFO_DEV_SAS3G; > info.device.port_count = 2; > - info.device.port_addr[0] = cpu_to_le64(megasas_gen_sas_addr((uint64_t)s)); > + info.device.port_addr[0] = cpu_to_le64(megasas_gen_sas_addr(s)); > > memcpy(info.product_name, "MegaRAID SAS 8708EM2", 20); > snprintf(info.serial_number, 32, "QEMU%08lx", > @@ -761,7 +762,7 @@ static int megasas_mfc_get_defaults(MegasasState *s, MegasasCmd *cmd) > return MFI_STAT_INVALID_PARAMETER; > } > > - info.sas_addr = cpu_to_le64(megasas_gen_sas_addr((uint64_t)s)); > + info.sas_addr = cpu_to_le64(megasas_gen_sas_addr(s)); > info.stripe_size = 3; > info.flush_time = 4; > info.background_rate = 30; > @@ -891,7 +892,7 @@ static int megasas_dcmd_pd_get_list(MegasasState *s, MegasasCmd *cmd) > info.addr[num_pd_disks].scsi_dev_type = sdev->type; > info.addr[num_pd_disks].connect_port_bitmap = 0x1; > info.addr[num_pd_disks].sas_addr[0] = > - cpu_to_le64(megasas_gen_sas_addr((uint64_t)sdev)); > + cpu_to_le64(megasas_gen_sas_addr(sdev)); > num_pd_disks++; > offset += sizeof(struct mfi_pd_address); > } > @@ -994,7 +995,7 @@ static int megasas_pd_get_info_submit(SCSIDevice *sdev, int lun, > info->slot_number = (sdev->id& 0xFF); > info->path_info.count = 1; > info->path_info.sas_addr[0] = > - cpu_to_le64(megasas_gen_sas_addr((uint64_t)sdev)); > + cpu_to_le64(megasas_gen_sas_addr(sdev)); > info->connected_port_bitmap = 0x1; > info->device_speed = 1; > info->link_speed = 1;