From nobody Mon Feb 9 03:19:22 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1666265808; cv=none; d=zohomail.com; s=zohoarc; b=fMt4lCycv74+VCy+6bwS/ZSZBcOm/gLMhswD3PyhwXmCTXFV+1nvvQzQnJbXuskyl5tIoN/aUdboXeG1x9QPzaFBVaI2OoHcvwYMSA9KXAzK6YGBVq7hgzqX7wpElxhEMgkcG2+nq0F4hCV950Q8W+p8R8Lk4HwYhHG2mdKCkrA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666265808; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=KHnL53pJczBHTqmZO1LrKItRzowSRHTkckS9BjAXjoE=; b=F0hm6Kb6vQ/yWHBHgLhCJU3mKK8wVkH1zTJH85RUkSqRGPFIi79QacN6UOnFO3Vb4lZ29OLxsZaOq/UqtoMnpol4e7V9V7kg5o2huLzaKpxlINf6SxR6wXj+0v968YUe4+7TMyyEJHODxp0dlNEdsl++IByCwI5+Hnll+t2ISkw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1666265808025611.5953216492753; Thu, 20 Oct 2022 04:36:48 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.426631.675199 (Exim 4.92) (envelope-from ) id 1olTqa-00059U-JD; Thu, 20 Oct 2022 11:36:24 +0000 Received: by outflank-mailman (output) from mailman id 426631.675199; Thu, 20 Oct 2022 11:36:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1olTqa-00059N-GK; Thu, 20 Oct 2022 11:36:24 +0000 Received: by outflank-mailman (input) for mailman id 426631; Thu, 20 Oct 2022 11:36:23 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1olTqZ-00059H-3C for xen-devel@lists.xenproject.org; Thu, 20 Oct 2022 11:36:23 +0000 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 678c321e-506b-11ed-8fd0-01056ac49cbb; Thu, 20 Oct 2022 13:36:14 +0200 (CEST) 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 9DAB72187E; Thu, 20 Oct 2022 11:36:21 +0000 (UTC) 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 4D0EB13494; Thu, 20 Oct 2022 11:36:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Jr9bEbUyUWPWBQAAMHmgww (envelope-from ); Thu, 20 Oct 2022 11:36:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 678c321e-506b-11ed-8fd0-01056ac49cbb DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1666265781; 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; bh=KHnL53pJczBHTqmZO1LrKItRzowSRHTkckS9BjAXjoE=; b=lYmD0CMx11/mhtHCnBMiU+WOl6vGhTpj/AiSjI9Y+eV6rL+Dhg8BSZjQG7421+kDbaFA0U CWHhBrzKzEkziGciqXPpbYv4fDQ3jH6dX3UkmdjaRulsa6RdNE4FvubOZnffhyyS/Px4vG IzZ7CeB9/zCegnAa22lBFdmlAaSAuZo= From: Juergen Gross To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: Juergen Gross , Boris Ostrovsky , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , xen-devel@lists.xenproject.org Subject: [PATCH] x86/xen: simplify sysenter and syscall setup Date: Thu, 20 Oct 2022 13:36:19 +0200 Message-Id: <20221020113619.17204-1-jgross@suse.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1666265808848100001 Content-Type: text/plain; charset="utf-8" xen_enable_sysenter() and xen_enable_syscall() can be simplified a lot. Signed-off-by: Juergen Gross --- arch/x86/xen/setup.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index cfa99e8f054b..0f33ed6d3a7b 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c @@ -910,17 +910,9 @@ static int register_callback(unsigned type, const void= *func) =20 void xen_enable_sysenter(void) { - int ret; - unsigned sysenter_feature; - - sysenter_feature =3D X86_FEATURE_SYSENTER32; - - if (!boot_cpu_has(sysenter_feature)) - return; - - ret =3D register_callback(CALLBACKTYPE_sysenter, xen_entry_SYSENTER_compa= t); - if(ret !=3D 0) - setup_clear_cpu_cap(sysenter_feature); + if (boot_cpu_has(X86_FEATURE_SYSENTER32) && + register_callback(CALLBACKTYPE_sysenter, xen_entry_SYSENTER_compat)) + setup_clear_cpu_cap(X86_FEATURE_SYSENTER32); } =20 void xen_enable_syscall(void) @@ -934,12 +926,9 @@ void xen_enable_syscall(void) mechanism for syscalls. */ } =20 - if (boot_cpu_has(X86_FEATURE_SYSCALL32)) { - ret =3D register_callback(CALLBACKTYPE_syscall32, - xen_entry_SYSCALL_compat); - if (ret !=3D 0) - setup_clear_cpu_cap(X86_FEATURE_SYSCALL32); - } + if (boot_cpu_has(X86_FEATURE_SYSCALL32) && + register_callback(CALLBACKTYPE_syscall32, xen_entry_SYSCALL_compat)) + setup_clear_cpu_cap(X86_FEATURE_SYSCALL32); } =20 static void __init xen_pvmmu_arch_setup(void) --=20 2.35.3