From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andre Przywara Subject: Re: [PATCH v3 3/4] kvmtool: Handle exit reason KVM_EXIT_SYSTEM_EVENT Date: Thu, 11 Sep 2014 17:26:08 +0100 Message-ID: <5411CD20.9040607@arm.com> References: <1410164258-27469-1-git-send-email-anup.patel@linaro.org> <1410164258-27469-4-git-send-email-anup.patel@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: "kvm@vger.kernel.org" , "patches@apm.com" , Will Deacon , Marc Zyngier , "penberg@kernel.org" , "christoffer.dall@linaro.org" , "pranavkumar@linaro.org" To: Anup Patel , "kvmarm@lists.cs.columbia.edu" Return-path: Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:55403 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756867AbaIKQ0e (ORCPT ); Thu, 11 Sep 2014 12:26:34 -0400 In-Reply-To: <1410164258-27469-4-git-send-email-anup.patel@linaro.org> Sender: kvm-owner@vger.kernel.org List-ID: On 08/09/14 09:17, Anup Patel wrote: > 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. Is that really a good idea to default to exit_kvm? I find a shutdown a rather drastic default. Also I'd like to see RESET not easily mapped to shutdown. If the user resets the box explicitly, it's probably expected to come up again (to load an updated kernel or proceed with an install). So what about a more explicit message like: "... please restart the VM" until we gain proper reboot support in kvmtool? Regards, Andre. > Signed-off-by: Pranavkumar Sawargaonkar > Signed-off-by: Anup Patel > --- > tools/kvm/kvm-cpu.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/tools/kvm/kvm-cpu.c b/tools/kvm/kvm-cpu.c > index ee0a8ec..6d01192 100644 > --- a/tools/kvm/kvm-cpu.c > +++ b/tools/kvm/kvm-cpu.c > @@ -160,6 +160,25 @@ 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_SHUTDOWN: > + printf(" # Info: shutdown system event\n"); > + break; > + case KVM_SYSTEM_EVENT_RESET: > + printf(" # Info: reset system event\n"); > + break; > + default: > + printf(" # Warning: unknown system event type=%d\n", > + cpu->kvm_run->system_event.type); > + break; > + }; > + printf(" # Info: exiting KVMTOOL\n"); > + goto exit_kvm; > default: { > bool ret; > >