Commit Graph
1710 Commits
Author SHA1 Message Date
kfraser@localhost.localdomain a1daf484e9 [BLK] Add support for barrier writes to blkfront/blkback.
Protocol changes:
 * There is a new operation (BLKIF_OP_WRITE_BARRIER)
   to pass on barrier requests.
 * There is a new state (BLKIF_RSP_EOPNOTSUPP) to indicate
   unsupported operations (barrier writes may fail depending
   on the underlying block device).
 * A new xenstore node named "feature-barrier" indicates the
   backend is able to handle barrier writes.  The value can
   be 1 (all is fine) or 0 (underlying block device doesn't
   support barriers).

blkback changes:  Add "feature-barrier" node to indicate barrier
support, pass incoming barrier requests to the block layer using
submit_bio(WRITE_BARRIER, bio).  Some error handling fixes to
properly pass through barrier write failures, so the frontend
can turn off barriers then.

blkfront changes:  Check if the backend sets "feature-barrier", if
present switch to QUEUE_ORDERED_DRAIN mode.  Send off barrier
requests to the backend using the new BLKIF_OP_WRITE_BARRIER
operation.  Also some error handling for the EOPNOTSUPP case.

Background:  Barriers are needed to make journaling filesystems work
reliable.  For some requests they need order constrains to make the
transactions work correctly.  Barrier requests are used to pass that
ordering information to the block layer and/or to the device, so the
constrains are obeyed when reordering requests for better write
performance.

Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
2006-11-09 16:49:59 +00:00
kfraser@localhost.localdomain de083f6648 [BLK] Expand number of fake-SCSI VBD volumes supported to 120.
Signed-off-by: Takanori Kasai <Kasai.Takanori@jp.fujitsu.com>
Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
2006-11-09 12:07:28 +00:00
kfraser@localhost.localdomain 39b46b711f [BLKTAP] ia64 support
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-11-07 11:17:39 +00:00
kfraser@localhost.localdomain c58282c9f4 [BLKTAP] avoid race between tapdisk and xvd daemon with ufe_ring.
- Tapdisk updates rsp_cons by ioctl(). on the other hand xvd daemon
  reads rsp_cons in do_block_io_op() with RING_FULL().
  Copy request and memory barrier before updating rsp_cons.
- Tapdisk access req_prod_pvt with select(). on the other hand xvd
  daemon updates it in do_block_io_op().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-11-07 11:14:52 +00:00
kfraser@localhost.localdomain 720860012a [BLKTAP] Various cleanups necessary for ia64 support.
- remove magic number 8 and 64.
  page size / sector size is 8 on x86, however on ia64 page size is
  16kb.
  blkring size is 64 on x86. however it's 128 on ia64.
- replace 0xFFFF with INVALID_GRANT_HANDLE
- don't map io ring into user space with uncachable.
  kernel access the page with cacable and tapdisk uses memory barrier
  so that it isn't necessary.
- remove printk warning and inserted new line.
- remove unused variable, page.
- add one BUG()

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2006-11-07 11:01:35 +00:00
kfraser@localhost.localdomain 53aff3a78c [NET] back: Fix wrap to zero in transmit credit scheduler.
This could happen when credit_bytes == ~0UL (i.e., scheduling is 'disabled').
Signed-off-by: Kirk Allan <kallan@novell.com>
2006-11-07 09:48:19 +00:00
kfraser@localhost.localdomain ff8bf0b0f4 PV-on-HVM: Fix PV-on-HVM drivers need maddr.h included for defn of maddr_t.
Signed-off-by: Takanori Kasai <Kasai.Takanori@jp.fujitsu.com>
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
2006-11-07 09:29:53 +00:00
kfraser@localhost.localdomain 77d409f7f2 [LINUX] Use pfn_to_page instead of relying in memory assumptions
This makes usage agnostic wrt the memory model being used.

Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
2006-11-07 09:28:18 +00:00
kfraser@localhost.localdomain adf74ce752 [LINUX] Don't use uint64_t parameter to gnttab_set_{,un}map_op() when
the upper 32 bits will never be used (i.e., i386 non-pae).
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2006-11-06 09:02:15 +00:00
kfraser@localhost.localdomain 66d409985f [LINUX] Clean up header includes (gnttab.h from fixmap.h).
include/asm-{i386,x86_64}/mach-xen/asm/fixmap.h was needlessly
including include/xen/gnttab.h. Removing this made necessary explicit
inclusion of that header in tpm_xen.c, the build of which should not
have succeeded on non-x86 architectures before.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2006-11-03 12:10:02 +00:00
kfraser@localhost.localdomain 7fd6304c64 [BLKTAP] Fix gnttab unmap call to specify that address contains PTE.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2006-11-03 12:08:42 +00:00
kfraser@localhost.localdomain af7afdc2a1 [BLKTAP] Fix Linux and Xen gnttab map operations when mapping into
PTEs above 4GB on PAE systems.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
2006-11-02 18:18:19 +00:00
Ian Campbell 680c789da1 PV-on-HVM: Conditionally disable checksum offload for receive on some
older kernels.

On some older kernels the CHECKSUM_UNNECESSARY flag on received
skbuffs is not honoured by all subsystems, specifically netfilter
under 2.6.9-42.EL

To work around this we need to ensure that the correct checksum is
calculated at some point. We can cause the backend to do this for us
by advertising to the backend that we cannot support checksum offload.

The correlation of this issue with the presence of NETIF_F_TSO is not
100% but it is a good first approximation.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
2006-11-02 11:56:26 +00:00
Ian Campbell 4101fafcc0 PV-on-HVM: Tweak reboot.c to be compatible with older kernels.
call_usermodehelper_keys() was not available until 2.6.13 but since we
pass session_keyring as NULL we may as well use call_usermodehelper()
anyway.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
2006-11-02 11:56:26 +00:00
Ian Campbell d8656aaa3e PV-on-HVM: Fix PV-on-HVM drivers for IA64.
Thanks to Kasai Takanori and Doi Tsunehisa for testing.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
2006-11-02 11:56:26 +00:00
kfraser@localhost.localdomain 27c01325d4 [NET] front: Clean up error handling. This eliminates earlier
workaround patch for an observed crash.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-31 16:18:07 +00:00
kfraser@localhost.localdomain fc229c860b Clean up recent changes to reboot code. This fixes PV save/restore.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-31 15:54:03 +00:00
Steven Smith 69ff2305bb Merge. 2006-10-31 11:44:47 +00:00
Steven Smith 937f23487a [NETFRONT] Make sure we don't crash if the backend goes to state
Closing before we have a chance to connect.  This can happen if
there's an error while connecting.

Signed-off-by: Steven Smith <sos22@cam.ac.uk>
2006-10-31 11:31:34 +00:00
Steven Smith 98f201b0e5 Merge. 2006-10-31 10:12:35 +00:00
Steven Smith 111a11e5f5 [HVM][LINUX][TOOLS] Split control/reboot_module into control/feature-reboot
and control/feature-sysrq.  This is more consistent with the other
PV device protocols.

Signed-off-by: Steven Smith <sos22@cam.ac.uk>
2006-10-31 10:11:53 +00:00
Steven Smith 65ae4fc8cd [HVM][LINUX][TOOLS] Make xm {shutdown|reboot} do something sensible for HVM
domains with PV drivers loaded.  This patch creates a new PV-on-HVM
module, reboot.ko, which, when loaded, creates control/reboot_module
in the store.  The tools notice this, and disable the watch which would
normally destroy HVM domains which are the target of an xm shutdown
command, allowing the reboot module to shut the domain down cleanly.

Signed-off-by: Tetsu Yamamoto <yamamoto.tetsu@jp.fujitsu.com>

(Checkin comments by Steven Smith <sos22@cam.ac.uk>)
2006-10-31 09:54:49 +00:00
kfraser@localhost.localdomain f99eaa7a3b [NET] back: Remove warning about non-zero tx queue length.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-31 09:49:31 +00:00
kfraser@localhost.localdomain 11b39cba56 [LINUX] Fix build breakage from previous patch.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-30 14:28:29 +00:00
kfraser@localhost.localdomain 3d91901864 [LINUX] Use CONFIG_XEN_COMPAT_030002 where possible.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2006-10-30 14:14:46 +00:00
kfraser@localhost.localdomain fa088340b4 [LINUX] Declare structs as 'static __initdata' where possible.
Probably still not catching all possible cases, but using static
(where not already the case) makes the code size smaller, and using __initdata
has the usual advantages.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2006-10-30 14:09:13 +00:00
kfraser@localhost.localdomain 8ba0049cfc [LINUX] privcmd: Range-check hypercall index.
Otherwise, bugs in e.g. libxc may bring the kernel down.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2006-10-30 14:04:44 +00:00
kfraser@localhost.localdomain 98c075c804 [NET] back: Advertise that we do not support rx-flip path any more.
This will now be used only by older guests who do not understand
the feature-rx-{copy,flip} feature flags.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-26 11:50:17 +01:00
awilliam@xenbuild.aw f1c6ac2751 [IA64] NUMA support
Based on patch from Tristan Gingold

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
2006-10-25 14:48:55 -06:00
awilliam@xenbuild.aw 506aac287c merge with xen-unstable.hg 2006-10-25 12:12:01 -06:00
Ian Campbell 06b12ba822 PV-on-HVM: Add infrastructure for a compatibility shim in order to
support PV-on-HVM drivers for older kernel releases.

The compatability code is included in the xen-platform-pci module
since this module underpins all the others.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
2006-10-25 13:58:30 +01:00
Ian Campbell 5631980c09 [LINUX] PV-on-HVM: The elevator_init prototype changed in 2.6.10
Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
2006-10-25 13:58:30 +01:00
Ian Campbell 20b18801a9 [LINUX] PV-on-HVM: Implement HDIO_GETGEO ioctl on kernels before
2.6.16.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
2006-10-25 13:58:30 +01:00
Ian Campbell 0d7bcbe60d [LINUX] PV-on-HVM: The probe, remove and shutdown methods were added
to struct bus_type in 2.6.16. For older kernels use the methods on the
struct device_driver.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
2006-10-25 13:58:30 +01:00
Ian Campbell 27e0aaa9a7 [LINUX] PV-on-HVM: Only initialize the owner field of struct
device_driver on kernels from 2.6.10 onward. The field was not
available until then.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
2006-10-25 13:58:30 +01:00
Ian Campbell 160e8134cb [LINUX] Exclude support for /proc/xen/xsd_kva when building a
non-privileged guest.

This is useful for PV-on-HVM because it removes code which would
otherwise require extra code in the compatability shim.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
2006-10-25 13:58:30 +01:00
Ian Campbell 3ac6239a86 [LINUX] PV-on-HVM: Remove the attr parameter from device attribute
show methods on kernels prior to 2.6.13. The parameter was not present
before that.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com>
2006-10-25 13:58:30 +01:00
Ian Campbell a7b5ded0d9 [LINUX] Move xenbus backend probing into a separate source file and
only build it when CONFIG_XEN_BACKEND is set.

This removes unused code from frontend only configurations and also
makes PV-on-HVM drivers on older kernels simpler by removing code
which would otherwise require extra code in the compatability shim.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
2006-10-25 13:58:30 +01:00
Ian Campbell 4f3230eb63 [LINUX] PV-on-HVM: Directly include headers which are used in various
files rather than relying on them being included indirectly.

This is required because these headers are not pulled in indirectly on
older kernels.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
2006-10-25 13:58:30 +01:00
kfraser@localhost.localdomain 94e4fb8a1d [BLOCK] blkback: Fix potential grant entry leaks on error
As it stands grant entries for the actual data are mapped in bulk.
If one of the earlier entries fail to be mapped, it can cause all
subsequent entries to be leaked if they were successfully mapped.

This patch changes it so that we will continue to reap grant entries
even when an error is detected.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2006-10-25 10:59:00 +01:00
awilliam@xenbuild.aw 3e081e983e merge with xen-unstable.hg 2006-10-24 11:21:48 -06:00
kfraser@localhost.localdomain 63175f1993 [BLKTAP] Do not allocate a descriptor for blktap control device
(minor 0).

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
2006-10-23 14:19:14 +01:00
kfraser@localhost.localdomain 7a9e5b2775 [BLKTAP] Only allocate tapfd descriptors when they are requested.
Currently all are allocated at bootup, even when they will never be used.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
2006-10-23 14:18:16 +01:00
kfraser@localhost.localdomain ccf92acf14 [BALLOON] Add a sysfs interface.
Information is located under /sys/devices/system/memory.

Original patch from Satoshi UCHIDA <s-uchida@ap.jp.nec.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-23 14:09:01 +01:00
kfraser@localhost.localdomain 61ca72df6f [NET] back: Fix packet queuing so that packets are drained if the
interface is blocked for longer than 500ms. This avoids deadlock
situations where interfaces cannot be destroyed because some other
dormant interface is holding resources.

Signed-off-by: Christopher Clark <christopher.clark@cl.cam.ac.uk>
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-10-23 11:20:37 +01:00
kfraser@localhost.localdomain 7a57f20be7 [BLOCK] blkback: Fix first_sect check.
The blkback code checks first_sect by computing last_sect - first_sect
+ 1. If this is not positive then the request is
rejected. Unfortunately, the calculation is stored in an unsigned
integer before the check is made so negative values will not be
rejected.

This patch fixes this by explicitly comparing first_sect with
last_sect.

The blktap code is similar but it stores the difference in a signed
integer so it's okay.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2006-10-23 10:05:32 +01:00
kfraser@localhost.localdomain 76da00df1a [BLOCK] blkback: Copy shared data before verification
As it is blkback verifies the metadata from the frontend in place.
This means we run the risk of the frontend changing the data after
we've verified it.  This patch copies the data onto the stack before
verifying and using it to ensure we see a consistent snapshot.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2006-10-23 10:00:14 +01:00
awilliam@xenbuild.aw b5f74534ce merge with xen-unstable.hg 2006-10-22 15:23:52 -06:00
Steven Hand cd6f6ef849 Omit seg fixup warning if it's just from statically linked init.
Signed-off-by: Steven Hand <steven@xensource.com>
2006-10-20 11:49:00 +01:00
kfraser@localhost.localdomain dbcc721001 [BLKTAP]: Fix potential grant entry leaks on error
As it stands grant entries for the actual data are mapped in bulk.
If one of the earlier entries fail to be mapped, it can cause all
subsequent entries to be leaked if they were successfully mapped.

This patch changes it so that we will continue to reap grant entries
even when an error is detected.

There is still a potential leak if create_lookup_pte_addr fails
in fast_flush_area.  This leak is not affected by this patch.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2006-10-20 09:28:31 +01:00