From patchwork Thu Mar 17 01:16:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Rzeszutek Wilk X-Patchwork-Id: 8606461 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C79369F294 for ; Thu, 17 Mar 2016 01:19:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E617B20279 for ; Thu, 17 Mar 2016 01:19:36 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E61CB2026C for ; Thu, 17 Mar 2016 01:19:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1agMYN-0005uP-JA; Thu, 17 Mar 2016 01:16:43 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1agMYM-0005uJ-9S for xen-devel@lists.xenproject.org; Thu, 17 Mar 2016 01:16:42 +0000 Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id 76/34-16378-9750AE65; Thu, 17 Mar 2016 01:16:41 +0000 X-Env-Sender: ketuzsezr@gmail.com X-Msg-Ref: server-12.tower-206.messagelabs.com!1458177400!29599375!1 X-Originating-IP: [209.85.220.195] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 34107 invoked from network); 17 Mar 2016 01:16:40 -0000 Received: from mail-qk0-f195.google.com (HELO mail-qk0-f195.google.com) (209.85.220.195) by server-12.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 17 Mar 2016 01:16:40 -0000 Received: by mail-qk0-f195.google.com with SMTP id s5so2026058qkd.2 for ; Wed, 16 Mar 2016 18:16:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=69ERbIXTIXp0ZG7WYj37rSCw1exQRKinzizOdNSSHWQ=; b=IAU3CLZobJZIT0LUSu+yv4c9yqbFkrz+22IP77Ow9aCZwG0WahfTRn+4iSeG/gIc9B ERzAN9EtqWt0pd9XX/jTDkqGpAJOyZbcLVCjf5NamgWqjoDomVGCEY4JZoDfHSul2zaK sjh64L03Cx02DSxfWS7V6loZUCiejYwrC8YUtlR9x5RTd/yaN7GHGRyR2KfF1/jPcyw5 OnRDfeAHFjinvVVh2iEi67ptycv9q5qyPpAbjZgK0/jiaN64F1rvo2zgGCU5ESne+Ha/ quiwSUDTd1XKe4JuN0NK6KJig6knLWnlOKdLquu7iB92bca6LssudAyc/ORmLKcjOMrS 4ZYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=69ERbIXTIXp0ZG7WYj37rSCw1exQRKinzizOdNSSHWQ=; b=Gy+Lvri98r3AaQlc/GETcmfeTscBs6Qe/zMYEoKCM6hV0bhl5HwLNDyejVtsZCvP9i LOCRZpX+ABEwMxVUdODVtVzXay2QAbrZ595Kj0rsB2Mtt/9tnBN99igVfTK3W/lph7gQ vUOLLtc7DBrFKJWjMJE7LGFn8yFvpCChT0zJ/l5FsfboeYHnVXlWDQD3/yfCJbzse6wp pFdwk/LuI4hdfCCkXWgBEwYNddJVVe7u5XLfpdxenkfUJhRkqu7iVHYpt3d5ox72/otn qWbg3oqs2E0EtnQAtOi1u85lGkgTeo7tjGyIJC2k9T3cAEys+L99tenLj17n2mpnWLq9 yQ7Q== X-Gm-Message-State: AD7BkJKc/SAL1+ZTuL79deVPrcSgFrt4Jzq82WPT/+4pXtDONms/h9QezE46D5KHs1fYAg== X-Received: by 10.55.201.81 with SMTP id q78mr10451170qki.98.1458177399739; Wed, 16 Mar 2016 18:16:39 -0700 (PDT) Received: from localhost.localdomain (209-6-196-81.c3-0.smr-ubr2.sbo-smr.ma.cable.rcn.com. [209.6.196.81]) by smtp.gmail.com with ESMTPSA id o128sm2736726qhb.34.2016.03.16.18.16.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Mar 2016 18:16:39 -0700 (PDT) Date: Wed, 16 Mar 2016 21:16:36 -0400 From: Konrad Rzeszutek Wilk To: Konrad Rzeszutek Wilk Message-ID: <20160317011635.GE5173@localhost.localdomain> References: <1455246507-5589-3-git-send-email-konrad.wilk@oracle.com> <20160212141753.GC6596@localhost.localdomain> <56BE027802000078000D1765@prv-mh.provo.novell.com> <20160212155642.GC28574@char.us.oracle.com> <56E99899.9010809@arm.com> <20160316175238.GD18336@char.us.oracle.com> <56E9A106.2010603@arm.com> <20160316192151.GA10835@char.us.oracle.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160316192151.GA10835@char.us.oracle.com> User-Agent: Mutt/1.5.24 (2015-08-30) Cc: wei.liu2@citrix.com, ian.campbell@citrix.com, Stefano Stabellini , ian.jackson@eu.citrix.com, Julien Grall , stefano.stabellini@citrix.com, Jan Beulich , xen-devel@lists.xenproject.org Subject: Re: [Xen-devel] [PATCH v3 2/5] arm/config: Declare ELFSIZE_[32|64] respectively. X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, Mar 16, 2016 at 03:21:51PM -0400, Konrad Rzeszutek Wilk wrote: > On Wed, Mar 16, 2016 at 06:08:06PM +0000, Julien Grall wrote: > > Hi Konrad > > > > On 16/03/2016 17:52, Konrad Rzeszutek Wilk wrote: > > >On Wed, Mar 16, 2016 at 05:32:09PM +0000, Julien Grall wrote: > > >>Sorry for the late answer on this patch. I noticed the problem while I was > > >>reviewing your xSplice patch series. > > >> > > >>On 12/02/2016 15:56, Konrad Rzeszutek Wilk wrote: > > >>> From 32a062c119091f2f3f6a4c540a8098e97c273dd2 Mon Sep 17 00:00:00 2001 > > >>>From: Konrad Rzeszutek Wilk > > >>>Date: Fri, 5 Feb 2016 10:44:45 -0500 > > >>>Subject: [PATCH] arm/config: Declare ELFSIZE_64. > > >>> > > >>>Otherwise any code that tries to use Elf_* macros would > > >>>require us to use Elf64_* types instead of the more > > >>>friendly Elf_ one. > > >>> > > >>>This is OK to do since 32-bit ARM uses LPAE mode. > > >> > > >>That's not true. Some of structures have a different layout based on the > > >>file class (i.e ELFSIZE in Xen). > > >> > > >>For 32-bit ARM, ELFCLASS32 (i.e 32-bit data types) will always be used. So > > >>we need to set ELFSIZE to 32. > > > > > >OK. Let me send out a patch to fix that. Thanks for the heads up! > > > > With this change, do you need to revise the answer to the question Jan > > raised in the design document about ARM32 and the ELF payload declaring the > > ELF only 64-bit syntax? > > Yes I will. Thank you for raising that as I completly forgot it! > > I think we can still keep the same structure and size. But instead of > using ELF types in the design (and in the code) I will swap them to > proper uintXX_t types. And here is the patch. The change for uintXX_t type worked out - same size and offset as on 64-bit. Thought I am tempted to add some more BUILD_BUG checks. From 7007f1a3fa3a77a725f529420c7aea0e8ebdc9fa Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Wed, 16 Mar 2016 16:08:25 -0400 Subject: [PATCH v4 01/35] arm/config: Declare ELFSIZE_[32|64] The commit bcfaea685d38c08e5eb90797512ab80f0bc69d0c "arm/config: Declare ELFSIZE_64" was not correct. For 32-bit ARM, ELFCLASS32 (i.e. 32-bit data types) will always be used so we need to set ELFSIZE to 32. Reported-by: Julien Grall Signed-off-by: Konrad Rzeszutek Wilk Acked-by: Julien Grall --- Cc: Stefano Stabellini Cc: Julien Grall -- --- xen/include/asm-arm/config.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h index 7ceb5c5..2d11b62 100644 --- a/xen/include/asm-arm/config.h +++ b/xen/include/asm-arm/config.h @@ -9,8 +9,10 @@ #if defined(CONFIG_ARM_64) # define LONG_BYTEORDER 3 +# define ELFSIZE 64 #else # define LONG_BYTEORDER 2 +# define ELFSIZE 32 #endif #define BYTES_PER_LONG (1 << LONG_BYTEORDER) @@ -20,9 +22,6 @@ /* xen_ulong_t is always 64 bits */ #define BITS_PER_XEN_ULONG 64 -/* And ELF files are also 64-bit. */ -#define ELFSIZE 64 - #define CONFIG_PAGING_ASSISTANCE 1 #define CONFIG_PAGING_LEVELS 3