From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Molnar Subject: Re: [PATCH 2/3 V2] kvm tools: Prevent PFN wraparound Date: Wed, 11 May 2011 13:15:59 +0200 Message-ID: <20110511111559.GD18521@elte.hu> References: <1305086951-31698-1-git-send-email-levinsasha928@gmail.com> <1305086951-31698-2-git-send-email-levinsasha928@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: penberg@kernel.org, asias.hejun@gmail.com, prasadjoshi124@gmail.com, avi@redhat.com, gorcunov@gmail.com, kvm@vger.kernel.org To: Sasha Levin Return-path: Received: from fallback.mail.elte.hu ([157.181.151.13]:37616 "EHLO fallback.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756590Ab1EKP7A (ORCPT ); Wed, 11 May 2011 11:59:00 -0400 Received: from mx3.mail.elte.hu ([157.181.1.138]) by fallback.mail.elte.hu with esmtp (Exim) id 1QK7Oi-00075b-3t from for ; Wed, 11 May 2011 13:16:08 +0200 Content-Disposition: inline In-Reply-To: <1305086951-31698-2-git-send-email-levinsasha928@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: * Sasha Levin wrote: > +++ b/tools/kvm/include/kvm/virtio.h > @@ -36,6 +36,11 @@ static inline bool virt_queue__available(struct virt_queue *vq) > return vq->vring.avail->idx != vq->last_avail_idx; > } > > +static inline void *guest_pfn_to_host(struct kvm *kvm, u32 pfn) > +{ > + return guest_flat_to_host(kvm, (unsigned long)pfn << 12); > +} We should at minimum document that on 32-bit hosts this will clip things at 4GB. Documenting such things helps, in case someone ventures into fixing this limitation in the future. Thanks, Ingo