Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3099503ybi; Thu, 18 Jul 2019 21:01:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqztEMVL5Simi5nepgmG8JP3LanlFbqnf8K0dvJgWf73hn8cIdPOsI44nHMlLB9Zz1VOARqO X-Received: by 2002:a17:90a:c68c:: with SMTP id n12mr56075325pjt.29.1563508895650; Thu, 18 Jul 2019 21:01:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563508895; cv=none; d=google.com; s=arc-20160816; b=D6lEHmwozYGWoRhG20j11hjw0NaF/pj4TiHMB5TmWrdqhSwAoXx1V29OLK5MxmeCsO md7LPe80aS3vjfsZMbt+EbUovIlAEUsdyC0vUe4Y6lDE5va+y5cJbpVvCupeC72xSwOE soNVNBJ7b0BiXsmlW5prZR57i63ydWljfEpgQv64T7fFMJcbfJweL4M9/dS/4BKXBMvi PlArCL2qljqH+cDHKh3AzJ6u2KzftX/CXO/s+440n4ggI3ZtehX+yNSOnhxAnvfw3Px7 shTxogDJC5sPhO6NsLYe77bS/A5Q6tzOSUOnIDxCU17/fybbpv1zb7wkPN3kKvsXPAzw h8BQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=14HLvOPZWIisjZ+zG3LNuTcV9XKTSFiDs0sDnv8ATY0=; b=eqmY7BqtZusLCuQW0xwJlG/ee5LvRqIkHA/eNKNEwUjCVjKef8xblkOSuZoLkQoMsP kprLnkJt/5XtsVlcc50sfWk2t7DWU/ZFznzXGrmBzNsmGBn8RieDpdxy8OEuRy9GMshl IFJQvgx8OZmVy0InFI9CfeBiQed6E0vWHF2HAgNccRBvNmVy+yGxuqkZiUpqHbkYCSvV 50Z9xybfK+q2TCaIRcWDQqXhpNbISsNd94VyNpespNjxHAyn4pgGM7jaBDlLUrIGZSf7 grnieXUdANOUfaOLDo8cIl8269yg/4d4VdUhNTSpXTDg6n8OYwA0HqMoZSIQcKYtlsTn dK+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=etINGHhR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m63si233346pld.385.2019.07.18.21.01.20; Thu, 18 Jul 2019 21:01:35 -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=etINGHhR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728445AbfGSD7E (ORCPT + 99 others); Thu, 18 Jul 2019 23:59:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:58402 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727234AbfGSD67 (ORCPT ); Thu, 18 Jul 2019 23:58:59 -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 06BB62189E; Fri, 19 Jul 2019 03:58:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563508738; bh=30mediPqSyOCVpfpiyzjkQznHDhL3K2DyXhGXN7PMk0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=etINGHhRAVeCRbS+owWLGgTDkL8zdXTtVn9Sgw1dPCO6ER6NMat2zTjF8NjikJoPg /Z8V/v0oblRVr3WDajrbAXQaKYcjHyrqdu1R5s7ibNmxBeKTE11RuKq0zwbgUEMs+E GHcVJQqDHxYKeTl+EAsE7PCp+AHmBGTGCO24zWwA= 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 5.2 060/171] powerpc/pseries/mobility: prevent cpu hotplug during DT update Date: Thu, 18 Jul 2019 23:54:51 -0400 Message-Id: <20190719035643.14300-60-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719035643.14300-1-sashal@kernel.org> References: <20190719035643.14300-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 0c48c8964783..50e7aee3c7f3 100644 --- a/arch/powerpc/platforms/pseries/mobility.c +++ b/arch/powerpc/platforms/pseries/mobility.c @@ -6,6 +6,7 @@ * Copyright (C) 2010 IBM Corporation */ +#include #include #include #include @@ -335,11 +336,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