| From 1a7cbcb07402781822a256688c39a535f651aaa9 Mon Sep 17 00:00:00 2001 |
| From: Sasha Levin <sashal@kernel.org> |
| Date: Tue, 20 Apr 2021 09:47:42 +0200 |
| Subject: x86/platform/uv: Fix !KEXEC build failure |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| From: Ingo Molnar <mingo@kernel.org> |
| |
| [ Upstream commit c2209ea55612efac75de0a58ef5f7394fae7fa0f ] |
| |
| When KEXEC is disabled, the UV build fails: |
| |
| arch/x86/platform/uv/uv_nmi.c:875:14: error: ‘uv_nmi_kexec_failed’ undeclared (first use in this function) |
| |
| Since uv_nmi_kexec_failed is only defined in the KEXEC_CORE #ifdef branch, |
| this code cannot ever have been build tested: |
| |
| if (main) |
| pr_err("UV: NMI kdump: KEXEC not supported in this kernel\n"); |
| atomic_set(&uv_nmi_kexec_failed, 1); |
| |
| Nor is this use possible in uv_handle_nmi(): |
| |
| atomic_set(&uv_nmi_kexec_failed, 0); |
| |
| These bugs were introduced in this commit: |
| |
| d0a9964e9873: ("x86/platform/uv: Implement simple dump failover if kdump fails") |
| |
| Which added the uv_nmi_kexec_failed assignments to !KEXEC code, while making the |
| definition KEXEC-only - apparently without testing the !KEXEC case. |
| |
| Instead of complicating the #ifdef maze, simplify the code by requiring X86_UV |
| to depend on KEXEC_CORE. This pattern is present in other architectures as well. |
| |
| ( We'll remove the untested, 7 years old !KEXEC complications from the file in a |
| separate commit. ) |
| |
| Fixes: d0a9964e9873: ("x86/platform/uv: Implement simple dump failover if kdump fails") |
| Signed-off-by: Ingo Molnar <mingo@kernel.org> |
| Cc: Mike Travis <travis@sgi.com> |
| Cc: linux-kernel@vger.kernel.org |
| Signed-off-by: Sasha Levin <sashal@kernel.org> |
| --- |
| arch/x86/Kconfig | 1 + |
| 1 file changed, 1 insertion(+) |
| |
| diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig |
| index 95aefc375200..4960c6e1b082 100644 |
| --- a/arch/x86/Kconfig |
| +++ b/arch/x86/Kconfig |
| @@ -564,6 +564,7 @@ config X86_UV |
| depends on X86_EXTENDED_PLATFORM |
| depends on NUMA |
| depends on EFI |
| + depends on KEXEC_CORE |
| depends on X86_X2APIC |
| depends on PCI |
| help |
| -- |
| 2.30.2 |
| |