Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1858816ybp; Sat, 5 Oct 2019 00:38:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqwF6FswF46V6On6ugGyFWBtRzohuQWArEtwIrniT3RcFLfjwx/rztCGlLPOOG/pCqRoVYEJ X-Received: by 2002:a17:906:4cc3:: with SMTP id q3mr11879987ejt.176.1570261099947; Sat, 05 Oct 2019 00:38:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570261099; cv=none; d=google.com; s=arc-20160816; b=wEs6Ehg14dEtY0N7shXLjEB6U0/RcYOUXAWV0Pw9vdWQPNVUs5H3G2lwNiycJY0Dx/ kMSSbEZRtOzEzM9wLQiT6EwrEHwSKeapIEnL5dJkw0d4bD5NFeMpl339ty8kSr56hNq2 I6UWk6CMvZ50n/E8f6YVfY8O/S9oBZWv4ZRlf40as6BBkMuaAptF81LZBSubTBua1tr8 Cbmih+qfIWXGZ8mCiqHj1yeXQmoTNfHTBkBCJTWReK4aGisUszT6zBVJqhqnDPldmodU ORuddf8Q2qJe+BT4syNi515UvEg83N72LhVewgJFPIPjrkGTD64lJjUg8RgslcVKrqY5 0rxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Sf5ePTEqZkKFYoIitpjcLWBJcma+hqmi5OwXf59WZQQ=; b=CrVT1+yskkagXKVuS+anyE9yN+ez/02GYzgkJ8YtsNY2t6Geeh6KG0La/NTzdHF6Du /IXXQ2qiFOItAGCgci9jqiz6GWQZoI9OOKuvdflb2gIT140wIqWtr51pB5G6TPmZRv2S gx7z4khhbb02hiF78rwgdxz1W2u5M4h525S02OX3kk44gQjDCXjRi5SxqS4/IKYeUyYC l/4h0ML8ZD9f0bk16UZGchNIlqwZxaRnCgaC//An3VMcLAYkIzuNucla9KzurVBu9lT0 lPrjQW5GFVGmx93Saey0oWokxZMa9Gd9ig5cjUQmHf+GMuxI6p9xEgZyWTQwsnrehk6L U4vA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1si4585059edn.93.2019.10.05.00.37.56; Sat, 05 Oct 2019 00:38:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726831AbfJEHfZ (ORCPT + 99 others); Sat, 5 Oct 2019 03:35:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47198 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725862AbfJEHfY (ORCPT ); Sat, 5 Oct 2019 03:35:24 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CB8A2C049E17; Sat, 5 Oct 2019 07:35:23 +0000 (UTC) Received: from localhost.localdomain (ovpn-12-49.pek2.redhat.com [10.72.12.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8A7605D9DC; Sat, 5 Oct 2019 07:35:12 +0000 (UTC) Subject: Re: [PATCH] x86/kdump: Fix 'kmem -s' reported an invalid freepointer when SME was active To: Baoquan He , "Eric W. Biederman" Cc: Dave Young , linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org, jgross@suse.com, dhowells@redhat.com, Thomas.Lendacky@amd.com, kexec@lists.infradead.org, Vivek Goyal References: <20190920035326.27212-1-lijiang@redhat.com> <20190927051518.GA13023@dhcp-128-65.nay.redhat.com> <87r241piqg.fsf@x220.int.ebiederm.org> <20190928000505.GJ31919@MiWiFi-R3L-srv> <875zldp2vj.fsf@x220.int.ebiederm.org> <20190928030910.GA5774@MiWiFi-R3L-srv> <87zhimks5j.fsf@x220.int.ebiederm.org> <20191001074012.GK31919@MiWiFi-R3L-srv> From: lijiang Message-ID: <7e97421d-d9a8-9d57-1aa0-406039f8421d@redhat.com> Date: Sat, 5 Oct 2019 15:35:07 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20191001074012.GK31919@MiWiFi-R3L-srv> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sat, 05 Oct 2019 07:35:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2019年10月01日 15:40, Baoquan He 写道: > On 09/30/19 at 05:14am, Eric W. Biederman wrote: >> Baoquan He writes: >>>> needs a little better description. I know it is not a lot on modern >>>> systems but reserving an extra 1M of memory to avoid having to special >>>> case it later seems in need of calling out. >>>> >>>> I have an old system around that I think that 640K is about 25% of >>>> memory. >>> >>> Understood. Basically 640K is wasted in this case. But we only do like >>> this in SME case, a condition checking is added. And system with SME is >>> pretty new model, it may not impact the old system. >> >> The conditional really should be based on if we are reserving memory >> for a kdump kernel. AKA if crash_kernel=XXX is specified on the kernel >> command line. >> >> At which point I think it would be very reasonable to unconditionally >> reserve the low 640k, and make the whole thing a non-issue. This would >> allow the kdump code to just not do anything special for any of the >> weird special case. >> >> It isn't perfect because we need a page or so used in the first kernel >> for bootstrapping the secondary cpus, but that seems like the least of >> evils. Especially as no one will DMA to that memory. >> >> So please let's just change what memory we reserve when crash_kernel is >> specified. > > Yes, makes sense, thanks for pointing it out. > Sorry for the delay and thanks for your comment, Eric, Baoquan and Dave Young. I will improve patch log and add the extra condition crash_kernel. I will post v2 later. Thanks. Lianbo >> >>>> How we interact with BIOS tables in the first 640k needs some >>>> explanation. Both in the first kernel and in the crash kernel. >>> >>> Yes, totally agree. >>> >>> Those BIOS tables have been reserved as e820 reserved regions and will >>> be passed to kdump kernel for reusing. Memblock reserved 640K doesn't >>> mean it will cover the whole [0, 640K) region, it only searches for >>> available system RAM from memblock allocator. >> >> Careful with that assumption. My memory is that the e820 memory map >> frequently fails to cover areas like the real mode interrupt descriptor >> table at address 0. > > OK, will think more about this. Thanks. >