From patchwork Mon Nov 5 18:51:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Lindsay X-Patchwork-Id: 10668941 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 5595317D4 for ; Mon, 5 Nov 2018 18:56:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47190299BF for ; Mon, 5 Nov 2018 18:56:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A7C229AA9; Mon, 5 Nov 2018 18:56:32 +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 B153A29AB8 for ; Mon, 5 Nov 2018 18:56:31 +0000 (UTC) Received: from localhost ([::1]:37135 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJk35-00021c-0t for patchwork-qemu-devel@patchwork.kernel.org; Mon, 05 Nov 2018 13:56:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46650) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJjz7-0004tw-Ju for qemu-devel@nongnu.org; Mon, 05 Nov 2018 13:52:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJjyx-0000iP-AC for qemu-devel@nongnu.org; Mon, 05 Nov 2018 13:52:17 -0500 Received: from mail-eopbgr740130.outbound.protection.outlook.com ([40.107.74.130]:9824 helo=NAM01-BN3-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 1gJjyl-0000P9-It; Mon, 05 Nov 2018 13:52:04 -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=VPXd9MWghnIzR5xY8zDFivqOeaaw3nTLqLMlwfGeAI0=; b=Ee/qGTTG2j8Uqi3HonFd6nWEGNYV8gQYuvDxqIie0Abx5FaDYIk3BtIpNygZsb3gAbmTDBvo+4sdA7I8OeaflP0JTRnioc0v26vrzI8WjRrCS4rzfpdJX0OniVOE+0IHzdNAE9e7UAAWjFsxBtm6fRzcP0ssKeUwMd9htDcOWP4= Received: from DM6PR01MB4825.prod.exchangelabs.com (20.177.218.222) by DM6PR01MB3673.prod.exchangelabs.com (20.176.64.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Mon, 5 Nov 2018 18:51:56 +0000 Received: from DM6PR01MB4825.prod.exchangelabs.com ([fe80::4cf7:c8dc:b673:ec66]) by DM6PR01MB4825.prod.exchangelabs.com ([fe80::4cf7:c8dc:b673:ec66%3]) with mapi id 15.20.1294.028; Mon, 5 Nov 2018 18:51:56 +0000 From: Aaron Lindsay To: "qemu-arm@nongnu.org" , Peter Maydell , Alistair Francis , Wei Huang , Peter Crosthwaite , Richard Henderson Thread-Topic: [PATCH v7 06/12] target/arm: Implement PMOVSSET Thread-Index: AQHUdTigfZ68J2Z5mEy9PN0mUl5ylg== Date: Mon, 5 Nov 2018 18:51:56 +0000 Message-ID: <20181105185046.2802-7-aaron@os.amperecomputing.com> References: <20181105185046.2802-1-aaron@os.amperecomputing.com> In-Reply-To: <20181105185046.2802-1-aaron@os.amperecomputing.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BN6PR20CA0070.namprd20.prod.outlook.com (2603:10b6:404:151::32) 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.153] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM6PR01MB3673; 6:LPxtb98pNRjH+n2OtAktiZhRVvyVzWUUBoVZdPwYJY/23n/kAVarNm5KnxFDqdol5ZJa6N1g876MgFj8Dz47RQMCd0Bk7xTx5EBc8GE914jzuGQtetuclyZgr86Fi4lUwZ0UkRgF+LiJsHkznIYrwp/LMoM8uVRHVI8Z8kOFohFOxmQYuw8Ne4DSs5bLHoYG53gdWUiRsR7Fi3ptq8kEjPMAlFmKp/jmyd02Wj4UHIDs3HQA/OVB7B27z2eB+aJ3ZDu8zG1wEXrgpdPncu0fAebbgqfMIrTlv9nigncSoUgHUZbluGbBBNJFKhGt/cVaYb2C2jLrvqfPz41GX2c68+s5O0u5twmwro8hLqfjAvziYCh1DcryWsbRkFFGgKRsXBFMJ0mx5j1SG1FDASAYIqWJw+oYLH5eKMxOAaDk9yUgkmC3KsQB0RyFyYxC9kl1fRkh83YsMO/57DqQF4fEbQ==; 5:2L9Ss5SvNifzDK/vRrgBJg4U5mFlR3SWgIJF9XdjN7WaU4EsI2/QT787koz5rC2mw/UlUij9/q+Q1WiFdUcqDau/H2/k9MOXpom3APujmXzuCeT5Ze3LxNdEoURZT4wOzlk9asOLZjeq3Igk6PkYkIzNBf2XviGnMRke3Eqt3nY=; 7:tkRvyFc9Ol//iqn1Ze1sYQgjJlm69rNyKdYg5RaCwb1jDaro2uz5mX958WwZ+ZfaKwBo5qlSCPuA7zMZVldx2uXH7agdF8TwUKW2uHTqKGs562ySARcoKNXPOMvHtyNLhbPnHU0RVg9kK7lvX6MjbQ== x-ms-office365-filtering-correlation-id: 6f8e55e2-790b-4c39-79ad-08d6434fc275 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:DM6PR01MB3673; x-ms-traffictypediagnostic: DM6PR01MB3673: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:DM6PR01MB3673; BCL:0; PCL:0; RULEID:; SRVR:DM6PR01MB3673; x-forefront-prvs: 08476BC6EF x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39840400004)(396003)(136003)(366004)(346002)(376002)(199004)(189003)(476003)(76176011)(68736007)(446003)(14444005)(14454004)(186003)(7416002)(6436002)(3846002)(26005)(486006)(6116002)(478600001)(6486002)(2906002)(256004)(2900100001)(305945005)(7736002)(54906003)(8676002)(81166006)(66066001)(110136005)(316002)(81156014)(1076002)(6512007)(2616005)(11346002)(71190400001)(52116002)(102836004)(386003)(71200400001)(105586002)(106356001)(2501003)(8936002)(97736004)(5660300001)(39060400002)(25786009)(6506007)(4326008)(53936002)(86362001)(99286004); DIR:OUT; SFP:1102; SCL:1; SRVR:DM6PR01MB3673; 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: 6BTXApQvmnflcbEAEg0tmeIzRxTeLEmfXckveAaYpjaHWWFw6xNOS92WzNt2beok2LqENMubwbZnK9ZTKZ0HjM4NdY6FoWYajvpCgQNwCwKkvyvl6myI8U0IeBDHmn22pIB1f7+LTXtsBdQCTaU9ZGAOcO0MfQ5LaE+Zz6vf4n8zkBQbv1RoHgvllELaVk6n3SJ8xFYJ0O9b4hycqWB9V8s0CeD96openg0uZghcZTOTB4+Qa985uzFL4fjMCCBRuZfby/sjxBtVGsNsmHCKDa/J/uNmIFzNsmglbdgKQ7dSG6a8jPe+2ojan26oXzQXgz3/O0kN8Bk7fnlYDhOYsOMFG+jSAZo+MF1isR8+t30= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f8e55e2-790b-4c39-79ad-08d6434fc275 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Nov 2018 18:51:56.6532 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR01MB3673 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.74.130 Subject: [Qemu-devel] [PATCH v7 06/12] target/arm: Implement PMOVSSET 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 Add an array for PMOVSSET so we only define it for v7ve+ platforms Signed-off-by: Aaron Lindsay Reviewed-by: Richard Henderson --- target/arm/helper.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/target/arm/helper.c b/target/arm/helper.c index 0522a606a4..6724d97346 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -1342,6 +1342,13 @@ static void pmovsr_write(CPUARMState *env, const ARMCPRegInfo *ri, env->cp15.c9_pmovsr &= ~value; } +static void pmovsset_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + value &= pmu_counter_mask(env); + env->cp15.c9_pmovsr |= value; +} + static void pmxevtyper_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -1709,6 +1716,24 @@ static const ARMCPRegInfo v7mp_cp_reginfo[] = { REGINFO_SENTINEL }; +static const ARMCPRegInfo pmovsset_cp_reginfo[] = { + /* PMOVSSET is not implemented in v7 before v7ve */ + { .name = "PMOVSSET", .cp = 15, .opc1 = 0, .crn = 9, .crm = 14, .opc2 = 3, + .access = PL0_RW, .accessfn = pmreg_access, + .type = ARM_CP_ALIAS, + .fieldoffset = offsetoflow32(CPUARMState, cp15.c9_pmovsr), + .writefn = pmovsset_write, + .raw_writefn = raw_write }, + { .name = "PMOVSSET_EL0", .state = ARM_CP_STATE_AA64, + .opc0 = 3, .opc1 = 3, .crn = 9, .crm = 14, .opc2 = 3, + .access = PL0_RW, .accessfn = pmreg_access, + .type = ARM_CP_ALIAS, + .fieldoffset = offsetof(CPUARMState, cp15.c9_pmovsr), + .writefn = pmovsset_write, + .raw_writefn = raw_write }, + REGINFO_SENTINEL +}; + static void teecr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { @@ -5212,6 +5237,9 @@ void register_cp_regs_for_features(ARMCPU *cpu) !arm_feature(env, ARM_FEATURE_PMSA)) { define_arm_cp_regs(cpu, v7mp_cp_reginfo); } + if (arm_feature(env, ARM_FEATURE_V7VE)) { + define_arm_cp_regs(cpu, pmovsset_cp_reginfo); + } 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