Commit Graph
565 Commits
Author SHA1 Message Date
kaf24@firebug.cl.cam.ac.uk 11dfd1c079 The Xen netif drivers won't complile if NET is absent.
Signed-Off-By: Horms <horms@verge.net.au>
2006-05-01 15:30:53 +01:00
kaf24@firebug.cl.cam.ac.uk 1c4f3590d1 Compilation fix on ia64. Include linux/vmalloc.h for struct vm_area.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-05-01 15:29:38 +01:00
kaf24@firebug.cl.cam.ac.uk 6320cedf16 Compilation fix tpmback.c on ia64. Use pfn_to_mfn instead of
phys_to_machine_mapping.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-05-01 15:29:08 +01:00
kaf24@firebug.cl.cam.ac.uk 28ba640091 Change semantics of grant transfers for vp guests so that the
operation automatically gets you a fresh page at the same
pseudo-physical address as Keir suggested.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-05-01 15:28:01 +01:00
kaf24@firebug.cl.cam.ac.uk 8419bc2fd9 Allow architectures to define their own privcmd_mmap() by
introducing HAVE_ARCH_PRIVCMD_MMAP.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-04-30 09:52:13 +01:00
kaf24@firebug.cl.cam.ac.uk 918c6260b3 Introduce XEN_IA64_DOM0_NON_VP to simplify some ifdefs
from defined(__ia64__) && !defined(CONFIG_XEN_IA64_DOM0_VP)
to defined(XEN_IA64_DOM0_NON_VP).

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-04-30 09:50:49 +01:00
kaf24@firebug.cl.cam.ac.uk ab105de48f Balloon driver: when in autotranslate mode, pages are returned
to xen without traversing init_mm.
This change is needed for xen/ia64 vp model.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-04-30 09:47:51 +01:00
kaf24@firebug.cl.cam.ac.uk a4e370a392 balloon_alloc_empty_page_range() should set the reference count
on every page structure before returning.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-04-30 09:32:21 +01:00
kaf24@firebug.cl.cam.ac.uk 013351bd7a Define new event-channel and physdev hypercalls with a more extensible
interface (the legacy hypercalls would break if subcommands with large
argument structures were added, as it would grow the size of the 
union of all argument structures).

Also, based on a patch from Kevin Tian, add a new physdev op to
signal EOI for a particular irq.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-04-30 09:16:15 +01:00
kaf24@firebug.cl.cam.ac.uk 48584e1773 xen/ia64 with dom0 vp model doesn't need the blkbkack ia64 workarounds
any more.  xen/ia64 dom0 vp model is a big change so that xen/ia64
with the old model (P=M) still remains as the compile option.
Hopefully the work around will be eliminated in the future completely.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-04-28 14:48:50 +01:00
kaf24@firebug.cl.cam.ac.uk 1de2453162 xen/ia64 with dom0 vp model needs direct_remap_pfn_range() to be called
for IOCTL_PRIVCMD_MMAPBATCH.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-04-28 14:42:53 +01:00
kaf24@firebug.cl.cam.ac.uk 54b4ddf0d1 Rename {SG}ET_XEN_GUEST_HANDLE to {sg}et_Xen_guest_handle, as they
are function macros rather than define/declare macros.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-04-28 09:40:07 +01:00
kaf24@firebug.cl.cam.ac.uk 37f486b06e Relax BUG_ON() state ment in increase_reservation() in balloon.c.
When xen_feature(XENFEAT_auto_translated_physmap) = 1,
phys_to_machine_mapping_valid(pfn) always returns true.
Relaxed BUG_ON() for xen_feature(XENFEAT_auto_translated_physmap) = 1 case.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-04-28 08:30:52 +01:00
kaf24@firebug.cl.cam.ac.uk 02842d8a2b Bump Xen interface version number to 0x00030201 for new
structural guest handles.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-04-27 14:03:22 +01:00
kaf24@firebug.cl.cam.ac.uk 704e9ade0f Wrap all GUEST_HANDLEs in structures, and define SET/GET macros to access them
in Linux and libxc.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
2006-04-27 13:58:50 +01:00
kaf24@firebug.cl.cam.ac.uk 4025e86c1a This patch adds the ability to have restricted write access to some
of the structures on the capability list. Specifically, this patch adds
support for reading data through the Vital Product Data capability
structure and for manipulating power management of a card. A driver
domain is not allowed to enable Power Management Events (the PME trace
may be shared across devices in many domains), but it can put a device
in its control to sleep or query it for power usage statistics. This
code could possibly be expanded in the future to add support for AGP,
PCI-X, and MSI/MSIX (all of which are controlled through structures on
the capability list).

This patch also corrects some formatting issues in the PCI backend and
adds some comments to the code regarding permissive mode.

Signed-off-by: Ryan Wilson <hap9@epoch.ncsc.mil>
2006-04-27 09:49:48 +01:00
kaf24@firebug.cl.cam.ac.uk c7e3f5818f Just allocate unbound irq only from dynirq range, since
pirq range is reserved for physical devices. This saves
unnecessary checks on pirq range.

Signed-off-by Kevin Tian <kevin.tian@intel.com>
2006-04-27 09:43:49 +01:00
kaf24@firebug.cl.cam.ac.uk b450304086 Make xen_features and force_evtchn_callback() non-GPL
symbols as they are used in a variety of ubiquitous
kernel macros.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-04-26 17:41:19 +01:00
kaf24@firebug.cl.cam.ac.uk b11a028b04 Need a little more serialisation in pciback_do_op().
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-04-25 18:22:11 +01:00
kaf24@firebug.cl.cam.ac.uk 93bb8669b3 Some of the Linux PCI functions called by the virtual configuration
space handlers were making calls into ACPI code which uses semaphores.
Since semaphores can not be locked while atomic (because they could
sleep), I changed the way the PCI backend responds to requests from the
frontend. Previously, the virtual configuration space handlers ran in
the same context as the event channel interrupt handler (which was often
atomic if not always atomic). Now the interrupt handler schedules a
callback function (a bottom half) in the system work queue (keventd)
that will get called in process context at a slightly later time. This
allows the handlers in the virtual configuration space to run in process
context and to call any core PCI function regardless of whether it will
sleep or not.

Signed-off-by: Ryan Wilson <hap9@epoch.ncsc.mil>
2006-04-25 18:13:39 +01:00
kaf24@firebug.cl.cam.ac.uk 91046a739e Fix the -xen, -xen0 builds.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-04-25 16:08:11 +01:00
kaf24@firebug.cl.cam.ac.uk c0b2433fa9 Change the xenbus_map_ring_valloc() interface and implementation so
that it is buildable as a module.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2006-04-25 14:20:08 +01:00
kaf24@firebug.cl.cam.ac.uk cfc4a77198 Enable migration of a domain to the local machine - some timing
issues needed to be resolved by executing certain code early/later
Restore the physical to machine array such that balloon-allocated
pages can be deallocated.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-04-20 17:32:12 +01:00
emellor@leeni.uk.xensource.com e264f7c0c4 Merged. 2006-04-15 19:25:21 +01:00
emellor@leeni.uk.xensource.com 3ae4ba6c3c Read the message type out of the message before sending it to xenstored, and
use that saved value when handling the reply.  Xenstored will leave the
message type intact, _except_ when returning an error, in which case it will
change the type to XS_ERROR.  This meant that we failed to remove a
transaction from our internal list if xenstored returned EAGAIN, as we did not
realise that the message was XS_TRANSACTION_END.  This manifested itself as
the intended behaviour until the connection was closed, at which point all of
those failed transactions would erroneously be aborted.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-04-15 19:25:09 +01:00
kaf24@firebug.cl.cam.ac.uk 40212eeb61 Restrict netfront to 256 grant references to avoid
exhausting the global pool.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-04-14 15:05:28 +01:00
kaf24@firebug.cl.cam.ac.uk eea1cdc7f4 Introduce gnttab_empty_grant_references() to check whether grant
references is empty.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-04-14 15:05:04 +01:00
kaf24@firebug.cl.cam.ac.uk a56425fa9d Call move_irq() during evtchn ->ack irq hook functions. This
triggers SMP affinity work.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-04-14 11:58:49 +01:00
kaf24@firebug.cl.cam.ac.uk 42f8fcaf1b This fixes the state machine of the vTPM driver.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-04-13 10:59:08 +01:00
kaf24@firebug.cl.cam.ac.uk bf1d9dba35 Make grant table map/unmap argument, host_addr, feature-specific.
Introduce gnttab_set_map_op() and gnttab_set_unmap_op() to initialize.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-04-13 10:29:27 +01:00
emellor@leeni.uk.xensource.com f9eb14bf6a Reset the cached state to XenbusStateInitialising on resume -- we're connecting
to a new backend, so the state value needs to be reset.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-04-12 18:53:38 +01:00
kaf24@firebug.cl.cam.ac.uk 72344c0921 Netfront must switch state using xenbus_switch_state() or this
is not picked up by the waiting code in xenbus_probe.c.

Also clean up the waiting code a little.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-04-10 18:56:34 +01:00
kaf24@firebug.cl.cam.ac.uk 6c33dc4782 Add a new config option for all backend drivers. This has two benefits:
1. All backend drivers can be disabled or modularised via
    one config option.
 2. Backend helper routines that are not specific to any particular driver
    can be disabled or modularised based on this config option. In
    particular this may allow backend drivers plus the service module
    to be upgraded separate from the kernel core as and when the backend
    interfaces change (and they will).

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-04-10 18:30:07 +01:00
emellor@leeni.uk.xensource.com 45fe4ec419 Fix the test inside all_devices_ready, and move it from xenbus_probe (a
postcore_initcall) to a new late_initcall, so that it happens after the
drivers have initialised.

Fixes the reopened bug #549 (I hope).

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-04-10 18:17:54 +01:00
kaf24@firebug.cl.cam.ac.uk 97a7c0c266 Power down an x86 system directly within domain0 rather than
executing a shutdown hypercall. Domain0 is able to execute
ACPI power-off code.

Signed-off-by: Harry Butterworth <butterwo@uk.ibm.com>
2006-04-07 13:40:22 +01:00
kaf24@firebug.cl.cam.ac.uk 6e5243b328 Do not create blkback vbd kernel thread until fully connected
to frontend driver. Otherwise the kernel thread may crash trying
to access the non-existent shared ring.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-04-06 18:39:00 +01:00
smh22@firebug.cl.cam.ac.uk 9444c07bdb Fix long-standing save/restore bug on x86-64.
Signed-off-by: Steven Hand <steven@xensource.com>
2006-04-06 16:15:28 +01:00
kaf24@firebug.cl.cam.ac.uk 66edd49a38 Add code to make handling domain poweroff/reboot symmetrical between
paravirtualized and fully virtualized.  This approach uses the new
sched_op to handle other domains than the current domain.  The new
code, SCHEDOP_remote_shutdown, is very much like SCHEDOP_shutdown, but
is called with the id of the domain which is to be shut down. This
allows fully virtualized shutdown and para-virtualized shutdown to be
identical from that point forward.

A paravirtualized domain uses sched_op to shut down and set the reason
code. This will send a VIRQ_DOM_EXC, which can be handled in dom0 by
control software.  In some ways, this resembles SIGCHILD/waitpid, and
is a reasonable model.

The fully virtualized case has qemu invoke xm directly. This is a
different path than paravirtualized. It also removes decision and
policy making choices from the rest of the control software and places
it within qemu. When any dom0 logic eventually gets a VIRQ_DOM_EXC,
the information about the domain is gone having been destroyed by xm.

A libxenctrl wrapper, xc_shutdown_domain has been added and qemu now
calls it.

As a freebie, #if 0 some very verbose logging code in qemu.  Totally
unrelated, but as long as I was there...

Signed-off-by: Ben Thomas <ben@virtualiron.com>
2006-04-06 15:24:00 +01:00
kaf24@firebug.cl.cam.ac.uk 564a3bf276 More simplifications to blkback:
1. Remove blkif->status field as it's really not needed.
 2. Simplify connection logic.
 3. Get rid of atomic_t io_pending. There's no need for
    atomic r-m-w updates to the work-to-do flag, so replace
    with an integer and add barriers where serialisation is
    required.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-04-06 11:34:14 +01:00
kaf24@firebug.cl.cam.ac.uk 3f7c9e7d7e Stupidly forgot there is a separate waitqueue for free pending request
structures in blkback. Fix my changes to blkif_schedule().

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-04-06 11:13:33 +01:00
kaf24@firebug.cl.cam.ac.uk 4e52e7ef09 Fix the blkif_schedule() kthread loop. Much simpler; much more correct.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-04-06 10:20:32 +01:00
kaf24@firebug.cl.cam.ac.uk 0773e2a340 Fix a problem that was caused by recent changes to the xenbus's
behavior that cause the .remove function not to be called anymore
during suspend. Due to that the driver allocated one more interrupt on
every suspend/resume cycle.  Otherwise some code reformatting,
cleanups and improvements on allocation and freeing of data structure.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-04-06 09:39:30 +01:00
kaf24@firebug.cl.cam.ac.uk 96e1e63322 Remove unused code in netback's net_rx_action():
new_mfn and old_mfn are set in the end half of the function
but they are not used.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-04-06 09:34:30 +01:00
kaf24@firebug.cl.cam.ac.uk fd7dd2c0ce Use PAGE_OFFSET instead of __PAGE_OFFSET in netfront.c.
__PAGE_OFFSET is not defined on all platforms.
Linux/ia64 and Linux/ppc don't have __PAGE_OFFSET definition.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-04-06 09:32:55 +01:00
kaf24@firebug.cl.cam.ac.uk ad9f21014f There are a couple of bugs with the current handling of reads and writes
in the configuration space overlay functions. The wrong offset is passed
to the virtual field handlers. This patch uses the variable which
contains the correct offset. This patch also fixes the logic which
generates the actual value to write to a given virtual configuration
space field.

Signed-off-by: Ryan Wilson <hap9@epoch.ncsc.mil>
2006-04-05 10:52:10 +01:00
kaf24@firebug.cl.cam.ac.uk 1b7e15f112 Fix checksum-offload problems introduced in c/s 9514, due to
data_validated flag not being properly specified on the
device channel.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-04-05 10:37:37 +01:00
emellor@leeni.uk.xensource.com 15b8695184 The attached patch fixes a race condition that occurs if after the
backend has been removed there are still requests pending. This patch
flushed all the pending requests.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-04-03 18:32:43 +01:00
Ian.Campbell@xensource.com d3cf31ddb2 Handle failure to register the xen store event channel instead of
just not initialising xenbus/store when the supervisor_mode_kernel
feature flag is enabled.

When initialising grant tables only -ENOSYS is a valid reason
to fail so BUG_ON anything else like we did prior to changeset
9498.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
2006-04-03 14:34:20 +01:00
kaf24@firebug.cl.cam.ac.uk 0c48c2080d Make checksum handling in the virtual network drivers more robust.
Largely this involves making the logic symmetrical: for example,
not only should netfront be able to tell netback that a packet has
an empty protocol checksum field, but the reverse must also be true.

Another change is that the drivers only advertise IP checksum
offload functionality. There is currently no information
propagated across the device channel about the offset of the
protocol-specific checksum field. Therefore it is not safe to
defer checksum calculation for protocols the remote end may not
understand -- it will end up dropping having to drop the packet.

Yet another change is to allow netback to disable tx checksum
offload, just as we already could for netfront. Currently there is
no support for disabling rx checksum offload -- that would seem
to require some way of propagating the checksum-offload advertisement
(or lack of it) across the device channel, as it really ought to be
the transmitter that acts on it.

Thanks to Ian Jackson for pointing out some of the problems with
our checksum-offload handling. Several of the changes here are
due to his comments.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-04-02 16:16:53 +01:00
kaf24@firebug.cl.cam.ac.uk 17e838d026 [IA64] Include features header in xenbus_probe and build features.c
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
2006-04-01 10:37:36 +01:00