[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] merge with xen-unstable.hg



# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1176298202 21600
# Node ID 3d356a2b1c75c2fea9b8eb0643075614e9e3d4fe
# Parent  a6800d989059304f7b4b0e55eec297b5af8bce15
# Parent  4dc14c591e6cf5177974f244db9ae4f609521417
merge with xen-unstable.hg
---
 unmodified_drivers/linux-2.6/util/Kbuild                   |    3 
 unmodified_drivers/linux-2.6/util/Makefile                 |    3 
 unmodified_drivers/linux-2.6/xenbus/Kbuild                 |   10 
 unmodified_drivers/linux-2.6/xenbus/Makefile               |    3 
 docs/xen-api/coversheet.tex                                |   27 -
 docs/xen-api/xenapi-datamodel.tex                          |  338 +++++++++++++
 docs/xen-api/xenapi.tex                                    |    1 
 linux-2.6-xen-sparse/drivers/xen/core/machine_reboot.c     |   14 
 linux-2.6-xen-sparse/drivers/xen/core/reboot.c             |   64 +-
 linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c       |    3 
 linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c     |   11 
 linux-2.6-xen-sparse/include/xen/xenbus.h                  |    2 
 tools/libxc/xc_domain_restore.c                            |    8 
 tools/libxen/include/xen_host.h                            |   41 +
 tools/libxen/include/xen_int_int_map.h                     |   53 ++
 tools/libxen/include/xen_internal.h                        |    1 
 tools/libxen/include/xen_vm.h                              |   17 
 tools/libxen/include/xen_vm_metrics.h                      |   26 +
 tools/libxen/src/xen_common.c                              |   19 
 tools/libxen/src/xen_host.c                                |   92 +++
 tools/libxen/src/xen_int_int_map.c                         |   39 +
 tools/libxen/src/xen_vm.c                                  |   32 +
 tools/libxen/src/xen_vm_metrics.c                          |   63 ++
 tools/libxen/test/test_bindings.c                          |   65 ++
 tools/python/xen/xend/XendAPI.py                           |   13 
 tools/python/xen/xend/XendDomainInfo.py                    |    1 
 tools/python/xen/xend/XendVMMetrics.py                     |    4 
 tools/python/xen/xm/main.py                                |    9 
 unmodified_drivers/linux-2.6/Makefile                      |    2 
 unmodified_drivers/linux-2.6/mkbuildtree                   |    2 
 unmodified_drivers/linux-2.6/platform-pci/Kbuild           |   11 
 unmodified_drivers/linux-2.6/platform-pci/evtchn.c         |  162 ++++--
 unmodified_drivers/linux-2.6/platform-pci/machine_reboot.c |   24 
 unmodified_drivers/linux-2.6/platform-pci/platform-pci.c   |   95 +--
 unmodified_drivers/linux-2.6/platform-pci/platform-pci.h   |   40 -
 xen/arch/x86/mm/hap/hap.c                                  |   49 +
 36 files changed, 1145 insertions(+), 202 deletions(-)

diff -r a6800d989059 -r 3d356a2b1c75 docs/xen-api/coversheet.tex
--- a/docs/xen-api/coversheet.tex       Wed Apr 11 07:28:29 2007 -0600
+++ b/docs/xen-api/coversheet.tex       Wed Apr 11 07:30:02 2007 -0600
@@ -41,22 +41,17 @@ Date: \datestring{}
 \end{center}
 \vspace{.5cm}
 \begin{large}
-\textbf{Contributors:}
-\begin{multicols}{2}{
-Stefan Berger, IBM \\
-Daniel Berrang\'e, Red Hat \\
-Gareth Bestor, IBM \\
-Hollis Blanchard, IBM \\
-Mike Day, IBM \\
-Jim Fehlig, Novell \\
-Jon Harrop, XenSource \\
-Vincent Hanquez, XenSource \\
-John Levon, Sun Microsystems \\
-Jon Ludlam, XenSource \\
-Alastair Tse, XenSource \\
-Daniel Veillard, Red Hat \\
-Tom Wilkie, University of Cambridge}
-\end{multicols}
+\textbf{Contributors:} \\
+\\
+\begin{tabular}{p{0.5\textwidth}l}
+Stefan Berger, IBM & Vincent Hanquez, XenSource \\
+Daniel Berrang\'e, Red Hat & John Levon, Sun Microsystems \\
+Gareth Bestor, IBM & Jon Ludlam, XenSource \\
+Hollis Blanchard, IBM & Alastair Tse, XenSource \\
+Mike Day, IBM & Daniel Veillard, Red Hat \\
+Jim Fehlig, Novell & Tom Wilkie, University of Cambridge \\
+Jon Harrop, XenSource & \\
+\end{tabular}
 \end{large}
 
 \vfill
diff -r a6800d989059 -r 3d356a2b1c75 docs/xen-api/xenapi-datamodel.tex
--- a/docs/xen-api/xenapi-datamodel.tex Wed Apr 11 07:28:29 2007 -0600
+++ b/docs/xen-api/xenapi-datamodel.tex Wed Apr 11 07:30:02 2007 -0600
@@ -1558,6 +1558,81 @@ void
 \vspace{0.3cm}
 \vspace{0.3cm}
 \vspace{0.3cm}
+\subsubsection{RPC name:~send\_sysrq}
+
+{\bf Overview:} 
+Send the given key as a sysrq to this VM.  The key is specified as a single
+character (a String of length 1).  This can only be called when the
+specified VM is in the Running state.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} void send_sysrq (session_id s, VM ref vm, string 
key)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+ 
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM ref } & vm & The VM \\ \hline 
+
+{\tt string } & key & The key to send \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+void
+}
+
+
+
+\vspace{0.3cm}
+
+\noindent{\bf Possible Error Codes:} {\tt VM\_BAD\_POWER\_STATE}
+
+\vspace{0.6cm}
+\subsubsection{RPC name:~send\_trigger}
+
+{\bf Overview:} 
+Send the named trigger to this VM.  This can only be called when the
+specified VM is in the Running state.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} void send_trigger (session_id s, VM ref vm, string 
trigger)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+ 
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM ref } & vm & The VM \\ \hline 
+
+{\tt string } & trigger & The trigger to send \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+void
+}
+
+
+
+\vspace{0.3cm}
+
+\noindent{\bf Possible Error Codes:} {\tt VM\_BAD\_POWER\_STATE}
+
+\vspace{0.6cm}
 \subsubsection{RPC name:~get\_all}
 
 {\bf Overview:} 
@@ -4107,6 +4182,9 @@ Quals & Field & Type & Description \\
 $\mathit{RO}_\mathit{run}$ &  {\tt memory/actual} & int & Guest's actual 
memory (bytes) \\
 $\mathit{RO}_\mathit{run}$ &  {\tt VCPUs/number} & int & Current number of 
VCPUs \\
 $\mathit{RO}_\mathit{run}$ &  {\tt VCPUs/utilisation} & (int $\rightarrow$ 
float) Map & Utilisation for all of guest's current VCPUs \\
+$\mathit{RO}_\mathit{run}$ &  {\tt VCPUs/CPU} & (int $\rightarrow$ int) Map & 
VCPU to PCPU map \\
+$\mathit{RO}_\mathit{run}$ &  {\tt VCPUs/params} & (string $\rightarrow$ 
string) Map & The live equivalent to VM.VCPUs\_params \\
+$\mathit{RO}_\mathit{run}$ &  {\tt start\_time} & datetime & Time at which 
this VM was last booted \\
 $\mathit{RO}_\mathit{run}$ &  {\tt last\_updated} & datetime & Time at which 
this information was last updated \\
 \hline
 \end{longtable}
@@ -4253,6 +4331,102 @@ Get the VCPUs/utilisation field of the g
  \noindent {\bf Return Type:} 
 {\tt 
 (int $\rightarrow$ float) Map
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_VCPUs\_CPU}
+
+{\bf Overview:} 
+Get the VCPUs/CPU field of the given VM\_metrics.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} ((int -> int) Map) get_VCPUs_CPU (session_id s, VM_metrics 
ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+ 
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM\_metrics ref } & self & reference to the object \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+(int $\rightarrow$ int) Map
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_VCPUs\_params}
+
+{\bf Overview:} 
+Get the VCPUs/params field of the given VM\_metrics.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} ((string -> string) Map) get_VCPUs_params (session_id s, 
VM_metrics ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+ 
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM\_metrics ref } & self & reference to the object \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+(string $\rightarrow$ string) Map
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_start\_time}
+
+{\bf Overview:} 
+Get the start\_time field of the given VM\_metrics.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} datetime get_start_time (session_id s, VM_metrics ref 
self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+ 
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM\_metrics ref } & self & reference to the object \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+datetime
 }
 
 
@@ -4744,6 +4918,8 @@ Quals & Field & Type & Description \\
 $\mathit{RO}_\mathit{run}$ &  {\tt software\_version} & (string $\rightarrow$ 
string) Map & version strings \\
 $\mathit{RW}$ &  {\tt other\_config} & (string $\rightarrow$ string) Map & 
additional configuration \\
 $\mathit{RO}_\mathit{run}$ &  {\tt capabilities} & string Set & Xen 
capabilities \\
+$\mathit{RO}_\mathit{run}$ &  {\tt cpu\_configuration} & (string $\rightarrow$ 
string) Map & The CPU configuration on this host.  May contain keys such as 
``nr\_nodes'', ``sockets\_per\_node'', ``cores\_per\_socket'', or 
``threads\_per\_core'' \\
+$\mathit{RO}_\mathit{run}$ &  {\tt sched\_policy} & string & Scheduler policy 
currently in force on this host \\
 $\mathit{RO}_\mathit{run}$ &  {\tt supported\_bootloaders} & string Set & a 
list of the bootloaders installed on the machine \\
 $\mathit{RO}_\mathit{run}$ &  {\tt resident\_VMs} & (VM ref) Set & list of VMs 
currently resident on host \\
 $\mathit{RW}$ &  {\tt logging} & (string $\rightarrow$ string) Map & logging 
configuration \\
@@ -4919,6 +5095,104 @@ dmesg string
 \vspace{0.3cm}
 \vspace{0.3cm}
 \vspace{0.3cm}
+\subsubsection{RPC name:~dmesg\_clear}
+
+{\bf Overview:} 
+Get the host xen dmesg, and clear the buffer.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} string dmesg_clear (session_id s, host ref host)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+ 
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt host ref } & host & The Host to query \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+string
+}
+
+
+dmesg string
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_log}
+
+{\bf Overview:} 
+Get the host's log file.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} string get_log (session_id s, host ref host)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+ 
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt host ref } & host & The Host to query \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+string
+}
+
+
+The contents of the host's primary log file
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~send\_debug\_keys}
+
+{\bf Overview:} 
+Inject the given string as debugging keys into Xen.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} void send_debug_keys (session_id s, host ref host, string 
keys)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+ 
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt host ref } & host & The host \\ \hline 
+
+{\tt string } & keys & The keys to send \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+void
+}
+
+
+
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
 \subsubsection{RPC name:~list\_methods}
 
 {\bf Overview:} 
@@ -5447,6 +5721,70 @@ Get the capabilities field of the given 
  \noindent {\bf Return Type:} 
 {\tt 
 string Set
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_cpu\_configuration}
+
+{\bf Overview:} 
+Get the cpu\_configuration field of the given host.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} ((string -> string) Map) get_cpu_configuration (session_id s, 
host ref self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+ 
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt host ref } & self & reference to the object \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+(string $\rightarrow$ string) Map
+}
+
+
+value of the field
+\vspace{0.3cm}
+\vspace{0.3cm}
+\vspace{0.3cm}
+\subsubsection{RPC name:~get\_sched\_policy}
+
+{\bf Overview:} 
+Get the sched\_policy field of the given host.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} string get_sched_policy (session_id s, host ref 
self)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+ 
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt host ref } & self & reference to the object \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+string
 }
 
 
diff -r a6800d989059 -r 3d356a2b1c75 docs/xen-api/xenapi.tex
--- a/docs/xen-api/xenapi.tex   Wed Apr 11 07:28:29 2007 -0600
+++ b/docs/xen-api/xenapi.tex   Wed Apr 11 07:30:02 2007 -0600
@@ -17,7 +17,6 @@
 \usepackage{graphics}
 \usepackage{longtable}
 \usepackage{fancyhdr}
-\usepackage{multicol}
 
 \setlength\topskip{0cm}
 \setlength\topmargin{0cm}
diff -r a6800d989059 -r 3d356a2b1c75 
linux-2.6-xen-sparse/drivers/xen/core/machine_reboot.c
--- a/linux-2.6-xen-sparse/drivers/xen/core/machine_reboot.c    Wed Apr 11 
07:28:29 2007 -0600
+++ b/linux-2.6-xen-sparse/drivers/xen/core/machine_reboot.c    Wed Apr 11 
07:30:02 2007 -0600
@@ -127,8 +127,10 @@ static int take_machine_down(void *p_fas
        extern void time_resume(void);
 
        if (fast_suspend) {
-               preempt_disable();
-       } else {
+               BUG_ON(!irqs_disabled());
+       } else {
+               BUG_ON(irqs_disabled());
+
                for (;;) {
                        err = smp_suspend();
                        if (err)
@@ -143,11 +145,11 @@ static int take_machine_down(void *p_fas
                        preempt_enable();
                        xenbus_suspend_cancel();
                }
+
+               local_irq_disable();
        }
 
        mm_pin_all();
-       local_irq_disable();
-       preempt_enable();
        gnttab_suspend();
        pre_suspend();
 
@@ -178,7 +180,9 @@ static int take_machine_down(void *p_fas
 #endif
        }
        time_resume();
-       local_irq_enable();
+
+       if (!fast_suspend)
+               local_irq_enable();
 
        return suspend_cancelled;
 }
diff -r a6800d989059 -r 3d356a2b1c75 
linux-2.6-xen-sparse/drivers/xen/core/reboot.c
--- a/linux-2.6-xen-sparse/drivers/xen/core/reboot.c    Wed Apr 11 07:28:29 
2007 -0600
+++ b/linux-2.6-xen-sparse/drivers/xen/core/reboot.c    Wed Apr 11 07:30:02 
2007 -0600
@@ -34,28 +34,7 @@ static void __shutdown_handler(void *unu
 static void __shutdown_handler(void *unused);
 static DECLARE_WORK(shutdown_work, __shutdown_handler, NULL);
 
-#ifdef CONFIG_XEN
 int __xen_suspend(int fast_suspend);
-#else
-extern void xenbus_suspend(void);
-extern void xenbus_resume(void);
-extern void platform_pci_suspend(void);
-extern void platform_pci_resume(void);
-int __xen_suspend(int fast_suspend)
-{
-       xenbus_suspend();
-       platform_pci_suspend();
-
-       /* pvdrv sleep in this hyper-call when save */
-       HYPERVISOR_shutdown(SHUTDOWN_suspend);
-
-       platform_pci_resume();
-       xenbus_resume();
-       printk("PV stuff on HVM resume successfully!\n");
-
-       return 0;
-}
-#endif
 
 static int shutdown_process(void *__unused)
 {
@@ -210,13 +189,11 @@ static struct xenbus_watch shutdown_watc
 };
 
 static struct xenbus_watch sysrq_watch = {
-       .node ="control/sysrq",
+       .node = "control/sysrq",
        .callback = sysrq_handler
 };
 
-static int setup_shutdown_watcher(struct notifier_block *notifier,
-                                 unsigned long event,
-                                 void *data)
+static int setup_shutdown_watcher(void)
 {
        int err;
 
@@ -225,24 +202,36 @@ static int setup_shutdown_watcher(struct
                     "%d", &fast_suspend);
 
        err = register_xenbus_watch(&shutdown_watch);
-       if (err)
+       if (err) {
                printk(KERN_ERR "Failed to set shutdown watcher\n");
-       else
-               xenbus_write(XBT_NIL, "control", "feature-reboot", "1");
+               return err;
+       }
+       xenbus_write(XBT_NIL, "control", "feature-reboot", "1");
 
        err = register_xenbus_watch(&sysrq_watch);
-       if (err)
+       if (err) {
                printk(KERN_ERR "Failed to set sysrq watcher\n");
-       else
-               xenbus_write(XBT_NIL, "control", "feature-sysrq", "1");
-
+               return err;
+       }
+       xenbus_write(XBT_NIL, "control", "feature-sysrq", "1");
+
+       return 0;
+}
+
+#ifdef CONFIG_XEN
+
+static int shutdown_event(struct notifier_block *notifier,
+                         unsigned long event,
+                         void *data)
+{
+       setup_shutdown_watcher();
        return NOTIFY_DONE;
 }
 
 static int __init setup_shutdown_event(void)
 {
        static struct notifier_block xenstore_notifier = {
-               .notifier_call = setup_shutdown_watcher
+               .notifier_call = shutdown_event
        };
        register_xenstore_notifier(&xenstore_notifier);
 
@@ -250,3 +239,12 @@ static int __init setup_shutdown_event(v
 }
 
 subsys_initcall(setup_shutdown_event);
+
+#else /* !defined(CONFIG_XEN) */
+
+int xen_reboot_init(void)
+{
+       return setup_shutdown_watcher();
+}
+
+#endif /* !defined(CONFIG_XEN) */
diff -r a6800d989059 -r 3d356a2b1c75 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c      Wed Apr 11 
07:28:29 2007 -0600
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c      Wed Apr 11 
07:30:02 2007 -0600
@@ -394,8 +394,7 @@ static const struct file_operations xenb
        .poll = xenbus_dev_poll,
 };
 
-int __init
-xenbus_dev_init(void)
+int xenbus_dev_init(void)
 {
        xenbus_dev_intf = create_xen_proc_entry("xenbus", 0400);
        if (xenbus_dev_intf)
diff -r a6800d989059 -r 3d356a2b1c75 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c    Wed Apr 11 
07:28:29 2007 -0600
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c    Wed Apr 11 
07:30:02 2007 -0600
@@ -863,7 +863,7 @@ static int xsd_port_read(char *page, cha
 }
 #endif
 
-static int __init xenbus_probe_init(void)
+static int xenbus_probe_init(void)
 {
        int err = 0;
        unsigned long page = 0;
@@ -978,10 +978,15 @@ static int __init xenbus_probe_init(void
        return err;
 }
 
+#ifdef CONFIG_XEN
 postcore_initcall(xenbus_probe_init);
-
 MODULE_LICENSE("Dual BSD/GPL");
-
+#else
+int xenbus_init(void)
+{
+       return xenbus_probe_init();
+}
+#endif
 
 static int is_disconnected_device(struct device *dev, void *data)
 {
diff -r a6800d989059 -r 3d356a2b1c75 linux-2.6-xen-sparse/include/xen/xenbus.h
--- a/linux-2.6-xen-sparse/include/xen/xenbus.h Wed Apr 11 07:28:29 2007 -0600
+++ b/linux-2.6-xen-sparse/include/xen/xenbus.h Wed Apr 11 07:30:02 2007 -0600
@@ -293,7 +293,7 @@ void xenbus_dev_fatal(struct xenbus_devi
 void xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt,
                      ...);
 
-int __init xenbus_dev_init(void);
+int xenbus_dev_init(void);
 
 const char *xenbus_strstate(enum xenbus_state state);
 int xenbus_dev_is_online(struct xenbus_device *dev);
diff -r a6800d989059 -r 3d356a2b1c75 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c   Wed Apr 11 07:28:29 2007 -0600
+++ b/tools/libxc/xc_domain_restore.c   Wed Apr 11 07:30:02 2007 -0600
@@ -119,6 +119,7 @@ static int uncanonicalize_pagetable(int 
         {
             /* Have a 'valid' PFN without a matching MFN - need to alloc */
             p2m_batch[nr_mfns++] = pfn; 
+            p2m[pfn]--;
         }
     }
 
@@ -146,8 +147,8 @@ static int uncanonicalize_pagetable(int 
             continue;
         
         pfn = (pte >> PAGE_SHIFT) & MFN_MASK_X86;
-        
-        if ( p2m[pfn] == INVALID_P2M_ENTRY )
+
+        if ( p2m[pfn] == (INVALID_P2M_ENTRY-1) )
             p2m[pfn] = p2m_batch[nr_mfns++];
 
         pte &= ~MADDR_MASK_X86;
@@ -489,6 +490,7 @@ int xc_domain_restore(int xc_handle, int
             {
                 /* Have a live PFN which hasn't had an MFN allocated */
                 p2m_batch[nr_mfns++] = pfn; 
+                p2m[pfn]--;
             }
         } 
 
@@ -514,7 +516,7 @@ int xc_domain_restore(int xc_handle, int
                 region_mfn[i] = ~0UL; /* map will fail but we don't care */
             else 
             {
-                if ( p2m[pfn] == INVALID_P2M_ENTRY )
+                if ( p2m[pfn] == (INVALID_P2M_ENTRY-1) )
                 {
                     /* We just allocated a new mfn above; update p2m */
                     p2m[pfn] = p2m_batch[nr_mfns++]; 
diff -r a6800d989059 -r 3d356a2b1c75 tools/libxen/include/xen_host.h
--- a/tools/libxen/include/xen_host.h   Wed Apr 11 07:28:29 2007 -0600
+++ b/tools/libxen/include/xen_host.h   Wed Apr 11 07:30:02 2007 -0600
@@ -79,6 +79,8 @@ typedef struct xen_host_record
     xen_string_string_map *software_version;
     xen_string_string_map *other_config;
     struct xen_string_set *capabilities;
+    xen_string_string_map *cpu_configuration;
+    char *sched_policy;
     struct xen_string_set *supported_bootloaders;
     struct xen_vm_record_opt_set *resident_vms;
     xen_string_string_map *logging;
@@ -261,6 +263,20 @@ xen_host_get_capabilities(xen_session *s
 
 
 /**
+ * Get the cpu_configuration field of the given host.
+ */
+extern bool
+xen_host_get_cpu_configuration(xen_session *session, xen_string_string_map 
**result, xen_host host);
+
+
+/**
+ * Get the sched_policy field of the given host.
+ */
+extern bool
+xen_host_get_sched_policy(xen_session *session, char **result, xen_host host);
+
+
+/**
  * Get the supported_bootloaders field of the given host.
  */
 extern bool
@@ -414,7 +430,7 @@ xen_host_enable(xen_session *session, xe
 
 /**
  * Shutdown the host. (This function can only be called if there are no
- * currently running VMs on the host and it is disabled.)
+ * currently running VMs on the host and it is disabled.).
  */
 extern bool
 xen_host_shutdown(xen_session *session, xen_host host);
@@ -422,7 +438,7 @@ xen_host_shutdown(xen_session *session, 
 
 /**
  * Reboot the host. (This function can only be called if there are no
- * currently running VMs on the host and it is disabled.)
+ * currently running VMs on the host and it is disabled.).
  */
 extern bool
 xen_host_reboot(xen_session *session, xen_host host);
@@ -436,6 +452,27 @@ xen_host_dmesg(xen_session *session, cha
 
 
 /**
+ * Get the host xen dmesg, and clear the buffer.
+ */
+extern bool
+xen_host_dmesg_clear(xen_session *session, char **result, xen_host host);
+
+
+/**
+ * Get the host's log file.
+ */
+extern bool
+xen_host_get_log(xen_session *session, char **result, xen_host host);
+
+
+/**
+ * Inject the given string as debugging keys into Xen.
+ */
+extern bool
+xen_host_send_debug_keys(xen_session *session, xen_host host, char *keys);
+
+
+/**
  * List all supported methods.
  */
 extern bool
diff -r a6800d989059 -r 3d356a2b1c75 tools/libxen/include/xen_int_int_map.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/libxen/include/xen_int_int_map.h    Wed Apr 11 07:30:02 2007 -0600
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef XEN_INT_INT_MAP_H
+#define XEN_INT_INT_MAP_H
+
+
+#include "xen_common.h"
+
+
+typedef struct xen_int_int_map_contents
+{
+  int64_t key;
+  int64_t val;
+} xen_int_int_map_contents;
+
+
+typedef struct xen_int_int_map
+{
+    size_t size;
+    xen_int_int_map_contents contents[];
+} xen_int_int_map;
+
+/**
+ * Allocate a xen_int_int_map of the given size.
+ */
+extern xen_int_int_map *
+xen_int_int_map_alloc(size_t size);
+
+/**
+ * Free the given xen_int_int_map, and all referenced values.  The
+ * given map must have been allocated by this library.
+ */
+extern void
+xen_int_int_map_free(xen_int_int_map *map);
+
+
+#endif
diff -r a6800d989059 -r 3d356a2b1c75 tools/libxen/include/xen_internal.h
--- a/tools/libxen/include/xen_internal.h       Wed Apr 11 07:28:29 2007 -0600
+++ b/tools/libxen/include/xen_internal.h       Wed Apr 11 07:30:02 2007 -0600
@@ -86,6 +86,7 @@ extern const abstract_type abstract_type
 
 extern const abstract_type abstract_type_string_string_map;
 extern const abstract_type abstract_type_int_float_map;
+extern const abstract_type abstract_type_int_int_map;
 
 
 typedef struct abstract_value
diff -r a6800d989059 -r 3d356a2b1c75 tools/libxen/include/xen_vm.h
--- a/tools/libxen/include/xen_vm.h     Wed Apr 11 07:28:29 2007 -0600
+++ b/tools/libxen/include/xen_vm.h     Wed Apr 11 07:30:02 2007 -0600
@@ -838,6 +838,23 @@ xen_vm_set_vcpus_number_live(xen_session
 
 
 /**
+ * Send the given key as a sysrq to this VM.  The key is specified as a
+ * single character (a String of length 1).  This can only be called when the
+ * specified VM is in the Running state.
+ */
+extern bool
+xen_vm_send_sysrq(xen_session *session, xen_vm vm, char *key);
+
+
+/**
+ * Send the named trigger to this VM.  This can only be called when the
+ * specified VM is in the Running state.
+ */
+extern bool
+xen_vm_send_trigger(xen_session *session, xen_vm vm, char *trigger);
+
+
+/**
  * Return a list of all the VMs known to the system.
  */
 extern bool
diff -r a6800d989059 -r 3d356a2b1c75 tools/libxen/include/xen_vm_metrics.h
--- a/tools/libxen/include/xen_vm_metrics.h     Wed Apr 11 07:28:29 2007 -0600
+++ b/tools/libxen/include/xen_vm_metrics.h     Wed Apr 11 07:30:02 2007 -0600
@@ -21,6 +21,8 @@
 
 #include "xen_common.h"
 #include "xen_int_float_map.h"
+#include "xen_int_int_map.h"
+#include "xen_string_string_map.h"
 #include "xen_vm_metrics_decl.h"
 
 
@@ -66,6 +68,9 @@ typedef struct xen_vm_metrics_record
     int64_t memory_actual;
     int64_t vcpus_number;
     xen_int_float_map *vcpus_utilisation;
+    xen_int_int_map *vcpus_cpu;
+    xen_string_string_map *vcpus_params;
+    time_t start_time;
     time_t last_updated;
 } xen_vm_metrics_record;
 
@@ -191,6 +196,27 @@ xen_vm_metrics_get_vcpus_utilisation(xen
 
 
 /**
+ * Get the VCPUs/CPU field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_vcpus_cpu(xen_session *session, xen_int_int_map **result, 
xen_vm_metrics vm_metrics);
+
+
+/**
+ * Get the VCPUs/params field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_vcpus_params(xen_session *session, xen_string_string_map 
**result, xen_vm_metrics vm_metrics);
+
+
+/**
+ * Get the start_time field of the given VM_metrics.
+ */
+extern bool
+xen_vm_metrics_get_start_time(xen_session *session, time_t *result, 
xen_vm_metrics vm_metrics);
+
+
+/**
  * Get the last_updated field of the given VM_metrics.
  */
 extern bool
diff -r a6800d989059 -r 3d356a2b1c75 tools/libxen/src/xen_common.c
--- a/tools/libxen/src/xen_common.c     Wed Apr 11 07:28:29 2007 -0600
+++ b/tools/libxen/src/xen_common.c     Wed Apr 11 07:30:02 2007 -0600
@@ -35,6 +35,7 @@
 #include "xen_host.h"
 #include "xen_internal.h"
 #include "xen_int_float_map.h"
+#include "xen_int_int_map.h"
 #include "xen_string_string_map.h"
 
 
@@ -1697,3 +1698,21 @@ const abstract_type abstract_type_int_fl
         .struct_size = sizeof(xen_int_float_map_contents),
         .members = int_float_members
     };
+
+static struct struct_member int_int_members[] =
+{
+    {
+        .type = &abstract_type_int,
+        .offset = offsetof(xen_int_int_map_contents, key)
+    },
+    {
+        .type = &abstract_type_int,
+        .offset = offsetof(xen_int_int_map_contents, val)
+    }
+};
+const abstract_type abstract_type_int_int_map =
+    {
+        .typename = MAP,
+        .struct_size = sizeof(xen_int_int_map_contents),
+        .members = int_int_members
+    };
diff -r a6800d989059 -r 3d356a2b1c75 tools/libxen/src/xen_host.c
--- a/tools/libxen/src/xen_host.c       Wed Apr 11 07:28:29 2007 -0600
+++ b/tools/libxen/src/xen_host.c       Wed Apr 11 07:30:02 2007 -0600
@@ -73,6 +73,12 @@ static const struct_member xen_host_reco
         { .key = "capabilities",
           .type = &abstract_type_string_set,
           .offset = offsetof(xen_host_record, capabilities) },
+        { .key = "cpu_configuration",
+          .type = &abstract_type_string_string_map,
+          .offset = offsetof(xen_host_record, cpu_configuration) },
+        { .key = "sched_policy",
+          .type = &abstract_type_string,
+          .offset = offsetof(xen_host_record, sched_policy) },
         { .key = "supported_bootloaders",
           .type = &abstract_type_string_set,
           .offset = offsetof(xen_host_record, supported_bootloaders) },
@@ -128,6 +134,8 @@ xen_host_record_free(xen_host_record *re
     xen_string_string_map_free(record->software_version);
     xen_string_string_map_free(record->other_config);
     xen_string_set_free(record->capabilities);
+    xen_string_string_map_free(record->cpu_configuration);
+    free(record->sched_policy);
     xen_string_set_free(record->supported_bootloaders);
     xen_vm_record_opt_set_free(record->resident_vms);
     xen_string_string_map_free(record->logging);
@@ -350,6 +358,40 @@ xen_host_get_capabilities(xen_session *s
 
 
 bool
+xen_host_get_cpu_configuration(xen_session *session, xen_string_string_map 
**result, xen_host host)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = host }
+        };
+
+    abstract_type result_type = abstract_type_string_string_map;
+
+    *result = NULL;
+    XEN_CALL_("host.get_cpu_configuration");
+    return session->ok;
+}
+
+
+bool
+xen_host_get_sched_policy(xen_session *session, char **result, xen_host host)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = host }
+        };
+
+    abstract_type result_type = abstract_type_string;
+
+    *result = NULL;
+    XEN_CALL_("host.get_sched_policy");
+    return session->ok;
+}
+
+
+bool
 xen_host_get_supported_bootloaders(xen_session *session, struct xen_string_set 
**result, xen_host host)
 {
     abstract_value param_values[] =
@@ -740,6 +782,56 @@ xen_host_dmesg(xen_session *session, cha
 
 
 bool
+xen_host_dmesg_clear(xen_session *session, char **result, xen_host host)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = host }
+        };
+
+    abstract_type result_type = abstract_type_string;
+
+    *result = NULL;
+    XEN_CALL_("host.dmesg_clear");
+    return session->ok;
+}
+
+
+bool
+xen_host_get_log(xen_session *session, char **result, xen_host host)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = host }
+        };
+
+    abstract_type result_type = abstract_type_string;
+
+    *result = NULL;
+    XEN_CALL_("host.get_log");
+    return session->ok;
+}
+
+
+bool
+xen_host_send_debug_keys(xen_session *session, xen_host host, char *keys)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = host },
+            { .type = &abstract_type_string,
+              .u.string_val = keys }
+        };
+
+    xen_call_(session, "host.send_debug_keys", param_values, 2, NULL, NULL);
+    return session->ok;
+}
+
+
+bool
 xen_host_list_methods(xen_session *session, struct xen_string_set **result)
 {
 
diff -r a6800d989059 -r 3d356a2b1c75 tools/libxen/src/xen_int_int_map.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/libxen/src/xen_int_int_map.c        Wed Apr 11 07:30:02 2007 -0600
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2006-2007, XenSource Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+
+#include "xen_common.h"
+#include "xen_int_int_map.h"
+#include "xen_internal.h"
+
+
+xen_int_int_map *
+xen_int_int_map_alloc(size_t size)
+{
+    xen_int_int_map *result = calloc(1, sizeof(xen_int_int_map) +
+                                     size * sizeof(struct 
xen_int_int_map_contents));
+    result->size = size;
+    return result;
+}
+
+
+void
+xen_int_int_map_free(xen_int_int_map *map)
+{
+    free(map);
+}
diff -r a6800d989059 -r 3d356a2b1c75 tools/libxen/src/xen_vm.c
--- a/tools/libxen/src/xen_vm.c Wed Apr 11 07:28:29 2007 -0600
+++ b/tools/libxen/src/xen_vm.c Wed Apr 11 07:30:02 2007 -0600
@@ -1610,6 +1610,38 @@ xen_vm_set_vcpus_number_live(xen_session
 
 
 bool
+xen_vm_send_sysrq(xen_session *session, xen_vm vm, char *key)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vm },
+            { .type = &abstract_type_string,
+              .u.string_val = key }
+        };
+
+    xen_call_(session, "VM.send_sysrq", param_values, 2, NULL, NULL);
+    return session->ok;
+}
+
+
+bool
+xen_vm_send_trigger(xen_session *session, xen_vm vm, char *trigger)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vm },
+            { .type = &abstract_type_string,
+              .u.string_val = trigger }
+        };
+
+    xen_call_(session, "VM.send_trigger", param_values, 2, NULL, NULL);
+    return session->ok;
+}
+
+
+bool
 xen_vm_get_all(xen_session *session, struct xen_vm_set **result)
 {
 
diff -r a6800d989059 -r 3d356a2b1c75 tools/libxen/src/xen_vm_metrics.c
--- a/tools/libxen/src/xen_vm_metrics.c Wed Apr 11 07:28:29 2007 -0600
+++ b/tools/libxen/src/xen_vm_metrics.c Wed Apr 11 07:30:02 2007 -0600
@@ -22,7 +22,9 @@
 
 #include "xen_common.h"
 #include "xen_int_float_map.h"
+#include "xen_int_int_map.h"
 #include "xen_internal.h"
+#include "xen_string_string_map.h"
 #include "xen_vm_metrics.h"
 
 
@@ -49,6 +51,15 @@ static const struct_member xen_vm_metric
         { .key = "VCPUs_utilisation",
           .type = &abstract_type_int_float_map,
           .offset = offsetof(xen_vm_metrics_record, vcpus_utilisation) },
+        { .key = "VCPUs_CPU",
+          .type = &abstract_type_int_int_map,
+          .offset = offsetof(xen_vm_metrics_record, vcpus_cpu) },
+        { .key = "VCPUs_params",
+          .type = &abstract_type_string_string_map,
+          .offset = offsetof(xen_vm_metrics_record, vcpus_params) },
+        { .key = "start_time",
+          .type = &abstract_type_datetime,
+          .offset = offsetof(xen_vm_metrics_record, start_time) },
         { .key = "last_updated",
           .type = &abstract_type_datetime,
           .offset = offsetof(xen_vm_metrics_record, last_updated) }
@@ -74,6 +85,8 @@ xen_vm_metrics_record_free(xen_vm_metric
     free(record->handle);
     free(record->uuid);
     xen_int_float_map_free(record->vcpus_utilisation);
+    xen_int_int_map_free(record->vcpus_cpu);
+    xen_string_string_map_free(record->vcpus_params);
     free(record);
 }
 
@@ -168,6 +181,56 @@ xen_vm_metrics_get_vcpus_utilisation(xen
 
 
 bool
+xen_vm_metrics_get_vcpus_cpu(xen_session *session, xen_int_int_map **result, 
xen_vm_metrics vm_metrics)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vm_metrics }
+        };
+
+    abstract_type result_type = abstract_type_int_int_map;
+
+    *result = NULL;
+    XEN_CALL_("VM_metrics.get_VCPUs_CPU");
+    return session->ok;
+}
+
+
+bool
+xen_vm_metrics_get_vcpus_params(xen_session *session, xen_string_string_map 
**result, xen_vm_metrics vm_metrics)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vm_metrics }
+        };
+
+    abstract_type result_type = abstract_type_string_string_map;
+
+    *result = NULL;
+    XEN_CALL_("VM_metrics.get_VCPUs_params");
+    return session->ok;
+}
+
+
+bool
+xen_vm_metrics_get_start_time(xen_session *session, time_t *result, 
xen_vm_metrics vm_metrics)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vm_metrics }
+        };
+
+    abstract_type result_type = abstract_type_datetime;
+
+    XEN_CALL_("VM_metrics.get_start_time");
+    return session->ok;
+}
+
+
+bool
 xen_vm_metrics_get_last_updated(xen_session *session, time_t *result, 
xen_vm_metrics vm_metrics)
 {
     abstract_value param_values[] =
diff -r a6800d989059 -r 3d356a2b1c75 tools/libxen/test/test_bindings.c
--- a/tools/libxen/test/test_bindings.c Wed Apr 11 07:28:29 2007 -0600
+++ b/tools/libxen/test/test_bindings.c Wed Apr 11 07:30:02 2007 -0600
@@ -285,6 +285,40 @@ int main(int argc, char **argv)
         return 1;
     }
 
+    xen_string_string_map *cpu_configuration;
+    if (!xen_host_get_cpu_configuration(session, &cpu_configuration, host))
+    {
+        print_error(session);
+        free(dmesg);
+        xen_string_set_free(capabilities);
+        xen_string_set_free(supported_bootloaders);
+        xen_string_string_map_free(versions);
+        xen_host_free(host);
+        xen_vm_record_free(vm_record);
+        xen_uuid_bytes_free(vm_uuid_bytes);
+        xen_uuid_free(vm_uuid);
+        xen_vm_free(vm);
+        CLEANUP;
+        return 1;
+    }
+
+    char *sched_policy;
+    if (!xen_host_get_sched_policy(session, &sched_policy, host))
+    {
+        print_error(session);
+        xen_string_string_map_free(cpu_configuration);
+        xen_string_set_free(capabilities);
+        xen_string_set_free(supported_bootloaders);
+        xen_string_string_map_free(versions);
+        xen_host_free(host);
+        xen_vm_record_free(vm_record);
+        xen_uuid_bytes_free(vm_uuid_bytes);
+        xen_uuid_free(vm_uuid);
+        xen_vm_free(vm);
+        CLEANUP;
+        return 1;
+    }
+
     printf("%s.\n", vm_uuid);
 
     printf("In bytes, the VM UUID is ");
@@ -317,6 +351,15 @@ int main(int argc, char **argv)
         printf(" %s", capabilities->contents[i]);
     }
     printf("\n");
+
+    printf("Host has the following CPU configuration:\n");
+    for (size_t i = 0; i < cpu_configuration->size; i++)
+    {
+        printf("  %s -> %s.\n", cpu_configuration->contents[i].key,
+               cpu_configuration->contents[i].val);
+    }
+
+    printf("Current scheduler policy: %s.\n\n", sched_policy);
 
     printf("%s.\n", vm_record->uuid);
 
@@ -334,6 +377,8 @@ int main(int argc, char **argv)
     free(dmesg);
     xen_string_set_free(supported_bootloaders);
     xen_string_set_free(capabilities);
+    xen_string_string_map_free(cpu_configuration);
+    free(sched_policy);
 
     print_vm_metrics(session, vm);
     if (!session->ok)
@@ -712,6 +757,10 @@ static void print_vm_metrics(xen_session
     my_strftime(time, 256, "Metrics updated at %c, local time.\n", tm);
     printf(time);
 
+    tm = localtime(&vm_metrics_record->start_time);
+    my_strftime(time, 256, "VM running since %c, local time.\n", tm);
+    printf(time);
+
     for (size_t i = 0; i < vm_metrics_record->vcpus_utilisation->size; i++)
     {
         printf("%"PRId64" -> %lf.\n",
@@ -719,6 +768,22 @@ static void print_vm_metrics(xen_session
                vm_metrics_record->vcpus_utilisation->contents[i].val);
     }
 
+    printf("VCPU -> PCPU mapping:\n");
+    for (size_t i = 0; i < vm_metrics_record->vcpus_cpu->size; i++)
+    {
+        printf("  %"PRId64" -> %"PRId64".\n",
+               vm_metrics_record->vcpus_cpu->contents[i].key,
+               vm_metrics_record->vcpus_cpu->contents[i].val);
+    }
+
+    printf("Live scheduling parameters:\n");
+    for (size_t i = 0; i < vm_metrics_record->vcpus_params->size; i++)
+    {
+        printf("  %s -> %s.\n",
+               vm_metrics_record->vcpus_params->contents[i].key,
+               vm_metrics_record->vcpus_params->contents[i].val);
+    }
+
     xen_vm_metrics_record_free(vm_metrics_record);
     xen_vm_metrics_free(vm_metrics);
 
diff -r a6800d989059 -r 3d356a2b1c75 tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py  Wed Apr 11 07:28:29 2007 -0600
+++ b/tools/python/xen/xend/XendAPI.py  Wed Apr 11 07:30:02 2007 -0600
@@ -87,7 +87,16 @@ def xen_api_todo():
 
 
 def now():
-    return xmlrpclib.DateTime(time.strftime("%Y%m%dT%H:%M:%S", time.gmtime()))
+    return datetime()
+
+
+def datetime(when = None):
+    """Marshall the given time as a Xen-API DateTime.
+
+    @param when The time in question, given as seconds since the epoch, UTC.
+                May be None, in which case the current time is used.
+    """
+    return xmlrpclib.DateTime(time.gmtime(when))
 
 
 # ---------------------------------------------------
@@ -860,13 +869,13 @@ class XendAPI(object):
                     'metrics',
                     'capabilities',
                     'supported_bootloaders',
+                    'sched_policy',
                     'API_version_major',
                     'API_version_minor',
                     'API_version_vendor',
                     'API_version_vendor_implementation']
     
     host_attr_rw = ['name_label',
-                    'sched_policy',
                     'name_description',
                     'other_config']
 
diff -r a6800d989059 -r 3d356a2b1c75 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Wed Apr 11 07:28:29 2007 -0600
+++ b/tools/python/xen/xend/XendDomainInfo.py   Wed Apr 11 07:30:02 2007 -0600
@@ -430,6 +430,7 @@ class XendDomainInfo:
                 self._endRestore()
             except:
                 log.exception('VM resume failed')
+                self.destroy()
                 raise
         else:
             raise XendError('VM already running')
diff -r a6800d989059 -r 3d356a2b1c75 tools/python/xen/xend/XendVMMetrics.py
--- a/tools/python/xen/xend/XendVMMetrics.py    Wed Apr 11 07:28:29 2007 -0600
+++ b/tools/python/xen/xend/XendVMMetrics.py    Wed Apr 11 07:30:02 2007 -0600
@@ -138,7 +138,9 @@ class XendVMMetrics:
             return {}
 
     def get_start_time(self):
-        return self.xend_domain_instance.info.get("start_time", -1)
+        import xen.xend.XendAPI as XendAPI
+        return XendAPI.datetime(
+            self.xend_domain_instance.info.get("start_time", 0))
     
     def get_last_updated(self):
         import xen.xend.XendAPI as XendAPI
diff -r a6800d989059 -r 3d356a2b1c75 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Wed Apr 11 07:28:29 2007 -0600
+++ b/tools/python/xen/xm/main.py       Wed Apr 11 07:30:02 2007 -0600
@@ -731,6 +731,12 @@ def xm_restore(args):
         server.xend.domain.restore(savefile, paused)
 
 
+def datetime_to_secs(v):
+    unwanted = ":-."
+    for c in unwanted:
+        v = str(v).replace(c, "")
+    return time.mktime(time.strptime(v[0:14], '%Y%m%dT%H%M%S'))
+
 def getDomains(domain_names, state, full = 0):
     if serverType == SERVER_XEN_API:
         doms_sxp = []
@@ -756,7 +762,8 @@ def getDomains(domain_names, state, full
                             'vcpus':    dom_metrics['VCPUs_number'],
                             'state':    state_str,
                             'cpu_time': dom_metrics['VCPUs_utilisation'],
-                            'start_time': dom_metrics['start_time']})
+                            'start_time': datetime_to_secs(
+                                              dom_metrics['start_time'])})
 
             doms_sxp.append(['domain'] + map2sxp(dom_rec))
             doms_dict.append(dom_rec)
diff -r a6800d989059 -r 3d356a2b1c75 unmodified_drivers/linux-2.6/Makefile
--- a/unmodified_drivers/linux-2.6/Makefile     Wed Apr 11 07:28:29 2007 -0600
+++ b/unmodified_drivers/linux-2.6/Makefile     Wed Apr 11 07:30:02 2007 -0600
@@ -1,8 +1,6 @@ include $(M)/overrides.mk
 include $(M)/overrides.mk
 
 obj-m += platform-pci/
-obj-m += xenbus/
 obj-m += balloon/
 obj-m += blkfront/
 obj-m += netfront/
-obj-m += util/
diff -r a6800d989059 -r 3d356a2b1c75 unmodified_drivers/linux-2.6/mkbuildtree
--- a/unmodified_drivers/linux-2.6/mkbuildtree  Wed Apr 11 07:28:29 2007 -0600
+++ b/unmodified_drivers/linux-2.6/mkbuildtree  Wed Apr 11 07:30:02 2007 -0600
@@ -25,7 +25,7 @@ ln -sf ${XL}/drivers/xen/core/gnttab.c p
 ln -sf ${XL}/drivers/xen/core/gnttab.c platform-pci
 ln -sf ${XL}/drivers/xen/core/features.c platform-pci
 ln -sf ${XL}/drivers/xen/core/xen_proc.c xenbus
-ln -sf ${XL}/drivers/xen/core/reboot.c util
+ln -sf ${XL}/drivers/xen/core/reboot.c platform-pci
 
 mkdir -p include/asm include/xen
 
diff -r a6800d989059 -r 3d356a2b1c75 
unmodified_drivers/linux-2.6/platform-pci/Kbuild
--- a/unmodified_drivers/linux-2.6/platform-pci/Kbuild  Wed Apr 11 07:28:29 
2007 -0600
+++ b/unmodified_drivers/linux-2.6/platform-pci/Kbuild  Wed Apr 11 07:30:02 
2007 -0600
@@ -4,7 +4,16 @@ obj-m := xen-platform-pci.o
 
 EXTRA_CFLAGS += -I$(M)/platform-pci
 
-xen-platform-pci-objs := evtchn.o platform-pci.o gnttab.o xen_support.o 
features.o platform-compat.o
+xen-platform-pci-objs := evtchn.o platform-pci.o gnttab.o xen_support.o
+xen-platform-pci-objs += features.o platform-compat.o
+xen-platform-pci-objs += reboot.o machine_reboot.o
+
+xen-platform-pci-objs += ../xenbus/xenbus_comms.o
+xen-platform-pci-objs += ../xenbus/xenbus_xs.o
+xen-platform-pci-objs += ../xenbus/xenbus_probe.o 
+xen-platform-pci-objs += ../xenbus/xenbus_dev.o 
+xen-platform-pci-objs += ../xenbus/xenbus_client.o 
+xen-platform-pci-objs += ../xenbus/xen_proc.o
 
 # Can we do better ?
 ifeq ($(ARCH),ia64)
diff -r a6800d989059 -r 3d356a2b1c75 
unmodified_drivers/linux-2.6/platform-pci/evtchn.c
--- a/unmodified_drivers/linux-2.6/platform-pci/evtchn.c        Wed Apr 11 
07:28:29 2007 -0600
+++ b/unmodified_drivers/linux-2.6/platform-pci/evtchn.c        Wed Apr 11 
07:30:02 2007 -0600
@@ -41,16 +41,42 @@
 
 void *shared_info_area;
 
-#define MAX_EVTCHN 256
+static DEFINE_MUTEX(irq_evtchn_mutex);
+
+#define is_valid_evtchn(x)     ((x) != 0)
+#define evtchn_from_irq(x)     (irq_evtchn[irq].evtchn)
+
 static struct {
        irqreturn_t(*handler) (int, void *, struct pt_regs *);
        void *dev_id;
-       int close; /* close on unbind_from_irqhandler()? */
-} evtchns[MAX_EVTCHN];
+       int evtchn;
+       int close:1; /* close on unbind_from_irqhandler()? */
+       int inuse:1;
+} irq_evtchn[256];
+static int evtchn_to_irq[NR_EVENT_CHANNELS] = {
+       [0 ...  NR_EVENT_CHANNELS-1] = -1 };
+
+static int find_unbound_irq(void)
+{
+       static int warned;
+       int irq;
+
+       for (irq = 0; irq < ARRAY_SIZE(irq_evtchn); irq++)
+               if (!irq_evtchn[irq].inuse)
+                       return irq;
+
+       if (!warned) {
+               warned = 1;
+               printk(KERN_WARNING "No available IRQ to bind to: "
+                      "increase irq_evtchn[] size in evtchn.c.\n");
+       }
+
+       return -ENOSPC;
+}
 
 int irq_to_evtchn_port(int irq)
 {
-       return irq;
+       return irq_evtchn[irq].evtchn;
 }
 EXPORT_SYMBOL(irq_to_evtchn_port);
 
@@ -107,21 +133,37 @@ int bind_listening_port_to_irqhandler(
        void *dev_id)
 {
        struct evtchn_alloc_unbound alloc_unbound;
-       int err;
+       int err, irq;
+
+       mutex_lock(&irq_evtchn_mutex);
+
+       irq = find_unbound_irq();
+       if (irq < 0) {
+               mutex_unlock(&irq_evtchn_mutex);
+               return irq;
+       }
 
        alloc_unbound.dom        = DOMID_SELF;
        alloc_unbound.remote_dom = remote_domain;
-
        err = HYPERVISOR_event_channel_op(EVTCHNOP_alloc_unbound,
                                          &alloc_unbound);
-       if (err)
+       if (err) {
+               mutex_unlock(&irq_evtchn_mutex);
                return err;
-
-       evtchns[alloc_unbound.port].handler = handler;
-       evtchns[alloc_unbound.port].dev_id  = dev_id;
-       evtchns[alloc_unbound.port].close   = 1;
+       }
+
+       irq_evtchn[irq].handler = handler;
+       irq_evtchn[irq].dev_id  = dev_id;
+       irq_evtchn[irq].evtchn  = alloc_unbound.port;
+       irq_evtchn[irq].close   = 1;
+       irq_evtchn[irq].inuse   = 1;
+
+       evtchn_to_irq[alloc_unbound.port] = irq;
+
        unmask_evtchn(alloc_unbound.port);
-       return alloc_unbound.port;
+
+       mutex_unlock(&irq_evtchn_mutex);
+       return irq;
 }
 EXPORT_SYMBOL(bind_listening_port_to_irqhandler);
 
@@ -132,35 +174,59 @@ int bind_caller_port_to_irqhandler(
        const char *devname,
        void *dev_id)
 {
-       if (caller_port >= MAX_EVTCHN)
-               return -EINVAL;
-       evtchns[caller_port].handler = handler;
-       evtchns[caller_port].dev_id  = dev_id;
-       evtchns[caller_port].close   = 0;
+       int irq;
+
+       mutex_lock(&irq_evtchn_mutex);
+
+       irq = find_unbound_irq();
+       if (irq < 0) {
+               mutex_unlock(&irq_evtchn_mutex);
+               return irq;
+       }
+
+       irq_evtchn[irq].handler = handler;
+       irq_evtchn[irq].dev_id  = dev_id;
+       irq_evtchn[irq].evtchn  = caller_port;
+       irq_evtchn[irq].close   = 0;
+       irq_evtchn[irq].inuse   = 1;
+
+       evtchn_to_irq[caller_port] = irq;
+
        unmask_evtchn(caller_port);
-       return caller_port;
+
+       mutex_unlock(&irq_evtchn_mutex);
+       return irq;
 }
 EXPORT_SYMBOL(bind_caller_port_to_irqhandler);
 
-void unbind_from_irqhandler(unsigned int evtchn, void *dev_id)
-{
-       if (evtchn >= MAX_EVTCHN)
-               return;
-
-       mask_evtchn(evtchn);
-       evtchns[evtchn].handler = NULL;
-
-       if (evtchns[evtchn].close) {
-               struct evtchn_close close = { .port = evtchn };
-               HYPERVISOR_event_channel_op(EVTCHNOP_close, &close);
-       }
+void unbind_from_irqhandler(unsigned int irq, void *dev_id)
+{
+       int evtchn = evtchn_from_irq(irq);
+
+       mutex_lock(&irq_evtchn_mutex);
+
+       if (is_valid_evtchn(evtchn)) {
+               evtchn_to_irq[irq] = -1;
+               mask_evtchn(evtchn);
+               if (irq_evtchn[irq].close) {
+                       struct evtchn_close close = { .port = evtchn };
+                       HYPERVISOR_event_channel_op(EVTCHNOP_close, &close);
+               }
+       }
+
+       irq_evtchn[irq].handler = NULL;
+       irq_evtchn[irq].evtchn  = 0;
+       irq_evtchn[irq].inuse   = 0;
+
+       mutex_unlock(&irq_evtchn_mutex);
 }
 EXPORT_SYMBOL(unbind_from_irqhandler);
 
 void notify_remote_via_irq(int irq)
 {
-       int evtchn = irq;
-       notify_remote_via_evtchn(evtchn);
+       int evtchn = evtchn_from_irq(irq);
+       if (is_valid_evtchn(evtchn))
+               notify_remote_via_evtchn(evtchn);
 }
 EXPORT_SYMBOL(notify_remote_via_irq);
 
@@ -183,9 +249,10 @@ irqreturn_t evtchn_interrupt(int irq, vo
                while ((l2 = s->evtchn_pending[l1i] & ~s->evtchn_mask[l1i])) {
                        port = (l1i * BITS_PER_LONG) + __ffs(l2);
                        synch_clear_bit(port, &s->evtchn_pending[0]);
-                       if ((handler = evtchns[port].handler) != NULL)
-                               handler(port, evtchns[port].dev_id,
-                                       regs);
+                       irq = evtchn_to_irq[port];
+                       if ((irq >= 0) &&
+                           ((handler = irq_evtchn[irq].handler) != NULL))
+                               handler(irq, irq_evtchn[irq].dev_id, regs);
                        else
                                printk(KERN_WARNING "unexpected event channel "
                                       "upcall on port %d!\n", port);
@@ -200,3 +267,28 @@ void force_evtchn_callback(void)
        (void)HYPERVISOR_xen_version(0, NULL);
 }
 EXPORT_SYMBOL(force_evtchn_callback);
+
+void irq_suspend(void)
+{
+       mutex_lock(&irq_evtchn_mutex);
+}
+
+void irq_suspend_cancel(void)
+{
+       mutex_unlock(&irq_evtchn_mutex);
+}
+
+void irq_resume(void)
+{
+       int evtchn, irq;
+
+       for (evtchn = 0; evtchn < NR_EVENT_CHANNELS; evtchn++) {
+               mask_evtchn(evtchn);
+               evtchn_to_irq[evtchn] = -1;
+       }
+
+       for (irq = 0; irq < ARRAY_SIZE(irq_evtchn); irq++)
+               irq_evtchn[irq].evtchn = 0;
+
+       mutex_unlock(&irq_evtchn_mutex);
+}
diff -r a6800d989059 -r 3d356a2b1c75 
unmodified_drivers/linux-2.6/platform-pci/machine_reboot.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/unmodified_drivers/linux-2.6/platform-pci/machine_reboot.c        Wed Apr 
11 07:30:02 2007 -0600
@@ -0,0 +1,24 @@
+#include <linux/config.h>
+#include <xen/xenbus.h>
+#include "platform-pci.h"
+#include <asm/hypervisor.h>
+
+int __xen_suspend(int fast_suspend)
+{
+       int suspend_cancelled;
+
+       xenbus_suspend();
+       platform_pci_suspend();
+
+       suspend_cancelled = HYPERVISOR_shutdown(SHUTDOWN_suspend);
+
+       if (suspend_cancelled) {
+               platform_pci_suspend_cancel();
+               xenbus_suspend_cancel();
+       } else {
+               platform_pci_resume();
+               xenbus_resume();
+       }
+
+       return 0;
+}
diff -r a6800d989059 -r 3d356a2b1c75 
unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c  Wed Apr 11 
07:28:29 2007 -0600
+++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c  Wed Apr 11 
07:30:02 2007 -0600
@@ -1,7 +1,9 @@
 /******************************************************************************
  * platform-pci.c
+ * 
  * Xen platform PCI device driver
- * Copyright (C) 2005, Intel Corporation.
+ * Copyright (c) 2005, Intel Corporation.
+ * Copyright (c) 2007, XenSource Inc.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
@@ -35,7 +37,9 @@
 #include <asm/hypervisor.h>
 #include <asm/pgtable.h>
 #include <xen/interface/memory.h>
+#include <xen/interface/hvm/params.h>
 #include <xen/features.h>
+#include <xen/evtchn.h>
 #include <xen/gnttab.h>
 #ifdef __ia64__
 #include <asm/xen/xencomm.h>
@@ -54,13 +58,9 @@ char *hypercall_stubs;
 char *hypercall_stubs;
 EXPORT_SYMBOL(hypercall_stubs);
 
-// Used to be xiaofeng.ling@xxxxxxxxx
 MODULE_AUTHOR("ssmith@xxxxxxxxxxxxx");
 MODULE_DESCRIPTION("Xen platform PCI device");
 MODULE_LICENSE("GPL");
-
-unsigned long *phys_to_machine_mapping;
-EXPORT_SYMBOL(phys_to_machine_mapping);
 
 static unsigned long shared_info_frame;
 static uint64_t callback_via;
@@ -89,28 +89,9 @@ static int __devinit init_xen_info(void)
        if (shared_info_area == NULL)
                panic("can't map shared info\n");
 
-       phys_to_machine_mapping = NULL;
-
        gnttab_init();
 
        return 0;
-}
-
-static void __devexit platform_pci_remove(struct pci_dev *pdev)
-{
-       long ioaddr, iolen;
-       long mmio_addr, mmio_len;
-
-       ioaddr = pci_resource_start(pdev, 0);
-       iolen = pci_resource_len(pdev, 0);
-       mmio_addr = pci_resource_start(pdev, 1);
-       mmio_len = pci_resource_len(pdev, 1);
-
-       release_region(ioaddr, iolen);
-       release_mem_region(mmio_addr, mmio_len);
-
-       pci_set_drvdata(pdev, NULL);
-       free_irq(pdev->irq, pdev);
 }
 
 static unsigned long platform_mmio;
@@ -208,6 +189,19 @@ static uint64_t get_callback_via(struct 
                ((uint64_t)(pin - 1) & 3));
 }
 
+static int set_callback_via(uint64_t via)
+{
+       struct xen_hvm_param a;
+
+       a.domid = DOMID_SELF;
+       a.index = HVM_PARAM_CALLBACK_IRQ;
+       a.value = via;
+       return HYPERVISOR_hvm_op(HVMOP_set_param, &a);
+}
+
+int xenbus_init(void);
+int xen_reboot_init(void);
+
 static int __devinit platform_pci_init(struct pci_dev *pdev,
                                       const struct pci_device_id *ent)
 {
@@ -232,15 +226,13 @@ static int __devinit platform_pci_init(s
                return -ENOENT;
        }
 
-       if (request_mem_region(mmio_addr, mmio_len, DRV_NAME) == NULL)
-       {
+       if (request_mem_region(mmio_addr, mmio_len, DRV_NAME) == NULL) {
                printk(KERN_ERR ":MEM I/O resource 0x%lx @ 0x%lx busy\n",
                       mmio_addr, mmio_len);
                return -EBUSY;
        }
 
-       if (request_region(ioaddr, iolen, DRV_NAME) == NULL)
-       {
+       if (request_region(ioaddr, iolen, DRV_NAME) == NULL) {
                printk(KERN_ERR DRV_NAME ":I/O resource 0x%lx @ 0x%lx busy\n",
                       iolen, ioaddr);
                release_mem_region(mmio_addr, mmio_len);
@@ -263,6 +255,12 @@ static int __devinit platform_pci_init(s
                goto out;
 
        if ((ret = set_callback_via(callback_via)))
+               goto out;
+
+       if ((ret = xenbus_init()))
+               goto out;
+
+       if ((ret = xen_reboot_init()))
                goto out;
 
  out:
@@ -289,7 +287,6 @@ static struct pci_driver platform_driver
 static struct pci_driver platform_driver = {
        name:     DRV_NAME,
        probe:    platform_pci_init,
-       remove:   __devexit_p(platform_pci_remove),
        id_table: platform_pci_tbl,
 };
 
@@ -298,13 +295,18 @@ void platform_pci_suspend(void)
 void platform_pci_suspend(void)
 {
        gnttab_suspend();
-}
-EXPORT_SYMBOL_GPL(platform_pci_suspend);
+       irq_suspend();
+}
+
+void platform_pci_suspend_cancel(void)
+{
+       irq_suspend_cancel();
+       gnttab_resume();
+}
 
 void platform_pci_resume(void)
 {
        struct xen_add_to_physmap xatp;
-       phys_to_machine_mapping = NULL;
 
        /* do 2 things for PV driver restore on HVM
         * 1: rebuild share info
@@ -317,34 +319,27 @@ void platform_pci_resume(void)
        if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp))
                BUG();
 
-       if (( set_callback_via(callback_via)))
+       irq_resume();
+
+       if (set_callback_via(callback_via))
                printk("platform_pci_resume failure!\n");
 
        gnttab_resume();
 }
-EXPORT_SYMBOL_GPL(platform_pci_resume);
 
 static int __init platform_pci_module_init(void)
 {
        int rc;
 
        rc = pci_module_init(&platform_driver);
-       if (rc)
-               printk(KERN_INFO DRV_NAME ":No platform pci device model 
found\n");
-       else
-               pci_device_registered = 1;
-
-       return rc;
-}
-
-static void __exit platform_pci_module_cleanup(void)
-{
-       printk(KERN_INFO DRV_NAME ":Do platform module cleanup\n");
-       /* disable hypervisor for callback irq */
-       set_callback_via(0);
-       if (pci_device_registered)
-               pci_unregister_driver(&platform_driver);
+       if (rc) {
+               printk(KERN_INFO DRV_NAME
+                      ": No platform pci device model found\n");
+               return rc;
+       }
+
+       pci_device_registered = 1;
+       return 0;
 }
 
 module_init(platform_pci_module_init);
-module_exit(platform_pci_module_cleanup);
diff -r a6800d989059 -r 3d356a2b1c75 
unmodified_drivers/linux-2.6/platform-pci/platform-pci.h
--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.h  Wed Apr 11 
07:28:29 2007 -0600
+++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.h  Wed Apr 11 
07:30:02 2007 -0600
@@ -1,7 +1,9 @@
 /******************************************************************************
- * evtchn-pci.h
- * module driver support in unmodified Linux
- * Copyright (C) 2004, Intel Corporation. <xiaofeng.ling@xxxxxxxxx>
+ * platform-pci.h
+ * 
+ * Xen platform PCI device driver
+ * Copyright (c) 2004, Intel Corporation. <xiaofeng.ling@xxxxxxxxx>
+ * Copyright (c) 2007, XenSource Inc.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
@@ -15,31 +17,21 @@
  * 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., 59 Temple
  * Place - Suite 330, Boston, MA 02111-1307 USA.
- *
  */
 
-#ifndef __XEN_SUPPORT_H
-#define __XEN_SUPPORT_H
-#include <linux/version.h>
+#ifndef _XEN_PLATFORM_PCI_H
+#define _XEN_PLATFORM_PCI_H
+
 #include <linux/interrupt.h>
-#include <xen/interface/hvm/params.h>
-
-static inline int set_callback_via(uint64_t via)
-{
-       struct xen_hvm_param a;
-
-       a.domid = DOMID_SELF;
-       a.index = HVM_PARAM_CALLBACK_IRQ;
-       a.value = via;
-       return HYPERVISOR_hvm_op(HVMOP_set_param, &a);
-}
 
 unsigned long alloc_xen_mmio(unsigned long len);
+int gnttab_init(void);
+irqreturn_t evtchn_interrupt(int irq, void *dev_id, struct pt_regs *regs);
+void irq_suspend(void);
+void irq_suspend_cancel(void);
 
-int gnttab_init(void);
+void platform_pci_suspend(void);
+void platform_pci_suspend_cancel(void);
+void platform_pci_resume(void);
 
-void setup_xen_features(void);
-
-irqreturn_t evtchn_interrupt(int irq, void *dev_id, struct pt_regs *regs);
-
-#endif
+#endif /* _XEN_PLATFORM_PCI_H */
diff -r a6800d989059 -r 3d356a2b1c75 unmodified_drivers/linux-2.6/util/Kbuild
--- a/unmodified_drivers/linux-2.6/util/Kbuild  Wed Apr 11 07:28:29 2007 -0600
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-include $(M)/overrides.mk
-
-obj-m := reboot.o
diff -r a6800d989059 -r 3d356a2b1c75 unmodified_drivers/linux-2.6/util/Makefile
--- a/unmodified_drivers/linux-2.6/util/Makefile        Wed Apr 11 07:28:29 
2007 -0600
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-ifneq ($(KERNELRELEASE),)
-include $(src)/Kbuild
-endif
diff -r a6800d989059 -r 3d356a2b1c75 unmodified_drivers/linux-2.6/xenbus/Kbuild
--- a/unmodified_drivers/linux-2.6/xenbus/Kbuild        Wed Apr 11 07:28:29 
2007 -0600
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-include $(M)/overrides.mk
-
-obj-m  += xenbus.o
-xenbus-objs =
-xenbus-objs += xenbus_comms.o
-xenbus-objs += xenbus_xs.o
-xenbus-objs += xenbus_probe.o 
-xenbus-objs += xenbus_dev.o 
-xenbus-objs += xenbus_client.o 
-xenbus-objs += xen_proc.o
diff -r a6800d989059 -r 3d356a2b1c75 
unmodified_drivers/linux-2.6/xenbus/Makefile
--- a/unmodified_drivers/linux-2.6/xenbus/Makefile      Wed Apr 11 07:28:29 
2007 -0600
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-ifneq ($(KERNELRELEASE),)
-include $(src)/Kbuild
-endif
diff -r a6800d989059 -r 3d356a2b1c75 xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c Wed Apr 11 07:28:29 2007 -0600
+++ b/xen/arch/x86/mm/hap/hap.c Wed Apr 11 07:30:02 2007 -0600
@@ -443,6 +443,7 @@ void hap_final_teardown(struct domain *d
         hap_teardown(d);
 
     p2m_teardown(d);
+    ASSERT( d->arch.paging.hap.p2m_pages == 0 );
 }
 
 void hap_teardown(struct domain *d)
@@ -635,12 +636,60 @@ void hap_update_paging_modes(struct vcpu
     hap_unlock(d);
 }
 
+#if CONFIG_PAGING_LEVELS == 3
+static void p2m_install_entry_in_monitors(struct domain *d, l3_pgentry_t *l3e) 
+/* Special case, only used for external-mode domains on PAE hosts:
+ * update the mapping of the p2m table.  Once again, this is trivial in
+ * other paging modes (one top-level entry points to the top-level p2m,
+ * no maintenance needed), but PAE makes life difficult by needing a
+ * copy l3es of the p2m table in eight l2h slots in the monitor table.  This 
+ * function makes fresh copies when a p2m l3e changes. */
+{
+    l2_pgentry_t *ml2e;
+    struct vcpu *v;
+    unsigned int index;
+    
+    index = ((unsigned long)l3e & ~PAGE_MASK) / sizeof(l3_pgentry_t);
+    ASSERT(index < MACHPHYS_MBYTES>>1);
+    
+    for_each_vcpu(d, v) {
+       if ( pagetable_get_pfn(v->arch.monitor_table) == 0 ) 
+           continue;
+
+       ASSERT(paging_mode_external(v->domain));
+
+        if ( v == current ) /* OK to use linear map of monitor_table */
+           ml2e = __linear_l2_table + l2_linear_offset(RO_MPT_VIRT_START);
+        else {
+           l3_pgentry_t *ml3e;
+            ml3e = 
hap_map_domain_page(pagetable_get_mfn(v->arch.monitor_table));
+           ASSERT(l3e_get_flags(ml3e[3]) & _PAGE_PRESENT);
+            ml2e = hap_map_domain_page(_mfn(l3e_get_pfn(ml3e[3])));
+            ml2e += l2_table_offset(RO_MPT_VIRT_START);
+           hap_unmap_domain_page(ml3e);
+        }
+       ml2e[index] = l2e_from_pfn(l3e_get_pfn(*l3e), __PAGE_HYPERVISOR);
+        if ( v != current )
+            hap_unmap_domain_page(ml2e);
+    }
+}
+#endif
+
 void 
 hap_write_p2m_entry(struct vcpu *v, unsigned long gfn, l1_pgentry_t *p,
                     l1_pgentry_t new, unsigned int level)
 {
     hap_lock(v->domain);
     safe_write_pte(p, new);
+#if CONFIG_PAGING_LEVELS == 3
+    /* install P2M in monitor table for PAE Xen */
+    if ( level == 3 ) {
+       /* We have written to the p2m l3: need to sync the per-vcpu
+         * copies of it in the monitor tables */
+       p2m_install_entry_in_monitors(v->domain, (l3_pgentry_t *)p);
+       
+    }
+#endif
     hap_unlock(v->domain);
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.