On Tue, Apr 04, 2017 at 09:27:46AM +0200, Andrew Jones wrote: > On Mon, Apr 03, 2017 at 05:28:45PM +0200, Christoffer Dall wrote: > > Hi Drew, > > > > On Fri, Mar 31, 2017 at 06:06:49PM +0200, Andrew Jones wrote: > > > This series fixes some hard to produce races by introducing the use of > > > vcpu requests. It also fixes a couple easier to produce races, ones > > > that have been produced with the PSCI kvm-unit-test test. The easy two > > > are addressed in two different ways: the first takes advantage of > > > power_off having been changed to a vcpu request, the second caches vcpu > > > MPIDRs in order to avoid extracting them from sys_regs. I've tested the > > > series on a Mustang and a ThunderX and compile-tested the ARM bits. > > > > > > Patch 2/9 adds documentation, as, at least for me, understanding vcpu > > > request interplay with vcpu kicks and vcpu mode and the memory barriers > > > that interplay implies, is exhausting. Hopefully the document is useful > > > to others. I'm not married to it though, so it can be deferred/dropped > > > as people like... > > > > Sounds helpful, I'll have a look. > > > > > > > > v2: > > > - No longer based on Radim's vcpu request API rework[1], except for > > > including "add kvm_request_pending" as patch 1/9 [drew] > > > > I lost track here; did those patches get merged or dropped and why are > > we not basing this work on them anymore, and should patch 1/9 be applied > > here or is it expected to land in the KVM tree via some other path? > > I think Radim still wants to rework the API, but, as his work doesn't > provide fixes or functional changes, his timeline may not be the same > as for this series. He also wants to expand his rework to add API > that includes kicking with requesting. I'm not sure how all that will > look yet, so, in the end, I decided I might as well just use the current > API for now. kvm_request_pending() was too nice an addition to drop > though. Makes sense, thanks for the explanation. > > > > > > - Added vcpu request documentation [drew] > > > - Dropped the introduction of user settable MPIDRs [Christoffer] > > > - Added vcpu requests to all request-less vcpu kicks [Christoffer] > > > > > > > Didn't we also have an issue with a missing barrier if the cmpxchg > > operation doesn't succeed? Did that fall though the cracks or is it > > just missing in the changelog? > > Just missing from the changelog. Sorry about that. No worries. > > - Ensure we have a read barrier (or equivalent) prior to issuing the > cmpxchg in kvm_vcpu_exiting_guest_mode(), as a failed cmpxchg does > not guarantee any barrier [Christoffer] Thanks for adding this, although I'm not able to convince myself that we got all the detailed aspects of this correct, just yet, but hopefully some of the questions I've asked on the individual patches can improve this. Thanks, -Christoffer