Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp907418pxj; Wed, 16 Jun 2021 16:56:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMAtEGqVv66NxoFqP9vV/OepuocHhj5RM0/R82D/YuvOHJ69KhHf3lKl1Zwyzhn499hIFI X-Received: by 2002:a17:906:2bd9:: with SMTP id n25mr2016767ejg.513.1623887760479; Wed, 16 Jun 2021 16:56:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623887760; cv=none; d=google.com; s=arc-20160816; b=utevII9WbIL2+h5PCgrB13axzgo0ramgb60/s68lF8BFIanBxMkJ3xujE9sYpP3mQ0 wrtuPwFlwgQ5d+NF9iyn++u4NDSHsrR/Qv/J1PhgrPWq6ZcQ21n3Rj5z0a3j7A1XKA8c 0HL8/36GGn4KSU1RNxjOTJEF+EybymMwRXRnmxVowAnqWgBChnB5S86vuF1kCwKY/gXa /d4/dcmtOgv6KBKe5vdeKXjU48/CQZXyn1MXsA6pDLKTLAPbD0ba1ZTltjQagCL//uyL wQYBPfn+UZ8MtG71qSfkQScEkH2ZwFSLrZ1cfvoSxuc4+TKw1TEcc+maL2Z6ofNaOP2f YhQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=4LO915OD4jKg/3nt6ThxWRMlutxdFuibXNp1Vc82/rg=; b=VA5umhpiZ/j5/jWIhZK6pMQ/FqpSHg3aqC/kRHLRtT2sRewUVlBVu5HbpE2MQdPIDA qjw3poqa9LM46zqwD+uemB5Bq/JwoMyzzFHBbrHyee4gByK3nsK0AwRTt3s/jgTozUP6 Ez69y10yKOTkG6jxskTASz0BvcVwX1OnE1z3l8wTMv+UfFJ2FGgERQvFLnDJ8zfVHMQO siidrpa/6en+j7MQ7vIKYYyDXaIm86Du8kVG6G14O8Wsj6vSrqgklQ/4FtTSxFvvoeyF Yw37zu9RmI+g89HUzRKEY7QEuuO9uhPwgqPr/xDqA1xg/5OInPQr1Y1Ul0kttHIFTVM7 17JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CcrM6uik; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w9si3679514edx.451.2021.06.16.16.55.37; Wed, 16 Jun 2021 16:56:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CcrM6uik; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235377AbhFPQdU (ORCPT + 99 others); Wed, 16 Jun 2021 12:33:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:39558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232234AbhFPQdR (ORCPT ); Wed, 16 Jun 2021 12:33:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CECD361351; Wed, 16 Jun 2021 16:31:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623861070; bh=exkQJNSPkDaseMRDwokpCtaWrpnVtJkBzMN5rRvGQlo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=CcrM6uikMWLtSBxw8H9H/2RY3qDvi+EYYeCjgHO3IJREBFMZI0Pd3wZ6OaIJGk+4N lDguHLiRALRo7Z+MZgOBGkqFhvoeQcekyMghWGkQiFqZVBe/0FDS52/h86X4d/CCxe CC8V6p1zS78I55C0TsuwMalmdvgQ9wrRekivnY6l5IlW6Sj74m5MmO87kgPug79KfJ 6JYfmHysfpYqP40QQ0G5/wNlAmnOj0mVxMgo35afLZ4b4etyX0sAy05mvHSib5b4z2 yeOWg2lCgxOh59vYBQq/TfJ5tSNzXOoe9fe94711BOMJha3rn6eUQkIF7JhIBU+hVP od/YObWbZ+Itg== Received: by mail-ot1-f41.google.com with SMTP id w23-20020a9d5a970000b02903d0ef989477so3067349oth.9; Wed, 16 Jun 2021 09:31:10 -0700 (PDT) X-Gm-Message-State: AOAM5305JSNPw4xbGPfQmRSNnEOZ2Xyd3I5tHIPDkueWTPx6Sua8swiz VOAxjl3fNtVjJCSnEwrFcG5tfRi/N7htU2k4Tww= X-Received: by 2002:a9d:4c83:: with SMTP id m3mr638863otf.77.1623861070211; Wed, 16 Jun 2021 09:31:10 -0700 (PDT) MIME-Version: 1.0 References: <20210419005539.22729-1-mick@ics.forth.gr> <20210419005539.22729-6-mick@ics.forth.gr> In-Reply-To: From: Ard Biesheuvel Date: Wed, 16 Jun 2021 18:30:58 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 5/5] RISC-V: Add crash kernel support To: Rob Herring Cc: Nick Kossifidis , Geert Uytterhoeven , linux-riscv , Palmer Dabbelt , Paul Walmsley , Linux Kernel Mailing List , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 16 Jun 2021 at 16:55, Rob Herring wrote: > > +Ard > > On Tue, Jun 15, 2021 at 5:29 PM Nick Kossifidis wrote= : > > > > =CE=A3=CF=84=CE=B9=CF=82 2021-06-15 22:21, Rob Herring =CE=AD=CE=B3=CF= =81=CE=B1=CF=88=CE=B5: > > > On Tue, Jun 15, 2021 at 12:48 PM Geert Uytterhoeven > > > wrote: > > >> > > >> Hi Nick, > > >> > > >> On Tue, Jun 15, 2021 at 8:29 PM Nick Kossifidis > > >> wrote: > > >> > =CE=A3=CF=84=CE=B9=CF=82 2021-06-15 16:19, Geert Uytterhoeven =CE= =AD=CE=B3=CF=81=CE=B1=CF=88=CE=B5: > > >> > > This does not match > > >> > > https://github.com/devicetree-org/dt-schema/blob/master/schemas/= chosen.yaml#L77: > > >> > > > > >> > > $ref: types.yaml#/definitions/uint64-array > > >> > > maxItems: 2 > > >> > > description: > > >> > > This property (currently used only on arm64) holds the mem= ory > > >> > > range, > > >> > > the address and the size, of the elf core header which mai= nly > > >> > > describes > > >> > > the panicked kernel\'s memory layout as PT_LOAD segments o= f elf > > >> > > format. > > >> > > > > >> > > Hence "linux,elfcorehdr" should be a property of the /chosen nod= e, > > >> > > instead of a memory node with a compatible value of "linux,elfco= rehdr". > > >> > > > > >> > > > >> > That's a binding for a property on the /chosen node, that as the t= ext > > >> > says it's defined for arm64 only and the code that handled it was = also > > >> > > >> That doesn't mean it must not be used on other architectures ;-) > > >> Arm64 was just the first one to use it... > > > > > > It is used on arm64 because memory is often passed by UEFI tables and > > > not with /memory node. As riscv is also supporting EFI, I'd think the= y > > > would do the same. > > > > > > > We've had this discussion before, riscv uses /memory for now and even i= f > > we switched to getting memory from ACPI/UEFI tables, the elf core heade= r > > is passed from the crashed kernel to the kdump kernel, it has nothing t= o > > do with UEFI since the bootloader is the kernel itself. Am I missing > > something ? > > I believe if we originally booted using UEFI tables, then those are > passed the kdump kernel as well. The original DT may have had a > /memory node, but it's possible it didn't match what was in the UEFI > tables. So using the DT /memory nodes for kdump could give surprising > results. I think reserved regions also come from UEFI. Ard can > probably comment better. > Anything that executes in the context of the UEFI boot firmware (loaders, drivers, etc) may use the UEFI memory allocation routines to allocate memory, and these allocations are communicated via the UEFI memory map, not via the /memory node. So it depends whether it matters if the kexec kernel tramples over those regions. For kdump scenarios, it might be reasonable, but in the general case, we should really respect what UEFI tells us about the memory map when booting via UEFI.