Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1035922ybi; Fri, 2 Aug 2019 08:18:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQYGkphSfXtGa23oTNcH1tRpe4dvqThytxSovAi653KU3nCUvofYuZbXv8UHXX22WrlM6S X-Received: by 2002:a63:5a4d:: with SMTP id k13mr121193001pgm.174.1564759086877; Fri, 02 Aug 2019 08:18:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564759086; cv=none; d=google.com; s=arc-20160816; b=YXjpSkYtlzY12+LJDUUrdFM/Dd0le4wnce0NXaTAy08pZOHxXGOJ5uRm2mUKi4SrbZ EeYBnUd7dsGRpnD/ZQ99oE5yLXWTnrnUejN7AAWvMUxhRXs98VEiqd3rjKqaqTQowj7L DZjgCG1L7WoP7lBpM7906847lyQVHEwvQnvfCZUFSbL8AgUdFYAI7DFDRyQyHpSUKE8A XK4I8pLljWQQKZ5lswJwWCa8xP3hxbGU14Fl+0wz9tm9uxUg5qeSJhkzxoOwFQVSmuSm 3aQuCVb6qTxc/TH1kGruSvEjBJpQ4Ojx15xlKk+ftxVtq7VC4aD8Ok7Ee0bFKxFemrJE Zgeg== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ht4eZ/GdK/3Kg1a2zCk/Titl5Jle0T+fRQoNtn1/4DM=; b=Ep9pMj75b+Rji8dqcdFvEUMRK+UuWoi9WamDS/ICR7+V2QG6l4RqrQ88b3Sr+sR4m6 bZ7lnKAAmuFihjRe9LDJez+CYKbA919UfdiQ29z9A3KgLeZmigpdTD8EIsEatEFO54H1 RpASoDDgn+GCXbd4ZCkl27JvVraCdsj51u0zY5qMdeVhV2omn6foWMhS2hHDoaymQejZ rcBpyuECcxJvPB23lImYK5V/XHHgPKtDyhXL62Rn3JiEuXrF+MAR5/gTkkYm5Tzjs7au wqG4sMykQ5L2YHfayrJh8JehkJNqB5ghdGtzJ15Sl9v+aNFz5GMKCp1BXV6HPCWnnkku ybAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zyhFtygl; 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 v63si10121246pgd.111.2019.08.02.08.17.51; Fri, 02 Aug 2019 08:18:06 -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=@kernel.org header.s=default header.b=zyhFtygl; 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 S2391348AbfHBJed (ORCPT + 99 others); Fri, 2 Aug 2019 05:34:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:34420 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731131AbfHBJe3 (ORCPT ); Fri, 2 Aug 2019 05:34:29 -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 AB83F217D7; Fri, 2 Aug 2019 09:34:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564738469; bh=v48wVHhPiKP8smes6yqznQFLzAjSRq0UFD5Bb/SPnSQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zyhFtyglNHF4P4wbxDo+WjWYSrI+9CwzBDBw+VdKxf1ZjoaLQxKkk9IlW/hjeH3Le mNs7porbeJc39FYwvbbba/5mFtbpu8418vMwYFchpKJ5Hv8ZXKrmJRKL+p2YCYuqga ijrZtGo5DYIS4nxwra6eSmDTXHusO3y30jnhueoM= 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.4 116/158] powerpc/pseries/mobility: prevent cpu hotplug during DT update Date: Fri, 2 Aug 2019 11:28:57 +0200 Message-Id: <20190802092227.618197382@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190802092203.671944552@linuxfoundation.org> References: <20190802092203.671944552@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 c773396d0969..fcd1a32267c4 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 @@ -309,11 +310,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