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 249A3E574 for ; Mon, 6 Jan 2025 17:32:59 +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=1736184790; cv=none; b=hZCUw4IRCCfDo7wodBiGGnurn2QHf5biIOzjRB50a6G93yTGi3v4ctU3AZyh85iOaqenRN8Dykk3w+pAFe2FjO+sxa8vsjcCvmha3ZhvL3+vtj+j5Sy0tuCFBo/3oi/Pt+hGUhYkoCbHeXmNMS4wOD85fjhyckXnQ0iXGeD48Jo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736184790; c=relaxed/simple; bh=1+vdJuLjvXqIcoVEdYZHlvPsVNML7n9ntXtC9IJ3n6U=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=h/nKNl2vLZvxZhtrr9V7kMavqMFzpA9E5uXmhQw/VZmlAZ9NmSlzvoP0sc7LQnnZwRJWd/S3n6ygs32qmHtebYfNQRf465LZnA5ksuV/0yi6AZ0T4eWFnS/N73iM51x0IPwo6T8DQbaxN94i4+wcVlW14cR1P/Xm5I1nXokChng= 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 1tUqxy-000000004C7-3kDw; Mon, 06 Jan 2025 12:32:38 -0500 Message-ID: Subject: Re: [PATCH 05/12] x86/mm: add INVLPGB support code From: Rik van Riel To: Dave Hansen , Borislav Petkov Cc: x86@kernel.org, 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, hpa@zytor.com, akpm@linux-foundation.org, nadav.amit@gmail.com, zhengqi.arch@bytedance.com, linux-mm@kvack.org Date: Mon, 06 Jan 2025 12:32:38 -0500 In-Reply-To: <0de32bbc-66e9-4875-af87-7a2fa2e03e39@intel.com> References: <20241230175550.4046587-1-riel@surriel.com> <20241230175550.4046587-6-riel@surriel.com> <20250102124247.GPZ3aJx8JTJa6PcaOW@fat_crate.local> <0de32bbc-66e9-4875-af87-7a2fa2e03e39@intel.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 Mon, 2025-01-06 at 08:50 -0800, Dave Hansen wrote: > On 1/2/25 04:42, Borislav Petkov wrote: > > > +#define INVLPGB_VA BIT(0) > > > +#define INVLPGB_PCID BIT(1) > > > +#define INVLPGB_ASID BIT(2) > > > +#define INVLPGB_INCLUDE_GLOBAL BIT(3) > > > +#define INVLPGB_FINAL_ONLY BIT(4) > > > +#define INVLPGB_INCLUDE_NESTED BIT(5) > > Please add only the defines which are actually being used. Ditto > > for the > > functions. >=20 > There's some precedent for defining them all up front, like we did > for > invpcid_flush_*(). >=20 > For INVPCID, there are four variants and two of them got used up > front. > But I get that it's a balancing act between having untested code that > might bitrot and introducing helpers at a time when someone (Rik) is > very likely to get all the variants coded up correctly. >=20 > Rik, how many of these end up being used by the end of the series? >=20 Only invlpgb_flush_single_asid is unused at the end of the series. I'll remove that one. As for the bit flags, those are a hardware interface. I can remove the unused ones, but would like to know why :) --=20 All Rights Reversed.