Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2404030pxb; Sat, 30 Jan 2021 01:19:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJx7O9oa2mlhwbww75YKXcMVbTqCL0ruzEQTBfMxvTxCOexL1bZt8o4ELZaLAQJxbJD7rTRu X-Received: by 2002:aa7:cd87:: with SMTP id x7mr9684543edv.210.1611998380876; Sat, 30 Jan 2021 01:19:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611998380; cv=none; d=google.com; s=arc-20160816; b=g2zoLMu4+f5ovJhYz8XUihh4ArZT3W2XyFkUJtnfPFlnqR2LNh+W0V+qPiskIHVfzl js6O9a0DxWzEY1gH+PmkVr79oy/iCEXHQF6RpybM1iVYJtoDlPVhGK+A/2cIr0MdWo6J LKJfzrsTg5t3lyd3Hv9DXAKRU+LPltydN9dNlky5NONcrTlPDmghsuf3hUeeRfRc30h5 Y+D+kR1m1rgzFZ9accVub5Qx60NEbMdJi8B6bg0krekZMFbPPpV4KYCNMNu6RKN4++oc 2WvCs18nkDHSqodBYVDahS76cdoAQ7tjncXKBtYOXqMD0zkzXWCORl7hxaLqQvJqjgLg rj+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=0/4+gI+uIAQET20GRdItOQQlqDUwwxD0rMN2MXRL1Tc=; b=Su3wa2A4VBbeckmhlY8aCNzhTRlYm3cFcahGReGMc1oqd/+7WC1T3TaxJnfJSSRZZf 3pqXJgKswverP+/+2GC79L6WdwkwczUDdUJeJ5QVtmmMHc6RfI9I16O9KVHoJzeMilP9 zZ3bqO+B+cHjf9EhH0zNzA48kwwLa3BxClMngSNuaI/0iaoNBJIIMVU42aa8JOlUOfTX htxtz2BJ7qsahaIEy9ioqL/hGmysNPEtmCjfUQ9TmNqMVmA5/Aq9IHklqqmCq9dEqklF 4T/3amCd9f4+olmQgFM8wvBMgzZExe2qKb0QVXz1MxJoYU2z/uK6iJdNE1wE3bqHstjx j7kw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g5si7136372edj.194.2021.01.30.01.19.17; Sat, 30 Jan 2021 01:19:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230178AbhA3JQ4 (ORCPT + 99 others); Sat, 30 Jan 2021 04:16:56 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:11951 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231901AbhA3JNB (ORCPT ); Sat, 30 Jan 2021 04:13:01 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4DSQFj45tRzjFJ3; Sat, 30 Jan 2021 15:05:13 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.498.0; Sat, 30 Jan 2021 15:06:07 +0800 From: Chen Zhou To: , , , , , , , , , , , CC: , , , , , , , , , , , , , kernel test robot Subject: [PATCH v14 06/11] x86/elf: Move vmcore_elf_check_arch_cross to arch/x86/include/asm/elf.h Date: Sat, 30 Jan 2021 15:10:20 +0800 Message-ID: <20210130071025.65258-7-chenzhou10@huawei.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210130071025.65258-1-chenzhou10@huawei.com> References: <20210130071025.65258-1-chenzhou10@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move macro vmcore_elf_check_arch_cross from arch/x86/include/asm/kexec.h to arch/x86/include/asm/elf.h to fix the following compiling warning: make ARCH=i386 In file included from arch/x86/kernel/setup.c:39:0: ./arch/x86/include/asm/kexec.h:77:0: warning: "vmcore_elf_check_arch_cross" redefined # define vmcore_elf_check_arch_cross(x) ((x)->e_machine == EM_X86_64) In file included from arch/x86/kernel/setup.c:9:0: ./include/linux/crash_dump.h:39:0: note: this is the location of the previous definition #define vmcore_elf_check_arch_cross(x) 0 The root cause is that vmcore_elf_check_arch_cross under CONFIG_CRASH_CORE depend on CONFIG_KEXEC_CORE. Commit 2db65f1db17d ("x86: kdump: move reserve_crashkernel[_low]() into crash_core.c") triggered the issue. Suggested by Mike, simply move vmcore_elf_check_arch_cross from arch/x86/include/asm/kexec.h to arch/x86/include/asm/elf.h to fix the warning. Fixes: 2db65f1db17d ("x86: kdump: move reserve_crashkernel[_low]() into crash_core.c") Reported-by: kernel test robot Suggested-by: Mike Rapoport Signed-off-by: Chen Zhou --- arch/x86/include/asm/elf.h | 3 +++ arch/x86/include/asm/kexec.h | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h index 66bdfe838d61..5333777cc758 100644 --- a/arch/x86/include/asm/elf.h +++ b/arch/x86/include/asm/elf.h @@ -94,6 +94,9 @@ extern unsigned int vdso32_enabled; #define elf_check_arch(x) elf_check_arch_ia32(x) +/* We can also handle crash dumps from 64 bit kernel. */ +# define vmcore_elf_check_arch_cross(x) ((x)->e_machine == EM_X86_64) + /* SVR4/i386 ABI (pages 3-31, 3-32) says that when the program starts %edx contains a pointer to a function which might be registered using `atexit'. This provides a mean for the dynamic linker to call DT_FINI functions for diff --git a/arch/x86/include/asm/kexec.h b/arch/x86/include/asm/kexec.h index 2b18f918203e..6fcae01a9cca 100644 --- a/arch/x86/include/asm/kexec.h +++ b/arch/x86/include/asm/kexec.h @@ -72,9 +72,6 @@ struct kimage; /* The native architecture */ # define KEXEC_ARCH KEXEC_ARCH_386 - -/* We can also handle crash dumps from 64 bit kernel. */ -# define vmcore_elf_check_arch_cross(x) ((x)->e_machine == EM_X86_64) #else /* Maximum physical address we can use pages from */ # define KEXEC_SOURCE_MEMORY_LIMIT (MAXMEM-1) -- 2.20.1