From: Jan Beulich <jbeulich@suse.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org,
Jason Andryuk <jandryuk@gmail.com>,
Ian Jackson <ian.jackson@eu.citrix.com>, Wei Liu <wl@xen.org>,
Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [Xen-devel] [PATCH v2] x86/hvmloader: round up memory BAR size to 4K
Date: Tue, 21 Jan 2020 17:15:20 +0100 [thread overview]
Message-ID: <ddac90c5-2fe5-ba92-d7ab-f258f483521d@suse.com> (raw)
In-Reply-To: <20200121155708.GI11756@Air-de-Roger>
On 21.01.2020 16:57, Roger Pau Monné wrote:
> On Tue, Jan 21, 2020 at 11:43:58AM +0100, Jan Beulich wrote:
>> On 21.01.2020 11:29, Roger Pau Monné wrote:
>>> So I'm not sure how to progress with this patch, are we fine with
>>> those limitations?
>>
>> I'm afraid this depends on ...
>>
>>> As I said, Xen hasn't got enough knowledge to correctly isolate the
>>> BARs, and hence we have to rely on dom0 DTRT. We could add checks in
>>> Xen to make sure no BARs share a page, but it's a non-trivial amount
>>> of scanning and sizing each possible BAR on the system.
>>
>> ... whether Dom0 actually "DTRT", which in turn is complicated by there
>> not being a specific Dom0 kernel incarnation to check against. Perhaps
>> rather than having Xen check _all_ BARs, Xen or the tool stack could
>> check BARs of devices about to be handed to a guest? Perhaps we need to
>> pass auxiliary information to hvmloader to be able to judge whether a
>> BAR shares a page with another one? Perhaps there also needs to be a
>> way for hvmloader to know what offset into a page has to be maintained
>> for any particular BAR, as follows from Jason's recent reply?
>
> Linux has an option to force resource alignment (as reported by
> Jason), maybe we could force all BARs to be aligned to page size in
> order to be passed through?
>
> That would make it easier to check (as Xen/Qemu would only need to
> assert that the BAR address is aligned), and won't require much extra
> work in Xen apart from the check itself.
>
> Do you think this would be an acceptable solution?
In principle yes, but there are loose ends:
- What do you mean by "we could force"? We have no control over the
Dom0 kernel.
- What about non-Linux Dom0?
Also, apart from extra resource (address space) consumption, what's
the point of forcing a single device's BARs to separate pages? (I'm
assuming here that hvmloader would have a way to know of the
potentially resulting non-zero offsets into a page. And I'm still
puzzled that the lack thereof hasn't been reported as a bug by
anyone, afaik.)
Jan
_______________________________________________
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-21 16:15 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
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 [this message]
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=ddac90c5-2fe5-ba92-d7ab-f258f483521d@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jandryuk@gmail.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).