Received: from eggs.gnu.org ([2001:4830:134:3::10]:46550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtF0K-0001y7-Fz for qemu-devel@nongnu.org; Fri, 15 May 2015 08:46:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YtF0G-0007Ev-K9 for qemu-devel@nongnu.org; Fri, 15 May 2015 08:46:16 -0400 Received: from mail.emea.novell.com ([130.57.118.101]:53707) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtF0G-0007Er-Be for qemu-devel@nongnu.org; Fri, 15 May 2015 08:46:12 -0400 Message-Id: <555606B3020000780007A8F1@mail.emea.novell.com> Date: Fri, 15 May 2015 13:46:11 +0100 From: "Jan Beulich" Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: [Qemu-devel] [PATCH] xen/pass-through: fold host PCI command register writes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: xen-devel , Stefano Stabellini The code introduced to address XSA-126 allows simplification of other code in xen_pt_initfn(): All we need to do is update "cmd" suitably, as it'll be written back to the host register near the end of the function anyway. Signed-off-by: Jan Beulich --- a/hw/xen/xen_pt.c +++ b/hw/xen/xen_pt.c @@ -698,10 +698,7 @@ static int xen_pt_initfn(PCIDevice *d) machine_irq, pirq, rc); =20 /* Disable PCI intx assertion (turn on bit10 of devctl) */ - xen_host_pci_set_word(&s->real_device, - PCI_COMMAND, - pci_get_word(s->dev.config + PCI_COMMAND) - | PCI_COMMAND_INTX_DISABLE); + cmd |=3D PCI_COMMAND_INTX_DISABLE; machine_irq =3D 0; s->machine_irq =3D 0; } else { @@ -723,9 +720,7 @@ static int xen_pt_initfn(PCIDevice *d) e_intx, rc); =20 /* Disable PCI intx assertion (turn on bit10 of devctl) */ - xen_host_pci_set_word(&s->real_device, PCI_COMMAND, - *(uint16_t *)(&s->dev.config[PCI_COMMAND= ]) - | PCI_COMMAND_INTX_DISABLE); + cmd |=3D PCI_COMMAND_INTX_DISABLE; xen_pt_mapped_machine_irq[machine_irq]--; =20 if (xen_pt_mapped_machine_irq[machine_irq] =3D=3D 0) {