All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: keir@xen.org,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	George Dunlap <george.dunlap@eu.citrix.com>,
	tim@xen.org, xen-devel@lists.xen.org,
	Jan Beulich <JBeulich@suse.com>, Wei Liu <wei.liu2@citrix.com>
Subject: Re: Limitation in HVM physmap
Date: Fri, 1 Nov 2013 14:08:09 +0000	[thread overview]
Message-ID: <20131101140809.GF4966@zion.uk.xensource.com> (raw)
In-Reply-To: <1383310152.672.60.camel@kazak.uk.xensource.com>

On Fri, Nov 01, 2013 at 12:49:12PM +0000, Ian Campbell wrote:
> On Fri, 2013-11-01 at 12:45 +0000, Wei Liu wrote:
> > On Fri, Nov 01, 2013 at 12:33:28PM +0000, Ian Campbell wrote:
> > [...]
> > > > 
> > > > So I think the behavior of OVMF is consistent with real hardware.
> > > 
> > > I'm not sure you can draw too many conclusions wrt the behaviour on the
> > > emulated cirrus though.
> > > 
> > > This devices seems to have three memory bars? Whereas the Cirrus card
> > > has only 2.
> > > 
> > > The original problem was that the Cirrus card was being accessed at two
> > > distinct locations, where is that happening here? I can only see
> > > 0xd5800000 being used.
> > > 
> > 
> > Good catch. I only noticed that efifb is probably using the mapped
> > location.
> > 
> > > The cirrus card also differs in that the address reported by efifb
> > > (0x80000000) does not match either of the BARS configured on the Cirrus
> > > card (0xf000000 and 0xf3xxxx). Whereas here efifb is using the first
> > > memory BAR of the matrox card, which is logical.
> > > 
> > > So where does the discrepancy between the efifb view and the Cirrus
> > > device's view come from? Does OVMF contain a cirrus driver or is it
> > 
> > Yes, it has a cirrus driver.
> > 
> > > using a generic (e.g. stdvga driver)? Where does it get this address
> > > 0x80000000 from and why does it think it maps to the Cirrus device?
> > > 
> > 
> > Snippet from the full log:
> [...]
> > (d1) PciBus: Discovered PCI @ [00|02|00]
> > (d1)    BAR[0]: Type = PMem32; Alignment = 0x1FFFFFF;   Length = 0x2000000;     Offset = 0
> > (d1) x10
> > (d1)    BAR[1]: Type =  Mem32; Alignment = 0xFFF;       Length = 0x1000;        Offset = 0x14
> 
> This is the cirrus device, I think?
> 
> I don't see any mention of either 0xf0000000 or 0x80000000 here.
> 

Yes. You can tell from the BDF.

It didn't print out base address by default. I added my own debug patch
and confirmed that base address was set correctly by hvmloader.

(d9) PciBus: Discovered PCI @ [00|02|00]
(d9)    BAR[0]: Type = PMem32; Alignment = 0x1FFFFFF;   Length = 0x2000000;     Offset = 0x10        BaseAddress = 0xF0000000
(d9)    BAR[1]: Type =  Mem32; Alignment = 0xFFF;       Length = 0x1000; Offset = 0x14   BaseAddress = 0xF3020000

Sorry about the confusion.

> > (d1) PciBus: HostBridge->SubmitResources() - Success
> > (d1) PciBus: HostBridge->NotifyPhase(AllocateResources) - Success
> > [  403.936062] xenbr0: port 3(vif1.0-emu) entered forwarding state
> > (d1) PciBus: Resource Map for Root Bridge PciRoot(0x0)
> > (d1) Type =   Io16; Base = 0xC000;      Length = 0x1000;        Alignment = 0xFFF
> > (d1)  Base = 0xC000;    Length = 0x100; Alignment = 0xFF;       Owner = PCI  [00|04|00:10]
> > (d1)  Base = 0xC100;    Length = 0x100; Alignment = 0xFF;       Owner = PCI  [00|03|00:10]
> > (d1)  Base = 0xC200;    Length = 0x10;  Alignment = 0xF;        Owner = PCI  [00|01|01:20]
> > (d1) Type =  Mem32; Base = 0x80000000;  Length = 0x3100000;     Alignment = 0x1FFFFFF
> > (d1)  Base = 0x80000000;        Length = 0x2000000;     Alignment = 0x1FFFFFF;  Owner = PCI  [00
> > (d1) |02|00:10]
> > (d1)  Base = 0x82000000;        Length = 0x1000000;     Alignment = 0xFFFFFF;   Owner = PCI  [00|
> > (d1) 03|00:14]
> > (d1)  Base = 0x83000000;        Length = 0x100; Alignment = 0xFFF;      Owner = PCI  [00|04|00:1
> > (d1) 4]
> > (d1)  Base = 0x83001000;        Length = 0x1000;        Alignment = 0xFFF;      Owner = PCI  [00|02|00:
> > (d1) 14]
> > 
> > 
> > Looks like OVMF does something tricky and doesn't propogate the change to Xen?
> 
> I'm not sure what you were trying to illustrate with that log, what
> tricky thing are you thinking of?
> 
> Is OVMF trying to do MMIO reassignment? I think we do this in hvmloader
> so you could try turning that behaviour off, if possible.
> 

I will see what I can do. My impression was that reassignment process is
mandatory in UEFI but I could be wrong. Real hardware doesn't behave
like that anyway.

> "propogate changes to Xen" would mean writing various BAR registers,
> which are emulated (by qemu I suppose), I wouldn't expect OVMF to be
> propagating things to Xen directly. We could be getting the emulation of
> those updates wrong I guess, but surely we'd have noticed it elsewhere
> before now?
> 

Yes, it's indeed caught by QEMU. And I think QEMU gets the right value.
I'm just not very sure about certain QEMU-specific behavior. I will
investigate that.

Wei.

> Ian.

  reply	other threads:[~2013-11-01 14:08 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-18 14:20 Limitation in HVM physmap Wei Liu
2013-10-18 14:26 ` George Dunlap
2013-10-18 15:12   ` Paul Durrant
2013-10-18 14:28 ` Tim Deegan
2013-10-18 14:36   ` Wei Liu
2013-10-18 14:41     ` Tim Deegan
2013-10-18 14:56       ` Wei Liu
2013-10-18 14:59         ` Ian Campbell
2013-10-18 15:00           ` Ian Campbell
2013-10-18 15:04           ` Wei Liu
2013-10-18 15:06             ` George Dunlap
2013-10-18 15:07             ` Wei Liu
2013-10-18 15:09               ` Ian Campbell
2013-10-18 15:14           ` Stefano Stabellini
2013-10-18 14:47     ` Jan Beulich
2013-10-18 15:01       ` Wei Liu
2013-10-18 15:07         ` Ian Campbell
2013-10-18 15:30           ` Wei Liu
2013-10-18 15:09         ` Jan Beulich
2013-11-01 12:21 ` Wei Liu
2013-11-01 12:26   ` George Dunlap
2013-11-01 12:33   ` Ian Campbell
2013-11-01 12:45     ` Wei Liu
2013-11-01 12:49       ` Ian Campbell
2013-11-01 14:08         ` Wei Liu [this message]
2013-11-01 14:12           ` Ian Campbell
2013-11-01 14:19             ` Wei Liu
2013-11-01 14:31               ` Ian Campbell
2013-11-01 14:55                 ` Wei Liu
2013-11-01 15:04                   ` Ian Campbell
2013-11-04  9:28                     ` Fabio Fantoni
2013-11-04 11:42                       ` Wei Liu
2013-11-04 12:05                         ` Fabio Fantoni
2013-11-04 12:17                           ` Wei Liu
2013-11-04 14:08                             ` Fabio Fantoni
2013-11-04 14:14                               ` Wei Liu

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=20131101140809.GF4966@zion.uk.xensource.com \
    --to=wei.liu2@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.