[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86/vmx: fix build with clang 3.8.0



commit ac6e7fd7a4826c14b85b9da59fc800a3a1bd3fd0
Author:     Roger Pau Monne <roger.pau@xxxxxxxxxx>
AuthorDate: Thu Feb 9 11:33:12 2017 +0000
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Thu Feb 9 14:30:18 2017 +0000

    x86/vmx: fix build with clang 3.8.0
    
    The usage of the __transparent__ attribute in 991033fa introduces some 
issues
    when compiled with clang 3.8.0:
    
    xen/include/asm/hvm/vmx/vmx.h:605:15: error: transparent_union attribute 
can only be
          applied to a union definition; attribute ignored 
[-Werror,-Wignored-attributes]
    typedef union __transparent__ ept_qual {
                  ^
    xen/include/xen/compiler.h:50:44: note: expanded from macro 
'__transparent__'
    
    This can be easily fixed by moving the attribute to the end of the 
definition,
    but then the following error triggers:
    
    xen/include/asm/hvm/vmx/vmx.h:607:5: error: size of field '' (16 bits) does 
not
          match the size of the first field in transparent union; 
transparent_union attribute ignored
          [-Werror,-Wignored-attributes]
        struct {
        ^
    xen/include/asm/hvm/vmx/vmx.h:606:19: note: size of first field is 64 bits
        unsigned long raw;
                      ^
    
    Which can be fixed by introducing a new field in the nested structure that
    contains the padding in order to match the size of an unsigned long.
    
    Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/include/asm-x86/hvm/vmx/vmx.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h 
b/xen/include/asm-x86/hvm/vmx/vmx.h
index 5f7512b..f4183d9 100644
--- a/xen/include/asm-x86/hvm/vmx/vmx.h
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h
@@ -602,15 +602,16 @@ void vmx_pi_hooks_assign(struct domain *d);
 void vmx_pi_hooks_deassign(struct domain *d);
 
 /* EPT violation qualifications definitions */
-typedef union __transparent__ ept_qual {
+typedef union ept_qual {
     unsigned long raw;
     struct {
         bool read:1, write:1, fetch:1,
             eff_read:1, eff_write:1, eff_exec:1, /* eff_user_exec */:1,
             gla_valid:1,
             gla_fault:1; /* Valid iff gla_valid. */
+        unsigned long /* pad */:55;
     };
-} ept_qual_t;
+} __transparent__ ept_qual_t;
 
 #define EPT_L4_PAGETABLE_SHIFT      39
 #define EPT_PAGETABLE_ENTRIES       512
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.