~ubuntu-branches/ubuntu/trusty/qemu/trusty

« back to all changes in this revision

Viewing changes to debian/patches/arm64/0034-target-arm-A64-add-support-for-test-and-branch-imm.patch

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2014-02-04 12:13:08 UTC
  • mfrom: (10.1.45 sid)
  • Revision ID: package-import@ubuntu.com-20140204121308-1xq92lrfs75agw2g
Tags: 1.7.0+dfsg-3ubuntu1~ppa1
* Merge 1.7.0+dfsg-3 from debian.  Remaining changes:
  - debian/patches/ubuntu:
    * expose-vmx_qemu64cpu.patch
    * linaro (omap3) and arm64 patches
    * ubuntu/target-ppc-add-stubs-for-kvm-breakpoints: fix FTBFS
      on ppc
    * ubuntu/CVE-2013-4377.patch: fix denial of service via virtio
  - debian/qemu-system-x86.modprobe: set kvm_intel nested=1 options
  - debian/control:
    * add arm64 to Architectures
    * add qemu-common and qemu-system-aarch64 packages
  - debian/qemu-system-common.install: add debian/tmp/usr/lib
  - debian/qemu-system-common.preinst: add kvm group
  - debian/qemu-system-common.postinst: remove acl placed by udev,
    and add udevadm trigger.
  - qemu-system-x86.links: add eepro100.rom, remove pxe-virtio,
    pxe-e1000 and pxe-rtl8139.
  - add qemu-system-x86.qemu-kvm.upstart and .default
  - qemu-user-static.postinst-in: remove arm64 binfmt
  - debian/rules:
    * allow parallel build
    * add aarch64 to system_targets and sys_systems
    * add qemu-kvm-spice links
    * install qemu-system-x86.modprobe
  - add debian/qemu-system-common.links for OVMF.fd link
* Remove kvm-img, kvm-nbd, kvm-ifup and kvm-ifdown symlinks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From 99de47d546424fb097ece8832bc514e1f2fd1a6e Mon Sep 17 00:00:00 2001
2
 
From: Alexander Graf <agraf@suse.de>
3
 
Date: Tue, 17 Dec 2013 19:42:33 +0000
4
 
Subject: [PATCH 34/49] target-arm: A64: add support for 'test and branch' imm
5
 
 
6
 
This patch adds emulation for the test and branch insns,
7
 
TBZ and TBNZ.
8
 
 
9
 
Signed-off-by: Alexander Graf <agraf@suse.de>
10
 
[claudio:
11
 
  adapted for new decoder
12
 
  always compare with 0
13
 
  remove a TCG temporary
14
 
]
15
 
Signed-off-by: Claudio Fontana <claudio.fontana@linaro.org>
16
 
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
17
 
Reviewed-by: Richard Henderson <rth@twiddle.net>
18
 
---
19
 
 target-arm/translate-a64.c | 27 +++++++++++++++++++++++++--
20
 
 1 file changed, 25 insertions(+), 2 deletions(-)
21
 
 
22
 
diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c
23
 
index 4eb2992..1d04303 100644
24
 
--- a/target-arm/translate-a64.c
25
 
+++ b/target-arm/translate-a64.c
26
 
@@ -233,10 +233,33 @@ static void disas_comp_b_imm(DisasContext *s, uint32_t insn)
27
 
     unsupported_encoding(s, insn);
28
 
 }
29
 
 
30
 
-/* Test & branch (immediate) */
31
 
+/* C3.2.5 Test & branch (immediate)
32
 
+ *   31  30         25  24  23   19 18          5 4    0
33
 
+ * +----+-------------+----+-------+-------------+------+
34
 
+ * | b5 | 0 1 1 0 1 1 | op |  b40  |    imm14    |  Rt  |
35
 
+ * +----+-------------+----+-------+-------------+------+
36
 
+ */
37
 
 static void disas_test_b_imm(DisasContext *s, uint32_t insn)
38
 
 {
39
 
-    unsupported_encoding(s, insn);
40
 
+    unsigned int bit_pos, op, rt;
41
 
+    uint64_t addr;
42
 
+    int label_match;
43
 
+    TCGv_i64 tcg_cmp;
44
 
+
45
 
+    bit_pos = (extract32(insn, 31, 1) << 5) | extract32(insn, 19, 5);
46
 
+    op = extract32(insn, 24, 1); /* 0: TBZ; 1: TBNZ */
47
 
+    addr = s->pc + sextract32(insn, 5, 14) * 4 - 4;
48
 
+    rt = extract32(insn, 0, 5);
49
 
+
50
 
+    tcg_cmp = tcg_temp_new_i64();
51
 
+    tcg_gen_andi_i64(tcg_cmp, cpu_reg(s, rt), (1ULL << bit_pos));
52
 
+    label_match = gen_new_label();
53
 
+    tcg_gen_brcondi_i64(op ? TCG_COND_NE : TCG_COND_EQ,
54
 
+                        tcg_cmp, 0, label_match);
55
 
+    tcg_temp_free_i64(tcg_cmp);
56
 
+    gen_goto_tb(s, 0, s->pc);
57
 
+    gen_set_label(label_match);
58
 
+    gen_goto_tb(s, 1, addr);
59
 
 }
60
 
 
61
 
 /* C3.2.2 / C5.6.19 Conditional branch (immediate)
62
 
1.8.5.2
63