Re: [PATCH v3] target/ppc: Fix 64-bit decrementer

2021-09-17 Thread Cédric Le Goater
So use PRIx64, as you're supposed to do. Or, in fact, change this to a tracepoint. yes. I will change all of them. It should be useful for everyone. C.

Re: [PATCH v3] target/ppc: Fix 64-bit decrementer

2021-09-17 Thread Richard Henderson
On 9/17/21 7:10 AM, Cédric Le Goater wrote: On 9/17/21 16:00, Luis Fernando Fujita Pires wrote: From: Cédric Le Goater +    target_long signed_value; +    target_long signed_decr; Since these values will be the results of sextract64, it's probably better to define them as int64_t. but then

Re: [PATCH v3] target/ppc: Fix 64-bit decrementer

2021-09-17 Thread Cédric Le Goater
On 9/17/21 16:00, Luis Fernando Fujita Pires wrote: From: Cédric Le Goater +target_long signed_value; +target_long signed_decr; Since these values will be the results of sextract64, it's probably better to define them as int64_t. but then it breaks the code doing the logging on PPC3

RE: [PATCH v3] target/ppc: Fix 64-bit decrementer

2021-09-17 Thread Luis Fernando Fujita Pires
From: Cédric Le Goater > >> +target_long signed_value; > >> +target_long signed_decr; > > > > Since these values will be the results of sextract64, it's probably better > > to > define them as int64_t. > > but then it breaks the code doing the logging on PPC32 targets :/ You mean here?

Re: [PATCH v3] target/ppc: Fix 64-bit decrementer

2021-09-17 Thread Cédric Le Goater
Hello, On 9/16/21 20:22, Luis Fernando Fujita Pires wrote: Hi Cédric, These changes look good and seem to replicate the exact behavior we had before, while fixing the 64-bit dec from MicroWatt. Yes. That's the goal. I would like to minimize the possible impact on other platforms. I checked M

RE: [PATCH v3] target/ppc: Fix 64-bit decrementer

2021-09-16 Thread Luis Fernando Fujita Pires
Hi Cédric, These changes look good and seem to replicate the exact behavior we had before, while fixing the 64-bit dec from MicroWatt. A few notes, in case they help others, too: According to the Power ISA: When not in Large Decrementer mode: - the maximum positive value for the decrement

[PATCH v3] target/ppc: Fix 64-bit decrementer

2021-09-16 Thread Cédric Le Goater
The current way the mask is built can overflow with a 64-bit decrementer. Use sextract64() to extract the signed values and remove the logic to handle negative values which has become useless. Cc: Luis Fernando Fujita Pires Fixes: a8dafa525181 ("target/ppc: Implement large decrementer support for