9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Anthony Martin <ality@pbrane.org>
To: 9front@9front.org
Subject: Re: 9FRONT "EMAILSCHADEN" RELEASED
Date: Mon, 19 Oct 2020 15:38:59 -0700	[thread overview]
Message-ID: <20201019223859.GC243000@alice> (raw)
In-Reply-To: <0230698894072CDFA179F53B8EE1DA03@ewsd.inri.net>

sl@stanleylieber.com once said:
> pc, pc64: remove mystery "type" bits in pcicfgrw*raw() (fixes qemu, thanks 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, §3.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


       reply	other threads:[~2020-10-19 22:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0230698894072CDFA179F53B8EE1DA03@ewsd.inri.net>
2020-10-19 22:38 ` Anthony Martin [this message]
2020-10-24 22:29   ` [9front] " cinap_lenrek
2020-10-24 23:28   ` cinap_lenrek
2020-10-24 23:57     ` Thaddeus Woskowiak
2020-10-25  0:49       ` Alex Musolino
2020-11-02  0:54         ` kokamoto
2020-11-02  5:22           ` Eli Cohen
2020-11-04 13:24           ` cinap_lenrek
2020-11-04 13:29           ` cinap_lenrek
2020-11-05  3:27             ` kokamoto
2020-10-19  4:03 sl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201019223859.GC243000@alice \
    --to=ality@pbrane.org \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).