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 6D8E9C54E76 for ; Mon, 20 Nov 2023 14:05:13 +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=6apixQKzwdM1qh3GWQw1tvdvsl9bJkkpYsM8fZu+nOM=; b=MhIMuwcmt1vJGw firuTo2zYbnDI0402qMVqboLaiqk7OLD3KkQRImaSlAKg1vMloq4Ioc5e+53osdPcgDRAfjjyNBuc DFVJ2EUIu/ms32bBPWtmytwdOy8nnVGeQQzVay38CogLe/f7logKx+PA5xOeP9omc/g0jB8pzEgn/ ITOBX2z0hF+ZTYNImMXq0wGBdaV6GTwXFI4jHdCR7SdSnv9p9EL+mHFSsQ8cC1PFO4ohPs82D5Gxl 9HaDDvTVa0HqghWpY67KjE0vfTIDLSPLUeWqxWI1n8RcrSlW03RSYA8/geNKJDkwNMqsWJkTxiAkL 2EbC4feAE8E80N2MO+Lw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r54tI-00CEHG-10; Mon, 20 Nov 2023 14:04:44 +0000 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r54t4-00CEBR-1y for linux-arm-kernel@lists.infradead.org; Mon, 20 Nov 2023 14:04:42 +0000 Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6d67d32adc2so2680275a34.2 for ; Mon, 20 Nov 2023 06:04:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1700489067; x=1701093867; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=rG0WCHMqWdGOoOpA8oz353io0iId12Ij+cwigESy5ls=; b=fbUMTubT+4j7Nmf4n2PGXlwyB6xRWyApod/J2iNX2k6G74y2fIHrq/zMvwjEXDSobC 6JDMvOjfYOR8YbZe/YA434tk9ku3FGYwDdnIU7/I8h1ROTVzC5twJFICiU99rB0mQ452 mToB1hrqKfAjYUXjL4s7bIRysGIlc8BN0tRjD2XsIS5KOJnOpYz87il2ocKCfQC2oL0i YDxkVHUQQPCIqpoRunTvSwuyxc/dxBu8VLeMYRuAqMIG+GuEH+mZxEFMOqyU8ehTJOpY S4dV/7J3VtlUCQx2cUVoQt+43sUK58M99Xy1sSaxG3Y14QIrGOlz05y4/MiIZT0wXw9V YPvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700489067; x=1701093867; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=rG0WCHMqWdGOoOpA8oz353io0iId12Ij+cwigESy5ls=; b=gHIsPlceNQNHm7Ax/IKJDu6PRpzwfvxqTHE2a1e/Iy4Tijt6JFHR83Fh6C6jbMyzsS JHqXf0MN4zrqVbaxYVO7TgpDtkuNK+ydvhkjninSZ4hZTLaDWRmWjvLHDVeK727JpHjd J8PE9OHR+kmFF6lo+3GzMQ7lWdaSouj8IXdjWUiFGe3Xtc0BPDkaub0fzkDAEnIkI0Ld 9OvkVbGGECLwdW3sbzp5z2UnKavmIoCNS7YuJUcca8x1XOuLBD1grutLdCyIdMGvbC5p tqShEe+SZvVlaKJIqbSUb/IzfSr/E51PxfVcSioqc07+Tl71VANKP037Bg9NxCilmfgk al5w== X-Gm-Message-State: AOJu0YzNRDbNQVLbQZytuh/09tgj7osMIYNTtfRuu60Fy0WgPyNcE6zh GsDGVcqm5AG7/AVWA4X5Tj4QZw== X-Google-Smtp-Source: AGHT+IHHYsEhV7J+GzlVmc8OzgOHpcxM+6MzRUXt5ncp8iyh4bWAf3tzoGkaPba/CTOoUAru+Cl/hw== X-Received: by 2002:a05:6830:200f:b0:6b9:50a8:1e76 with SMTP id e15-20020a056830200f00b006b950a81e76mr7463127otp.17.1700489067691; Mon, 20 Nov 2023 06:04:27 -0800 (PST) Received: from ziepe.ca ([12.97.180.36]) by smtp.gmail.com with ESMTPSA id y8-20020a9d5188000000b006c7c1868b05sm1168833otg.50.2023.11.20.06.04.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 06:04:26 -0800 (PST) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1r54sz-000Hvu-MZ; Mon, 20 Nov 2023 10:04:25 -0400 Date: Mon, 20 Nov 2023 10:04:25 -0400 From: Jason Gunthorpe To: Boris Brezillon Cc: Joerg Roedel , iommu@lists.linux.dev, Will Deacon , Robin Murphy , linux-arm-kernel@lists.infradead.org, Rob Clark , Gaurav Kohli , Steven Price Subject: Re: [PATCH v2 0/2] iommu: Allow passing custom allocators to pgtable drivers Message-ID: <20231120140425.GA10140@ziepe.ca> References: <20231110094352.565347-1-boris.brezillon@collabora.com> <20231110151428.GJ4634@ziepe.ca> <20231110164809.270f82bc@collabora.com> <20231110161229.GA462657@nvidia.com> <20231110201652.629b7228@collabora.com> <20231110194215.GR4488@nvidia.com> <20231113101103.1cc05c8c@collabora.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231120_060430_770253_E00F3501 X-CRM114-Status: GOOD ( 25.34 ) 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, Nov 14, 2023 at 12:27:48PM -0400, Jason Gunthorpe wrote: > > Anyway, given you already thought it through, can I ask you to provide > > a preliminary implementation for this IOVA range mechanism so I can > > play with it and adjust panthor accordingly. And if you don't have the > > time, can you at least give me extra details about the implementation > > you had in mind, so I don't have to guess and come back with something > > that's not matching what you had in mind. > > Oh, I don't know if I can manage patches in any reasonable time frame, > though I think it is pretty straightforward really: > > - Patch to introduce some 'struct iopte_page' (see struct slab) > - Adjust io pagetable implementations to consume it > - Do RCU freeing of iopte_page > - Add a reserve/unreserve io page table ops > - Implement reserve/unresereve in arm by manipulating a new refcount > in iopte_page. Rely on RCU to protect the derefs > - Modify iommufd to call reserve/unreserve around areas attachment > to have an intree user. > > Some of this is a bit interesting, like reserving probably will > ideally want to invoke the batch allocator for efficiency which means > computing the number of radix levels required to fully populate the > current empty level - that should be general code somehow At LPC there was quite a lot if interest in improving the io page table stuff to work better. Based on that I'm even more against adding an external allocator at this time. :\ I may try to write a sketch of something but I'm not sure when.. Jason _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel