PV usually comes in two flavors:  device PV, and "core" PV.  The existing PV
ops deal in terms of the latter.  However, it would be useful to add an
interface for a virtual bus with provisions for discovery/configuration of
backend PV devices.  Often times it is desirable to run PV devices even if the
entire core is not operating with PVOPS.  Therefore, we introduce a separate
interface to deal with the devices.

Signed-off-by: Gregory Haskins <[EMAIL PROTECTED]>
---

 include/linux/pvbus.h |   43 +++++++++++++++++++++++++++++++++++++++++++
 kernel/Makefile       |    2 +-
 kernel/pvbus.c        |   45 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 89 insertions(+), 1 deletions(-)

diff --git a/include/linux/pvbus.h b/include/linux/pvbus.h
new file mode 100644
index 0000000..edfe185
--- /dev/null
+++ b/include/linux/pvbus.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2007 Novell.  All Rights Reserved.
+ *
+ * Paravirtualized-Bus
+ *
+ * Author:
+ *      Gregory Haskins <[EMAIL PROTECTED]>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _LINUX_PVBUS_H
+#define _LINUX_PVBUS_H
+
+#include <linux/ioq.h>
+
+struct pvbus_dev {
+       u64 instance;
+       u32 version;
+};
+
+struct pvbus_ops {
+       int (*enumerate)(const char *dev, struct pvbus_dev inst[],
+                        size_t *cnt, int flags);
+       int (*call)(u64 inst, u32 func, void *data, size_t len, int flags);
+
+       struct ioq_mgr *ioqmgr;
+};
+
+extern struct pvbus_ops *pvbus_ops;
+
+#endif /* */
diff --git a/kernel/Makefile b/kernel/Makefile
index 642d427..3008163 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -8,7 +8,7 @@ obj-y     = sched.o fork.o exec_domain.o panic.o printk.o 
profile.o \
            signal.o sys.o kmod.o workqueue.o pid.o \
            rcupdate.o extable.o params.o posix-timers.o \
            kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \
-           hrtimer.o rwsem.o latency.o nsproxy.o srcu.o die_notifier.o
+           hrtimer.o rwsem.o latency.o nsproxy.o srcu.o die_notifier.o pvbus.o
 
 obj-$(CONFIG_STACKTRACE) += stacktrace.o
 obj-y += time/
diff --git a/kernel/pvbus.c b/kernel/pvbus.c
new file mode 100644
index 0000000..e638a69
--- /dev/null
+++ b/kernel/pvbus.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2007 Novell.  All Rights Reserved.
+ *
+ * Paravirtualized-Bus
+ *
+ * Author:
+ *      Gregory Haskins <[EMAIL PROTECTED]>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <linux/module.h>
+#include <linux/pvbus.h>
+
+int native_enumerate(const char *dev, struct pvbus_dev inst[],
+                    size_t *cnt, int flags)
+{
+       return -ENOSYS;
+}
+
+int native_call(u64 inst, u32 func, void *data, size_t len, int flags)
+{
+       return -ENOSYS;
+}
+
+static struct pvbus_ops native_pvbus = {
+       .enumerate = native_enumerate,
+       .call      = native_call,
+       .ioqmgr    = NULL,
+};
+
+/* This will get reassigned if a PV compatible platform is detected */
+struct pvbus_ops *pvbus_ops = &native_pvbus;
+EXPORT_SYMBOL(pvbus_ops);


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to