mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
xen/arm: make processor a per cpu variable
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>
This commit is contained in:
1 parent
c8f62a0bb2
commit
f22f8bc41d
2 files changed
+6
-4
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||