Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3425551pxj; Tue, 15 Jun 2021 00:11:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxo1wkYE5htwiTO5IWJRAy3OXD6tIiZ3RVRU+oWiGVaSi1DNm1drV1Fra1CtDn5dHY8Loul X-Received: by 2002:a05:6e02:1e06:: with SMTP id g6mr16658904ila.192.1623741114013; Tue, 15 Jun 2021 00:11:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623741114; cv=none; d=google.com; s=arc-20160816; b=dmbcqQniZlb1aR6Uh5k10+SrB7FTdNSsMng2pi/Nb0TiQo4EbB8NBuIRgbZjZCGOIn E9C815xn6rdV3f3SWRuYcmXdX2ro5AFmJ+m0eFuxgNlkxvri3DLM11x03D3W4YKOsB6b I1ZXDCGwSS+3NTNrVUw9DGoRqALLE1gTxFwUwOrRHMqSeRzM3CqkUuwZZHWD9yL508iT p6N11OLCGUqa/ObRRveMw5ZlxNdFraSzCJH0Fdi1bCyNoesqscvNwFU5zgj4TbiKWhcA myWaWSOA/mbKDvQJjz/YV5fhvhQdPvW4CgsL5j4tsc36wy8xdV9yvX1TzgBcrjIMUWgM lc7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=CW960DyAkJbZgIulFh2SqKgZviNtgHFFzWUHYQAciss=; b=vOvDxE0z9BMkL485FTfzHY+rXO5n1z6qQbLww1XgsFBmu/aCz9+3FmCb2kvKDE+Loi RnzGKekmjhqQqfXQYUxkDp2mzIYqGXJmCjDj4c20B6pPjNPoUfCwFyj7E2dmSJge1OYF /8SlvFD60XzHkLsaWfE38Xv9atChXTbt5S+TywmmfqaKfxs1+dM4gW5TBT6YwTrLZCFI gacBnxY6i9gEu9IC0WJ6xwzPjVZ3Qsgnc49m8IVHMVsCTSh6iOGIQk4v8olzXV1xkcMw CCUbRBZz/nIseShTDzBoApWdsGuOZWvrzRaa4dNbFwqaTennTj1jiN5ThmlLyUxrR5TG sefA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TvW1XGLl; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u12si22003680ilm.99.2021.06.15.00.11.41; Tue, 15 Jun 2021 00:11:54 -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=@linaro.org header.s=google header.b=TvW1XGLl; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230187AbhFOHM0 (ORCPT + 99 others); Tue, 15 Jun 2021 03:12:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230161AbhFOHMZ (ORCPT ); Tue, 15 Jun 2021 03:12:25 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ACDEC0617AF for ; Tue, 15 Jun 2021 00:10:20 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id k5-20020a05600c1c85b02901affeec3ef8so1030122wms.0 for ; Tue, 15 Jun 2021 00:10:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CW960DyAkJbZgIulFh2SqKgZviNtgHFFzWUHYQAciss=; b=TvW1XGLl5bBBwb99rHkJePUTzdbV7rSN6B1VDY8W31TGCATQ9bjidrAgwKLLgINUpJ loo3c2/atVGTWFw8KUjTKnil0+62LwQOiRx6GX12Yoe6CAqxLoXUwrXpDJr3nZD+plII u7K5aZ/PQ40WDn/FfOp9vGBBK+ZuH9MKuYxRZ1xNucIjJ7Nmjw43CUUjOpDfDMTc12WI guwyZuKeVyMkjQkJ3Zhukwo9m7vrlX33KxpGaXfcO0OsxliXAgybh6SObPkqvMYpYe53 JgNBEMhsvli7NMaP0biXVAW4sXELZJGPOPrEst/+b/M/mP4YI+0bMGKWzX1loxr4OcYK 5n2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CW960DyAkJbZgIulFh2SqKgZviNtgHFFzWUHYQAciss=; b=DWrGB6wT1RISWuUDGN2E4XptqLUnWQ7gx6AVKy81JGMgLWH5J1CeeT72QjEGy1JsaG 8txoBhwt0AgiS2gRNtag/Nnx7z0Zu6Xy4pdPHZ4/74tAL8XTFWy1goaZaZef76lHZqPR NnWh+veemdzwPGKy4oJCJ3cTn7czoND8MuRUHUyiflh9c4gUCi2bzPgV8Cti9xE7x7Si /4vET84vJopQeTaNMb4XwwcufPcMom7JeUfssjWBw8amUocPK0qC1NnPucBCOI7u8W0x /XtpTI6qwOQ9XWmtx/QbLqXb5i14zs337d9WASWeu0Qree2UDULwxCYr1vI7H3H1SrB2 z6jw== X-Gm-Message-State: AOAM531RJ05vODL12usHWyUUMxZ0vx7Z/sRTnnZudU9ay5ZOhVQcVwqQ iQ4ejTsdrOaIWD4RDzSc1Bq2XcFzoB/kuYJ5fdyavA== X-Received: by 2002:a7b:c853:: with SMTP id c19mr3573406wml.30.1623741018772; Tue, 15 Jun 2021 00:10:18 -0700 (PDT) MIME-Version: 1.0 References: <20210614223317.999867-1-tyhicks@linux.microsoft.com> <20210614223317.999867-7-tyhicks@linux.microsoft.com> In-Reply-To: <20210614223317.999867-7-tyhicks@linux.microsoft.com> From: Jens Wiklander Date: Tue, 15 Jun 2021 09:10:08 +0200 Message-ID: Subject: Re: [PATCH v5 6/8] tee: Correct inappropriate usage of TEE_SHM_DMA_BUF flag To: Tyler Hicks Cc: Allen Pais , Sumit Garg , Peter Huewe , Jarkko Sakkinen , Jason Gunthorpe , Vikas Gupta , Thirupathaiah Annapureddy , Pavel Tatashin , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , OP-TEE TrustedFirmware , linux-integrity , bcm-kernel-feedback-list@broadcom.com, linux-mips@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 15, 2021 at 12:33 AM Tyler Hicks wrote: > > From: Sumit Garg > > Currently TEE_SHM_DMA_BUF flag has been inappropriately used to not > register shared memory allocated for private usage by underlying TEE > driver: OP-TEE in this case. So rather add a new flag as TEE_SHM_PRIV > that can be utilized by underlying TEE drivers for private allocation > and usage of shared memory. > > With this corrected, allow tee_shm_alloc_kernel_buf() to allocate a > shared memory region without the backing of dma-buf. > > Cc: stable@vger.kernel.org > Signed-off-by: Sumit Garg > Co-developed-by: Tyler Hicks > Signed-off-by: Tyler Hicks > --- > drivers/tee/optee/call.c | 2 +- > drivers/tee/optee/core.c | 3 ++- > drivers/tee/optee/rpc.c | 5 +++-- > drivers/tee/optee/shm_pool.c | 8 ++++++-- > drivers/tee/tee_shm.c | 4 ++-- > include/linux/tee_drv.h | 1 + > 6 files changed, 15 insertions(+), 8 deletions(-) Reviewed-by: Jens Wiklander