From patchwork Wed Jan 10 06:47:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Denis V. Lunev\" via" X-Patchwork-Id: 10154073 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 BDA2E602D8 for ; Wed, 10 Jan 2018 06:48:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A27C128179 for ; Wed, 10 Jan 2018 06:48:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 96E9E2818A; Wed, 10 Jan 2018 06:48:04 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, 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 2518C2817F for ; Wed, 10 Jan 2018 06:48:03 +0000 (UTC) Received: from localhost ([::1]:48989 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZAB9-0006OP-18 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 10 Jan 2018 01:48:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZAAQ-00061A-PA for qemu-devel@nongnu.org; Wed, 10 Jan 2018 01:47:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZAAP-0008SR-VX for qemu-devel@nongnu.org; Wed, 10 Jan 2018 01:47:18 -0500 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]:40731) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eZAAP-0008Py-OT for qemu-devel@nongnu.org; Wed, 10 Jan 2018 01:47:17 -0500 Received: by mail-pl0-x241.google.com with SMTP id 62so6742546pld.7 for ; Tue, 09 Jan 2018 22:47:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=kRbKpq5f6wQ07X/FGa+ui2pDeKsyhBpH97IxmG15ltw=; b=CLgGS3plC3tjmPZZCTRaDZPf5+xZ7tBso0zmNK2SpR/S/zlgdx3KgUbwttJGCdYxim hXz7dVKBx8YfYzZ89T2RmYCCH4ihxxkBkLWoxUbAQyslTBnspupveYX/TPpodrdEOpqJ 9Qp+P3CUodYUp1zQcS+jI+aL2jbyz3GH2BXULK6CKKBGfVtHE78DWp6DSPjlq1z03fc9 OJoQ4BYBNP+uV3sJLd3eJ2Q2f2VwiZ8ehwA5deiFO44YDvmJWn7JbAlyODlCSDnGuhCF LLcXm6mYSff1m8r1tzmm+IeD2Xv2GhI8h6QeOrkTwAEwSsJnbxvL47k/xdeSU/8JB8ny vvuw== 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=kRbKpq5f6wQ07X/FGa+ui2pDeKsyhBpH97IxmG15ltw=; b=Cfd0zdA/mDTVF5gD5/U7UDXHVJ6asWM2Vdmd/6vAK7mt+1UuLl20GC9SrXD3OK0F8H 2JEPTDg5r3XyXKwt874Q/zD1j2g715/SMf+tosrfJtz4L8RxHo6UAjtcVvwtVTjFWufQ QmxWb/H4vIYAR3/JUyi+2Lznc73gr4zq8xo0148Ik1DrPgTtxQYuNJOJkSieAyTFEZvA ye1To53Oe4n5a4IWwyLX0MSJOLvmS4tcbHRLBunuWVp5okkPZYJknHwFWtra3CkwsjSg +lODlsKgcv/x0gi18ksFAfMZGyx60GDKvo2gVGn2z0luGOY28E8oZlv8nNn99jyzFf4Z I7hw== X-Gm-Message-State: AKwxytcvOXRB+usX75VE9Fr9fP75cWdklPPkdigcPgdzoC+yM7WjFRrO 4/S4UzO2hZDie/7Q4RI046+Cpw== X-Google-Smtp-Source: ACJfBouq0fWUR8r6oiC2ZMPGOrvHsb7jZhkcBbl9YydFBX68LrPjpmG2ku+BeAvYhyGv2nqgu2znoQ== X-Received: by 10.84.238.1 with SMTP id u1mr1374381plk.12.1515566835902; Tue, 09 Jan 2018 22:47:15 -0800 (PST) Received: from paxos.mtv.corp.google.com ([2620:0:1000:1611:f4de:39e6:d38c:64eb]) by smtp.gmail.com with ESMTPSA id 69sm35266096pfj.28.2018.01.09.22.47.13 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Jan 2018 22:47:14 -0800 (PST) To: qemu-devel@nongnu.org Date: Tue, 9 Jan 2018 22:47:06 -0800 Message-Id: <20180110064706.49777-1-lepton@google.com> X-Mailer: git-send-email 2.16.0.rc1.238.g530d649a79-goog X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::241 Subject: [Qemu-devel] [PATCH] target/i386: hax: Move hax_setup_qemu_emulator. 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: , X-Patchwork-Original-From: Tao Wu via Qemu-devel From: "Denis V. Lunev\" via" Reply-To: Tao Wu Cc: pbonzini@redhat.com, Tao Wu , ehabkost@redhat.com, rth@twiddle.net Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP hax_setup_qemu_emulator reference env->efer which is updated in hax_get_msrs, so it has to be called after hax_get_msrs. This fix the bug that sometimes dump_state show 32 bits regs even in 64 bits mode. Signed-off-by: Tao Wu --- target/i386/hax-all.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/i386/hax-all.c b/target/i386/hax-all.c index 3ce6950296..a933bd462d 100644 --- a/target/i386/hax-all.c +++ b/target/i386/hax-all.c @@ -887,9 +887,6 @@ static int hax_sync_vcpu_register(CPUArchState *env, int set) return -1; } } - if (!set) { - hax_setup_qemu_emulator(env); - } return 0; } @@ -1070,6 +1067,7 @@ static int hax_arch_get_registers(CPUArchState *env) return ret; } + hax_setup_qemu_emulator(env); return 0; }