target-xtensa: return EINVAL for unimplemented simcalls
PATCH 1/1 target-xtensa: return EINVAL for unimplemented simcalls
This prevents guest from proceeding with uninitialised garbage returned from unimplemented simcalls.
Signed-off-by Max Filippov <[email protected]>
--- target-xtensa/xtensa-semi.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
target-xtensa/xtensa-semi.c +2 -0
@@ -218,6 +218,8 @@ void HELPER(simcall)(CPUXtensaState *env)default :qemu_log ("%s(%d): not implemented\n" , __func__, regs[2 ]); + regs[2 ] =-1 ; + regs[3 ] =EINVAL ;break ; } }
Signature · 1 line
1.7.7.6
Quoted 2 lines · Max Filippov
This prevents guest from proceeding with uninitialised garbage returned from unimplemented simcalls.
Oops, looks like ENOSYS is the right errno for that.
Signature · 2 lines
Thanks. -- Max