Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2289013lqp; Sun, 24 Mar 2024 11:31:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWfAkr/ssBOHSECaHC/BrctyJxpHBTSjcMtvJv6IYhL4w11pudALaFgouP4/hFP1/+A+0ndzx5tl82axa1Nz7Nklgh39oASMi8OiK4rpg== X-Google-Smtp-Source: AGHT+IFG4P2fd0nsxxgdaz4Y7keKzlWfHZwlnrOD9dOtLxCRj8sBLdELiJOzMQDPRp34ANvTsXJP X-Received: by 2002:a05:6a00:3d51:b0:6e7:9a5e:3b45 with SMTP id lp17-20020a056a003d5100b006e79a5e3b45mr5577733pfb.11.1711305109497; Sun, 24 Mar 2024 11:31:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711305109; cv=pass; d=google.com; s=arc-20160816; b=tPXR7h+J9JJUuvLlm3WVnK1cVRmSJpBtLgMjEuaAmSvveQNmtnNJe4r85eOgxYjEx1 ZTHSi4FSPNEparD6OoDoDiuWHNJ7jNiLzXFGQkHDqGgZrm7vx4u9nyjMwdK8h93xV5BM w0p0APpOIpozWEwCxS4RownsFw2+V/8ky9BOOjlOFafwaI2biLKh6QGgtAu0gLZd9aUc 1sV2Vt+DLkhMLEptsG3vpQC79dygwQja7I3TD+q/ypmUWwwCXxUIrI0dKKWEKs6HubDm MBv6S8udLEoMb4TEMkkO2EJi3vntK/UZX2f1GrFXynzYmjAGTRIAQkKFG7J0krw6Atp3 zS0g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=aolOflWZr/7wKHKycroU/AWobCE8FzusJlo2jYPu33Q=; fh=veT8tUjYswqpDkFB5HJcLsTlYvVVBAqy+yF+fgm0qQU=; b=mUGPiCrkTcWtzR3Qa/q+2H48ZRVuHc9oC8D8utlgpANUf5b5Y8sfhRcbeCCsYPKZzd SO3/hEde9AtSBM1x81FxaBQVYnFCI6BsByAoQH2Jln51rTlEvAjIkWIs5UHU+hdtG7cE nBMVPvxNAabOM9OIpQ4S8mtc03p++y5T7CSeMatn1d8m6Fp1a/PNxVCmIHp79HSLTnJQ oPukSTJbsTdX8Qnz2inLdZBi5z56DPHAhQVgouULw3BVE7pzquZ5l0+2yOFLu22Umohx iuus+2aaNEhHOAuD4Z7HsouJU+L/oLbg32Wh7G0op0lj7Quo+Sy3xqHJNU94O96nsm5l wdfg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=SMb0ksJ4; arc=pass (i=1 spf=pass spfdomain=xry111.site dkim=pass dkdomain=xry111.site dmarc=pass fromdomain=xry111.site); spf=pass (google.com: domain of linux-kernel+bounces-112805-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112805-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t3-20020a625f03000000b006e645833308si3653538pfb.277.2024.03.24.11.31.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 11:31:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112805-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=@xry111.site header.s=default header.b=SMb0ksJ4; arc=pass (i=1 spf=pass spfdomain=xry111.site dkim=pass dkdomain=xry111.site dmarc=pass fromdomain=xry111.site); spf=pass (google.com: domain of linux-kernel+bounces-112805-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112805-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site 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 F3B3C281839 for ; Sun, 24 Mar 2024 18:31:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 025AB7475; Sun, 24 Mar 2024 18:31:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=xry111.site header.i=@xry111.site header.b="SMb0ksJ4" Received: from xry111.site (xry111.site [89.208.246.23]) (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 8EF4815BF for ; Sun, 24 Mar 2024 18:31:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=89.208.246.23 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711305105; cv=none; b=dgDb+CNtIQyQaAyiAGHrpR0RFiaRt1Pb0H7tEGvbmRahqVXm5JKHSLfh38nk+tFSNWdh+IhtUdoDlTYeeBXTec9lOYLBt2xQucDYIG6BdVCeQBqf2otY/Xx5elZraYBxwK7KLeOfJ3Y1b/tHLbE6KeNIRZ9DJAibE7Piymc3Jtk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711305105; c=relaxed/simple; bh=uT3yI8Uw1SouPMeSzpY+y7bPttkZ7cNJNJQKqFxOnT4=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=Zvh7rR5ziE/RPv83+5RbkJKxW5N9H5YVb5rXbFlRbPl8NFOAzzZHviwDIx8GaiKyxfJDTtUYD2bJHDeV7k5Jf6A45LBr1cjNS0oIDcj5GajksBAFJXeHw+6WhutK/rxdMbbKQhI4aPFonpRCBiP8NvkKsyNEr61KUdBbjtlQPnQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=xry111.site; spf=pass smtp.mailfrom=xry111.site; dkim=pass (1024-bit key) header.d=xry111.site header.i=@xry111.site header.b=SMb0ksJ4; arc=none smtp.client-ip=89.208.246.23 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xry111.site DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1711305100; bh=uT3yI8Uw1SouPMeSzpY+y7bPttkZ7cNJNJQKqFxOnT4=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=SMb0ksJ4ugEmykdfN1+cHUKjBNnqFS5Yvc7N+COJTWzMbY5Tk1eOlo4P5a9s7vxff d8dny4h8VHVT0M0d1Og6mq9BzCgQ2IwwTGdcjwKPaJhfqBbqQCL47bL1U1cq9T7RRA ZSPftAmjtlBOkU1QlYW8kFrPPktW+/vOJa0Jz2RM= Received: from [127.0.0.1] (unknown [IPv6:2001:470:683e::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 128CD1A3FB4; Sun, 24 Mar 2024 14:31:38 -0400 (EDT) Message-ID: <6cb0333cb0e60aa9f7e914af26c605d075f90d61.camel@xry111.site> Subject: Re: [PATCH] x86/mm: Don't disable INVLPG if "incomplete Global INVLPG flushes" is fixed by microcode From: Xi Ruoyao To: Dave Hansen Cc: Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org Date: Mon, 25 Mar 2024 02:31:37 +0800 In-Reply-To: <319db7f3-7ce1-4096-a168-e5869c7a42f6@intel.com> References: <20240324170630.76084-1-xry111@xry111.site> <319db7f3-7ce1-4096-a168-e5869c7a42f6@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Sun, 2024-03-24 at 11:29 -0700, Dave Hansen wrote: > On 3/24/24 10:06, Xi Ruoyao wrote: > > +/* > > + * INVLPG issue is fixed with intel-microcode-20240312 for all > > + * affected models.=C2=A0 This table is taken from the release note > > + * of this microcode release. > > + */ >=20 > That comment is much more changelog material than code comment material. >=20 > > +static const struct x86_cpu_desc invlpg_miss_fixed_ucode[] =3D { > > + INTEL_CPU_DESC(INTEL_FAM6_ALDERLAKE, 2, 0x34), > > + INTEL_CPU_DESC(INTEL_FAM6_ALDERLAKE, 5, 0x34), > > + INTEL_CPU_DESC(INTEL_FAM6_ALDERLAKE_L, 3, 0x432), > > + INTEL_CPU_DESC(INTEL_FAM6_ALDERLAKE_L, 4, 0x432), > > + INTEL_CPU_DESC(INTEL_FAM6_ATOM_GRACEMONT, 0, 0x15), > > + INTEL_CPU_DESC(INTEL_FAM6_RAPTORLAKE, 1, 0x122), > > + INTEL_CPU_DESC(INTEL_FAM6_RAPTORLAKE_P, 2, 0x4121), > > + INTEL_CPU_DESC(INTEL_FAM6_RAPTORLAKE_P, 3, 0x4121), > > + INTEL_CPU_DESC(INTEL_FAM6_RAPTORLAKE_S, 2, 0x34), > > + INTEL_CPU_DESC(INTEL_FAM6_RAPTORLAKE_S, 5, 0x34), > > + {} > > +}; >=20 > Why is this listing individual steppings?=C2=A0 That seems nuts when the > issue affects *all* steppings or at least the invlpg_miss_ids[] table > says it affects all steppings. >=20 > The right way to do this is to take the existing table: >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 INTEL_MATCH(INTEL_FAM6_ALDERLA= KE=C2=A0=C2=A0 ), > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 INTEL_MATCH(INTEL_FAM6_ALDERLA= KE_L ), > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 INTEL_MATCH(INTEL_FAM6_ATOM_GR= ACEMONT ), >=20 > and simply add the fix version: >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 INTEL_WHATEVER(INTEL_FAM6_ALDE= RLAKE,=C2=A0 =C2=A0 0x034), > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 INTEL_WHATEVER(INTEL_FAM6_ALDE= RLAKE_L,=C2=A0 =C2=A0 0x432), > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 INTEL_WHATEVER(INTEL_FAM6_ATOM= _GRACEMONT, 0x015), >=20 > Then you do: >=20 > c =3D x86_match_cpu(invlpg_miss_ids); > if (boot_cpu_data.microcode >=3D c->data) > return 0; // no mitiagtion > // affected, do mitigation >=20 > Then there's *one* table listing each model once and no steppings.=C2=A0 = I > thought there's another example of this _somewhere_ but I couldn't find > it in two minutes of grepping. Hmm, I also thought there should be this thing but I couldn't find it... Let me try again. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University