Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2430133rwd; Fri, 19 May 2023 05:51:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5nRyo2glL2Ju6Q+tomUvRWhNg7RUpizTy1FJ3XwoQuvyN1+fx2ZdotsbY65EUlWCAq+L4l X-Received: by 2002:a05:6a21:9201:b0:ff:b564:c532 with SMTP id tl1-20020a056a21920100b000ffb564c532mr1832801pzb.43.1684500661465; Fri, 19 May 2023 05:51:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684500661; cv=none; d=google.com; s=arc-20160816; b=mo7nfvTCegb9l5Y9yHYL9/FF2cKAzFbTR9J4D7ZxhjrpY0ZEoJaq7P4WU7AfwxNnZH iEGCVFZq0qwcm4HVrOMmRIoo/rr32Aq6Ab2pvnONsFSxvrUpmwWqq2MFavMer3p5pcTA 4gmQb1js5UL8CUWIYq5iWkspCR5p5dy3+gXqzAFSb89Z/woWSEUME4HT0WEJqxfYrX3w yYjlYOEJ9taEoc1v/ruqQVimK77s8sSB0HZ2gFPcBEVFCqTqkwuoY8VQwJGpHdm5tt/H wKN/OIGjAn4Qw4sqG/i1hWNTTXDxvus1+DYba1+2St8zzIPEwKCPBvaQ1rUVPlegFqg/ giYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=EXobUfQz7lSc5nZMlrMk/Uwaa4klN24vvkUJVlFAYfE=; b=d9hjeskK6mnskjltD9udtwW/89x7R8QcGgLXgv93q3dQtshgvSGzARAK8ndkyKS/nS LPQ5nKSNuhCyMcFmsGxJYw6dF4fi/9RmSMNxMdddqrjvexl/BlFS84mgZtjetTiMyBfQ 6NOCzVVrvcqeHenNwIh0X42byQPh9MKJObaNFYPtlIDuAkj8RjDgfaiRU6Q4TS6EIBYm cj30wZnHSC8y3aG13ONrM11NHpBtxxmsSwk/njVPoc3Qz7dP/G1bHOXpQKhDQHDO1Hu7 ep1EVT7NVOAftGO0vOBp3uwG0pZlZ11PCzOezGnEAYa9VZSW6daX2txU19B5uVPkCeiY F9XA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x5-20020a654145000000b0053420d9d291si3547943pgp.554.2023.05.19.05.50.46; Fri, 19 May 2023 05:51:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230290AbjESMmV (ORCPT + 99 others); Fri, 19 May 2023 08:42:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231336AbjESMmS (ORCPT ); Fri, 19 May 2023 08:42:18 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3640B10D for ; Fri, 19 May 2023 05:42:00 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id A400368C7B; Fri, 19 May 2023 14:41:18 +0200 (CEST) Date: Fri, 19 May 2023 14:41:18 +0200 From: Christoph Hellwig To: Marek =?iso-8859-1?Q?Marczykowski-G=F3recki?= Cc: Christoph Hellwig , Juergen Gross , Stefano Stabellini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Ben Skeggs , Karol Herbst , Lyude Paul , xen-devel@lists.xenproject.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, nouveau@lists.freedesktop.org Subject: Re: [PATCH 2/4] x86: always initialize xen-swiotlb when xen-pcifront is enabling Message-ID: <20230519124118.GA5869@lst.de> References: <20230518134253.909623-1-hch@lst.de> <20230518134253.909623-3-hch@lst.de> <20230519040405.GA10818@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 19, 2023 at 12:10:26PM +0200, Marek Marczykowski-G?recki wrote: > While I would say PCI passthrough is not very common for PV guests, can > the decision about xen-swiotlb be delayed until you can enumerate > xenstore to check if there are any PCI devices connected (and not > allocate xen-swiotlb by default if there are none)? This would > still not cover the hotplug case (in which case, you'd need to force it > with a cmdline), but at least you wouldn't loose much memory just > because one of your VMs may use PCI passthrough (so, you have it enabled > in your kernel). How early can we query xenstore? We'd need to do this before setting up DMA for any device. The alternative would be to finally merge swiotlb-xen into swiotlb, in which case we might be able to do this later. Let me see what I can do there.