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 1B50EC433EF for ; Wed, 2 Feb 2022 13:23:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242503AbiBBNXS (ORCPT ); Wed, 2 Feb 2022 08:23:18 -0500 Received: from foss.arm.com ([217.140.110.172]:59196 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344309AbiBBNXM (ORCPT ); Wed, 2 Feb 2022 08:23:12 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 49719ED1; Wed, 2 Feb 2022 05:23:12 -0800 (PST) Received: from [10.57.68.47] (unknown [10.57.68.47]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 65DE23F718; Wed, 2 Feb 2022 05:23:08 -0800 (PST) Message-ID: <862bfda8-5c95-3743-3758-2e63faa7ac3e@arm.com> Date: Wed, 2 Feb 2022 13:22:46 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH 0/2] x86/hyperv/Swiotlb: Add swiotlb_alloc_from_low_pages switch Content-Language: en-GB To: Christoph Hellwig , Tianyu Lan Cc: kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, m.szyprowski@samsung.com, michael.h.kelley@microsoft.com, Tianyu Lan , iommu@lists.linux-foundation.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, vkuznets@redhat.com, brijesh.singh@amd.com, konrad.wilk@oracle.com, hch@lst.de, parri.andrea@gmail.com, thomas.lendacky@amd.com References: <20220126161053.297386-1-ltykernel@gmail.com> From: Robin Murphy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-02-02 08:12, Christoph Hellwig wrote: > I think this interface is a little too hacky. In the end all the > non-trusted hypervisor schemes (including the per-device swiotlb one) > can allocate the memory from everywhere and want for force use of > swiotlb. I think we need some kind of proper interface for that instead > of setting all kinds of global variables. Right, if platform/hypervisor code knows enough to be able to set magic non-standard allocation flags correctly, surely it could equally just perform whatever non-standard allocation it needs and call swiotlb_init_with_tbl() instead of swiotlb_init(). Robin.