From patchwork Fri Mar 16 20:31:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Lindsay X-Patchwork-Id: 887143 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=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=codeaurora.org header.i=@codeaurora.org header.b="GelHzmf8"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="PLofwU59"; dkim-atps=neutral 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 402yFh5Lymz9s7h for ; Sat, 17 Mar 2018 07:47:36 +1100 (AEDT) Received: from localhost ([::1]:59538 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewwGE-0001sr-JY for incoming@patchwork.ozlabs.org; Fri, 16 Mar 2018 16:47:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eww1l-0006BB-Cw for qemu-devel@nongnu.org; Fri, 16 Mar 2018 16:32:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eww1k-0003mW-IP for qemu-devel@nongnu.org; Fri, 16 Mar 2018 16:32:37 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:56852) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eww1i-0003hn-6m; Fri, 16 Mar 2018 16:32:34 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 0DCDF60C54; Fri, 16 Mar 2018 20:32:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521232353; bh=MU0rboX1g0yXQDqkflH/sfVouCJZviPyuhiDzS9Sde8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GelHzmf8CCSBtDEpJUGC925+kMpbPVJOrgqi+DpLhkSm1OSg0ueJTIF5pAgBA5oWe Hprf0zn9HufnGpl7O18PSAsIOENoAbuSruqNEeVkAEZAELS07ARDn4GjrHZ1tbhSK+ 44G3hjdybpRXtOQaBK8AyMUET8AVLw0b5HEvyusE= Received: from mossypile.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: alindsay@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0122660FB1; Fri, 16 Mar 2018 20:32:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521232345; bh=MU0rboX1g0yXQDqkflH/sfVouCJZviPyuhiDzS9Sde8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PLofwU59XexJuPQ8TLd0TWPOs0Lmjlu8C/0L1uDehxQKHifJsIpJ3WbouDHHownrT reHuj3PRwMYmWsYncLXea1p4vofS++EI6UNI6s9tvVxBKrxWXr6nVrPcUOgVJwazpb Q2rVIn08UmjHJtEpdqIZUacvRA4+8Ipx2r7Wvc/w= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0122660FB1 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=alindsay@codeaurora.org From: Aaron Lindsay To: qemu-arm@nongnu.org, Peter Maydell , Alistair Francis , Wei Huang , Peter Crosthwaite Date: Fri, 16 Mar 2018 16:31:19 -0400 Message-Id: <1521232280-13089-22-git-send-email-alindsay@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1521232280-13089-1-git-send-email-alindsay@codeaurora.org> References: <1521232280-13089-1-git-send-email-alindsay@codeaurora.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 198.145.29.96 Subject: [Qemu-devel] [PATCH v3 21/22] target/arm: PMU: Set PMCR.N to 4 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: Michael Spradling , qemu-devel@nongnu.org, Digant Desai Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This both advertises that we support four counters and adds them to the implementation because the PMU_NUM_COUNTERS macro reads this value from the PMCR. Signed-off-by: Aaron Lindsay --- target/arm/helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index 679897a..06e2e2c 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -1575,7 +1575,7 @@ static const ARMCPRegInfo v7_cp_reginfo[] = { .access = PL1_W, .type = ARM_CP_NOP }, /* Performance monitors are implementation defined in v7, * but with an ARM recommended set of registers, which we - * follow (although we don't actually implement any counters) + * follow. * * Performance registers fall into three categories: * (a) always UNDEF in PL0, RW in PL1 (PMINTENSET, PMINTENCLR) @@ -5192,7 +5192,8 @@ void register_cp_regs_for_features(ARMCPU *cpu) .access = PL0_RW, .accessfn = pmreg_access, .type = ARM_CP_IO, .fieldoffset = offsetof(CPUARMState, cp15.c9_pmcr), - .resetvalue = cpu->midr & 0xff000000, + /* 4 counters enabled */ + .resetvalue = (cpu->midr & 0xff000000) | (0x4 << PMCRN_SHIFT), .writefn = pmcr_write, .raw_writefn = raw_write, }; define_one_arm_cp_reg(cpu, &pmcr);