All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Anup Patel <anup.patel@linaro.org>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"patches@apm.com" <patches@apm.com>,
	Will Deacon <Will.Deacon@arm.com>,
	Marc Zyngier <Marc.Zyngier@arm.com>,
	"penberg@kernel.org" <penberg@kernel.org>,
	"christoffer.dall@linaro.org" <christoffer.dall@linaro.org>,
	"pranavkumar@linaro.org" <pranavkumar@linaro.org>
Subject: Re: [PATCH v4 3/4] kvmtool: Handle exit reason KVM_EXIT_SYSTEM_EVENT
Date: Tue, 30 Sep 2014 10:04:08 +0100	[thread overview]
Message-ID: <542A7208.3030603@arm.com> (raw)
In-Reply-To: <1411084676-8275-4-git-send-email-anup.patel@linaro.org>

On 19/09/14 00:57, 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.
> 
> Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
> Signed-off-by: Anup Patel <anup.patel@linaro.org>
> ---
>  tools/kvm/kvm-cpu.c |   21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/tools/kvm/kvm-cpu.c b/tools/kvm/kvm-cpu.c
> index ee0a8ec..5180039 100644
> --- a/tools/kvm/kvm-cpu.c
> +++ b/tools/kvm/kvm-cpu.c
> @@ -160,6 +160,27 @@ 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");
> +				goto exit_kvm;
> +			case KVM_SYSTEM_EVENT_RESET:
> +				printf("  # Info: reset system event\n");
> +				printf("  # Info: KVMTOOL does not support VM reset\n");
> +				printf("  # Info: please re-launch the VM manually\n");
> +				goto exit_kvm;
> +			default:
> +				printf("  # Warning: unknown system event type=%d\n",
> +				       cpu->kvm_run->system_event.type);
> +				printf("  # Info: exiting KVMTOOL\n");
> +				goto exit_kvm;
> +			};
> +			break;
>  		default: {
>  			bool ret;
>  
> 

Looks good to me.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Cheers,
Andre.

  reply	other threads:[~2014-09-30  9:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-18 23:57 [PATCH v4 0/4] kvmtool: ARM/ARM64: Misc updates Anup Patel
2014-09-18 23:57 ` [PATCH v4 1/4] kvmtool: ARM: Use KVM_ARM_PREFERRED_TARGET vm ioctl to determine target cpu Anup Patel
2014-09-30  8:56   ` Andre Przywara
2014-10-01 10:24     ` Anup Patel
2014-09-18 23:57 ` [PATCH v4 2/4] kvmtool: ARM64: Add target type potenza for aarch64 Anup Patel
2014-09-29 17:00   ` Andre Przywara
2014-10-01 10:23     ` Anup Patel
2014-09-18 23:57 ` [PATCH v4 3/4] kvmtool: Handle exit reason KVM_EXIT_SYSTEM_EVENT Anup Patel
2014-09-30  9:04   ` Andre Przywara [this message]
2014-09-18 23:57 ` [PATCH v4 4/4] kvmtool: ARM/ARM64: Provide PSCI-0.2 to guest when KVM supports it Anup Patel
2014-09-30  9:02   ` Andre Przywara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=542A7208.3030603@arm.com \
    --to=andre.przywara@arm.com \
    --cc=Marc.Zyngier@arm.com \
    --cc=Will.Deacon@arm.com \
    --cc=anup.patel@linaro.org \
    --cc=christoffer.dall@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=patches@apm.com \
    --cc=penberg@kernel.org \
    --cc=pranavkumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.