public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sheng Yang <sheng@linux.intel.com>
To: Ian Campbell <ijc@hellion.org.uk>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2 v2] xen: HVM X2APIC support
Date: Thu, 6 Jan 2011 09:20:47 +0800	[thread overview]
Message-ID: <201101060920.47797.sheng@linux.intel.com> (raw)
In-Reply-To: <1294239388.3831.3516.camel@zakaz.uk.xensource.com>

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.

  reply	other threads:[~2011-01-06  1:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-21  6:18 [PATCH 1/2] apic: Move hypervisor detection of x2apic to hypervisor.h Sheng Yang
2010-12-21  6:18 ` [PATCH 2/2 v2] xen: HVM X2APIC support Sheng Yang
2011-01-05  7:47   ` Sheng Yang
2011-01-05 14:56     ` Ian Campbell
2011-01-06  1:20       ` Sheng Yang [this message]
2011-01-06  9:10         ` Ian Campbell
2011-01-06  9:23           ` Sheng Yang
2011-01-06  9:35             ` Ian Campbell
2011-01-06 10:05               ` Sheng Yang
2011-01-06 15:00                 ` Konrad Rzeszutek Wilk
2011-01-10  2:34                   ` Sheng Yang
2010-12-21 17:15 ` [PATCH 1/2] apic: Move hypervisor detection of x2apic to hypervisor.h Jeremy Fitzhardinge
2010-12-21 18:15   ` Avi Kivity
2010-12-31  2:05     ` Sheng Yang
2011-01-04  8:57     ` Sheng Yang
2011-01-04  9:24       ` Ingo Molnar
2011-01-05  1:51         ` Sheng Yang
2011-01-05  7:40           ` Jeremy Fitzhardinge
2011-01-05 15:46             ` Konrad Rzeszutek Wilk
  -- strict thread matches above, loose matches on Subject: below --
2010-12-08  6:03 Sheng Yang
2010-12-08  6:04 ` [PATCH 2/2 v2] xen: HVM X2APIC support Sheng Yang
2010-12-17  8:20   ` Sheng Yang

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=201101060920.47797.sheng@linux.intel.com \
    --to=sheng@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=ijc@hellion.org.uk \
    --cc=jeremy@goop.org \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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