* [PATCH 2/2] Hyperv detection - code cleanup
@ 2010-05-19 17:20 Ky Srinivasan
2010-05-19 17:50 ` H. Peter Anvin
0 siblings, 1 reply; 5+ messages in thread
From: Ky Srinivasan @ 2010-05-19 17:20 UTC (permalink / raw)
To: hpa; +Cc: greg, hjanssen, mingo, linux-kernel
From: K. Y. Srinivasan <ksrinivasan@novell.com>
Subject: Code cleanup - get rid of the "ms" prefix in hyperv related files.
Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
Index: linux.trees.git/arch/x86/include/asm/hyperv.h
===================================================================
--- linux.trees.git.orig/arch/x86/include/asm/hyperv.h 2010-05-18 13:04:25.000000000 -0600
+++ linux.trees.git/arch/x86/include/asm/hyperv.h 2010-05-18 13:46:18.000000000 -0600
@@ -190,11 +190,11 @@
#define HV_STATUS_INVALID_HYPERCALL_INPUT 3
#define HV_STATUS_INVALID_ALIGNMENT 4
-struct ms_hyperv_info {
+struct hyperv_info {
u32 features;
u32 hints;
};
-extern struct ms_hyperv_info ms_hyperv;
+extern struct hyperv_info hyperv_info;
#endif
Index: linux.trees.git/arch/x86/include/asm/hypervisor.h
===================================================================
--- linux.trees.git.orig/arch/x86/include/asm/hypervisor.h 2010-05-18 10:14:02.000000000 -0600
+++ linux.trees.git/arch/x86/include/asm/hypervisor.h 2010-05-18 13:52:10.000000000 -0600
@@ -44,6 +44,6 @@ extern const struct hypervisor_x86 *x86_
/* Recognized hypervisors */
extern const struct hypervisor_x86 x86_hyper_vmware;
-extern const struct hypervisor_x86 x86_hyper_ms_hyperv;
+extern const struct hypervisor_x86 x86_hyper_hyperv;
#endif
Index: linux.trees.git/arch/x86/kernel/cpu/Makefile
===================================================================
--- linux.trees.git.orig/arch/x86/kernel/cpu/Makefile 2010-05-18 10:14:02.000000000 -0600
+++ linux.trees.git/arch/x86/kernel/cpu/Makefile 2010-05-18 13:55:30.000000000 -0600
@@ -14,7 +14,7 @@ CFLAGS_common.o := $(nostackp)
obj-y := intel_cacheinfo.o addon_cpuid_features.o
obj-y += proc.o capflags.o powerflags.o common.o
-obj-y += vmware.o hypervisor.o sched.o mshyperv.o
+obj-y += vmware.o hypervisor.o sched.o hyperv.o
obj-$(CONFIG_X86_32) += bugs.o cmpxchg.o
obj-$(CONFIG_X86_64) += bugs_64.o
Index: linux.trees.git/arch/x86/kernel/cpu/hyperv.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux.trees.git/arch/x86/kernel/cpu/hyperv.c 2010-05-18 14:11:07.000000000 -0600
@@ -0,0 +1,55 @@
+/*
+ * HyperV Detection code.
+ *
+ * Copyright (C) 2010, Novell, Inc.
+ * Author : K. Y. Srinivasan <ksrinivasan@novell.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ */
+
+#include <linux/types.h>
+#include <linux/module.h>
+#include <asm/processor.h>
+#include <asm/hypervisor.h>
+#include <asm/hyperv.h>
+
+struct hyperv_info hyperv_info;
+EXPORT_SYMBOL(hyperv_info);
+
+static bool __init hyperv_platform(void)
+{
+ u32 eax;
+ u32 hyp_signature[3];
+
+ if (!boot_cpu_has(X86_FEATURE_HYPERVISOR))
+ return false;
+
+ cpuid(HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS,
+ &eax, &hyp_signature[0], &hyp_signature[1], &hyp_signature[2]);
+
+ return eax >= HYPERV_CPUID_MIN &&
+ eax <= HYPERV_CPUID_MAX &&
+ !memcmp("Microsoft Hv", hyp_signature, 12);
+}
+
+static void __init hyperv_init_platform(void)
+{
+ /*
+ * Extract the features and hints
+ */
+ hyperv_info.features = cpuid_eax(HYPERV_CPUID_FEATURES);
+ hyperv_info.hints = cpuid_eax(HYPERV_CPUID_ENLIGHTMENT_INFO);
+
+ printk(KERN_INFO "HyperV: features 0x%x, hints 0x%x\n",
+ hyperv_info.features, hyperv_info.hints);
+}
+
+const __refconst struct hypervisor_x86 x86_hyper_hyperv = {
+ .name = "Microsoft HyperV",
+ .detect = hyperv_platform,
+ .init_platform = hyperv_init_platform,
+};
+EXPORT_SYMBOL(x86_hyper_hyperv);
Index: linux.trees.git/arch/x86/kernel/cpu/mshyperv.c
===================================================================
--- linux.trees.git.orig/arch/x86/kernel/cpu/mshyperv.c 2010-05-18 13:05:43.000000000 -0600
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,55 +0,0 @@
-/*
- * HyperV Detection code.
- *
- * Copyright (C) 2010, Novell, Inc.
- * Author : K. Y. Srinivasan <ksrinivasan@novell.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- */
-
-#include <linux/types.h>
-#include <linux/module.h>
-#include <asm/processor.h>
-#include <asm/hypervisor.h>
-#include <asm/hyperv.h>
-
-struct ms_hyperv_info ms_hyperv;
-EXPORT_SYMBOL(ms_hyperv);
-
-static bool __init ms_hyperv_platform(void)
-{
- u32 eax;
- u32 hyp_signature[3];
-
- if (!boot_cpu_has(X86_FEATURE_HYPERVISOR))
- return false;
-
- cpuid(HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS,
- &eax, &hyp_signature[0], &hyp_signature[1], &hyp_signature[2]);
-
- return eax >= HYPERV_CPUID_MIN &&
- eax <= HYPERV_CPUID_MAX &&
- !memcmp("Microsoft Hv", hyp_signature, 12);
-}
-
-static void __init ms_hyperv_init_platform(void)
-{
- /*
- * Extract the features and hints
- */
- ms_hyperv.features = cpuid_eax(HYPERV_CPUID_FEATURES);
- ms_hyperv.hints = cpuid_eax(HYPERV_CPUID_ENLIGHTMENT_INFO);
-
- printk(KERN_INFO "HyperV: features 0x%x, hints 0x%x\n",
- ms_hyperv.features, ms_hyperv.hints);
-}
-
-const __refconst struct hypervisor_x86 x86_hyper_ms_hyperv = {
- .name = "Microsoft HyperV",
- .detect = ms_hyperv_platform,
- .init_platform = ms_hyperv_init_platform,
-};
-EXPORT_SYMBOL(x86_hyper_ms_hyperv);
Index: linux.trees.git/arch/x86/kernel/cpu/hypervisor.c
===================================================================
--- linux.trees.git.orig/arch/x86/kernel/cpu/hypervisor.c 2010-05-18 10:14:02.000000000 -0600
+++ linux.trees.git/arch/x86/kernel/cpu/hypervisor.c 2010-05-18 14:06:07.000000000 -0600
@@ -33,7 +33,7 @@
static const __initconst struct hypervisor_x86 * const hypervisors[] =
{
&x86_hyper_vmware,
- &x86_hyper_ms_hyperv,
+ &x86_hyper_hyperv,
};
const struct hypervisor_x86 *x86_hyper;
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH 2/2] Hyperv detection - code cleanup
2010-05-19 17:20 [PATCH 2/2] Hyperv detection - code cleanup Ky Srinivasan
@ 2010-05-19 17:50 ` H. Peter Anvin
2010-05-19 18:19 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: H. Peter Anvin @ 2010-05-19 17:50 UTC (permalink / raw)
To: Ky Srinivasan; +Cc: greg, hjanssen, mingo, linux-kernel, Avi Kivity
On 05/19/2010 10:20 AM, Ky Srinivasan wrote:
> From: K. Y. Srinivasan <ksrinivasan@novell.com>
> Subject: Code cleanup - get rid of the "ms" prefix in hyperv related files.
>
>
> Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
NAK in the extreme.
"hyperv" -- without the capitalization to make it stand out -- is way
too easy to read as just an abbreviation for "hypervisor".
-hpa
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] Hyperv detection - code cleanup
2010-05-19 17:50 ` H. Peter Anvin
@ 2010-05-19 18:19 ` Greg KH
2010-05-19 18:21 ` H. Peter Anvin
0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2010-05-19 18:19 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: Ky Srinivasan, hjanssen, mingo, linux-kernel, Avi Kivity
On Wed, May 19, 2010 at 10:50:54AM -0700, H. Peter Anvin wrote:
> On 05/19/2010 10:20 AM, Ky Srinivasan wrote:
> > From: K. Y. Srinivasan <ksrinivasan@novell.com>
> > Subject: Code cleanup - get rid of the "ms" prefix in hyperv related files.
> >
> >
> > Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
>
> NAK in the extreme.
>
> "hyperv" -- without the capitalization to make it stand out -- is way
> too easy to read as just an abbreviation for "hypervisor".
Which is what I confused it with, and hence I wrote the ms_* changes in
my patch. But KY wanted it changed back so I suggested he write a
patch.
I personally like the ms_ stuff, it makes it more obvious what is going
on here, but that's just me.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] Hyperv detection - code cleanup
2010-05-19 18:19 ` Greg KH
@ 2010-05-19 18:21 ` H. Peter Anvin
2010-05-19 18:33 ` Ky Srinivasan
0 siblings, 1 reply; 5+ messages in thread
From: H. Peter Anvin @ 2010-05-19 18:21 UTC (permalink / raw)
To: Greg KH; +Cc: Ky Srinivasan, hjanssen, mingo, linux-kernel, Avi Kivity
On 05/19/2010 11:19 AM, Greg KH wrote:
> On Wed, May 19, 2010 at 10:50:54AM -0700, H. Peter Anvin wrote:
>> On 05/19/2010 10:20 AM, Ky Srinivasan wrote:
>>> From: K. Y. Srinivasan <ksrinivasan@novell.com>
>>> Subject: Code cleanup - get rid of the "ms" prefix in hyperv related files.
>>>
>>>
>>> Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
>>
>> NAK in the extreme.
>>
>> "hyperv" -- without the capitalization to make it stand out -- is way
>> too easy to read as just an abbreviation for "hypervisor".
>
> Which is what I confused it with, and hence I wrote the ms_* changes in
> my patch. But KY wanted it changed back so I suggested he write a
> patch.
>
> I personally like the ms_ stuff, it makes it more obvious what is going
> on here, but that's just me.
>
Well, I agree with you. Sorry, Ky.
-hpa
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] Hyperv detection - code cleanup
2010-05-19 18:21 ` H. Peter Anvin
@ 2010-05-19 18:33 ` Ky Srinivasan
0 siblings, 0 replies; 5+ messages in thread
From: Ky Srinivasan @ 2010-05-19 18:33 UTC (permalink / raw)
To: Greg KH, H. Peter Anvin; +Cc: hjanssen, Avi Kivity, mingo, linux-kernel
>>> On 5/19/2010 at 2:21 PM, in message <4BF42C3D.6030404@zytor.com>, "H. Peter
Anvin" <hpa@zytor.com> wrote:
> On 05/19/2010 11:19 AM, Greg KH wrote:
>> On Wed, May 19, 2010 at 10:50:54AM -0700, H. Peter Anvin wrote:
>>> On 05/19/2010 10:20 AM, Ky Srinivasan wrote:
>>>> From: K. Y. Srinivasan <ksrinivasan@novell.com>
>>>> Subject: Code cleanup - get rid of the "ms" prefix in hyperv related files.
>>>>
>>>>
>>>> Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
>>>
>>> NAK in the extreme.
>>>
>>> "hyperv" -- without the capitalization to make it stand out -- is way
>>> too easy to read as just an abbreviation for "hypervisor".
>>
>> Which is what I confused it with, and hence I wrote the ms_* changes in
>> my patch. But KY wanted it changed back so I suggested he write a
>> patch.
>>
>> I personally like the ms_ stuff, it makes it more obvious what is going
>> on here, but that's just me.
>>
>
> Well, I agree with you. Sorry, Ky.
I see your concern.
Regards,
K. Y
>
> -hpa
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-05-19 18:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-19 17:20 [PATCH 2/2] Hyperv detection - code cleanup Ky Srinivasan
2010-05-19 17:50 ` H. Peter Anvin
2010-05-19 18:19 ` Greg KH
2010-05-19 18:21 ` H. Peter Anvin
2010-05-19 18:33 ` Ky Srinivasan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox