Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35140 )
Change subject: [WIP] arch/x86: Refactor CAR_GLOBAL quirk for FSP1.0 ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35140/2/src/cpu/x86/car.c File src/cpu/x86/car.c:
https://review.coreboot.org/c/coreboot/+/35140/2/src/cpu/x86/car.c@97 PS2, Line 97: uintptr_t *mig_var = car_get_var_ptr(var);
Could you add some comments here?
Yes, if patchset #2 actually works with FSP1.0...
We're getting the migrated pointer and subtracting the value at this new slot?
My logic here is that since FSP1.0 migrates the entire _car_region (implicitly), absolute pointers to CAR region become stale, but pointers to CAR that are relative to a CAR_GLOBAL remain valid.
So this code: mig_var = car_get_var_ptr(&bar.baz) /* A' */ if (*mig_var) /* *mig_var = B */ return A' - B;
But value in *mig_var = (A - B) == -sizeof(struct foo).