Discussion:
[Qemu-devel] implemetation of wfe and sev instructions on aarch64
Pei XiaoYong
2015-05-26 07:29:18 UTC
Permalink
hello everybody:
in linux kernel , when smp booting via spin tables , primary core use
sev instruction to wakeup the secondery cores .
but qemu don't support sev and wfe in TCG model . does somebody have
some idea about how to implemet wfe and sev
instruction on aarch64?
Peter Crosthwaite
2015-05-26 08:00:02 UTC
Permalink
Post by Pei XiaoYong
in linux kernel , when smp booting via spin tables , primary core use
sev instruction to wakeup the secondery cores .
but qemu don't support sev and wfe in TCG model .
So it should still work as the semantic of wfe is it is still
implementable as a nop, is it just potentially bad performance. Also
note that QEMU wfe as-is, even though it is still a busy-wait, should
yield the CPU time slice back up to the top level, so performance
should be tolerable for spin-table boot.
Post by Pei XiaoYong
does somebody have
some idea about how to implemet wfe and sev
instruction on aarch64?
I have done it before but there are complications. The main problem is
there is no notion of a cpu-cluster and the CPUs don't have linkages
between each other to sev each other. My approach was crude, in that
sev just iterated through and notified all cpus in the system. Sevl
was implemented too. This might be acceptable, but I never got the
patches into shape and I found that just the yielding semantic is
still ok perf in the end.

Both sev and wfe were implemented as helpers, similar to existing wfi
and yield helpers.

Does your linux kernel have this patch:

https://lkml.org/lkml/2015/3/2/672

? This was the leading source of slowdown when I was doing SMP boots.

Regards,
Peter
Loading...