Commit e6f4afe029ae21853fd6625d94e9e0b2caa4defd

Authored by Jan Kiszka
Committed by Anthony Liguori
1 parent 582af0da

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>
Showing 1 changed file with 9 additions and 1 deletions
kvm-all.c
@@ -583,7 +583,15 @@ void kvm_set_phys_mem(target_phys_addr_t start_addr, @@ -583,7 +583,15 @@ void kvm_set_phys_mem(target_phys_addr_t start_addr,
583 int err; 583 int err;
584 584
585 if (start_addr & ~TARGET_PAGE_MASK) { 585 if (start_addr & ~TARGET_PAGE_MASK) {
586 - fprintf(stderr, "Only page-aligned memory slots supported\n"); 586 + if (flags >= IO_MEM_UNASSIGNED) {
  587 + if (!kvm_lookup_overlapping_slot(s, start_addr,
  588 + start_addr + size)) {
  589 + return;
  590 + }
  591 + fprintf(stderr, "Unaligned split of a KVM memory slot\n");
  592 + } else {
  593 + fprintf(stderr, "Only page-aligned memory slots supported\n");
  594 + }
587 abort(); 595 abort();
588 } 596 }
589 597