[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/18] tcg/i386: Use byte form of xgetbv instruction
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PULL 01/18] tcg/i386: Use byte form of xgetbv instruction |
Date: |
Thu, 14 Jun 2018 09:31:30 -1000 |
From: John Arbuckle <address@hidden>
The assembler in most versions of Mac OS X is pretty old and does not
support the xgetbv instruction. To go around this problem, the raw
encoding of the instruction is used instead.
Signed-off-by: John Arbuckle <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
tcg/i386/tcg-target.inc.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c
index 5357909fff..0d0ff524b7 100644
--- a/tcg/i386/tcg-target.inc.c
+++ b/tcg/i386/tcg-target.inc.c
@@ -3501,7 +3501,10 @@ static void tcg_target_init(TCGContext *s)
sure of not hitting invalid opcode. */
if (c & bit_OSXSAVE) {
unsigned xcrl, xcrh;
- asm ("xgetbv" : "=a" (xcrl), "=d" (xcrh) : "c" (0));
+ /* The xgetbv instruction is not available to older versions of
+ * the assembler, so we encode the instruction manually.
+ */
+ asm(".byte 0x0f, 0x01, 0xd0" : "=a" (xcrl), "=d" (xcrh) : "c" (0));
if ((xcrl & 6) == 6) {
have_avx1 = (c & bit_AVX) != 0;
have_avx2 = (b7 & bit_AVX2) != 0;
--
2.17.1
- [Qemu-devel] [PULL 00/18] tcg queued patches, Richard Henderson, 2018/06/14
- [Qemu-devel] [PULL 01/18] tcg/i386: Use byte form of xgetbv instruction,
Richard Henderson <=
- [Qemu-devel] [PULL 03/18] qht: return existing entry when qht_insert fails, Richard Henderson, 2018/06/14
- [Qemu-devel] [PULL 02/18] qht: require a default comparison function, Richard Henderson, 2018/06/14
- [Qemu-devel] [PULL 04/18] tcg: track TBs with per-region BST's, Richard Henderson, 2018/06/14
- [Qemu-devel] [PULL 06/18] translate-all: iterate over TBs in a page with PAGE_FOR_EACH_TB, Richard Henderson, 2018/06/14
- [Qemu-devel] [PULL 05/18] tcg: move tb_ctx.tb_phys_invalidate_count to tcg_ctx, Richard Henderson, 2018/06/14
- [Qemu-devel] [PULL 07/18] translate-all: make l1_map lockless, Richard Henderson, 2018/06/14
- [Qemu-devel] [PULL 09/18] translate-all: work page-by-page in tb_invalidate_phys_range_1, Richard Henderson, 2018/06/14
- [Qemu-devel] [PULL 08/18] translate-all: remove hole in PageDesc, Richard Henderson, 2018/06/14
- [Qemu-devel] [PULL 10/18] translate-all: move tb_invalidate_phys_page_range up in the file, Richard Henderson, 2018/06/14
- [Qemu-devel] [PULL 11/18] translate-all: use per-page locking in !user-mode, Richard Henderson, 2018/06/14