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.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,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 B7937C433E0 for ; Tue, 23 Feb 2021 12:46:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83D1764E60 for ; Tue, 23 Feb 2021 12:46:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232387AbhBWMqa (ORCPT ); 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: kvm@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