From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Chen Baozi <cbz@baozis.org>, xen-devel@lists.xenproject.org
Cc: Julien Grall <julien.grall@citrix.com>,
Chen Baozi <baozich@gmail.com>,
Ian Campbell <ian.campbell@citrix.com>
Subject: Re: [PATCH V4 8/8] xen/arm: make domain_max_vcpus return value according to vGIC version
Date: Thu, 28 May 2015 11:17:45 +0100 [thread overview]
Message-ID: <5566EB49.4020209@citrix.com> (raw)
In-Reply-To: <1432808109-31466-9-git-send-email-cbz@baozis.org>
On 28/05/15 11:15, Chen Baozi wrote:
> From: Chen Baozi <baozich@gmail.com>
>
> When a guest uses vGICv2, the maximum number of vCPU it can support
> should not be as many as MAX_VIRT_CPUS, which is 128 at the moment.
> So the domain_max_vcpus should return the value according to the vGIC
> version the domain uses.
>
> We didn't keep it as the old static inline form because it will break
> compilation when access the member of struct domain:
>
> In file included from xen/include/xen/domain.h:6:0,
> from xen/include/xen/sched.h:10,
> from arm64/asm-offsets.c:10:
> xen/include/asm/domain.h: In function ‘domain_max_vcpus’:
> xen/include/asm/domain.h:266:10: error: dereferencing pointer to incomplete type
> if (d->arch.vgic.version == GIC_V2)
> ^
>
> Signed-off-by: Chen Baozi <baozich@gmail.com>
Looks much better!
It is a shame about the compilation issue - I had a similar issue on the
x86 side. At some point, I need to untangle the rats nest which is our
currently header file layout, so that we don't have to rely on tricks
like this to keep it compiling.
~Andrew
> ---
> xen/arch/arm/domain.c | 6 ++++++
> xen/include/asm-arm/domain.h | 5 +----
> xen/include/asm-arm/gic.h | 3 +++
> 3 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
> index 0cf147c..78b77b1 100644
> --- a/xen/arch/arm/domain.c
> +++ b/xen/arch/arm/domain.c
> @@ -890,6 +890,12 @@ void vcpu_block_unless_event_pending(struct vcpu *v)
> vcpu_unblock(current);
> }
>
> +unsigned int domain_max_vcpus(const struct domain *d)
> +{
> + return ((d->arch.vgic.version == GIC_V2) ?
> + GICV2_MAX_CPUS : GICV3_MAX_CPUS);
> +}
> +
> /*
> * Local variables:
> * mode: C
> diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
> index 603a20b..c4cb15d 100644
> --- a/xen/include/asm-arm/domain.h
> +++ b/xen/include/asm-arm/domain.h
> @@ -261,10 +261,7 @@ struct arch_vcpu
> void vcpu_show_execution_state(struct vcpu *);
> void vcpu_show_registers(const struct vcpu *);
>
> -static inline unsigned int domain_max_vcpus(const struct domain *d)
> -{
> - return MAX_VIRT_CPUS;
> -}
> +unsigned int domain_max_vcpus(const struct domain *);
>
> /*
> * Due to the restriction of GICv3, the number of vCPUs in AFF0 is
> diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
> index 463fffb..a7bc0d1 100644
> --- a/xen/include/asm-arm/gic.h
> +++ b/xen/include/asm-arm/gic.h
> @@ -18,6 +18,9 @@
> #ifndef __ASM_ARM_GIC_H__
> #define __ASM_ARM_GIC_H__
>
> +#define GICV2_MAX_CPUS 8
> +#define GICV3_MAX_CPUS 128
> +
> #define NR_GIC_LOCAL_IRQS NR_LOCAL_IRQS
> #define NR_GIC_SGI 16
> #define MAX_RDIST_COUNT 4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2015-05-28 10:17 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-28 10:15 [PATCH V4 0/8] Support more than 8 vcpus on arm64 with GICv3 Chen Baozi
2015-05-28 10:15 ` [PATCH V4 1/8] xen/arm: gic-v3: Increase the size of GICR in address space for guest Chen Baozi
2015-05-28 10:15 ` [PATCH V4 2/8] xen/arm: Add functions of mapping between vCPUID and virtual affinity Chen Baozi
2015-05-29 14:27 ` Julien Grall
2015-05-28 10:15 ` [PATCH V4 3/8] xen/arm: Use the new functions for vCPUID/vaffinity transformation Chen Baozi
2015-05-29 14:34 ` Julien Grall
2015-05-28 10:15 ` [PATCH V4 4/8] xen/arm: Use cpumask_t type for vcpu_mask in vgic_to_sgi Chen Baozi
2015-05-29 15:20 ` Julien Grall
2015-05-28 10:15 ` [PATCH V4 5/8] tools/libxl: Set 'reg' of cpu node equal to MPIDR affinity for domU Chen Baozi
2015-05-29 15:44 ` Julien Grall
2015-05-29 15:55 ` Ian Campbell
2015-05-29 16:08 ` Julien Grall
2015-05-30 2:08 ` Chen Baozi
2015-05-30 2:27 ` Chen Baozi
2015-05-28 10:15 ` [PATCH V4 6/8] xen/arm: Set 'reg' of cpu node for dom0 to match MPIDR's affinity Chen Baozi
2015-05-29 15:49 ` Julien Grall
2015-05-30 2:10 ` Chen Baozi
2015-05-28 10:15 ` [PATCH V4 7/8] xen/arm64: increase MAX_VIRT_CPUS to 128 on arm64 Chen Baozi
2015-05-29 15:51 ` Julien Grall
2015-05-29 16:20 ` Julien Grall
2015-05-29 16:41 ` Andrew Cooper
2015-05-29 16:45 ` Julien Grall
2015-05-29 16:49 ` Andrew Cooper
2015-05-28 10:15 ` [PATCH V4 8/8] xen/arm: make domain_max_vcpus return value according to vGIC version Chen Baozi
2015-05-28 10:17 ` Andrew Cooper [this message]
2015-05-29 16:18 ` Julien Grall
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=5566EB49.4020209@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=baozich@gmail.com \
--cc=cbz@baozis.org \
--cc=ian.campbell@citrix.com \
--cc=julien.grall@citrix.com \
--cc=xen-devel@lists.xenproject.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.