From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from MTA-10-1.privateemail.com ([68.65.122.30]) by ewsd; Mon Oct 19 18:39:13 -0400 2020 Received: from MTA-10.privateemail.com (localhost [127.0.0.1]) by MTA-10.privateemail.com (Postfix) with ESMTP id 61E4860048 for <9front@9front.org>; Mon, 19 Oct 2020 18:39:09 -0400 (EDT) Received: from localhost (unknown [10.20.151.224]) by MTA-10.privateemail.com (Postfix) with ESMTPA id 75ABE60038 for <9front@9front.org>; Mon, 19 Oct 2020 22:39:08 +0000 (UTC) Date: Mon, 19 Oct 2020 15:38:59 -0700 From: Anthony Martin To: 9front@9front.org Subject: Re: 9FRONT "EMAILSCHADEN" RELEASED Message-ID: <20201019223859.GC243000@alice> References: <0230698894072CDFA179F53B8EE1DA03@ewsd.inri.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <0230698894072CDFA179F53B8EE1DA03@ewsd.inri.net> X-Virus-Scanned: ClamAV using ClamSMTP Content-Transfer-Encoding: quoted-printable List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: template descriptor sl@stanleylieber.com once said: > pc, pc64: remove mystery "type" bits in pcicfgrw*raw() (fixes qemu, tha= nks mischief) In changeset 78891f472fbf, cinap wrote: the access functions for pci config space in config mode #1 used to set bit 0 in the register offset if the access was to a device on any bus different from 0. it is completely unclear why this was done and i can't find any documentation on this. but for sure, this breaks all pci config spacess access to pci devices behind a bridge on qemu. with -trace pci* it was discovered that all config space register offsets on devies behind pci brige where off by one. Our code looks like it was a slight misreading of the specification and the change looks good. However, the original behavior should have been innocuous for any conforming host bridge: For Type 1 translations, the host bridge directly copies the contents of the CONFIG_ADDRESS register (excluding bits 31 and 0) onto the PCI AD lines during the address phase of a configuration transaction making sure that AD[1::0] is "01". (from PCI Local Bus Specification, Revision 3.0, =C2=A73.2.2.3.2) Note the phrase "excluding bits 31 and 0". Also, the PCI-PCI bridge in QEMU should be doing a Type 1 to Type 0 translation before the device behind the bridge sees the address. Cheers, Anthony