From: "Andrew Fish" <afish@apple.com>
To: devel@edk2.groups.io, lersek@redhat.com
Cc: wuchenye1995 <wuchenye1995@gmail.com>,
zhoujianjay <zhoujianjay@gmail.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
berrange@redhat.com,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
qemu-devel@nongnu.org, discuss <discuss@edk2.groups.io>
Subject: Re: [edk2-devel] A problem with live migration of UEFI virtual machines
Date: Tue, 25 Feb 2020 10:56:30 -0800 [thread overview]
Message-ID: <3E8BB07B-8730-4AB8-BCB6-EA183FB589C5@apple.com> (raw)
In-Reply-To: <8b0ec286-9322-ee00-3729-6ec7ee8260a6@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 6405 bytes --]
Laszlo,
If I understand this correctly is it not more complicated than just size. It also assumes the memory layout is the same? The legacy BIOS used fixed magic address ranges, but UEFI uses dynamically allocated memory so addresses are not fixed. While the UEFI firmware does try to keep S3 and S4 layouts consistent between boots, I'm not aware of any mechanism to keep the memory map address the same between versions of the firmware?
Thanks,
Andrew Fish
> On Feb 25, 2020, at 9:53 AM, Laszlo Ersek <lersek@redhat.com> wrote:
>
> On 02/24/20 16:28, Daniel P. Berrangé wrote:
>> On Tue, Feb 11, 2020 at 05:39:59PM +0000, Alex Bennée wrote:
>>>
>>> wuchenye1995 <wuchenye1995@gmail.com> writes:
>>>
>>>> Hi all,
>>>> We found a problem with live migration of UEFI virtual machines
>>>> due to size of OVMF.fd changes.
>>>> Specifically, the size of OVMF.fd in edk with low version such as
>>>> edk-2.0-25 is 2MB while the size of it in higher version such as
>>>> edk-2.0-30 is 4MB.
>>>> When we migrate a UEFI virtual machine from the host with low
>>>> version of edk2 to the host with higher one, qemu component will
>>>> report an error in function qemu_ram_resize while
>>>> checking size of ovmf_pcbios: Length mismatch: pc.bios: 0x200000 in
>>>> != 0x400000: Invalid argument.
>>>> We want to know how to solve this problem after updating the
>>>> version of edk2.
>>>
>>> You can only migrate a machine that is identical - so instantiating a
>>> empty machine with a different EDK image is bound to cause a problem
>>> because the machines don't match.
>>
>> I don't believe we are that strict for firmware in general. The
>> firmware is loaded when QEMU starts, but that only matters for the
>> original source host QEMU. During migration, the memory content of the
>> original firmware will be copied during live migration, overwriting
>> whatever the target QEMU loaded off disk. This works....provided the
>> memory region is the same size on source & target host, which is where
>> the problem arises in this case.
>>
>> If there's a risk that newer firmware will be larger than old firmware
>> there's only really two options:
>>
>> - Keep all firmware images forever, each with a unique versioned
>> filename. This ensures target QEMU will always load the original
>> smaller firmware
>>
>> - Add padding to the firmware images. IOW, if the firmware is 2 MB,
>> add zero-padding to the end of the image to round it upto 4 MB
>> (whatever you anticipate the largest size wil be in future).
>>
>> Distros have often taken the latter approach for QEMU firmware in the
>> past. The main issue is that you have to plan ahead of time and get
>> this padding right from the very start. You can't add the padding
>> after the fact on an existing VM.
>
> Following up here *too*, just for completeness.
>
> The query in this thread has been posted three times now (and I have
> zero idea why). Each time it generated a different set of responses. For
> completes, I'm now going to link the other two threads here (because the
> present thread seems to have gotten the most feedback).
>
> To the OP:
>
> - please do *NOT* repost the same question once you get an answer. It
> only fragments the discussion and creates confusion. It also doesn't
> hurt if you *confirm* that you understood the answer.
>
> - Yet further, if your email address has @gmail.com for domain, but your
> msgids contain "tencent", that raises some eyebrows (mine for sure).
> You say "we" in the query, but never identify the organization behind
> the plural pronoun.
>
> (I've been fuming about the triple-posting of the question for a while
> now, but it's only now that, upon seeing how much work Dan has put into
> his answer, I've decided that dishing out a bit of netiquette would be
> in order.)
>
> * First posting:
> - msgid: <tencent_F1295F826E46EDFF3D77812B@qq.com <mailto:tencent_F1295F826E46EDFF3D77812B@qq.com>>
> - edk2-devel: https://edk2.groups.io/g/devel/message/54146 <https://edk2.groups.io/g/devel/message/54146>
> - qemu-devel: https://lists.gnu.org/archive/html/qemu-devel/2020-02/msg02419.html <https://lists.gnu.org/archive/html/qemu-devel/2020-02/msg02419.html>
>
> * my response:
> - msgid: <12553.1581366059422195003@groups.io <mailto:12553.1581366059422195003@groups.io>>
> - edk2-devel: https://edk2.groups.io/g/devel/message/54161 <https://edk2.groups.io/g/devel/message/54161>
> - qemu-devel: none, because (as an exception) I used the stupid
> groups.io <http://groups.io/> web interface to respond, and so my response
> never reached qemu-devel
>
> * Second posting (~4 hours after the first)
> - msgid: <tencent_3CD8845EC159F0161725898B@qq.com <mailto:tencent_3CD8845EC159F0161725898B@qq.com>>
> - edk2-devel: https://edk2.groups.io/g/devel/message/54147 <https://edk2.groups.io/g/devel/message/54147>
> - qemu-devel: https://lists.gnu.org/archive/html/qemu-devel/2020-02/msg02415.html <https://lists.gnu.org/archive/html/qemu-devel/2020-02/msg02415.html>
>
> * Dave's response:
> - msgid: <20200220154742.GC2882@work-vm>
> - edk2-devel: https://edk2.groups.io/g/devel/message/54681 <https://edk2.groups.io/g/devel/message/54681>
> - qemu-devel: https://lists.gnu.org/archive/html/qemu-devel/2020-02/msg05632.html <https://lists.gnu.org/archive/html/qemu-devel/2020-02/msg05632.html>
>
> * Third posting (next day, present thread) -- cross posted to yet
> another list (!), because apparently Dave's feedback and mine had not
> been enough:
> - msgid: <tencent_BC7FD00363690990994E90F8@qq.com <mailto:tencent_BC7FD00363690990994E90F8@qq.com>>
> - edk2-devel: https://edk2.groups.io/g/devel/message/54220 <https://edk2.groups.io/g/devel/message/54220>
> - edk2-discuss: https://edk2.groups.io/g/discuss/message/135 <https://edk2.groups.io/g/discuss/message/135>
> - qemu-devel: https://lists.gnu.org/archive/html/qemu-devel/2020-02/msg02735.html <https://lists.gnu.org/archive/html/qemu-devel/2020-02/msg02735.html>
>
> Back on topic: see my response again. The answer is, you can't solve the
> problem (specifically with OVMF), and QEMU in fact does you service by
> preventing the migration.
>
> Laszlo
>
>
>
[-- Attachment #2: Type: text/html, Size: 55185 bytes --]
next prev parent reply other threads:[~2020-02-25 18:56 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-11 17:06 A problem with live migration of UEFI virtual machines "wuchenye1995
2020-02-11 17:39 ` Alex Bennée
2020-02-24 15:28 ` Daniel P. Berrangé
2020-02-25 17:53 ` [edk2-devel] " Laszlo Ersek
2020-02-25 18:56 ` Andrew Fish [this message]
2020-02-25 20:40 ` Laszlo Ersek
2020-02-25 21:35 ` Andrew Fish
2020-02-26 9:42 ` Laszlo Ersek
2020-02-28 3:20 ` Zhoujian (jay)
2020-02-28 11:29 ` Laszlo Ersek
2020-02-28 4:04 ` Andrew Fish
2020-02-28 11:47 ` Laszlo Ersek
2020-02-28 11:50 ` Laszlo Ersek
2020-03-02 12:32 ` Dr. David Alan Gilbert
-- strict thread matches above, loose matches on Subject: below --
2020-02-10 4:39 wuchenye1995
2020-02-10 20:20 ` [edk2-devel] " Laszlo Ersek
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-list 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=3E8BB07B-8730-4AB8-BCB6-EA183FB589C5@apple.com \
--to=devel@edk2.groups.io \
/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