From patchwork Fri Jun 15 19:43:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 138752 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1244810lji; Fri, 15 Jun 2018 12:44:36 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL92legBRKTT5rQb8nFqRrn2cyQynupYJWP3+skIHr9A2N3DibsKJXfTaJkijX4sA0k3XOs X-Received: by 2002:a37:b603:: with SMTP id g3-v6mr2659468qkf.208.1529091876604; Fri, 15 Jun 2018 12:44:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529091876; cv=none; d=google.com; s=arc-20160816; b=SjAoyhlqONx/rDSS4Qpx7kd2fnYAJH2vvUk4YxZCzY2JedqHPBXcyTeSOc1X4z6Gw+ jh4zT2LwbHdvNHeZQFlbQh6zG1Ija034L6AEhAnYO5D3YftuTujORqSn1PT5rTXqxfrX vCeVAi0JblEiNbDDpDSib/9SaJtbejpQ1oZMQg3IHixBY2MpKC1QZJCIXMA4pK+jk/2o SNHT8yix6xyxGsiOF5aLJ390gAIiRFCs9rwh4N0XNFnvTzUFmLIWca6P9ldaYk70L6rN usqW5wJBisScruWykXbkIz2DzVKQGy8LiVKpbMqvoy02iRRfwPNsZYwAlDwdmnprWylP mCQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=8yfaMikkCfKbwAVcUNBZHbpP9x83/6cBIZm5WMmsiqk=; b=TaykK8F4pZUbahIk0yLMhuQrR7LAheLLkEeNjAfsoMOwxvi0U5j/1NwPuDz3M9dTT6 9ZWqCyhwC2ViSe3JvstJtnIlRrBjveqGdh2AP6Wa4bh9rpZgcL3AJfrufliILcjorV+m GOWQSjyujYoP/2jhrVNzB1lyD2tfIFvIFiJUz/CsnKejw5RaAjKawbsU6tFWR5ysfN+L 4Bb8C3l26EaOI9XovpPAMy5ugOl0zcgO+ZnoETH3iezDKU72JXzW3w5LK52+3aCrYiP+ jo8ODPVH+M7/u4SoiA4HGcZj1rZqmVJFL71iJkVLWEsB+1vN3nBM+Y1i9PD7UMcqVWmJ bPBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XcYxOWjT; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id k73-v6si7927262qke.106.2018.06.15.12.44.36 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Jun 2018 12:44:36 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XcYxOWjT; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:48955 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTueC-0000Gk-3m for patch@linaro.org; Fri, 15 Jun 2018 15:44:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTudi-0000E3-3i for qemu-devel@nongnu.org; Fri, 15 Jun 2018 15:44:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTude-0002Lo-Nz for qemu-devel@nongnu.org; Fri, 15 Jun 2018 15:44:06 -0400 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:41327) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fTude-0002LI-Gy for qemu-devel@nongnu.org; Fri, 15 Jun 2018 15:44:02 -0400 Received: by mail-pg0-x241.google.com with SMTP id l65-v6so4852853pgl.8 for ; Fri, 15 Jun 2018 12:44:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8yfaMikkCfKbwAVcUNBZHbpP9x83/6cBIZm5WMmsiqk=; b=XcYxOWjTiQ6BHxWDeh+Q4JM+LKrGFxfsUkG3jf5dbUjE9bzK99MEFrRBbzNp95T78W jKce6Og5L0c9cVwdzSbcIhonvmJCNgHYWUuUcOrqXwzVibJOFiyB0x+fxtIhzB5f3iFH 5geB9o45KYYh97HvkrwfyShg4Y6nOEfhN4pks= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8yfaMikkCfKbwAVcUNBZHbpP9x83/6cBIZm5WMmsiqk=; b=Hut+xX4ezs5zBLR5fram6QgAo4fi3muM6km+6WGES95hhYtP4I3RupLYBiyZEkLG7p fbDx+CaSJ+Og3wKoby6ciYh/kllJ82lxt84B6vlIOnj9tJ1s346ciITEdkIT6Z6FRqLu dx+Wpsaaoh/+B0CKpDewN9JiY3lwb7YbfpA2chOcQ7kSyQDBMZBFnk/DjrVV8A2jDXwg O52WZnvFvlYNFiNxglAE1t/bz6DtcX9C9dLzZxFxyJhXj+DXKTrEBtXTSvdIjiKbduGd p9rI+OubZd2w7lRhPsegVZUh6q5q4pcZ9rK6kuGuIcd3d7TkhuK9mRrqH5RSUVNH0F1l d8Gg== X-Gm-Message-State: APt69E2y3cbD8kLoWPWFBHQMg5zovZG/sgMWJnzKRQs3/ycuKh0IPD3U Usm/lxjN3MSMyjdxWMyCAF39nqEpR5E= X-Received: by 2002:aa7:854e:: with SMTP id y14-v6mr3302088pfn.165.1529091841277; Fri, 15 Jun 2018 12:44:01 -0700 (PDT) Received: from cloudburst.twiddle.net (rrcs-173-198-77-219.west.biz.rr.com. [173.198.77.219]) by smtp.gmail.com with ESMTPSA id 29-v6sm14038360pfj.14.2018.06.15.12.43.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Jun 2018 12:44:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 15 Jun 2018 09:43:36 -1000 Message-Id: <20180615194354.12489-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180615194354.12489-1-richard.henderson@linaro.org> References: <20180615194354.12489-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::241 Subject: [Qemu-devel] [PULL v2 01/19] tcg/i386: Use byte form of xgetbv instruction X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, John Arbuckle Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: John Arbuckle 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 Message-Id: <20180604215102.11002-1-programmingkidx@gmail.com> Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.inc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.17.1 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;