Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2400308ybh; Mon, 5 Aug 2019 00:15:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIuAMbSHxA6a3nDQL3py5cyAAygdK9lPzgfwJ26CrV+cIWlDA0/Spl00M8iDW5ZJr6sSky X-Received: by 2002:a17:902:f46:: with SMTP id 64mr144212789ply.235.1564989343076; Mon, 05 Aug 2019 00:15:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564989343; cv=none; d=google.com; s=arc-20160816; b=VgjqTJ1Cfs/ODe6vpuU9P6QbRLnyV9JRRzTJvmKSNs1omBJT8LnWMSpPersD5SGafS dRzx4tvisjY/OfEhRejn8z37fneTHNpJODhJa1BNgQVtDdaJ3YfpDnjGS4Zwp5AzNJmP RnyUwyf6p1S0ulbVAU4IgBEGkp3ux5szarqGlz8OcYZ3CWgx8FiNSN06xJ81gWJ66Eiw Lo7hpXj4uRHF6qjMmtohcVB236SaNwXYTVb9KDdxsvqNcxTtiKnB5BphghJZcU72OH9z nd1uGMkB83PExF65sOdIm1bbKiF0DMDGF2KgWAXXOyzE1qVIFbLJVvLq2NeE17FuGfwE Ok8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:openpgp:from:references:cc:to:subject; bh=xXNzFDoqWDF3bFjncF2L5fOVNU1OQ5j5piUBIWBmL0I=; b=Xspc2LH3a6/eqgRMqpG2DxoPpuFcTf6sfH+k4YhY0+hkUycKRA8tRiJ7u9rbUYKOsR DLG6eJteqPttQquGda9KoLrv5tXpT+0L1wHAiDu2B5W+i9/IgFrs5U9jiQeapU/WGCGD zS/eR30fKDV7jLYI/apbwuVHJWMoqtwHeO/GkVUTqzRe96O+CT/t73VUbIF+sUqHOgNP PlTNw11poTN4iNXyLa+RUm4hGaSR9d9MJkBoJ3daoa7gL2TmhqdYdutC1uCis/HvRqji qX/n4YcUN7uG2nv1MuIZnHHOlOM47zDVGAFUjxjk3yWUwkSfOy+AbE6CjiAIbRO5KUie ANbQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c35si34048633pgm.51.2019.08.05.00.15.27; Mon, 05 Aug 2019 00:15:43 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727471AbfHEHOs (ORCPT + 99 others); Mon, 5 Aug 2019 03:14:48 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38980 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726587AbfHEHOs (ORCPT ); Mon, 5 Aug 2019 03:14:48 -0400 Received: by mail-wr1-f65.google.com with SMTP id x4so30069592wrt.6 for ; Mon, 05 Aug 2019 00:14:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=xXNzFDoqWDF3bFjncF2L5fOVNU1OQ5j5piUBIWBmL0I=; b=efnObHL20oxxcYmlpLMKAVwYQCVkpxZZAT05Xs7eEHZ3YfQ4nHJnZJf3U5+g7Y/5jh +s4q5onnaxGJ+SILKl/tc1l6W/PfIaa0RiMyFIkp13r92L08y4KEB/QT0hABNNC3aPlH IzrHCTG+pW5iVhJVmB/WDZo7IHVReb9hkUa8DFfBxDekSqZjbSzgVsog5RHp85JU9QhL 5DhZG9kb6U51JSHklhIDyFdHk2I4yKNnsh1X4SzQD6jxou5rTTPmoUGfPb6dbliNYcQC hO1hh64CbP/E6kKTCNZD+XPMeHAtN1j8vPWShB5dKrnIpSgjuQN6mdAtjTuKCHSsWR4j dLVg== X-Gm-Message-State: APjAAAXvWwPmk9hOrMxugteFTHGDTr5abH7cpY2TwirX6+IgYxkJ9AYf Rx/RqTvs4+bzBNNMEP+BET2uvy+S7mk= X-Received: by 2002:adf:eb49:: with SMTP id u9mr42305386wrn.215.1564989285989; Mon, 05 Aug 2019 00:14:45 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:4013:e920:9388:c3ff? ([2001:b07:6468:f312:4013:e920:9388:c3ff]) by smtp.gmail.com with ESMTPSA id g11sm79705061wrq.92.2019.08.05.00.14.44 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Mon, 05 Aug 2019 00:14:45 -0700 (PDT) Subject: Re: [RFC PATCH v2 10/19] RISC-V: KVM: Handle WFI exits for VCPU To: Anup Patel 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" References: <20190802074620.115029-1-anup.patel@wdc.com> <20190802074620.115029-11-anup.patel@wdc.com> <5b966171-4d11-237d-5a43-dc881efb7d0a@redhat.com> From: Paolo Bonzini Openpgp: preference=signencrypt Message-ID: <458f6b85-cdb2-5e6b-6730-4875f0e4cdba@redhat.com> Date: Mon, 5 Aug 2019 09:14:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Paolo