Commit Graph

406 Commits

Author SHA1 Message Date
yamt e81b1eeaa7 implement NETRXF_csum_blank/NETTXF_csum_blank tx checksum "offloading". 2006-07-12 15:03:08 +00:00
yamt 897bdba2b9 implement a simple NETTXF_csum_blank/NETRXF_csum_blank workaround
so that we can talk with linux guests at least.
just fill checksum field of received packets if the flag is set.
maybe should be revisited later.
2006-07-12 15:02:15 +00:00
yamt eeb2c6eb23 inittodr: if xen3, add processed_system_time (system_time) to
shadow_tv (wc_sec/nsec) as linux guest does.
2006-07-11 12:26:58 +00:00
christos cfa1686dee include files.apm 2006-07-09 01:59:42 +00:00
yamt fa517f1fc0 make this compilable without kernfs in the case of !DOM0OPS && XEN3. 2006-07-07 18:15:53 +00:00
yamt aa5b46a800 xbdsize: fix an null dereference. 2006-07-07 17:59:21 +00:00
jld 3ebfa1a07d Fix accidentally unsigned comparison, which was causing the timer event
handler to run ~forever in the face of slightly unexpected input from
Xen (system_time apparently going backwards).  Pointed out by kardel@.
2006-07-04 07:35:28 +00:00
bouyer a2847deb82 Fix a bogus gcc4 uninitialized warning. 2006-07-02 18:54:25 +00:00
bouyer b96fedac26 block device backend driver for Xen3. Add
pseudo-device xbdback
in your config file to use.
2006-07-02 16:35:24 +00:00
bouyer 3fc47e70cc Fix a off by one error in xstart_mmu[] that would cause bad corruption
when handling full batch of requests.
Linux expects to have 16 btyes free between the start of the RX buffer and the
start of the packet, handle this.
Get rid of the "hotplug-status" hack, we now have proper tools to deal with
it in userland.
Various minor fixes and code reorg.
2006-07-02 16:32:49 +00:00
bouyer 9b4c2c6758 m_copyback() doesn't adjust m->m_len if the data to copy is smaller than
the mbuf's size. Set it to a proper value before calling m_copyback().
This should fix panics in m_makewritable() reported by several peoples.
While there, add MCLAIM() calls where appropriate, a few more #ifdef DEBUG
checks, and various minor fixes.
2006-07-02 16:29:49 +00:00
bouyer 9e9d09bf73 Use the right test for ring full condition. Avoid an infinite loop when the
ring is full (because the domU is in ddb for example).
2006-06-25 19:46:52 +00:00
bouyer 58af96f414 Don't loop forever if we receive a packet while the interface is down. 2006-06-25 18:34:09 +00:00
bouyer 65918da968 DTRT when the number of grants to map or unmap is more than one. 2006-06-25 18:03:49 +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 22247e56e0 Adapt for new xen_shm_* signatures.
While here add more xenbus_dev_fatal() calls for some failure cases.
2006-06-25 15:20:39 +00:00
bouyer b063155744 Allow xen_shm_map() to map multiple grants in a contigous virtual address
space.
While here garbage-collect unused xen_shm_vaddr2ma()
2006-06-25 15:18:53 +00:00
kardel d377d3f58a no timecounters yet - provide a local types.h 2006-06-07 22:45:21 +00:00
bouyer 85cd924c0e Remove unused file. Pointed out by Pavel Cahyna.
Probably unused since kernel config files were moved to i386/conf.
2006-05-28 17:14:59 +00:00
pavel ad560fa074 Give Xen its own linker script, which does not set the physical load address
specially. In Xen, the system is already in virtual mode when the kernel is
started, so the old behavior of setting physical address to virtual address
was actually correct, and the previous change made NetBSD/Xen kernels
unbootable.

Pointed out, explained and tested by <bouyer>.
2006-05-28 14:00:13 +00:00
bouyer b48d779334 Revert previous. HYPERVISOR_set_timer_op() works fine for domU, and using
HYPERVISOR_yield() cause a domain to busy-wait for some work to do (so
using HYPERVISOR_yield doen't fix the problem for dom0, and makes things much
worse for domU).
2006-05-28 13:36:28 +00:00
bouyer 5ff62d8d84 On my system the CPU frequency reported at boot is off by about 10% (maybe
because of the jitter caused by the serial console), which is not only
cosmetic but is bad for clock accuracy. Introducing a 1s delay before reading
Xen's idea of the CPU frequency fixes this.
2006-05-27 20:48:40 +00:00
bouyer 2a649c320b HYPERVISOR_set_timer_op() doesn't seem to work right on a NetBSD Xen3 dom0,
the dom0 is getting a continous stream of clock interrupts. As we want an
interrupt every hz anyway, just use HYPERVISOR_yield() instead.
2006-05-27 19:57:15 +00:00
bouyer 498d4ec7e6 The receive buffer, once mapped back in the domU, is read/write and not
shared so there;s no problems marking the mbuf M_EXT_RW.
2006-05-27 19:54:59 +00:00
bouyer de9d456540 A lot of work is needed in the tcp stack to handle read-only ext storage
so always copy packets from the domU to a fresh mbuf for now.
2006-05-27 13:54:35 +00:00
bouyer 5eda3c3cab Use xen_shm_* to map the packet sent to us by the domU, and attach it
as external storage to the mbuf.
2006-05-25 21:28:38 +00:00
bouyer 159a19cf73 Always include xen_shm_machdep.c for Xen3, theorically a domU could also
provide backend services to other domains.
2006-05-25 21:27:40 +00:00
bouyer d1d1596e1e Convert xen_shm_map() and xen_shm_unmap() to the Xen3 grant table
interface.
2006-05-25 21:26:20 +00:00
bouyer b06932d37f Add a network backend driver for Xen3. This will appear as a xvif pseudo
device in kernel config files.
2006-05-23 21:10:42 +00:00
bouyer a4fe55530f Don't forget to softintr_disestablish() when destroying a xvif. 2006-05-23 21:09:37 +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
yamt 7445825948 i386 and xen: move struct user to the highest address in uarea
and reduce UPAGES from 4 to 3 in the case of !NOREDZONE.
2006-05-22 13:44:53 +00:00
dogcow fedf1d0f26 For whatever reason, GCC4 really really wants extern struct decls to be
after the struct is defined.
2006-05-15 20:57:53 +00:00
dogcow c1c911e17b gcc4: initalize uninitialized data (one valid, one not quite as valid) 2006-05-15 20:16:31 +00:00
dogcow e04236d6b3 remove bitrotted functions that have never been used, and have been
cargo-culted from one port to another.
2006-05-15 12:47:42 +00:00
yamt d52000b74c include kauth.h for NOCRED. 2006-05-15 09:22:34 +00:00
yamt 394475baf3 include sys/kauth.h for NOCRED. 2006-05-15 00:55:57 +00:00
yamt dfae4593ce include sys/kauth.h for kauth_cred_geteuid. 2006-05-15 00:55:29 +00:00
elad 8ccb6c9341 integrate kauth. 2006-05-14 21:55:09 +00:00
bouyer dc6fb875d6 Add a missing break in a switch clause, causing the frontend to go to Closed
state when it should not.
2006-05-14 20:44:36 +00:00
skrll 214053461e Fix some more comments. 2006-05-13 08:56:08 +00:00
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