From patchwork Thu Mar 3 10:31:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 8491031 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 950FE9F38C for ; Thu, 3 Mar 2016 10:33:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 178B92035E for ; Thu, 3 Mar 2016 10:33:52 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 307522035D for ; Thu, 3 Mar 2016 10:33:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1abQXE-0001X2-TW; Thu, 03 Mar 2016 10:31:08 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1abQXD-0001Ww-Ob for xen-devel@lists.xenproject.org; Thu, 03 Mar 2016 10:31:07 +0000 Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id D5/CD-07729-B6218D65; Thu, 03 Mar 2016 10:31:07 +0000 X-Env-Sender: JBeulich@suse.com X-Msg-Ref: server-14.tower-206.messagelabs.com!1457001063!26205987!1 X-Originating-IP: [137.65.248.74] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 9546 invoked from network); 3 Mar 2016 10:31:05 -0000 Received: from prv-mh.provo.novell.com (HELO prv-mh.provo.novell.com) (137.65.248.74) by server-14.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 3 Mar 2016 10:31:05 -0000 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Thu, 03 Mar 2016 03:31:03 -0700 Message-Id: <56D8207602000078000D8B91@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.0 Date: Thu, 03 Mar 2016 03:31:02 -0700 From: "Jan Beulich" To: "xen-devel" References: <56D817F102000078000D8B4D@prv-mh.provo.novell.com> In-Reply-To: <56D817F102000078000D8B4D@prv-mh.provo.novell.com> Mime-Version: 1.0 Cc: Andrew Cooper , Keir Fraser Subject: Re: [Xen-devel] [PATCH 1/2] x86: use "unsigned int" for cache attribute values X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ... 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 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 --- 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 *pl 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) ) --- 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); } Reviewed-by: Andrew Cooper --- 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 *pl 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) ) --- 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); }