From: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
To: Paul Mackerras <paulus@ozlabs.org>
Cc: wanpengli@tencent.com, kvm@vger.kernel.org, david@redhat.com,
benh@kernel.crashing.org, heiko.carstens@de.ibm.com,
linux-mips@vger.kernel.org, hpa@zytor.com,
kvmarm@lists.cs.columbia.edu, linux-s390@vger.kernel.org,
frankja@linux.ibm.com, chenhuacai@gmail.com, maz@kernel.org,
joro@8bytes.org, x86@kernel.org, borntraeger@de.ibm.com,
mingo@redhat.com, thuth@redhat.com, gor@linux.ibm.com,
kvm-ppc@vger.kernel.org, bp@alien8.de, tglx@linutronix.de,
linux-arm-kernel@lists.infradead.org, jmattson@google.com,
tsbogend@alpha.franken.de, cohuck@redhat.com,
sean.j.christopherson@intel.com, linux-kernel@vger.kernel.org,
mpe@ellerman.id.au, pbonzini@redhat.com, vkuznets@redhat.com,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v4 5/7] KVM: PPC: clean up redundant kvm_run parameters in assembly
Date: Mon, 13 Jul 2020 11:07:18 +0800 [thread overview]
Message-ID: <c3540a4b-a568-3428-0427-ae2a1f30dbe2@linux.alibaba.com> (raw)
In-Reply-To: <20200526055924.GD282305@thinks.paulus.ozlabs.org>
On 2020/5/26 13:59, Paul Mackerras wrote:
> On Mon, Apr 27, 2020 at 12:35:12PM +0800, Tianjia Zhang wrote:
>> In the current kvm version, 'kvm_run' has been included in the 'kvm_vcpu'
>> structure. For historical reasons, many kvm-related function parameters
>> retain the 'kvm_run' and 'kvm_vcpu' parameters at the same time. This
>> patch does a unified cleanup of these remaining redundant parameters.
>
> Some of these changes don't look completely correct to me, see below.
> If you're expecting these patches to go through my tree, I can fix up
> the patch and commit it (with you as author), noting the changes I
> made in the commit message. Do you want me to do that?
>
I am very glad for you to do so, although I have submitted a new version
of patch, I still prefer you to fix up and commit it.
Thanks and best,
Tianjia
>> diff --git a/arch/powerpc/kvm/book3s_interrupts.S b/arch/powerpc/kvm/book3s_interrupts.S
>> index f7ad99d972ce..0eff749d8027 100644
>> --- a/arch/powerpc/kvm/book3s_interrupts.S
>> +++ b/arch/powerpc/kvm/book3s_interrupts.S
>> @@ -55,8 +55,7 @@
>> ****************************************************************************/
>>
>> /* Registers:
>> - * r3: kvm_run pointer
>> - * r4: vcpu pointer
>> + * r3: vcpu pointer
>> */
>> _GLOBAL(__kvmppc_vcpu_run)
>>
>> @@ -68,8 +67,8 @@ kvm_start_entry:
>> /* Save host state to the stack */
>> PPC_STLU r1, -SWITCH_FRAME_SIZE(r1)
>>
>> - /* Save r3 (kvm_run) and r4 (vcpu) */
>> - SAVE_2GPRS(3, r1)
>> + /* Save r3 (vcpu) */
>> + SAVE_GPR(3, r1)
>>
>> /* Save non-volatile registers (r14 - r31) */
>> SAVE_NVGPRS(r1)
>> @@ -82,11 +81,11 @@ kvm_start_entry:
>> PPC_STL r0, _LINK(r1)
>>
>> /* Load non-volatile guest state from the vcpu */
>> - VCPU_LOAD_NVGPRS(r4)
>> + VCPU_LOAD_NVGPRS(r3)
>>
>> kvm_start_lightweight:
>> /* Copy registers into shadow vcpu so we can access them in real mode */
>> - mr r3, r4
>> + mr r4, r3
>
> This mr doesn't seem necessary.
>
>> bl FUNC(kvmppc_copy_to_svcpu)
>> nop
>> REST_GPR(4, r1)
>
> This should be loading r4 from GPR3(r1), not GPR4(r1) - which is what
> REST_GPR(4, r1) will do.
>
> Then, in the file but not in the patch context, there is this line:
>
> PPC_LL r3, GPR4(r1) /* vcpu pointer */
>
> where once again GPR4 needs to be GPR3.
>
>> @@ -191,10 +190,10 @@ after_sprg3_load:
>> PPC_STL r31, VCPU_GPR(R31)(r7)
>>
>> /* Pass the exit number as 3rd argument to kvmppc_handle_exit */
>
> The comment should be modified to say "2nd" instead of "3rd",
> otherwise it is confusing.
>
> The rest of the patch looks OK.
>
> Paul.
>
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
next prev parent reply other threads:[~2020-07-13 7:44 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-27 4:35 [PATCH v4 0/7] clean up redundant 'kvm_run' parameters Tianjia Zhang
2020-04-27 4:35 ` [PATCH v4 1/7] KVM: s390: " Tianjia Zhang
2020-04-29 12:03 ` Vitaly Kuznetsov
2020-04-27 4:35 ` [PATCH v4 2/7] KVM: arm64: " Tianjia Zhang
2020-04-29 12:07 ` Vitaly Kuznetsov
2020-05-05 8:39 ` Marc Zyngier
2020-05-07 13:04 ` Tianjia Zhang
2020-04-27 4:35 ` [PATCH v4 3/7] KVM: PPC: Remove redundant kvm_run from vcpu_arch Tianjia Zhang
2020-04-29 12:23 ` Vitaly Kuznetsov
2020-05-26 4:36 ` Paul Mackerras
2020-05-27 4:20 ` Paul Mackerras
2020-05-27 5:23 ` Tianjia Zhang
2020-04-27 4:35 ` [PATCH v4 4/7] KVM: PPC: clean up redundant 'kvm_run' parameters Tianjia Zhang
2020-04-29 12:32 ` Vitaly Kuznetsov
2020-05-26 5:49 ` Paul Mackerras
2020-04-27 4:35 ` [PATCH v4 5/7] KVM: PPC: clean up redundant kvm_run parameters in assembly Tianjia Zhang
2020-05-26 5:59 ` Paul Mackerras
2020-07-13 3:07 ` Tianjia Zhang [this message]
2020-04-27 4:35 ` [PATCH v4 6/7] KVM: MIPS: clean up redundant 'kvm_run' parameters Tianjia Zhang
2020-04-27 5:40 ` Huacai Chen
2020-05-27 6:24 ` Tianjia Zhang
2020-05-29 9:48 ` Paolo Bonzini
2020-06-16 11:54 ` Tianjia Zhang
2020-04-27 4:35 ` [PATCH v4 7/7] KVM: MIPS: clean up redundant kvm_run parameters in assembly Tianjia Zhang
2020-04-27 5:36 ` Huacai Chen
2020-05-05 4:15 ` [PATCH v4 0/7] clean up redundant 'kvm_run' parameters Tianjia Zhang
2020-06-23 9:42 ` Paolo Bonzini
2020-06-23 10:00 ` Tianjia Zhang
2020-06-23 10:24 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c3540a4b-a568-3428-0427-ae2a1f30dbe2@linux.alibaba.com \
--to=tianjia.zhang@linux.alibaba.com \
--cc=benh@kernel.crashing.org \
--cc=borntraeger@de.ibm.com \
--cc=bp@alien8.de \
--cc=chenhuacai@gmail.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=frankja@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=hpa@zytor.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maz@kernel.org \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=paulus@ozlabs.org \
--cc=pbonzini@redhat.com \
--cc=sean.j.christopherson@intel.com \
--cc=tglx@linutronix.de \
--cc=thuth@redhat.com \
--cc=tsbogend@alpha.franken.de \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).