Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2119019pxa; Mon, 17 Aug 2020 00:55:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxfSXcmM4BH0d3Frk8vw/gPZKnXoazqaivaFfhQCS0MplRwxvK/m3OKLITroB00aI1CvWy X-Received: by 2002:a50:e809:: with SMTP id e9mr14020224edn.133.1597650934516; Mon, 17 Aug 2020 00:55:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597650934; cv=none; d=google.com; s=arc-20160816; b=pzgBVGdZucdbow/tsfIqz8XfTUjw0rzlnlheOFyGXHaqeVQ7Qz/7fI7w9n3Zv0bIyj FnefVwoHN8PJu2hEMeYHvY8+os2BaWj0Y3Ik6tXxNgx/lRnhewC1FKOUhJ6kWPsKtmTC YRf8Rz4QF6QFJU5mAnM/6YPLUQSNZahPd9NjlMcBTgm+wgM1/mt9ONovEvTnluKeZLw2 n4GA+x6b7vIVS+th1O92F/JXkoMnrZB91tJqd+0F7aB1YwxGBPBGo9P9np4eJJxjN0tF ZzMh5l+MR2E0YD7WnatPbAcGAb+yEqQmwTLlZ8S1Ue5V1iJZeO64Yek7FGhOdVlD4x+k NgLQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fqL167zZKAyiF08HvK4W7iarKDKTNIjqUARHV8oL/1I=; b=VkYdMQgkZIMEG79zTSN+FcXAyn4hSZ1mONVsfTfS5ONuwog38QOoqOxdjr36EW8WMs B0qP/812YN4vVdEj3J8ZuAbLuvI69c2YGhz+Jq+AQz3E3qHrYKW049vliFL/oYnuPqQs HK7hg8zMHcxhZ7Uw+wi+1NhrFKrsrAg5VAk62ui8EyDr+WNmRnmwdQg9DdBjpPIY5Fh/ I5yxfqPuMpcyZvYOPHslyUNjtMZvTY2Um2EgjhbwL/1YjFNvNPokOEnXZgvE/2B95cdB XKzrMk8lPBMqVjkXcUz4cRuIYdgPoE6kwP74VjlKbIlhdTm9ZZzcFQZqYXa3c1Pe5tP1 nstw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OhyMpbfZ; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cc13si10890063edb.14.2020.08.17.00.55.11; Mon, 17 Aug 2020 00:55:34 -0700 (PDT) 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=@kernel.org header.s=default header.b=OhyMpbfZ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726718AbgHQHvV (ORCPT + 99 others); Mon, 17 Aug 2020 03:51:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:45490 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726780AbgHQHuV (ORCPT ); Mon, 17 Aug 2020 03:50:21 -0400 Received: from mail.kernel.org (ip5f5ad5a3.dynamic.kabel-deutschland.de [95.90.213.163]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0DC632078A; Mon, 17 Aug 2020 07:50:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597650620; bh=mQ3WvTAGWgK2rmSELwujRqp54hJGC60batYeik6p+fw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OhyMpbfZ+LZu2GPSMY3c5rAeSH0dDmtRC1sj2lvdGpFh3OLP3+pwfzFJBPp2cwdbB XuvcrdLeCf09uaggkOJfj7Dby+DReR1cbVCXw6DOGVc8LC6ymx3Tm+lKQYZOxrLNWD d0z2U2LKocgwu3+aV6frqfOcAaFEvwbCb45kbJJo= Received: from mchehab by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1k7ZuM-00BfcA-6B; Mon, 17 Aug 2020 09:50:18 +0200 From: Mauro Carvalho Chehab To: Greg Kroah-Hartman Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , John Stultz , Manivannan Sadhasivam , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org Subject: [PATCH 07/16] iommu: hisi_smmu_lpae: get rid of IOMMU_SEC and IOMMU_DEVICE Date: Mon, 17 Aug 2020 09:50:06 +0200 Message-Id: X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Those prot bits aren't needed for Hikey970's GPU code, and depends on some patch not on upstream. So, get rid of them. Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/hikey9xx/hisi_smmu_lpae.c | 41 +++++++++-------------- 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/drivers/staging/hikey9xx/hisi_smmu_lpae.c b/drivers/staging/hikey9xx/hisi_smmu_lpae.c index 5fdd91a6aa8e..9dae0a3067b6 100644 --- a/drivers/staging/hikey9xx/hisi_smmu_lpae.c +++ b/drivers/staging/hikey9xx/hisi_smmu_lpae.c @@ -205,9 +205,6 @@ static int hisi_smmu_alloc_init_pte_lpae(smmu_pmd_t *ppmd, } pte_ready: - if (prot & IOMMU_SEC) - *ppmd &= (~SMMU_PMD_NS); - start = (smmu_pte_t *)smmu_pte_page_vaddr_lpae(ppmd) + smmu_pte_index(addr); pte = start; @@ -215,30 +212,24 @@ static int hisi_smmu_alloc_init_pte_lpae(smmu_pmd_t *ppmd, pteval |= SMMU_PROT_NORMAL; pteval |= SMMU_PTE_NS; } else { - if (prot & IOMMU_DEVICE) { - pteval |= SMMU_PROT_DEVICE_nGnRE; - } else { - if (prot & IOMMU_CACHE) - pteval |= SMMU_PROT_NORMAL_CACHE; - else - pteval |= SMMU_PROT_NORMAL_NC; + if (prot & IOMMU_CACHE) + pteval |= SMMU_PROT_NORMAL_CACHE; + else + pteval |= SMMU_PROT_NORMAL_NC; - if ((prot & IOMMU_READ) && (prot & IOMMU_WRITE)) - pteval |= SMMU_PAGE_READWRITE; - else if ((prot & IOMMU_READ) && !(prot & IOMMU_WRITE)) - pteval |= SMMU_PAGE_READONLY; - else - WARN_ON("you do not set read attribute!"); + if ((prot & IOMMU_READ) && (prot & IOMMU_WRITE)) + pteval |= SMMU_PAGE_READWRITE; + else if ((prot & IOMMU_READ) && !(prot & IOMMU_WRITE)) + pteval |= SMMU_PAGE_READONLY; + else + WARN_ON("you do not set read attribute!"); - if (prot & IOMMU_EXEC) { - pteval |= SMMU_PAGE_READONLY_EXEC; - pteval &= ~(SMMU_PTE_PXN | SMMU_PTE_UXN); - } + if (!(prot & IOMMU_NOEXEC)) { + pteval |= SMMU_PAGE_READONLY_EXEC; + pteval &= ~(SMMU_PTE_PXN | SMMU_PTE_UXN); } - if (prot & IOMMU_SEC) - pteval &= (~SMMU_PTE_NS); - else - pteval |= SMMU_PTE_NS; + + pteval |= SMMU_PTE_NS; } do { @@ -287,8 +278,6 @@ static int hisi_smmu_alloc_init_pmd_lpae(smmu_pgd_t *ppgd, } pmd_ready: - if (prot & IOMMU_SEC) - *ppgd &= (~SMMU_PGD_NS); start = (smmu_pmd_t *)smmu_pmd_page_vaddr_lpae(ppgd) + smmu_pmd_index(addr); ppmd = start; -- 2.26.2