[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 05:11:26PM +0200, Roger Pau Monné wrote:
> On Mon, Oct 21, 2019 at 03:56:51PM +0100, Wei Liu wrote:
> > 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.
> 
> Is it really cumbersome to introduce the header now?
> 
> IMO it would be better to avoid deferring this to when you introduce
> the header, since it's easy to miss it.

The header in Linux is not without its problems. It certainly doesn't
have the signature values in it yet, so whether importing it now or
later is immaterial to this issue at hand. I will have to go through
that header file first but -ETIME.

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®.