From: Oleg Nesterov <oleg@redhat.com>
To: Jiri Kosina <jkosina@suse.cz>
Cc: Andi Kleen <andi@firstfloor.org>,
linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
x86@kernel.org, Andi Kleen <ak@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@kernel.org>,
Borislav Petkov <bp@alien8.de>
Subject: Re: [PATCH] Add a text_poke syscall v2
Date: Sat, 30 Nov 2013 17:51:22 +0100 [thread overview]
Message-ID: <20131130165122.GA24507@redhat.com> (raw)
In-Reply-To: <alpine.LRH.2.00.1311300023070.9932@twin.jikos.cz>
Sorry for completely offtopic question, but while we are here...
On 11/30, Jiri Kosina wrote:
>
> We have moved from using stop_machine() to int3-based patching exactly
> because it's much more lightweight.
I don't really understans the barriers in poke_int3_handler() and
text_poke_bp(). To the point, I do not really understand why do we
actually need bp_patching_in_progress, but lets ignore this.
Lets look at the end of text_poke_bp(), it does
on_each_cpu(do_sync_core, NULL, 1);
bp_patching_in_progress = false;
smp_wmb();
First of all, this smp_wmb() is not clear. But what I actually
can't understand is why it is safe to clear bp_patching_in_progress.
OK, on_each_cpu() should serialize us with do_int3(), but only if
poke_int3_handler() is called with irqs disabled.
However, do_int3() does preempt_conditional_sti() and this looks
as if it can be called with irqs enabled? If this is actually
possible then text_poke_bp() needs synchronize_sched() to avoid
the races with poke_int3_handler(), afaics.
OTOH, int3 is GATE_INTERRUPT, doesn't this mean that that do_int3()
can enable irqs unconditionally and on_each_cpu() also acts as a
synchronization barrier?
Oleg.
next prev parent reply other threads:[~2013-11-30 16:50 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-26 0:37 [PATCH] Add a text_poke syscall v2 Andi Kleen
2013-11-26 19:05 ` Andy Lutomirski
2013-11-26 19:11 ` Andi Kleen
2013-11-26 20:03 ` Linus Torvalds
2013-11-27 19:57 ` H. Peter Anvin
2013-11-27 22:02 ` H. Peter Anvin
2013-11-27 22:21 ` Andy Lutomirski
2013-11-27 22:21 ` Borislav Petkov
2013-11-27 22:24 ` H. Peter Anvin
2013-11-27 22:25 ` H. Peter Anvin
2013-11-27 22:29 ` Borislav Petkov
2013-11-27 22:31 ` H. Peter Anvin
2013-11-27 23:04 ` Linus Torvalds
2013-11-27 23:13 ` Borislav Petkov
2013-11-27 22:40 ` H. Peter Anvin
2013-11-27 23:10 ` Borislav Petkov
2013-11-27 23:20 ` H. Peter Anvin
2013-11-27 23:40 ` Borislav Petkov
2013-11-27 23:47 ` H. Peter Anvin
2013-11-27 22:41 ` Linus Torvalds
2013-11-27 22:53 ` H. Peter Anvin
2013-11-27 23:15 ` Linus Torvalds
2013-11-27 23:28 ` H. Peter Anvin
2013-11-28 2:01 ` Linus Torvalds
2013-11-28 2:10 ` H. Peter Anvin
2013-11-28 9:12 ` Jiri Kosina
2013-11-27 23:44 ` Andi Kleen
2013-11-29 18:35 ` Oleg Nesterov
2013-11-29 19:54 ` Andi Kleen
2013-11-29 20:05 ` Oleg Nesterov
2013-11-29 20:17 ` H. Peter Anvin
2013-11-29 20:35 ` Oleg Nesterov
2013-11-29 21:24 ` H. Peter Anvin
2013-11-30 14:56 ` Oleg Nesterov
2013-11-29 23:24 ` Jiri Kosina
2013-11-30 0:22 ` Linus Torvalds
2013-12-03 18:49 ` [PATCH?] uprobes: change uprobe_write_opcode() to modify the page directly Oleg Nesterov
2013-12-03 19:00 ` Linus Torvalds
2013-12-03 19:20 ` H. Peter Anvin
2013-12-03 20:01 ` Oleg Nesterov
2013-12-03 20:21 ` H. Peter Anvin
2013-12-03 20:38 ` Oleg Nesterov
2013-12-03 20:43 ` H. Peter Anvin
2013-12-03 20:54 ` Oleg Nesterov
2013-12-03 22:01 ` Linus Torvalds
2013-12-03 23:47 ` H. Peter Anvin
2013-12-04 11:30 ` Oleg Nesterov
2013-12-04 11:11 ` Oleg Nesterov
2013-12-04 16:01 ` H. Peter Anvin
2013-12-04 16:48 ` Oleg Nesterov
2013-12-04 16:54 ` H. Peter Anvin
2013-12-04 17:15 ` Linus Torvalds
2013-12-04 17:43 ` Oleg Nesterov
2013-12-05 17:23 ` Oleg Nesterov
2013-12-05 17:49 ` Borislav Petkov
2013-12-05 18:45 ` Oleg Nesterov
2013-12-04 18:32 ` H. Peter Anvin
2013-12-05 8:28 ` Jon Medhurst (Tixy)
2013-12-03 22:42 ` H. Peter Anvin
2013-12-03 19:53 ` Oleg Nesterov
2013-11-30 15:20 ` [PATCH] Add a text_poke syscall v2 Oleg Nesterov
2013-11-30 16:51 ` Oleg Nesterov [this message]
2013-11-30 17:31 ` Oleg Nesterov
2013-11-30 5:16 ` H. Peter Anvin
2013-11-30 14:52 ` Oleg Nesterov
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=20131130165122.GA24507@redhat.com \
--to=oleg@redhat.com \
--cc=ak@linux.intel.com \
--cc=andi@firstfloor.org \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.