Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2344926pxb; Tue, 23 Feb 2021 05:02:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8Im4CU6bJ8VbJgtp2SPh3AANcBb77Ve9S1L658aUD0evOnbmbIRsc/aBc2J9mKKVk09LR X-Received: by 2002:a17:906:758:: with SMTP id z24mr25108266ejb.406.1614085319883; Tue, 23 Feb 2021 05:01:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614085319; cv=none; d=google.com; s=arc-20160816; b=ONpS6ahz3VhsShkD/0PK9bHpUYNrehJ5l3X1hk3ysz2O+1d9uBGvnsAKwerW2rouRZ WetAzEk37CDlLXyiv+qf0hLcnx3w91BQHEpaeFwaP7/1/PJbvkU4JJSeJIxMMWyegvob 1y1wU389/U7md62Jkvg7wZhLjNzaHVL/gzBZd0gKKu6b6eklgn0SHNOZWuwExoF/iB+n G/LsQ1EfMuHmf5sjuCHQ4cCN42BF7Taof56RQDZ6CAHGJGVmUve9OkUPtJ/eHBZvI4vO nYi8frRLCsR4ZpQlniqeGcMx4OSSNatBIykHu83T8njqP4Kq2ZYlD1u5LYPVSh67rU0b 6Tiw== 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:dkim-signature; bh=ejww2KN9lm9jdMXwKJXUxNSbDO+xho00yxBfGY60kHQ=; b=SEiHqmLVModvtbHBDJchR+OhSN5RRZiOzoBRVRbhz3VgX5jHPbPPf6RUBpIMdy+CHi zR/lP2S35qwXNgdQXCItJinztVoZCaFSLn1/nJDfB0CxxGU1yzHKdUdkHEOJ4vKPQnZX Cy+uOz0FC9izpOMsKXCZFMzYkGMAN6s5Sak2LHdSCuhNlnLiVLI/c5N0w30NJAAMgGDC sv+mcAGuOi6JzIgNibOqr/rsu+2pDsHyGEyM4rS4+/LAEIe4qdkk9pcSH09YSf2nZMNC LjW9FO1VIA/tu4+948Zx7NK7iFV/11cjD5zwvRIjZC+6taYZ9FW2a6ORbx8qV30W7K7T cwmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=R1uPay+p; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z17si4350844eji.221.2021.02.23.05.01.35; Tue, 23 Feb 2021 05:01: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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=R1uPay+p; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232776AbhBWM7k (ORCPT + 99 others); Tue, 23 Feb 2021 07:59:40 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:29763 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232754AbhBWM7P (ORCPT ); Tue, 23 Feb 2021 07:59:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614085069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ejww2KN9lm9jdMXwKJXUxNSbDO+xho00yxBfGY60kHQ=; b=R1uPay+pJnqRhQzGQkUTktqHsBHLDCLZSXurKWg7zjOnt2lK9+HOwRv4XZkrJNi4QN6JTO ptUypPS8DPOkCVtZMW2B5kd2TCqzqVp1/UpiwkjaEA8RIgBTQv31pbBRJNiJmOQzqaosti ZbXk1QeQFngN0jKKWbboQJmWljrngXc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-406-StTCqMhkNUqtugcRrQksTQ-1; Tue, 23 Feb 2021 07:57:47 -0500 X-MC-Unique: StTCqMhkNUqtugcRrQksTQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2B85A1005501; Tue, 23 Feb 2021 12:57:44 +0000 (UTC) Received: from [10.36.114.34] (ovpn-114-34.ams2.redhat.com [10.36.114.34]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 507585D9D0; Tue, 23 Feb 2021 12:57:34 +0000 (UTC) Subject: Re: [PATCH v11 04/13] vfio/pci: Add VFIO_REGION_TYPE_NESTED region type To: Shenming Lu , eric.auger.pro@gmail.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, will@kernel.org, joro@8bytes.org, maz@kernel.org, robin.murphy@arm.com, Alex Williamson Cc: jean-philippe@linaro.org, jacob.jun.pan@linux.intel.com, nicoleotsuka@gmail.com, vivek.gautam@arm.com, yi.l.liu@intel.com, zhangfei.gao@linaro.org, wanghaibin.wang@huawei.com, Keqian Zhu , yuzenghui@huawei.com, Kunkun Jiang References: <20201116110030.32335-1-eric.auger@redhat.com> <20201116110030.32335-5-eric.auger@redhat.com> <2b5031d4-fa1a-c893-e7e4-56c68da600e4@huawei.com> <081265c6-a579-6041-5a74-99bf74cc3d5f@huawei.com> From: Auger Eric Message-ID: <022eec8e-ae33-720a-b882-d00cc95a2a27@redhat.com> Date: Tue, 23 Feb 2021 13:57:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <081265c6-a579-6041-5a74-99bf74cc3d5f@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Shenming, On 2/23/21 1:45 PM, Shenming Lu wrote: >> +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(). Thank you. That's fixed now. Best Regards Eric > > Thanks, > Shenming >