aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2009-04-30 10:17:39 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-05-01 09:38:33 -0500
commite6f4afe029ae21853fd6625d94e9e0b2caa4defd (patch)
treef1a9736c76effb3245b102657a70ecea6cfbbc9b
parent582af0da2a65784e431c2c5ed3a003a35c5587f7 (diff)
kvm: Relax aligment check of kvm_set_phys_mem
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 <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--kvm-all.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/kvm-all.c b/kvm-all.c
index 32cd636f8f..0da5c7aa8d 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();
}