From nobody Mon Apr 29 10:37:39 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=1558543618; cv=none; d=zoho.com; s=zohoarc; b=naqXLrJGCGpwEB6wN6AKdHFLC9iobBvSSqQCs0OWarwIvcXf7NOxvDJv47LICBqpfWknqWRFGyGs6oBljz9SE5j+8n9buj39rBPqboleQokIeTew0VCSRFqAnfxgm4MpmuFVIcmCXF29Dc1+fGvmUHCHtyNWURZ2Ejj6Ab+Cw/0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558543618; 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=ZtSQGudkYl+O4XcKhsYzGbPWZKoSg0OzvjT4XbMspBI=; b=EfYPJSDHLwtGR5zB/sX73EQswUTFGIL6zT1M94lD/4QgWbsJCTFPqJqjbKCOkloibgbXowcOq1Md+2Q9hsfozD5hg16tFvRcZHS4gtxl+ZsHVDBmA2YKYmtSbSkIj2e45I5zFQxZ8I//CoWKm2qOPktk4wpzZbb6hViC1jpcLOs= 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 1558543618774872.641320890409; Wed, 22 May 2019 09:46:58 -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 1hTUNB-000812-CC; Wed, 22 May 2019 16:45:49 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hTUN9-00080t-GZ for xen-devel@lists.xenproject.org; Wed, 22 May 2019 16:45:47 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 0b9263e4-7cb1-11e9-8980-bc764e045a96; Wed, 22 May 2019 16:45:45 +0000 (UTC) X-Inumbo-ID: 0b9263e4-7cb1-11e9-8980-bc764e045a96 Authentication-Results: esa6.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 (esa6.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=esa6.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.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=esa6.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.83 ~all" Received-SPF: None (esa6.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=esa6.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@MIAPEX02MSOL01.citrite.net"; x-conformance=sidf_compatible IronPort-SDR: rxDJ3RqNoZBiXfV4A6GMA+oUgj/CFbGtNWLd8ezgRwZNRDoK24J+HD1uraOZbBoitvlZhgnpaq QpaAJddieRiO/h5g0QKiUrG9J8tWxumfHERTJsafUgPAk977w1m7mT7Whn8PFeXvZfjF15tR9e CbAg2jUnNwruii1BUbHL+AQOF/3XK5HGUPSpd88usMWC+ybxj5BUnwmPVXQQikASQkwLIahIaC a4RIMnNkRU8bbwn17WHv0C8n3Gt3GxI7fxSqW8V+yQ3i5+K+pFEWJ9tN5YZySZdThrSWn6EUcc HRI= X-SBRS: 2.7 X-MesageID: 762650 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 23.29.105.83 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.60,499,1549947600"; d="scan'208";a="762650" From: Roger Pau Monne To: Date: Wed, 22 May 2019 17:45:30 +0100 Message-ID: <20190522164530.33147-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2] x86: fix 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" 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, the more that using the assembly macro in an inline assembly instance causes the following error 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: ^ Fixes: 67d01cdb5 ("x86: infrastructure to allow converting certain indirect= calls to direct ones") Signed-off-by: Roger Pau Monn=C3=A9 --- Cc: Jan Beulich Cc: Andrew Cooper Cc: Wei Liu --- 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