From patchwork Mon Jul 23 01:57:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 10539505 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7C40B17FD for ; Mon, 23 Jul 2018 01:59:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 628142847F for ; Mon, 23 Jul 2018 01:59:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51E4D28488; Mon, 23 Jul 2018 01:59:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D02A72847F for ; Mon, 23 Jul 2018 01:59:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject: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=Qe2FmIxAQa+P+pUmGiVqxGCz98X6uFh8hQVv9B/2bWo=; b=up2 PhkaqGaKI5b6E9BPb7kqgJ7aIgeY6Gq4qyB4mYfpb0jde4qFkRQQ95p+NQgrR9A0Sm7GPwB6cSrue lxTDXXt1VZb2nYa4trAQmDQmFS830T6YknF19T6PcDYeWvldhAgYBm3+FRUBTH3pQ4H4uY6BkxzCi z74b43/Uaka8nZVVZtR20LMbbJOQSb+m51OPIYwpa48hqptMLDH/rRQIjljn0DWLujVCzuj+KhwJ2 n9tR1Fa02jmoDEz9+N6PTOH9j+zfbRp6XYtZiRQrsmCxp+z8Tf6aPdy6ZVme0KR6eQ3o1xYKDcbSj tqC2Bp8MmvrcdtpxhLPnt8I08kd2bkg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhQ82-000195-T8; Mon, 23 Jul 2018 01:59:14 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhQ7z-00016d-Aq for linux-arm-kernel@lists.infradead.org; Mon, 23 Jul 2018 01:59:13 +0000 Received: by mail-pg1-x542.google.com with SMTP id v13-v6so11056420pgr.10 for ; Sun, 22 Jul 2018 18:59:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=aQ5nNiDR2NMeUvnpStbd7qXhG/8pAoljy1wl8r3yD+E=; b=OmqliB2uDJ3jxMPiIEurbLWu+GE4eDctEuWfSDq21m8Bc++xSDvE/dIAgeQNh86ghF qDw8wG32XGYYbAR+uZWrkti9NvhDl9OLZ7lMy+lOHQhjYwYpO/Fi4Il7I9CAJXj05vG9 A3r57+0CMAO7mYKxx0TCINFxCdDIt96dv+OcI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=aQ5nNiDR2NMeUvnpStbd7qXhG/8pAoljy1wl8r3yD+E=; b=gOaXQh7/yy8DF2ergPDAGOi4n0Z9yRWH/vdY1n6D2KO6BuYrv6ro3PnDF5dGsNPHg/ 3Pqey63iNU+IEmpKqu82OxCO29goIrFAloxjKsIrsFWxdhW0jOSDjBOmroKE20tPAVbP zJMrby65YrbZHITwzlNA95TOS6woQd8SFUVKkp6xC2X9v5ovzKyGXdGm8I0roQUjoavp Ll2LF7fHPKi1uHTjgl9QSI3vZijIDjQ/wGvKMMDTp3hCLM8+odhd7tbwuvbvb0iM5uQq d3rbac4bjuWZcBfMrM2KNOwNflojf5mXrxDmRHqysZqJdPFCOFleUevskJaWF7BjpSsa sqaw== X-Gm-Message-State: AOUpUlHgizGFf3iO26FcdPFP6uYTS3AhIPM4C9PCXAhpjPMCjL6sdIhp nJHmBv8hyvCD2CYczV1gtdI+7Q== X-Google-Smtp-Source: AAOMgpdhPgDRYMJp9p43LIJG3KmVuVko+qEWWuuO7Pn9TvHnnDVN/PiCL2XMs99x0+i+L7ZLoMli8Q== X-Received: by 2002:a65:6411:: with SMTP id a17-v6mr10217732pgv.287.1532311140241; Sun, 22 Jul 2018 18:59:00 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id q5-v6sm7962227pgv.61.2018.07.22.18.58.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Jul 2018 18:58:59 -0700 (PDT) From: AKASHI Takahiro To: catalin.marinas@arm.com, will.deacon@arm.com, rjw@rjwysocki.net, lenb@kernel.org, ard.biesheuvel@linaro.org Subject: [PATCH v4 0/5] arm64: kexec, kdump: fix boot failures on acpi-only system Date: Mon, 23 Jul 2018 10:57:27 +0900 Message-Id: <20180723015732.24252-1-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.18.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180722_185911_367374_117391FF X-CRM114-Status: GOOD ( 12.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, lorenzo.pieralisi@arm.com, graeme.gregory@linaro.org, al.stone@linaro.org, bhsharma@redhat.com, tbaicar@codeaurora.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, AKASHI Takahiro , james.morse@arm.com, hanjun.guo@linaro.org, sudeep.holla@arm.com, dyoung@redhat.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch series is a set of bug fixes to address kexec/kdump failures which are sometimes observed on ACPI-only system and reported in LAK-ML before. In short, the phenomena are: 1. kexec'ed kernel can fail to boot because some ACPI table is corrupted by a new kernel (or other data) being loaded into System RAM. Currently kexec may possibly allocate space ignoring such "reserved" regions. We will see no messages after "Bye!" 2. crash dump (kdump) kernel can fail to boot and get into panic due to an alignment fault when accessing ACPI tables. This can happen because those tables are not always properly aligned while they are mapped non-cacheable (ioremap'ed) as they are not recognized as part of System RAM under the current implementation. After discussing several possibilities to address those issues, the agreed approach, in my understanding, is * to add resource entries for every "reserved", i.e. memblock_reserve(), regions to /proc/iomem. (NOMAP regions, also marked as "reserved," remains at top-level for backward compatibility. User-space can tell the difference between reserved-system-ram and reserved-address-space.) * For case (1), user space (kexec-tools) should rule out such regions in searching for free space for loaded data. * For case (2), the kernel should access ACPI tables by mapping them with appropriate memory attributes described in UEFI memory map. (This means that it doesn't require any changes in /proc/iomem, and hence user space.) Please find past discussions about /proc/iomem in [1]. --- more words from James --- Our attempts to fix this just in the kernel reached a dead end, because Kdump needs to include reserved-system-ram, whereas kexec has to avoid it. User-space needs to be able to tell reserved-system-ram and reserved-address-space apart. Hence we need to expose that information, and pick it up in user-space. Patched-kernel and unpatch-user-space will work the same way it does today, as the additional reserved regions are ignored by user-space. Unpatched-kernel and patched-user-space will also work the same way it does today as the additional reserved regions are missing. --->8--- Patch#1 addresses kexec case, for which you are also required to update user space. See necessary patches in [2]. If you want to review Patch#1, please also take a look at and review [2]. Patch#2, #3, #4 and #5 address the kdump case above. Changes in v4 (2018, July 23, 2018) * correct configuration dependency for ACPI (patch#2) Changes in v3.1 (2018, July 10, 2018) * add Ard's patch[4] to this patch set Changes in v3 (2018, July 9, 2018) * drop the v2's patch#3, preferring [4] Changes in v2 (2018, June 19, 2018) * re-organise v1's patch#2 and #3 into v2's #2, #3 and #4 not to break bisect [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2018-March/565980.html [2] https://git.linaro.org/people/takahiro.akashi/kexec-tools.git arm64/resv_mem [3] http://lists.infradead.org/pipermail/linux-arm-kernel/2018-April/573655.html [4] https://marc.info/?l=linux-efi&m=152930773507524&w=2 AKASHI Takahiro (3): drivers: acpi: add dependency of EFI for arm64 efi/arm: map UEFI memory map even w/o runtime services enabled arm64: acpi: fix alignment fault in accessing ACPI Ard Biesheuvel (1): efi/arm: preserve early mapping of UEFI memory map longer for BGRT James Morse (1): arm64: export memblock_reserve()d regions via /proc/iomem arch/arm64/include/asm/acpi.h | 23 ++++++++++++------ arch/arm64/kernel/acpi.c | 11 +++------ arch/arm64/kernel/setup.c | 38 ++++++++++++++++++++++++++++++ drivers/acpi/Kconfig | 2 +- drivers/firmware/efi/arm-init.c | 1 - drivers/firmware/efi/arm-runtime.c | 16 +++++++------ 6 files changed, 67 insertions(+), 24 deletions(-)