From patchwork Tue Nov 10 00:23:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 56275 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp475668lbb; Mon, 9 Nov 2015 16:24:20 -0800 (PST) X-Received: by 10.140.98.195 with SMTP id o61mr828241qge.70.1447115059998; Mon, 09 Nov 2015 16:24:19 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id c110si580737qgc.127.2015.11.09.16.24.19 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 09 Nov 2015 16:24:19 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:56602 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvwjT-00026D-GM for patch@linaro.org; Mon, 09 Nov 2015 19:24:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zvwj5-0001ou-6x for qemu-devel@nongnu.org; Mon, 09 Nov 2015 19:23:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zvwj0-0007rf-9L for qemu-devel@nongnu.org; Mon, 09 Nov 2015 19:23:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36463) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zvwj0-0007rb-3z for qemu-devel@nongnu.org; Mon, 09 Nov 2015 19:23:50 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 837CDC0467FF; Tue, 10 Nov 2015 00:23:49 +0000 (UTC) Received: from hawk.localdomain.com (ovpn-116-60.ams2.redhat.com [10.36.116.60]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAA0Nkq4028530; Mon, 9 Nov 2015 19:23:47 -0500 From: Andrew Jones To: qemu-devel@nongnu.org, kvm@vger.kernel.org Date: Mon, 9 Nov 2015 19:23:42 -0500 Message-Id: <1447115022-4142-1-git-send-email-drjones@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: pbonzini@redhat.com Subject: [Qemu-devel] [PATCH] kvm-all: PAGE_SIZE should be real host page size X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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(-) -- 2.4.3 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