lkml.org 
[lkml]   [2020]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v6 3/5] KVM: PPC: clean up redundant kvm_run parameters in assembly
From
Date
On 23/06/20 15:14, Tianjia Zhang wrote:
>
> /* 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
> bl FUNC(kvmppc_copy_to_svcpu)
> nop
> - REST_GPR(4, r1)
> + REST_GPR(3, r1)
>
> #ifdef CONFIG_PPC_BOOK3S_64
> /* Get the dcbz32 flag */
> @@ -146,7 +144,7 @@ after_sprg3_load:

Below, there are a bunch of references to r3 and r4 left

rldicl r3, r3, 0, 63 /* r3 &= 1 */
stb r3, HSTATE_RESTORE_HID5(r13)

/* Load up guest SPRG3 value, since it's user readable */
lwz r3, VCPU_SHAREDBE(r4) <<<
cmpwi r3, 0
ld r5, VCPU_SHARED(r4) <<<

where r3 is also destroyed. So I'd rather have three patches:

- one that is as small as possible, changing the prototypes and adding

mr r4, r3

- one that entirely swaps out r3 and r4. This would be the hard one to
review!

- one that cleans up the prologue and epilogue

But overall I think it's simplest to just leave out this patch.

Paolo

\
 
 \ /
  Last update: 2020-07-10 09:58    [W:0.105 / U:1.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site