From patchwork Tue May 3 11:54:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 93775 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 66F77B6EFE for ; Tue, 3 May 2011 21:55:14 +1000 (EST) Received: from localhost ([::1]:44098 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHEC7-0004fq-Li for incoming@patchwork.ozlabs.org; Tue, 03 May 2011 07:55:11 -0400 Received: from eggs.gnu.org ([140.186.70.92]:58127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHEBm-0004XW-DD for qemu-devel@nongnu.org; Tue, 03 May 2011 07:54:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QHEBl-0005iv-GR for qemu-devel@nongnu.org; Tue, 03 May 2011 07:54:50 -0400 Received: from cantor2.suse.de ([195.135.220.15]:55913 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHEBl-0005ib-BB for qemu-devel@nongnu.org; Tue, 03 May 2011 07:54:49 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id 1221688B6C; Tue, 3 May 2011 13:54:46 +0200 (CEST) From: Alexander Graf To: QEMU-devel Developers Date: Tue, 3 May 2011 13:54:46 +0200 Message-Id: <1304423686-18909-2-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1304423686-18909-1-git-send-email-agraf@suse.de> References: <1304423686-18909-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: Scott Wood Subject: [Qemu-devel] [PATCH] kvm: ppc: warn user on PAGE_SIZE mismatch 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On PPC, the default PAGE_SIZE is 64kb. Unfortunately, the hardware alignments don't match here: There are RAM and MMIO regions within a single page when it's 64kb in size. So the only way out for now is to tell the user that he should use 4k PAGE_SIZE. This patch gives the user a hint on that, telling him that failing to register a prefix slot is most likely to be caused by mismatching PAGE_SIZE. This way it's also more future-proof, as bigger PAGE_SIZE can easily be supported by other machines then, as long as they stick to 64kb granularities. Signed-off-by: Alexander Graf --- kvm-all.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index d92c20e..a30865e 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -590,6 +590,11 @@ static void kvm_set_phys_mem(target_phys_addr_t start_addr, ram_addr_t size, if (err) { fprintf(stderr, "%s: error registering prefix slot: %s\n", __func__, strerror(-err)); +#ifdef TARGET_PPC + fprintf(stderr, "%s: This is probably because your kernel's " \ + "PAGE_SIZE is too big. Please try to use 4k " \ + "PAGE_SIZE!\n", __func__); +#endif abort(); } }