From nobody Tue May 7 02:26:31 2024 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=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528146760641239.50012897030183; Mon, 4 Jun 2018 14:12:40 -0700 (PDT) Received: from localhost ([::1]:41980 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPwmN-00030I-Sw for importer@patchew.org; Mon, 04 Jun 2018 17:12:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPwl8-0002Ra-EL for qemu-devel@nongnu.org; Mon, 04 Jun 2018 17:11:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPwl5-00029D-75 for qemu-devel@nongnu.org; Mon, 04 Jun 2018 17:11:22 -0400 Received: from mail-it0-x241.google.com ([2607:f8b0:4001:c0b::241]:38626) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fPwl5-00028x-32 for qemu-devel@nongnu.org; Mon, 04 Jun 2018 17:11:19 -0400 Received: by mail-it0-x241.google.com with SMTP id v83-v6so757917itc.3 for ; Mon, 04 Jun 2018 14:11:18 -0700 (PDT) Received: from localhost.localdomain ([69.14.184.20]) by smtp.gmail.com with ESMTPSA id n23-v6sm4182610ioj.43.2018.06.04.14.11.16 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 04 Jun 2018 14:11:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=wIUC2S2uZPQDVE0HHtFoPhjjTO+fX4wKmJbeIlYc1MQ=; b=m55k4EiGt8YX5DGh0SPPn7wCeSFz2wvb5OQJ+EZTCE3CkJLeL8YVL1jciQiPU8/Z/H VJjulvLDJrId6wEWWryD/0ViBTcuJm3dA+I7PaYAG0TeXONR4LS2rdVdKfBNGEDsykd3 qSNT+QvP7AOcsNAaSd+8vhFLvJfLayjFw6YDm9plyXoezEW+dZoQK/tAHmNpP3Js5YnK uuLEOKj+WCkAAKEGFQZXaS5lVaEhONKKQBko+VyAg1/2X7buX6naIyosGNfLfh2VGajN +4+e28eWWwFKz+gLOwYhLflIbvT3r4kYtKfrrK+zqQNPftBytAR3HdWbIOG0gvevxbVS idyA== 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; bh=wIUC2S2uZPQDVE0HHtFoPhjjTO+fX4wKmJbeIlYc1MQ=; b=BZl8+6EMf+6I0xqYGYHGONN32KBiCLsP9SJhFka5bqpYFVrfzkDSWOXDJsoxlLRMSQ Ii0z0H9kGFJ3pY/fjvr8fjrMt3RuHuDpwoZi+Hxzhb6QU9X+o3Rv813dmed7ASFqykNJ tlA+tGBVF2E8JdyZF3hsrHSLWdrHSW6/5zZg+SNVNnESnWR9FP762vWKHkwHck/cniwC ARXFVz1ZGz37j2FJLr964s45zeWQvCGVviRiQmHyoCNPsr4dPOTF7QRqpkGgi/uVaZ/Z yuD3d9dH74On81nCc8d8CGK2cOTYf70ASekuABX6yykDSAm2m8/hWjs+uhg+EpZp83RT 7A+g== X-Gm-Message-State: APt69E2x/sx3CvW0zVTIpDexpajDptAB2BEnZ8m+7IS3mBztlgCqlYRb kPiHJhydVk77L8y2ROgK35o= X-Google-Smtp-Source: ADUXVKIX/9E3WpfIezUZbSzJqH31wIhG2+gxY6ocOkCvkGl3QUFm73bcOgxiarDL3/uUxvKU7tByHg== X-Received: by 2002:a24:43cf:: with SMTP id s198-v6mr15178127itb.28.1528146678309; Mon, 04 Jun 2018 14:11:18 -0700 (PDT) From: John Arbuckle To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 4 Jun 2018 17:11:06 -0400 Message-Id: <20180604211106.4442-1-programmingkidx@gmail.com> X-Mailer: git-send-email 2.14.3 (Apple Git-98) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c0b::241 Subject: [Qemu-devel] [PATCH] tcg-target.inc.c: 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: 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" The assembler in most versions of Mac OS X is pretty old and does not suppo= rt the xgetbv instruction. To go around this problem the raw encoding of the instruction is used instead. Signed-off-by: John Arbuckle --- tcg/i386/tcg-target.inc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c index 5357909..82e004a 100644 --- a/tcg/i386/tcg-target.inc.c +++ b/tcg/i386/tcg-target.inc.c @@ -3501,7 +3501,11 @@ 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 o= f the=20 + * 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.10.2