From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934192AbeAMKsu (ORCPT + 1 other); Sat, 13 Jan 2018 05:48:50 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:40447 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933432AbeAMKss (ORCPT ); Sat, 13 Jan 2018 05:48:48 -0500 X-Google-Smtp-Source: ACJfBouh/PzgOEKDgUL5VFQVTIvOxx6dXyfgHrPGbE4AIaFEJkqSIB5fZ+DYJeFzk4zWAqH+bshZzA== Date: Sat, 13 Jan 2018 11:48:38 +0100 From: Ingo Molnar To: "Kirill A. Shutemov" Cc: Ingo Molnar , Andrew Morton , x86@kernel.org, Thomas Gleixner , "H. Peter Anvin" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Dave Young , Baoquan He , Vivek Goyal , kexec@lists.infradead.org, stable@vger.kernel.org Subject: Re: [PATCH] kdump: Write a correct address of mem_section into vmcoreinfo Message-ID: <20180113104838.ht57uooqk3fo546o@gmail.com> References: <20180112162532.35896-1-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180112162532.35896-1-kirill.shutemov@linux.intel.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: * Kirill A. Shutemov wrote: > Depending on configuration mem_section can now be an array or a pointer > to an array allocated dynamically. In most cases, we can continue to refer > to it as 'mem_section' regardless of what it is. > > But there's one exception: '&mem_section' means "address of the array" if > mem_section is an array, but if mem_section is a pointer, it would mean > "address of the pointer". > > We've stepped onto this in kdump code. VMCOREINFO_SYMBOL(mem_section) > writes down address of pointer into vmcoreinfo, not array as we wanted. > > Let's introduce VMCOREINFO_SYMBOL_ARRAY() that would handle the > situation correctly for both cases. > > Signed-off-by: Kirill A. Shutemov > Fixes: 83e3c48729d9 ("mm/sparsemem: Allocate mem_section at runtime for CONFIG_SPARSEMEM_EXTREME=y") > Cc: stable@vger.kernel.org > Acked-by: Baoquan He > Acked-by: Dave Young You forgot the Reported-by - I added that to the commit. Thanks, Ingo