From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70F00C76186 for ; Mon, 29 Jul 2019 19:40:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A09C20C01 for ; Mon, 29 Jul 2019 19:40:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429234; bh=uACrljbtjVrRz/5uwNaTP4YBY9lwZwFCt/Wsvp6Kf4U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=AzUt3LbrTJQfB5IwZU9Sw5OdZzjadWc06BgutHdJFLW3w58TUFkZ6izAWwKyO9rBY d+4yre8OxV8IwJKNPSQNt1pS5blxQailCUUVqxW+jvpmCzHloxFnSNMC79es10nOt8 mjRBQXx3OD8T4kZWHCe7Xh6ApspDpIec2f7lh654= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389173AbfG2Tkd (ORCPT ); Mon, 29 Jul 2019 15:40:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:55770 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389120AbfG2Tk2 (ORCPT ); Mon, 29 Jul 2019 15:40:28 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0009220C01; Mon, 29 Jul 2019 19:40:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429227; bh=uACrljbtjVrRz/5uwNaTP4YBY9lwZwFCt/Wsvp6Kf4U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xoegkL5NKcQLKMo9ws/dvLRlIrlrizqIWvj2HxOzgW2DaQfZ3AlK/rqIzlPr/SKOF i2RVX0tqc/IrLaEWoW7yWTXimIUVWH2Uy+ARR5qP+It85eXlZoVycarY1p04za83+q 3biFPBZemVBfGkcq9oR8wGeCNW3Tb34EqbOY2EuE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Lynch , "Gautham R. Shenoy" , Michael Ellerman , Sasha Levin Subject: [PATCH 4.19 030/113] powerpc/pseries/mobility: prevent cpu hotplug during DT update Date: Mon, 29 Jul 2019 21:21:57 +0200 Message-Id: <20190729190703.085037943@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190655.455345569@linuxfoundation.org> References: <20190729190655.455345569@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit e59a175faa8df9d674247946f2a5a9c29c835725 ] CPU online/offline code paths are sensitive to parts of the device tree (various cpu node properties, cache nodes) that can be changed as a result of a migration. Prevent CPU hotplug while the device tree potentially is inconsistent. Fixes: 410bccf97881 ("powerpc/pseries: Partition migration in the kernel") Signed-off-by: Nathan Lynch Reviewed-by: Gautham R. Shenoy Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/platforms/pseries/mobility.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c index f0e30dc94988..7b60fcf04dc4 100644 --- a/arch/powerpc/platforms/pseries/mobility.c +++ b/arch/powerpc/platforms/pseries/mobility.c @@ -9,6 +9,7 @@ * 2 as published by the Free Software Foundation. */ +#include #include #include #include @@ -344,11 +345,19 @@ void post_mobility_fixup(void) if (rc) printk(KERN_ERR "Post-mobility activate-fw failed: %d\n", rc); + /* + * We don't want CPUs to go online/offline while the device + * tree is being updated. + */ + cpus_read_lock(); + rc = pseries_devicetree_update(MIGRATION_SCOPE); if (rc) printk(KERN_ERR "Post-mobility device tree update " "failed: %d\n", rc); + cpus_read_unlock(); + /* Possibly switch to a new RFI flush type */ pseries_setup_rfi_flush(); -- 2.20.1