Message ID | 20231024145309.46756-1-ubizjak@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1997232vqx; Tue, 24 Oct 2023 07:53:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IECt5V+lI28teZ1ntJByEXkGquJHQCxIwyWbexSbPnWyd/zcW81rV4U9gPa9L4mQctlDmGy X-Received: by 2002:a05:6a20:160e:b0:17a:4871:63fd with SMTP id l14-20020a056a20160e00b0017a487163fdmr3786603pzj.0.1698159211993; Tue, 24 Oct 2023 07:53:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698159211; cv=none; d=google.com; s=arc-20160816; b=0s03ceGg7v71fPbcIZwlx0ZU0Bs2M+5avucgEq/ct9HWRKCKVd0nEaIKrqASAcaO1a O0Vfc01D6nu9usern1EVkij0502M7JtSu34Ht+GUhBGxf7JnGO3HtVJ5HiWxmI0REqOd Fd0LsclbgBCOArZVUsXJh++nnAUvxzX2McPDBBaMl87KWTr9e4Wcs+BVIfrQ0mrSpequ CDhCiTA0zP3u5tobjpLchgG3nJ/C/3vHK5rPIdVFPZlHJ1VNbF5OIwIyyOUXiWnOhiwj Z6BC145TBxXK6mH6GoVI0Qo4SUU0NyCNVKZMBWrrGFCkK20WTVFb/XBzZBWBdiat04aK YQJQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=KGTgRMl8R0AO37IqkPzGKZezgxHG7P4IDM0GnQ1FQko=; fh=Lg0n8Kt1FzrWrrpdAJIEZ+A+M/gVozJpG8E4qEdoiqc=; b=DH2qqRBv4ZWQhrhwoqxPDNJDejZcWPHuD3ARn5zuivwwnuItbhGPdpWfZEID84gf4a po/DF7GSemj4PRxwajCio2VsZ4E2EdAEfKdR/6pMFOpHr8DFu/k7nMJKpbf4jX47ZUMk xC5o6nDg7y8LfecpDL9GLe3NWoNxL6T4TIgsi+ETEa4k5WR4F5J2YE6Ew4ByCK2FeIJX AvOmmxRjPkfwaDvzlfVGhovF6Nm/5bQ2BMdyaJr2GPqzhPyojl+ZUz3tiwKibwYcsWtj cZsjt6yznazxfW5jZZPKcthaFICgn0ycPuUhVQDCnWGi4FEidzytlgEjblvnOIwDNUZ9 XMgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fnjTQW5M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id o7-20020a056a0015c700b00690c953e024si8628923pfu.119.2023.10.24.07.53.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 07:53:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=fnjTQW5M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 33968802C7F2; Tue, 24 Oct 2023 07:53:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234610AbjJXOx1 (ORCPT <rfc822;a1648639935@gmail.com> + 26 others); Tue, 24 Oct 2023 10:53:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234602AbjJXOxZ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 24 Oct 2023 10:53:25 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89097118 for <linux-kernel@vger.kernel.org>; Tue, 24 Oct 2023 07:53:22 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-9b96c3b4be4so668571466b.1 for <linux-kernel@vger.kernel.org>; Tue, 24 Oct 2023 07:53:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698159201; x=1698764001; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=KGTgRMl8R0AO37IqkPzGKZezgxHG7P4IDM0GnQ1FQko=; b=fnjTQW5M4mNWpKB7awBz+WlKrUvcbQ6hc1GH1n24HGuwRK2g4WN0gN0kfgl6ZY9H5X KGI43jwozLTvNFy96gyEm3aGQgw009QFlkeAKIVKIbTrAEpKYpvUOp6URitp6ZvfY1TB S7xXniXSrxp6Q4PsI6gfKCwroqdnfbN0NPD/BFwG0kLz/wm58HD/y8XaQ0mMSsxnPnTu 7fewbFzoQdzGxbzkMdLKRHXMKJbleVykNOvYgceCsFBzNU8I0jyB4CtC+uIYLsW0wJM1 D9jsDtfeNfI5XUS9RNiR9KAGwSnh4NV7Ad4JC54tvavV57YbWSfOlUl6DQLTChrmpHv0 vn1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698159201; x=1698764001; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KGTgRMl8R0AO37IqkPzGKZezgxHG7P4IDM0GnQ1FQko=; b=MJlDkkv9I+V3ZZUq3zFsiM0frZqrlE9MWDKvl2gSUffB21ZiF2c/KZpxgT5pfUXG6o QzjgkOiXuSbo+CUmNtW9nv2XFhZhVdG9XBSm5aILpg5fc8ccXdTHQB7vD/a6uRnRfWU5 OYjwwq2HPHey4czhDKNj+XN9wifREn9Rj9vPAjJlWjEKcbL6tj0B33Uacfgg014A4stS RhPjP3AbbI59ms3mtF3Y2J84yvVG/Q0wuTgxmtQTioFcR2FijA+/HeGZM/ZCyuZzN83r xytVCNZCFvcxWxjv2na05CK4CIGxDNj46YE96+/Zn6SBsMZEME0ngSk5yZjxOFLkRTpU ZKIg== X-Gm-Message-State: AOJu0YxmfQFoyGnkSHUFwcg5yyAFpKCCP99oM7C9SmKu9K+6m96WcvML h1alrfisKeN743CchB7iI7RAah4VMTcmaQ== X-Received: by 2002:a17:907:94c3:b0:9c3:bd63:4245 with SMTP id dn3-20020a17090794c300b009c3bd634245mr8864192ejc.47.1698159200756; Tue, 24 Oct 2023 07:53:20 -0700 (PDT) Received: from localhost.localdomain ([46.248.82.114]) by smtp.gmail.com with ESMTPSA id x9-20020a170906148900b0099d45ed589csm8304952ejc.125.2023.10.24.07.53.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 07:53:20 -0700 (PDT) From: Uros Bizjak <ubizjak@gmail.com> To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Uros Bizjak <ubizjak@gmail.com>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@kernel.org>, Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, "H. Peter Anvin" <hpa@zytor.com> Subject: [PATCH] x86/traps: Use current_top_of_stack() helper in traps.c Date: Tue, 24 Oct 2023 16:52:53 +0200 Message-ID: <20231024145309.46756-1-ubizjak@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 24 Oct 2023 07:53:31 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780648993702005497 X-GMAIL-MSGID: 1780648993702005497 |
Series |
x86/traps: Use current_top_of_stack() helper in traps.c
|
|
Commit Message
Uros Bizjak
Oct. 24, 2023, 2:52 p.m. UTC
Use current_top_of_stack() helper in sync_regs() and vc_switch_off_ist()
instead of reading top_of_stack percpu variable explicitly.
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
---
arch/x86/kernel/traps.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index c876f1d36a81..78b1d1a6ed2c 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c @@ -772,7 +772,7 @@ DEFINE_IDTENTRY_RAW(exc_int3) */ asmlinkage __visible noinstr struct pt_regs *sync_regs(struct pt_regs *eregs) { - struct pt_regs *regs = (struct pt_regs *)this_cpu_read(pcpu_hot.top_of_stack) - 1; + struct pt_regs *regs = (struct pt_regs *)current_top_of_stack() - 1; if (regs != eregs) *regs = *eregs; return regs; @@ -790,7 +790,7 @@ asmlinkage __visible noinstr struct pt_regs *vc_switch_off_ist(struct pt_regs *r * trust it and switch to the current kernel stack */ if (ip_within_syscall_gap(regs)) { - sp = this_cpu_read(pcpu_hot.top_of_stack); + sp = current_top_of_stack(); goto sync; }