[tip:tools/kvm] kvmtool: Handle exit reason KVM_EXIT_SYSTEM_EVENT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  57eadcdb5da99559edb6a27ce01d30123d2aec73
Gitweb:     http://git.kernel.org/tip/57eadcdb5da99559edb6a27ce01d30123d2aec73
Author:     Anup Patel <anup.patel@xxxxxxxxxx>
AuthorDate: Mon, 6 Oct 2014 12:15:18 +0100
Committer:  Will Deacon <will.deacon@xxxxxxx>
CommitDate: Fri, 10 Oct 2014 11:19:46 +0100

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@xxxxxxxxxx>
Signed-off-by: Anup Patel <anup.patel@xxxxxxxxxx>
Reviewed-by: Andre Przywara <andre.przywara@xxxxxxx>
[will: removed useless prints]
Signed-off-by: Will Deacon <will.deacon@xxxxxxx>
---
 tools/kvm/kvm-cpu.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/tools/kvm/kvm-cpu.c b/tools/kvm/kvm-cpu.c
index ee0a8ec..5d90664 100644
--- a/tools/kvm/kvm-cpu.c
+++ b/tools/kvm/kvm-cpu.c
@@ -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;
 
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux