From patchwork Wed Dec 5 13:43:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Lindsay X-Patchwork-Id: 10714211 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CA5F513BB for ; Wed, 5 Dec 2018 13:44:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B79D22BEFA for ; Wed, 5 Dec 2018 13:44:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ABE982CD4D; Wed, 5 Dec 2018 13:44:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1F50E2BEFA for ; Wed, 5 Dec 2018 13:44:50 +0000 (UTC) Received: from localhost ([::1]:34583 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUXTs-0000Ld-Jv for patchwork-qemu-devel@patchwork.kernel.org; Wed, 05 Dec 2018 08:44:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUXSN-0007PB-CC for qemu-devel@nongnu.org; Wed, 05 Dec 2018 08:43:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gUXSM-0004Uq-FS for qemu-devel@nongnu.org; Wed, 05 Dec 2018 08:43:15 -0500 Received: from mail-eopbgr690133.outbound.protection.outlook.com ([40.107.69.133]:62640 helo=NAM04-CO1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gUXSF-0004L6-UE; Wed, 05 Dec 2018 08:43:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amperemail.onmicrosoft.com; s=selector1-os-amperecomputing-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IFtnHOPgCQZi6m35uK9PtxVFj12AuwN3qF4NFzvKbqk=; b=j5p/iNFkMBfWHVExGYqU6pj5g8STQr3R3kbOSz8SUJHFMMJcP4qryrFapFwSqbivSZdV8qTcVwyXZozKG7CEElL6b9kwSuC3Qvgll/Qsx3hsnUBQOli2EqpIs5EhIB+Zc287ndqsvZcs2qnM3g5Wvsn9It+88H/gc1Lf+FYMpfQ= Received: from DM6PR01MB4825.prod.exchangelabs.com (20.177.218.222) by DM6PR01MB5180.prod.exchangelabs.com (20.176.122.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1382.19; Wed, 5 Dec 2018 13:43:04 +0000 Received: from DM6PR01MB4825.prod.exchangelabs.com ([fe80::9c7c:27c7:4cb7:f820]) by DM6PR01MB4825.prod.exchangelabs.com ([fe80::9c7c:27c7:4cb7:f820%2]) with mapi id 15.20.1404.016; Wed, 5 Dec 2018 13:43:04 +0000 From: Aaron Lindsay To: "qemu-arm@nongnu.org" , Peter Maydell , Alistair Francis , Wei Huang , Peter Crosthwaite , Richard Henderson Thread-Topic: [PATCH v9 00/14] More fully implement ARM PMUv3 Thread-Index: AQHUjKByd/idnSlI+0yghkDC2UDzLQ== Date: Wed, 5 Dec 2018 13:43:04 +0000 Message-ID: <20181205134243.4791-1-aaron@os.amperecomputing.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BN6PR12CA0032.namprd12.prod.outlook.com (2603:10b6:405:70::18) To DM6PR01MB4825.prod.exchangelabs.com (2603:10b6:5:6b::30) authentication-results: spf=none (sender IP is ) smtp.mailfrom=aaron@os.amperecomputing.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [216.85.170.155] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM6PR01MB5180; 6:u2tE0xk+/E5cZjbig3XgcgZwJ0GJArw4YUyOSR/8rugSPbWxBbEjRLNOPPsCBGB0v44Y5mPAvyFuJ85upqooMzhx2MniT2QEn6YqCK6eJmiA0FHZ5GzDdNPv68/U21+HzXoMFxx7wZg8mwfrEvHuYJ79iW8ssrmKf31ZPcjuVeJC7poxzhs2ejMNptMYVEuOt7MUxpg14qvBdYVGwY6MBgnWIKyvwlieVZd5k2Rp79LMVU6V5tfhsvXxlICp+Tep6LgLhDV5kn4lPVWx8q5wsLqMlFMlTxzviirioCiToo2JRsc388WvUGRAUKOGkiKSGGfMqAMQUbUAkj36Q/n952hxewvfcIM7vH4ZK7y7B9BgG1nb0QTSvTHQpEHAui7u0lY/lfFAXGkJCuo4J2DNGF6Z+STxuMf6/p2rOtpEOV/AcWfp52nXKuafuDxq+Ac9hoYiFK/8d7qId1ei6Ufhpw==; 5:UR2JLYUf3z6Lb26yrLymMOPQdJReFCxtsmuRof5BbUb4wQmgecYJaX435Aqzz7hIraoQnaAJn6OVb+P2u5FmlyMvuBYrcKvbdr+8QnC9ezuUVLjPMXj9hO/4r0MjHHlC2XskN0vzaXWs0j4UHkncFSNVT1BoUXifqMxKg0rSC6E=; 7:yA5brLnRC/dNr87o1VmNZ6Xx1zHGynMaGAKgjIgCG50fbaqbUsDZ8nhXp+NhyBFfpIggma/uPhCZiuiz6SI8KGxf23Erk9Hfr8mXkeih8MYTipumwq5+woTakL22PwJDoGBdOFcqP44JFtOu2ePTzA== x-ms-office365-filtering-correlation-id: 835b54dc-22f8-43b3-cebf-08d65ab794c1 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:DM6PR01MB5180; x-ms-traffictypediagnostic: DM6PR01MB5180: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231455)(999002)(944501520)(52105112)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:DM6PR01MB5180; BCL:0; PCL:0; RULEID:; SRVR:DM6PR01MB5180; x-forefront-prvs: 08770259B4 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(366004)(39840400004)(136003)(346002)(376002)(199004)(189003)(6486002)(86362001)(53936002)(39060400002)(66066001)(71200400001)(71190400001)(14444005)(106356001)(25786009)(6116002)(3846002)(26005)(4326008)(256004)(966005)(8936002)(105586002)(6436002)(2501003)(186003)(2906002)(110136005)(81166006)(81156014)(107886003)(54906003)(52116002)(1076002)(8676002)(478600001)(316002)(14454004)(102836004)(2616005)(486006)(6306002)(476003)(68736007)(305945005)(5660300001)(386003)(6506007)(7736002)(6512007)(99286004)(97736004); DIR:OUT; SFP:1102; SCL:1; SRVR:DM6PR01MB5180; H:DM6PR01MB4825.prod.exchangelabs.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:0; MX:1; received-spf: None (protection.outlook.com: os.amperecomputing.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: bfERhw7RjlZMmdpZN55u4MrXZTknmuoYrq2OQ05QwwP/5dpNpUpU1ew3PAkHXFC8u4DUB872nTt535KobOiOds5GuN2niTw2ZFf0S6us21L6jIj2gtSvbaZINxQXznaOEA+KAvtlcixhtggnHnVea6njKd6zt1/UTiONC3DW2f/gqOGEnB7nxTjXXUi6Pct9WgRKfo63Rylt5u803IXqISKvbcAJEjglUHEkx76reY+CZK027RCTzNxikZNMNxbj5zpJ/FHGswGKj+RFNfxZkB8up5+thRAC3QLFzzhNYC1lml/9CU2qWN+IgK97Vu6yAqdoXRt97K2wRAXWXIj9Qbrvu3pe6Euxg6p9ogpbyCA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 835b54dc-22f8-43b3-cebf-08d65ab794c1 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2018 13:43:04.2623 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR01MB5180 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.69.133 Subject: [Qemu-devel] [PATCH v9 00/14] More fully implement ARM PMUv3 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The ARM PMU implementation currently contains a basic cycle counter, but it is often useful to gather counts of other events, filter them based on execution mode, and/or be notified on counter overflow. These patches flesh out the implementations of various PMU registers including PM[X]EVCNTR and PM[X]EVTYPER, add a struct definition to represent arbitrary counter types, implement mode filtering, send interrupts on counter overflow, and add instruction, cycle, and software increment events. Since v8 [1] I have made the following changes: * Simplified if statements and corrected overflow bit clearing logic in counter overflow patch based on Richard's review * Added FIELDs for ARMv8.1 PMUv3 variant and guard the definition of PMCEID2 and PMCEID3 based on ID_DFR0.PerfMon * Added/fixed up a couple comments [1] - https://lists.gnu.org/archive/html/qemu-devel/2018-11/msg04037.html Aaron Lindsay (14): migration: Add post_save function to VMStateDescription target/arm: Reorganize PMCCNTR accesses target/arm: Swap PMU values before/after migrations target/arm: Filter cycle counter based on PMCCFILTR_EL0 target/arm: Allow AArch32 access for PMCCFILTR target/arm: Implement PMOVSSET target/arm: Define FIELDs for ID_DFR0 target/arm: Make PMCEID[01]_EL0 64 bit registers, add PMCEID[23] target/arm: Add array for supported PMU events, generate PMCEID[01]_EL0 target/arm: Finish implementation of PM[X]EVCNTR and PM[X]EVTYPER target/arm: PMU: Add instruction and cycle events target/arm: PMU: Set PMCR.N to 4 target/arm: Implement PMSWINC target/arm: Send interrupts on PMU counter overflow docs/devel/migration.rst | 9 +- include/migration/vmstate.h | 1 + migration/vmstate.c | 13 +- target/arm/cpu.c | 28 +- target/arm/cpu.h | 79 +++- target/arm/cpu64.c | 4 - target/arm/helper.c | 807 ++++++++++++++++++++++++++++++++---- target/arm/machine.c | 24 ++ 8 files changed, 860 insertions(+), 105 deletions(-)