lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cacbbb02-732e-076e-50bf-292d20a4d722@quicinc.com>
Date:   Wed, 28 Jun 2023 20:31:31 +0530
From:   Mukesh Ojha <quic_mojha@...cinc.com>
To:     Rob Herring <robh+dt@...nel.org>
CC:     <corbet@....net>, <agross@...nel.org>, <andersson@...nel.org>,
        <konrad.dybcio@...aro.org>, <krzysztof.kozlowski+dt@...aro.org>,
        <conor+dt@...nel.org>, <keescook@...omium.org>,
        <tony.luck@...el.com>, <gpiccoli@...lia.com>,
        <mathieu.poirier@...aro.org>, <catalin.marinas@....com>,
        <will@...nel.org>, <linus.walleij@...aro.org>,
        <andy.shevchenko@...il.com>, <linux-doc@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>,
        <devicetree@...r.kernel.org>, <linux-hardening@...r.kernel.org>,
        <linux-remoteproc@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-gpio@...r.kernel.org>
Subject: Re: [PATCH v4 08/21] dt-bindings: reserved-memory: Add qcom,ramoops
 binding



On 6/28/2023 8:17 PM, Rob Herring wrote:
> On Wed, Jun 28, 2023 at 6:36 AM Mukesh Ojha <quic_mojha@...cinc.com> wrote:
>>
>> Qualcomm ramoops minidump logger provide a means of storing
>> the ramoops data to some dynamically reserved memory instead
>> of traditionally implemented ramoops where the region should
>> be statically fixed ram region. Its device tree binding
>> would be exactly same as ramoops device tree binding and is
>> going to contain traditional ramoops frontend data and this
>> content will be collected via Qualcomm minidump infrastructure
>> provided from the boot firmware.
> 
> The big difference is if firmware is not deciding where this log
> lives, then it doesn't need to be in DT. How does anything except the
> kernel that allocates the log find the logs?

Yes, you are correct, firmware is not deciding where the logs lives
instead here, Kernel has reserved the region where the ramoops region
lives and later with the minidump registration where, physical
address/size/virtual address(for parsing) are passed and that is how
firmware is able to know and dump those region before triggering system
reset.

A part of this registration code you can find in 11/21

> I'm pretty sure I already said all this before.

Yes, you said this before but that's the reason i came up with vendor
ramoops instead of changing traditional ramoops binding.

> 
>>
>> Signed-off-by: Mukesh Ojha <quic_mojha@...cinc.com>
>> ---
>>   .../devicetree/bindings/soc/qcom/qcom,ramoops.yaml | 126 +++++++++++++++++++++
>>   1 file changed, 126 insertions(+)
>>   create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,ramoops.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,ramoops.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom,ramoops.yaml
>> new file mode 100644
>> index 000000000000..b1fdcf3f8ad4
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,ramoops.yaml
>> @@ -0,0 +1,126 @@
>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: "http://devicetree.org/schemas/soc/qcom/qcom,ramoops.yaml#"
>> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
>> +
>> +title: Qualcomm Ramoops minidump logger
>> +
>> +description: |
>> +  Qualcomm ramoops minidump logger provide a means of storing the ramoops
>> +  data to some dynamically reserved memory instead of traditionally
>> +  implemented ramoops where the region should be statically fixed ram
>> +  region. Because of its similarity with ramoops it will also have same
>> +  set of property what ramoops have it in its schema and is going to
>> +  contain traditional ramoops frontend data and this region will be
>> +  collected via Qualcomm minidump infrastructure provided from the
>> +  boot firmware.
>> +
>> +maintainers:
>> +  - Mukesh Ojha <quic_mojha@...cinc.com>
>> +
>> +properties:
>> +  compatible:
>> +    items:
>> +      - enum:
>> +          - qcom,sm8450-ramoops
>> +      - const: qcom,ramoops
>> +
>> +  memory-region:
>> +    maxItems: 1
>> +    description: handle to memory reservation for qcom,ramoops region.
>> +
>> +  ecc-size:
>> +    $ref: /schemas/types.yaml#/definitions/uint32
>> +    description: enables ECC support and specifies ECC buffer size in bytes
>> +    default: 0 # no ECC
>> +
>> +  record-size:
>> +    $ref: /schemas/types.yaml#/definitions/uint32
>> +    description: maximum size in bytes of each kmsg dump
>> +    default: 0
>> +
>> +  console-size:
>> +    $ref: /schemas/types.yaml#/definitions/uint32
>> +    description: size in bytes of log buffer reserved for kernel messages
>> +    default: 0
>> +
>> +  ftrace-size:
>> +    $ref: /schemas/types.yaml#/definitions/uint32
>> +    description: size in bytes of log buffer reserved for function tracing and profiling
>> +    default: 0
>> +
>> +  pmsg-size:
>> +    $ref: /schemas/types.yaml#/definitions/uint32
>> +    description: size in bytes of log buffer reserved for userspace messages
>> +    default: 0
>> +
>> +  mem-type:
>> +    $ref: /schemas/types.yaml#/definitions/uint32
>> +    description: if present, sets the type of mapping is to be used to map the reserved region.
>> +    default: 0
>> +    oneOf:
>> +      - const: 0
>> +        description: write-combined
>> +      - const: 1
>> +        description: unbuffered
>> +      - const: 2
>> +        description: cached
>> +
>> +  max-reason:
>> +    $ref: /schemas/types.yaml#/definitions/uint32
>> +    default: 2 # log oopses and panics
>> +    maximum: 0x7fffffff
>> +    description: |
>> +      If present, sets maximum type of kmsg dump reasons to store.
>> +      This can be set to INT_MAX to store all kmsg dumps.
>> +      See include/linux/kmsg_dump.h KMSG_DUMP_* for other kmsg dump reason values.
>> +      Setting this to 0 (KMSG_DUMP_UNDEF), means the reason filtering will be
>> +      controlled by the printk.always_kmsg_dump boot param.
>> +      If unset, it will be 2 (KMSG_DUMP_OOPS), otherwise 5 (KMSG_DUMP_MAX).
>> +
>> +  flags:
>> +    $ref: /schemas/types.yaml#/definitions/uint32
>> +    default: 0
>> +    description: |
>> +      If present, pass ramoops behavioral flags
>> +      (see include/linux/pstore_ram.h RAMOOPS_FLAG_* for flag values).
>> +
>> +  no-dump-oops:
>> +    deprecated: true
> 
> Why would you define deprecated properties in a *new* binding?

Since, it is exact copy of ramoops binding, that's the reason of mention.

Will remove it.

-Mukesh
> 
>> +    type: boolean
>> +    description: |
>> +      Use max_reason instead. If present, and max_reason is not specified,
>> +      it is equivalent to max_reason = 1 (KMSG_DUMP_PANIC).
>> +
>> +  unbuffered:
>> +    deprecated: true
>> +    type: boolean
>> +    description: |
>> +      Use mem_type instead. If present, and mem_type is not specified,
>> +      it is equivalent to mem_type = 1 and uses unbuffered mappings to map
>> +      the reserved region (defaults to buffered mappings mem_type = 0).
>> +      If both are specified -- "mem_type" overrides "unbuffered".
>> +
>> +unevaluatedProperties: false
>> +
>> +required:
>> +  - compatible
>> +  - memory-region
>> +
>> +anyOf:
>> +  - required: [record-size]
>> +  - required: [console-size]
>> +  - required: [ftrace-size]
>> +  - required: [pmsg-size]
>> +
>> +examples:
>> +  - |
>> +
>> +    qcom_ramoops {
>> +        compatible = "qcom,sm8450-ramoops", "qcom,ramoops";
>> +        memory-region = <&qcom_ramoops_region>;
>> +        console-size = <0x8000>;    /* 32kB */
>> +        record-size = <0x400>;      /*  1kB */
>> +        ecc-size = <16>;
>> +    };
>> --
>> 2.7.4
>>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ