Commit bc028c90 authored by Hrishabh Rajput's avatar Hrishabh Rajput Committed by Sebastian Ene
Browse files

ANDROID: gunyah: Add support for tracking Guest VM run time



Mechanism to detect vCPU stalls relies on VMM (running in userspace) to
keep track of the time vCPU has run as guest. Currently, Gunyah drivers
do not provide any mechanism for VMM to track how long a vCPU has run
in guest context. In case of vCPU stall detection, this results in VMM
always seeing the guest VM run duration as zero, consequently never
triggering VM watchdog.

This patch adds calls to vtime_account_guest_enter() and
vtime_account_guest_exit() to track how much a vCPU has run as
guest VM.

By design, interrupts must be enabled when making the Gunyah hypercall
to switch to guest vCPU. However, if VIRT_CPU_ACCOUNTING_NATIVE or
VIRT_VCPU_ACCOUNTING_GEN configs are enabled,
vtime_account_guest_enter() & vtime_account_guest_exit()
implementations use seqlocks, which require interrupts to be disabled.
Hence, if either of these configs are enabled, guest VM run time
tracking cannot be supported with Gunyah.

Bug: 350614114
Change-Id: Ia49677137716fed50948f209b5e22fba05271c1b
Signed-off-by: default avatarHrishabh Rajput <quic_hrishabh@quicinc.com>
parent 2182ee63
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment