From: Paul Durrant <Paul.Durrant@citrix.com>
To: 'Jan Beulich' <JBeulich@suse.com>
Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 3/7] x86/viridian: don't put Xen version information in CPUID leaf 2
Date: Mon, 20 Mar 2017 13:08:06 +0000 [thread overview]
Message-ID: <55f96b4bc1ec4b0fb1b671a9b2852a92@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <58CFD3060200007800144FB6@prv-mh.provo.novell.com>
> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: 20 March 2017 12:03
> To: Paul Durrant <Paul.Durrant@citrix.com>
> Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>; xen-
> devel@lists.xenproject.org
> Subject: RE: [PATCH 3/7] x86/viridian: don't put Xen version information in
> CPUID leaf 2
>
> >>> On 20.03.17 at 12:57, <Paul.Durrant@citrix.com> wrote:
> >> From: Jan Beulich [mailto:JBeulich@suse.com]
> >> Sent: 20 March 2017 11:42
> >> >>> On 17.03.17 at 10:57, <paul.durrant@citrix.com> wrote:
> >> > So, clearly putting Xen hypervisor version information in that leaf is
> >> > spurious, but we probably get away with it because Xen's major version
> >> > is lower than the major version of Windows in which Hyper-V first
> >> > appeared (Server 2008).
> >> >
> >> > This patch changes the leaf to hard-code the kernel major and minor
> >> > versions from Windows Server 2008.
> >>
> >> It's not really clear to me what the version numbers are supposed
> >> to be used for: Is there any functionality availability of which can
> >> be determined solely by looking at version?
> >
> > There's not *supposed* to be, but I'm going entirely off the algorithm
> > quoted above, which implies choosing the oldest possible
> > hypervisor-main-version gives that best chance of compatibility.
> > Interestingly KVM chooses a version of 6.1 and build number of 0x1bbc.
>
> Might that be because Windows itself considers the older version
> buggy in some respect?
No clue. Maybe it's safer to match KVM.
>
> >> If so, wouldn't
> >> hard coding a specific Windows Server version limit ourselves? If
> >> not, does it really matter what we put there?
> >>
> >
> > Well I want to avoid a scenario where Xen's version gets bumped and
> suddenly
> > some viridian enlightenment stops working. As you say, everything is
> supposed
> > to be based on feature flags anyway, so hardcoding a version seems safest.
>
> Sure, using Xen's version here was plain wrong. What I'm rather
> wondering is whether the returned number needs to be a little
> more dynamic (e.g. depending on other, newer features we
> support, partly - iirc - optionally).
>
The algorithm would suggest that bumping up the hypervisor version would only be done with make it *incompatible* with older versions of Windows. E.g. if the ABI were being deliberately broken. I guess there is a chance we'd need to do that but I'd hope not.
> >> > --- a/xen/arch/x86/hvm/viridian.c
> >> > +++ b/xen/arch/x86/hvm/viridian.c
> >> > @@ -134,8 +134,8 @@ void cpuid_viridian_leaves(const struct vcpu *v,
> >> uint32_t leaf,
> >> > own version number. */
> >> > if ( d->arch.hvm_domain.viridian.guest_os_id.raw == 0 )
> >> > break;
> >> > - res->a = 1; /* Build number */
> >> > - res->b = (xen_major_version() << 16) | xen_minor_version();
> >> > + res->a = 0; /* Build number */
> >>
> >> Is a build number of 0 valid at all?
> >
> > The algorithm appears to ignore it and I've not observed any problems with
> > Server 2008, Server 200R2, Windows 10 Anniversary, Server 2016 or
> Redstone2,
> > so I think it's safe. I don't mind picking the real one from a fully updated
> > Server 2008 if you'd prefer.
>
> Or the one KVM is using, provided they have somewhere spelled
> out why it was this one they've picked?
>
I'll see if I mine out the commit that the chose the number and look for some justification. If not then maybe going with default values from Server 2008 with command line overrides 'just in case' would be best?
Paul
> Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-03-20 13:09 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-17 9:57 [PATCH 0/7] x86/viridian updates Paul Durrant
2017-03-17 9:57 ` [PATCH 1/7] x86/viridian: update to version 5.0a of the specification Paul Durrant
2017-03-20 11:27 ` Jan Beulich
2017-03-20 11:43 ` Paul Durrant
2017-03-20 11:54 ` Jan Beulich
2017-03-17 9:57 ` [PATCH 2/7] x86/viridian: fix xen-hvmcrash when vp_assist page is present Paul Durrant
2017-03-20 11:36 ` Jan Beulich
2017-03-20 11:50 ` Paul Durrant
2017-03-20 13:42 ` Paul Durrant
2017-03-20 13:58 ` Jan Beulich
2017-03-17 9:57 ` [PATCH 3/7] x86/viridian: don't put Xen version information in CPUID leaf 2 Paul Durrant
2017-03-20 11:41 ` Jan Beulich
2017-03-20 11:57 ` Paul Durrant
2017-03-20 12:03 ` Jan Beulich
2017-03-20 13:08 ` Paul Durrant [this message]
2017-03-20 13:20 ` Jan Beulich
2017-03-17 9:57 ` [PATCH 4/7] x86/viridian: get rid of the magic numbers in CPUID leaves 1 and 2 Paul Durrant
2017-03-20 12:15 ` Jan Beulich
2017-03-20 12:56 ` Paul Durrant
2017-03-17 9:57 ` [PATCH 5/7] x86/viridian: add warnings for unimplemented hypercalls and MSRs Paul Durrant
2017-03-20 12:21 ` Jan Beulich
2017-03-20 12:54 ` Paul Durrant
2017-03-17 9:57 ` [PATCH 6/7] x86/viridian: make the threshold for HvNotifyLongSpinWait tunable Paul Durrant
2017-03-20 12:26 ` Jan Beulich
2017-03-20 12:51 ` Paul Durrant
2017-03-20 13:22 ` Jan Beulich
2017-03-20 17:03 ` Andrew Cooper
2017-03-20 17:07 ` Paul Durrant
2017-03-17 9:57 ` [PATCH 7/7] x86/viridian: implement the crash MSRs Paul Durrant
2017-03-20 12:38 ` Jan Beulich
2017-03-20 12:48 ` Paul Durrant
2017-03-20 13:29 ` Jan Beulich
2017-03-20 13:33 ` Paul Durrant
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=55f96b4bc1ec4b0fb1b671a9b2852a92@AMSPEX02CL03.citrite.net \
--to=paul.durrant@citrix.com \
--cc=Andrew.Cooper3@citrix.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).