From 29d03b3fd11b5e131169e8a8e5c5eaaca45a6ff9 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Tue, 4 Jan 2011 17:20:23 +0200 Subject: [PATCH] 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: [] warn_slowpath_common+0x7f/0xc0 [] warn_slowpath_null+0x1a/0x20 [] __alloc_pages_nodemask+0x5b4/0x6c0 [] ? idr_get_empty_slot+0x110/0x2c0 [] ? idr_get_empty_slot+0x110/0x2c0 [] alloc_page_interleave+0x45/0xa0 [] alloc_pages_current+0xb9/0xe0 [] __get_free_pages+0xe/0x50 [] __kmalloc+0x14e/0x1c0 [] ? virtio_config_buf+0x57/0x80 [] virtblk_probe+0x78/0x498 Signed-off-by: Pekka Enberg --- tools/kvm/blk-virtio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/kvm/blk-virtio.c b/tools/kvm/blk-virtio.c index c1274e951e78..34c00d469cf6 100644 --- a/tools/kvm/blk-virtio.c +++ b/tools/kvm/blk-virtio.c @@ -15,8 +15,7 @@ struct device { }; static struct device device = { - .host_features = (1UL << VIRTIO_BLK_F_SEG_MAX) - | (1UL << VIRTIO_BLK_F_GEOMETRY) + .host_features = (1UL << VIRTIO_BLK_F_GEOMETRY) | (1UL << VIRTIO_BLK_F_TOPOLOGY) | (1UL << VIRTIO_BLK_F_BLK_SIZE), }; -- 2.39.5