From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3775C47082 for ; Mon, 31 May 2021 10:00:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 731CF610E7 for ; Mon, 31 May 2021 10:00:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 731CF610E7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=18gbRcnE80hTPboR6CCq6C29ypASAsAg5i0xcbd8dI4=; b=wnx7ssfewMGUlF SzCFJKpYccOzLkO+RZgQG+DKfdvyZ82i831IfdxN6/hPVR/IO3QZvBlVZA/MZPnmzydnO4aUs++qa y7XhWOdcfXvFt9mvUjCk+y68JT1qPT3G9Tp2B1o184yCBZxpG6JlsvvMThVXzeohrE4VlnoZ4OqAc WyXCTPam60gxJFZ6TVXL2jn9O9havJfKtOZLwfKRxCwmnzaABDLEmphYnJCX8oQQlk9xQB1PD22Kn YB6HzcSgdsvNvdR2VWJn8gTpdRs1lt1NBmKUvjegfdSEKtAJfZNMbjlqGlZq7bGKrdzCVcKNQOSlg eDR1VCUBCtSckd8e/5Cw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnegF-00BkOj-Q8; Mon, 31 May 2021 09:57:55 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnegB-00BkMw-5S; Mon, 31 May 2021 09:57:52 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 41410610E7; Mon, 31 May 2021 09:57:50 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1lneg8-004Z7v-5g; Mon, 31 May 2021 10:57:48 +0100 From: Marc Zyngier To: kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Catalin Marinas , Will Deacon , Ard Biesheuvel , Mark Rutland , James Morse , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Eric Biederman , Bhupesh SHARMA , AKASHI Takahiro , Dave Young , Andrew Morton , Moritz Fischer , kernel-team@android.com Subject: [PATCH v2 0/5] arm64: Make kexec_file_load honor iomem reservations Date: Mon, 31 May 2021 10:57:15 +0100 Message-Id: <20210531095720.77469-1-maz@kernel.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, ardb@kernel.org, mark.rutland@arm.com, james.morse@arm.com, lorenzo.pieralisi@arm.com, guohanjun@huawei.com, sudeep.holla@arm.com, ebiederm@xmission.com, bhupesh.sharma@linaro.org, takahiro.akashi@linaro.org, dyoung@redhat.com, akpm@linux-foundation.org, mdf@kernel.org, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210531_025751_289914_08639964 X-CRM114-Status: GOOD ( 15.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel