[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 20/41] linux-user: Add raise_sigsegv
From: |
Warner Losh |
Subject: |
Re: [PATCH v2 20/41] linux-user: Add raise_sigsegv |
Date: |
Sun, 19 Sep 2021 12:53:11 -0600 |
> On Sep 19, 2021, at 12:43 PM, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> On 9/19/21 20:35, Richard Henderson wrote:
>> On 9/18/21 11:45 AM, Richard Henderson wrote:
>>> +/**
>>> + * raise_sigsegv:
>>> + * @cpu: the cpu context
>>> + * @addr: the guest address of the fault
>>> + * @access_type: access was read/write/execute
>>> + * @maperr: true for invalid page, false for permission fault
>>> + * @ra: host pc for unwinding
>>> + *
>>> + * Use the TCGCPUOps hook to record cpu state, do guest operating system
>>> + * specific things to raise SIGSEGV, and jump to the main cpu loop.
>>> + */
>>> +void QEMU_NORETURN raise_sigsegv(CPUState *cpu, target_ulong addr,
>>> + MMUAccessType access_type,
>>> + bool maperr, uintptr_t ra);
>>
>> FYI, something to bikeshed here is the name of the function. Should it
>> in fact be cpu_loop_exit_raise_sigsegv?
>
> That or cpu_loop_exit_segv() which is explicit enough IMO.
That name works for me…
Also, and this is a stretch so consider it maybe a bit weak…
Reviewed by: Warner Losh <imp@bsdimp.com>
> Because it can't be used outside of the running cpu context. (E.g.
>>
>> there are a couple of instances where it's tempting to use this from
>> within cpu_loop itself, processing pseudo-syscalls.)
>>
>>
>> r~
>>
>
>
[PATCH v2 22/41] target/arm: Use raise_sigsegv for mte tag lookup, Richard Henderson, 2021/09/18
[PATCH v2 23/41] target/arm: Implement arm_cpu_record_sigsegv, Richard Henderson, 2021/09/18
[PATCH v2 21/41] target/alpha: Make alpha_cpu_tlb_fill sysemu only, Richard Henderson, 2021/09/18
[PATCH v2 26/41] target/hppa: Make hppa_cpu_tlb_fill sysemu only, Richard Henderson, 2021/09/18
[PATCH v2 29/41] target/microblaze: Make mb_cpu_tlb_fill sysemu only, Richard Henderson, 2021/09/18
[PATCH v2 35/41] target/riscv: Make riscv_cpu_tlb_fill sysemu only, Richard Henderson, 2021/09/18
[PATCH v2 27/41] target/i386: Implement x86_cpu_record_sigsegv, Richard Henderson, 2021/09/18
[PATCH v2 36/41] target/s390x: Use probe_access_flags in s390_probe_access, Richard Henderson, 2021/09/18