From patchwork Mon Jan 18 15:09:31 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: 8055261 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 66D219F818 for ; Mon, 18 Jan 2016 15:12:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 96112203AC for ; Mon, 18 Jan 2016 15:12:21 +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 AE90B203A1 for ; Mon, 18 Jan 2016 15:12:17 +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 1aLBR7-0005Jg-2s; Mon, 18 Jan 2016 15:09:41 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aLBR5-0005JX-MU for xen-devel@lists.xenproject.org; Mon, 18 Jan 2016 15:09:39 +0000 Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id C7/3D-15353-2300D965; Mon, 18 Jan 2016 15:09:38 +0000 X-Env-Sender: prvs=8183bab3b=roger.pau@citrix.com X-Msg-Ref: server-4.tower-206.messagelabs.com!1453129776!16543141!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 46825 invoked from network); 18 Jan 2016 15:09:38 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 18 Jan 2016 15:09:38 -0000 X-IronPort-AV: E=Sophos;i="5.22,312,1449532800"; d="scan'208";a="332167362" From: Roger Pau Monne To: Date: Mon, 18 Jan 2016 16:09:31 +0100 Message-ID: <1453129771-78737-1-git-send-email-roger.pau@citrix.com> X-Mailer: git-send-email 1.9.5 (Apple Git-50.3) In-Reply-To: <569CFAEE.3050805@citrix.com> References: <569CFAEE.3050805@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Andrew Cooper , Ian Jackson , Ian Campbell , Jan Beulich , Roger Pau Monne Subject: [Xen-devel] [PATCH v2] x86/HVM: change the flags cpu context field to uint64_t 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 So that the size of the structure is the same on 32 and 64bit. Signed-off-by: Roger Pau Monné Reviewed-by: Andrew Cooper --- Cc: Ian Campbell Cc: Ian Jackson Cc: Jan Beulich Cc: Andrew Cooper --- This should fix the issues seen on OSSTest when using a 32bit toolstack on a 64bit hypervisor to create a Windows 7 HVM guest. --- Changes since v1: - Instead of adding padding, change the flags field to be a uint64_t. --- xen/arch/x86/hvm/hvm.c | 2 +- xen/include/public/arch-x86/hvm/save.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index a99edc2..1364d16 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -2017,7 +2017,7 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h) if ( (ctxt.flags & ~XEN_X86_FPU_INITIALISED) != 0 ) { - gprintk(XENLOG_ERR, "bad flags value in CPU context: %#x\n", + gprintk(XENLOG_ERR, "bad flags value in CPU context: %#lx\n", ctxt.flags); return -EINVAL; } diff --git a/xen/include/public/arch-x86/hvm/save.h b/xen/include/public/arch-x86/hvm/save.h index b6b1bf8..3fac45b 100644 --- a/xen/include/public/arch-x86/hvm/save.h +++ b/xen/include/public/arch-x86/hvm/save.h @@ -161,8 +161,8 @@ struct hvm_hw_cpu { uint32_t error_code; #define _XEN_X86_FPU_INITIALISED 0 -#define XEN_X86_FPU_INITIALISED (1U<<_XEN_X86_FPU_INITIALISED) - uint32_t flags; +#define XEN_X86_FPU_INITIALISED (1UL<<_XEN_X86_FPU_INITIALISED) + uint64_t flags; }; struct hvm_hw_cpu_compat {