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=-5.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 082F3C433E0 for ; Wed, 24 Feb 2021 16:55:30 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 9A04464F04 for ; Wed, 24 Feb 2021 16:55:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A04464F04 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.microsoft.com 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=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ZimyWewih98UNhd/NRdY1ZqR75UWQMeBLQmFPJM4N2I=; b=QCe5mU8LKa54Y7HHMdqPx+5Wv 3n2q3d7W80vvPb1/2AaRiZnUtlLc/y7oAT9HAkFq2d3KSP5bnm4LKMfoAeQERyPsAK23D+yz8jyWG ssi14W09uD3GtDwmipv/6CGp9d7CI1HyqsyagHoihUDdae1ebPp9Vp7loOKTs7be4G/9VOiCtS/vj WmUkLWU1dCgkytYT14cCurL5CVmg8N68z9w61xqsQofhv0kzv476uDj8T+SYhdqnPfETs1GxomfkZ Z/fgcEhheZfExtfuJt117KnDp34HXx867nkLeBTD/SenQ+fwLq3CVGuI1CiaUOPmwVkz/P0FvBH9H 8MrwnPJ3w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lExQ1-0006f1-2D; Wed, 24 Feb 2021 16:53:45 +0000 Received: from linux.microsoft.com ([13.77.154.182]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lExPy-0006eB-KG for linux-arm-kernel@lists.infradead.org; Wed, 24 Feb 2021 16:53:43 +0000 Received: from [192.168.0.114] (unknown [49.207.206.154]) by linux.microsoft.com (Postfix) with ESMTPSA id 70D7320B6C40; Wed, 24 Feb 2021 08:53:37 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 70D7320B6C40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1614185620; bh=8YbxFx9Hocxmd6u3Eq78VVDiouONns5HyeEedD7A2HU=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=kMq11BtNKsvhQGtuYMUpR5yK7YNhjYofyHUhgYloHkmWl9wsOQwWELn1DMa8gwW+I /iNsyGAc2l5/wXLxAktg6W8KzgRlF9fmcW4M1Z9w4+4DaJ6Ru/FPHQ8xhViFGVyfGK sE5dixBwUAGcZsOCGIB4dJhxkhwWxg351zSRxG74= Subject: Re: [PATCH 1/2] optee: fix tee out of memory failure seen during kexec reboot To: Jens Wiklander References: <20210217092714.121297-2-allen.lkml@gmail.com> <20210217092714.121297-2-allen.lkml@gmail.com> <8d87655f-27c6-6a66-6eb0-9244279fbf2c@linux.microsoft.com> <20210223081948.GA1836717@jade> <20210224081553.GB2653493@jade> From: Allen Pais Message-ID: <9f4b44c1-cf86-a061-a9c6-726c4e23f99b@linux.microsoft.com> Date: Wed, 24 Feb 2021 22:23:34 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210224081553.GB2653493@jade> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210224_115342_771794_A696EE45 X-CRM114-Status: GOOD ( 17.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: zajec5@gmail.com, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, op-tee@lists.trustedfirmware.org, bcm-kernel-feedback-list@broadcom.com, Dhananjay Phadke , allen.lkml@gmail.com, linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org >>>>>> - /* >>>>>> - * Ask OP-TEE to free all cached shared memory objects to decrease >>>>>> - * reference counters and also avoid wild pointers in secure world >>>>>> - * into the old shared memory range. >>>>>> - */ >>>>>> - optee_disable_shm_cache(optee); >>>>>> + if (shutdown) { >>>>>> + optee_disable_shm_cache(optee); >>>>>> + } else { >>>>>> + /* >>>>>> + * Ask OP-TEE to free all cached shared memory >>>>>> + * objects to decrease reference counters and >>>>>> + * also avoid wild pointers in secure world >>>>>> + * into the old shared memory range. >>>>>> + */ >>>>>> + optee_disable_shm_cache(optee); >>>>> Calling optee_disable_shm_cache() in both if and else. It could be >>>>> put in front of if(). >>>>> >>>> >>>> Ideally, I could just use optee_remove for shutdown() too. >>>> But it would not look good. Hence this approach. >>> >>> What is the problem with using optee_remove() for shutdown()? >>> >> >> There is no problem, I just thought it would be more cleaner/readable >> with this approach. If you'd like to keep it simple by just calling >> optee_remove() for shutdown() too, I could quickly send out V2. > > In the patch you posted it looks like you'd like to call > only optee_disable_shm_cache() in the case of shutdown. Like: > > static void optee_shutdown(struct platform_device *pdev) > { > optee_disable_shm_cache(platform_get_drvdata(pdev)); > } > > and optee_remove() kept as it was before this patch. > Sure, Will have it fixed and send out V2. Thanks. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel