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

[Xen-changelog] [xen staging] xen/arm: memaccess: Initialize correctly *access in __p2m_get_mem_access



commit 5ba1c5d0641cf63086b3058e547fcd28c3c4a011
Author:     Julien Grall <julien.grall@xxxxxxx>
AuthorDate: Wed Mar 27 18:45:23 2019 +0000
Commit:     Julien Grall <julien.grall@xxxxxxx>
CommitDate: Tue Apr 9 12:40:08 2019 +0100

    xen/arm: memaccess: Initialize correctly *access in __p2m_get_mem_access
    
    The commit 8d84e701fd "xen/arm: initialize access" initializes
    *access using the wrong enumeration type. This result to a warning
    using clang:
    
    mem_access.c:50:20: error: implicit conversion from enumeration type
    'p2m_access_t' to different enumeration type 'xenmem_access_t'
    [-Werror,-Wenum-conversion]
        *access = p2m->default_access;
                ~ ~~~~~^~~~~~~~~~~~~~
    
    The correct solution is to use the array memaccess that will do the
    conversion between the 2 enums.
    
    Fixes: 8d84e701fd ("xen/arm: initialize access")
    Signed-off-by: Julien Grall <julien.grall@xxxxxxx>
    Acked-by: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
---
 xen/arch/arm/mem_access.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/mem_access.c b/xen/arch/arm/mem_access.c
index db49372a2c..3e3620294c 100644
--- a/xen/arch/arm/mem_access.c
+++ b/xen/arch/arm/mem_access.c
@@ -47,7 +47,7 @@ static int __p2m_get_mem_access(struct domain *d, gfn_t gfn,
     };
 
     ASSERT(p2m_is_locked(p2m));
-    *access = p2m->default_access;
+    *access = memaccess[p2m->default_access];
 
     /* If no setting was ever set, just return rwx. */
     if ( !p2m->mem_access_enabled )
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
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®.