Received: from eggs.gnu.org ([2001:4830:134:3::10]:52205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c08d8-0004WR-5s for qemu-devel@nongnu.org; Fri, 28 Oct 2016 10:59:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c08d5-0005MR-Sc for qemu-devel@nongnu.org; Fri, 28 Oct 2016 10:59:38 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:47447) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c08d5-0005K7-JY for qemu-devel@nongnu.org; Fri, 28 Oct 2016 10:59:35 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1c08cy-0005lj-Nn for qemu-devel@nongnu.org; Fri, 28 Oct 2016 15:59:28 +0100 From: Peter Maydell Date: Fri, 28 Oct 2016 15:59:22 +0100 Message-Id: <1477666764-19403-8-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1477666764-19403-1-git-send-email-peter.maydell@linaro.org> References: <1477666764-19403-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PULL 7/9] arm: virt: add PMU property to mach-virt machine type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From: Wei Huang CPU vPMU is now turned ON by default, but this feature wasn't introduced until virt-2.7 machine type. To solve this problem, this patch adds a PMU option in machine state, which is used to control CPU's vPMU status. This PMU option is not exposed to command line and is turned off in virt-2.6 machine type. Reviewed-by: Andrew Jones Signed-off-by: Wei Huang Message-id: 1477463301-17175-3-git-send-email-wei@redhat.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/arm/virt.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 32c95fb..54a8b28 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -85,6 +85,7 @@ typedef struct { VirtBoardInfo *daughterboard; bool disallow_affinity_adjustment; bool no_its; + bool no_pmu; } VirtMachineClass; typedef struct { @@ -1353,6 +1354,10 @@ static void machvirt_init(MachineState *machine) } } + if (vmc->no_pmu && object_property_find(cpuobj, "pmu", NULL)) { + object_property_set_bool(cpuobj, false, "pmu", NULL); + } + if (object_property_find(cpuobj, "reset-cbar", NULL)) { object_property_set_int(cpuobj, vbi->memmap[VIRT_CPUPERIPHS].base, "reset-cbar", &error_abort); @@ -1592,5 +1597,7 @@ static void virt_machine_2_6_options(MachineClass *mc) virt_machine_2_7_options(mc); SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_6); vmc->disallow_affinity_adjustment = true; + /* Disable PMU for 2.6 as PMU support was first introduced in 2.7 */ + vmc->no_pmu = true; } DEFINE_VIRT_MACHINE(2, 6) -- 2.7.4