xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@eu.citrix.com>
To: George Dunlap <george.dunlap@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@citrix.com>,
	Hanweidong <hanweidong@huawei.com>,
	Stefano Stabellini <stefano.stabellini@citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	xen-devel@lists.xen.org
Subject: Re: [PATCH v2 1/5] hvmloader: Correct bug in low mmio region accounting
Date: Tue, 18 Jun 2013 17:53:44 +0100	[thread overview]
Message-ID: <51C09098.1020901@eu.citrix.com> (raw)
In-Reply-To: <1371573984-28514-1-git-send-email-george.dunlap@eu.citrix.com>

On 06/18/2013 05:46 PM, George Dunlap wrote:
> When deciding whether to map a device in low MMIO space (<4GiB),
> hvmloader compares it with "mmio_left", which is set to the size of
> the low MMIO range (pci_mem_end - pci_mem_start).  However, even if it
> does map a device in high MMIO space, it still removes the size of its
> BAR from mmio_left.
>
> This patch first changes the name of this variable to "low_mmio_left"
> to distinguish it from generic MMIO, and corrects the logic to only
> subtract the size of the BAR for devices maped in the low MMIO region.
>
> Also make low_mmio_left unsigned, and don't allow it to go negative.
> Since its main use is to be compared to a 64-bit unsigned int, this
> may have undefined (and in practice almost certainly incorrect)
> results.  Not subtracting is OK because if there's not enough room, it
> won't actually be mapped.
>
> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

This patch series is a lot longer and more intrusive than I was hoping 
it would be. :-(

However, it still seems to me that this will be a smaller impact on 
people than the alternatives.

If the code is done properly, then none of these changes should have any 
effect on people who are not passing through devices with large BARs: 
the vast majority of our users, who are simply booting plain VMs in HVM 
mode, should see zero effect.

Similarly, the vast majority of qemu-traditional users should also see 
no effect; the 64-bit code should only be invoked when the MMIO hole 
cannot be resized large enough, and by default, qemu-traditional will be 
able to resize the hole up to 2GiB -- far larger than almost any guest 
should need.

qemu-xen users will be affected, but they would have been affected 
anyway.  This changes a certain "will 100% crash at some point" to "will 
probably work most of the time, with a small unforeseen chance of 
something crashing randomly".  I think that's still a step forward.

  -George

  parent reply	other threads:[~2013-06-18 16:53 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-18 16:46 [PATCH v2 1/5] hvmloader: Correct bug in low mmio region accounting George Dunlap
2013-06-18 16:46 ` [PATCH v2 2/5] hvmloader: Load large devices into high MMIO space as needed George Dunlap
2013-06-19 17:18   ` Stefano Stabellini
2013-06-20  9:23     ` George Dunlap
2013-06-20  9:47   ` Jan Beulich
2013-06-18 16:46 ` [PATCH v2 3/5] hvmloader: Remove minimum size for BARs to relocate to 64-bit space George Dunlap
2013-06-19 17:18   ` Stefano Stabellini
2013-06-19 21:14   ` Wei Liu
2013-06-20  9:01     ` George Dunlap
2013-06-20  9:48   ` Jan Beulich
2013-06-18 16:46 ` [PATCH v2 4/5] hvmloader: Fix check for needing a 64-bit bar George Dunlap
2013-06-19 17:18   ` Stefano Stabellini
2013-06-20 10:01   ` Jan Beulich
2013-06-20 10:21     ` George Dunlap
2013-06-18 16:46 ` [PATCH v2 5/5] libxl, hvmloader: Don't relocate memory for MMIO hole George Dunlap
2013-06-18 17:16   ` George Dunlap
2013-06-19 17:18   ` Stefano Stabellini
2013-06-20  9:22     ` George Dunlap
2013-06-20 10:12       ` Jan Beulich
2013-06-20 10:20         ` George Dunlap
2013-06-20 10:29           ` Stefano Stabellini
2013-06-20 10:56             ` Jan Beulich
2013-06-20 10:59               ` George Dunlap
2013-06-20 11:01             ` George Dunlap
2013-06-20 13:35               ` Ian Jackson
2013-06-20 14:06                 ` George Dunlap
2013-06-20 10:37           ` Ian Jackson
2013-06-20 10:44             ` George Dunlap
2013-06-20 10:52           ` Jan Beulich
2013-06-20 10:49       ` Stefano Stabellini
2013-06-25  9:56       ` Ian Campbell
2013-06-25 10:15         ` George Dunlap
2013-06-18 16:53 ` George Dunlap [this message]
2013-06-19 17:18 ` [PATCH v2 1/5] hvmloader: Correct bug in low mmio region accounting Stefano Stabellini
2013-06-20  8:56   ` George Dunlap
2013-06-20 10:40     ` Stefano Stabellini
2013-06-20 10:43       ` George Dunlap
2013-06-20  9:36 ` Jan Beulich

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=51C09098.1020901@eu.citrix.com \
    --to=george.dunlap@eu.citrix.com \
    --cc=hanweidong@huawei.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@citrix.com \
    --cc=stefano.stabellini@citrix.com \
    --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 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).