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 C6B94C47074 for ; Thu, 4 Jan 2024 22:50:34 +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=EG87cXd1twAbN8NLcsjcLGOy6C85UkH8XB0k+/ahyQ4=; b=hV/IgTk4olKNuR kRK27+thEtN20p6gfuOtTE75Ke5tH4PwqktxcyfmY4/rjJQOiOYg8cQocB6r5L9bxvIe9TwEsxvWX AZfXmIqJrJwN0U3s3rX+ryP3PT58ULtSgBrp4VX/IbuoIFY+bXF4cN9Lg9yeSjXnLuSdStb2RUyTL xJZ1yrZ8IzwUYsNDeF1Bxn05BaZhHRsBV+HGv5VkqYiXFmSo7wpmu0+wJ9L57yeGKJeqP1sT2EteJ q9XOJoc5wubuEvcGzFdkLc5qofrxhPze49JZEckS5V1XB1rj3n3X75qUsIy1zc1WA06dRFTx/UKad jxN6s2mVKKHAUfAtKHwA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rLWXK-00FOGl-2h; Thu, 04 Jan 2024 22:50:02 +0000 Received: from mail-mw2nam12on2060e.outbound.protection.outlook.com ([2a01:111:f400:fe5a::60e] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rLWXG-00FOFT-32 for linux-arm-kernel@lists.infradead.org; Thu, 04 Jan 2024 22:50:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qe9xE9iV0ms1A7Ha7itEZOO4/LfjFMl64MClOYuwNtCeh+DMAix4is3gkpf+lTsGT5wK4hcBDcQQcqkFrpof+74fKJKG9q1/rMi/515E/+4vX3QnC6O1KOI5+LoAZrZcB/0/DqU+Vw4aELgURJzP5Ew9N76UvYR77L9UYLZXOwgSmMXrLV5P0ujqki91UagJEVNPGRh+ktBBCBZ7DDRguqNkZpx1nAFhOaA+QAibePOYSrLPjgre0HODmYZfkB3buEQkY1Ojswq2YRp7C4szAF9HuHlP0+/2ufQ+i6CjYEBGgAh6RwBIoK8gOXktdhfJp/swPKgxNJzlUZOn9/KqKw== 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=zgzGfKMnVXQ+/zALMtk1bZGik8OVjc0P2vo5G3jcT6A=; b=EHFXuJcbk/OpQyDKFSexevnd4pSq8co/5WxF5fzTAQm9yjKXZPuhDJw7OV40cQmvpu7HodeSDog0li0Uw8ozZxq5vEDwqW9sqJy+lbJtbaGEBELASJMQjs/5FMpgRClKVIrw+nr0/XNPivcofigjgGk0E6V4Z79SZJjgvKB/rSf4u9y9SS3XU8qXNRT4lRzrC3HYASqwWVPmQuRRNBZrpWERBi41CzrJy/EMJqhym4JtWvmQrJX7wPWMec3r4PCXKYQvcTGPRRiJjm1yDTI1bLxkkJDAlbi3G5avNfhRJEcSwwpz016VqXMz32NPgpu1vKXsMWxffsVqrR4vHX2uow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=126.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=zgzGfKMnVXQ+/zALMtk1bZGik8OVjc0P2vo5G3jcT6A=; b=bOxMmKrAStjYUcIWx8i4WzVTYEGEiToPPxAG7ygUtLWQ5O20glK8pRyNVimb7Lf6ehgu84G5RnX5f3J1BDCBJd+zB4gL7UOdM4YdSa90KQ+k0Nufh6FWtakZno4sO7iKzNYesK3UDenZyTQ7qIQaDyBSXgLR1IycugZ3jGlg732Rj3O+7KDPRU9KQnZa+9ErHaz/Iy6BQaLQ5F5O2BKmAIQKJfy+endawBSthb2GmTMDRLW34/Hyj1EV6yg/qdmDyLkCxfisJfnci6TKfhD6aRWgPWv8NKwQxYY2M3f0qKwLwgPL0RWFFrm4ACbDIaA4yU6V8LZhrOAp4a8GDdPo0g== Received: from DM6PR13CA0068.namprd13.prod.outlook.com (2603:10b6:5:134::45) by MW3PR12MB4380.namprd12.prod.outlook.com (2603:10b6:303:5a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.16; Thu, 4 Jan 2024 22:35:26 +0000 Received: from DS2PEPF0000343A.namprd02.prod.outlook.com (2603:10b6:5:134:cafe::64) by DM6PR13CA0068.outlook.office365.com (2603:10b6:5:134::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.7 via Frontend Transport; Thu, 4 Jan 2024 22:35:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DS2PEPF0000343A.mail.protection.outlook.com (10.167.18.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.9 via Frontend Transport; Thu, 4 Jan 2024 22:35:26 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 4 Jan 2024 14:35:14 -0800 Received: from rnnvmail202.nvidia.com (10.129.68.7) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 4 Jan 2024 14:35:13 -0800 Received: from Asurada-Nvidia (10.127.8.12) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41 via Frontend Transport; Thu, 4 Jan 2024 14:35:13 -0800 Date: Thu, 4 Jan 2024 14:35:12 -0800 From: Nicolin Chen To: Ben CC: , linux-arm-kernel Subject: Re: Re: Re: Re: how test the Translation Support for SMMUv3? Message-ID: References: <61332e87.404e.18caa3d6e15.Coremail.figure1802@126.com> <141aeebe.1299.18cc03d503d.Coremail.figure1802@126.com> <4bb04c20.66ed.18ccfa87b41.Coremail.figure1802@126.com> <2fa4ae48.65c6.18cd49ba689.Coremail.figure1802@126.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <2fa4ae48.65c6.18cd49ba689.Coremail.figure1802@126.com> X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF0000343A:EE_|MW3PR12MB4380:EE_ X-MS-Office365-Filtering-Correlation-Id: f3c67b9b-9e4c-4ae0-23a3-08dc0d757275 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6/YaLffnJx5ybWrLYNoXArnoEO9fo6NNU7deyrRotiysmuc4N96vMukvqt84Uk0VhGTeoQwpqUxewXYjoSa0TyNe2aUTPjDAzDJnkXj1PoD9rAZUvL5kQ0KpwvMg8nIf4IAigjkjLzUh6Be+elBvs6g9uCqq3u6OSQ4XSRs+lklVEL+v8fEbQLBbALFqKcQ5VWh7+gm5DKEJzUCfDU+O18jwJdl2whYFCil6qQW7Dj0mEIP7S1/iRGXx4sMVMTpdg/Ru53iy7hWbAeaAI55joyzjzXOF8E+GofQ09QDh5BVjD/JeTxtW8ddErSd1wchbXfdsIsBqd7shCGtrhU0m2I/vAlWqEEPsunJdcOAMJMY6x0XAUKHhir2/nfHplMpq67vEaZxEQYT0kpEbUxRzdP5f9DCUTZhVZaK3um1IneruCE1Ds6vVokR3/3j2ena1BEtVqiyU5RxmEC9GFAXVMb+Vte1rx8Sr9KWnRO4Srt97+qI8lQLlKsA3sUMuxJ5sq5D+KefDGeyuabLfdlIuiderMKVhDEzU18Wat16WvjFjEQr6w2yxojAc6wavy3Yb1VzWpfa9EEMRF5pSTfN7OcwbsiBt8x5At2ysAA9VIxr4zjA+a+0aDG9YhN78Xk01tKlUlvWoasuNo8KGhr/mhxEGHrs8ZkiXDc6pfsAOn1ncx8J13nsoo5YLjoNqn5pqBO6n1dRdkT7W1iS7NXzp4t4PLucFwYetqYzdytFzxlsNoRBUKv+lcmYWlvmm53zs X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(376002)(136003)(346002)(396003)(39860400002)(230922051799003)(64100799003)(186009)(1800799012)(82310400011)(451199024)(36840700001)(46966006)(40470700004)(336012)(36860700001)(9686003)(426003)(26005)(478600001)(54906003)(83380400001)(47076005)(2906002)(5660300002)(33716001)(41300700001)(316002)(70586007)(6916009)(8936002)(8676002)(4326008)(70206006)(82740400003)(86362001)(356005)(7636003)(55016003)(40480700001)(40460700003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2024 22:35:26.0975 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f3c67b9b-9e4c-4ae0-23a3-08dc0d757275 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS2PEPF0000343A.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4380 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240104_144959_017785_2DBFABD4 X-CRM114-Status: GOOD ( 17.91 ) 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 Thu, Jan 04, 2024 at 09:13:39PM +0800, Ben wrote: > At 2024-01-04 01:38:11, "Nicolin Chen" wrote: > >The "Unassigned class" returned by the lspci running in the > >host is likely telling you that your kernel doesn't support > >the device at all? > > The device (13b5 ff80) is a special device (SMMUv3TestEngine) implemented in FVP, > I wrote a simple PCI driver for it, just probe and call dma_alloc_coherent() API to alloc a DMA buffer. > > Here is log on Guest side: > / # insmod smmu_test.ko > [ 8251.668308] smmu_test: module verification failed: signature and/or required key missing - tainting kernel > [ 8251.671198] smmu_test 0000:00:02.0: Adding to iommu group 1 > [ 8251.672748] arm_smmu_attach_dev======== > [ 8251.673823] arm_smmu_domain_finalise_s1 ==== > [17991.095955] arm-smmu-v3 arm-smmu-v3.0.auto: arm_smmu_domain_finalise_nested ====== > [ 8251.675278] smmu_test 0000:00:02.0: enabling device (0000 -> 0002) > qemu-system-aarch64-iommufd: IOMMU_IOAS_MAP failed: Bad address > qemu-system-aarch64-iommufd: vfio_container_dma_map(0xaaaaf4b56c60, 0x8000000000, 0x40000, 0xffffbc6a4000) = -14 (Bad address) > qemu-system-aarch64-iommufd: IOMMU_IOAS_MAP failed: Bad address > qemu-system-aarch64-iommufd: vfio_container_dma_map(0xaaaaf4b56c60, 0x800004c000, 0x1000, 0xffffbf49d000) = -14 (Bad address) > [ 8251.678163] smmu_test_pci_probe === reg_phy 0x8000000000, len 0x40000 > [ 8251.679978] smmu_test_pci_probe === reg 0xffff800009300000 > [ 8251.681908] smmu_test_alloc_dma ---- iova 0xffff800008008000 dma_addr 0xfffff000 Given the dma_addr looks good to me, I think the result is a "pass"? > so in this log, some qemu error logs are observed, does it the nested SMMU work fine? 0x8000000000 stuff are the PCI bar memory space that isn't supported well yet, which shouldn't break a DMA test with 2-stage translation. > In the Guest side, is it GPA or SPA about the return address (dma_addr) of dma_alloc_coherent() API? I think so. Try the same test in the host and see if it returns a similar print, just ignoring those QEMU logs. > >Try some simpler device that's supported first. What happens > >to the 0000:05:00.0 that you passed through previously? > > 05:00.0 is a SATA device on FVP, but it is very strange that failed to assigned to VM, "device busy" reported. I changed to use SMMUv3TestEngine device. OK. Nicolin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel