From nobody Sat Nov 30 00:44:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1620850727; cv=none; d=zohomail.com; s=zohoarc; b=MDGH3/7ljr7J9QxRi58+H6npTEW4SJ2X22f8exIyVdFlQCTvaNJX+SoFfrNCBsfbEFrQeJf4+mYa0YaaqL9fCD+ZV6+b7G+Fu6+u1Ou/K0JMZ4f+R9OX0liaidETR0Y555G68r+UeOo9JPNLWfXN7v4O6nhDbT8UKGK9Q2lDMLY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620850727; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=GS4VpO1/fkjmGpSI9nTGZE/tAhz4lG4ulA39ei9EZhQ=; b=mW9JOrytt0lJmWojwaqdNkn/b61Jct2zfOr9a97E5I6bSZOcbnRKLiAXWUCmVtysowg999mOQZkpmU2TYDGW0bAAd8H3ImByzPlzqe8IIUvppXHbdAyBzloaHFIPXI+o7a4vuCkktLq1Zf8hU+Jp/EFwSnbHieqgCcyRjyVcUKM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1620850727874207.91435561979995; Wed, 12 May 2021 13:18:47 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.126373.237919 (Exim 4.92) (envelope-from ) id 1lgvJQ-0005La-4n; Wed, 12 May 2021 20:18:32 +0000 Received: by outflank-mailman (output) from mailman id 126373.237919; Wed, 12 May 2021 20:18:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lgvJQ-0005LR-1a; Wed, 12 May 2021 20:18:32 +0000 Received: by outflank-mailman (input) for mailman id 126373; Wed, 12 May 2021 20:18:30 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lgvJN-00053u-UJ for xen-devel@lists.xenproject.org; Wed, 12 May 2021 20:18:29 +0000 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 9ec0c904-6615-4f9e-9af4-e77e4ba4086b; Wed, 12 May 2021 20:18:29 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id E6BFC61421; Wed, 12 May 2021 20:18:27 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 9ec0c904-6615-4f9e-9af4-e77e4ba4086b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620850708; bh=ikG741femM1u5L3PYlYRG1oNEZycqnQin0LDEK63UdI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RShGZVhkT1+Cv9URRAR9hvRdm2lnVpZ/vDKhwwndQErexmq58V6abEelgnec4DX+x Iq/powaDhH+V5WHSLB3ryZogB1b2sgnkPU7EiP0/MRRG/nwzIzV/Q5Srxs0gqbB+cH 14MZp+GtgTMFCs0Ih8T5Uvn9iByb8FozTPHOAcZHiN5n9RknvNAxd+0RQUcHqLXTeM jofPjb49sy0g5sdVuYrjnmuG6NNqjf0n9H6kCmi+4WL9vnyH3UOIud8DubTi7dXVH/ FrXkN9yBf13D6H+TzEtt8Qy8V5lcj65NtVqeobNFzPY2KnlgJ0bWtvyv2fiu58p57T I20jFea37G0/w== From: Stefano Stabellini To: xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, boris.ostrovsky@oracle.com, jgross@suse.com, hch@lst.de, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, Stefano Stabellini Subject: [PATCH v2 2/3] arm64: do not set SWIOTLB_NO_FORCE when swiotlb is required Date: Wed, 12 May 2021 13:18:22 -0700 Message-Id: <20210512201823.1963-2-sstabellini@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-ZohoMail-DKIM: pass (identity @kernel.org) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Christoph Hellwig Although SWIOTLB_NO_FORCE is meant to allow later calls to swiotlb_init, today dma_direct_map_page returns error if SWIOTLB_NO_FORCE. For now, without a larger overhaul of SWIOTLB_NO_FORCE, the best we can do is to avoid setting SWIOTLB_NO_FORCE in mem_init when we know that it is going to be required later (e.g. Xen requires it). CC: boris.ostrovsky@oracle.com CC: jgross@suse.com CC: catalin.marinas@arm.com CC: will@kernel.org CC: linux-arm-kernel@lists.infradead.org Fixes: 2726bf3ff252 ("swiotlb: Make SWIOTLB_NO_FORCE perform no allocation") Signed-off-by: Christoph Hellwig Signed-off-by: Stefano Stabellini Acked-by: Catalin Marinas Reviewed-by: Juergen Gross --- Changes in v2: - patch split --- arch/arm64/mm/init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 16a2b2b1c54d..e55409caaee3 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -43,6 +43,7 @@ #include #include #include +#include =20 /* * We need to be able to catch inadvertent references to memstart_addr @@ -482,7 +483,7 @@ void __init mem_init(void) if (swiotlb_force =3D=3D SWIOTLB_FORCE || max_pfn > PFN_DOWN(arm64_dma_phys_limit)) swiotlb_init(1); - else + else if (!xen_swiotlb_detect()) swiotlb_force =3D SWIOTLB_NO_FORCE; =20 set_max_mapnr(max_pfn - PHYS_PFN_OFFSET); --=20 2.17.1