Received: from eggs.gnu.org ([2001:4830:134:3::10]:44279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzJcy-0007N5-7o for qemu-devel@nongnu.org; Mon, 01 Jun 2015 02:55:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzJcu-0000VB-UT for qemu-devel@nongnu.org; Mon, 01 Jun 2015 02:55:16 -0400 Received: from mail.emea.novell.com ([130.57.118.101]:50548) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzJcu-0000V7-Ld for qemu-devel@nongnu.org; Mon, 01 Jun 2015 02:55:12 -0400 Message-Id: <556C1DEB020000780007F82C@mail.emea.novell.com> Date: Mon, 01 Jun 2015 07:55:07 +0100 From: "Jan Beulich" References: <5556059F020000780007A8D0@mail.emea.novell.com> In-Reply-To: <5556059F020000780007A8D0@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: [Qemu-devel] Ping: [PATCH] xen/pass-through: ROM BAR handling adjustments List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Stabellini , qemu-devel@nongnu.org Cc: xen-devel Ping? >>> On 15.05.15 at 14:41, wrote: > Expecting the ROM BAR to be written with an all ones value when sizing > the region is wrong - the low bit has another meaning (enable/disable) > and bits 1..10 are reserved. The PCI spec also mandates writing all > ones to just the address portion of the register. >=20 > Use suitable constants also for initializing the ROM BAR register field > description. >=20 > Signed-off-by: Jan Beulich >=20 > --- a/hw/xen/xen_pt.c > +++ b/hw/xen/xen_pt.c > @@ -248,7 +248,9 @@ static void xen_pt_pci_write_config(PCID > =20 > /* check unused BAR register */ > index =3D xen_pt_bar_offset_to_index(addr); > - if ((index >=3D 0) && (val > 0 && val < XEN_PT_BAR_ALLF) && > + if ((index >=3D 0) && (val !=3D 0) && > + (((index !=3D PCI_ROM_SLOT) ? > + val : (val | (uint32_t)~PCI_ROM_ADDRESS_MASK)) !=3D=20 > XEN_PT_BAR_ALLF) && > (s->bases[index].bar_flag =3D=3D XEN_PT_BAR_FLAG_UNUSED)) { > XEN_PT_WARN(d, "Guest attempt to set address to unused Base = Address=20 > " > "Register. (addr: 0x%02x, len: %d)\n", addr, len); > --- a/hw/xen/xen_pt_config_init.c > +++ b/hw/xen/xen_pt_config_init.c > @@ -726,8 +726,8 @@ static XenPTRegInfo xen_pt_emu_reg_heade > .offset =3D PCI_ROM_ADDRESS, > .size =3D 4, > .init_val =3D 0x00000000, > - .ro_mask =3D 0x000007FE, > - .emu_mask =3D 0xFFFFF800, > + .ro_mask =3D ~PCI_ROM_ADDRESS_MASK & ~PCI_ROM_ADDRESS_ENABLE,= > + .emu_mask =3D (uint32_t)PCI_ROM_ADDRESS_MASK, > .init =3D xen_pt_bar_reg_init, > .u.dw.read =3D xen_pt_long_reg_read, > .u.dw.write =3D xen_pt_exp_rom_bar_reg_write, >=20 >=20 >=20 >=20 > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org=20 > http://lists.xen.org/xen-devel=20