Message ID | 4-v1-8060f06462cc+c0a39-dart_paging_jgg@nvidia.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> 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 672E3CD4846 for <linux-arm-kernel@archiver.kernel.org>; Fri, 22 Sep 2023 17:08:58 +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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tCcFbTuurYNv/SqXcore3bjILfAheICNNwlatDwmuao=; b=QqDdKree6dGaW/ WphydfPGwJtGVXBWie/vdRJj8qJdDscor3B1c3u800J1R+LHxvu7KMR3+Z7y/Y3rrZ8bod4Ban5HH LPoA+twH5W+14J5TZh5bQ2WrBoQYz2Rj0HNqG1FIvHcqWsCGRBpn3Brsqo78jhspDAUJ1ViYaUYJk Ws2AalweZ0qLKZELqZDrHH8GCeF5KV3+m4ZbwQZpdBETHP8rFcVomq4Xdxe4yh06S0TTno4fh93AX z9+228WNZhfcAISgXhyqfXG8lYKvSL3dbncqL4hyd4fj7NtEutzFEJdE6wFsitQ4BnEesZK4EDyyK lUwt4SWM327D6d5MfVOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qjjdr-009TP6-2G; Fri, 22 Sep 2023 17:08:35 +0000 Received: from mail-dm3nam02on2061f.outbound.protection.outlook.com ([2a01:111:f400:7e83::61f] helo=NAM02-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qjjdg-009TD0-2r for linux-arm-kernel@lists.infradead.org; Fri, 22 Sep 2023 17:08:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RWLyDMUIeFegoDjesUxNrqfNdj2jGkHWACIBfZNA6mn639ykjYRmN7Z2VvRqK32Fq2a7EGu4YNEq7NX68ZqxRKAG9VkgXoO1ndGkvoi5Q4UV9SEoSsH7kSyQtQywK4It8tcuYpBMMramixQxc/UCpUqGzQVn0qAfgPRJOwuPcQoxwDWtfQmMxXmS+Eh7v2rgj0Vnq7hbomsCe0p+UEBsnCxVw0MS6cd4s8AnjW15uxUqhR7ACRmAjqAuag/M+AqLMNrmLSKp71btpve1uSa0Ag2wkep/Q5lzJuVcl0Zilj+aBofLUEqgkW02BIWmO2I8+mAR7g7oCj4Mksdy6j6NJQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6f/F+3oX3DVdv7ukFG5Ga5zY2EAmoCSYx8EULKevBPs=; b=FWQJeMuZJzqN1DQI87tXeKXUEaWynubTXDMVospHIIXLrEvXehaLsv8ucb74zki/lM15rhlPkOjbSj3TTfy7rVxpDm3ZDufjaWNpCQHdrxGRYQnTgoDUmW+QFZmg5JlK/kB8y+7+1HM1Befg+B+UJCGUGp+1bnk0jtD4Pw/qRNo5Ro8RhHhFB8yRtO9R1RvsIee47PY33jFRn+LLXn5tZUEUTwcy21SSWse8eLdfVh+LFEC/vXqg8hGMZiyV/0fekgHmPkInD5enOcgisDEBWQGsKzjrLSsudGCFVxJJckFmzBKX5u8/VwnWRFuUFzOzsrEnNraxofEjBYV8pP6/SA== 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=6f/F+3oX3DVdv7ukFG5Ga5zY2EAmoCSYx8EULKevBPs=; b=nAUa3UtnId/+206QHbkfIoXoanJbF9vXiJCjw+4kjiouW7obdLqCV7Vz4vf1PqXd43CVCYQLwBZAneXaY9rPw25OpTixFJv9lyljh/oRzRKp49ShUX9db9hwj4K8xCPs2IlfEk/EcMFo+v3nkVJe82+P7CFvGPtKkhJDp38adWQ7yjMW14iNwugiFHGvnahGR1RSJr+y9cuhRU9hWsDBt4fOpVpLKXRwFkKl4VyWPmwb7K9jQTgBVXq+vvKbBFnR6aSb0evPgiB5Vb4mX/MZ+l8eMNuFUoiBlMDO9PEfb3d7OT0aFYVKKkZ9jKl0h5Gin6lzGjI5um58tPB6mPXOsg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) by LV3PR12MB9188.namprd12.prod.outlook.com (2603:10b6:408:19b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.23; Fri, 22 Sep 2023 17:08:03 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::faf:4cd0:ae27:1073]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::faf:4cd0:ae27:1073%6]) with mapi id 15.20.6792.026; Fri, 22 Sep 2023 17:08:03 +0000 From: Jason Gunthorpe <jgg@nvidia.com> To: Alyssa Rosenzweig <alyssa@rosenzweig.io>, asahi@lists.linux.dev, Lu Baolu <baolu.lu@linux.intel.com>, Christophe Leroy <christophe.leroy@csgroup.eu>, David Woodhouse <dwmw2@infradead.org>, iommu@lists.linux.dev, Joerg Roedel <joro@8bytes.org>, Kevin Tian <kevin.tian@intel.com>, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Hector Martin <marcan@marcan.st>, Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>, Robin Murphy <robin.murphy@arm.com>, Sven Peter <sven@svenpeter.dev>, Will Deacon <will@kernel.org> Subject: [PATCH 4/8] iommufd: Convert to alloc_domain_paging() Date: Fri, 22 Sep 2023 14:07:55 -0300 Message-ID: <4-v1-8060f06462cc+c0a39-dart_paging_jgg@nvidia.com> In-Reply-To: <0-v1-8060f06462cc+c0a39-dart_paging_jgg@nvidia.com> References: X-ClientProxiedBy: YQXP288CA0034.CANP288.PROD.OUTLOOK.COM (2603:10b6:c00:41::45) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|LV3PR12MB9188:EE_ X-MS-Office365-Filtering-Correlation-Id: 309ec585-3499-4ffc-4000-08dbbb8e7a6b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QDr5g9LMUbokCpafY/IdOfkR1rDjdalo/JgjIgwGf+uBzg/BLPtHJn+fofdlIclLBxMqUAvHqRcitAXgjT4OJFNzuHf7bfRv7LH3CqM/g5L8oC0mKDIP38TUQspjB/RVdoiFsDYmh7HshKdgcVlFJqnFmBhSshImgy/3K1WdGPVuAUtiiQA7C178bKk5VR+wPzeoVWKIel8FgRbF+GEOX0dknEhwlhLsoe9icO9mOED6UmtQtW3X1lzCmiP1fIPcv2bFw1GKGSiFOCwf0o5S1DyIRR5iaTRjMg4mAadgyltqK4XT4YGblpT4TlV4RUSoycE9DZZ3QEdtgD0MH/uuaHtaUPvWRn+iwlNxSujgKjibO9shydG3wmqL9hoc6LzFvrYqgukCZiCf3YxxGneBYGCsNhI4mnntfxYa7znWp/Ac3gMoJwnGFIw8zhIC310Mhpwe//j+ejRPvF5w22VhFwV3ZWq8QAduF18Wk6+YcCX6G6Zj1+0TwiOur15EuLBwdpQm+3oQdRxrcLJ9BucXRymimRLx2rjL2T0LVOkYQcDnrWMR+exb5Ok9Nfy7NFn9QJOh8MwxRYmYwpI1g4Kl7HD7Ia6AaV4OfECCvXDfUsfQrD5O33HYV+fs7Pvf4FFp X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV2PR12MB5869.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(366004)(396003)(376002)(39860400002)(346002)(186009)(1800799009)(451199024)(921005)(26005)(8936002)(2616005)(8676002)(7416002)(83380400001)(2906002)(36756003)(86362001)(6486002)(6506007)(478600001)(6666004)(5660300002)(38100700002)(6512007)(66946007)(110136005)(41300700001)(66556008)(316002)(66476007)(4216001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3LV3Dc3Jx7kdR/dUZHVgYVV2AtBPm3I+cuxg1b6sPbj+gGSVw0X2kHZ09qboQH/ZTgcV2bOUqFMCaQcG1X1E86fhEry0304hVkDQk9jH87E1dGWAeCOb3+pk8qRNJENA+VE3P1dKtVP2KL5popkGPCMx0sUSwl9VlBHIy8jayqP5bbte4bTxQKoxX92yCQMWYDO0jV0ayc4DcF29gnPtYPAsY0FkrOy08huchotXh7jUbmhbgnYHzJz2w+zZpLjrn85PihogE1kURPAS3cI6fNerudzMrjBRsDANDYGxfOUu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QL5pjBtev3fa5ysgZQQDLUXq1gPg/WvxexCPzN77uURAOyug8AjYnOgwU9DV/+B4QOKdj3HVTcc8wcZfv9kOxgjWgAMJoHJM3NJmDKXyDHnHBXwR54OAGg0LRv7bflnhdzzL/4cTndqag3urYZL5iDEkov/Nm9uTdXmqm5lL950k5BjS8e/nDrz1+pSUWpO6W/6z6wWBO9Ze X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 309ec585-3499-4ffc-4000-08dbbb8e7a6b X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2023 17:08:01.8067 (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: 3wQlBrkEwVa3nRIR0D17LYlCQ66pkwEOENAPFGzD0S6eh1m+mdi5BGSrp/xE6+JZ X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9188 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230922_100824_934415_2A932CE7 X-CRM114-Status: GOOD ( 10.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
iommu: Convert dart & iommufd to the new domain_alloc_paging()
|
expand
|
diff --git a/drivers/iommu/iommufd/selftest.c b/drivers/iommu/iommufd/selftest.c index fb981ba97c4e87..ee607984709102 100644 --- a/drivers/iommu/iommufd/selftest.c +++ b/drivers/iommu/iommufd/selftest.c @@ -141,16 +141,10 @@ static void *mock_domain_hw_info(struct device *dev, u32 *length, u32 *type) return info; } -static struct iommu_domain *mock_domain_alloc(unsigned int iommu_domain_type) +static struct iommu_domain *mock_domain_alloc_paging(struct device *dev) { struct mock_iommu_domain *mock; - if (iommu_domain_type == IOMMU_DOMAIN_BLOCKED) - return &mock_blocking_domain; - - if (iommu_domain_type != IOMMU_DOMAIN_UNMANAGED) - return NULL; - mock = kzalloc(sizeof(*mock), GFP_KERNEL); if (!mock) return NULL; @@ -295,10 +289,11 @@ static const struct iommu_ops mock_ops = { * because it is zero. */ .default_domain = &mock_blocking_domain, + .blocked_domain = &mock_blocking_domain, .owner = THIS_MODULE, .pgsize_bitmap = MOCK_IO_PAGE_SIZE, .hw_info = mock_domain_hw_info, - .domain_alloc = mock_domain_alloc, + .domain_alloc_paging = mock_domain_alloc_paging, .capable = mock_domain_capable, .device_group = generic_device_group, .probe_device = mock_probe_device,
Move the global static blocked domain to the ops and convert the unmanaged domain to domain_alloc_paging. Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> --- drivers/iommu/iommufd/selftest.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)