]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
13 years agokvm tools: Cleanup IO space and PCI magic numbers
Asias He [Fri, 8 Apr 2011 14:12:48 +0000 (22:12 +0800)]
kvm tools: Cleanup IO space and PCI magic numbers

This patch define macros for virtio device IO space size and PCI device
numbering.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Fix input hang when compiling without optimization
Sasha Levin [Wed, 6 Apr 2011 18:47:27 +0000 (21:47 +0300)]
kvm tools: Fix input hang when compiling without optimization

When compiling without optimizations (-O0) input would hang.
This was caused by poll() returning there was data to read but read()
failing.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Use STDIN_FILENO instead of fileno(stdin)
Pekka Enberg [Wed, 6 Apr 2011 18:09:14 +0000 (21:09 +0300)]
kvm tools: Use STDIN_FILENO instead of fileno(stdin)

To cleanup the serial console emulation code, use STDIN_FILENO which is POSIX
API instead of fileno(stdin) which is libc API.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools, bios: Introduce bioscall specificator
Cyrill Gorcunov [Wed, 6 Apr 2011 17:19:08 +0000 (21:19 +0400)]
kvm tools, bios: Introduce bioscall specificator

We are to be sure how arguments are passed from
bios assembler code to C code. Just for sure.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Free memory and FDs on exit
Sasha Levin [Wed, 6 Apr 2011 16:07:43 +0000 (19:07 +0300)]
kvm tools: Free memory and FDs on exit

Following patch adds more cleanup code when exiting.
Close disk image, free msrs array and destroy the timer fd.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Drop hard-coded 'nosmp' kernel parameter
Pekka Enberg [Wed, 6 Apr 2011 15:46:29 +0000 (18:46 +0300)]
kvm tools: Drop hard-coded 'nosmp' kernel parameter

As noted by Cyrill, there's no need to pass 'nosmp' to the guest kernel because
it'll switch to PIC after noticing APIC is not available.

Cc: Asias He <asias.hejun@gmail.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Cleanup disk image code
Pekka Enberg [Wed, 6 Apr 2011 13:25:17 +0000 (16:25 +0300)]
kvm tools: Cleanup disk image code

This patch cleans up disk image in preparation for supporting other disk
format.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Cleanup virtio block device configuration
Pekka Enberg [Wed, 6 Apr 2011 13:25:17 +0000 (16:25 +0300)]
kvm tools: Cleanup virtio block device configuration

This patch removes obsolete virtio block device configuration bits that are no
longer used.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: remove KVM_EXIT_INTERNAL_ERROR
Asias He [Thu, 7 Apr 2011 08:33:41 +0000 (16:33 +0800)]
kvm tools: remove KVM_EXIT_INTERNAL_ERROR

Since we are in tools/kvm, remove the compatibility define

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Separate BIOS specifics into own file
Cyrill Gorcunov [Tue, 5 Apr 2011 17:44:57 +0000 (20:44 +0300)]
kvm tools: Separate BIOS specifics into own file

Instead of calling various BIOS routines from kvm.c better to have all BIOS
specifics sit in bios.c.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Remove useless empty lines for a call series in kvm__reset_vcpu
Cyrill Gorcunov [Tue, 5 Apr 2011 17:44:30 +0000 (20:44 +0300)]
kvm tools: Remove useless empty lines for a call series in kvm__reset_vcpu

Also add a comment on function in kernel-doc style.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Setup BIOS for both bzImage and flat image
Cyrill Gorcunov [Tue, 5 Apr 2011 17:43:39 +0000 (20:43 +0300)]
kvm tools: Setup BIOS for both bzImage and flat image

There is no differences in terms of BIOS what kind of kernel is loaded so we
have to setup BIOS for both bzImage and flat image.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Cleanup strstr() in expression
Pekka Enberg [Tue, 5 Apr 2011 16:48:40 +0000 (19:48 +0300)]
kvm tools: Cleanup strstr() in expression

Cleanup use of strstr() in an expression in main() function.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: do not append root=/dev/vda if passed via command line
David Ahern [Tue, 5 Apr 2011 16:04:13 +0000 (10:04 -0600)]
kvm tools: do not append root=/dev/vda if passed via command line

Hardcoding the root= option prevents an existing qemu-kvm based disk
image using LVM from booting. It fails to find the root filesystem.
By making the root parameter optional if given on the command line, the
image boots correctly. For example,

  ./kvm --kernel=/tmp/vmlinuz-2.6.38 \
        --initrd=/tmp/initramfs-2.6.38.img \
        --image=/home/dsa/vm/images/f14/nkvm-f14.img \
        --mem=1024
        --params="ro root=/dev/mapper/vg_f14vm-lv_root"

works now.

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agotools kvm: Fix missing ARCH define on 32-bit in Makefile
Pekka Enberg [Mon, 4 Apr 2011 15:23:47 +0000 (18:23 +0300)]
tools kvm: Fix missing ARCH define on 32-bit in Makefile

Commit daf68ae ("kvm tools: Fix KVM problem on SuSe 2.6.37 kernel") missed a
hunk that's needed on 32 bit x86.

Reported-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Fix KVM problem on SuSe 2.6.37 kernel
Prasad Joshi [Mon, 4 Apr 2011 15:03:21 +0000 (16:03 +0100)]
kvm tools: Fix KVM problem on SuSe 2.6.37 kernel

Got following errors while compiling the native kvm tool on my supervisor's
machine.

oswaldo@sir61a:~/linux-kvm/tools/kvm> make
In file included from /usr/include/asm/types.h:4,
                 from /usr/include/asm/kvm.h:9,
                 from ../../include/linux/kvm.h:13,
                 from include/kvm/kvm.h:6,
                 from mmio.c:1:
../../include/asm-generic/int-ll64.h:11:29: error: asm/bitsperlong.h: No such file or directory
In file included from /usr/include/asm/types.h:4,
                 from /usr/include/asm/kvm.h:9,
                 from ../../include/linux/kvm.h:13,
                 from include/kvm/kvm.h:6,
                 from main.c:1:
[snip]

../../include/asm-generic/int-ll64.h:11:29: error: asm/bitsperlong.h: No such file or directory
make: *** No rule to make target `8250-serial.d', needed by `kvm'.  Stop.

Following patch adds architecture specific include path to resolve this error.

Signed-off-by: Prasad Joshi <prasadjoshi124@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: add README
Asias He [Sun, 3 Apr 2011 10:50:51 +0000 (18:50 +0800)]
kvm tools: add README

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Fix required boot protocol version
Pekka Enberg [Sun, 3 Apr 2011 09:42:12 +0000 (12:42 +0300)]
kvm tools: Fix required boot protocol version

Cyrill has an old bzImage that SIGSEGVs when running under KVM because
'cmdline_size' is bogus. Reading Documentation/x86/boot.txt, it turns out
32-bit 'cmdline_size' requires boot protocol 2.06 or later so fix up
BOOT_PROTOCOL_REQUIRED.

Reported-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Fix E820 map on x86-64
Pekka Enberg [Sun, 3 Apr 2011 08:25:14 +0000 (11:25 +0300)]
kvm tools: Fix E820 map on x86-64

We must not define '-D__x86_64__' for all the code because the BIOS emulation
code is actually real mode 16-bite code. This fixes E820 map regression on
x86-64 caused by commit e227ea5 ("kvm tools: Fix compilation on x86_64").

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Fix compilation on x86_64
Paul Bolle [Thu, 31 Mar 2011 20:33:02 +0000 (22:33 +0200)]
kvm tools: Fix compilation on x86_64

Compilation on x86_64 failed with:
[...]
In file included from /usr/include/features.h:386:0,
                 from /usr/include/stdint.h:26,
                 from
/usr/lib/gcc/x86_64-redhat-linux/4.5.1/include/stdint.h:3,
                 from include/kvm/e820.h:4,
                 from bios/e820.c:1:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file
or directory
compilation terminated.
make: *** [bios/bios-rom.bin] Error 1

This is caused by a typo in the Makefile and because gnu/stubs.h (and
friends) expect to see __x86_64__. That's trivial to fix.

Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Fix large disk images on 32-bit
Pekka Enberg [Thu, 31 Mar 2011 08:50:09 +0000 (11:50 +0300)]
kvm tools: Fix large disk images on 32-bit

Use read()/write() instead of mmap() for virtio block device emulation to
support large disk images on 32-bit.

Reported-and-tested-by: Asias He <asias.hejun@gmail.com>
Tested-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools, 8250: Don't set the UART_LSR_OE bit
Pekka Enberg [Thu, 24 Mar 2011 16:56:02 +0000 (18:56 +0200)]
kvm tools, 8250: Don't set the UART_LSR_OE bit

User input is buffered anyway, so it's pointless to set the UART_LSR_OE bit.
Instead, wait for the guest kernel to consume the current input and send a new
character when the guest is ready.

This fixes the following warnings in guest kernels:

[  207.485000] ttyS0: 1 input overrun(s)

Reported-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agotools/kvm: Exit gracefully upon KVM_EXIT_SHUTDOWN
Pekka Enberg [Tue, 22 Mar 2011 19:32:46 +0000 (21:32 +0200)]
tools/kvm: Exit gracefully upon KVM_EXIT_SHUTDOWN

This patch changes the userspace hypervisor to exit gracefully upon
KVM_EXIT_SHUTDOWN which is triggered when guest userspace is shut down.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm,virtio: add scatter-gather support v2
Asias He [Sat, 26 Feb 2011 02:11:52 +0000 (10:11 +0800)]
kvm,virtio: add scatter-gather support v2

The size of the virtqueue(16) was smaller than scatter-gather(128)
which hypervisor tells the guest.  Under some circumstances,
if the guest uses scatter-gather which larger than 16 - 2, kernel panics.
That is why the scatter-gather support v1 breaks Cyrill's kernel boot.

Two descriptors are used as the header and status descriptors.
The remaining descriptors can be used as the real disk data descriptors.
So DISK_SEG_MAX should be VIRTIO_BLK_QUEUE_SIZE - 2.
VIRTIO_BLK_QUEUE_SIZE is 128 and DISK_SEG_MAX is 126 in this patch.

Tested-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Cleanup virtqueue handling
Pekka Enberg [Sun, 23 Jan 2011 19:21:58 +0000 (21:21 +0200)]
kvm tools: Cleanup virtqueue handling

This patch introduces some virtqueue handling helper functions and converts the
blk virtio device to use them.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm,8250: Fix device initial state
Pekka Enberg [Sun, 23 Jan 2011 09:49:39 +0000 (11:49 +0200)]
kvm,8250: Fix device initial state

This patch fixes 8250 device initial state for registers and IRQ based on what
Qemu does.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm tools: Cleanup termios handling
Pekka Enberg [Tue, 18 Jan 2011 21:05:06 +0000 (23:05 +0200)]
kvm tools: Cleanup termios handling

This patch cleans up the confused termios handling to do what Lguest does.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Remove duplicate headers
Pekka Enberg [Sun, 16 Jan 2011 21:09:01 +0000 (23:09 +0200)]
kvm: Remove duplicate headers

We're in the kernel source tree now so remove duplicate headers.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agoRevert "kvm,virtio: add scatter-gather support"
Pekka Enberg [Sun, 16 Jan 2011 21:06:42 +0000 (23:06 +0200)]
Revert "kvm,virtio: add scatter-gather support"

This reverts commit 87a53e99dad8b70decbc4d9744c3d272e51c3ceb.  It breaks
Cyrill's kernel boot.

13 years agovirtio, block: Rename IOPORT_VIRTIO to IOPORT_VIRTIO_BLK
Cyrill Gorcunov [Thu, 13 Jan 2011 16:56:17 +0000 (18:56 +0200)]
virtio, block: Rename IOPORT_VIRTIO to IOPORT_VIRTIO_BLK

Since that is its only purpose, not the whole virtio
stuff.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm,virtio: add scatter-gather support
Asias He [Thu, 13 Jan 2011 11:56:05 +0000 (19:56 +0800)]
kvm,virtio: add scatter-gather support

Publish VIRTIO_BLK_F_SEG_MAX feature to guest.

In disk I/O request, guest can use multiple buffers which are not physicall
contiguousy as the I/O request buffer.

[ penberg@kernel.org: cleanups ]
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Cleanup interrupt timer logic
Pekka Enberg [Tue, 11 Jan 2011 21:56:22 +0000 (23:56 +0200)]
kvm: Cleanup interrupt timer logic

This patch moves the interrupt timer logic to kvm.c and cleans it up.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm,serial: Implement 16550A FIFO support
Pekka Enberg [Tue, 11 Jan 2011 18:52:06 +0000 (20:52 +0200)]
kvm,serial: Implement 16550A FIFO support

This patch implements 16550A FIFO support to the serial console emulation
layer. There's still a bug lurking somewhere which the hypervisor in some busy
loop taking up 100% of CPU. However, this patch is a definite improvement over
the previous hacks.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm,8250: Implement missing register emulation
Pekka Enberg [Tue, 11 Jan 2011 15:52:22 +0000 (17:52 +0200)]
kvm,8250: Implement missing register emulation

This patch implements missing register emulation as per "UART register to port
conversion table" here:

  http://www.lammertbies.nl/comm/info/serial-uart.html

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years ago8250-serial: Emulate 8250 behaviour on autoprobing
Cyrill Gorcunov [Tue, 11 Jan 2011 06:08:15 +0000 (08:08 +0200)]
8250-serial: Emulate 8250 behaviour on autoprobing

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm,8250: Cleanup receive emulation
Pekka Enberg [Mon, 10 Jan 2011 22:06:28 +0000 (00:06 +0200)]
kvm,8250: Cleanup receive emulation

This patch cleans up receive emulation by separating the stdin polling and
reading logic from the interrupt logic. The patch also fixes the interrupt
injection code to inject one type of interrupt at a time.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm,8250: Fix ->counter clearing
Pekka Enberg [Mon, 10 Jan 2011 20:20:06 +0000 (22:20 +0200)]
kvm,8250: Fix ->counter clearing

We need to reset the counter to zero before we inject an interrupt to the
guest.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm,8250: Fix "too much work for irq4" problems
Pekka Enberg [Mon, 10 Jan 2011 19:46:37 +0000 (21:46 +0200)]
kvm,8250: Fix "too much work for irq4" problems

This patch fixes the "too much work for irq4" problems caused by the fact that
we never set the UART_IIR_NO_INT flag in the emulation layer. This makes the
interrupt handler in the guest kernel process as much as possible which
triggers a warning.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm,8250: Make ttyS1 and ttyS2 disabled
Pekka Enberg [Mon, 10 Jan 2011 19:21:06 +0000 (21:21 +0200)]
kvm,8250: Make ttyS1 and ttyS2 disabled

This patch fixes the 8250 serial emulation to not have undefined ioports but
rather make them explicitly disabled.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Support for more than one serial ttys
Pekka Enberg [Mon, 10 Jan 2011 19:12:03 +0000 (21:12 +0200)]
kvm: Support for more than one serial ttys

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Improve 8250 serial console interrupt handling
Pekka Enberg [Mon, 10 Jan 2011 18:28:37 +0000 (20:28 +0200)]
kvm: Improve 8250 serial console interrupt handling

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Use disk name for mounting root
Pekka Enberg [Mon, 10 Jan 2011 17:44:50 +0000 (19:44 +0200)]
kvm: Use disk name for mounting root

Use disk name for kernel "root=" parameter rather than the dynamic major and
minor numbers that vary from system to system.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agoMerge branch 'master' of /home/penberg/kvm into kvm/core
Pekka Enberg [Tue, 11 Jan 2011 14:49:41 +0000 (16:49 +0200)]
Merge branch 'master' of /home/penberg/kvm into kvm/core

13 years ago8250-serial: Make transmitter being always ready to send data
Cyrill Gorcunov [Mon, 10 Jan 2011 13:22:27 +0000 (16:22 +0300)]
8250-serial: Make transmitter being always ready to send data

Otherwise it causes kernel to do additional timeout
waiting for THR being empty.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years ago8250-serial: Use linux/serial-reg.h with predefined constants
Cyrill Gorcunov [Mon, 10 Jan 2011 13:20:10 +0000 (16:20 +0300)]
8250-serial: Use linux/serial-reg.h with predefined constants

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years ago8250-serial: Simplify is_readable function
Cyrill Gorcunov [Sun, 9 Jan 2011 23:06:10 +0000 (02:06 +0300)]
8250-serial: Simplify is_readable function

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agokvm: save/restore std ttys
Cyrill Gorcunov [Sun, 9 Jan 2011 21:30:32 +0000 (00:30 +0300)]
kvm: save/restore std ttys

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agokvm: Put terminal in canonical mode
Pekka Enberg [Sun, 9 Jan 2011 20:15:04 +0000 (22:15 +0200)]
kvm: Put terminal in canonical mode

As suggested by Ingo Molnar, put terminal in canonical mode. This makes poll()
on stdin to react to keystrokes insted of return key and fixes the double
echo'd character problem for input.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm,8250: Implement serial input support
Pekka Enberg [Sun, 9 Jan 2011 19:26:48 +0000 (21:26 +0200)]
kvm,8250: Implement serial input support

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agomake: Add TAGS, tags targets and tune cscope
Cyrill Gorcunov [Sun, 9 Jan 2011 17:12:43 +0000 (20:12 +0300)]
make: Add TAGS, tags targets and tune cscope

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agokvm: Use serial console by default
Pekka Enberg [Sun, 9 Jan 2011 16:32:38 +0000 (18:32 +0200)]
kvm: Use serial console by default

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm,8250: Inject interrupts to guest
Pekka Enberg [Sun, 9 Jan 2011 16:28:03 +0000 (18:28 +0200)]
kvm,8250: Inject interrupts to guest

This patch fixes 8250 emulation to inject interrupts to guest so we actually
see what's sent to the serial console.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Rename early_printk.c to 8250-serial.c
Pekka Enberg [Sun, 9 Jan 2011 11:02:04 +0000 (13:02 +0200)]
kvm: Rename early_printk.c to 8250-serial.c

The 8250 emulation is no longer there to just support early_printk() so rename
the source file to reflect that.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Implement support interrupt injection
Pekka Enberg [Sat, 8 Jan 2011 22:46:07 +0000 (00:46 +0200)]
kvm: Implement support interrupt injection

This patch implement support for injecting interrupts from the userspace
hypervisor to the guest.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Add rw to default kernel command line parameters
Asias He [Sun, 9 Jan 2011 08:48:40 +0000 (16:48 +0800)]
kvm: Add rw to default kernel command line parameters

As reported by Asias He, guest kernels mount filesystems as readonly under our
hypervisor:

  without rw:
  [    0.909000] EXT3-fs: mounted filesystem with writeback data mode.
  [    0.909000] VFS: Mounted root (ext3 filesystem) readonly on device 253:1.

  /dev/root on / type ext3 (ro,relatime,errors=continue,data=writeback)

by passing the "rw" kernel parameter, guest kernels are able to mount as
read-write:

  [    0.891000] EXT3 FS on vda1, internal journal
  [    0.891000] EXT3-fs: recovery complete.
  [    0.892000] EXT3-fs: mounted filesystem with writeback data mode.
  [    0.892000] VFS: Mounted root (ext3 filesystem) on device 253:1.

  /dev/root on / type ext3 (rw,relatime,errors=continue,data=writeback)

There's some real problem hiding here but as we've done with other parts of the
kernel (PCI, SMP), just bypass the problem for now.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm,virtio: do not publish read only feature to guest
Asias He [Sun, 9 Jan 2011 08:48:39 +0000 (16:48 +0800)]
kvm,virtio: do not publish read only feature to guest

We support write operations now.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm,virtio: move SECTOR_SHIFT and SECTOR_SIZE to disk-image.h
Asias He [Sun, 9 Jan 2011 08:01:40 +0000 (16:01 +0800)]
kvm,virtio: move SECTOR_SHIFT and SECTOR_SIZE to disk-image.h

Suggested-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm,serial: Enable THRI bit in IIR register
Pekka Enberg [Sat, 8 Jan 2011 20:56:25 +0000 (22:56 +0200)]
kvm,serial: Enable THRI bit in IIR register

This patch enables the THRI ("transmission holding register empty") bit in the
IIR register to make sure the guest doesn't think we have data waiting for it.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Fix magic numbers in 8250 support
Pekka Enberg [Sat, 8 Jan 2011 20:51:10 +0000 (22:51 +0200)]
kvm: Fix magic numbers in 8250 support

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Improve 8250 serial console support
Pekka Enberg [Sat, 8 Jan 2011 17:29:23 +0000 (19:29 +0200)]
kvm: Improve 8250 serial console support

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Redirect serial console to stdout, not stderr
Pekka Enberg [Sat, 8 Jan 2011 12:50:32 +0000 (14:50 +0200)]
kvm: Redirect serial console to stdout, not stderr

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Implement virtio block device write support
Pekka Enberg [Sat, 8 Jan 2011 12:28:59 +0000 (14:28 +0200)]
kvm: Implement virtio block device write support

This patch implement virtio block device write support. The writes are not
persistent because we map the disk image with MAP_PRIVATE.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Kill debug logging from blk-virtio.c
Pekka Enberg [Sat, 8 Jan 2011 11:24:49 +0000 (13:24 +0200)]
kvm: Kill debug logging from blk-virtio.c

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Support MSR register for serial console
Pekka Enberg [Sat, 8 Jan 2011 11:20:56 +0000 (13:20 +0200)]
kvm: Support MSR register for serial console

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Fix virtio block device support some more
Pekka Enberg [Sat, 8 Jan 2011 10:06:47 +0000 (12:06 +0200)]
kvm: Fix virtio block device support some more

This patch fixes the following issues in virtio block device support:

- Handle all requests in the virtqueue before signaling an interrupt.

- Initialize ->used vring elements properly.

- Handle non-read requests by injecting an I/O error to the guest.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Fix virtqueue ring index check
Pekka Enberg [Sat, 8 Jan 2011 10:18:44 +0000 (12:18 +0200)]
kvm: Fix virtqueue ring index check

This patch fixes the virtqueu ring index check that was totally wrong. The
->last_avail_idx is the index we've last seen but it doesn't need to match with
avail->idx.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agovirtio: capacity should be in 512-byte sectors
Asias He [Sat, 8 Jan 2011 02:28:26 +0000 (10:28 +0800)]
virtio: capacity should be in 512-byte sectors

struct virtio_blk_config {
        /* The capacity (in 512-byte sectors). */
        uint64_t capacity;
...
}

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Fail if user specifies a QCOW disk image
Pekka Enberg [Fri, 7 Jan 2011 19:25:24 +0000 (21:25 +0200)]
kvm: Fail if user specifies a QCOW disk image

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Improve kvm__init() error message
Pekka Enberg [Fri, 7 Jan 2011 19:17:59 +0000 (21:17 +0200)]
kvm: Improve kvm__init() error message

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Enable virtio block device if disk image specified
Pekka Enberg [Fri, 7 Jan 2011 19:06:27 +0000 (21:06 +0200)]
kvm: Enable virtio block device if disk image specified

This patch removes the "--enable-virtion" command line option and enable virtio
block device when a disk image is specified.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agoMerge branch 'master' of git://github.com/cyrillos/vm
Pekka Enberg [Thu, 6 Jan 2011 09:58:36 +0000 (11:58 +0200)]
Merge branch 'master' of git://github.com/cyrillos/vm

13 years agovirtio-blk: Leave disk geometry to compute in kernel
Cyrill Gorcunov [Thu, 6 Jan 2011 09:55:32 +0000 (12:55 +0300)]
virtio-blk: Leave disk geometry to compute in kernel

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agokvm: Introduce a list of known BUGS
Pekka Enberg [Thu, 6 Jan 2011 09:48:45 +0000 (11:48 +0200)]
kvm: Introduce a list of known BUGS

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Cleanup disk geometry setup code
Pekka Enberg [Thu, 6 Jan 2011 08:22:09 +0000 (10:22 +0200)]
kvm: Cleanup disk geometry setup code

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Setup disk geometry if needed
Cyrill Gorcunov [Wed, 5 Jan 2011 22:37:29 +0000 (01:37 +0300)]
kvm: Setup disk geometry if needed

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
13 years agokvm: Use disk image API from virtio block device
Pekka Enberg [Wed, 5 Jan 2011 20:47:28 +0000 (22:47 +0200)]
kvm: Use disk image API from virtio block device

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Add support for disk images
Pekka Enberg [Wed, 5 Jan 2011 17:54:48 +0000 (19:54 +0200)]
kvm: Add support for disk images

This patch implements "--image" command line option that can be used to specify
a disk image. It supports raw images and it needs to be integrated to the
hypervisor block layer.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Kill stale interrupt configuration comment
Pekka Enberg [Wed, 5 Jan 2011 16:11:15 +0000 (18:11 +0200)]
kvm: Kill stale interrupt configuration comment

Yes, our interrupt configuration is OK. We can see the guest interrupt trapping
to our hypervisor.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Implement virtio blk device vring lookup
Pekka Enberg [Wed, 5 Jan 2011 16:00:52 +0000 (18:00 +0200)]
kvm: Implement virtio blk device vring lookup

This patch changes VIRTIO_PCI_QUEUE_NOTIFY handler to look up the actual I/O
request from the vring. We don't inject anything back to the guest yet.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agoLinux 2.6.37 v2.6.37
Linus Torvalds [Wed, 5 Jan 2011 00:50:19 +0000 (16:50 -0800)]
Linux 2.6.37

13 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Tue, 4 Jan 2011 21:55:49 +0000 (13:55 -0800)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  ipv4/route.c: respect prefsrc for local routes
  bridge: stp: ensure mac header is set
  bridge: fix br_multicast_ipv6_rcv for paged skbs
  atl1: fix oops when changing tx/rx ring params
  drivers/atm/atmtcp.c: add missing atm_dev_put
  starfire: Fix dma_addr_t size test for MIPS
  tg3: fix return value check in tg3_read_vpd()
  Broadcom CNIC core network driver: fix mem leak on allocation failures in cnic_alloc_uio_rings()
  ISDN, Gigaset: Fix memory leak in do_disconnect_req()
  CAN: Use inode instead of kernel address for /proc file
  skfp: testing the wrong variable in skfp_driver_init()
  ppp: allow disabling multilink protocol ID compression
  ehea: Avoid changing vlan flags
  ueagle-atm: fix PHY signal initialization race

13 years agokvm: Implement virtqueues for virtio block device
Pekka Enberg [Tue, 4 Jan 2011 19:07:30 +0000 (21:07 +0200)]
kvm: Implement virtqueues for virtio block device

This patch implements virtqueues for virtio block device. It doesn't handle the
I/O requests on the vring yet, though.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agoipv4/route.c: respect prefsrc for local routes
Joel Sing [Mon, 3 Jan 2011 20:24:20 +0000 (20:24 +0000)]
ipv4/route.c: respect prefsrc for local routes

The preferred source address is currently ignored for local routes,
which results in all local connections having a src address that is the
same as the local dst address. Fix this by respecting the preferred source
address when it is provided for local routes.

This bug can be demonstrated as follows:

 # ifconfig dummy0 192.168.0.1
 # ip route show table local | grep local.*dummy0
 local 192.168.0.1 dev dummy0  proto kernel  scope host  src 192.168.0.1
 # ip route change table local local 192.168.0.1 dev dummy0 \
     proto kernel scope host src 127.0.0.1
 # ip route show table local | grep local.*dummy0
 local 192.168.0.1 dev dummy0  proto kernel  scope host  src 127.0.0.1

We now establish a local connection and verify the source IP
address selection:

 # nc -l 192.168.0.1 3128 &
 # nc 192.168.0.1 3128 &
 # netstat -ant | grep 192.168.0.1:3128.*EST
 tcp        0      0 192.168.0.1:3128        192.168.0.1:33228 ESTABLISHED
 tcp        0      0 192.168.0.1:33228       192.168.0.1:3128  ESTABLISHED

Signed-off-by: Joel Sing <jsing@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoremove trim_fs method from Documentation/filesystems/Locking
Christoph Hellwig [Tue, 4 Jan 2011 06:14:24 +0000 (07:14 +0100)]
remove trim_fs method from Documentation/filesystems/Locking

The ->trim_fs has been removed meanwhile, so remove it from the documentation
as well.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reported-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agokvm: Add ->queue_selector and ->queue_pfn to struct device
Pekka Enberg [Tue, 4 Jan 2011 18:41:25 +0000 (20:41 +0200)]
kvm: Add ->queue_selector and ->queue_pfn to struct device

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Make virtio block device read-only
Pekka Enberg [Tue, 4 Jan 2011 17:30:06 +0000 (19:30 +0200)]
kvm: Make virtio block device read-only

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Implement virtio blk device config space
Pekka Enberg [Tue, 4 Jan 2011 16:21:21 +0000 (18:21 +0200)]
kvm: Implement virtio blk device config space

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agoRevert "kvm: Fix virtio block PCI device IRQ configuration"
Pekka Enberg [Tue, 4 Jan 2011 16:21:35 +0000 (18:21 +0200)]
Revert "kvm: Fix virtio block PCI device IRQ configuration"

This reverts commit 00b793d98754629f833d5a3003554f841e64ec45.

13 years agokvm: Remove bogus #include directive
Pekka Enberg [Tue, 4 Jan 2011 15:22:57 +0000 (17:22 +0200)]
kvm: Remove bogus #include directive

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Don't use VIRTIO_BLK_F_SEG_MAX in the hypervisor
Pekka Enberg [Tue, 4 Jan 2011 15:20:23 +0000 (17:20 +0200)]
kvm: Don't use VIRTIO_BLK_F_SEG_MAX in the hypervisor

We don't actually support VIRTIO_BLK_F_SEG_MAX so disable it from host
features. This fixes the following error during virtio block device probe in
the guest kernel which is caused by bogus "sg_elems" in virtblk_probe():

  ------------[ cut here ]------------
  WARNING: at mm/page_alloc.c:1968 __alloc_pages_nodemask+0x5b4/0x6c0()
  Modules linked in:
  Pid: 1, comm: swapper Not tainted 2.6.35-rc3 #48
  Call Trace:
   [<ffffffff81081e7f>] warn_slowpath_common+0x7f/0xc0
   [<ffffffff81081eda>] warn_slowpath_null+0x1a/0x20
   [<ffffffff8110a6e4>] __alloc_pages_nodemask+0x5b4/0x6c0
   [<ffffffff8124f860>] ? idr_get_empty_slot+0x110/0x2c0
   [<ffffffff8124f860>] ? idr_get_empty_slot+0x110/0x2c0
   [<ffffffff81138795>] alloc_page_interleave+0x45/0xa0
   [<ffffffff811395d9>] alloc_pages_current+0xb9/0xe0
   [<ffffffff8110993e>] __get_free_pages+0xe/0x50
   [<ffffffff8114191e>] __kmalloc+0x14e/0x1c0
   [<ffffffff8137dbf7>] ? virtio_config_buf+0x57/0x80
   [<ffffffff81671e15>] virtblk_probe+0x78/0x498

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Cleanup virtio block device I/O functions
Pekka Enberg [Tue, 4 Jan 2011 15:14:56 +0000 (17:14 +0200)]
kvm: Cleanup virtio block device I/O functions

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agokvm: Implement "host features" for virtio blk device
Pekka Enberg [Tue, 4 Jan 2011 15:13:19 +0000 (17:13 +0200)]
kvm: Implement "host features" for virtio blk device

Signed-off-by: Pekka Enberg <penberg@kernel.org>
13 years agoMerge master.kernel.org:/home/rmk/linux-2.6-arm
Linus Torvalds [Tue, 4 Jan 2011 00:37:01 +0000 (16:37 -0800)]
Merge master.kernel.org:/home/rmk/linux-2.6-arm

* master.kernel.org:/home/rmk/linux-2.6-arm:
  ARM: pxa: fix page table corruption on resume
  ARM: it8152: add IT8152_LAST_IRQ definition to fix build error
  ARM: pxa: PXA_ESERIES depends on FB_W100.
  ARM: 6605/1: Add missing include "asm/memory.h"
  ARM: 6540/1: Stop irqsoff trace on return to user
  ARM: 6537/1: update Nomadik, U300 and Ux500 maintainers
  ARM: 6536/1: Add missing SZ_{32,64,128}
  ARM: fix cache-feroceon-l2 after stack based kmap_atomic()
  ARM: fix cache-xsc3l2 after stack based kmap_atomic()
  ARM: get rid of kmap_high_l1_vipt()
  ARM: smp: avoid incrementing mm_users on CPU startup
  ARM: pxa: PXA_ESERIES depends on FB_W100.

13 years agoarch/mn10300/kernel/irq.c: fix build
Andrew Morton [Mon, 3 Jan 2011 22:59:11 +0000 (14:59 -0800)]
arch/mn10300/kernel/irq.c: fix build

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=25702

Reported-by: Martin Ettl <ettl.martin@gmx.de>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoima: fix add LSM rule bug
Mimi Zohar [Mon, 3 Jan 2011 22:59:10 +0000 (14:59 -0800)]
ima: fix add LSM rule bug

If security_filter_rule_init() doesn't return a rule, then not everything
is as fine as the return code implies.

This bug only occurs when the LSM (eg. SELinux) is disabled at runtime.

Adding an empty LSM rule causes ima_match_rules() to always succeed,
ignoring any remaining rules.

 default IMA TCB policy:
  # PROC_SUPER_MAGIC
  dont_measure fsmagic=0x9fa0
  # SYSFS_MAGIC
  dont_measure fsmagic=0x62656572
  # DEBUGFS_MAGIC
  dont_measure fsmagic=0x64626720
  # TMPFS_MAGIC
  dont_measure fsmagic=0x01021994
  # SECURITYFS_MAGIC
  dont_measure fsmagic=0x73636673

  < LSM specific rule >
  dont_measure obj_type=var_log_t

  measure func=BPRM_CHECK
  measure func=FILE_MMAP mask=MAY_EXEC
  measure func=FILE_CHECK mask=MAY_READ uid=0

Thus without the patch, with the boot parameters 'tcb selinux=0', adding
the above 'dont_measure obj_type=var_log_t' rule to the default IMA TCB
measurement policy, would result in nothing being measured.  The patch
prevents the default TCB policy from being replaced.

Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
Cc: James Morris <jmorris@namei.org>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Cc: David Safford <safford@watson.ibm.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoMerge branch 'fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6
Russell King [Mon, 3 Jan 2011 22:55:21 +0000 (22:55 +0000)]
Merge branch 'fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6

13 years agobridge: stp: ensure mac header is set
Florian Westphal [Mon, 3 Jan 2011 04:16:28 +0000 (04:16 +0000)]
bridge: stp: ensure mac header is set

commit bf9ae5386bca8836c16e69ab8fdbe46767d7452a
(llc: use dev_hard_header) removed the
skb_reset_mac_header call from llc_mac_hdr_init.

This seems fine itself, but br_send_bpdu() invokes ebtables LOCAL_OUT.

We oops in ebt_basic_match() because it assumes eth_hdr(skb) returns
a meaningful result.

Cc: acme@ghostprotocols.net
References: https://bugzilla.kernel.org/show_bug.cgi?id=24532
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 3 Jan 2011 19:51:22 +0000 (11:51 -0800)]
Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  perf: Fix callchain hit bad cast on ascii display
  arch/x86/oprofile/op_model_amd.c: Perform initialisation on a single CPU
  watchdog: Improve initialisation error message and documentation

13 years agoMerge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
Linus Torvalds [Mon, 3 Jan 2011 19:50:26 +0000 (11:50 -0800)]
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6

* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6:
  [media] em28xx: radio_fops should also use unlocked_ioctl
  [media] wm8775: Revert changeset fcb9757333 to avoid a regression
  [media] cx25840: Prevent device probe failure due to volume control ERANGE error

13 years agoMerge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx
Linus Torvalds [Mon, 3 Jan 2011 19:48:54 +0000 (11:48 -0800)]
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx:
  dmaengine: provide dummy functions for DMA_ENGINE=n
  mv_xor: fix race in tasklet function