]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/log
legacy/linux-2.6.18-xen.git
13 years agolinux-2.6.18/x86: replace order-based range checking of M2P table by linear one
Jan Beulich [Mon, 25 Jul 2011 12:48:41 +0000 (13:48 +0100)]
linux-2.6.18/x86: replace order-based range checking of M2P table by linear one

The order-based approach is not only less efficient (requiring a shift
and a compare, typical generated code looking like this

        mov     eax, [machine_to_phys_order]
        mov     ecx, eax
        shr     ebx, cl
        test    ebx, ebx
        jnz     ...

whereas a direct check requires just a compare, like in

        cmp     ebx, [machine_to_phys_nr]
        jae     ...

), but also slightly dangerous in the 32-on-64 case - the element
address calculation can wrap if the next power of two boundary is
sufficiently far away from the actual upper limit of the table, and
hence can result in user space addresses being accessed (with it being
unknown what may actually be mapped there).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
13 years agoxen: add privileged (dom0) kernel feature indication
Jan Beulich [Sat, 23 Jul 2011 07:51:31 +0000 (08:51 +0100)]
xen: add privileged (dom0) kernel feature indication

Signed-off-by: Jan Beulich <jbeulich@novell.com>
13 years agoSync Xen public headers.
Keir Fraser [Sat, 23 Jul 2011 07:51:07 +0000 (08:51 +0100)]
Sync Xen public headers.

Signed-off-by: Keir Fraser <keir@xen.org>
13 years agoblkfront: avoid NULL de-reference in CDROM ioctl handling
Jan Beulich [Fri, 8 Jul 2011 12:23:47 +0000 (13:23 +0100)]
blkfront: avoid NULL de-reference in CDROM ioctl handling

Just like already done in the default case, for CDROM_GET_CAPABILITY
info->gd should not be blindly de-referenced, as the ioctl can be
called prior to full device setup having completed.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
13 years agoRevert 1096:0fc6424770c8
Keir Fraser [Fri, 8 Jul 2011 12:18:31 +0000 (13:18 +0100)]
Revert 1096:0fc6424770c8

13 years agoxen: add privileged/unprivileged kernel feature indication
Jan Beulich [Fri, 8 Jul 2011 07:36:27 +0000 (08:36 +0100)]
xen: add privileged/unprivileged kernel feature indication

This is the kernel side change accompanying the earlier sent Xen side
patch titled identically.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
13 years agoxenbus: replace list_for_each..._safe() by list_for_each...() where possible
Jan Beulich [Thu, 23 Jun 2011 10:14:00 +0000 (11:14 +0100)]
xenbus: replace list_for_each..._safe() by list_for_each...() where possible

There's no need for using the ..._safe() list iterators when deletion
of objects is followed by a loop exit.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
13 years agoxenbus: xenbus_gather()/xenbus_scanf() usage adjustments
Jan Beulcih [Thu, 23 Jun 2011 10:13:16 +0000 (11:13 +0100)]
xenbus: xenbus_gather()/xenbus_scanf() usage adjustments

- don't use xenbus_gather() for just a single, non-string item (as it
  doesn't do format checking on its inputs)
- grant references don't need to be parsed as "long", since
  grant_ref_t
  is a typedef of uint32_t
- in the frontend protocol determination logic in blkback and blktap,
  don't parse into a local buffer - use the allocated string directly

Signed-off-by: Jan Beulich <jbeulich@novell.com>
13 years agoxenbus: add __attribute__((format(printf... where appropriate
Jan Beulcih [Thu, 23 Jun 2011 10:12:32 +0000 (11:12 +0100)]
xenbus: add __attribute__((format(printf... where appropriate

From: Joe Perches <joe@perches.com>

Use the compiler to verify printf formats and arguments.

Fix fallout.

Signed-off-by: Joe Perches <joe@perches.com>
Make apply, slightly re-format, and fix more fallout (in blktap).

Signed-off-by: Jan Beulcih <jbeulich@novell.com>
13 years agoxenbus: simplify xenbus_dev_request_and_reply()
Jan Beulich [Wed, 1 Jun 2011 15:17:19 +0000 (16:17 +0100)]
xenbus: simplify xenbus_dev_request_and_reply()

No need to retain a local copy of the full request message, only the
type is really needed.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
13 years agoxenbus: don't BUG() on user mode induced conditions
Jan Beulich [Wed, 1 Jun 2011 15:16:45 +0000 (16:16 +0100)]
xenbus: don't BUG() on user mode induced conditions

Neither allocation failure nor inability to locate a user mode
specified transaction ID should lead to a kernel crash. For
XS_TRANSACTION_END also don't issue anything to xenbus if the
specified ID doesn't match that of any active transaction.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
13 years agoxen/blktap: fix locking
Jan Beulich [Wed, 1 Jun 2011 15:09:50 +0000 (16:09 +0100)]
xen/blktap: fix locking

blktap_read_ufe_ring() invalidating the mmap index of a request could
race with blktap_clear_pte() reading it. Move the invalidation into
the info->mm->mmap_sem protected region in fast_flush_area(), noting
that doing this on the failure path of dispatch_rw_block_io() is
benign.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
13 years agoxen/blkback: don't fail empty barrier requests
Jan Beulich [Thu, 26 May 2011 11:33:41 +0000 (12:33 +0100)]
xen/blkback: don't fail empty barrier requests

The sector number on empty barrier requests may (will?) be
uninitialized (neither bio_init() nor rq_init() set the respective
fields), which allows for exceeding the actual (virtual) disk's size.

Inspired by Konrad's "When writting barriers set the sector number to
zero...", but instead of zapping the sector number (which is wrong for
non-empty ones) just ignore the sector number when the sector count is
zero.

While at it also add overflow checking to the math in vbd_translate().

Signed-off-by: Jan Beulich <jbeulich@novell.com>
13 years agoblkback: don't call vbd_size() if bd_disk is NULL
Laszlo Ersek [Thu, 26 May 2011 07:09:04 +0000 (08:09 +0100)]
blkback: don't call vbd_size() if bd_disk is NULL

...because vbd_size() dereferences bd_disk if bd_part is NULL.

Signed-off-by: Laszlo Ersek<lersek@redhat.com>
Acked-by: Jan Beulich <jbeulich@novell.com>
13 years agonetfront: plug a theoretical leak on setup_device()'s error path
Laszlo Ersek [Thu, 26 May 2011 07:07:05 +0000 (08:07 +0100)]
netfront: plug a theoretical leak on setup_device()'s error path

Suppose the frontend is in XenbusStateInitialising and the backend
advances to XenbusStateInitWait. backend_changed() will call
network_connect() -> talk_to_backend() -> setup_device().

If bind_listening_port_to_irqhandler() fails (due to event channel
allocation failure, dynamic IRQ allocation failure etc), then the
grant references and the shared ring pages remain allocated. The error
percolates back to backend_changed() without any cleanup.
backend_changed() will not change the frontend state; it will stay in
XenbusStateInitialising. If the backend retries XenbusStateInitWait
(possibly through a fake, no-op mediate state, like
XenbusStateClosed), then the frontend repeats the above call chain and
leaks the previously unreleased ring pages and grant references.

If setup_device() fails to grant access to the RX page before it tries
to call bind_listening_port_to_irqhandler(), then only the TX page /
grant reference are leaked in the next round.

I'm not sure what happens when the RX page allocation fails:
xenbus_dev_fatal() is called then, which changes the frontend's state
and seems to preclude a second immediate call to network_connect(). I
think this patch shouldn't hurt in that case either (or after
earlier failures in setup_device() for that matter).

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
13 years agosfc_netfront: fix an unused variable error
Jan Beulich [Mon, 23 May 2011 17:36:33 +0000 (18:36 +0100)]
sfc_netfront: fix an unused variable error

Make the code in netfront_accel_enqueue_skb_multi() match that in
netfront_accel_enqueue_skb_single().

Signed-off-by: Jan Beulich <jbeulich@novell.com>
13 years agotmem: Fix build after public header sync.
Keir Fraser [Fri, 20 May 2011 14:53:56 +0000 (15:53 +0100)]
tmem: Fix build after public header sync.

Signed-off-by: Keir Fraser <keir@xen.org>
13 years agoFix Makefile for newer versions of GNUmake.
Keir Fraser [Fri, 20 May 2011 14:53:38 +0000 (15:53 +0100)]
Fix Makefile for newer versions of GNUmake.

Signed-off-by: Keir Fraser <keir@xen.org>
13 years agoxen-kbdfront - advertise either absolute or relative coordinates
Olaf Hering [Fri, 20 May 2011 07:51:36 +0000 (08:51 +0100)]
xen-kbdfront - advertise either absolute or relative coordinates

Mainline commit 8c3c283e6bf463ab498d6e7823aff6c4762314b6
Mainline commit c36b58e8a9112017c2bcc322cc98e71241814303

    A virtualized display device is usually viewed with the vncviewer
    application, either by 'xm vnc domU' or with vncviewer
    localhost:port.  vncviewer and the RFB protocol provides absolute
    coordinates to the virtual display. These coordinates are either
    passed through to a PV guest or converted to relative coordinates
    for a HVM guest.

    A PV guest receives these coordinates and passes them to the
    kernels evdev driver. There it can be picked up by applications
    such as the xorg-input drivers. Using absolute coordinates avoids
    issues such as guest mouse pointer not tracking host mouse pointer
    due to wrong mouse acceleration settings in the guests X display.

    Advertise either absolute or relative coordinates to the input
    system and the evdev driver, depending on what dom0 provides. The
    xorg-input driver prefers relative coordinates even if a devices
    provides both.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
13 years agoSync Xen public headers.
Keir Fraser [Fri, 20 May 2011 07:50:33 +0000 (08:50 +0100)]
Sync Xen public headers.

Signed-off-by: Keir Fraser <keir@xen.org>
13 years agoxenbus: fix xenbus_transaction_start() hang caused by double xenbus_transaction_end()
Laszlo Ersek [Mon, 16 May 2011 12:26:45 +0000 (13:26 +0100)]
xenbus: fix xenbus_transaction_start() hang caused by double xenbus_transaction_end()

vbd_resize() up_read()'s xs_state.suspend_mutex twice in a row via
double xenbus_transaction_end() calls. The next down_read() in
xenbus_transaction_start() (at eg. the next resize attempt) hangs.

See RHBZ#618317.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Jan Beulich <jbeulich@novell.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
14 years agoxen/blkfront: fix data size for xenbus_gather in connect()
Jan Beulich [Mon, 9 May 2011 09:02:19 +0000 (10:02 +0100)]
xen/blkfront: fix data size for xenbus_gather in connect()

From: Marek Marczykowski <marmarek@mimuw.edu.pl>

barrier variable is int, not long. This overflow caused another
variable override: "err" (in PV code) and "binfo" (in xenlinux code -
drivers/xen/blkfront/blkfront.c). The latter caused incorrect device
flags (RO/removable etc).

Signed-off-by: Marek Marczykowski <marmarek@mimuw.edu.pl>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agokdump pv-on-hvm: reset PV devices in crash kernel
Olaf Hering [Tue, 5 Apr 2011 11:42:02 +0000 (12:42 +0100)]
kdump pv-on-hvm: reset PV devices in crash kernel

After triggering a crash dump in a HVM guest, the PV backend drivers
will remain in connected state.  When the kdump kernel starts the PV
drivers will skip such devices.  As a result, no root device is found
and the vmcore cant be saved.

With this change all frontend devices with state XenbusStateConnected
will be reset by changing the state file to
Closing/Closed/Initializing.  This will trigger a disconnect in the
backend drivers. Now the frontend drivers will find the backend
drivers in state Initwait and can connect.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
14 years agokdump pv-on-hvm: introduce "reset_devices" command line option
Olaf Hering [Tue, 5 Apr 2011 11:41:39 +0000 (12:41 +0100)]
kdump pv-on-hvm: introduce "reset_devices" command line option

    upstream commit 7e96287ddc4f42081e18248b6167041c0908004c

    [PATCH] kdump: introduce "reset_devices" command line option

    Resetting the devices during driver initialization can be a costly
    operation in terms of time (especially scsi devices).  This option
    can be
    used by drivers to know that user forcibly wants the devices to be
    reset
    during initialization.

    This option can be useful while kernel is booting in unreliable
    environment.  For ex.  during kdump boot where devices are in
    unknown
    random state and BIOS execution has been skipped.

Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
14 years agoxen: miscellaneous adjustments (mostly missing from earlier upstream merges)
Jan Beulich [Tue, 5 Apr 2011 11:39:33 +0000 (12:39 +0100)]
xen: miscellaneous adjustments (mostly missing from earlier upstream merges)

Remove unused bits, use kmem_cache_zalloc(), consistently constify
instances of struct file_operations, fix an error cleanup path.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxen: cleanups to blkback and blktap
Jan Beulich [Tue, 5 Apr 2011 11:38:55 +0000 (12:38 +0100)]
xen: cleanups to blkback and blktap

Remove unused/unneccessary fields of their pending_req_t structures,
and reduce the width of those structures' nr_pages field.

Move loop-invariant grant table flags calculation out of loops (also
in scsiback).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxen/backends: use xenbus_be.ko interfaces instead of open-coding them
Jan Beulich [Tue, 5 Apr 2011 11:38:20 +0000 (12:38 +0100)]
xen/backends: use xenbus_be.ko interfaces instead of open-coding them

Also remove unused xenbus_{,un}map_ring(), adjust types, and clean up
header inclusion.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxenbus: fix type inconsistency with xenbus_conn()
Jan Beulich [Sat, 2 Apr 2011 14:54:29 +0000 (15:54 +0100)]
xenbus: fix type inconsistency with xenbus_conn()

Its (bogus) declaration in xenbus_dev.c was inconsistent with the
actual implementation, leaving room for stack corruption on 64-bit
systems. Thus move the declaration to a header included by both
parties, and use proper types for the parameters.

Additionally, the function is needed on privileged kernels only, and
hence neither the potentially forward-incompatible HAVE_UNLOCKED_IOCTL
conditionals in xenbus_dev.c are needed, nor does the function (and
its helper) need to be compiled in unprivileged builds.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxen: Sync public headers (except tmem.h)
Keir Fraser [Fri, 11 Mar 2011 16:18:59 +0000 (16:18 +0000)]
xen: Sync public headers (except tmem.h)

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agoxen/fbfront: fix regression from c/s 1068
Jan Beulich [Wed, 2 Mar 2011 10:24:28 +0000 (10:24 +0000)]
xen/fbfront: fix regression from c/s 1068

Unfortunately we managed to not catch in our automatic testing this
oversight during the porting of the corresponding pv-ops patch
(info->irq now getting set later, which doesn't matter for pv-ops as
that has the event channel at hand).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxen: make various _ATTR() definitions static
Jan Beulich [Fri, 25 Feb 2011 11:31:57 +0000 (11:31 +0000)]
xen: make various _ATTR() definitions static

This is to not pollute the global name space, particularly when the
affected components get built into the base kernel.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agopciback: disable MSI/MSI-X when resetting device
Jan Beulich [Thu, 10 Feb 2011 13:59:02 +0000 (13:59 +0000)]
pciback: disable MSI/MSI-X when resetting device

In cases where the guest is abruptly killed and has not disabled
MSI/MSI-X interrupts we want to do that.

Otherwise when the guest is started up and enables MSI, we would
get a WARN() that the device already had been enabled.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoblktap: a small fix and assorted cleanup
Jan Beulich [Thu, 10 Feb 2011 09:06:04 +0000 (09:06 +0000)]
blktap: a small fix and assorted cleanup

The main cleanup item is to convert the index map from a plain
"unsigned long" holding two merged together integers into a proper
structure (at once halving its size on 64-bit).

Additionally, add a previously missing range check of res.id in
blktap_read_ufe_ring() and remove blkif_reqs (which could have been
set via module load option to a value other than the default, which
code elsewhere isn't capable of handling).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxen/fb: fix potential memory leak
Jan Beulich [Wed, 9 Feb 2011 08:59:29 +0000 (08:59 +0000)]
xen/fb: fix potential memory leak

From: Joe Jin <joe.jin@oracle.com>

This patch fixes a potential memory leak when xenfb connect to
the backend fails.

Thanks for Ian's review and comments.

[v2: reworded the commit message a bit]

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
Tested-by: Gurudas Pai <gurudas.pai@oracle.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Made apply to linux-2.6.18-xen.hg.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agonetback: allow arbitrary mtu size until frontend connects
Keir Fraser [Wed, 9 Feb 2011 08:38:55 +0000 (08:38 +0000)]
netback: allow arbitrary mtu size until frontend connects

Allow arbitrary mtu size until the frontend is connected.  Once the
connection is established, adjust mtu by checking if the backend
supports the 'feature-sg'.  If the backend does support it, keep the
current mtu. Otherwise set it to the default value, which is 1500.

based on two commits from
https://git.kernel.org/?p=linux/kernel/git/jeremy/xen.git

bee2eec2355c4bf4e149a426d5e30527162de566

This allows large MTU to be configured by the VIF hotplug
script. Previously this would fail because at the point the hotplug
script runs the VIF features have most likely not been negotiated with
the frontend and so SG has not yet been enabled. Invert this behaviour
so that SG is assumed present until negotiations prove otherwise and
reduce MTU at that point.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
d532fa93d4eeabbfc0176a6a9a93b0d6ade3f6c4

Make sure that if a feature flag is disabled by ethtool on netback
that we do not gratuitously re-enabled it when we check the frontend
features during ring connection.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Olaf Hering <olaf@aepfle.de>
14 years agoxen: vscsi >2TB build fix
Keir Fraser [Wed, 26 Jan 2011 11:37:23 +0000 (11:37 +0000)]
xen: vscsi >2TB build fix

MAINTENANCE_{IN,OUT} got introduced only in 2.6.19, but I failed to
notice that because we have this backported to our 2.6.16-based
kernels.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxen, vscsi: >2TB patch
Keir Fraser [Tue, 25 Jan 2011 14:09:27 +0000 (14:09 +0000)]
xen, vscsi: >2TB patch

This patch fixes current 2TB limitation of the xen vscsi driver.
Both frontend (command size) and backend (missing READ_16/WRITE_16
commands) driver need a fix. Also an scsi command added to support
ALUA. Tested thoroughly on 4TB external RAID.

I also enabled some more commands to allow operating LTO tape
drives and autoloaders (tested on HP Ultrium 1/8 + Bacula).

Still more scsi commands might be missing for other specific
devices (why not to enable all scsi commands by default ?).

Signed-off-by: Samuel Kvasnica <samuel.kvasnica@ims.co.at>
Acked-by: Jan Beulich <jbeulich@novell.com>
14 years agoxen: remove stale exports
Keir Fraser [Fri, 14 Jan 2011 15:45:52 +0000 (15:45 +0000)]
xen: remove stale exports

All of these exports and the need for the one additional symbol
disappeared somewhere between 2.6.5 and 2.6.16.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxen: add missing kobject_uevent() invocations for CPU hotplug code
Keir Fraser [Tue, 11 Jan 2011 15:11:23 +0000 (15:11 +0000)]
xen: add missing kobject_uevent() invocations for CPU hotplug code

Their counterparts in drivers/base/cpu.c:store_online() got added
around 2.6.12.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxenbus: Fix memory leak on release
Keir Fraser [Mon, 20 Dec 2010 09:24:55 +0000 (09:24 +0000)]
xenbus: Fix memory leak on release

Pending responses were leaked on close.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxen/netback: Always pull through PKT_PROT_LEN bytes into the linear part of an skb
Keir Fraser [Fri, 17 Dec 2010 16:40:58 +0000 (16:40 +0000)]
xen/netback: Always pull through PKT_PROT_LEN bytes into the linear part of an skb

Previously PKT_PROT_LEN would only have an effect on the first
fragment.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
xen/netback: try to pull a minimum of 72 bytes into the skb data area

... when receiving a packet into netback.  The previous number, 64,
tended to place a fragment boundary in the middle of the TCP header
options and led to unnecessary fragmentation in Windows <-> Windows
networking.

xen/netback: Re-define PKT_PROT_LEN to be bigger.

Re-define PKT_PROT_LEN to be big enough to handle maximal IPv4 and TCP
options and phrase the definition so that it's reasonably obvious
that's what it's for.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxen/gntdev: add range check for IOCTL_GNTDEV_UNMAP_GRANT_REF arguments,
Keir Fraser [Fri, 17 Dec 2010 10:09:15 +0000 (10:09 +0000)]
xen/gntdev: add range check for IOCTL_GNTDEV_UNMAP_GRANT_REF arguments,

..., move all user memory accesses out of semaphore protected region,
simplify, clean up, and remove some bogus printk()-s in gntdev_ioctl()
and its helpers.

The purpose of free_list_sem seems questionable: It is only ever being
acquired for write access, and always with grants_sem already held
in write mode.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxen/netback: Re-factor net_tx_action_dealloc() slightly
Keir Fraser [Fri, 17 Dec 2010 10:08:41 +0000 (10:08 +0000)]
xen/netback: Re-factor net_tx_action_dealloc() slightly

There is no need for processing of the pending_inuse list to be within
the dealloc_prod/cons loop.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxen/netloop: make netloop permanent
Keir Fraser [Fri, 10 Dec 2010 10:48:31 +0000 (10:48 +0000)]
xen/netloop: make netloop permanent

with reference to RH BZ#567540 [0], this patch makes the netloop
module permanent (like netback is currently). It reverts parts of
xen-unstable c/s 9019:271cb04a4f2b [1] [2] (though that has a typo:
"__init clean_loopback", so it was probably changed later too).

The patch fixes the problem of "rmmod netloop" hanging, resulting in
blocked tasks and inability to shut down cleanly:

... kernel: unregister_netdevice: waiting for veth4 to become
free. Usage count = 1

The problem was also reported for Debian [3] and on the Fedora-xen
mailing list [4].

[0] https://bugzilla.redhat.com/show_bug.cgi?id=567540
[1] http://lists.xensource.com/archives/html/xen-devel/2006-02/msg01033.html
[2] http://xenbits.xensource.com/xen-unstable.hg?rev/271cb04a4f2b
[3] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=425703
[4] http://www.redhat.com/archives/fedora-xen/2007-April/msg00074.html

From: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Keir Fraser <keir@xen.org>
14 years agonetback: Recent change caused spurious hotplug event firings.
Keir Fraser [Tue, 7 Dec 2010 18:35:16 +0000 (18:35 +0000)]
netback: Recent change caused spurious hotplug event firings.

From: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Keir Fraser <keir@xen.org>
14 years agoAdd some Intel PCI device ID's to irq.c; sync irq-xen.c with irq.c
Keir Fraser [Fri, 26 Nov 2010 10:09:59 +0000 (10:09 +0000)]
Add some Intel PCI device ID's to irq.c; sync irq-xen.c with irq.c

From: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Keir Fraser <keir@xen.org>
14 years agoblkback/blktap/netback: Fix CVE-2010-3699
Keir Fraser [Tue, 23 Nov 2010 13:58:38 +0000 (13:58 +0000)]
blkback/blktap/netback: Fix CVE-2010-3699

A guest can cause the backend driver to leak a kernel
thread. Such leaked threads hold references to the device, whichmakes
the device impossible to tear down. If shut down, the guest remains a
zombie domain, the xenwatch process hangs, and most xm commands will
stop working.

This patch tries to do the following, for all of netback, blkback,
blktap:
    - identify/extract idempotent teardown operations,
    - add/move the invocation of said teardown operation
      right before we're about to allocate new resources in the
      Connected states.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
14 years agoxen/netfront: Default to copy-mode receiver.
Keir Fraser [Fri, 19 Nov 2010 13:22:43 +0000 (13:22 +0000)]
xen/netfront: Default to copy-mode receiver.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agoblktap2: fix synchronization in blktap_device_run_queue()
Keir Fraser [Fri, 19 Nov 2010 13:20:06 +0000 (13:20 +0000)]
blktap2: fix synchronization in blktap_device_run_queue()

c/s 896 (use of blk_rq_map_sg()) made the problem worse, but from what
I can tell there had been races (ring and stats updates) before. If
that's not a correct observation, a perhaps better solution might be
to move the struct scatterlist array out of struct blktap (and make it
e.g. an on-stack variable, the problem being that
blktap_device_process_request() has a pretty large stack frame
already - shrinking this might be possible by moving e.g. the
struct blktap_grant_table and struct blkif_request blkif_req instances
the other way if the locking change here is the right thing to do).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoblktap2: fix after c/s 1035
Keir Fraser [Wed, 17 Nov 2010 17:16:52 +0000 (17:16 +0000)]
blktap2: fix after c/s 1035

The grant handle must be invalidated only in the error path.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: Olaf Hering <olaf@aepfle.de>
14 years agoDon't register shutdown watch and suspend event channel for Dom0
Keir Fraser [Tue, 16 Nov 2010 11:32:04 +0000 (11:32 +0000)]
Don't register shutdown watch and suspend event channel for Dom0

This pointlessly consumes resources and poses the risk of either
getting triggered inadvertently.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxen/evtchn: clear secondary CPUs' cpu_evtchn_mask[] after restore
Keir Fraser [Tue, 16 Nov 2010 11:31:19 +0000 (11:31 +0000)]
xen/evtchn: clear secondary CPUs' cpu_evtchn_mask[] after restore

To bind all event channels to CPU#0, it is not sufficient to set all
of its cpu_evtchn_mask[] bits; all other CPUs also need to get their
bits cleared. Otherwise, evtchn_do_upcall() will start handling
interrupts on CPUs they're not intended to run on, which can be
particularly bad for per-CPU ones.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xen.org>
14 years agopcifront: fix PCI reference leak
Keir Fraser [Mon, 15 Nov 2010 09:32:57 +0000 (09:32 +0000)]
pcifront: fix PCI reference leak

Stanse found that when pdev is found and has no driver a reference is
leaked in pcifront_common_process. So add pci_dev_put there. For the
pdev == NULL case, pci_dev_put(NULL) is fine.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
From: Jiri Slaby <jslaby@suse.cz>
Subject: pcifront: fix potential NULL dereference

Milton spotted that we dereference NULL in one fail path in
pcifront_common_process. Fix that by using different device to print
out an error.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Milton Miller <miltonm@bga.com>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxen/x86_64: remove an inapplicable feature flag
Keir Fraser [Wed, 3 Nov 2010 17:36:03 +0000 (17:36 +0000)]
xen/x86_64: remove an inapplicable feature flag

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agolinux-2.6.18: add list_first_entry()
Keir Fraser [Wed, 3 Nov 2010 17:34:34 +0000 (17:34 +0000)]
linux-2.6.18: add list_first_entry()
... to address build failure after c/s 1045:bd2bf7a84686.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxen/smpboot: eliminate cpu_2_logical_apicid
Keir Fraser [Wed, 3 Nov 2010 08:21:08 +0000 (08:21 +0000)]
xen/smpboot: eliminate cpu_2_logical_apicid

This variable must have become orphaned by a merge predating the
2.6.16 one.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agonetback: take net_schedule_list_lock when removing entry from net_schedule_list
Keir Fraser [Wed, 3 Nov 2010 08:20:42 +0000 (08:20 +0000)]
netback: take net_schedule_list_lock when removing entry from net_schedule_list

There is a race in net_tx_build_mops between checking if
net_schedule_list is empty and actually dequeuing the first entry on
the list. If another thread dequeues the only entry on the list during
this window we crash because list_first_entry expects a non-empty
list. Therefore after the initial lock free check for an empty list
check again with the lock held before dequeueing the entry.

Based on a patch by Tomasz Wroblewski.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxen/netloop: add get_drvinfo() ("ethtool -i") support
Keir Fraser [Fri, 29 Oct 2010 09:23:16 +0000 (10:23 +0100)]
xen/netloop: add get_drvinfo() ("ethtool -i") support

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
14 years agonetfront: Fix build failure after previous changeset
Keir Fraser [Tue, 12 Oct 2010 10:03:20 +0000 (11:03 +0100)]
netfront: Fix build failure after previous changeset

From: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Acked-by: Jan Beulich <jbeulich@novell.com>
14 years agoxen/netfront: ethtool -i does not return info about xennet driver
Keir Fraser [Mon, 11 Oct 2010 09:25:55 +0000 (10:25 +0100)]
xen/netfront: ethtool -i does not return info about xennet driver

Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agolinux/pcifront: fix freeing of device
Keir Fraser [Mon, 4 Oct 2010 12:31:00 +0000 (13:31 +0100)]
linux/pcifront: fix freeing of device

unbind_from_irqhandler() takes irq, not evtchn, as its first argument.

Once at it, improve error handling.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Reported-by: Rafal Wojtczuk <rafal@invisiblethingslab.com>
14 years agolinux/pcifront: claim PCI resources also on rescan
Keir Fraser [Mon, 4 Oct 2010 12:30:33 +0000 (13:30 +0100)]
linux/pcifront: claim PCI resources also on rescan

Condensed from the following two patches:

http://git.kernel.org/?p=3Dlinux/kernel/git/konrad/xen.git;a=3Dcommitdiff;h=
=3D621d869f36b215d63bb99e7ecd7a11f029821b85=20
xen-pcifront: Claim PCI resources before going live.

author  Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>=09
        Fri, 18 Jun 2010 19:31:47 +0000 (15:31 -0400)
committer       Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>=09
        Fri, 18 Jun 2010 19:40:37 +0000 (15:40 -0400)

We were missing the important step of claiming (and setting the
parent of IO and MEM regions to 'PCI IO' and 'PCI mem' respectivly)
of the BARs. This meant that during hot inserts we would get:

igb 0000:01:00.1: device not available (can't reserve [mem
0xfb840000-0xfb8=
5ffff])

even thought the memory region had been reserved before.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
http://git.kernel.org/?p=3Dlinux/kernel/git/konrad/xen.git;a=3Dcommitdiff;h=
=3D4a65de894fc0af05397eedca180d0ea7d8c6caba=20
xen-pcifront: Don't race with udev when discovering new devices.

author  Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>=09
        Fri, 23 Jul 2010 14:35:57 +0000 (10:35 -0400)
committer       Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>=09
        Fri, 23 Jul 2010 15:15:56 +0000 (11:15 -0400)

We inadvertly would call 'pci_bus_add_device' right after discovering
the device, but before claiming the BARs. This ended up firing off
a uevent and udev loading the module and the modules failing to
request_region as they were not claimed. We fix this by holding off
going live by calling 'pci_bus_add_devices' at the end.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Reported-by: Rafal Wojtczuk <rafal@invisiblethingslab.com>
14 years agoxen/x86-64: adjustments to match i386 behavior
Keir Fraser [Sat, 2 Oct 2010 14:07:00 +0000 (15:07 +0100)]
xen/x86-64: adjustments to match i386 behavior

On i386 the corresponding code is inside X86_HT conditionals, and this
config variable is unconditionally off for X86_XEN.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxen/evtchn: Handle VIRQ_TIMER before any other hardirq in event loop.
Keir Fraser [Wed, 22 Sep 2010 09:25:42 +0000 (10:25 +0100)]
xen/evtchn: Handle VIRQ_TIMER before any other hardirq in event loop.

This avoids any other hardirq handler seeing a very stale jiffies
value immediately after wakeup from a long idle period. The one
observable symptom of this was a USB keyboard, with software keyboard
repeat, which would always repeat a key immediately that it was
pressed. This is due to the key press waking the guest, the key
handler immediately runs, sees an old jiffies value, and then that
jiffies value significantly updated, before the key is unpressed.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoxen/x86: synchronize vmalloc_sync_all() with mm_{,un}pin()
Keir Fraser [Wed, 22 Sep 2010 07:57:21 +0000 (08:57 +0100)]
xen/x86: synchronize vmalloc_sync_all() with mm_{,un}pin()

As recently diagnosed by Citrix engineers, mm_{,un}pin() and
vmalloc_sync_all() aren't properly synchronized. So we add a backlink
to the referencing struct mm_struct to the pgd's struct page, and use
this to lock the page table updates in vmalloc_sync_all().

Due to the way pgd-s get allocated and put on the global list on i386,
we have to account for the backlink not to be set yet (in which case
they cannot be subject to (un)pinning.

Along the way, I found it necessary/desirable to also fix
- a potential NULL dereference in i386's pgd_alloc(),
- x86-64 adding not yet cleaned out pgd-s to the global list, and
- x86-64 removing pgd-s from the global list rather late.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxen/blkfront: forward unknown IOCTLs to scsi_cmd_ioctl() for /dev/sdX
Keir Fraser [Wed, 22 Sep 2010 07:56:26 +0000 (08:56 +0100)]
xen/blkfront: forward unknown IOCTLs to scsi_cmd_ioctl() for /dev/sdX

Certain utilities (here: parted) expect certain SCSI IOCTLs (here:
SCSI_IOCTL_GET_IDLUN) to not fail on /dev/sdX devices. Rather than
handling them one-by-one, just forward control to scsi_cmd_ioctl().

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxenpaging: handle GNTST_eagain in kernel drivers
Keir Fraser [Fri, 17 Sep 2010 16:00:43 +0000 (17:00 +0100)]
xenpaging: handle GNTST_eagain in kernel drivers

Handle GNTST_eagain status from GNTTABOP_map_grant_ref and
GNTTABOP_copy operations properly to allow usage of xenpaging without
causing crashes or data corruption.

Remove the existing retry code from net_rx_action(),
dispatch_rw_block_io(), net_accel_map_grants_contig() and
net_accel_map_iomem_page() and replace all relevant
HYPERVISOR_grant_table_op() calls with a retry loop.  This loop is
implemented as a macro to allow different GNTTABOP_* args.  It will
sleep up to 33 seconds and wait for the page to be paged in again.

All ->status checks were updated to use the GNTST_* namespace.  All
return values are converted from GNTST_* namespace to 0/-EINVAL, since
all callers did not use the actual return value.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Patrick Colp <pjcolp@cs.ubc.ca>
14 years agoia64, xencomm: fix 1028:6f7bda25a4de
Keir Fraser [Wed, 15 Sep 2010 06:46:47 +0000 (07:46 +0100)]
ia64, xencomm: fix 1028:6f7bda25a4de

Because xen-compat.h defines __XEN_INTERFACE_VERSION__ only if __XEN__
or __XEN_TOOLS__ is defined, I added #include xen-compat.h before
#define __XEN_TOOLS__.

I confirmed that dom0 kernel could be built without warnings and
guests could be created.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
14 years agolinux: fix swiotlb sync functions to properly deal with DMA_BIDIRECTIONAL
Keir Fraser [Mon, 13 Sep 2010 16:41:22 +0000 (17:41 +0100)]
linux: fix swiotlb sync functions to properly deal with DMA_BIDIRECTIONAL

This change was left out from a merge somewhere between 2.6.12 and
2.6.16.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Dominic Curran <dominic.curran@citrix.com>
14 years agoxen: netback: save interrupt state in add_to_net_schedule_list_tail
Keir Fraser [Mon, 13 Sep 2010 16:40:48 +0000 (17:40 +0100)]
xen: netback: save interrupt state in add_to_net_schedule_list_tail

add_to_net_schedule_list_tail is called from both hard interrupt
context (add_to_net_schedule_list_tail) and soft interrupt/process
context (netif_schedule_work) so use the interrupt state saving
spinlock variants.

Fixes:
        ------------[ cut here ]------------
        WARNING: at kernel/lockdep.c:2323
        trace_hardirqs_on_caller+0xef/0x1a0()
        Hardware name: PowerEdge 860
        Modules linked in: rtc_cmos rtc_core rtc_lib
        Pid: 16, comm: xenwatch Not tainted
        2.6.32.18-x86_32p-xen0-00850-ge6b9b2c #98
        Call Trace:
         [<c103951c>] warn_slowpath_common+0x6c/0xc0
         [<c1039585>] warn_slowpath_null+0x15/0x20
         [<c105f60f>] trace_hardirqs_on_caller+0xef/0x1a0
         [<c105f6cb>] trace_hardirqs_on+0xb/0x10
         [<c136cc72>] _spin_unlock_irq+0x22/0x40
         [<c11ab9ef>] add_to_net_schedule_list_tail+0x5f/0xb0
         [<c11aba6b>] netif_be_int+0x2b/0x120
         [<c106dd8e>] handle_IRQ_event+0x2e/0xe0
         [<c106f98e>] handle_level_irq+0x6e/0xf0
         [<c1197cdf>] __xen_evtchn_do_upcall+0x16f/0x190
         [<c11981b8>] xen_evtchn_do_upcall+0x28/0x40
         [<c100b487>] xen_do_upcall+0x7/0xc
         [<c119bcf9>] xs_talkv+0x59/0x1a0
         [<c119bf6a>] xs_single+0x3a/0x50
         [<c119c6f9>] xenbus_read+0x39/0x60
         [<c11adf77>] frontend_changed+0x3e7/0x6a0
         [<c119d35a>] xenbus_otherend_changed+0x8a/0xa0
         [<c119d572>] frontend_changed+0x12/0x20
         [<c119b9dc>] xenwatch_thread+0x7c/0x140
         [<c104ea74>] kthread+0x74/0x80
         [<c100b433>] kernel_thread_helper+0x7/0x10
        ---[ end trace 48d73949a8e0909a ]---

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxen/x86: make __direct_remap_pfn_range()'s return value meaningful
Keir Fraser [Mon, 13 Sep 2010 16:39:53 +0000 (17:39 +0100)]
xen/x86: make __direct_remap_pfn_range()'s return value meaningful

From: Olaf Hering <ohering@novell.com>

This change fixes the xc_map_foreign_bulk interface, which would
otherwise cause SIGBUS when pages are gone because -ENOENT is not
returned as expected by the IOCTL_PRIVCMD_MMAPBATCH_V2 ioctl.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoia64, xencomm: fix XEN_SYSCTL_cpupool_op
Keir Fraser [Mon, 13 Sep 2010 16:38:36 +0000 (17:38 +0100)]
ia64, xencomm: fix XEN_SYSCTL_cpupool_op

Because the cpumap member of struct xen_sysctl_cpupool_op is used only
when the operation is XEN_SYSCTL_CPUPOOL_OP_INFO or
XEN_SYSCTL_CPUPOOL_OP_FREEINFO, in case of others, xencomm_map to
cpumap fails, thus XEN_SYSCTL_cpupool_op fails.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
14 years agoFix build after c/s 1028
Keir Fraser [Thu, 26 Aug 2010 10:27:25 +0000 (11:27 +0100)]
Fix build after c/s 1028

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoUpdate Xen public headers.
Keir Fraser [Thu, 26 Aug 2010 07:50:42 +0000 (08:50 +0100)]
Update Xen public headers.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 years agoxen/x86: eliminate nesting of run-queue locks inside xtime_lock
Keir Fraser [Tue, 10 Aug 2010 14:47:41 +0000 (15:47 +0100)]
xen/x86: eliminate nesting of run-queue locks inside xtime_lock

From: Zdenek Salvet <salvet@ics.muni.cz>

According to Debian bug 591362 this has been causing problems. While
no proof was given that the inverse lock order does actually occur
anywhere (with interrupts enabled), it is plain unnecessary to take
the risk.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
14 years agoblktap2: eliminate bogus clearing of PG_reserved
Keir Fraser [Tue, 10 Aug 2010 14:46:56 +0000 (15:46 +0100)]
blktap2: eliminate bogus clearing of PG_reserved

While making sure PG_reserved is set for pages allocated from the
balloon driver (and to be used for I/O) is a necessary thing to do
(as 2.6.18's as well as pv-ops' balloon drivers don't guarantee this
for the pages returned from alloc_empty_pages_and_page_vec()),
clearing this flag again when a page is no longer in use for I/O is
bogus at best (after all, the page at that point is not associated
with any MFN anymore), and causes problems when the balloon driver
properly marks all such pages as reserved and checks, upon their
return, that they are still marked this way.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxenoprofile: Add IBS support
Keir Fraser [Mon, 2 Aug 2010 10:02:18 +0000 (11:02 +0100)]
xenoprofile: Add IBS support

Add IBS support for AMD family 10h processors. The major
implementation is derived from latest Linux. Two hypercalls are added,
which is necessary for IBS feature detection and user mode parameter
read.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
14 years agoxenfs: implement O_NONBLOCK for /proc/xen/xenbus
Keir Fraser [Mon, 26 Jul 2010 09:40:00 +0000 (10:40 +0100)]
xenfs: implement O_NONBLOCK for /proc/xen/xenbus

This patch implements O_NONBLOCK for /proc/xen/xenbus.  It is a simple
matter of returning -EAGAIN instead of waiting on a queue.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
14 years agopci/guestdev: clean up data definitions
Keir Fraser [Fri, 9 Jul 2010 11:37:28 +0000 (12:37 +0100)]
pci/guestdev: clean up data definitions

Keep a local variable from polluting the global namespace, and move
another one into .init.data since it's only being used by __init
functions.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agopci/iomulti: adjustments for CONFIG_HOTPLUG_PCI=m
Keir Fraser [Fri, 9 Jul 2010 11:37:02 +0000 (12:37 +0100)]
pci/iomulti: adjustments for CONFIG_HOTPLUG_PCI=m

The code supposed to deal with hot added/removed devices is also
needed when the core PCI hotplug code lives in a module.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoxen/x86: fix for special behavior of first sys_settimeofday(NULL, &tz) invocation
Keir Fraser [Fri, 18 Jun 2010 13:11:57 +0000 (14:11 +0100)]
xen/x86: fix for special behavior of first sys_settimeofday(NULL, &tz) invocation

The data Xen's time implementation maintains to make do_gettimeofday()
return values monotonic needs to be reset not only during normal
do_gettimeofday() invocations, but also when the clock gets warped
due to the hardware (CMOS) clock running on local (rather than UTC)
time.

Additionally there was a time window in do_gettimeofday() (between
the end of the xtime read loop and the acquiring of the monotonicity
data lock) where, if on another processor do_settimeofday() would
execute to completion, the zeroes written by the latter could get
overwritten by the former with values obtained before the time was
updated. This now gets prevented by maintaining a version for the
monotonicity data.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
14 years agoia64, xencomm: fix 1018:b7eb9756e522
Keir Fraser [Fri, 11 Jun 2010 08:37:25 +0000 (09:37 +0100)]
ia64, xencomm: fix 1018:b7eb9756e522

This fixes the following errors:
  /arch/ia64/xen/xcom_privcmd.c: In function `xencomm_privcmd_sysctl':
  /arch/ia64/xen/xcom_privcmd.c:295: error: case label not within a
  switch statement
  /arch/ia64/xen/xcom_privcmd.c:305: error: break statement not within
  loop or switch

Since 1018:b7eb9756e522 inserted lines in outside of a switch
statement. This patch corrects it.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
14 years agoia64, xencomm: support XEN_SYSCTL_topologyinfo and XEN_SYSCTL_numainfo
Keir Fraser [Mon, 7 Jun 2010 05:57:35 +0000 (06:57 +0100)]
ia64, xencomm: support XEN_SYSCTL_topologyinfo and XEN_SYSCTL_numainfo

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
14 years agoia64, xencomm: support XEN_SYSCTL_cpupool_op
Keir Fraser [Mon, 7 Jun 2010 05:57:11 +0000 (06:57 +0100)]
ia64, xencomm: support XEN_SYSCTL_cpupool_op

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
15 years agoSync with latest Xen public headers.
Keir Fraser [Thu, 6 May 2010 14:52:48 +0000 (15:52 +0100)]
Sync with latest Xen public headers.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoblktap: make debugging messages a little more meaningful
Keir Fraser [Thu, 22 Apr 2010 08:36:11 +0000 (09:36 +0100)]
blktap: make debugging messages a little more meaningful

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agoblktap: fix cleanup after unclean application exit #2
Keir Fraser [Thu, 22 Apr 2010 08:35:46 +0000 (09:35 +0100)]
blktap: fix cleanup after unclean application exit #2

When an application using blktap devices doesn't close the mmap-s of
/dev/xen/blktapN and the frontend driver never connects, we cannot
defer the mmput() on the stored mm until blktap_release() or the exit
path of the worker thread, as the former will never be called without
the mm's reference count dropping to zero, and the worker thread
would never get started.

Also remove a left-over from c/s 1013.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agoxen/blktap: fix various checks
Keir Fraser [Mon, 19 Apr 2010 16:19:56 +0000 (17:19 +0100)]
xen/blktap: fix various checks

- array indices got checked after having indexed the array already
- several were off by one
- BLKTAP_IOCTL_FREEINTF should not be used on other than the control
  device (or the logic should be changed to that when thus used only
  the respective device can be freed)
- BLKTAP_IOCTL_MINOR can reasonably also be used on non-control
- devices
  (returning that device's minor and ignoring the passed in argument)

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agoxen/blktap: fix cleanup after unclean application exit
Keir Fraser [Mon, 19 Apr 2010 16:19:23 +0000 (17:19 +0100)]
xen/blktap: fix cleanup after unclean application exit

When an application using blktap devices doesn't close the file handle
(or mmap-s) of /dev/xen/blktapN, we cannot defer the mmput() on the
stored mm until blktap_release(), as that will never be called without
the mm's reference count dropping to zero.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agoxen/x86-64: kern_addr_valid() must not walk page tables mapping hypervisor space
Keir Fraser [Mon, 12 Apr 2010 16:34:34 +0000 (17:34 +0100)]
xen/x86-64: kern_addr_valid() must not walk page tables mapping hypervisor space

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agoxen/balloon: Fix return value interpretation for XENMEM_get_pod_target
Keir Fraser [Tue, 30 Mar 2010 17:28:34 +0000 (18:28 +0100)]
xen/balloon: Fix return value interpretation for XENMEM_get_pod_target

Unfortunately c/s 989 didn't consider what I would call a quirk in
pre-3.4 Xen, resulting in XENMEM_get_pod_target calls to not return
-ENOSYS as one would normally expect.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agopci: fix PCI resource reservation option parsing
Keir Fraser [Thu, 25 Mar 2010 10:00:03 +0000 (10:00 +0000)]
pci: fix PCI resource reservation option parsing

Start looking for the second '+' after the first one (rather than at
the beginning again). Also fail if second string cannot be parsed.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agopvscsi: allow pvscsi hba driver to be loaded automatically
Keir Fraser [Thu, 25 Mar 2010 09:59:38 +0000 (09:59 +0000)]
pvscsi: allow pvscsi hba driver to be loaded automatically

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agopvusb: allow pvusb hcd driver to be loaded automatically
Keir Fraser [Thu, 25 Mar 2010 09:59:07 +0000 (09:59 +0000)]
pvusb: allow pvusb hcd driver to be loaded automatically

From: jsong@novell.com
Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agolinux: small ACPI processor external control code adjustments
Keir Fraser [Wed, 17 Mar 2010 08:32:52 +0000 (08:32 +0000)]
linux: small ACPI processor external control code adjustments

- don't send a change notification to Xen before having sent an init
  one
- fix a bogus preprocessor directive

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agoblkback: Fix the build.
Keir Fraser [Mon, 15 Mar 2010 17:05:28 +0000 (17:05 +0000)]
blkback: Fix the build.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoxenblk: dynamic vbd resizing
Keir Fraser [Mon, 15 Mar 2010 13:31:19 +0000 (13:31 +0000)]
xenblk: dynamic vbd resizing
Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
15 years agousbfront: fix some bugs
Keir Fraser [Mon, 15 Mar 2010 13:20:21 +0000 (13:20 +0000)]
usbfront: fix some bugs

Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
15 years agopciback: Replace commented-out use of dev->enable_cnt with dev->is_enabled.
Keir Fraser [Mon, 1 Mar 2010 10:19:41 +0000 (10:19 +0000)]
pciback: Replace commented-out use of dev->enable_cnt with dev->is_enabled.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoblkfront: Fix an unlikely xenbus crasher
Keir Fraser [Mon, 1 Mar 2010 09:56:52 +0000 (09:56 +0000)]
blkfront: Fix an unlikely xenbus crasher

Getting partition 0 should not fail, but if it does we won't continue.

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@novell.com>