Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2920058lqo; Tue, 21 May 2024 00:50:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXTaccTMNP21AoMoEGq4Lcn2GrapsFdvqeBQnywl+0pbAvlzBn3cDJQA2BPRWTUukAIEhOyKpCpqMACavrcf1u2rolJ+KHz/6USamvrrQ== X-Google-Smtp-Source: AGHT+IEjX4gUVJ3NkioQBvSwkk36VTShzhCoO5GhDtP+UPEedQsHFDHxJS3YtOKW9xD1qMPihlC0 X-Received: by 2002:a05:6a20:dc95:b0:1af:9369:9a3 with SMTP id adf61e73a8af0-1afde1b70a0mr33577605637.44.1716277829005; Tue, 21 May 2024 00:50:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716277828; cv=pass; d=google.com; s=arc-20160816; b=hIITyTm4ZYAFELZvNL0TuCHumLrcgILO70Lj6DotN5CljSvTu4Xyjke5RN2VVnpLR1 5s/pthd76/B6Xz0rTF8V2N5aaSAZd58RfsjdD6tr+dtAMltXGL4XUGmAPphwtjKfMwVH p7psgGts1JKbdTR8PCA5hgqNziinXGWjFxXRXJ3qSyxMP8tnmJrQA5yTgcCJnSs1fAaB 7ZFvnSBDMPnQKLB1KY18CmVjw4Q/02DcmiFbiVvYb14omTqHLjb7CgcGsFJxcisQNu52 /bnb0LkjceNoa18vqrRdAMJBAuBC0Xz7nQY9mlm3nrBMfflZHSpiCv3zWMsiT6XBgLaZ l7ng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=zhriVY1YS+s2GEj2LKPeJWhuxKvrjyAYCIq8RfPBJmc=; fh=3jUX1yFEVx0X7aGAGalBMxP6bfA6yJKdRg+WHYBWKq4=; b=dwfKgoHT7upMAnjijptj3kWT7XYq/rZwgBl8XaNtn70SG1B+kobIfGt3ZRUFQS4Gp0 8DOOpedb8D2YAhAZHNVGfYv/MczSIhen/rxLBygbzG3uJydcOGHzvxkteJd7ARpbT0rX 4eBOMaYpitwm24im8DgOvy7ljJPd2QmrUwaI8Oi3G72urqf3LpypGU/+kJsRADf3/Q3s o+DHl7hP13Atnr73ZtNv5l3NjPJmgdN2/8Bpmqa8+++D/AS5NeKDWKAmxtMCf7ADUnKz IjFLig+WKhSpGlu8bSLbo5q00R3dfRC8zo7kyR+yO0BjzmIDhvu419S4BC4skQdbquiX ymhQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=AvpIwQgu; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-184595-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184595-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0b9d142csi8444915ad.17.2024.05.21.00.50.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 00:50:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184595-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=AvpIwQgu; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-184595-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184595-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 1C945B213C6 for ; Tue, 21 May 2024 07:50:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 870025337D; Tue, 21 May 2024 07:50:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="AvpIwQgu" Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C0DE51C4F for ; Tue, 21 May 2024 07:50:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716277819; cv=none; b=CyEJNnzqGgKr9Javdl/dCjDhMnw/o1i/RyI+ps8x6exkDcBDzpftKNE77eYaiNNst4yYcp2xk9JNAmTVWzURbwPZ7X7s3PwikB+ntUMrlioCPPsjaDUKxoRQIqjwaZOrRapR95aELVZD7vNmqSXv5grCrr5SewmGTUDPTtQDq5s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716277819; c=relaxed/simple; bh=L/Vg3azzF1AwIKur+spgX2StqpWHdR2fCI0O12zbwSo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=N3Khy/qjOaiDwSLXsM3XNs54KqFOzJ5MKFqJNJ9YCUEyCx8EZWXqr1z4Rp0Zjg7gGzBL+cuImSWQte4FXDLUB1fyDc5XTkca58DcVuj7IvRGKfkWCWbRElIRc/g7nsACREIZp/aLi+Un/lYByh2JQwmDFjAYP/1oH/nlXpEfwX8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b=AvpIwQgu; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id BAD0840E02A7; Tue, 21 May 2024 07:50:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id AmG9K47KQcgt; Tue, 21 May 2024 07:50:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1716277810; bh=zhriVY1YS+s2GEj2LKPeJWhuxKvrjyAYCIq8RfPBJmc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AvpIwQguEOYipaAs1bqZf9/1aizrJp2VZs+MIa4qYBj8OM+yUXvGDzqwbtozuO5J2 e8GQ9/s6/EwMPYkF/1Obts1F6p8npJwJ5j4YIGN1e+yQ4oRzr2yJsxPlQaCvz1tlxv EEAKPz9iPha0lY5n50fUVrunpcedc8+5guTc3niIZOp23OKhfYFpnqfNK+uXwpK2jC VITHotBZsh78UXx7GM+MZTwXVCdq1JvIvBk2i5Yqrbrjk4kprjZn3Oxdne3leiS7qO GTgLZDGUUYocUmxy7IXknRk4exZudgbFgsdtxr4vW1e+G2Vn95J6kQ+MVQT8/F3IAs CagJ9IdpDAoPgKGawFLI13NlBq/4FQT7D/3lvgCosJH5MF4nQSkX05FyIiF6j/gxJP 1E98yMy/Cf+eV851+hB5NArK+xAjZR0+YqDofd1xChB5pNoF5qRObGfeJlbn10Tmzr MBsQN7HJrbE5uNNMhOkxs9tXGRTc1b4BRWwv1JQUOec5lxJcP2MwtI41jr59Qk2/Wf KiLhWj13UOGFUMfhQx4OLuTsg3J+vESA2prJt5cQ+6mrczjar1Nau+P+TgERTK6dYr aM8Q5CyXUc3z1eAsYBxp0Z5KfgwdMRVpYcTbVuOY2fkT+XZAAarm+RO5WYhkO2vVAa nW476cxFb6Hf+9IiueKkmAfw= Received: from zn.tnic (p5de8ee85.dip0.t-ipconnect.de [93.232.238.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 1859240E01A3; Tue, 21 May 2024 07:49:55 +0000 (UTC) Date: Tue, 21 May 2024 09:49:47 +0200 From: Borislav Petkov To: Tony Luck Cc: Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , "Peter Zijlstra (Intel)" , Uros Bizjak , Rick Edgecombe , Arnd Bergmann , Mateusz Guzik , Thomas Renninger , Andi Kleen , linux-kernel@vger.kernel.org, patches@lists.linux.dev Subject: Re: [PATCH v6 02/49] x86/cpu: Fix x86_match_cpu() to match just X86_VENDOR_INTEL Message-ID: <20240521074947.GAZkxSG_u08uLDqZ_m@fat_crate.local> References: <20240520224620.9480-1-tony.luck@intel.com> <20240520224620.9480-3-tony.luck@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240520224620.9480-3-tony.luck@intel.com> On Mon, May 20, 2024 at 03:45:33PM -0700, Tony Luck wrote: > Fixes: 644e9cbbe3fc ("Add driver auto probing for x86 features v4") Do you really want to backport this to everything since 2012, as that patch is from then? > @@ -690,6 +690,7 @@ struct x86_cpu_id { > __u16 model; > __u16 steppings; > __u16 feature; /* bit index */ > + __u16 flags; > kernel_ulong_t driver_data; > }; > > @@ -700,6 +701,9 @@ struct x86_cpu_id { > #define X86_STEPPING_ANY 0 > #define X86_FEATURE_ANY 0 /* Same as FPU, you can't test for that */ > > +/* x86_cpu_id::flags */ > +#define X86_CPU_ID_FLAG_ENTRY_VALID BIT(0) I would definitely not want to have those visible in userspace. IOW, something like this: diff --git a/arch/x86/include/asm/cpu_device_id.h b/arch/x86/include/asm/cpu_device_id.h index 54a71c669ce9..b6325ee30871 100644 --- a/arch/x86/include/asm/cpu_device_id.h +++ b/arch/x86/include/asm/cpu_device_id.h @@ -53,6 +53,9 @@ #define X86_CENTAUR_FAM6_C7_D 0xd #define X86_CENTAUR_FAM6_NANO 0xf +/* x86_cpu_id::flags */ +#define X86_CPU_ID_FLAG_ENTRY_VALID BIT(0) + #define X86_STEPPINGS(mins, maxs) GENMASK(maxs, mins) /** * X86_MATCH_VENDOR_FAM_MODEL_STEPPINGS_FEATURE - Base macro for CPU matching diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index ca3468ad06ff..4338b1b4ac44 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -690,6 +690,7 @@ struct x86_cpu_id { __u16 model; __u16 steppings; __u16 feature; /* bit index */ + /* Solely for kernel-internal use: DO NOT EXPORT to userspace! */ __u16 flags; kernel_ulong_t driver_data; }; @@ -701,9 +702,6 @@ struct x86_cpu_id { #define X86_STEPPING_ANY 0 #define X86_FEATURE_ANY 0 /* Same as FPU, you can't test for that */ -/* x86_cpu_id::flags */ -#define X86_CPU_ID_FLAG_ENTRY_VALID BIT(0) - /* * Generic table type for matching CPU features. * @feature: the bit number of the feature (0 - 65535) -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette