Skip to content

Commit 7c098e0

Browse files
stephanosiogalak
authored andcommitted
xilinx_qemu: Fix WFI instruction
The Xilinx QEMU deliberately breaks the WFI (wake up from interrupt) instruction, possibly for performance and cosimulation stability reasons, and this causes the Zephyr CI tests, that expect the WFI instruction to function properly, to fail. This commit adds a patch to revert the offending Xilinx QEMU commit since accurate simulation behaviour takes precedence over performance for CI testing, and the Zephyr will not use the cosimulation feature. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent 706d1e1 commit 7c098e0

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
From 4bde2c46a979ba1539c05ffa6d4fc22ab6a2a9c2 Mon Sep 17 00:00:00 2001
2+
From: Stephanos Ioannidis <[email protected]>
3+
Date: Wed, 8 Jan 2020 17:47:05 +0900
4+
Subject: [PATCH] Revert "target/arm: Revert back to YIELD for WFI"
5+
6+
This reverts commit 5f38ea92fb697b94ad43f01fe162f3ed6e6b0e16.
7+
8+
The commit 5f38ea92fb697b94ad43f01fe162f3ed6e6b0e16 was probably
9+
introduced in order to improve emulation performance, as well as to
10+
address the stability issue when running co-simulations (refer to the
11+
commit 708639f72be2a9425992ae9dc4b9a098dc804c94).
12+
13+
This, unfortunately, breaks the WFI instruction; i.e. CPU is not halted
14+
and keeps running regardless of whether an interrupt occurs, and this
15+
is a problem for the Zephyr CI tests that expect the WFI instruction to
16+
do its job (in particular, tests/kernel/context is broken because of
17+
this change).
18+
19+
Signed-off-by: Stephanos Ioannidis <[email protected]>
20+
---
21+
target/arm/op_helper.c | 2 +-
22+
1 file changed, 1 insertion(+), 1 deletion(-)
23+
24+
diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c
25+
index acef79251d..6ab3a75a76 100644
26+
--- a/target/arm/op_helper.c
27+
+++ b/target/arm/op_helper.c
28+
@@ -304,7 +304,7 @@ void HELPER(wfi)(CPUARMState *env, uint32_t insn_len)
29+
}
30+
31+
qemu_mutex_lock_iothread();
32+
- if (use_icount || 1) {
33+
+ if (use_icount) {
34+
cs->exception_index = EXCP_YIELD;
35+
} else {
36+
cs->halted = 1;
37+
--
38+
2.17.1
39+

meta-zephyr-sdk/recipes-devtools/xilinx_qemu/xilinx-qemu_git.bb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
77

88
SRCREV = "293badb9e42930393d2246cbc4d0eb78409243ba"
99
SRC_URI = "git://github.com/Xilinx/qemu.git;protocol=https \
10+
file://0001-Revert-target-arm-Revert-back-to-YIELD-for-WFI.patch \
1011
"
1112

1213
BBCLASSEXTEND = "native nativesdk"

0 commit comments

Comments
 (0)