[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87lfmeh44x.fsf@vitty.brq.redhat.com>
Date: Wed, 29 Apr 2020 14:23:42 +0200
From: Vitaly Kuznetsov <vkuznets@...hat.com>
To: Tianjia Zhang <tianjia.zhang@...ux.alibaba.com>
Cc: kvm@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
kvmarm@...ts.cs.columbia.edu, linux-mips@...r.kernel.org,
kvm-ppc@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-s390@...r.kernel.org, linux-kernel@...r.kernel.org,
tianjia.zhang@...ux.alibaba.com, pbonzini@...hat.com,
tsbogend@...ha.franken.de, paulus@...abs.org, mpe@...erman.id.au,
benh@...nel.crashing.org, borntraeger@...ibm.com,
frankja@...ux.ibm.com, david@...hat.com, cohuck@...hat.com,
heiko.carstens@...ibm.com, gor@...ux.ibm.com,
sean.j.christopherson@...el.com, wanpengli@...cent.com,
jmattson@...gle.com, joro@...tes.org, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, x86@...nel.org, hpa@...or.com,
maz@...nel.org, james.morse@....com, julien.thierry.kdev@...il.com,
suzuki.poulose@....com, christoffer.dall@....com,
peterx@...hat.com, thuth@...hat.com, chenhuacai@...il.com
Subject: Re: [PATCH v4 3/7] KVM: PPC: Remove redundant kvm_run from vcpu_arch
Tianjia Zhang <tianjia.zhang@...ux.alibaba.com> writes:
> 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 <tianjia.zhang@...ux.alibaba.com>
> ---
> arch/powerpc/include/asm/kvm_host.h | 1 -
> arch/powerpc/kvm/book3s_hv.c | 6 ++----
> arch/powerpc/kvm/book3s_hv_nested.c | 3 +--
> 3 files changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h
> index 1dc63101ffe1..2745ff8faa01 100644
> --- a/arch/powerpc/include/asm/kvm_host.h
> +++ b/arch/powerpc/include/asm/kvm_host.h
> @@ -795,7 +795,6 @@ struct kvm_vcpu_arch {
> struct mmio_hpte_cache_entry *pgfault_cache;
>
> struct task_struct *run_task;
> - struct kvm_run *kvm_run;
>
> spinlock_t vpa_update_lock;
> struct kvmppc_vpa vpa;
> diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
> index 93493f0cbfe8..413ea2dcb10c 100644
> --- a/arch/powerpc/kvm/book3s_hv.c
> +++ b/arch/powerpc/kvm/book3s_hv.c
> @@ -2934,7 +2934,7 @@ static void post_guest_process(struct kvmppc_vcore *vc, bool is_master)
>
> ret = RESUME_GUEST;
> if (vcpu->arch.trap)
> - ret = kvmppc_handle_exit_hv(vcpu->arch.kvm_run, vcpu,
> + ret = kvmppc_handle_exit_hv(vcpu->run, vcpu,
> vcpu->arch.run_task);
>
> vcpu->arch.ret = ret;
> @@ -3920,7 +3920,6 @@ static int kvmppc_run_vcpu(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
> spin_lock(&vc->lock);
> vcpu->arch.ceded = 0;
> vcpu->arch.run_task = current;
> - vcpu->arch.kvm_run = kvm_run;
> vcpu->arch.stolen_logged = vcore_stolen_time(vc, mftb());
> vcpu->arch.state = KVMPPC_VCPU_RUNNABLE;
> vcpu->arch.busy_preempt = TB_NIL;
> @@ -3973,7 +3972,7 @@ static int kvmppc_run_vcpu(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
> if (signal_pending(v->arch.run_task)) {
> kvmppc_remove_runnable(vc, v);
> v->stat.signal_exits++;
> - v->arch.kvm_run->exit_reason = KVM_EXIT_INTR;
> + v->run->exit_reason = KVM_EXIT_INTR;
> v->arch.ret = -EINTR;
> wake_up(&v->arch.cpu_run);
> }
> @@ -4049,7 +4048,6 @@ int kvmhv_run_single_vcpu(struct kvm_run *kvm_run,
> vc = vcpu->arch.vcore;
> vcpu->arch.ceded = 0;
> vcpu->arch.run_task = current;
> - vcpu->arch.kvm_run = kvm_run;
> vcpu->arch.stolen_logged = vcore_stolen_time(vc, mftb());
> vcpu->arch.state = KVMPPC_VCPU_RUNNABLE;
> vcpu->arch.busy_preempt = TB_NIL;
> diff --git a/arch/powerpc/kvm/book3s_hv_nested.c b/arch/powerpc/kvm/book3s_hv_nested.c
> index dc97e5be76f6..5a3987f3ebf3 100644
> --- a/arch/powerpc/kvm/book3s_hv_nested.c
> +++ b/arch/powerpc/kvm/book3s_hv_nested.c
> @@ -290,8 +290,7 @@ long kvmhv_enter_nested_guest(struct kvm_vcpu *vcpu)
> r = RESUME_HOST;
> break;
> }
> - r = kvmhv_run_single_vcpu(vcpu->arch.kvm_run, vcpu, hdec_exp,
> - lpcr);
> + r = kvmhv_run_single_vcpu(vcpu->run, vcpu, hdec_exp, lpcr);
> } while (is_kvmppc_resume_guest(r));
>
> /* save L2 state for return */
FWIW,
Reviewed-by: Vitaly Kuznetsov <vkuznets@...hat.com>
--
Vitaly
Powered by blists - more mailing lists