Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1564054pxb; Tue, 26 Oct 2021 11:19:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCvYwLrRMNEmrIYF6azedFV39oJCfNrNQi6gCQ+YGsL7AMetpDoxXTnNAulLDgpCp0ASXY X-Received: by 2002:a05:6a00:1a16:b0:47c:11bb:f833 with SMTP id g22-20020a056a001a1600b0047c11bbf833mr5371758pfv.2.1635272380826; Tue, 26 Oct 2021 11:19:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635272380; cv=none; d=google.com; s=arc-20160816; b=jzREXsvof0gwqlmsRNBuJxo4ZCaU/EQwcejRDEzEwSsLggFhps7m2XlC8k51yxpWfe xkFRNziTnv8KTleeJBxJLbUNhRiozSqcnYlNGt0e9kDF/sbat9n0LnnLSSy3Jk36K2ml 3Z0Hd/PtfGizvaxg1G0yd2Toslhxu+bmDJfAdlsVKsSpaT2h06zklufUnKOnHRRHHp4B uTC4FGZ7ZGnNSNeS19DFuqFbAQoIwX0P4xIvnfUxzvP7dkPdpzxuftPXlcJpzZI3BAX/ PVpy9iLFUzgWjdUxYpyiEDZvEI0jE5lv9/jOc63SE6YElMYgZxUSRCzVVR/gpKZzbJzp 3eog== 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=SLvPDSjlXuC0odmXJ7mp0PxXfMTmsQLadPLQAXM53SE=; b=pMW0jD+DPKWl2NbQkfb82N/MWCJSeuaOdek3p7L7OxNabR14HFdjFxQtZWIAZs7PFn uPAC1cuq6kg5GHaq4jEAIm3Fx5B9E10VbvP3fqSpd2eGyfOnYWh8ny8v5/rog+fI3Dhn 9L42AifPxxR+V5XI8hRdhTojFZk9trX+PYhfB36q7/fRXV2Ft6O/pdHfNQUbwWk1wbER tPxuC5n4FaLriuXKlM2mNcS0utCmJwLgCzZMWYa4OcnWEwBO2/x6wwwfXOJg5vB48+aY uLDAGAkYb+kuNMfj5600mt+LXaMnld0DQ952FM18RAgpHrF3F4EkX1OrNl6sDWK1D2/v kWsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Dq+2cGcx; 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 e8si29996692pgg.625.2021.10.26.11.19.28; Tue, 26 Oct 2021 11:19:40 -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=Dq+2cGcx; 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 S236695AbhJZOdP (ORCPT + 99 others); Tue, 26 Oct 2021 10:33:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236682AbhJZOdN (ORCPT ); Tue, 26 Oct 2021 10:33:13 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88E6AC061745 for ; Tue, 26 Oct 2021 07:30:49 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id l186so7877265pge.7 for ; Tue, 26 Oct 2021 07:30:49 -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=SLvPDSjlXuC0odmXJ7mp0PxXfMTmsQLadPLQAXM53SE=; b=Dq+2cGcxpR4hHgPKwa3lXKppms4MJ1ABJQsR/c/LSTYeTLn031quUbtQfCYikWbSlO bhvydJL2l5UI9TyflxW+LAijacELclNc1P3X+IqC+IG8knSZGj53eKA2uioB7ZQXw93Y 9O65vPVdxBb7u9YlYtWrhChqaQrBZVFLFjZtdu7uqBrlbuKTgWemqav6q8m8bbFb/zI1 XqC9qTN6dGTDq8nmYsQQUM+/eejRbgDt6KNMb9B/V5tbR8WgvzA3ZOchp01SRfrB6MZR rE3pVRLzYtw5vgSOm/wQlezIB1Ja3yRmbgaxgJGe6JtWTWRVo1/xlJrqR2B/LsGfrJoe IdfA== 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=SLvPDSjlXuC0odmXJ7mp0PxXfMTmsQLadPLQAXM53SE=; b=V5ITGVoQUNkMrGEA3Pg/e9IxQBsl8eBc0HhtEJLkBvU+On4f5TT90r1XzDWSEsrypT KcXJT0Hi8fsEgtL86leKMyngIr6XSiMq7NU9B4wv8bCvfIpeCzti0IMAvdDF7aBOAz13 8OpauLNOxMpxMKmZAEdsy+Q0G3f+ZNfERo95bTw3jiWgQXw9/6KwKpYg6zIj5c33Ax3K Y4o6Uo6/5M+EFBDObN+KUKw3CmIiQTUacwkuBWHu+neIEraw0cvMdKTlnOMHHBOn98hw qoCJ6EFIzyzDaagpPIGhCdMFP0v/8+0Nm4BTS5WfiSml7n6HGODKvsNasxecCg1DJXmj e+XA== X-Gm-Message-State: AOAM5319VZ1lk1J4bBiIiDSwdFUtpSeDkwKoX+QStrtMvIo6hgyaQln6 92blW51w8+f5YFy2TlMioNYpdHAYQo4= X-Received: by 2002:a63:7d46:: with SMTP id m6mr19461290pgn.409.1635258648970; Tue, 26 Oct 2021 07:30:48 -0700 (PDT) Received: from localhost ([47.88.5.130]) by smtp.gmail.com with ESMTPSA id lr3sm1297294pjb.3.2021.10.26.07.30.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Oct 2021 07:30:48 -0700 (PDT) From: Lai Jiangshan To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, Lai Jiangshan , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" Subject: [PATCH V4 23/50] x86/entry: Convert SWAPGS to swapgs in error_entry() Date: Tue, 26 Oct 2021 22:30:05 +0800 Message-Id: <20211026143032.18624-5-jiangshanlai@gmail.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20211026141420.17138-1-jiangshanlai@gmail.com> References: <20211026141420.17138-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 XENPV doesn't use error_entry() anymore, so the pv-aware SWAPGS can be changed to native swapgs. It is prepared for later patch to convert error_entry() to C code, which uses native_swapgs() directly. Converting SWAPGS to swapgs in ASM error_entry first to ensure the later patch has zero semantic change. Signed-off-by: Lai Jiangshan --- arch/x86/entry/entry_64.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index 9bad620553c8..b97ce4204f6d 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -996,7 +996,7 @@ SYM_CODE_START_LOCAL(error_entry) * We entered from user mode or we're pretending to have entered * from user mode due to an IRET fault. */ - SWAPGS + swapgs FENCE_SWAPGS_USER_ENTRY /* We have user CR3. Change to kernel CR3. */ SWITCH_TO_KERNEL_CR3 scratch_reg=%rax @@ -1028,7 +1028,7 @@ SYM_CODE_START_LOCAL(error_entry) * gsbase and proceed. We'll fix up the exception and land in * .Lgs_change's error handler with kernel gsbase. */ - SWAPGS + swapgs /* * The above code has no serializing instruction. So do an lfence @@ -1050,7 +1050,7 @@ SYM_CODE_START_LOCAL(error_entry) * We came from an IRET to user mode, so we have user * gsbase and CR3. Switch to kernel gsbase and CR3: */ - SWAPGS + swapgs FENCE_SWAPGS_USER_ENTRY SWITCH_TO_KERNEL_CR3 scratch_reg=%rax -- 2.19.1.6.gb485710b