On 05/05/20 10:51, Gavin Shan wrote: >> How does the guest know if host has any pending events or not? > > One way would be through struct kvm_vcpu_pv_apf_data, which is visible > to host and guest. In the host, the workers that have completed their > work (GUP) are queued into vcpu->async_pf.done. So we need a bit in > struct kvm_vcpu_pv_apf_data, written by host while read by guest to > see if there pending work. I even don't think the writer/reader need > to be synchronized. No, this cannot work. The problem is that you need a way to tell the host "you can give me another ready page", and a memory location is not enough for that. Paolo