xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
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 v3 2/6] x86/viridian: don't put Xen version information in CPUID leaf 2
Date: Wed, 22 Mar 2017 10:20:23 +0000	[thread overview]
Message-ID: <4e88c2ba98e84629bb98b1fc345f2b37@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <58D25B7102000078001461D5@prv-mh.provo.novell.com>

> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: 22 March 2017 10:10
> To: Paul Durrant <Paul.Durrant@citrix.com>
> Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>; xen-
> devel@lists.xenproject.org
> Subject: Re: [PATCH v3 2/6] x86/viridian: don't put Xen version information in
> CPUID leaf 2
> 
> >>> On 21.03.17 at 19:17, <paul.durrant@citrix.com> wrote:
> > --- a/docs/misc/xen-command-line.markdown
> > +++ b/docs/misc/xen-command-line.markdown
> > @@ -1616,6 +1616,14 @@ The optional `keep` parameter causes Xen to
> continue using the vga
> >  console even after dom0 has been started.  The default behaviour is to
> >  relinquish control to dom0.
> >
> > +### viridian-version
> > +> `= <major>,<minor>,<build>`
> 
> In my proposal I had intentionally enclosed each number in square
> brackets, indicating that each one is optional. I don't see the point
> of having to specify all numbers all the time (and your earlier split
> option model didn't make this a requirement either).
>

So you'd like something like:

viridian-version=,,0xabcd

so that just the build number can be overridden to 0xabcd?
 
> > +> Default: `6,0,1772`
> > +
> > +<major>, <minor> and <build> must be integers specified in hexadecimal.
> The values will be
> > +encoded in guest CPUID 0x40000002 if viridian enlightenments are
> enabled.
> 
> Please wrap at column 80 the latest. And why do the numbers need
> to be in hex?

I can relax that restriction if you'd prefer.

> 
> > --- a/xen/arch/x86/hvm/viridian.c
> > +++ b/xen/arch/x86/hvm/viridian.c
> > @@ -106,6 +106,19 @@ typedef struct {
> >  #define CPUID6A_MSR_BITMAPS     (1 << 1)
> >  #define CPUID6A_NESTED_PAGING   (1 << 3)
> >
> > +/*
> > + * Version and build number reported by CPUID leaf 2
> > + *
> > + * These numbers are chosen to match the version numbers reported by
> > + * Windows Server 2008.
> > + */
> > +static char __initdata
> viridian_version[sizeof("0xVVVV,0xVVVV,0xVVVVVVVV")] = "";
> 
> Pointless in initializer.
> 

Seemed to be common practice elsewhere in the code.

> > +string_param("viridian-version", viridian_version);
> 
> Why not custom_param()?
> 

Not come across custom_param(). I'll look it up.

> > @@ -910,6 +923,39 @@ static int viridian_load_vcpu_ctxt(struct domain
> *d, hvm_domain_context_t *h)
> >  HVM_REGISTER_SAVE_RESTORE(VIRIDIAN_VCPU,
> viridian_save_vcpu_ctxt,
> >                            viridian_load_vcpu_ctxt, 1, HVMSR_PER_VCPU);
> >
> > +static int __init viridian_init(void)
> > +{
> > +    char *t, *v = viridian_version;
> 
> With e being pointer to const, I think t should be, too.
> 

Ok.

> > +    unsigned int n[3], i = 0;
> > +
> > +    if ( *v == '\0' )
> > +        return 0;
> > +
> > +    while ( (t = strsep(&v, ",")) != NULL )
> > +    {
> > +        const char *e;
> > +
> > +        n[i++] = simple_strtoul(t, &e, 16);
> > +        if ( *e != '\0' )
> > +            goto fail;
> > +    }
> > +    if ( i != 3 )
> > +        goto fail;
> > +
> > +    if (n[0] > 0xffff || n[1] > 0xffff)
> 
> Missing blanks.
> 

Oops.

> > +        goto fail;
> > +
> > +    viridian_major = n[0];
> > +    viridian_minor = n[1];
> > +    viridian_build = n[2];
> > +    return 0;
> > +
> > +fail:
> 
> Indentation.
>

Yes, sorry I forgot about that xen style quirk.

  Paul
 
> Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-03-22 10:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-21 18:17 [PATCH v3 0/6] viridian updates Paul Durrant
2017-03-21 18:17 ` [PATCH v3 1/6] x86/viridian: fix xen-hvmcrash when vp_assist page is present Paul Durrant
2017-03-22  9:57   ` Jan Beulich
2017-03-21 18:17 ` [PATCH v3 2/6] x86/viridian: don't put Xen version information in CPUID leaf 2 Paul Durrant
2017-03-22 10:09   ` Jan Beulich
2017-03-22 10:20     ` Paul Durrant [this message]
2017-03-22 10:39       ` Jan Beulich
2017-03-21 18:17 ` [PATCH v3 3/6] x86/viridian: get rid of the magic numbers in CPUID leaves 1 and 2 Paul Durrant
2017-03-21 18:17 ` [PATCH v3 4/6] x86/viridian: add warnings for unimplemented hypercalls and MSRs Paul Durrant
2017-03-21 18:17 ` [PATCH v3 5/6] x86/viridian: make the threshold for HvNotifyLongSpinWait tunable Paul Durrant
2017-03-21 18:17 ` [PATCH v3 6/6] x86/viridian: implement the crash MSRs Paul Durrant
2017-03-22 11:07   ` Jan Beulich
2017-03-22 11:09     ` Wei Liu
2017-03-22 11:10       ` Paul Durrant
2017-03-22 11:37   ` Jan Beulich
2017-03-22 11:44     ` 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=4e88c2ba98e84629bb98b1fc345f2b37@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).