Commit Graph

334 Commits

Author SHA1 Message Date
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
eb7b686214 Ops, better include bpfilter.h if we're going to use NBPFILTER > 0.
Should make bpf work on Xen3 domU, problem reported by Stephane Bortzmeyer
on port-xen.
2006-04-02 13:56:12 +00:00
gdamore
9a2b9dd63b Reorganize ath layout as requested by sam@ and suggested by dyoung@ in
http://mail-index.netbsd.org/tech-net/2006/03/15/0000.html.

The new layout almost precisely matches FreeBSD, and should make
future imports much easier.

At the same time, import the current 0.9.16.16 HAL from FreeBSD.  According
to sam@, this is the proper version we should be using.
2006-04-02 05:52:14 +00:00
thorpej
f5bd442003 Use device_unit(). 2006-03-29 04:41:56 +00:00
thorpej
b9f91d66b8 Use device_is_a() rathern than testing the dv_cfattach pointer. 2006-03-29 04:24:51 +00:00
thorpej
2be6494fc9 Use device_cfdata(). 2006-03-29 04:16:44 +00:00
thorpej
39cd836ee1 Use device_unit(). 2006-03-28 17:38:24 +00:00
bouyer
03999c340c For unknown CPU, if family >= CPU_MAXFAMILY set family to CPU_MINFAMILY instead
of CPU_MAXFAMILY. This effectively causes to downgrade to i386 class
instead of a nonexistant class, and overrunning  classnames[] by one.
Coverity ID 1472.
2006-03-27 20:59:35 +00:00
bouyer
f2b8c717e8 Adapt to xenbus changes; add a proper autoconf detach callback and
handle state change to Closing. We can now dynamically attach/detach
block devices.
2006-03-26 22:05:06 +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
c53404f76c When printing the size of the xbd, also print the number of sectors.
in xbdstart(), check the sector number and transfer size against the
size of the xbd; if we issue an out of bound request the linux xbd backend
will fail to unmap the request, and xbd hangs up.
2006-03-25 17:57:25 +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
499f3cb906 - Add a missing UVM_KMF_WIRED to uvm_km_alloc(), this would trigger an
assertion in uvm
- xbd_open(): check that the device exists before calling dk_open(). Fix
 a null pointer dereference when trying to open a unconfigured xbd.
Should fix 2 issues reported by Stephane Bortzmeyer on port-xen.
2006-03-25 17:20:32 +00:00
jld
2ae09ef648 Fix handling of physmem (and the hw.usermem sysctl) to better reflect
reality -- the memory taken by the kernel image should be counted in the
former, but not the latter, as is the case on other ports.

Discussed on port-xen; approved by bouyer@.
2006-03-23 04:14:33 +00:00
bouyer
5062a5e79e Make it build with options DEBUG 2006-03-20 22:31:21 +00:00
bouyer
c2dd0a8a5e More xbd->xbd_hypervisor changes; non-Xen3 kernels build again. 2006-03-19 15:11:50 +00:00
bouyer
6596b3c534 Add a block device frontend driver for Xen-3. xbd at hypervisor now
attaches with xbd_hypervisor, adjust CFATTACH_DECL().
2006-03-19 00:36:09 +00:00
bouyer
3987b20c61 Add code to dump the xenstore's node for this device under XENNET_DEBUG. 2006-03-19 00:30:00 +00:00
bouyer
2fb45fb442 Get the x86_lfence/x86_sfence right (I hope :) 2006-03-19 00:29:00 +00:00
bouyer
601bc7105f Don't include debug code by default. 2006-03-19 00:28:02 +00:00
jld
2e34cd0e5e Add some missing memory barriers I noticed.
Discussed on port-xen.
2006-03-17 06:04:24 +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
62b855014e m_copyback() doesn't work the way I expexted it: it doesn't update the
mbuf fields, and it seems it doesn't allocate mbuf clusters for large
packets. So revert to using MCLGET() if needed and memcpy to get the
data in the mbuf.
Should fix panic in m_makewritable() reported by Mike M. Volokhov
and Andreas Wrede on port-xen, patch tested by Andreas Wrede.
2006-03-16 23:02:50 +00:00
bouyer
aceceafca7 Implement watch of xenstore nodes, and install watches for otherend'state
node.
2006-03-15 22:20:06 +00:00
drochner
47fbb9d86b adapt to uvm_fault() interface cleanup: kill the useless 3rd argument 2006-03-15 18:12:02 +00:00
dyoung
fe756b012b config(8) creates opt_ah.h, no need to do so here. 2006-03-08 17:06:07 +00:00
jld
25ab6c9464 Improve timekeeping under Xen. Specifically, replace use of
cc_microtime with a MD function that isn't affected by erratic "clock
interrupts" and instead takes more advantage of time information
provided by the hypervisor.  Fixes, most importantly, a case where the
clock as seen by userland would sometimes bounce back and forth by up to
1<<31 us (~35 min).

Approved by bouyer@; explained in more detail in
http://mail-index.netbsd.org/port-xen/2006/02/28/0002.html
2006-03-07 23:08:14 +00:00
bouyer
028c20dba6 Adapt for recent changes in UVM. 2006-03-06 22:10:28 +00:00
bouyer
be18814951 Fix build issues that didn't show up in my private tree. 2006-03-06 22:04:18 +00:00
bouyer
2e3fa7a73a Add a Xen Virtual Network device driver for Xenbus. 2006-03-06 20:36:12 +00:00
bouyer
60d4a96e28 pull in the grant table and Xenbus interfaces, and attach xenbus at hypervisor. 2006-03-06 20:34:09 +00:00
bouyer
8adab3e01b Map the XenStore shared page for non-domain0. 2006-03-06 20:32:28 +00:00
bouyer
f0dc72de02 Implement granttables operations. 2006-03-06 20:30:40 +00:00
bouyer
636656c40d Xenbus public functions 2006-03-06 20:29:52 +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
bouyer
df06d5bae0 Add back a cn_check_magic() call which was commented out by mistake in
previous commit.
2006-03-06 20:12:09 +00:00
bouyer
59b2aa00f1 xenconscn_getc(): if xencons_console_device is NULL loop here instead
of in ddb.
2006-03-06 20:10:51 +00:00
bouyer
8508673945 Mark ring indexes as volatile. 2006-03-06 20:00:51 +00:00
bouyer
2e57249e9d Use x86_lfence/x86_sfence instead of linux wmb()/mb() 2006-03-06 20:00:06 +00:00
bouyer
9c7083dfa0 Implement MULTI_update_va_mapping() and MULTI_update_va_mapping_otherdomain(),
which fills in multicall arguments for __HYPERVISOR_update_va_mapping
and __HYPERVISOR_update_va_mapping_otherdomain dealing with
differences between i386 and amd64.
2006-03-06 19:57:31 +00:00
bouyer
fa2d4a51e2 Add xen_atomic_cmpxchg16(), which exports the cmpxchgw instruction to C. 2006-03-06 19:55:47 +00:00
bouyer
198cdcf732 Correct arguments for __HYPERVISOR_set_timer_op 2006-03-06 19:54:50 +00:00
bouyer
e4e15333af Add x86_sfence() for symetry, which is just a __insn_barrier() here. 2006-03-06 19:54:14 +00:00
he
483f1a7d27 Before symlinking opt_ah.h, make sure the target doesn't already exist.
This fixes a build problem with UPDATE set.
2006-03-03 14:55:14 +00:00
thorpej
a4f36d5d21 Use device_is_a(). 2006-02-26 06:17:00 +00:00
thorpej
458b3e43f7 Use device_parent(). 2006-02-23 05:37:46 +00:00
thorpej
58853410ae Use device_class() instead of accessing dv_class directly. 2006-02-21 04:32:38 +00:00
perry
fbae48b901 Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
2006-02-16 20:17:12 +00:00
tron
cbb0e8c88b Share Intel hardware random number generator support between amd64 and
i386 port. This will benefit EM64T systems using Intel i9xx chipsets.
2006-02-12 18:16:01 +00:00