Re: [PATCH 3/4] KVM: x86: kvm_hv_flush_tlb use inputs from XMM registers

Vitaly Kuznetsov
2021-04-08T12:52:38Z

Paolo Bonzini <pbonzini@redhat.com> writes:

> On 08/04/21 14:01, Vitaly Kuznetsov wrote:
>>
>> Also, we can probably defer kvm_hv_hypercall_read_xmm() until we know
>> how many regs we actually need to not read them all (we will always
>> need xmm[0] I guess so we can as well read it here).
>
> The cost is get/put FPU, so I think there's not much to gain from that.
>

Maybe, I just think that in most cases we will only need xmm0. To make
the optimization work we can probably do kvm_get_fpu() once we figured
out that we're dealing with XMM hypercall and do kvm_put_fpu() when
we're done processing hypercall parameters. This way we don't need to do
get/put twice. We can certainly leave this idea to the (possible) future
optimizations.

--
Vitaly