From patchwork Wed Oct 10 20:37:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Lindsay X-Patchwork-Id: 982105 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Cf7/47lA"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42VmT76lxdz9s9N for ; Thu, 11 Oct 2018 07:50:35 +1100 (AEDT) Received: from localhost ([::1]:59102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gALRB-0003AT-JV for incoming@patchwork.ozlabs.org; Wed, 10 Oct 2018 16:50:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gALFi-0002wJ-G4 for qemu-devel@nongnu.org; Wed, 10 Oct 2018 16:38:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gALFh-0002kD-K4 for qemu-devel@nongnu.org; Wed, 10 Oct 2018 16:38:42 -0400 Received: from mail-yb1-xb41.google.com ([2607:f8b0:4864:20::b41]:43086) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gALFb-0002Ve-Kb; Wed, 10 Oct 2018 16:38:35 -0400 Received: by mail-yb1-xb41.google.com with SMTP id w80-v6so2750414ybe.10; Wed, 10 Oct 2018 13:38:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EWF0Fr/S5CUPmbGpS8tqzvex/tP5zrxb/33cA+skGN4=; b=Cf7/47lAYIOTZaG7uIbjQGVGyyofz8AoFJ4bkLiY7cr+HyjzuzZ55u3biWAZNi+jxQ U40C7HLsK2Tw1qTjRBnaqpHRAxGmhXvVzwJX6rpCKpw3oAiG41Tip+MZACRUNEXwlm/9 IYf3wpHnEG6/hxkZEPuMnNBCnSJc953qUOYxBgDaKyLW9VcC5/DYnrTODeY/0E/1WWoz hV8uIteYdf7V/dlZl/jgiqZ8PN4bzWDO5G88P4HhJzj4SUgZzhmeKefafgbHZGl71Wlg ivqUya4+rdNqAVYweUVTIE9cr2gTUTHruk+eua0xhFyTNXo/SLAICme9Efl6y0/1OA+z ZslQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EWF0Fr/S5CUPmbGpS8tqzvex/tP5zrxb/33cA+skGN4=; b=CA3IKpn9hbJoP1ClcVAREC6zUGnGB8nPopI+rXYYxH0c0zjNUBxD1xi5Ma7Uh/HeRX wFXdX7UvtXNswC+EfSftKSwr0k6YY5Y4T4qyBWY5JsE4eu3itP2jREKOY/IBG8PgjPvF QPH9TspaPjczag3obWGCTWzxoRVK1uWe7/Mzzsl+9uDI/AJvInsUu1n5jPrC7t6h/4Py hjWFvCCk+mIakuReyKjUPWw3PT+dfGAwpEoycwhdJAG9kUh9hGLj2optJYEF5wlhaCwR ZWmkhYt4a8zEpvPIODb632Ewzf8lk9idjDhSTJjQWF7jQxW0u8oyNcMKLJRRy8zkaYFz CqqQ== X-Gm-Message-State: ABuFfojkcTaDM3SzDDGdBxNN5hBWDVvKwPUbfnwmA4jJ+b5f9nPXLbw8 2fX3sYKdE8uv6ja3TEA3DGo+g4Ur X-Google-Smtp-Source: ACcGV60CgvoECT5nEJ72eDJJUKMYbVccR5Pt32S+uCTYv0YrbaGR5OIoDKXHw6VU6p46atQpnmWnjA== X-Received: by 2002:a25:e481:: with SMTP id b123-v6mr19206298ybh.416.1539203914835; Wed, 10 Oct 2018 13:38:34 -0700 (PDT) Received: from quinoa.localdomain ([216.85.170.153]) by smtp.gmail.com with ESMTPSA id u131-v6sm15170728ywf.13.2018.10.10.13.38.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Oct 2018 13:38:34 -0700 (PDT) From: Aaron Lindsay To: qemu-arm@nongnu.org, Peter Maydell , Alistair Francis , Wei Huang , Peter Crosthwaite Date: Wed, 10 Oct 2018 16:37:33 -0400 Message-Id: <20181010203735.27918-13-aclindsa@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181010203735.27918-1-aclindsa@gmail.com> References: <20181010203735.27918-1-aclindsa@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b41 Subject: [Qemu-devel] [PATCH v6 12/14] 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: Aaron Lindsay , 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 enables them because the pmu_num_counters() reads this value from PMCR. Signed-off-by: Aaron Lindsay --- target/arm/helper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index d6501de1ba..89ceb34cb9 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -1706,7 +1706,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) @@ -5412,8 +5412,8 @@ void register_cp_regs_for_features(ARMCPU *cpu) } if (arm_feature(env, ARM_FEATURE_V7)) { /* v7 performance monitor control register: same implementor - * field as main ID register, and we implement only the cycle - * count register. + * field as main ID register, and we implement four counters in + * addition to the cycle count register. */ unsigned int i, pmcrn = 4; ARMCPRegInfo pmcr = { @@ -5430,7 +5430,7 @@ 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, + .resetvalue = (cpu->midr & 0xff000000) | (pmcrn << PMCRN_SHIFT), .writefn = pmcr_write, .raw_writefn = raw_write, }; define_one_arm_cp_reg(cpu, &pmcr);