Commit Graph
524 Commits
Author SHA1 Message Date
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
cl349@firebug.cl.cam.ac.uk 05c8070bb4 Fix do_IRQ high bit masking.
Instead of setting the highest bit (which isn't easily done on native x86_64),
negate the interrupt vector stored in orig_{e,r}ax.
Also add patch for native build.

Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2006-03-31 17:44:26 +01:00
kaf24@firebug.cl.cam.ac.uk e5829dcbe1 Plumb network vif credit-based rate limiting thorugh xenbus
and xend into xm guest config files.

A new vif parameter 'rate' is supported, with an optional time window
paremeter for specifying granularity of credit replenishment. The default
window is 50ms. For example:

 'rate=10Mb/s'  'rate=250KB/s'  'rate=1MB/s@20ms'

From: Chris Clark <christopher.w.clark@gmail.com>

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-31 15:34:52 +01:00
Ian.Campbell@xensource.com 5a5d245c8c Disable xen bus and grant tables when supervisor_mode_kernel is enabled.
Neither of these features are useful/available in this mode since only a
single domain is supported.

Do not attempt to initialise xen bus when supervisor_mode_kernel is
enabled.

Do not BUG_ON() failure to setup grant tables, future versions
of supervisor_mode_kernel may return -ENOSYS here. 

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
2006-03-31 11:04:42 +01:00
emellor@leeni.uk.xensource.com 62b8bcaf48 Merged. 2006-03-31 00:26:07 +01:00
emellor@leeni.uk.xensource.com f207095aac Remove the transaction parameter from xenbus_switch_state and move the state
switch out of a transaction, in the few cases where it is inside one.

In order to behave properly, it is necessary for a driver to know its own
xenbus state (see changeset 9469:b3cb19d2b07f, for example).  This
value is stored as xenbus_device.state and updated by xenbus_switch_state.

If xenbus_switch_state occurs within a transaction, then there is a possibility
that the transaction would be aborted, leaving the state field dangerously out
of sync with the value currently in the store.

This fixes recent problems seen whereby bringing multiple devices up at the
same time results in some devices not coming up (often all of the even-numbered
ones, because of the pattern of transaction conflict).

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-31 00:24:54 +01:00
cl349@firebug.cl.cam.ac.uk 13678d4465 Remove __HYPERVISOR_sched_op_new in favour of a header file interface version number system.
Define interface version in Kconfig and define it through CPPFLAGS for
C and assembly file compilation.
Add HYPERVISOR_{yield,block,shutdown} to remove direct use of sched_op
from guest code.

Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2006-03-30 17:50:44 +01:00
emellor@leeni.uk.xensource.com 4b4593251a Revert accidental commit.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-29 18:46:51 +01:00
emellor@leeni.uk.xensource.com f61bc4e0b8 Merged. 2006-03-29 18:41:30 +01:00
smh22@firebug.cl.cam.ac.uk f9bdf89a1b Fix save/restore on 64-bit.
Signed-off-by: Steven Hand <steven@xensource.com>
2006-03-29 18:07:36 +01:00
smh22@firebug.cl.cam.ac.uk 473e020902 Fix save/restore bug; further rationalization of xenbus state machine
logic deferred until post 3.0.2.

Signed-off-by: Steven Hand <steven@xensource.com>
2006-03-29 18:06:27 +01:00
kaf24@firebug.cl.cam.ac.uk fd8719a931 Clean up and fix VCPU hotplug and SMP save/restore.
1. No longer hold xenbus_lock while taking down VCPUs
    in SMP suspend path. This allows block device hotplug
    to continue working and so we will not deadlock on
    paging in userspace hotplug code.
 2. Track xenbus and local-admin permitted cpumasks for 
    VCPUs to bring online. So, if a local admin takes a
    CPU down, that won't surprisingly get overridden next
    time the kernel interrogates xenstore.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-28 18:43:30 +01:00
cl349@firebug.cl.cam.ac.uk ee35c5fbf6 Change do_IRQ high bit masking.
Allow more than 256 interrupt vectors on native by only setting the
highest bit when marking orig_eax to indicate that we're not within
a system call.

Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2006-03-28 14:19:22 +01:00
cl349@firebug.cl.cam.ac.uk 044cc18bf5 Whitespace.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2006-03-27 11:16:36 +01:00
kaf24@firebug.cl.cam.ac.uk c671da80d2 Rename generic_page_range as apply_to_page_range, export the symbol
to GPL modules. Rename pte_page parameter to pmd_page (following the
Linux idiom). apply_to_pte_range() should take the pte spinlock.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-23 15:30:00 +01:00
kaf24@firebug.cl.cam.ac.uk 7d6c54d484 Support late binding of PCI devices to the PCI backend driver in
dom0. This allows you to bind devices to the backend driver *after*
dom0 has booted. You are no longer required to specify the devices to
hide on the kernel command-line. Using the bind/unbind driver
attributes (see /sys/bus/pci/drivers/pciback), you can specify which
devices that the PCI backend will seize. There are three new driver
attributes in that directory:

slots       - lists all of the PCI slots that
              the PCI backend will try to seize
new_slot    - write the name of a slot here
              (in 0000:00:00.0 format) to have the PCI
              Backend seize the device in this slot
remove_slot - write the name of a slot here to have
              the PCI Backend no longer try to seize a
              device in this slot

Note that writing to new_slot/remove_slot does not actually change
whether the PCI Backend is actually bound to the device in that slot or
not. Instead, it tells the PCI backend which slots it should be
interested in. The sysfs attributes "bind" and "unbind" (which are
common to all drivers, not just the PCI Backend) must be used to
actually add or remove a device from the PCI backend driver. Note that
the syntax for specifying a device to bind and unbind is very strict (do
not append a newline).

For Example:

# Add a new slot to the PCI Backend's list
echo -n 0000:01:04.d > /sys/bus/pci/drivers/pciback/new_slot
# Now that the backend is watching for the slot, bind to it
echo -n 0000:01:04.d > /sys/bus/pci/drivers/pciback/bind

# Unbind a PCI network card from its network driver
echo -n 0000:05:02.0 > /sys/bus/pci/drivers/3c905/unbind
# And now bind it to the PCI Backend
echo -n 0000:05:02.0 > /sys/bus/pci/drivers/pciback/new_slot
echo -n 0000:05:02.0 > /sys/bus/pci/drivers/pciback/bind


Unfortunately, Linux makes it possible to remove (unbind) a PCI device
from the PCI backend while that device is attached to a driver domain.
It is also possible to unload the PCI Backend module while a PCI
Frontend is attached. DON'T DO EITHER OF THESE ACTIONS. This patch will
output warnings if you do try and do these. Be aware that while access
to the configuration space of the device has been revoked, the driver
domain can still access the I/O resources of the device as they have not
been revoked (although I *hope* to explore adding support for this
soon). Before unloading the module or unbinding a device, shutdown your
driver domain.

These patches also convert a few function and variable declarations to
static (no sense in polluting the global namespace with local function
names) and rename a few structures in drivers/xen/pciback/pci_stub.c.

Signed-off-by: Ryan Wilson <hap9@epoch.ncsc.mil>
2006-03-23 10:57:48 +01:00
kaf24@firebug.cl.cam.ac.uk 7a128eeb93 The PCI Frontend doesn't properly clean-up PCI buses and their devices
that are in-use if the PCI Backend goes away. This patch corrects that.

This patch also shortens the timeout in drivers/xen/pcifront/pci_op.c
(in an attempt to minimize the amount of time spent waiting with
interrupts disabled).

Signed-off-by: Ryan Wilson <hap9@epoch.ncsc.mil>
2006-03-23 10:53:55 +01:00
kaf24@firebug.cl.cam.ac.uk e12d3cd719 Update and extend netif transmit/receive flag names.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-23 10:46:28 +01:00
kaf24@firebug.cl.cam.ac.uk 5f4d33b808 Clean up netfront. Eliminate some macros in favour of inline functions.
Fix allocation of receive batching arrays (should be per interface).

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-22 16:48:48 +01:00
kaf24@firebug.cl.cam.ac.uk 0be2ec9f9e Externally triggered reboot signal executes ctrl_alt_del()
rather than calling /sbin/reboot directly.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-22 16:48:00 +01:00
kaf24@firebug.cl.cam.ac.uk 316d5899a0 Replace evtchn macro maze with static inline functions.
Todo: could replace current irq_info packed format with a bitfield.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-22 16:47:18 +01:00
kaf24@firebug.cl.cam.ac.uk 6d10e95f6f A few cleanups based on comments from Arjan van de Ven.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-22 12:21:44 +01:00
kaf24@firebug.cl.cam.ac.uk ea509d3a44 Use shiny new mutexes instead of semaphores where possible in our Linux code.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-22 11:55:43 +01:00
kaf24@firebug.cl.cam.ac.uk 8d9256b041 Licensing clarifications in Linux source files:
1. Make it clear in all dual-licensed files that the
    license when distributed with Linux is GPLv2.
 2. Add MODULE_LICENSE(dual) in a few places.
 3. Change many of our EXPORT_SYMBOL() decls to EXPORT_SYMBOL_GPL().
    This is the preference of the Linux maintainers, and avoids any
    trouble down the road if our EXPORT_SYMBOL'ed functions use Linux
    internal interfaces that are GPL only.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-22 11:30:57 +01:00
kaf24@firebug.cl.cam.ac.uk 2e3c599844 Fix a build problem when enabling XEN_SYSFS on xen/ia64.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
2006-03-21 22:48:04 +01:00
emellor@leeni.uk.xensource.com 7555524dd7 Merged. 2006-03-21 12:26:38 +01:00
emellor@leeni.uk.xensource.com fb57267cd6 Only send the OFFLINE hotplug event if be->netif is set. Firstly, this ensures
that OFFLINE is only sent if the ONLINE event has been sent.  Secondly, this
fixes one possible cause of the reopened bug #549 as it prevents be->netif
being dereferenced inside netback_uevent.  Early reports suggest that this is
not the only cause of #549, so that bug remains open for now.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-21 12:25:23 +01:00
kaf24@firebug.cl.cam.ac.uk 728b3dab17 Creates a module that exports Xen Hypervisor attributes to sysfs. The
module has a tri-state configuration so it can be a loadable module.

Views the hypervisor as hardware device, uses sysfs as  a scripting
interface for user space tools that need these attributes.

Some user space apps, particularly for systems management, need to
know if their kernel is running in a virtual machine and if so in
what type of virtual machine. This property is contained in the
file /sys/hypervisor/type.

The file hypervisor_sysfs.c creates a generic  hypervisor subsystem
that can be linked to by any hypervisor. The file xen_sysfs.c exports
the xen-specific attributes.

Signed-off-by: Mike D. Day <ncmike@us.ibm.com>
2006-03-21 12:17:19 +01:00
kaf24@firebug.cl.cam.ac.uk 4a58d57594 Add poll() support to xenbus device file.
From: Gerd Hoffmann
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-20 12:00:58 +01:00
vhanquez@kneesa.uk.xensource.com be4c0619d5 Fix a race that crash domU by calling xenbus_probe twice if it receive event
between xs_init and setting xenbus_running

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-03-18 13:56:34 +00:00
cl349@firebug.cl.cam.ac.uk ce0bcf0e64 Update to Linux 2.6.16-rc6.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>


--HG--
rename : patches/linux-2.6.16-rc5/i386-mach-io-check-nmi.patch => patches/linux-2.6.16-rc6/i386-mach-io-check-nmi.patch
rename : patches/linux-2.6.16-rc5/net-csum.patch => patches/linux-2.6.16-rc6/net-csum.patch
rename : patches/linux-2.6.16-rc5/pmd-shared.patch => patches/linux-2.6.16-rc6/pmd-shared.patch
rename : patches/linux-2.6.16-rc5/smp-alts.patch => patches/linux-2.6.16-rc6/smp-alts.patch
2006-03-18 00:12:26 +00:00
vhanquez@kneesa.uk.xensource.com 18b6341b93 Reinitialize producer and consumer index to 0 if indexes corruption are detected
in XenBus.
Prevent a kernel infinite loop and add more recovering ability.

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-03-17 10:03:37 +00:00
vhanquez@kneesa.uk.xensource.com 6ac4acde21 Substitute kmalloc+memset by kzalloc where possible
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-03-17 09:52:05 +00:00
kaf24@firebug.cl.cam.ac.uk abed9e6eea Explicitly include time.h to get gettimeofday declaration.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-16 12:34:27 +01:00
kaf24@firebug.cl.cam.ac.uk 7d2b8840b8 pcifront poll loop now checks gettimeofday rather than jiffies,
as the latter does not increase while interrupts are disabled.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-16 12:31:16 +01:00
kaf24@firebug.cl.cam.ac.uk 3b9ba71177 Make MTU rx check in netfront more permissive to allow for 8021q vlan tagging.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-15 12:52:33 +01:00
vhanquez@kneesa.uk.xensource.com ba07c577c6 Do not BUG when receiving unexpected message type from xenbus
print a warning and discard the query

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
2006-03-15 11:09:45 +00:00
kaf24@firebug.cl.cam.ac.uk badff410e4 Define a new sched_op hypercall called sched_op_new, which differs from the
legacy hypercall in that it takes a pointer to a block of extra arguments
rather than an opaque unsigned long. The old hypercall still exists, for
backwards compatibility.

The new hypercall supports new sub-command SCHEDOP_poll, which can be used to
wait on a set of event-channel ports with an optional timeout. This is exported
in XenLinux as HYPERVISOR_poll, and used in the pcifront driver to wait on a
response from the pciback driver.

Can also be used for debuggers. :-)

Signed-off-by: Keir Fraser <keir@xensource.com>
Signed-off-by: John Levon <john.levon@sun.com>
2006-03-14 19:33:45 +01:00
kaf24@firebug.cl.cam.ac.uk 021c621639 Initialise blkfront_info to zeroes after allocating it.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-14 15:18:35 +01:00
kaf24@firebug.cl.cam.ac.uk 4e20802918 Clean up block-device hotplug routines in xenlinux.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-13 15:06:58 +01:00
kaf24@firebug.cl.cam.ac.uk d8864ab7b3 Add missing include of a header file to avoid a compile warning.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-12 10:03:33 +01:00
kaf24@firebug.cl.cam.ac.uk b4adf19334 pciback sends evtchn notification to pcifront when its request is processed.
This may in future allow pcifront to avoid spin-waiting.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-12 09:52:19 +01:00