From: Ian Jackson Date: Tue, 13 Jan 2009 11:28:04 +0000 (+0000) Subject: Contain MSI errors in msi emulation code X-Git-Tag: t.master-before-merge~29^2~3 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=6052cb980abc07b8ec5596ccf543258638c67bc6;p=qemu-xen-3.4-testing.git Contain MSI errors in msi emulation code If msi=0 is specified and guest want to enable msi, qemu finds it can not enable it and quits. (This problem is not appicable for xen unstable since the "msi=x" switch is removed.) This patch let these cases be handled inside msi emulation code. If qemu can not enable msi, guest will not receive MSI. But Qemu can still go on. But if guest driver does not test MSI's functionality, guest device will stop to function. Submitted-By: Haitao Shan Signed-off-by: Ian Jackson (cherry picked from commit 35f55c5b0b54e310c787c39bde0f723a1390e839) Cherry pick requested by Dexuan Cui: In the latest Xen-unstable, MSI in xen was disabled temporarily and many guests with MSI-capable NIC assigned fail to bootup. Could you please pull the following commit of qemu-xen-3.3-testing.git into qemu-xen-unstable.git? Conflicts: hw/pass-through.c --- diff --git a/hw/pass-through.c b/hw/pass-through.c index 7280677f..6cf63e6f 100644 --- a/hw/pass-through.c +++ b/hw/pass-through.c @@ -2800,8 +2800,14 @@ static int pt_msgctrl_reg_write(struct pt_dev *ptdev, PT_LOG("setup msi for dev %x\n", pd->devfn); if (pt_msi_setup(ptdev)) { - PT_LOG("pt_msi_setup error!!!\n"); - return -1; + /* We do not broadcast the error to the framework code, so + * that MSI errors are contained in MSI emulation code and + * QEMU can go on running. + * Guest MSI would be actually not working. + */ + *value &= ~PCI_MSI_FLAGS_ENABLE; + PT_LOG("Warning: Can not map MSI for dev %x\n", pd->devfn); + return 0; } } pt_msi_update(ptdev);