public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavan Kondeti <quic_pkondeti@quicinc.com>
To: Mukesh Ojha <quic_mojha@quicinc.com>
Cc: Kees Cook <keescook@chromium.org>, Will Deacon <will@kernel.org>,
	<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
Date: Thu, 5 Oct 2023 17:14:15 +0530	[thread overview]
Message-ID: <0120ea7e-e9cc-4955-81dd-6801b56068dc@quicinc.com> (raw)
In-Reply-To: <3273977a-be7d-85f6-6754-52a3dd9b784a@quicinc.com>

On Thu, Oct 05, 2023 at 04:52:20PM +0530, Mukesh Ojha wrote:
> Sorry for the late reply, was on a long vacation.
> 
> On 9/14/2023 4:47 AM, Kees Cook wrote:
> > 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 <quic_mojha@quicinc.com>
> > > > ---
> > > >   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/
> 
> How do we reserve memory? are you suggesting to use dma api's for
> dynamic ramoops ?
> 
Sharing my thoughts:

Your patch is inspired from how kexec allocate memory for crash kernel
right? There is a series [1] which moved arch code (ARM64/x86) to
generic kexec core. Something we should also do as the feedback
received here.

Coming to how part, we still have to use memblock API to increase the chance
of allocating contiguous memory. Since PSTORE_RAM can also be
compiled as a module, we probably need another pstore layer that needs to
be built statically in kernel to allocate memory using memblock API.
once slab is available, all memblock API will re-direct to slab
allocations. This layer can be enabled via ARCH_WANTS_PSTORE_xxx or 
another config that only supports 'y'. PSTORE_RAM can still be a module but 
when this layer is available, it supports dynamic ramoops. Another option 
would be just including this layer in PSTORE RAM module but take away module 
option  when this layer is enabled.


[1]
https://lore.kernel.org/all/20211020020317.1220-6-thunder.leizhen@huawei.com/

  reply	other threads:[~2023-10-05 13:57 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-11 10:53 [REBASE PATCH v5 00/17] Add Qualcomm Minidump kernel driver related support Mukesh Ojha
2023-09-11 10:53 ` [REBASE PATCH v5 01/17] docs: qcom: Add qualcomm minidump guide Mukesh Ojha
2023-09-11 11:02   ` Krzysztof Kozlowski
2023-09-13  9:25   ` Bagas Sanjaya
2023-09-13 15:20     ` Mukesh Ojha
2023-09-11 10:53 ` [REBASE PATCH v5 02/17] soc: qcom: Add qcom_rproc_minidump module Mukesh Ojha
2023-09-11 10:53 ` [REBASE PATCH v5 03/17] remoteproc: qcom_q6v5_pas: Use qcom_rproc_minidump() Mukesh Ojha
2023-09-11 10:53 ` [REBASE PATCH v5 04/17] remoteproc: qcom: Remove minidump related data from qcom_common.c Mukesh Ojha
2023-10-06 15:08   ` Mukesh Ojha
2023-10-11 17:48     ` Mathieu Poirier
2023-09-11 10:53 ` [REBASE PATCH v5 05/17] init: export linux_banner data variable Mukesh Ojha
2023-09-11 10:53 ` [REBASE PATCH v5 06/17] soc: qcom: Add Qualcomm APSS minidump kernel driver Mukesh Ojha
2023-09-11 11:03   ` Krzysztof Kozlowski
2023-09-11 10:53 ` [REBASE PATCH v5 07/17] soc: qcom: minidump: Add pending region registration Mukesh Ojha
2023-09-11 10:53 ` [REBASE PATCH v5 08/17] arm64: mm: Add dynamic ramoops region support through command line Mukesh Ojha
2023-09-12 10:18   ` Will Deacon
2023-09-13  7:02     ` Mukesh Ojha
2023-09-13 10:25       ` Will Deacon
2023-09-13 23:17     ` Kees Cook
2023-10-05 11:22       ` Mukesh Ojha
2023-10-05 11:44         ` Pavan Kondeti [this message]
2023-10-05 15:42           ` Mukesh Ojha
2023-10-05 15:51             ` Pavan Kondeti
2023-09-11 10:53 ` [REBASE PATCH v5 09/17] pstore/ram: Use dynamic ramoops reserve resource Mukesh Ojha
2023-09-11 10:53 ` [REBASE PATCH v5 10/17] pstore: Add pstore_region_defined() helper and export it Mukesh Ojha
2023-09-13 23:24   ` Kees Cook
2023-10-09 11:59     ` Mukesh Ojha
2023-09-11 10:53 ` [REBASE PATCH v5 11/17] qcom_minidump: Register ramoops region with minidump Mukesh Ojha
2023-09-13 23:30   ` Kees Cook
2023-09-13 23:42     ` Kees Cook
2023-09-11 10:53 ` [REBASE PATCH v5 12/17] MAINTAINERS: Add entry for minidump related files Mukesh Ojha
2023-09-11 10:53 ` [REBASE PATCH v5 13/17] firmware: qcom_scm: provide a read-modify-write function Mukesh Ojha
2023-09-11 10:53 ` [REBASE PATCH v5 14/17] pinctrl: qcom: Use qcom_scm_io_update_field() Mukesh Ojha
2023-09-12  8:23   ` Linus Walleij
2023-09-11 10:53 ` [REBASE PATCH v5 15/17] firmware: scm: Modify only the download bits in TCSR register Mukesh Ojha
2023-09-11 15:07   ` Kathiravan Thirumoorthy
2023-09-12  9:09     ` Mukesh Ojha
2023-09-11 10:53 ` [REBASE PATCH v5 16/17] firmware: qcom_scm: Refactor code to support multiple download mode Mukesh Ojha
2023-09-11 10:53 ` [REBASE PATCH v5 17/17] firmware: qcom_scm: Add multiple download mode support Mukesh Ojha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0120ea7e-e9cc-4955-81dd-6801b56068dc@quicinc.com \
    --to=quic_pkondeti@quicinc.com \
    --cc=agross@kernel.org \
    --cc=alim.akhtar@samsung.com \
    --cc=andersson@kernel.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=bmasney@redhat.com \
    --cc=catalin.marinas@arm.com \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=gpiccoli@igalia.com \
    --cc=keescook@chromium.org \
    --cc=kernel@quicinc.com \
    --cc=kgene@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=matthias.bgg@gmail.com \
    --cc=nm@ti.com \
    --cc=quic_mojha@quicinc.com \
    --cc=quic_tsoni@quicinc.com \
    --cc=robh+dt@kernel.org \
    --cc=tony.luck@intel.com \
    --cc=vigneshr@ti.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox