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=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 D17DEC76195 for ; Fri, 19 Jul 2019 04:08:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9E900218D9 for ; Fri, 19 Jul 2019 04:08:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563509321; bh=STJ7eoRUjKT6lWQmYtHhHf0Q6NbOBi3UBDB7Dc3P0JY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=0RG8spoHN2aql30M+ZR/dGPe8tvdT87Xi8io+ua9M1paPWX2bCd6ZaWy+A6wb02Bq 5ssw6WX/LM8DiM+dqd2jS2IBfYwX5pLduNrN5bv39V64SdmI82YsdtNZc6DiCCz+DD 3RsZUPO9CyJoGZ3uHCFHkGpQRB4ppnk5wx9hsJ+I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733169AbfGSEIk (ORCPT ); Fri, 19 Jul 2019 00:08:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:42992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732260AbfGSEIi (ORCPT ); Fri, 19 Jul 2019 00:08:38 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D047D21872; Fri, 19 Jul 2019 04:08:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563509317; bh=STJ7eoRUjKT6lWQmYtHhHf0Q6NbOBi3UBDB7Dc3P0JY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fx4FeD9iNlEMvzkcVfxcYcXSgWHXqGh1cRsflAUoQN8xLxdAQMOnuYLb+BMSuiNG3 CcKmqvhtGtioP46Ua4hcWo3b+CtE4q0ARlIgW5N6lfrqEdkFQIzxG0JRXgZWGYXixp qPHM81ikWmUUCZkzfbNySMKuDomWYc9Ik0XrEnTQ= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nathan Lynch , "Gautham R . Shenoy" , Michael Ellerman , Sasha Levin , linuxppc-dev@lists.ozlabs.org Subject: [PATCH AUTOSEL 4.19 030/101] powerpc/pseries/mobility: prevent cpu hotplug during DT update Date: Fri, 19 Jul 2019 00:06:21 -0400 Message-Id: <20190719040732.17285-30-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719040732.17285-1-sashal@kernel.org> References: <20190719040732.17285-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Nathan Lynch [ 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