]> git.proxmox.com Git - mirror_edk2.git/commit
UefiCpuPkg/RegisterCpuFeaturesLib: Adjust Order.
authorEric Dong <eric.dong@intel.com>
Fri, 9 Nov 2018 05:20:41 +0000 (13:20 +0800)
committerEric Dong <eric.dong@intel.com>
Sun, 11 Nov 2018 02:02:43 +0000 (10:02 +0800)
commitc1528b855c42b05886f90ad8c76c363b32ee7539
tree1911e3ae07defb72481bb3dd2de41f800300ff70
parent8cd4e734ccdfbc961c72aeaa8dbd3f5154171f9b
UefiCpuPkg/RegisterCpuFeaturesLib: Adjust Order.

V2 changes:
V1 change has regression which caused by change feature order.
V2 changes logic to detect dependence not only for the
neighborhood features. It need to check all features in the list.

V1 Changes:
In current code logic, only adjust feature position if current
CPU feature position not follow the request order. Just like
Feature A need to be executed before feature B, but current
feature A registers after feature B. So code will adjust the
position for feature A, move it to just before feature B. If
the position already met the requirement, code will not adjust
the position.

This logic has issue when met all below cases:
1. feature A has core or package level dependence with feature B.
2. feature A is register before feature B.
3. Also exist other features exist between feature A and B.

Root cause is driver ignores the dependence for this case, so
threads may execute not follow the dependence order.

Fix this issue by change code logic to adjust feature position
for CPU features which has dependence relationship.

Related BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1311

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeatures.h
UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c