Re: [PATCH] hw/timer/a9gtimer: Handle QTest mode in a9_gtimer_get_current_cpu

2024-06-20 Thread Peter Maydell
On Thu, 20 Jun 2024 at 12:16, Edgar E. Iglesias wrote: > > On Thu, Jun 20, 2024 at 12:25:51PM +0200, Philippe Mathieu-Daudé wrote: > > On 20/6/24 12:10, Peter Maydell wrote: > > > On Tue, 18 Jun 2024 at 15:51, Philippe Mathieu-Daudé > > > wrote: > > > > > > > > On 18/6/24 16:40, Zheyu Ma wrote:

Re: [PATCH] hw/timer/a9gtimer: Handle QTest mode in a9_gtimer_get_current_cpu

2024-06-20 Thread Edgar E. Iglesias
On Thu, Jun 20, 2024 at 12:25:51PM +0200, Philippe Mathieu-Daudé wrote: > On 20/6/24 12:10, Peter Maydell wrote: > > On Tue, 18 Jun 2024 at 15:51, Philippe Mathieu-Daudé > > wrote: > > > > > > On 18/6/24 16:40, Zheyu Ma wrote: > > > > This commit updates the a9_gtimer_get_current_cpu() function

Re: [PATCH] hw/timer/a9gtimer: Handle QTest mode in a9_gtimer_get_current_cpu

2024-06-20 Thread Philippe Mathieu-Daudé
On 20/6/24 12:10, Peter Maydell wrote: On Tue, 18 Jun 2024 at 15:51, Philippe Mathieu-Daudé wrote: On 18/6/24 16:40, Zheyu Ma wrote: This commit updates the a9_gtimer_get_current_cpu() function to handle cases where QTest is enabled. When QTest is used, it returns 0 instead of dereferencing t

Re: [PATCH] hw/timer/a9gtimer: Handle QTest mode in a9_gtimer_get_current_cpu

2024-06-20 Thread Peter Maydell
On Tue, 18 Jun 2024 at 15:51, Philippe Mathieu-Daudé wrote: > > On 18/6/24 16:40, Zheyu Ma wrote: > > This commit updates the a9_gtimer_get_current_cpu() function to handle > > cases where QTest is enabled. When QTest is used, it returns 0 instead > > of dereferencing the current_cpu, which can be

Re: [PATCH] hw/timer/a9gtimer: Handle QTest mode in a9_gtimer_get_current_cpu

2024-06-18 Thread Philippe Mathieu-Daudé
On 18/6/24 16:40, Zheyu Ma wrote: This commit updates the a9_gtimer_get_current_cpu() function to handle cases where QTest is enabled. When QTest is used, it returns 0 instead of dereferencing the current_cpu, which can be NULL. This prevents the program from crashing during QTest runs. Reproduc

[PATCH] hw/timer/a9gtimer: Handle QTest mode in a9_gtimer_get_current_cpu

2024-06-18 Thread Zheyu Ma
This commit updates the a9_gtimer_get_current_cpu() function to handle cases where QTest is enabled. When QTest is used, it returns 0 instead of dereferencing the current_cpu, which can be NULL. This prevents the program from crashing during QTest runs. Reproducer: cat << EOF | qemu-system-aarch64