Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp574268ybr; Fri, 22 May 2020 13:38:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxosT3M9a+FcG17QD1KSxj+KcZz3BcyxXdIF43iSRqbp9WaHfK0GTwd+vbzmeGGl34CKsWx X-Received: by 2002:a17:906:2c03:: with SMTP id e3mr9610507ejh.206.1590179892788; Fri, 22 May 2020 13:38:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590179892; cv=none; d=google.com; s=arc-20160816; b=TrDMpWufGuuLVwXAtNSoD1bVRhc9P0ML8RaIjIJpzejHg6UcCAf1i5Vkpn1JXkJC6Q CgiHA9fAwfEpobRU/45KfBwHTF1rammp2Mhs4iekHXxTzX6J0fT7UAKPxckow6bc78JF K1TtrY2pjQTjDgsBP1IUxpErBS0yn6DLjxBHx3hEifbmNF1uH1NB4xRhNJjw7W17IoJs 9VXK2GOjAJJD67gtlr9IdO5HIaUeFQH7ko6b6YW/GaJFkr4w3//QuxiuSyMmGIvtIWlZ YfBI1e8vL0g2ykU9+LNQoBR4D1Ziv2/OTGzxZgofdz7L4R8TqM6JraZhtP3OMMo8V1Gc B2Uw== 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=ITyMmn7cC10zrCK6WnVBIQ9wCgr7sh3QahAvea9PhVk=; b=AnbNE5xjnnvYuohpKkRwlKSJnBVSlMZhLLKZbYtdeqgUToddbdhH60m67Elkb+Rtsg ivVKTS//o4MRAwKSuq00OvJjfth1z64dSmelOhrtSxUITxKfy/GwPl5Gac6wec6wTrwX 63boeMM0ACjN5nBpEhz2Fbr0b/90tPO24oI3woEe9VF7kRgK9y0EFd+0SNyul5EMs9R3 ozpBBUJzZITjQVmgxYkBTQ2xRr8iXyxZoT6nbObmGHTEGZ0imvmj2s56xWGRYtJPHyTW 4Sg1slc8PKsmtGAQxsoJ9i1D/ALCHbDg7rfCdjE0pb4xQhQbMjcJ65m4RJOlWiyTlUkm WYKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RmpDsrr5; 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 qk12si5779876ejb.351.2020.05.22.13.37.48; Fri, 22 May 2020 13:38:12 -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=RmpDsrr5; 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 S1731016AbgEVUgW (ORCPT + 99 others); Fri, 22 May 2020 16:36:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:52052 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730976AbgEVUgV (ORCPT ); Fri, 22 May 2020 16:36:21 -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 DAB8C20723; Fri, 22 May 2020 20:36:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590179781; bh=IK1thAcWlCaqCoeU+81mOVb4TLhtZ5VdD8ydtfEDSgs=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=RmpDsrr5nt9VA49OfsdkCWmcG0mYVN1lGMYIb4+IQoZLGBtI/9xzwXOBng+nnnv/q s+CeSUi8X84jzr1XX2my8nGSl5T199PQ2Se5rhGEzgd8/K3xyp86L02PEim92xLt+R WdnSgson2U54CaVck5NBfmV5zlQWQ3kK7kcOlk7U= Date: Fri, 22 May 2020 13:36:20 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-T480s To: Julien Grall cc: Stefano Stabellini , jgross@suse.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, Stefano Stabellini Subject: Re: [PATCH 01/10] swiotlb-xen: use vmalloc_to_page on vmalloc virt addresses In-Reply-To: Message-ID: References: <20200520234520.22563-1-sstabellini@kernel.org> <23e5b6d8-c5d9-b43f-41cd-9d02d8ec0a7f@xen.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 Fri, 22 May 2020, Julien Grall wrote: > Hi Stefano, > > On 22/05/2020 04:54, Stefano Stabellini wrote: > > On Thu, 21 May 2020, Julien Grall wrote: > > > Hi, > > > > > > On 21/05/2020 00:45, Stefano Stabellini wrote: > > > > From: Boris Ostrovsky > > > > > > > > Don't just assume that virt_to_page works on all virtual addresses. > > > > Instead add a is_vmalloc_addr check and use vmalloc_to_page on vmalloc > > > > virt addresses. > > > > > > Can you provide an example where swiotlb is used with vmalloc()? > > > > The issue was reported here happening on the Rasperry Pi 4: > > https://marc.info/?l=xen-devel&m=158862573216800 > > Thanks, it would be good if the commit message contains a bit more details. > > > > > If you are asking where in the Linux codebase the vmalloc is happening > > specifically, I don't know for sure, my information is limited to the > > stack trace that you see in the link (I don't have a Rasperry Pi 4 yet > > but I shall have one soon.) > > Looking at the code there is a comment in xen_swiotlb_alloc_coherent() > suggesting that xen_alloc_coherent_pages() may return an ioremap'ped region on > Arm. So it feels to me that commit b877ac9815a8fe7e5f6d7fdde3dc34652408840a > "xen/swiotlb: remember having called xen_create_contiguous_region()" has > always been broken on Arm. Yes, I think you are right > As an aside, your commit message also suggests this is an issue for every > virtual address used in swiotlb. But only the virt_to_page() call in > xen_swiotlb_free_coherent() is modified. Is it intended? If yes, I think you > want to update your commit message. I see, yes I can explain better