Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2404608ybh; Mon, 5 Aug 2019 00:20:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpg56AZ+f/wzfkYeTUV0OM4QnNJPmFCE4B5F6Qq/38ghCezamCBbOzmwSP3L7zoLPM7bGo X-Received: by 2002:a62:64d4:: with SMTP id y203mr71195987pfb.91.1564989640996; Mon, 05 Aug 2019 00:20:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564989640; cv=none; d=google.com; s=arc-20160816; b=CaS187r4jo9xlDS1jfVuHcQ240O6LOW7ly8V1W5tMJOna9gkQO9h3JvwjKU7ZMJ2m+ MQXRNQHrxTmqgCvOnQ2EAbmUVqpw0xfMdeVPj+5y/3+RUobRwV3toznRty/Y5VUR20VR BElIssBHW5Ww7Uid8C8BCmNQ7QVCFdwUWm79XvG07AWOZz5olU0IemOpfvktcHo8GBtU b0xrgYsvgD4E/knQZ1AHQNXBDKgzqTzx+4DpdbJE9oyJuh3gM5KTQZk8e45zL5FF9/Q5 oUCz+GaIgx9I9xkvZ6GvI9xzuUo2ItgBQf80cXhWtTi0lPjHr/4YR48nFCwlRz9Uzffr GRTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=RUqYiFGRwqZz3baSi7DePLwfU/zHvDjxvxTGgWRnjy4=; b=1GZAnT+QAgqIvhx22wg00V5bApnifkRksoE1HFQ4DjD7SJbt7EJNd+hGcjBCMIXBYt wZIVyEjgevALbI+yth8bp5u5Uv+v7GRnDQ4I6GSUDp5I3YUyHNGNORp4i1Sr1hTm97Xf aoJcfIXqFKAp114CoX6cNiVd2v/1VscwDxbGMrG1tOySHCqvNSafFc/ODcYeBFw6FFHF L5tPyN+KG0JWEh/pXf8bvYn+g39XK8P3j61BEYPr4sU06iWg1odAmpSLt9hjdaJnSp5l 7A+no87+bQ3I4vYM5ab1j+FRRgDzdDEqI3HxZOD2Dx61OxbgIRErnjkI6MEaiyzr1fP6 peFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=vaSHkIAH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bh2si40773839plb.116.2019.08.05.00.20.25; Mon, 05 Aug 2019 00:20:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=vaSHkIAH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727538AbfHEHS0 (ORCPT + 99 others); Mon, 5 Aug 2019 03:18:26 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:38201 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726394AbfHEHS0 (ORCPT ); Mon, 5 Aug 2019 03:18:26 -0400 Received: by mail-wr1-f68.google.com with SMTP id g17so83253380wrr.5 for ; Mon, 05 Aug 2019 00:18:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RUqYiFGRwqZz3baSi7DePLwfU/zHvDjxvxTGgWRnjy4=; b=vaSHkIAHMZgvdsmo51ZYrbAryRPsAqLUFYv5jJavndTgROhdJ2YKtLsZZ7C5gyHtvW d/v3QIkwaKBrAFuclzEsoay1vDYmjzsPaxL6kALb0MhKAhO2G5JvtGBdNRuHDOhawgi4 lXTjtmEwRoGoiHPDd7rP98028ijkU/rrmccPlI4+BJUogzjLpnIAfcM/RSF7a0W20G3a +lYNkmcxP15Wv0MSZzqX1VmMeIw8oeevNB0gHTpWSvBKIISi5EBHG0ojEi+JIBbaGMD3 Jrc2jqiRbvWDhyZXhGGFBf5N5Ec8u2CeeK2HmFW6XmZ5yQoLYLGMohbmcA8s+tpwyTkC naNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RUqYiFGRwqZz3baSi7DePLwfU/zHvDjxvxTGgWRnjy4=; b=STkNqlGyP5A7AYQY2zDWawcRtAEfiJ931Hg0Eegg1gq1+7BPRhoHI1hZZx8MtTklRy e1Uxd6dDxZ+zmVMUClGAbBJnSAnmTLzrU2TAMntnpy+LHT/d6vsGXAEOWW7HXrmibBgr LL9AgRWQMtOX8QIfJtzDhOChgo0eoqcdAXQeIRzlbEYodA17SmPdMTAHJu2LpthRuSCu Fyiu8GSQMlX1HXHJITxApM50qgl5dx1vPNvYQLxa6fddT/QA2Bxo7W+JDRyFRxMUcirW 3cejSk0ditvFkxXRMHQX61U/8ajjF5qAZZ04KovOqkDroCKSeMboRzmHrsxFbpNGeOmb d2bw== X-Gm-Message-State: APjAAAWvM7bEDlVy/l9toqIGRMYu7f2ENS/YM41kiJ75bulji9HehLXh alrg5e/2iImbdqw7MNsFNTRuCA3g1jUhzEPJI54= X-Received: by 2002:a5d:4e50:: with SMTP id r16mr24977381wrt.227.1564989504211; Mon, 05 Aug 2019 00:18:24 -0700 (PDT) MIME-Version: 1.0 References: <20190802074620.115029-1-anup.patel@wdc.com> <20190802074620.115029-11-anup.patel@wdc.com> <5b966171-4d11-237d-5a43-dc881efb7d0a@redhat.com> <458f6b85-cdb2-5e6b-6730-4875f0e4cdba@redhat.com> In-Reply-To: <458f6b85-cdb2-5e6b-6730-4875f0e4cdba@redhat.com> From: Anup Patel Date: Mon, 5 Aug 2019 12:48:12 +0530 Message-ID: Subject: Re: [RFC PATCH v2 10/19] RISC-V: KVM: Handle WFI exits for VCPU To: Paolo Bonzini Cc: Anup Patel , Palmer Dabbelt , Paul Walmsley , Radim K , Daniel Lezcano , Thomas Gleixner , Atish Patra , Alistair Francis , Damien Le Moal , Christoph Hellwig , "kvm@vger.kernel.org" , "linux-riscv@lists.infradead.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 5, 2019 at 12:44 PM Paolo Bonzini wrote: > > On 05/08/19 09:12, Anup Patel wrote: > > On Fri, Aug 2, 2019 at 2:33 PM Paolo Bonzini wrote: > >> > >> On 02/08/19 09:47, Anup Patel wrote: > >>> + if (!kvm_riscv_vcpu_has_interrupt(vcpu)) { > >> > >> This can be kvm_arch_vcpu_runnable instead, since kvm_vcpu_block will > >> check it anyway before sleeping. > > > > I think we can skip this check here because kvm_vcpu_block() is > > checking it anyway. Agree ?? > > Yes, but it's quite a bit faster to do this outside the call. There's a > bunch of setup before kvm_vcpu_block reaches that point, and it includes > mfences too once you add srcu_read_unlock/lock here. No problem, I will use kvm_arch_vcpu_runnable() here. Regards, Anup