From patchwork Wed Jun 9 10:23:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Wiklander X-Patchwork-Id: 12309535 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CA86C48BCD for ; Wed, 9 Jun 2021 10:29:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CE6B9601FC for ; Wed, 9 Jun 2021 10:29:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CE6B9601FC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VJfsgaMh1h+eCs7Vv51dnVL6icLJrQXJJNPm7xHJhMI=; b=aSXJXw43nErEBD SpOxfh3JtIc/X4G6FrCngGRNRrXa9ASgXR68OPH73ZwYdSnPEL+p9GRobIswS7fnVeqHXhqb0yLQc R2fky0Tk2caHACuYXo9DmJGrwr6ghs+kpxRU3w+EGqDe6pvsnxMwzkU2PrOcvmLs7brwDEIQTz4jA CJKOVtLpxkpqH+o5/IYBhyDVGqOeZro6OOFZ0jGONpdwZHAYQN53Z6zMsNot6BmzVRStDxD5MSkeT 7C9T0RiUGGOqZJE7WTC49cKb+kmRku8rAcrQ5rA5XO14fZG2Lqmoh7/t+Ir6olvJjumQo1U70Td4X Sg1dNsrdlmpfelPOtB4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqvRK-00Czqd-L2; Wed, 09 Jun 2021 10:28:03 +0000 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqvN9-00CyUW-JF for linux-arm-kernel@lists.infradead.org; Wed, 09 Jun 2021 10:23:44 +0000 Received: by mail-lj1-x232.google.com with SMTP id x14so16644213ljp.7 for ; Wed, 09 Jun 2021 03:23:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rSIr/zgD0QKUjYJIhEJ6XI1VLo+32XT0J4ID1IoyWD4=; b=fqAD6isZzOpdAF9uAsnzbY6yrKqxk+H25yKbeNb+ngubcNcT0kFOdS+WdP63PHHUxC HmbNlTSi/IukvVImU0SQ0hRYfsU7yaQJLtUvzSHrwZ0Y76HCXjKyn5yYlU2/MUumCPF9 9yi1u57wsD0zu6bpxQ8wDnxKEWL44I8LVjqcf1pBBa9ABKrCbo7Qhopx41SgKr/WdwkX gb/v8WSzmih9Gs954Py1V0YsjmVOH+nZR8Nc1tkBdN+y+JWwfsvBgCU6cWA/mBIrDt/p emaGFZFxeNq9knd/y1BAHZfbpwU+TH6k35FucKISH2vnlRbwQrIy4SpUNkrrzEFUSDo1 0L/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rSIr/zgD0QKUjYJIhEJ6XI1VLo+32XT0J4ID1IoyWD4=; b=lNkfBnTiuRbCfa14Nzh3Ix5IhLy1zBOgoJLKoD/3PLfNkMhafyAKBGqx4Y0FwbmWQq ld06tYBRVIPF6FJo2512lx126nQauOMTjaG/OzzrInsOQlZQ8eyP2EPU8SN1M7/g1uWw VxPZWHsIVGw1hHSmxP9NagLI2+RzeK6E+fS4AwVbJTrv/PWlaL8MBHxX5w2cMfd3Jhu0 PQL3nnMNgr0+ITAoqFUFn0MeDcukuKfspsnPFID6phywJh5VSqbyrPVjzh08MyNetGXm llTUow0C30HzNa7JPqvqjSQ1exX/bU6pUoh8AIEIcsYCp3hnObXphjJUlbajWL3kJZhR X9vA== X-Gm-Message-State: AOAM5308Rvpe8kIpyazMR4+KWYczqkSL+J3rQch2pzSrHbySNrEpkkGJ B7msJfnAzkC2+ZSFEddyYk9fNw== X-Google-Smtp-Source: ABdhPJxRpAglWaXtGp3R3fiw+lgOGV4wZw8PB/hRjO196/Gjs3ftPKT5ETRh0FArSEmyNuoX6BcBEg== X-Received: by 2002:a05:651c:1185:: with SMTP id w5mr21510897ljo.379.1623234221556; Wed, 09 Jun 2021 03:23:41 -0700 (PDT) Received: from jade.urgonet (h-79-136-85-3.A175.priv.bahnhof.se. [79.136.85.3]) by smtp.gmail.com with ESMTPSA id m4sm302966ljp.9.2021.06.09.03.23.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jun 2021 03:23:41 -0700 (PDT) From: Jens Wiklander To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, op-tee@lists.trustedfirmware.org Cc: Sumit Garg , Herbert Xu , Sakkinen , Sasha Levin , Thirupathaiah Annapureddy , Vikas Gupta , "David S . Miller" , Tyler Hicks , Jens Wiklander Subject: [PATCH 5/7] tpm_ftpm_tee: use tee_shm_alloc_kernel_buf() Date: Wed, 9 Jun 2021 12:23:22 +0200 Message-Id: <20210609102324.2222332-6-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210609102324.2222332-1-jens.wiklander@linaro.org> References: <20210609102324.2222332-1-jens.wiklander@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210609_032343_679456_783CA6CE X-CRM114-Status: GOOD ( 12.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Uses the new simplified tee_shm_alloc_kernel_buf() function instead of the old deprecated tee_shm_alloc() function which required specific TEE_SHM-flags. Signed-off-by: Jens Wiklander Reviewed-by: Tyler Hicks --- drivers/char/tpm/tpm_ftpm_tee.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/char/tpm/tpm_ftpm_tee.c b/drivers/char/tpm/tpm_ftpm_tee.c index 2ccdf8ac6994..6e3235565a4d 100644 --- a/drivers/char/tpm/tpm_ftpm_tee.c +++ b/drivers/char/tpm/tpm_ftpm_tee.c @@ -254,11 +254,11 @@ static int ftpm_tee_probe(struct device *dev) pvt_data->session = sess_arg.session; /* Allocate dynamic shared memory with fTPM TA */ - pvt_data->shm = tee_shm_alloc(pvt_data->ctx, - MAX_COMMAND_SIZE + MAX_RESPONSE_SIZE, - TEE_SHM_MAPPED | TEE_SHM_DMA_BUF); + pvt_data->shm = tee_shm_alloc_kernel_buf(pvt_data->ctx, + MAX_COMMAND_SIZE + + MAX_RESPONSE_SIZE); if (IS_ERR(pvt_data->shm)) { - dev_err(dev, "%s: tee_shm_alloc failed\n", __func__); + dev_err(dev, "%s: tee_shm_alloc_kernel_buf failed\n", __func__); rc = -ENOMEM; goto out_shm_alloc; }