[PATCH v3 19/52] KVM: PPC: Book3S HV P9: Reduce mtmsrd instructions required to save host SPRs

Nicholas Piggin npiggin at gmail.com
Wed Oct 20 16:35:44 AEDT 2021


Excerpts from Fabiano Rosas's message of October 16, 2021 11:45 pm:
> Nicholas Piggin <npiggin at gmail.com> writes:
> 
>> This reduces the number of mtmsrd required to enable facility bits when
>> saving/restoring registers, by having the KVM code set all bits up front
>> rather than using individual facility functions that set their particular
>> MSR bits.
>>
>> Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
> 
> Reviewed-by: Fabiano Rosas <farosas at linux.ibm.com>
> 
> Aside: at msr_check_and_set what's with MSR_VSX always being implicitly
> set whenever MSR_FP is set? I get that it depends on MSR_FP, but if FP
> always implies VSX, then you could stop setting MSR_VSX in this patch.

Good question, this seems to come from quite old code and is carried
forward. I did not immediately see why, might have been to avoid
another mtmsrd operation if we later want to set VSX.

But the rule seems to be to set MSR_VSX if both FP and VEC are set, so
this seems a bit odd. __msr_check_and_clear similarly clears VSX if we 
clear FP, but not if we clear VEC.

I might be good to remove that logic or turn it into warnings and make 
sure the callers do the right thing. Not sure.

Thanks,
Nick


More information about the Linuxppc-dev mailing list