From patchwork Wed Jul 25 23:59:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 10544945 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 401EB139A for ; Wed, 25 Jul 2018 23:59:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F6022A9C4 for ; Wed, 25 Jul 2018 23:59:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23CBE2A9D4; Wed, 25 Jul 2018 23:59:57 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C26952A9C4 for ; Wed, 25 Jul 2018 23:59:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728745AbeGZBN7 (ORCPT ); Wed, 25 Jul 2018 21:13:59 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:36650 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728619AbeGZBNl (ORCPT ); Wed, 25 Jul 2018 21:13:41 -0400 Received: by mail-pf1-f193.google.com with SMTP id d14-v6so2200495pfo.3 for ; Wed, 25 Jul 2018 16:59:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hIvpKGKNqRxV3JggszEiPqiqS8x7Has4uKzatQ8KMas=; b=VgwH9ehGKsvLCpNCJBZ3LT/BPS3kwPfYyYKCdvQLTjgI2AWqFcsKmr1fkMCFT/BbGJ S85GvHFFcSzPQU1l4YKlJHpcQQ6zcChxOOFcnSLBdTSbPFOu+7ixg2949tYvLMmtAbT6 2QGcFpKlnIoPWeoNKDmXnDDeV9cbZhwWm3nzfzTXZEf47Lg5/GueHAjRZMS8Mb0s6KjY +JZYhVbDDVeG9TLa7leCTOOcozVaPDpVoDi1yB+IgzN6vhJwflPRtnuL5BdgKpU2KzI3 fgKdrprTyv4+bS0dD/o9uBqWURDlqMIN9XC4N2OwkVBsdoy7yKlnbK4z7xkf4crXj6qa NK/A== 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:in-reply-to :references; bh=hIvpKGKNqRxV3JggszEiPqiqS8x7Has4uKzatQ8KMas=; b=sXcs6+WRexySlx97cz4U4cuTUZ0s5mp6g7wK8jGgOCdJASNZZAfRC1ljjaLm0i0vWS r/ufqFU4iDubxNj8juLhW2oa/tUOnrmnxP5E1bitzEsBdihEoFDCGI+t5Js8D66gr6fY r43JAWFIilxOOZyb3i9dkNu4ypuRLyOG3mI7X0gImVGkvtIhQX6CAyiRcjICekbcA2f8 8pCP0y9EbPMuXlaQAAH1gYXda68PyEi0XbdrHQMV72szMR2V9FDSQq/HJ9R1EmpLAGC8 EhLdMROrEzZUnDe1W1PovX3RlNWseGeGCvkeH81tT9QVOj43CP321FjBymgigkPqkGdS oVtg== X-Gm-Message-State: AOUpUlHC7mm0kuI78DQsDOxdnaXpqK9TobwCynN8o0PnX0ykN/G4xgvu rTbE0b7LBXglof0qfgxQfvondg== X-Google-Smtp-Source: AAOMgpdZj07WntgfPeGIVoOtHqMpHSMjPYh78SgKm6VEPVadyXrVGLL9NS5jXIHQ0H+CV4VWdQypBw== X-Received: by 2002:a63:5055:: with SMTP id q21-v6mr21675081pgl.397.1532563176737; Wed, 25 Jul 2018 16:59:36 -0700 (PDT) Received: from vader.thefacebook.com ([2620:10d:c090:180::1:8d38]) by smtp.gmail.com with ESMTPSA id 65-v6sm23188753pfq.81.2018.07.25.16.59.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jul 2018 16:59:36 -0700 (PDT) From: Omar Sandoval To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Andrew Morton Cc: Alexey Dobriyan , Eric Biederman , James Morse , Bhupesh Sharma , kernel-team@fb.com Subject: [PATCH v4 8/9] crash_core: use VMCOREINFO_SYMBOL_ARRAY() for swapper_pg_dir Date: Wed, 25 Jul 2018 16:59:19 -0700 Message-Id: X-Mailer: git-send-email 2.18.0 In-Reply-To: References: Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Omar Sandoval This is preparation for allowing CRASH_CORE to be enabled for any architecture. swapper_pg_dir is always either an array or a macro expanding to NULL. In the latter case, VMCOREINFO_SYMBOL() won't work, as it tries to take the address of the given symbol: #define VMCOREINFO_SYMBOL(name) \ vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name) Instead, use VMCOREINFO_SYMBOL_ARRAY(), which uses the value: #define VMCOREINFO_SYMBOL_ARRAY(name) \ vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)name) This is the same thing for the array case but isn't an error for the macro case. Signed-off-by: Omar Sandoval --- kernel/crash_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/crash_core.c b/kernel/crash_core.c index b66aced5e8c2..e7b4025c7b24 100644 --- a/kernel/crash_core.c +++ b/kernel/crash_core.c @@ -401,7 +401,7 @@ static int __init crash_save_vmcoreinfo_init(void) VMCOREINFO_SYMBOL(init_uts_ns); VMCOREINFO_SYMBOL(node_online_map); #ifdef CONFIG_MMU - VMCOREINFO_SYMBOL(swapper_pg_dir); + VMCOREINFO_SYMBOL_ARRAY(swapper_pg_dir); #endif VMCOREINFO_SYMBOL(_stext); VMCOREINFO_SYMBOL(vmap_area_list);