From: Andrew Jones Subject: Re: [PATCH] kvm-all: PAGE_SIZE should be real host page size Date: Tue, 10 Nov 2015 10:57:28 -0500 Message-ID: <20151110155728.GB3452@hawk.localdomain> References: <1447115022-4142-1-git-send-email-drjones@redhat.com> <5642101C.5060104@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org To: Paolo Bonzini Return-path: Received: from mx1.redhat.com ([209.132.183.28]:46148 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754079AbbKJP5d (ORCPT ); Tue, 10 Nov 2015 10:57:33 -0500 Content-Disposition: inline In-Reply-To: <5642101C.5060104@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Nov 10, 2015 at 04:41:16PM +0100, Paolo Bonzini wrote: > > > On 10/11/2015 01:23, Andrew Jones wrote: > > Just noticed this while grepping TARGET_PAGE_SIZE for an unrelated > > reason. I didn't use qemu_real_host_page_size as kvm_set_phys_mem() > > does, because we'd need to make sure page_size_init() has run first. > > > > Signed-off-by: Andrew Jones > > --- > > kvm-all.c | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/kvm-all.c b/kvm-all.c > > index 1bc12737723c3..de9ff5971fb3b 100644 > > --- a/kvm-all.c > > +++ b/kvm-all.c > > @@ -45,8 +45,10 @@ > > #include > > #endif > > > > -/* 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() > > > > //#define DEBUG_KVM > > > > > > Is this a bugfix or just a cleanup? If the former, on which targets? It's a bugfix for any targets that have a TARGET_PAGE_SIZE != real-host-page-size. For example ARM has TARGET_PAGE_SIZE set to 1024, even when the host is using 4k or 64k pages. However, I didn't find this due to a bug, because on ARM I'm not using emulated devices that make use of the coalesced-mmio feature at this time. Thanks, drew > > Paolo > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html