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 X-Spam-Level: X-Spam-Status: No, score=-5.0 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C873BC4708A for ; Thu, 27 May 2021 18:25:21 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 63046613D3 for ; Thu, 27 May 2021 18:25:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 63046613D3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 326CA83DF1; Thu, 27 May 2021 18:25:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W-YLGTxorGvU; Thu, 27 May 2021 18:25:20 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTP id 2375B83DEC; Thu, 27 May 2021 18:25:19 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id AE62CC000E; Thu, 27 May 2021 18:25:19 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id D457AC0001 for ; Thu, 27 May 2021 18:25:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id B55B960BE7 for ; Thu, 27 May 2021 18:25:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=nvidia.com Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZhtxtCQrzoZg for ; Thu, 27 May 2021 18:25:16 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on20616.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eaa::616]) by smtp3.osuosl.org (Postfix) with ESMTPS id 8459B60BCE for ; Thu, 27 May 2021 18:25:16 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=miHLD1o/j8DAanruhuqMqHWuZR4z2W2XMPyEmqks++GOS3k3DI/YnwZ6+XpW/NFYqG81gPwbGWO3skyCMkVNw1Livbw/Id7YCt2kLnYsMT7WXPGsTeoFleYGuDrgT9h0/MjOuidRRPnjdjKpec5s7YS05ctmkNppKfpvOOw0QVQkFOjWw6oW7T7BlI7E4BlpiQbF7TjTlJPnWkm9IbMTKXpzTgG68SK+U7k4p35NR7CoZ37uxlWW7bm/znX2GUxY7UQsLKvOejnHrsvzl1aO97ReC7GWm5NHjYdY9q+O9Im5Le0z19zHH4VuDXSVvpVabKkqUrBVd5ZEIMpdHH8qTQ== 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=yHNJ/tHpoRmzUSCDLrlfwzUiIzLXw6x/NlDpR9tA5To=; b=Z4KMjoMmDlXfs3SB5lLQpCJktaiIU3nP18vvUDHuJz19x53/4Xe7vVCZLuoBGm8AnnfoYYZuB4337kqmiZjDVnde9gI5Fu9/e6IQALAyohoGkHAIPcpcj5VKABAqSukmDK+LLXXGVzh9OQimNi6m++o8fHiqyfKaqwKV+YctvA6jXyrveGDaVsQuDZtEJS7mnaxSXUIe6vKPIwvxFADvJXnOmuybeyS/q+uuT44aE77FE1mmE9k6gacB5+zvVVqwNu8GqRBQu04pVTfHLpHW8uY24dyA4bVBMGR021rF0TZpN4jZUXMkHqR4zEFNPT2BufAC1fGZNEO2/ncBSRZWuQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=yHNJ/tHpoRmzUSCDLrlfwzUiIzLXw6x/NlDpR9tA5To=; b=KEsTRw5JhfE0s2RrUxdn8msH5OP6B2U0EW86gvU7ixZIdrBIUqNY+5CzeoLTvs/ccSX+/kLYfzerc2QrQilAOIH1SEuHo7VpGMVo+EPlSTlyMBiNOAAdZAG9i4eamBLT8cbaC+1SJPFztuFw2ZWq91qI3ZYhqQB1Ke4m2R9s4ySxg9bbpPtOY07QaMWtj8LBOTW5CtZNs2EaOkErwKftti1rCM1ZjXh66eLM5NJJqNLagESVVqby+TTgrUoUn0Vy3Jtg4ofBoXdlYN6RRM0IOPu3NIqf49QcYttx2QMykF4uh+OAhWbVo4LRM6JSr5+8TnWtzQ0MpSHRjX6ApjxIyQ== Received: from BN9PR03CA0729.namprd03.prod.outlook.com (2603:10b6:408:110::14) by DM6PR12MB3292.namprd12.prod.outlook.com (2603:10b6:5:18c::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.20; Thu, 27 May 2021 18:25:14 +0000 Received: from BN8NAM11FT017.eop-nam11.prod.protection.outlook.com (2603:10b6:408:110:cafe::16) by BN9PR03CA0729.outlook.office365.com (2603:10b6:408:110::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.20 via Frontend Transport; Thu, 27 May 2021 18:25:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT017.mail.protection.outlook.com (10.13.177.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4150.30 via Frontend Transport; Thu, 27 May 2021 18:25:13 +0000 Received: from [10.40.101.125] (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 27 May 2021 18:25:04 +0000 Subject: Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs To: David Gibson References: <20210428145622.GU1370958@nvidia.com> <20210503161518.GM1370958@nvidia.com> <20210513135938.GG1002214@nvidia.com> <20210524233744.GT1002214@nvidia.com> <20210525195257.GG1002214@nvidia.com> <6b13399d-cf03-1e71-3624-c39d4d05e958@nvidia.com> X-Nvconfidentiality: public From: Kirti Wankhede Message-ID: <2476b70c-9320-a49c-efa5-fb7027e1b572@nvidia.com> Date: Thu, 27 May 2021 23:55:00 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 99a934c6-bc0b-458f-fc6b-08d9213cc4f3 X-MS-TrafficTypeDiagnostic: DM6PR12MB3292: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2qEzlDAfS7V7u9x6X0+WR6WzIvpYZcZFLSRWVXfoWyB69Z50UWXWNepeeioiOca0PYau02CSxUOu4HXVoGTWHapD5a5Y1sMYZ+X85pKuItTOLUxIdVxvwtqygpSETibEGMZPwkI4QAARKg3DIVEAzGEWriHlzeoHjkzjQ7anM/Goz6o77eJHzII6PZ1FoJTZnYX28eW20rjAdiz0wpkhYvjbyNoj4OI1jRwOnqdz8jqwOaGHP7HhQVgWKGZ0WCMDiWnOi8+NxQ5UJZUjHHRhPMtVdNXPusdjGUiirBfT23nbyfrFba5Ne9Gm204l+3NIbnNHHqFqQZ/eRv9aQLqCrSy7NAFG/QzXIvh38e4BxiZAQhrdC7+0NOYX+9OnOXTaqUBvQ6wY6oXydtUmQKKf+BSMq8h53pBN5flbE42Bl/WZjdUpYeUbO+57wvODuEg1u5TqaEO7QM9tlps/wVFC8autcz0XvfH/UTkjcRoWovWdskqwD/MEOIJvq43Sw3PaKqR9TOTrNXEz51VImJc1i3bUzyiq0myNOAsUZsO2E8UvN8SKIrnnKsEjBcRBEZjI2/kZBWhPsWZEwV7yGb/41Gl3ZZ6XsPRhORTDf3TYEsa3ekNwlS7UPAwhd9b3UM0vGO5rPwOeDVFsQVKJ/G/SSlNOUTgGVUD8nHl6Ph3KqCeIcDXWQvmnpP2xalXVChtZ X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(136003)(376002)(346002)(396003)(39860400002)(46966006)(36840700001)(107886003)(53546011)(70206006)(2616005)(70586007)(16576012)(36906005)(26005)(6666004)(356005)(31696002)(316002)(82740400003)(83380400001)(4326008)(8936002)(86362001)(54906003)(8676002)(31686004)(36860700001)(2906002)(5660300002)(478600001)(82310400003)(7636003)(7416002)(336012)(16526019)(36756003)(6916009)(47076005)(186003)(426003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2021 18:25:13.3845 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 99a934c6-bc0b-458f-fc6b-08d9213cc4f3 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT017.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3292 Cc: Jean-Philippe Brucker , "Jiang, Dave" , "Raj, Ashok" , Jonathan Corbet , Jason Gunthorpe , "Wu, Hao" , "Tian, Kevin" , Alex Williamson , "cgroups@vger.kernel.org" , David Woodhouse , LKML , "iommu@lists.linux-foundation.org" , Li Zefan , Johannes Weiner , Tejun Heo , Jean-Philippe Brucker X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On 5/27/2021 10:30 AM, David Gibson wrote: > On Wed, May 26, 2021 at 02:48:03AM +0530, Kirti Wankhede wrote: >> >> >> On 5/26/2021 1:22 AM, Jason Gunthorpe wrote: >>> On Wed, May 26, 2021 at 12:56:30AM +0530, Kirti Wankhede wrote: >>> >>>> 2. iommu backed mdev devices for SRIOV where mdev device is created per >>>> VF (mdev device == VF device) then that mdev device has same iommu >>>> protection scope as VF associated to it. >>> >>> This doesn't require, and certainly shouldn't create, a fake group. >>> >>> Only the VF's real IOMMU group should be used to model an iommu domain >>> linked to a VF. Injecting fake groups that are proxies for real groups >>> only opens the possibility of security problems like David is >>> concerned with. >>> >> >> I think this security issue should be addressed by letting mdev device >> inherit its parent's iommu_group, i.e. VF's iommu_group here. > > No, that doesn't work. AIUI part of the whole point of mdevs is to > allow chunks of a single PCI function to be handed out to different > places, because they're isolated from each other not by the system > IOMMU, but by a combination of MMU hardware in the hardware (e.g. in a > GPU card) and software in the mdev driver. That's correct for non-iommu backed mdev devices. > If mdevs inherited the > group of their parent device they wouldn't count as isolated from each > other, which they should. > For iommu backed mdev devices for SRIOV, where there can be single mdev device for its parent, here parent device is VF, there can't be multiple mdev devices associated with that VF. In this case mdev can inherit the group of parent device. Kirti _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu