Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3629462rdb; Wed, 13 Sep 2023 19:23:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGNoKWd4pDK6H3zjrqkWvCKvWstGql4W2tJVF8tda0nK1xL1M23Trqu0bpcYPxQeX2besqw X-Received: by 2002:a17:902:8693:b0:1c3:188c:a347 with SMTP id g19-20020a170902869300b001c3188ca347mr4076246plo.54.1694658224440; Wed, 13 Sep 2023 19:23:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694658224; cv=none; d=google.com; s=arc-20160816; b=CiGTc3b12dhMkqMN9NPis8ATGJawpZhzmQcLg1LYLu4HFntJC7gLuJ7WfEr3VBHakc 3Lon0JawjvJaH6rT65jr1raDSP50tKmLfDdwE6B5TwprjDcuqyPDJSrgpW84WSRksPfK zDE8MZl/+EaCRMtybcT70HnQOJC31m90k94uKwduMmPmsKRE/7oLiqrt0lzDa0t9X4Lx C/epQCUjTQ7GF+uty3JPMDktuhWLA/mWdp4DQEuyeqB8viYTQ1q8YsYaSn+Kvh+TANIj oZLE5InRNUMUBSEfsrDVtqAx4VrM2ktz59cnuNEU1bQrlclFDooTymcgqoNZv824AtBW 690Q== 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=e1a1XS5FwL95wVQ3U0hOYK16YJk3gJb5vChvM9EJIak=; fh=1/ly+2G/eEDXzfcEIR7SCUDi/hZxPTnq5ztJaTODeS8=; b=OEPqtFpfCotikX96E40yie0xoe1vHJ/9C6JB0lAT26x7hWVuYa7EeuDCGZ9Z3TBMH0 KJEqWzCavfCifrUi/mglZXOLh391X8lPTIjZjiylhpOHOnSIukEQlTSyKwUoiu7Eza2T oMC7oz0kC/fgcUrFnb1kLF08wklDRQqaskqEfW9U14BospSnstrh5zU5/S7eLNUY0M+M iNMMg4+VtvVGWcF9CGaaUL0pghPdoqYpmxyVWwNCv1Odxm69nMTeElmDqDUqOd6XkGGe yk96F5npsuEZmqaw+vcGJhkLqlgf0D6SvGFkoGiENeCo6baOHYF+Om0bL35mv0D+96ur soiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NovGamzA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id h14-20020a170902680e00b001bc92dc57bbsi590427plk.633.2023.09.13.19.23.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 19:23:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NovGamzA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 90D888050FAF; Wed, 13 Sep 2023 16:17:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233098AbjIMXRg (ORCPT + 99 others); Wed, 13 Sep 2023 19:17:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233118AbjIMXRf (ORCPT ); Wed, 13 Sep 2023 19:17:35 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70C2F1BD1 for ; Wed, 13 Sep 2023 16:17:31 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-573ccec985dso249854a12.2 for ; Wed, 13 Sep 2023 16:17:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1694647050; x=1695251850; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=e1a1XS5FwL95wVQ3U0hOYK16YJk3gJb5vChvM9EJIak=; b=NovGamzA9VvBNl1NvPwObRG4Yw8PVqhR4W2GbES9EwqPPd8vZ4mFtfrvBaSYXGLaA4 MAz6DE7lN9SXDmizvtRaBovZL69KvTwI6z/vEVlwZTg/wvvDDcU6p+r1DdhMEYVF7wG0 EwreFS0fKayZ4E+M2fxYwOseRYK3+5S9+DSOA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694647050; x=1695251850; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=e1a1XS5FwL95wVQ3U0hOYK16YJk3gJb5vChvM9EJIak=; b=Uj536mDx2XZQ7BiPfQUqMwrlUxFL+nVAhOAxKObggSfypdQlqk+Wcs4EoFxlvO/h9g i7sBlh/ix0J4/OAe3sw+Oyfn25IqLzwnfYV2eB29zKSTDj0VQTSC59TxeHIIwftNsUqR h3AZzeFqR45N+IgLzgNdMzS9yYBITHPnawFMVJpIkzGPsaj7Csy/RPv3FaqC3F/+YoKo sYpEqa0rYPIy8ileDRlyVcDzgFj4Mr4e4ZanwiuxCcpzK9oLthU0Qilo6c6kH7yAM+uu 3oaU1dLYfNmLRLCwhrbhQgAyLFEdibrtMETtpZKGgRBtuUILhuclA3Zy9e/Ae1OVhwrV AAEA== X-Gm-Message-State: AOJu0YyODyy3l00aJzdajP1tdRPtagKcK7hy1mjBggiEPZA3doqJPYSF ifmszFXl/Lkl1rkt0qnVzHIcsg== X-Received: by 2002:a17:90a:a008:b0:26b:24ed:e0d9 with SMTP id q8-20020a17090aa00800b0026b24ede0d9mr3570072pjp.33.1694647050628; Wed, 13 Sep 2023 16:17:30 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id e15-20020a17090a684f00b0026b4d215627sm128652pjm.21.2023.09.13.16.17.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 16:17:30 -0700 (PDT) Date: Wed, 13 Sep 2023 16:17:29 -0700 From: Kees Cook To: Will Deacon Cc: Mukesh Ojha , corbet@lwn.net, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, tony.luck@intel.com, gpiccoli@igalia.com, mathieu.poirier@linaro.org, catalin.marinas@arm.com, linus.walleij@linaro.org, andy.shevchenko@gmail.com, vigneshr@ti.com, nm@ti.com, matthias.bgg@gmail.com, kgene@kernel.org, alim.akhtar@samsung.com, bmasney@redhat.com, quic_tsoni@quicinc.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-hardening@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@quicinc.com Subject: Re: [REBASE PATCH v5 08/17] arm64: mm: Add dynamic ramoops region support through command line Message-ID: <202309131613.C0E12D0D14@keescook> References: <1694429639-21484-1-git-send-email-quic_mojha@quicinc.com> <1694429639-21484-9-git-send-email-quic_mojha@quicinc.com> <20230912101820.GA10884@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230912101820.GA10884@willie-the-truck> 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 (agentk.vger.email [0.0.0.0]); Wed, 13 Sep 2023 16:17:44 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email On Tue, Sep 12, 2023 at 11:18:20AM +0100, Will Deacon wrote: > On Mon, Sep 11, 2023 at 04:23:50PM +0530, Mukesh Ojha wrote: > > The reserved memory region for ramoops is assumed to be at a fixed > > and known location when read from the devicetree. This may not be > > required for something like Qualcomm's minidump which is interested > > in knowing addresses of ramoops region but it does not put hard > > requirement of address being fixed as most of it's SoC does not > > support warm reset and does not use pstorefs at all instead it has > > firmware way of collecting ramoops region if it gets to know the > > address and register it with apss minidump table which is sitting > > in shared memory region in DDR and firmware will have access to > > these table during reset and collects it on crash of SoC. > > > > So, add the support of reserving ramoops region to be dynamically > > allocated early during boot if it is request through command line > > via 'dyn_ramoops_size=' and fill up reserved resource structure and > > export the structure, so that it can be read by ramoops driver. > > > > Signed-off-by: Mukesh Ojha > > --- > > arch/arm64/mm/init.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++ > > Why does this need to be in the arch code? There's absolutely nothing > arm64-specific here. I would agree: this needs to be in ramoops itself, IMO. It should be a ramoops module argument, too. It being unhelpful for systems that don't have an external consumer is certainly true, but I think it would still make more sense for this change to live entirely within ramoops. Specifically: you're implementing a pstore backend behavioral change. In the same way that patch 10 is putting the "output" side of this into pstore/, I'd expect the "input" side also in pstore/ More comments there, though. -- Kees Cook