From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sean Christopherson Subject: Re: [patch V5 15/15] x86/kvm: Use generic xfer to guest work function Date: Thu, 23 Jul 2020 17:55:46 -0700 Message-ID: <20200724005546.GL21891@linux.intel.com> References: <20200722215954.464281930@linutronix.de> <20200722220520.979724969@linutronix.de> <20200724001736.GK21891@linux.intel.com> <87eep1vixp.fsf@nanos.tec.linutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mga04.intel.com ([192.55.52.120]:60096 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728413AbgGXAzr (ORCPT ); Thu, 23 Jul 2020 20:55:47 -0400 Content-Disposition: inline In-Reply-To: <87eep1vixp.fsf@nanos.tec.linutronix.de> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Thomas Gleixner Cc: LKML , x86@kernel.org, linux-arch@vger.kernel.org, Will Deacon , Arnd Bergmann , Mark Rutland , Kees Cook , Keno Fischer , Paolo Bonzini , kvm@vger.kernel.org, Gabriel Krisman Bertazi On Fri, Jul 24, 2020 at 02:46:26AM +0200, Thomas Gleixner wrote: > Sean, > > Sean Christopherson writes: > > On Thu, Jul 23, 2020 at 12:00:09AM +0200, Thomas Gleixner wrote: > >> + if (xfer_to_guest_mode_work_pending()) { > >> srcu_read_unlock(&kvm->srcu, vcpu->srcu_idx); > >> - cond_resched(); > >> + r = xfer_to_guest_mode(vcpu); > > > > Any reason not to call this xfer_to_guest_mode_work()? Or handle_work(), > > do_work(), etc... Without the "work" part, it looks like a function that > > should be invoked unconditionally. It's obvious that's not the case if > > one looks at the implementation, but it's a bit confusing on the KVM side > > of things. > > The reason is probably lazyness. The original approach was to have this > as close as possible to user entry/exit but with the recent changes > vs. instrumentation and RCU this is not longer the case. > > I really want to keep the notion of transitioning in the function name, > so xfer_to_guest_mode_handle_work() makes a lot of sense. > > I'll change that before merging the lot into the tip tree if your > Reviewed-by still stands with that change made w/o reposting. Ya, works for me.