From patchwork Tue Jun 13 16:13:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 105401 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp486537qgd; Tue, 13 Jun 2017 09:15:37 -0700 (PDT) X-Received: by 10.157.3.45 with SMTP id 42mr602340otv.234.1497370537528; Tue, 13 Jun 2017 09:15:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497370537; cv=none; d=google.com; s=arc-20160816; b=x2Ex9Ej4zZOdjoru7T4Wqhodxt8Q3cerSThMeC0H0hdtZt1AoRTERC3T3ko3Wfpvir FvgBtfKHk+N3ebbdu+Oo6B2JeGV8jRfOX5s+oc+p1SHauaLtYM26UV2oknRGqxGIW1h7 i2aeBAMnXLo/xoZ0fHsQZqjKRvEtGOCPoVY9aarKrSh5njqbgUJDGaqYhZb+qktwneTO xCm/dwVw1cLzm8eq3uhKFBK5jy2Z9M3Zw+wbu6MJ/1T5Nzrk+ACp6/Ry51nr+YQeY1Vt KSktlr7pId/MAfIawbFRPXFC2BZA03MoEPdq00Mk3fEqZwdagjLeDsgoTOdG/t3uhP2e If6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:arc-authentication-results; bh=9r2W1JENXXOJJe+VnpKmPJd0ugntQitMPv+EIYQGkRk=; b=BYMJxM8s4mEDlqDLnaCxK8Ade4hqA7CabqNq2tXyrCzdNwWl6bSq6yVHQobkcPP+rJ fiWsGNkp9m20R/CXSoYKFQCnYWXk3hyit9LkKcryN0LawYiQBaNDVPIbHh5xsPiFeZFI RpFWAN39CCIUmveJBmoTsFBHcND98jaDnLoWnXsqrsCFV92ZjuXC0uWTaz1fSxVZWH0g oV79fAcBTjn067sysrw/Ddq4yfewJb2/w66S9bhDJWA3W9fgrXx4lwzDHs3xr3pUFZJm DECIfkSxMP7NXeiBWts79Bwpz1HLV3c+bmm07vr/dZ4EZmY2pw6LtEU8WjgYPaZfIEfl DmAA== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id o33si337123oto.103.2017.06.13.09.15.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jun 2017 09:15:37 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKoRk-00080K-22; Tue, 13 Jun 2017 16:13:36 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKoRj-0007zw-1t for xen-devel@lists.xen.org; Tue, 13 Jun 2017 16:13:35 +0000 Received: from [193.109.254.147] by server-7.bemta-6.messagelabs.com id 7B/88-03620-E2F00495; Tue, 13 Jun 2017 16:13:34 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOLMWRWlGSWpSXmKPExsVysyfVTVeX3yH S4EaPicWSj4tZHBg9ju7+zRTAGMWamZeUX5HAmrFp007mgrM8FbcXLmJuYDzK1cXIxSEksJlR omXiCnYI5zSjxKY33axdjJwcbAKaEnc+f2ICsUUEpCWufb7MCFLELPCKSeLIw36whLCAn8Tfr ecYQWwWAVWJzqsdYM28ApYSF868AotLCMhL7Gq7CBbnFLCSuPS8CSwuBFTTvHs90wRG7gWMDK sY1YtTi8pSi3TN9ZKKMtMzSnITM3N0DQ3M9HJTi4sT01NzEpOK9ZLzczcxAj3MAAQ7GGde9j/ EKMnBpCTKu+WKTaQQX1J+SmVGYnFGfFFpTmrxIUYZDg4lCV57PodIIcGi1PTUirTMHGCowaQl OHiURHjvswCleYsLEnOLM9MhUqcYFaXEeSeA9AmAJDJK8+DaYOF9iVFWSpiXEegQIZ6C1KLcz BJU+VeM4hyMSsK8LTxAU3gy80rgpr8CWswEtPg6yM28xSWJCCmpBsY6KfHE80GSZ6x3SE7/Ma UrdWvPV8cOA5H8/M/zfVzYmsJzUneE9AvqPXYKWTRp9VbtFV8nTlrmpZh/yPmmz7IowXCnmsc XRDxPZh912f5VI+Il348Dh2rtGDRP3Tmilr84siNjcXHc342C0y7GlEy1ke9d6+IvsHpdmoWy UPLUH33PmUxW71FiKc5INNRiLipOBAAxL3bBagIAAA== X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-2.tower-27.messagelabs.com!1497370413!47935409!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 38736 invoked from network); 13 Jun 2017 16:13:33 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-2.tower-27.messagelabs.com with SMTP; 13 Jun 2017 16:13:33 -0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F351315A2; Tue, 13 Jun 2017 09:13:32 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 39A3B3F557; Tue, 13 Jun 2017 09:13:31 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Tue, 13 Jun 2017 17:13:00 +0100 Message-Id: <20170613161323.25196-2-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170613161323.25196-1-julien.grall@arm.com> References: <20170613161323.25196-1-julien.grall@arm.com> Cc: sstabellini@kernel.org, Wei Liu , George Dunlap , Andrew Cooper , punit.agrawal@arm.com, Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich Subject: [Xen-devel] [PATCH 01/24] xen/mm: Don't use _{g, m}fn for defining INVALID_{G, M}FN 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" INVALID_{G,M}FN are defined using static inline helpers _{g,m}fn. This means, they cannot be used to initialize a build time static variable: In file included from mm.c:24:0: xen/xen/include/xen/mm.h:59:26: error: initializer element is not constant #define INVALID_MFN _mfn(~0UL) Signed-off-by: Julien Grall Acked-by: Tim Deegan --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Jan Beulich Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini Cc: Tim Deegan Cc: Wei Liu I know that this solution will not work for non-debug build. I would like input from the community on way to fix it nicely. --- xen/include/xen/mm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index ee50d4cd7b..f0daae6b5c 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -56,7 +56,7 @@ TYPE_SAFE(unsigned long, mfn); #define PRI_mfn "05lx" -#define INVALID_MFN _mfn(~0UL) +#define INVALID_MFN (mfn_t){ ~0UL } #ifndef mfn_t #define mfn_t /* Grep fodder: mfn_t, _mfn() and mfn_x() are defined above */ @@ -85,7 +85,7 @@ static inline bool_t mfn_eq(mfn_t x, mfn_t y) TYPE_SAFE(unsigned long, gfn); #define PRI_gfn "05lx" -#define INVALID_GFN _gfn(~0UL) +#define INVALID_GFN (gfn_t){ ~0UL } #ifndef gfn_t #define gfn_t /* Grep fodder: gfn_t, _gfn() and gfn_x() are defined above */