Commit Graph

43 Commits

Author SHA1 Message Date
cegger
962766853c ansify function definitions 2009-03-16 05:59:21 +00:00
jym
f0ba6e4c1b Replace x86 memory fences in Xen drivers by their Xen equivalents, to reduce
MD dependency:

x86_lfence() => xen_rmb()
x86_sfence() => xen_wmb()
x86_mfence() => xen_mb()

Discussed in
http://mail-index.netbsd.org/port-xen/2009/01/15/msg004655.html

Ok by bouyer@.
2009-01-16 20:16:47 +00:00
jym
ae69d2f013 Do not probe for console when configuring xenbus devices, as it is
attached earlier during boot, when initializing hypervisor.

This avoids the "unknown type console at xenbus0 id 0 not configured"
autoconf(9) messages, which are misleading during domU's boot.

See also http://mail-index.netbsd.org/port-xen/2009/01/05/msg004621.html

Ok by bouyer@ in private mail.
2009-01-09 22:26:25 +00:00
cegger
3449eda978 remove unused malloc.h 2008-12-18 12:18:20 +00:00
cegger
77abfb89c8 include <xen/xen.h> for xendomain_is_dom0() 2008-10-29 13:53:15 +00:00
jym
4f26afe701 - rename init_events() to events_init(), to better reflect netbsd semantics
- change unbind_[pv]irq_from_evtch() so that they now return the event
channel the [PV]IRQ was bound to. It reflects the opposite behaviour of the
bind_[pv]irq_to_evtch() functions.

- remove xenbus_suspend() and xenbus_resume() prototypes, as they are not
used anywhere else, and will conflict with the xenbus pmf(9) handlers.

- make start_info aligned on a page boundary, as Xen expects it to be so.

- mask event channel during xbd detach before removing its handler (can
avoid spurious events).

- add the "protocol" entry in xenstore during xbd initialization. Normally
created during domU's boot by xentools, it is under domU's responsibility
in all other cases (save/restore, hot plugging, etc.).

- modifications to xs_init(), so that it can properly return an error.

Reviewed by Christoph (cegger@).
2008-10-24 21:09:24 +00:00
jym
507459d7a0 - printf -> aprint_*
- fix and add comments
- make some panic/error messages more relevant
- remove last '\n' in DPRINTK() macros, not required as it is already part of format string.

No functional changes.
2008-10-24 18:02:58 +00:00
cegger
397d181874 The 'sc' in xenbus_sc implies a softc, but it is actually a device_t. Since the device_t/softc split you can't cast a softc out of a device and vice versa.
Therefore rename xenbus_sc to xenbus_dev to prevent any possible confusions.
2008-10-21 21:55:44 +00:00
cegger
7395238cc5 xenbus_probe_init():
- use xendomain_is_dom0()  (from jym@)
- replace return with kthread_exit(0)  (from jym@)
- cleanup error handling
- plug memory leak in error path
- use aprint_error_dev for error messages (from jym@)

xenbus_attach():
- use aprint_error_dev for error message
2008-10-21 21:28:05 +00:00
cegger
2de31871b9 introduce two macros: xendomain_is_dom0() and xendomain_is_privileged(). Use them. 2008-10-21 15:46:32 +00:00
tron
0f256b9d59 Compile NetBSD/amd64 kernels with "-Wextra". Patches contributed by
Juan RP in PR port-amd64/39266.
2008-09-05 13:37:24 +00:00
cegger
5f767a47d6 Dom0: Add a delay before registering event handlers. Wait 1s per request from bouyer.
Fixes "Hotplug scripts not working" problems when launching guests.
Reviewed by bouyer.
2008-06-02 20:54:59 +00:00
cegger
af33bdeef3 device_t / softc split
reviewed, tested and approved by bouyer
2008-04-16 18:41:48 +00:00
cegger
f5bd7c2196 use aprint_*_dev and device_xname 2008-04-06 07:23:57 +00:00
bouyer
9cde455f5c Add swedge support to xbd backed, and make the virtual block device handle
sizes larger than 4TB. Tested by Jukka Marin.
Should fix kern/37370.
2008-03-13 22:19:39 +00:00
bouyer
26315d042c Merge the bouyer-xeni386 branch to head, at tag bouyer-xeni386-merge1 (the
branch is still active and will see i386PAE support developement).
Sumary of changes:
- switch xeni386 to the x86/x86/pmap.c, and the xen/x86/x86_xpmap.c
  pmap bootstrap.
- merge back most of xen/i386/ to i386/i386
- change the build to reduce diffs between i386 and amd64 in file locations
- remove include files that were identical to the i386/amd64 counterparts,
  the build will find them via the xen-ma/machine link.
2008-01-11 20:00:13 +00:00
perry
9b2b412c19 __FUNCTION__ -> __func__ 2007-12-15 00:39:14 +00:00
ad
065b6ba2fb lockmgr -> mutex 2007-12-06 17:00:31 +00:00
pooka
f9379f7719 a_l -> curlwp 2007-11-27 11:37:27 +00:00
bouyer
4e54134323 Pull up the bouyer-xenamd64 branch to HEAD. This brings in amd64 support
to NetBSD/Xen, both Dom0 and DomU.
2007-11-22 16:16:40 +00:00
garbled
d974db0ada Merge the ppcoea-renovation branch to HEAD.
This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree.  Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches.  The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
2007-10-17 19:52:51 +00:00
dogcow
1367780514 Looks like this was part of a botched merge; apply he@'s patch to make
everything compile/link again.
2007-07-11 04:07:08 +00:00
ad
88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
dogcow
82e011bdfd unb0rk build. 2007-03-14 22:26:02 +00:00
christos
53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
christos
ca42d11f95 Coverity CID 3786: Fix memory leak (from Arnaud Lacombe) 2006-09-29 14:36:30 +00:00
yamt
467e0c9853 "xm shutdown" support for xen3. ok'ed by Manuel Bouyer. 2006-08-11 13:22:43 +00:00
bouyer
2613e19eec Add a 'base' argument to xenbus_read_ul, so that we can read number is base
other than 10.
2006-06-25 16:46:59 +00:00
bouyer
237137c875 Add needed framework for backend drivers.
As we want some control on the name the backend driver will have we
can't use autoconf(9) here. Instead backend drivers registers to
xenbus, which will call a create callback when a new device is there.
Backend devices won't have a "struct device" in xenbus, use a void pointer
instead.
2006-05-23 21:07:56 +00:00
bouyer
3a0a2e12df Call xb_init_comms() once the event channel has been allocated for dom0. 2006-05-07 21:50:32 +00:00
bouyer
621b16009d Fix read for /kern/xen/xenbus: ignore offset. 2006-05-07 21:49:56 +00:00
bouyer
c8a960c560 Add dom0 operation support for Xen3. Probably buggy, but it's enouth to have
xend and xenstored starting; xm info and xm list works.
2006-05-07 10:18:28 +00:00
bouyer
2ed85162e6 Centralize all xenbus /kern entries in xenbus_dev.c, and call
xenbus_kernfs_init() for domain0. Now /kern/xen/xenbus is also present
on domain0.
2006-04-11 22:09:09 +00:00
bouyer
c2c545c188 Move xenkernfs_init() back in hypervisor.c so that /kern/xen/privcmd can
also register properly.
2006-04-09 22:14:13 +00:00
bouyer
4ac2bb53f4 start xenbus support for domain0: allocate the page and the event channel,
and export theses via /kern/xen/xsd_mfn and /kern/xen/xsd_port.
2006-04-09 21:39:42 +00:00
bouyer
5086e476d2 #if out read_frontend_details() for now, so that it compiles with DOM0OPS. 2006-04-09 19:25:50 +00:00
bouyer
02e9db01de unregister_xenbus_watch(): Ops, correct code to remove pending watch events
so that it's not an infinite loop.
2006-04-02 15:32:10 +00:00
bouyer
0c9571be10 Properly handle dynamic attach/detach of device:
- keep a linked list of xenbus_device in the xenbus_infrastructure, and
  keep a pointer to struct device for each xenbus_device
- xenbus_probe_device_type(): check that the device is not already attached
- when we get a frontend_changed callback, call xenbus_probe_device_type()
- When a device changes to state XenbusStateClosed, config_detach() it
  and free the structures.
While there, move xbusd_path[] to the end of struct xenbus_device, and
allocate only the space needed to store the path. Garbage-collect
struct xenbus_driver, it's not needed.
2006-03-26 22:02:57 +00:00
bouyer
bf79bcbeba Initialize memory to 0 when allocating a new xenbus device structure.
Prevents trying to unregister a nonexistant node in talk_to_otherend().
2006-03-25 17:23:36 +00:00
bouyer
14e4157f2e Add a xenbus_read_ul() which reads a node and convert it to unsigned long.
Make xenbus_switch_state() and xenbus_read_driver_state() do something usefull.
2006-03-16 23:08:08 +00:00
bouyer
aceceafca7 Implement watch of xenstore nodes, and install watches for otherend'state
node.
2006-03-15 22:20:06 +00:00
bouyer
1604640823 Adapt for NetBSD and add glue for config(9). Enough to get guest domain
virtual devices probed and attached, domain0 and xenstore watch needs to
be done.
2006-03-06 20:21:35 +00:00
bouyer
ed3fe49dd5 Import xenbus sources, from linux sparse tree in the 20060107 xen-3.0
snapshot.
2006-03-06 20:16:33 +00:00