From patchwork Thu Mar 19 14:55:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 46045 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2F97C21515 for ; Thu, 19 Mar 2015 14:58:49 +0000 (UTC) Received: by wggx13 with SMTP id x13sf12905744wgg.0 for ; Thu, 19 Mar 2015 07:58:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=YfUgQ268s2ge315Mn+J20DNIHkEkQJuZik36y97Ckv8=; b=IqF9qZ0WrZp5TB+1z2FzgImi+XtPEWD3GpA+vwpU7pWGlhagN32NSrWVyStHQylZWc +A9PhP50xEMmkVCwupnWEXYNN2/ffQZ65ROIiz7Y/xw0W0KTSGAd41zn++7pmi0Zkou+ Jhdu5Q6izHJJYC9dkze2sNPgLOXxCxyjfY8n8y9pY9vB1qofzpJX+dKeJ8hPcCrx3Mfy wKthfTHT9w1s09ltUZTxtwMWfI9ZPlNDzYpR2SNuS3TWx2FsGsBbAyBHNeVf9j3f24+c 2pWcoKZ9OJrMKDp6sWKPPK9nZiOkBwAY7i2wQODuz8dCGUIiL9RRKIIeYD3ccT20Hs3O 5nFA== X-Gm-Message-State: ALoCoQn9x1L4sryfZjqTEtl/UdTAJxgH0gbLSb8NMw4YHYNuw1fVbfUhQmq6lBGnLVTwg2ZAl2Dy X-Received: by 10.180.109.34 with SMTP id hp2mr1832995wib.4.1426777128551; Thu, 19 Mar 2015 07:58:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.197.34 with SMTP id ir2ls287652lac.84.gmail; Thu, 19 Mar 2015 07:58:48 -0700 (PDT) X-Received: by 10.152.1.70 with SMTP id 6mr46089039lak.83.1426777128260; Thu, 19 Mar 2015 07:58:48 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id dv6si1162532lbc.94.2015.03.19.07.58.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Mar 2015 07:58:48 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by ladw1 with SMTP id w1so64297370lad.0 for ; Thu, 19 Mar 2015 07:58:48 -0700 (PDT) X-Received: by 10.152.28.5 with SMTP id x5mr67989993lag.112.1426777128049; Thu, 19 Mar 2015 07:58:48 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.35.133 with SMTP id h5csp441541lbj; Thu, 19 Mar 2015 07:58:47 -0700 (PDT) X-Received: by 10.181.27.201 with SMTP id ji9mr17016409wid.20.1426777121875; Thu, 19 Mar 2015 07:58:41 -0700 (PDT) Received: from mail-we0-f171.google.com (mail-we0-f171.google.com. [74.125.82.171]) by mx.google.com with ESMTPS id de8si9611127wib.80.2015.03.19.07.58.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Mar 2015 07:58:41 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 74.125.82.171 as permitted sender) client-ip=74.125.82.171; Received: by weop45 with SMTP id p45so59491731weo.0 for ; Thu, 19 Mar 2015 07:58:41 -0700 (PDT) X-Received: by 10.180.7.134 with SMTP id j6mr17330547wia.11.1426777121563; Thu, 19 Mar 2015 07:58:41 -0700 (PDT) Received: from gnx2579.gnb.st.com (weg38-3-78-232-41-119.fbx.proxad.net. [78.232.41.119]) by mx.google.com with ESMTPSA id a6sm1695350wiy.17.2015.03.19.07.58.39 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Mar 2015 07:58:40 -0700 (PDT) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, christoffer.dall@linaro.org, marc.zyngier@arm.com, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, alex.williamson@redhat.com Cc: linux-kernel@vger.kernel.org, patches@linaro.org, pbonzini@redhat.com, kim.phillips@freescale.com, b.reynal@virtualopensystems.com, feng.wu@intel.com Subject: [RFC v5 09/13] KVM: arm: rename pause into power_off Date: Thu, 19 Mar 2015 15:55:47 +0100 Message-Id: <1426776951-24901-10-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426776951-24901-1-git-send-email-eric.auger@linaro.org> References: <1426776951-24901-1-git-send-email-eric.auger@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: eric.auger@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The kvm_vcpu_arch pause field is renamed into power_off to prepare for the introduction of a new pause field. Signed-off-by: Eric Auger v4 -> v5: - fix compilation issue on arm64 (add power_off field in kvm_host.h) --- arch/arm/include/asm/kvm_host.h | 4 ++-- arch/arm/kvm/arm.c | 10 +++++----- arch/arm/kvm/psci.c | 10 +++++----- arch/arm64/include/asm/kvm_host.h | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h index 902a7d1..79a919c 100644 --- a/arch/arm/include/asm/kvm_host.h +++ b/arch/arm/include/asm/kvm_host.h @@ -129,8 +129,8 @@ struct kvm_vcpu_arch { * here. */ - /* Don't run the guest on this vcpu */ - bool pause; + /* vcpu power-off state */ + bool power_off; /* IO related fields */ struct kvm_decode mmio_decode; diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index c3a2dc6..08e12dc 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -458,7 +458,7 @@ static void vcpu_pause(struct kvm_vcpu *vcpu) { wait_queue_head_t *wq = kvm_arch_vcpu_wq(vcpu); - wait_event_interruptible(*wq, !vcpu->arch.pause); + wait_event_interruptible(*wq, !vcpu->arch.power_off); } static int kvm_vcpu_initialized(struct kvm_vcpu *vcpu) @@ -508,7 +508,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) update_vttbr(vcpu->kvm); - if (vcpu->arch.pause) + if (vcpu->arch.power_off) vcpu_pause(vcpu); kvm_vgic_flush_hwstate(vcpu); @@ -730,12 +730,12 @@ static int kvm_arch_vcpu_ioctl_vcpu_init(struct kvm_vcpu *vcpu, vcpu_reset_hcr(vcpu); /* - * Handle the "start in power-off" case by marking the VCPU as paused. + * Handle the "start in power-off" case. */ if (test_bit(KVM_ARM_VCPU_POWER_OFF, vcpu->arch.features)) - vcpu->arch.pause = true; + vcpu->arch.power_off = true; else - vcpu->arch.pause = false; + vcpu->arch.power_off = false; return 0; } diff --git a/arch/arm/kvm/psci.c b/arch/arm/kvm/psci.c index 02fa8ef..367b131 100644 --- a/arch/arm/kvm/psci.c +++ b/arch/arm/kvm/psci.c @@ -61,7 +61,7 @@ static unsigned long kvm_psci_vcpu_suspend(struct kvm_vcpu *vcpu) static void kvm_psci_vcpu_off(struct kvm_vcpu *vcpu) { - vcpu->arch.pause = true; + vcpu->arch.power_off = true; } static unsigned long kvm_psci_vcpu_on(struct kvm_vcpu *source_vcpu) @@ -85,7 +85,7 @@ static unsigned long kvm_psci_vcpu_on(struct kvm_vcpu *source_vcpu) */ if (!vcpu) return PSCI_RET_INVALID_PARAMS; - if (!vcpu->arch.pause) { + if (!vcpu->arch.power_off) { if (kvm_psci_version(source_vcpu) != KVM_ARM_PSCI_0_1) return PSCI_RET_ALREADY_ON; else @@ -113,7 +113,7 @@ static unsigned long kvm_psci_vcpu_on(struct kvm_vcpu *source_vcpu) * the general puspose registers are undefined upon CPU_ON. */ *vcpu_reg(vcpu, 0) = context_id; - vcpu->arch.pause = false; + vcpu->arch.power_off = false; smp_mb(); /* Make sure the above is visible */ wq = kvm_arch_vcpu_wq(vcpu); @@ -150,7 +150,7 @@ static unsigned long kvm_psci_vcpu_affinity_info(struct kvm_vcpu *vcpu) kvm_for_each_vcpu(i, tmp, kvm) { mpidr = kvm_vcpu_get_mpidr_aff(tmp); if (((mpidr & target_affinity_mask) == target_affinity) && - !tmp->arch.pause) { + !tmp->arch.power_off) { return PSCI_0_2_AFFINITY_LEVEL_ON; } } @@ -173,7 +173,7 @@ static void kvm_prepare_system_event(struct kvm_vcpu *vcpu, u32 type) * re-initialized. */ kvm_for_each_vcpu(i, tmp, vcpu->kvm) { - tmp->arch.pause = true; + tmp->arch.power_off = true; kvm_vcpu_kick(tmp); } diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index 967fb1c..a713b0c 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -122,8 +122,8 @@ struct kvm_vcpu_arch { * here. */ - /* Don't run the guest */ - bool pause; + /* vcpu power-off state */ + bool power_off; /* IO related fields */ struct kvm_decode mmio_decode;