From patchwork Tue Jan 12 16:12:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 8019071 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CD3F0BEEE5 for ; Tue, 12 Jan 2016 16:15:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EE4C3203C4 for ; Tue, 12 Jan 2016 16:15:53 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 12A5F203AE for ; Tue, 12 Jan 2016 16:15:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aJ1Yr-0004Zk-Hl; Tue, 12 Jan 2016 16:12:45 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aJ1Yq-0004Zd-QQ for xen-devel@lists.xenproject.org; Tue, 12 Jan 2016 16:12:44 +0000 Received: from [85.158.139.211] by server-14.bemta-5.messagelabs.com id AB/EB-18633-CF525965; Tue, 12 Jan 2016 16:12:44 +0000 X-Env-Sender: prvs=812c9b64b=roger.pau@citrix.com X-Msg-Ref: server-5.tower-206.messagelabs.com!1452615161!15412150!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 14277 invoked from network); 12 Jan 2016 16:12:43 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 12 Jan 2016 16:12:43 -0000 X-IronPort-AV: E=Sophos;i="5.20,558,1444694400"; d="scan'208";a="330675753" From: Roger Pau Monne To: Date: Tue, 12 Jan 2016 17:12:33 +0100 Message-ID: <1452615153-67387-3-git-send-email-roger.pau@citrix.com> X-Mailer: git-send-email 1.9.5 (Apple Git-50.3) In-Reply-To: <1452615153-67387-1-git-send-email-roger.pau@citrix.com> References: <1452615153-67387-1-git-send-email-roger.pau@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Wei Liu , Ian Campbell , Stefano Stabellini , Andrew Cooper , Ian Jackson , Jan Beulich , Roger Pau Monne Subject: [Xen-devel] [PATCH v6 2/2] Revert "libxc: create an initial FPU state for HVM guests" X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This reverts commit d64dbbcc7c9934a46126c59d78536235908377ad: Xen always set the FPU as initialized when loading a HVM context, so libxc has to provide a valid FPU context when setting the CPU registers. This was a stop-gap measure in order to unblock OSSTest Windows 7 failures while a proper fix for the HVM CPU save/restore is being worked on. This can now be reverted because a proper fix is in place and we can signal in the save record whether the FPU is initialized or not. Signed-off-by: Roger Pau Monné Reviewed-by: Andrew Cooper Acked-by: Wei Liu Cc: Jan Beulich Cc: Andrew Cooper Cc: Ian Jackson Cc: Stefano Stabellini Cc: Ian Campbell Cc: Wei Liu --- tools/libxc/xc_dom_x86.c | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c index b8d2904..b650762 100644 --- a/tools/libxc/xc_dom_x86.c +++ b/tools/libxc/xc_dom_x86.c @@ -987,27 +987,6 @@ static int vcpu_hvm(struct xc_dom_image *dom) struct hvm_save_descriptor end_d; HVM_SAVE_TYPE(END) end; } bsp_ctx; - /* - * The layout of the fpu context structure is the same for - * both 32 and 64 bits. - */ - struct { - uint16_t fcw; - uint16_t fsw; - uint8_t ftw; - uint8_t rsvd1; - uint16_t fop; - union { - uint64_t addr; - struct { - uint32_t offs; - uint16_t sel; - uint16_t rsvd; - }; - } fip, fdp; - uint32_t mxcsr; - uint32_t mxcsr_mask; - } *fpu_ctxt; uint8_t *full_ctx = NULL; int rc; @@ -1075,23 +1054,6 @@ static int vcpu_hvm(struct xc_dom_image *dom) /* Set the control registers. */ bsp_ctx.cpu.cr0 = X86_CR0_PE | X86_CR0_ET; - /* - * XXX: Set initial FPU state. - * - * This should be removed once Xen is able to know if the - * FPU state saved is valid or not, now Xen always sets - * fpu_initialised to true regardless of the FPU state. - * - * The code below mimics the FPU sate after executing - * fninit - * ldmxcsr 0x1f80 - */ - fpu_ctxt = (typeof(fpu_ctxt))bsp_ctx.cpu.fpu_regs; - - fpu_ctxt->fcw = 0x37f; - fpu_ctxt->ftw = 0xff; - fpu_ctxt->mxcsr = 0x1f80; - /* Set the IP. */ bsp_ctx.cpu.rip = dom->parms.phys_entry;