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 F1C493B19A for ; Wed, 25 Dec 2024 14:49:11 +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=1735138160; cv=none; b=PnP+qTC2nQOu57n9/Bsw6ISq4Q8oA8xhedmfclO8xGW4ohVQ42LII8bowzbFvWEeH4zgFlDFKvlk8PzR8kERhLoa7SsxUiCzwHVogKsGfSbJhE5LawvRV2vnVufrYY27sGV5Ew7Bpw0BpJhCF0pkeN4Rtx+sCHpZL6TM6npNA34= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735138160; c=relaxed/simple; bh=lkCm6LOsNRpKndVyxEkkdsl82NHdGOxAh0Rgqb3XKTU=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=MhZ7WUrgWmqVpZNj6CxiC189lDOPNZdBB9Rb+ixniRejsZCxvb0WUt0dfOmbmpZM35KuhpWhUFGlrzx2w4FiQr82RNIV7ew06jh6o72o+GqEUNcc4366sUgrGJpuUyvr8CEoC0ZRZgglW5X8Eer5d2lVEH2O8iyyUQ4ry41SeM0= 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 1tQSga-000000006fM-3AIy; Wed, 25 Dec 2024 09:48:32 -0500 Message-ID: Subject: Re: [RFC PATCH v2 00/11] AMD broadcast TLB invalidation From: Rik van Riel To: Michael Kelley , "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" , "linux-mm@kvack.org" Date: Wed, 25 Dec 2024 09:48:32 -0500 In-Reply-To: References: <20241223025751.3268975-1-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 Tue, 2024-12-24 at 18:08 +0000, Michael Kelley wrote: > From: riel@surriel.com=C2=A0 Sent: Sunday, December 22, > 2024 6:55 PM >=20 > >=20 > > Add support for broadcast TLB invalidation using AMD's INVLPGB > > instruction. >=20 > > This allows the kernel to invalidate TLB entries on remote CPUs > > without > > needing to send IPIs, without having to wait for remote CPUs to > > handle > > those interrupts, and with less interruption to what was running on > > those CPUs. > >=20 > > Because x86 PCID space is limited, and there are some very large > > systems out there, broadcast TLB invalidation is only used for > > processes that are active on 3 or more CPUs, with the threshold > > being gradually increased the more the PCID space gets exhausted. >=20 > Rik -- >=20 > What is this patch set's expectation about INVLPGB and TLBSYNC > availability and usage in a VM? I see that INVLPGB and TLBYSNC > behavior in a VM is spec'ed in the AMD Programmer's Manual, but > I wonder about their impact in a multi-tenant host like in a public > cloud environment. And given what this patch set does in assigning > global ASIDs, should X86_FEATURE_INVLPGB be disabled if > running in a VM where the hypervisor for whatever reason has > enabled INVLPGB/TLBSYNC in its VMs? >=20 This patch series enables bare metal INVLPGB functionality. Virtual machines should probably not expose the INVPLGB CPUID feature bit to guests, since virtual machine invalidation seems to work differently than bare metal invalidation. For one, the ASID seems to actually mean something in SVM context, while trying to use the ASID in bare metal blows up :) --=20 All Rights Reversed.