[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH 0/9] Assembly coroutine backend and
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH 0/9] Assembly coroutine backend and x86 CET support |
Date: |
Wed, 22 May 2019 12:02:22 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
On 16/05/19 14:50, Peter Maydell wrote:
> On Wed, 15 May 2019 at 10:48, Stefan Hajnoczi <address@hidden> wrote:
>> 1. It's required for Intel Control-flow Enforcement Technology (CET).
>> The existing ucontext backend doesn't work with CET.
>> 2. It's faster than the existing ucontext implementation.
>
> Mmm, I think we've talked about 1 before, but I think it would
> be useful to clearly state why we need to do things here.
The reason is that, with CET enabled, setjmp and longjmp assume that
they are used only to unwind the stack and not to switch to a completely
different one. You are supposed to use swapcontext for that, but it
doesn't work for QEMU coroutines because it saves/restores the signal
mask; that is not only slower, it's incorrect we want the signal mask to
be a property of the thread, not the coroutine.
> It's also useful for identifying whether we need an asm
> backend for every host, or only some hosts (and if so which).
It's not needed for _any_ host (except x86 if you want CET support). I
wrote these three backends to ensure that it could be ported without
much effort on any host. If you prefer not having an aarch64 backend,
for example, I can leave it out.
Paolo
- [Qemu-block] [PATCH 6/9] configure: add control-flow protection support, (continued)
- [Qemu-block] [PATCH 6/9] configure: add control-flow protection support, Paolo Bonzini, 2019/05/04
- [Qemu-block] [PATCH 7/9] tcg: add tcg_out_start, Paolo Bonzini, 2019/05/04
- [Qemu-block] [PATCH 8/9] tcg/i386: add support for IBT, Paolo Bonzini, 2019/05/04
- [Qemu-block] [PATCH 9/9] linux-user: add IBT support to x86 safe-syscall.S, Paolo Bonzini, 2019/05/04
- [Qemu-block] [PATCH 10/9] coroutine-asm: add x86 CET shadow stack support, Paolo Bonzini, 2019/05/04
- Re: [Qemu-block] [Qemu-devel] [PATCH 0/9] Assembly coroutine backend and x86 CET support, Alex Bennée, 2019/05/05
Re: [Qemu-block] [Qemu-devel] [PATCH 0/9] Assembly coroutine backend and x86 CET support, Stefan Hajnoczi, 2019/05/09