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,
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>
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>
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").
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>
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>
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>
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.
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.
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.
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.
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>
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.
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.
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.
* 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
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:
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():
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>
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>
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
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
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