From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LzRSw-0006it-FC for qemu-devel@nongnu.org; Thu, 30 Apr 2009 04:17:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LzRSs-0006ih-UT for qemu-devel@nongnu.org; Thu, 30 Apr 2009 04:17:58 -0400 Received: from [199.232.76.173] (port=34770 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LzRSs-0006ie-RB for qemu-devel@nongnu.org; Thu, 30 Apr 2009 04:17:54 -0400 Received: from lizzard.sbs.de ([194.138.37.39]:22707) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LzRSs-0004LU-CM for qemu-devel@nongnu.org; Thu, 30 Apr 2009 04:17:54 -0400 Message-ID: <49F95EA3.9020600@siemens.com> Date: Thu, 30 Apr 2009 10:17:39 +0200 From: Jan Kiszka MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] kvm: Relax aligment check of kvm_set_phys_mem List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Liu Yu-B13201 , qemu-devel , Hollis Blanchard There is no need to reject an unaligned memory region registration if the region will be I/O memory and it will not split an existing KVM slot. This fixes KVM support on PPC. Signed-off-by: Jan Kiszka --- kvm-all.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 32cd636..0da5c7a 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -583,7 +583,15 @@ void kvm_set_phys_mem(target_phys_addr_t start_addr, int err; if (start_addr & ~TARGET_PAGE_MASK) { - fprintf(stderr, "Only page-aligned memory slots supported\n"); + if (flags >= IO_MEM_UNASSIGNED) { + if (!kvm_lookup_overlapping_slot(s, start_addr, + start_addr + size)) { + return; + } + fprintf(stderr, "Unaligned split of a KVM memory slot\n"); + } else { + fprintf(stderr, "Only page-aligned memory slots supported\n"); + } abort(); }