All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] kvm/mmu: Resolve compile warning
@ 2009-10-11  6:28 ` javier martinez canillas
  0 siblings, 0 replies; 8+ messages in thread
From: javier martinez canillas @ 2009-10-11  6:28 UTC (permalink / raw)
  To: avi, kvm, kernel-janitors

I got this compile warning with today linux-next:

arch/x86/kvm/mmu.c: In function ‘kvm_set_pte_rmapp’:
arch/x86/kvm/mmu.c:770: warning: cast to pointer from integer of different size
arch/x86/kvm/mmu.c: In function ‘kvm_set_spte_hva’:
arch/x86/kvm/mmu.c:849: warning: cast from pointer to integer of different size

This patch solves the issue:

Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
---
 arch/x86/kvm/mmu.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 20a2cd1..a0b2610 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -767,7 +767,7 @@ static int kvm_set_pte_rmapp(struct kvm *kvm, unsigned long *rmapp, u64 data)
 {
 	int need_flush = 0;
 	u64 *spte, new_spte;
-	pte_t *ptep = (pte_t *)data;
+	pte_t *ptep = (pte_t *)(unsigned long)data;
 	pfn_t new_pfn;
 
 	WARN_ON(pte_huge(*ptep));
@@ -846,7 +846,7 @@ int kvm_unmap_hva(struct kvm *kvm, unsigned long hva)
 
 void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte)
 {
-	kvm_handle_hva(kvm, hva, (u64)&pte, kvm_set_pte_rmapp);
+	kvm_handle_hva(kvm, hva, (unsigned long)&pte, kvm_set_pte_rmapp);
 }
 
 static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp, u64 data)
-- 
1.6.0.4











^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 1/1] kvm/mmu: Resolve compile warning
@ 2009-10-11  6:28 ` javier martinez canillas
  0 siblings, 0 replies; 8+ messages in thread
From: javier martinez canillas @ 2009-10-11  6:28 UTC (permalink / raw)
  To: avi, kvm, kernel-janitors

I got this compile warning with today linux-next:

arch/x86/kvm/mmu.c: In function ‘kvm_set_pte_rmapp’:
arch/x86/kvm/mmu.c:770: warning: cast to pointer from integer of different size
arch/x86/kvm/mmu.c: In function ‘kvm_set_spte_hva’:
arch/x86/kvm/mmu.c:849: warning: cast from pointer to integer of different size

This patch solves the issue:

Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
---
 arch/x86/kvm/mmu.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 20a2cd1..a0b2610 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -767,7 +767,7 @@ static int kvm_set_pte_rmapp(struct kvm *kvm, unsigned long *rmapp, u64 data)
 {
 	int need_flush = 0;
 	u64 *spte, new_spte;
-	pte_t *ptep = (pte_t *)data;
+	pte_t *ptep = (pte_t *)(unsigned long)data;
 	pfn_t new_pfn;
 
 	WARN_ON(pte_huge(*ptep));
@@ -846,7 +846,7 @@ int kvm_unmap_hva(struct kvm *kvm, unsigned long hva)
 
 void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte)
 {
-	kvm_handle_hva(kvm, hva, (u64)&pte, kvm_set_pte_rmapp);
+	kvm_handle_hva(kvm, hva, (unsigned long)&pte, kvm_set_pte_rmapp);
 }
 
 static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp, u64 data)
-- 
1.6.0.4











^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/1] kvm/mmu: Resolve compile warning
  2009-10-11  6:28 ` javier martinez canillas
@ 2009-10-12 11:59   ` walter harms
  -1 siblings, 0 replies; 8+ messages in thread
From: walter harms @ 2009-10-12 11:59 UTC (permalink / raw)
  To: javier martinez canillas; +Cc: avi, kvm, kernel-janitors



javier martinez canillas schrieb:
> I got this compile warning with today linux-next:
> 
> arch/x86/kvm/mmu.c: In function ‘kvm_set_pte_rmapp’:
> arch/x86/kvm/mmu.c:770: warning: cast to pointer from integer of different size
> arch/x86/kvm/mmu.c: In function ‘kvm_set_spte_hva’:
> arch/x86/kvm/mmu.c:849: warning: cast from pointer to integer of different size
> 
> This patch solves the issue:
> 
> Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
> ---
>  arch/x86/kvm/mmu.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
> index 20a2cd1..a0b2610 100644
> --- a/arch/x86/kvm/mmu.c
> +++ b/arch/x86/kvm/mmu.c
> @@ -767,7 +767,7 @@ static int kvm_set_pte_rmapp(struct kvm *kvm, unsigned long *rmapp, u64 data)
>  {
>  	int need_flush = 0;
>  	u64 *spte, new_spte;
> -	pte_t *ptep = (pte_t *)data;
> +	pte_t *ptep = (pte_t *)(unsigned long)data;
>  	pfn_t new_pfn;
>  
>  	WARN_ON(pte_huge(*ptep));
> @@ -846,7 +846,7 @@ int kvm_unmap_hva(struct kvm *kvm, unsigned long hva)
>  
>  void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte)
>  {
> -	kvm_handle_hva(kvm, hva, (u64)&pte, kvm_set_pte_rmapp);
> +	kvm_handle_hva(kvm, hva, (unsigned long)&pte, kvm_set_pte_rmapp);
>  }
>  
>  static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp, u64 data)


Hi javier,
from the part is see in the patch i see the follwing problem:
 in kvm_set_pte_rmapp() you cast an U64 to (unsigned long)
it seems that kvm_set_pte_rmapp is mapped via kvm_handle_hva().
here pte_t pte is casted into (unsigned long).
Does look wired.


btw: there is also cleanup available claiming to fix the same warning
http://article.gmane.org/gmane.linux.kernel/900102

ntl: to much casting points to seroius trouble

re,
 wh

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/1] kvm/mmu: Resolve compile warning
@ 2009-10-12 11:59   ` walter harms
  0 siblings, 0 replies; 8+ messages in thread
From: walter harms @ 2009-10-12 11:59 UTC (permalink / raw)
  To: javier martinez canillas; +Cc: avi, kvm, kernel-janitors



javier martinez canillas schrieb:
> I got this compile warning with today linux-next:
> 
> arch/x86/kvm/mmu.c: In function ‘kvm_set_pte_rmapp’:
> arch/x86/kvm/mmu.c:770: warning: cast to pointer from integer of different size
> arch/x86/kvm/mmu.c: In function ‘kvm_set_spte_hva’:
> arch/x86/kvm/mmu.c:849: warning: cast from pointer to integer of different size
> 
> This patch solves the issue:
> 
> Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
> ---
>  arch/x86/kvm/mmu.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
> index 20a2cd1..a0b2610 100644
> --- a/arch/x86/kvm/mmu.c
> +++ b/arch/x86/kvm/mmu.c
> @@ -767,7 +767,7 @@ static int kvm_set_pte_rmapp(struct kvm *kvm, unsigned long *rmapp, u64 data)
>  {
>  	int need_flush = 0;
>  	u64 *spte, new_spte;
> -	pte_t *ptep = (pte_t *)data;
> +	pte_t *ptep = (pte_t *)(unsigned long)data;
>  	pfn_t new_pfn;
>  
>  	WARN_ON(pte_huge(*ptep));
> @@ -846,7 +846,7 @@ int kvm_unmap_hva(struct kvm *kvm, unsigned long hva)
>  
>  void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte)
>  {
> -	kvm_handle_hva(kvm, hva, (u64)&pte, kvm_set_pte_rmapp);
> +	kvm_handle_hva(kvm, hva, (unsigned long)&pte, kvm_set_pte_rmapp);
>  }
>  
>  static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp, u64 data)


Hi javier,
from the part is see in the patch i see the follwing problem:
 in kvm_set_pte_rmapp() you cast an U64 to (unsigned long)
it seems that kvm_set_pte_rmapp is mapped via kvm_handle_hva().
here pte_t pte is casted into (unsigned long).
Does look wired.


btw: there is also cleanup available claiming to fix the same warning
http://article.gmane.org/gmane.linux.kernel/900102

ntl: to much casting points to seroius trouble

re,
 wh

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/1] kvm/mmu: Resolve compile warning
  2009-10-11  6:28 ` javier martinez canillas
@ 2009-10-13 17:10   ` Marcelo Tosatti
  -1 siblings, 0 replies; 8+ messages in thread
From: Marcelo Tosatti @ 2009-10-13 17:10 UTC (permalink / raw)
  To: javier martinez canillas; +Cc: avi, kvm, kernel-janitors

javier,

This is fixed in the -next branch of kvm.git. Thanks.

On Sun, Oct 11, 2009 at 02:28:23AM -0400, javier martinez canillas wrote:
> I got this compile warning with today linux-next:
> 
> arch/x86/kvm/mmu.c: In function ‘kvm_set_pte_rmapp’:
> arch/x86/kvm/mmu.c:770: warning: cast to pointer from integer of different size
> arch/x86/kvm/mmu.c: In function ‘kvm_set_spte_hva’:
> arch/x86/kvm/mmu.c:849: warning: cast from pointer to integer of different size
> 
> This patch solves the issue:
> 
> Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/1] kvm/mmu: Resolve compile warning
@ 2009-10-13 17:10   ` Marcelo Tosatti
  0 siblings, 0 replies; 8+ messages in thread
From: Marcelo Tosatti @ 2009-10-13 17:10 UTC (permalink / raw)
  To: javier martinez canillas; +Cc: avi, kvm, kernel-janitors

javier,

This is fixed in the -next branch of kvm.git. Thanks.

On Sun, Oct 11, 2009 at 02:28:23AM -0400, javier martinez canillas wrote:
> I got this compile warning with today linux-next:
> 
> arch/x86/kvm/mmu.c: In function ‘kvm_set_pte_rmapp’:
> arch/x86/kvm/mmu.c:770: warning: cast to pointer from integer of different size
> arch/x86/kvm/mmu.c: In function ‘kvm_set_spte_hva’:
> arch/x86/kvm/mmu.c:849: warning: cast from pointer to integer of different size
> 
> This patch solves the issue:
> 
> Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/1] kvm/mmu: Resolve compile warning
  2009-10-13 17:10   ` Marcelo Tosatti
@ 2009-10-13 18:32     ` Javier Martinez Canillas
  -1 siblings, 0 replies; 8+ messages in thread
From: Javier Martinez Canillas @ 2009-10-13 18:32 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: avi, kvm, kernel-janitors

Thank you. Sorry for the noise.

Best regards

-----------------------------------------
Javier Martínez Canillas
+595 981 88 66 58



On Tue, Oct 13, 2009 at 1:10 PM, Marcelo Tosatti <mtosatti@redhat.com> wrote:
> javier,
>
> This is fixed in the -next branch of kvm.git. Thanks.
>
> On Sun, Oct 11, 2009 at 02:28:23AM -0400, javier martinez canillas wrote:
>> I got this compile warning with today linux-next:
>>
>> arch/x86/kvm/mmu.c: In function ‘kvm_set_pte_rmapp’:
>> arch/x86/kvm/mmu.c:770: warning: cast to pointer from integer of different size
>> arch/x86/kvm/mmu.c: In function ‘kvm_set_spte_hva’:
>> arch/x86/kvm/mmu.c:849: warning: cast from pointer to integer of different size
>>
>> This patch solves the issue:
>>
>> Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
>
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/1] kvm/mmu: Resolve compile warning
@ 2009-10-13 18:32     ` Javier Martinez Canillas
  0 siblings, 0 replies; 8+ messages in thread
From: Javier Martinez Canillas @ 2009-10-13 18:32 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: avi, kvm, kernel-janitors

Thank you. Sorry for the noise.

Best regards

-----------------------------------------
Javier Martínez Canillas
+595 981 88 66 58



On Tue, Oct 13, 2009 at 1:10 PM, Marcelo Tosatti <mtosatti@redhat.com> wrote:
> javier,
>
> This is fixed in the -next branch of kvm.git. Thanks.
>
> On Sun, Oct 11, 2009 at 02:28:23AM -0400, javier martinez canillas wrote:
>> I got this compile warning with today linux-next:
>>
>> arch/x86/kvm/mmu.c: In function ‘kvm_set_pte_rmapp’:
>> arch/x86/kvm/mmu.c:770: warning: cast to pointer from integer of different size
>> arch/x86/kvm/mmu.c: In function ‘kvm_set_spte_hva’:
>> arch/x86/kvm/mmu.c:849: warning: cast from pointer to integer of different size
>>
>> This patch solves the issue:
>>
>> Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
>
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-10-13 18:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-11  6:28 [PATCH 1/1] kvm/mmu: Resolve compile warning javier martinez canillas
2009-10-11  6:28 ` javier martinez canillas
2009-10-12 11:59 ` walter harms
2009-10-12 11:59   ` walter harms
2009-10-13 17:10 ` Marcelo Tosatti
2009-10-13 17:10   ` Marcelo Tosatti
2009-10-13 18:32   ` Javier Martinez Canillas
2009-10-13 18:32     ` Javier Martinez Canillas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.