From patchwork Thu Nov 8 17:52:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 150565 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1142627ljp; Thu, 8 Nov 2018 10:02:28 -0800 (PST) X-Google-Smtp-Source: AJdET5cTYyyFBzhGp0Cg7JhrhTptFYEBdcRbaMHdV+bm6NvwfcsKraEq8UF0E1MaEiYGT6YaUySz X-Received: by 2002:a0c:a4a3:: with SMTP id x32mr5448075qvx.89.1541700147052; Thu, 08 Nov 2018 10:02:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541700147; cv=none; d=google.com; s=arc-20160816; b=xRHdOgg9QzL9gOo2kXNBr2HhK0c3sRgXzuMigSUXygmCKaftGqhV6I7V5MtIsIDpHn PiLgafoDO2vfcmj5ZmGg6/usCFND0TaUplq+RadQ+1SbERgM27scq6Ta+QmplAzrsiki lNbodx7opGS313dRxC0iLlc11MyyOKM7mtg6XfmENqJ6b6MMBwUanAlNmKjP9mtMxDlk BjFKoWGNqmyoamOgERAA9LqOn1eCWLyY1O9WaTAcisq9ZwKC9WN8u5sllwNOMP5x2WXs gbtdoXNCvusx7ujkTSRtMzsbnzAO7YD2lQFZjIOUe3+sWTAc/7/7li+EGUfazI8gRBf3 sqBA== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=zlFdkBkZo5nt5LFadOS5kmImPmiLZuKCuNQcIkYLDuU=; b=hgIpCB0z2N+kQ+VtHVuLQqjntGQ++/tMYnLnFZyD625wdWt8RnTj0Ol6T0RTUj34Qu Butu8uyGSgzSByrg6eNem43A7zBTuvJfR3FaovcKcsVkc8TCf2KxzO1ueUn6+dwffOgl ykpz1JA/CeBmjgF2zDu1uY2R4LXR9kNeIx8TXc83gfcKaOnRC9y6h1PWio+mfrCiqNXc RAskepcR+gWKTLzoklMWWwn32AMhTO5KbRmpdwVOYY7WJGco4JuYh2goyuvI0EO2k93J BJPkaX5CYJPGMd1Zgj8DMA+9FiBJ6SAtbAJJiwL6fY1Kw3zWlSxrdjN+2wvOK8VnTV94 UBvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iKmxGaMW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id e17si3481731qkj.109.2018.11.08.10.02.26 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 08 Nov 2018 10:02:27 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iKmxGaMW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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]:58378 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKodO-0008TD-3E for patch@linaro.org; Thu, 08 Nov 2018 13:02:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKoWB-0001d7-Aa for qemu-devel@nongnu.org; Thu, 08 Nov 2018 12:55:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gKoW8-0008Ek-MN for qemu-devel@nongnu.org; Thu, 08 Nov 2018 12:54:59 -0500 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:38475) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gKoW8-0008Cv-8q for qemu-devel@nongnu.org; Thu, 08 Nov 2018 12:54:56 -0500 Received: by mail-wm1-x344.google.com with SMTP id f2-v6so2033299wme.3 for ; Thu, 08 Nov 2018 09:54:56 -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; bh=zlFdkBkZo5nt5LFadOS5kmImPmiLZuKCuNQcIkYLDuU=; b=iKmxGaMW4tihGC/qQdP4MkkPVOeTV3lkT+LEx6VeHFTUeNlVXS821ei5djZx+OAh9X GGMv2/6LEyFZiAa/xrwwD2/C0bKBvMmJcNIIfMITE/frD1lrZL2TPw1ha5uMubU/ZJd3 syD7pbaYkRKxkP2j8fs55pyrTBEhuvxNOsAoE= 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; bh=zlFdkBkZo5nt5LFadOS5kmImPmiLZuKCuNQcIkYLDuU=; b=JVwasmVQXejaxaANU1XxwGZAuJIthsEC5AbR8bWY+x1xLgEXo89UQAVPR/nfOkH9F8 KtYmuh856jwNsY6ZOzRwaY/jeCBVJRqSbC1VatfpjB1R4hUeaM/cQrIu5mexJjQx5VZU MyUJTsivH9UqgtsDDmvZiacxiAM0z3SFbxIXoTZRuL81/RKf2fOG7j3R0nwLw00Ps+ja JsU1vAQ16O70BFPCjhoKY3CdWMiKY93fIkzOnAyjryMF2Y9yGpdu3BW7SZGk7Ufgey21 TQDkgqa0Ca6Re95kgOlc5ZNCu6bEJFPYIWobXXpbwaGaYLoURo6mnJm4IvmG666lLyQH ev0w== X-Gm-Message-State: AGRZ1gLVHrqW1DPAReEIgoIORpYtDeHMGQXkhBHYCv1uzcFucggymQ2T ShBmo4bQOu45rgAwFcB8dr5RCINwGcTXDA== X-Received: by 2002:a1c:5885:: with SMTP id m127-v6mr2005469wmb.118.1541699694705; Thu, 08 Nov 2018 09:54:54 -0800 (PST) Received: from cloudburst.twiddle.net (70.red-2-141-114.dynamicip.rima-tde.net. [2.141.114.70]) by smtp.gmail.com with ESMTPSA id l42-v6sm4411384wre.37.2018.11.08.09.54.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Nov 2018 09:54:54 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 8 Nov 2018 18:52:46 +0100 Message-Id: <20181108175246.13416-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181108175246.13416-1-richard.henderson@linaro.org> References: <20181108175246.13416-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 Subject: [Qemu-devel] [PATCH v3 5/5] target/arm: Convert t32ee from feature bit to isar3 test 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: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/cpu.h | 6 +++++- linux-user/elfload.c | 2 +- target/arm/cpu.c | 4 ---- target/arm/helper.c | 2 +- target/arm/kvm32.c | 3 --- target/arm/machine.c | 3 +-- 6 files changed, 8 insertions(+), 12 deletions(-) -- 2.17.2 Reviewed-by: Philippe Mathieu-Daudé diff --git a/target/arm/cpu.h b/target/arm/cpu.h index b5eff79f73..5c2c77c31d 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1575,7 +1575,6 @@ enum arm_features { ARM_FEATURE_NEON, ARM_FEATURE_M, /* Microcontroller profile. */ ARM_FEATURE_OMAPCP, /* OMAP specific CP15 ops handling. */ - ARM_FEATURE_THUMB2EE, ARM_FEATURE_V7MP, /* v7 Multiprocessing Extensions */ ARM_FEATURE_V7VE, /* v7 Virtualization Extensions (non-EL2 parts) */ ARM_FEATURE_V4T, @@ -3172,6 +3171,11 @@ static inline bool isar_feature_jazelle(const ARMISARegisters *id) return FIELD_EX32(id->id_isar1, ID_ISAR1, JAZELLE) != 0; } +static inline bool isar_feature_t32ee(const ARMISARegisters *id) +{ + return FIELD_EX32(id->id_isar3, ID_ISAR3, T32EE) != 0; +} + static inline bool isar_feature_aa32_aes(const ARMISARegisters *id) { return FIELD_EX32(id->id_isar5, ID_ISAR5, AES) != 0; diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 5bccd2e243..a3503c83c9 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -466,7 +466,7 @@ static uint32_t get_elf_hwcap(void) GET_FEATURE(ARM_FEATURE_V5, ARM_HWCAP_ARM_EDSP); GET_FEATURE(ARM_FEATURE_VFP, ARM_HWCAP_ARM_VFP); GET_FEATURE(ARM_FEATURE_IWMMXT, ARM_HWCAP_ARM_IWMMXT); - GET_FEATURE(ARM_FEATURE_THUMB2EE, ARM_HWCAP_ARM_THUMBEE); + GET_FEATURE_ID(t32ee, ARM_HWCAP_ARM_THUMBEE); GET_FEATURE(ARM_FEATURE_NEON, ARM_HWCAP_ARM_NEON); GET_FEATURE(ARM_FEATURE_VFP3, ARM_HWCAP_ARM_VFPv3); GET_FEATURE(ARM_FEATURE_V6K, ARM_HWCAP_ARM_TLS); diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 784a4c2dfc..d4dc0bc225 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1451,7 +1451,6 @@ static void cortex_a8_initfn(Object *obj) set_feature(&cpu->env, ARM_FEATURE_V7); set_feature(&cpu->env, ARM_FEATURE_VFP3); set_feature(&cpu->env, ARM_FEATURE_NEON); - set_feature(&cpu->env, ARM_FEATURE_THUMB2EE); set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS); set_feature(&cpu->env, ARM_FEATURE_EL3); cpu->midr = 0x410fc080; @@ -1520,7 +1519,6 @@ static void cortex_a9_initfn(Object *obj) set_feature(&cpu->env, ARM_FEATURE_VFP3); set_feature(&cpu->env, ARM_FEATURE_VFP_FP16); set_feature(&cpu->env, ARM_FEATURE_NEON); - set_feature(&cpu->env, ARM_FEATURE_THUMB2EE); set_feature(&cpu->env, ARM_FEATURE_EL3); /* Note that A9 supports the MP extensions even for * A9UP and single-core A9MP (which are both different @@ -1583,7 +1581,6 @@ static void cortex_a7_initfn(Object *obj) set_feature(&cpu->env, ARM_FEATURE_V7VE); set_feature(&cpu->env, ARM_FEATURE_VFP4); set_feature(&cpu->env, ARM_FEATURE_NEON); - set_feature(&cpu->env, ARM_FEATURE_THUMB2EE); set_feature(&cpu->env, ARM_FEATURE_GENERIC_TIMER); set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS); set_feature(&cpu->env, ARM_FEATURE_CBAR_RO); @@ -1629,7 +1626,6 @@ static void cortex_a15_initfn(Object *obj) set_feature(&cpu->env, ARM_FEATURE_V7VE); set_feature(&cpu->env, ARM_FEATURE_VFP4); set_feature(&cpu->env, ARM_FEATURE_NEON); - set_feature(&cpu->env, ARM_FEATURE_THUMB2EE); set_feature(&cpu->env, ARM_FEATURE_GENERIC_TIMER); set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS); set_feature(&cpu->env, ARM_FEATURE_CBAR_RO); diff --git a/target/arm/helper.c b/target/arm/helper.c index 96301930cc..e28770833a 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -5457,7 +5457,7 @@ void register_cp_regs_for_features(ARMCPU *cpu) define_arm_cp_regs(cpu, vmsa_pmsa_cp_reginfo); define_arm_cp_regs(cpu, vmsa_cp_reginfo); } - if (arm_feature(env, ARM_FEATURE_THUMB2EE)) { + if (cpu_isar_feature(t32ee, cpu)) { define_arm_cp_regs(cpu, t2ee_cp_reginfo); } if (arm_feature(env, ARM_FEATURE_GENERIC_TIMER)) { diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c index 9ededa3c73..8b2c9b3075 100644 --- a/target/arm/kvm32.c +++ b/target/arm/kvm32.c @@ -115,9 +115,6 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) set_feature(&features, ARM_FEATURE_VFP3); set_feature(&features, ARM_FEATURE_GENERIC_TIMER); - if (extract32(id_pfr0, 12, 4) == 1) { - set_feature(&features, ARM_FEATURE_THUMB2EE); - } if (extract32(ahcf->isar.mvfr1, 20, 4) == 1) { set_feature(&features, ARM_FEATURE_VFP_FP16); } diff --git a/target/arm/machine.c b/target/arm/machine.c index 239fe4e84d..07f904709a 100644 --- a/target/arm/machine.c +++ b/target/arm/machine.c @@ -321,9 +321,8 @@ static const VMStateDescription vmstate_m = { static bool thumb2ee_needed(void *opaque) { ARMCPU *cpu = opaque; - CPUARMState *env = &cpu->env; - return arm_feature(env, ARM_FEATURE_THUMB2EE); + return cpu_isar_feature(t32ee, cpu); } static const VMStateDescription vmstate_thumb2ee = {