lkml.org 
[lkml]   [2021]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 4/8] KVM: SEV-ES: clean up kvm_sev_es_ins/outs
From
On 22/10/21 01:14, Maxim Levitsky wrote:
>>
>> vcpu->arch.pio.count = 0;
> ^^^
> I wonder what the rules are for clearing vcpu->arch.pio.count for userspace PIO vm exits.
> Looks like complete_fast_pio_out clears it, but otherwise the only other place
> that clears it in this case is x86_emulate_instruction when it restarts the instuction.
> Do I miss something?

For IN, it is cleared by the completion callback.

For OUT, it can be cleared either by the completion callback or before
calling it, because the completion callback will not need it. I would
like to standardize towards clearing it in the callback for out, too,
even if sometimes it's unnecessary to have a callback in the first
place; this is what patch 8 does for example. This way
vcpu->arch.pio.count > 0 tells you whether the other fields have a
recent value.

Paolo

\
 
 \ /
  Last update: 2021-10-22 18:32    [W:0.070 / U:0.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site