From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Subject: Re: [PATCH RFC 2/3] xen/hvm: introduce a fpu_initialised filed to the CPU save record Date: Thu, 15 Oct 2015 11:53:00 +0200 Message-ID: <561F777C.3060406@citrix.com> References: <1444839880-15260-1-git-send-email-roger.pau@citrix.com> <1444839880-15260-3-git-send-email-roger.pau@citrix.com> <561E8808.7060009@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 1ZmfDd-0006EC-FT for xen-devel@lists.xenproject.org; Thu, 15 Oct 2015 09:53:05 +0000 In-Reply-To: <561E8808.7060009@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 , xen-devel@lists.xenproject.org Cc: Jan Beulich List-Id: xen-devel@lists.xenproject.org El 14/10/15 a les 18.51, Andrew Cooper ha escrit: > On 14/10/15 17:24, Roger Pau Monne wrote: >> Introduce a new filed to signal if the FPU has been initialised or not. Xen > > "field", I am guessing? Yes. >> diff --git a/xen/include/public/arch-x86/hvm/save.h b/xen/include/public/arch-x86/hvm/save.h >> index c7560f2..c4863be 100644 >> --- a/xen/include/public/arch-x86/hvm/save.h >> +++ b/xen/include/public/arch-x86/hvm/save.h >> @@ -47,7 +47,8 @@ DECLARE_HVM_SAVE_TYPE(HEADER, 1, struct hvm_save_header); >> /* >> * Processor >> * >> - * Compat: Pre-3.4 didn't have msr_tsc_aux >> + * Compat2: Pre-4.7 didn't have fpu_initialised >> + * Compat1: Pre-3.4 didn't have msr_tsc_aux > > I would suggest reversing the Compat1 and 2 lines, to match chronology. OK, that's fine. >> */ >> >> struct hvm_hw_cpu { >> @@ -157,9 +158,121 @@ struct hvm_hw_cpu { >> }; >> /* error code for pending event */ >> uint32_t error_code; >> + /* is fpu initialised? */ >> + uint8_t fpu_initialised:1; > > Bitfields can't be used in the public ABI, and please don't leave > trailing implicit padding. Sadly we already have quite a lot of bitfields in the same file (see hvm_hw_vpic) but I understand why they shouldn't be used, specially if we do the versioning based on the size of the structure. > I would recommend uint32_t flags and specify that bit 0 indicates that > fpu context is initialised. Right. Roger.