qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Bhushan Bharat-R65777 <R65777@freescale.com>
Cc: Yoder Stuart-B08248 <B08248@freescale.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Wood Scott-B07421 <B07421@freescale.com>
Subject: Re: [Qemu-devel] [RFC] Proposal: PCI/PCIe: inbound BAR0 emulation for PCI controller (Root Complex)
Date: Fri, 8 Jun 2012 13:56:35 -0500	[thread overview]
Message-ID: <4FD24AE3.60604@freescale.com> (raw)
In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D03D71BC1@039-SN2MPN1-022.039d.mgd.msft.net>

On 06/08/2012 04:03 AM, Bhushan Bharat-R65777 wrote:
> Hi All,
> 
> When Freescale PCI controller configured in Root Complex mode then,
> its configuration header (type 1) have one inbound BAR (BAR0, called
> as CCSRBAR).

It maps to CCSRBAR, but it's called PCICSRBAR/PEXCSRBAR.

> And rest of BARs (inbound and outbound) are supported by
> ATMU registers, which are outside the Type 1 configuration header.
> This BAR0 of Type 1 configuration header always translate to CCSR
> space and is of the size of CCSR. This BAR0 (inbound window) is
> required for MSI interrupts support.

Some sort of inbound mapping is required for MSIs.  It's typically this
one or PEXMSIBAR (which is a similar concept but more full-featured, and
not in config space), but doesn't have to be (e.g. we use normal inbound
windows for MSI on Topaz, because of PAMU limitations that prevent us
from using the CCSR address as the guest physical MSI destination).

> As far as I know, as of now no emulated PCI controller supports this
> BAR0 in type 1 configuration header. But probably (I think so) that
> supporting this is not of big concern, but the point is that this
> window (BAR0) translate to mmio-regs (CCSR) and not to DDR memory.
> 
> So I have couple of concerns here:
> 
> 1. Whenever PCI device does need DMA then these windows (inbound and
> outbound ATMUs registers) need to used to translate pci address to
> system physical address (Sometime we also call this as cpu address
> space). This will probably be done by : [Qemu-devel] [PATCH 00/12]
> IOMMU Infrastructure : patch-set ( I am trying to understand these
> patches :-))
> 
> 2. Hook up this inbound BAR0 in the above patch-set to translate to
> mmio-regs. As this would be controller specific, a callback will be
> registered for translation. Now it will be upto the controller
> specific code on how it translates. As this is needed only for MSI
> interrupt, maybe, initially we do not do anything initially, till we
> want MSI emulation in QEMU.

MSIs may be the only thing that we plan to use it for, but if you want
to properly emulate the chip you need to fully implement all the
translation windows.

We also want the BAR itself to be properly emulated, as otherwise
software can get confused when it reads it and sees zero as the location
of the PCI DMA memory hole.

-Scott

  parent reply	other threads:[~2012-06-08 18:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-08  9:03 [Qemu-devel] [RFC] Proposal: PCI/PCIe: inbound BAR0 emulation for PCI controller (Root Complex) Bhushan Bharat-R65777
2012-06-08 11:01 ` Benjamin Herrenschmidt
2012-06-08 11:35   ` Bhushan Bharat-R65777
2012-06-08 19:08   ` Scott Wood
2012-06-08 22:51     ` Benjamin Herrenschmidt
2012-06-11 12:41   ` Bhushan Bharat-R65777
2012-06-08 18:56 ` Scott Wood [this message]
2012-06-11  5:05   ` Bhushan Bharat-R65777
2012-06-11 19:15     ` Scott Wood

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=4FD24AE3.60604@freescale.com \
    --to=scottwood@freescale.com \
    --cc=B07421@freescale.com \
    --cc=B08248@freescale.com \
    --cc=R65777@freescale.com \
    --cc=qemu-devel@nongnu.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).