From patchwork Tue Nov 22 18:04:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 24497 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2362248wrr; Tue, 22 Nov 2022 10:06:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf4qGV68uybzbQ0+XhfVWiprbnY1aTeBaJuqCn7bRnB/A0W4KJ+3v5tmDmNmKD3kaFbOztPn X-Received: by 2002:a17:902:b283:b0:179:fe08:48da with SMTP id u3-20020a170902b28300b00179fe0848damr9361408plr.154.1669140384439; Tue, 22 Nov 2022 10:06:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669140384; cv=none; d=google.com; s=arc-20160816; b=iGEcmYKEDSzDouYomlJVdJFGPGekIe0Av25PcGK/B4zpFCxCgoSL6Y5/7TFzufoxz1 JwoIzetb6GZl0sigZ4U2RgPJs0IrZkP38OPOummV+bPFJ0gOD5sKRhuKI6u9dhd1g694 MF1NW4NrI5s10HWgEUk1bhx6108kcGhmxFisnAHFNd15bq/nSf4b/dn93Ohq1Nrj/Dpa gbPD+F594GM9hrVTf2G+SVC/iuM2MrDop8whmyl59K1wVLmdmV+pURufUPpV0dSK1MyK YhuWOImrsEhX8q6XSpOYOUWIAvcYKuiAtZdPJ4024EeY0pOFV97rkldtcb0hTV15dTyi cjgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=jV+Vu5nExTKWPYOeBZhl4AtcbxNOQy4jUkV4cFJwyCk=; b=LIZOB3OZ1vFA/en1CQr+t/vE1yctOpSK8fkXnnA7Fddvijhq+SzbbDURNze9C4kbYc qNK1KYsoknJQohPY4hQdcMlkICM+LFrSDaRDmsygmOWfYIHwI7/wLlie7pmfnFzpnO89 cdnppjfaWhJwNje/YT20BTIVHljFfgbKVq/l001vhTUuuazyZoxLY3MMR5QprXT7Q70x 4zBohbzYHtyw32Jl+WWtOhzQ48Rbj354guFDBzruIRifjpVAf2hcMXCF1+uTDk6TZutT 1MGUgcK98kNwP7dlyCMTsmd4DXGlZDayVTGrv3iTDjZ7MWwQfc/uDfMy1hqwicL4eyP1 MLWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=JGYnRvQB; dkim=neutral (no key) header.i=@linutronix.de header.b=599Fus7P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v17-20020a056a00149100b00563a0453c55si15550878pfu.268.2022.11.22.10.06.08; Tue, 22 Nov 2022 10:06:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=JGYnRvQB; dkim=neutral (no key) header.i=@linutronix.de header.b=599Fus7P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234201AbiKVSE7 (ORCPT + 99 others); Tue, 22 Nov 2022 13:04:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234070AbiKVSEw (ORCPT ); Tue, 22 Nov 2022 13:04:52 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD3B16A6BD; Tue, 22 Nov 2022 10:04:51 -0800 (PST) Date: Tue, 22 Nov 2022 18:04:49 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669140290; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jV+Vu5nExTKWPYOeBZhl4AtcbxNOQy4jUkV4cFJwyCk=; b=JGYnRvQBJAZmRl0wXCdCqaEx+94V6gBRQx9N1vRdRJE8mg4LM1vaJsNuXdJA4DcVjZ+hdb 06OqbC1KlMGS2Pf011Cs5nd7hcvQGAOoAjVsQ74omelnaBEm484I8SWtMuUYteUqfuGG2m CF/979fqPKA7OxJ9XkWfPJYzQFAMcK6m9+nkNMtJ7wT2ebZY445YB9H03CmOtL7Zn29zlN bOxkZQX41cjdXpOtoibdUsvthqBVk2gxjdl/Jkc6csJSiTVoh2uFjA5GSzUSxEP8abl6t0 Kr1sf3lhv0JdFbJuUVGe8OJuKheAQtMCnFsFpj3kJVWmYCXDHYnpCHscToNGaQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669140290; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jV+Vu5nExTKWPYOeBZhl4AtcbxNOQy4jUkV4cFJwyCk=; b=599Fus7PCHoxiMmnuulpUUu59Q2nMRpG7wYqHdgUT88HEcj/lM62GH8JscHA7nXAu6QGyl TVJNE1MPjnUd6UBg== From: "tip-bot2 for Juergen Gross" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cpu] x86/cpu: Drop 32-bit Xen PV guest code in update_task_stack() Cc: Juergen Gross , Borislav Petkov , Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221104072701.20283-4-jgross@suse.com> References: <20221104072701.20283-4-jgross@suse.com> MIME-Version: 1.0 Message-ID: <166914028910.4906.12824058487983110591.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750220547671658035?= X-GMAIL-MSGID: =?utf-8?q?1750220547671658035?= The following commit has been merged into the x86/cpu branch of tip: Commit-ID: dfbd9e4059c4edad4d92ef7f3deb4954f76e4ba0 Gitweb: https://git.kernel.org/tip/dfbd9e4059c4edad4d92ef7f3deb4954f76e4ba0 Author: Juergen Gross AuthorDate: Fri, 04 Nov 2022 08:26:59 +01:00 Committer: Borislav Petkov CommitterDate: Tue, 22 Nov 2022 16:14:15 +01:00 x86/cpu: Drop 32-bit Xen PV guest code in update_task_stack() Testing for Xen PV guest mode in a 32-bit only code section can be dropped, as Xen PV guests are supported in 64-bit mode only. While at it, switch from boot_cpu_has() to cpu_feature_enabled() in the 64-bit part of the code. Signed-off-by: Juergen Gross Signed-off-by: Borislav Petkov Acked-by: Dave Hansen Link: https://lore.kernel.org/r/20221104072701.20283-4-jgross@suse.com --- arch/x86/include/asm/switch_to.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/x86/include/asm/switch_to.h b/arch/x86/include/asm/switch_to.h index c08eb0f..5c91305 100644 --- a/arch/x86/include/asm/switch_to.h +++ b/arch/x86/include/asm/switch_to.h @@ -66,13 +66,10 @@ static inline void update_task_stack(struct task_struct *task) { /* sp0 always points to the entry trampoline stack, which is constant: */ #ifdef CONFIG_X86_32 - if (static_cpu_has(X86_FEATURE_XENPV)) - load_sp0(task->thread.sp0); - else - this_cpu_write(cpu_tss_rw.x86_tss.sp1, task->thread.sp0); + this_cpu_write(cpu_tss_rw.x86_tss.sp1, task->thread.sp0); #else /* Xen PV enters the kernel on the thread stack. */ - if (static_cpu_has(X86_FEATURE_XENPV)) + if (cpu_feature_enabled(X86_FEATURE_XENPV)) load_sp0(task_top_of_stack(task)); #endif }