Kernel KVM-PPC virtualization development
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Liu Yu <yu.liu@freescale.com>
Cc: agraf@suse.de, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH 1/2] KVM: PPC: epapr: Add idle hcall support for host
Date: Mon, 02 Jan 2012 18:17:21 +0000	[thread overview]
Message-ID: <4F01F4B1.3010409@freescale.com> (raw)
In-Reply-To: <1325312176-17697-1-git-send-email-yu.liu@freescale.com>

On 12/31/2011 12:16 AM, Liu Yu wrote:
> Add a new field opt_feature in struct kvm_ppc_pvinfo
> to tell userspace whether it support hcall idle.
> 
> Signed-off-by: Liu Yu <yu.liu@freescale.com>
> ---
>  arch/powerpc/include/asm/kvm_para.h |   18 ++++++++++++++----
>  arch/powerpc/kvm/powerpc.c          |    9 +++++++++
>  include/linux/kvm.h                 |    5 ++++-
>  3 files changed, 27 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/kvm_para.h b/arch/powerpc/include/asm/kvm_para.h
> index 50533f9..0686377 100644
> --- a/arch/powerpc/include/asm/kvm_para.h
> +++ b/arch/powerpc/include/asm/kvm_para.h
> @@ -40,17 +40,27 @@ struct kvm_vcpu_arch_shared {
>  	__u32 sr[16];
>  };
>  
> +#ifdef __KERNEL__
> +
>  #define KVM_SC_MAGIC_R0		0x4b564d21 /* "KVM!" */
> -#define HC_VENDOR_KVM		(42 << 16)
> +
> +#include <asm/epapr_hcalls.h>
> +
> +/* ePAPR Hypercall Vendor ID */
> +#define HC_VENDOR_EPAPR		(EV_EPAPR_VENDOR_ID << 16)
> +#define HC_VENDOR_KVM		(EV_KVM_VENDOR_ID << 16)
> +
> +/* ePAPR Hypercall Token */
> +#define HC_EV_IDLE		EV_IDLE
> +
> +/* ePAPR Hypercall Return Codes */
>  #define HC_EV_SUCCESS		0
> -#define HC_EV_UNIMPLEMENTED	12
> +#define HC_EV_UNIMPLEMENTED	EV_UNIMPLEMENTED
>  
>  #define KVM_FEATURE_MAGIC_PAGE	1
>  
>  #define KVM_MAGIC_FEAT_SR	(1 << 0)
>  
> -#ifdef __KERNEL__
> -

We don't want this stuff to be kernel-only.

> diff --git a/include/linux/kvm.h b/include/linux/kvm.h
> index c107fae..5af21f3 100644
> --- a/include/linux/kvm.h
> +++ b/include/linux/kvm.h
> @@ -426,9 +426,12 @@ struct kvm_ppc_pvinfo {
>  	/* out */
>  	__u32 flags;
>  	__u32 hcall[4];
> -	__u8  pad[108];
> +	__u32 opt_features;
> +	__u8  pad[104];
>  };

If the features weren't "opt"ional, there wouldn't be a bitmap of them. :-)

Just call it "features".  Or maybe just use "flags"?

-Scott


  parent reply	other threads:[~2012-01-02 18:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-31  6:16 [PATCH 1/2] KVM: PPC: epapr: Add idle hcall support for host Liu Yu
2011-12-31  6:16 ` [PATCH 2/2] KVM: PPC: epapr: Install ev_idle hcall for paravirt guest linux Liu Yu
2012-01-02 18:23   ` [PATCH 2/2] KVM: PPC: epapr: Install ev_idle hcall for paravirt Scott Wood
2012-01-04  9:23     ` Liu Yu-B13201
2012-01-04 19:21       ` Scott Wood
2012-01-02 18:17 ` Scott Wood [this message]
2012-01-03 14:01 ` [PATCH 1/2] KVM: PPC: epapr: Add idle hcall support for host Avi Kivity
2012-01-03 14:13   ` Alexander Graf
2012-01-04 10:33     ` Avi Kivity
2012-01-04 12:04       ` Alexander Graf
2012-01-04 12:11         ` Avi Kivity
2012-01-04 19:25         ` Scott Wood

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=4F01F4B1.3010409@freescale.com \
    --to=scottwood@freescale.com \
    --cc=agraf@suse.de \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=yu.liu@freescale.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox