All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: Julien Grall <julien.grall@arm.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xen.org
Subject: Re: [PATCH v2 4/6] xen/arm: make vpidr per vcpu
Date: Tue, 20 Feb 2018 12:47:53 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1802201242190.19448@sstabellini-ThinkPad-X260> (raw)
In-Reply-To: <b6f56deb-17cf-49a1-bcfd-b073eda8a576@arm.com>

On Tue, 20 Feb 2018, Julien Grall wrote:
> Hi Stefano,
> 
> On 19/02/18 21:58, Stefano Stabellini wrote:
> > On big.LITTLE systems not all cores have the same midr. Instead of
> > storing only one vpidr per domain, make it per vcpu and initialize it to
> > the value of the midr of the pcpu where the vcpu will run.
> > 
> > This way, assuming that the vcpu has been created with the right pcpu
> > affinity, the guest will be able to read the right vpidr value, matching
> > the one of the physical cpu.
> > 
> > Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
> > 
> > ---
> > 
> > - remove warning message
> > - make vpidr per vcpu
> > ---
> >   xen/arch/arm/domain.c        | 6 ++----
> >   xen/arch/arm/vcpreg.c        | 4 ++--
> >   xen/include/asm-arm/domain.h | 6 +++---
> >   3 files changed, 7 insertions(+), 9 deletions(-)
> > 
> > diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
> > index fb51415..41d5d25 100644
> > --- a/xen/arch/arm/domain.c
> > +++ b/xen/arch/arm/domain.c
> > @@ -180,7 +180,7 @@ static void ctxt_switch_to(struct vcpu *n)
> >         p2m_restore_state(n);
> >   -    WRITE_SYSREG32(n->domain->arch.vpidr, VPIDR_EL2);
> > +    WRITE_SYSREG32(n->arch.vpidr, VPIDR_EL2);
> 
> Do we really need to store the vpidr in struct vcpu? It would be simpler and
> more efficient (no memory access) to use directly read MDIR_EL1 and copy it to
> VPIDR_EL1.

I followed your suggestion to drop vpidr from struct vcpu and just read
MDIR_EL1 in ctxt_switch_to. In do_cp14_32 I replaced v->arch.vpidr with
current_cpu_data.midr.bits for simplicity.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-02-20 20:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-19 21:58 [PATCH v2 0/6] unsafe big.LITTLE support Stefano Stabellini
2018-02-19 21:58 ` [PATCH v2 1/6] xen/arm: Park CPUs with a MIDR different from the boot CPU Stefano Stabellini
2018-02-19 21:58   ` [PATCH v2 2/6] xen/arm: make processor a per cpu variable Stefano Stabellini
2018-02-20 10:39     ` Julien Grall
2018-02-19 21:58   ` [PATCH v2 3/6] xen/arm: read ACTLR on the pcpu where the vcpu will run Stefano Stabellini
2018-02-20 10:56     ` Julien Grall
2018-02-19 21:58   ` [PATCH v2 4/6] xen/arm: make vpidr per vcpu Stefano Stabellini
2018-02-20 11:02     ` Julien Grall
2018-02-20 20:47       ` Stefano Stabellini [this message]
2018-02-19 21:58   ` [PATCH v2 5/6] xen/arm: read cacheline size when needed Stefano Stabellini
2018-02-20 11:33     ` Julien Grall
2018-02-20 21:03       ` Stefano Stabellini
2018-02-20 21:16         ` Julien Grall
2018-02-20 21:49           ` Julien Grall
2018-02-20 23:28             ` Stefano Stabellini
2018-02-21  7:58               ` Julien Grall
2018-02-19 21:58   ` [PATCH v2 6/6] xen/arm: update the docs about heterogeneous computing Stefano Stabellini
2018-02-20 11:38     ` Julien Grall
2018-02-20 16:40       ` Stefano Stabellini

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=alpine.DEB.2.10.1802201242190.19448@sstabellini-ThinkPad-X260 \
    --to=sstabellini@kernel.org \
    --cc=julien.grall@arm.com \
    --cc=xen-devel@lists.xen.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.