]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
plat/common/arm: Init `TPIDR_EL1` in `lcpu_arch_init`
authorSergiu Moga <sergiu@unikraft.io>
Thu, 23 Nov 2023 12:55:19 +0000 (14:55 +0200)
committerSergiu Moga <sergiu@unikraft.io>
Fri, 24 Nov 2023 17:16:10 +0000 (19:16 +0200)
Every LCPU shall have their `TPIDR_EL1` system register assigned
the value of the address of their own `struct lcpu` element in the
global `lcpus` array.

Co-authored-by: Michalis Pappas <michalis@unikraft.io>
Signed-off-by: Michalis Pappas <michalis@unikraft.io>
Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
plat/common/arm/lcpu.c

index 2d4021bd1a10967e494b117179d2b9b33ee8192c..037b1c1eeddee2bb20cd4285fe6a03873a80ed3c 100644 (file)
@@ -90,6 +90,8 @@ int lcpu_arch_init(struct lcpu *this_lcpu)
                        return ret;
        }
 
+       SYSREG_WRITE64(tpidr_el1, (__uptr)this_lcpu);
+
        return ret;
 }