From 3dc9a96b05c9025597674b774f58aaa89b6578c8 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 4 Mar 2016 14:09:04 +0100 Subject: [PATCH] x86: use "unsigned int" for cache attribute values ... where suitable. But note that the type of "cacheattr" in get_page_from_l1e() specifically needs to remain "unsigned long". Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- xen/arch/x86/mm.c | 4 ++-- xen/include/asm-x86/page.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 32b49105af..36c44873c2 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -802,7 +802,7 @@ int is_iomem_page(unsigned long mfn) return (page_get_owner(page) == dom_io); } -static int update_xen_mappings(unsigned long mfn, unsigned long cacheattr) +static int update_xen_mappings(unsigned long mfn, unsigned int cacheattr) { int err = 0; bool_t alias = mfn >= PFN_DOWN(xen_phys_start) && @@ -2136,7 +2136,7 @@ static int mod_l4_entry(l4_pgentry_t *pl4e, static int cleanup_page_cacheattr(struct page_info *page) { - uint32_t cacheattr = + unsigned int cacheattr = (page->count_info & PGC_cacheattr_mask) >> PGC_cacheattr_base; if ( likely(cacheattr == 0) ) diff --git a/xen/include/asm-x86/page.h b/xen/include/asm-x86/page.h index fd9a2ec089..224852aa30 100644 --- a/xen/include/asm-x86/page.h +++ b/xen/include/asm-x86/page.h @@ -348,11 +348,11 @@ void free_xen_pagetable(void *v); l1_pgentry_t *virt_to_xen_l1e(unsigned long v); /* Convert between PAT/PCD/PWT embedded in PTE flags and 3-bit cacheattr. */ -static inline uint32_t pte_flags_to_cacheattr(uint32_t flags) +static inline unsigned int pte_flags_to_cacheattr(unsigned int flags) { return ((flags >> 5) & 4) | ((flags >> 3) & 3); } -static inline uint32_t cacheattr_to_pte_flags(uint32_t cacheattr) +static inline unsigned int cacheattr_to_pte_flags(unsigned int cacheattr) { return ((cacheattr & 4) << 5) | ((cacheattr & 3) << 3); } -- 2.39.5