Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp672313lqh; Thu, 28 Mar 2024 12:38:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWLrnw9jccMEQgGrMlj226KhYZDNZc04ppAeW41EXGXk/zzsXw7+7fWpr9Q0ZtfrSa6exMNcHNObM1umflZAczzhVnoROpMVwcQ2JiPkw== X-Google-Smtp-Source: AGHT+IG/xylI3dmmI05Xs3UYOxKaPJjQScgX4UFvQLgbUiuIBc+mPvwtGQpindpOVm/Lvhp6bP9R X-Received: by 2002:a92:cdac:0:b0:368:6236:f8a6 with SMTP id g12-20020a92cdac000000b003686236f8a6mr37088ild.31.1711654728205; Thu, 28 Mar 2024 12:38:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711654728; cv=pass; d=google.com; s=arc-20160816; b=jHZy0ZdwlWhcl5cPaQUL4ej4Un1RvqeLmg0BwpJ7Stz82TragdjbdS4H7nY8DXjslj dnxkyODr4S5a+D7u+LR1U+KW097OGRQmRd8S1lUYpwRkTOam+6OK0bgcN/8wtWHiw2DM Rhs6H9bhfxB2tQa8Drx4u5BmZKYF1bJUA6QKUYt5/BMfC6yGHuJHQD0dBCVHkqcscGrW YoyH5NygbTAuo/YF6j2i0vFEopCjG2M9ub9A+qsAe27JGbIA4LrZhbCUTSNSlrbeH+vn knMD5tQrX8giT/3aRxlN+aAjlLFMFGGNkcqmU2M9j5LN6QeKIGfag2drgNJScsyBrc4I paVQ== 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=ZvLxj9Ez3rRsztf8ZFy8bTWKEto+yVyhTFTt+eJhk+0=; fh=zkuupytIpqL/+pyMuCrqwCMVE/C+fX4Llsb5HOG6zQo=; b=cUl1CAOLBVeGzVnvpFiaNk+2+w+5CoyvRIWa+LE9S73UfLkOUkkQHA+zhsDcAS1vr3 1bf2ydnQhnl4uex4fUQE8S5qijIw319aiV3Gm3proal95xNviYUpdn36d/he/6eSLA3k RXPXuC++rSJkzDHKkRRkGKzBTUMK1RYaJZdVXGwWWPTv8lTfTC1fg1bDQ+4cQBnDCHsd qX4W8zuQrrHZRLqXouK0IUt20VqXIsekjbLEjBty14CNVN7Mv9aQ8hqt+BEqw+n2W9S5 b/8QwxA6ydezHJ6tyIDTWa8q/zEvwbPDZz6w3HyO3st/gf6i4XrgQ/nikOm2tPwHeqvJ OlrA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=ipepdLq6; 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-123301-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123301-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id m18-20020a637d52000000b005dc0b1b0116si2042709pgn.119.2024.03.28.12.38.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 12:38:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123301-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=ipepdLq6; 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-123301-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123301-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id EF36F2A3ABC for ; Thu, 28 Mar 2024 16:50:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C788F136E01; Thu, 28 Mar 2024 16:48:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="ipepdLq6" 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 A785041A84 for ; Thu, 28 Mar 2024 16:48:26 +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=1711644508; cv=none; b=QgAKNhyIHARQxoYSw/cYSl02bl+ybueiXGTYf3SVp1fJv7laTZBS+TFldHQBgrphK0aCppWJoAf4Bx5TLaN/oK6LI6FlMR1JUXYlbdJaPvFjd54GlRiUJqyUGdVVvG2KV4LK2Wfsg07mMSzfuxDEuFZRb2Ghe0ttTVW3rQhuvtI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711644508; c=relaxed/simple; bh=eIs4O4s4xJQE5+HpKhCWd4AZ6Ys4Zcuc4A/6FsaEj30=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=l+eDiKN5pWEJjRgAJBHG+wcszYmm2LS3dgZMAkNypx1nQGoVf5e3ENDruU5dbiYiCbBngzyBGrZNsnIf1IFgkknrxXjxwjv8hk1uH6tUkXdOesL7PGeXhgJ6ni0HLp7/rF7jOjTjTD9bVcxs7YV/idQupCvBIyktZ97HZtTEWUs= 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=ipepdLq6; 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 5E1BC40E024C; Thu, 28 Mar 2024 16:48:24 +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 YiQoA9Pr1ltk; Thu, 28 Mar 2024 16:48:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1711644499; bh=ZvLxj9Ez3rRsztf8ZFy8bTWKEto+yVyhTFTt+eJhk+0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ipepdLq6zzVo1CcWwYq7hN5L1KtQSSJ9szDHKlpn7WIvjk7yxKf0jqkhujmpngQTR W6N68hfJeDWxvyoPxzn5xoDjud5Hn3KYhs6lECSfpFsngYMZSFgMAirD3iqx+bEHd7 iA2v391J5B7fOckmzOCyBclFxE+wG84n/bsznV45rqmn5uKWLJ86kYHrKN3WROH7ah w7tatg2RxpDq5xqAGTTeFyl61PxHYfkDR51GYUhjP6wnOrTiaefcaALP3VOsmBLHzt DqIzKf4a3ccGyfWanjEToEfyTREFjs7zWWYnGdT0/hXsllpZgwUScZSEiWFJyfSvZy VhJaIquBusaxdocMMMFv6cEv8yLB1gLpUQgK4KtI4I2aVL2jREK6McWZ8mVJ89O00D 3XffKzY6T12vXyuQuXlwDM6TI2FR115S5pF3QbEje5SVVW7w1eI9LrMcWX5m6sURTG xpzcj+zqVV0mL10m77uhIHYNW+SUh8XZ1dh5DpzaxATnBwU1kT5TbDY14Uww5yBUo3 14sh3RttV68yBnCaBM+YaS0TYvq0iDiKYmpom73tpLHayagm7rwGu7EVWfNLs2nr0s dSo0uo7kWgnnGsK878dDPSjxaAKHEyBysWJQG1aXRWeaVb1RAe9bcpy3ZBNSM5B3b2 4KI1Wi+CkJh8P2aWaziC/GjE= Received: from zn.tnic (p5de8ecf7.dip0.t-ipconnect.de [93.232.236.247]) (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 CBB0140E00B2; Thu, 28 Mar 2024 16:48:16 +0000 (UTC) Date: Thu, 28 Mar 2024 17:48:11 +0100 From: Borislav Petkov To: Tony Luck Cc: x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 01/74] x86/cpu/vfm: Add/initialize x86_vfm field to struct cpuinfo_x86 Message-ID: <20240328164811.GDZgWfSzAWZXO7dUky@fat_crate.local> References: <20240328163746.243023-1-tony.luck@intel.com> <20240328163746.243023-2-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: <20240328163746.243023-2-tony.luck@intel.com> On Thu, Mar 28, 2024 at 09:37:44AM -0700, Tony Luck wrote: > Refactor struct cpuinfo_x86 so that the vendor, family, and model > fields are overlayed in a union with a 32-bit field that combines > all three (together with a one byte reserved field in the upper > byte). > > This will make it easy, cheap, and reliable to check all three > values at once. > > Signed-off-by: Tony Luck > --- > arch/x86/include/asm/processor.h | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h > index 811548f131f4..87115e5d884f 100644 > --- a/arch/x86/include/asm/processor.h > +++ b/arch/x86/include/asm/processor.h > @@ -108,9 +108,15 @@ struct cpuinfo_topology { > }; > > struct cpuinfo_x86 { > - __u8 x86; /* CPU family */ > - __u8 x86_vendor; /* CPU vendor */ > - __u8 x86_model; > + union { > + struct { > + __u8 x86_vendor; /* CPU vendor */ > + __u8 x86; /* CPU family */ > + __u8 x86_model; > + __u8 x86_reserved; > + }; > + __u32 x86_vfm; /* combined vendor, family, model */ > + }; > __u8 x86_stepping; Why are you leaving out stepping? And since we want to simplify all this, why aren't we replacing all f/m/s checks by using the whole CPUID(1).EAX u32 instead? Then the macros need to build that CPUID leaf simply. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette