[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 11/12] swiotlb: merge swiotlb-xen initialization into swiotlb
 
- To: Christoph Hellwig <hch@xxxxxx>
 
- From: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
 
- Date: Wed, 9 Mar 2022 10:18:57 -0500
 
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none
 
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Dx641JSVlBiQrD+zJH2H/HezAIOHGVb03Y0nL/kDJBw=; b=IIEjjqZ6k0gmWray/FUYEshYIpfu54ofKRN/JTPTJsUylaVanCTekZ0wY/FZZb5LZmMO3H25LLwyGsrdMO4ymwf8/e7avW04kKQryaBx3lNTKRBuS0BIm6/DGB+fSgoipAVNlpAopKMUgAJfu8YpyWAsoEKhHW4b/yzIcV8hUrIj1LjAbBsmwqp9LtVUPGjj+2QYrIaX8BX2zOOZZdHPnnk4UyNOBwoMk+F8VzSHwWfKb3gFKeOg21IgJ+IjcB2pHL5vuWdEGan5NXh12xRz+GMBvu75aeZaD1J8yqSOk2g3dXT2XlCAaQrc/R3PI+NBJMbEU11TkijJZ5hQxWPwQQ==
 
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HEHPyjSwOBD3pR0mcIfAdUxRXe3UhUKlabQ0+C2C7Ob0ptn01/CPHsVmGZD9VZrZuAx0pPEQqyvlT6b3wCz/yvqRm4s2VL9ed76YO5PMMOW2+NBS9+t1bALedcJr/69K6yqGyiTI0bbAY/h5D3ZbMf9Jma1oIa1iTT3zqSjZflju37nhnixOQ8J2PARJTggDNYEvM+40WCkntw70diTB4mNw7tSBoYULHav2GoLJqsPx3d6TRjTkJ0f6fTjxGF7Pj8QJiB3f0KmntsqyZob8IRg8+9tj+BC5N4iHafcjpVTuZCMotCHkBDmmrwP8c4IvRsYzvlB2Rk794L72FKFgoA==
 
- Cc: iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx, x86@xxxxxxxxxx,        Anshuman Khandual <anshuman.khandual@xxxxxxx>,        Tom Lendacky <thomas.lendacky@xxxxxxx>,        Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>,        Stefano Stabellini <sstabellini@xxxxxxxxxx>,        Juergen Gross <jgross@xxxxxxxx>, Joerg Roedel <joro@xxxxxxxxxx>,        David Woodhouse <dwmw2@xxxxxxxxxxxxx>,        Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>,        Robin Murphy <robin.murphy@xxxxxxx>,        linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx,        linux-ia64@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx,        linuxppc-dev@xxxxxxxxxxxxxxxx, linux-riscv@xxxxxxxxxxxxxxxxxxx,        linux-s390@xxxxxxxxxxxxxxx, linux-hyperv@xxxxxxxxxxxxxxx,        tboot-devel@xxxxxxxxxxxxxxxxxxxxx, linux-pci@xxxxxxxxxxxxxxx
 
- Delivery-date: Wed, 09 Mar 2022 15:20:06 +0000
 
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
 
 
 
On 3/9/22 1:18 AM, Christoph Hellwig wrote:
 
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?
 
 
swiotlb_init() rework to be done separately?
 
 
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.
 
 
Oh, right, nevermind. *pv* domain.
-boris
 
 
    
     |