From patchwork Wed Oct 10 20:37:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Lindsay X-Patchwork-Id: 10635231 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 8DF5F46E4 for ; Wed, 10 Oct 2018 20:40:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85D1A2ACE4 for ; Wed, 10 Oct 2018 20:40:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 842562AD00; Wed, 10 Oct 2018 20:40:46 +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_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,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 5F3452AD10 for ; Wed, 10 Oct 2018 20:40:45 +0000 (UTC) Received: from localhost ([::1]:59043 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gALHg-0004ZE-Jv for patchwork-qemu-devel@patchwork.kernel.org; Wed, 10 Oct 2018 16:40:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gALFb-0002rO-KZ for qemu-devel@nongnu.org; Wed, 10 Oct 2018 16:38:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gALFa-0002UZ-Cm for qemu-devel@nongnu.org; Wed, 10 Oct 2018 16:38:35 -0400 Received: from mail-yw1-xc32.google.com ([2607:f8b0:4864:20::c32]:33952) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gALFX-0002RM-P6; Wed, 10 Oct 2018 16:38:31 -0400 Received: by mail-yw1-xc32.google.com with SMTP id m129-v6so2731057ywc.1; Wed, 10 Oct 2018 13:38:31 -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=UXPD8KhgIRR+aP3UPZnC5gnhN4pMpEVIMIIDlkzVIRI=; b=Sh3HycZCpo39UHuL/cEXJzlDyI9VQAOxIim0St/ThAAFUzxnAAtYTR4PWR82MSmAJD 8qP2m56nt45/h7qIToaBeC5cTAdQ7fI6hTKwBbRRMiciyEUXkzAHhiPUDFtpxQPe+QWF e4NdZ7PZpPZdnS9ZahifS5xnCDholYifQH82b3/IqBzcRvRZDMs0piGr1B4IisiCnOvB R9Xh6vl8V546gC4kzjV3teRIUqBhXoPxisM9AHf4uOQ8TpLn14QQvJIFnMX101zLl9yQ TWSISewDBEAt9sBLdq8TFnT8GRe15/Dvyr/t5ZJBH/r3+yGw0S/zvBXggGLWGZLC9JyN TqEw== 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=UXPD8KhgIRR+aP3UPZnC5gnhN4pMpEVIMIIDlkzVIRI=; b=rX4fu8UiLAbxxxYyhrLry576dXC98GOBuA3vJdt3y8cK36ioYr5vyQPpI5viso5ALi RHCvHdCBCl1PNSJA8FPFEb+jAjerWiOSM1ZAYHIhQcWLHXi4k0sacFrU1XyAscKmku0a +q51Ss3XuaVbKWHkSpHf+tJVcywenJZPRzwp/mDlCLMA9WxTI6J5v4SVZqmt/OrC0+4j rTWlCYMqS+mRY7PXuwlTzSG3sn5oyWbwqNceuidE87Dr3e0ujcjtk6bpbPm30BkeBRAx SXraz3HKg5aEx7zSIn3/ZLxI+BVepwqQwZXQByAFiwjITTh9+c6OUBpAhT1POxGe2Lpu 8jxQ== X-Gm-Message-State: ABuFfojZ9/D7JU77H+GMF5UHrv1ZAjGATcg1d+Pr2GCtUJ4BwcZNO3O7 tdXHruUvdSkvcEU8eKG6ybysgOjY X-Google-Smtp-Source: ACcGV6050/DAYioVuLdnrxAH3evwGQT2i8fBm+XcU3iTvqPPVdKMh3D6tpACnCpGl3WkDo4WD8nW1Q== X-Received: by 2002:a81:2d54:: with SMTP id t81-v6mr19619082ywt.69.1539203911053; Wed, 10 Oct 2018 13:38:31 -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.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Oct 2018 13:38:30 -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:29 -0400 Message-Id: <20181010203735.27918-9-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::c32 Subject: [Qemu-devel] [PATCH v6 08/14] 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 e804caaced..f3c00c3db0 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -1309,6 +1309,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) { @@ -1662,6 +1669,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) { @@ -5116,6 +5141,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