qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, John Arbuckle <programmingkidx@gmail.com>
Subject: [Qemu-devel] [PULL v2 01/19] tcg/i386: Use byte form of xgetbv instruction
Date: Fri, 15 Jun 2018 09:43:36 -1000	[thread overview]
Message-ID: <20180615194354.12489-2-richard.henderson@linaro.org> (raw)
In-Reply-To: <20180615194354.12489-1-richard.henderson@linaro.org>

From: John Arbuckle <programmingkidx@gmail.com>

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 <programmingkidx@gmail.com>
Message-Id: <20180604215102.11002-1-programmingkidx@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 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

  reply	other threads:[~2018-06-15 19:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-15 19:43 [Qemu-devel] [PULL v2 00/19] tcg queued patches Richard Henderson
2018-06-15 19:43 ` Richard Henderson [this message]
2018-06-15 19:43 ` [Qemu-devel] [PULL v2 02/19] qht: require a default comparison function Richard Henderson
2018-06-15 19:43 ` [Qemu-devel] [PULL v2 03/19] qht: return existing entry when qht_insert fails Richard Henderson
2018-06-15 19:43 ` [Qemu-devel] [PULL v2 04/19] tcg: track TBs with per-region BST's Richard Henderson
2018-06-15 19:43 ` [Qemu-devel] [PULL v2 05/19] tcg: move tb_ctx.tb_phys_invalidate_count to tcg_ctx Richard Henderson
2018-06-15 19:43 ` [Qemu-devel] [PULL v2 06/19] translate-all: iterate over TBs in a page with PAGE_FOR_EACH_TB Richard Henderson
2018-06-15 19:43 ` [Qemu-devel] [PULL v2 07/19] translate-all: make l1_map lockless Richard Henderson
2018-06-15 19:43 ` [Qemu-devel] [PULL v2 08/19] translate-all: remove hole in PageDesc Richard Henderson
2018-06-15 19:43 ` [Qemu-devel] [PULL v2 09/19] translate-all: work page-by-page in tb_invalidate_phys_range_1 Richard Henderson
2018-06-15 19:43 ` [Qemu-devel] [PULL v2 10/19] translate-all: move tb_invalidate_phys_page_range up in the file Richard Henderson
2018-06-15 19:43 ` [Qemu-devel] [PULL v2 11/19] translate-all: use per-page locking in !user-mode Richard Henderson
2018-06-15 19:43 ` [Qemu-devel] [PULL v2 12/19] translate-all: add page_locked assertions Richard Henderson
2018-06-15 19:43 ` [Qemu-devel] [PULL v2 13/19] translate-all: introduce assert_no_pages_locked Richard Henderson
2018-06-15 19:43 ` [Qemu-devel] [PULL v2 14/19] translate-all: discard TB when tb_link_page returns an existing matching TB Richard Henderson
2018-06-15 19:43 ` [Qemu-devel] [PULL v2 15/19] translate-all: protect TB jumps with a per-destination-TB lock Richard Henderson
2018-06-15 19:43 ` [Qemu-devel] [PULL v2 16/19] cputlb: remove tb_lock from tlb_flush functions Richard Henderson
2018-06-15 19:43 ` [Qemu-devel] [PULL v2 17/19] translate-all: remove tb_lock mention from cpu_restore_state_from_tb Richard Henderson
2018-06-15 19:43 ` [Qemu-devel] [PULL v2 18/19] tcg: remove tb_lock Richard Henderson
2018-06-15 19:43 ` [Qemu-devel] [PULL v2 19/19] tcg: Reduce max TB opcode count Richard Henderson

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=20180615194354.12489-2-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=programmingkidx@gmail.com \
    --cc=qemu-devel@nongnu.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).