All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>
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	[thread overview]
Message-ID: <561F777C.3060406@citrix.com> (raw)
In-Reply-To: <561E8808.7060009@citrix.com>

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.

  parent reply	other threads:[~2015-10-15  9:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-14 16:24 [PATCH RFC 0/3] Introduce a fpu_initilised filed to HVM CPU context Roger Pau Monne
2015-10-14 16:24 ` [PATCH RFC 1/3] xen/save: pass a size paramter to the HVM compat functions Roger Pau Monne
2015-10-15  8:12   ` Jan Beulich
2015-10-15  9:49     ` Roger Pau Monné
2015-10-15  9:59       ` Jan Beulich
2015-10-15 10:31         ` Andrew Cooper
2015-10-14 16:24 ` [PATCH RFC 2/3] xen/hvm: introduce a fpu_initialised filed to the CPU save record Roger Pau Monne
2015-10-14 16:51   ` Andrew Cooper
2015-10-15  8:13     ` Jan Beulich
2015-10-15  9:53     ` Roger Pau Monné [this message]
2015-10-14 16:24 ` [PATCH RFC 3/3] Revert "libxc: create an initial FPU state for HVM guests" Roger Pau Monne
2015-10-14 16:30   ` Wei Liu
2015-11-16 12:51     ` Ian Campbell
2015-11-17 12:16       ` Roger Pau Monné

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=561F777C.3060406@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.