Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932110AbaAaBC1 (ORCPT ); Thu, 30 Jan 2014 20:02:27 -0500 Received: from smtp.gentoo.org ([140.211.166.183]:39145 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752803AbaAaBCZ convert rfc822-to-8bit (ORCPT ); Thu, 30 Jan 2014 20:02:25 -0500 References: <1391104968-10258-1-git-send-email-ryao@gentoo.org> <1391104968-10258-2-git-send-email-ryao@gentoo.org> <20140130.162926.561686911250624301.davem@davemloft.net> <20140130.164451.873520736572570393.davem@davemloft.net> Mime-Version: 1.0 (1.0) In-Reply-To: <20140130.164451.873520736572570393.davem@davemloft.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8BIT Message-Id: <1EB31694-2C49-415B-8394-A91724665D71@gentoo.org> Cc: "ericvh@gmail.com" , "rminnich@sandia.gov" , "lucho@ionkov.net" , "v9fs-developer@lists.sourceforge.net" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kernel@gentoo.org" , "aneesh.kumar@linux.vnet.ibm.com" , "will.deacon@arm.com" , "cov@codeaurora.org" , "behlendorf1@llnl.gov" , "mthode@mthode.org" X-Mailer: iPad Mail (10B146) From: Richard Yao Subject: Re: [PATCH] 9p/trans_virtio.c: Fix broken zero-copy on vmalloc() buffers Date: Thu, 30 Jan 2014 20:02:23 -0500 To: David Miller Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Jan 30, 2014, at 7:44 PM, David Miller wrote: > From: David Miller > Date: Thu, 30 Jan 2014 16:29:26 -0800 (PST) > >> From: Richard Yao >> Date: Thu, 30 Jan 2014 13:02:48 -0500 >> >>> The 9p-virtio transport does zero copy on things larger than 1024 bytes >>> in size. It accomplishes this by returning the physical addresses of >>> pages to the virtio-pci device. At present, the translation is usually a >>> bit shift. >>> >>> However, that approach produces an invalid page address when we >>> read/write to vmalloc buffers, such as those used for Linux kernle >>> modules. This causes QEMU to die printing: >>> >>> qemu-system-x86_64: virtio: trying to map MMIO memory >>> >>> This patch enables 9p-virtio to correctly handle this case. This not >>> only enables us to load Linux kernel modules off virtfs, but also >>> enables ZFS file-based vdevs on virtfs to be used without killing QEMU. >>> >>> Also, special thanks to both Avi Kivity and Alexander Graf for their >>> interpretation of QEMU backtraces. Without their guidence, tracking down >>> this bug would have taken much longer. >>> >>> Signed-off-by: Richard Yao >>> Acked-by: Alexander Graf >>> Reviewed-by: Will Deacon >> >> Applied, thanks. > > Actually I had to revert, is_vmalloc_or_malloc_addr() is not exported to > modules, so this change breaks the build. Thanks for catching that. I had originally used is_vmalloc_addr() instead of is_vmalloc_or_malloc_addr(), but changed it after realizing this did not correct the problem on all architectures. The is_vmalloc_addr() lives in headers. I will send out a patch to get that symbol exported and resubmit this after it is merged.-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/