From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: From: Marc Zyngier Subject: [PATCH 2/2] ACPI: arm64: Reserve the ACPI tables in memblock Date: Thu, 29 Apr 2021 14:35:33 +0100 Message-Id: <20210429133533.1750721-3-maz@kernel.org> In-Reply-To: <20210429133533.1750721-1-maz@kernel.org> References: <20210429133533.1750721-1-maz@kernel.org> MIME-Version: 1.0 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 , Will Deacon , Ard Biesheuvel , Mark Rutland , James Morse , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Eric Biederman , Bhupesh Sharma , AKASHI Takahiro , kernel-team@android.com Just like the EFI reservations, ACPI tables can be stamped over by kexec_file_load(), and the secondary kernel will be unable to recover from such corruption. It looks like our x86 friends have been there before, and have recently added some infratructure that does what we need since 1a1c130ab757 ("ACPI: tables: x86: Reserve memory occupied by ACPI tables"), though it appears to exist for different reasons. Let's call into acpi_reserve_initial_tables() early so that our tables are protected from the big bad kexec. Signed-off-by: Marc Zyngier --- arch/arm64/kernel/acpi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c index cada0b816c8a..5b5406c92ee4 100644 --- a/arch/arm64/kernel/acpi.c +++ b/arch/arm64/kernel/acpi.c @@ -233,6 +233,7 @@ void __init acpi_boot_table_init(void) if (earlycon_acpi_spcr_enable) early_init_dt_scan_chosen_stdout(); } else { + acpi_reserve_initial_tables(); acpi_parse_spcr(earlycon_acpi_spcr_enable, true); if (IS_ENABLED(CONFIG_ACPI_BGRT)) acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt); -- 2.29.2 _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec 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=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 78677C433B4 for ; Thu, 29 Apr 2021 13:37:47 +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 21AC76144B for ; Thu, 29 Apr 2021 13:37:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 21AC76144B 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: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:List-Owner; bh=Mk8HUdJ6FS3/Gm5cD2i45I9M9eNo7ng97gluZ8CkQ8I=; b=gm0IVPt/7Lz/6jmulXzdQW5HV bwJDmLE1pfimyOU8n8wI7qOUj6d2Z88EvG2n7RTKDB/efj48U19tojg6TTD2zkHBoqExfX+46bBny Mfu/Qbv6HyBLeXxNiohz2kRM2URUFbPIgvb38aZmFzqFbNXKJMRRAdSz2+gpxtqC7E1+O0T/S3Q3x HbWaBMRktkcJLCJyqbP1Ph+RQ0Fs7FDU92xPlacS54b3KxHQyWCYFf2jBPAZg03VGs6+3LFToI7Z5 7lcPU2CUkI8ma3KRwB3V3E1fXyTb7N30TyuEjgwLmnnBw1ZpGilLNxwjQVIpXMcbVoxG6WZQ41sUI EvxgPc0ew==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lc6qA-005htf-3p; Thu, 29 Apr 2021 13:36:26 +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 1lc6pZ-005hpX-Bz; Thu, 29 Apr 2021 13:35:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=DmokG4tCLbDXR0sDIxFdCaXdXPDoPm/J/6zKQ7hY2Zs=; b=qrU5a1AgvWRj2ZI+gZVAPYDmo1 Ef5vu+i8a9nFewnzp3iTvcw/TuL6LabYcRVG5RUO6pizTtnQta9HcUewVWQpvi8GwwzqifuZbBDtn ZYQzhEizyLRUri+r+Y2xRaoPwX11LfJwuXeq39WbG/avvwHouWAT5n1MkVR/YpdwQvH8EdZL0hKAs 8FGsJknaUBCWO7SCsOkPzUO+OG4TaL7cBf/Ks/qbzSOXDDD3o4DZ5Xd0RKqBUg0RqXzTueHkHslVx xqCqnFNF3qKpER7dpJlYr+lku1tqmfcIXV90O51ZEu24VkX0lXI9Rspl59EQ49syomeohWWWtD2oQ gsHHbV4w==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lc6pW-000eia-4X; Thu, 29 Apr 2021 13:35:48 +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 AE45861450; Thu, 29 Apr 2021 13:35:45 +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) (envelope-from ) id 1lc6pT-00A21L-SN; Thu, 29 Apr 2021 14:35:43 +0100 From: Marc Zyngier To: kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org Cc: Catalin Marinas , 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: [PATCH 2/2] ACPI: arm64: Reserve the ACPI tables in memblock Date: Thu, 29 Apr 2021 14:35:33 +0100 Message-Id: <20210429133533.1750721-3-maz@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210429133533.1750721-1-maz@kernel.org> References: <20210429133533.1750721-1-maz@kernel.org> 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, 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, 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-20210429_063546_228843_5F525B8D X-CRM114-Status: GOOD ( 13.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 Just like the EFI reservations, ACPI tables can be stamped over by kexec_file_load(), and the secondary kernel will be unable to recover from such corruption. It looks like our x86 friends have been there before, and have recently added some infratructure that does what we need since 1a1c130ab757 ("ACPI: tables: x86: Reserve memory occupied by ACPI tables"), though it appears to exist for different reasons. Let's call into acpi_reserve_initial_tables() early so that our tables are protected from the big bad kexec. Signed-off-by: Marc Zyngier --- arch/arm64/kernel/acpi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c index cada0b816c8a..5b5406c92ee4 100644 --- a/arch/arm64/kernel/acpi.c +++ b/arch/arm64/kernel/acpi.c @@ -233,6 +233,7 @@ void __init acpi_boot_table_init(void) if (earlycon_acpi_spcr_enable) early_init_dt_scan_chosen_stdout(); } else { + acpi_reserve_initial_tables(); acpi_parse_spcr(earlycon_acpi_spcr_enable, true); if (IS_ENABLED(CONFIG_ACPI_BGRT)) acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt); -- 2.29.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel