qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>,
	Stefan Hajnoczi <stefanha@gmail.com>
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
	"Cornelia Huck" <cohuck@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	Qemu-block <qemu-block@nongnu.org>
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	[thread overview]
Message-ID: <feef288f-e6c5-277b-7129-6facdb35c987@redhat.com> (raw)
In-Reply-To: <CAFEAcA-XC3UjNxRZ5OU5i16Nc515rYoaxEhMVc+8nD1M+VZVVg@mail.gmail.com>

On 16/05/19 14:50, Peter Maydell wrote:
> On Wed, 15 May 2019 at 10:48, Stefan Hajnoczi <stefanha@gmail.com> 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


  reply	other threads:[~2019-05-22 10:08 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-04 12:05 [Qemu-devel] [PATCH 0/9] Assembly coroutine backend and x86 CET support Paolo Bonzini
2019-05-04 12:05 ` Paolo Bonzini
2019-05-04 12:05 ` [Qemu-devel] [PATCH 1/9] qemugdb: allow adding support for other coroutine backends Paolo Bonzini
2019-05-04 12:05   ` Paolo Bonzini
2019-05-04 12:05 ` [Qemu-devel] [PATCH 2/9] qemugdb: allow adding support for other architectures Paolo Bonzini
2019-05-04 12:05   ` Paolo Bonzini
2019-05-04 12:05 ` [Qemu-devel] [PATCH 3/9] coroutine: add host specific coroutine backend for 64-bit x86 Paolo Bonzini
2019-05-04 12:05   ` Paolo Bonzini
2019-05-05 16:52   ` Richard Henderson
2019-05-05 16:52     ` Richard Henderson
2019-05-04 12:05 ` [Qemu-devel] [PATCH 4/9] coroutine: add host specific coroutine backend for 64-bit ARM Paolo Bonzini
2019-05-04 12:05   ` Paolo Bonzini
2019-05-05 17:00   ` Richard Henderson
2019-05-05 17:00     ` Richard Henderson
2019-05-09 13:15   ` Stefan Hajnoczi
2019-05-04 12:05 ` [Qemu-devel] [PATCH 5/9] coroutine: add host specific coroutine backend for 64-bit s390 Paolo Bonzini
2019-05-04 12:05   ` Paolo Bonzini
2019-05-05 17:10   ` Richard Henderson
2019-05-05 17:10     ` Richard Henderson
2019-05-04 12:05 ` [Qemu-devel] [PATCH 6/9] configure: add control-flow protection support Paolo Bonzini
2019-05-04 12:05   ` Paolo Bonzini
2019-05-04 12:05 ` [Qemu-devel] [PATCH 7/9] tcg: add tcg_out_start Paolo Bonzini
2019-05-04 12:05   ` Paolo Bonzini
2019-05-04 12:05 ` [Qemu-devel] [PATCH 8/9] tcg/i386: add support for IBT Paolo Bonzini
2019-05-04 12:05   ` Paolo Bonzini
2019-05-05 17:14   ` Richard Henderson
2019-05-05 17:14     ` Richard Henderson
2019-05-04 12:05 ` [Qemu-devel] [PATCH 9/9] linux-user: add IBT support to x86 safe-syscall.S Paolo Bonzini
2019-05-04 12:05   ` Paolo Bonzini
2019-05-04 12:05 ` [Qemu-devel] [PATCH 10/9] coroutine-asm: add x86 CET shadow stack support Paolo Bonzini
2019-05-04 12:05   ` Paolo Bonzini
2019-05-05 15:41 ` [Qemu-devel] [PATCH 0/9] Assembly coroutine backend and x86 CET support Alex Bennée
2019-05-05 15:41   ` Alex Bennée
2019-05-09 13:44   ` Peter Maydell
2019-05-15  9:48     ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2019-05-16 12:50       ` Peter Maydell
2019-05-22 10:02         ` Paolo Bonzini [this message]
2019-05-09 13:29 ` [Qemu-devel] " Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=feef288f-e6c5-277b-7129-6facdb35c987@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=cohuck@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).