From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35099C43217 for ; Wed, 9 Mar 2022 06:18:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229964AbiCIGTr (ORCPT ); Wed, 9 Mar 2022 01:19:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229935AbiCIGTo (ORCPT ); Wed, 9 Mar 2022 01:19:44 -0500 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50BB51EC7C; Tue, 8 Mar 2022 22:18:46 -0800 (PST) Received: by verein.lst.de (Postfix, from userid 2407) id A4A1568AFE; Wed, 9 Mar 2022 07:18:40 +0100 (CET) Date: Wed, 9 Mar 2022 07:18:40 +0100 From: Christoph Hellwig To: Boris Ostrovsky Cc: Christoph Hellwig , iommu@lists.linux-foundation.org, x86@kernel.org, Anshuman Khandual , Tom Lendacky , Konrad Rzeszutek Wilk , Stefano Stabellini , Juergen Gross , Joerg Roedel , David Woodhouse , Lu Baolu , Robin Murphy , linux-arm-kernel@lists.infradead.org, xen-devel@lists.xenproject.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-hyperv@vger.kernel.org, tboot-devel@lists.sourceforge.net, linux-pci@vger.kernel.org Subject: Re: [PATCH 11/12] swiotlb: merge swiotlb-xen initialization into swiotlb Message-ID: <20220309061840.GA31435@lst.de> References: <20220301105311.885699-1-hch@lst.de> <20220301105311.885699-12-hch@lst.de> <6a22ea1e-4823-5c3b-97ee-a29155404a0d@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6a22ea1e-4823-5c3b-97ee-a29155404a0d@oracle.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-s390@vger.kernel.org On Tue, Mar 08, 2022 at 04:38:21PM -0500, Boris Ostrovsky wrote: > > On 3/1/22 5:53 AM, Christoph Hellwig wrote: >> Allow to pass a remap argument to the swiotlb initialization functions >> to handle the Xen/x86 remap case. ARM/ARM64 never did any remapping >> from xen_swiotlb_fixup, so we don't even need that quirk. > > > Any chance this patch could be split? Lots of things are happening here and it's somewhat hard to review. (Patch 7 too BTW but I think I managed to get through it) What would be your preferred split? >> diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c >> index e0def4b1c3181..2f2c468acb955 100644 >> --- a/arch/x86/kernel/pci-dma.c >> +++ b/arch/x86/kernel/pci-dma.c >> @@ -71,15 +71,12 @@ static inline void __init pci_swiotlb_detect(void) >> #endif /* CONFIG_SWIOTLB */ >> #ifdef CONFIG_SWIOTLB_XEN >> -static bool xen_swiotlb; >> - >> static void __init pci_xen_swiotlb_init(void) >> { >> if (!xen_initial_domain() && !x86_swiotlb_enable) >> return; > > > Now that there is a single call site for this routine I think this check can be dropped. We are only called here for xen_initial_domain()==true. The callsite just checks xen_pv_domain() and itself is called unconditionally during initialization. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 19338C433F5 for ; Wed, 9 Mar 2022 06:19:20 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4KD28j2cCyz3bcY for ; Wed, 9 Mar 2022 17:19:17 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lst.de (client-ip=213.95.11.211; helo=verein.lst.de; envelope-from=hch@lst.de; receiver=) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4KD2880Tdqz3bV2 for ; Wed, 9 Mar 2022 17:18:47 +1100 (AEDT) Received: by verein.lst.de (Postfix, from userid 2407) id A4A1568AFE; Wed, 9 Mar 2022 07:18:40 +0100 (CET) Date: Wed, 9 Mar 2022 07:18:40 +0100 From: Christoph Hellwig To: Boris Ostrovsky Subject: Re: [PATCH 11/12] swiotlb: merge swiotlb-xen initialization into swiotlb Message-ID: <20220309061840.GA31435@lst.de> References: <20220301105311.885699-1-hch@lst.de> <20220301105311.885699-12-hch@lst.de> <6a22ea1e-4823-5c3b-97ee-a29155404a0d@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6a22ea1e-4823-5c3b-97ee-a29155404a0d@oracle.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-hyperv@vger.kernel.org, x86@kernel.org, linux-ia64@vger.kernel.org, linux-pci@vger.kernel.org, linux-riscv@lists.infradead.org, Christoph Hellwig , linux-s390@vger.kernel.org, Stefano Stabellini , Joerg Roedel , Konrad Rzeszutek Wilk , tboot-devel@lists.sourceforge.net, xen-devel@lists.xenproject.org, David Woodhouse , Tom Lendacky , Anshuman Khandual , linux-arm-kernel@lists.infradead.org, Juergen Gross , linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org, iommu@lists.linux-foundation.org, Robin Murphy , Lu Baolu Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Tue, Mar 08, 2022 at 04:38:21PM -0500, Boris Ostrovsky wrote: > > On 3/1/22 5:53 AM, Christoph Hellwig wrote: >> Allow to pass a remap argument to the swiotlb initialization functions >> to handle the Xen/x86 remap case. ARM/ARM64 never did any remapping >> from xen_swiotlb_fixup, so we don't even need that quirk. > > > Any chance this patch could be split? Lots of things are happening here and it's somewhat hard to review. (Patch 7 too BTW but I think I managed to get through it) What would be your preferred split? >> diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c >> index e0def4b1c3181..2f2c468acb955 100644 >> --- a/arch/x86/kernel/pci-dma.c >> +++ b/arch/x86/kernel/pci-dma.c >> @@ -71,15 +71,12 @@ static inline void __init pci_swiotlb_detect(void) >> #endif /* CONFIG_SWIOTLB */ >> #ifdef CONFIG_SWIOTLB_XEN >> -static bool xen_swiotlb; >> - >> static void __init pci_xen_swiotlb_init(void) >> { >> if (!xen_initial_domain() && !x86_swiotlb_enable) >> return; > > > Now that there is a single call site for this routine I think this check can be dropped. We are only called here for xen_initial_domain()==true. The callsite just checks xen_pv_domain() and itself is called unconditionally during initialization. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B7C91C433F5 for ; Wed, 9 Mar 2022 06:18:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 5473F607B0; Wed, 9 Mar 2022 06:18:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RFAsvwPQ_M7K; Wed, 9 Mar 2022 06:18:49 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id 16F7560797; Wed, 9 Mar 2022 06:18:49 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id E14CDC001D; Wed, 9 Mar 2022 06:18:48 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id D0B0CC000B for ; Wed, 9 Mar 2022 06:18:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id BADD7812DD for ; Wed, 9 Mar 2022 06:18:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F05K3qxyc9EO for ; Wed, 9 Mar 2022 06:18:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by smtp1.osuosl.org (Postfix) with ESMTPS id C1330812A1 for ; Wed, 9 Mar 2022 06:18:46 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id A4A1568AFE; Wed, 9 Mar 2022 07:18:40 +0100 (CET) Date: Wed, 9 Mar 2022 07:18:40 +0100 From: Christoph Hellwig To: Boris Ostrovsky Subject: Re: [PATCH 11/12] swiotlb: merge swiotlb-xen initialization into swiotlb Message-ID: <20220309061840.GA31435@lst.de> References: <20220301105311.885699-1-hch@lst.de> <20220301105311.885699-12-hch@lst.de> <6a22ea1e-4823-5c3b-97ee-a29155404a0d@oracle.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <6a22ea1e-4823-5c3b-97ee-a29155404a0d@oracle.com> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: linux-hyperv@vger.kernel.org, x86@kernel.org, linux-ia64@vger.kernel.org, linux-pci@vger.kernel.org, linux-riscv@lists.infradead.org, Christoph Hellwig , linux-s390@vger.kernel.org, Stefano Stabellini , Konrad Rzeszutek Wilk , tboot-devel@lists.sourceforge.net, xen-devel@lists.xenproject.org, David Woodhouse , Tom Lendacky , Anshuman Khandual , linux-arm-kernel@lists.infradead.org, Juergen Gross , linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org, iommu@lists.linux-foundation.org, Robin Murphy X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Tue, Mar 08, 2022 at 04:38:21PM -0500, Boris Ostrovsky wrote: > > On 3/1/22 5:53 AM, Christoph Hellwig wrote: >> Allow to pass a remap argument to the swiotlb initialization functions >> to handle the Xen/x86 remap case. ARM/ARM64 never did any remapping >> from xen_swiotlb_fixup, so we don't even need that quirk. > > > Any chance this patch could be split? Lots of things are happening here and it's somewhat hard to review. (Patch 7 too BTW but I think I managed to get through it) What would be your preferred split? >> diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c >> index e0def4b1c3181..2f2c468acb955 100644 >> --- a/arch/x86/kernel/pci-dma.c >> +++ b/arch/x86/kernel/pci-dma.c >> @@ -71,15 +71,12 @@ static inline void __init pci_swiotlb_detect(void) >> #endif /* CONFIG_SWIOTLB */ >> #ifdef CONFIG_SWIOTLB_XEN >> -static bool xen_swiotlb; >> - >> static void __init pci_xen_swiotlb_init(void) >> { >> if (!xen_initial_domain() && !x86_swiotlb_enable) >> return; > > > Now that there is a single call site for this routine I think this check can be dropped. We are only called here for xen_initial_domain()==true. The callsite just checks xen_pv_domain() and itself is called unconditionally during initialization. _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D00BCC433F5 for ; Wed, 9 Mar 2022 06:19:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XiQQ/k1e0OK8INDwy8eFgt0xRV47U1FfV5zu++hk+1Q=; b=cBEdSpWkygw9A0 YHpySC7++idcnFm/ZFLcyjaiGrPFxomu8KoT1WbREBoyJA/vnbHJTA+S3e73yYfu/KxMKAz/c1ysS 1aUC4n7KsGpzkqNuxPGeqW4rLzFMcoCiMGnzcEzWsdbZaWuEIKfdHBUrK2ZD2SYYwW/8T092RquY8 JZKWs59TEffBX4F/wO+Tc/kTtJpK9t6TbjyiBMPLOf2SDZUFr1Y/02qPBOlQWA91Y+wtaAxNbQ74W gkWxZmxaako1Fg6pFaI361w6wb2vkBAOGKX0Xx3ga+F0FZONRx3ocxorSpgHQDIBBv0NQHVxuC6jt fOM06iWwdW/YOSh1/uYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRpf3-007UmI-HX; Wed, 09 Mar 2022 06:19:01 +0000 Received: from verein.lst.de ([213.95.11.211]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRpen-007Uh9-20; Wed, 09 Mar 2022 06:18:46 +0000 Received: by verein.lst.de (Postfix, from userid 2407) id A4A1568AFE; Wed, 9 Mar 2022 07:18:40 +0100 (CET) Date: Wed, 9 Mar 2022 07:18:40 +0100 From: Christoph Hellwig To: Boris Ostrovsky Cc: Christoph Hellwig , iommu@lists.linux-foundation.org, x86@kernel.org, Anshuman Khandual , Tom Lendacky , Konrad Rzeszutek Wilk , Stefano Stabellini , Juergen Gross , Joerg Roedel , David Woodhouse , Lu Baolu , Robin Murphy , linux-arm-kernel@lists.infradead.org, xen-devel@lists.xenproject.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-hyperv@vger.kernel.org, tboot-devel@lists.sourceforge.net, linux-pci@vger.kernel.org Subject: Re: [PATCH 11/12] swiotlb: merge swiotlb-xen initialization into swiotlb Message-ID: <20220309061840.GA31435@lst.de> References: <20220301105311.885699-1-hch@lst.de> <20220301105311.885699-12-hch@lst.de> <6a22ea1e-4823-5c3b-97ee-a29155404a0d@oracle.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <6a22ea1e-4823-5c3b-97ee-a29155404a0d@oracle.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220308_221845_295022_E748C464 X-CRM114-Status: GOOD ( 17.15 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Tue, Mar 08, 2022 at 04:38:21PM -0500, Boris Ostrovsky wrote: > > On 3/1/22 5:53 AM, Christoph Hellwig wrote: >> Allow to pass a remap argument to the swiotlb initialization functions >> to handle the Xen/x86 remap case. ARM/ARM64 never did any remapping >> from xen_swiotlb_fixup, so we don't even need that quirk. > > > Any chance this patch could be split? Lots of things are happening here and it's somewhat hard to review. (Patch 7 too BTW but I think I managed to get through it) What would be your preferred split? >> diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c >> index e0def4b1c3181..2f2c468acb955 100644 >> --- a/arch/x86/kernel/pci-dma.c >> +++ b/arch/x86/kernel/pci-dma.c >> @@ -71,15 +71,12 @@ static inline void __init pci_swiotlb_detect(void) >> #endif /* CONFIG_SWIOTLB */ >> #ifdef CONFIG_SWIOTLB_XEN >> -static bool xen_swiotlb; >> - >> static void __init pci_xen_swiotlb_init(void) >> { >> if (!xen_initial_domain() && !x86_swiotlb_enable) >> return; > > > Now that there is a single call site for this routine I think this check can be dropped. We are only called here for xen_initial_domain()==true. The callsite just checks xen_pv_domain() and itself is called unconditionally during initialization. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2A44EC433F5 for ; Wed, 9 Mar 2022 06:20:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/niIF26Cns4sh1Uxd9lRNrHIYUBnnk8PnLnc/G87M3E=; b=apD9VrZrMa9BVs MOosOiBl4qK2n8YeWKHg0fSMo0/xmb/GEN7c6oMNHYsPXWCjFph/etWQhWkZN1GhlAKWOOypVqnwt fp50ZLplYPtaviKIIJZbyFMorqFPGM4kxCrKZoO22XOSfa2k9dbtrpm/guacQGZL5rsIifR4Z3Egh qoHkPovt/mESniaqtq/BuN1THWbyj2Ob/5lVZGU0K4VDOfMlM5sUyqeHcsjW3vurAeRlqiK07l1M7 ZQZg1ZlZOb5bPWp96811mGCBXFYJ1BbQbNErnoVBCUB6OQ1q03fmAhx5hHrbWKu/t3a7ByRxGpQ0N zGAWPGddsUtNbwqX45sg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRper-007Uj4-Av; Wed, 09 Mar 2022 06:18:49 +0000 Received: from verein.lst.de ([213.95.11.211]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRpen-007Uh9-20; Wed, 09 Mar 2022 06:18:46 +0000 Received: by verein.lst.de (Postfix, from userid 2407) id A4A1568AFE; Wed, 9 Mar 2022 07:18:40 +0100 (CET) Date: Wed, 9 Mar 2022 07:18:40 +0100 From: Christoph Hellwig To: Boris Ostrovsky Cc: Christoph Hellwig , iommu@lists.linux-foundation.org, x86@kernel.org, Anshuman Khandual , Tom Lendacky , Konrad Rzeszutek Wilk , Stefano Stabellini , Juergen Gross , Joerg Roedel , David Woodhouse , Lu Baolu , Robin Murphy , linux-arm-kernel@lists.infradead.org, xen-devel@lists.xenproject.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-hyperv@vger.kernel.org, tboot-devel@lists.sourceforge.net, linux-pci@vger.kernel.org Subject: Re: [PATCH 11/12] swiotlb: merge swiotlb-xen initialization into swiotlb Message-ID: <20220309061840.GA31435@lst.de> References: <20220301105311.885699-1-hch@lst.de> <20220301105311.885699-12-hch@lst.de> <6a22ea1e-4823-5c3b-97ee-a29155404a0d@oracle.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <6a22ea1e-4823-5c3b-97ee-a29155404a0d@oracle.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220308_221845_295022_E748C464 X-CRM114-Status: GOOD ( 17.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Mar 08, 2022 at 04:38:21PM -0500, Boris Ostrovsky wrote: > > On 3/1/22 5:53 AM, Christoph Hellwig wrote: >> Allow to pass a remap argument to the swiotlb initialization functions >> to handle the Xen/x86 remap case. ARM/ARM64 never did any remapping >> from xen_swiotlb_fixup, so we don't even need that quirk. > > > Any chance this patch could be split? Lots of things are happening here and it's somewhat hard to review. (Patch 7 too BTW but I think I managed to get through it) What would be your preferred split? >> diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c >> index e0def4b1c3181..2f2c468acb955 100644 >> --- a/arch/x86/kernel/pci-dma.c >> +++ b/arch/x86/kernel/pci-dma.c >> @@ -71,15 +71,12 @@ static inline void __init pci_swiotlb_detect(void) >> #endif /* CONFIG_SWIOTLB */ >> #ifdef CONFIG_SWIOTLB_XEN >> -static bool xen_swiotlb; >> - >> static void __init pci_xen_swiotlb_init(void) >> { >> if (!xen_initial_domain() && !x86_swiotlb_enable) >> return; > > > Now that there is a single call site for this routine I think this check can be dropped. We are only called here for xen_initial_domain()==true. The callsite just checks xen_pv_domain() and itself is called unconditionally during initialization. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Date: Wed, 09 Mar 2022 06:18:40 +0000 Subject: Re: [PATCH 11/12] swiotlb: merge swiotlb-xen initialization into swiotlb Message-Id: <20220309061840.GA31435@lst.de> List-Id: References: <20220301105311.885699-1-hch@lst.de> <20220301105311.885699-12-hch@lst.de> <6a22ea1e-4823-5c3b-97ee-a29155404a0d@oracle.com> In-Reply-To: <6a22ea1e-4823-5c3b-97ee-a29155404a0d@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Boris Ostrovsky Cc: Christoph Hellwig , iommu@lists.linux-foundation.org, x86@kernel.org, Anshuman Khandual , Tom Lendacky , Konrad Rzeszutek Wilk , Stefano Stabellini , Juergen Gross , Joerg Roedel , David Woodhouse , Lu Baolu , Robin Murphy , linux-arm-kernel@lists.infradead.org, xen-devel@lists.xenproject.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-hyperv@vger.kernel.org, tboot-devel@lists.sourceforge.net, linux-pci@vger.kernel.org On Tue, Mar 08, 2022 at 04:38:21PM -0500, Boris Ostrovsky wrote: > > On 3/1/22 5:53 AM, Christoph Hellwig wrote: >> Allow to pass a remap argument to the swiotlb initialization functions >> to handle the Xen/x86 remap case. ARM/ARM64 never did any remapping >> from xen_swiotlb_fixup, so we don't even need that quirk. > > > Any chance this patch could be split? Lots of things are happening here and it's somewhat hard to review. (Patch 7 too BTW but I think I managed to get through it) What would be your preferred split? >> diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c >> index e0def4b1c3181..2f2c468acb955 100644 >> --- a/arch/x86/kernel/pci-dma.c >> +++ b/arch/x86/kernel/pci-dma.c >> @@ -71,15 +71,12 @@ static inline void __init pci_swiotlb_detect(void) >> #endif /* CONFIG_SWIOTLB */ >> #ifdef CONFIG_SWIOTLB_XEN >> -static bool xen_swiotlb; >> - >> static void __init pci_xen_swiotlb_init(void) >> { >> if (!xen_initial_domain() && !x86_swiotlb_enable) >> return; > > > Now that there is a single call site for this routine I think this check can be dropped. We are only called here for xen_initial_domain()=true. The callsite just checks xen_pv_domain() and itself is called unconditionally during initialization.