qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 46/55] target/arm: Add ARM_FEATURE_V7VE for v7 Virtualization Extensions
Date: Fri, 29 Jun 2018 15:53:38 +0100	[thread overview]
Message-ID: <20180629145347.652-47-peter.maydell@linaro.org> (raw)
In-Reply-To: <20180629145347.652-1-peter.maydell@linaro.org>

From: Aaron Lindsay <alindsay@codeaurora.org>

Signed-off-by: Aaron Lindsay <alindsay@codeaurora.org>
Message-id: 1529699547-17044-5-git-send-email-alindsay@codeaurora.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target/arm/cpu.h   |  1 +
 target/arm/cpu.c   | 21 ++++++++++++++-------
 target/arm/kvm32.c |  8 ++++----
 3 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 6a8441c2dd6..7ac909448ea 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -1442,6 +1442,7 @@ enum arm_features {
     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,
     ARM_FEATURE_V5,
     ARM_FEATURE_STRONGARM,
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index aa62315cea2..4584cd01bc1 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -800,9 +800,20 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp)
 
     /* Some features automatically imply others: */
     if (arm_feature(env, ARM_FEATURE_V8)) {
-        set_feature(env, ARM_FEATURE_V7);
+        set_feature(env, ARM_FEATURE_V7VE);
+    }
+    if (arm_feature(env, ARM_FEATURE_V7VE)) {
+        /* v7 Virtualization Extensions. In real hardware this implies
+         * EL2 and also the presence of the Security Extensions.
+         * For QEMU, for backwards-compatibility we implement some
+         * CPUs or CPU configs which have no actual EL2 or EL3 but do
+         * include the various other features that V7VE implies.
+         * Presence of EL2 itself is ARM_FEATURE_EL2, and of the
+         * Security Extensions is ARM_FEATURE_EL3.
+         */
         set_feature(env, ARM_FEATURE_ARM_DIV);
         set_feature(env, ARM_FEATURE_LPAE);
+        set_feature(env, ARM_FEATURE_V7);
     }
     if (arm_feature(env, ARM_FEATURE_V7)) {
         set_feature(env, ARM_FEATURE_VAPA);
@@ -1524,15 +1535,13 @@ static void cortex_a7_initfn(Object *obj)
     ARMCPU *cpu = ARM_CPU(obj);
 
     cpu->dtb_compatible = "arm,cortex-a7";
-    set_feature(&cpu->env, ARM_FEATURE_V7);
+    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_ARM_DIV);
     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);
-    set_feature(&cpu->env, ARM_FEATURE_LPAE);
     set_feature(&cpu->env, ARM_FEATURE_EL3);
     cpu->kvm_target = QEMU_KVM_ARM_TARGET_CORTEX_A7;
     cpu->midr = 0x410fc075;
@@ -1569,15 +1578,13 @@ static void cortex_a15_initfn(Object *obj)
     ARMCPU *cpu = ARM_CPU(obj);
 
     cpu->dtb_compatible = "arm,cortex-a15";
-    set_feature(&cpu->env, ARM_FEATURE_V7);
+    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_ARM_DIV);
     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);
-    set_feature(&cpu->env, ARM_FEATURE_LPAE);
     set_feature(&cpu->env, ARM_FEATURE_EL3);
     cpu->kvm_target = QEMU_KVM_ARM_TARGET_CORTEX_A15;
     cpu->midr = 0x412fc0f1;
diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c
index 1740cda47da..fb9ea37a318 100644
--- a/target/arm/kvm32.c
+++ b/target/arm/kvm32.c
@@ -98,12 +98,12 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
     /* Now we've retrieved all the register information we can
      * set the feature bits based on the ID register fields.
      * We can assume any KVM supporting CPU is at least a v7
-     * with VFPv3, LPAE and the generic timers; this in turn implies
-     * most of the other feature bits, but a few must be tested.
+     * with VFPv3, virtualization extensions, and the generic
+     * timers; this in turn implies most of the other feature
+     * bits, but a few must be tested.
      */
-    set_feature(&features, ARM_FEATURE_V7);
+    set_feature(&features, ARM_FEATURE_V7VE);
     set_feature(&features, ARM_FEATURE_VFP3);
-    set_feature(&features, ARM_FEATURE_LPAE);
     set_feature(&features, ARM_FEATURE_GENERIC_TIMER);
 
     switch (extract32(id_isar0, 24, 4)) {
-- 
2.17.1

  parent reply	other threads:[~2018-06-29 14:54 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-29 14:52 [Qemu-devel] [PULL 00/55] target-arm queue Peter Maydell
2018-06-29 14:52 ` [Qemu-devel] [PULL 01/55] hw/block/fdc: Replace error_setg(&error_abort) by assert() Peter Maydell
2018-06-29 14:52 ` [Qemu-devel] [PULL 02/55] hw/arm/sysbus-fdt: Replace error_setg(&error_fatal) by error_report() + exit() Peter Maydell
2018-06-29 14:52 ` [Qemu-devel] [PULL 03/55] device_tree: " Peter Maydell
2018-06-29 14:52 ` [Qemu-devel] [PULL 04/55] device_tree: Add qemu_fdt_node_unit_path Peter Maydell
2018-06-29 14:52 ` [Qemu-devel] [PULL 05/55] hw/arm/virt: Silence dtc /intc warnings Peter Maydell
2018-06-29 14:52 ` [Qemu-devel] [PULL 06/55] hw/arm/virt: Silence dtc /memory warning Peter Maydell
2018-06-29 14:52 ` [Qemu-devel] [PULL 07/55] target/arm: Implement SVE Memory Contiguous Load Group Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 08/55] target/arm: Implement SVE Contiguous Load, first-fault and no-fault Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 09/55] target/arm: Implement SVE Memory Contiguous Store Group Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 10/55] target/arm: Implement SVE load and broadcast quadword Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 11/55] target/arm: Implement SVE integer convert to floating-point Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 12/55] target/arm: Implement SVE floating-point arithmetic (predicated) Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 13/55] target/arm: Implement SVE FP Multiply-Add Group Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 14/55] target/arm: Implement SVE Floating Point Accumulating Reduction Group Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 15/55] target/arm: Implement SVE load and broadcast element Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 16/55] target/arm: Implement SVE store vector/predicate register Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 17/55] target/arm: Implement SVE scatter stores Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 18/55] target/arm: Implement SVE prefetches Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 19/55] target/arm: Implement SVE gather loads Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 20/55] target/arm: Implement SVE first-fault " Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 21/55] target/arm: Implement SVE scatter store vector immediate Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 22/55] target/arm: Implement SVE floating-point compare vectors Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 23/55] target/arm: Implement SVE floating-point arithmetic with immediate Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 24/55] target/arm: Implement SVE Floating Point Multiply Indexed Group Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 25/55] target/arm: Implement SVE FP Fast Reduction Group Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 26/55] target/arm: Implement SVE Floating Point Unary Operations - Unpredicated Group Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 27/55] target/arm: Implement SVE FP Compare with Zero Group Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 28/55] target/arm: Implement SVE floating-point trig multiply-add coefficient Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 29/55] target/arm: Implement SVE floating-point convert precision Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 30/55] target/arm: Implement SVE floating-point convert to integer Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 31/55] target/arm: Implement SVE floating-point round to integral value Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 32/55] target/arm: Implement SVE floating-point unary operations Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 33/55] target/arm: Implement SVE MOVPRFX Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 34/55] target/arm: Implement SVE floating-point complex add Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 35/55] target/arm: Implement SVE fp complex multiply add Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 36/55] target/arm: Pass index to AdvSIMD FCMLA (indexed) Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 37/55] target/arm: Implement SVE fp complex multiply add (indexed) Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 38/55] target/arm: Implement SVE dot product (vectors) Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 39/55] target/arm: Implement SVE dot product (indexed) Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 40/55] target/arm: Enable SVE for aarch64-linux-user Peter Maydell
2018-11-12 21:10   ` Laurent Vivier
2018-11-12 22:12     ` Alex Bennée
2018-11-13  9:08       ` Laurent Vivier
2018-11-13  9:49     ` Richard Henderson
2018-11-13  9:57       ` Laurent Vivier
2018-11-13  9:51     ` Richard Henderson
2018-11-13 10:04       ` Laurent Vivier
2018-06-29 14:53 ` [Qemu-devel] [PULL 41/55] target/arm: Implement ARMv8.2-DotProd Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 42/55] target/arm: support reading of CNT[VCT|FRQ]_EL0 from user-space Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 43/55] i.mx7d: Remove unused header files Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 44/55] i.mx7d: Change SRC unimplemented device name from sdma to src Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 45/55] i.mx7d: Change IRQ number type from hwaddr to int Peter Maydell
2018-06-29 14:53 ` Peter Maydell [this message]
2018-06-29 14:53 ` [Qemu-devel] [PULL 47/55] target/arm: Remove redundant DIV detection for KVM Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 48/55] target/arm: Mark PMINTENSET accesses as possibly doing IO Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 49/55] sd: Don't trace SDRequest crc field Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 50/55] sdcard: Use the ldst API Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 51/55] target/arm: Fix SVE signed division vs x86 overflow exception Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 52/55] target/arm: Fix SVE system register access checks Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 53/55] target/arm: Prune a57 features from max Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 54/55] target/arm: Prune a15 " Peter Maydell
2018-06-29 14:53 ` [Qemu-devel] [PULL 55/55] target/arm: Add ID_ISAR6 Peter Maydell
2018-06-30 12:33 ` [Qemu-devel] [PULL 00/55] target-arm queue Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180629145347.652-47-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).