From patchwork Tue Feb 11 17:37:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 183292 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp5582802ile; Tue, 11 Feb 2020 09:42:42 -0800 (PST) X-Google-Smtp-Source: APXvYqxAmct76u49AuihAkC7aD2KX/DW2tmN8WKcVX29LJzr0sA0ooZ5ONGwdmBbXVLqs6EKrLzy X-Received: by 2002:ac8:740c:: with SMTP id p12mr3465409qtq.286.1581442961958; Tue, 11 Feb 2020 09:42:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581442961; cv=none; d=google.com; s=arc-20160816; b=PKSEy2cOik69fnXPQ93Vz0fM8R80XRXOVp8e9bIj+xuc7DOb9qCmQW4zQWoPcRtCMK tjhoJgvbMRYOOEKUwJeqvbT90H9V+2n1EpyyCtwft1bKeJhBgXLSbKM7t3OmEdIONPeN GheCnHJTABUSjGXyk/bUiEiNLtXpm2LmUlKPUwuiDnb2gNCiQGA/9Wfi+wVhLIMc4Fzy Tk216rUb/DDzyXPUX85OeBinPf2k6bZ6BV732qnkmcWVLxGRxNeGjl+romuY2CPKKACn 6m1g1lNwSfSzx/sqbuFncLUFbsYtIhyR3/xRl/+6EwbHh/y4EwX1D+HS6HXt0eWvkNH+ A6lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=JSb9oHrSYbgGp44mvDk4b87Si1MyKo6uTVibb795S44=; b=PIBwz2z0byBiF/K4W9AZUXTn9gD6pqF7mlf/gZk8Jgh18OR0Nsf8CFw5ok/3n6TY43 jjT7DaXUuJpxO0VQQFnm/SHO3NaZoJHhI9tNgaxtmXKdQCDEMSlkpbzA/MnMQ4ddCpKb yw8opje3p0jYbp5ptwiYYDr6ChS1Lo0fEXIxg+CC2r0j+7H4W7fqQNe+GMSPMgA3P0wP 7Ax70kHLb4XfB2UVf2VSGNZry0BbYBwCWfGfrws9Z/V7gbMKqnhGIa1/GoYUSLwvSB8g WKuRSi3AEbN+F3r1IdbKXOsUSJqta+nMaJBMDYfSfPuwXI8BCZslKNjNdnQ1H4NfJeZF VmfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KdeyNqLx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z5si2153487qki.259.2020.02.11.09.42.41 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Feb 2020 09:42:41 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KdeyNqLx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1ZYX-0005HU-CP for patch@linaro.org; Tue, 11 Feb 2020 12:42:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48599) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1ZTk-0005m0-Mi for qemu-devel@nongnu.org; Tue, 11 Feb 2020 12:37:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1ZTh-000480-Gn for qemu-devel@nongnu.org; Tue, 11 Feb 2020 12:37:44 -0500 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:45811) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1ZTh-000417-3p for qemu-devel@nongnu.org; Tue, 11 Feb 2020 12:37:41 -0500 Received: by mail-wr1-x442.google.com with SMTP id g3so12391070wrs.12 for ; Tue, 11 Feb 2020 09:37:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JSb9oHrSYbgGp44mvDk4b87Si1MyKo6uTVibb795S44=; b=KdeyNqLxNRrctXOU0reSvDdXp6NGfQg7f6hSUk9aRbusiSG9sNsOUnCk6SMN/M2JqP XERnMDwo2friCZIdQUq6Wmu8xWzIkZChGfqaAT6d2vDpKdMhppkKhYDblc4uibLU0H+E HvErkYM1w4qnj7ir3hNCs6wURUTagP8rSLkwvZAYj37nqzVVb/3pfW35VzGIvOwS32in AHS8soIyVBrzlY5JzztGPDUXKorbacNLcgxyKC9Gr8EkBz/gO56SegcMG9lxF+rz/PGa ZuyT2rp6TGsq7HnF3Y1Q9K62lC0dC5SxwHChlD/eU54oE2TREOtnvK+4fMMVasMWWyWx H93w== 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=JSb9oHrSYbgGp44mvDk4b87Si1MyKo6uTVibb795S44=; b=nIPHaYF0RPFuqw8njR2PJhGWrrf56PQa9NlLj740WeMH/bsd5VKbpSUHdwEDvXDKGQ DBccDbabZCmsyvmFRTDtokW5NqjPrBPV3fBa+5ZqNaxNXAdCXuywp3Tb0qs5XXbH4LLn dMRjE4XWWP7DdNelN26xxn9EKCTQ+oQFvRhew5tM9+bfjUwKRxh2njK9lk54fkr14S2e BjZKODM69W//SSasTDOqD2ZvCufdwJRVplQPLoROzWFz4FX/0OCR7Fqu7aeAoEySoRuo 9CPqFL0AodGhLHb6jy85ol/E+1Vc1bQthp+IcwiOiGsOkvUD145aBJLnLML5OTna3Cay DvWg== X-Gm-Message-State: APjAAAXNUkANaQxk3ENqxUVhnjEzg3JHMxIsmUYJL9fJS3TWX/qx4gAW FE20atUFIWRqXTKzDiWB4Q0bSA== X-Received: by 2002:a5d:494b:: with SMTP id r11mr9526289wrs.184.1581442656249; Tue, 11 Feb 2020 09:37:36 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id y1sm6109675wrq.16.2020.02.11.09.37.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 09:37:35 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 05/13] target/arm: Add and use FIELD definitions for ID_AA64DFR0_EL1 Date: Tue, 11 Feb 2020 17:37:18 +0000 Message-Id: <20200211173726.22541-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200211173726.22541-1-peter.maydell@linaro.org> References: <20200211173726.22541-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Auger , Aaron Lindsay , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Add FIELD() definitions for the ID_AA64DFR0_EL1 and use them where we currently have hard-coded bit values. Signed-off-by: Peter Maydell --- target/arm/cpu.h | 10 ++++++++++ target/arm/cpu.c | 2 +- target/arm/helper.c | 6 +++--- 3 files changed, 14 insertions(+), 4 deletions(-) -- 2.20.1 Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé diff --git a/target/arm/cpu.h b/target/arm/cpu.h index b1f3ecfd942..f2194b27ba3 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1806,6 +1806,16 @@ FIELD(ID_AA64MMFR1, PAN, 20, 4) FIELD(ID_AA64MMFR1, SPECSEI, 24, 4) FIELD(ID_AA64MMFR1, XNX, 28, 4) +FIELD(ID_AA64DFR0, DEBUGVER, 0, 4) +FIELD(ID_AA64DFR0, TRACEVER, 4, 4) +FIELD(ID_AA64DFR0, PMUVER, 8, 4) +FIELD(ID_AA64DFR0, BRPS, 12, 4) +FIELD(ID_AA64DFR0, WRPS, 20, 4) +FIELD(ID_AA64DFR0, CTX_CMPS, 28, 4) +FIELD(ID_AA64DFR0, PMSVER, 32, 4) +FIELD(ID_AA64DFR0, DOUBLELOCK, 36, 4) +FIELD(ID_AA64DFR0, TRACEFILT, 40, 4) + FIELD(ID_DFR0, COPDBG, 0, 4) FIELD(ID_DFR0, COPSDBG, 4, 4) FIELD(ID_DFR0, MMAPDBG, 8, 4) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 5712082c0b9..dc582da8fa4 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1602,7 +1602,7 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) cpu); #endif } else { - cpu->id_aa64dfr0 &= ~0xf00; + cpu->id_aa64dfr0 = FIELD_DP32(cpu->id_aa64dfr0, ID_AA64DFR0, PMUVER, 0); cpu->id_dfr0 &= ~(0xf << 24); cpu->pmceid0 = 0; cpu->pmceid1 = 0; diff --git a/target/arm/helper.c b/target/arm/helper.c index 0011a22f42d..2a57bfd9e86 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -5771,9 +5771,9 @@ static void define_debug_regs(ARMCPU *cpu) * check that if they both exist then they agree. */ if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) { - assert(extract32(cpu->id_aa64dfr0, 12, 4) == brps); - assert(extract32(cpu->id_aa64dfr0, 20, 4) == wrps); - assert(extract32(cpu->id_aa64dfr0, 28, 4) == ctx_cmps); + assert(FIELD_EX32(cpu->id_aa64dfr0, ID_AA64DFR0, BRPS) == brps); + assert(FIELD_EX32(cpu->id_aa64dfr0, ID_AA64DFR0, WRPS) == wrps); + assert(FIELD_EX32(cpu->id_aa64dfr0, ID_AA64DFR0, CTX_CMPS) == ctx_cmps); } define_one_arm_cp_reg(cpu, &dbgdidr);