From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Subject: Re: [PATCH v2] x86/HVM: change the flags cpu context field to uint64_t Date: Mon, 18 Jan 2016 16:38:54 +0100 Message-ID: <569D070E.9070209@citrix.com> References: <569CFAEE.3050805@citrix.com> <1453129771-78737-1-git-send-email-roger.pau@citrix.com> <569D10F002000078000C8169@prv-mh.provo.novell.com> <569D0396.2060207@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aLBtt-0007RO-GJ for xen-devel@lists.xenproject.org; Mon, 18 Jan 2016 15:39:25 +0000 In-Reply-To: <569D0396.2060207@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper , Jan Beulich Cc: xen-devel@lists.xenproject.org, Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org El 18/01/16 a les 16.24, Andrew Cooper ha escrit: > On 18/01/16 15:21, Jan Beulich wrote: >>>>> On 18.01.16 at 16:09, wrote: >>> --- 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; >>> }; >> How is the UL going to make this safe for a 32-bit consumer? >> Makes me think that, other than just said in reply to v1, it'll >> indeed be better to have a separate field (with a separate >> zero-check)... The (undesirable imo) alternative being to use >> 1L instead. > > I am happy either way. My R-b stands. What about using ULL or simply casting to uint64_t? Roger.