Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2167817lqt; Mon, 22 Apr 2024 03:37:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXNwSHDXJgOFgNWgabCw7SXtJ9qylxx9Y2S23mlZBwJCsp4D1B2t5ZylANhbUYAA+XWGE8SA0aWIPDZCdrLBeCdQeWLaqA3VBwl6wEzZw== X-Google-Smtp-Source: AGHT+IFD9iFyV8Z3Jmo8LooxccJdBJEEd7knRZlOWuJb/40VRk8zF+YHoRueZrzQUUTjpqxQL52U X-Received: by 2002:a17:906:fb86:b0:a52:5230:b076 with SMTP id lr6-20020a170906fb8600b00a525230b076mr6056849ejb.2.1713782235258; Mon, 22 Apr 2024 03:37:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713782235; cv=pass; d=google.com; s=arc-20160816; b=FvsuoH6I3KGwMbkHr2uxo2Qbn42ljQ0ytqKqyZCsv4tN9Lua3sM+CKNfGbHxLRaD2K wkL7BKktWAVQRErVdGVAAuO9vXRnU8g3F9b6OY4Sl0J4knuw1kjYVAGPl3knDq7ipOm/ UBZUNoRhz93xp0c6jRM1ViJ/2+RssKCHNXlzST42mqp6cUKbKQfGNygNyENQvbINNa1w yKzn2YQ1cI0WztiwaFknXsdWQx/njKlnNhHnZMtlBiI6G7aLUZB12KYDyFOwbUmgrIgH 74XVZ/H9hi+mIXPFVWDWdyk1hA9TH1R4r0Ht7BNXSNMHUliePFM3WFVhZGq7vVqUFI5e Ne2Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=k36/OzTuWnVZCdzvGZGEbyXGQwInx3at1IQn4KQjoFk=; fh=nc0fknZ7Ugza3bm9KD5ejx8UDmqPehkw9JKfTDY6F6I=; b=zq5LygVUYrSfdN9nUYZoz8HbdqoxX0PD3lJlCWzyZIXG6oitj5PFK/hI7iygOlAj0D M/9TLZ0ByAkt1SA2q8U+mWMk9JSLBrvrozhOM7OlFieKYh0AgRYYf2fJfvGeVNAoL7m2 S23vpY7cSnGta78vsHYPWbx4LxR8T5KM4y6EEq4RX2GugkIxNAsCYEDFEZ7pm0wrLaEn knbQxZQhFYq9rQvKUqC0p6PqRtxD7rhb/6hy0iEDZTJKdzRSgUYZ8i/ZPujbqpJmtMJK Aw/VU0SNZ5RnPc8+HzJHEYfBTv1cl5q+QfBTkmgD34dOyfmo3lGnDXx84k0cHbF49X/c 32cw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=43hEQLjB; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=P0bS7eSC; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-153145-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153145-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id kt6-20020a170906aac600b00a55b1959c82si1475042ejb.285.2024.04.22.03.37.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 03:37:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153145-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=43hEQLjB; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=P0bS7eSC; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-153145-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153145-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5C49E1F224D4 for ; Mon, 22 Apr 2024 10:01:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1CE1D13E400; Mon, 22 Apr 2024 10:01:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="43hEQLjB"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="P0bS7eSC" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 E7E8012837C; Mon, 22 Apr 2024 10:01:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713780077; cv=none; b=quB8KiCB3RgNGObZaunaIsoHQSkfAcfac9CenUabqJfKN50mHgLwVW/fqSXIy1tElXtTNjs4PJMGudbY2JT8s9uDm84UARCh3Vmc6E7piZDryFFyqhBrYZtD7RK/pKEKtiOANarMM4/uelhFOfhtPGw/e7dnPPnT9F7a0hjlhDk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713780077; c=relaxed/simple; bh=KiS5jBM9kAdav3nfwdQ3HeNKVj2AIlwsVJFHBYU+x+A=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=oJMGWHDFCkL+nyE7aWpUdfyk8sjxhNo+QhK7JGlMlHo+oGRw3LNVvOSbVi4c1xxAdnzxRvJhr9LR31z80u0WJbPxKOY2W/SA7cM+B+gVl8CnaVqwIHq+Mkc/weXn/WT7m32DQS9OHIm7HbTWnLof+ZKIZXW1LquwAgAdaJWOmBI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=43hEQLjB; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=P0bS7eSC; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Mon, 22 Apr 2024 10:01:08 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1713780071; h=from:from:sender:sender:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k36/OzTuWnVZCdzvGZGEbyXGQwInx3at1IQn4KQjoFk=; b=43hEQLjB4sl/83AyyjjeDLq2Qo6GHWGfQokopMEX/uF9FFwylqNFdxYei8ticn8qfSY4Ng ZlElczdWcd804n0wZTK2XS75VyvcHejlwtid2Vs+/TAuUyUheGADFhMpHO9hwjaKa3wwu5 xBoW1uy+kpBSr0gFjv2t1OnhJlqhVdfp/WWrB9FKDDMPWRWM+gOQxZdlIt7sEo9AFM8OJf EgDNeEH/d6xjve3nndtFn0fZkxI4rv9d7GtmmGrwB/tvd7jGBnIexWABtjNyMgISr9y7y1 pvsj+9J57ZuHajUB69bb0U2OmFqOh04OOv+Nr62B8Pbqnsvhy2hogFdsS/cmLg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1713780071; h=from:from:sender:sender:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k36/OzTuWnVZCdzvGZGEbyXGQwInx3at1IQn4KQjoFk=; b=P0bS7eSCTvZfeOmsn+/uRwN7sKz6Xfi8aGaX+SmFkbSB8nUeOf7NNs8UVTn9iJj7ZWPawu xh3Jcsy58DwWEkAQ== From: "tip-bot2 for Tony Luck" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cpu] x86/cpu/vfm: Add/initialize x86_vfm field to struct cpuinfo_x86 Cc: Tony Luck , "Borislav Petkov (AMD)" , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240416211941.9369-2-tony.luck@intel.com> References: <20240416211941.9369-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 Message-ID: <171378006893.10875.6298031558412078369.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the x86/cpu branch of tip: Commit-ID: a9d0adce69075192961f3be466c4810a21b7bc9e Gitweb: https://git.kernel.org/tip/a9d0adce69075192961f3be466c4810a21b7bc9e Author: Tony Luck AuthorDate: Tue, 16 Apr 2024 14:19:03 -07:00 Committer: Borislav Petkov (AMD) CommitterDate: Mon, 22 Apr 2024 11:43:48 +02:00 x86/cpu/vfm: Add/initialize x86_vfm field to struct cpuinfo_x86 Refactor struct cpuinfo_x86 so that the vendor, family, and model fields are overlaid 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. See https://lore.kernel.org/r/Zgr6kT8oULbnmEXx@agluck-desk3 for why the ordering is (low-to-high bits): (vendor, family, model) [ bp: Move comments over the line, add the backstory about the particular order of the fields. ] Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Thomas Gleixner Link: https://lore.kernel.org/r/20240416211941.9369-2-tony.luck@intel.com --- arch/x86/include/asm/processor.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 811548f..e0f9251 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -108,9 +108,23 @@ struct cpuinfo_topology { }; struct cpuinfo_x86 { - __u8 x86; /* CPU family */ - __u8 x86_vendor; /* CPU vendor */ - __u8 x86_model; + union { + /* + * The particular ordering (low-to-high) of (vendor, + * family, model) is done in case range of models, like + * it is usually done on AMD, need to be compared. + */ + struct { + __u8 x86_model; + /* CPU family */ + __u8 x86; + /* CPU vendor */ + __u8 x86_vendor; + __u8 x86_reserved; + }; + /* combined vendor, family, model */ + __u32 x86_vfm; + }; __u8 x86_stepping; #ifdef CONFIG_X86_64 /* Number of 4K pages in DTLB/ITLB combined(in pages): */