qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 24/30] linux-user/openrisc: Use force_sig_fault, force_sig


From: Richard Henderson
Subject: Re: [PATCH v2 24/30] linux-user/openrisc: Use force_sig_fault, force_sigsegv_for_addr
Date: Sun, 19 Sep 2021 10:49:26 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 8/24/21 10:17 AM, Peter Maydell wrote:
I think that EXCP_RANGE should for us be unreachable in user-only
mode (because it can only happen if the relevant bits in SR are
set, and SR is writeable only in supervisor mode, and its starting
value doesn't set these bits). So we could just delete the EXCP_RANGE
handling and let it hit the default g_assert_not_reached() case.

If I also disable the SR case from gdbstub.

EXCP_FPE is more tricky -- this happens for FP exceptions, where
the enabling bit is in the FPCSR, which does appear to be writeable
from user mode. So either:
  * our mtspr is wrong and should either be not allowing writes
    to FPCSR in usermode (or at least sanitizing them)
  * the Linux kernel for openrisc is wrong, because a userspace
    program that sets FPCSR.FPEE can make it run into unhandled_exception()
    and die(), and it should be doing something else, like delivering
    a suitable SIGFPE

I believe the kernel to be buggy. But it also point to the fact that no one has written fenv.h for or1k for musl, so no one has tried to use those bits.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]