public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH V1 1/3] Xen stub driver for CPU hotplug
@ 2013-01-15 12:30 Liu, Jinsong
  2013-01-23 19:55 ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 3+ messages in thread
From: Liu, Jinsong @ 2013-01-15 12:30 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk, xen-devel@lists.xensource.com,
	linux-kernel@vger.kernel.org
  Cc: Konrad Rzeszutek Wilk

[-- Attachment #1: Type: text/plain, Size: 2623 bytes --]

>From 110b4ef3b8ebefeaf68832dd8ef8aa916a782e89 Mon Sep 17 00:00:00 2001
From: Liu Jinsong <jinsong.liu@intel.com>
Date: Mon, 14 Jan 2013 15:19:30 +0800
Subject: [PATCH 1/3] Xen stub driver for CPU hotplug

Add Xen stub driver for CPU hotplug, early occupy to block native,
will be replaced later by real Xen processor driver module.

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
---
 drivers/xen/xen-stub.c |   34 ++++++++++++++++++++++++++++++++--
 include/xen/acpi.h     |    6 ++++++
 2 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/xen-stub.c b/drivers/xen/xen-stub.c
index 01a49e3..681e9cc 100644
--- a/drivers/xen/xen-stub.c
+++ b/drivers/xen/xen-stub.c
@@ -28,12 +28,13 @@
 #include <acpi/acpi_drivers.h>
 #include <xen/acpi.h>
 
+
+#ifdef CONFIG_ACPI
+
 /*--------------------------------------------
 	stub driver for Xen memory hotplug
 --------------------------------------------*/
 
-#ifdef CONFIG_ACPI
-
 static const struct acpi_device_id memory_device_ids[] = {
 	{ACPI_MEMORY_DEVICE_HID, 0},
 	{"", 0},
@@ -57,4 +58,33 @@ static int __init xen_stub_memory_device_init(void)
 }
 subsys_initcall(xen_stub_memory_device_init);
 
+
+/*--------------------------------------------
+	stub driver for Xen cpu hotplug
+--------------------------------------------*/
+
+static const struct acpi_device_id processor_device_ids[] = {
+	{ACPI_PROCESSOR_OBJECT_HID, 0},
+	{ACPI_PROCESSOR_DEVICE_HID, 0},
+	{"", 0},
+};
+
+struct acpi_driver xen_stub_processor_driver = {
+	/* same name as native processor driver to block native loaded */
+	.name = "processor",
+	.class = ACPI_PROCESSOR_CLASS,
+	.ids = processor_device_ids,
+};
+EXPORT_SYMBOL_GPL(xen_stub_processor_driver);
+
+static int __init xen_stub_processor_init(void)
+{
+	if (!xen_initial_domain())
+		return -ENODEV;
+
+	/* just reserve space for Xen, block native driver loaded */
+	return acpi_bus_register_driver(&xen_stub_processor_driver);
+}
+subsys_initcall(xen_stub_processor_init);
+
 #endif
diff --git a/include/xen/acpi.h b/include/xen/acpi.h
index 7366e58..1c99eb5 100644
--- a/include/xen/acpi.h
+++ b/include/xen/acpi.h
@@ -46,6 +46,12 @@
 
 extern struct acpi_driver xen_stub_memory_device_driver;
 
+#define ACPI_PROCESSOR_CLASS            "processor"
+#define ACPI_PROCESSOR_DEVICE_HID       "ACPI0007"
+#define ACPI_PROCESSOR_DEVICE_NAME      "Processor"
+
+extern struct acpi_driver xen_stub_processor_driver;
+
 int xen_acpi_notify_hypervisor_state(u8 sleep_state,
 				     u32 pm1a_cnt, u32 pm1b_cnd);
 
-- 
1.7.1

[-- Attachment #2: 0001-Xen-stub-driver-for-CPU-hotplug.patch --]
[-- Type: application/octet-stream, Size: 2536 bytes --]

From 110b4ef3b8ebefeaf68832dd8ef8aa916a782e89 Mon Sep 17 00:00:00 2001
From: Liu Jinsong <jinsong.liu@intel.com>
Date: Mon, 14 Jan 2013 15:19:30 +0800
Subject: [PATCH 1/3] Xen stub driver for CPU hotplug

Add Xen stub driver for CPU hotplug, early occupy to block native,
will be replaced later by real Xen processor driver module.

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
---
 drivers/xen/xen-stub.c |   34 ++++++++++++++++++++++++++++++++--
 include/xen/acpi.h     |    6 ++++++
 2 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/xen-stub.c b/drivers/xen/xen-stub.c
index 01a49e3..681e9cc 100644
--- a/drivers/xen/xen-stub.c
+++ b/drivers/xen/xen-stub.c
@@ -28,12 +28,13 @@
 #include <acpi/acpi_drivers.h>
 #include <xen/acpi.h>
 
+
+#ifdef CONFIG_ACPI
+
 /*--------------------------------------------
 	stub driver for Xen memory hotplug
 --------------------------------------------*/
 
-#ifdef CONFIG_ACPI
-
 static const struct acpi_device_id memory_device_ids[] = {
 	{ACPI_MEMORY_DEVICE_HID, 0},
 	{"", 0},
@@ -57,4 +58,33 @@ static int __init xen_stub_memory_device_init(void)
 }
 subsys_initcall(xen_stub_memory_device_init);
 
+
+/*--------------------------------------------
+	stub driver for Xen cpu hotplug
+--------------------------------------------*/
+
+static const struct acpi_device_id processor_device_ids[] = {
+	{ACPI_PROCESSOR_OBJECT_HID, 0},
+	{ACPI_PROCESSOR_DEVICE_HID, 0},
+	{"", 0},
+};
+
+struct acpi_driver xen_stub_processor_driver = {
+	/* same name as native processor driver to block native loaded */
+	.name = "processor",
+	.class = ACPI_PROCESSOR_CLASS,
+	.ids = processor_device_ids,
+};
+EXPORT_SYMBOL_GPL(xen_stub_processor_driver);
+
+static int __init xen_stub_processor_init(void)
+{
+	if (!xen_initial_domain())
+		return -ENODEV;
+
+	/* just reserve space for Xen, block native driver loaded */
+	return acpi_bus_register_driver(&xen_stub_processor_driver);
+}
+subsys_initcall(xen_stub_processor_init);
+
 #endif
diff --git a/include/xen/acpi.h b/include/xen/acpi.h
index 7366e58..1c99eb5 100644
--- a/include/xen/acpi.h
+++ b/include/xen/acpi.h
@@ -46,6 +46,12 @@
 
 extern struct acpi_driver xen_stub_memory_device_driver;
 
+#define ACPI_PROCESSOR_CLASS            "processor"
+#define ACPI_PROCESSOR_DEVICE_HID       "ACPI0007"
+#define ACPI_PROCESSOR_DEVICE_NAME      "Processor"
+
+extern struct acpi_driver xen_stub_processor_driver;
+
 int xen_acpi_notify_hypervisor_state(u8 sleep_state,
 				     u32 pm1a_cnt, u32 pm1b_cnd);
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH V1 1/3] Xen stub driver for CPU hotplug
  2013-01-15 12:30 [PATCH V1 1/3] Xen stub driver for CPU hotplug Liu, Jinsong
@ 2013-01-23 19:55 ` Konrad Rzeszutek Wilk
  2013-01-25  6:32   ` Liu, Jinsong
  0 siblings, 1 reply; 3+ messages in thread
From: Konrad Rzeszutek Wilk @ 2013-01-23 19:55 UTC (permalink / raw)
  To: Liu, Jinsong
  Cc: xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org,
	Konrad Rzeszutek Wilk

On Tue, Jan 15, 2013 at 12:30:19PM +0000, Liu, Jinsong wrote:
> >From 110b4ef3b8ebefeaf68832dd8ef8aa916a782e89 Mon Sep 17 00:00:00 2001
> From: Liu Jinsong <jinsong.liu@intel.com>
> Date: Mon, 14 Jan 2013 15:19:30 +0800
> Subject: [PATCH 1/3] Xen stub driver for CPU hotplug
> 
> Add Xen stub driver for CPU hotplug, early occupy to block native,
> will be replaced later by real Xen processor driver module.
> 
> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
> ---
>  drivers/xen/xen-stub.c |   34 ++++++++++++++++++++++++++++++++--
>  include/xen/acpi.h     |    6 ++++++
>  2 files changed, 38 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/xen/xen-stub.c b/drivers/xen/xen-stub.c
> index 01a49e3..681e9cc 100644
> --- a/drivers/xen/xen-stub.c
> +++ b/drivers/xen/xen-stub.c
> @@ -28,12 +28,13 @@
>  #include <acpi/acpi_drivers.h>
>  #include <xen/acpi.h>
>  
> +
> +#ifdef CONFIG_ACPI
> +
>  /*--------------------------------------------
>  	stub driver for Xen memory hotplug
>  --------------------------------------------*/
>  
> -#ifdef CONFIG_ACPI
> -
>  static const struct acpi_device_id memory_device_ids[] = {
>  	{ACPI_MEMORY_DEVICE_HID, 0},
>  	{"", 0},
> @@ -57,4 +58,33 @@ static int __init xen_stub_memory_device_init(void)
>  }
>  subsys_initcall(xen_stub_memory_device_init);
>  
> +
> +/*--------------------------------------------
> +	stub driver for Xen cpu hotplug
> +--------------------------------------------*/
> +
> +static const struct acpi_device_id processor_device_ids[] = {
> +	{ACPI_PROCESSOR_OBJECT_HID, 0},
> +	{ACPI_PROCESSOR_DEVICE_HID, 0},
> +	{"", 0},
> +};
> +
> +struct acpi_driver xen_stub_processor_driver = {
> +	/* same name as native processor driver to block native loaded */
> +	.name = "processor",
> +	.class = ACPI_PROCESSOR_CLASS,
> +	.ids = processor_device_ids,
> +};
> +EXPORT_SYMBOL_GPL(xen_stub_processor_driver);

Could you make this be

xen_stub_processor_deinit() instead?

> +
> +static int __init xen_stub_processor_init(void)
> +{
> +	if (!xen_initial_domain())
> +		return -ENODEV;
> +
> +	/* just reserve space for Xen, block native driver loaded */
> +	return acpi_bus_register_driver(&xen_stub_processor_driver);
> +}
> +subsys_initcall(xen_stub_processor_init);
> +
>  #endif
> diff --git a/include/xen/acpi.h b/include/xen/acpi.h
> index 7366e58..1c99eb5 100644
> --- a/include/xen/acpi.h
> +++ b/include/xen/acpi.h
> @@ -46,6 +46,12 @@
>  
>  extern struct acpi_driver xen_stub_memory_device_driver;
>  
> +#define ACPI_PROCESSOR_CLASS            "processor"
> +#define ACPI_PROCESSOR_DEVICE_HID       "ACPI0007"
> +#define ACPI_PROCESSOR_DEVICE_NAME      "Processor"
> +
> +extern struct acpi_driver xen_stub_processor_driver;
> +
>  int xen_acpi_notify_hypervisor_state(u8 sleep_state,
>  				     u32 pm1a_cnt, u32 pm1b_cnd);
>  
> -- 
> 1.7.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH V1 1/3] Xen stub driver for CPU hotplug
  2013-01-23 19:55 ` Konrad Rzeszutek Wilk
@ 2013-01-25  6:32   ` Liu, Jinsong
  0 siblings, 0 replies; 3+ messages in thread
From: Liu, Jinsong @ 2013-01-25  6:32 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org,
	Konrad Rzeszutek Wilk

Konrad Rzeszutek Wilk wrote:
> On Tue, Jan 15, 2013 at 12:30:19PM +0000, Liu, Jinsong wrote:
>>> From 110b4ef3b8ebefeaf68832dd8ef8aa916a782e89 Mon Sep 17 00:00:00
>>> 2001 
>> From: Liu Jinsong <jinsong.liu@intel.com>
>> Date: Mon, 14 Jan 2013 15:19:30 +0800
>> Subject: [PATCH 1/3] Xen stub driver for CPU hotplug
>> 
>> Add Xen stub driver for CPU hotplug, early occupy to block native,
>> will be replaced later by real Xen processor driver module.
>> 
>> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
>> ---
>>  drivers/xen/xen-stub.c |   34 ++++++++++++++++++++++++++++++++--
>>  include/xen/acpi.h     |    6 ++++++
>>  2 files changed, 38 insertions(+), 2 deletions(-)
>> 
>> diff --git a/drivers/xen/xen-stub.c b/drivers/xen/xen-stub.c
>> index 01a49e3..681e9cc 100644
>> --- a/drivers/xen/xen-stub.c
>> +++ b/drivers/xen/xen-stub.c
>> @@ -28,12 +28,13 @@
>>  #include <acpi/acpi_drivers.h>
>>  #include <xen/acpi.h>
>> 
>> +
>> +#ifdef CONFIG_ACPI
>> +
>>  /*--------------------------------------------
>>  	stub driver for Xen memory hotplug
>>  --------------------------------------------*/
>> 
>> -#ifdef CONFIG_ACPI
>> -
>>  static const struct acpi_device_id memory_device_ids[] = {
>>  	{ACPI_MEMORY_DEVICE_HID, 0},
>>  	{"", 0},
>> @@ -57,4 +58,33 @@ static int __init
>>  xen_stub_memory_device_init(void)  }
>> subsys_initcall(xen_stub_memory_device_init); 
>> 
>> +
>> +/*--------------------------------------------
>> +	stub driver for Xen cpu hotplug
>> +--------------------------------------------*/
>> +
>> +static const struct acpi_device_id processor_device_ids[] = {
>> +	{ACPI_PROCESSOR_OBJECT_HID, 0},
>> +	{ACPI_PROCESSOR_DEVICE_HID, 0},
>> +	{"", 0},
>> +};
>> +
>> +struct acpi_driver xen_stub_processor_driver = {
>> +	/* same name as native processor driver to block native loaded */
>> +	.name = "processor", +	.class = ACPI_PROCESSOR_CLASS,
>> +	.ids = processor_device_ids,
>> +};
>> +EXPORT_SYMBOL_GPL(xen_stub_processor_driver);
> 
> Could you make this be
> 
> xen_stub_processor_deinit() instead?
> 

Updated, w/ 2 funcs EXPORT_SYMBOL_GPL to cpu hotplug module:
xen_stub_processor_init()
xen_stub_processor_exit()

Thanks,
Jinsong

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-01-25  6:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-15 12:30 [PATCH V1 1/3] Xen stub driver for CPU hotplug Liu, Jinsong
2013-01-23 19:55 ` Konrad Rzeszutek Wilk
2013-01-25  6:32   ` Liu, Jinsong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox