Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5322460imm; Tue, 18 Sep 2018 07:47:41 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ6Tet4FLD8Ekcf5o+SgSfc+IqkXD5ViuoJRbdcgZ58eEWx2i1tDTn8N7n8WMB8Rp4KnvVA X-Received: by 2002:a17:902:b595:: with SMTP id a21-v6mr30014510pls.23.1537282061221; Tue, 18 Sep 2018 07:47:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537282061; cv=none; d=google.com; s=arc-20160816; b=gnUTldSSiVWr1y2q1/aB01XQ0Yh9T2MorWGDYxDSVCW8wUpMP/DFyOtbF46N0Kb8ZT EDLuRnufg+zo6rtAQeCvlNgmIfdsrYJdwm1PuzYhSIorKlP8Gt1XOLdg8E8JN//LIHc+ 10mY8eQRHT8cVevcixIyCw4rkd9AQRzApNjNtYxdaoIbCfxQfFwMr9tiM5eQc7RvCkF3 WmXQKHrg/dfLCXhnI1xs+X+nWDI4dIUrqKEosF6nPFQ5K5pWDzJ8YFLMgt7dk0zEhMen 4+s5rXNOBnSPU3h9S5Can0sv2sXB30cGd/8bVqaVRw32S/FPTsai7BNZSIjYaqobjnGZ Lz/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:subject:cc:to:from:date:message-id :mime-version:dkim-signature; bh=JJ9oRzm3p75bA1zb7y6gGPfXcxkB66BT/pPAdPc9118=; b=dEUkp+XMy9ZbHiIGQoxZw0Lux6JFNsKKHyhEyfddnkyPkEGORa0JxN2duH5v52vRF3 be1jUFsb39CxiRdMOHVHNLQp//j3ILr2riEVoynrqG9NbEJGBmI6v4SlCAWK8e7lJ8Nf JctDndWIZR70RMEamg2Ficu4IhkCdDZdS3v8fbb4W0oEcCoUyMqK1SyAk/mHLbJU20yq Dsn53Bl1GhHbdBx4VXOxt3JFLNA/68XtT5FzIhETSC74Doopc6Gc+oOxSnDJvdKHjLXL /vsB75bUWSdlssh6wHdRQ6nDZoEqZ8ClaaShVM0NWQMdePwfAUMJ4/bawfg53SSWxbgY JqZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=r0+MPGou; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c12-v6si19709927pfk.145.2018.09.18.07.47.24; Tue, 18 Sep 2018 07:47:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=r0+MPGou; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729877AbeIRUSP (ORCPT + 99 others); Tue, 18 Sep 2018 16:18:15 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:36254 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727348AbeIRUSP (ORCPT ); Tue, 18 Sep 2018 16:18:15 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w8IEikxl140102; Tue, 18 Sep 2018 14:45:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : to : cc : subject : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=JJ9oRzm3p75bA1zb7y6gGPfXcxkB66BT/pPAdPc9118=; b=r0+MPGoudwA3HT6xTuweWktV1w/wH0x/HspcDtcFIRC/MVlrG/HxmAeHzjE/e3JxNEOj 0kh32SEgSMaXs4jkxRybFKirOLy44G3p8xY7lt5icoIThM0f6tIJj/KjLjsGi5K9C2n3 vWygEj9NCiKzBhi6+gqGuKlZH3Lp8i5u/HRs69+i4p+3kl9fmKT9BlEVbxlGiPSPPv2K sM/hl9E9lyqzNJ5whYDwjtO5zvXzFM6ekfbefyYoD/mAX90R6hwhQR6WHmK5BowgXfai 5iho+m0HPrJ4QerZpGxx9wxyX2FHKFlKGBzH0qx+WufrCaV7HxzHLkYEwWhs0oCWYgdK ow== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2mgsgtn1r1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Sep 2018 14:45:03 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w8IEj27r016466 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Sep 2018 14:45:02 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w8IEj15Y022171; Tue, 18 Sep 2018 14:45:01 GMT MIME-Version: 1.0 Message-ID: Date: Tue, 18 Sep 2018 07:45:00 -0700 (PDT) From: Zhenzhong Duan To: Cc: , , , , , , , , Subject: [PATCH v2] x86/speculation: Add RETPOLINE_AMD support to the inline-asm CALL_NOSPEC X-Mailer: Zimbra on Oracle Beehive Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9019 signatures=668708 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=831 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809180148 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ..so that they match the asm CALL_NOSPEC. Add the missing ANNOTATE_NOSPEC_ALTERNATIVE in CALL_NOSPEC. Signed-off-by: Zhenzhong Duan --- arch/x86/include/asm/nospec-branch.h | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/no= spec-branch.h index b5b6f8c..b0e80e0 100644 --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -170,11 +170,15 @@ */ # define CALL_NOSPEC=09=09=09=09=09=09\ =09ANNOTATE_NOSPEC_ALTERNATIVE=09=09=09=09\ -=09ALTERNATIVE(=09=09=09=09=09=09\ +=09ALTERNATIVE_2(=09=09=09=09=09=09\ =09ANNOTATE_RETPOLINE_SAFE=09=09=09=09=09\ =09"call *%[thunk_target]\n",=09=09=09=09\ =09"call __x86_indirect_thunk_%V[thunk_target]\n",=09=09\ -=09X86_FEATURE_RETPOLINE) +=09X86_FEATURE_RETPOLINE,=09=09=09=09=09\ +=09"lfence;\n"=09=09=09=09=09=09\ +=09ANNOTATE_RETPOLINE_SAFE=09=09=09=09=09\ +=09"call *%[thunk_target]\n",=09=09=09=09\ +=09X86_FEATURE_RETPOLINE_AMD) # define THUNK_TARGET(addr) [thunk_target] "r" (addr) =20 #elif defined(CONFIG_X86_32) && defined(CONFIG_RETPOLINE) @@ -184,7 +188,8 @@ * here, anyway. */ # define CALL_NOSPEC=09=09=09=09=09=09\ -=09ALTERNATIVE(=09=09=09=09=09=09\ +=09ANNOTATE_NOSPEC_ALTERNATIVE=09=09=09=09\ +=09ALTERNATIVE_2(=09=09=09=09=09=09\ =09ANNOTATE_RETPOLINE_SAFE=09=09=09=09=09\ =09"call *%[thunk_target]\n",=09=09=09=09\ =09" jmp 904f;\n"=09=09=09=09=09\ @@ -199,7 +204,11 @@ =09" ret;\n"=09=09=09=09=09=09\ =09" .align 16\n"=09=09=09=09=09\ =09"904:=09call 901b;\n",=09=09=09=09\ -=09X86_FEATURE_RETPOLINE) +=09X86_FEATURE_RETPOLINE,=09=09=09=09=09\ +=09"lfence;\n"=09=09=09=09=09=09\ +=09ANNOTATE_RETPOLINE_SAFE=09=09=09=09=09\ +=09"call *%[thunk_target]\n",=09=09=09=09\ +=09X86_FEATURE_RETPOLINE_AMD) =20 # define THUNK_TARGET(addr) [thunk_target] "rm" (addr) #else /* No retpoline for C / inline asm */ --=20 1.7.3