From: Jason Andryuk <jandryuk@gmail.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
Ian Jackson <ian.jackson@eu.citrix.com>, Wei Liu <wl@xen.org>,
Jan Beulich <jbeulich@suse.com>,
Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [Xen-devel] [PATCH v2] x86/hvmloader: round up memory BAR size to 4K
Date: Fri, 17 Jan 2020 11:05:48 -0500 [thread overview]
Message-ID: <CAKf6xpsGhh8hKeaSO_=sRknc=AHnS6bK9dHje3iwter3UsHowA@mail.gmail.com> (raw)
In-Reply-To: <20200117110811.43321-1-roger.pau@citrix.com>
On Fri, Jan 17, 2020 at 6:08 AM Roger Pau Monne <roger.pau@citrix.com> wrote:
>
> When placing memory BARs with sizes smaller than 4K multiple memory
> BARs can end up mapped to the same guest physical address, and thus
> won't work correctly.
>
> Round up all memory BAR sizes to be at least 4K, so that they are
> naturally aligned to a page size and thus don't end up sharing a page.
> Also add a couple of asserts to the current code to make sure the MMIO
> hole is properly sized and aligned.
>
> Note that the guest can still move the BARs around and create this
> collisions, and that BARs not filling up a physical page might leak
> access to other MMIO regions placed in the same host physical page.
>
> This is however no worse than what's currently done, and hence should
> be considered an improvement over the current state.
>
> Reported-by: Jason Andryuk <jandryuk@gmail.com>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
> Cc: Jason Andryuk <jandryuk@gmail.com>
> ---
> Changes since v1:
> - Do the round up when sizing the BARs, so that the MMIO hole is
> correctly sized.
> - Add some asserts that the hole is properly sized and size-aligned.
> - Dropped Jason Tested-by since the code has changed.
> ---
> Jason, can you give this a spin? Thanks.
Tested-by: Jason Andryuk <jandryuk@gmail.com>
Thanks!
-Jason
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2020-01-17 16:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-17 11:08 [Xen-devel] [PATCH v2] x86/hvmloader: round up memory BAR size to 4K Roger Pau Monne
2020-01-17 16:05 ` Jason Andryuk [this message]
2020-01-20 16:10 ` Jan Beulich
2020-01-20 17:18 ` Roger Pau Monné
2020-01-20 20:48 ` Jason Andryuk
2020-01-21 9:18 ` Jan Beulich
2020-01-21 10:29 ` Roger Pau Monné
2020-01-21 10:43 ` Jan Beulich
2020-01-21 15:57 ` Roger Pau Monné
2020-01-21 16:15 ` Jan Beulich
2020-01-21 16:57 ` Roger Pau Monné
2020-01-22 10:27 ` Jan Beulich
2020-01-22 10:51 ` Roger Pau Monné
2020-01-22 14:04 ` Jason Andryuk
2020-01-22 14:15 ` Jan Beulich
2020-01-22 14:12 ` 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='CAKf6xpsGhh8hKeaSO_=sRknc=AHnS6bK9dHje3iwter3UsHowA@mail.gmail.com' \
--to=jandryuk@gmail.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=roger.pau@citrix.com \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.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).