Commit Graph
1095 Commits
Author SHA1 Message Date
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
kaf24@firebug.cl.cam.ac.uk f651bf191b The ia64 build doesn't yet include drivers/xen/Kconfig directly so we
need to replicate the new XEN_INTERFACE_VERSION option in the arch
Kconfig.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
2006-03-31 10:06:20 +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
cl349@firebug.cl.cam.ac.uk 811ca618e3 Change how we add the include asm override to CPPFLAGS.
Add to CPPFLAGS instead of entirely redefining it.

Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2006-03-30 17:50:40 +01:00
kaf24@firebug.cl.cam.ac.uk 31903a3370 Include the E7520 (e.g., Dell 1850) irqbalance quirk fix even when
building a non-SMP kernel. The underlying hypervisor may still be SMP.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-30 14:06:11 +01:00
kaf24@firebug.cl.cam.ac.uk 919a239a3c Same panic() behaviour as native Linux when running as domain 0.
That is, no reboot: just sit there and flash the keyboard LEDs.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-30 00:11:53 +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 111ce84369 Some fixes to IRET hypercall and failsafe callback handlers:
1. IRET hypercall must restore the event callback mask. This
    was missing on x86/64, and both subarchitectures now restore
    from EFLAGS.IF.
 2. Failsafe callbacks are fixed to detect whether fault is due to
    bad segment or due to IRET. In the latter case we now
    immediatiately kill the process. This avoids infinite looping
    between IRET hypercall and failsafe callback handler in the guest.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-29 12:02:45 +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 e8e51446b5 Remove special handling of {set,clear}_in_cr4().
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2006-03-28 10:09:44 +01:00
kaf24@firebug.cl.cam.ac.uk 80605be3af Simplify the failsafe callback handler in x86/64 linux. It doesn't
need to try reloading segment selectors (unlike i386 linux).

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-28 10:01:35 +01:00
kaf24@firebug.cl.cam.ac.uk 9dd08d8ffb Add -xen buildconfig for ia64 and tweak CONFIG_VT setup to avoid
initializing on domUs.  Remove CONFIG_IDE_GENERIC as this is
unnecessary on ia64 systems (no ISA IDE controllers) and causes long
timeouts booting domU.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
2006-03-28 09:57:48 +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
cl349@firebug.cl.cam.ac.uk 3495154652 Remove unused variable.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2006-03-23 16:21:05 +00: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 fed2a3f4c4 merge with xen-ia64-unstable.hg 2006-03-22 19:18:42 +01:00
kaf24@firebug.cl.cam.ac.uk c048a39db2 Paravirtualise the CPUID instruction by forcing emulation with an invalid-opcode prefix.
This allows to clear feature flags and hide unsupported features from guests.

Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-22 19:05:50 +01:00
awilliam@xenbuild.aw 6a59751ba0 [IA64] build xen_sysfs by default
This works on xen/ia64 too, enable the code

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
2006-03-22 10:04:43 -07: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 6e79784b9d On x86/64 a domU kernel just sits around forever on a panic because
the HV doesn't know it crashed.  This patch sends the signal, which
allows the kernel to be cleaned up (according to whatever guest.conf
rules). It is basically copied and pasted from the i386 branch.

From: Don Zickus
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-22 10:38:44 +01:00
kaf24@firebug.cl.cam.ac.uk 2e327ea4ab Clean up #include in init-xen.h.
Signed-off-by: Muli Ben-Yehuda <mulix@mulix.org>
2006-03-21 22:55:29 +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
kaf24@firebug.cl.cam.ac.uk af34eb43a1 Nanosecs not usecs in a time comment.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-21 15:40:54 +01:00
kaf24@firebug.cl.cam.ac.uk e718ef7000 'permitted_clock_jitter' units are nanoseconds not microseconds.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-21 15:10:26 +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
emellor@leeni.uk.xensource.com d24b3a43ce Fix the implicit declaration of function `swiotlb_init' warning, by including
the appropriate headers.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
2006-03-21 12:21:08 +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
cl349@firebug.cl.cam.ac.uk f9da43103c Update to Linux 2.6.16.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>


--HG--
rename : patches/linux-2.6.16-rc6/i386-mach-io-check-nmi.patch => patches/linux-2.6.16/i386-mach-io-check-nmi.patch
rename : patches/linux-2.6.16-rc6/net-csum.patch => patches/linux-2.6.16/net-csum.patch
rename : patches/linux-2.6.16-rc6/pmd-shared.patch => patches/linux-2.6.16/pmd-shared.patch
rename : patches/linux-2.6.16-rc6/smp-alts.patch => patches/linux-2.6.16/smp-alts.patch
2006-03-20 20:10:17 +00: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