Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3015215imm; Sun, 1 Jul 2018 10:20:09 -0700 (PDT) X-Google-Smtp-Source: AAOMgpetzSHLbgRlZKxQT1UAob7AdCSdcNl2qJKIWOke07v6UuBB6kTNLRPx3tM86Bjaw+ECJ8h3 X-Received: by 2002:a62:5601:: with SMTP id k1-v6mr22355355pfb.212.1530465609578; Sun, 01 Jul 2018 10:20:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530465609; cv=none; d=google.com; s=arc-20160816; b=MY1hPLVvrKnXJoIV9T/taQYSK6mjKqlUYHAEaaVndHVriMmznIwHPFEkpbgp5iHMGe ms6NCeU/9OVeticNvvO08z9s4vHXl7rAWAaRj1fvIPDxg2uaS2ddePq+F3QOysARpRJO Kzj9EiXsDr2EpjhhK23ZxhMwiBLldW5+n4xFLjl5OZ4fcuswNQgPI7zJdBJ0wZ9PUgku Tvm0vQSoZfC77L0SsGnCtQEvV04wjLnYNuj8rkonekgvmcGYvuWNb/eXigv0hf8XE1ay unOfMgXFN29A+1Egs5EXIxwmynNl2Ifsq/c6LHgUkQIsiVSVMNnWTQR10ZvqEvh20mV1 f91w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=+dSyyTg9aZi/PSdbEjDNa/GQoKDqdMkQ75fP1fC9cUU=; b=MVU7xkLMpuNYD0oXFaI95xSYd3nxWeRR4kZgDjXT+yA6HDch2g9fsgtNsFW1zww0EY 3IddZwwB7pqXQj3k1AfnS+4Lc2KrfFyS1WsLiGRXunJCy5uoIdTH8tMEqex7n4xTLswH PFMq/sbarbvkCXrAZYCqXh8YHdP9b+taLOTUXRak+Y33j9W6AOJLGlXcRpQQGUPnWMrO GC/0pO+fmJfiaGN1g/bUxgvPGKydIlHfxCZ2zpnV9tr6850doH7ERwz9WFaMWvVBPrqX c5B9suc+Il9NfOhz59RMsNje5FYwvvE1aUAW8uVeGYTI6Ztx2XmZbjl+MLv/puPbNAvQ Cnlw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b66-v6si14089108pfe.265.2018.07.01.10.19.55; Sun, 01 Jul 2018 10:20:09 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031046AbeGARSx (ORCPT + 99 others); Sun, 1 Jul 2018 13:18:53 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36802 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031659AbeGAQiz (ORCPT ); Sun, 1 Jul 2018 12:38:55 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7B936AA6; Sun, 1 Jul 2018 16:38:54 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mahesh Salgaonkar , Michael Ellerman Subject: [PATCH 4.17 053/220] powerpc/fadump: Unregister fadump on kexec down path. Date: Sun, 1 Jul 2018 18:21:17 +0200 Message-Id: <20180701160910.551321291@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160908.272447118@linuxfoundation.org> References: <20180701160908.272447118@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mahesh Salgaonkar commit 722cde76d68e8cc4f3de42e71c82fd40dea4f7b9 upstream. Unregister fadump on kexec down path otherwise the fadump registration in new kexec-ed kernel complains that fadump is already registered. This makes new kernel to continue using fadump registered by previous kernel which may lead to invalid vmcore generation. Hence this patch fixes this issue by un-registering fadump in fadump_cleanup() which is called during kexec path so that new kernel can register fadump with new valid values. Fixes: b500afff11f6 ("fadump: Invalidate registration and release reserved memory for general use.") Cc: stable@vger.kernel.org # v3.4+ Signed-off-by: Mahesh Salgaonkar Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/fadump.c | 3 +++ 1 file changed, 3 insertions(+) --- a/arch/powerpc/kernel/fadump.c +++ b/arch/powerpc/kernel/fadump.c @@ -1155,6 +1155,9 @@ void fadump_cleanup(void) init_fadump_mem_struct(&fdm, be64_to_cpu(fdm_active->cpu_state_data.destination_address)); fadump_invalidate_dump(&fdm); + } else if (fw_dump.dump_registered) { + /* Un-register Firmware-assisted dump if it was registered. */ + fadump_unregister_dump(&fdm); } }