[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YfJsNcYNH8JTHrM/@hirez.programming.kicks-ass.net>
Date: Thu, 27 Jan 2022 10:56:05 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Sean Christopherson <seanjc@...gle.com>
Cc: mingo@...hat.com, tglx@...utronix.de, juri.lelli@...hat.com,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
bristot@...hat.com, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, linux-api@...r.kernel.org, x86@...nel.org,
pjt@...gle.com, posk@...gle.com, avagin@...gle.com,
jannh@...gle.com, tdelisle@...terloo.ca, mark.rutland@....com,
posk@...k.io
Subject: Re: [RFC][PATCH v2 4/5] x86/uaccess: Implement
unsafe_try_cmpxchg_user()
On Thu, Jan 27, 2022 at 06:36:19AM +0000, Sean Christopherson wrote:
> On Thu, Jan 27, 2022, Sean Christopherson wrote:
> > Doh, I should have specified that KVM needs 8-byte CMPXCHG on 32-bit kernels due
> > to using it to atomically update guest PAE PTEs and LTR descriptors (yay).
> >
> > Also, KVM's use case isn't a tight loop, how gross would it be to add a slightly
> > less unsafe version that does __uaccess_begin_nospec()? KVM pre-checks the address
> > way ahead of time, so the access_ok() check can be omitted. Alternatively, KVM
> > could add its own macro, but that seems a little silly. E.g. somethign like this,
> > though I don't think this is correct
>
> *sigh*
>
> Finally realized I forgot to add back the page offset after converting from guest
> page frame to host virtual address. Anyways, this is what I ended up with, will
> test more tomorrow.
Looks about right :-) (famous last words etc..)
Powered by blists - more mailing lists