From patchwork Mon Feb 27 19:54:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 9593885 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D171060471 for ; Mon, 27 Feb 2017 20:03:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C377C28304 for ; Mon, 27 Feb 2017 20:03:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B7B5C2849E; Mon, 27 Feb 2017 20:03:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4C39928304 for ; Mon, 27 Feb 2017 20:03:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=6tgYoG8y04FRTqBnRP0xtEZnUNTTSXBER4O/7xviPsE=; b=bGJNNeQipQDd3mJbiQJ6al2rkp TJ14j1E/R3+MlBDrl7K31k1yIPOtXDya1GEK1f7n2UPkYOnXr+mudDKRV1UEXqA6yQr+U2FMW6bgZ TF/5EpD9/yP5ZetpMLE/ldRl0/04Tb47IoV/Ujv172L6dhcgK6fpJkBIeqklnbANs+v2X9PDZiqyn /1j7xXPv1tpBkdaotwaBr89vhUUHyw52qIgJryLgRwLPG6X8F0+t3VbvbZVZec9u3xupnAQOfFJlJ DAZPwoLqMCCqiMzSuoyEbv2I0t9a2em1WAmP9hZ14K+iSZj5ddvZwdEsDPa8GYQ2iNCMPMRZdQl/G yLvQqbZw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ciRWG-0004rW-Nk; Mon, 27 Feb 2017 20:03:40 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ciRRZ-0007xh-T5 for linux-arm-kernel@lists.infradead.org; Mon, 27 Feb 2017 19:58:54 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CE9B315A2; Mon, 27 Feb 2017 11:58:49 -0800 (PST) Received: from e106794-lin.cambridge.arm.com (e106794-lin.cambridge.arm.com [10.1.210.60]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 30CEA3F3E1; Mon, 27 Feb 2017 11:58:47 -0800 (PST) From: Jean-Philippe Brucker To: Subject: [RFC PATCH 16/30] iommu/arm-smmu-v3: Use shared ASID set Date: Mon, 27 Feb 2017 19:54:27 +0000 Message-Id: <20170227195441.5170-17-jean-philippe.brucker@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170227195441.5170-1-jean-philippe.brucker@arm.com> References: <20170227195441.5170-1-jean-philippe.brucker@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170227_115850_431645_1B77E7E9 X-CRM114-Status: UNSURE ( 8.72 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Shanker Donthineni , kvm@vger.kernel.org, Catalin Marinas , Joerg Roedel , Sinan Kaya , Will Deacon , iommu@lists.linux-foundation.org, Harv Abdulhamid , Alex Williamson , linux-pci@vger.kernel.org, Bjorn Helgaas , Robin Murphy , David Woodhouse , linux-arm-kernel@lists.infradead.org, Nate Watterson MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP We now have two exclusive sets of ASIDs: private and shared. SMMUv3 allows for contexts to take part in distributed TLB maintenance via the ASET bit. When this bit is 0 for a given context, TLB entries tagged with its ASID are invalidated by broadcast TLB maintenance. Set ASET=0 for task contexts. Signed-off-by: Jean-Philippe Brucker --- drivers/iommu/arm-smmu-v3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 3af47b1427a6..86d5430bd68d 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -1263,7 +1263,8 @@ static void arm_smmu_write_ctx_desc(struct arm_smmu_master_data *master, CTXDESC_CD_0_ENDI | #endif CTXDESC_CD_0_R | CTXDESC_CD_0_A | - CTXDESC_CD_0_ASET_PRIVATE | + (ssid ? CTXDESC_CD_0_ASET_SHARED : + CTXDESC_CD_0_ASET_PRIVATE) | CTXDESC_CD_0_AA64 | (u64)cfg->asid << CTXDESC_CD_0_ASID_SHIFT | CTXDESC_CD_0_V;