From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Anthony PERARD <anthony.perard@citrix.com>
Cc: xen-devel@lists.xen.org
Subject: Re: OVMF very slow on AMD
Date: Fri, 15 Jul 2016 11:22:45 -0400 [thread overview]
Message-ID: <cf715642-0ad5-fe4d-1e9d-6b4f99cdb37d@oracle.com> (raw)
In-Reply-To: <20160715134831.GB16867@char.us.oracle.com>
On 07/15/2016 09:48 AM, Konrad Rzeszutek Wilk wrote:
> On Thu, Jul 14, 2016 at 04:53:07PM +0100, Anthony PERARD wrote:
>> Hi,
>>
>> I've been investigating why OVMF is very slow in a Xen guest on an AMD
>> host. This, I think, is the current failure that osstest is having.
>>
>> I've only look at a specific part of OVMF where the slowdown is very
>> obvious on AMD vs Intel, the decompression.
>>
>> This is what I get on AMD, via the Xen serial console port:
>> Invoking OVMF ...
>> SecCoreStartupWithStack(0xFFFCC000, 0x818000)
>> then, nothing for almost 1 minute, then the rest of the boot process.
>> The same binary on Intel, the output does not stay "stuck" here.
>>
>> I could pin-point which part of the boot process takes a long time, but
>> there is not anything obvious in there, just a loop that decompress the
>> ovmf binary, with plenty of iteration.
>> I tried `xentrace', but the trace does not show anything wrong, there is
>> just an interrupt from time to time. I've tried to had some tracepoint
>> inside this decompresion function in OVMF, but that did not reveal
>> anything either, maybe there where not at the right place.
>>
>> Anyway, the function is: LzmaDec_DecodeReal() from the file
>> IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/Sdk/C/LzmaDec.c
>> you can get the assembly from this object:
>> Build/OvmfX64/DEBUG_GCC49/X64/IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib/OUTPUT/Sdk/C/LzmaDec.obj
>> This is with OVMF upstream (https://github.com/tianocore/edk2).
>> I can send the assembly if needed.
> Pls. The full file if possible. Perhaps there is also an .S file somewhere there?
>
>> So, this loop takes about 1 minute on my AMD machine (AMD Opteron(tm)
>> Processor 4284), and less that 1 second on an Intel machine.
>> If I compile OVMF as a 32bit binary, the loop is faster, but still takes
>> about 30s on AMD. (that's true for both OvmfIa32 and OvmfIa32X64 which
>> is 32bit bootstrap, but can start 64bit OS.)
>> Another thing, I tried the same binary (64bit) with KVM, and OVMF seems
>> fast.
>>
>>
>> So, any idee of what I could investigate?
> I presume we emulating some operation on AMD but not on Intel.
>
> However you say xentrace shows nothing - which would imply we are not
> incurring VMEXITs to deal with this. Hmm.. Could it be what we
> expose to the guest (the CPUID flags?) Somehow we are missing one on AMD
> and it takes a slower route?
I don't know whether it's possible but can you extract this loop somehow
and run it on baremetal? Or run the whole thing on baremetal.
Also a newer compiler might potentially make a difference (if you are
running on something older).
-boris
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-07-15 15:22 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-14 15:53 OVMF very slow on AMD Anthony PERARD
2016-07-15 13:48 ` Konrad Rzeszutek Wilk
2016-07-15 15:22 ` Boris Ostrovsky [this message]
2016-07-27 11:08 ` Anthony PERARD
2016-07-27 11:35 ` Anthony PERARD
2016-07-27 19:45 ` Boris Ostrovsky
2016-07-28 10:18 ` Anthony PERARD
2016-07-28 10:43 ` George Dunlap
2016-07-28 10:54 ` Andrew Cooper
2016-07-28 11:28 ` Anthony PERARD
2016-07-28 15:17 ` Boris Ostrovsky
2016-07-28 15:51 ` Andrew Cooper
2016-07-28 19:25 ` Boris Ostrovsky
2016-07-28 19:44 ` Andrew Cooper
2016-07-28 19:54 ` Boris Ostrovsky
2016-07-29 15:54 ` Anthony PERARD
2016-07-18 14:10 ` Anthony PERARD
2016-07-18 15:09 ` Anthony PERARD
2016-07-22 10:40 ` Dario Faggioli
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=cf715642-0ad5-fe4d-1e9d-6b4f99cdb37d@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=anthony.perard@citrix.com \
--cc=konrad.wilk@oracle.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).