From patchwork Tue Dec 1 08:53:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 335117 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp5496634ilb; Tue, 1 Dec 2020 01:18:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxMU1O+9jCsX2OGpaoOkT4KNeUC8B0s61q3K5d1Db5OICwiRRFRKV7PBTRIH4wTmfaQ9yrj X-Received: by 2002:a17:906:17d1:: with SMTP id u17mr2089388eje.229.1606814295056; Tue, 01 Dec 2020 01:18:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606814295; cv=none; d=google.com; s=arc-20160816; b=VJaBjl7+0t4Mmqsqt7eOOzWMb+Q86BFyvE9ndTBGUxC+2teMm6l8O/eA5iCxrCld9g U4Qr1jeLFr9iy2D9KI393D4n0n6PlnDvks/CkQq+O5EbLC6YLVHHkNJBNeJ5LRzckheu fkHLcsjF0KoAnT/jmYbuF05qUMVfoFLAlK0n7/+lkC8Wet1DbgyuXggsBzHio4TWd74C CtLu9mkdsMBFR0U08z6Lyaam7CphN8q1TMctb7e54RuHBySxg/we1uWUHL/0xFIFtF76 VcULOV2RWEnBlFfJEJ31UAcP+Zf8qF7954UWlOKL4rYaoGYcIK+P4ANMEPkBOhOgnkQT 40kA== 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=mXrgRtFoD/zPEkFu8+3Gp8TJEQ/1pmW/TEybuD6oEsmltmJjnmqGHgiQXnbvskbGIz z75mKeS9WPDz0EDHnxQeeO3v6Yr1yehhKJlk8rbylXzHm6q7ckCVyqkHcl3is5VfZp8G 93wzzAntBpiUH4rYGW8ccM1ql3pNDMPtMTYqzFT7//NUKFcR7kHXNuy/StG4zK/1jXD2 DdonQ+BBLJUnu3DOFCx8Ey0i4Au7MBdlTTb7ClfxNgcNMhxlIsgnEiFMJOfOJQI06CvJ TOYx4gDwJiho+wj9ABey/IHcUJdo7BM0Hj5lJS74zK/eVe9mDgdqe29PIgZoOb1l1ox0 trVQ== 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 stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 d7si557857ejk.78.2020.12.01.01.18.14; Tue, 01 Dec 2020 01:18:15 -0800 (PST) Received-SPF: pass (google.com: domain of stable-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 stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S2389669AbgLAJQT (ORCPT + 14 others); Tue, 1 Dec 2020 04:16:19 -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 Precedence: bulk List-ID: X-Mailing-List: stable@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(-) -- 2.27.0 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