From: Alexander Graf <agraf@suse.de>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org, kvm@vger.kernel.org,
kvm-ppc@vger.kernel.org, Scott Wood <scottwood@freescale.com>
Subject: Re: [RFC PATCH 17/17] KVM: PPC: Add an ioctl for userspace to select which platform to emulate
Date: Thu, 30 Jun 2011 17:04:23 +0200 [thread overview]
Message-ID: <4E0C9077.2060608@suse.de> (raw)
In-Reply-To: <20110629104103.GR25406@bloggs.ozlabs.ibm.com>
On 06/29/2011 12:41 PM, Paul Mackerras wrote:
> This new ioctl allows userspace to specify what paravirtualization
> interface (if any) KVM should implement, what architecture version
> the guest virtual processors should conform to, and whether the guest
> can be permitted to use a real supervisor mode.
>
> At present the only effect of the ioctl is to indicate whether the
> requested emulation is available, but in future it may be used to
> select between different emulation techniques (book3s_pr vs. book3s_hv)
> or set the CPU compatibility mode for the guest.
>
> If book3s_pr KVM is enabled in the kernel config, then this new
> ioctl accepts platform values of KVM_PPC_PV_NONE and KVM_PPC_PV_KVM,
> but not KVM_PPC_PV_SPAPR. If book3s_hv KVM is enabled, then this
> ioctl requires that the platform is KVM_PPC_PV_SPAPR and the
> guest_arch field contains one of 201 or 206 (for architecture versions
> 2.01 and 2.06) -- when running on a PPC970, it must contain 201, and
> when running on a POWER7, it must contain 206.
>
> Signed-off-by: Paul Mackerras<paulus@samba.org>
> ---
> Documentation/virtual/kvm/api.txt | 35 +++++++++++++++++++++++++++++++++++
> arch/powerpc/include/asm/kvm.h | 15 +++++++++++++++
> arch/powerpc/include/asm/kvm_host.h | 1 +
> arch/powerpc/kvm/powerpc.c | 28 ++++++++++++++++++++++++++++
> include/linux/kvm.h | 1 +
> 5 files changed, 80 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
> index b0e4b9c..3ab012c 100644
> --- a/Documentation/virtual/kvm/api.txt
> +++ b/Documentation/virtual/kvm/api.txt
> @@ -1430,6 +1430,41 @@ is supported; 2 if the processor requires all virtual machines to have
> an RMA, or 1 if the processor can use an RMA but doesn't require it,
> because it supports the Virtual RMA (VRMA) facility.
>
> +4.64 KVM_PPC_SET_PLATFORM
> +
> +Capability: none
> +Architectures: powerpc
> +Type: vm ioctl
> +Parameters: struct kvm_ppc_set_platform (in)
> +Returns: 0, or -1 on error
> +
> +This is used by userspace to tell KVM what sort of platform it should
> +emulate. The return value of the ioctl tells userspace whether the
> +emulation it is requesting is supported by KVM.
> +
> +struct kvm_ppc_set_platform {
> + __u16 platform; /* defines the OS/hypervisor ABI */
> + __u16 guest_arch; /* e.g. decimal 206 for v2.06 */
> + __u32 flags;
Please add some padding so we can extend it later if necessary.
> +};
> +
> +/* Values for platform */
> +#define KVM_PPC_PV_NONE 0 /* bare-metal, non-paravirtualized */
> +#define KVM_PPC_PV_KVM 1 /* as defined in kvm_para.h */
> +#define KVM_PPC_PV_SPAPR 2 /* IBM Server PAPR (a la PowerVM) */
We also support BookE which would be useful to also include in the list.
Furthermore, KVM is more of a feature flag than a platform. We can
easily support KVM extensions on an SPAPR platform, no?
This whole interface also could deprecate the PVR setting one, so we can
simply include PVR as well and not require kernel space to jump through
hoops to figure out its capabilities.
And we need to identify 32-bit BookS processors, so we can go into
32-bit mode when necessary. That should also be a different guest_arch,
right?
> +
> +/* Values for flags */
> +#define KVM_PPC_CROSS_ARCH 1 /* guest architecture != host */
User space shouldn't have to worry about this one. It's up to the kernel
to decide that it's cross.
Alex
next prev parent reply other threads:[~2011-06-30 15:04 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-29 10:15 [PATCH 0/17] Hypervisor-mode KVM on POWER7 and PPC970 Paul Mackerras
2011-06-29 10:16 ` [PATCH 01/17] KVM: PPC: Fix machine checks on 32-bit Book3S Paul Mackerras
2011-07-01 10:08 ` Alexander Graf
2011-06-29 10:17 ` [PATCH 02/17] KVM: PPC: Move fields between struct kvm_vcpu_arch and kvmppc_vcpu_book3s Paul Mackerras
2011-06-29 10:17 ` [PATCH 03/17] KVM: PPC: Split out code from book3s.c into book3s_pr.c Paul Mackerras
2011-06-29 10:18 ` [PATCH 04/17] powerpc, KVM: Rework KVM checks in first-level interrupt handlers Paul Mackerras
2011-06-29 10:18 ` [PATCH 05/17] KVM: PPC: Deliver program interrupts right away instead of queueing them Paul Mackerras
2011-07-01 11:47 ` Alexander Graf
2011-06-29 10:19 ` [PATCH 06/17] KVM: PPC: Pass init/destroy vm and prepare/commit memory region ops down Paul Mackerras
2011-06-29 10:19 ` [PATCH 07/17] KVM: PPC: Move guest enter/exit down into subarch-specific code Paul Mackerras
2011-06-29 10:20 ` [PATCH 08/17] powerpc: Set up LPCR for running guest partitions Paul Mackerras
2011-06-29 10:20 ` [PATCH 09/17] KVM: PPC: Split host-state fields out of kvmppc_book3s_shadow_vcpu Paul Mackerras
2011-06-29 10:21 ` [PATCH 10/17] KVM: PPC: Add support for Book3S processors in hypervisor mode Paul Mackerras
2011-07-01 18:37 ` Dave Hansen
2011-07-01 19:12 ` Alexander Graf
2011-07-04 11:51 ` Paul Mackerras
2011-06-29 10:22 ` [PATCH 11/17] KVM: PPC: Handle some PAPR hcalls in the kernel Paul Mackerras
2011-06-29 10:22 ` [PATCH 12/17] KVM: PPC: Accelerate H_PUT_TCE by implementing it in real mode Paul Mackerras
2011-06-29 10:23 ` [PATCH 13/17] KVM: PPC: Allow book3s_hv guests to use SMT processor modes Paul Mackerras
2012-04-16 9:45 ` Alexander Graf
2012-04-16 12:13 ` Paul Mackerras
2012-04-16 13:01 ` Alexander Graf
2011-06-29 10:25 ` [PATCH 14/17] KVM: PPC: Allocate RMAs (Real Mode Areas) at boot for use by guests Paul Mackerras
2011-06-29 10:26 ` [PATCH 15/17] powerpc, KVM: Split HVMODE_206 cpu feature bit into separate HV and architecture bits Paul Mackerras
2011-06-29 10:40 ` [PATCH 16/17] KVM: PPC: book3s_hv: Add support for PPC970-family processors Paul Mackerras
2011-06-29 10:41 ` [RFC PATCH 17/17] KVM: PPC: Add an ioctl for userspace to select which platform to emulate Paul Mackerras
2011-06-29 11:53 ` Josh Boyer
2011-06-29 11:56 ` Alexander Graf
2011-06-29 11:58 ` Josh Boyer
2011-06-30 8:34 ` Avi Kivity
2011-06-30 15:04 ` Alexander Graf [this message]
2011-06-30 15:16 ` Avi Kivity
2011-06-30 15:22 ` Alexander Graf
2011-06-30 16:00 ` Avi Kivity
2011-06-30 16:33 ` Alexander Graf
2011-07-03 8:15 ` Avi Kivity
2011-07-03 8:34 ` Alexander Graf
2011-07-03 8:56 ` Avi Kivity
2011-07-03 9:00 ` Alexander Graf
2011-07-03 9:05 ` Avi Kivity
2011-07-03 9:09 ` Alexander Graf
2011-07-03 9:12 ` Avi Kivity
2011-07-04 10:59 ` Alexander Graf
2011-07-04 11:22 ` Avi Kivity
2011-07-04 11:36 ` Alexander Graf
2011-07-04 11:37 ` Avi Kivity
2011-07-04 11:41 ` Alexander Graf
2011-06-30 23:13 ` Benjamin Herrenschmidt
2011-07-01 10:09 ` Paul Mackerras
2011-07-01 10:23 ` Alexander Graf
2011-07-01 18:24 ` [PATCH 0/17] Hypervisor-mode KVM on POWER7 and PPC970 Alexander Graf
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=4E0C9077.2060608@suse.de \
--to=agraf@suse.de \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
--cc=scottwood@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