All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Tim Deegan <tim@xen.org>
Cc: keir@xen.org, Ian Campbell <ian.campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	George Dunlap <george.dunlap@eu.citrix.com>,
	xen-devel@lists.xen.org, Jan Beulich <JBeulich@suse.com>,
	Wei Liu <wei.liu2@citrix.com>
Subject: Re: Limitation in HVM physmap
Date: Fri, 18 Oct 2013 15:36:40 +0100	[thread overview]
Message-ID: <20131018143640.GC20185@zion.uk.xensource.com> (raw)
In-Reply-To: <20131018142824.GA33100@deinos.phlegethon.org>

On Fri, Oct 18, 2013 at 04:28:24PM +0200, Tim Deegan wrote:
> Hi,
> 
> At 15:20 +0100 on 18 Oct (1382106012), Wei Liu wrote:
> > I currently run into the limitation of HVM's physmap: one MFN can only
> > be mapped into one guest physical frame. Why is it designed like that?
> 
> 1. For simplicity.  That code is hard wnough to work with already. :)
> 
> 2. It helps avoid worrying about inconsistent cache settings if the
>    HAP tables only have one entry for each MFN. 
> 
> 3. Xen maintains a single mapping from MFN back to PFN, and any code
>    that uses it would have to be able to deal with getting multiple
>    answers.  That's already been partly changed by the mem_sharing
>    code (which obviously _can_ have multiple P2M entries pointing to
>    the same MFN but is a bit complex as a result).
> 

I see.

> > The scenario is that: when QEMU boots with OVMF (UEFI firmware), OVMF
> > will first map the framebuffer to 0x80000000, resulting the framebuffer
> > MFNs added to corresponding slots in physmap. A few moments later when
> > Linux kernel loads, it tries to map framebuffer MFNs to 0xf00000000,
> > which fails because those MFNs have already been mapped in other
> > locations. Is there a way to fix this?
> 
> Qemu could remember where it put the framebuffer last time and unmap
> it.  AIUI that's how real hardware would behave if you changed the
> framebuffer base address -- the framebuffer wouldn't still be mapped at
> the old location as well.
> 

In fact, this is not the case in OVMF. EFIFB driver in Linux will always
use the EFIFB region (0x80000000) provided by OVMF. 

Unmapping the first region (0x80000000) 1) makes the guest not able to
refresh its framebuffer, 2) causes lots of traps in QEMU (because guest
is still accessing first region) which makes QEMU busy-looping all the
time.

I do have a workaround in QEMU but it's very fragile and ugly...

Wei.

> Cheers,
> 
> Tim.

  reply	other threads:[~2013-10-18 14:36 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 [this message]
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
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=20131018143640.GC20185@zion.uk.xensource.com \
    --to=wei.liu2@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=ian.campbell@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.