Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3147225ybt; Mon, 29 Jun 2020 16:53:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymfxjsYecXjQfyhwGfMfCW3dqvp7zaNj5XQOLoGfQUbylhQPTLnb3z+3uuXeed+Cl/uUej X-Received: by 2002:aa7:d4c1:: with SMTP id t1mr12381787edr.253.1593474807357; Mon, 29 Jun 2020 16:53:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593474807; cv=none; d=google.com; s=arc-20160816; b=Ef3JEuBKwY7ERPJi2qxhGirzrCTaWypSm/TTz5bY9Zss49x9gzxXoJnKtnJ5nI9nmx MC2iThVR9RGldun7MLIPLQCQ/VAFs7qa1tXIScpuJkaSVJIlBadLwz9NdNoqWJWz+0Ib vUoDihmUuGsNOoDhpjgqQ/hI8gehhcLdg7HgxBU1QmtaUlE2+aRitR0spoJ1uBZ5Feqb GmOyvjhXDPyGVUpL9AFzphUMXlLSlE72fnw1PAEnJ8Hx+zX54QMkDz5R2zOlRDPIHnUy AORElgfqOav84HbtmxcrZfD+TtnbQ7PeqzD7MbXOh92At6fWQW/gJ0aWnoL6lMP7nH6W moOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=2QZ/5ifbtly3giqijWzsSjUnL9Enw+HJzDh31JM/IOs=; b=OUPzMbIYomXkexiNNquQe83KL7ztFR4nP3ELfr30x+gEbmZRQsyD8OokVVEq6SUdtK QDoODkOeP61SvbcNpPTGaTXvQezgQ7hEwEDsEgFo+BydONxDlyp3SPVQMzYss/aOi15t f4zVU/DICmdVzrsng+wyYqmFiul1bc2h0mvs1Utd+4aiUgOc9lrB6QlRCTAM4Mtx9elH Fxp/mOK8Mb5n2YnMlG8P1wVrtzRs4CMjFF0EJgSJMRWkqepE3n5p5yanipmpFAC8ocV+ Hhl9MjEq1z9tcwC2Sac0FK4jlYSqs4fgQHzE611pMmdsJ7KdGZCHc0nD7OcLgWXzj2gL YDHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oupK0XZK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cz22si569870edb.148.2020.06.29.16.53.04; Mon, 29 Jun 2020 16:53:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oupK0XZK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728410AbgF2XtJ (ORCPT + 99 others); Mon, 29 Jun 2020 19:49:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:50466 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728226AbgF2XtI (ORCPT ); Mon, 29 Jun 2020 19:49:08 -0400 Received: from localhost (c-67-164-102-47.hsd1.ca.comcast.net [67.164.102.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7889C20780; Mon, 29 Jun 2020 23:49:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593474548; bh=YbTxDsPQ5DXse6zCMw0MuvKG3mwFGMtOfnE1ikxlpqo=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=oupK0XZKr1tf9ZlB/vvhwl1g6l2FOT5EFgGIhASbYWQH4kL3mAqIIY0pFydyMp7AX ofoJ8l5Iy8Aj26eVYnf5X4wsVYL6+cyWfbFqp0keEtaF2uTu23UBwDyP6etUS+vytZ X2bXG5S9JLED91Z9FLDjXkzy6mkStrMTTdctv8GQ= Date: Mon, 29 Jun 2020 16:49:07 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-T480s To: Peng Fan cc: "Michael S. Tsirkin" , Stefano Stabellini , "boris.ostrovsky@oracle.com" , "jgross@suse.com" , "konrad.wilk@oracle.com" , "jasowang@redhat.com" , "x86@kernel.org" , "xen-devel@lists.xenproject.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "virtualization@lists.linux-foundation.org" , dl-linux-imx Subject: RE: [PATCH] xen: introduce xen_vring_use_dma In-Reply-To: Message-ID: References: <20200624091732.23944-1-peng.fan@nxp.com> <20200624050355-mutt-send-email-mst@kernel.org> <20200624163940-mutt-send-email-mst@kernel.org> <20200624181026-mutt-send-email-mst@kernel.org> <20200626110629-mutt-send-email-mst@kernel.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 29 Jun 2020, Peng Fan wrote: > > > If that is the case, how is it possible that virtio breaks on ARM > > > using the default dma_ops? The breakage is not Xen related (except > > > that Xen turns dma_ops on). The original message from Peng was: > > > > > > vring_map_one_sg -> vring_use_dma_api > > > -> dma_map_page > > > -> __swiotlb_map_page > > > ->swiotlb_map_page > > > ->__dma_map_area(phys_to_virt(dma_to_phys(dev, > > dev_addr)), size, dir); > > > However we are using per device dma area for rpmsg, phys_to_virt > > > could not return a correct virtual address for virtual address in > > > vmalloc area. Then kernel panic. > > > > > > I must be missing something. Maybe it is because it has to do with RPMesg? > > > > I think it's an RPMesg bug, yes > > rpmsg bug is another issue, it should not use dma_alloc_coherent for reserved area, > and use vmalloc_to_page. > > Anyway here using dma api will also trigger issue. Is the stack trace above for the RPMesg issue or for the Trusty issue? If it is the stack trace for RPMesg, can you also post the Trusty stack trace? Or are they indentical?