eba16022d3
Goal: save/restore support in NetBSD domUs, for i386, i386 PAE and amd64. Executive summary: - split all Xen drivers (xenbus(4), grant tables, xbd(4), xennet(4)) in two parts: suspend and resume, and hook them to pmf(9). - modify pmap so that Xen hypervisor does not cry out loud in case it finds "unexpected" recursive memory mappings - provide a sysctl(7), machdep.xen.suspend, to command suspend from userland via powerd(8). Note: a suspend can only be handled correctly when dom0 requested it, so provide a mechanism that will prevent kernel to blindly validate user's commands The code is still in experimental state, use at your own risk: restore can corrupt backend communications rings; this can completely thrash dom0 as it will loop at a high interrupt level trying to honor all domU requests. XXX PAE suspend does not work in amd64 currently, due to (yet again!) page validation issues with hypervisor. Will fix. XXX secondary CPUs are not suspended, I will write the handlers in sync with cherry's Xen MP work. Tested under i386 and amd64, bear in mind ring corruption though. No build break expected, GENERICs and XEN* kernels should be fine. ./build.sh distribution still running. In any case: sorry if it does break for you, contact me directly for reports.
56 lines
1.9 KiB
C
56 lines
1.9 KiB
C
/* $NetBSD: xenbus_comms.h,v 1.6 2011/09/20 00:12:25 jym Exp $ */
|
|
/*
|
|
* Private include for xenbus communications.
|
|
*
|
|
* Copyright (C) 2005 Rusty Russell, IBM Corporation
|
|
*
|
|
* This file may be distributed separately from the Linux kernel, or
|
|
* incorporated into other software packages, subject to the following license:
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
* of this source file (the "Software"), to deal in the Software without
|
|
* restriction, including without limitation the rights to use, copy, modify,
|
|
* merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
|
* and to permit persons to whom the Software is furnished to do so, subject to
|
|
* the following conditions:
|
|
*
|
|
* The above copyright notice and this permission notice shall be included in
|
|
* all copies or substantial portions of the Software.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
* IN THE SOFTWARE.
|
|
*/
|
|
|
|
#ifndef _XENBUS_COMMS_H
|
|
#define _XENBUS_COMMS_H
|
|
|
|
void xenbus_kernfs_init(void);
|
|
int xs_init(device_t dev);
|
|
int xb_init_comms(device_t dev);
|
|
void xb_suspend_comms(device_t dev);
|
|
void xb_resume_comms(device_t dev);
|
|
|
|
/* Low level routines. */
|
|
int xb_write(const void *data, unsigned len);
|
|
int xb_read(void *data, unsigned len);
|
|
int xs_input_avail(void);
|
|
|
|
extern struct xenstore_domain_interface *xenstore_interface;
|
|
|
|
#endif /* _XENBUS_COMMS_H */
|
|
|
|
/*
|
|
* Local variables:
|
|
* c-file-style: "linux"
|
|
* indent-tabs-mode: t
|
|
* c-indent-level: 8
|
|
* c-basic-offset: 8
|
|
* tab-width: 8
|
|
* End:
|
|
*/
|