Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2219124pxb; Tue, 23 Feb 2021 01:17:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJzeNzb6VjSZVLta9X3T81MB6r0Eb7csOCJiGP3zPMPyrLg2UvaL33HhBJ/nTuCPutZab8Nz X-Received: by 2002:a17:906:48d7:: with SMTP id d23mr23924416ejt.275.1614071829847; Tue, 23 Feb 2021 01:17:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614071829; cv=none; d=google.com; s=arc-20160816; b=IFHT1QZJ0hPXOHWT+WyMsp2vL2XCrUu5gwk3i7IcQQsS2G0K7tSmiXaF01HIlTNTBh MDFLFiRmnvClVNRsmxjyNc1CzlZeAFxlZ1uiSeB11gwVCrSQqQz23cm4TU4kHBZFzW1I gwFvZpHY/wqFN4BfB8Ox7eg3ZfGd+RULWuh4Pm2FbMvqsDXSshcxAjtJwE+WKG6EeSRm F8iXfr1uBBq2TYPO7eWk3KvsvTRpSVu9PKjL0QIxvQMki/w8GehfJkIATiZjosp7t6dZ xlpe1NGxC1DuqrFG8GuUlVToOuv7uhUyj2QDE5ow+fy0Lc7avrI8uie8wsRys72gRuiR LRdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ziKu9fCgZMMDJu51DNLFllZqOxNQ3wrYaiXyRSckVtY=; b=kDp441vnjtKZVz1KKaB+qQh5Ny+qaeXpQkCZVinTy26rL3LZQLyn3RtTJOhgeb97XM FZXeKI+YbgOPw7Gr8uAcaZ8avCzd8mKgdU+wkpxZIVuB0PG6C3KrLi+nAHBF9BK6wLdx VnNdlWILkgXiBS92UN+VBZTjdbYF27MypiyUKGVQxEzom12U+XTeqlETZmIP/6ZyitBV KS6AjgIYkGFal+z4eGZ2hhMCeej/bbGI870wvfIiknD1f7ruBtkXa3PQLfh3DdNJqV8G f4VuNfTc6KFeTf2TnZhF16/UCPF93/Xf1u8WGZnE9doIobb5n+vj4kvhu1d6QE6DHNe5 CAJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="p/MGW4fu"; 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 k24si2444734edq.177.2021.02.23.01.16.45; Tue, 23 Feb 2021 01:17:09 -0800 (PST) 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="p/MGW4fu"; 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 S232085AbhBWIUg (ORCPT + 99 others); Tue, 23 Feb 2021 03:20:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232076AbhBWIUc (ORCPT ); Tue, 23 Feb 2021 03:20:32 -0500 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3402DC061574 for ; Tue, 23 Feb 2021 00:19:52 -0800 (PST) Received: by mail-lj1-x22a.google.com with SMTP id a22so62005783ljp.10 for ; Tue, 23 Feb 2021 00:19:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ziKu9fCgZMMDJu51DNLFllZqOxNQ3wrYaiXyRSckVtY=; b=p/MGW4fux+raA1lacKYcNWVbXKqUFMqEe0TZK1tdZDrw65OmouBhYUWRNnbftp0AZ5 Z2xQeEZrpQ9wiZ7TIx/SaoVrxllrVkk7x3V9ISEnPEpAm92ZYAVQ5CyprTuHT1V3c7QS 6nx92MGt5IIOY1/tCVUk0z8+x8YwJjnSS72dWlM/2iV+v3TpjAiBrQIctSpFAeZasSjA tZXBl3P9/y8i+sLakv+sWS9V2afmWMt9OzmqjE8E3I3etPOFQOiG2SqSYyiIm/aT/BaO pdeQRVcay/Kq/i8h4WWePbUdBmnlflnKAWiqGRq6dm7u9B2oWHjhcBmK+wdjBD1mkitI o/ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ziKu9fCgZMMDJu51DNLFllZqOxNQ3wrYaiXyRSckVtY=; b=HoJRA5H3Igt44+5Fa2nL0kTkyOnOSNGyPR7UPxKgNEpZZEGZnei06Rbk1+2n9JPc3G JqLxUUuvvUU9SpsB7nlV4sjS6eJ+1kEDp+rUVzITZQkw2TWuo8N7GH0Uws3y4WYf1IE8 UM3s6ovzto58VmVfmWQP5bOlo4R0ZPSXg2F1F13+aYkYjS2Wkynko0uR5APSEQimTYUw LpuRqru6yMXF1r2GMxJBKp8AQ4sgUdwpIGy/02F28YBxMBiEbM+DKyKh5Rkk9VAFvtLW 7/hbxsh+e28SF28/b0l/n0Q1SQSOi0tu0TpjScOxKdpPMbKrzZHazR+T2u1mpueX3H8g UV/A== X-Gm-Message-State: AOAM532GPD+1x41Kuvw4dCX5lkgViTAhySUQEFlK3Bj91Na2v0lAsss5 /OolmeCrvIxJfipnM8GSf+YL0g== X-Received: by 2002:a2e:b051:: with SMTP id d17mr24922ljl.255.1614068390673; Tue, 23 Feb 2021 00:19:50 -0800 (PST) Received: from jade (h-249-223.A175.priv.bahnhof.se. [98.128.249.223]) by smtp.gmail.com with ESMTPSA id r16sm2474986lfr.223.2021.02.23.00.19.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Feb 2021 00:19:50 -0800 (PST) Date: Tue, 23 Feb 2021 09:19:48 +0100 From: Jens Wiklander To: Allen Pais Cc: Dhananjay Phadke , allen.lkml@gmail.com, zajec5@gmail.com, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, op-tee@lists.trustedfirmware.org, linux-arm-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com Subject: Re: [PATCH 1/2] optee: fix tee out of memory failure seen during kexec reboot Message-ID: <20210223081948.GA1836717@jade> References: <20210217092714.121297-2-allen.lkml@gmail.com> <20210217092714.121297-2-allen.lkml@gmail.com> <8d87655f-27c6-6a66-6eb0-9244279fbf2c@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <8d87655f-27c6-6a66-6eb0-9244279fbf2c@linux.microsoft.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 22, 2021 at 06:15:08PM +0530, Allen Pais wrote: > > > On Wed, 17 Feb 2021 14:57:12 +0530, Allen Pais wrote: > > > - /* > > > - * 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()? Cheers, Jens