Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1701654ybp; Fri, 11 Oct 2019 19:23:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwyaQHgZ+HAhBXt7mW89sOlPHNv00tYCdF0fDsQlVB2J1tMZacVlTf/xHL/Uglxj7Pw8VVz X-Received: by 2002:aa7:d045:: with SMTP id n5mr16703181edo.24.1570846982035; Fri, 11 Oct 2019 19:23:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570846982; cv=none; d=google.com; s=arc-20160816; b=I1FEq6jt9qoM6Dm9OkQtTVY1/oWhs0pLUxtl5fwdTIZLuqFHP3GENBwJvO9jycfU6m rC10JOTV4gffMoLvI2P6RN7NtCOlC7OAmDgn8YAW8G8ZM/JsvMNQcyLZz/wUK7xYWQEX iG3vfJNOOt8IJn1GWB3qqnnVq5g1qj1ZvmFGouCVyZ+fshTOBjItMiu+8Vqje4S1S5x1 8xMMNEcFCLSpTyAtGlGQSNYGJQ2cCiCXOAKL9TeibE+DlMkvK6kl0FD0ZJDF8BURZGRH HcjgvYsW/crbJN/y5x9SWNkCx3Fk0uy/E0V7A3HKLBvqkcMZ7kV6cMDLMqFCMq56VjrR eelQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=Aah2WjtAubLNkdysMMFMfnuB3+eyeS+nFdFoZcwwP2I=; b=nkkYdTzufdyPoxKKvtGSnv5cplt0DpsHYDW9vOzWl/ji0ATy3LbY2cLSCoarO7DnNg R6AsgmCT7amKziqu5c9bPFTPKSmv/F9Faj4VmFGGYEKcu0QcLVX0UiLlGJbh24zZZksy 1F7wO5LA3D3H7RS+7n2q5IPZr569INUulSJSXLyrmtL0WfIayV+EfVTo6+pRI1xiqNqS KZNxvrbo2oBI2t25OC9CplehB/IjJP59cU5iDdZg9AgStJhZ0Xg676foHlewE/TVfakl O9n6HuMAKQ7UBlp6IlUnP2rdVhhRBaPOytMQU8xVf1QMDrsrQ8KBpfVOrUZS8If5w1b3 H+sw== 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 17si5936420ejt.403.2019.10.11.19.22.39; Fri, 11 Oct 2019 19:23:02 -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 S1728169AbfJLCV5 (ORCPT + 99 others); Fri, 11 Oct 2019 22:21:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35176 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726757AbfJLCV4 (ORCPT ); Fri, 11 Oct 2019 22:21:56 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4CBF110C0930; Sat, 12 Oct 2019 02:21:56 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-12-50.pek2.redhat.com [10.72.12.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8115710018F8; Sat, 12 Oct 2019 02:21:45 +0000 (UTC) From: Lianbo Jiang To: linux-kernel@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org, bhe@redhat.com, dyoung@redhat.com, jgross@suse.com, dhowells@redhat.com, Thomas.Lendacky@amd.com, ebiederm@xmission.com, vgoyal@redhat.com, kexec@lists.infradead.org Subject: [PATCH 0/3 v3] x86/kdump: Fix 'kmem -s' reported an invalid freepointer when SME was active Date: Sat, 12 Oct 2019 10:21:37 +0800 Message-Id: <20191012022140.19003-1-lijiang@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Sat, 12 Oct 2019 02:21:56 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In purgatory(), the main things are as below: [1] verify sha256 hashes for various segments. Lets keep these codes, and do not touch the logic. [2] copy the first 640k content to a backup region. Lets safely remove it and clean all code related to backup region. This patch series will remove the backup region, because the current handling of copying the first 640k runs into problems when SME is active. The low 1MiB region will always be reserved when the crashkernel kernel command line option is specified. And this way makes it unnecessary to do anything with the low 1MiB region, because the memory allocated later won't fall into the low 1MiB area. This series includes three patches: [1] Fix 'kmem -s' reported an invalid freepointer when SME was active The low 1MiB region will always be reserved when the crashkernel kernel command line option is specified, which ensures that the memory allocated later won't fall into the low 1MiB area. [2] x86/kdump cleanup: remove the unused crash_copy_backup_region() The crash_copy_backup_region() has never been used, so clean up the redundant code. [3] x86/kdump: clean up all the code related to the backup region Remove the backup region and clean up. Changes since v1: [1] Add extra checking condition: when the crashkernel option is specified, reserve the low 640k area. Changes since v2: [1] Reserve the low 1MiB region when the crashkernel option is only specified.(Suggested by Eric) [2] Remove the unused crash_copy_backup_region() [3] Remove the backup region and clean up [4] Split them into three patches Lianbo Jiang (3): x86/kdump: Fix 'kmem -s' reported an invalid freepointer when SME was active x86/kdump cleanup: remove the unused crash_copy_backup_region() x86/kdump: clean up all the code related to the backup region arch/x86/include/asm/crash.h | 1 - arch/x86/include/asm/kexec.h | 10 ---- arch/x86/include/asm/purgatory.h | 10 ---- arch/x86/kernel/crash.c | 91 ++++++------------------------ arch/x86/kernel/machine_kexec_64.c | 47 --------------- arch/x86/purgatory/purgatory.c | 19 ------- arch/x86/realmode/init.c | 11 ++++ 7 files changed, 27 insertions(+), 162 deletions(-) -- 2.17.1