]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86: shuffle use of __attribute__((packed))
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 14 Mar 2014 08:44:40 +0000 (09:44 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 14 Mar 2014 08:44:40 +0000 (09:44 +0100)
This is almost all manual shuffling of __attribute__((packed)) statements to
__packed at the head of the structure.

The only different change is in tboot.h, removing some now-redundant ifdefs.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
19 files changed:
xen/arch/x86/bzimage.c
xen/arch/x86/cpu/mcheck/mce-apei.c
xen/arch/x86/dmi_scan.c
xen/arch/x86/microcode_amd.c
xen/arch/x86/mm/shadow/multi.c
xen/arch/x86/oprofile/backtrace.c
xen/arch/x86/trace.c
xen/include/asm-x86/apicdef.h
xen/include/asm-x86/desc.h
xen/include/asm-x86/e820.h
xen/include/asm-x86/edd.h
xen/include/asm-x86/hvm/svm/vmcb.h
xen/include/asm-x86/hvm/vmx/vmx.h
xen/include/asm-x86/i387.h
xen/include/asm-x86/io_apic.h
xen/include/asm-x86/msi.h
xen/include/asm-x86/processor.h
xen/include/asm-x86/tboot.h
xen/include/asm-x86/xstate.h

index d72b832cca398573b0c33508e6969ac9dbce43ac..c86c39ede248e118b859ae1eef050bfb0ad1dbc1 100644 (file)
@@ -146,7 +146,7 @@ static __init int perform_gunzip(char *output, char *image, unsigned long image_
     return rc;
 }
 
-struct setup_header {
+struct __packed setup_header {
         uint8_t         _pad0[0x1f1];           /* skip uninteresting stuff */
         uint8_t         setup_sects;
         uint16_t        root_flags;
@@ -183,7 +183,7 @@ struct setup_header {
         uint64_t        hardware_subarch_data;
         uint32_t        payload_offset;
         uint32_t        payload_length;
-    } __attribute__((packed));
+    };
 
 static __init int bzimage_check(struct setup_header *hdr, unsigned long len)
 {
index 9488dbd37efdb6a2270ee906959ecff18e2e56cf..31f2302ed5af3e7f45c9ed96ba4ccc61c671dcdf 100644 (file)
  * CPER specification (in UEFI specification 2.3 appendix N) requires
  * byte-packed.
  */
-struct cper_mce_record {
+struct __packed cper_mce_record {
        struct cper_record_header hdr;
        struct cper_section_descriptor sec_hdr;
        struct mce mce;
-} __attribute__((packed));
+};
 
 int apei_write_mce(struct mce *m)
 {
index 9d4348b3a5f9f74a8aa5b5541d43bf6df7352fe4..500133ac354681d17ca57f196d5d919deaef1ac5 100644 (file)
 #define memcpy_fromio    memcpy
 #define alloc_bootmem(l) xmalloc_bytes(l)
 
-struct dmi_eps {
+struct __packed dmi_eps {
        char anchor[5];                 /* "_DMI_" */
        u8 checksum;
        u16 size;
        u32 address;
        u16 num_structures;
        u8 revision;
-} __attribute__((packed));
+};
 
-struct smbios_eps {
+struct __packed smbios_eps {
        char anchor[4];                 /* "_SM_" */
        u8 checksum;
        u8 length;
@@ -36,7 +36,7 @@ struct smbios_eps {
        u8 revision;
        u8 _rsrvd_[5];
        struct dmi_eps dmi;
-} __attribute__((packed));
+};
 
 struct dmi_header
 {
index 30142452e9a2d0d037e0ec5288674565f255ca52..b2271736917ed7dd84cd9409962a1fef9bb38f9c 100644 (file)
 #include <asm/microcode.h>
 #include <asm/hvm/svm/svm.h>
 
-struct equiv_cpu_entry {
+struct __packed equiv_cpu_entry {
     uint32_t installed_cpu;
     uint32_t fixed_errata_mask;
     uint32_t fixed_errata_compare;
     uint16_t equiv_cpu;
     uint16_t reserved;
-} __attribute__((packed));
+};
 
-struct microcode_header_amd {
+struct __packed microcode_header_amd {
     uint32_t data_code;
     uint32_t patch_id;
     uint8_t  mc_patch_data_id[2];
@@ -50,7 +50,7 @@ struct microcode_header_amd {
     uint8_t  bios_api_rev;
     uint8_t  reserved1[3];
     uint32_t match_reg[8];
-} __attribute__((packed));
+};
 
 #define UCODE_MAGIC                0x00414d44
 #define UCODE_EQUIV_CPU_TABLE_TYPE 0x00000000
index 3c1b25b998ba9b7bafcec74a198cfba4e1f14cdd..9dfa345902aadf0c301b9de052bd23847951cb11 100644 (file)
@@ -2700,13 +2700,13 @@ static inline void trace_shadow_fixup(guest_l1e_t gl1e,
 {
     if ( tb_init_done )
     {
-        struct {
+        struct __packed {
             /* for PAE, guest_l1e may be 64 while guest_va may be 32;
                so put it first for alignment sake. */
             guest_l1e_t gl1e;
             guest_va_t va;
             u32 flags;
-        } __attribute__((packed)) d;
+        } d;
         u32 event;
 
         event = TRC_SHADOW_FIXUP | ((GUEST_PAGING_LEVELS-2)<<8);
@@ -2724,13 +2724,13 @@ static inline void trace_not_shadow_fault(guest_l1e_t gl1e,
 {
     if ( tb_init_done )
     {
-        struct {
+        struct __packed {
             /* for PAE, guest_l1e may be 64 while guest_va may be 32;
                so put it first for alignment sake. */
             guest_l1e_t gl1e;
             guest_va_t va;
             u32 flags;
-        } __attribute__((packed)) d;
+        } d;
         u32 event;
 
         event = TRC_SHADOW_NOT_SHADOW | ((GUEST_PAGING_LEVELS-2)<<8);
@@ -2749,7 +2749,7 @@ static inline void trace_shadow_emulate_other(u32 event,
 {
     if ( tb_init_done )
     {
-        struct {
+        struct __packed {
             /* for PAE, guest_l1e may be 64 while guest_va may be 32;
                so put it first for alignment sake. */
 #if GUEST_PAGING_LEVELS == 2
@@ -2758,7 +2758,7 @@ static inline void trace_shadow_emulate_other(u32 event,
             u64 gfn;
 #endif
             guest_va_t va;
-        } __attribute__((packed)) d;
+        } d;
 
         event |= ((GUEST_PAGING_LEVELS-2)<<8);
 
@@ -2779,13 +2779,13 @@ static inline void trace_shadow_emulate(guest_l1e_t gl1e, unsigned long va)
 {
     if ( tb_init_done )
     {
-        struct {
+        struct __packed {
             /* for PAE, guest_l1e may be 64 while guest_va may be 32;
                so put it first for alignment sake. */
             guest_l1e_t gl1e, write_val;
             guest_va_t va;
             unsigned flags:29, emulation_count:3;
-        } __attribute__((packed)) d;
+        } d;
         u32 event;
 
         event = TRC_SHADOW_EMULATE | ((GUEST_PAGING_LEVELS-2)<<8);
index b3ea7f386e3565a367d8588bcf7ad237c3992a97..94bd24cd4fd0e89863a07adc64d475ed339b92fb 100644 (file)
 #include <xen/xenoprof.h>
 #include <xen/guest_access.h>
 
-struct frame_head {
+struct __packed frame_head {
     struct frame_head * ebp;
     unsigned long ret;
-} __attribute__((packed));
+};
 typedef struct frame_head frame_head_t;
 DEFINE_XEN_GUEST_HANDLE(frame_head_t);
 
-struct frame_head_32bit {
+struct __packed frame_head_32bit {
     uint32_t ebp;
     uint32_t ret;
-} __attribute__((packed));
+};
 typedef struct frame_head_32bit frame_head32_t;
 DEFINE_COMPAT_HANDLE(frame_head32_t);
 
index b1804a497df3bee1b4ab31fd4a72bf10b88a6d6e..64e9ad096ef9b58e1b27a37a1ef58328aea52a1e 100644 (file)
@@ -38,12 +38,12 @@ void __trace_pv_trap(int trapnr, unsigned long eip,
 {
     if ( is_pv_32on64_vcpu(current) )
     {
-        struct {
+        struct __packed {
             unsigned eip:32,
                 trapnr:15,
                 use_error_code:1,
                 error_code:16;
-        } __attribute__((packed)) d;
+        } d;
 
         d.eip = eip;
         d.trapnr = trapnr;
@@ -54,12 +54,12 @@ void __trace_pv_trap(int trapnr, unsigned long eip,
     }
     else
     {
-        struct {
+        struct __packed {
             unsigned long eip;
             unsigned trapnr:15,
                 use_error_code:1,
                 error_code:16;
-        } __attribute__((packed)) d;
+        } d;
         unsigned event;
 
         d.eip = eip;
@@ -79,9 +79,9 @@ void __trace_pv_page_fault(unsigned long addr, unsigned error_code)
 
     if ( is_pv_32on64_vcpu(current) )
     {
-        struct {
+        struct __packed {
             u32 eip, addr, error_code;
-        } __attribute__((packed)) d;
+        } d;
 
         d.eip = eip;
         d.addr = addr;
@@ -91,10 +91,10 @@ void __trace_pv_page_fault(unsigned long addr, unsigned error_code)
     }
     else
     {
-        struct {
+        struct __packed {
             unsigned long eip, addr;
             u32 error_code;
-        } __attribute__((packed)) d;
+        } d;
         unsigned event;
 
         d.eip = eip;
@@ -125,18 +125,18 @@ void __trace_trap_two_addr(unsigned event, unsigned long va1,
 {
     if ( is_pv_32on64_vcpu(current) )
     {
-        struct {
+        struct __packed {
             u32 va1, va2;
-        } __attribute__((packed)) d;
+        } d;
         d.va1=va1;
         d.va2=va2;
         __trace_var(event, 1, sizeof(d), &d);
     }
     else
     {
-        struct {
+        struct __packed {
             unsigned long va1, va2;
-        } __attribute__((packed)) d;
+        } d;
         d.va1=va1;
         d.va2=va2;
         event |= TRC_64_FLAG;
@@ -158,10 +158,10 @@ void __trace_ptwr_emulation(unsigned long addr, l1_pgentry_t npte)
 
     if ( is_pv_32on64_vcpu(current) )
     {
-        struct {
+        struct __packed {
             l1_pgentry_t pte;
             u32 addr, eip;
-        } __attribute__((packed)) d;
+        } d;
         d.addr = addr;
         d.eip = eip;
         d.pte = npte;
index 2bdb3dfa2a768116e070a051bc3b343c245934f3..d66c8ea987345c81f0df9ebd62bf673b359e56b4 100644 (file)
 #define lapic ((volatile struct local_apic *)APIC_BASE)
 
 #ifndef __ASSEMBLY__
-struct local_apic {
+struct __packed local_apic {
 
 /*000*/        struct { u32 __reserved[4]; } __reserved_01;
 
@@ -388,7 +388,7 @@ struct local_apic {
 
 /*3F0*/        struct { u32 __reserved[4]; } __reserved_20;
 
-} __attribute__ ((packed));
+};
 #endif /* !__ASSEMBLY__ */
 
 #undef u32
index 354b8897ee89519a0e8b7df125f98bcbb5b7332a..4edb834d96128d6d1c6c837382e28592453e1888 100644 (file)
@@ -181,10 +181,10 @@ do {                                                     \
         (((u32)(addr) & 0x00FF0000U) >> 16);             \
 } while (0)
 
-struct desc_ptr {
+struct __packed desc_ptr {
        unsigned short limit;
        unsigned long base;
-} __attribute__((__packed__)) ;
+};
 
 extern struct desc_struct boot_cpu_gdt_table[];
 DECLARE_PER_CPU(struct desc_struct *, gdt_table);
index 0fd81f6a0f4c6fb64eaa0e6bd3a69dc1a204d1e2..08b413d566c437750053549634cf0954c53f3ba1 100644 (file)
 #define E820_NVS          4
 #define E820_UNUSABLE     5
 
-struct e820entry {
+struct __packed e820entry {
     uint64_t addr;
     uint64_t size;
     uint32_t type;
-} __attribute__((packed));
+};
 
 #define E820MAX        128
 
index 5544ba582d30f61d60afe625490a6812729d9b46..afaa23732a385c71d5b3a1fb0be128e8deb69a84 100644 (file)
@@ -25,7 +25,7 @@
 
 #ifndef __ASSEMBLY__
 
-struct edd_info {
+struct __packed edd_info {
     /* Int13, Fn48: Check Extensions Present. */
     u8 device;                   /* %dl: device */
     u8 version;                  /* %ah: major version */
@@ -35,7 +35,7 @@ struct edd_info {
     u8 legacy_max_head;          /* %dh: maximum head number */
     u8 legacy_sectors_per_track; /* %cl[5:0]: maximum sector number */
     /* Int13, Fn41: Get Device Parameters (as filled into %ds:%esi). */
-    struct edd_device_params {
+    struct __packed edd_device_params {
         u16 length;
         u16 info_flags;
         u32 num_default_cylinders;
@@ -51,97 +51,97 @@ struct edd_info {
         u8 host_bus_type[4];
         u8 interface_type[8];
         union {
-            struct {
+            struct __packed {
                 u16 base_address;
                 u16 reserved1;
                 u32 reserved2;
-            } __attribute__ ((packed)) isa;
-            struct {
+            } isa;
+            struct __packed {
                 u8 bus;
                 u8 slot;
                 u8 function;
                 u8 channel;
                 u32 reserved;
-            } __attribute__ ((packed)) pci;
+            } pci;
             /* pcix is same as pci */
-            struct {
+            struct __packed {
                 u64 reserved;
-            } __attribute__ ((packed)) ibnd;
-            struct {
+            } ibnd;
+            struct __packed {
                 u64 reserved;
-            } __attribute__ ((packed)) xprs;
-            struct {
+            } xprs;
+            struct __packed {
                 u64 reserved;
-            } __attribute__ ((packed)) htpt;
-            struct {
+            } htpt;
+            struct __packed {
                 u64 reserved;
-            } __attribute__ ((packed)) unknown;
+            } unknown;
         } interface_path;
         union {
-            struct {
+            struct __packed {
                 u8 device;
                 u8 reserved1;
                 u16 reserved2;
                 u32 reserved3;
                 u64 reserved4;
-            } __attribute__ ((packed)) ata;
-            struct {
+            } ata;
+            struct __packed {
                 u8 device;
                 u8 lun;
                 u8 reserved1;
                 u8 reserved2;
                 u32 reserved3;
                 u64 reserved4;
-            } __attribute__ ((packed)) atapi;
-            struct {
+            } atapi;
+            struct __packed {
                 u16 id;
                 u64 lun;
                 u16 reserved1;
                 u32 reserved2;
-            } __attribute__ ((packed)) scsi;
-            struct {
+            } scsi;
+            struct __packed {
                 u64 serial_number;
                 u64 reserved;
-            } __attribute__ ((packed)) usb;
-            struct {
+            } usb;
+            struct __packed {
                 u64 eui;
                 u64 reserved;
-            } __attribute__ ((packed)) i1394;
-            struct {
+            } i1394;
+            struct __packed {
                 u64 wwid;
                 u64 lun;
-            } __attribute__ ((packed)) fibre;
-            struct {
+            } fibre;
+            struct __packed {
                 u64 identity_tag;
                 u64 reserved;
-            } __attribute__ ((packed)) i2o;
-            struct {
+            } i2o;
+            struct __packed {
                 u32 array_number;
                 u32 reserved1;
                 u64 reserved2;
-            } __attribute__ ((packed)) raid;
-            struct {
+            } raid;
+            struct __packed {
                 u8 device;
                 u8 reserved1;
                 u16 reserved2;
                 u32 reserved3;
                 u64 reserved4;
-            } __attribute__ ((packed)) sata;
-            struct {
+            } sata;
+            struct __packed {
                 u64 reserved1;
                 u64 reserved2;
-            } __attribute__ ((packed)) unknown;
+            } unknown;
         } device_path;
         u8 reserved4;
         u8 checksum;
-    } __attribute__ ((packed)) edd_device_params;
-} __attribute__ ((packed));
+    }  edd_device_params;
+};
 
-struct mbr_signature {
+struct __packed mbr_signature {
     u8 device;
     u8 pad[3];
     u32 signature;
-} __attribute__ ((packed));
+};
 
 /* These all reside in the boot trampoline. Access via bootsym(). */
 extern struct mbr_signature boot_mbr_signature[];
index ade4bb2afa6e0b680f527fa89cd4c11f350201bb..9b0c789bd1b6b0e0b42d05607cd8cdb7fabc4ddf 100644 (file)
@@ -309,7 +309,7 @@ enum VMEXIT_EXITCODE
 /* Definition of segment state is borrowed by the generic HVM code. */
 typedef struct segment_register svm_segment_register_t;
 
-typedef union 
+typedef union __packed
 {
     u64 bytes;
     struct 
@@ -321,9 +321,9 @@ typedef union
         u64 v:         1;
         u64 errorcode:32;
     } fields;
-} __attribute__ ((packed)) eventinj_t;
+} eventinj_t;
 
-typedef union 
+typedef union __packed
 {
     u64 bytes;
     struct 
@@ -339,9 +339,9 @@ typedef union
         u64 vector:       8;
         u64 rsvd3:       24;
     } fields;
-} __attribute__ ((packed)) vintr_t;
+} vintr_t;
 
-typedef union
+typedef union __packed
 {
     u64 bytes;
     struct 
@@ -356,18 +356,18 @@ typedef union
         u64 rsv1: 9;
         u64 port: 16;
     } fields;
-} __attribute__ ((packed)) ioio_info_t;
+} ioio_info_t;
 
-typedef union
+typedef union __packed
 {
     u64 bytes;
     struct
     {
         u64 enable:1;
     } fields;
-} __attribute__ ((packed)) lbrctrl_t;
+} lbrctrl_t;
 
-typedef union
+typedef union __packed
 {
     uint32_t bytes;
     struct
@@ -397,12 +397,12 @@ typedef union
         uint32_t lbr: 1;
         uint32_t resv: 21;
     } fields;
-} __attribute__ ((packed)) vmcbcleanbits_t;
+} vmcbcleanbits_t;
 
 #define IOPM_SIZE   (12 * 1024)
 #define MSRPM_SIZE  (8  * 1024)
 
-struct vmcb_struct {
+struct __packed vmcb_struct {
     u32 _cr_intercepts;         /* offset 0x00 - cleanbit 0 */
     u32 _dr_intercepts;         /* offset 0x04 - cleanbit 0 */
     u32 _exception_intercepts;  /* offset 0x08 - cleanbit 0 */
@@ -487,7 +487,7 @@ struct vmcb_struct {
     u64 _lastintfromip;         /* cleanbit 10 */
     u64 _lastinttoip;           /* cleanbit 10 */
     u64 res16[301];
-} __attribute__ ((packed));
+};
 
 struct svm_domain {
 };
index 827c97e7eeed4c1c3538479c1ea9350f3001fe03..ac4380a08845d1dba571cf2f985bd512e35d803b 100644 (file)
@@ -421,11 +421,11 @@ static inline void __invept(unsigned long type, u64 eptp, u64 gpa)
 
 static inline void __invvpid(unsigned long type, u16 vpid, u64 gva)
 {
-    struct {
+    struct __packed {
         u64 vpid:16;
         u64 rsvd:48;
         u64 gva;
-    } __attribute__ ((packed)) operand = {vpid, 0, gva};
+    }  operand = {vpid, 0, gva};
 
     /* Fix up #UD exceptions which occur when TLBs are flushed before VMXON. */
     asm volatile ( "1: "
index 1f5fe50faf08c7f44e729133a82f6909970f097d..38dbcae1a9521404080c9e3c862f9065961c1ade 100644 (file)
@@ -28,11 +28,11 @@ struct ix87_state {
         uint32_t fdp;
         uint16_t fds, _res6;
     } env;
-    struct ix87_reg {
+    struct __packed ix87_reg {
         uint64_t mantissa;
         uint16_t exponent:15;
         uint16_t sign:1;
-    } __attribute__((__packed__)) r[8];
+    } r[8];
 };
 
 void vcpu_restore_fpu_eager(struct vcpu *v);
index 6d90628055a77221a08670e5520f06a5e74c1aad..b318a3624aa32ea374002366f50f916917a6eff0 100644 (file)
  */
 union IO_APIC_reg_00 {
        u32     raw;
-       struct {
+       struct __packed {
                u32     __reserved_2    : 14,
                        LTS             :  1,
                        delivery_type   :  1,
                        __reserved_1    :  8,
                        ID              :  8;
-       } __attribute__ ((packed)) bits;
+       } bits;
 };
 
 union IO_APIC_reg_01 {
        u32     raw;
-       struct {
+       struct __packed {
                u32     version         :  8,
                        __reserved_2    :  7,
                        PRQ             :  1,
                        entries         :  8,
                        __reserved_1    :  8;
-       } __attribute__ ((packed)) bits;
+       } bits;
 };
 
 union IO_APIC_reg_02 {
        u32     raw;
-       struct {
+       struct __packed {
                u32     __reserved_2    : 24,
                        arbitration     :  4,
                        __reserved_1    :  4;
-       } __attribute__ ((packed)) bits;
+       } bits;
 };
 
 union IO_APIC_reg_03 {
        u32     raw;
-       struct {
+       struct __packed {
                u32     boot_DT         :  1,
                        __reserved_1    : 31;
-       } __attribute__ ((packed)) bits;
+       } bits;
 };
 
 /*
@@ -90,7 +90,7 @@ enum ioapic_irq_destination_types {
        dest_ExtINT = 7
 };
 
-struct IO_APIC_route_entry {
+struct __packed IO_APIC_route_entry {
        __u32   vector          :  8,
                delivery_mode   :  3,   /* 000: FIXED
                                         * 001: lowest prio
@@ -119,7 +119,7 @@ struct IO_APIC_route_entry {
                        __u32 dest32;
        } dest;
 
-} __attribute__ ((packed));
+};
 
 /*
  * MP-BIOS irq configuration table structures:
index 89a9266ca9452d939cc162fc2b555128cabe9aa0..1dd0d8cd0d47bc9f8a9f5f59523250dea9f838ac 100644 (file)
@@ -168,7 +168,7 @@ int msi_free_irq(struct msi_desc *entry);
  * MSI Defined Data Structures
  */
 
-struct msg_data {
+struct __packed msg_data {
 #if defined(__LITTLE_ENDIAN_BITFIELD)
        __u32   vector          :  8;
        __u32   delivery_mode   :  3;   /* 000b: FIXED | 001b: lowest prior */
@@ -186,9 +186,9 @@ struct msg_data {
 #else
 #error "Bitfield endianness not defined! Check your byteorder.h"
 #endif
-} __attribute__ ((packed));
+};
 
-struct msg_address {
+struct __packed msg_address {
        union {
                struct {
 #if defined(__LITTLE_ENDIAN_BITFIELD)
@@ -212,7 +212,7 @@ struct msg_address {
                        __u32  value;
        }lo_address;
        __u32   hi_address;
-} __attribute__ ((packed));
+};
 
 #define MAX_MSIX_TABLE_ENTRIES  (PCI_MSIX_FLAGS_QSIZE + 1)
 #define MAX_MSIX_TABLE_PAGES    PFN_UP(MAX_MSIX_TABLE_ENTRIES * \
index 498d8a75ef65867c4c7dffa675e7faeb20cfed51..f5e9eda1a8a020fde588b612f7db485e3d48cf8c 100644 (file)
@@ -412,7 +412,7 @@ static always_inline void __mwait(unsigned long eax, unsigned long ecx)
 #define IOBMP_BYTES             8192
 #define IOBMP_INVALID_OFFSET    0x8000
 
-struct tss_struct {
+struct __packed __cacheline_aligned tss_struct {
     unsigned short     back_link,__blh;
     union { u64 rsp0, esp0; };
     union { u64 rsp1, esp1; };
@@ -426,7 +426,7 @@ struct tss_struct {
     u16 bitmap;
     /* Pads the TSS to be cacheline-aligned (total size is 0x80). */
     u8 __cacheline_filler[24];
-} __cacheline_aligned __attribute__((packed));
+};
 
 #define IST_NONE 0UL
 #define IST_DF   1UL
index e77d1c03f1a3bcb22fa9d100d85ba8c8ce629ca2..d2428625687730996ae14bb8b57d9e577f87bf4e 100644 (file)
 
 #include <xen/acpi.h>
 
-#ifndef __packed
-#define __packed   __attribute__ ((packed))
-#endif
-
 typedef struct __packed {
   uint32_t    data1;
   uint16_t    data2;
index de5711e703f29ea3ed04cd574e1ecc07729fca19..1a92ac3d2dcfb56ed5ff155b31b8ba39fda93efd 100644 (file)
@@ -42,7 +42,7 @@
 extern u64 xfeature_mask;
 
 /* extended state save area */
-struct xsave_struct
+struct __packed __attribute__((aligned (64))) xsave_struct
 {
     union {                                  /* FPU/MMX, SSE */
         char x[512];
@@ -73,7 +73,7 @@ struct xsave_struct
 
     struct { char x[XSTATE_YMM_SIZE]; } ymm; /* YMM */
     char   data[];                           /* Future new states */
-} __attribute__ ((packed, aligned (64)));
+};
 
 /* extended state operations */
 bool_t __must_check set_xcr0(u64 xfeatures);