[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y1fsYwshJ93FT21r@hirez.programming.kicks-ass.net>
Date: Tue, 25 Oct 2022 16:02:11 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Jann Horn <jannh@...gle.com>
Cc: John Hubbard <jhubbard@...dia.com>, x86@...nel.org,
willy@...radead.org, torvalds@...ux-foundation.org,
akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, aarcange@...hat.com,
kirill.shutemov@...ux.intel.com, jroedel@...e.de, ubizjak@...il.com
Subject: Re: [PATCH 01/13] mm: Update ptep_get_lockless()s comment
On Mon, Oct 24, 2022 at 09:58:07PM +0200, Jann Horn wrote:
> Unless I'm completely misunderstanding what's going on here, the whole
> "remove_table" thing only happens when you "remove a table", meaning
> you free an entire *pagetable*. Just zapping PTEs doesn't trigger that
> logic.
Aah; yes true. OTOH even it that were not so, I think it would still be
broken because the current code relies on the TLB flush to have
completed, whereas the RCU scheme is effectively async and can be
considered pending until the callback runs.
Hurmph... easiest fix is probably to dis-allow kvm_flush_tlb_multi()
for i386-pae builds.
Something like so... nobody in his right mind should care about i386-pae
virt performance much.
---
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 95fb85bea111..cbfb84e88251 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -473,6 +473,12 @@ static DEFINE_PER_CPU(cpumask_var_t, __pv_cpu_mask);
static bool pv_tlb_flush_supported(void)
{
+ /*
+ * i386-PAE split loads are incompatible with optimized TLB flushes.
+ */
+ if (IS_ENABLED(CONFIG_GUP_GET_PTE_LOW_HIGH))
+ return false;
+
return (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) &&
!kvm_para_has_hint(KVM_HINTS_REALTIME) &&
kvm_para_has_feature(KVM_FEATURE_STEAL_TIME) &&
Powered by blists - more mailing lists