All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Chen Baozi <cbz@baozis.org>
Cc: Julien Grall <julien.grall@citrix.com>,
	xen-devel@lists.xenproject.org, Chen Baozi <baozich@gmail.com>
Subject: Re: [PATCH V6 03/10] xen/arm: Use the new functions for vCPUID/vaffinity transformation
Date: Fri, 5 Jun 2015 16:56:07 +0100	[thread overview]
Message-ID: <1433519767.7108.327.camel@citrix.com> (raw)
In-Reply-To: <1433163388-16970-4-git-send-email-cbz@baozis.org>

On Mon, 2015-06-01 at 20:56 +0800, Chen Baozi wrote:
> From: Chen Baozi <baozich@gmail.com>
> 
> There are 3 places to change:
> 
> * Initialise vMPIDR value in vcpu_initialise()
> * Find the vCPU from vMPIDR affinity information when accessing GICD
>   registers in vGIC
> * Find the vCPU from vMPIDR affinity information when booting with vPSCI
>   in vGIC
>   - Also make the code for PSCI 0.1 use MPIDR-like value as the cpuid.

Does this "- Also ..." not need to be done at the same time as the
change to how we describe things in the FDT? Since that is where the
guest gets the parameter from, isn't it?

> Signed-off-by: Chen Baozi <baozich@gmail.com>
> Reviewed-by: Julien Grall <julien.grall@citrix.com>
> ---
>  xen/arch/arm/domain.c  | 6 +-----
>  xen/arch/arm/vgic-v3.c | 2 +-
>  xen/arch/arm/vpsci.c   | 5 +----
>  3 files changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
> index 2bde26e..0cf147c 100644
> --- a/xen/arch/arm/domain.c
> +++ b/xen/arch/arm/domain.c
> @@ -501,11 +501,7 @@ int vcpu_initialise(struct vcpu *v)
>  
>      v->arch.sctlr = SCTLR_GUEST_INIT;
>  
> -    /*
> -     * By default exposes an SMP system with AFF0 set to the VCPU ID
> -     * TODO: Handle multi-threading processor and cluster
> -     */
> -    v->arch.vmpidr = MPIDR_SMP | (v->vcpu_id << MPIDR_AFF0_SHIFT);
> +    v->arch.vmpidr = MPIDR_SMP | vcpuid_to_vaffinity(v->vcpu_id);
>  
>      v->arch.actlr = READ_SYSREG32(ACTLR_EL1);
>  
> diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
> index 540f85f..ef9a71a 100644
> --- a/xen/arch/arm/vgic-v3.c
> +++ b/xen/arch/arm/vgic-v3.c
> @@ -61,7 +61,7 @@ static struct vcpu *vgic_v3_irouter_to_vcpu(struct domain *d, uint64_t irouter)
>      if ( irouter & GICD_IROUTER_SPI_MODE_ANY )
>          return d->vcpu[0];
>  
> -    vcpu_id = irouter & MPIDR_AFF0_MASK;
> +    vcpu_id = vaffinity_to_vcpuid(irouter);
>      if ( vcpu_id >= d->max_vcpus )
>          return NULL;
>  
> diff --git a/xen/arch/arm/vpsci.c b/xen/arch/arm/vpsci.c
> index 5d899be..aebe1e2 100644
> --- a/xen/arch/arm/vpsci.c
> +++ b/xen/arch/arm/vpsci.c
> @@ -32,10 +32,7 @@ static int do_common_cpu_on(register_t target_cpu, register_t entry_point,
>      int is_thumb = entry_point & 1;
>      register_t vcpuid;
>  
> -    if( ver == XEN_PSCI_V_0_2 )
> -        vcpuid = (target_cpu & MPIDR_HWID_MASK);
> -    else
> -        vcpuid = target_cpu;
> +    vcpuid = vaffinity_to_vcpuid(target_cpu);
>  
>      if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
>          return PSCI_INVALID_PARAMETERS;

  reply	other threads:[~2015-06-05 15:57 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 12:56 [PATCH V6 00/10] Support more than 8 vcpus on arm64 with GICv3 Chen Baozi
2015-06-01 12:56 ` [PATCH V6 01/10] xen/arm: gic-v3: Increase the size of GICR in address space for guest Chen Baozi
2015-06-05 15:49   ` Ian Campbell
2015-06-05 16:04     ` Julien Grall
2015-06-05 16:31       ` Ian Campbell
2015-06-05 18:07         ` Julien Grall
2015-06-01 12:56 ` [PATCH V6 02/10] xen/arm: Add functions of mapping between vCPUID and virtual affinity Chen Baozi
2015-06-05 15:54   ` Ian Campbell
2015-06-01 12:56 ` [PATCH V6 03/10] xen/arm: Use the new functions for vCPUID/vaffinity transformation Chen Baozi
2015-06-05 15:56   ` Ian Campbell [this message]
2015-06-05 18:18     ` Julien Grall
2015-06-08 10:05       ` Ian Campbell
2015-06-08 13:00         ` Julien Grall
2015-06-01 12:56 ` [PATCH V6 04/10] xen/arm: Use cpumask_t type for vcpu_mask in vgic_to_sgi Chen Baozi
2015-06-05 16:05   ` Ian Campbell
2015-06-10 10:21     ` Chen Baozi
2015-06-10 10:27       ` Ian Campbell
2015-06-01 12:56 ` [PATCH V6 05/10] xen/arm64: gicv3: Use AFF1 when translating ICC_SGI1R_EL1 to cpumask Chen Baozi
2015-06-05 16:09   ` Ian Campbell
2015-06-05 18:25     ` Julien Grall
2015-06-08 10:06       ` Ian Campbell
2015-06-01 12:56 ` [PATCH V6 06/10] tools/libxl: Set 'reg' of cpu node equal to MPIDR affinity for domU Chen Baozi
2015-06-05 16:11   ` Ian Campbell
2015-06-05 16:12   ` Ian Campbell
2015-06-01 12:56 ` [PATCH V6 07/10] xen/arm: Set 'reg' of cpu node for dom0 to match MPIDR's affinity Chen Baozi
2015-06-05 16:13   ` Ian Campbell
2015-06-01 12:56 ` [PATCH V6 08/10] xen: Add arch_domain_preinit to initialise vGIC before evtchn_init Chen Baozi
2015-06-05 16:22   ` Ian Campbell
2015-06-11  9:20     ` Chen Baozi
2015-06-11  9:37       ` Ian Campbell
2015-06-11 11:16         ` Chen Baozi
2015-06-11 11:47           ` Julien Grall
2015-06-11 12:45             ` Chen Baozi
2015-06-01 12:56 ` [PATCH V6 09/10] xen/arm: make domain_max_vcpus return value from vgic_ops Chen Baozi
2015-06-05 16:26   ` Ian Campbell
2015-06-05 16:39     ` Julien Grall
2015-06-01 12:56 ` [PATCH V6 10/10] xen/arm64: increase MAX_VIRT_CPUS to 128 on arm64 Chen Baozi
2015-06-05 16:27   ` Ian Campbell
2015-06-05 14:08 ` [PATCH V6 00/10] Support more than 8 vcpus on arm64 with GICv3 Ian Campbell
2015-06-05 14:37   ` Julien Grall
2015-06-05 15:15     ` Ian Campbell
2015-06-05 14:23 ` Ian Campbell

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=1433519767.7108.327.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=baozich@gmail.com \
    --cc=cbz@baozis.org \
    --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.