xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Tomasz Wroblewski <tomasz.wroblewski@gmail.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel@lists.xenproject.org
Subject: Re: GPU passthrough performance regression in >4GB vms due to XSA-60 changes
Date: Mon, 19 May 2014 14:17:30 +0200	[thread overview]
Message-ID: <5379F65A.7020609@gmail.com> (raw)
In-Reply-To: <537A0FF10200007800013973@mail.emea.novell.com>


On 05/19/2014 02:06 PM, Jan Beulich wrote:
>>>> On 19.05.14 at 13:32, <tomasz.wroblewski@gmail.com> wrote:
>> On 05/19/2014 01:07 PM, Jan Beulich wrote:
>>>>>> On 19.05.14 at 12:47, <tomasz.wroblewski@gmail.com> wrote:
>>>> On 05/19/2014 12:38 PM, Jan Beulich wrote:
>>>>> So perhaps time for sending complete logs, plus suitable information
>>>>> from inside the guest of how things (RAM, MMIO, MTRRs) end up being
>>>>> set up?
>>>> Could be, though please read the explanation I came up in the other post
>>>> whether its enough, I think it makes sense... 64bit guest BARs are
>>>> indeed not in use (confirmed from guest). MTRR is setup such that only
>>>> the low region is UC, which is correct.
>>> Yes, that's a very sensible theory, which - as just said in the other
>>> reply - can be easily verified.
>>>
>>>> But the RAM relocation code causes the caching on relocated region to be
>>>> UC instead of WB due to the timing (very early, MTRR disabled) at which
>>>> it runs, which is incorrect. I am thinking enabling MTRR during that
>>>> relocation would probably fix it on 4.3
>>> Except that this is a chicken and egg problem then: In order to
>>> populate the variable range MTRRs, the BAR assignment (and hence
>>> the prerequisite RAM relocation) need to be done already.
>> I am not sure; looking at hvmloader code, wouldn't it be possible to
>> calculate the BAR locations first, then update the MTRR var ranges and
>> enable it, and only then actually write the BAR registers (from
>> precalculated info)? Presumably it's only the write part which needs to
>> be done after relocation as it causes qemu to setup mmio etc.
> Leaving aside that this would require splitting pci_setup(), and
> hence communicating state from its main part (RAM relocation and
> resource allocation) to the final one (BAR writing), which by itself is
> already not as simple a change as one would like for something that
> is intended to go _only_ into the stable trees, you also already
> imply with the above that we'd add a pre-enabling step for the
> MTRRs. I.e. we'd end up with
>
> - enable fixed-range MTRRs and set default to WB (no var ranges)
> - pci_setup_early()
> - set variable range MTRRs
> - pci_setup_late()
> - set MTRRs in one go on APs
>
> Yes, that ought to work. But do we want this much diverging from
> -unstable on 4.3 and 4.4? Are we certain that namely the two-stage
> MTRR setup won't have any unintended side effects?
>
>> Yeah I gave about a day of effort to port us onto unstable and test
>> there but it sadly looks to be a bigger job, so leaving that as a last
>> resort (though planning to spend couple more days on it soon).
> Then as an alternative did you try pulling over the EPT changes
> from -unstable?
That would be indeed preferable, I've looked over them but couldn't 
figure out which particular change would fix the EPT update after MTRR 
enable. Do you remember which that was? I could test it and try to 
narrow any other commits it'd require (seems there were a lot of ept 
related changes)


> Jan
>

  reply	other threads:[~2014-05-19 12:17 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-15  9:11 GPU passthrough performance regression in >4GB vms due to XSA-60 changes Tomasz Wroblewski
2014-05-15 12:32 ` Jan Beulich
2014-05-15 12:10   ` Tomasz Wroblewski
2014-05-15 13:23     ` Jan Beulich
2014-05-15 13:39       ` Tomasz Wroblewski
2014-05-15 14:34         ` Tomasz Wroblewski
2014-05-15 14:56           ` Tomasz Wroblewski
2014-05-15 16:07             ` Jan Beulich
2014-05-15 15:39               ` Tomasz Wroblewski
2014-05-16  6:33                 ` Jan Beulich
2014-05-16 11:18                   ` Tomasz Wroblewski
2014-05-16 11:38                     ` Jan Beulich
2014-05-16 14:36                       ` Jan Beulich
2014-05-19 10:29                         ` Tomasz Wroblewski
2014-05-19 10:38                           ` Jan Beulich
2014-05-19 10:47                             ` Tomasz Wroblewski
2014-05-19 11:07                               ` Jan Beulich
2014-05-19 11:32                                 ` Tomasz Wroblewski
2014-05-19 12:06                                   ` Jan Beulich
2014-05-19 12:17                                     ` Tomasz Wroblewski [this message]
2014-05-19 12:44                                       ` Jan Beulich
2014-05-19 14:20                                         ` Tomasz Wroblewski
2014-05-19 15:24                                           ` Jan Beulich
2014-05-19 15:48                                             ` Tomasz Wroblewski
2014-05-19 17:36                                             ` Tim Deegan
2014-05-20  6:31                                               ` Jan Beulich
2014-05-19 10:42                           ` Tomasz Wroblewski
2014-05-19 11:01                             ` Jan Beulich
2014-05-19 11:09                               ` Tomasz Wroblewski
2014-05-19 11:19                                 ` Jan Beulich
2014-05-15 16:01         ` 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=5379F65A.7020609@gmail.com \
    --to=tomasz.wroblewski@gmail.com \
    --cc=JBeulich@suse.com \
    --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).