Skip to content

Commit 2610a57

Browse files
uudiinpaulusmack
authored andcommitted
KVM: PPC: Remove redundant kvm_run from vcpu_arch
The 'kvm_run' field already exists in the 'vcpu' structure, which is the same structure as the 'kvm_run' in the 'vcpu_arch' and should be deleted. Signed-off-by: Tianjia Zhang <[email protected]> Reviewed-by: Vitaly Kuznetsov <[email protected]> Reviewed-by: Paul Mackerras <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent 512721d commit 2610a57

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

arch/powerpc/include/asm/kvm_host.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,6 @@ struct kvm_vcpu_arch {
795795
struct mmio_hpte_cache_entry *pgfault_cache;
796796

797797
struct task_struct *run_task;
798-
struct kvm_run *kvm_run;
799798

800799
spinlock_t vpa_update_lock;
801800
struct kvmppc_vpa vpa;

arch/powerpc/kvm/book3s_hv.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2932,7 +2932,7 @@ static void post_guest_process(struct kvmppc_vcore *vc, bool is_master)
29322932

29332933
ret = RESUME_GUEST;
29342934
if (vcpu->arch.trap)
2935-
ret = kvmppc_handle_exit_hv(vcpu->arch.kvm_run, vcpu,
2935+
ret = kvmppc_handle_exit_hv(vcpu->run, vcpu,
29362936
vcpu->arch.run_task);
29372937

29382938
vcpu->arch.ret = ret;
@@ -3917,7 +3917,6 @@ static int kvmppc_run_vcpu(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
39173917
spin_lock(&vc->lock);
39183918
vcpu->arch.ceded = 0;
39193919
vcpu->arch.run_task = current;
3920-
vcpu->arch.kvm_run = kvm_run;
39213920
vcpu->arch.stolen_logged = vcore_stolen_time(vc, mftb());
39223921
vcpu->arch.state = KVMPPC_VCPU_RUNNABLE;
39233922
vcpu->arch.busy_preempt = TB_NIL;
@@ -3970,7 +3969,7 @@ static int kvmppc_run_vcpu(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
39703969
if (signal_pending(v->arch.run_task)) {
39713970
kvmppc_remove_runnable(vc, v);
39723971
v->stat.signal_exits++;
3973-
v->arch.kvm_run->exit_reason = KVM_EXIT_INTR;
3972+
v->run->exit_reason = KVM_EXIT_INTR;
39743973
v->arch.ret = -EINTR;
39753974
wake_up(&v->arch.cpu_run);
39763975
}
@@ -4046,7 +4045,6 @@ int kvmhv_run_single_vcpu(struct kvm_run *kvm_run,
40464045
vc = vcpu->arch.vcore;
40474046
vcpu->arch.ceded = 0;
40484047
vcpu->arch.run_task = current;
4049-
vcpu->arch.kvm_run = kvm_run;
40504048
vcpu->arch.stolen_logged = vcore_stolen_time(vc, mftb());
40514049
vcpu->arch.state = KVMPPC_VCPU_RUNNABLE;
40524050
vcpu->arch.busy_preempt = TB_NIL;

arch/powerpc/kvm/book3s_hv_nested.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,7 @@ long kvmhv_enter_nested_guest(struct kvm_vcpu *vcpu)
290290
r = RESUME_HOST;
291291
break;
292292
}
293-
r = kvmhv_run_single_vcpu(vcpu->arch.kvm_run, vcpu, hdec_exp,
294-
lpcr);
293+
r = kvmhv_run_single_vcpu(vcpu->run, vcpu, hdec_exp, lpcr);
295294
} while (is_kvmppc_resume_guest(r));
296295

297296
/* save L2 state for return */

0 commit comments

Comments
 (0)