From nobody Sun May 5 07:20:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=1559146488; cv=none; d=zoho.com; s=zohoarc; b=JKDfyOVQHiFwzbJwGhfVIL/vOS6sj+rmopxkAauJ4l18aoOJzV6Qz0RCP+K4JaHrehKdlIj8w06IRslBGN3fhcpN0uhqjvfcAGHNtGjwa56McQtIuJRvzP8BLA9fdVpDjJgHpbFQF/AGkzECRYbvdFWwKCaOvlo9LAIkvH9CohE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559146488; 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=wipko84uqzigmhE1N/XcNZr+E7phuQZXL9xriMlMfag=; b=L8gYEMMQ1NlPdZFuR8cO8qqRCme6RcJXPTVPKdnWotx1kUFkagcawZD3+Z/wFGA+/2s2gPrfboAyqOKw3fRsaCPKjngyHP09v7a8A6ydyVJ57kp6sqC1wjWu3FVE00vjHJfh7osRkwFyv0+/J5Rnjh9SpBt1iqndjQRQJluvff0= ARC-Authentication-Results: i=1; mx.zoho.com; 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 1559146487500876.3928199022681; Wed, 29 May 2019 09:14:47 -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 1hW1Cj-0001RF-2a; Wed, 29 May 2019 16:13:29 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hW1Ci-0001RA-Cm for xen-devel@lists.xenproject.org; Wed, 29 May 2019 16:13:28 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id afe0608e-822c-11e9-94c3-77256efa1056; Wed, 29 May 2019 16:13:25 +0000 (UTC) X-Inumbo-ID: afe0608e-822c-11e9-94c3-77256efa1056 Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=Pass smtp.mailfrom=roger.pau@citrix.com; spf=None smtp.helo=postmaster@MIAPEX02MSOL01.citrite.net 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 (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of roger.pau@citrix.com) identity=pra; client-ip=23.29.105.83; receiver=esa2.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of roger.pau@citrix.com designates 23.29.105.83 as permitted sender) identity=mailfrom; client-ip=23.29.105.83; receiver=esa2.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@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:23.29.105.83 ip4:162.221.156.50 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@MIAPEX02MSOL01.citrite.net) identity=helo; client-ip=23.29.105.83; receiver=esa2.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@MIAPEX02MSOL01.citrite.net"; x-conformance=sidf_compatible IronPort-SDR: 6Xc7tMvKslAXbV6TTGzFoAEfGfxRzmuDEC00fyJnjsBjzP0VBE/kswpU3RaKSXGexFobWX+pIP S7BFbTD1hzR8oLzOO1ZqfFr9K+lbMlQyMvlIVjcav5Yux9R91SOLNiGPlE5h3WWLJdMdZtrJEh /QEI+Faz6kye0xiHhKWvqzluzaznSZBdCOBqJZpFMifdbl6rfceOIqRtsu7fPJz7FJnrDM2ckP 70eUAeZ56s3U4PD4ZCGx0mAvxAVxEJxa48wQ71ZOK2yRVgmBBxlizyOSD/mc7AakwU9xqpuFLu 8/4= X-SBRS: 2.7 X-MesageID: 1056626 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 23.29.105.83 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.60,527,1549947600"; d="scan'208";a="1056626" From: Roger Pau Monne To: Date: Wed, 29 May 2019 18:13:19 +0200 Message-ID: <20190529161319.51794-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3] x86: remove alternative_callN usage of ALTERNATIVE asm macro 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: Andrew Cooper , Wei Liu , Jan Beulich , Roger Pau Monne Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" There is a bug in llvm that needs to be fixed before switching to use the alternative assembly macros in inline assembly call sites. Therefore alternative_callN using inline assembly to generate the alternative patch sites should be using the ALTERNATIVE C preprocessor macro rather than the ALTERNATIVE assembly macro. Using the assembly macro in an inline assembly instance triggers the following bug on llvm based toolchains: :1:1: error: invalid symbol redefinition .L0_orig_s: call *genapic+64(%rip); .L0_orig_e: .L0_diff =3D (.L0_repl_e1 -= .L0_repl_s1) - (... ^ :1:37: error: invalid symbol redefinition .L0_orig_s: call *genapic+64(%rip); .L0_orig_e: .L0_diff =3D (.L0_repl_e1 -= .L0_repl_s1) - (... ^ :1:60: error: invalid reassignment of non-absolute variable = '.L0_diff' .L0_orig_s: call *genapic+64(%rip); .L0_orig_e: .L0_diff =3D (.L0_repl_e1 -= .L0_repl_s1) - (... ^ :1:2: note: while in macro instantiation ALTERNATIVE "call *genapic+64(%rip)", "call .", X86_FEATURE_LM ^ :1:156: error: invalid symbol redefinition ...- (.L0_orig_e - .L0_orig_s); mknops ((-(.L0_diff > 0)) * .L0_diff); .L= 0_orig_p: ^ :18:5: error: invalid symbol redefinition .L0_repl_s1: call .; .L0_repl_e1: ^ :18:26: error: invalid symbol redefinition .L0_repl_s1: call .; .L0_repl_e1: ^ :1:1: error: invalid symbol redefinition .L0_orig_s: call *genapic+64(%rip); .L0_orig_e: .L0_diff =3D (.L0_repl_e1 -= .L0_repl_s1) - (... ^ :1:37: error: invalid symbol redefinition .L0_orig_s: call *genapic+64(%rip); .L0_orig_e: .L0_diff =3D (.L0_repl_e1 -= .L0_repl_s1) - (... ^ :1:60: error: invalid reassignment of non-absolute variable = '.L0_diff' .L0_orig_s: call *genapic+64(%rip); .L0_orig_e: .L0_diff =3D (.L0_repl_e1 -= .L0_repl_s1) - (... ^ :1:2: note: while in macro instantiation ALTERNATIVE "call *genapic+64(%rip)", "call .", X86_FEATURE_LM ^ :1:156: error: invalid symbol redefinition ...- (.L0_orig_e - .L0_orig_s); mknops ((-(.L0_diff > 0)) * .L0_diff); .L= 0_orig_p: ^ :18:5: error: invalid symbol redefinition .L0_repl_s1: call .; .L0_repl_e1: ^ :18:26: error: invalid symbol redefinition .L0_repl_s1: call .; .L0_repl_e1: ^ :1:1: error: invalid symbol redefinition .L0_orig_s: call *genapic+64(%rip); .L0_orig_e: .L0_diff =3D (.L0_repl_e1 -= .L0_repl_s1) - (... ^ :1:37: error: invalid symbol redefinition .L0_orig_s: call *genapic+64(%rip); .L0_orig_e: .L0_diff =3D (.L0_repl_e1 -= .L0_repl_s1) - (... ^ :1:60: error: invalid reassignment of non-absolute variable = '.L0_diff' .L0_orig_s: call *genapic+64(%rip); .L0_orig_e: .L0_diff =3D (.L0_repl_e1 -= .L0_repl_s1) - (... ^ :1:2: note: while in macro instantiation ALTERNATIVE "call *genapic+64(%rip)", "call .", X86_FEATURE_LM ^ :1:156: error: invalid symbol redefinition ...- (.L0_orig_e - .L0_orig_s); mknops ((-(.L0_diff > 0)) * .L0_diff); .L= 0_orig_p: ^ :18:5: error: invalid symbol redefinition .L0_repl_s1: call .; .L0_repl_e1: ^ :18:26: error: invalid symbol redefinition .L0_repl_s1: call .; .L0_repl_e1: ^ This has been reported to upstream llvm: https://bugs.llvm.org/show_bug.cgi?id=3D42034 Fixes: 67d01cdb5 ("x86: infrastructure to allow converting certain indirect= calls to direct ones") Signed-off-by: Roger Pau Monn=C3=A9 Acked-by: Jan Beulich --- Cc: Jan Beulich Cc: Andrew Cooper Cc: Wei Liu --- Changes since v2: - Further fixes to commit log. Changes since v1: - Fix subject and commit message. --- xen/include/asm-x86/alternative.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xen/include/asm-x86/alternative.h b/xen/include/asm-x86/altern= ative.h index 63d0a450ba..92e3581bc2 100644 --- a/xen/include/asm-x86/alternative.h +++ b/xen/include/asm-x86/alternative.h @@ -202,9 +202,8 @@ extern void alternative_branches(void); rettype ret_; \ register unsigned long r10_ asm("r10"); \ register unsigned long r11_ asm("r11"); \ - asm volatile (__stringify(ALTERNATIVE "call *%c[addr](%%rip)", \ - "call .", \ - X86_FEATURE_ALWAYS) \ + asm volatile (ALTERNATIVE("call *%c[addr](%%rip)", "call .", \ + X86_FEATURE_ALWAYS) \ : ALT_CALL ## n ## _OUT, "=3Da" (ret_), \ "=3Dr" (r10_), "=3Dr" (r11_) ASM_CALL_CONSTRAINT \ : [addr] "i" (&(func)), "g" (func) \ --=20 2.20.1 (Apple Git-117) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel