Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2404605pxb; Tue, 23 Feb 2021 06:24:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJxkpYl6zkOLx+Goz+uMXWRJ0xBWPd6VJNDSLcdyMMxKvHsFm4thej9KxcrX4wx1a1cz2TSF X-Received: by 2002:a17:906:f19a:: with SMTP id gs26mr6357676ejb.545.1614090299726; Tue, 23 Feb 2021 06:24:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614090299; cv=none; d=google.com; s=arc-20160816; b=g7r8KSnEYYgahioe4eego3LP9ejKHXcpDLxV5AFU7VdL5EsgVRyf1geqrQfcgP97p3 wchGcz2lh7Pg6ieCXfI5IqMc0WABFLscEgUnEDfCPmsEifdvxMxkukFf+xoHvsfbuH0o vtCTwwuDj9L3hyzSMMw5B6Dnk3aCUSLVJ366qMPYnXusOIamUR/odVSqo2KwezH0BzWL oWPFsAKnEg64O595S7cSiJ+ipLtVD52Yd1/15un/658DDCE/NjepyNokVcJPVU5U/vUa 0isH/4ySE3/NeOGomKbIVT83UMo95GY7Hl0F9AtnaY28OUP+tx4xjST9GQciSMvHgO/5 owyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=5hVBuk0l0AbwiiNhXew7Rcaj7szaGwS6+yNFipGzXpM=; b=oaEDpQNe+xst2CXvulfSF7obBWARn2MO7F57/8rdhC3rRc35UyooBLy2Xovkinf6zL vx9OCqsjbJQ22t7IsWRj2AqX4Halje9ajhNF6q1EEPYllMed4ts+No9B33ae+t65Nr+m 5vaJlqGOLzEJ/lwLaX7wzbHQ3+Guxsj0NzQrlwTt870f9h8lA+GqYeqYwPNGSscO/KAs gq3XKMPCr91c/pwUtmSdMAsz96s+e/I8F2Zz9bF11eufE7k4t7GM1CsfuUaKgEOXQlOc IjIDSfVqHvLaYVt+Si/ISb0irnCbkbQc1uXxxCwxemVtaYyY0itXHYOQIi4jvkwMcoyb Lq+A== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j11si7618827eds.371.2021.02.23.06.24.35; Tue, 23 Feb 2021 06:24:59 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232490AbhBWMqa (ORCPT + 99 others); Tue, 23 Feb 2021 07:46:30 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:12944 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232491AbhBWMqZ (ORCPT ); Tue, 23 Feb 2021 07:46:25 -0500 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4DlJf212MhzjQX2; Tue, 23 Feb 2021 20:44:26 +0800 (CST) Received: from [10.174.184.135] (10.174.184.135) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.498.0; Tue, 23 Feb 2021 20:45:37 +0800 Subject: Re: [PATCH v11 04/13] vfio/pci: Add VFIO_REGION_TYPE_NESTED region type To: Eric Auger , , , , , , , , , , Alex Williamson CC: , , , , , , , Keqian Zhu , , Kunkun Jiang References: <20201116110030.32335-1-eric.auger@redhat.com> <20201116110030.32335-5-eric.auger@redhat.com> <2b5031d4-fa1a-c893-e7e4-56c68da600e4@huawei.com> From: Shenming Lu Message-ID: <081265c6-a579-6041-5a74-99bf74cc3d5f@huawei.com> Date: Tue, 23 Feb 2021 20:45:25 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.2.2 MIME-Version: 1.0 In-Reply-To: <2b5031d4-fa1a-c893-e7e4-56c68da600e4@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.184.135] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +static int vfio_pci_dma_fault_init(struct vfio_pci_device *vdev) > +{ > + struct vfio_region_dma_fault *header; > + struct iommu_domain *domain; > + size_t size; > + bool nested; > + int ret; > + > + domain = iommu_get_domain_for_dev(&vdev->pdev->dev); > + ret = iommu_domain_get_attr(domain, DOMAIN_ATTR_NESTING, &nested); > + if (ret || !nested) > + return ret; Hi Eric, It seems that the type of nested should be int, the use of bool might trigger a panic in arm_smmu_domain_get_attr(). Thanks, Shenming