Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4130249pxj; Tue, 15 Jun 2021 16:20:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYLfpyUdJeIGJJGXOh10CuDJe15Y70DmR8756gWrVvusB+1vwRPkyvJxsiPDjhVSjkv0uL X-Received: by 2002:a05:6e02:5c7:: with SMTP id l7mr1256563ils.283.1623799219602; Tue, 15 Jun 2021 16:20:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623799219; cv=none; d=google.com; s=arc-20160816; b=v4DyxCUaosgHtK8+k3CsltzDXJuJhz/ihAjaB1xIW2za5MjSfKDU3Zi5YUBS0D4agQ 6nRMujGSrFJ/coy/ZCQwIDMRQXdixPnxr5ziLrNXWgW+l5xtieVGyBfn9sF9j4QJWFUD C9R9U6QjeecfuIpohdeI7k17+03N/FRXL+d3dj22J9Zk5VP9v5Ze0Ta6rwylDjPiXjdg Dz+8U/9Ph8n5O6U3ufcry0Yv05jeGO5yubTlw595Gy+JigAiK6MYDt/xJqkYgSVPEitW 7eB1e5BS7r7WtKKBoB6c8iDRsyxAsWe48O6BQB9WUeNxpDW8H4UiiBJ5zS96qi4MNQyH +2bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:references:in-reply-to :organization:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=p13t7AXV5K47elc8J0+J56WqkdT/5gwV0xyQteOJKBk=; b=dJebSVtnxuzxLnVbKiQ9Y1uVW8X9CzgYg5HSPN2fg0ywMIk2qCIWk+0P9nDc9uqo3M sJcn0iiTYvuUgpqK4fSnpZitGR3gaR64YlV2Vq9KfcQpMk98IjEOaBstkY5xVyRkGep4 /XwCY6VcBePiC0SUqmpwtqbp4F27iladQyIogHCqHT7ZfkkGJ1i8utEF/b1TbTW2dKw/ 5Oih4rNvrcS8+KLeTk5q+tQivTH/dtleiyHWBYw1VWQ5kXOtylmH/D38QMq+mNbPBjUG QtsUxcW1yvEdAM+i3Zpj3Q9Bvaz4atASSMYwu+4XymKVmo8QEvMyucbfQw5Lf4LTkcSZ +BUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@ics.forth.gr header.s=av header.b=LMz1xsXB; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ics.forth.gr Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t9si309187ilp.29.2021.06.15.16.20.06; Tue, 15 Jun 2021 16:20:19 -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=fail (test mode) header.i=@ics.forth.gr header.s=av header.b=LMz1xsXB; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ics.forth.gr Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231164AbhFOXV1 (ORCPT + 99 others); Tue, 15 Jun 2021 19:21:27 -0400 Received: from mailgate.ics.forth.gr ([139.91.1.2]:37367 "EHLO mailgate.ics.forth.gr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229898AbhFOXV1 (ORCPT ); Tue, 15 Jun 2021 19:21:27 -0400 Received: from av3.ics.forth.gr (av3in.ics.forth.gr [139.91.1.77]) by mailgate.ics.forth.gr (8.15.2/ICS-FORTH/V10-1.8-GATE) with ESMTP id 15FNJKpK058325 for ; Wed, 16 Jun 2021 02:19:20 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; d=ics.forth.gr; s=av; c=relaxed/simple; q=dns/txt; i=@ics.forth.gr; t=1623799155; x=1626391155; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=uwFXfKsUDq2hvWkMUShCCiVgWGg1LtvvqsBZuvGXYp0=; b=LMz1xsXB6BGLWnG55k8/4KVd5f2tm9aH0Ier9huFlt/47D4vW0sg/ztO6pSrB4uf PnP5v6Lk2IFZRfbxeRoVDbrfSiTG3RUvYI09ZSIPOtLY8Ipw8J+WFfznFmKDnrvJ dGFWD2uHkO2EPf5eLhCGxZZ7e60j+5XaUEgrq1BiQZDmh/9DEickjKKmjGvwRSW0 fqXA8pZS0s7cU7pSVbEBuaVf4LhBFMTz//P2uBSS+eQQP8zYHd752GIG8RxC6dcf nfMDiTNRe/eQE29a/poJC3vogvHlxsFpSLvZiO117EWH0jxRwPTOdGFCEAQU1pd1 y6HmTkZB3yzgPfAOx/1lhQ==; X-AuditID: 8b5b014d-96ef2700000067b6-12-60c93573b2c3 Received: from enigma.ics.forth.gr (enigma.ics.forth.gr [139.91.151.35]) by av3.ics.forth.gr (Symantec Messaging Gateway) with SMTP id 87.05.26550.37539C06; Wed, 16 Jun 2021 02:19:15 +0300 (EEST) X-ICS-AUTH-INFO: Authenticated user: at ics.forth.gr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Wed, 16 Jun 2021 02:19:14 +0300 From: Nick Kossifidis To: Rob Herring Cc: Nick Kossifidis , Geert Uytterhoeven , Paul Walmsley , Palmer Dabbelt , Albert Ou , Frank Rowand , Catalin Marinas , Will Deacon , devicetree@vger.kernel.org, linux-riscv , linux-arm-kernel , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] riscv: Remove non-standard linux,elfcorehdr handling Organization: FORTH In-Reply-To: References: Message-ID: X-Sender: mick@mailhost.ics.forth.gr User-Agent: Roundcube Webmail/1.3.16 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjkeLIzCtJLcpLzFFi42Lpjp6urFtsejLB4M8yDYutv2exW7xf1sNo Mf/IOVaLmW/+s1nMnT2J0WLT42usFpd3zWGz2Pa5hc2i+d05douXl3uYLdpm8Vu07j3CbtFy x9SB12PNvDWMHm9evmTxONzxhd1j4lldj52z7rJ7PNx0iclj06pONo/NS+o9LjVfZ/f4vEku gCuKyyYlNSezLLVI3y6BK+P99/WsBRdkK2adC21gfC/excjBISFgIrFqb14XIyeHkMBRRonF TeEgtoSAqcTsvZ2MIDavgKDEyZlPWEBsZgELialX9jNC2PISzVtnM4PYLAKqEp2bVrKD2GwC mhLzLx0EqxcRUJHY8PwWUA0XUP0+Fom2lyfAioQFfCV+zbwIZvMLCEt8unuRFcTmFAiUeH/5 GhNIg5DABCaJfV9usUFc4SLxrfU1G8R1KhIffj9gB3lAFMjePFdpAqPgLCS3zkJy6ywkty5g ZF7FKJBYZqyXmVysl5ZfVJKhl160iREcVYy+Oxhvb36rd4iRiYPxEKMEB7OSCK9u8YkEId6U xMqq1KL8+KLSnNTiQ4zSHCxK4ry8ehPihQTSE0tSs1NTC1KLYLJMHJxSDUyup6ex2j0Ib95W YMqsevBi9b0W7UJt5e9vPnkGn7xrOkn/1+kZ7/i3nS5ZuG6tSF9Ye+eWZaceqUcXORt8Sjzx 7eLsBx3mAZOfTbrLa6riFmcmJ6dy5qCYd+B8HR9zS78ZCx9riKect7HYfcvabq3jwq1P7rCr 6X/d9iaSn+lnpuX+e5LWqdPu8EdfEJqYkpw/f+HDOzpbWqWvF0zgnS3cEubaLCg4UdZ7Wqni xEvrvsyI2RD4cdvDd4fnR2pcyHt/P25jtIfx45B3m9ofz+tfvnqr7Pz9pQsurpdo9L+tuzzI Q4NXTY774FY3lto/myepLmye2j9p94eqC+4RQsUpbKrV0y5yMfxZosh98IClEktxRqKhFnNR cSIAWD8HaxkDAAA= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Στις 2021-06-15 22:54, Rob Herring έγραψε: > On Tue, Jun 15, 2021 at 12:40 PM Nick Kossifidis > wrote: >> >> Στις 2021-06-15 21:17, Geert Uytterhoeven έγραψε: >> > RISC-V uses platform-specific code to locate the elf core header in >> > memory. However, this does not conform to the standard >> > "linux,elfcorehdr" DT bindings, as it relies on a reserved memory node >> > with the "linux,elfcorehdr" compatible value, instead of on a >> > "linux,elfcorehdr" property under the "/chosen" node. >> > >> > The non-compliant code can just be removed, as the standard behavior is >> > already implemented by platform-agnostic handling in the FDT core code. >> > >> > Fixes: 5640975003d0234d ("RISC-V: Add crash kernel support") >> > Signed-off-by: Geert Uytterhoeven >> >> NACK >> >> There is nothing standard about "linux,elfcorehdr", it's an > > It is and it is documented which is more than we can say for > "linux,elfcorehdr" as a node. > Standard stuff goes on /drivers/of, not on /arch/arm64. The reserved-memory binding I use is on /drivers/of, is definitely a standard / documented binding and the only issue here is that the compatible string I used matched that property from arm64. >> arm64-specific property on /chosen and it's suboptimal, it gets the >> addr/length of ELF core of the previous kernel through that property >> and >> then goes on to reserve that region at: >> https://elixir.bootlin.com/linux/v5.13-rc6/source/arch/arm64/mm/init.c#L155 >> >> Why on earth is this cleaner than just defining a reserved-region in >> the >> first place (a standard binding) with and hook up a callback with >> RESERVEDMEM_OF_DECLARE for it to also initialize elfcorehdr_addr/size >> ? >> If you don't like the compatible string I'm ok to change it, but this >> patch breaks kdump on riscv since that region won't be reserved any >> more >> and kernel will corrupt it. > > I might agree if we were designing this all from scratch, but we're > not. We've got powerpc doing /memreserve/ + kernel cmdline, arm64 > using chosen, and RiscV a 3rd way. > I get it and I'd also like to consolidate things, but forcing riscv to use a suboptimal approach just because arm64 uses it doesn't make sense either, the goal should be for all to use the best possible approach (disclaimer: I'm not saying my approach is the best possible, I'm saying it's cleaner than arm64's). > What happens when/if RiscV wants to add an IMA buffer? That's no > different than this case. The 2 architectures supporting it both use > /chosen. Specifying an initrd is no different either. Those two are already on drivers/of/fdt.c and drivers/of/kexec.c, it's also interesting to note that for both of them, including "linux,elfcorehdr", the newly added drivers/of/kexec.c adds an entry to the fdt's memory reservation map when creating the fdt for the next kernel, so they are all basically reserved regions. Why this was chosen (a property on /chosen + an entry on the reservation map), effectively adding each region twice on the fdt, instead of just adding a reserved-memory node for each one beats me. Note that in case of arm64 this is not what happens on kexec-tools, which is probably the reason why arm64 still reserves them in any case. Anyway I guess switching arm64 to reserved-memory is too much to ask since they would have to also change kexec-tools, handle different versions etc, and although I don't like it consolidation is more important than a duplicate region on the fdt, so let's go with "linux,elfcorehdr" on /chosen + entry on the reservation map. I'll update my kexec-tools patch instead. Regards, Nick