From nobody Tue Feb 10 23:58:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529091996148382.67004780234186; Fri, 15 Jun 2018 12:46:36 -0700 (PDT) Received: from localhost ([::1]:48965 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTug7-0001X1-E8 for importer@patchew.org; Fri, 15 Jun 2018 15:46:35 -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) 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) 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-Google-Smtp-Source: ADUXVKLLSlw7TntYvdtdO/RivXDyznfjiUmSFhGzxpZnSXOe7YMuYcWwUKT7EKA1E2GcBfCXdxum/A== X-Received: by 2002:aa7:854e:: with SMTP id y14-v6mr3302088pfn.165.1529091841277; Fri, 15 Jun 2018 12:44:01 -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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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(-) 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" : "=3Da" (xcrl), "=3Dd" (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" : "=3Da" (xcrl), "=3Dd" (xcrh) : = "c" (0)); if ((xcrl & 6) =3D=3D 6) { have_avx1 =3D (c & bit_AVX) !=3D 0; have_avx2 =3D (b7 & bit_AVX2) !=3D 0; --=20 2.17.1