From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVcVe-00078f-W7 for qemu-devel@nongnu.org; Wed, 11 Mar 2015 05:01:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVcVZ-0003Il-U6 for qemu-devel@nongnu.org; Wed, 11 Mar 2015 05:00:58 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:52343) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVcVZ-0003HM-Kv for qemu-devel@nongnu.org; Wed, 11 Mar 2015 05:00:53 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 11 Mar 2015 09:00:52 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 121DB1B0804B for ; Wed, 11 Mar 2015 09:01:11 +0000 (GMT) Received: from d06av06.portsmouth.uk.ibm.com (d06av06.portsmouth.uk.ibm.com [9.149.37.217]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t2B90onM51380478 for ; Wed, 11 Mar 2015 09:00:50 GMT Received: from d06av06.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t2B3tunm027439 for ; Tue, 10 Mar 2015 23:55:57 -0400 Date: Wed, 11 Mar 2015 10:00:46 +0100 From: Thomas Huth Message-ID: <20150311100046.3bdd8f18@oc7435384737.ibm.com> In-Reply-To: <54FFF831.8050800@de.ibm.com> References: <1425976693-18087-1-git-send-email-borntraeger@de.ibm.com> <54FF6F98.4080102@de.ibm.com> <87k2yormoh.fsf@blackfin.pond.sub.org> <54FFF831.8050800@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PULL 00/20] s390x/kvm: Features and fixes for 2.3 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christian Borntraeger Cc: Peter Maydell , qemu-devel , Alexander Graf , Markus Armbruster , Jens Freimann , Cornelia Huck , Richard Henderson On Wed, 11 Mar 2015 09:09:21 +0100 Christian Borntraeger wrote: > Am 11.03.2015 um 08:57 schrieb Markus Armbruster: > > Christian Borntraeger writes: > >=20 > >> Am 10.03.2015 um 19:01 schrieb Peter Maydell: > >>> On 10 March 2015 at 08:37, Christian Borntraeger > >>> wrote: > >>>> Peter, > >>>> > >>>> this pull reuqest contains a header sync to 4.0-rc3. This should cau= se > >>>> no merge conflicts with other header syncs against 4.0-rc2. So here > >>>> is the s390 pull request. > >>>> > >>>> The following changes since commit 277263e1b320d759a760ba6c5ea75ec26= 8f929e5: > >>>> > >>>> Merge remote-tracking branch > >>>> remotes/agraf/tags/signed-ppc-for-upstream' into staging > >>>> (2015-03-09 14:04:14 +0000) > >>>> > >>>> are available in the git repository at: > >>>> > >>>> git://github.com/borntraeger/qemu.git tags/s390x-20150310 > >>>> > >>>> for you to fetch changes up to 6342cb1443b37d249a0e2005128ade07a80a9= 7f5: > >>>> > >>>> s390-ccw: rebuild BIOS (2015-03-10 09:26:33 +0100) > >>> > >>> Unfortunately I see build failures on 32 bit hosts: > >>> > >>> /root/qemu/hw/s390x/ipl.c: In function =E2=80=98bios_translate_addr= =E2=80=99: > >>> /root/qemu/hw/s390x/ipl.c:101:24: error: cast from pointer to integer > >>> of different size [-Werror=3Dpointer-to-int-cast] > >>> /root/qemu/hw/s390x/ipl.c: In function =E2=80=98s390_ipl_init=E2=80= =99: > >>> /root/qemu/hw/s390x/ipl.c:135:30: error: cast to pointer from integer > >>> of different size [-Werror=3Dint-to-pointer-cast] > >>> > >> > >> O dear. Seems that every pull request after your vacation is somewhat = broken. > >> I fixed up patch 19 (" s390/bios: Make the s390-ccw.img relocatable") = as > >> such > >> > >> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c > >> index ab7fd8a..6ed18d3 100644 > >> --- a/hw/s390x/ipl.c > >> +++ b/hw/s390x/ipl.c > >> @@ -98,7 +98,7 @@ static const VMStateDescription vmstate_ipl =3D { > >> =20 > >> static uint64_t bios_translate_addr(void *opaque, uint64_t srcaddr) > >> { > >> - uint64_t dstaddr =3D (uint64_t)opaque; > >> + uint64_t dstaddr =3D (uint64_t) (unsigned long) opaque; > >> /* > >> * Assuming that our s390-ccw.img was linked for starting at addr= ess 0, > >> * we can simply add the destination address for the final locati= on > >=20 > > Won't this shift the warning from hosts where sizeof(void *) !=3D > > sizeof(uint64_t) to hosts where it's !=3D sizeof(unsigned long)? >=20 > Indeed. I was only thinking about Linux, where sizeof(unsigned long) =3D= =3D sizeof(void*). > But Windows has a different model. We have to cover all kind of lp64, llp= 64 and friends. >=20 > > What about using uintptr_t instead? >=20 > Should work. Will have a try on Linux 32bit/64bit..no way to test on wind= ows, though :-( Thinking about this again, I think the really proper solution is rather this: diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index 437c3ea..2eb55ca 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -98,7 +98,7 @@ static const VMStateDescription vmstate_ipl =3D { =20 static uint64_t bios_translate_addr(void *opaque, uint64_t srcaddr) { - uint64_t dstaddr =3D (uint64_t)opaque; + uint64_t dstaddr =3D *(uint64_t*)opaque; /* * Assuming that our s390-ccw.img was linked for starting at address 0, * we can simply add the destination address for the final location @@ -132,7 +132,7 @@ static int s390_ipl_init(SysBusDevice *dev) } =20 bios_size =3D load_elf(bios_filename, bios_translate_addr, - (void *)fwbase, &ipl->bios_start_addr, + &fwbase, &ipl->bios_start_addr, NULL, NULL, 1, ELF_MACHINE, 0); =20 if (bios_size > 0) { Instead of passing the uint64 value in the pointer, let's rather pass a pointer to that value instead. Then we can also be sure to get the full 64-bit value in bios_translate_addr(). Thomas