From patchwork Tue May 1 19:48:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 156196 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0A25EB6FA5 for ; Wed, 2 May 2012 05:48:36 +1000 (EST) Received: from localhost ([::1]:47206 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPJ3p-0001Ab-Qm for incoming@patchwork.ozlabs.org; Tue, 01 May 2012 15:48:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPJ3i-0001AB-IO for qemu-devel@nongnu.org; Tue, 01 May 2012 15:48:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SPJ3g-0002ye-OC for qemu-devel@nongnu.org; Tue, 01 May 2012 15:48:26 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38122 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPJ3g-0002yS-F5; Tue, 01 May 2012 15:48:24 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 1384095267; Tue, 1 May 2012 21:48:23 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1257) From: Alexander Graf In-Reply-To: Date: Tue, 1 May 2012 21:48:21 +0200 Message-Id: <6AE2C3A0-C56C-43D9-86CB-9DB62087AD67@suse.de> References: <1335862740-17408-1-git-send-email-agraf@suse.de> <1335862740-17408-4-git-send-email-agraf@suse.de> <4FA02C3C.2080305@suse.de> To: Peter Maydell X-Mailer: Apple Mail (2.1257) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: blauwirbel@gmail.com, qemu-ppc@nongnu.org, =?iso-8859-1?Q?Andreas_F=E4rber?= , qemu-devel Developers Subject: Re: [Qemu-devel] [PATCH 3/8] linux-user: Fix undefined HOST_LONG_SIZE on PPC hosts X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On 01.05.2012, at 21:11, Peter Maydell wrote: > On 1 May 2012 19:54, Alexander Graf wrote: >> >> On 01.05.2012, at 20:32, Andreas Färber wrote: >> >>> Am 01.05.2012 10:58, schrieb Alexander Graf: >>>> On my PPC host, HOST_LONG_SIZE is not defined even after >>>> running configure. Use the normal C way of determining the >>>> long size instead. >>>> >>>> Signed-off-by: Alexander Graf >>>> --- >>>> thunk.h | 2 +- >>>> 1 files changed, 1 insertions(+), 1 deletions(-) >>>> >>>> diff --git a/thunk.h b/thunk.h >>>> index 5be8f91..87025c3 100644 >>>> --- a/thunk.h >>>> +++ b/thunk.h >>>> @@ -113,7 +113,7 @@ static inline int thunk_type_size(const argtype *type_ptr, int is_host) >>>> defined(HOST_PARISC) || defined(HOST_SPARC64) >>>> return 4; >>>> #elif defined(HOST_PPC) >>>> - return HOST_LONG_SIZE; >>>> + return sizeof(void *); >>> >>> malc has committed a different fix (TARGET_ABI_BITS / 8) - thanks for >>> fixing the build - but this PULL will now conflict. >> >> :(. >> >> Removed from my queue. > > We need to put out a patch which converts commit b754e4fc1 to > the fix as reviewed on the mailing list, because b754e4fc1 is > incorrect: it is returning the size of a target type when it > should be returning the size of a host type. Yes, you're right. Added the below patch onto the queue. Sending a new pull request now. Alex From ddf1ddcf65866e2dd8e5d515bc636617fb2e15ee Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Mon, 30 Apr 2012 22:58:55 +0000 Subject: [PATCH 8/8] linux-user: Fix invalid TARGET_ABI_BITS usage on ppc hosts When trying to evaluate the size of the _host_ type size for olddev_t, we need to expose the host's pointer size, not the guest pointer size. This usage got introduced accidently in commit b754e4fc1. Fix things by not using TARGET_.*, but rather use host sizeof() information, which gives us the correct size. Reported-by: Peter Maydell Signed-off-by: Alexander Graf --- thunk.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/thunk.h b/thunk.h index c295766..87025c3 100644 --- a/thunk.h +++ b/thunk.h @@ -113,7 +113,7 @@ static inline int thunk_type_size(const argtype *type_ptr, int is_host) defined(HOST_PARISC) || defined(HOST_SPARC64) return 4; #elif defined(HOST_PPC) - return TARGET_ABI_BITS / 8; + return sizeof(void *); #else return 2; #endif