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.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 31C3CC433B4 for ; Thu, 13 May 2021 03:20:09 +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 A0E0F613C9 for ; Thu, 13 May 2021 03:20:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0E0F613C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com 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:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NfnGHRkYkpucah5Z6m1LD/UkVaSZCNyUo4Gy07iQMug=; b=JNpjVo9P7OjQJIkpWmhoRiCdT EtjbQKqEDpzmK3+2NiuO756ctPD8XGUQiseLRiOD89cSzMqO8q/ne4B7FQjE2UKgn0k75eBquebmu jlVV/akLQ+JqzmKhiGcILAJnaeMoSofW2ludU9XH5F6CKAKdWTRH+QxqZ+R5kbvZJ7GFwI3y+FaxB Vik63W38leycCqbuRfaRqixORSid/8eA3Yp34vc9JmsRVgetRkKYeAmqSTWHhdLCYINcWmgdhY2Nf +OD8hJZVg9vMR8aLlCxZkvq3boWZcVgeqWpf+XWNUHACAMzTmob6Mc1K8iS/gmntkZukIfDvGklck Blyxrxbng==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lh1rQ-004akL-WD; Thu, 13 May 2021 03:18:05 +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 1lh1rK-004ajk-H2 for linux-arm-kernel@desiato.infradead.org; Thu, 13 May 2021 03:17:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:In-Reply-To:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=4RHl70aJFUtyZqZU9OUxLf1rhckQqZVdAqDHKwNpMLE=; b=2aDZgd0YUZvDhYQLQxyabdIUaS uVF+eDjb5OeogM+ZNxZyKUh6Q4E/VdogJDO7r2iwIPCy6cO1DpgSXBX6rVIGnZm8i2nn20Nc1gOCV oQBDciyt942/s1oZjTty0/EziguNNhnVE+WEHLfi9CN9JeItjKeM5TtEkXwIfK/kxjSeLesSGOCnw GkfWJ+AdSf1sE1RvbYo22H5/Gx69iMv+EcM8xRlA9oGNcCGJr/INCvCObISJUASZ8rk+LRyd5wAf/ cY6rPxPotPdNDeepGG7i/3NMLvsDsFViy0/tejOvyQlCMLZSEAVSGef76Op3TaspVpjH4cKtRoteZ ZtMjKjLw==; Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lh1rH-00Ayvk-4o for linux-arm-kernel@lists.infradead.org; Thu, 13 May 2021 03:17:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620875873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4RHl70aJFUtyZqZU9OUxLf1rhckQqZVdAqDHKwNpMLE=; b=W3CDQ9Vvv/JfvFVb1QWSNKMmJAFV1N/AOeA0c+FpaC2xoCLr0SkF/3O1vovC3Ts012pwzD eyBCsNa1PV818hm4Lxz0SNTJcIjCbHnyIhAYp9F1k/1ysU8/IpKU6LfDPsrcTImT8F759O IZTqgS0U6zwTydZf7hCzfnBLkCanhs0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-355-c0KvayRdNbW-vy7XIF6-oA-1; Wed, 12 May 2021 23:17:51 -0400 X-MC-Unique: c0KvayRdNbW-vy7XIF6-oA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 195AC8049C5; Thu, 13 May 2021 03:17:49 +0000 (UTC) Received: from dhcp-128-65.nay.redhat.com (ovpn-12-207.pek2.redhat.com [10.72.12.207]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 562E360CE6; Thu, 13 May 2021 03:17:42 +0000 (UTC) Date: Thu, 13 May 2021 11:17:38 +0800 From: Dave Young To: Marc Zyngier Cc: kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Catalin Marinas , Moritz Fischer , Will Deacon , Ard Biesheuvel , Mark Rutland , James Morse , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Eric Biederman , Bhupesh Sharma , Pingfan Liu , AKASHI Takahiro , kernel-team@android.com Subject: Re: [PATCH 0/2] arm64: kexec_file_load vs memory reservations Message-ID: <20210513031503.GC45898@dhcp-128-65.nay.redhat.com> References: <20210429133533.1750721-1-maz@kernel.org> <87fsyroml3.wl-maz@kernel.org> MIME-Version: 1.0 In-Reply-To: <87fsyroml3.wl-maz@kernel.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dyoung@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210512_201755_396374_E506AC12 X-CRM114-Status: GOOD ( 35.94 ) 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 Hi Marc, On 05/12/21 at 07:04pm, Marc Zyngier wrote: > + 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. The arm64 memory reservation is tricky, I do not think I understand it correctly. Previously there were a lot discussion, Ard and AKASHI should know more about it, see if they can provide comments. About the problem you see, another way is to just add an arch weak function like powerpc: arch_kexec_locate_mem_hole, and walking resource tree for kexec_file_load as well. But I might be wrong since I did not follow up the arm64 specific history. > > Thanks, > > M. > > -- > Without deviation from the norm, progress is not possible. > Thanks Dave _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel