From: Peter Zijlstra <peterz@infradead.org>
To: Jan Beulich <JBeulich@suse.com>
Cc: Andy Lutomirski <luto@kernel.org>, Borislav Petkov <bp@alien8.de>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Brian Gerst <brgerst@gmail.com>,
Matthew Whitehead <tedheadster@gmail.com>,
Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
x86@kernel.org, xen-devel <Xen-devel@lists.xen.org>,
One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Juergen Gross <JGross@suse.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [Xen-devel] [PATCH v3 4/4] x86/asm: Rewrite sync_core() to use IRET-to-self
Date: Tue, 6 Dec 2016 10:25:20 +0100 [thread overview]
Message-ID: <20161206092520.GX3092@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <584688FD02000078001257BB@prv-mh.provo.novell.com>
On Tue, Dec 06, 2016 at 01:46:37AM -0700, Jan Beulich wrote:
> > + asm volatile (
> > + "pushfl\n\t"
> > + "pushl %%cs\n\t"
> > + "pushl $1f\n\t"
> > + "iret\n\t"
> > + "1:"
> > + : "+r" (__sp) : : "cc", "memory");
>
> I don't thing EFLAGS (i.e. "cc") gets modified anywhere here. And
> the memory clobber would perhaps better be pulled out into an
> explicit barrier() invocation (making it more obvious what it's needed
> for)?
EVerything that implies a memory barrier (and I think serializing
instructions do that) also imply a compiler barrier.
Not doing the memory clobber gets you inconsistency wrt everything else.
WARNING: multiple messages have this Message-ID (diff)
From: Peter Zijlstra <peterz@infradead.org>
To: Jan Beulich <JBeulich@suse.com>
Cc: Juergen Gross <JGross@suse.com>,
One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
"H. Peter Anvin" <hpa@zytor.com>,
Andy Lutomirski <luto@kernel.org>,
Andrew Cooper <andrew.cooper3@citrix.com>,
x86@kernel.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Matthew Whitehead <tedheadster@gmail.com>,
Borislav Petkov <bp@alien8.de>,
Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
Brian Gerst <brgerst@gmail.com>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
xen-devel <Xen-devel@lists.xen.org>
Subject: Re: [PATCH v3 4/4] x86/asm: Rewrite sync_core() to use IRET-to-self
Date: Tue, 6 Dec 2016 10:25:20 +0100 [thread overview]
Message-ID: <20161206092520.GX3092@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <584688FD02000078001257BB@prv-mh.provo.novell.com>
On Tue, Dec 06, 2016 at 01:46:37AM -0700, Jan Beulich wrote:
> > + asm volatile (
> > + "pushfl\n\t"
> > + "pushl %%cs\n\t"
> > + "pushl $1f\n\t"
> > + "iret\n\t"
> > + "1:"
> > + : "+r" (__sp) : : "cc", "memory");
>
> I don't thing EFLAGS (i.e. "cc") gets modified anywhere here. And
> the memory clobber would perhaps better be pulled out into an
> explicit barrier() invocation (making it more obvious what it's needed
> for)?
EVerything that implies a memory barrier (and I think serializing
instructions do that) also imply a compiler barrier.
Not doing the memory clobber gets you inconsistency wrt everything else.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-12-06 10:08 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-05 21:32 [PATCH v3 0/4] CPUID-less CPU/sync_core fixes and improvements Andy Lutomirski
2016-12-05 21:32 ` [PATCH v3 1/4] x86/asm/32: Make sync_core() handle missing CPUID on all 32-bit kernels Andy Lutomirski
2016-12-05 21:32 ` Andy Lutomirski
2016-12-05 21:32 ` [PATCH v3 2/4] Revert "x86/boot: Fail the boot if !M486 and CPUID is missing" Andy Lutomirski
2016-12-05 21:32 ` Andy Lutomirski
2016-12-05 21:32 ` [PATCH v3 3/4] x86/microcode/intel: Replace sync_core() with native_cpuid() Andy Lutomirski
2016-12-05 21:32 ` Andy Lutomirski
2016-12-05 21:32 ` [PATCH v3 4/4] x86/asm: Rewrite sync_core() to use IRET-to-self Andy Lutomirski
2016-12-06 7:52 ` Borislav Petkov
2016-12-06 7:52 ` Borislav Petkov
2016-12-06 17:49 ` Andy Lutomirski
2016-12-06 17:49 ` Andy Lutomirski
2016-12-06 8:46 ` Jan Beulich
2016-12-06 8:46 ` [Xen-devel] " Jan Beulich
2016-12-06 9:25 ` Peter Zijlstra [this message]
2016-12-06 9:25 ` Peter Zijlstra
2016-12-06 9:49 ` Jan Beulich
2016-12-06 17:46 ` [Xen-devel] " Andy Lutomirski
2016-12-06 17:46 ` Andy Lutomirski
2016-12-06 19:32 ` [Xen-devel] " H. Peter Anvin
2016-12-06 19:32 ` H. Peter Anvin
2016-12-05 21:32 ` Andy Lutomirski
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=20161206092520.GX3092@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=JBeulich@suse.com \
--cc=JGross@suse.com \
--cc=Xen-devel@lists.xen.org \
--cc=andrew.cooper3@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=hmh@hmh.eng.br \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=tedheadster@gmail.com \
--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.