From mboxrd@z Thu Jan 1 00:00:00 1970 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=-20.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS 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 15AB8C433E0 for ; Fri, 19 Mar 2021 07:01:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF3E864F69 for ; Fri, 19 Mar 2021 07:01:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234130AbhCSHAp (ORCPT ); Fri, 19 Mar 2021 03:00:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234136AbhCSHAf (ORCPT ); Fri, 19 Mar 2021 03:00:35 -0400 Received: from mail-oo1-xc2d.google.com (mail-oo1-xc2d.google.com [IPv6:2607:f8b0:4864:20::c2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 339F6C06174A for ; Fri, 19 Mar 2021 00:00:34 -0700 (PDT) Received: by mail-oo1-xc2d.google.com with SMTP id c12-20020a4ae24c0000b02901bad05f40e4so2054034oot.4 for ; Fri, 19 Mar 2021 00:00:34 -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=FPOK1V0xQBgz/LvuEDvlEdlMHvA8U+a3mNRXD1kRc/g=; b=T30jMH3NuD7ezkxsdYCLGtrzrz28ROF2x0krK025Nm5sFbRsJ4/TtMYqlhCExImOSU 42kMZFncvT6EQzsAb8Hs0GzYWDZePhDFrAOfPmltTYoGfjX4WBHEYvhq1NF9JmHxSr0t PQP4aDH23wR/wldGJDfAcLL/TFhzGnDuRNXEvlDZs1JrLQFCysPspVfutuTKOMfB+bOu NcgarfGoYXV8l62Nx6IM5CP2yv933KaZqYzmjpLel/nM+mtEMVeMB0Nha1BrFPNuTSp3 6bA+4PUorMGp2jDsIXGbV+n29KfTUgfoO2B6GAxqAPLpaFvFpIFe5yBzFHkeLPwL3KjC IaIA== 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=FPOK1V0xQBgz/LvuEDvlEdlMHvA8U+a3mNRXD1kRc/g=; b=fTKLeTrEORhyt+pHlKlWfDm1KlzwfWo7q93JWDXfdcKJ4Ecvw/bTaRqj84yQCtZGvE +JWcdIinc3pOfmqAgkrDx0zW2N/1RB3kuT1f+OkgFZKOCvjaVzvQBLs2FJwHgTerfQwJ I0WKiuudMZ/A0e0MivfafOYMqpeYDK5EDtoiiSzqB9ZUCsWDKhr4Yq0Tj4ZMjFrUjA+Z vlkuG4x/3AFcDfyzvooqADNwue+uZiZhQsUhE8WD/axN50pyAKGoKmQjFQ8jt2sMgyjb YOUrJ2qT+ur7YCipnsWsAV/dIcpgI2dqsMmwqBOT1+KNnJK/F/hBUIN02I6v/Rp89tHx r4Gg== X-Gm-Message-State: AOAM530kfhmkFMNE7dlAq/TcWtx7pOpuu3iv89RvbzRusoqpqY1digTD kixRESoPBB8M8q2PLlgq+HVGXIuZBnyx4h9WQsignOfiwrcziQ== X-Google-Smtp-Source: ABdhPJydbrEFLJm+jNyY05vJbeJ9IoVBovtjUBW5YWX3rnGdADvRawb06vnoVwHmhvPMWac2Kv0CKCMyy3xXSPYFYiE= X-Received: by 2002:a05:6820:3c8:: with SMTP id s8mr22284ooj.49.1616137233541; Fri, 19 Mar 2021 00:00:33 -0700 (PDT) MIME-Version: 1.0 References: <20210225090610.242623-1-allen.lkml@gmail.com> <20210225090610.242623-2-allen.lkml@gmail.com> <9a6c017c-d156-f939-f907-d6dfe83c41ac@linux.microsoft.com> In-Reply-To: <9a6c017c-d156-f939-f907-d6dfe83c41ac@linux.microsoft.com> From: Jens Wiklander Date: Fri, 19 Mar 2021 08:00:22 +0100 Message-ID: Subject: Re: [PATCH v2 1/2] optee: fix tee out of memory failure seen during kexec reboot To: Allen Pais Cc: Allen Pais , zajec5@gmail.com, bcm-kernel-feedback-list@broadcom.com, Linux ARM , Linux Kernel Mailing List , OP-TEE TrustedFirmware Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 16, 2021 at 2:21 PM Allen Pais wrote: > > > > >> > >> [ 0.368428] tee_bnxt_fw optee-clnt0: tee_shm_alloc failed > >> [ 0.368461] tee_bnxt_fw: probe of optee-clnt0 failed with error -22 > >> > >> tee_shm_release() is not invoked on dma shm buffer. > >> > >> Implement .shutdown() method to handle the release of the buffers > >> correctly. > >> > >> More info: > >> https://github.com/OP-TEE/optee_os/issues/3637 > >> > >> Signed-off-by: Allen Pais > >> --- > >> drivers/tee/optee/core.c | 20 ++++++++++++++++++++ > >> 1 file changed, 20 insertions(+) > > > > This looks good to me. Do you have a practical way of testing this on > > QEMU for instance? > > > > Jens, > > I could not reproduce nor create a setup using QEMU, I could only > do it on a real h/w. > > I have extensively tested the fix and I don't see any issues. I did a few test runs too, seems OK. Thanks, Jens From mboxrd@z Thu Jan 1 00:00:00 1970 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=-19.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,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 1BBECC433DB for ; Fri, 19 Mar 2021 07:05:11 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 5257D64F69 for ; Fri, 19 Mar 2021 07:05:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5257D64F69 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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PsiH7vvvX/8zcNm8hUiQsxpVFOSH8UZK5LHr7MaQ41A=; b=H6uulj0GXcGydkb6XMyCOR0yV MJYxrXyeGAMHbaLC+5nXQ2CKm5DHTUBURBHLTtWanFuHb4Dd/weJnk4LUrqqcHcl99bmURlH4FI9u EGZwUnAqGRWeGprzqe+KokNi6sqItxrAAgjaSH63pV87qVzzuURDDLAcIq+gH+GcYbGgnp/lonxum KYurIvNVOjOKM6OaSJc3tvCtXaimWpQP/MPOD34GgKJRUd7+Lm+XWGNzb5HdO4Fc8MZDYyW876sTK 7qcdJ/3GSF+uJL5wGXxELKb76t6b1JNdOiapQUQifSGhOzWKQfWiNzLShYGzDgKmi+5Aavl1vxWUY bW+kISWhw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lN9A2-006l5V-KD; Fri, 19 Mar 2021 07:03:07 +0000 Received: from mail-oo1-xc32.google.com ([2607:f8b0:4864:20::c32]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lN97b-006klj-3f for linux-arm-kernel@lists.infradead.org; Fri, 19 Mar 2021 07:00:39 +0000 Received: by mail-oo1-xc32.google.com with SMTP id j20-20020a4ad6d40000b02901b66fe8acd6so2055344oot.7 for ; Fri, 19 Mar 2021 00:00:34 -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=FPOK1V0xQBgz/LvuEDvlEdlMHvA8U+a3mNRXD1kRc/g=; b=T30jMH3NuD7ezkxsdYCLGtrzrz28ROF2x0krK025Nm5sFbRsJ4/TtMYqlhCExImOSU 42kMZFncvT6EQzsAb8Hs0GzYWDZePhDFrAOfPmltTYoGfjX4WBHEYvhq1NF9JmHxSr0t PQP4aDH23wR/wldGJDfAcLL/TFhzGnDuRNXEvlDZs1JrLQFCysPspVfutuTKOMfB+bOu NcgarfGoYXV8l62Nx6IM5CP2yv933KaZqYzmjpLel/nM+mtEMVeMB0Nha1BrFPNuTSp3 6bA+4PUorMGp2jDsIXGbV+n29KfTUgfoO2B6GAxqAPLpaFvFpIFe5yBzFHkeLPwL3KjC IaIA== 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=FPOK1V0xQBgz/LvuEDvlEdlMHvA8U+a3mNRXD1kRc/g=; b=cvH8M2hLM2gL67FZOj3kchi3sYR+R1HO6ft7ZT6cI4sJ/V/rj6Ump4waefoqKSYvce kdqv3EYkkFr34i3fodSn3O5tSF6Q7M7AE5uz1tgqSgOjqaxeArNUFuCEVHz7cx3a11CY /yGs7CjDBAhux2KA+pAbP95mFlT7ip4rmLaSPSmf0MVehT8+TvZcMyY4gjyphNq20M62 yxIvaZei/umfkPvshJB4lHCepeDTwJKKyIKreoMalgZnW+oZYrsjdFBZT261j1CaCcV4 9aM058+xGxSNdsQ9mCg4FOv7Q0VtW305Xwk18N5qjI15GR67GTj3ZvHFhQHbknudZAgU zkyQ== X-Gm-Message-State: AOAM533LXfy6DTCyuTVzvRckFFDd+YlNR4xl0XV8ymigF+kDbDvnrahV DQ9YL3MkcEfU78My5r3gjHd+nCeTifi+WiOFDJNv6Q== X-Google-Smtp-Source: ABdhPJydbrEFLJm+jNyY05vJbeJ9IoVBovtjUBW5YWX3rnGdADvRawb06vnoVwHmhvPMWac2Kv0CKCMyy3xXSPYFYiE= X-Received: by 2002:a05:6820:3c8:: with SMTP id s8mr22284ooj.49.1616137233541; Fri, 19 Mar 2021 00:00:33 -0700 (PDT) MIME-Version: 1.0 References: <20210225090610.242623-1-allen.lkml@gmail.com> <20210225090610.242623-2-allen.lkml@gmail.com> <9a6c017c-d156-f939-f907-d6dfe83c41ac@linux.microsoft.com> In-Reply-To: <9a6c017c-d156-f939-f907-d6dfe83c41ac@linux.microsoft.com> From: Jens Wiklander Date: Fri, 19 Mar 2021 08:00:22 +0100 Message-ID: Subject: Re: [PATCH v2 1/2] optee: fix tee out of memory failure seen during kexec reboot To: Allen Pais Cc: Allen Pais , zajec5@gmail.com, bcm-kernel-feedback-list@broadcom.com, Linux ARM , Linux Kernel Mailing List , OP-TEE TrustedFirmware X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210319_070036_145937_C10FFBA0 X-CRM114-Status: GOOD ( 18.67 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Mar 16, 2021 at 2:21 PM Allen Pais wrote: > > > > >> > >> [ 0.368428] tee_bnxt_fw optee-clnt0: tee_shm_alloc failed > >> [ 0.368461] tee_bnxt_fw: probe of optee-clnt0 failed with error -22 > >> > >> tee_shm_release() is not invoked on dma shm buffer. > >> > >> Implement .shutdown() method to handle the release of the buffers > >> correctly. > >> > >> More info: > >> https://github.com/OP-TEE/optee_os/issues/3637 > >> > >> Signed-off-by: Allen Pais > >> --- > >> drivers/tee/optee/core.c | 20 ++++++++++++++++++++ > >> 1 file changed, 20 insertions(+) > > > > This looks good to me. Do you have a practical way of testing this on > > QEMU for instance? > > > > Jens, > > I could not reproduce nor create a setup using QEMU, I could only > do it on a real h/w. > > I have extensively tested the fix and I don't see any issues. I did a few test runs too, seems OK. Thanks, Jens _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel