diff options
author | Anup Patel <anup.patel@linaro.org> | 2014-10-06 12:15:18 +0100 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2015-06-01 16:39:55 +0100 |
commit | 5f9b016e4e96429f9d076d4b31e5d309d14df17b (patch) | |
tree | f8439be773fa2f85d329cd2d6cc073b195eaa955 | |
parent | 1640753ac1e606d345b1065401d6bca986796aa1 (diff) | |
download | kvmtool-5f9b016e4e96429f9d076d4b31e5d309d14df17b.tar.gz |
kvmtool: Handle exit reason KVM_EXIT_SYSTEM_EVENT
The KVM_EXIT_SYSTEM_EVENT exit reason was added to define
architecture independent system-wide events for a Guest.
Currently, it is used by in-kernel PSCI-0.2 emulation of
KVM ARM/ARM64 to inform user space about PSCI SYSTEM_OFF
or PSCI SYSTEM_RESET request.
For now, we simply treat all system-wide guest events as
shutdown request in KVMTOOL.
Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
Signed-off-by: Anup Patel <anup.patel@linaro.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
[will: removed useless prints]
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | kvm-cpu.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -160,6 +160,22 @@ int kvm_cpu__start(struct kvm_cpu *cpu) goto exit_kvm; case KVM_EXIT_SHUTDOWN: goto exit_kvm; + case KVM_EXIT_SYSTEM_EVENT: + /* + * Print the type of system event and + * treat all system events as shutdown request. + */ + switch (cpu->kvm_run->system_event.type) { + case KVM_SYSTEM_EVENT_RESET: + /* Fall through for now */ + case KVM_SYSTEM_EVENT_SHUTDOWN: + goto exit_kvm; + default: + pr_warning("unknown system event type %d", + cpu->kvm_run->system_event.type); + goto exit_kvm; + }; + break; default: { bool ret; |