All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Paul Mackerras <paulus@samba.org>
Cc: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org,
	Cornelia Huck <cornelia.huck@de.ibm.com>
Subject: Re: [PATCH 1/3] KVM: PPC: Book3S: Controls for in-kernel PAPR hypercall handling
Date: Sun, 01 Jun 2014 09:55:21 +0000	[thread overview]
Message-ID: <538AF889.4070700@suse.de> (raw)
In-Reply-To: <1401520869-29364-2-git-send-email-paulus@samba.org>


On 31.05.14 09:21, Paul Mackerras wrote:
> This provides a way for userspace controls which PAPR hcalls get
> handled in the kernel.  Each hcall can be individually enabled or
> disabled for in-kernel handling, except for H_RTAS.  The exception
> for H_RTAS is because userspace can already control whether
> individual RTAS functions are handled in-kernel or not via the
> KVM_PPC_RTAS_DEFINE_TOKEN ioctl, and because the numeric value for
> H_RTAS is out of the normal sequence of hcall numbers.
>
> Hcalls are enabled or disabled using the KVM_ENABLE_CAP ioctl for the
> KVM_CAP_PPC_ENABLE_HCALL capability on the file descriptor for the VM.
> The args field of the struct kvm_enable_cap specifies the hcall number
> in args[0] and the enable/disable flag in args[1]; 0 means disable
> in-kernel handling (so that the hcall will always cause an exit to
> userspace) and 1 means enable.  Enabling or disabling in-kernel
> handling of an hcall is effective across the whole VM.
>
> The ability for KVM_ENABLE_CAP to be used on a VM file descriptor
> on PowerPC is new, added by this commit.  The KVM_CAP_ENABLE_CAP_VM
> capability advertises that this ability exists.
>
> When a VM is created, an initial set of hcalls are enabled for
> in-kernel handling.  The set that is enabled is the set that have
> an in-kernel implementation at this point.  Any new hcall
> implementations from this point onwards should not be added to the
> default set without a good reason.
>
> No distinction is made between real-mode and virtual-mode hcall
> implementations; the one setting controls them both.
>
> Signed-off-by: Paul Mackerras <paulus@samba.org>
> ---
>   Documentation/virtual/kvm/api.txt       | 19 ++++++++++++
>   arch/powerpc/include/asm/kvm_book3s.h   |  1 +
>   arch/powerpc/include/asm/kvm_host.h     |  2 ++
>   arch/powerpc/kernel/asm-offsets.c       |  1 +
>   arch/powerpc/kvm/book3s_hv.c            | 51 +++++++++++++++++++++++++++++++++
>   arch/powerpc/kvm/book3s_hv_rmhandlers.S | 11 +++++++
>   arch/powerpc/kvm/book3s_pr.c            |  5 ++++
>   arch/powerpc/kvm/book3s_pr_papr.c       | 37 ++++++++++++++++++++++++
>   arch/powerpc/kvm/powerpc.c              | 45 +++++++++++++++++++++++++++++
>   include/uapi/linux/kvm.h                |  1 +
>   10 files changed, 173 insertions(+)
>
> diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
> index 6ff3a77..73c614f 100644
> --- a/Documentation/virtual/kvm/api.txt
> +++ b/Documentation/virtual/kvm/api.txt
> @@ -3002,3 +3002,22 @@ Parameters: args[0] is the XICS device fd
>               args[1] is the XICS CPU number (server ID) for this vcpu
>   
>   This capability connects the vcpu to an in-kernel XICS device.
> +
> +6.8 KVM_CAP_PPC_ENABLE_HCALL
> +
> +Architectures: ppc (VM capability)

Hrm. Just create a new section for VM scope ENABLE_CAP caps. Putting 
them into the same bucket as CPU ones will end up confusing :).

> +Parameters: args[0] is the PAPR hcall number
> +	    args[1] is 0 to disable, 1 to enable in-kernel handling
> +
> +This capability controls whether individual PAPR hypercalls (hcalls)

Sorry for not seeing this earlier. We support both ePAPR and sPAPR 
compliant hypercalls on PPC. I think it makes sense to document which 
ones we're talking about here.


Alex


WARNING: multiple messages have this Message-ID (diff)
From: Alexander Graf <agraf@suse.de>
To: Paul Mackerras <paulus@samba.org>
Cc: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org,
	Cornelia Huck <cornelia.huck@de.ibm.com>
Subject: Re: [PATCH 1/3] KVM: PPC: Book3S: Controls for in-kernel PAPR hypercall handling
Date: Sun, 01 Jun 2014 11:55:21 +0200	[thread overview]
Message-ID: <538AF889.4070700@suse.de> (raw)
In-Reply-To: <1401520869-29364-2-git-send-email-paulus@samba.org>


On 31.05.14 09:21, Paul Mackerras wrote:
> This provides a way for userspace controls which PAPR hcalls get
> handled in the kernel.  Each hcall can be individually enabled or
> disabled for in-kernel handling, except for H_RTAS.  The exception
> for H_RTAS is because userspace can already control whether
> individual RTAS functions are handled in-kernel or not via the
> KVM_PPC_RTAS_DEFINE_TOKEN ioctl, and because the numeric value for
> H_RTAS is out of the normal sequence of hcall numbers.
>
> Hcalls are enabled or disabled using the KVM_ENABLE_CAP ioctl for the
> KVM_CAP_PPC_ENABLE_HCALL capability on the file descriptor for the VM.
> The args field of the struct kvm_enable_cap specifies the hcall number
> in args[0] and the enable/disable flag in args[1]; 0 means disable
> in-kernel handling (so that the hcall will always cause an exit to
> userspace) and 1 means enable.  Enabling or disabling in-kernel
> handling of an hcall is effective across the whole VM.
>
> The ability for KVM_ENABLE_CAP to be used on a VM file descriptor
> on PowerPC is new, added by this commit.  The KVM_CAP_ENABLE_CAP_VM
> capability advertises that this ability exists.
>
> When a VM is created, an initial set of hcalls are enabled for
> in-kernel handling.  The set that is enabled is the set that have
> an in-kernel implementation at this point.  Any new hcall
> implementations from this point onwards should not be added to the
> default set without a good reason.
>
> No distinction is made between real-mode and virtual-mode hcall
> implementations; the one setting controls them both.
>
> Signed-off-by: Paul Mackerras <paulus@samba.org>
> ---
>   Documentation/virtual/kvm/api.txt       | 19 ++++++++++++
>   arch/powerpc/include/asm/kvm_book3s.h   |  1 +
>   arch/powerpc/include/asm/kvm_host.h     |  2 ++
>   arch/powerpc/kernel/asm-offsets.c       |  1 +
>   arch/powerpc/kvm/book3s_hv.c            | 51 +++++++++++++++++++++++++++++++++
>   arch/powerpc/kvm/book3s_hv_rmhandlers.S | 11 +++++++
>   arch/powerpc/kvm/book3s_pr.c            |  5 ++++
>   arch/powerpc/kvm/book3s_pr_papr.c       | 37 ++++++++++++++++++++++++
>   arch/powerpc/kvm/powerpc.c              | 45 +++++++++++++++++++++++++++++
>   include/uapi/linux/kvm.h                |  1 +
>   10 files changed, 173 insertions(+)
>
> diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
> index 6ff3a77..73c614f 100644
> --- a/Documentation/virtual/kvm/api.txt
> +++ b/Documentation/virtual/kvm/api.txt
> @@ -3002,3 +3002,22 @@ Parameters: args[0] is the XICS device fd
>               args[1] is the XICS CPU number (server ID) for this vcpu
>   
>   This capability connects the vcpu to an in-kernel XICS device.
> +
> +6.8 KVM_CAP_PPC_ENABLE_HCALL
> +
> +Architectures: ppc (VM capability)

Hrm. Just create a new section for VM scope ENABLE_CAP caps. Putting 
them into the same bucket as CPU ones will end up confusing :).

> +Parameters: args[0] is the PAPR hcall number
> +	    args[1] is 0 to disable, 1 to enable in-kernel handling
> +
> +This capability controls whether individual PAPR hypercalls (hcalls)

Sorry for not seeing this earlier. We support both ePAPR and sPAPR 
compliant hypercalls on PPC. I think it makes sense to document which 
ones we're talking about here.


Alex

  reply	other threads:[~2014-06-01  9:55 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-26 12:17 [PATCH 0/3] New PAPR hypercall plus individual hypercall enables Paul Mackerras
2014-05-26 12:17 ` Paul Mackerras
2014-05-26 12:17 ` [PATCH 1/3] KVM: PPC: Book3S: Controls for in-kernel PAPR hypercall handling Paul Mackerras
2014-05-26 12:17   ` Paul Mackerras
2014-05-28 13:27   ` Alexander Graf
2014-05-28 13:27     ` Alexander Graf
2014-05-29  5:27     ` Paul Mackerras
2014-05-29  5:27       ` Paul Mackerras
2014-05-29  6:35       ` Alexander Graf
2014-05-29  6:35         ` Alexander Graf
2014-05-26 12:17 ` [PATCH 2/3] KVM: PPC: Book3S: Allow only implemented hcalls to be enabled or disabled Paul Mackerras
2014-05-26 12:17   ` Paul Mackerras
2014-05-28 13:30   ` Alexander Graf
2014-05-28 13:30     ` Alexander Graf
2014-05-26 12:17 ` [PATCH 3/3] KVM: PPC: Book3S HV: Add H_SET_MODE hcall handling Paul Mackerras
2014-05-26 12:17   ` Paul Mackerras
2014-05-28 13:35   ` Alexander Graf
2014-05-28 13:35     ` Alexander Graf
2014-05-29  5:47     ` Michael Neuling
2014-05-29  5:47       ` Michael Neuling
2014-05-29  6:22       ` [PATCH v2 " Michael Neuling
2014-05-29  6:22         ` Michael Neuling
2014-05-29  7:18         ` Alexander Graf
2014-05-29  7:18           ` Alexander Graf
2014-05-29  7:45           ` powerpc/pseries: Use new defines when calling h_set_mode Michael Neuling
2014-05-29  7:45             ` Michael Neuling
2014-05-29  7:45             ` Michael Neuling
2014-05-29 21:27             ` Alexander Graf
2014-05-29 21:27               ` Alexander Graf
2014-05-29 21:27               ` Alexander Graf
2014-05-29 21:52               ` Benjamin Herrenschmidt
2014-05-29 21:52                 ` Benjamin Herrenschmidt
2014-05-29 21:52                 ` Benjamin Herrenschmidt
2014-05-30  7:44                 ` Alexander Graf
2014-05-30  7:44                   ` Alexander Graf
2014-05-30  7:44                   ` Alexander Graf
2014-05-30  8:56             ` Michael Ellerman
2014-05-30  8:56               ` Michael Ellerman
2014-05-30  8:56               ` Michael Ellerman
2014-05-30  9:10               ` Michael Neuling
2014-05-30  9:10                 ` Michael Neuling
2014-05-30  9:10                 ` Michael Neuling
2014-05-30  9:13                 ` Alexander Graf
2014-05-30  9:13                   ` Alexander Graf
2014-05-30  9:13                   ` Alexander Graf
2014-05-30  9:44                   ` Michael Neuling
2014-05-30  9:44                     ` Michael Neuling
2014-05-30  9:44                     ` Alexander Graf
2014-05-30  9:44                       ` Alexander Graf
2014-05-30  9:44                       ` Alexander Graf
2014-05-31  7:21 ` [PATCH 0/3] New PAPR hypercall plus individual hypercall enables, v2 Paul Mackerras
2014-05-31  7:21   ` Paul Mackerras
2014-05-31  7:21   ` [PATCH 1/3] KVM: PPC: Book3S: Controls for in-kernel PAPR hypercall handling Paul Mackerras
2014-05-31  7:21     ` Paul Mackerras
2014-06-01  9:55     ` Alexander Graf [this message]
2014-06-01  9:55       ` Alexander Graf
2014-05-31  7:21   ` [PATCH 2/3] KVM: PPC: Book3S: Allow only implemented hcalls to be enabled or disabled Paul Mackerras
2014-05-31  7:21     ` Paul Mackerras
2014-05-31  7:21   ` [PATCH 3/3] KVM: PPC: Book3S HV: Add H_SET_MODE hcall handling Paul Mackerras
2014-05-31  7:21     ` Paul Mackerras
2014-06-01 10:01   ` [PATCH 0/3] New PAPR hypercall plus individual hypercall enables, v2 Alexander Graf
2014-06-01 10:01     ` Alexander Graf
2014-06-02  1:02 ` [PATCH 0/3] New PAPR hypercall plus individual hypercall enables, v3 Paul Mackerras
2014-06-02  1:02   ` Paul Mackerras
2014-06-02  1:02   ` [PATCH 1/3] KVM: PPC: Book3S: Controls for in-kernel sPAPR hypercall handling Paul Mackerras
2014-06-02  1:02     ` Paul Mackerras
2014-06-02  1:03   ` [PATCH 2/3] KVM: PPC: Book3S: Allow only implemented hcalls to be enabled or disabled Paul Mackerras
2014-06-02  1:03     ` Paul Mackerras
2014-06-02  1:03   ` [PATCH 3/3] KVM: PPC: Book3S HV: Add H_SET_MODE hcall handling Paul Mackerras
2014-06-02  1:03     ` Paul Mackerras
2014-06-25 21:46   ` [PATCH 0/3] New PAPR hypercall plus individual hypercall enables, v3 Alexander Graf
2014-06-25 21:46     ` Alexander Graf
2014-06-25 23:08     ` Paul Mackerras
2014-06-25 23:08       ` Paul Mackerras

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=538AF889.4070700@suse.de \
    --to=agraf@suse.de \
    --cc=cornelia.huck@de.ibm.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=paulus@samba.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.