lkml.org 
[lkml]   [2011]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2/2 v2] xen: HVM X2APIC support
Date
On Wednesday 05 January 2011 22:56:28 Ian Campbell wrote:
> > > @@ -1384,6 +1365,17 @@ static bool __init xen_hvm_platform(void)
> > >
> > > return true;
> > >
> > > }
> > >
> > > +bool xen_hvm_need_lapic(void)
> > > +{
> > > + if (xen_pv_domain())
> > > + return false;
> > > + if (xen_hvm_domain() && xen_feature(XENFEAT_hvm_pirqs) &&
> > > + xen_have_vector_callback)
> > > + return false;
> > > + return (xen_cpuid_base() != 0);
> > > +}
> > > +EXPORT_SYMBOL_GPL(xen_hvm_need_lapic);
> > > +
>
> Since xen_hvm_domain() is always true if xen_cpuid_base() != 0, isn't
> this more obviously written as:
> if (!xen_hvm_domain())
> return false;

XEN_HVM_DOMAIN works only when kernel built with CONFIG_XEN. This patch can also
support kernel built without CONFIG_XEN but with CONFIG_X86_X2APIC.

> if (xen_feature(XENFEAT_hvm_pirqs) && xen_have_vector_callback)
> return false;
> return true;
> ?
>
> Also, checking for the XenVMMXenVMM signature alone seems like a very
> broad test for checking the availability of a specific feature, is there
> nothing more specific which we could/should be testing?

The CPU flag x2apic is checked when we want to enable x2apic, and only Xen which
supported x2apic emulation would show this flag.

--
regards
Yang, Sheng

>
> Ian.


\
 
 \ /
  Last update: 2011-01-06 02:21    [W:1.069 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site