From patchwork Wed Jan 17 09:20:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kurz X-Patchwork-Id: 862115 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zM1pd14Fvz9s0g for ; Wed, 17 Jan 2018 20:23:05 +1100 (AEDT) Received: from localhost ([::1]:49918 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebjvz-0002BQ-2i for incoming@patchwork.ozlabs.org; Wed, 17 Jan 2018 04:23:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebjtW-0000cf-29 for qemu-devel@nongnu.org; Wed, 17 Jan 2018 04:20:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebjtS-0006gE-FM for qemu-devel@nongnu.org; Wed, 17 Jan 2018 04:20:29 -0500 Received: from 9.mo179.mail-out.ovh.net ([46.105.76.148]:33438) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ebjtS-0006f9-3X for qemu-devel@nongnu.org; Wed, 17 Jan 2018 04:20:26 -0500 Received: from player716.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo179.mail-out.ovh.net (Postfix) with ESMTP id 33BC585EB0 for ; Wed, 17 Jan 2018 10:20:22 +0100 (CET) Received: from bahia.lan (lns-bzn-46-82-253-208-248.adsl.proxad.net [82.253.208.248]) (Authenticated sender: groug@kaod.org) by player716.ha.ovh.net (Postfix) with ESMTPA id 297EF5600D6; Wed, 17 Jan 2018 10:20:20 +0100 (CET) From: Greg Kurz To: qemu-devel@nongnu.org Date: Wed, 17 Jan 2018 10:20:14 +0100 Message-ID: <151618081462.20461.3393245354775542888.stgit@bahia.lan> User-Agent: StGit/0.17.1-46-g6855-dirty MIME-Version: 1.0 X-Ovh-Tracer-Id: 1537416323604257107 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtvddrtddugddufeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.76.148 Subject: [Qemu-devel] [PATCH 0/3] spapr: fix CPU device tree nodes X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" When a compatibility mode is requested on the command line, only the boot CPU core is correctly advertised in the device tree. Any other CPU core, either hot-plugged or cold-plugged, appears to be in raw mode with the host PVR. Guest started on a POWER8 host with: -smp cores=2 -machine pseries,max-cpu-compat=compat7 # dtc -f -I fs -O dts /proc/device-tree | egrep 'cpu-version|pa-features' ibm,pa-features = [18 00 f6 3f c7 c0 80 f0 80 00 00 00 00 00 00 00 00 00 80 00 80 00 80 00 00 00]; cpu-version = <0x4d0200>; ^^^ second CPU core ibm,pa-features = <0x600f63f 0xc70080c0>; cpu-version = <0xf000003>; ^^^ boot CPU core This happens because the compatibility mode for any CPU but the boot one is set after the device tree was populated, and exposed to the guest. This series fixes the issue by setting the compatibility mode during CPU reset. This is done in the last patch. The first two patches are preliminary cleanup of the CPU reset and CPU hotplug paths. They are not strictly needed, but I think they are valuable anyway. --- Greg --- Greg Kurz (3): spapr: drop duplicate variable in spapr_core_plug() spapr_cpu_core: don't reset CPUs during realization spapr: fix device tree properties when using compatibility mode hw/ppc/spapr.c | 30 ++++++++++++++++++------------ hw/ppc/spapr_cpu_core.c | 15 +++++++++++++-- hw/ppc/spapr_rtas.c | 9 --------- include/hw/ppc/spapr_cpu_core.h | 2 ++ 4 files changed, 33 insertions(+), 23 deletions(-)