Commit Graph
574 Commits
Author SHA1 Message Date
kaf24@firebug.cl.cam.ac.uk 9fb76f5882 Add module license to xenbus_be, otherwise the module cannot be loaded.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2006-05-08 14:54:22 +01:00
kaf24@firebug.cl.cam.ac.uk b7f7d7a8ec Adjust skb->truesize appropriately in netback driver.
When you generate non-linear skb's as netback does, it is up to you
to ensure that truesize reflects the size of paged part of the skb.
Otherwise socket memory accounting in Linux falls apart.

Thanks to the new check that David Miller added to TCP we were able
to catch this bug.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2006-05-05 13:49:49 +01:00
kaf24@firebug.cl.cam.ac.uk 3b5459241b Fix IA64 transparent-virtualization issue (Xen may not be running).
Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
2006-05-05 13:46:59 +01:00
cl349@firebug.cl.cam.ac.uk 44cf443c79 Linux: upgrade to 2.6.16.13.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2006-05-04 17:38:25 +01:00
kaf24@firebug.cl.cam.ac.uk 55723b70ac This patch
- moves the TPM frontend completely into the char/tpm directory where it
is a plug-in to the generic TPM driver
- removes a now obsolete include file
- adapts part of the documentation
- fixes some locking problems where copy_to/from_user was called with
IRQs blocked

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-05-04 11:22:19 +01:00
cl349@firebug.cl.cam.ac.uk 79d14c1747 Fix xenbus userspace device transaction tracking.
If a transaction end command fails, the semaphore which keeps track
of whether we're in a transaction or not was not getting updated.

Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2006-05-04 10:25:27 +01:00
kaf24@firebug.cl.cam.ac.uk 3d8b0ffdd4 Introduce some finer-grained locking to prevent calling
copy_from/to_user while preventing interrupts and fix allocation of
memory from within a task and other issues.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-05-03 11:00:57 +01:00
kaf24@firebug.cl.cam.ac.uk 9a10a080aa Balloon driver should hijack the ->lru list field rather than
adding another list field to every page structure.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-05-02 17:23:21 +01:00
kaf24@firebug.cl.cam.ac.uk cba8d491b2 Virtual net drivers advertise multicast capabilities.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-05-02 15:46:15 +01:00
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