From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: [PATCH for-next 2/2] xen/x86: Drop sync_core()
Date: Fri, 19 May 2017 19:49:07 +0100 [thread overview]
Message-ID: <1495219747-26305-2-git-send-email-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <1495219747-26305-1-git-send-email-andrew.cooper3@citrix.com>
As identified in Linux c/s c198b121b1a1d "x86/asm: Rewrite sync_core() to use
IRET-to-self", sync_core() is only appropriate for two very specific usecases.
Xen doesn't have need of either of these usecases, so drop sync_core() to
avoid any misuse.
In the unlikely event that we do gain a legitimate use for sync_core(), it
should be reintroduced as a mov to %cr2 rather than cpuid, which has a lower
overhead.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
---
xen/include/asm-x86/processor.h | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index 1d1a4ff..6a335d3 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -396,17 +396,6 @@ static inline bool_t read_pkru_wd(uint32_t pkru, unsigned int pkey)
outb((data), 0x23); \
} while (0)
-/* Stop speculative execution */
-static inline void sync_core(void)
-{
- int tmp;
- asm volatile (
- "cpuid"
- : "=a" (tmp)
- : "0" (1)
- : "ebx","ecx","edx","memory" );
-}
-
static always_inline void __monitor(const void *eax, unsigned long ecx,
unsigned long edx)
{
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-05-19 18:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-19 18:49 [PATCH for-next 1/2] xen/x86/alternatives: Do not use sync_core() to serialize I$ Andrew Cooper
2017-05-19 18:49 ` Andrew Cooper [this message]
2017-05-22 13:39 ` [PATCH for-next 2/2] xen/x86: Drop sync_core() Jan Beulich
2017-05-20 0:29 ` [PATCH for-next 1/2] xen/x86/alternatives: Do not use sync_core() to serialize I$ Konrad Rzeszutek Wilk
2017-05-22 13:38 ` Jan Beulich
2017-05-22 13:51 ` Andrew Cooper
2017-05-22 14:17 ` Jan Beulich
2017-05-22 14:26 ` Juergen Gross
2017-05-22 15:29 ` Jan Beulich
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=1495219747-26305-2-git-send-email-andrew.cooper3@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.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 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).