Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16486075rwd; Mon, 26 Jun 2023 10:36:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7r6xu3t3GuGI1wIm+K/GlsMYVYBazoga8YeiCsXqfndCiS5CjGU4emiZaogrJlWs5ud/Bx X-Received: by 2002:a05:6a00:15d6:b0:66a:6310:ac1a with SMTP id o22-20020a056a0015d600b0066a6310ac1amr11153793pfu.13.1687800972336; Mon, 26 Jun 2023 10:36:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687800972; cv=none; d=google.com; s=arc-20160816; b=B6dmEKiLaKSMsAURYgkEwRVFSclXjDsezGG+4AukwhTYK0+pRNSkCm1UNIMrhWJrCf GKpf6VAnnYWijNsjW/nlGupIvMgyU+aG+R4/Pq5KLyMT32pvEWmOA5ysvjRRS9W4AFTS 5pQ6ZYFgdho1ljkqZhpGe8GWnEQli6f00VVlr1ZNvLVDFyF7qbrv4ekt7WszVrse4ryy ydmE2Y7teZleMj6X3XOHYZ4LrZUUWRcy1Rz82pvc+dpRkwjXNCI3S4Z2vooagU1kdPau Z4X6LjS5jR0YWXcX2Q0MszG7u1F24IjBp/cizsEXPNQkYEMXr8B3gDXFcX0oIPtEnZPc kH8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=EyU7g+/FdYKrk1DQaEP2iYnQoU8oezLZUpMJ66Ucu9Q=; fh=d75CYaDJsvZywQAT5gRCDCksuvgQWxbYBmzlN1IhEQo=; b=SH/VQDe+Jbg98zWuqzw3YXT8EbU3gmJBtHzl9LRYowVvv78uXMGdlZNnhhM+Qt7PRt 6NUQ0qMo19ELIIo6yazed2iFZd3DM5RKFHyLBi55T6Hdv8bChVEnmAYMhvV0oBkBcrZy AeasD6+V1adsPpWwRC/1Cb9FGLzn9Wb3u3zZ//yy2lfjyHE3zEveWO5VoKw2RxscH7Nj fVeOGZ0fKERn5thCIKZTt/K+BjMx+kLxHJiiigioXrqdg+OZykGEnRj+iYEwqluNLl22 XgAFngzP0oHDj4IFbSOSeq/mtTv6xLNz3eEtxLasAx8jc7agSzSlVevprNXqARMpa8ao Nf4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=hgixuRIt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bx11-20020a056a00428b00b0066d93ab678asi4645060pfb.16.2023.06.26.10.35.59; Mon, 26 Jun 2023 10:36:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=hgixuRIt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229667AbjFZRfB (ORCPT + 99 others); Mon, 26 Jun 2023 13:35:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231591AbjFZReh (ORCPT ); Mon, 26 Jun 2023 13:34:37 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54E6E10CC; Mon, 26 Jun 2023 10:34:36 -0700 (PDT) Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35QGtlo2004894; Mon, 26 Jun 2023 17:34:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=EyU7g+/FdYKrk1DQaEP2iYnQoU8oezLZUpMJ66Ucu9Q=; b=hgixuRItsxPwEM2NXUJMoi/E8RbvrDf2EE1o+DRP9PvLFZDMZFEcCBbhFpCMaMQ1vhFO pS5t7ke/+aS+wRklFQR8hSlD9bMxCjgoQkOS31ccKqAPzSKgwTHK2ud5xs9c90L0Df+E VoEYD51LiEmHx8NnYHDTn5pWdinJZivqI+gZditAWRW01Cnmt2OXT+x1Xk6YuSQFlpfT VaHHCkCIr+czB/1CjqdeRHFtU3qM0iJCvLkqzu4ukn+/SF3x6A9Lt5EsgW2rE6VuosqB M6P6EYsHCiwvmGzvP0jrccFTSQXRwhX73YIYtf6C/61V/2VIz/mmHsMQG1vxtF3XxmgO 4w== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3rdrvd4r8s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Jun 2023 17:34:21 +0000 Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 35QHYKeC004838 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Jun 2023 17:34:20 GMT Received: from [10.216.59.223] (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Mon, 26 Jun 2023 10:34:16 -0700 Message-ID: <696269e1-8b97-66ed-c9b0-ce1b8d637d24@quicinc.com> Date: Mon, 26 Jun 2023 23:04:11 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] pstore/ram: Add support for dynamically allocated ramoops memory regions Content-Language: en-US To: Elliot Berman , Kees Cook , Isaac Manjarres , Kees Cook CC: John Stultz , Tony Luck , "Guilherme G. Piccoli" , , , , "Trilok Soni" , Satya Durga Srinivasu Prabhala References: <20230622005213.458236-1-isaacmanjarres@google.com> <202306212212.5E53607@keescook> <3A2CFB4D-27D0-4FEB-93B4-2F888305DE5A@kernel.org> From: Mukesh Ojha In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: Mmjga9lZugHysgU3bcUR50qAwjUFXuLA X-Proofpoint-GUID: Mmjga9lZugHysgU3bcUR50qAwjUFXuLA X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-26_14,2023-06-26_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 adultscore=0 priorityscore=1501 bulkscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 mlxlogscore=822 suspectscore=0 phishscore=0 clxscore=1011 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306260160 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On 6/23/2023 1:21 AM, Elliot Berman wrote: > > > On 6/22/2023 10:58 AM, Kees Cook wrote: >> On June 22, 2023 10:26:35 AM PDT, Isaac Manjarres >> wrote: >>> On Wed, Jun 21, 2023 at 10:15:45PM -0700, Kees Cook wrote: >>>> On Wed, Jun 21, 2023 at 09:47:26PM -0700, John Stultz wrote: >>>>>> The reserved memory region for ramoops is assumed to be at a fixed >>>>>> and known location when read from the devicetree. This is not >>>>>> desirable >>>>>> in environments where it is preferred for the region to be >>>>>> dynamically >>>>>> allocated early during boot (i.e. the memory region is defined with >>>>>> the "alloc-ranges" property instead of the "reg" property). >>>>>> >>>>> >>>>> Thanks for sending this out, Isaac! >>>>> >>>>> Apologies, I've forgotten much of the details around dt bindings here, >>>>> so forgive my questions: >>>>> If the memory is dynamically allocated from a specific range, is it >>>>> guaranteed to be consistently the same address boot to boot? >>>>> >>>>>> Since ramoops regions are part of the reserved-memory devicetree >>>>>> node, they exist in the reserved_mem array. This means that the >>>>>> of_reserved_mem_lookup() function can be used to retrieve the >>>>>> reserved_mem structure for the ramoops region, and that structure >>>>>> contains the base and size of the region, even if it has been >>>>>> dynamically allocated. >>>>> >>>>> I think this is answering my question above, but it's a little opaque, >>>>> so I'm not sure. >>>> >>>> Yeah, I had exactly the same question: will this be the same >>>> boot-to-boot? >>> >>> Hi Kees, >>> >>> Thank you for taking a look at this patch and for your review! When the >>> alloc-ranges property is used to describe a memory region, the memory >>> region will always be allocated within that range, but it's not >>> guaranteed to be allocated at the same base address across reboots. >>> >>> I had proposed re-wording the end of the commit message in my response >>> to John as follows: >>> >>> "...and that structure contains the address of the base of the region >>> that was allocated at boot anywhere within the range specified by the >>> "alloc-ranges" devicetree property." >>> >>> Does that clarify things better? >> >> I am probably misunderstanding something still, but it it varies from >> boot to boot, what utility is there for pstore if it changes? I.e. the >> things written during the last boot would then no longer accessible at >> the next boot? E.g.: >> >> Boot 1. >> Get address Foo. >> Crash, write to Foo. >> Boot 2. >> Get address Bar, different from Foo. >> Nothing found at Bar, so nothing populated in pstorefs; crash report >> from Boot 1 unavailable. >> >> I feel like there is something I don't understand about the Foo/Bar >> addresses in my example. >> > > I believe this is being added to support the QCOM SoC minidump feature. > Mukesh has posted it on the mailing lists here: > > https://lore.kernel.org/all/1683133352-10046-1-git-send-email-quic_mojha@quicinc.com/ > > https://lore.kernel.org/all/1683133352-10046-10-git-send-email-quic_mojha@quicinc.com/ > > Mukesh, could you comment whether this patch is wanted for us in the > version you have posted? It looks like maybe not based on the commit > text in patch #9. No, this is no needed after patch #9 . I have tried multiple attempt already to get this patch in https://lore.kernel.org/lkml/1675330081-15029-2-git-send-email-quic_mojha@quicinc.com/ later tried the approach of patch #9 along with minidump series.. - Mukesh > >  - Elliot