From: Stefano Stabellini <sstabellini@kernel.org>
To: julien.grall@arm.com
Cc: sstabellini@kernel.org, xen-devel@lists.xen.org
Subject: [PATCH v4 3/7] xen/arm: make processor a per cpu variable
Date: Fri, 2 Mar 2018 11:06:04 -0800 [thread overview]
Message-ID: <1520017568-24427-3-git-send-email-sstabellini@kernel.org> (raw)
In-Reply-To: <1520017568-24427-1-git-send-email-sstabellini@kernel.org>
There can be processors of different kinds on a single system. Make
processor a per_cpu variable pointing to the right processor type for
each core.
Suggested-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Julien Grall <julien.grall@arm.com>
---
Changes in v2:
- add patch
---
xen/arch/arm/processor.c | 8 ++++----
xen/arch/arm/smpboot.c | 2 ++
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/xen/arch/arm/processor.c b/xen/arch/arm/processor.c
index 8c425ce..ce43850 100644
--- a/xen/arch/arm/processor.c
+++ b/xen/arch/arm/processor.c
@@ -18,7 +18,7 @@
*/
#include <asm/procinfo.h>
-static const struct processor *processor = NULL;
+static DEFINE_PER_CPU(struct processor *, processor);
void __init processor_setup(void)
{
@@ -28,15 +28,15 @@ void __init processor_setup(void)
if ( !procinfo )
return;
- processor = procinfo->processor;
+ this_cpu(processor) = procinfo->processor;
}
void processor_vcpu_initialise(struct vcpu *v)
{
- if ( !processor || !processor->vcpu_initialise )
+ if ( !this_cpu(processor) || !this_cpu(processor)->vcpu_initialise )
return;
- processor->vcpu_initialise(v);
+ this_cpu(processor)->vcpu_initialise(v);
}
/*
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 7ea4e41..122c0b5 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -32,6 +32,7 @@
#include <xen/console.h>
#include <asm/cpuerrata.h>
#include <asm/gic.h>
+#include <asm/procinfo.h>
#include <asm/psci.h>
#include <asm/acpi.h>
@@ -300,6 +301,7 @@ void start_secondary(unsigned long boot_phys_offset,
set_processor_id(cpuid);
identify_cpu(¤t_cpu_data);
+ processor_setup();
init_traps();
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-03-02 19:06 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-02 19:05 [PATCH v4 0/7] unsafe big.LITTLE support Stefano Stabellini
2018-03-02 19:06 ` [PATCH v4 1/7] xen/arm: Read the dcache line size from CTR register Stefano Stabellini
2018-03-02 19:06 ` [PATCH v4 2/7] xen/arm: Park CPUs with a MIDR different from the boot CPU Stefano Stabellini
2018-03-02 19:06 ` Stefano Stabellini [this message]
2018-03-02 19:06 ` [PATCH v4 4/7] xen/arm: read ACTLR on the pcpu where the vcpu will run Stefano Stabellini
2018-03-02 19:06 ` [PATCH v4 5/7] xen/arm: set VPIDR based on the MIDR value of the underlying pCPU Stefano Stabellini
2018-03-02 19:06 ` [PATCH v4 6/7] xen/arm: update the docs about heterogeneous computing Stefano Stabellini
2018-03-02 19:06 ` [PATCH v4 7/7] xen/arm: disable CPUs with different dcache line sizes Stefano Stabellini
2018-03-06 10:59 ` Julien Grall
2018-03-06 19:41 ` Stefano Stabellini
2018-03-06 10:46 ` [PATCH v4 1/7] xen/arm: Read the dcache line size from CTR register Julien Grall
2018-03-08 6:15 ` [PATCH v4 0/7] unsafe big.LITTLE support Peng Fan
2018-03-08 11:03 ` Julien Grall
2018-03-08 12:23 ` Peng Fan
2018-03-08 12:30 ` Julien Grall
2018-03-08 12:43 ` Peng Fan
2018-03-08 15:13 ` Julien Grall
2018-03-09 9:05 ` Peng Fan
2018-03-09 10:22 ` Julien Grall
2018-03-09 13:30 ` Peng Fan
2018-03-09 14:40 ` Julien Grall
2018-03-10 1:09 ` Stefano Stabellini
2018-03-12 2:57 ` Peng Fan
2018-03-12 11:02 ` Julien Grall
2018-03-12 2:32 ` Peng Fan
2018-03-12 10:34 ` 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=1520017568-24427-3-git-send-email-sstabellini@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).