Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3205148pxb; Sun, 26 Sep 2021 08:12:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXR7KH4+rr3EIBKO+V3iQ+lH4U65X+s/7tvirim7V7EcgrSXRQLgRgWHKVCy9oIW9oivBG X-Received: by 2002:a05:6402:42d5:: with SMTP id i21mr18030485edc.14.1632669128405; Sun, 26 Sep 2021 08:12:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632669128; cv=none; d=google.com; s=arc-20160816; b=VOLNWXbgaZNDMrBOKzWUmi9m3+6Uv02H+IgiuKqqj11o9Z4W4LfeP7NJ9OdlL+9730 HN9bkMOa0gtvVRUdF20j1LRIMI+S69P9tCElpP0NFOFeCWd+K9vBC0ZfxEW8gXt2wYOC eCRJeuRWYGQi7HLMpAbkYza6JsPlGaUugOs4iD169ztmS3Yyn8fEZeUEHEIaaORyvmQP k7sz2A+MbfTwsuYF2Pz6oPmhhTcPZFFoemwdDyGuB1/elT2nrWTFHtaWl0EdnoRUBxPV ZbKGyg2vaYzpDDbL3c6HX8PeBUogIYe5HqFgEmSKrx8/Y8mrsxuWUHNXBBokQZSTAF9b v8cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NOdWJCw3tVCAFZkNrIUjy/G15qNxwBzWh+jwkoZvbqY=; b=plc3/MPtDFi2DwDP3aS8uRhDJlwp8muW9Yn/QWzMgmMr/te2kqbAF9eA18Nyedjk8i C1HNAtbAESubjPsTgFJY7ugdhFxrJOFDPtVNNpSv8lcH4o6SaPKYcTee55Mu5gzmlsnf e8hrbgHCpYaxBSKRFblUCu0of1tHYUjSnebtf8v+WerCcfOAdjxmAvxQpatTFzZsggq7 oc4XSWGG7B1UZT0NzRYsA1ufY0EQcYrHrjYwasQGmOPZd0XirmdBXZqG329KjNwXYT2z WmNLFVN1CsM05B4Njk1o7Qew/n8A8UggguqcEhr1Pn29HNAvGlkoWNJPLT5Xax3cBK47 yQ7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=T6Mgdu6N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e10si20147743edj.222.2021.09.26.08.11.44; Sun, 26 Sep 2021 08:12:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=T6Mgdu6N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232031AbhIZPL0 (ORCPT + 99 others); Sun, 26 Sep 2021 11:11:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232010AbhIZPLS (ORCPT ); Sun, 26 Sep 2021 11:11:18 -0400 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36EF1C061570 for ; Sun, 26 Sep 2021 08:09:41 -0700 (PDT) Received: by mail-pg1-x52b.google.com with SMTP id s11so15242176pgr.11 for ; Sun, 26 Sep 2021 08:09:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NOdWJCw3tVCAFZkNrIUjy/G15qNxwBzWh+jwkoZvbqY=; b=T6Mgdu6NXsd6XBCofA5+QFKjeHQM11wV8G1IdfMBNttOmD2pyVjsZkoYxUH9fNNYZA FQ1SCk3wDOowM+mIQBo+C0oNRXeaJ+8nX7jLR0rj0CstFm8S9j72IPwQr3M77sdYY4// FAgHAWyWaBlEjUVnwR64ub6IoGXsPPh/+wf3JMquzA+X+zF5GJHruv+Pfs3s5BH2Z2HS h66W8tHScpN+8TkNB1+UoYiluHizKfqUbU07O4wcO2i3Ssrs4gzNrMjUwVy8sVnu5SLz 0msNHh9btHW5q77RbCwBv8Uzn1ihM+Ht0cxPWbG220iiojps3Nq+EWLdaL7oHM83UT8r TPIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NOdWJCw3tVCAFZkNrIUjy/G15qNxwBzWh+jwkoZvbqY=; b=zxW+HSsW1Xag/yvZlgYIo0wanUCH/tZ1iN62cdB+kMZNQLFvw6NpPaGngZ7izuJp7I hEQOMrmHNQ5/jG0KW9+sixtnUSuCMVU4VCIQ0gFH2ZIlKH77bfeUyrDknm7I6NJLm0Vv phHHd8VKIWDo85wNo1AQzkU9WrX9v8Ucxzjto+6fRQXiwdKCl6GkMrTxVvd2TyrM1was 96qjkRknLq34WxrCHJ6QQCSgEd64ujNufIBZaiawB2+80+pEWMBWOd82WBWxVBTtfp6g o5e01LC31vecOGKV3kBSgCF9zzFKUHNifXHkQxzmdIpbUwZCr30utHKuCoTYnzLR1YSo 4A2g== X-Gm-Message-State: AOAM531dlQm2Ml8TvHsBqnNuYLHVKrdcDDv3X42IMR4YYkfcA/cwnq2B k3sCuQctSQiStmoMAbjcySqwNwGrC5dHGw== X-Received: by 2002:a65:6251:: with SMTP id q17mr12816678pgv.416.1632668980583; Sun, 26 Sep 2021 08:09:40 -0700 (PDT) Received: from localhost ([47.88.60.64]) by smtp.gmail.com with ESMTPSA id c22sm13479077pja.10.2021.09.26.08.09.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Sep 2021 08:09:40 -0700 (PDT) From: Lai Jiangshan To: linux-kernel@vger.kernel.org Cc: Lai Jiangshan , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" Subject: [PATCH V2 09/41] x86/entry: Expose the address of .Lgs_change to entry64.c Date: Sun, 26 Sep 2021 23:08:06 +0800 Message-Id: <20210926150838.197719-10-jiangshanlai@gmail.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20210926150838.197719-1-jiangshanlai@gmail.com> References: <20210926150838.197719-1-jiangshanlai@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lai Jiangshan The address of .Lgs_change will be used in traps.c in later patch when some entry code is implemented in entry64.c. So the address of .Lgs_change is exposed to traps.c for preparation. The label .Lgs_change is still needed in ASM code for extable due to it can not use asm_load_gs_index_gs_change. Otherwise: warning: objtool: __ex_table+0x0: don't know how to handle non-section reloc symbol asm_load_gs_index_gs_change Signed-off-by: Lai Jiangshan --- arch/x86/entry/entry64.c | 2 ++ arch/x86/entry/entry_64.S | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/entry/entry64.c b/arch/x86/entry/entry64.c index 3a6d70367940..7272266a3726 100644 --- a/arch/x86/entry/entry64.c +++ b/arch/x86/entry/entry64.c @@ -9,3 +9,5 @@ * is PTI user CR3 or both. */ #include + +extern unsigned char asm_load_gs_index_gs_change[]; diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index 95d85b16710b..291732f571a7 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -729,6 +729,7 @@ _ASM_NOKPROBE(common_interrupt_return) SYM_FUNC_START(asm_load_gs_index) FRAME_BEGIN swapgs +SYM_INNER_LABEL(asm_load_gs_index_gs_change, SYM_L_GLOBAL) .Lgs_change: movl %edi, %gs 2: ALTERNATIVE "", "mfence", X86_BUG_SWAPGS_FENCE @@ -1006,7 +1007,7 @@ SYM_CODE_START_LOCAL(error_entry) movl %ecx, %eax /* zero extend */ cmpq %rax, RIP+8(%rsp) je .Lbstep_iret - cmpq $.Lgs_change, RIP+8(%rsp) + cmpq $asm_load_gs_index_gs_change, RIP+8(%rsp) jne .Lerror_entry_done_lfence /* -- 2.19.1.6.gb485710b