[<prev] [next>] [day] [month] [year] [list]
Message-ID: <DE8DF0795D48FD4CA783C40EC82923353DD6E1@SHSMSX101.ccr.corp.intel.com>
Date: Fri, 25 Jan 2013 08:57:13 +0000
From: "Liu, Jinsong" <jinsong.liu@...el.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
"xen-devel@...ts.xensource.com" <xen-devel@...ts.xensource.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: Konrad Rzeszutek Wilk <konrad@...nel.org>
Subject: [PATCH V2 1/3] Xen stub driver for CPU hotplug
>From 74028ed6e4190ba0ea8ec87cba1d28de95a128bf Mon Sep 17 00:00:00 2001
From: Liu Jinsong <jinsong.liu@...el.com>
Date: Thu, 24 Jan 2013 22:12: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@...el.com>
---
drivers/xen/xen-stub.c | 39 +++++++++++++++++++++++++++++++++++++--
include/xen/acpi.h | 7 +++++++
2 files changed, 44 insertions(+), 2 deletions(-)
diff --git a/drivers/xen/xen-stub.c b/drivers/xen/xen-stub.c
index 811152f..d85e411 100644
--- a/drivers/xen/xen-stub.c
+++ b/drivers/xen/xen-stub.c
@@ -28,12 +28,12 @@
#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},
@@ -63,4 +63,39 @@ void xen_stub_memory_device_exit(void)
}
EXPORT_SYMBOL_GPL(xen_stub_memory_device_exit);
+
+/*--------------------------------------------
+ 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},
+};
+
+static 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,
+};
+
+int 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);
+}
+EXPORT_SYMBOL_GPL(xen_stub_processor_init);
+subsys_initcall(xen_stub_processor_init);
+
+void xen_stub_processor_exit(void)
+{
+ acpi_bus_unregister_driver(&xen_stub_processor_driver);
+}
+EXPORT_SYMBOL_GPL(xen_stub_processor_exit);
+
#endif
diff --git a/include/xen/acpi.h b/include/xen/acpi.h
index ce7e526..2b3103b 100644
--- a/include/xen/acpi.h
+++ b/include/xen/acpi.h
@@ -47,6 +47,13 @@
int xen_stub_memory_device_init(void);
void xen_stub_memory_device_exit(void);
+#define ACPI_PROCESSOR_CLASS "processor"
+#define ACPI_PROCESSOR_DEVICE_HID "ACPI0007"
+#define ACPI_PROCESSOR_DEVICE_NAME "Processor"
+
+int xen_stub_processor_init(void);
+void xen_stub_processor_exit(void);
+
int xen_acpi_notify_hypervisor_state(u8 sleep_state,
u32 pm1a_cnt, u32 pm1b_cnd);
--
1.7.1
Download attachment "0001-Xen-stub-driver-for-CPU-hotplug.patch" of type "application/octet-stream" (2707 bytes)
Powered by blists - more mailing lists