[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0eab7a31-53e0-2899-76d7-3e9c0be76fad@redhat.com>
Date: Fri, 22 Oct 2021 18:31:03 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Maxim Levitsky <mlevitsk@...hat.com>, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org
Cc: fwilhelm@...gle.com, seanjc@...gle.com, oupton@...gle.com,
stable@...r.kernel.org
Subject: Re: [PATCH 4/8] KVM: SEV-ES: clean up kvm_sev_es_ins/outs
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
Powered by blists - more mailing lists