diff options
author | Eric Auger <eric.auger@linaro.org> | 2015-09-25 17:41:14 -0400 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2015-10-22 17:01:45 -0400 |
commit | 3781528e3045e7c9cc7c4846e0f675b1f353655f (patch) | |
tree | f11a36b156eedf32dd4caa0ff5d7b6702d28e66d /arch/arm/kvm | |
parent | 75755c6d02df9e9b959b3066c12de5494907e3d9 (diff) |
KVM: arm/arm64: rename pause into power_off
The kvm_vcpu_arch pause field is renamed into power_off to prepare
for the introduction of a new pause field. Also vcpu_pause is renamed
into vcpu_sleep since we will sleep until both power_off and pause are
false.
Signed-off-by: Eric Auger <eric.auger@linaro.org>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'arch/arm/kvm')
-rw-r--r-- | arch/arm/kvm/arm.c | 20 | ||||
-rw-r--r-- | arch/arm/kvm/psci.c | 10 |
2 files changed, 15 insertions, 15 deletions
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index 59125f48c707..9d2fb4772d8c 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c | |||
@@ -318,7 +318,7 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) | |||
318 | int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu, | 318 | int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu, |
319 | struct kvm_mp_state *mp_state) | 319 | struct kvm_mp_state *mp_state) |
320 | { | 320 | { |
321 | if (vcpu->arch.pause) | 321 | if (vcpu->arch.power_off) |
322 | mp_state->mp_state = KVM_MP_STATE_STOPPED; | 322 | mp_state->mp_state = KVM_MP_STATE_STOPPED; |
323 | else | 323 | else |
324 | mp_state->mp_state = KVM_MP_STATE_RUNNABLE; | 324 | mp_state->mp_state = KVM_MP_STATE_RUNNABLE; |
@@ -331,10 +331,10 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu, | |||
331 | { | 331 | { |
332 | switch (mp_state->mp_state) { | 332 | switch (mp_state->mp_state) { |
333 | case KVM_MP_STATE_RUNNABLE: | 333 | case KVM_MP_STATE_RUNNABLE: |
334 | vcpu->arch.pause = false; | 334 | vcpu->arch.power_off = false; |
335 | break; | 335 | break; |
336 | case KVM_MP_STATE_STOPPED: | 336 | case KVM_MP_STATE_STOPPED: |
337 | vcpu->arch.pause = true; | 337 | vcpu->arch.power_off = true; |
338 | break; | 338 | break; |
339 | default: | 339 | default: |
340 | return -EINVAL; | 340 | return -EINVAL; |
@@ -478,11 +478,11 @@ bool kvm_arch_intc_initialized(struct kvm *kvm) | |||
478 | return vgic_initialized(kvm); | 478 | return vgic_initialized(kvm); |
479 | } | 479 | } |
480 | 480 | ||
481 | static void vcpu_pause(struct kvm_vcpu *vcpu) | 481 | static void vcpu_sleep(struct kvm_vcpu *vcpu) |
482 | { | 482 | { |
483 | wait_queue_head_t *wq = kvm_arch_vcpu_wq(vcpu); | 483 | wait_queue_head_t *wq = kvm_arch_vcpu_wq(vcpu); |
484 | 484 | ||
485 | wait_event_interruptible(*wq, !vcpu->arch.pause); | 485 | wait_event_interruptible(*wq, !vcpu->arch.power_off); |
486 | } | 486 | } |
487 | 487 | ||
488 | static int kvm_vcpu_initialized(struct kvm_vcpu *vcpu) | 488 | static int kvm_vcpu_initialized(struct kvm_vcpu *vcpu) |
@@ -532,8 +532,8 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) | |||
532 | 532 | ||
533 | update_vttbr(vcpu->kvm); | 533 | update_vttbr(vcpu->kvm); |
534 | 534 | ||
535 | if (vcpu->arch.pause) | 535 | if (vcpu->arch.power_off) |
536 | vcpu_pause(vcpu); | 536 | vcpu_sleep(vcpu); |
537 | 537 | ||
538 | /* | 538 | /* |
539 | * Disarming the background timer must be done in a | 539 | * Disarming the background timer must be done in a |
@@ -780,12 +780,12 @@ static int kvm_arch_vcpu_ioctl_vcpu_init(struct kvm_vcpu *vcpu, | |||
780 | vcpu_reset_hcr(vcpu); | 780 | vcpu_reset_hcr(vcpu); |
781 | 781 | ||
782 | /* | 782 | /* |
783 | * Handle the "start in power-off" case by marking the VCPU as paused. | 783 | * Handle the "start in power-off" case. |
784 | */ | 784 | */ |
785 | if (test_bit(KVM_ARM_VCPU_POWER_OFF, vcpu->arch.features)) | 785 | if (test_bit(KVM_ARM_VCPU_POWER_OFF, vcpu->arch.features)) |
786 | vcpu->arch.pause = true; | 786 | vcpu->arch.power_off = true; |
787 | else | 787 | else |
788 | vcpu->arch.pause = false; | 788 | vcpu->arch.power_off = false; |
789 | 789 | ||
790 | return 0; | 790 | return 0; |
791 | } | 791 | } |
diff --git a/arch/arm/kvm/psci.c b/arch/arm/kvm/psci.c index ad6f6424f1d1..0b556968a6da 100644 --- a/arch/arm/kvm/psci.c +++ b/arch/arm/kvm/psci.c | |||
@@ -63,7 +63,7 @@ static unsigned long kvm_psci_vcpu_suspend(struct kvm_vcpu *vcpu) | |||
63 | 63 | ||
64 | static void kvm_psci_vcpu_off(struct kvm_vcpu *vcpu) | 64 | static void kvm_psci_vcpu_off(struct kvm_vcpu *vcpu) |
65 | { | 65 | { |
66 | vcpu->arch.pause = true; | 66 | vcpu->arch.power_off = true; |
67 | } | 67 | } |
68 | 68 | ||
69 | static unsigned long kvm_psci_vcpu_on(struct kvm_vcpu *source_vcpu) | 69 | static unsigned long kvm_psci_vcpu_on(struct kvm_vcpu *source_vcpu) |
@@ -87,7 +87,7 @@ static unsigned long kvm_psci_vcpu_on(struct kvm_vcpu *source_vcpu) | |||
87 | */ | 87 | */ |
88 | if (!vcpu) | 88 | if (!vcpu) |
89 | return PSCI_RET_INVALID_PARAMS; | 89 | return PSCI_RET_INVALID_PARAMS; |
90 | if (!vcpu->arch.pause) { | 90 | if (!vcpu->arch.power_off) { |
91 | if (kvm_psci_version(source_vcpu) != KVM_ARM_PSCI_0_1) | 91 | if (kvm_psci_version(source_vcpu) != KVM_ARM_PSCI_0_1) |
92 | return PSCI_RET_ALREADY_ON; | 92 | return PSCI_RET_ALREADY_ON; |
93 | else | 93 | else |
@@ -115,7 +115,7 @@ static unsigned long kvm_psci_vcpu_on(struct kvm_vcpu *source_vcpu) | |||
115 | * the general puspose registers are undefined upon CPU_ON. | 115 | * the general puspose registers are undefined upon CPU_ON. |
116 | */ | 116 | */ |
117 | *vcpu_reg(vcpu, 0) = context_id; | 117 | *vcpu_reg(vcpu, 0) = context_id; |
118 | vcpu->arch.pause = false; | 118 | vcpu->arch.power_off = false; |
119 | smp_mb(); /* Make sure the above is visible */ | 119 | smp_mb(); /* Make sure the above is visible */ |
120 | 120 | ||
121 | wq = kvm_arch_vcpu_wq(vcpu); | 121 | wq = kvm_arch_vcpu_wq(vcpu); |
@@ -153,7 +153,7 @@ static unsigned long kvm_psci_vcpu_affinity_info(struct kvm_vcpu *vcpu) | |||
153 | mpidr = kvm_vcpu_get_mpidr_aff(tmp); | 153 | mpidr = kvm_vcpu_get_mpidr_aff(tmp); |
154 | if ((mpidr & target_affinity_mask) == target_affinity) { | 154 | if ((mpidr & target_affinity_mask) == target_affinity) { |
155 | matching_cpus++; | 155 | matching_cpus++; |
156 | if (!tmp->arch.pause) | 156 | if (!tmp->arch.power_off) |
157 | return PSCI_0_2_AFFINITY_LEVEL_ON; | 157 | return PSCI_0_2_AFFINITY_LEVEL_ON; |
158 | } | 158 | } |
159 | } | 159 | } |
@@ -179,7 +179,7 @@ static void kvm_prepare_system_event(struct kvm_vcpu *vcpu, u32 type) | |||
179 | * re-initialized. | 179 | * re-initialized. |
180 | */ | 180 | */ |
181 | kvm_for_each_vcpu(i, tmp, vcpu->kvm) { | 181 | kvm_for_each_vcpu(i, tmp, vcpu->kvm) { |
182 | tmp->arch.pause = true; | 182 | tmp->arch.power_off = true; |
183 | kvm_vcpu_kick(tmp); | 183 | kvm_vcpu_kick(tmp); |
184 | } | 184 | } |
185 | 185 | ||