Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp384536pxj; Fri, 7 May 2021 10:40:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOGtPC9mCCCxWKoH3WZz74hIz/zvoAxw3L/8x8DBfB7VKhzcNDriX9vgaj11NlVzAlHSdx X-Received: by 2002:a65:52cd:: with SMTP id z13mr2448771pgp.330.1620409247027; Fri, 07 May 2021 10:40:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1620409247; cv=pass; d=google.com; s=arc-20160816; b=c88Q2ZYWofnAn5JLi1EMn+LR9wJChMA0SQ4zYWv4F7AMVSINfxpDZCy8IHsrwTyS7f Rn115QA1+JyCSDi4h1LpG8PPOeWABld/Ahc4KbfF7KkTD8Q36ewhSGLjTu7LYrMf3PCT GqLqq9ahIlHbVPKAWJ9G6P2CBtLNPfUGvx6I1cPkRu604Vi/nc4F5EgXngqeMPl1vjzv 06ovk69VZZwSWwNTl6eAHKr+vl2VtcQNY4L3jNB688xf6/Ovccl5pdcj8GMdKZ3DT9SO ULIzF37xCJ8bkrRC+AslxmxX3LyW8AgfO1aU3IHoMZ6RNhGLO2SFEdGDQS8FIXam0A7q FQGQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=M0MLvbZBevsyhRA6EvN0IFIo7lI5yPAeclzQDtJqH28=; b=rd/GNRtUfMeTYtmNkctlJkquX8cnIJhp9Qm2eW64IBZJDEDfsqmJUDQfIE8bkXTjaM T0qgCMu9qt7ViJd84Evncyhg/QxCHtTDYhmujZklJB6Kr6RIQFzXQeAOw4+XVpRAWpst O14JYZ2/g1aThkCGJm3aAmbA48RVn6kXLR0yVcapXl4zYnKA7lZEwwv9au2jtMoYGHGN nmNcNLUvHDU6Mvgj7dvArDc+mieRzQIjXvfe9VwvQpl2Q3JLuKKig0tZfCfqSzwetIg5 vZNzGBJ5d/ia5toOwg6STDDW7mTFT/GxJFZmB6xDsc60FdRPVhWDtmHizgRL5XO8rcC4 PTbQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=Ivs88zu2; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si7471984pgn.82.2021.05.07.10.40.35; Fri, 07 May 2021 10:40:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=Ivs88zu2; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233775AbhEGRLy (ORCPT + 99 others); Fri, 7 May 2021 13:11:54 -0400 Received: from mail-mw2nam08on2082.outbound.protection.outlook.com ([40.107.101.82]:41184 "EHLO NAM04-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232717AbhEGRLx (ORCPT ); Fri, 7 May 2021 13:11:53 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cCScQYkHLB/8Y2iWxXYi9vInw1iBpLEvT2DE08ed/3Xk6Aw9jKZ82HmhRv81KsMbXbaxaZR/WSODP58+Ip12fUTqG2QqnsNmtDUGMzlkSzeoeAHCUVmK9WBrCLztQWQ38HqbpVgq161gPdptfPRcLnWe3AvSMC22dXZq/h7iIbBVFri/z6Tm7WyhXFa89iBrq/3K731zOoa2dGn+N8hITsN0w8t8/ZJC+F7i+iBY4w6LKG7GluKJfNhdLiUgBMVpr/+wIx/ieEWTIktD9S4Ec6nDcHcFfCzx1AeUjC5NKUVtgu8KEg75YwlBE3V/uYkqw0cTd1BZduG+gSVtrIxQUA== 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-SenderADCheck; bh=M0MLvbZBevsyhRA6EvN0IFIo7lI5yPAeclzQDtJqH28=; b=g5mtJJYfyHxisWNOKqhCuZ5fZ8j5dnTEucXX8p609ttxpmZsPgA9RH7L/Vq4ENfIZ8Hq0FdnI6ZVklSkgoiR7YP1Dc4zm0cRD0/WRhNDSUQAoAvqQ6eTq5avrR4GimMU879c3fvVk8sGw3NDzp/nqRI/z7gsIjfCF48i3ro7ek3n5k4QBvoFxF2bwORaZqOqViUJ32grAjh3gK1o4VXLHfR8t899i++HSsBejhE9veXqlCShDyXNq+N6ZiEcqAfzimb4FizLwK7GTWlVMtoIS1BAK5coTMps213qXp43xU+pu1LLyRZo0IDWNFrG7cCwk1NY10nDC7b1R89ICvfUsw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=M0MLvbZBevsyhRA6EvN0IFIo7lI5yPAeclzQDtJqH28=; b=Ivs88zu21G2JnEM1a7qfGSMjdOynDrACqWCDOh0WSfiQMwQybGgE4iBH2jGuw2z7VP0MibFxOUVJB2xivbgOnG6qdBMV5neroDXfKi+FODxjcCLI47cT1mSn7+V/RsOnYBBrpSJkK/rjVEN6x+aDVdbadoVhCVqgpWpclx7XRyQeJDjSPjTPOPB4VMAXwLqcEwZNSNLc9RCnICOPtj9EctWBCExpWfB/qR+x6mmNn0isNeDeM/cQRb7PsgWF5UPtM+NzYCh4bIwQwQmn/QxnDklVsyiwi/jzN7MBoa6dZNR1eDHVzIn7AAmVJ+z9ts1jVSu18xvroB1siJNcdmqMLA== Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB3834.namprd12.prod.outlook.com (2603:10b6:5:14a::12) by DM6PR12MB3594.namprd12.prod.outlook.com (2603:10b6:5:11f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.24; Fri, 7 May 2021 17:10:51 +0000 Received: from DM6PR12MB3834.namprd12.prod.outlook.com ([fe80::ddb4:2cbb:4589:f039]) by DM6PR12MB3834.namprd12.prod.outlook.com ([fe80::ddb4:2cbb:4589:f039%4]) with mapi id 15.20.4108.030; Fri, 7 May 2021 17:10:51 +0000 Date: Fri, 7 May 2021 14:10:50 -0300 From: Jason Gunthorpe To: Alex Williamson Cc: "Tian, Kevin" , "Liu, Yi L" , Jacob Pan , Auger Eric , Jean-Philippe Brucker , LKML , Joerg Roedel , Lu Baolu , David Woodhouse , "iommu@lists.linux-foundation.org" , "cgroups@vger.kernel.org" , Tejun Heo , Li Zefan , Johannes Weiner , Jean-Philippe Brucker , Jonathan Corbet , "Raj, Ashok" , "Wu, Hao" , "Jiang, Dave" Subject: Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs Message-ID: <20210507171050.GV1370958@nvidia.com> References: <20210422121020.GT1370958@nvidia.com> <20210423114944.GF1370958@nvidia.com> <20210426123817.GQ1370958@nvidia.com> <20210428090625.5a05dae8@redhat.com> <20210507110614.7b8e6998@redhat.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210507110614.7b8e6998@redhat.com> X-Originating-IP: [47.55.113.94] X-ClientProxiedBy: BL0PR0102CA0025.prod.exchangelabs.com (2603:10b6:207:18::38) To DM6PR12MB3834.namprd12.prod.outlook.com (2603:10b6:5:14a::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mlx.ziepe.ca (47.55.113.94) by BL0PR0102CA0025.prod.exchangelabs.com (2603:10b6:207:18::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Fri, 7 May 2021 17:10:51 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1lf402-002vKA-4N; Fri, 07 May 2021 14:10:50 -0300 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 89240622-d73e-4007-d3ce-08d9117b1121 X-MS-TrafficTypeDiagnostic: DM6PR12MB3594: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5u23vss7Xf2rZSGF/K9gJ2rvAV+b20nA7QlrwdqoPWHYuJiMcOlT9/74JvTjSFyfEqfYri5fybYibUnVIeNAJiWtNaNLY53PPWLQRx0uIMkrMqLz6C+X0zcHJ8fO25skCdS2JS72sODOYSRNakZbtkzm2ukXMq0Oef8jbchH5th7h0G4Q0+ZL2Fu6Q6YlsHGaOxGHKRfWoge1MQyQCuxD9+1BDUjYyHDr3/Slmaxnal1cN7Nis0k7gsne17axvlheFehOZK2LrsyAp08hwkz9Lkk9jXrnlgmYnKYgC2Ejc1sMnd1lGur8WE5u0fBSowSQJ2IWer+/VlO0rV346A8yehsVa7F4Ppbkj8D+P9+NApAvLEINIQJX2T5QlZxEdr1nlfpqJ1n2Pm3LIwg50CkptToNUpQfj3lfsZ/06QTFGdExIHOcNaUQOVN+2ToaisxRfivjYyeNoMDj5uFkS427/o8PJD63o26mqE72xHp9a04fl93utnYc1u2ZzbX+4JCtQ8DJutQzWSEiI56ShrbQxF6TfmtEvxGCWsDFsL8bV7mIcPi4g28S1nAxdd8bpVvuu1VoOa31Q4Ot5QIeV4z10ettV6iH8RY9XD2EZyEnoM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB3834.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(396003)(366004)(376002)(39860400002)(136003)(316002)(26005)(6916009)(54906003)(426003)(1076003)(5660300002)(38100700002)(36756003)(33656002)(4326008)(9786002)(7416002)(83380400001)(9746002)(4744005)(2906002)(478600001)(86362001)(66556008)(66476007)(66946007)(2616005)(8936002)(186003)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?7RMKailXr7+XT2Oy5CZkNfmkQbWDRdyI9qg9VFQfXg61LlkWvyyops4vFM81?= =?us-ascii?Q?I+ir8gX6zINq+3aQw4aE4nGkW6UChVRPr8zTLBdrEe36Kk8jcYJ30AsD5OrN?= =?us-ascii?Q?ewQoEAMr25XGVo1YJJbdMJf3j5HZLZkNFJDKdWBlA8kjw4yqBACKjQHuEPve?= =?us-ascii?Q?7ygXj6/NmDZETmVzEjPheFaUNRJn8s6pwaL9rCkdvnAG4gztL4n2YVxJpvLS?= =?us-ascii?Q?6TjgFu9gGnEpvbIpVpWcyr1xykbiDzNUpRYtVr+tG0oNHR/zdfBtIIiVnlJf?= =?us-ascii?Q?S5Phc+7CObIHy3bDKDPBMT8LVZbGMZ1xr/BCG6IrCZscm1s0tLJ0Xtcyefk4?= =?us-ascii?Q?ig5haYjtO2V4G+T9BQ5wC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= =?us-ascii?Q?4fX6vNThcAyv4fHsTDqlnU6C+2QNH3YIfn/jCugFnPuNJDL8Q4Pd5PeReOyJ?= =?us-ascii?Q?hI4MZ6x6BPCkU0gKlD4Qf3VL?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89240622-d73e-4007-d3ce-08d9117b1121 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3834.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2021 17:10:51.8463 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZzmAhj5hdxGgs3Vr1eUpKx6QCGNfODnPwLh1rLFW8gQ1VAYEaYPgiiPQL0xqAp7M X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3594 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 07, 2021 at 11:06:14AM -0600, Alex Williamson wrote: > We had tossed around an idea of a super-container with vfio, it's maybe > something we'd want to incorporate into this design. For instance, if > memory could be pre-registered with a super container, which would > handle the locked memory accounting for that memory, then > sub-containers could all handle the IOMMU context of their sets of > devices relative to that common memory pool. This is where I suggested to David to use nesting of IOASIDs. Without HW support for nesting a SW nest is really just re-using the memory registration information stored in the parent when constructing the children Jason