From patchwork Mon Jun 4 21:51:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Programmingkid X-Patchwork-Id: 10447375 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 455A060284 for ; Mon, 4 Jun 2018 21:52:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35156291A9 for ; Mon, 4 Jun 2018 21:52:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27B44291BB; Mon, 4 Jun 2018 21:52:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D07D7291A9 for ; Mon, 4 Jun 2018 21:52:07 +0000 (UTC) Received: from localhost ([::1]:42097 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPxOY-0007Lt-Nu for patchwork-qemu-devel@patchwork.kernel.org; Mon, 04 Jun 2018 17:52:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPxNp-00071F-Au for qemu-devel@nongnu.org; Mon, 04 Jun 2018 17:51:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPxNm-0004fx-8q for qemu-devel@nongnu.org; Mon, 04 Jun 2018 17:51:21 -0400 Received: from mail-io0-x234.google.com ([2607:f8b0:4001:c06::234]:42141) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fPxNm-0004fj-2y for qemu-devel@nongnu.org; Mon, 04 Jun 2018 17:51:18 -0400 Received: by mail-io0-x234.google.com with SMTP id r24-v6so797500ioh.9 for ; Mon, 04 Jun 2018 14:51: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=nzalL6B5q+wfh5gXrdDk/JczswScedsZmUqGUdMR/Us=; b=T04SUUUecehctnTzN1J9AcS+W/inB60RO6lkGfZmnwT1OYvLcgR1O0Q51FqVo9YVvt HUVbufL4Tz3t/sPOEmXBwVRkEFmJBhXe02zpcevXDtjfOgSsGoxJq6UN8jut1IzAzM8u Oq/GtugdSkcQuIs4JQIIkIRDyI+sKyj0wHZZYOdXa7HXsh3Z2C8Zoo0mao35rkihaoU6 yj7E1jsKB2pdzaZsCksxpSq0ijR9UsyRIHhQC5//+FO9mbVWXnZToJvvAO1nXPTmP8EY 17tfdwxP1XtY3qfsznPzsjFSM4SSopj6tvkTwYJaY5AJ1+/ukAr8HTWo5Oe4EWG8gIH7 +TFw== 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=nzalL6B5q+wfh5gXrdDk/JczswScedsZmUqGUdMR/Us=; b=UZTyVkE3oI/SGl4B4H56Nzn22FaaSFlVK3X6ils9ID2cTA9/+SekC5JjyuqBBKjz3S 9JeX3DkGzm00ss+iy7HrOe2TUXcLBWCGz8cRjQL7TL/WkT9kdoOa9rGsvjlECxB4oQ2i Gpk70Ru9cEIraBut8qjetiJmNYQHkrA/NH/SnfAfpgV+/fxFIbIg24kSdVkB/Mwmw9hV 6Ub/lDFRy8Mq+8BwZ6UySIJgeNDF5cyZd/s90x/ObQrM0roUcVpA/9n0RYY0QB0n2/zq W5l5yfsWV/ilZtJwueGFSW5u764P9206NYyZUG5jUCqdyuX2jO1fKn3IEF69uxgkbUK0 B2WA== X-Gm-Message-State: ALKqPwcWtOBK5jOfoeuXBkT14k94wsOzB+j/h1hjjXqCTyw3NA2Nenvc k61yRfzPWOOWv3sPMvXRn7U= X-Google-Smtp-Source: ADUXVKI3+rgV4LrIXCJTnAcLOSuShE68+ZYLnay0Jtn3GF1HaLx67Gef43zw6j/Ul0IlZEi8j6AIIQ== X-Received: by 2002:a6b:a008:: with SMTP id j8-v6mr22646685ioe.72.1528149077434; Mon, 04 Jun 2018 14:51:17 -0700 (PDT) Received: from localhost.localdomain ([69.14.184.20]) by smtp.gmail.com with ESMTPSA id l24-v6sm4864691iog.59.2018.06.04.14.51.15 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 04 Jun 2018 14:51:16 -0700 (PDT) From: John Arbuckle To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Mon, 4 Jun 2018 17:51:02 -0400 Message-Id: <20180604215102.11002-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:c06::234 Subject: [Qemu-devel] [PATCH v2] 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: John Arbuckle --- v2 changes: - Fixed a spacing issue in the asm() function. 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 5357909fff..09141fa8e0 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" : "=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;