From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34462) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwCJs-0006al-Fl for qemu-devel@nongnu.org; Tue, 10 Nov 2015 12:03:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwCJr-0005UA-9q for qemu-devel@nongnu.org; Tue, 10 Nov 2015 12:02:56 -0500 Received: from mail-vk0-x22d.google.com ([2607:f8b0:400c:c05::22d]:34172) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwCJr-0005Tv-5j for qemu-devel@nongnu.org; Tue, 10 Nov 2015 12:02:55 -0500 Received: by vkbq142 with SMTP id q142so1865613vkb.1 for ; Tue, 10 Nov 2015 09:02:54 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20151110165923.GE3452@hawk.localdomain> References: <1447115022-4142-1-git-send-email-drjones@redhat.com> <20151110165923.GE3452@hawk.localdomain> From: Peter Maydell Date: Tue, 10 Nov 2015 17:02:35 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH] kvm-all: PAGE_SIZE should be real host page size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andrew Jones Cc: Paolo Bonzini , QEMU Developers , kvm-devel On 10 November 2015 at 16:59, Andrew Jones wrote: > On Tue, Nov 10, 2015 at 04:29:31PM +0000, Peter Maydell wrote: >> On 10 November 2015 at 00:23, Andrew Jones wrote: >> > -/* KVM uses PAGE_SIZE in its definition of COALESCED_MMIO_MAX */ >> > -#define PAGE_SIZE TARGET_PAGE_SIZE >> > +/* KVM uses PAGE_SIZE in its definition of KVM_COALESCED_MMIO_MAX. We >> > + * need to use the real host PAGE_SIZE, as that's what KVM will use. >> > + */ >> > +#define PAGE_SIZE getpagesize() >> >> Rather than defining PAGE_SIZE here (a confusing macro given >> we have several page sizes to deal with), why not just use >> getpagesize() in the one and only location where we currently >> use this macro? > > The macro is used by kernel headers that we import and include in > kvm-all.c. It's ugly, I agree, but that's how the this cookie crumbled. Oh, I see. That's pretty horrible. thanks -- PMM