From patchwork Wed Mar 1 19:30:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 13156356 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 ECA57C7EE45 for ; Wed, 1 Mar 2023 19:30:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229533AbjCATal (ORCPT ); Wed, 1 Mar 2023 14:30:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229667AbjCATak (ORCPT ); Wed, 1 Mar 2023 14:30:40 -0500 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2062.outbound.protection.outlook.com [40.107.93.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAF8438EB7 for ; Wed, 1 Mar 2023 11:30:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ItOK84QX7CwAyoV2sa+Z7hd+KbC3s9e+1LgeIHlmAfok5GSY/SJbhlf2koDHkCuZ5ZjGd2grNRBWYiN7hDwejN06TM2BerhlUfteusbM3Kn4mIYXLr7DG0j3QRZXqsf49HeFPWLJqwrYTu+Fe8jsGJp2TWoazWy7pcmJMA9MhjDxrOCJpC58+We+204ns5ULd1d6OiDnuOEabVFRIyA6VsYbycz87bEtpf0XyrkZRkFNm6RZEpAQyefInHa3iwBEaHh8MP3bp7eW/Bc/kRVqYZxyKiFvbmikT2+LeChCocjuhqusi2e/7QkYLwjQ51vS2sLvMbWQywKeN1Q1XM4weQ== 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=6AB7dOaZggIQRsdIHBoUQaO85PFcCCbbJxJCyNAb/Pw=; b=YZPdBVtp9f2tlLBBSniq+pSOOzSy5dLa47XWMDKyn/1+S+3GRK/9BxvFNExDUZ2Qcn8/upUv1dCbRJks49eXFrZ1FL3X+3BNjB+5SpUciXvGqRJVbJbgkchGkiFo1tKWkvXAZ9h5JcvmcwfeHxBOHCs3cYw3v7bA9Aq9rxElLTjDU5mNcxy46h8vlqU/KA5czOcRUYH4HK9l45IOLCWkNVcWhxHbstZyWVZY6sIJpqD283akvYb981rF137CtLpAf48tPfZVXotpZOKgEFUke7ATzeCAlJVInwC2MwdrwqwAsv+W71/dIu8XQbQbPkRqv2jqf3Z61YC7btAYzlkbbw== 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=6AB7dOaZggIQRsdIHBoUQaO85PFcCCbbJxJCyNAb/Pw=; b=bk2Eies1wUFtTNlohNZ7xRGH4wTmG+lKzhvuiqrEqpwFz5UfobN7TWljzJbIdYCg6ZgAtH7tq9OkT7QXjVktKljGDLN9oD4MLiHkLZBQJ7vVpE1FiAtwPZOxs2NVmBrS4XOywPds+47/Evrix1t5yPsqcnalDMy7u54KraG0f6PxVCR9Em5X7KPZZ//nvuYvqOKt+lJpxKlpsdfPJsXUnSZMwG9doWkEY2iRbnwLPmXWAUy3VI8dXhBcB4fEzL64BcDkHSoYTJe5bkzu6KeJpM7gONLPNeXmv5VxXpuOrDklD8XaYDhBYDkk5sAD+1HMahvM+Gmlc6T3DayV7+8uNQ== 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 IA0PR12MB8086.namprd12.prod.outlook.com (2603:10b6:208:403::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.30; Wed, 1 Mar 2023 19:30:34 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::3cb3:2fce:5c8f:82ee]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::3cb3:2fce:5c8f:82ee%4]) with mapi id 15.20.6134.029; Wed, 1 Mar 2023 19:30:34 +0000 From: Jason Gunthorpe To: iommu@lists.linux.dev, Kevin Tian , linux-kselftest@vger.kernel.org, Shuah Khan Cc: Nicolin Chen , Yi Liu Subject: [PATCH v3 10/12] iommufd/selftest: Rename the remaining mock device_id's to stdev_id Date: Wed, 1 Mar 2023 15:30:27 -0400 Message-Id: <10-v3-ae9c2975a131+2e1e8-iommufd_hwpt_jgg@nvidia.com> In-Reply-To: <0-v3-ae9c2975a131+2e1e8-iommufd_hwpt_jgg@nvidia.com> References: X-ClientProxiedBy: YT4PR01CA0101.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d7::17) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|IA0PR12MB8086:EE_ X-MS-Office365-Filtering-Correlation-Id: 989d79d5-483b-479f-7b4a-08db1a8b6c22 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3pQPYgqyXk2eO2LG4G/Vz45F+ga1G2kHk/109AyARRAi7jG6GSMnhJvhcryJROKla1MKEbuiQ43pGPnJlSdORRGxuitNwXRRQ0A1VlUZUlFPqN57AmpXP6ESrykNCrG/Ks1Vy5Qv3HVnGI8mrQqfpBEGQuvBumXlMkD1p6EtIY8Tr56hPBHJ/BsinSnb3qGr5T1s9AHDNM3P8LAIOngWgdNadTCS3xTh7KXDfC5sxiBd4CSH6kGrdlmJLiU2EkIrhfOA9opbNRcYNuSfIq0Mn8oGaHvHYxq6txUwuwbKHBvDLdMB6z3PidyCd8u28CzBibXCCI3cRpuGALTWaZUuk6T6wys3udo9T1qk5cdGqkjfMgLgKH/tF89epbzjbm6tBPCZb6axW4hErrjXn5Wv7urItb2DMq9ILrvuv/sPlO+5g3T7h7mkVQAmZZ4VpB4R0yiPBloNc3q0Prc6WCXxvAQT2ls9t5aQFGxcJr0kIIkjDbkj7o0DGPHD738ATynOPsspZrKN3S5HGT9DFql38LKRjZTXlYXvHNymILRFlRJtUd4Z8Ock4oAzLtSgdIeOXMJ1BNvS7L8GIBmsFKhCWocyQYCwARcBlkZ+ukA3c3xpe1jQnHWEO0zzfjwb7uuO3MRH8unaEVG0uZmGZPxLMQ== 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:(13230025)(4636009)(396003)(376002)(346002)(366004)(39860400002)(136003)(451199018)(186003)(2906002)(6512007)(5660300002)(38100700002)(26005)(6506007)(8936002)(4326008)(6486002)(41300700001)(86362001)(2616005)(8676002)(66946007)(66556008)(66476007)(6666004)(110136005)(36756003)(54906003)(83380400001)(316002)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cbGtZI6iwAN6PjB1iXjtvAxvEgMjxpp3qYo4WX7K8Cd4lS8QbBYc1PLlgKbrRG1J/L+eAioYfud2wnsUe0CQM16N6jROcKaQnVayGonhKqKE61VR4D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/YyDEVj5HZELwMU4JMYZHCUStKRZl5+j7u3OhHB2clmh5nfCDAq+imgZbNv5cVRRxLmtcalC6f7NWe+GNxUzdxLNhBZa7gc5z7F/fjF2EIyacSIh65W9sql8VFN6H5kcBowh2SUXs+NuzRsmnGXyBpnSQ+Wrq9M2J31oKUJ695IrDIcFQ6KEkmw5mp37/IvlwPl9q2uwaVq59nTTuTNIPFrFk4WLbK8Lmngiflmb3JbB5S+Kr159hTiUva3UvIn5jVd07wYi5S93jrwlrf+dwsyqx4Vlkkea1b/oY5PSxvTEYdE+3Y/4+nOQXvtMnoOnF9fcxYOqGOgRkCdfsAfcmDiVsbAgbRskHvnR4RyxgK3LBwV8R7H57c8Wli/meYO426No5npvIkcfOwaEnQG9hwVVaYV2mnaN8bo X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 989d79d5-483b-479f-7b4a-08db1a8b6c22 X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2023 19:30:32.1594 (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: 0p7vdtUZsC3Ppubx24OWCieQfQOA+eRBK7nidbtP+v1sIsn8qwYhtYVk7slPTfcM X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8086 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org For consistency. Signed-off-by: Jason Gunthorpe Reviewed-by: Kevin Tian --- tools/testing/selftests/iommu/iommufd.c | 12 ++++---- .../selftests/iommu/iommufd_fail_nth.c | 30 +++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/tools/testing/selftests/iommu/iommufd.c b/tools/testing/selftests/iommu/iommufd.c index 6a61ec84243572..a9b232c281c02f 100644 --- a/tools/testing/selftests/iommu/iommufd.c +++ b/tools/testing/selftests/iommu/iommufd.c @@ -605,7 +605,7 @@ TEST_F(iommufd_ioas, access_pin) MOCK_FLAGS_ACCESS_CREATE_NEEDS_PIN_PAGES); for (npages = 1; npages < BUFFER_SIZE / PAGE_SIZE; npages++) { - uint32_t mock_device_id; + uint32_t mock_stdev_id; uint32_t mock_hwpt_id; access_cmd.access_pages.length = npages * PAGE_SIZE; @@ -637,14 +637,14 @@ TEST_F(iommufd_ioas, access_pin) ASSERT_EQ(0, ioctl(self->fd, _IOMMU_TEST_CMD(IOMMU_TEST_OP_ACCESS_PAGES), &access_cmd)); - test_cmd_mock_domain(self->ioas_id, &mock_device_id, + test_cmd_mock_domain(self->ioas_id, &mock_stdev_id, &mock_hwpt_id); check_map_cmd.id = mock_hwpt_id; ASSERT_EQ(0, ioctl(self->fd, _IOMMU_TEST_CMD(IOMMU_TEST_OP_MD_CHECK_MAP), &check_map_cmd)); - test_ioctl_destroy(mock_device_id); + test_ioctl_destroy(mock_stdev_id); test_ioctl_destroy(mock_hwpt_id); test_cmd_destroy_access_pages( access_cmd.id, @@ -1197,14 +1197,14 @@ TEST_F(iommufd_mock_domain, all_aligns_copy) for (; end < buf_size; end += MOCK_PAGE_SIZE) { size_t length = end - start; unsigned int old_id; - uint32_t mock_device_id; + uint32_t mock_stdev_id; __u64 iova; test_ioctl_ioas_map(buf + start, length, &iova); /* Add and destroy a domain while the area exists */ old_id = self->hwpt_ids[1]; - test_cmd_mock_domain(self->ioas_id, &mock_device_id, + test_cmd_mock_domain(self->ioas_id, &mock_stdev_id, &self->hwpt_ids[1]); check_mock_iova(buf + start, iova, length); @@ -1213,7 +1213,7 @@ TEST_F(iommufd_mock_domain, all_aligns_copy) start / PAGE_SIZE * PAGE_SIZE, 1); - test_ioctl_destroy(mock_device_id); + test_ioctl_destroy(mock_stdev_id); test_ioctl_destroy(self->hwpt_ids[1]); self->hwpt_ids[1] = old_id; diff --git a/tools/testing/selftests/iommu/iommufd_fail_nth.c b/tools/testing/selftests/iommu/iommufd_fail_nth.c index 9713111b820dd7..e7d535680721b2 100644 --- a/tools/testing/selftests/iommu/iommufd_fail_nth.c +++ b/tools/testing/selftests/iommu/iommufd_fail_nth.c @@ -297,7 +297,7 @@ TEST_FAIL_NTH(basic_fail_nth, basic) TEST_FAIL_NTH(basic_fail_nth, map_domain) { uint32_t ioas_id; - __u32 device_id; + __u32 stdev_id; __u32 hwpt_id; __u64 iova; @@ -313,7 +313,7 @@ TEST_FAIL_NTH(basic_fail_nth, map_domain) fail_nth_enable(); - if (_test_cmd_mock_domain(self->fd, ioas_id, &device_id, &hwpt_id)) + if (_test_cmd_mock_domain(self->fd, ioas_id, &stdev_id, &hwpt_id)) return -1; if (_test_ioctl_ioas_map(self->fd, ioas_id, buffer, 262144, &iova, @@ -321,12 +321,12 @@ TEST_FAIL_NTH(basic_fail_nth, map_domain) IOMMU_IOAS_MAP_READABLE)) return -1; - if (_test_ioctl_destroy(self->fd, device_id)) + if (_test_ioctl_destroy(self->fd, stdev_id)) return -1; if (_test_ioctl_destroy(self->fd, hwpt_id)) return -1; - if (_test_cmd_mock_domain(self->fd, ioas_id, &device_id, &hwpt_id)) + if (_test_cmd_mock_domain(self->fd, ioas_id, &stdev_id, &hwpt_id)) return -1; return 0; } @@ -334,8 +334,8 @@ TEST_FAIL_NTH(basic_fail_nth, map_domain) TEST_FAIL_NTH(basic_fail_nth, map_two_domains) { uint32_t ioas_id; - __u32 device_id2; - __u32 device_id; + __u32 stdev_id2; + __u32 stdev_id; __u32 hwpt_id2; __u32 hwpt_id; __u64 iova; @@ -350,12 +350,12 @@ TEST_FAIL_NTH(basic_fail_nth, map_two_domains) if (_test_ioctl_set_temp_memory_limit(self->fd, 32)) return -1; - if (_test_cmd_mock_domain(self->fd, ioas_id, &device_id, &hwpt_id)) + if (_test_cmd_mock_domain(self->fd, ioas_id, &stdev_id, &hwpt_id)) return -1; fail_nth_enable(); - if (_test_cmd_mock_domain(self->fd, ioas_id, &device_id2, &hwpt_id2)) + if (_test_cmd_mock_domain(self->fd, ioas_id, &stdev_id2, &hwpt_id2)) return -1; if (_test_ioctl_ioas_map(self->fd, ioas_id, buffer, 262144, &iova, @@ -363,19 +363,19 @@ TEST_FAIL_NTH(basic_fail_nth, map_two_domains) IOMMU_IOAS_MAP_READABLE)) return -1; - if (_test_ioctl_destroy(self->fd, device_id)) + if (_test_ioctl_destroy(self->fd, stdev_id)) return -1; if (_test_ioctl_destroy(self->fd, hwpt_id)) return -1; - if (_test_ioctl_destroy(self->fd, device_id2)) + if (_test_ioctl_destroy(self->fd, stdev_id2)) return -1; if (_test_ioctl_destroy(self->fd, hwpt_id2)) return -1; - if (_test_cmd_mock_domain(self->fd, ioas_id, &device_id, &hwpt_id)) + if (_test_cmd_mock_domain(self->fd, ioas_id, &stdev_id, &hwpt_id)) return -1; - if (_test_cmd_mock_domain(self->fd, ioas_id, &device_id2, &hwpt_id2)) + if (_test_cmd_mock_domain(self->fd, ioas_id, &stdev_id2, &hwpt_id2)) return -1; return 0; } @@ -518,7 +518,7 @@ TEST_FAIL_NTH(basic_fail_nth, access_pin_domain) { uint32_t access_pages_id; uint32_t ioas_id; - __u32 device_id; + __u32 stdev_id; __u32 hwpt_id; __u64 iova; @@ -532,7 +532,7 @@ TEST_FAIL_NTH(basic_fail_nth, access_pin_domain) if (_test_ioctl_set_temp_memory_limit(self->fd, 32)) return -1; - if (_test_cmd_mock_domain(self->fd, ioas_id, &device_id, &hwpt_id)) + if (_test_cmd_mock_domain(self->fd, ioas_id, &stdev_id, &hwpt_id)) return -1; if (_test_ioctl_ioas_map(self->fd, ioas_id, buffer, BUFFER_SIZE, &iova, @@ -570,7 +570,7 @@ TEST_FAIL_NTH(basic_fail_nth, access_pin_domain) return -1; self->access_id = 0; - if (_test_ioctl_destroy(self->fd, device_id)) + if (_test_ioctl_destroy(self->fd, stdev_id)) return -1; if (_test_ioctl_destroy(self->fd, hwpt_id)) return -1;