Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp367018rwl; Fri, 4 Nov 2022 01:04:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5nBPq5AI7f1tQ85bGzcfZWd849zea9KL2UpdTxAJ6L/K1xJdLOauovq975F1UKkK/K6j0a X-Received: by 2002:a05:6402:3789:b0:461:3ae6:8d73 with SMTP id et9-20020a056402378900b004613ae68d73mr34880946edb.229.1667549068611; Fri, 04 Nov 2022 01:04:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667549068; cv=none; d=google.com; s=arc-20160816; b=ZwIovMT4KuTlb/28CC5O76gVlYlcngb7/K4gduK+QC2ImN+5xDX8l5L3Td1zxDuqS6 YozEplaHNfs9Rr3uSGhv4xmPLqkFWq5gnO30rsRXphJfgE1q5cAcaWm92naozxqRQsFw +CMkZ6cMXCqrOULolkRoIXr6CTXVInNMc7F7B7eL+ZH3wg/GRyY7ivXbGfTpMcuvhZkU YU2xQia/WIs2lLrEkohb1z2JxTq8Vcz4JZCviDZx9Tm5XNQa9NNqQeqvpK+3oK0o1Jsi Kr95Ub9ckisA2uuuapq7zfdZMMDECjA7yYecw0VUUpGPrz/XoWG+2PN/Bh1n9z+RvV/T fpUA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z16-20020a05640240d000b00461d9b46883si4477147edb.519.2022.11.04.01.04.05; Fri, 04 Nov 2022 01:04:28 -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 + 96 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 ); 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 ; 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 ); Fri, 04 Nov 2022 07:27:20 +0000 From: Juergen Gross To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, x86@kernel.org Cc: Juergen Gross , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 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 } -- 2.35.3