From owner-svn-src-all@freebsd.org Mon Oct 26 12:24:45 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 391AEA1AF66; Mon, 26 Oct 2015 12:24:45 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22f.google.com (mail-ig0-x22f.google.com [IPv6:2607:f8b0:4001:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 04C9511D4; Mon, 26 Oct 2015 12:24:45 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igdg1 with SMTP id g1so57091770igd.1; Mon, 26 Oct 2015 05:24:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=7ogB/iGtwWjR7JhNXmLfH3JnNtb3m8MF8RSV/lGhaSk=; b=cBsb3OOJqQc37QHca9i22G1x3ZIU11zOTyxd5Wg75Ot2x3X1JcMeMMCYs0D2BHs7/9 UVZP2geZe0A/myhmrK4/Fzyi9uVBTr7XeGwpmLlWSgOO8lSh0axigqdbDt58O7i30xnH N7yORnNa5e0M7nGMoa3+NVsBUZuCGA54Q7tpdMVfqpnickczr477fS67M305O5H0g9gZ W+/l1KN4i8cm1AbP9p1dzuEQWAofWh+jOiw7VpnsVmwFUjl6mLO0VfM+4heKA9uMipC4 ut11pkkPGG4HEzKNlZgWcMS6IQGPKHP2960y6Iwr46Fd51LIgERybYpBjKj+/PaBgjDm Pf6w== MIME-Version: 1.0 X-Received: by 10.50.164.196 with SMTP id ys4mr535950igb.37.1445862284349; Mon, 26 Oct 2015 05:24:44 -0700 (PDT) Received: by 10.36.46.66 with HTTP; Mon, 26 Oct 2015 05:24:44 -0700 (PDT) In-Reply-To: <562A564D.9080703@citrix.com> References: <201510231539.t9NFdxPe018130@repo.freebsd.org> <562A564D.9080703@citrix.com> Date: Mon, 26 Oct 2015 05:24:44 -0700 Message-ID: Subject: Re: svn commit: r289834 - head/sys/x86/x86 From: Adrian Chadd To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2015 12:24:45 -0000 Hi, I've started seeing panics on -head with ATA code doing a dmamap load -> panic. I'll test by reverting this patch and see what happens, but when it /does/ happen I can't get a crashdump, so debugging will be less easy. Has anyone else seen this? -a On 23 October 2015 at 08:46, Roger Pau Monn=C3=A9 wr= ote: > El 23/10/15 a les 17.39, Roger Pau Monn=C3=A9 ha escrit: >> Author: royger >> Date: Fri Oct 23 15:39:59 2015 >> New Revision: 289834 >> URL: https://svnweb.freebsd.org/changeset/base/289834 >> >> Log: >> x86/dma_bounce: rework _bus_dmamap_load_ma implementation >> >> The implementation of bus_dmamap_load_ma_triv currently calls >> _bus_dmamap_load_phys on each page that is part of the passed in buffe= r. >> Since each page is treated as an individual buffer, the resulting beha= viour >> is different from the behaviour of _bus_dmamap_load_buffer. This break= s >> certain drivers, like Xen blkfront. >> >> If an unmapped buffer of size 4096 that starts at offset 13 into the f= irst >> page is passed to the current _bus_dmamap_load_ma implementation (so t= he ma >> array contains two pages), the result is that two segments are created= , one >> with a size of 4083 and the other with size 13 (because two independan= t >> calls to _bus_dmamap_load_phys are performed, one for each physical pa= ge). >> If the same is done with a mapped buffer and calling _bus_dmamap_load_= buffer >> the result is that only one segment is created, with a size of 4096. >> >> This patch relegates the usage of bus_dmamap_load_ma_triv in x86 bounc= e >> buffer code to drivers requesting BUS_DMA_KEEP_PG_OFFSET and implement= s >> _bus_dmamap_load_ma so that it's behaviour is the same as the mapped v= ersion >> (_bus_dmamap_load_buffer). This patch only modifies the x86 bounce buf= fer >> code, other arches are left untouched. >> >> Reviewed by: kib, jah >> Differential Revision: https://reviews.freebsd.org/D888 >> Sponsored by: Citrix Systems R&D > > Forgot to add: > > MFC after: 2 weeks > > Roger. >