Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2241091ybc; Wed, 13 Nov 2019 11:10:15 -0800 (PST) X-Google-Smtp-Source: APXvYqxI5xEv2iwYJ4pWY1Q6WR1nJZ2sHIX94kOtKw4ZQoQ08FNIuZ6bt1gUg3nks7/s169qn53L X-Received: by 2002:a50:8264:: with SMTP id 91mr5370146edf.69.1573672215698; Wed, 13 Nov 2019 11:10:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573672215; cv=none; d=google.com; s=arc-20160816; b=UxVqAHU9g8sOi0DOToFtCiHo6NqGHm7QtMN/voXwzFKfyKqel0gQi/OlIImXYr/Ldv WIIEV+qwVmZNOmlygzPkJ90sRz0JzWBPLEYYFOfDc3QYzST6C2DqiETrYx7zExI6fg8u AnPpEbf5zDCbTuy1NWlgj+0+ftjIQhH9s0y+kj/7CzlOK+fEP/EAjDuKqQDav5MwrViQ XWENuKlU5d1ee0RqdmcQFJCER/fQh8aX7KBJ+2p3fcIJaOpgOaQe5OaoUfnJrzr+0opV 92pmUkSPGbwhxCR4VDXIcnjF4ty3P1LohIU8RsbtTunGWrwU13CQdYxwlK23aPmSAQNd Om+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=MKpHhhBqoycdcVcruhtuzAKJzf0fc5hZX5GnzgRoulc=; b=CpiT65kBko4RUgF4KAD62oltys02d7jaSvc413Kk/7cgMd2MVSugM9/gegRklHBzyN GMpq8JekV+uDPux0ePxU/TO/c35SnzdxDcTUAKvvi0kVkcNeIYq9/K6RFZBSE/MEMYuW cXJz4DARztXDOk/hyZa2kjp6UHnTH4vINeAGbZYyXmrvGvBv8f4/QI1JFCQgnNMiVnyS nzYLeR+lgiDa2xaPy0iTe0rP6BG9I/eAYNl9zri5pofR5ReYWSO9rMPdU+07bP33Vq3z 3s000aDp6i9cy24qNrNII0zHfuzsRFRZnkNcdbCf3/knmkfsRupnJon9ySQorgFd0TC5 cBgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gv22si1836424ejb.2.2019.11.13.11.09.49; Wed, 13 Nov 2019 11:10:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728235AbfKMRFr (ORCPT + 99 others); Wed, 13 Nov 2019 12:05:47 -0500 Received: from foss.arm.com ([217.140.110.172]:55730 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726613AbfKMRFr (ORCPT ); Wed, 13 Nov 2019 12:05:47 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4333C30E; Wed, 13 Nov 2019 09:05:46 -0800 (PST) Received: from [10.1.196.37] (e121345-lin.cambridge.arm.com [10.1.196.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 353E13F534; Wed, 13 Nov 2019 09:05:45 -0800 (PST) Subject: Re: [PATCH] iommu/arm-smmu-v3: Populate VMID field for CMDQ_OP_TLBI_NH_VA To: Shameer Kolothum , will@kernel.org Cc: joro@8bytes.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, xuwei5@hisilicon.com, linuxarm@huawei.com References: <20191113161138.22336-1-shameerali.kolothum.thodi@huawei.com> From: Robin Murphy Message-ID: Date: Wed, 13 Nov 2019 17:05:40 +0000 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191113161138.22336-1-shameerali.kolothum.thodi@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/11/2019 4:11 pm, Shameer Kolothum wrote: > CMDQ_OP_TLBI_NH_VA requires VMID and this was missing since > commit 1c27df1c0a82 ("iommu/arm-smmu: Use correct address mask > for CMD_TLBI_S2_IPA"). Add it back. Whoops indeed... although we do currently issue S1 invalidations with the VMID hardcoded to 0, so nothing's actually broken as things stand. Reviewed-by: Robin Murphy > Fixes: 1c27df1c0a82 ("iommu/arm-smmu: Use correct address mask for CMD_TLBI_S2_IPA") > Signed-off-by: Shameer Kolothum > --- > This came to light while verifying the "SMMUv3 Nested Stage Setup" > series by Eric. Please find the discusiion here, > https://lore.kernel.org/patchwork/cover/1099617/ > --- > drivers/iommu/arm-smmu-v3.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c > index 8da93e730d6f..9b5274346df0 100644 > --- a/drivers/iommu/arm-smmu-v3.c > +++ b/drivers/iommu/arm-smmu-v3.c > @@ -856,6 +856,7 @@ static int arm_smmu_cmdq_build_cmd(u64 *cmd, struct arm_smmu_cmdq_ent *ent) > cmd[1] |= FIELD_PREP(CMDQ_CFGI_1_RANGE, 31); > break; > case CMDQ_OP_TLBI_NH_VA: > + cmd[0] |= FIELD_PREP(CMDQ_TLBI_0_VMID, ent->tlbi.vmid); > cmd[0] |= FIELD_PREP(CMDQ_TLBI_0_ASID, ent->tlbi.asid); > cmd[1] |= FIELD_PREP(CMDQ_TLBI_1_LEAF, ent->tlbi.leaf); > cmd[1] |= ent->tlbi.addr & CMDQ_TLBI_1_VA_MASK; >