]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
12 years agokvm tools: Move mmap_anon_or_hugetblfs() into util
Michael Ellerman [Tue, 17 Jul 2012 05:00:11 +0000 (15:00 +1000)]
kvm tools: Move mmap_anon_or_hugetblfs() into util

So we can use it on powerpc.

Acked-by: Matt Evans <matt@ozlabs.org>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Introduce struct disk_image_params
Asias He [Wed, 11 Jul 2012 17:16:50 +0000 (01:16 +0800)]
kvm tools: Introduce struct disk_image_params

Introduce struct disk_image_params to contain all the disk image parameters.
This is useful for adding more disk image parameters, e.g. disk image
cache mode.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Do not poll ioeventfd if vhost is enabled
Asias He [Wed, 11 Jul 2012 16:08:14 +0000 (00:08 +0800)]
kvm tools: Do not poll ioeventfd if vhost is enabled

If vhost is enabled for a virtio device, vhost will poll the ioeventfd
in kernel side and there is no need to poll it in userspace. Otherwise,
both vhost kernel and userspace will race to poll.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Fix VHOST_SET_MEM_TABLE failure
Asias He [Wed, 11 Jul 2012 16:08:13 +0000 (00:08 +0800)]
kvm tools: Fix VHOST_SET_MEM_TABLE failure

VHOST_SET_MEM_TABLE failed: Operation not supported

In vhost_set_memory(), We have

        if (mem.padding)
                return -EOPNOTSUPP;

So, we need to zero struct vhost_memory.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tool: Fix powerpc/kvm-cpu.c for new KVM_SET_ONE_REG API
Michael Ellerman [Wed, 4 Jul 2012 13:39:58 +0000 (23:39 +1000)]
kvm tool: Fix powerpc/kvm-cpu.c for new KVM_SET_ONE_REG API

I think this code was based on an earlier version of the KVM_SET_ONE_REG
API, which at the time was in agraf's tree but not mainline?

Either way it doesn't compile as is, so fix it up.

Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Cleanup ARCH & uname_M in Makefile
Michael Ellerman [Wed, 4 Jul 2012 13:18:58 +0000 (23:18 +1000)]
kvm tools: Cleanup ARCH & uname_M in Makefile

The sed expression for ARCH seems to have been cribbed from the top-level
kernel Makefile, and includes lots of architectures kvmtool doesn't
support - strip it down.

Also call uname -m directly there and get rid of uname_M.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Support cross compilation
Michael Ellerman [Wed, 4 Jul 2012 13:18:57 +0000 (23:18 +1000)]
kvm tools: Support cross compilation

Allow CROSS_COMPILE to be used to prefix CC as is done in the kernel
Makefile. If CROSS_COMPILE is unset it has no effect, and still allows
CC to be overridden.

We need to fix a few places to use ARCH instead of uname_M directly, so
that the overridden setting of ARCH takes effect.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Use asm/barrier.h on powerpc
Michael Ellerman [Wed, 4 Jul 2012 13:18:56 +0000 (23:18 +1000)]
kvm tools: Use asm/barrier.h on powerpc

Commit 141124c deleted system.h, we really want barrier.h

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Define KVM_VIRTIO_MMIO_AREA for powerpc
Michael Ellerman [Wed, 4 Jul 2012 13:18:55 +0000 (23:18 +1000)]
kvm tools: Define KVM_VIRTIO_MMIO_AREA for powerpc

Commit 82ea06e "Introduce KVM_VIRTIO_MMIO_AREA" did just that, but only
for x86. Causing the following commit 5c301a3 "Add virtio-mmio support"
to break the build for powerpc.

We follow what x86 did and place it 16MB past the PCI area, I have no
idea if that is actually a good idea, or whether it works at all.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: set the HYPERVISOR flag in cpuid
Sasha Levin [Wed, 20 Jun 2012 07:37:39 +0000 (11:37 +0400)]
kvm tools: set the HYPERVISOR flag in cpuid

We need to set the HYPERVISOR flag to let the kernel know we're running
under a hypervisor.

This makes the kernel enable all sorts of para-virtualization options
such as kvm-clock.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
[gorcunov@: Add comments on bits]
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: support 9p flush command
Sasha Levin [Fri, 15 Jun 2012 11:34:17 +0000 (13:34 +0200)]
kvm tools: support 9p flush command

While we process 9p requests serially, so there's no point for implementing
flush, we still need to answer it to prevent guest kernel from hanging waiting
for it.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Process virito blk requests in separate thread
Asias He [Tue, 29 Nov 2011 13:55:20 +0000 (21:55 +0800)]
kvm tools: Process virito blk requests in separate thread

All blk requests are processed in notify_vq() which is in the context of
ioeventfd thread: ioeventfd__thread(). The processing in notify_vq() may
take a long time to complete and all devices share the single ioeventfd
thead, so this might block other device's notify_vq() being called and
starve other devices.

This patch makes virtio blk's notify_vq() just notify the blk thread
instead of doing the real hard read/write work. Tests show that the
overhead of the notification operations is small.

The reasons for using dedicated thead instead of using thead pool
follow:

1) In thread pool model, each job handling operation:
thread_pool__do_job() takes about 6 or 7 mutex_{lock,unlock} ops. Most
of the mutex are global (job_mutex) which are contented by the threads
in the pool. It's fine for the non performance critical virtio devices,
such as console, rng, etc. But it's not optimal for net and blk devices.

2) Using dedicated threads to handle blk requests opens the door for
user to set different IO priority for the blk threads.

3) It also reduces the contentions between net and blk devices if they
do not share the thead pool.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Increase AIO_MAX to 256
Asias He [Mon, 4 Jun 2012 15:10:04 +0000 (23:10 +0800)]
kvm tools: Increase AIO_MAX to 256

The queue size for virtio_blk is 256 and AIO_MAX is 32, we might be
short of available aio events if guest issues > 32 requests
simultaneously. Following error is observed when guest running stressed
I/O workload.

  Info: disk_image__read error: total=-11

To fix this, let's increase the aio events limit.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Add test for -static libc present
Cyrill Gorcunov [Mon, 11 Jun 2012 11:31:40 +0000 (15:31 +0400)]
kvm tools: Add test for -static libc present

Make sure the static binaries can be built.

Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
[ penberg@kernel.org: improve error message ]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Use safe string handling functions
Cyrill Gorcunov [Wed, 6 Jun 2012 08:57:00 +0000 (12:57 +0400)]
kvm tools: Use safe string handling functions

Use str[n|l] functions to make sure destination is
not overflowed.

Seems socket path generation should be moved into
a separate helper, but it's for another patch.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Improve compat message format
Asias He [Tue, 5 Jun 2012 16:40:43 +0000 (00:40 +0800)]
kvm tools: Improve compat message format

---------
Before:
---------
*** Compatibility Warning ***

        virtio-blk device was not detected

While you have requested a virtio-blk device, the guest kernel did not initialize it.
Please make sure that the guest kernel was compiled with CONFIG_VIRTIO_BLK=y enabled in its .config

*** Compatibility Warning ***

        virtio-net device was not detected

While you have requested a virtio-net device, the guest kernel did not initialize it.
Please make sure that the guest kernel was compiled with CONFIG_VIRTIO_NET=y enabled in its .config

  # KVM session ended normally.

---------
After:
---------
  # KVM compatibility warning.
        virtio-blk device was not detected.
        While you have requested a virtio-blk device, the guest kernel did not initialize it.
        Please make sure that the guest kernel was compiled with CONFIG_VIRTIO_BLK=y enabled in .config.

  # KVM compatibility warning.
        virtio-net device was not detected.
        While you have requested a virtio-net device, the guest kernel did not initialize it.
        Please make sure that the guest kernel was compiled with CONFIG_VIRTIO_NET=y enabled in .config.

  # KVM session ended normally.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Fix compat message
Asias He [Tue, 5 Jun 2012 16:40:42 +0000 (00:40 +0800)]
kvm tools: Fix compat message

compat_id is initialized to -1 for each type of device. We should add
compat message if the compat_id == -1 which means we haven't added
compat message for this type of device.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Introduce virtio_compat_add_message() helper
Asias He [Tue, 5 Jun 2012 16:40:41 +0000 (00:40 +0800)]
kvm tools: Introduce virtio_compat_add_message() helper

This patch introduces a helper virtio_compat_add_message() to simplify
adding compat message for virtio device.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Code cleanup for disk/raw.c
Asias He [Tue, 5 Jun 2012 14:42:45 +0000 (22:42 +0800)]
kvm tools: Code cleanup for disk/raw.c

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Code cleanup for disk/qcow.c
Asias He [Tue, 5 Jun 2012 14:42:44 +0000 (22:42 +0800)]
kvm tools: Code cleanup for disk/qcow.c

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Code cleanup for disk/core.c
Asias He [Tue, 5 Jun 2012 14:42:43 +0000 (22:42 +0800)]
kvm tools: Code cleanup for disk/core.c

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Code cleanup for virtio/net.c
Asias He [Tue, 5 Jun 2012 14:42:42 +0000 (22:42 +0800)]
kvm tools: Code cleanup for virtio/net.c

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Code cleanup for virtio/console.c
Asias He [Tue, 5 Jun 2012 14:42:41 +0000 (22:42 +0800)]
kvm tools: Code cleanup for virtio/console.c

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Code cleanup for virtio/blk.c
Asias He [Tue, 5 Jun 2012 14:42:40 +0000 (22:42 +0800)]
kvm tools: Code cleanup for virtio/blk.c

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Code cleanup for virtio/balloon.c
Asias He [Tue, 5 Jun 2012 14:42:39 +0000 (22:42 +0800)]
kvm tools: Code cleanup for virtio/balloon.c

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Code cleanup for virtio/9p.c
Asias He [Tue, 5 Jun 2012 14:42:38 +0000 (22:42 +0800)]
kvm tools: Code cleanup for virtio/9p.c

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Simplify disk read write function name
Asias He [Mon, 4 Jun 2012 15:25:38 +0000 (23:25 +0800)]
kvm tools: Simplify disk read write function name

We read and write in sectors by default. It makes little sense to add
the extra _sector string for read and write ops/function name.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Restart io_submit if it returns EAGAIN
Asias He [Mon, 4 Jun 2012 15:10:05 +0000 (23:10 +0800)]
kvm tools: Restart io_submit if it returns EAGAIN

Keep trying if io_submit returns EAGAIN. No need to fail the request.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Rename ~/.kvm-tools/ to ~/.lkvm/
Asias He [Mon, 4 Jun 2012 09:51:47 +0000 (17:51 +0800)]
kvm tools: Rename ~/.kvm-tools/ to ~/.lkvm/

The new directory name is simpler and easier to type and remember.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Remove unused req_mutex variable.
Asias He [Fri, 25 May 2012 10:23:50 +0000 (18:23 +0800)]
kvm tools: Remove unused req_mutex variable.

The req_mutex was used to protect the request list. In commit b7b038d, I
removed the use of the virtio_blk_req_{pop, push} which needs the
req_mutex, but I forgot to remove the req_mutex. So remove it now.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: increase amount of virtio-9p FIDs
Sasha Levin [Wed, 9 May 2012 12:24:48 +0000 (14:24 +0200)]
kvm tools: increase amount of virtio-9p FIDs

Increase the amount of FIDs since we easily reach current amount with
simple stress tests.

This should be changed to use a rbtree or something faster in the
future.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: use accessor function for virtio-9p FIDs
Sasha Levin [Wed, 9 May 2012 12:24:47 +0000 (14:24 +0200)]
kvm tools: use accessor function for virtio-9p FIDs

Since the 9p functions don't know the size of the fid array, they might
request an FID outside of the allowed range. Use an accessor to prevent
that and to hide the internal implementation from them.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: use bitwise 'and' in kvm-ipc
Sasha Levin [Wed, 9 May 2012 12:24:46 +0000 (14:24 +0200)]
kvm tools: use bitwise 'and' in kvm-ipc

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: fix sigsegv in irq__exit
Sasha Levin [Wed, 9 May 2012 12:24:45 +0000 (14:24 +0200)]
kvm tools: fix sigsegv in irq__exit

We free the structure, but never remove them from the tree or list, then
we freed them the next time we ran through that structure.

This patch also simplifies irq__exit a bit.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Fix printf() format string in kvm__load_firmware()
Jean-Philippe Menil [Tue, 8 May 2012 13:48:15 +0000 (15:48 +0200)]
kvm tools: Fix printf() format string in kvm__load_firmware()

Fixes the following build breakage with '-Werror':

  cc1: warnings being treated as errors
  x86/boot.c: In function ‘kvm__load_firmware’:
  x86/boot.c:29: error: format ‘%lu’ expects type ‘long unsigned int’, but
  argument 3 has type ‘__off64_t’
  make: *** [x86/boot.o] Erreur 1

Signed-off-by: Jean-Philippe Menil <jean-philippe.menil@univ-nantes.fr>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Add own barrier() definition
Cyrill Gorcunov [Tue, 8 May 2012 09:52:40 +0000 (13:52 +0400)]
kvm tools: Add own barrier() definition

Otherwise I'm getting the following compile problem on my Fedora
machine. The helper is rather taken from linux kernel.

 | [cyrill@moon kvm]$ make tags
 | x86/include/kvm/barrier.h:11:25: fatal error: asm/barrier.h: No such file or directory compilation terminated.

Acked-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Add --debug-mmio option
Cyrill Gorcunov [Thu, 3 May 2012 19:16:55 +0000 (23:16 +0400)]
kvm tools: Add --debug-mmio option

This switches the default behaviour of lkvm if access
on unregistered MMIO address happens -- we don't spam
a user with warning messages anymore. If one needs details
on unhandled MMIOs the --debug-mmio option should be passed.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Fix build breakage due to <linux/stddef.h> changes
Pekka Enberg [Tue, 8 May 2012 05:27:13 +0000 (08:27 +0300)]
kvm tools: Fix build breakage due to <linux/stddef.h> changes

Commit 2084c24 ("do not export kernel's NULL #define to userspace") broken KVM
tool build:

  FYI:

   CC       framebuffer.o
  In file included from include/kvm/framebuffer.h:5:0,
                from framebuffer.c:1:
  ../../include/linux/list.h: In function ‘INIT_HLIST_NODE’:
  ../../include/linux/list.h:572:12: error: ‘NULL’ undeclared (first use in this function)
  ../../include/linux/list.h:572:12: note: each undeclared identifier is reported only once for each function it appears in
  ../../include/linux/list.h: In function ‘hlist_move_list’:
  ../../include/linux/list.h:657:15: error: ‘NULL’ undeclared (first use in this function)
  make: *** [framebuffer.o] Error 1

  due to this upstream commit:

   2084c24a8141 do not export kernel's NULL #define to userspace

Fix that.

Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Update README for CONFIG_FB_VESA
Asias He [Fri, 13 Apr 2012 11:44:39 +0000 (19:44 +0800)]
kvm tools: Update README for CONFIG_FB_VESA

CONFIG_FB_VESA is needed for --sdl or --vnc. Update README for it.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Fix sdl hang
Asias He [Fri, 13 Apr 2012 11:44:38 +0000 (19:44 +0800)]
kvm tools: Fix sdl hang

Commit b4a932d175c6aa975c456e9b05339aa069c961cb sets sdl's .start
ops to sdl__stop which makes the sdl never start.

Fix it up.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Make raw block device work
Asias He [Thu, 12 Apr 2012 23:49:44 +0000 (07:49 +0800)]
kvm tools: Make raw block device work

Previously, we use mmaped host root partition as guest's root
filesystem. As virtio-9p based root filesystem is supported,
mmaped host root partition approach is not used anymore.

It is useful to use raw block device as guest's disk backend for some
user. e.g. bypass host's fs layer.

This patch makes raw block device work as disk image, user can do
read/write on raw block device, by using DISK_IMAGE_REGULAR instead of
DISK_IMAGE_MMAP for block device

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Drop unnecessary headers in barrier.h
Asias He [Sat, 7 Apr 2012 12:14:55 +0000 (20:14 +0800)]
kvm tools: Drop unnecessary headers in barrier.h

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Small indentation fix
Asias He [Sat, 7 Apr 2012 12:12:58 +0000 (20:12 +0800)]
kvm tools: Small indentation fix

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Use enum for NET_MODE_{USER, TAP}
Asias He [Sat, 7 Apr 2012 12:11:13 +0000 (20:11 +0800)]
kvm tools: Use enum for NET_MODE_{USER, TAP}

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Rename VIRTIO_P9 to VIRTIO_9P
Asias He [Sat, 7 Apr 2012 12:07:29 +0000 (20:07 +0800)]
kvm tools: Rename VIRTIO_P9 to VIRTIO_9P

This makes the naming more consistent.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Add set_size_vq for virtio-blk
Asias He [Sat, 7 Apr 2012 12:05:22 +0000 (20:05 +0800)]
kvm tools: Add set_size_vq for virtio-blk

set_size_vq does not do the actual work, we can implement this later.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Add set_size_vq for virtio-net
Asias He [Sat, 7 Apr 2012 12:01:51 +0000 (20:01 +0800)]
kvm tools: Add set_size_vq for virtio-net

set_size_vq does not do the actual work, we can implement this later.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Increase virtio-blk and virtio-net queue size
Asias He [Sat, 7 Apr 2012 11:56:38 +0000 (19:56 +0800)]
kvm tools: Increase virtio-blk and virtio-net queue size

Increase virtio-blk and virtio-net queue size to 256.
This makes virtio-mmio work.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Introduce trans=mmio parameter for virtio-net
Asias He [Sat, 7 Apr 2012 11:51:21 +0000 (19:51 +0800)]
kvm tools: Introduce trans=mmio parameter for virtio-net

To select virtio-mmio instead of virito-pci transport:

   lkvm run --network trans=mmio

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Support virtio-mmio in virtio_init
Asias He [Sat, 7 Apr 2012 11:47:34 +0000 (19:47 +0800)]
kvm tools: Support virtio-mmio in virtio_init

This patch adds virtio-mmio support in virtio_init.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Add virtio-mmio support
Asias He [Sat, 7 Apr 2012 11:44:12 +0000 (19:44 +0800)]
kvm tools: Add virtio-mmio support

This patch is based on Sasha's 'kvm tools: Add support for virtio-mmio'
patch. ioeventfds support is added which was missing in the previous one.
VQ size/align is still not supported.

It adds support for the new virtio-mmio transport layer added in
3.2-rc1. The purpose of this new layer is to allow virtio to work on
systems which don't necessarily support PCI, such as embedded systems.

To apply the patch on top of the KVM tools tree, you must first pull
Linus' tree on top. Also, CONFIG_VIRTIO_MMIO=y should be set in the
guest kernel.

To easily test it it's recommended to apply Pawel Moll's patch named
'virtio-mmio: Devices parameter parsing' on top, and define the
virtio-mmio device using kernel command line.

LKVM will print a message to help user to figure out how to add kernel
command line to support virtio-mmio.

To instantiate guest virtio-mmio devices using kernel command line (or
module) parameter, e.g.

   virtio_mmio.devices=0x200@0xd2000000:5,0x200@0xd2000200:6

Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: virtualization@lists.linux-foundation.org
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Introduce KVM_VIRTIO_MMIO_AREA
Asias He [Sat, 7 Apr 2012 11:42:06 +0000 (19:42 +0800)]
kvm tools: Introduce KVM_VIRTIO_MMIO_AREA

This area is used for virtio-mmio.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Rename callback_mmio_table
Asias He [Sat, 7 Apr 2012 11:39:57 +0000 (19:39 +0800)]
kvm tools: Rename callback_mmio_table

Reanme callback_mmio_table to virtio_pci__mmio_callback

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Rework on virtio transport abstraction.
Asias He [Sat, 7 Apr 2012 22:48:20 +0000 (06:48 +0800)]
kvm tools: Rework on virtio transport abstraction.

This patch reworks on virtio transport abstraction.

* Move virtio transport operations to virtio operations and drop
  virtio/trans.c This makes the abstraction much cleaner.

* Rename struct virtio_trans to struct virtio_device

  struct virtio_trans {
       void                    *virtio;
       enum virtio_trans_type  type;
       struct virtio_trans_ops *trans_ops;
       struct virtio_ops       *virtio_ops;
  };

  struct virtio_device {
       void                    *virtio;
       struct virtio_ops       *ops;
  };

  The virtio_trans struct is bit confusing since it also includes virtio
  operations.

* Introduce virtio_init()
  To init device, e.g.
  Before:
virtio_trans_init()
ndev->vtrans.trans_ops->init()
ndev->vtrans.virtio_ops = &net_dev_virtio_ops
  After:
virtio_init()

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agokvm tools: Add is_pio flag to ioeventfd__add_event
Asias He [Sat, 7 Apr 2012 22:47:17 +0000 (06:47 +0800)]
kvm tools: Add is_pio flag to ioeventfd__add_event

Add is_pio flag to set KVM_IOEVENTFD_FLAG_PIO. This is useful for
attaching an ioeventfd to MMIO address as well as PIO address.
virtio-mmio needs an ioeventfd to MMIO address.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agotools/kvm: Fix compilation fallout from system.h split-up
Ingo Molnar [Sun, 1 Apr 2012 12:24:34 +0000 (14:24 +0200)]
tools/kvm: Fix compilation fallout from system.h split-up

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agoMerge commit 'v3.4-rc1' into kvmtool/next
Pekka Enberg [Sun, 1 Apr 2012 19:04:17 +0000 (22:04 +0300)]
Merge commit 'v3.4-rc1' into kvmtool/next

Merge reason: pull upstream "asm/system.h" header cleanups to fix Ingo Molnar's
build issues in the -tip tree.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
12 years agoLinux 3.4-rc1 v3.4-rc1
Linus Torvalds [Sat, 31 Mar 2012 23:24:09 +0000 (16:24 -0700)]
Linux 3.4-rc1

12 years agoMerge branch 's3-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/amit/virti...
Linus Torvalds [Sat, 31 Mar 2012 22:11:39 +0000 (15:11 -0700)]
Merge branch 's3-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/amit/virtio-console

Pull virtio S3 support patches from Amit Shah:
 "Turns out S3 is not different from S4 for virtio devices: the device
  is assumed to be reset, so the host and guest state are to be assumed
  to be out of sync upon resume.  We handle the S4 case with exactly the
  same scenario, so just point the suspend/resume routines to the
  freeze/restore ones.

  Once that is done, we also use the PM API's macro to initialise the
  sleep functions.

  A couple of cleanups are included: there's no need for special thaw
  processing in the balloon driver, so that's addressed in patches 1 and
  2.

  Testing: both S3 and S4 support have been tested using these patches
  using a similar method used earlier during S4 patch development: a
  guest is started with virtio-blk as the only disk, a virtio network
  card, a virtio-serial port and a virtio balloon device.  Ping from
  guest to host, dd /dev/zero to a file on the disk, and IO from the
  host on the virtio-serial port, all at once, while exercising S4 and
  S3 (separately) were tested.  They all continue to work fine after
  resume.  virtio balloon values too were tested by inflating and
  deflating the balloon."

Pulling from Amit, since Rusty is off getting married (and presumably
shaving people).

* 's3-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/amit/virtio-console:
  virtio-pci: switch to PM ops macro to initialise PM functions
  virtio-pci: S3 support
  virtio-pci: drop restore_common()
  virtio: drop thaw PM operation
  virtio: balloon: Allow stats update after restore from S4

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Linus Torvalds [Sat, 31 Mar 2012 20:42:57 +0000 (13:42 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull second try at vfs part d#2 from Al Viro:
 "Miklos' first series (with do_lookup() rewrite split into edible
  chunks) + assorted bits and pieces.

  The 'untangling of do_lookup()' series is is a splitup of what used to
  be a monolithic patch from Miklos, so this series is basically "how do
  I convince myself that his patch is correct (or find a hole in it)".
  No holes found and I like the resulting cleanup, so in it went..."

Changes from try 1: Fix a boot problem with selinux, and commit messages
prettied up a bit.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (24 commits)
  vfs: fix out-of-date dentry_unhash() comment
  vfs: split __lookup_hash
  untangling do_lookup() - take __lookup_hash()-calling case out of line.
  untangling do_lookup() - switch to calling __lookup_hash()
  untangling do_lookup() - merge d_alloc_and_lookup() callers
  untangling do_lookup() - merge failure exits in !dentry case
  untangling do_lookup() - massage !dentry case towards __lookup_hash()
  untangling do_lookup() - get rid of need_reval in !dentry case
  untangling do_lookup() - eliminate a loop.
  untangling do_lookup() - expand the area under ->i_mutex
  untangling do_lookup() - isolate !dentry stuff from the rest of it.
  vfs: move MAY_EXEC check from __lookup_hash()
  vfs: don't revalidate just looked up dentry
  vfs: fix d_need_lookup/d_revalidate order in do_lookup
  ext3: move headers to fs/ext3/
  migrate ext2_fs.h guts to fs/ext2/ext2.h
  new helper: ext2_image_size()
  get rid of pointless includes of ext2_fs.h
  ext2: No longer export ext2_fs.h to user space
  mtdchar: kill persistently held vfsmount
  ...

12 years agoMerge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sat, 31 Mar 2012 20:35:31 +0000 (13:35 -0700)]
Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler fixes from Ingo Molnar.

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  sched: Fix incorrect usage of for_each_cpu_mask() in select_fallback_rq()
  sched: Fix __schedule_bug() output when called from an interrupt
  sched/arch: Introduce the finish_arch_post_lock_switch() scheduler callback

12 years agoMerge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sat, 31 Mar 2012 20:34:04 +0000 (13:34 -0700)]
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull perf updates and fixes from Ingo Molnar:
 "It's mostly fixes, but there's also two late items:

   - preliminary GTK GUI support for perf report
   - PMU raw event format descriptors in sysfs, to be parsed by tooling

  The raw event format in sysfs is a new ABI.  For example for the 'CPU'
  PMU we have:

    aldebaran:~> ll /sys/bus/event_source/devices/cpu/format/*
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/any
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/cmask
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/edge
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/event
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/inv
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/offcore_rsp
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/pc
    -r--r--r--. 1 root root 4096 Mar 31 10:29 /sys/bus/event_source/devices/cpu/format/umask

  those lists of fields contain a specific format:

    aldebaran:~> cat /sys/bus/event_source/devices/cpu/format/offcore_rsp
    config1:0-63

  So, those who wish to specify raw events can now use the following
  event format:

    -e cpu/cmask=1,event=2,umask=3

  Most people will not want to specify any events (let alone raw
  events), they'll just use whatever default event the tools use.

  But for more obscure PMU events that have no cross-architecture
  generic events the above syntax is more usable and a bit more
  structured than specifying hex numbers."

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (41 commits)
  perf tools: Remove auto-generated bison/flex files
  perf annotate: Fix off by one symbol hist size allocation and hit accounting
  perf tools: Add missing ref-cycles event back to event parser
  perf annotate: addr2line wants addresses in same format as objdump
  perf probe: Finder fails to resolve function name to address
  tracing: Fix ent_size in trace output
  perf symbols: Handle NULL dso in dso__name_len
  perf symbols: Do not include libgen.h
  perf tools: Fix bug in raw sample parsing
  perf tools: Fix display of first level of callchains
  perf tools: Switch module.h into export.h
  perf: Move mmap page data_head offset assertion out of header
  perf: Fix mmap_page capabilities and docs
  perf diff: Fix to work with new hists design
  perf tools: Fix modifier to be applied on correct events
  perf tools: Fix various casting issues for 32 bits
  perf tools: Simplify event_read_id exit path
  tracing: Fix ftrace stack trace entries
  tracing: Move the tracing_on/off() declarations into CONFIG_TRACING
  perf report: Add a simple GTK2-based 'perf report' browser
  ...

12 years agoMerge tag 'parisc-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/parisc-2.6
Linus Torvalds [Sat, 31 Mar 2012 20:32:30 +0000 (13:32 -0700)]
Merge tag 'parisc-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/parisc-2.6

Pull PARISC misc updates from James Bottomley:
 "This is a couple of minor updates (fixing lws futex locking and
  removing some obsolete cpu_*_map calls)."

* tag 'parisc-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/parisc-2.6:
  [PARISC] remove references to cpu_*_map.
  [PARISC] futex: Use same lock set as lws calls

12 years agoMerge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi...
Linus Torvalds [Sat, 31 Mar 2012 20:31:23 +0000 (13:31 -0700)]
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

Pull SCSI updates from James Bottomley:
 "This is primarily another round of driver updates (lpfc, bfa, fcoe,
  ipr) plus a new ufshcd driver.  There shouldn't be anything
  controversial in here (The final deletion of scsi proc_ops which
  caused some build breakage has been held over until the next merge
  window to give us more time to stabilise it).

  I'm afraid, with me moving continents at exactly the wrong time,
  anything submitted after the merge window opened has been held over to
  the next merge window."

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (63 commits)
  [SCSI] ipr: Driver version 2.5.3
  [SCSI] ipr: Increase alignment boundary of command blocks
  [SCSI] ipr: Increase max concurrent oustanding commands
  [SCSI] ipr: Remove unnecessary memory barriers
  [SCSI] ipr: Remove unnecessary interrupt clearing on new adapters
  [SCSI] ipr: Fix target id allocation re-use problem
  [SCSI] atp870u, mpt2sas, qla4xxx use pci_dev->revision
  [SCSI] fcoe: Drop the rtnl_mutex before calling fcoe_ctlr_link_up
  [SCSI] bfa: Update the driver version to 3.0.23.0
  [SCSI] bfa: BSG and User interface fixes.
  [SCSI] bfa: Fix to avoid vport delete hang on request queue full scenario.
  [SCSI] bfa: Move service parameter programming logic into firmware.
  [SCSI] bfa: Revised Fabric Assigned Address(FAA) feature implementation.
  [SCSI] bfa: Flash controller IOC pll init fixes.
  [SCSI] bfa: Serialize the IOC hw semaphore unlock logic.
  [SCSI] bfa: Modify ISR to process pending completions
  [SCSI] bfa: Add fc host issue lip support
  [SCSI] mpt2sas: remove extraneous sas_log_info messages
  [SCSI] libfc: fcoe_transport_create fails in single-CPU environment
  [SCSI] fcoe: reduce contention for fcoe_rx_list lock [v2]
  ...

12 years agovfs: fix out-of-date dentry_unhash() comment
J. Bruce Fields [Wed, 15 Feb 2012 16:48:40 +0000 (11:48 -0500)]
vfs: fix out-of-date dentry_unhash() comment

64252c75a2196a0cf1e0d3777143ecfe0e3ae650 "vfs: remove dget() from
dentry_unhash()" changed the implementation but not the comment.

Cc: Sage Weil <sage@newdream.net>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agovfs: split __lookup_hash
Miklos Szeredi [Mon, 26 Mar 2012 10:54:24 +0000 (12:54 +0200)]
vfs: split __lookup_hash

Split __lookup_hash into two component functions:

 lookup_dcache - tries cached lookup, returns whether real lookup is needed
 lookup_real - calls i_op->lookup

This eliminates code duplication between d_alloc_and_lookup() and
d_inode_lookup().

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agountangling do_lookup() - take __lookup_hash()-calling case out of line.
Al Viro [Fri, 30 Mar 2012 18:48:04 +0000 (14:48 -0400)]
untangling do_lookup() - take __lookup_hash()-calling case out of line.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agountangling do_lookup() - switch to calling __lookup_hash()
Al Viro [Fri, 30 Mar 2012 18:41:51 +0000 (14:41 -0400)]
untangling do_lookup() - switch to calling __lookup_hash()

now we have __lookup_hash() open-coded if !dentry case;
just call the damn thing instead...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agountangling do_lookup() - merge d_alloc_and_lookup() callers
Al Viro [Fri, 30 Mar 2012 18:39:15 +0000 (14:39 -0400)]
untangling do_lookup() - merge d_alloc_and_lookup() callers

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agountangling do_lookup() - merge failure exits in !dentry case
Al Viro [Fri, 30 Mar 2012 18:37:42 +0000 (14:37 -0400)]
untangling do_lookup() - merge failure exits in !dentry case

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agountangling do_lookup() - massage !dentry case towards __lookup_hash()
Al Viro [Fri, 30 Mar 2012 18:34:00 +0000 (14:34 -0400)]
untangling do_lookup() - massage !dentry case towards __lookup_hash()

Reorder if-else cases for starters...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agountangling do_lookup() - get rid of need_reval in !dentry case
Al Viro [Fri, 30 Mar 2012 18:18:50 +0000 (14:18 -0400)]
untangling do_lookup() - get rid of need_reval in !dentry case

Everything arriving into if (!dentry) will have need_reval = 1.
Indeed, the only way to get there with need_reval reset to 0 would
be via
if (unlikely(d_need_lookup(dentry)))
goto unlazy;
if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE)) {
status = d_revalidate(dentry, nd);
if (unlikely(status <= 0)) {
if (status != -ECHILD)
need_reval = 0;
goto unlazy;
...
unlazy:
/* no assignments to dentry */
if (dentry && unlikely(d_need_lookup(dentry))) {
dput(dentry);
dentry = NULL;
}
and if d_need_lookup() had already been false the first time around, it
will remain false on the second call as well.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agountangling do_lookup() - eliminate a loop.
Al Viro [Fri, 30 Mar 2012 18:13:15 +0000 (14:13 -0400)]
untangling do_lookup() - eliminate a loop.

d_lookup() *will* fail after successful d_invalidate(), if we are
holding i_mutex all along.  IOW, we don't need to jump back to
l: - we know what path will be taken there and can do that (i.e.
d_alloc_and_lookup()) directly.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agountangling do_lookup() - expand the area under ->i_mutex
Al Viro [Fri, 30 Mar 2012 18:08:28 +0000 (14:08 -0400)]
untangling do_lookup() - expand the area under ->i_mutex

keep holding ->i_mutex over revalidation parts

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agountangling do_lookup() - isolate !dentry stuff from the rest of it.
Al Viro [Fri, 30 Mar 2012 18:04:16 +0000 (14:04 -0400)]
untangling do_lookup() - isolate !dentry stuff from the rest of it.

Duplicate the revalidation-related parts into if (!dentry) branch.
Next step will be to pull them under i_mutex.

This and the next 8 commits are more or less a splitup of patch
by Miklos; folks, when you are working with something that convoluted,
carve your patches up into easily reviewed steps, especially when
a lot of codepaths involved are rarely hit...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agovfs: move MAY_EXEC check from __lookup_hash()
Miklos Szeredi [Mon, 26 Mar 2012 10:54:21 +0000 (12:54 +0200)]
vfs: move MAY_EXEC check from __lookup_hash()

The only caller of __lookup_hash() that needs the exec permission check on
parent is lookup_one_len().

All lookup_hash() callers already checked permission in LOOKUP_PARENT walk.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agovfs: don't revalidate just looked up dentry
Miklos Szeredi [Mon, 26 Mar 2012 10:54:20 +0000 (12:54 +0200)]
vfs: don't revalidate just looked up dentry

__lookup_hash() calls ->lookup() if the dentry needs lookup and on success
revalidates the dentry (all under dir->i_mutex).

While this is harmless it doesn't make a lot of sense.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agovfs: fix d_need_lookup/d_revalidate order in do_lookup
Miklos Szeredi [Mon, 26 Mar 2012 10:54:19 +0000 (12:54 +0200)]
vfs: fix d_need_lookup/d_revalidate order in do_lookup

Doing revalidate on a dentry which has not yet been looked up makes no sense.

Move the d_need_lookup() check before d_revalidate().

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoext3: move headers to fs/ext3/
Al Viro [Fri, 30 Mar 2012 02:30:07 +0000 (22:30 -0400)]
ext3: move headers to fs/ext3/

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agomigrate ext2_fs.h guts to fs/ext2/ext2.h
Al Viro [Fri, 23 Mar 2012 20:45:51 +0000 (16:45 -0400)]
migrate ext2_fs.h guts to fs/ext2/ext2.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agonew helper: ext2_image_size()
Al Viro [Fri, 23 Mar 2012 20:36:45 +0000 (16:36 -0400)]
new helper: ext2_image_size()

... implemented that way since the next commit will leave it
almost alone in ext2_fs.h - most of the file (including
struct ext2_super_block) is going to move to fs/ext2/ext2.h.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoget rid of pointless includes of ext2_fs.h
Al Viro [Fri, 23 Mar 2012 20:04:05 +0000 (16:04 -0400)]
get rid of pointless includes of ext2_fs.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoext2: No longer export ext2_fs.h to user space
Thierry Reding [Fri, 23 Mar 2012 09:27:36 +0000 (10:27 +0100)]
ext2: No longer export ext2_fs.h to user space

Since the on-disk format has been stable for quite some time, users
should either use the headers provided by libext2fs or keep a private
copy of this header. For the full discussion, see this thread:

https://lkml.org/lkml/2012/3/21/516

While at it, this commit removes all __KERNEL__ guards, which are now
unnecessary.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Jan Kara <jack@suse.cz>
Cc: Ted Ts'o <tytso@mit.edu>
Cc: Artem Bityutskiy <dedekind1@gmail.com>
Cc: Andreas Dilger <aedilger@gmail.com>
Cc: linux-ext4@vger.kernel.org
12 years agomtdchar: kill persistently held vfsmount
Al Viro [Fri, 23 Mar 2012 17:47:52 +0000 (13:47 -0400)]
mtdchar: kill persistently held vfsmount

... and mtdchar_notifier along with it; just have ->drop_inode() that
will unconditionally get evict them instead of dances on mtd device
removal and use simple_pin_fs() instead of kern_mount()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agopstore: trim pstore_get_inode()
Al Viro [Thu, 22 Mar 2012 16:26:35 +0000 (12:26 -0400)]
pstore: trim pstore_get_inode()

move mode-dependent parts to callers, kill unused arguments

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoaio: take final put_ioctx() into callers of io_destroy()
Al Viro [Tue, 20 Mar 2012 20:27:57 +0000 (16:27 -0400)]
aio: take final put_ioctx() into callers of io_destroy()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoaio: merge aio_cancel_all() with wait_for_all_aios()
Al Viro [Tue, 20 Mar 2012 20:26:24 +0000 (16:26 -0400)]
aio: merge aio_cancel_all() with wait_for_all_aios()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoselinuxfs: merge dentry allocation into sel_make_dir()
Al Viro [Mon, 19 Mar 2012 00:36:59 +0000 (20:36 -0400)]
selinuxfs: merge dentry allocation into sel_make_dir()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12 years agoASPM: Fix pcie devices with non-pcie children
Matthew Garrett [Tue, 27 Mar 2012 14:17:41 +0000 (10:17 -0400)]
ASPM: Fix pcie devices with non-pcie children

Since 3.2.12 and 3.3, some systems are failing to boot with a BUG_ON.
Some other systems using the pata_jmicron driver fail to boot because no
disks are detected.  Passing pcie_aspm=force on the kernel command line
works around it.

The cause: commit 4949be16822e ("PCI: ignore pre-1.1 ASPM quirking when
ASPM is disabled") changed the behaviour of pcie_aspm_sanity_check() to
always return 0 if aspm is disabled, in order to avoid cases where we
changed ASPM state on pre-PCIe 1.1 devices.

This skipped the secondary function of pcie_aspm_sanity_check which was
to avoid us enabling ASPM on devices that had non-PCIe children, causing
trouble later on.  Move the aspm_disabled check so we continue to honour
that scenario.

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=42979 and
          http://bugs.debian.org/665420

Reported-by: Romain Francoise <romain@orebokech.com> # kernel panic
Reported-by: Chris Holland <bandidoirlandes@gmail.com> # disk detection trouble
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: stable@vger.kernel.org
Tested-by: Hatem Masmoudi <hatem.masmoudi@gmail.com> # Dell Latitude E5520
Tested-by: janek <jan0x6c@gmail.com> # pata_jmicron with JMB362/JMB363
[jn: with more symptoms in log message]
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoselinux: inline avc_audit() and avc_has_perm_noaudit() into caller
Linus Torvalds [Sat, 31 Mar 2012 18:12:57 +0000 (11:12 -0700)]
selinux: inline avc_audit() and avc_has_perm_noaudit() into caller

Now that all the slow-path code is gone from these functions, we can
inline them into the main caller - avc_has_perm_flags().

Now the compiler can see that 'avc' is allocated on the stack for this
case, which helps register pressure a bit.  It also actually shrinks the
total stack frame, because the stack frame that avc_has_perm_flags()
always needed (for that 'avc' allocation) is now sufficient for the
inlined functions too.

Inlining isn't bad - but mindless inlining of cold code (see the
previous commit) is.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoselinux: don't inline slow-path code into avc_has_perm_noaudit()
Linus Torvalds [Sat, 31 Mar 2012 17:58:08 +0000 (10:58 -0700)]
selinux: don't inline slow-path code into avc_has_perm_noaudit()

The selinux AVC paths remain some of the hottest (and deepest) codepaths
at filename lookup time, and we make it worse by having the slow path
cases take up I$ and stack space even when they don't trigger.  Gcc
tends to always want to inline functions that are just called once -
never mind that this might make for slower and worse code in the caller.

So this tries to improve on it a bit by making the slow-path cases
explicitly separate functions that are marked noinline, causing gcc to
at least no longer allocate stack space for them unless they are
actually called.  It also seems to help register allocation a tiny bit,
since gcc now doesn't take the slow case code into account.

Uninlining the slow path may also allow us to inline the remaining hot
path into the one caller that actually matters: avc_has_perm_flags().
I'll have to look at that separately, but both avc_audit() and
avc_has_perm_noaudit() are now small and lean enough that inlining them
may make sense.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agosched: Fix incorrect usage of for_each_cpu_mask() in select_fallback_rq()
Srivatsa S. Bhat [Fri, 30 Mar 2012 14:10:28 +0000 (19:40 +0530)]
sched: Fix incorrect usage of for_each_cpu_mask() in select_fallback_rq()

The function for_each_cpu_mask() expects a *pointer* to struct
cpumask as its second argument, whereas select_fallback_rq()
passes the value itself.

And moreover, for_each_cpu_mask() has been marked as obselete
in include/linux/cpumask.h. So move to the more appropriate
for_each_cpu() variant.

Reported-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Dave Jones <davej@redhat.com>
Cc: Liu Chuansheng <chuansheng.liu@intel.com>
Cc: vapier@gentoo.org
Cc: rusty@rustcorp.com.au
Link: http://lkml.kernel.org/r/4F75BED4.9050005@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
12 years agoMerge branch 'perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/acme...
Ingo Molnar [Sat, 31 Mar 2012 07:27:41 +0000 (09:27 +0200)]
Merge branch 'perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent

12 years agovirtio-pci: switch to PM ops macro to initialise PM functions
Amit Shah [Thu, 29 Mar 2012 07:28:05 +0000 (12:58 +0530)]
virtio-pci: switch to PM ops macro to initialise PM functions

Use the SET_SYSTEM_SLEEP_PM_OPS macro to initialise the suspend/resume
functions in the new PM API.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
12 years agovirtio-pci: S3 support
Amit Shah [Thu, 29 Mar 2012 07:21:41 +0000 (12:51 +0530)]
virtio-pci: S3 support

There's no difference in supporting S3 and S4 for virtio devices: the
vqs have to be re-created as the device has to be assumed to be reset at
restore-time.  Since S4 already handles this situation, we can directly
use the same code and callbacks for S3 support.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
12 years agovirtio-pci: drop restore_common()
Amit Shah [Thu, 29 Mar 2012 07:24:43 +0000 (12:54 +0530)]
virtio-pci: drop restore_common()

restore_common() was shared between restore and thaw callbacks.  With
thaw gone, we don't need restore_common() anymore.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
12 years agovirtio: drop thaw PM operation
Amit Shah [Thu, 29 Mar 2012 07:20:20 +0000 (12:50 +0530)]
virtio: drop thaw PM operation

The thaw operation was used by the balloon driver, but after the last
commit there's no reason to have separate thaw and restore callbacks.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
12 years agovirtio: balloon: Allow stats update after restore from S4
Amit Shah [Thu, 29 Mar 2012 07:18:19 +0000 (12:48 +0530)]
virtio: balloon: Allow stats update after restore from S4

There's no reason stats update after restore can't work.  If a host
requested for stats, and before servicing the request, the guest entered
S4, upon restore, the stats request can still be processed and sent off
to the host.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Linus Torvalds [Sat, 31 Mar 2012 01:40:33 +0000 (18:40 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc

Pull Sam Ravnborg's sparc32 build fixes from David Miller.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
  sparc32: fix fallout from system.h removal

12 years agosparc32: fix fallout from system.h removal
Sam Ravnborg [Fri, 30 Mar 2012 13:53:50 +0000 (15:53 +0200)]
sparc32: fix fallout from system.h removal

Build failures for the typical configs I use

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>