Re: [PATCH] xen: HVM X2APIC support

From: Stefano Stabellini
Date: Fri Dec 03 2010 - 06:29:53 EST


On Fri, 3 Dec 2010, Sheng Yang wrote:
> I suppose only HVM guest without XENFEAT_hvm_pirqs may need this. But does this
> code covered PV guest as well? We don't need cover them.
>

We can add a check on xen_pv_domain() to rule PV guests out.

> > }
> > #else
> > static inline bool xen_para_available(void)
> > {
> > return (xen_cpuid_base() != 0);
> > }
> > #endif
> >
> >
> > This is assuming that enabling x2apic doesn't prevent Linux from
> > receiving evtchns either using the callback vector mechanism or the
> > legacy platform-pci interrupt.
>
> I suppose only legacy platform-pci would need this, because it would use lapic.
> Callback vector method would use evtchn so this won't be enabled.
>

Right, should add a check on xen_have_vector_callback too.


> > Finally when running as dom0 would this feature create problems in the
> > presence of a real x2apic?
>
> I don't think this can be enabled on dom0.
>
> This one target on HVM domain, maybe also PVHVM domain without XENFEAT_hvm_pirqs,
> but not the domains using evtchn.
>

Ok, a check on xen_pv_domain() will disable x2apic for both pv guests
and dom0:


#ifdef CONFIG_XEN_PVHVM
static inline bool xen_para_available(void)
{
if (xen_pv_domain())
return 0;
if (xen_cpuid_base() != 0 &&
xen_feature(XENFEAT_hvm_pirqs) &&
xen_have_vector_callback)
return 0;
else
return 1;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/