Commit Graph

365 Commits

Author SHA1 Message Date
bouyer
2b90da4613 Fix NULL pointer deref when a backend switches to closing without
have been connected.
Make sure we connect only once; avoid getting disk attached multiple times
when there are multiple block devices configured (the xenbus seems to call
the callbacks for all xbd when each of them comes up).
2006-05-10 21:31:49 +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
61ebbef433 Initialise a few things earlier, so that getc() works before the console
is probed for dom0. This makes -c and -d work on Xen3/dom0 kernels.
The kernel still gets a trap on Xen2/dom0.
2006-05-07 21:48:35 +00:00
bouyer
c96226e3fa Resolve conflicts from xen-3.0.2-2 import 2006-05-07 10:56:37 +00:00
bouyer
388f0b9508 Import non-DPLd Xen public headers from Xen 3.0.2-2 2006-05-07 10:54:39 +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
jld
efe3d96393 Use TAILQ_FOREACH instead of duplicating the code.
No change to compiled object file.
2006-05-05 23:45:52 +00:00
jld
78e3490d47 Have our dom0 periodically set Xen's time-of-day clock (much as Linux does).
That time is used by ~all domUs when they boot (or resume), and Linux by
default will pin the local clock to it; so, it's useful to correct its
drift as best we can.  A sysctl (machdep.xen_timepush_ticks) has been
added to allow changing the interval or disabling this feature.
2006-05-05 19:38:38 +00:00
jld
2aa6d50864 Suspend/resume support for xbd -- keep enough info on live I/O to replay.
The rest of suspend/resume isn't there yet, but the parts that touch
regular usage have been tested.  Discussed on port-xen on 2006-04-25;
approved by bouyer@.
2006-05-05 19:25:26 +00:00
bouyer
97aadda462 Fix a race between xenconscn_getc() and xencons_handler() (which seems to be
triggered by recent xen3 hypervisor or tools): check sc->polling in
xencons_handler() and just return if set. Also, run xenconscn_getc() and putc()
at spltty().
While there, mark xencons_interface as volatile and use __UNVOLATILE() where
appropriate; and update the pointers in xencons_handler() if xenconscn_getc()
changed them (avoids replaying ddb commands in shell if ddb got called
by the magic string).
2006-05-03 20:22:34 +00:00
jld
57a2f1d62a What corresponds to the last run of hardclock(9), and thus the current
value of time(9), is processed_system_time and not shadow_system_time.
2006-04-28 02:30:42 +00:00
jld
7cc80f17e2 Put the "excessively fragmented I/O" warning printf under #ifdef DEBUG,
where it belonged in the first place.
2006-04-27 22:38:13 +00:00
jld
8d20bdba95 Don't leak an xbdreq when probing disks. 2006-04-22 23:59:50 +00:00
dogcow
3d7a8aef39 fix breakage due to iostats header twiddling 2006-04-20 18:58:06 +00:00
blymn
10df330c85 Prefix iostat structure elements with io_ 2006-04-20 12:13:51 +00:00
christos
19e3773ffa Apply fix from FreeBSD's advisory: fxrstor on AMD FPU's does not restore
FIP,FDP,FOP thus leaking other process's execution history.
2006-04-19 17:19:48 +00:00
jld
88064d75f5 Raise time limit on sanity-check warning printf to 10s (from 10 ticks),
to avoid false postives on Xen 3, which doesn't update the shared time
info as often.
2006-04-18 21:19:01 +00:00
matt
59ec00f1e2 Use M_ZERO instead of an explicit memset. 2006-04-15 17:54:12 +00:00
dogcow
b9eb230696 Make XENU compile again. (I'm not sure if this is the 'correct'
way to it build correctly; there might be some different method to
the new iostats collection framework.)
2006-04-15 06:18:56 +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
aab0004b68 Add support for ACPI in xen-3 dom0 support. We can now boot a xen-3 dom0
kernel with a default xen comamnd line.
2006-04-09 19:28:00 +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
jld
00f39ded1b Change diagnostic assertions to DEBUG-conditionalized printfs.
(Alternately, XEN_CLOCK_DEBUG may be defined to enable just the
checks in this module.)
2006-04-04 21:08:47 +00:00
bouyer
65b5449cc4 Add NetBSD CVS Id. 2006-04-04 20:30:30 +00:00
gdamore
75670ddc44 Convert existing ath users to new Makefile, except for amd64, which needs
the rules due to needing to conditionally postprocess the HAL object file.

Macppc needs a a non-ELF HAL (EABI) object, so take care of that by default
in the atheros include file.
2006-04-04 03:13:12 +00:00
bouyer
fb009d1ad3 Properly update output counters. 2006-04-02 17:11:12 +00:00
bouyer
e3393ee971 xbd_xenbus_detach(): wait for the backed to release grant reference to the
ring before trying to revoke it, otherwise the kernel may panic in
xengnt_revoke_access.
2006-04-02 15:36:10 +00:00
bouyer
e35565d1d4 Add proper detach support for Xen3 xennet. 2006-04-02 15:32:41 +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
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