Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3148229pxb; Fri, 12 Feb 2021 10:19:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzB2yVsBQ+Qm6Nz3C7GOj9NtskJdMN5QzmRPy/ykIfFzPSurj9gMptVF6WLU3C7rVv65MAb X-Received: by 2002:a05:6402:13ca:: with SMTP id a10mr228769edx.58.1613153990804; Fri, 12 Feb 2021 10:19:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613153990; cv=none; d=google.com; s=arc-20160816; b=epGqEdscHPndT1XVQ/CFUmu/eP5y36P4uwMMZ6g93xq0IMkZgVtwG6lOZGFjLP7/p/ O4mURP9wY9f9rqtzUkmLZ8dTABH4FxY6gu7jDa6BmQjXeM1CJJO7EZcJ46pLSl1R7ZY5 GCO+sXb1nIiISRPHGNBsSYBF0JDU8/FSbdnL1z1fc7UUEhgMBpSx+awX7eVz7/0Ia7bX 5NdaV3S0+JPBOHp6Y0SodAOW0yiJGvzaNKjjfNtjFxc9n/SToRz8SgA7qaKiA8ZiGIh/ Oqunp55Xc9ltMLHOs/ed+yI1l0bteOnoGAkdn4hRuRhDjFwpUk1ZuqwgvuZBohNX+xfv 1mdw== 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=NZl7b/r+ppu+9/FrF3IJzLz0mVLNre9CvDKAjn1o6yA=; b=wHuy3ckg3BolotWJs+0t6s6hINo0RFA2xs1amZZeW5v9xQwY4IobPZGZDrgUJ4VG7T GjdVemL6gCjYfTwBWKNUyG1PIplyC3anAZZtg8Er0TuKN9a6a88xcAJx3vOWGQ/OfpIp ZxH+5srNowHd4U40aqm7UKwM/ZNgT3oKEnq/dXqjAg7vUO678WmwEtJnNPw2EjsMq3MS t4FPk0DKnRb5VxhIvrSTpBG+n+0A6ojnBi4spX5KVYq1kPZSuzVCxbblypCblJXPHxxL enlb9aaMlUXsXXu8Dn3lmijPkVb9c8lLWR4OswtNx7WxKy1z3TYUpGvMHyG/zUnMbVqc 1jWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Cw07S8FX; 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 b20si1337590edr.583.2021.02.12.10.19.27; Fri, 12 Feb 2021 10:19:50 -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=Cw07S8FX; 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 S231611AbhBLSR5 (ORCPT + 99 others); Fri, 12 Feb 2021 13:17:57 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:52157 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231401AbhBLSRy (ORCPT ); Fri, 12 Feb 2021 13:17:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613153787; 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=NZl7b/r+ppu+9/FrF3IJzLz0mVLNre9CvDKAjn1o6yA=; b=Cw07S8FXGAnpcX2hI8NlAQUR685ZSI9k49y3ct+ImHhWaIiPWoSt2FVptmKXTTXekWfbP8 bAae/7cpHmu4hD9gTWah0qmWLTFFpiQusn2wU8xY4hU8+NBMgy1KpWEyys+/rfXTYaYWXK 8WxNL0ddVtZNqO5RK3M5qmfyNk/k6Vs= 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-10-h8Vd8kzrMlCZ5LdBkFC8Dg-1; Fri, 12 Feb 2021 13:16:25 -0500 X-MC-Unique: h8Vd8kzrMlCZ5LdBkFC8Dg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6B61AAFA81; Fri, 12 Feb 2021 18:16:23 +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 4D7915C23D; Fri, 12 Feb 2021 18:16:14 +0000 (UTC) Subject: Re: [PATCH 2/2] iommu: arm-smmu-v3: Report domain nesting info reuqired for stage1 To: Vivek Gautam , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, virtualization@lists.linux-foundation.org Cc: joro@8bytes.org, will.deacon@arm.com, mst@redhat.com, robin.murphy@arm.com, jean-philippe@linaro.org, alex.williamson@redhat.com, kevin.tian@intel.com, jacob.jun.pan@linux.intel.com, yi.l.liu@intel.com, Lorenzo.Pieralisi@arm.com, shameerali.kolothum.thodi@huawei.com References: <20210212105859.8445-1-vivek.gautam@arm.com> <20210212105859.8445-3-vivek.gautam@arm.com> From: Auger Eric Message-ID: <07d43c06-9876-2595-1139-b0bc67d94a2c@redhat.com> Date: Fri, 12 Feb 2021 19:16:12 +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: <20210212105859.8445-3-vivek.gautam@arm.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.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vivek, On 2/12/21 11:58 AM, Vivek Gautam wrote: > Update nested domain information required for stage1 page table. > > Signed-off-by: Vivek Gautam > --- > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 16 ++++++++++++++-- > 1 file changed, 14 insertions(+), 2 deletions(-) > > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > index c11dd3940583..728018921fae 100644 > --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > @@ -2555,6 +2555,7 @@ static int arm_smmu_domain_nesting_info(struct arm_smmu_domain *smmu_domain, > void *data) > { > struct iommu_nesting_info *info = (struct iommu_nesting_info *)data; > + struct arm_smmu_device *smmu = smmu_domain->smmu; > unsigned int size; > > if (!info || smmu_domain->stage != ARM_SMMU_DOMAIN_NESTED) > @@ -2571,9 +2572,20 @@ static int arm_smmu_domain_nesting_info(struct arm_smmu_domain *smmu_domain, > return 0; > } > > - /* report an empty iommu_nesting_info for now */ > - memset(info, 0x0, size); > + /* Update the nesting info as required for stage1 page tables */ > + info->addr_width = smmu->ias; > + info->format = IOMMU_PASID_FORMAT_ARM_SMMU_V3; > + info->features = IOMMU_NESTING_FEAT_BIND_PGTBL | > + IOMMU_NESTING_FEAT_PAGE_RESP | IOMMU_NESTING_FEAT_PAGE_RESP definition is missing too Eric > + IOMMU_NESTING_FEAT_CACHE_INVLD; > + info->pasid_bits = smmu->ssid_bits; > + info->vendor.smmuv3.asid_bits = smmu->asid_bits; > + info->vendor.smmuv3.pgtbl_fmt = ARM_64_LPAE_S1; > + memset(&info->padding, 0x0, 12); > + memset(&info->vendor.smmuv3.padding, 0x0, 9); > + > info->argsz = size; > + > return 0; > } > >