Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4302743pxu; Tue, 1 Dec 2020 01:19:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJwF0eaHMmnhL6JC/ZTJbiIWhfOcd3V9h9Lim1SFTfFoUeTASw8dSspWkvXOg1/iPfqdCf8B X-Received: by 2002:aa7:d516:: with SMTP id y22mr2034871edq.159.1606814391597; Tue, 01 Dec 2020 01:19:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606814391; cv=none; d=google.com; s=arc-20160816; b=ZSCXD8HwbzBF6Tk4Jv0aBPJt8SJtTOCUFYsl7w0MgOB41xSAII6uWO3igVhsC8ewMc JNbKHvqmdDOZZFqGQW8Gk8oejuMmfuhm2rNRCjoKTfcmJXVGuv03yj1l0hXwOCf5H+n1 ZO+3Q3hyAuPCHnUQfv/s2F90PmWnJlq9VPZIPaNMwEDafi2N2wny2/lU+WzW9YRsmLo6 UnAH3T9rTAdiKOChAoqY6y9FOuODprROgYUsYOgtRnxuGywA5k9x1jRozb8GjvBCXkvC QEyb89PAtVW7d+MiQ3NEaeHt/LM7gN8wXfEDVNX8Jl2MVSHNGoL0hv45sGddTzfdtaMW QM+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=J/R34t/dDsmAnRGfZpOXJMPm4p3PRhFI9mAEwoBZQgE=; b=Xn7OskwwTRyDTeS6dcod4TxyIW/hNDgxd0uUTieRhoQEeW8nWQpvTiFpSVYDhi6sdr 0VAZLAdn8tAx9JRcekFqNOyutOfcx7S1ITvcEbLYO/rwpX2yjFoHl1p1rG6l8arfdyfr E1t9xMRd+mLTKwpIsiR9746+6M6QvQVJ58bV/ZlK3QdZyOYgmJBlS46KDRAG1C/9nN9S KtDIzerkYvN6WD5dhdT1DQgaaI+LyygB3jNkMrCJ/MEGqv64iO4yKWWzMmj7n3RVFnon GVKDsflqhllYFUawHVzcmFTYCRGT5A1C5xtPWSzTdASpNLRu4grM8BQ4HpQNeCgmKpXl Z21w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rtFbauNU; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 63si742346edn.339.2020.12.01.01.19.29; Tue, 01 Dec 2020 01:19:51 -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=@linuxfoundation.org header.s=korg header.b=rtFbauNU; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390238AbgLAJQY (ORCPT + 99 others); Tue, 1 Dec 2020 04:16:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:53576 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390349AbgLAJOq (ORCPT ); Tue, 1 Dec 2020 04:14:46 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 36EC520809; Tue, 1 Dec 2020 09:14:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606814045; bh=I7zec5XKVFOpAujn43qhFeJhbJU70mbj3jifrQPgHy4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rtFbauNUDL1wS7jLq/jYxvya+mgrJ0sOxMAWwdh9pmw47w56A52x53Jn3PQZVGp4R q55jc+X5mDIExo59JoAdfjbnrcA4YG03xZnqOUq7EsqDTFv+MNTmYw26+2fZFSj/R9 U1SVzzjbbor8YxX/NyKTugSEWqEdYVkBFMxwvUms= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rui Miguel Silva , Jens Wiklander , Sasha Levin Subject: [PATCH 5.9 117/152] optee: add writeback to valid memory type Date: Tue, 1 Dec 2020 09:53:52 +0100 Message-Id: <20201201084727.137553773@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084711.707195422@linuxfoundation.org> References: <20201201084711.707195422@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rui Miguel Silva [ Upstream commit 853735e404244f5496cdb6188c5ed9a0f9627ee6 ] Only in smp systems the cache policy is setup as write alloc, in single cpu systems the cache policy is set as writeback and it is normal memory, so, it should pass the is_normal_memory check in the share memory registration. Add the right condition to make it work in no smp systems. Fixes: cdbcf83d29c1 ("tee: optee: check type of registered shared memory") Signed-off-by: Rui Miguel Silva Signed-off-by: Jens Wiklander Signed-off-by: Sasha Levin --- drivers/tee/optee/call.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/tee/optee/call.c b/drivers/tee/optee/call.c index 20b6fd7383c54..c981757ba0d40 100644 --- a/drivers/tee/optee/call.c +++ b/drivers/tee/optee/call.c @@ -534,7 +534,8 @@ void optee_free_pages_list(void *list, size_t num_entries) static bool is_normal_memory(pgprot_t p) { #if defined(CONFIG_ARM) - return (pgprot_val(p) & L_PTE_MT_MASK) == L_PTE_MT_WRITEALLOC; + return (((pgprot_val(p) & L_PTE_MT_MASK) == L_PTE_MT_WRITEALLOC) || + ((pgprot_val(p) & L_PTE_MT_MASK) == L_PTE_MT_WRITEBACK)); #elif defined(CONFIG_ARM64) return (pgprot_val(p) & PTE_ATTRINDX_MASK) == PTE_ATTRINDX(MT_NORMAL); #else -- 2.27.0