From: Alex Bligh Subject: Re: Fatal crash on xen4.2 HVM + qemu-xen dm + NFS Date: Mon, 21 Jan 2013 15:35:03 +0000 Message-ID: References: <5B4525F296F6ABEB38B0E614@nimrod.local> <50CEFDA602000078000B0B11@nat28.tlf.novell.com> <3B1D0701EAEA6532CEA91EA0@Ximines.local> <77822E2DDAEA8F94631B6A52@Ximines.local> <1358781790.3279.224.camel@zakaz.uk.xensource.com> Reply-To: Alex Bligh Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1358781790.3279.224.camel@zakaz.uk.xensource.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Wilk , Xen Devel , Alex Bligh , Jan Beulich , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Ian, --On 21 January 2013 15:23:10 +0000 Ian Campbell wrote: > On Mon, 2013-01-21 at 15:15 +0000, Alex Bligh wrote: >> Surely before Xen removes the grant on the page, unmapping it from dom0's >> memory, it should check to see if there are any existing references >> to the page and if there are, given the kernel its own COW copy, rather >> than unmap it totally which is going to lead to problems. > > Unfortunately each page only has one reference count, so you cannot > distinguish between references from this particular NFS write from other > references (other writes, the ref held by the process itself, etc). > > My old series added a reference count to the SKB itself exactly so that > it would be possible to know when the network stack was truly finished > with the page in the context of a specific operation. > > Unfortunately due to lack of time I've not been able to finish those > off. Does that apply even when O_DIRECT is not being used (which I don't think it is by default for upstream qemu & xen, as it's cache=writeback, and cache=none produces a different failure)? If so, I think it's the case that *ALL* NFS dom0 access by Xen domU VMs is unsafe in the event of tcp retransmit (both in the sense that the grant can be freed up causing a crash, or the domU's data can be rewritten post write causing corruption). I think that would also apply to iSCSI over tcp, which would presumably suffer similarly. Is that analysis correct? -- Alex Bligh