From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoffer Dall Subject: Re: [PATCH 1/5] arm/arm64: KVM: Correct KVM_ARM_VCPU_INIT power off option Date: Tue, 2 Dec 2014 15:33:05 +0100 Message-ID: <20141202143305.GG545@cbox> References: <1417113660-23610-1-git-send-email-christoffer.dall@linaro.org> <1417113660-23610-2-git-send-email-christoffer.dall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "kvmarm@lists.cs.columbia.edu" , arm-mail-list , kvm-devel , Ard Biesheuvel , Marc Zyngier To: Peter Maydell Return-path: Received: from mail-la0-f46.google.com ([209.85.215.46]:51415 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932155AbaLBOcW (ORCPT ); Tue, 2 Dec 2014 09:32:22 -0500 Received: by mail-la0-f46.google.com with SMTP id q1so5973745lam.33 for ; Tue, 02 Dec 2014 06:32:21 -0800 (PST) Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Nov 27, 2014 at 10:44:29PM +0000, Peter Maydell wrote: > On 27 November 2014 at 18:40, Christoffer Dall > wrote: > > The implementation of KVM_ARM_VCPU_INIT is currently not doing what > > userspace expects, namely making sure that a vcpu which may have been > > turned off using PSCI is returned to its initial state, which would be > > powered on if userspace does not set the KVM_ARM_VCPU_POWER_OFF flag. > > > > Implment the expected functionality and clarify the ABI. > > ("Implement", if you have to respin.) > > > diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c > > index 9e193c8..4dcc8c2 100644 > > --- a/arch/arm/kvm/arm.c > > +++ b/arch/arm/kvm/arm.c > > @@ -663,6 +663,8 @@ static int kvm_arch_vcpu_ioctl_vcpu_init(struct kvm_vcpu *vcpu, > > */ > > if (__test_and_clear_bit(KVM_ARM_VCPU_POWER_OFF, vcpu->arch.features)) > > vcpu->arch.pause = true; > > + else > > + vcpu->arch.pause = false; > > Out of curiosity, why do we have to test-and-clear the bit rather than > just testing it? > No reason, I think we used to do this when we were always testing the flag directly instead of through the pause flag. I'll add a change of this. -Christoffer