All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@kaod.org>
To: Greg Kurz <groug@kaod.org>, David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH 6/7] spapr/xive: Configure number of servers in KVM
Date: Thu, 3 Oct 2019 14:30:29 +0200	[thread overview]
Message-ID: <a86bb869-5908-4150-e2df-791e1d54ff77@kaod.org> (raw)
In-Reply-To: <157010411139.246126.16419749660388287086.stgit@bahia.lan>

On 03/10/2019 14:01, Greg Kurz wrote:
> The XIVE KVM devices now has an attribute to configure the number of
> interrupt servers. This allows to greatly optimize the usage of the VP
> space in the XIVE HW, and thus to start a lot more VMs.
> 
> Only set this attribute if available in order to support older POWER9
> KVM.
> 
> The XIVE KVM device now reports the exhaustion of VPs upon the
> connection of the first VCPU. Check that in order to have a chance
> to provide an hint to the user.
> 
> Signed-off-by: Greg Kurz <groug@kaod.org>

Reviewed-by: Cédric Le Goater <clg@kaod.org>

> ---
>  hw/intc/spapr_xive_kvm.c |   22 ++++++++++++++++++++--
>  1 file changed, 20 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/intc/spapr_xive_kvm.c b/hw/intc/spapr_xive_kvm.c
> index 51b334b676a1..2a3a9ef22b6f 100644
> --- a/hw/intc/spapr_xive_kvm.c
> +++ b/hw/intc/spapr_xive_kvm.c
> @@ -152,7 +152,8 @@ void kvmppc_xive_cpu_synchronize_state(XiveTCTX *tctx, Error **errp)
>  
>  void kvmppc_xive_cpu_connect(XiveTCTX *tctx, Error **errp)
>  {
> -    SpaprXive *xive = SPAPR_MACHINE(qdev_get_machine())->xive;
> +    MachineState *ms = MACHINE(qdev_get_machine());
> +    SpaprXive *xive = SPAPR_MACHINE(ms)->xive;
>      unsigned long vcpu_id;
>      int ret;
>  
> @@ -171,8 +172,15 @@ void kvmppc_xive_cpu_connect(XiveTCTX *tctx, Error **errp)
>      ret = kvm_vcpu_enable_cap(tctx->cs, KVM_CAP_PPC_IRQ_XIVE, 0, xive->fd,
>                                vcpu_id, 0);
>      if (ret < 0) {
> -        error_setg(errp, "XIVE: unable to connect CPU%ld to KVM device: %s",
> +        Error *err = NULL;
> +
> +        error_setg(&err, "XIVE: unable to connect CPU%ld to KVM device: %s",
>                     vcpu_id, strerror(errno));
> +        if (errno == ENOSPC) {
> +            error_append_hint(&local_err, "Try -smp maxcpus=N with N < %u\n",
> +                              ms->smp.max_cpus);
> +        }
> +        error_propagate(errp, err);
>          return;
>      }
>  
> @@ -768,6 +776,16 @@ void kvmppc_xive_connect(SpaprXive *xive, Error **errp)
>          return;
>      }
>  
> +    /* Tell KVM about the # of VCPUs we may have */
> +    if (kvm_device_check_attr(xive->fd, KVM_DEV_XIVE_GRP_CTRL,
> +                              KVM_DEV_XIVE_NR_SERVERS)) {
> +        if (kvm_device_access(xive->fd, KVM_DEV_XIVE_GRP_CTRL,
> +                              KVM_DEV_XIVE_NR_SERVERS, &xive->nr_servers, true,
> +                              &local_err)) {
> +            goto fail;
> +        }
> +    }
> +
>      /*
>       * 1. Source ESB pages - KVM mapping
>       */
> 



  reply	other threads:[~2019-10-03 12:33 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-03 12:00 [PATCH 0/7] spapr: Use less XIVE HW resources in KVM Greg Kurz
2019-10-03 12:00 ` [PATCH 1/7] spapr, xics: Get number of servers with a XICSFabricClass method Greg Kurz
2019-10-03 12:24   ` Cédric Le Goater
2019-10-03 12:49     ` Greg Kurz
2019-10-03 12:58       ` Cédric Le Goater
2019-10-03 13:02         ` Greg Kurz
2019-10-03 13:19           ` Cédric Le Goater
2019-10-03 13:41             ` Greg Kurz
2019-10-03 13:59               ` Cédric Le Goater
2019-10-03 14:58                 ` Greg Kurz
2019-10-03 12:01 ` [PATCH 2/7] spapr, xive: Turn "nr-ends" property into "nr-servers" property Greg Kurz
2019-10-03 12:21   ` Cédric Le Goater
2019-10-03 12:44     ` Greg Kurz
2019-10-04  4:07   ` David Gibson
2019-10-04  5:53     ` Cédric Le Goater
2019-10-04  6:52       ` Greg Kurz
2019-10-04  7:27         ` Cédric Le Goater
2019-10-04  6:51     ` Greg Kurz
2019-10-05 10:23       ` David Gibson
2019-10-03 12:01 ` [PATCH 3/7] spapr, xics, xive: Drop nr_servers argument in DT-related functions Greg Kurz
2019-10-03 12:25   ` Cédric Le Goater
2019-10-03 12:52     ` Greg Kurz
2019-10-03 12:01 ` [PATCH RFC 4/7] linux-headers: Update against 5.3-rc2 Greg Kurz
2019-10-03 12:01 ` [PATCH 5/7] spapr/xics: Configure number of servers in KVM Greg Kurz
2019-10-03 12:29   ` Cédric Le Goater
2019-10-03 12:55     ` Greg Kurz
2019-10-03 12:01 ` [PATCH 6/7] spapr/xive: " Greg Kurz
2019-10-03 12:30   ` Cédric Le Goater [this message]
2019-10-03 12:02 ` [PATCH 7/7] spapr: Set VSMT to smp_threads by default Greg Kurz
2019-10-14  6:12   ` David Gibson
2019-10-14 11:31     ` Greg Kurz

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=a86bb869-5908-4150-e2df-791e1d54ff77@kaod.org \
    --to=clg@kaod.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=groug@kaod.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.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.