Commit Graph
353 Commits
Author SHA1 Message Date
kaf24@firebug.cl.cam.ac.uk adec4de131 Fix rx buffer allocation in netfront. The final allocation size
was ending up bigger than PAGE_SIZE.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-12-13 03:47:47 +01:00
kaf24@firebug.cl.cam.ac.uk 523283aa07 Fix ia64 blkback build.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-12-11 00:11:44 +01:00
kaf24@firebug.cl.cam.ac.uk 92fb778f03 Fix blkback to build on ia64.
Signed-off-by: Dan Magenheimer <dan.magenheimer@hp.com>
2005-12-09 09:29:52 +01:00
kaf24@firebug.cl.cam.ac.uk 98bea19681 Allocate separate vm areas for rx and tx rings in netback
driver as part of preparation for ia64 support.

Signed-off-by: Dan Magenheimer <dan.magenheimer@hp.com>
2005-12-08 16:58:41 +01:00
kaf24@firebug.cl.cam.ac.uk 3361d4d041 Support CFQ scheduling of guest block requests by creating
a kernel thread per blkif connection. General cleanup work
in blkback driver.

Signed-off-by: Gerd Knorr <kraxel@suse.de>
2005-12-08 16:53:53 +01:00
kaf24@firebug.cl.cam.ac.uk e50c7df410 Make balloon driver arch-neutral.
Signed-off-by: Dan Magenheimer <dan.magenheimer@hp.com>
2005-12-08 15:33:10 +01:00
emellor@leeni.uk.xensource.com 11d655cef6 Tidy up use of environment variables in xenbus-hotplug interaction.
I've changed this to only write "backend" (xenbus_backend.root) into
XENBUS_BASE_PATH.  After appending XENBUS_TYPE (also exported) you can
construct the "base path" easily in the scripts.  I've completely
removed writing XENBUS_FRONTEND_ID in favour of reading it from the
store at "$XENBUS_PATH/frontend-id".

Avoid re-reading the store over and over for the frontend domain's vm-path.

The patch also fixes a memory leak in backend_bus_id where we
leak the memory referenced by frontend if the function succeeds.

This work is by Christian Limpach.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-07 11:57:26 +00:00
kaf24@firebug.cl.cam.ac.uk b8477f0215 Fix the request size for a full page-sized skbuff in netfront
driver (must allow 16 bytes for dev_alloc_skb headroom).

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-12-06 15:52:15 +01:00
kaf24@firebug.cl.cam.ac.uk 107808a452 Fix netfront to accept received packets at a wider range of
offsets within a memory page. Also fix, skb realloc-and-copy
when copying really is required (we were forgetting whether
the packet data is known valid, and checksumming packets that
do not have the csum field filled in).

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-12-06 15:02:54 +01:00
kaf24@firebug.cl.cam.ac.uk 1e4b462e21 Pull requests from blkfront into blkback a bit more
aggressively, to keep the scheduling pipeline filled.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-12-04 18:20:41 +01:00
kaf24@firebug.cl.cam.ac.uk 1e56ea4a43 Fix request-notification holdoff in blkback. New code is
more correct and clearer in intent.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-12-03 21:53:01 +01:00
cl349@firebug.cl.cam.ac.uk f9165bed2f Fix block backend teardown when the device didn't setup completely.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-12-03 13:36:22 +01:00
kaf24@firebug.cl.cam.ac.uk ad7f8262e3 Fix blkback request notification holdoff. req_cons must be
updated before make_response() is called. This fixes attaching
ramdisk-backed vbds to a blkfront.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-12-03 11:41:49 +01:00
emellor@leeni.uk.xensource.com 895f3158e2 Merged. 2005-12-02 15:48:55 +00:00
emellor@leeni.uk.xensource.com d1dd4f46f5 Fix the block-sharing check for physical devices by using a lock to serialise
the check, reading from the store rather than /sys, and checking whether the
VM for apparently-conflicting uses is actually the same (i.e. this is a
migration or a reboot in progress).

This fixes recent failures in 12_block_attach_shared_domU and recloses bug #331.

This fix includes particularly skanky path slicing inside xenbus_probe, which
it would be nice to remove very soon.

The loopback device check still suffers from the problem that filenames over
64 characters long are truncated.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-12-02 15:48:44 +00:00
kaf24@firebug.cl.cam.ac.uk af71f48393 More console-related cleanups.
Signed-off-by: Keir Fraser <keir@xensource.com>
2005-12-02 16:26:57 +01:00
kaf24@firebug.cl.cam.ac.uk 8d547cb252 Simplify console driver and avoid unnecessary spinning in the
transmit handler.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-12-02 16:14:20 +01:00
sos22@douglas.cl.cam.ac.uk c10797216b Avoid a hang when probing the partition table on imported block
devices.  If you export a device so the importing domain sees it as a
whole disk rather than a partition, then add_disk will try to probe
its partition table.  However, we were calling add_disk before the
device was properly connected, and then not connecting it until
add_disk had finished.  This meant that we ended up never actually
connecting the device, and any accesses to it would then hang.

Fix this by not calling add_disk until we're connected.

Signed-off-by: Steven Smith, sos22@cam.ac.uk
2005-12-02 15:16:37 +01:00
kaf24@firebug.cl.cam.ac.uk 8afc538db6 Blkif request notifications use generic ring req_event holdoff
mechanism rather than custom mechanism.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-12-02 13:27:39 +01:00
kaf24@firebug.cl.cam.ac.uk eedace537e Clean up netif messages. Remove bitfields, and create
extensible flag fields in tx requests and rx responses, in
place of specific csum_blank/csum_valid bitfields.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-12-02 13:10:25 +01:00
kaf24@firebug.cl.cam.ac.uk 442ca37bf1 Fix tpm split driver to include grant-table defintions.
Signed-off-by: Stefan Beger <stefanb@us.ibm.com>
2005-12-02 11:10:01 +01:00
smh22@firebug.cl.cam.ac.uk 2b039aa937 Fix VBD recovery logic on SMP guests (+ a minor error reporting fix for save)
Signed-off-by: Steven Hand <steven@xensource.com>
2005-12-01 20:43:04 +01:00
kaf24@firebug.cl.cam.ac.uk da533ceb07 Implement generic notiication hold-off in the ring macros
(ring.h). Move net and blk split drivers to use it.
blktap probably needs some work. :-)

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-12-01 20:23:07 +01:00
kaf24@firebug.cl.cam.ac.uk 96428d33d9 Define explicit evtchn_port_t type (32 bits) and plumb up
to user space thru /dev/xen/evtchn.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-12-01 15:22:22 +01:00
vhanquez@kneesa.uk.xensource.com 23f0fe07cd fix the console when only XEN_PHYSDEV_ACCESS is Yes.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2005-12-01 07:31:50 +00:00
kaf24@firebug.cl.cam.ac.uk b242b20898 Move net split driver onto ring.h generic rings.
No backend should SHARED_RING_INIT(): that's the frontend's job.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-12-01 11:27:27 +01:00
iap10@freefall.cl.cam.ac.uk 8d68c69875 Add a new /proc/xen file called 'capabilities'. Currently, when read in dom0 it will return 'control_d', and be empty when read in a guest. This provides a convenient way to allow the root user to detect whether they're running in a guest or dom0, and e.g. gate whether to start xend. In future, when we add more fine grained capabilities we will add other details into this file.
Signed-off-by: ian@xensource.com
2005-12-01 02:43:04 +01:00
kaf24@firebug.cl.cam.ac.uk ba3f55e57a GNTTABOP_map_grant_ref returns error status and handle as
separate fields. Update callers for new interface. Also
use int16_t as standard error code type on all public
interfaces.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-11-30 17:24:27 +01:00
kaf24@firebug.cl.cam.ac.uk b2de462a06 Public interface cleanups. Widen some fields in public
interface defintions for future extensibility. In particular,
grant references are now 32 bits and this has some knock-on
effects on split-driver interfaces.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-11-30 16:03:05 +01:00
smh22@firebug.cl.cam.ac.uk 7086b5730b Cleanup backend block device logic under save/restore; this should
fix the issues some people have seen with segfaults in vbd_translate 
and/or user-space hangs. 

Signed-off-by: Steven Hand <steven@xensource.com>
2005-11-29 14:50:30 +01:00
kaf24@firebug.cl.cam.ac.uk f823a38b1f arch/xen/kernel/fixup.c -> arch/xen/i386/kernel/fixup.c
arch/xen/kernel/devmem.c -> drivers/xen/char/mem.c
arch/xen/kernel/smp.c deleted

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-11-28 14:08:53 +01:00
emellor@leeni.uk.xensource.com 10e8ebd5bb Merged. 2005-11-26 01:21:55 +00:00
emellor@leeni.uk.xensource.com d966085083 Check when using physical devices that the device is not already in use. Using
a device from two guests, or from dom 0 and a guest, can destroy the filesystem,
and this check prevents that.  This should ensure that the xm tests
11_block_attach_shared_dom0 and 12_block_attach_shared_domU should pass.
Closes bug #331.

Devices may be shared only if all uses are read-only.  If anyone has read-write
access to a device, then no sharing is allowed.

The mode in the config file may now have an exclamation mark appended, to
indicate that devices may be shared (i.e. that this new check should be
bypassed).  This supports some network block devices, but is clearly dangerous
and should only be used when you know what you are doing.

The mode specified in the config file is now written explicitly to the store,
To implement this, the blkback driver has been changed to create two entries
in /sys describing each device in use.  This means that we can determine which
devices are in use without crawling through the store.

The physical-device node has been changed to give the major and minor of the
device, separated by a colon.  This means that we do not need to pack these
numbers into one, removing the restriction to 8 bit minors that we had in place
before.

The mode specified in the config file is now written explicitly to the store,
rather than using the presence or absence of a read-only node.  This supports
the write-sharing override above.

If the device is in use, a new hotplug status of "busy" is written to the
store, and a message is written to a new hotplug-error node.  Xend uses these
things for diagnosis.

The block scripts do not need to handle online or offline events, so this
support has been removed.  These scripts can be called twice, depending upon
the hotplug config, so they now identify the second run and do not attempt to
set up the device again.

The device directories in the store are cleaned out before new details are
written there.  This prevents stale information from messing up block device
hotplugging.  This will be one cause of "blkback: changing physical device
not supported" messages.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-25 20:58:07 +00:00
kaf24@firebug.cl.cam.ac.uk 83120737f5 Implement new memory_op() XENMEM_machphys_mfn_list. Replaces old
privcmd Linux ioctl and includes an implementation for x86/64.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-11-25 18:43:35 +01:00
kaf24@firebug.cl.cam.ac.uk b588d4451a Update vtpm driver following the recent changes to the
xenbus driver and its semantics.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2005-11-25 09:14:01 +01:00
emellor@leeni.uk.xensource.com c039c43deb Added a count of the number of users of this block device, and refuse to close
down the frontend until that number becomes 0.  There are no reasonable
semantics for hot-unplugging a block device beneath a mounted filesystem, and
this solution ensures that the guest is not crashed nor the filesystem corruptedby the actions of the administrator.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-24 19:53:09 +00:00
emellor@leeni.uk.xensource.com 2128c9ba49 Minor tidy, no semantic change.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-24 15:52:42 +00:00
emellor@leeni.uk.xensource.com f6d80a7f57 Reverse accidental commits for changesets 8001 and 7996-7999.
The Mercurial Queues extensions suddenly looks a lot less useful than it first
seemed.
 
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-23 19:37:33 +00:00
emellor@leeni.uk.xensource.com d64896a9f0 Merged. 2005-11-23 19:31:22 +00:00
emellor@leeni.uk.xensource.com 96e138a54d Merged. 2005-11-23 19:19:04 +00:00
emellor@leeni.uk.xensource.com 034f2cd52e Inside xenbus_switch_state, don't write the new state if the node has already
disappeared.  This happens when the driver is being torn down, and we don't
want to resurrect the device directory in the store because of it.

Partially addresses bug #424.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-23 18:47:54 +00:00
emellor@leeni.uk.xensource.com d29719d231 Added a hotplug KOBJ_OFFLINE call, for symmetry with the ONLINE call used here.
We need a hook to be able to close down the device properly, but the REMOVE
event is no good because we don't get the script and vif environment variables
set in that case.

Closes bug #417.
 
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-23 18:45:57 +00:00
kaf24@firebug.cl.cam.ac.uk 5a808f1e05 Add __iomem and __user pointer annotations to linux sparse tree.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2005-11-23 14:14:01 +01:00
smh22@firebug.cl.cam.ac.uk 1366ee55cc Avoid GPF when attempting to save / restore 64bit guests. More thought
required as to best way to get M2P mfns under 64...

Signed-off-by: Steven Hand <steven@xensource.com>
2005-11-22 19:10:50 +01:00
kaf24@firebug.cl.cam.ac.uk a1584b36b2 Change semantics of gnttab_transfer to take the page away
from the calling domain, even on error (except for special
error GNTST_bad_page). This has a knock-on advantage of
simplifying Linux's netback driver.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-11-21 18:10:35 +01:00
kaf24@firebug.cl.cam.ac.uk 0200af138e Fix grant-table transfer implementation. Also fix transfer
error paths in network frontend and backend drivers.

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-11-21 14:17:50 +01:00
cl349@firebug.cl.cam.ac.uk a69feeba51 Move tpmfe.h file next to other xen specific header files.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>


--HG--
rename : linux-2.6-xen-sparse/include/linux/tpmfe.h => linux-2.6-xen-sparse/include/asm-xen/tpmfe.h
2005-11-19 02:27:20 +01:00
emellor@leeni.uk.xensource.com eaa3641b4f Merged. 2005-11-18 14:30:47 +01:00
kaf24@firebug.cl.cam.ac.uk de70603843 Remove conditionally-compiled code for Linux 2.4.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2005-11-18 13:46:18 +01:00
emellor@leeni.uk.xensource.com 3700b1715b Initialise the request ID in xs_talkv, to silence valgrind. We're not actually
using this value at the moment -- it's only there for use by future clients.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2005-11-17 20:20:44 +01:00