Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3788728ybi; Mon, 29 Jul 2019 12:38:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwDckCiNJ8Hi3Rw2yygEd9KvxFxYKq9f6zt1QLq9wDbwThrApnrUA8fKQagtpvoopsQQSIa X-Received: by 2002:a63:e010:: with SMTP id e16mr99441198pgh.285.1564429119189; Mon, 29 Jul 2019 12:38:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564429119; cv=none; d=google.com; s=arc-20160816; b=mex2CUlWr5Cnaaa5ZHHKIyZzeO1Be0NZWf5ODTAMM9k8hSn4VPJ3ASaTkqJl17jcip aSmBc2azRaWBLVGg6ADSRLWSWop4ZSrMdHMi+5IbxUFwjKb3ETmTBj6S2U8qGA5JEKkf rLRXERgWIKehDns907KJ3g/5LXdGDN5obi1GKMhCVKyzKHSSqTKLnZDkTPApFuP4h8SM Myn6a9558fuFLXpSsCDIBMhiRnRRmpS2LA/XF9vnnxmaJz+WkLfh7eOBYkRIf7d4iOxF a+Eab5SmjrUEMWRQwg9ncnoIo1wcGVMUwIiHUR7G4jBUar0oD7dsv6JJj2dx48b8Vh0R tp8A== 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=CuOtQDmQ0nOLd1nRcyS9Wk33ZXLsBbzuiwjVstb8YHM=; b=rbLRMa4XSID7Mrj21X7b3KhVFyhSAIYZt9qeH4fkDL9eegcmrj9R3jdxJJwbrVkItk DuO1f3qZq6UUulzqG/JX4SzIaKtfx7FDFgKF9XRDGagFnJuoh/gjTP+WcLpTlhmmX+wF f2KGFOyd8FLc6wI6vxtorSVUUCEZJkfp96BDwLwSISYXnVZpM1KHhvp05G6WOLRsYDh2 mTPCcL6cPY/qHFuTs1kBA9Z4H3kHmmvs0pm1khRi6izpmfwKJw+Q8BhsDuFpwQUstxba 8SRhz8sQMjdEgWYGMU7HxIiXI9f481WzyUnBel6qVKbLlDUnettt9z7cC01mUh0BKO2m qEzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UErMUOjx; 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 e5si11389442pgl.536.2019.07.29.12.38.24; Mon, 29 Jul 2019 12:38:39 -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=UErMUOjx; 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 S2388547AbfG2Tfx (ORCPT + 99 others); Mon, 29 Jul 2019 15:35:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:50192 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388528AbfG2Tfu (ORCPT ); Mon, 29 Jul 2019 15:35:50 -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 2A25A2070B; Mon, 29 Jul 2019 19:35:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428949; bh=6KoBIfRycs0fd73LI5Ph46OJrdLpdAWCZXhfKYUdFK8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UErMUOjxJ5FCw0Qg2LrEju37LfPOYIPwBjxIeFI+RI67YIBBzvMwEpU5nLfLj26fo aUM90/YqU8FPzkI5cwGpUBRl8pTLmZok5uMd7qOBP9a+3KIa6mdo8xExggCYn2FCFm 4LrupNdu0CdPVpRL/XsXSwsqj+4ZJsmwo66q+RKQ= 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.14 238/293] powerpc/pseries/mobility: prevent cpu hotplug during DT update Date: Mon, 29 Jul 2019 21:22:09 +0200 Message-Id: <20190729190842.688563055@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@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 fbea7db043fa..4addc552eb33 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 @@ -343,11 +344,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