[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH 02/13] target/arm/arm-semi: Always set some kind o
From: |
Peter Maydell |
Subject: |
Re: [Qemu-arm] [PATCH 02/13] target/arm/arm-semi: Always set some kind of errno for failed calls |
Date: |
Thu, 12 Sep 2019 11:50:47 +0100 |
On Thu, 12 Sep 2019 at 11:42, Alex Bennée <address@hidden> wrote:
>
>
> Peter Maydell <address@hidden> writes:
>
> > If we fail a semihosting call we should always set the
> > semihosting errno to something; we were failing to do
> > this for some of the "check inputs for sanity" cases.
> >
> > Signed-off-by: Peter Maydell <address@hidden>
>
> Reviewed-by: Alex Bennée <address@hidden>
>
> although:
>
> > ---
> > target/arm/arm-semi.c | 45 ++++++++++++++++++++++++++-----------------
> > 1 file changed, 27 insertions(+), 18 deletions(-)
> >
> > diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c
> > index 03e60105c05..51b55816faf 100644
> > --- a/target/arm/arm-semi.c
> > +++ b/target/arm/arm-semi.c
> > @@ -232,11 +232,13 @@ static target_ulong arm_gdb_syscall(ARMCPU *cpu,
> > gdb_syscall_complete_cb cb,
> > #define GET_ARG(n) do { \
> > if (is_a64(env)) { \
> > if (get_user_u64(arg ## n, args + (n) * 8)) { \
> > - return -1; \
> > + errno = EFAULT; \
> > + return set_swi_errno(ts, -1); \
>
> This looks a little queasy given ts is NULL for the softmmu version. I
> wonder (depending on your approach to -smp for 1/13) if we should just
> pass the ARMCPU down to the helper?
NULL is fine because the softmmu version of set_swi_errno() doesn't
do anything with it anyway, right?
thanks
-- PMM
- [Qemu-arm] [PATCH 00/13] target/arm: Implement semihosting v2.0, Peter Maydell, 2019/09/10
- [Qemu-arm] [PATCH 03/13] target/arm/arm-semi: Make semihosting code hand out its own file descriptors, Peter Maydell, 2019/09/10
- [Qemu-arm] [PATCH 04/13] target/arm/arm-semi: clean up TaskState* usage in non-user-only code, Peter Maydell, 2019/09/10
- [Qemu-arm] [PATCH 05/13] target/arm/arm-semi: Factor out implementation of SYS_CLOSE, Peter Maydell, 2019/09/10
- [Qemu-arm] [PATCH 06/13] target/arm/arm-semi: Factor out implementation of SYS_WRITE, Peter Maydell, 2019/09/10