From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (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 F220020DD43 for ; Fri, 10 Jan 2025 20:28:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=96.67.55.147 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736540887; cv=none; b=GyPRslHzQ5v57iPgur6v3kr4ad8PO0LZWX64P01XLRh9m0BB/kZiHKbM4hsykiEGTeXgkjVSansG5Qjz4Lyrev/tT5VVrWBJMHG5JH8iUYDJUgnDmo/roiWkz9SPLMPc3cWQf2yFlEZQa7hF+0Sa+/iUc/cPT5WeRH1lpG6mKFw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736540887; c=relaxed/simple; bh=9f/FlilOL9OL3MEoMbPJbe4AUfcBI6yFkqMCy6Znuao=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=OkipVgub98sYRi/i+nEdGMqvzOZoVC4y1UCGHdEoUi51ff+Z8gEHmF3Hp60ymToJvp0tTuSRJMDLwOwbFqZqHHhJMXyIiH9hI3tEAAgY3l+u79hy2WY1Vt5fBR2wC3n6Y6TWcsldR7QthhQ/yGuf+nvHTRYvdSgLiWKZxD2toig= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=surriel.com; spf=pass smtp.mailfrom=shelob.surriel.com; arc=none smtp.client-ip=96.67.55.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=surriel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shelob.surriel.com Received: from fangorn.home.surriel.com ([10.0.13.7]) by shelob.surriel.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.97.1) (envelope-from ) id 1tWLbV-000000006eO-3pwY; Fri, 10 Jan 2025 15:27:37 -0500 Message-ID: <3bf6f37a386ef8afeefee54202283023c0581f58.camel@surriel.com> Subject: Re: [PATCH 04/12] x86/mm: get INVLPGB count max from CPUID From: Rik van Riel To: Tom Lendacky , x86@kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, akpm@linux-foundation.org, nadav.amit@gmail.com, zhengqi.arch@bytedance.com, linux-mm@kvack.org Date: Fri, 10 Jan 2025 15:27:37 -0500 In-Reply-To: References: <20241230175550.4046587-1-riel@surriel.com> <20241230175550.4046587-5-riel@surriel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.1 (3.54.1-1.fc41) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sender: riel@surriel.com On Fri, 2025-01-10 at 12:44 -0600, Tom Lendacky wrote: > On 12/30/24 11:53, Rik van Riel wrote: > >=20 > > +++ b/arch/x86/kernel/cpu/amd.c > > @@ -1135,6 +1135,14 @@ static void cpu_detect_tlb_amd(struct > > cpuinfo_x86 *c) > > =C2=A0 tlb_lli_2m[ENTRIES] =3D eax & mask; > > =C2=A0 > > =C2=A0 tlb_lli_4m[ENTRIES] =3D tlb_lli_2m[ENTRIES] >> 1; > > + > > + if (c->extended_cpuid_level < 0x80000008) > > + return; >=20 > Can this just be based on cpu_feature_enabled(X86_FEATURE_TLBI), e.g: >=20 > if (cpu_feature_enabled(X86_FEATURE_TLBI)) > invlpgb_count_max =3D (cpuid_edx(0x80000008) & 0xffff) > + 1 >=20 I don't see X86_FEATURE_TLBI defined in the tip tree. Which CPUID bit does that need to be? > Then you can squash this and the previous patch. Heh, I already squashed the previous commit into what is patch 6 in this series, as requested by Borislav :) --=20 All Rights Reversed.