Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp687451ybi; Fri, 2 Aug 2019 02:37:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRXme1xORo5rh+63wQzwkRncfodFXqednd6JFonwrsopRT3UKPmi5dMRaVO5DkT16Gibab X-Received: by 2002:a17:90a:b387:: with SMTP id e7mr3549221pjr.113.1564738656690; Fri, 02 Aug 2019 02:37:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564738656; cv=none; d=google.com; s=arc-20160816; b=B2RN5TBrTIAbuLMZ1Xgt65B+qt6I6A0MrJr/8jGpUDvLY27Wqb2kUT2vo8OqghM2l8 8K1Ib+Z9eZPE2nhws/Ul3Yb9C/m3lwSyVFQ89mR8rSkrMe9kO3CjiKXYC1DtAHKU3MGd edj2Yv0h+q5xIp4IhXYBy4dhX1LRk/qUgzDP7n97bbTvm94PrlimXf1KCzjkUiNJH+vU 5XYVqMJCOV0exhfZbKxvX8bRMig7ST8YX3W4LdjvMtsE2EF8JQjsM7S5JAbB1ccX/sUx oFApyM0vIDZAJpAAvoopntmvT90962fZ6twt5yZlfxb25GJ0jzTAzVV6FjGqqXurQFON ioxA== 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=MJhjj3mBwgft1ytEPPkTSsGclIEbwHaqa5f1BjqWwHE=; b=VMSvbNqg+VSAyGhUMkJyp8W2YLhtOkRupjP1Va69yLIQrWfbOgWkxEARaBVnJkuEY/ 9SLhYykdB7x/u4qOu+LOXOkggLkSbi+/wdFn91polnXVdsCNk8uei1+krKDlM+GuE+7Q U0FzFmD/obDjFnv9gJfwCT62sCyTuGW930XqCEngiweKtAqdvm/WmxbReeKzsLZ9oZRn RTvAnd2vda1m5ayWp105SSSJj0fno4XzHUTKwCRnBpJ2IiTJnHZ4o4Crif9JEZ9mYkzc XqygTZUuLbZjslWvA7RkD1G5XwlbuTih0FYsQpDLwF53CYl+OboKS/g/marbPdcA4UiL YTlQ== 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 f131si35307740pgc.265.2019.08.02.02.37.21; Fri, 02 Aug 2019 02:37:36 -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 S1732673AbfHBJD2 (ORCPT + 99 others); Fri, 2 Aug 2019 05:03:28 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:54130 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731810AbfHBJD2 (ORCPT ); Fri, 2 Aug 2019 05:03:28 -0400 Received: by mail-wm1-f68.google.com with SMTP id x15so67202855wmj.3 for ; Fri, 02 Aug 2019 02:03:26 -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=MJhjj3mBwgft1ytEPPkTSsGclIEbwHaqa5f1BjqWwHE=; b=EMe8yzVqA7LTVm0H9PLg5fVB2Q7CYI+b6TW3EwaJebhMyOoPPnLYey2zDhISHl15of A851k4Mjg6K0hdKTjYl/tvGApqussL8aYWP8V5bJNN9m8RNZ7ar2BFR06dbTWUTUHt9Q NqR0UmhiMsY9NHChI5cV6B+Fj4+hfPs5e46cpGmoMAuTG64BRcfQNwbbB5uGwwsn9kOE FKh3VlaJeGSGZyzppsKOhqLMLwWAS5SdkL/Bp0sa7Xs0vEoyhe3kODXVRyjHTwUKW1Dl TSi7+hRfCb7AFXTJQ/x6S2+djqhMWFo9Xlr1N2J0bxoxjEJMz/AGsQxNRXC0Azp+zauh O8Jg== X-Gm-Message-State: APjAAAWYLWkt4ygsIigVT3YdkZtaISG1cinHccFpCz4B0bn8NfNZ8wVP GUok1alfMuJfRtXj+y2i02B/4HvOfWI= X-Received: by 2002:a1c:f418:: with SMTP id z24mr3454407wma.80.1564736606068; Fri, 02 Aug 2019 02:03:26 -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 z5sm53295288wmf.48.2019.08.02.02.03.25 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 02 Aug 2019 02:03:25 -0700 (PDT) Subject: Re: [RFC PATCH v2 10/19] RISC-V: KVM: Handle WFI exits for VCPU To: Anup Patel , Palmer Dabbelt , Paul Walmsley , Radim K Cc: Daniel Lezcano , Thomas Gleixner , Atish Patra , Alistair Francis , Damien Le Moal , Christoph Hellwig , Anup Patel , "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> From: Paolo Bonzini Openpgp: preference=signencrypt Message-ID: <5b966171-4d11-237d-5a43-dc881efb7d0a@redhat.com> Date: Fri, 2 Aug 2019 11:03:25 +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: <20190802074620.115029-11-anup.patel@wdc.com> 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 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. Paolo > + kvm_vcpu_block(vcpu); > + kvm_clear_request(KVM_REQ_UNHALT, vcpu); > + }