[PATCH 0/2] target/sparc: Enable MTTCG

Richard Henderson posted 2 patches 11 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230620164040.912490-1-richard.henderson@linaro.org
Maintainers: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Artyom Tarasenko <atar4qemu@gmail.com>
configs/targets/sparc-softmmu.mak   |  1 +
configs/targets/sparc64-softmmu.mak |  1 +
target/sparc/cpu.h                  | 23 +++++++++++++++++++++++
3 files changed, 25 insertions(+)
[PATCH 0/2] target/sparc: Enable MTTCG
Posted by Richard Henderson 11 months ago
With the addition of TCG_GUEST_DEFAULT_MO, there's nothing in
the cpu emulation preventing this from working.  There is some
board model work to be done for sparc64, where max_cpus = 1.


r~


Richard Henderson (2):
  target/sparc: Set TCG_GUEST_DEFAULT_MO
  configs: Enable MTTCG for sparc, sparc64

 configs/targets/sparc-softmmu.mak   |  1 +
 configs/targets/sparc64-softmmu.mak |  1 +
 target/sparc/cpu.h                  | 23 +++++++++++++++++++++++
 3 files changed, 25 insertions(+)

-- 
2.34.1
Re: [PATCH 0/2] target/sparc: Enable MTTCG
Posted by Mark Cave-Ayland 10 months, 4 weeks ago
On 20/06/2023 17:40, Richard Henderson wrote:

> With the addition of TCG_GUEST_DEFAULT_MO, there's nothing in
> the cpu emulation preventing this from working.  There is some
> board model work to be done for sparc64, where max_cpus = 1.

I've tried testing this with the Advent Calendar image at 
https://qemu-advent-calendar.org/2018/download/day11.tar.xz and even without these 
patches applied I'm seeing hangs with -smp 2. When applied on top of the other 
"target/sparc: Use tcg_gen_lookup_and_goto_ptr" series I get assert() after a minute 
or two:

ERROR:../accel/tcg/tcg-accel-ops-mttcg.c:110:mttcg_cpu_thread_fn: assertion failed: 
(cpu->halted)
Bail out! ERROR:../accel/tcg/tcg-accel-ops-mttcg.c:110:mttcg_cpu_thread_fn: assertion 
failed: (cpu->halted)

It may be wise to try and figure out what's going on with git head first before 
applying this. In particular /proc/cpuinfo suggests things aren't right with -smp 2:

# cat /proc/cpuinfo
cpu             : Texas Instruments, Inc. - SuperSparc-(II)
fpu             : SuperSparc on-chip FPU
promlib         : Version 3 Revision 2
prom            : 2.25
type            : sun4m
ncpus probed    : 2
ncpus active    : 1
CPU0Bogo        : 213.50
CPU0ClkTck      : 0
MMU type        : TI Viking/MXCC
contexts        : 65536
nocache total   : 3145728
nocache used    : 375552

> Richard Henderson (2):
>    target/sparc: Set TCG_GUEST_DEFAULT_MO
>    configs: Enable MTTCG for sparc, sparc64
> 
>   configs/targets/sparc-softmmu.mak   |  1 +
>   configs/targets/sparc64-softmmu.mak |  1 +
>   target/sparc/cpu.h                  | 23 +++++++++++++++++++++++
>   3 files changed, 25 insertions(+)


ATB,

Mark.
Re: [PATCH 0/2] target/sparc: Enable MTTCG
Posted by Richard Henderson 10 months, 3 weeks ago
On 6/22/23 16:36, Mark Cave-Ayland wrote:
> On 20/06/2023 17:40, Richard Henderson wrote:
> 
>> With the addition of TCG_GUEST_DEFAULT_MO, there's nothing in
>> the cpu emulation preventing this from working.  There is some
>> board model work to be done for sparc64, where max_cpus = 1.
> 
> I've tried testing this with the Advent Calendar image at 
> https://qemu-advent-calendar.org/2018/download/day11.tar.xz and even without these patches 
> applied I'm seeing hangs with -smp 2. When applied on top of the other "target/sparc: Use 
> tcg_gen_lookup_and_goto_ptr" series I get assert() after a minute or two:

Would you try again, now that we've solved the issues with lookup_and_goto_ptr?


r~

Re: [PATCH 0/2] target/sparc: Enable MTTCG
Posted by Mark Cave-Ayland 10 months, 3 weeks ago
On 30/06/2023 19:05, Richard Henderson wrote:

> On 6/22/23 16:36, Mark Cave-Ayland wrote:
>> On 20/06/2023 17:40, Richard Henderson wrote:
>>
>>> With the addition of TCG_GUEST_DEFAULT_MO, there's nothing in
>>> the cpu emulation preventing this from working.  There is some
>>> board model work to be done for sparc64, where max_cpus = 1.
>>
>> I've tried testing this with the Advent Calendar image at 
>> https://qemu-advent-calendar.org/2018/download/day11.tar.xz and even without these 
>> patches applied I'm seeing hangs with -smp 2. When applied on top of the other 
>> "target/sparc: Use tcg_gen_lookup_and_goto_ptr" series I get assert() after a 
>> minute or two:
> 
> Would you try again, now that we've solved the issues with lookup_and_goto_ptr?

The wording above is a bit clumsy on my part, but I was still seeing the hangs on git 
master with -smp 2, but with the older tcg_gen_lookup_and_goto_ptr series not only 
would I see the hangs but I would hit the assert() within a couple of minutes.

My notes on the wiki at https://wiki.qemu.org/Documentation/Platforms/SPARC#Timeline 
suggest that it was working on QEMU 6.2, so I'll need to find a moment to bisect it 
down to see where things broke.


ATB,

Mark.