[Top][All Lists]

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

Re: [Qemu-devel] [Qemu-block] [PATCH 0/9] Assembly coroutine backend and

From: Paolo Bonzini
Subject: Re: [Qemu-devel] [Qemu-block] [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.


reply via email to

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