linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: Rik van Riel <riel@surriel.com>,
	Michael Kelley <mhklinux@outlook.com>,
	"x86@kernel.org" <x86@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kernel-team@meta.com" <kernel-team@meta.com>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"luto@kernel.org" <luto@kernel.org>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"bp@alien8.de" <bp@alien8.de>, "hpa@zytor.com" <hpa@zytor.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [RFC PATCH v2 00/11] AMD broadcast TLB invalidation
Date: Fri, 10 Jan 2025 13:29:13 -0600	[thread overview]
Message-ID: <00294e7e-dcd8-f940-372e-070b8d174582@amd.com> (raw)
In-Reply-To: <d09a9b6a06d3017a27ace549876b739fa39e3aed.camel@surriel.com>

On 12/25/24 08:48, Rik van Riel wrote:
> On Tue, 2024-12-24 at 18:08 +0000, Michael Kelley wrote:
>> From: riel@surriel.com <riel@surriel.com> Sent: Sunday, December 22,
>> 2024 6:55 PM
>>
>>>
>>> Add support for broadcast TLB invalidation using AMD's INVLPGB
>>> instruction.
>>
>>> 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.
>>>
>>> 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.
>>
>> Rik --
>>
>> 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?
>>
> 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 :)

Note that global ASIDs (relative to VMs) are different from the broadcast
ASIDs being used here. IIUC, the broadcast ASIDs here get translated to a
PCID value (kern_pcid(asid) or user_pcid(asid) in patch #9).

Thanks,
Tom

> 
> 


      reply	other threads:[~2025-01-10 19:29 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-23  2:55 Rik van Riel
2024-12-23  2:55 ` [PATCH 01/11] x86/mm: make MMU_GATHER_RCU_TABLE_FREE unconditional Rik van Riel
2024-12-23  6:01   ` Qi Zheng
2024-12-23 20:20     ` Rik van Riel
2024-12-24 18:26   ` Peter Zijlstra
2024-12-23  2:55 ` [PATCH 02/11] x86/mm: add X86_FEATURE_INVLPGB definition Rik van Riel
2024-12-23  2:55 ` [PATCH 03/11] x86/mm: get INVLPGB count max from CPUID Rik van Riel
2024-12-25 23:42   ` Nadav Amit
2024-12-23  2:55 ` [PATCH 04/11] x86/mm: add INVLPGB support code Rik van Riel
2024-12-23  2:55 ` [PATCH 05/11] x86/mm: use INVLPGB for kernel TLB flushes Rik van Riel
2024-12-23  2:55 ` [PATCH 06/11] x86/tlb: use INVLPGB in flush_tlb_all Rik van Riel
2024-12-23  2:55 ` [PATCH 07/11] x86/mm: use broadcast TLB flushing for page reclaim TLB flushing Rik van Riel
2024-12-23  2:55 ` [PATCH 08/11] x86/mm: enable broadcast TLB invalidation for multi-threaded processes Rik van Riel
2024-12-25 23:22   ` Nadav Amit
2024-12-25 23:32   ` Nadav Amit
2024-12-23  2:55 ` [PATCH 09/11] x86,tlb: do targeted broadcast flushing from tlbbatch code Rik van Riel
2024-12-23  2:55 ` [PATCH 10/11] x86/mm: enable AMD translation cache extensions Rik van Riel
2024-12-23  2:55 ` [PATCH 11/11] x86/mm: only invalidate final translations with INVLPGB Rik van Riel
2024-12-24 18:08 ` [RFC PATCH v2 00/11] AMD broadcast TLB invalidation Michael Kelley
2024-12-25 14:48   ` Rik van Riel
2025-01-10 19:29     ` Tom Lendacky [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=00294e7e-dcd8-f940-372e-070b8d174582@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@kernel.org \
    --cc=mhklinux@outlook.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=riel@surriel.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox