On 25/11/2015 17:55, Andrey Smetanin wrote: >> >> + gpa = synic->msg_page & PAGE_MASK; >> + page = kvm_vcpu_gfn_to_page(vcpu, gpa >> PAGE_SHIFT); >> + if (is_error_page(page)) { >> + vcpu_err(vcpu, "Hyper-V SynIC can't get msg page, gpa 0x%llx\n", >> + gpa); >> + return; >> + } >> + msg_page = kmap_atomic(page); > > But the message page is not being pinned, is it? > > Actually I don't know anything about pinning. > Is it pinning against page swapping ?
Yes. Unless the page is pinned, kmap_atomic can fail. However, I don't think that kvm_hv_notify_acked_sint is called from atomic context. It is only called from apic_set_eoi. Could you just use kvm_vcpu_write_guest_page? By the way, do you need to do this also in kvm_get_apic_interrupt, for auto EOI interrupts? Thanks, Paolo > Could you please clarify and provide an API to use in this case ?