summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Maydell2018-10-11 19:20:57 +0200
committerPeter Maydell2018-10-16 18:14:55 +0200
commitab44c7b71fa683b9402bea0d367b87c881704188 (patch)
tree5d001fc9ce3f4ce456825fbc31bde7175ce821a8
parenttarget/arm: Mask PMOVSR writes based on supported counters (diff)
downloadqemu-ab44c7b71fa683b9402bea0d367b87c881704188.tar.gz
qemu-ab44c7b71fa683b9402bea0d367b87c881704188.tar.xz
qemu-ab44c7b71fa683b9402bea0d367b87c881704188.zip
target/arm: Initialize ARMMMUFaultInfo in v7m_stack_read/write
The get_phys_addr() functions take a pointer to an ARMMMUFaultInfo struct, which they fill in only if a fault occurs. This means that the caller must always zero-initialize the struct before passing it in. We forgot to do this in v7m_stack_read() and v7m_stack_write(). Correct the error. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20181011172057.9466-1-peter.maydell@linaro.org
-rw-r--r--target/arm/helper.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/target/arm/helper.c b/target/arm/helper.c
index 7a53098888..e3946562aa 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -6472,7 +6472,7 @@ static bool v7m_stack_write(ARMCPU *cpu, uint32_t addr, uint32_t value,
target_ulong page_size;
hwaddr physaddr;
int prot;
- ARMMMUFaultInfo fi;
+ ARMMMUFaultInfo fi = {};
bool secure = mmu_idx & ARM_MMU_IDX_M_S;
int exc;
bool exc_secure;
@@ -6534,7 +6534,7 @@ static bool v7m_stack_read(ARMCPU *cpu, uint32_t *dest, uint32_t addr,
target_ulong page_size;
hwaddr physaddr;
int prot;
- ARMMMUFaultInfo fi;
+ ARMMMUFaultInfo fi = {};
bool secure = mmu_idx & ARM_MMU_IDX_M_S;
int exc;
bool exc_secure;