Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1764798ybh; Thu, 23 Jul 2020 17:47:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwD7fUFWscMqNUJpKuI0VdBxDQPsfIhK91Ddpw7curQZjbr3Em9c5yYPQxgknnf1CfKBVK7 X-Received: by 2002:a17:907:42cc:: with SMTP id nz20mr168982ejb.429.1595551621233; Thu, 23 Jul 2020 17:47:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595551621; cv=none; d=google.com; s=arc-20160816; b=rMmnxEWzPX5pOeYDZuI+BfiEYi47VXAcFuDki7bWHdJo3ULeS9Z6t5l3XNLl1B8k1h NgO6Eq8uD/ES4GhCJUoCmsmOPUPG8w3anEXl3MOnBTZfLC1qcVTXzbVQZOL/L+LLon3p xryZznsDZuAzJzjHJZLy8dr2i59dWm3ZPzBneV53WnTMr96fVqMt269kxL5lby/k3XRu g2/Ff7hA1z2AWOHHnN4aeyTB37FNAtbuVNCzmCJNSKPR54WkRRrvMBAEu9uRcDQ8TA1B Osu60hXKc5LZ0uBSMWLumQ3hJnuFNql958yauy0l8wIy+6HEgJsPNpZZH1pdZnVhc7tI XZ2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=Rtfgquq0SEtwZ4k84B82DPLcPpqLHnp8JJ3FWAcLToc=; b=tHRl6W4buEhHCVbqmo/vdEpPQw2nhUnTHXGuLV9XyD0a1hXvLHMGWP3FHw7THsuDvc c8+6bfgbmyBKsm+JAA9z1PYs3DEhkbs2yl9D07zmDQ9MTNxjMaCL7vrYN4/+1FcQCkKh 8M1K0gMtB0iEIwNwRzg9yThe2RvTE3KrdD/LmplJcBosfn3jMiffsTzadpe34rxG7+Kj SDFKaYXA//IyQZRvaJ9ZuVpIY0syYrcaYJq3BWn+Gny+EdLLYr/dtmmn4wIcL/h4STY6 r/uw53N7TXuEIT5AFJ8HdgwuUaGLlJXpxZNXdpU7It0v3Dl75ncbhfp35NkqkGud7GMc peag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=FCgBIDO4; dkim=neutral (no key) header.i=@vger.kernel.org header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z65si2989578ede.610.2020.07.23.17.46.33; Thu, 23 Jul 2020 17:47:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=FCgBIDO4; dkim=neutral (no key) header.i=@vger.kernel.org header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728362AbgGXAq3 (ORCPT + 99 others); Thu, 23 Jul 2020 20:46:29 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:34170 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727783AbgGXAq3 (ORCPT ); Thu, 23 Jul 2020 20:46:29 -0400 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1595551586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Rtfgquq0SEtwZ4k84B82DPLcPpqLHnp8JJ3FWAcLToc=; b=FCgBIDO4dFsTETDUU2z/PvMVPTNfhdLwM5G/qDHHhVn2Gs40PUDpnDpAOj3DEVrkHdll98 7wAgbLI/+nDwQpJDtNYgT6mqBoKwiCRV4gyxmHfMOtUSi7DN6ICz3XPdRgrJd4EoAiLdpp eQ/9G7ynZYGbAB2vUMWGo+xiVHX0Hz7DVsxZFMJfYt3v/iLlq0+S/2M+h9DvO+DChPsK0Y wzni2LKKB+siE3TZ1Jv0QkYIOAqk+OMRaDafmvVfG3K0GT5ORqNRnL9fBOGKa8xDVq6LiJ 7ihiBQyTB+GsD+mLaNyW79iXXxNhjvTggArcGvrEnykstAVlNf+queHKwAEqKQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1595551586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Rtfgquq0SEtwZ4k84B82DPLcPpqLHnp8JJ3FWAcLToc=; b=+72kDR/MnJXvaBvbhjSwQo5IS35v9oHJhgRGmkKtKtzg6sQLvwVBCrjHDfoUoWBVBeX80p sslkbtIwIa5O9sCA== To: Sean Christopherson 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 Subject: Re: [patch V5 15/15] x86/kvm: Use generic xfer to guest work function In-Reply-To: <20200724001736.GK21891@linux.intel.com> References: <20200722215954.464281930@linutronix.de> <20200722220520.979724969@linutronix.de> <20200724001736.GK21891@linux.intel.com> Date: Fri, 24 Jul 2020 02:46:26 +0200 Message-ID: <87eep1vixp.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks, tglx