From: Sam Bobroff <sbobroff@linux.ibm.com>
To: Paul Mackerras <paulus@ozlabs.org>
Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH 1/2] KVM: PPC: Book3S HV: Allow creating max number of VCPUs on POWER9
Date: Mon, 30 Jul 2018 13:37:27 +1000 [thread overview]
Message-ID: <20180730033725.GA28225@tungsten.ozlabs.ibm.com> (raw)
In-Reply-To: <20180726054353.GB1672@fergus>
[-- Attachment #1: Type: text/plain, Size: 2645 bytes --]
On Thu, Jul 26, 2018 at 03:43:54PM +1000, Paul Mackerras wrote:
> Commit 1e175d2 ("KVM: PPC: Book3S HV: Pack VCORE IDs to access full
> VCPU ID space", 2018-07-25) allowed use of VCPU IDs up to
> KVM_MAX_VCPU_ID on POWER9 in all guest SMT modes and guest emulated
> hardware SMT modes. However, with the current definition of
> KVM_MAX_VCPU_ID, a guest SMT mode of 1 and an emulated SMT mode of 8,
> it is only possible to create KVM_MAX_VCPUS / 2 VCPUS, because
> threads_per_subcore is 4 on POWER9 CPUs. (Using an emulated SMT mode
> of 8 is useful when migrating VMs to or from POWER8 hosts.)
>
> This increases KVM_MAX_VCPU_ID to 8 * KVM_MAX_VCPUS when HV KVM is
> configured in, so that a full complement of KVM_MAX_VCPUS VCPUs can
> be created on POWER9 in all guest SMT modes and emulated hardware
> SMT modes.
>
> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
> ---
> This and the next patch apply on my kvm-ppc-next branch, which
> includes Sam Bobroff's patch "KVM: PPC: Book3S HV: Pack VCORE IDs to
> access full VCPU ID space".
Thanks!
I've tested kvm-ppc-next with all three above patches, and I'm able to
access the entire VCPU ID space (tested using CONFIG_NR_CPUS 1024 in the
host, rather than the default 2048, as that's the limit imposed by
QEMU). So:
Tested-by: Sam Bobroff <sbobroff@linux.ibm.com>
>
> arch/powerpc/include/asm/kvm_host.h | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h
> index 5b9e660..906bcbdf 100644
> --- a/arch/powerpc/include/asm/kvm_host.h
> +++ b/arch/powerpc/include/asm/kvm_host.h
> @@ -42,7 +42,14 @@
> #define KVM_USER_MEM_SLOTS 512
>
> #include <asm/cputhreads.h>
> -#define KVM_MAX_VCPU_ID (threads_per_subcore * KVM_MAX_VCORES)
> +
> +#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
> +#include <asm/kvm_book3s_asm.h> /* for MAX_SMT_THREADS */
> +#define KVM_MAX_VCPU_ID (MAX_SMT_THREADS * KVM_MAX_VCORES)
> +
> +#else
> +#define KVM_MAX_VCPU_ID KVM_MAX_VCPUS
> +#endif /* CONFIG_KVM_BOOK3S_HV_POSSIBLE */
>
> #define __KVM_HAVE_ARCH_INTC_INITIALIZED
>
> --
> 2.7.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at https://urldefense.proofpoint.com/v2/url?u=http-3A__vger.kernel.org_majordomo-2Dinfo.html&d=DwIBAg&c=jf_iaSHvJObTbx-siA1ZOg&r=FFlZoKpUuHop_w02rKHYxbjM9foF4tIm4FyKg8muba0&m=XJuK_j7qbnfsRxN3uHJ65CPxG7brNIut6LNuFyQYF8k&s=2zUtzqXA51owzthAuMl8kD0fWpLcjXBZswb_t6SYFSI&e=
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2018-07-30 3:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-26 5:43 [PATCH 1/2] KVM: PPC: Book3S HV: Allow creating max number of VCPUs on POWER9 Paul Mackerras
2018-07-30 3:37 ` Sam Bobroff [this message]
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=20180730033725.GA28225@tungsten.ozlabs.ibm.com \
--to=sbobroff@linux.ibm.com \
--cc=david@gibson.dropbear.id.au \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@ozlabs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).