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 D705226F47A for ; Tue, 18 Feb 2025 17:25:30 +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=1739899536; cv=none; b=ga4tiAEcnS5T+tegVby/lbLeoq2EobaN7HLJWnV8fUnw29KUNgG3LD6Jg/a02NcCfZvcNRlNcdP3N530BOsbe3BwVTOuxodJNwgZa57DByD/LoatDbrr/NXW4TH86yL+o3e1V7d8BwpmUIriVqb5l2Z+RXPlCE1K6NpeVlnsGgc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739899536; c=relaxed/simple; bh=jIjWwTqmLkRYVuVzekJHRmVz9JXd3OsVTNTvdc+S2bY=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=DjADkp5MZKf42ViTHkP3SyRyUEOkr/S0qhQjNHmTwMDw/8dJbozQfM/SW8bvf1nLQ89diwg6McYGZAkD8C63p6j2FD+BOFKJbFAvAGDt2qvRZ6GpWoXVchncXhhxMxpHSv5KiJHYN5/zIxyc1qUQQ/CmIqwIS7LXgp7I8QohRPg= 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 1tkRJg-000000002oZ-121S; Tue, 18 Feb 2025 12:23:28 -0500 Message-ID: <78e2f84848a6515b903cc3660b829b5bcd378f12.camel@surriel.com> Subject: Re: [PATCH v11 05/12] x86/mm: add INVLPGB support code From: Rik van Riel To: Dave Hansen , x86@kernel.org Cc: linux-kernel@vger.kernel.org, bp@alien8.de, peterz@infradead.org, dave.hansen@linux.intel.com, zhengqi.arch@bytedance.com, nadav.amit@gmail.com, thomas.lendacky@amd.com, kernel-team@meta.com, linux-mm@kvack.org, akpm@linux-foundation.org, jackmanb@google.com, jannh@google.com, mhklinux@outlook.com, andrew.cooper3@citrix.com, Manali Shukla Date: Tue, 18 Feb 2025 12:23:28 -0500 In-Reply-To: References: <20250213161423.449435-1-riel@surriel.com> <20250213161423.449435-6-riel@surriel.com> Autocrypt: addr=riel@surriel.com; prefer-encrypt=mutual; keydata=mQENBFIt3aUBCADCK0LicyCYyMa0E1lodCDUBf6G+6C5UXKG1jEYwQu49cc/gUBTTk33A eo2hjn4JinVaPF3zfZprnKMEGGv4dHvEOCPWiNhlz5RtqH3SKJllq2dpeMS9RqbMvDA36rlJIIo47 Z/nl6IA8MDhSqyqdnTY8z7LnQHqq16jAqwo7Ll9qALXz4yG1ZdSCmo80VPetBZZPw7WMjo+1hByv/ lvdFnLfiQ52tayuuC1r9x2qZ/SYWd2M4p/f5CLmvG9UcnkbYFsKWz8bwOBWKg1PQcaYHLx06sHGdY dIDaeVvkIfMFwAprSo5EFU+aes2VB2ZjugOTbkkW2aPSWTRsBhPHhV6dABEBAAG0HlJpayB2YW4gU mllbCA8cmllbEByZWRoYXQuY29tPokBHwQwAQIACQUCW5LcVgIdIAAKCRDOed6ShMTeg05SB/986o gEgdq4byrtaBQKFg5LWfd8e+h+QzLOg/T8mSS3dJzFXe5JBOfvYg7Bj47xXi9I5sM+I9Lu9+1XVb/ r2rGJrU1DwA09TnmyFtK76bgMF0sBEh1ECILY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dQj4O7xxvdg865TLeLpho5PwDRF+/mR3qi8CdGbkE c4pYZQO8UDXUN4S+pe0aTeTqlYw8rRHWF9TnvtpcNzZw== Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 (3.54.3-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-02-14 at 10:22 -0800, Dave Hansen wrote: > On 2/13/25 08:13, Rik van Riel wrote: > > Add invlpgb.h with the helper functions and definitions needed to > > use > > broadcast TLB invalidation on AMD EPYC 3 and newer CPUs. >=20 > You should also note here that (or if??) all these functions get used > later in the series. >=20 You made me look, and there was indeed one helper function that is not being used. I removed it, and added in the commit message that all the (remaining) functions are used. > > +/* Flush addr, including globals, for all PCIDs. */ > > +static inline void invlpgb_flush_addr_nosync(unsigned long addr, > > u16 nr) > > +{ > > + __invlpgb(0, 0, addr, nr - 1, 0, INVLPGB_INCLUDE_GLOBAL); > > +} >=20 > Something about the "nr - 1"'s needs to get mentioned *somewhere*. I > think the best place is actually in __invlpgb(). Basically make the > calling convention for __invlpgb() be the _sane_ thing where nr=3D=3D1 > flushes 1 page. Then do the nr-=3D1 in __invlpgb() and document why. >=20 > I don't mean to insult the AMD ISA designers here. I might have done > the > same thing. But the software to use the instruction ends up looking > really funky. It would be great to limit the number of places that > deal > with the funkiness to exactly 1. >=20 > With those two nits addressed: >=20 > Acked-by: Dave Hansen Nits addressed, and the Acked-by header added to the next version :) Thank you! --=20 All Rights Reversed.