KVM_GUEST: use the right parameter type on kvm_release_pt() (was Re: i386 allmodconfig in linux-next)
Subsystems (3)
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 KVM_GUEST: use the right parameter type on kvm_release_pt() (was Re: i386 allmodconfig in linux-next)
Quoted 13 lines · Avi Kivity
Quoted 5 lines · Andrew Morton
arch/x86/kernel/kvm.c: In function 'paravirt_ops_setup':arch/x86/kernel/kvm.c:233: warning: assignment from incompatible pointer typearch/x86/kernel/kvm.c:234: warning: assignment from incompatible pointer typearch/x86/kernel/kvm.c:235: warning: assignment from incompatible pointer typeEduardo, this is your
Quoted 4 lines
commit
fa24f8e67c189b8b904c8a34f12e6dae9c14dbbaAuthor: Eduardo Habkost <[email protected]> Date: Wed Jul 30 18:32:27 2008 -0300
Quoted 6 lines
Quoted 2 lines
x86,
paravirt_ops: use unsigned long instead of u32 for alloc_p*()
pfn argsPlease compile-test (and run-test?)
paravirt_opschanges withCONFIG_KVM_GUESTandCONFIG_KVM_CLOCKenabled. Thanks.
Oops, sorry. I've grepped for 'alloc_p*' and didn't notice KVM was using release_p*. I've checked for binary code changes with all paravirt guest options enabled, but missed the compiler warnings. Fix below.
---
From: Eduardo Habkost <[email protected]>
Subject: [PATCH] KVM_GUEST: Use the right parameter type on kvm_release_pt()
This fixes the following compiler warnings, that were introduced by me on commit fa24f8e67c189b8b904c8a34f12e6dae9c14dbba.
arch/x86/kernel/kvm.c: In function 'paravirt_ops_setup':arch/x86/kernel/kvm.c:233: warning: assignment from incompatible pointer type arch/x86/kernel/kvm.c:234: warning: assignment from incompatible pointer type arch/x86/kernel/kvm.c:235: warning: assignment from incompatible pointer type
--- arch/x86/kernel/kvm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/kvm.c +1 -1
@@ -178,7 +178,7 @@ static void kvm_flush_tlb(void)kvm_deferred_mmu_op (&ftlb,sizeof ftlb); } -static void kvm_release_pt (u32 pfn) +static void kvm_release_pt (unsigned long pfn) {struct kvm_mmu_op_release_pt rpt = { .header.op =KVM_MMU_OP_RELEASE_PT ,
Signature · 4 lines
1.5.5.GIT -- Eduardo
Quoted 11 lines · Eduardo Habkost
From: Eduardo Habkost <[email protected]>
Subject: [PATCH]KVM_GUEST: Use the right parameter type onkvm_release_pt()This fixes the following compiler warnings, that were introduced by me on commit
fa24f8e67c189b8b904c8a34f12e6dae9c14dbba.
arch/x86/kernel/kvm.c: In function 'paravirt_ops_setup':arch/x86/kernel/kvm.c:233: warning: assignment from incompatible pointer typearch/x86/kernel/kvm.c:234: warning: assignment from incompatible pointer typearch/x86/kernel/kvm.c:235: warning: assignment from incompatible pointer type
Ingo? Can you queue/fold this into the original patch?
Quoted 19 lines
Signed-off-by Eduardo Habkost <[email protected]>--- arch/x86/kernel/kvm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/x86/kernel/kvm.c +1
-1@@ -178,7 +178,7 @@ static void kvm_flush_tlb(void)kvm_deferred_mmu_op (&ftlb,sizeof ftlb); } -static void kvm_release_pt (u32 pfn) +static void kvm_release_pt (unsigned long pfn) {struct kvm_mmu_op_release_pt rpt = { .header.op =KVM_MMU_OP_RELEASE_PT ,
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 7 lines · Avi Kivity
Quoted 6 lines · Eduardo Habkost
From: Eduardo Habkost <[email protected]>
Subject: [PATCH]KVM_GUEST: Use the right parameter type onkvm_release_pt()This fixes the following compiler warnings, that were introduced by me on commit
fa24f8e67c189b8b904c8a34f12e6dae9c14dbba.
Quoted 7 lines
Quoted 5 lines
arch/x86/kernel/kvm.c: In function 'paravirt_ops_setup':arch/x86/kernel/kvm.c:233: warning: assignment from incompatible pointer typearch/x86/kernel/kvm.c:234: warning: assignment from incompatible pointer typearch/x86/kernel/kvm.c:235: warning: assignment from incompatible pointer typeIngo? Can you queue/fold this into the original patch?
done - updated v2 combo patch below, queued in tip/x86/paravirt.
Ingo
-------------------->
Quoted 1 line
From
f86399396ce7a4f4069828b7dceac5aa5113dfb5Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <[email protected]>
Date: Wed, 30 Jul 2008 18:32:27 -0300
Subject: [PATCH] x86, paravirt_ops: use unsigned long instead of u32 for alloc_p*() pfn args
This patch changes the pfn args from 'u32' to 'unsigned long' on alloc_p*() functions on paravirt_ops, and the corresponding implementations for Xen and VMI. The prototypes for CONFIG_PARAVIRT=n are already using unsigned long, so paravirt.h now matches the prototypes on asm-x86/pgalloc.h.
It shouldn't result in any changes on generated code on 32-bit, with or without CONFIG_PARAVIRT. On both cases, 'codiff -f' didn't show any change after applying this patch.
On 64-bit, there are (expected) binary changes only when CONFIG_PARAVIRT is enabled, as the patch is really supposed to change the size of the pfn args.
[ v2: KVM_GUEST: use the right parameter type on kvm_release_pt() ]
--- arch/x86/kernel/kvm.c | 2 +- arch/x86/kernel/vmi_32.c | 10 +++++----- arch/x86/xen/enlighten.c | 20 ++++++++++---------- include/asm-x86/paravirt.h | 30 +++++++++++++++--------------- 4 files changed, 31 insertions(+), 31 deletions(-)
arch/x86/kernel/kvm.c +1 -1
@@ -178,7 +178,7 @@ static void kvm_flush_tlb(void)kvm_deferred_mmu_op (&ftlb,sizeof ftlb); } -static void kvm_release_pt (u32 pfn) +static void kvm_release_pt (unsigned long pfn) {struct kvm_mmu_op_release_pt rpt = { .header.op =KVM_MMU_OP_RELEASE_PT ,
arch/x86/kernel/vmi_32.c +5 -5
@@ -392,13 +392,13 @@ static void *vmi_kmap_atomic_pte(struct page *page, enum km_type type) }#endif -static void vmi_allocate_pte (struct mm_struct *mm,u32 pfn) +static void vmi_allocate_pte (struct mm_struct *mm,unsigned long pfn) {vmi_set_page_type (pfn,VMI_PAGE_L1 ); vmi_ops.allocate_page (pfn,VMI_PAGE_L1 ,0 ,0 ,0 ); } -static void vmi_allocate_pmd (struct mm_struct *mm,u32 pfn) +static void vmi_allocate_pmd (struct mm_struct *mm,unsigned long pfn) {/* * This call comes in very early, before mem_map is setup.
@@ -409,20 +409,20 @@ static void vmi_allocate_pmd(struct mm_struct *mm, u32 pfn) vmi_ops.allocate_page (pfn,VMI_PAGE_L2 ,0 ,0 ,0 ); } -static void vmi_allocate_pmd_clone (u32 pfn,u32 clonepfn,u32 start,u32 count) +static void vmi_allocate_pmd_clone (unsigned long pfn,unsigned long clonepfn,unsigned long start,unsigned long count) {vmi_set_page_type (pfn,VMI_PAGE_L2 |VMI_PAGE_CLONE );vmi_check_page_type (clonepfn,VMI_PAGE_L2 ); vmi_ops.allocate_page (pfn,VMI_PAGE_L2 |VMI_PAGE_CLONE , clonepfn, start, count); } -static void vmi_release_pte (u32 pfn) +static void vmi_release_pte (unsigned long pfn) { vmi_ops.release_page (pfn,VMI_PAGE_L1 );vmi_set_page_type (pfn,VMI_PAGE_NORMAL ); } -static void vmi_release_pmd (u32 pfn) +static void vmi_release_pmd (unsigned long pfn) { vmi_ops.release_page (pfn,VMI_PAGE_L2 );vmi_set_page_type (pfn,VMI_PAGE_NORMAL );
arch/x86/xen/enlighten.c +10 -10
@@ -812,7 +812,7 @@ static int xen_write_msr_safe(unsigned int msr, unsigned low, unsigned high)/* Early in boot, while setting up the initial pagetable, assume everything is pinned. */ -static __init void xen_alloc_pte_init (struct mm_struct *mm,u32 pfn) +static __init void xen_alloc_pte_init (struct mm_struct *mm,unsigned long pfn) {#ifdef CONFIG_FLATMEM BUG_ON (mem_map);/* should only be used early */
@@ -822,7 +822,7 @@ static __init void xen_alloc_pte_init(struct mm_struct *mm, u32 pfn)/* Early release_pte assumes that all pts are pinned, since there's only init_mm and anything attached to that is pinned. */ -static void xen_release_pte_init (u32 pfn) +static void xen_release_pte_init (unsigned long pfn) {make_lowmem_page_readwrite (__va (PFN_PHYS (pfn))); }
@@ -838,7 +838,7 @@ static void pin_pagetable_pfn(unsigned cmd, unsigned long pfn)/* This needs to make sure the new pte page is pinned iff its being attached to a pinned pagetable. */ -static void xen_alloc_ptpage (struct mm_struct *mm,u32 pfn,unsigned level) +static void xen_alloc_ptpage (struct mm_struct *mm,unsigned long pfn,unsigned level) {struct page *page =pfn_to_page (pfn);
@@ -856,12 +856,12 @@ static void xen_alloc_ptpage(struct mm_struct *mm, u32 pfn, unsigned level) } } -static void xen_alloc_pte (struct mm_struct *mm,u32 pfn) +static void xen_alloc_pte (struct mm_struct *mm,unsigned long pfn) {xen_alloc_ptpage (mm, pfn,PT_PTE ); } -static void xen_alloc_pmd (struct mm_struct *mm,u32 pfn) +static void xen_alloc_pmd (struct mm_struct *mm,unsigned long pfn) {xen_alloc_ptpage (mm, pfn,PT_PMD ); }
@@ -909,7 +909,7 @@ static void xen_pgd_free(struct mm_struct *mm, pgd_t *pgd) }/* This should never happen until we're OK to use struct page */ -static void xen_release_ptpage (u32 pfn,unsigned level) +static void xen_release_ptpage (unsigned long pfn,unsigned level) {struct page *page =pfn_to_page (pfn);
@@ -923,23 +923,23 @@ static void xen_release_ptpage(u32 pfn, unsigned level) } } -static void xen_release_pte (u32 pfn) +static void xen_release_pte (unsigned long pfn) {xen_release_ptpage (pfn,PT_PTE ); } -static void xen_release_pmd (u32 pfn) +static void xen_release_pmd (unsigned long pfn) {xen_release_ptpage (pfn,PT_PMD ); }#if PAGETABLE_LEVELS ==4 -static void xen_alloc_pud (struct mm_struct *mm,u32 pfn) +static void xen_alloc_pud (struct mm_struct *mm,unsigned long pfn) {xen_alloc_ptpage (mm, pfn,PT_PUD ); } -static void xen_release_pud (u32 pfn) +static void xen_release_pud (unsigned long pfn) {xen_release_ptpage (pfn,PT_PUD ); }
include/asm-x86/paravirt.h +15 -15
@@ -257,13 +257,13 @@ struct pv_mmu_ops {* Hooks for allocating/releasing pagetable pages when they're * attached to a pagetable */ -void (*alloc_pte)(struct mm_struct *mm,u32 pfn); -void (*alloc_pmd)(struct mm_struct *mm,u32 pfn); -void (*alloc_pmd_clone)(u32 pfn,u32 clonepfn,u32 start,u32 count); -void (*alloc_pud)(struct mm_struct *mm,u32 pfn); -void (*release_pte)(u32 pfn); -void (*release_pmd)(u32 pfn); -void (*release_pud)(u32 pfn); +void (*alloc_pte)(struct mm_struct *mm,unsigned long pfn); +void (*alloc_pmd)(struct mm_struct *mm,unsigned long pfn); +void (*alloc_pmd_clone)(unsigned long pfn,unsigned long clonepfn,unsigned long start,unsigned long count); +void (*alloc_pud)(struct mm_struct *mm,unsigned long pfn); +void (*release_pte)(unsigned long pfn); +void (*release_pmd)(unsigned long pfn); +void (*release_pud)(unsigned long pfn);/* Pagetable manipulation functions */ void (*set_pte)(pte_t *ptep,pte_t pteval);
@@ -993,35 +993,35 @@ static inline void paravirt_pgd_free(struct mm_struct *mm, pgd_t *pgd)PVOP_VCALL2 (pv_mmu_ops.pgd_free, mm, pgd); } -static inline void paravirt_alloc_pte (struct mm_struct *mm,unsigned pfn) +static inline void paravirt_alloc_pte (struct mm_struct *mm,unsigned long pfn) {PVOP_VCALL2 (pv_mmu_ops.alloc_pte, mm, pfn); } -static inline void paravirt_release_pte (unsigned pfn) +static inline void paravirt_release_pte (unsigned long pfn) {PVOP_VCALL1 (pv_mmu_ops.release_pte, pfn); } -static inline void paravirt_alloc_pmd (struct mm_struct *mm,unsigned pfn) +static inline void paravirt_alloc_pmd (struct mm_struct *mm,unsigned long pfn) {PVOP_VCALL2 (pv_mmu_ops.alloc_pmd, mm, pfn); } -static inline void paravirt_alloc_pmd_clone (unsigned pfn,unsigned clonepfn, -unsigned start,unsigned count) +static inline void paravirt_alloc_pmd_clone (unsigned long pfn,unsigned long clonepfn, +unsigned long start,unsigned long count) {PVOP_VCALL4 (pv_mmu_ops.alloc_pmd_clone, pfn, clonepfn, start, count); } -static inline void paravirt_release_pmd (unsigned pfn) +static inline void paravirt_release_pmd (unsigned long pfn) {PVOP_VCALL1 (pv_mmu_ops.release_pmd, pfn); } -static inline void paravirt_alloc_pud (struct mm_struct *mm,unsigned pfn) +static inline void paravirt_alloc_pud (struct mm_struct *mm,unsigned long pfn) {PVOP_VCALL2 (pv_mmu_ops.alloc_pud, mm, pfn); } -static inline void paravirt_release_pud (unsigned pfn) +static inline void paravirt_release_pud (unsigned long pfn) {PVOP_VCALL1 (pv_mmu_ops.release_pud, pfn); }