From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45288) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1dee-0000dZ-L1 for qemu-devel@nongnu.org; Wed, 25 Nov 2015 12:14:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1deb-0006Lt-AJ for qemu-devel@nongnu.org; Wed, 25 Nov 2015 12:14:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44076) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1deb-0006Ll-59 for qemu-devel@nongnu.org; Wed, 25 Nov 2015 12:14:49 -0500 References: <1448464821-8199-1-git-send-email-asmetanin@virtuozzo.com> <1448464821-8199-7-git-send-email-asmetanin@virtuozzo.com> <5655E748.4080503@redhat.com> <5655E800.5030309@virtuozzo.com> From: Paolo Bonzini Message-ID: <5655EC83.4090201@redhat.com> Date: Wed, 25 Nov 2015 18:14:43 +0100 MIME-Version: 1.0 In-Reply-To: <5655E800.5030309@virtuozzo.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v1 6/7] kvm/x86: Hyper-V SynIC message slot pending clearing at SINT ack List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: asmetanin@virtuozzo.com, kvm@vger.kernel.org Cc: Gleb Natapov , Haiyang Zhang , qemu-devel@nongnu.org, Roman Kagan , "Denis V. Lunev" , Vitaly Kuznetsov , "K. Y. Srinivasan" On 25/11/2015 17:55, Andrey Smetanin wrote: >> >> + gpa =3D synic->msg_page & PAGE_MASK; >> + page =3D 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 =3D 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 ?