[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH for-next v2 9/9] x86: introduce CONFIG_HYPERV and detection code



On Mon, Oct 21, 2019 at 12:22:25PM +0200, Roger Pau Monné wrote:
[...]
> > +bool __init hyperv_probe(void)
> > +{
> > +    uint32_t eax, ebx, ecx, edx;
> > +    bool hyperv_guest = false;
> 
> I don't think you need this local variable, you can return true in if
> the if condition matches, and false otherwise.
> 

Sure. I can drop it for now and reintroduce it when necessary.

> > +
> > +    cpuid(0x40000000, &eax, &ebx, &ecx, &edx);
> > +    if ( (ebx == 0x7263694d) && /* "Micr" */
> > +         (ecx == 0x666f736f) && /* "osof" */
> > +         (edx == 0x76482074) )  /* "t Hv" */
> 
> I guess there are no HyperV headers to import that have those values
> defined?
> 

Not yet. I have plan to import a header from Linux. When that's done
these will be replaced by some macros.

So I will keep this as-is for now.

[...]
> > +#ifndef __X86_GUEST_HYPERV_H__
> > +#define __X86_GUEST_HYPERV_H__
> > +
> > +#ifdef CONFIG_HYPERV_GUEST
> > +
> > +#include <asm/guest/hypervisor.h>
> > +
> > +extern struct hypervisor_ops hyperv_hypervisor_ops;
> 
> hyperv_ops would be fine by me, seems kind of redundant to have
> 'hyper' twice in a name.
> 

In that case I will also change xen_hypervisor_ops to xen_ops to remain
consistent.

Wei.

> Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.