Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2852769pxj; Mon, 31 May 2021 12:37:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy05DApRDZ7e++wY60PFzXY8U1QzJ3GUW1XaiqiiiwdgkQbFHJwmBd9TUG1scAD0IzICSEM X-Received: by 2002:a05:6e02:104b:: with SMTP id p11mr19299033ilj.275.1622489858322; Mon, 31 May 2021 12:37:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622489858; cv=none; d=google.com; s=arc-20160816; b=lnWWo8eJZxYsjXW8vsi7U2jzg0ZQBY2RUi7ZlApULFFfb5uIlrw8BCdvGbg8tQWAb/ mokl1+UIJY9CILwvLyFtqhd2vc0FP7YlV0b/GnRlyN78QVqLE/nK6k1VJB6IJe3iSbcD R36+4ynzgLlLPdpsoGrd+ttGQCLDGthiqWMj2tOjNgxEca8omzGvNmX7kTXT4bhe0vuM gM/iHD1KigCFwFwk4BX52VqxPs4xnmJDOo6aBRkCgONqRmrkHJX0WatUTvsxHPLw2uyR HoOcnJFvgkC4ae5NlG0aK++t6tikfsF9Ryui8c7hqkVdlN25wl0UN1lkz2BneJPIkl1p x0+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=AP7h7him3JeEctWajAa52TnSkMxpnL6XCskMFSEtLT8=; b=QS1hgz7mOu0h+kGcDDIgVJ8+MWHPS62Cthc4b0HuI50oHRpxEs8wRncpQ+EvmHfvZl PXd3ZFax/2n/j6kk9d1Vlky7ezDD0/N8CLlnijopE3TfO0uiCtlKHfwr6XUFy56A4dXI qxsb6n/0QB4FxCDTegAxmFDg2+3486Ke3fSftM/+VzJRMzzUsrdkla3XvkQFXbRDiUNe j6C+t2NAgrK35GugwFGcbcO9FDxvbHA1cCDZsHWzTcpRmoWFW3j+bATmNzMi387eadLc QlCzJ2YKC0n7IKVTgKADyFJlsidJy1e206WXFp7+jyhoCV4Z0B0uRp1QKUPeLKcAoR5q 0BKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c2Dqg7GW; 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 l17si16184530jaj.81.2021.05.31.12.37.24; Mon, 31 May 2021 12:37:38 -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=c2Dqg7GW; 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 S231809AbhEaTi0 (ORCPT + 99 others); Mon, 31 May 2021 15:38:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:46016 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231144AbhEaTiZ (ORCPT ); Mon, 31 May 2021 15:38:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8BA546128A for ; Mon, 31 May 2021 19:36:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622489805; bh=CLLhfPrGUsh9JYNXiGJiXeJ+RJ6r+AscuPI1NBWlG5w=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=c2Dqg7GWLB84YPc3RL/DZS2dSv7b9DnrLUt+9fQ39YNaqog0T1BRyqHF0g99W/kG4 kVZ2XwUlRKsEIdx3mu2+3VBOJV8ERpcYo0mrC94IQiLva95SgBBp9B84zfRJj27GRv ojWggEuAFssJPXf7SX/WGfLbqLvN+5taWwME07vHN8rPO8Cs3vmIkLsgtQB4uSv2K4 x+kuBVsQKYxzTRqw/QD3+CLa6W8Hl6YbVPU+Q9yQ2t1t0zYWvA70gFdNyUICubMVIe WNt2Z5qkqMTkFH7sgRjoLPbnxgJntQjII1S+M7qpFXc36/23B8X7VdTqJPBE96ezo4 MHbcM+yzWdVSw== Received: by mail-ot1-f43.google.com with SMTP id u25-20020a0568302319b02902ac3d54c25eso12026681ote.1 for ; Mon, 31 May 2021 12:36:45 -0700 (PDT) X-Gm-Message-State: AOAM53032Lja9GrU7l7c2U2BMndMgtZATh9qba8EfsWYWSC5nlxMHFf9 agLyspU9hGrKi2OOTALkadbNaJiEaPHwKChUwtg= X-Received: by 2002:a9d:7cd8:: with SMTP id r24mr18604847otn.90.1622489804839; Mon, 31 May 2021 12:36:44 -0700 (PDT) MIME-Version: 1.0 References: <20210531095720.77469-1-maz@kernel.org> In-Reply-To: <20210531095720.77469-1-maz@kernel.org> From: Ard Biesheuvel Date: Mon, 31 May 2021 21:36:34 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 0/5] arm64: Make kexec_file_load honor iomem reservations To: Marc Zyngier Cc: kexec@lists.infradead.org, Linux ARM , Linux Kernel Mailing List , Catalin Marinas , Will Deacon , Mark Rutland , James Morse , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Eric Biederman , Bhupesh SHARMA , AKASHI Takahiro , Dave Young , Andrew Morton , Moritz Fischer , Android Kernel Team Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 31 May 2021 at 11:57, Marc Zyngier wrote: > > This series is a complete departure from the approach I initially sent > almost a month ago[0]. Instead of trying to teach EFI, ACPI and other > subsystem to use memblock, I've decided to stick with the iomem > resource tree and use that exclusively for arm64. > > This means that my current approach is (despite what I initially > replied to both Dave and Catalin) to provide an arm64-specific > implementation of arch_kexec_locate_mem_hole() which walks the > resource tree and excludes ranges of RAM that have been registered for > any odd purpose. This is exactly what the userspace implementation > does, and I don't really see a good reason to diverge from it. > > Again, this allows my Synquacer board to reliably use kexec_file_load > with as little as 256M, something that would always fail before as it > would overwrite most of the reserved tables. > > Although this series still targets 5.14, the initial patch is a > -stable candidate, and disables non-kdump uses of kexec_file_load. I > have limited it to 5.10, as earlier kernels will require a different, > probably more invasive approach. > > Catalin, Ard: although this series has changed a bit compared to v1, > I've kept your AB/RB tags. Should anything seem odd, please let me > know and I'll drop them. > Fine with me. > Thanks, > > M. > > * From v1 [1]: > - Move the overlap exclusion into find_next_iomem_res() > - Handle child resource not overlapping with parent > - Provide walk_system_ram_excluding_child_res() as a top level > walker > - Simplify arch-specific code > - Add initial patch disabling non-crash kernels > > [0] https://lore.kernel.org/r/20210429133533.1750721-1-maz@kernel.org > [1] https://lore.kernel.org/r/20210526190531.62751-1-maz@kernel.org > > Marc Zyngier (5): > arm64: kexec_file: Forbid non-crash kernels > kexec_file: Make locate_mem_hole_callback global > kernel/resource: Allow find_next_iomem_res() to exclude overlapping > child resources > kernel/resource: Introduce walk_system_ram_excluding_child_res() > arm64: kexec_image: Restore full kexec functionnality > > arch/arm64/kernel/kexec_image.c | 39 ++++++++++++++++ > include/linux/ioport.h | 3 ++ > include/linux/kexec.h | 1 + > kernel/kexec_file.c | 6 +-- > kernel/resource.c | 82 +++++++++++++++++++++++++++++---- > 5 files changed, 119 insertions(+), 12 deletions(-) > > -- > 2.30.2 >