qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] memory: fix 128 arithmetic in info mtree
@ 2013-08-30  8:10 Alexey Kardashevskiy
  2013-09-10  4:19 ` Alexey Kardashevskiy
  2013-09-25 11:27 ` Paolo Bonzini
  0 siblings, 2 replies; 4+ messages in thread
From: Alexey Kardashevskiy @ 2013-08-30  8:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexey Kardashevskiy, Paolo Bonzini

mtree_print_mr() calls int128_get64() in 3 places but only 2 places
handle 2^64 correctly.

This fixes the third call of int128_get64().

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 memory.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/memory.c b/memory.c
index ffedde7..93f2995 100644
--- a/memory.c
+++ b/memory.c
@@ -1816,7 +1816,9 @@ static void mtree_print_mr(fprintf_function mon_printf, void *f,
                    mr->alias->name,
                    mr->alias_offset,
                    mr->alias_offset
-                   + (hwaddr)int128_get64(mr->size) - 1);
+                   + (int128_nz(mr->size) ?
+                      (hwaddr)int128_get64(int128_sub(mr->size,
+                                                      int128_one())) : 0));
     } else {
         mon_printf(f,
                    TARGET_FMT_plx "-" TARGET_FMT_plx " (prio %d, %c%c): %s\n",
-- 
1.8.4.rc4

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

* Re: [Qemu-devel] [PATCH] memory: fix 128 arithmetic in info mtree
  2013-08-30  8:10 [Qemu-devel] [PATCH] memory: fix 128 arithmetic in info mtree Alexey Kardashevskiy
@ 2013-09-10  4:19 ` Alexey Kardashevskiy
  2013-09-25 10:46   ` Alexey Kardashevskiy
  2013-09-25 11:27 ` Paolo Bonzini
  1 sibling, 1 reply; 4+ messages in thread
From: Alexey Kardashevskiy @ 2013-09-10  4:19 UTC (permalink / raw)
  To: Alexey Kardashevskiy; +Cc: Paolo Bonzini, qemu-devel

On 08/30/2013 06:10 PM, Alexey Kardashevskiy wrote:
> mtree_print_mr() calls int128_get64() in 3 places but only 2 places
> handle 2^64 correctly.
> 
> This fixes the third call of int128_get64().
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
>  memory.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/memory.c b/memory.c
> index ffedde7..93f2995 100644
> --- a/memory.c
> +++ b/memory.c
> @@ -1816,7 +1816,9 @@ static void mtree_print_mr(fprintf_function mon_printf, void *f,
>                     mr->alias->name,
>                     mr->alias_offset,
>                     mr->alias_offset
> -                   + (hwaddr)int128_get64(mr->size) - 1);
> +                   + (int128_nz(mr->size) ?
> +                      (hwaddr)int128_get64(int128_sub(mr->size,
> +                                                      int128_one())) : 0));
>      } else {
>          mon_printf(f,
>                     TARGET_FMT_plx "-" TARGET_FMT_plx " (prio %d, %c%c): %s\n",
> 


Ping?


-- 
Alexey

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

* Re: [Qemu-devel] [PATCH] memory: fix 128 arithmetic in info mtree
  2013-09-10  4:19 ` Alexey Kardashevskiy
@ 2013-09-25 10:46   ` Alexey Kardashevskiy
  0 siblings, 0 replies; 4+ messages in thread
From: Alexey Kardashevskiy @ 2013-09-25 10:46 UTC (permalink / raw)
  To: Alexey Kardashevskiy; +Cc: Paolo Bonzini, qemu-devel

On 09/10/2013 02:19 PM, Alexey Kardashevskiy wrote:
> On 08/30/2013 06:10 PM, Alexey Kardashevskiy wrote:
>> mtree_print_mr() calls int128_get64() in 3 places but only 2 places
>> handle 2^64 correctly.
>>
>> This fixes the third call of int128_get64().
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> ---
>>  memory.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/memory.c b/memory.c
>> index ffedde7..93f2995 100644
>> --- a/memory.c
>> +++ b/memory.c
>> @@ -1816,7 +1816,9 @@ static void mtree_print_mr(fprintf_function mon_printf, void *f,
>>                     mr->alias->name,
>>                     mr->alias_offset,
>>                     mr->alias_offset
>> -                   + (hwaddr)int128_get64(mr->size) - 1);
>> +                   + (int128_nz(mr->size) ?
>> +                      (hwaddr)int128_get64(int128_sub(mr->size,
>> +                                                      int128_one())) : 0));
>>      } else {
>>          mon_printf(f,
>>                     TARGET_FMT_plx "-" TARGET_FMT_plx " (prio %d, %c%c): %s\n",
>>
> 
> 
> Ping?


Ping?


-- 
Alexey

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

* Re: [Qemu-devel] [PATCH] memory: fix 128 arithmetic in info mtree
  2013-08-30  8:10 [Qemu-devel] [PATCH] memory: fix 128 arithmetic in info mtree Alexey Kardashevskiy
  2013-09-10  4:19 ` Alexey Kardashevskiy
@ 2013-09-25 11:27 ` Paolo Bonzini
  1 sibling, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2013-09-25 11:27 UTC (permalink / raw)
  To: Alexey Kardashevskiy; +Cc: qemu-devel

Il 30/08/2013 10:10, Alexey Kardashevskiy ha scritto:
> mtree_print_mr() calls int128_get64() in 3 places but only 2 places
> handle 2^64 correctly.
> 
> This fixes the third call of int128_get64().
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
>  memory.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/memory.c b/memory.c
> index ffedde7..93f2995 100644
> --- a/memory.c
> +++ b/memory.c
> @@ -1816,7 +1816,9 @@ static void mtree_print_mr(fprintf_function mon_printf, void *f,
>                     mr->alias->name,
>                     mr->alias_offset,
>                     mr->alias_offset
> -                   + (hwaddr)int128_get64(mr->size) - 1);
> +                   + (int128_nz(mr->size) ?
> +                      (hwaddr)int128_get64(int128_sub(mr->size,
> +                                                      int128_one())) : 0));
>      } else {
>          mon_printf(f,
>                     TARGET_FMT_plx "-" TARGET_FMT_plx " (prio %d, %c%c): %s\n",
> 

Applied to my iommu branch, which I should eventually rename. :)

Thanks,

Paolo

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

end of thread, other threads:[~2013-09-25 11:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-30  8:10 [Qemu-devel] [PATCH] memory: fix 128 arithmetic in info mtree Alexey Kardashevskiy
2013-09-10  4:19 ` Alexey Kardashevskiy
2013-09-25 10:46   ` Alexey Kardashevskiy
2013-09-25 11:27 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).