Received: by 10.223.164.202 with SMTP id h10csp189905wrb; Mon, 13 Nov 2017 05:01:55 -0800 (PST) X-Google-Smtp-Source: AGs4zMbCcRga0KSI/HQ3fQz1PEd6P+xCm0w6YC8wo3eihV/kXtRes4w4WX21Pwlu+mavHSqVfoJq X-Received: by 10.101.71.132 with SMTP id e4mr8465263pgs.206.1510578115129; Mon, 13 Nov 2017 05:01:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510578115; cv=none; d=google.com; s=arc-20160816; b=eRuNWsXInOtevhpPo/eS2ok433tuRcf2qSRCsjO11RPznZ6FpY63tGYerp0usSLb80 84XL3BSr71nseGy6xE0xti7XGQpbxENt6psz8tcSeSufdXz8bEpb2b5OA589ESiO4yjy sjEsaN1jP6QNfXxv0hJ+QXVjR1mRwJg8070FSeKRCKoiWic07Kkz5aGDCWzlNK4HwUel XpHjrQPoxR1/iL1LqEk0d1lBWvr07QLL3ExgzN+A3HXFd9nH5lwrNZlijSa2vPQ0qz2u B+0X1ebjHTAcQPqi1bwHupZAL14jP3cQd5jNzMGMZ/SLcw+UEC0mwixrDZzffiOxmPOB DUog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=K9DTE51MLZsnxKCXdIP0uuHNspd3yYYBz2slsWapaQY=; b=W8wBIf9/u9q/ic1C2sxoryQe6LwwnZT1ED6kEhd2n7i8LseMcI59kE29Ou3X1LntBe dS21xUq4ElBwAcg01j0uCwyAlgPcMgCiicw0nHEA9DRDnty8EO27oFuoYVMdue0HnlR0 lAFaA8vONW5VC8ipx8wYhU2ZXVBc5o6gY/7Auz5YK00wOMgYviNzMWQ6sN/g6YiohaNj DkMMgM2yIUaY+4ptOMgRoLto9L06XZXvlKszVh764ozs/j8QwBBAeuvVxPpJqIpa2cEz MXyp4oILc7j8+wI3cPdqjcmU2xBaaPBjsbbNxHs3/vbuW//rBVmqh7jfQSXD+faKQ3pb 1TMg== 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 k7si1050262pls.500.2017.11.13.05.01.42; Mon, 13 Nov 2017 05:01:55 -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 S1754497AbdKMNAp (ORCPT + 95 others); Mon, 13 Nov 2017 08:00:45 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:50034 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754473AbdKMNAm (ORCPT ); Mon, 13 Nov 2017 08:00:42 -0500 Received: from localhost (LFbn-1-12253-150.w90-92.abo.wanadoo.fr [90.92.67.150]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id EA8B2AA5; Mon, 13 Nov 2017 13:00:41 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nate Watterson , Will Deacon , Sasha Levin Subject: [PATCH 4.9 13/87] iommu/arm-smmu-v3: Clear prior settings when updating STEs Date: Mon, 13 Nov 2017 13:55:30 +0100 Message-Id: <20171113125616.452473993@linuxfoundation.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171113125615.304035578@linuxfoundation.org> References: <20171113125615.304035578@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nate Watterson [ Upstream commit 810871c57011eb3e89e6768932757f169d666cd2 ] To prevent corruption of the stage-1 context pointer field when updating STEs, rebuild the entire containing dword instead of clearing individual fields. Signed-off-by: Nate Watterson Signed-off-by: Will Deacon Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/iommu/arm-smmu-v3.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -1040,13 +1040,8 @@ static void arm_smmu_write_strtab_ent(st } } - /* Nuke the existing Config, as we're going to rewrite it */ - val &= ~(STRTAB_STE_0_CFG_MASK << STRTAB_STE_0_CFG_SHIFT); - - if (ste->valid) - val |= STRTAB_STE_0_V; - else - val &= ~STRTAB_STE_0_V; + /* Nuke the existing STE_0 value, as we're going to rewrite it */ + val = ste->valid ? STRTAB_STE_0_V : 0; if (ste->bypass) { val |= disable_bypass ? STRTAB_STE_0_CFG_ABORT @@ -1081,7 +1076,6 @@ static void arm_smmu_write_strtab_ent(st val |= (ste->s1_cfg->cdptr_dma & STRTAB_STE_0_S1CTXPTR_MASK << STRTAB_STE_0_S1CTXPTR_SHIFT) | STRTAB_STE_0_CFG_S1_TRANS; - } if (ste->s2_cfg) { From 1583990570604382568@xxx Mon Nov 13 22:12:04 +0000 2017 X-GM-THRID: 1583990570604382568 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread