Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2477648rdb; Thu, 21 Sep 2023 22:36:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFV1MCqsLdSsyMTF4HYAuEHjH13wMN6n1kvd8iN4vE9O2QEAfJg9L8aqh5kzGJwNTJjQghS X-Received: by 2002:a92:c147:0:b0:34f:36ae:e8c3 with SMTP id b7-20020a92c147000000b0034f36aee8c3mr7739555ilh.1.1695361014322; Thu, 21 Sep 2023 22:36:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695361014; cv=pass; d=google.com; s=arc-20160816; b=auhw289ZAomSesL9N9+/t3QoABBbbk3XX9YnQroNRQDFXCWEMk81OAyAYUrPvwZfjS wz9W/v0Edi/6i+WuEGK2IsDD9vJBeZedsJ145yCgiGv7bt5j74vapYLFllehW07jPKHS 9hXpa9VNToFMhfs93IiSJ8qc94+4sw4+nkWSTpXCOqyGjeK0jdFyFq8NXa9A/LK3pYig yxf2tDQltzMkYYm49no5rKuOjb8j97QMbWvyrU0j+kjInwBJYE18sZ0OVwSAi1YSnNRZ AWmPA7dDwJkcxonTBF/xo9I8K19C/METyJVLcG/iZx76EtrqV39arRwnlHBjE1xmALJS adYQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=ER9Rl/dAAvA3/1hcaTkniApxXyi9907vmiYDjLpHhQU=; fh=bIWEojp9WmDYVt3D/7PitCi2VDOwZdrdZJ0+Xrk/ilg=; b=JYnY4eMcYV51VWsExH5vqjpyK1n2oIwQbeVIlHPg7XZjgypdW0Ua4RbF9vUlJapIWQ LNLEyYkKzkMcSwsOWfISYj6HB43xoAGPWvoI7lVfRw2vdeqC1V3e209XCJoieHysZU1l xhDX2+aqb1uQv4MZ2zT5D2xzCbc14mnTx1FQd3bEzPLTSU6f1zpJTkwlEDE2mvGgil/e qZzNZ1+vb4XqTykLZeK5vOtkd+O/mvd44zr+KrvsT5K1r6BlgqtklB+PeN7zm/Ywyn5p WZf/6HaLBF3rZtCYXuFLjI8gZjrkMXFfnjN2vdVUMq92OEh+9ZBIVpBwmSzm4DmrpUFC 6oIA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gerhold.net header.s=strato-dkim-0002 header.b=CXgfIu6P; dkim=neutral (no key) header.i=@gerhold.net; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id i186-20020a6387c3000000b00577a7c39aacsi3027095pge.275.2023.09.21.22.36.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 22:36:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gerhold.net header.s=strato-dkim-0002 header.b=CXgfIu6P; dkim=neutral (no key) header.i=@gerhold.net; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 3FE8A820E531; Thu, 21 Sep 2023 12:30:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229804AbjIUTal (ORCPT + 99 others); Thu, 21 Sep 2023 15:30:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229643AbjIUTaH (ORCPT ); Thu, 21 Sep 2023 15:30:07 -0400 Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [81.169.146.167]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97F8CAD957; Thu, 21 Sep 2023 11:04:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695319453; cv=none; d=strato.com; s=strato-dkim-0002; b=JjgtlM1qT5peRew9uUMoUtgT2/JunfOouUA4TgH7RMjRCJf/7nfKu+ru+pifhtPdFX 3ICcbIPOHtyusCdFPulR7EQv9Uct4D5zYhC+O5NVVAjCA6ChwKLTFNHqZFcLbd+qduFD KYvCbutM0E61oKWIkO/w4g9CgQr7gVZ9mGrZlhjSX3e08bcyi7SPsvTGmgd6ZL8WJoT0 evWIoc/LXkiJAxW1MXcFOJvxWaRuJU+nl/sLTb5TUscN4qAvBkFuIiXgtx7YI+Eachhg 89dDWjBzVaNu2aoQclREoqKvH5cgyXbagStXzwBQi6YA3cq1FlZO/nm33efnohEtD0hx Dp1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1695319453; s=strato-dkim-0002; d=strato.com; h=In-Reply-To:References:Message-ID:Subject:Cc:To:From:Date:Cc:Date: From:Subject:Sender; bh=ER9Rl/dAAvA3/1hcaTkniApxXyi9907vmiYDjLpHhQU=; b=cBGZvzqZz+loVgGaSlYXg2fqn0eSCgaw84UnZYLdW/+gFfhLTFdVMO7UZ29Tvfzjeu o757p9ZdUUnzGyCSJG3Una9WIW/DR/DM3GQ6SioLXRQfoe51/IG3JRp+x1tU1eDDu4yb NF2V0ebblZTFEuypYOFKWG2lo2ISBQND7yOfGyainEV9Ye09P69pbsYvpMzDXxs9q1Wl HqDJh/1k3oHN/8wE9QTqU2MtnLt1hmhcgXcVxT0DzZUIPpzQUmynYescs9+MnVjGAt+p K0eYvIWTDtAEkKP/SjOjO6Cs07ZkaL9nPlCnU/6LvbXxJICUTOFLxYQiHD9ToFNLMhki h7tw== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo01 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1695319453; s=strato-dkim-0002; d=gerhold.net; h=In-Reply-To:References:Message-ID:Subject:Cc:To:From:Date:Cc:Date: From:Subject:Sender; bh=ER9Rl/dAAvA3/1hcaTkniApxXyi9907vmiYDjLpHhQU=; b=CXgfIu6PKRYcEA5pamfwHgdUKe4UnFcMMOQBITnekEUVD6ygZXJD+H6XAPFLhfJ2zz mJwGc8kIM2mKWd/NrOg4tsxiiISxvfMAmxLCLWFnUySLHBKitw03V8ma4Mme4qfLIrZ2 CG/EOS8diWeYuvgc/4Shv+jsSY+G7cMJJYGG/hEsWWpwzfSYaIrSWk4QB0hNA5a6mE6y IiZuBc3QwoPzNuXRdN3HuiMz91l5QRz3Fpd9lwHa7cy3T3B5PcBxHKTPPZn05fknrp7a bWNjvadJJgHMX/+Auof+XBM3MBjTPO8tDqFFOuAG7GSm5V/OJq+ZuBjfXZUQwiam55Mm C4Dw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1695319453; s=strato-dkim-0003; d=gerhold.net; h=In-Reply-To:References:Message-ID:Subject:Cc:To:From:Date:Cc:Date: From:Subject:Sender; bh=ER9Rl/dAAvA3/1hcaTkniApxXyi9907vmiYDjLpHhQU=; b=EFnJfmaS9VXsw64L4JveushSUYVIw38yNjjKOoqNLYG1L38gul3cNOAwj0/AEzk+j3 WnzGDxAZQ7GmPU2qpbAQ== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVOQ/OcYgojyw4j34+u261EJF5OxJD4peA8Z+P1A==" Received: from gerhold.net by smtp.strato.de (RZmta 49.8.2 DYNA|AUTH) with ESMTPSA id R04c57z8LI4DRMY (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 21 Sep 2023 20:04:13 +0200 (CEST) Date: Thu, 21 Sep 2023 20:04:06 +0200 From: Stephan Gerhold To: Bjorn Andersson Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/3] soc: qcom: rmtfs: Support discarding guard pages Message-ID: References: <20230920-rmtfs-mem-guard-pages-v3-0-305b37219b78@quicinc.com> <20230920-rmtfs-mem-guard-pages-v3-2-305b37219b78@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230920-rmtfs-mem-guard-pages-v3-2-305b37219b78@quicinc.com> Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 21 Sep 2023 12:30:56 -0700 (PDT) On Wed, Sep 20, 2023 at 07:37:31PM -0700, Bjorn Andersson wrote: > In some configurations, the exact placement of the rmtfs shared memory > region isn't so strict. The DeviceTree author can then choose to use the > "size" property and rely on the OS for placement (in combination with > "alloc-ranges", if desired). > > But on some platforms the rmtfs memory region may not be allocated > adjacent to regions allocated by other clients. Add support for > discarding the first and last 4k block in the region, if > qcom,use-guard-pages is specified in DeviceTree. > > Signed-off-by: Bjorn Andersson > --- > drivers/soc/qcom/rmtfs_mem.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/soc/qcom/rmtfs_mem.c b/drivers/soc/qcom/rmtfs_mem.c > index f83811f51175..83bba9321e72 100644 > --- a/drivers/soc/qcom/rmtfs_mem.c > +++ b/drivers/soc/qcom/rmtfs_mem.c > @@ -200,6 +200,15 @@ static int qcom_rmtfs_mem_probe(struct platform_device *pdev) > rmtfs_mem->client_id = client_id; > rmtfs_mem->size = rmem->size; > > + /* > + * If requested, discard the first and last 4k block in order to ensure > + * that the rmtfs region isn't adjacent to other protected regions. > + */ > + if (of_property_present(node, "qcom,use-guard-pages")) { I think of_property_read_bool() would be more fitting here. Right now of_property_present() is just a wrapper around of_property_read_bool(). Semantically reading a bool fits better here though. :-) Feel free to fix that up while applying. FWIW I don't really have an opinion if "qcom,use-guard-pages" is a good way to describe this in the DT. For the implementation side feel free to add my Reviewed-by: Stephan Gerhold Thanks, Stephan > + rmtfs_mem->addr += SZ_4K; > + rmtfs_mem->size -= 2 * SZ_4K; > + } > + > device_initialize(&rmtfs_mem->dev); > rmtfs_mem->dev.parent = &pdev->dev; > rmtfs_mem->dev.groups = qcom_rmtfs_mem_groups; > > -- > 2.25.1 >