From: Jan Beulich Date: Mon, 25 Apr 2016 12:22:29 +0000 (+0200) Subject: x86/MMCFG: don't ignore error from intercept handler X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~1257 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5fe3abb574b319a8729d70d0b12e3a5b830dd66b;p=xen.git x86/MMCFG: don't ignore error from intercept handler In commit 9256f66c16 ("x86/PCI: intercept all PV Dom0 MMCFG writes") for an unclear to me reason I left pci_conf_write_intercept()'s return value unchecked. Correct this. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper Release-acked-by: Wei Liu --- diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index bca75321f0..ca26f49b8c 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -5430,11 +5430,11 @@ int mmcfg_intercept_write( } offset &= 0xfff; - pci_conf_write_intercept(mmio_ctxt->seg, mmio_ctxt->bdf, offset, bytes, - p_data); - pci_mmcfg_write(mmio_ctxt->seg, PCI_BUS(mmio_ctxt->bdf), - PCI_DEVFN2(mmio_ctxt->bdf), offset, bytes, - *(uint32_t *)p_data); + if ( pci_conf_write_intercept(mmio_ctxt->seg, mmio_ctxt->bdf, + offset, bytes, p_data) >= 0 ) + pci_mmcfg_write(mmio_ctxt->seg, PCI_BUS(mmio_ctxt->bdf), + PCI_DEVFN2(mmio_ctxt->bdf), offset, bytes, + *(uint32_t *)p_data); return X86EMUL_OKAY; }