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=-9.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham 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 090EAC433B4 for ; Wed, 12 May 2021 18:17:04 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 60A7A61289 for ; Wed, 12 May 2021 18:17:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 60A7A61289 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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Subject:Cc:To: From:Message-ID:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zowfPB+57C0ZzK2Pih10V8jsAO5s1+9N4EDfmioIBCo=; b=aT92BtQlsnax6DNBhKM/+2sb7 YJNwWKI+B4IFAnfi2Xm/vbKnhMNToimfDgz3OaJtmFlXytf9HCSWtx4+kQ9ew71BL05xvkqyjILTY LKjCUgYhqazP24YXN6Ilxw0uyRCncmXPd8NzSLEHLdTckqLdjt+zVwPaPJCVXT86eOwXzZGLSVXlM YF0+T8THyd4ydJub1WlCvLzc3ix+lHDZWrIQyCzanv89/eaMGxuyZLT/xRylCqA/NAOKJrOmkQw8+ J6c2v6DaZTQxECdWHirh/LtVBzhh+CHSHDs2SHJuSud0doYASDlzBehsVltbwVlfHUWpzW0F/VAPD +dOwTbSXw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lgtNj-003Zmg-M4; Wed, 12 May 2021 18:14:52 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgtDj-003Wbr-69; Wed, 12 May 2021 18:04:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:MIME-Version:References: In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=racqsUx5I8N9FVM9ft0fMvm4cEP+VInnXL4KLe/AMkE=; b=2OXTHrC4JfBj/Byye99Zicyc1f Bwswou2ZAdhHpt7C8OMvoXj89HgvH27dWgEJRliQHCGKBlJKV1kYDfsimQ3MmfdFe380xpZb4DzBP n7Rf1pzDT+92v7HIHzAh8ORTG0bqYrkmbkd4As1iTReoISBa9bpBLzbrbzFscUnpXadf4S5htsQO3 l93ub0smbA68Qnn6wDVMA5VW9eAv2oSsRmxm9xJWRxPA+MtkB48WW2186itbz6mK7f0T1O9iiB4tk ZuLfxbD0Umgd5f2mM1qlrN9ri+IAVrtzJM33D8tGkCkhk0N5qJD7c8tykw74ULI+ycVd4VuPjXeWe TnbDTknQ==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgtDg-00AgAX-IR; Wed, 12 May 2021 18:04:29 +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 39E9A61482; Wed, 12 May 2021 18:04:28 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.misterjones.org) 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 1lgtDd-0010xm-0c; Wed, 12 May 2021 19:04:25 +0100 Date: Wed, 12 May 2021 19:04:24 +0100 Message-ID: <87fsyroml3.wl-maz@kernel.org> From: Marc Zyngier To: kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org Cc: Catalin Marinas , Dave Young , Moritz Fischer , Will Deacon , Ard Biesheuvel , Mark Rutland , James Morse , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Eric Biederman , Bhupesh Sharma , AKASHI Takahiro , kernel-team@android.com Subject: Re: [PATCH 0/2] arm64: kexec_file_load vs memory reservations In-Reply-To: <20210429133533.1750721-1-maz@kernel.org> References: <20210429133533.1750721-1-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, dyoung@redhat.com, mdf@kernel.org, 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, bhsharma@redhat.com, takahiro.akashi@linaro.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-20210512_110428_699038_836B3BD9 X-CRM114-Status: GOOD ( 29.67 ) 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 + Dave Young, which I accidentally missed in my initial post On Thu, 29 Apr 2021 14:35:31 +0100, Marc Zyngier wrote: > > It recently became apparent that using kexec with kexec_file_load() on > arm64 is pretty similar to playing Russian roulette. > > Depending on the amount of memory, the HW supported and the firmware > interface used, your secondary kernel may overwrite critical memory > regions without which the secondary kernel cannot boot (the GICv3 LPI > tables being a prime example of such reserved regions). > > It turns out that there is at least two ways for reserved memory > regions to be described to kexec: /proc/iomem for the userspace > implementation, and memblock.reserved for kexec_file. And of course, > our LPI tables are only reserved using the resource tree, leading to > the aforementioned stamping. Similar things could happen with ACPI > tables as well. > > On my 24xA53 system artificially limited to 256MB of RAM (yes, it > boots with that little memory), trying to kexec a secondary kernel > failed every times. I can only presume that this was mostly tested > using kdump, which preserves the entire kernel memory range. > > This small series aims at triggering a discussion on what are the > expectations for kexec_file, and whether we should unify the two > reservation mechanisms. > > And in the meantime, it gets things going... > > Marc Zyngier (2): > firmware/efi: Tell memblock about EFI reservations > ACPI: arm64: Reserve the ACPI tables in memblock > > arch/arm64/kernel/acpi.c | 1 + > drivers/firmware/efi/efi.c | 23 ++++++++++++++++++++++- > 2 files changed, 23 insertions(+), 1 deletion(-) Any comment on this? I've separately started working on using the resource tree to slice and dice the memblocks that are candidate for kexec_file_load(), but I'd like some consensus on whether this is the right way to address the issue. Without something like this, kexec_file_load() is not usable on arm64, so I'm pretty eager to see the back of this bug. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Date: Wed, 12 May 2021 19:04:24 +0100 Message-ID: <87fsyroml3.wl-maz@kernel.org> From: Marc Zyngier Subject: Re: [PATCH 0/2] arm64: kexec_file_load vs memory reservations In-Reply-To: <20210429133533.1750721-1-maz@kernel.org> References: <20210429133533.1750721-1-maz@kernel.org> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org Cc: Catalin Marinas , Dave Young , Moritz Fischer , Will Deacon , Ard Biesheuvel , Mark Rutland , James Morse , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Eric Biederman , Bhupesh Sharma , AKASHI Takahiro , kernel-team@android.com + Dave Young, which I accidentally missed in my initial post On Thu, 29 Apr 2021 14:35:31 +0100, Marc Zyngier wrote: > > It recently became apparent that using kexec with kexec_file_load() on > arm64 is pretty similar to playing Russian roulette. > > Depending on the amount of memory, the HW supported and the firmware > interface used, your secondary kernel may overwrite critical memory > regions without which the secondary kernel cannot boot (the GICv3 LPI > tables being a prime example of such reserved regions). > > It turns out that there is at least two ways for reserved memory > regions to be described to kexec: /proc/iomem for the userspace > implementation, and memblock.reserved for kexec_file. And of course, > our LPI tables are only reserved using the resource tree, leading to > the aforementioned stamping. Similar things could happen with ACPI > tables as well. > > On my 24xA53 system artificially limited to 256MB of RAM (yes, it > boots with that little memory), trying to kexec a secondary kernel > failed every times. I can only presume that this was mostly tested > using kdump, which preserves the entire kernel memory range. > > This small series aims at triggering a discussion on what are the > expectations for kexec_file, and whether we should unify the two > reservation mechanisms. > > And in the meantime, it gets things going... > > Marc Zyngier (2): > firmware/efi: Tell memblock about EFI reservations > ACPI: arm64: Reserve the ACPI tables in memblock > > arch/arm64/kernel/acpi.c | 1 + > drivers/firmware/efi/efi.c | 23 ++++++++++++++++++++++- > 2 files changed, 23 insertions(+), 1 deletion(-) Any comment on this? I've separately started working on using the resource tree to slice and dice the memblocks that are candidate for kexec_file_load(), but I'd like some consensus on whether this is the right way to address the issue. Without something like this, kexec_file_load() is not usable on arm64, so I'm pretty eager to see the back of this bug. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec