From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: Christoph Schlameuss <schlameuss@linux.ibm.com>
Cc: kvm@vger.kernel.org,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Janosch Frank <frankja@linux.ibm.com>,
David Hildenbrand <david@redhat.com>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
linux-s390@vger.kernel.org
Subject: Re: [PATCH 1/3] KVM: s390: Set KVM_MAX_VCPUS to 256
Date: Thu, 15 May 2025 13:14:47 +0200 [thread overview]
Message-ID: <20250515131447.5d99ce69@p-imbrenda> (raw)
In-Reply-To: <20250514-rm-bsca-v1-1-6c2b065a8680@linux.ibm.com>
On Wed, 14 May 2025 18:34:49 +0200
Christoph Schlameuss <schlameuss@linux.ibm.com> wrote:
> The s390x architecture allows for 256 vCPUs with a max CPUID of 255.
> The current KVM implementation limits this to 248 when using the
> extended system control area (ESCA). So this correction should not cause
> any real world problems but actually correct the values returned by the
> ioctls:
>
> * KVM_CAP_NR_VCPUS
> * KVM_CAP_MAX_VCPUS
> * KVM_CAP_MAX_VCPU_ID
>
> KVM_MAX_VCPUS is also moved to kvm_host_types to allow using this in
> future type definitions.
>
> Signed-off-by: Christoph Schlameuss <schlameuss@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> ---
> arch/s390/include/asm/kvm_host.h | 2 --
> arch/s390/include/asm/kvm_host_types.h | 2 ++
> arch/s390/kvm/kvm-s390.c | 2 ++
> 3 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
> index cb89e54ada257eb4fdfe840ff37b2ea639c2d1cb..f51bac835260f562eaf4bbfd373a24bfdbc43834 100644
> --- a/arch/s390/include/asm/kvm_host.h
> +++ b/arch/s390/include/asm/kvm_host.h
> @@ -27,8 +27,6 @@
> #include <asm/isc.h>
> #include <asm/guarded_storage.h>
>
> -#define KVM_MAX_VCPUS 255
> -
> #define KVM_INTERNAL_MEM_SLOTS 1
>
> /*
> diff --git a/arch/s390/include/asm/kvm_host_types.h b/arch/s390/include/asm/kvm_host_types.h
> index 1394d3fb648f1e46dba2c513ed26e5dfd275fad4..9697db9576f6c39a6689251f85b4b974c344769a 100644
> --- a/arch/s390/include/asm/kvm_host_types.h
> +++ b/arch/s390/include/asm/kvm_host_types.h
> @@ -6,6 +6,8 @@
> #include <linux/atomic.h>
> #include <linux/types.h>
>
> +#define KVM_MAX_VCPUS 256
> +
> #define KVM_S390_BSCA_CPU_SLOTS 64
> #define KVM_S390_ESCA_CPU_SLOTS 248
>
> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> index 3f3175193fd7a7a26658eb2e2533d8037447a0b4..b65e4cbe67cf70a7d614607ebdd679060e7d31f4 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
> @@ -638,6 +638,8 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
> r = KVM_S390_ESCA_CPU_SLOTS;
> if (ext == KVM_CAP_NR_VCPUS)
> r = min_t(unsigned int, num_online_cpus(), r);
> + else if (ext == KVM_CAP_MAX_VCPU_ID)
> + r -= 1;
> break;
> case KVM_CAP_S390_COW:
> r = machine_has_esop();
>
next prev parent reply other threads:[~2025-05-15 11:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-14 16:34 [PATCH 0/3] KVM: s390: Use ESCA instead of BSCA at VM init Christoph Schlameuss
2025-05-14 16:34 ` [PATCH 1/3] KVM: s390: Set KVM_MAX_VCPUS to 256 Christoph Schlameuss
2025-05-15 11:14 ` Claudio Imbrenda [this message]
2025-05-14 16:34 ` [PATCH 2/3] KVM: s390: Always allocate esca_block Christoph Schlameuss
2025-05-15 11:24 ` Claudio Imbrenda
2025-05-15 13:07 ` Christoph Schlameuss
2025-05-15 13:15 ` Claudio Imbrenda
2025-05-14 16:34 ` [PATCH 3/3] KVM: s390: Specify kvm->arch.sca as esca_block Christoph Schlameuss
2025-05-15 11:25 ` Claudio Imbrenda
2025-05-14 17:34 ` [PATCH 0/3] KVM: s390: Use ESCA instead of BSCA at VM init David Hildenbrand
2025-05-15 7:38 ` Christoph Schlameuss
2025-05-15 11:26 ` Claudio Imbrenda
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=20250515131447.5d99ce69@p-imbrenda \
--to=imbrenda@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=david@redhat.com \
--cc=frankja@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=schlameuss@linux.ibm.com \
--cc=svens@linux.ibm.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 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.