Message ID | 20221104072701.20283-4-jgross@suse.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp228425wru; Fri, 4 Nov 2022 00:31:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7R4okipE8kzE2T9FSbHt+7yLkiIgoU92iI/I/r1h5LopIJoUXVg/akEkwmQGvxbx+l+PqV X-Received: by 2002:a65:5a8b:0:b0:470:2ecd:ea02 with SMTP id c11-20020a655a8b000000b004702ecdea02mr4156772pgt.83.1667547071943; Fri, 04 Nov 2022 00:31:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667547071; cv=none; d=google.com; s=arc-20160816; b=JgVsEjeKavHwylRMUEGOyRQ+6VMPmk1FYNIuO3/JnZF3ya4/W8CJTRJ5AvpzMIat9/ ctW69RoWvr5l86omDHMTdJGjtvKAAqGGVM1y+z1x6izQ94Tg/DR3DE689q11TBEXPi9p dhsq/UfsZwAZkg4ThFLrN9wc69Dgyy8H+b0Xi3XE84odAdIKw/RblhjyPghrXpM0ZgNr 7Sw6Z4OIQcutszVlIbfPgexP/oH6E0pHj+qlEJtC26aQGsmxez+MDskPZlBjRMfBz+9d TZ+hlfYdbiGgw0DaiC77/4CZF2i+KSw+AyT1PJn4wvvYNe3tz32O/eCc/GHtb/2pAkoF MsGw== 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=ZIOvMf0VCiOOdx+pSynOR3iuEcnpBNHWVTTFgfhwJA0=; b=LXYLF0KI5xogdLB/vTT7Fmhw1FucsT4IhQOW6kbO7evW7p8WUb8BoF9e8jTaQQh0cg 4WuMyFUyAXdrf7CT/neEukHxcfkb7L5cp7EGTbSSO057M2RkiwVe2Nb9eLWEsLWsOM3E zsc0Wi29oykagYFAMIoMAUSsbCY6kCHrr6Y4CoJpL7N/XAFLFzw1Yzi8F9WpLBlYuIZV 5arM3oTHI8adKBqdiqAhOhA8GoGQlkUBhIaGp1oLi98IPQZeFns7uCH5cqtExdACw1YE XnWbv0aSnbH96ULDhiZod1V6ulD+i6mEETmbOjA0qohs9k4+khpsRsPRqtK/yVA3LSaQ 7t6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=EnjxfVY1; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g14-20020a65580e000000b0045af77f7f19si254137pgr.400.2022.11.04.00.30.59; Fri, 04 Nov 2022 00:31:11 -0700 (PDT) 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=@suse.com header.s=susede1 header.b=EnjxfVY1; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231465AbiKDH1o (ORCPT <rfc822;jimliu8233@gmail.com> + 99 others); Fri, 4 Nov 2022 03:27:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231570AbiKDH1X (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 4 Nov 2022 03:27:23 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D3172982D for <linux-kernel@vger.kernel.org>; Fri, 4 Nov 2022 00:27:22 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0D699218EF; Fri, 4 Nov 2022 07:27:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1667546841; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZIOvMf0VCiOOdx+pSynOR3iuEcnpBNHWVTTFgfhwJA0=; b=EnjxfVY16idoJh9IIy4JkGsUyUCXsUVwU0w51egCCLg5DyQj3J7jxrbkA4rfngpNO2Pwv9 wov57FtNfpnF/SBFt652DKi5Xmswq2R3f0Y6Q5BJrjFYmZf8ZvCWawW+KwYgwKKIJlgZd1 wTqlkt/BxLqs95Vk1s+327B34/LytLo= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BE74F1346F; Fri, 4 Nov 2022 07:27:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id wt8nLdi+ZGP8QAAAMHmgww (envelope-from <jgross@suse.com>); Fri, 04 Nov 2022 07:27:20 +0000 From: Juergen Gross <jgross@suse.com> To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, x86@kernel.org Cc: Juergen Gross <jgross@suse.com>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, "H. Peter Anvin" <hpa@zytor.com> Subject: [PATCH v2 3/5] x86: drop 32-bit Xen PV guest code in update_task_stack() Date: Fri, 4 Nov 2022 08:26:59 +0100 Message-Id: <20221104072701.20283-4-jgross@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20221104072701.20283-1-jgross@suse.com> References: <20221104072701.20283-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748549838460978743?= X-GMAIL-MSGID: =?utf-8?q?1748549838460978743?= |
Series |
x86: Switch X86_FEATURE_XENPV to cpu_feature_enabled() use
|
|
Commit Message
Juergen Gross
Nov. 4, 2022, 7:26 a.m. UTC
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 <jgross@suse.com>
---
arch/x86/include/asm/switch_to.h | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
Comments
On 11/4/22 00:26, Juergen Gross wrote: > 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. Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
diff --git a/arch/x86/include/asm/switch_to.h b/arch/x86/include/asm/switch_to.h index c08eb0fdd11f..5c91305d09d2 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 }