From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Sheng Yang <sheng@linux.intel.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] xen: HVM X2APIC support
Date: Mon, 6 Dec 2010 15:40:54 -0500 [thread overview]
Message-ID: <20101206204054.GA28678@dumpdata.com> (raw)
In-Reply-To: <1291621797-1483-1-git-send-email-sheng@linux.intel.com>
> +static inline uint32_t xen_cpuid_base(void)
> +{
> + uint32_t base, eax, ebx, ecx, edx;
> + char signature[13];
> +
> + for (base = 0x40000000; base < 0x40010000; base += 0x100) {
> + cpuid(base, &eax, &ebx, &ecx, &edx);
> + *(uint32_t *)(signature + 0) = ebx;
> + *(uint32_t *)(signature + 4) = ecx;
> + *(uint32_t *)(signature + 8) = edx;
> + signature[12] = 0;
> +
> + if (!strcmp("XenVMMXenVMM", signature) && ((eax - base) >= 2))
> + return base;
> + }
> +
> + return 0;
> +}
> +
> +#ifdef CONFIG_XEN
> +extern bool xen_hvm_need_lapic(void);
> +
> +static inline bool xen_para_available(void)
> +{
> + return xen_hvm_need_lapic();
> +}
> +#else
> +static inline bool xen_para_available(void)
> +{
> + return (xen_cpuid_base() != 0);
Would it make sense to collapse the kvm_para_available and
the xen_cpuid_base together (and maybe even the HyperV detection code)
together in one and just return "x2_apic_para_capable" ?
next prev parent reply other threads:[~2010-12-06 20:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-06 7:49 [PATCH v2] xen: HVM X2APIC support Sheng Yang
2010-12-06 18:07 ` Jeremy Fitzhardinge
2010-12-07 2:01 ` Sheng Yang
2010-12-07 2:03 ` [Xen-devel] " Sheng Yang
2010-12-06 20:40 ` Konrad Rzeszutek Wilk [this message]
2010-12-07 2:04 ` 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=20101206204054.GA28678@dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sheng@linux.intel.com \
--cc=stefano.stabellini@eu.citrix.com \
/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