Hi Gavin,

On 18/08/2020 02:13, Gavin Shan wrote:
> This renames user_mem_abort() to kvm_handle_user_mem_abort(), and
> then exports it. The function will be used in asynchronous page fault
> to populate a page table entry once the corresponding page is populated
> from the backup device (e.g. swap partition):
> 
>    * Parameter @fault_status is replace by @esr.
>    * Parameter @prefault is added
> 
> As the @esr is passed as parameter, not fetched from vCPU struct. This
> also introduces the necessasry helpers in esr.h, to manupulate the @esr.

(Nit: necessary, manipulate)


> The helpers defined in kvm_emulate.h reuses the newly added helper. This
> shouldn't cause functional changes.

user_mem_abort() is deep in the the guts of KVM's arch code. I don't think this 
should be
exported. It  must be called on the vcpu thread. It must be called under the 
VMs srcu
lock. There are also tricky interactions with whether the vcpu is loaded on 
this cpu or not...

I think it would be much simpler to always let the guest take the stage2-fault 
a second
time. This keeps the property that pages are only populate in response to a 
stage2 fault.
If the guest behaves, it will only schedule a task that accesses the page once 
its available.


Thanks,

James
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

Reply via email to