From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Olaf Hering <olaf@aepfle.de>, <xen-devel@lists.xenproject.org>
Subject: Re: XEN_SYSCTL_cpu_policy_hvm_default truncates leaf count
Date: Thu, 1 Jul 2021 12:19:24 +0100 [thread overview]
Message-ID: <20e828c9-e7dc-4401-9307-a6d72eb618d8@citrix.com> (raw)
In-Reply-To: <20210701125623.593fe3ae.olaf@aepfle.de>
On 01/07/2021 11:56, Olaf Hering wrote:
> For some reason migration of HVM domUs from pre-4.14 to staging is broken.
>
> It seems xc_cpuid_apply_policy gets nr_leaves=119 from XEN_SYSCTL_get_cpu_policy.
> Later XEN_SYSCTL_cpu_policy_hvm_default truncates this value to 31.
119 is the maximum number of leaves to cover sizeof(struct cpuid_policy).
But no CPU hits both Intel and AMD max leaf, so we can unambiguously
represent the policy with fewer than 119 leaves. 31 is the count of
leaves with data in, on this particular system.
> As a result x86_cpuid_copy_to_buffer returns -ENOBUFS. It would copy up to 51 leaves in my testing.
>
> I suspect commit 34990446ca91d9e201ff17bd4e3f43bfe3ad308e just revealed a logic error somewhere.
>
> What is supposed to happen in libxl__srm_callout_callback_static_data_done when XGR_SDD_MISSING_CPUID is set?
One of the many totally broken things about Xen migration was that the
guests CPUID data never used to be part of the stream. It was always
reinvented from scratch on the destination host.
This had fun properties such as the CPU's family/model/stepping changing
underfoot (I'm still amazed that VMs didn't complain more about this -
windows would happily install a new HAL driver and call itself done),
and less fun properties where some features just disappeared totally due
to changes in xc_cpuid_apply_policy() logic.
Starting in 4.14, after I'd added a "please get the guest's view of
CPUID" hypercall, the CPUID settings the VM saw move in the migrate
stream with it.
XGR_SDD_MISSING_CPUID is the signal of "this is a pre-4.14 VM with no
CPUID data", which means "you need to reinvent CPUID as the toolstack in
4.13 would have done".
This *ought* to be "grab default, edit a few details, send back to
Xen". Where is the 51 leaves coming in? Do you have cpuid= lines in
the xl cfg file?
~Andrew
next prev parent reply other threads:[~2021-07-01 11:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-01 10:56 XEN_SYSCTL_cpu_policy_hvm_default truncates leaf count Olaf Hering
2021-07-01 11:19 ` Andrew Cooper [this message]
2021-07-01 11:36 ` Olaf Hering
2021-07-01 12:35 ` Andrew Cooper
2021-07-01 13:15 ` Olaf Hering
2021-07-01 15:00 ` Olaf Hering
2021-07-01 15:13 ` Andrew Cooper
2021-07-01 15:18 ` Olaf Hering
2021-07-01 15:25 ` Andrew Cooper
2021-07-01 16:23 ` Olaf Hering
2021-07-01 16:28 ` Andrew Cooper
2021-07-01 16:32 ` Olaf Hering
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=20e828c9-e7dc-4401-9307-a6d72eb618d8@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=olaf@aepfle.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.