qemu-arm
[Top][All Lists]
Advanced

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

Re: [PATCH v2 4/8] linux-user/arm: Report SIGBUS and SIGSEGV correctly


From: Richard Henderson
Subject: Re: [PATCH v2 4/8] linux-user/arm: Report SIGBUS and SIGSEGV correctly
Date: Sun, 19 Sep 2021 15:23:09 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 8/26/21 6:31 AM, Peter Maydell wrote:
+                si_signo = TARGET_SIGSEGV;
+                si_code = TARGET_SEGV_ACCERR;
+                break;
+            case 0x5: /* Translation fault, level 1 */
+            case 0x7: /* Translation fault, level 2 */
+                si_signo = TARGET_SIGSEGV;
+                si_code = TARGET_SEGV_MAPERR;
+                break;

Side note: for cases like this where we can tell MAPERR from
ACCERR based on info the exception handler passes to us, should
we prefer that or the "check the page flags" approach that
force_sigsegv_for_addr() takes ?

FYI, the v3 version of the sigsegv+siginfo patch set makes is vastly easier on the target code. For the most part the target code goes away entirely. For the specific case of Arm (both a32 and a64), we retain it because we are supposed to report the ESR and FAR as part of the signal frame.

I'll note that a64 isn't filling in the esr_context and far_context structures. The latter was invented for MTE, I believe, where the normal si_addr is untagged. I should have a double-check around those at some point...


r~



reply via email to

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