summary refs log tree commit diff stats
path: root/gitlab/issues/target_arm/host_missing/accel_missing/1421.toml
diff options
context:
space:
mode:
authorChristian Krinitsin <mail@krinitsin.com>2025-05-21 21:21:26 +0200
committerChristian Krinitsin <mail@krinitsin.com>2025-05-21 21:21:26 +0200
commit4b927bc37359dec23f67d3427fc982945f24f404 (patch)
tree245449ef9146942dc7fffd0235b48b7e70a00bf2 /gitlab/issues/target_arm/host_missing/accel_missing/1421.toml
parentaa8bd79cec7bf6790ddb01d156c2ef2201abbaab (diff)
downloademulator-bug-study-4b927bc37359dec23f67d3427fc982945f24f404.tar.gz
emulator-bug-study-4b927bc37359dec23f67d3427fc982945f24f404.zip
add gitlab issues in toml format
Diffstat (limited to 'gitlab/issues/target_arm/host_missing/accel_missing/1421.toml')
-rw-r--r--gitlab/issues/target_arm/host_missing/accel_missing/1421.toml29
1 files changed, 29 insertions, 0 deletions
diff --git a/gitlab/issues/target_arm/host_missing/accel_missing/1421.toml b/gitlab/issues/target_arm/host_missing/accel_missing/1421.toml
new file mode 100644
index 00000000..4476d10e
--- /dev/null
+++ b/gitlab/issues/target_arm/host_missing/accel_missing/1421.toml
@@ -0,0 +1,29 @@
+id = 1421
+title = "GDB memory reads fail on Cortex-M33"
+state = "closed"
+created_at = "2023-01-07T00:12:28.630Z"
+closed_at = "2023-03-07T12:41:14.403Z"
+labels = ["Closed::Fixed", "GDB", "target: arm"]
+url = "https://gitlab.com/qemu-project/qemu/-/issues/1421"
+host-os = "Fedora 36"
+host-arch = "x86_64 host, Arm cortex-m33 emulated"
+qemu-version = "QEMU emulator version 7.2.50 (v7.2.0-334-gca5181d8d7-dirty)  (This is based on upstream git revision 222059a0fccf4af3be776fe35a5ea2d6a68f9a0b with some irrelevant local changes)."
+guest-os = "Bare metal"
+guest-arch = "Arm Cortex M-33"
+description = """GDB fails to read memory from the guest.  There appear to be at least two problems:
+
+1. In `arm_cpu_get_phys_page_attrs_debug`, `arm_is_secure(env)` returns false, because the implementation doesn't seem to know about Armv7-M or Armv8-M secure states.  However, `arm_mmu_idx(env)` does know how to check `env->v7m.secure`, so it returns `ARMMMUIdx_MSPriv` (the S stands for secure).  The mismatch between an apparently non-secure access to a secure MMU seems to cause the read to fail laster.
+2. With the MPU enabled (not the case in this repro, but I can provide one), `cpu_memory_rw_debug` computes `page = addr & TARGET_PAGE_MASK`, and uses the page to compute permissions.  However, TARGET_PAGE_MASK is based on 4K pages on this platform, but the MPU granularity is 32 bytes.  So the wrong page is used for checking."""
+reproduce = """```
+# Sorry for the large clone.  It's mostly unused files in CMSIS.
+git clone --recursive -b qemu-repro-1 https://github.com/dreiss/mpu_experiments
+cd mpu_experiments
+git checkout origin/qemu-repro-1
+cmake -S . -B build -DBOARD=qemu-mps2-an505 -DAPP=mpu_stacktrace -DCMAKE_BUILD_TYPE=Debug
+cmake --build build
+/path/to/qemu-system-arm -machine mps2-an505 -nographic -kernel build/kernel.elf -s -S -d int
+# Open a separate terminal and cd into mpu_experiments
+gdb build/kernel.elf -ex 'target remote :1234' -ex 'break base_case' -ex continue -ex backtrace -ex quit
+# Note the memory read failures in the backtrace.
+```"""
+additional = "n/a"