Attention is currently required from: Arthur Heymans.
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/69435 )
Change subject: cpu/x86: Set thread local storage in C code ......................................................................
Patch Set 5: Code-Review+1
(5 comments)
Commit Message:
https://review.coreboot.org/c/coreboot/+/69435/comment/6625c3c3_07d3e467 PS5, Line 11: overflow Be nice if we could enable paging :)
File src/arch/x86/cpu.c:
https://review.coreboot.org/c/coreboot/+/69435/comment/4212286b_4aa4938a PS5, Line 346: cpu_info Can you make this a `struct per_cpu_segment_data` so we keep using the same thing as `cpu_info()`.
File src/cpu/x86/mp_init.c:
https://review.coreboot.org/c/coreboot/+/69435/comment/61af0bc8_28c7bdde PS5, Line 181: struct cpu_info *info = cpu_info(); So the reason that cpu_info was setup very early on was that `printk` calls `spin_lock` which calls `thread_coop_disable`. `thread_coop_disable used to call `cpu_info`, so if the cpu_info wasn't setup early on then we would be reading an invalid value and bad things would happen. With https://review.coreboot.org/c/coreboot/+/58199 we dropped the requirement on cpu_info and switched over to using `boot_cpu()` which doesn't require any initial setup. So moving it into C code I think is a great idea.
https://review.coreboot.org/c/coreboot/+/69435/comment/6ec5611f_1f70a9bb PS5, Line 179: static void asmlinkage ap_init(unsigned int index)
storage class 'asmlinkage' should be located before type 'void'
Please fix.
File src/cpu/x86/sipi_vector.S:
https://review.coreboot.org/c/coreboot/+/69435/comment/01f5f70c_f1f71ede PS5, Line 93: /* Obtain CPU number. */ : movl ap_count, %ecx : inc %ecx : lock cmpxchg %ecx, ap_count : jnz 1b I wonder if we could just use the APIC ID instead of racing to get an AP number.