qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] kvm: Relax aligment check of kvm_set_phys_mem


From: Jan Kiszka
Subject: [Qemu-devel] [PATCH] kvm: Relax aligment check of kvm_set_phys_mem
Date: Thu, 30 Apr 2009 10:17:39 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

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 <address@hidden>
---

 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();
     }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]