All,
Attached is a patch that fixes the first (of at least a couple) migration
problem that I am running into. Basically, using the setup I described in my
last post, I was always getting "Disabling IRQ #11" once the guest reached the
destination side, and then no further activity. Dumping the APIC on both the
source and destination side revealed something interesting:
Source:
APIC 0x2
(pad is 0x0
IOAPIC state:
base_address: 0xfec00000
ioregsel: 0x2e
id: 0x0
irr: 0x0
pad: 0x0
Destination:
APIC 0x2
(pad is 0x38)
IOAPIC state:
base_address: 0xf2001000
ioregsel: 0x2e
id: 0x0
irr: 0x78872f3d
pad: 0x38
You'll notice that the base_address and irr are completely bogus on the
destination side. Although KVM_CREATE_IRQCHIP does the right thing on the
destination side when first creating the "incoming" guest, the base_address and
other fields get blown away with bogus data during the restore. The attached
patch fixes this by only restoring the bits that we know were saved on the
source side (i.e. what's in qemu/hw/apic.c:ioapic_save()).
Signed-off-by: Chris Lalancette <[EMAIL PROTECTED]>
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 8f94a0b..b07ea3a 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1314,6 +1314,9 @@ static int kvm_vm_ioctl_get_irqchip(struct kvm *kvm, struct kvm_irqchip *chip)
static int kvm_vm_ioctl_set_irqchip(struct kvm *kvm, struct kvm_irqchip *chip)
{
int r;
+ int i;
+ struct kvm_ioapic *kioapic;
+ struct kvm_ioapic_state *uioapic;
r = 0;
switch (chip->chip_id) {
@@ -1328,9 +1331,16 @@ static int kvm_vm_ioctl_set_irqchip(struct kvm *kvm, struct kvm_irqchip *chip)
sizeof(struct kvm_pic_state));
break;
case KVM_IRQCHIP_IOAPIC:
- memcpy(ioapic_irqchip(kvm),
- &chip->chip.ioapic,
- sizeof(struct kvm_ioapic_state));
+ kioapic = ioapic_irqchip(kvm);
+ uioapic = &chip->chip.ioapic;
+
+ kioapic->id = uioapic->id;
+ kioapic->ioregsel = uioapic->ioregsel;
+
+ for (i = 0; i < IOAPIC_NUM_PINS; i++) {
+ kioapic->redirtbl[i].bits = uioapic->redirtbl[i].bits;
+ }
+
break;
default:
r = -EINVAL;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel