From: Sean Christopherson <seanjc@google.com>
To: Maxim Levitsky <mlevitsk@redhat.com>
Cc: Uros Bizjak <ubizjak@gmail.com>,
Peter Zijlstra <peterz@infradead.org>, X86 ML <x86@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
kvm@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>, Will Deacon <will@kernel.org>,
Boqun Feng <boqun.feng@gmail.com>,
Mark Rutland <mark.rutland@arm.com>,
"Paul E. McKenney" <paulmck@kernel.org>,
Marco Elver <elver@google.com>
Subject: Re: [PATCH] locking/atomic/x86: Introduce try_cmpxchg64
Date: Mon, 16 May 2022 15:14:36 +0000 [thread overview]
Message-ID: <YoJqXMN38b8dYwyY@google.com> (raw)
In-Reply-To: <9ed2fc294bf2c21b41b22605ff8039bb71903712.camel@redhat.com>
On Mon, May 16, 2022, Maxim Levitsky wrote:
> On Mon, 2022-05-16 at 14:08 +0000, Sean Christopherson wrote:
> > On Mon, May 16, 2022, Maxim Levitsky wrote:
> > > On Wed, 2022-05-11 at 21:54 +0200, Uros Bizjak wrote:
> > > > On Wed, May 11, 2022 at 6:04 PM Sean Christopherson <seanjc@google.com> wrote:
> > > > > On Wed, May 11, 2022, Uros Bizjak wrote:
> > > > > > On Wed, May 11, 2022 at 9:54 AM Peter Zijlstra <peterz@infradead.org> wrote:
> > > > > > > Still, does 32bit actually support that stuff?
> > > > > >
> > > > > > Unfortunately, it does:
> > > > > >
> > > > > > kvm-intel-y += vmx/vmx.o vmx/vmenter.o vmx/pmu_intel.o vmx/vmcs12.o \
> > > > > > vmx/evmcs.o vmx/nested.o vmx/posted_intr.o
> > > > > >
> > > > > > And when existing cmpxchg64 is substituted with cmpxchg, the
> > > > > > compilation dies for 32bits with:
> > > > >
> > > > > ...
> > > > >
> > > > > > > Anyway, your patch looks about right, but I find it *really* hard to
> > > > > > > care about 32bit code these days.
> > > > > >
> > > > > > Thanks, this is also my sentiment, but I hope the patch will enable
> > > > > > better code and perhaps ease similar situation I have had elsewhere.
> > > > >
> > > > > IMO, if we merge this it should be solely on the benefits to 64-bit code. Yes,
> > > > > KVM still supports 32-bit kernels, but I'm fairly certain the only people that
> > > > > run 32-bit KVM are KVM developers. 32-bit KVM has been completely broken for
> > > > > multiple releases at least once, maybe twice, and no one ever complained.
> > > >
> > > > Yes, the idea was to improve cmpxchg64 with the implementation of
> > > > try_cmpxchg64 for 64bit targets. However, the issue with 32bit targets
> > > > stood in the way, so the effort with 32-bit implementation was mainly
> > > > to unblock progression for 64-bit targets.
> > >
> > > Would that allow tdp mmu to work on 32 bit?
> >
> > From a purely technical perspective, there's nothing that prevents enabling the
> > TDP MMU on 32-bit kernels. The TDP MMU is 64-bit only to simplify the implementation
> > and to reduce the maintenance and validation costs.
>
> I understand exactly that, so the question, will this patch help make the tdp
> mmu work transparently on 32 bit kernels? I heard that 64 bit cmpxchg was
> one of the main reasons that it is 64 bit only.
I don't think it moves the needled much, e.g. non-atomic 64-bit accesses are still
problematic, and we'd have to update the TDP MMU to deal with PAE paging (thanks
NPT). All those problems are solvable, it's purely a matter of the ongoing costs
to solve them.
> I am asking because there was some talk to eliminate the direct mode from the
> legacy non tdp mmu, which would simplify its code by a lot, but then it will
> make 32 bit kernel fail back to shadowing mmu.
Simplify which code? Between the nonpaging code and direct shadow pages in
indirect MMUs, the vast majority of the "direct" support in the legacy MMU needs
to be kept even if TDP support is dropped. And the really nasty stuff, e.g. PAE
roots, would need to be carried over to the TDP MMU.
next prev parent reply other threads:[~2022-05-16 15:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-10 15:42 [PATCH] locking/atomic/x86: Introduce try_cmpxchg64 Uros Bizjak
2022-05-10 16:55 ` Peter Zijlstra
2022-05-10 17:07 ` Uros Bizjak
2022-05-11 7:54 ` Peter Zijlstra
2022-05-11 8:24 ` Uros Bizjak
2022-05-11 16:04 ` Sean Christopherson
2022-05-11 19:54 ` Uros Bizjak
2022-05-16 14:04 ` Maxim Levitsky
2022-05-16 14:08 ` Sean Christopherson
2022-05-16 14:49 ` Maxim Levitsky
2022-05-16 15:14 ` Sean Christopherson [this message]
2022-05-16 15:36 ` Maxim Levitsky
2022-05-13 9:10 ` Peter Zijlstra
2022-05-13 10:20 ` Uros Bizjak
2022-05-13 15:36 ` Uros Bizjak
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=YoJqXMN38b8dYwyY@google.com \
--to=seanjc@google.com \
--cc=boqun.feng@gmail.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=elver@google.com \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=mlevitsk@redhat.com \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=ubizjak@gmail.com \
--cc=will@kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).