Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2993008ybg; Mon, 28 Oct 2019 05:50:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqx63mXkU7/srh020fvZ1YOBdFHpjWR55xJas4VMaYK3BGPwe59j2lV7wJeQszArQZbJpivp X-Received: by 2002:a17:906:f48:: with SMTP id h8mr9149605ejj.106.1572267023173; Mon, 28 Oct 2019 05:50:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572267023; cv=none; d=google.com; s=arc-20160816; b=08o+9NBscULCBShFdeJaLhV57039a5ck6teBdTnHQP/QtuMm1S2H6nYcq5cuqfrZ14 vGposHSYKnM06bp0TTg8HTWDGYDqWm4dr3feYfrAB9YltBEuYqQo4c7S1t82yCxrbXD+ OcCPsWXATyll9RRmlO/qyNdoGJkzXEJzW3hNBzxHcoiOG7WMN5c9QrK7geJ6J9g5hqcW MsJs2D56ITPCTApdmWQxsX5WDIqhiH61VJ9+6HO09Kh3g5wBjB4buuFjy5sVsk0V6JMF V8jj/2+BZiq51U2oxNBxG2FuLJQGlW3nOdvdHJuWgpQkn2xE2P+ZwKhuyjXpsX27F6FI 21ow== 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:message-id:date :subject:cc:to:from:dkim-signature; bh=JamJ4gnvFxwjftOwafZltk5nfJrJj67jqUAhqzujMfY=; b=KQ3csdWDUKZFRzXOvXhF7z4jE/x5yToQglqSjy+VQEfGZmy73sTNtHihcpLp01XPnL qJNNYXf38uqhz4XgPRxMBWqB6nLT+GSGm2/f/dzYK27NlZWjKiQOuEcJ3+Ko5yzmlR1+ 7uWxQWiRtsNXs6mKYKUPhqqa9sqTAWbLbbz/fE8SJs+CK3X7tKKkt7eTxb9aBpFIyG+4 XtHfEJ5gw6ly5CbHfocs2knM3rxGSr9y6pQ3ygVKAjMe70UrEtqXvhUVby96yLT0U3Hv qhsrY6f7xKkr/8xN2feCLnCFBg3JkF+bZMRcQa6Zrsoh8tI4Hl7MTgkQ+x5pERNMBHT8 b9RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LOMqt7HL; 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=pass (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 e10si6281783ejk.416.2019.10.28.05.49.59; Mon, 28 Oct 2019 05:50:23 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LOMqt7HL; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729356AbfJ1CqP (ORCPT + 99 others); Sun, 27 Oct 2019 22:46:15 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:55436 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726934AbfJ1CqP (ORCPT ); Sun, 27 Oct 2019 22:46:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572230773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JamJ4gnvFxwjftOwafZltk5nfJrJj67jqUAhqzujMfY=; b=LOMqt7HLBtq7PKMv83oy2ieueUeLkp7YCnKXjojbpzLJ5pCHoZVxBnbBUI0i2YGLWO0KXV HlRFT5nomRPd1JqOHt0sPW3YCxgYTgbVrs08q1HXxzu8KfjEwVbxoymqt+0KLOQegK6DVq sdaMrXRWiEH+5A7fU07Y0u2onlsXVok= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-377-2dx9YDZ-P22704eCoESnTg-1; Sun, 27 Oct 2019 22:46:10 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EBAAC80183E; Mon, 28 Oct 2019 02:46:08 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-12-41.pek2.redhat.com [10.72.12.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 58C4260A9F; Mon, 28 Oct 2019 02:45:56 +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, d.hatayama@fujitsu.com, horms@verge.net.au, kexec@lists.infradead.org Subject: [PATCH 0/2 v6] x86/kdump: Fix 'kmem -s' reported an invalid freepointer when SME was active Date: Mon, 28 Oct 2019 10:45:49 +0800 Message-Id: <20191028024551.4278-1-lijiang@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: 2dx9YDZ-P22704eCoESnTg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable 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(https://bugzilla.kernel.org/show_bug.cgi?id=3D204793). 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 two patches: [1] x86/kdump: always reserve the low 1MiB when the crashkernel option is specified 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: 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 Changes since v3: [1] Improve the first patch's log [2] Improve the third patch based on Eric's suggestions Changes since v4: [1] Correct some typos, and also improve the first patch's log [2] Add a new function kexec_reserve_low_1MiB() in kernel/kexec_core.c and which is called by reserve_real_mode(). (Suggested by Boris) Changes since v5: [1] Call the cmdline_find_option() instead of strstr() to check the crashkernel option. (Suggested by Hatayama) [2] Add a weak function kexec_reserve_low_1MiB() in kernel/kexec_core.c, and implement the kexec_reserve_low_1MiB() in arch/x86/kernel/ machine_kexec_64.c so that it does not cause the compile error on non-x86 kernel, and also ensures that it can work well on x86 kernel. Lianbo Jiang (2): x86/kdump: always reserve the low 1MiB when the crashkernel option is specified x86/kdump: clean up all the code related to the backup region arch/x86/include/asm/kexec.h | 10 ---- arch/x86/include/asm/purgatory.h | 10 ---- arch/x86/kernel/crash.c | 87 ++++-------------------------- arch/x86/kernel/machine_kexec_64.c | 62 ++++++--------------- arch/x86/purgatory/purgatory.c | 19 ------- arch/x86/realmode/init.c | 2 + include/linux/kexec.h | 2 + kernel/kexec_core.c | 3 ++ 8 files changed, 33 insertions(+), 162 deletions(-) --=20 2.17.1