Use a uint64_t to store the arm64 mpidr
Use a single uint64_t to hole the mpidr register as we can break the KBI on 14. Keep the macro so code can still be MFCd to 13. Sponsored by: Arm Ltd
This commit is contained in:
parent
c9a05c0722
commit
078a69abcb
@ -315,8 +315,7 @@ cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size)
|
|||||||
{
|
{
|
||||||
|
|
||||||
pcpu->pc_acpi_id = 0xffffffff;
|
pcpu->pc_acpi_id = 0xffffffff;
|
||||||
pcpu->pc_mpidr_low = 0xffffffff;
|
pcpu->pc_mpidr = UINT64_MAX;
|
||||||
pcpu->pc_mpidr_high = 0xffffffff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -558,8 +558,7 @@ start_cpu(u_int cpuid, uint64_t target_cpu, int domain, vm_paddr_t release_addr)
|
|||||||
M_WAITOK | M_ZERO);
|
M_WAITOK | M_ZERO);
|
||||||
pmap_disable_promotion((vm_offset_t)pcpup, size);
|
pmap_disable_promotion((vm_offset_t)pcpup, size);
|
||||||
pcpu_init(pcpup, cpuid, sizeof(struct pcpu));
|
pcpu_init(pcpup, cpuid, sizeof(struct pcpu));
|
||||||
pcpup->pc_mpidr_low = target_cpu & CPU_AFF_MASK;
|
pcpup->pc_mpidr = target_cpu & CPU_AFF_MASK;
|
||||||
pcpup->pc_mpidr_high = (target_cpu & CPU_AFF_MASK) >> 32;
|
|
||||||
|
|
||||||
dpcpu[cpuid - 1] = (void *)(pcpup + 1);
|
dpcpu[cpuid - 1] = (void *)(pcpup + 1);
|
||||||
dpcpu_init(dpcpu[cpuid - 1], cpuid);
|
dpcpu_init(dpcpu[cpuid - 1], cpuid);
|
||||||
@ -780,8 +779,7 @@ cpu_mp_start(void)
|
|||||||
/* CPU 0 is always boot CPU. */
|
/* CPU 0 is always boot CPU. */
|
||||||
CPU_SET(0, &all_cpus);
|
CPU_SET(0, &all_cpus);
|
||||||
mpidr = READ_SPECIALREG(mpidr_el1) & CPU_AFF_MASK;
|
mpidr = READ_SPECIALREG(mpidr_el1) & CPU_AFF_MASK;
|
||||||
cpuid_to_pcpu[0]->pc_mpidr_low = mpidr;
|
cpuid_to_pcpu[0]->pc_mpidr = mpidr;
|
||||||
cpuid_to_pcpu[0]->pc_mpidr_high = mpidr >> 32;
|
|
||||||
|
|
||||||
switch(arm64_bus_method) {
|
switch(arm64_bus_method) {
|
||||||
#ifdef DEV_ACPI
|
#ifdef DEV_ACPI
|
||||||
|
@ -47,10 +47,9 @@ struct debug_monitor_state;
|
|||||||
pcpu_ssbd pc_ssbd; \
|
pcpu_ssbd pc_ssbd; \
|
||||||
struct pmap *pc_curpmap; \
|
struct pmap *pc_curpmap; \
|
||||||
struct pmap *pc_curvmpmap; \
|
struct pmap *pc_curvmpmap; \
|
||||||
u_int pc_bcast_tlbi_workaround; \
|
|
||||||
/* Store as two u_int values to preserve KBI */ \
|
/* Store as two u_int values to preserve KBI */ \
|
||||||
u_int pc_mpidr_low; /* lower MPIDR 32 bits */ \
|
uint64_t pc_mpidr; \
|
||||||
u_int pc_mpidr_high; /* upper MPIDR 32 bits */ \
|
u_int pc_bcast_tlbi_workaround; \
|
||||||
char __pad[197]
|
char __pad[197]
|
||||||
|
|
||||||
#ifdef _KERNEL
|
#ifdef _KERNEL
|
||||||
@ -85,8 +84,7 @@ get_curthread(void)
|
|||||||
#define PCPU_PTR(member) (&pcpup->pc_ ## member)
|
#define PCPU_PTR(member) (&pcpup->pc_ ## member)
|
||||||
#define PCPU_SET(member,value) (pcpup->pc_ ## member = (value))
|
#define PCPU_SET(member,value) (pcpup->pc_ ## member = (value))
|
||||||
|
|
||||||
#define PCPU_GET_MPIDR(pc) \
|
#define PCPU_GET_MPIDR(pc) ((pc)->pc_mpidr)
|
||||||
((((uint64_t)((pc)->pc_mpidr_high)) << 32) | ((pc)->pc_mpidr_low))
|
|
||||||
|
|
||||||
#endif /* _KERNEL */
|
#endif /* _KERNEL */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user