diff mbox

x86/HVM: add padding to hvm_hw_cpu

Message ID 1453127950-78500-1-git-send-email-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Roger Pau Monné Jan. 18, 2016, 2:39 p.m. UTC
So that the size of the structure is the same on 32 and 64bit.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
This should fix the issues seen on OSSTest when using a 32bit toolstack on
a 64bit hypervisor to create a Windows 7 HVM guest.
---
 xen/include/public/arch-x86/hvm/save.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Andrew Cooper Jan. 18, 2016, 2:47 p.m. UTC | #1
On 18/01/16 14:39, Roger Pau Monne wrote:
> So that the size of the structure is the same on 32 and 64bit.
>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> This should fix the issues seen on OSSTest when using a 32bit toolstack on
> a 64bit hypervisor to create a Windows 7 HVM guest.
> ---
>  xen/include/public/arch-x86/hvm/save.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/xen/include/public/arch-x86/hvm/save.h b/xen/include/public/arch-x86/hvm/save.h
> index b6b1bf8..6862720 100644
> --- a/xen/include/public/arch-x86/hvm/save.h
> +++ b/xen/include/public/arch-x86/hvm/save.h
> @@ -163,6 +163,7 @@ struct hvm_hw_cpu {
>  #define _XEN_X86_FPU_INITIALISED        0
>  #define XEN_X86_FPU_INITIALISED         (1U<<_XEN_X86_FPU_INITIALISED)
>      uint32_t flags;
> +    uint32_t pad0;

I would extend flags to uint64_t, so the existing ctxt.flags &
~XEN_X86_FPU_INITIALISED check for unused bits will cover all of them.

~Andrew
Jan Beulich Jan. 18, 2016, 3:17 p.m. UTC | #2
>>> On 18.01.16 at 15:47, <andrew.cooper3@citrix.com> wrote:
>> index b6b1bf8..6862720 100644
>> --- a/xen/include/public/arch-x86/hvm/save.h
>> +++ b/xen/include/public/arch-x86/hvm/save.h
>> @@ -163,6 +163,7 @@ struct hvm_hw_cpu {
>>  #define _XEN_X86_FPU_INITIALISED        0
>>  #define XEN_X86_FPU_INITIALISED         (1U<<_XEN_X86_FPU_INITIALISED)
>>      uint32_t flags;
>> +    uint32_t pad0;
> 
> I would extend flags to uint64_t, so the existing ctxt.flags &
> ~XEN_X86_FPU_INITIALISED check for unused bits will cover all of them.

Actually I would have suggested against that (and demanded the
new field to be checked), but I see the new patch and your R-b
already came through, so I'm not going to demand a 3rd version.

Jan
diff mbox

Patch

diff --git a/xen/include/public/arch-x86/hvm/save.h b/xen/include/public/arch-x86/hvm/save.h
index b6b1bf8..6862720 100644
--- a/xen/include/public/arch-x86/hvm/save.h
+++ b/xen/include/public/arch-x86/hvm/save.h
@@ -163,6 +163,7 @@  struct hvm_hw_cpu {
 #define _XEN_X86_FPU_INITIALISED        0
 #define XEN_X86_FPU_INITIALISED         (1U<<_XEN_X86_FPU_INITIALISED)
     uint32_t flags;
+    uint32_t pad0;
 };
 
 struct hvm_hw_cpu_compat {