From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqXPQ-0006wY-Ee for qemu-devel@nongnu.org; Wed, 23 Sep 2009 15:21:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqXPL-0006u8-9I for qemu-devel@nongnu.org; Wed, 23 Sep 2009 15:21:47 -0400 Received: from [199.232.76.173] (port=39684 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqXPL-0006u4-41 for qemu-devel@nongnu.org; Wed, 23 Sep 2009 15:21:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25951) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MqXPK-0002kE-N5 for qemu-devel@nongnu.org; Wed, 23 Sep 2009 15:21:43 -0400 Date: Wed, 23 Sep 2009 22:19:43 +0300 From: "Michael S. Tsirkin" Message-ID: <20090923191943.GC18947@redhat.com> References: <20090923125818.GA13875@redhat.com> <4ABA62D0.2060205@codemonkey.ws> <20090923184041.GA18947@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: comments on: get page size in device init List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org On Wed, Sep 23, 2009 at 10:03:26PM +0300, Blue Swirl wrote: > On Wed, Sep 23, 2009 at 9:40 PM, Michael S. Tsirkin wr= ote: > > On Wed, Sep 23, 2009 at 01:02:56PM -0500, Anthony Liguori wrote: > >> Blue Swirl wrote: > >>> On Wed, Sep 23, 2009 at 3:58 PM, Michael S. Tsirkin wrote: > >>> > >>>>> =A0 =A0 Compile msix only once > >>>>> > >>>>> =A0 =A0 Get page size in device init. > >>>>> > >>>>> =A0 =A0 Signed-off-by: Blue Swirl > >>>>> > >>>> What was the motivation for the page size change? > >>>> > >>> > >>> "Compile msix only once" > >>> > >>> > >>>> It seems the only user passes TARGET_PAGE_SIZE anyway, > >>>> using a constant seems clearer and probably generates > >>>> less code. No? > >>>> > >>> > >>> Yes, but then the code would depend on TARGET_PAGE_SIZE, making it > >>> impossible to compile the code only once. > >>> > >> > >> We could probably get away with doing > >> > >> #define TARGET_PAGE_SIZE target_get_page_size() > >> > >> And take care of a big chunk of this without passing page size > >> parameters around. > > > > > > Sounds good. >=20 > That would work and target_get_page_size() together with > get_ram_size() would also handle the virtio case nicely, except for > the if (!kvm_enabled() || kvm_has_sync_mmu()) part. OK, I did and just sent the msix part, virtio can come on top. --=20 MST