From: Zhenzhong Duan <zhenzhong.duan@oracle.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
"x86@kernel.org" <x86@kernel.org>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Feng Jin <joe.jin@oracle.com>
Subject: [PATCH] Return a proper bool value to hypervisor_x2apic_available
Date: Tue, 30 Jul 2013 13:33:52 +0800 [thread overview]
Message-ID: <51F75040.1010300@oracle.com> (raw)
When bootup on a bare metal env, hypervisor_x2apic_available should return
ture so that "max_physical_apicid > 255" check in enable_IR_x2apic is useful.
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
---
arch/x86/include/asm/hypervisor.h | 2 +-
arch/x86/kernel/cpu/hypervisor.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/hypervisor.h b/arch/x86/include/asm/hypervisor.h
index 2d4b5e6..d4c09b3 100644
--- a/arch/x86/include/asm/hypervisor.h
+++ b/arch/x86/include/asm/hypervisor.h
@@ -59,6 +59,6 @@ extern bool hypervisor_x2apic_available(void);
#else
static inline void init_hypervisor(struct cpuinfo_x86 *c) { }
static inline void init_hypervisor_platform(void) { }
-static inline bool hypervisor_x2apic_available(void) { return false; }
+static inline bool hypervisor_x2apic_available(void) { return true; }
#endif /* CONFIG_HYPERVISOR_GUEST */
#endif /* _ASM_X86_HYPERVISOR_H */
diff --git a/arch/x86/kernel/cpu/hypervisor.c b/arch/x86/kernel/cpu/hypervisor.c
index 8727921..ee303cd 100644
--- a/arch/x86/kernel/cpu/hypervisor.c
+++ b/arch/x86/kernel/cpu/hypervisor.c
@@ -82,7 +82,7 @@ void __init init_hypervisor_platform(void)
bool __init hypervisor_x2apic_available(void)
{
- return x86_hyper &&
+ return !x86_hyper ||
x86_hyper->x2apic_available &&
x86_hyper->x2apic_available();
}
--
1.7.3
reply other threads:[~2013-07-30 5:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=51F75040.1010300@oracle.com \
--to=zhenzhong.duan@oracle.com \
--cc=hpa@zytor.com \
--cc=joe.jin@oracle.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.