target/arm: Set ISSIs16Bit in make_issinfo
PATCH 1/1 target/arm: Set ISSIs16Bit in make_issinfo
During the conversion to decodetree, the setting of ISSIs16Bit got lost. This causes the guest os to incorrectly adjust trapping memory operations.
--- target/arm/translate.c | 3 +++ 1 file changed, 3 insertions(+)
target/arm/translate.c +3 -0
@@ -8556,6 +8556,9 @@ static ISSInfo make_issinfo(DisasContext *s, int rd, bool p, bool w)/* ISS not valid if writeback */ if (p && !w) { ret = rd; +if (s->base.pc_next - s->pc_curr ==2 ) { + ret |= ISSIs16Bit; + } }else { ret = ISSInvalid; }
Signature · 1 line
2.20.1
Quoted 5 lines · Richard Henderson
During the conversion to decodetree, the setting of ISSIs16Bit got lost. This causes the guest os to incorrectly adjust trapping memory operations.
Fixes 46beb58efbb8a2a32
It's not really obvious from this commit where we end up now calling...
Quoted 12 lines
Reported-by Jeff Kubascik <[email protected]>Signed-off-by Richard Henderson <[email protected]>--- target/arm/translate.c | 3 +++ 1 file changed, 3 insertions(+)target/arm/translate.c +0
-0
target/arm/translate.c static ISSInfo make_issinfo(DisasContext *s, int rd, bool p, bool w) · line 8561
Quoted 6 lines
target/arm/translate.c +3
-0@@ -8556,6 +8556,9 @@ static ISSInfo make_issinfo(DisasContext *s, int rd, bool p, bool w)/* ISS not valid if writeback */ if (p && !w) { ret = rd; +if (s->base.pc_next - s->pc_curr ==2 ) { + ret |= ISSIs16Bit; + }
this function.
Should I be seeing op_load_rr/ri in the included generated functions?
Quoted 3 lines
target/arm/translate.c +0
-0}else { ret = ISSInvalid; }
Signature · 1 line
Alex Bennée
Quoted 20 lines · Alex Bennée
Quoted 5 lines · Richard Henderson
During the conversion to decodetree, the setting of ISSIs16Bit got lost. This causes the guest os to incorrectly adjust trapping memory operations.
Fixes 46beb58efbb8a2a32It's not really obvious from this commit where we end up now calling...
Quoted 7 lines
Reported-by Jeff Kubascik <[email protected]>Signed-off-by Richard Henderson <[email protected]>--- target/arm/translate.c | 3 +++ 1 file changed, 3 insertions(+)
Quoted 13 lines
target/arm/translate.c static ISSInfo make_issinfo(DisasContext *s, int rd, bool p, bool w) · line 8561
Quoted 11 lines
target/arm/translate.c +3
-0@@ -8556,6 +8556,9 @@ static ISSInfo make_issinfo(DisasContext *s, int rd, bool p, bool w)/* ISS not valid if writeback */ if (p && !w) { ret = rd; +if (s->base.pc_next - s->pc_curr ==2 ) { + ret |= ISSIs16Bit; + }this function.
Yeah, the combination of decodetree and the C preprocessor is pretty confusing. There's a macro DO_LDST in translate.c which creates trans_LDR_rr() functions which call op_load_rr() which then calls make_issinfo(); and the decodetree generator is what generates the code that calls trans_LDR_rr() and friends.
thanks
-- PMM
Quoted 28 lines · Richard Henderson
During the conversion to decodetree, the setting of ISSIs16Bit got lost. This causes the guest os to incorrectly adjust trapping memory operations.
Fixes 46beb58efbb8a2a32Reported-by Jeff Kubascik <[email protected]>Signed-off-by Richard Henderson <[email protected]>--- target/arm/translate.c | 3 +++ 1 file changed, 3 insertions(+)target/arm/translate.c +3
-1@@ -8556,6 +8556,9 @@ static ISSInfo make_issinfo(DisasContext *s, int rd, bool p, bool w)/* ISS not valid if writeback */ if (p && !w) { ret = rd; +if (s->base.pc_next - s->pc_curr ==2 ) { + ret |= ISSIs16Bit; + } }else { ret = ISSInvalid; } --
Quoted 1 line
2.20.1
This is correct, and fixes the regression vs 46beb58efbb8a, but I agree with Jeff that it's not sufficient (and in fact we've always been reporting wrong ISS info as a result) because of the wrong sense of the bool argument to syn_data_abort_with_iss() in merge_syn_data_abort().
thanks
-- PMM