Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp805988ybk; Fri, 15 May 2020 14:10:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxmR0QfD5oAgJHV2K8Z8q7LwqDGKByQhyxzapzRBYfbwJ+5NSC1B0FY4Om2w6bZ8skJb9X X-Received: by 2002:a50:8749:: with SMTP id 9mr4596100edv.164.1589577035125; Fri, 15 May 2020 14:10:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589577035; cv=none; d=google.com; s=arc-20160816; b=Zunss+gmgz0sdK7We4wsnXt2a+ggTfO1HNHB191FilFx05rlzzTq5uR8nxP/fr5AmP 9oB5xGSa4LOfS63gp5A4d4BS0+hZ6ihwTj2aLiUJS8PnjPv17Nl/baHlpqt7FTaNahML Zj6OrCvd8tdSC/ENMB/nVJbqGKm4GXwTwhyGi140j3uaa6QJLPmUrykcu1GgPNVX+RNR D07LowSBnZHgmk2Eaq/hVlHe+C/MnUMU89Agmh7d6OJWEEhLSzt2OtwQl3eZyKes3qMm r0VLIY+fDJnahOBqe4E3RzIDHGkDA4PvuQQoopOViiWzmtdt659bPzJoVvfKd9t3W+lf y+LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=rVW8KezM3i3HcZ5WoaIxiJ9RRMgtGJtV0/SuZwNn25U=; b=fxB7/GIzsIc0cL5rPEI1dFBWnGJkvw0VqylDjqysP3OuJjU/nC07vIZsNPgGYyhLsI EbCxC/QR2fDwXs5q/VaatA3bmKv97kA+fX+DEkGTq1S9au2+JQGNhz7DB81OYkH6jIlG ARy8uXD8IlWXQf9MEldWD5ffUN4u4zxjQIn/gRDWvnMMf18NbV1Nlnqa0rS03AYe2qJ7 wRuMLP0C2AExJlfl//smmiINynpuGT9Dw8IwhZTnypMD/BcqcttMvHIepTSOKs//VfHO qBrym8l6JyA7gx8WQuXcRGMh3YrkqrKW2QJWPVBd7JBZfu7QqYCCMc1p92V+Omhp1GFb IsxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=xVbecPPq; 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=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gr5si1858123ejb.509.2020.05.15.14.10.11; Fri, 15 May 2020 14:10:35 -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=@armlinux.org.uk header.s=pandora-2019 header.b=xVbecPPq; 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=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726786AbgEOVG3 (ORCPT + 99 others); Fri, 15 May 2020 17:06:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726247AbgEOVG2 (ORCPT ); Fri, 15 May 2020 17:06:28 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC634C061A0C for ; Fri, 15 May 2020 14:06:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=rVW8KezM3i3HcZ5WoaIxiJ9RRMgtGJtV0/SuZwNn25U=; b=xVbecPPq9oJGttjPZ+wLz1nfl 0Wyv5gVizqqLjk/7dSGcf05+nUTO/+vUG57jxAUcdyZSrAf/NrRiL0dovMKAXqDhv719/HOf50ieD 6S3IJTlNoGIlQo+Mhx01Qzlt0bf00oR6z5WDhWcNorOZiSEaxOiUDpqdQNznYVH6XiCNqkvWCVxkx 8GNzLn6CrD4aOEW7oJ/KDIxD27cge6AsPgrjclDCAeumWWbdw1+/eKFpgZjEHAMhGI66xeP3wVJ1e 1e2YVtALC/wbMPk1YbXxb6GuSheNlok+UT6JvYteYh44uEvUoDakiiNUBEc8rQQ4Oc6e5H6KfR4w2 XU2rHKvxQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:60910) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZhX2-0006kl-Mb; Fri, 15 May 2020 22:06:17 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1jZhX1-0001rt-5y; Fri, 15 May 2020 22:06:11 +0100 Date: Fri, 15 May 2020 22:06:11 +0100 From: Russell King - ARM Linux admin To: Corentin Labbe Cc: ebiederm@xmission.com, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: kexec: arm: possible overwrite of initrd Message-ID: <20200515210611.GS1551@shell.armlinux.org.uk> References: <20200515135712.GA5979@Red> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200515135712.GA5979@Red> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 15, 2020 at 03:57:12PM +0200, Corentin Labbe wrote: > Hello > > Following https://lkml.org/lkml/2020/4/6/96 I was able to boot my Cubieboard4 via kexec reliabily. You can try increasing the kernel size that kexec thinks the kernel needs, but it should be extremely accurate with modern kexec. --image-size $((0x01dc8154 + 0x10000)) will add 64k on top of what you currently have. Note where the first figure comes from (you'll find it in the debug output, see "Resulting kernel space"). The best I can say is try playing around with that - but, kexec's calculations should be spot on to stop the booting kernel from overwriting the initrd. The only way to debug that is to get the booted kernel to hexdump the initrd so it's possible to see what happened to it. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 10.2Mbps down 587kbps up