Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp756067rwi; Thu, 20 Oct 2022 05:02:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5YfEv6iURFxsSAs20/vOxzDbPNfXFoGkLa6RcNX4IdPrJ2wW5/bpxXfCTZ9mZXX+ZJKd54 X-Received: by 2002:a05:6402:270b:b0:45d:61cd:73cc with SMTP id y11-20020a056402270b00b0045d61cd73ccmr11972875edd.136.1666267352463; Thu, 20 Oct 2022 05:02:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666267352; cv=none; d=google.com; s=arc-20160816; b=etsDV0Fs7hRA2lKCxJliqXbvXQgi6hujjdvUN05VZT8jLoTgwj3oJjx0gMjUjCN0vM DJ7Mvh2q5kdw5QhI1shRe4F8xwnsvpHNa2dlpSbFXJ8iqe5LPeNozqTVeNZhpkWMZj3s 2fkXFWG4449GM71+FMCDi1z4ABOkqsbCniwB/DDj1O67Xi2OUsP/jf6oG5w/G+GU2d1h ASwZ6qgifJC3lr8q6PoeUSe9nNZamK7Y0iMZFAHxD8Xr94JaBsoPgmHYfbpGjDnjSt3U iII0t8QnpCI7R+rL0vy54Rau/5ngvmhNG/D/JgKCAt/NLfulJ4uVYT6EMh4+JRPGeNmZ 8PCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Vt+wMbRFE0rG1uXDujJFiYR0joB4irWLNz9Ee1QgEPY=; b=hQ1Q3RBpNxleS1HCrLIic+247Rw9ZYqZd15buBo+so/jLNZParZiwuXBJRWb4uanMI s8Ujxp2ywIfubJQuyKTd4ASusaUkWZUsZKle5x8Ux7WWBohHziB4aCJLe0wGuw4UJvzl dPKvHEC3yaF0bsY2IVdmK1kx4kt6/gtEGLRtmRUX9ri42OgGLsto6fapkAjl6F8Xg3Y8 0/6emtNYGcoZgtmOjK34S+HLUUH/at6N1y4uSz2wIjLtI55kvLu/Ql+C621v4h4XRIye 7jZDFsYZSPXGbTgknswehIgusgsS77pGT00G4YT938GQHrP8bpUZ9RVgeC/OlODO1Icx Jhyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=Lo2rYQRz; 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=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ce6-20020a170906b24600b0078de51ec509si14284409ejb.686.2022.10.20.05.01.55; Thu, 20 Oct 2022 05:02:32 -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=@alien8.de header.s=dkim header.b=Lo2rYQRz; 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=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231418AbiJTLj0 (ORCPT + 99 others); Thu, 20 Oct 2022 07:39:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230052AbiJTLjY (ORCPT ); Thu, 20 Oct 2022 07:39:24 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 927131DDC2D for ; Thu, 20 Oct 2022 04:39:16 -0700 (PDT) Received: from zn.tnic (p200300ea9733e710329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e710:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 59C931EC0567; Thu, 20 Oct 2022 13:39:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1666265949; h=from:from: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:in-reply-to:in-reply-to: references:references; bh=Vt+wMbRFE0rG1uXDujJFiYR0joB4irWLNz9Ee1QgEPY=; b=Lo2rYQRz7A01KADbSuyKRxc1XILdeTNVtSfBHQ6PVOriFyIbeFkH76vI40g1wbm5m7rGlR TMyHEwGgv0LOWkHvZL3E1HTzoJhM7nJazREkCHOqRC+ROyKYNxA00cJXwKIXbr/IrRJqTn z8gXYkwQKD48/lE+L7Ml+vSO/8iqZPk= Date: Thu, 20 Oct 2022 13:39:09 +0200 From: Borislav Petkov To: Juergen Gross Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Boris Ostrovsky , Thomas Gleixner , Ingo Molnar , Dave Hansen , "H. Peter Anvin" , xen-devel@lists.xenproject.org Subject: Re: [PATCH] x86/xen: simplify sysenter and syscall setup Message-ID: References: <20221020113619.17204-1-jgross@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20221020113619.17204-1-jgross@suse.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 On Thu, Oct 20, 2022 at 01:36:19PM +0200, Juergen Gross wrote: > 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) > > void xen_enable_sysenter(void) > { > - int ret; > - unsigned sysenter_feature; > - > - sysenter_feature = X86_FEATURE_SYSENTER32; > - > - if (!boot_cpu_has(sysenter_feature)) > - return; > - > - ret = register_callback(CALLBACKTYPE_sysenter, xen_entry_SYSENTER_compat); > - if(ret != 0) > - setup_clear_cpu_cap(sysenter_feature); > + if (boot_cpu_has(X86_FEATURE_SYSENTER32) && Can you switch that and below to cpu_feature_enabled() while at it, pls? > + if (boot_cpu_has(X86_FEATURE_SYSCALL32) && ^^^^^^^^^^^^^^^^^^ Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette