From: Keir Fraser Subject: Re: Question regarding SLAB corruption Date: Mon, 09 Jul 2007 19:46:37 +0100 Message-ID: References: <20070709183745.GR3885@ics.muni.cz> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="B_3266855198_9566316" Return-path: In-Reply-To: <20070709183745.GR3885@ics.muni.cz> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Lukas Hejtmanek Cc: Roland Dreier , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3266855198_9566316 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit On 9/7/07 19:37, "Lukas Hejtmanek" wrote: > On Mon, Jul 09, 2007 at 07:29:59PM +0100, Keir Fraser wrote: >> Oh! I take it then that the infiniband driver will call sync_single() on >> subsections of a mapped region? I haven't seen that behaviour before and it >> will kill lib/swiotlb.c (the generic Linux swiotlb implementation) just as >> surely as it does the Xen-specific swiotlb! >> >> We could make the swiotlb robust to this treatment, I guess. It will involve >> initialising all covered io_tlb_orig_addr[] slots rather than just the >> first. You could even have a go at this yourself if you like: rather than >> initialising a single slot at the end of map_single(), you'd have a for-loop >> to iterate over each allocated swiotlb slab. > > Is there a reason why this is not an issue in Dom0? It should be an issue in dom0 just the same as in domU. You may get lucky in dom0 and not use the swiotlb as much, as your dom0 is more likely to have a physically contiguous memory map to start with. Anyway, attahced is a patch I just applied to our unstable Linux tree. It should fix this issue. -- Keir --B_3266855198_9566316 Content-type: application/octet-stream; name="swiotlb.patch" Content-disposition: attachment; filename="swiotlb.patch" Content-transfer-encoding: base64 IyBIRyBjaGFuZ2VzZXQgcGF0Y2gKIyBVc2VyIGtmcmFzZXJAbG9jYWxob3N0LmxvY2FsZG9t YWluCiMgRGF0ZSAxMTg0MDA2NDY0IC0zNjAwCiMgTm9kZSBJRCBmMTU2NDNkYWIxY2E0MGZm M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9IGJ1ZmZlcjsKKwlmb3IgKGkgPSAwOyBpIDwgbnNsb3Rz OyBpKyspIHsKKwkJaW9fdGxiX29yaWdfYWRkcltpbmRleCtpXSA9IHNsb3RfYnVmOworCQlz bG90X2J1Zi5vZmZzZXQgKz0gMSA8PCBJT19UTEJfU0hJRlQ7CisJCWlmIChzbG90X2J1Zi5v ZmZzZXQgPiBQQUdFX1NJWkUpIHsKKwkJCXNsb3RfYnVmLnBhZ2UrKzsKKwkJCXNsb3RfYnVm Lm9mZnNldCAtPSBQQUdFX1NJWkU7CisJCX0KKwl9CiAJaWYgKChkaXIgPT0gRE1BX1RPX0RF VklDRSkgfHwgKGRpciA9PSBETUFfQklESVJFQ1RJT05BTCkpCiAJCV9fc3luY19zaW5nbGUo YnVmZmVyLCBkbWFfYWRkciwgc2l6ZSwgRE1BX1RPX0RFVklDRSk7CiAK --B_3266855198_9566316 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --B_3266855198_9566316--