Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1114698lqo; Fri, 17 May 2024 11:04:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXF7Slp8nL1UJaxSrWkvxZqjepzsF4vJYZxJ/hOQLyo00Hi1SUIogJ9maAG9knCQzjekuTKcc8QsKH7MY4XNGQw7xv2rIzLJ/rmiNA7rg== X-Google-Smtp-Source: AGHT+IFHk3uQ2ZMTANjIEdn+kAkLgTMFJlSPXo3IzzrXuIc8LgHXv218byXhuCxtFBA+NZE2pXma X-Received: by 2002:ac2:53aa:0:b0:523:8f4c:6a5 with SMTP id 2adb3069b0e04-5238f4c0786mr7868174e87.17.1715969059488; Fri, 17 May 2024 11:04:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715969059; cv=pass; d=google.com; s=arc-20160816; b=bhCCK0ADjHMmjE+JirwnBFj5wEEacD4WwCMXCR6rx+mFSturopd3mqKKiowj0v/LkX 4mblR0UrRBeIRFUotRlELaaS9B12AEl4YC+FMlHliIAabTXgC9/D3nRU6KlOw9SYy3zq xmsRU1uZqMwA+MDtzv9ogFbw11colNAnLo8+S4bLwIeaksfK5iOXBW5UJgG9YpogyOC8 WhKJeBue6CDhrM24m9PZYHZXCWKZc2t8x8F57MI2qE7pQw17mciUZ+JaRlygJBAy7oKg 2A4ZEy0Se3WDFzhiMTtHZMw8WqnLlamUwKm6l/6v24DQ1rR5wJLuO+LnuiDGOKZ0qwuq A7zw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:references:in-reply-to :user-agent:subject:cc:to:from:date:dkim-signature:dkim-filter; bh=szLPbiQdc8E9uUoOZsNWX0bh8PnKr+5DS2+bIeNO6nI=; fh=q+0K2S5ZstHY8ubldZUy32Z3to/ZyJXiAEdchrh2We0=; b=jUKjm5x02ujq2F7/k2WEhlw0hWo+42pXEiO1FFzPAMD8Qa6YsgcU8y/v9MY1FCa8Tc bFlhaGuVo8ewhGg3NXo+O7+c4+MwonG4HFlTDPq5eZuk+wsBP6SR1sWCr8wOv0RFYowe nS+UOXN2ExkEMSocQnpe1SlSYqzGVhL/Sy8e1xv3y5jdMPJOPZ/OX0Ft7HTGvGMksZo7 UBuKcukEF8VF2Y6C/vQN0+m/Hl3oQKqelmA9cTfUm36U9VDkbEVGehXob4KVRyScjfmT 0lo04TxQTpPh5pdiHg0ldebposlMZ++X79ocnEWLKImaA3SWRre5uQWzwojvhDYzwd5N uviQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@zytor.com header.s=2024051501 header.b=GFgwwms4; arc=pass (i=1 spf=pass spfdomain=zytor.com dkim=pass dkdomain=zytor.com dmarc=pass fromdomain=zytor.com); spf=pass (google.com: domain of linux-kernel+bounces-182489-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182489-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a1793c4e1si1023156566b.151.2024.05.17.11.04.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 11:04:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182489-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=@zytor.com header.s=2024051501 header.b=GFgwwms4; arc=pass (i=1 spf=pass spfdomain=zytor.com dkim=pass dkdomain=zytor.com dmarc=pass fromdomain=zytor.com); spf=pass (google.com: domain of linux-kernel+bounces-182489-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182489-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com 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 3D4FC1F28085 for ; Fri, 17 May 2024 17:56:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CA4C413E037; Fri, 17 May 2024 17:47:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="GFgwwms4" Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (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 8A10213DDB6 for ; Fri, 17 May 2024 17:47:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.136 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715968030; cv=none; b=o69r5fBcaRE9bMPwa0H20HCmhn6pNqjKmXOpcs4GZ85FGLzalCRTlDLhwbniawkPipfyGUyA0C4eAY6GhyceisVTh1RYJk/fYjGxe1T0esWCJ6yRfaYXhec3jP6yMjzJjIq8ovJE+6jlNmi/xuq9EouuutwpYwvandkil87TpLc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715968030; c=relaxed/simple; bh=s953sk5n/NeAVDdd0aV9BvqgcCqXLRcDa7PuZ5KTB2Y=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=aYIHJ94r3J5U9Q7gs/TnGv/gHyp8uLvLwlNXFFmzl4G9CRfqyMmqhi6MfGsbnZXyxIVE0bNw6qUSrrV2wzDRldyHCUnueWdRpNUqHTTr1rntaAMwhGNo8dlv3m45DCWc4J3cwEcD2ld9jUoqw6GUszhbob37BIi9Id7GfTx104c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=GFgwwms4; arc=none smtp.client-ip=198.137.202.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Received: from [127.0.0.1] ([76.133.66.138]) (authenticated bits=0) by mail.zytor.com (8.17.2/8.17.1) with ESMTPSA id 44HHkXfw2564600 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Fri, 17 May 2024 10:46:33 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 44HHkXfw2564600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2024051501; t=1715967994; bh=szLPbiQdc8E9uUoOZsNWX0bh8PnKr+5DS2+bIeNO6nI=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=GFgwwms4oINnKXr9a1/WH2hk+eP/pBzaMX5lPQ6flzW7Cy7jq4tPYL1i6vbwlGv8X kj0gUpJhasAfTqxccA70htdQZxbjQpUZ6Q3cEx7nreeMjp7d7/P5KSWArDSGGeQqJM hIAkDvZ0jED5Me86FZs4Sw2eZoNLFOfpyKX7lZRed3NGJZKr3i2qJHdDscIU8l+MNA Mc0kJlhU9iSfoxxE2pnP7jXmUxVzVrt5vdi/eqXFXsgPdd9KNpOJZBiJUyUQ/iFB0j mqdgnAS3GnsjKcmek0rMEUNFZvQGiHS5LDY7w6LIGruFG0McAUwUnPq/hfyfKw8Fyg h5aa/mWoTFMFQ== Date: Fri, 17 May 2024 10:46:29 -0700 From: "H. Peter Anvin" To: Borislav Petkov , Tony Luck CC: Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, "Peter Zijlstra (Intel)" , Uros Bizjak , Rick Edgecombe , Arnd Bergmann , Mateusz Guzik , Thomas Renninger , Greg Kroah-Hartman , Andi Kleen , linux-kernel@vger.kernel.org, patches@lists.linux.dev Subject: =?US-ASCII?Q?Re=3A_=5BPATCH_v3=5D_x86/cpu=3A_Fix_x86=5Fmatch?= =?US-ASCII?Q?=5Fcpu=28=29_to_match_just_X86=5FVENDOR=5FINTEL?= User-Agent: K-9 Mail for Android In-Reply-To: <20240517173811.GFZkeWAzKjYtEMwe1e@fat_crate.local> References: <20240517172134.7255-1-tony.luck@intel.com> <20240517173811.GFZkeWAzKjYtEMwe1e@fat_crate.local> Message-ID: 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-Transfer-Encoding: quoted-printable On May 17, 2024 10:38:11 AM PDT, Borislav Petkov wrote: >On Fri, May 17, 2024 at 10:21:34AM -0700, Tony Luck wrote: >> diff --git a/arch/x86/kernel/cpu/match=2Ec b/arch/x86/kernel/cpu/match= =2Ec >> index 8651643bddae=2E=2E996f96cfce68 100644 >> --- a/arch/x86/kernel/cpu/match=2Ec >> +++ b/arch/x86/kernel/cpu/match=2Ec >> @@ -39,7 +39,7 @@ const struct x86_cpu_id *x86_match_cpu(const struct x= 86_cpu_id *match) >> struct cpuinfo_x86 *c =3D &boot_cpu_data; >> =20 >> for (m =3D match; >> - m->vendor | m->family | m->model | m->steppings | m->feature; >> + m->vendor | m->family | m->model | m->steppings | m->feature | m= ->flags; > >I think this should not do anything implicit even if it is correct but >should explicitly check > > if (!(m->flags & X86_CPU_ID_FLAG_VENDOR_VALID)) > continue; > >I don't have a clear idea how exactly yet - I need to play with it=2E > >Maybe this stupid flow in the loop should be finally fixed into >something more readable and sensible=2E=2E=2E > >Thx=2E > Thought: why don't we add VENDOR and CPUID as synthetic CPU feature flags = as well? Not saying it necessarily solves this specific problem but it migh= t make some other code more uniform=2E=20 Obviously on x86-64 CPUID is baseline; VENDOR might not be known, however= =2E