From nobody Tue Nov 11 05:43:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1569871059; cv=none; d=zoho.com; s=zohoarc; b=iEZTZ0YLxnL9blONP0cYECtqdDktKv2VFAaiyx0f49Vo29ZwsfosjptGWlxeYqmE2KPz15q4xp9qSby26UC9wWeymyRVWcn8orgo6lqwkjqQnZcmW/zIqCwL5ZqK0qSHb8xUs+EXs/zAPP1fKdOab2zT9kZ17jQm9to7//et46Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569871059; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=1wHyz0/sEcFubizAykVbWSOApiOpSLRXMiEyc/v2WIc=; b=DcL/DTVuHSxuuxd5UHMB64+xDdO/QzB9N2GK0JG8d5RffAjx+fwcQdCXcCVIocDUB6sSqIHj+B9AXiCNYVNOktmsV92eXd2EvSOXdUudUfmfeiJ6peZ4ONwmeGNI+CfaOICkK8XWZz3syENv5IcMdChAzlLVX7Xyf498SGl16t0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1569871059732752.2917316675943; Mon, 30 Sep 2019 12:17:39 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iF19d-0004zh-4e; Mon, 30 Sep 2019 19:16:17 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iF19b-0004zc-VE for xen-devel@lists.xenproject.org; Mon, 30 Sep 2019 19:16:15 +0000 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by localhost (Halon) with ESMTPS id c546a4d8-e3b6-11e9-bf31-bc764e2007e4; Mon, 30 Sep 2019 19:16:14 +0000 (UTC) X-Inumbo-ID: c546a4d8-e3b6-11e9-bf31-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1569870974; h=from:to:cc:subject:date:message-id:mime-version; bh=kT5v3qDwEDFIK1RRLCLUYHKPs1WhmHSG4FkUXw03/lc=; b=ExveGWeMz7sgV27yM5VIHkTITip09Hkm8PPJ9em4z+zOfYpZLis2vGGZ HsNJ17Rpb9k0UdDbW/mjm6Ypthg6cZJFsshCvkahksdn+/Eu6eR37Y4qo IKPcRrcOlC9Lr0FKSZbOzcZAH/n34EBb5wqK55YgHziotrino2gNzsM5V Q=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: MMbKhWUDOiDVTA1uXK2Pv0AOdgvGEhMmArHmap58hex2+IPpR+aBJPwFcGIPhmsP1Nu7om3vqA YpYVhgnigwvuGqeJep7w+ql5+xvKXYAdWryAUqUIUfljwTRKXmuypk5QjKbHba0izbVXDjEE4h qWcvB/kYFm3bCN+pmMHNB2wd8qOereHUJbRAy+ISbqHZUar80BTMF9vc4Rj0uTd8pBeqvWXZYo iwW9Mz/Of8muE0CPhWzOBvW+NtD43SWKJp8EWuQBukp5I6LX3ZkMI+jVlTIBUwFi8nBSs9zwij Fgg= X-SBRS: 2.7 X-MesageID: 6513078 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,568,1559534400"; d="scan'208";a="6513078" From: Andrew Cooper To: Xen-devel Date: Mon, 30 Sep 2019 20:16:10 +0100 Message-ID: <20190930191610.27545-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] xen/typesafe: Force helpers to be always_inline X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Tim Deegan , Jan Beulich , Ian Jackson Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Clang in particular has a habit of out-of-lining these and creating multiple local copies of _mfn() and mfn_x(), etc. Override this behaviour. Adjust bool_t to bool for the *_eq() helpers. Signed-off-by: Andrew Cooper --- CC: George Dunlap CC: Ian Jackson CC: Jan Beulich CC: Konrad Rzeszutek Wilk CC: Stefano Stabellini CC: Tim Deegan CC: Wei Liu CC: Julien Grall CC: Juergen Gross Spotted while looking at the code generation of evalute_nospec() Semi-RFC for-4.13. Nothing (currently un-broken) will break without this, = but it is a step on the way to being able to use Clang and Livepatch in combination. --- xen/include/xen/iommu.h | 4 ++-- xen/include/xen/mm.h | 16 ++++++++-------- xen/include/xen/typesafe.h | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h index 974bd3ffe8..c77b8c1a22 100644 --- a/xen/include/xen/iommu.h +++ b/xen/include/xen/iommu.h @@ -42,12 +42,12 @@ TYPE_SAFE(uint64_t, dfn); #undef dfn_x #endif =20 -static inline dfn_t dfn_add(dfn_t dfn, unsigned long i) +static always_inline dfn_t dfn_add(dfn_t dfn, unsigned long i) { return _dfn(dfn_x(dfn) + i); } =20 -static inline bool_t dfn_eq(dfn_t x, dfn_t y) +static always_inline bool dfn_eq(dfn_t x, dfn_t y) { return dfn_x(x) =3D=3D dfn_x(y); } diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index 8d0ddfb60c..5617ecc607 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -77,22 +77,22 @@ TYPE_SAFE(unsigned long, mfn); #undef mfn_x #endif =20 -static inline mfn_t mfn_add(mfn_t mfn, unsigned long i) +static always_inline mfn_t mfn_add(mfn_t mfn, unsigned long i) { return _mfn(mfn_x(mfn) + i); } =20 -static inline mfn_t mfn_max(mfn_t x, mfn_t y) +static always_inline mfn_t mfn_max(mfn_t x, mfn_t y) { return _mfn(max(mfn_x(x), mfn_x(y))); } =20 -static inline mfn_t mfn_min(mfn_t x, mfn_t y) +static always_inline mfn_t mfn_min(mfn_t x, mfn_t y) { return _mfn(min(mfn_x(x), mfn_x(y))); } =20 -static inline bool_t mfn_eq(mfn_t x, mfn_t y) +static always_inline bool mfn_eq(mfn_t x, mfn_t y) { return mfn_x(x) =3D=3D mfn_x(y); } @@ -115,22 +115,22 @@ TYPE_SAFE(unsigned long, gfn); #undef gfn_x #endif =20 -static inline gfn_t gfn_add(gfn_t gfn, unsigned long i) +static always_inline gfn_t gfn_add(gfn_t gfn, unsigned long i) { return _gfn(gfn_x(gfn) + i); } =20 -static inline gfn_t gfn_max(gfn_t x, gfn_t y) +static always_inline gfn_t gfn_max(gfn_t x, gfn_t y) { return _gfn(max(gfn_x(x), gfn_x(y))); } =20 -static inline gfn_t gfn_min(gfn_t x, gfn_t y) +static always_inline gfn_t gfn_min(gfn_t x, gfn_t y) { return _gfn(min(gfn_x(x), gfn_x(y))); } =20 -static inline bool_t gfn_eq(gfn_t x, gfn_t y) +static always_inline bool gfn_eq(gfn_t x, gfn_t y) { return gfn_x(x) =3D=3D gfn_x(y); } diff --git a/xen/include/xen/typesafe.h b/xen/include/xen/typesafe.h index 7ecd3b4a8d..f242500063 100644 --- a/xen/include/xen/typesafe.h +++ b/xen/include/xen/typesafe.h @@ -21,15 +21,15 @@ =20 #define TYPE_SAFE(_type, _name) \ typedef struct { _type _name; } _name##_t; \ - static inline _name##_t _##_name(_type n) { return (_name##_t) { n }; = } \ - static inline _type _name##_x(_name##_t n) { return n._name; } + static always_inline _name##_t _##_name(_type n) { return (_name##_t) = { n }; } \ + static always_inline _type _name##_x(_name##_t n) { return n._name; } =20 #else =20 #define TYPE_SAFE(_type, _name) \ typedef _type _name##_t; \ - static inline _name##_t _##_name(_type n) { return n; } \ - static inline _type _name##_x(_name##_t n) { return n; } + static always_inline _name##_t _##_name(_type n) { return n; } \ + static always_inline _type _name##_x(_name##_t n) { return n; } =20 #endif =20 --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel