Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3797577ybi; Mon, 29 Jul 2019 12:49:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTrWxw2eSfe18IA/NUI+V9rcbGYnL0+RwjCsTVmIn5WUIhTxDJR60KlLjgrDDHhuTFHOjP X-Received: by 2002:a17:90a:bf02:: with SMTP id c2mr114563080pjs.73.1564429781720; Mon, 29 Jul 2019 12:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564429781; cv=none; d=google.com; s=arc-20160816; b=cXqopgtCvG7xxVY7ZpFAN5Bm05VDUY07ajdiWNTD243LHTeNOdBCcuWrCMbmzzWVWt YRx4yEU6L6Sx6+3ipw+Tt1G9PBCiA6RmU4U1kjyLWFX6Q9q7hgkg/r+86MpynCiwwn6w of+fsBjE2zGETTsZC3//G2+ioNXE8qAwnUU913b0cs7Y17Rs6qARj/Mh6fiY+Y0DUG08 nXuZuk9G8fivjdDbhNZCWjHCtli2YPh9BatNpWjDKvGWAXFsW1dZrtEg30ZYPH0x/R+7 gLbRLvZZXnODeXxoGrq1VBQ39wkSRe3ACugSqZgmPuuRVrchbvGZu5Z/L7crD8vH8RI/ vdFg== 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=ihTA19UMNHWjxFLssN92rRZyC12XuaypEkAiANRY1uI=; b=BasQzYgy9fcV9KB4K4ZVeuVQ0jo20vHS0PJAMR79NKi1PQvw8xV7/cZjUpEcaP7/Bi GV7ZkRPPKAQJ4oHh5PRMPF/lWiJvvu0iESSZzKsyzB0nlmj50+730vC4B9ex/uuVluZE qf4kP6IHSTdnjSbWDy1H2HGHVF1u5D7YPjIqZRVNhCZcv3LHcbikaXrK5q8bLSF1ZXOl DWF2atjJxKrE5g65rfPyW/MhVQOgk1OcaNuJimN4cgkH5BhTgl4Lb5CMr0KEYDX5nWF7 LLP55qO+VLTDhOrUSF2KnyBdghlOBjlw43MdtqolgPYpnAf95ivZoGWhYiQS/5G4S+uH Z/FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=M3roj78T; 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 g11si28453179pfi.282.2019.07.29.12.49.27; Mon, 29 Jul 2019 12:49:41 -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=M3roj78T; 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 S2390413AbfG2TsN (ORCPT + 99 others); Mon, 29 Jul 2019 15:48:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:38216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729696AbfG2TsK (ORCPT ); Mon, 29 Jul 2019 15:48:10 -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 B215720C01; Mon, 29 Jul 2019 19:48:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429690; bh=a20IC1hebj4tVMxQzZWl+3FHx5FTgJbKJxxAffv3wEM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M3roj78T79fAkXtYbZII4rZwvice8uwhGu4k281KKBgtZabLi4ThL6dbDMH7uCXQP MTe8bpiyj6toPKUJ+CjEW2dkZHPmv1QxEvYEUcZqQG2eWp2Vq+cG8Su3Mh4l6Ed08G M70VelvJqBKC/dIbcG8madBEmBrUq/WDJ/q6aky8= 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 5.2 062/215] powerpc/pseries/mobility: prevent cpu hotplug during DT update Date: Mon, 29 Jul 2019 21:20:58 +0200 Message-Id: <20190729190751.252069499@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190739.971253303@linuxfoundation.org> References: <20190729190739.971253303@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 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