Skip to contentSkip to conversation

implemetation of wfe and sev instructions on aarch64

Qemu-devel Pei XiaoYong 2 participants 2 messages May 26, 2015

lore
Share & tools
lore
#0 lore raw

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?

#1 lore raw
Quoted 4 lines · Pei XiaoYong

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 .

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.

Quoted 4 lines

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

Quoted 1 line