From patchwork Fri Feb 14 17:51:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 183500 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2111487ile; Fri, 14 Feb 2020 10:05:01 -0800 (PST) X-Google-Smtp-Source: APXvYqwagvVRAndYWmxdEHWVvHjEdQ3GCNtSvpKTXrCQiPToGCuEp6FdH0+uY07zm669KDoBP6n9 X-Received: by 2002:a37:a488:: with SMTP id n130mr2637248qke.120.1581703497811; Fri, 14 Feb 2020 10:04:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581703495; cv=none; d=google.com; s=arc-20160816; b=ZcvfojowRz2eNhLvCjUlnbmh7RqPINPs6tt+qD6JNullf85Yhd5NwFhWdyr0LFSbjl KqOiQAUp+7+osibrNk6tn48Wy6m6hnh2551+VaOyBz5u3DGKw2XwcFighEZNW9B3nP8c Flrb4KEmtTFbtsl/SRjGy/W91kaywQyZadXJUvR9W++t7G2QXLEzLbyH+BI06uvbyEc7 RnNhT5iUUoo2vm1ak2rSUvx24b6FY1uuC+Qp/8Qx/XC7jgrgfugplUOr7wYL2QlvHmXu eIcZEXdxxopWI3DpcccI4Sukih2by2reguLaNRLohpgs51WdPJE2LLbfVAEUVWeLXerO c5gg== 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=I7VGzJKa0emO5iag6GpwHNYHbTYM9xvXNaLqgVHooL4=; b=o95ygMCtkAwcgixivGLpqV/qioy5Am3AexuiQbh86CsLWWKvBszAsmgBg5RkElk5zy tidcqbRLLRcP1u6oYEpK7Ktci1dyvCCY/o3YitW+ct27I0GaoELm2q6OZ0yHr//HtkEb TBjTpaSbUN8R5O/kBSk6AHdVMpnYJE/6GG7nhXLqXcERSa4wEVkulWzvuk58hc7Pbh2o OyoQeh/tFjOYW5UCZ7d7FnCmbawX91sNlTOMnI5DpDX7MzmYPq0eu6tdGFT5ledm5CQO TQEBhEv6m4xq37PSUEaPrJI5oooQjCFVvoM+WmEAgVJ1hK0zq2HnW4I73LISlmEUZJQf ennQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="mKoc/y89"; 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 a198si3214107qkb.38.2020.02.14.10.04.55 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Feb 2020 10:04:55 -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="mKoc/y89"; 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]:43180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fKh-0004Mk-IO for patch@linaro.org; Fri, 14 Feb 2020 13:04:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56299) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2f7z-0006Bg-Om for qemu-devel@nongnu.org; Fri, 14 Feb 2020 12:51:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2f7x-00018n-KP for qemu-devel@nongnu.org; Fri, 14 Feb 2020 12:51:46 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:36995) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2f7x-00016E-Dt for qemu-devel@nongnu.org; Fri, 14 Feb 2020 12:51:45 -0500 Received: by mail-wm1-x341.google.com with SMTP id a6so11579423wme.2 for ; Fri, 14 Feb 2020 09:51:45 -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=I7VGzJKa0emO5iag6GpwHNYHbTYM9xvXNaLqgVHooL4=; b=mKoc/y89McFeR3+YyDh2nlQqYLnNRHzAyph+9ZMPYXnpyCs23OVW2JrjyDK/6bqERB FD9eXNOnHA9s7hz0LWQKGo+eWKMgJqT3f5gzjWNwJtcBF612R69bfky9l9M+IMgUDzbS cKBJR1woYwsVVNLsDL6gxs8usCzeo2ajQzjGuU0OuBV2a1sqjO8YJhsFJVojkA1/vUKd LMwNvTUNz2MJbdrffZQVBVHwV9kvMSn0eJM4y9oLCMkSpT9TOkXSrJ8FQ4FHkFxZzB9J u/eiVSmK8pOLwGaIjffPIQ/F0t8HPfwK94n50GJDJ2HNcLysTEnsJIiyp/mZXOGpwYB9 aoPA== 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=I7VGzJKa0emO5iag6GpwHNYHbTYM9xvXNaLqgVHooL4=; b=Wejjd00TiOpW94H/EVZMSpcV8OnsZdGoQiNRDc4XOlE7ofq6Nn3weLGDHyuO6FPCjQ BXHbzxj8MycIxLDU5TKFHRDwIJDHblSdUsO9whroXh3m29y1/j+VtJaUBH1yAqKTjAl+ B17NTWfUvOycS+OGOlsX/QZWN8RNQTgncsQzCeKsnOS+8dM1h5z9FZbfL0rYso5+e3PL KrQ2cncEGESz+bxf+XZtTX9PU8boTGO0pnaA8jWnka93ozXeXpZVdChu7tWVHYZJ2eAl yu5slaG5Tpki+TUgp3rBMllSk7XB5cnsrfKXBxbJt8rkgGNeLMuibdr8NmFmb3KSmYjL IHwA== X-Gm-Message-State: APjAAAUq+JNT8Y5Pl10PoiKsit28AM6S7Zliis6YOrfH/OTx5Og9t+vw Q/P5iHiP1wGzzmu7+m+AJDSP4w== X-Received: by 2002:a05:600c:228f:: with SMTP id 15mr6110868wmf.56.1581702704511; Fri, 14 Feb 2020 09:51:44 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id v8sm8001857wrw.2.2020.02.14.09.51.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 09:51:44 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 19/21] target/arm: Use isar_feature function for testing AA32HPD feature Date: Fri, 14 Feb 2020 17:51:14 +0000 Message-Id: <20200214175116.9164-20-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200214175116.9164-1-peter.maydell@linaro.org> References: <20200214175116.9164-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::341 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 , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Now we have moved ID_MMFR4 into the ARMISARegisters struct, we can define and use an isar_feature for the presence of the ARMv8.2-AA32HPD feature, rather than open-coding the test. While we're here, correct a comment typo which missed an 'A' from the feature name. Signed-off-by: Peter Maydell --- target/arm/cpu.h | 5 +++++ target/arm/helper.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/target/arm/cpu.h b/target/arm/cpu.h index ba97fc75c1d..276030a5cf3 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -3526,6 +3526,11 @@ static inline bool isar_feature_aa32_pmu_8_4(const ARMISARegisters *id) FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) != 0xf; } +static inline bool isar_feature_aa32_hpd(const ARMISARegisters *id) +{ + return FIELD_EX32(id->id_mmfr4, ID_MMFR4, HPDS) != 0; +} + /* * 64-bit feature tests via id registers. */ diff --git a/target/arm/helper.c b/target/arm/helper.c index 492741a2b0b..56b1c08f027 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -7408,8 +7408,8 @@ void register_cp_regs_for_features(ARMCPU *cpu) } else { define_arm_cp_regs(cpu, vmsa_pmsa_cp_reginfo); define_arm_cp_regs(cpu, vmsa_cp_reginfo); - /* TTCBR2 is introduced with ARMv8.2-A32HPD. */ - if (FIELD_EX32(cpu->isar.id_mmfr4, ID_MMFR4, HPDS) != 0) { + /* TTCBR2 is introduced with ARMv8.2-AA32HPD. */ + if (cpu_isar_feature(aa32_hpd, cpu)) { define_one_arm_cp_reg(cpu, &ttbcr2_reginfo); } }