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.

Backports commit ab44c7b71fa683b9402bea0d367b87c881704188 from qemu
This commit is contained in:
Peter Maydell 2018-10-23 12:58:16 -04:00 committed by Lioncash
parent 1596801693
commit 64661a9165
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -5655,7 +5655,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 = {0};
bool secure = mmu_idx & ARM_MMU_IDX_M_S;
int exc;
bool exc_secure;
@ -5713,12 +5713,12 @@ static bool v7m_stack_read(ARMCPU *cpu, uint32_t *dest, uint32_t addr,
{
CPUState *cs = CPU(cpu);
CPUARMState *env = &cpu->env;
MemTxAttrs attrs = {};
MemTxAttrs attrs = {0};
MemTxResult txres;
target_ulong page_size;
hwaddr physaddr;
int prot;
ARMMMUFaultInfo fi;
ARMMMUFaultInfo fi = {0};
bool secure = mmu_idx & ARM_MMU_IDX_M_S;
int exc;
bool exc_secure;