xen/arm: introduce vwfi parameter
authorStefano Stabellini <sstabellini@kernel.org>
Wed, 1 Mar 2017 19:43:15 +0000 (11:43 -0800)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 3 Mar 2017 18:42:53 +0000 (10:42 -0800)
commit56ac30f92bddc23f356d779d8c7478dabe5839e7
tree7502c66897a1402c0b94f307cdb38b3a353ab8d7
parentf2c608444261824a9463a7847be2d08ee3ae0c48
xen/arm: introduce vwfi parameter

Introduce new Xen command line parameter called "vwfi", which stands for
virtual wfi. The default is "trap": Xen traps guest wfi and wfe
instructions. In the case of wfi, Xen calls vcpu_block on the guest
vcpu; in the case of guest wfe, Xen calls vcpu_yield on the guest vcpu.
The behavior can be changed by setting vwfi to "native", in that case
Xen doesn't trap neither wfi nor wfe, running them in guest context.

The result is strong reduction in irq latency (from 5000ns to 2000ns,
measured using https://github.com/edgarigl/tbm, the physical timer, and
1 pcpu dedicated to 1 vcpu). The downside is that the scheduler thinks
that the guest is busy when actually is sleeping, leading to suboptimal
scheduling decisions.

Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: Julien Grall <julien.grall@arm.com>
docs/misc/xen-command-line.markdown
xen/arch/arm/traps.c