Usha P has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
soc/intel/skylake: Clean up report_cpu_info() function
This patch makes below clean up for report_cpu_info() function 1. Replace cpu_string with cpu_not_found 2. Assign default string "Platform info not available" to cpu_not_found string 3. Add array out of bound check while skiping leading white space in cpu brand string name
TEST=Able to build and boot soraka.
Change-Id: Idf7b04edc3fce147f7856591ce7e5a0cd05f43fe Signed-off-by: Usha P usha.p@intel.com --- M src/soc/intel/skylake/bootblock/report_platform.c 1 file changed, 5 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/36840/1
diff --git a/src/soc/intel/skylake/bootblock/report_platform.c b/src/soc/intel/skylake/bootblock/report_platform.c index 0bd65c3..6eec951 100644 --- a/src/soc/intel/skylake/bootblock/report_platform.c +++ b/src/soc/intel/skylake/bootblock/report_platform.c @@ -166,7 +166,8 @@ { struct cpuid_result cpuidr; u32 i, index, cpu_id, cpu_feature_flag; - char cpu_string[50], *cpu_name = cpu_string; /* 48 bytes are reported */ + const char cpu_not_found[] = "Platform info not available"; + const char *cpu_name = cpu_not_found; int vt, txt, aes; msr_t microcode_ver; static const char *const mode[] = {"NOT ", ""}; @@ -174,10 +175,8 @@
index = 0x80000000; cpuidr = cpuid(index); - if (cpuidr.eax < 0x80000004) { - strcpy(cpu_string, "Platform info not available"); - } else { - u32 *p = (u32 *) cpu_string; + if (cpuidr.eax >= 0x80000004) { + u32 *p = (u32 *) cpu_not_found; for (i = 2; i <= 4; i++) { cpuidr = cpuid(index + i); *p++ = cpuidr.eax; @@ -187,7 +186,7 @@ } } /* Skip leading spaces in CPU name string */ - while (cpu_name[0] == ' ') + while (cpu_name[0] == ' ' && strlen(cpu_name) > 0) cpu_name++;
microcode_ver.lo = 0;
Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
Patch Set 1: Code-Review+2
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
Patch Set 1: Code-Review-1
(1 comment)
https://review.coreboot.org/c/coreboot/+/36840/1/src/soc/intel/skylake/bootb... File src/soc/intel/skylake/bootblock/report_platform.c:
https://review.coreboot.org/c/coreboot/+/36840/1/src/soc/intel/skylake/bootb... PS1, Line 179: cpu_not_found this is a const char array.
Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
Patch Set 1: -Code-Review
valid point, this code need more clean up
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
Patch Set 1:
Reuse fill_processor_name() please. Also this code is in soc/intel/skylake. Is there any reason to be pedantic about cpuid 0x80000004 not being available which it has for at least 15y on Intel CPU's
Hello Patrick Rudolph, Subrata Banik, Arthur Heymans, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/36840
to look at the new patch set (#2).
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
soc/intel/skylake: Clean up report_cpu_info() function
This patch makes below clean up for report_cpu_info() function 1. Replace cpu_string with cpu_not_found 2. Assign default string "Platform info not available" to cpu_not_found string 3. Add array out of bound check while skiping leading white space in cpu brand string name
TEST=Able to build and boot soraka.
Change-Id: Idf7b04edc3fce147f7856591ce7e5a0cd05f43fe Signed-off-by: Usha P usha.p@intel.com --- M src/cpu/x86/name/Makefile.inc M src/soc/intel/skylake/bootblock/report_platform.c 2 files changed, 7 insertions(+), 20 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/36840/2
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
Patch Set 2: Code-Review-2
(2 comments)
out of bound array access...
https://review.coreboot.org/c/coreboot/+/36840/2/src/soc/intel/skylake/bootb... File src/soc/intel/skylake/bootblock/report_platform.c:
https://review.coreboot.org/c/coreboot/+/36840/2/src/soc/intel/skylake/bootb... PS2, Line 170: "Platform info not available" fill_processor_name always overwrites this.
https://review.coreboot.org/c/coreboot/+/36840/2/src/soc/intel/skylake/bootb... PS2, Line 177: fill_processor_name(cpu_name); You need to have at least a 49 (3 * 12 + 4 + 1) char array size.
Hello Patrick Rudolph, Subrata Banik, Arthur Heymans, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/36840
to look at the new patch set (#3).
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
soc/intel/skylake: Clean up report_cpu_info() function
This patch makes below clean up for report_cpu_info() function 1. Replace cpu_string with cpu_not_found 2. Assign default string "Platform info not available" to cpu_not_found string 3. Add array out of bound check while skiping leading white space in cpu brand string name
TEST=Able to build and boot soraka.
Change-Id: Idf7b04edc3fce147f7856591ce7e5a0cd05f43fe Signed-off-by: Usha P usha.p@intel.com --- M src/cpu/x86/name/Makefile.inc M src/soc/intel/skylake/bootblock/report_platform.c 2 files changed, 7 insertions(+), 20 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/36840/3
Usha P has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
Patch Set 3:
(3 comments)
https://review.coreboot.org/c/coreboot/+/36840/1/src/soc/intel/skylake/bootb... File src/soc/intel/skylake/bootblock/report_platform.c:
https://review.coreboot.org/c/coreboot/+/36840/1/src/soc/intel/skylake/bootb... PS1, Line 179: cpu_not_found
this is a const char array.
Done
https://review.coreboot.org/c/coreboot/+/36840/2/src/soc/intel/skylake/bootb... File src/soc/intel/skylake/bootblock/report_platform.c:
https://review.coreboot.org/c/coreboot/+/36840/2/src/soc/intel/skylake/bootb... PS2, Line 170: "Platform info not available"
fill_processor_name always overwrites this.
Done
https://review.coreboot.org/c/coreboot/+/36840/2/src/soc/intel/skylake/bootb... PS2, Line 177: fill_processor_name(cpu_name);
You need to have at least a 49 (3 * 12 + 4 + 1) char array size.
Done
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36840/2/src/soc/intel/skylake/bootb... File src/soc/intel/skylake/bootblock/report_platform.c:
https://review.coreboot.org/c/coreboot/+/36840/2/src/soc/intel/skylake/bootb... PS2, Line 170: "Platform info not available"
Done
No, not done?!
Usha P has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36840/2/src/soc/intel/skylake/bootb... File src/soc/intel/skylake/bootblock/report_platform.c:
https://review.coreboot.org/c/coreboot/+/36840/2/src/soc/intel/skylake/bootb... PS2, Line 170: "Platform info not available"
Done […]
I have tried to make the array cpu_not_found[50] in patch set 3
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36840/2/src/soc/intel/skylake/bootb... File src/soc/intel/skylake/bootblock/report_platform.c:
https://review.coreboot.org/c/coreboot/+/36840/2/src/soc/intel/skylake/bootb... PS2, Line 170: "Platform info not available"
I have tried to make the array cpu_not_found[50] in patch set 3
That's ok but this does not solve this particular comment.
Usha P has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36840/2/src/soc/intel/skylake/bootb... File src/soc/intel/skylake/bootblock/report_platform.c:
https://review.coreboot.org/c/coreboot/+/36840/2/src/soc/intel/skylake/bootb... PS2, Line 170: "Platform info not available"
I have tried to make the array cpu_not_found[50] in patch set 3 […]
Could you please suggest on how i can handle this.
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36840/2/src/soc/intel/skylake/bootb... File src/soc/intel/skylake/bootblock/report_platform.c:
https://review.coreboot.org/c/coreboot/+/36840/2/src/soc/intel/skylake/bootb... PS2, Line 170: "Platform info not available"
Could you please suggest on how i can handle this.
This is really just basic C programming... Don't create a separate char pointer cpu_name and don't initialize the array.
Hello Patrick Rudolph, Subrata Banik, Arthur Heymans, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/36840
to look at the new patch set (#4).
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
soc/intel/skylake: Clean up report_cpu_info() function
This patch makes below clean up for report_cpu_info() function 1. Replace cpu_string with cpu_not_found 2. Assign default string "Platform info not available" to cpu_not_found string 3. Add array out of bound check while skiping leading white space in cpu brand string name
TEST=Able to build and boot soraka.
Change-Id: Idf7b04edc3fce147f7856591ce7e5a0cd05f43fe Signed-off-by: Usha P usha.p@intel.com --- M src/cpu/x86/name/Makefile.inc M src/soc/intel/skylake/bootblock/report_platform.c 2 files changed, 6 insertions(+), 20 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/36840/4
Usha P has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36840/2/src/soc/intel/skylake/bootb... File src/soc/intel/skylake/bootblock/report_platform.c:
https://review.coreboot.org/c/coreboot/+/36840/2/src/soc/intel/skylake/bootb... PS2, Line 170: "Platform info not available"
Could you please suggest on how i can handle this. […]
Thankyou, Done.
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
Patch Set 4: -Code-Review
(2 comments)
https://review.coreboot.org/c/coreboot/+/36840/4/src/soc/intel/skylake/bootb... File src/soc/intel/skylake/bootblock/report_platform.c:
https://review.coreboot.org/c/coreboot/+/36840/4/src/soc/intel/skylake/bootb... PS4, Line 168: struct cpuid_result; unused?
https://review.coreboot.org/c/coreboot/+/36840/4/src/soc/intel/skylake/bootb... PS4, Line 170: 50 49 should be enough.
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
Patch Set 4:
(2 comments)
https://review.coreboot.org/c/coreboot/+/36840/4//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/36840/4//COMMIT_MSG@7 PS4, Line 7: soc/intel/skylake: Clean up report_cpu_info() function : : This patch makes below clean up for report_cpu_info() function : 1. Replace cpu_string with cpu_not_found : 2. Assign default string "Platform info not available" to cpu_not_found string : 3. Add array out of bound check while skiping leading white space in cpu brand : string name stale now?
https://review.coreboot.org/c/coreboot/+/36840/4//COMMIT_MSG@15 PS4, Line 15: TEST=Able to build and boot soraka. seems to needlessly clutter the commit message
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
Patch Set 4:
(3 comments)
Does the commit message match the actual diff?
https://review.coreboot.org/c/coreboot/+/36840/4//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/36840/4//COMMIT_MSG@9 PS4, Line 9: clean up clean-up
https://review.coreboot.org/c/coreboot/+/36840/4//COMMIT_MSG@14 PS4, Line 14: It could be three commits next time?
https://review.coreboot.org/c/coreboot/+/36840/4//COMMIT_MSG@15 PS4, Line 15: TEST=Able to build and boot soraka.
seems to needlessly clutter the commit message
Isn’t a successful boot is worth mentioning?
Hello Patrick Rudolph, Subrata Banik, Arthur Heymans, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/36840
to look at the new patch set (#5).
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
soc/intel/skylake: Clean up report_cpu_info() function
This patch makes below clean up for report_cpu_info() function 1. Replace cpu_string with cpu_not_found 2. Assign default string "Platform info not available" to cpu_not_found string 3. Add array out of bound check while skiping leading white space in cpu brand string name
TEST=Able to build and boot soraka.
Change-Id: Idf7b04edc3fce147f7856591ce7e5a0cd05f43fe Signed-off-by: Usha P usha.p@intel.com --- M src/cpu/x86/name/Makefile.inc M src/soc/intel/skylake/bootblock/report_platform.c 2 files changed, 5 insertions(+), 20 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/36840/5
Hello Patrick Rudolph, Subrata Banik, Arthur Heymans, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/36840
to look at the new patch set (#6).
Change subject: soc/intel/skylake: Clean-up report_cpu_info() function ......................................................................
soc/intel/skylake: Clean-up report_cpu_info() function
This patch makes below clean-up for report_cpu_info() function. 1. Remove unused variables. 2. Reuse fill_processor_name.
TEST= Succesfully able to boot soraka and verify the cpu_name "CPU: Intel(R) Pentium(R) CPU 4415Y @ 1.60GHz"
Change-Id: Idf7b04edc3fce147f7856591ce7e5a0cd05f43fe Signed-off-by: Usha P usha.p@intel.com --- M src/cpu/x86/name/Makefile.inc M src/soc/intel/skylake/bootblock/report_platform.c 2 files changed, 5 insertions(+), 20 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/36840/6
Usha P has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean-up report_cpu_info() function ......................................................................
Patch Set 6:
(6 comments)
https://review.coreboot.org/c/coreboot/+/36840/4//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/36840/4//COMMIT_MSG@9 PS4, Line 9: clean up
clean-up
Done
https://review.coreboot.org/c/coreboot/+/36840/4//COMMIT_MSG@7 PS4, Line 7: soc/intel/skylake: Clean up report_cpu_info() function : : This patch makes below clean up for report_cpu_info() function : 1. Replace cpu_string with cpu_not_found : 2. Assign default string "Platform info not available" to cpu_not_found string : 3. Add array out of bound check while skiping leading white space in cpu brand : string name
stale now?
Done
https://review.coreboot.org/c/coreboot/+/36840/4//COMMIT_MSG@14 PS4, Line 14:
It could be three commits next time?
Done
https://review.coreboot.org/c/coreboot/+/36840/4//COMMIT_MSG@15 PS4, Line 15: TEST=Able to build and boot soraka.
Isn’t a successful boot is worth mentioning?
Done
https://review.coreboot.org/c/coreboot/+/36840/4/src/soc/intel/skylake/bootb... File src/soc/intel/skylake/bootblock/report_platform.c:
https://review.coreboot.org/c/coreboot/+/36840/4/src/soc/intel/skylake/bootb... PS4, Line 168: struct cpuid_result;
unused?
Done
https://review.coreboot.org/c/coreboot/+/36840/4/src/soc/intel/skylake/bootb... PS4, Line 170: 50
49 should be enough.
Done
Usha P has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean-up report_cpu_info() function ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36840/2/src/soc/intel/skylake/bootb... File src/soc/intel/skylake/bootblock/report_platform.c:
https://review.coreboot.org/c/coreboot/+/36840/2/src/soc/intel/skylake/bootb... PS2, Line 170: "Platform info not available"
Thankyou, Done.
Done
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean-up report_cpu_info() function ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36840/6/src/cpu/x86/name/Makefile.i... File src/cpu/x86/name/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/36840/6/src/cpu/x86/name/Makefile.i... PS6, Line 14: bootblock-y += name.c This is not mentioned in the commit message. Why is this needed?
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean-up report_cpu_info() function ......................................................................
Patch Set 6: Code-Review+2
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean-up report_cpu_info() function ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36840/6//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/36840/6//COMMIT_MSG@7 PS6, Line 7: Clean-up The verb is spelled with a space: Clean up
Hello Patrick Rudolph, Subrata Banik, Arthur Heymans, build bot (Jenkins), Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/36840
to look at the new patch set (#7).
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
soc/intel/skylake: Clean up report_cpu_info() function
This patch makes below clean-up for report_cpu_info() function. 1. Remove unused variables. 2. Make fill_processor_name function available in bootblock. 3. Reuse fill_processor_name.
TEST= Succesfully able to boot soraka and verify the cpu_name "CPU: Intel(R) Pentium(R) CPU 4415Y @ 1.60GHz"
Change-Id: Idf7b04edc3fce147f7856591ce7e5a0cd05f43fe Signed-off-by: Usha P usha.p@intel.com --- M src/cpu/x86/name/Makefile.inc M src/soc/intel/skylake/bootblock/report_platform.c 2 files changed, 5 insertions(+), 20 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/36840/7
Usha P has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
Patch Set 7:
(2 comments)
https://review.coreboot.org/c/coreboot/+/36840/6//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/36840/6//COMMIT_MSG@7 PS6, Line 7: Clean-up
The verb is spelled with a space: Clean up
Done
https://review.coreboot.org/c/coreboot/+/36840/6/src/cpu/x86/name/Makefile.i... File src/cpu/x86/name/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/36840/6/src/cpu/x86/name/Makefile.i... PS6, Line 14: bootblock-y += name.c
This is not mentioned in the commit message. […]
This entry is required to make the fill_processor_name function available in bootblock. Updated the commit message to include this change.
Usha P has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
Patch Set 7:
(1 comment)
https://review.coreboot.org/c/coreboot/+/36840/6/src/cpu/x86/name/Makefile.i... File src/cpu/x86/name/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/36840/6/src/cpu/x86/name/Makefile.i... PS6, Line 14: bootblock-y += name.c
This entry is required to make the fill_processor_name function available in bootblock. […]
Done
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/36840 )
Change subject: soc/intel/skylake: Clean up report_cpu_info() function ......................................................................
soc/intel/skylake: Clean up report_cpu_info() function
This patch makes below clean-up for report_cpu_info() function. 1. Remove unused variables. 2. Make fill_processor_name function available in bootblock. 3. Reuse fill_processor_name.
TEST= Succesfully able to boot soraka and verify the cpu_name "CPU: Intel(R) Pentium(R) CPU 4415Y @ 1.60GHz"
Change-Id: Idf7b04edc3fce147f7856591ce7e5a0cd05f43fe Signed-off-by: Usha P usha.p@intel.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/36840 Reviewed-by: Arthur Heymans arthur@aheymans.xyz Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/cpu/x86/name/Makefile.inc M src/soc/intel/skylake/bootblock/report_platform.c 2 files changed, 5 insertions(+), 20 deletions(-)
Approvals: build bot (Jenkins): Verified Arthur Heymans: Looks good to me, approved
diff --git a/src/cpu/x86/name/Makefile.inc b/src/cpu/x86/name/Makefile.inc index a2e37e5..944c18f 100644 --- a/src/cpu/x86/name/Makefile.inc +++ b/src/cpu/x86/name/Makefile.inc @@ -11,4 +11,5 @@ ## GNU General Public License for more details. ##
+bootblock-y += name.c ramstage-y += name.c diff --git a/src/soc/intel/skylake/bootblock/report_platform.c b/src/soc/intel/skylake/bootblock/report_platform.c index 0bd65c3..b0b416e 100644 --- a/src/soc/intel/skylake/bootblock/report_platform.c +++ b/src/soc/intel/skylake/bootblock/report_platform.c @@ -18,6 +18,7 @@ #include <device/pci_ops.h> #include <console/console.h> #include <cpu/x86/msr.h> +#include <cpu/x86/name.h> #include <device/pci.h> #include <device/pci_ids.h> #include <intelblocks/mp_init.h> @@ -164,31 +165,14 @@
static void report_cpu_info(void) { - struct cpuid_result cpuidr; - u32 i, index, cpu_id, cpu_feature_flag; - char cpu_string[50], *cpu_name = cpu_string; /* 48 bytes are reported */ + u32 i, cpu_id, cpu_feature_flag; + char cpu_name[49]; int vt, txt, aes; msr_t microcode_ver; static const char *const mode[] = {"NOT ", ""}; const char *cpu_type = "Unknown";
- index = 0x80000000; - cpuidr = cpuid(index); - if (cpuidr.eax < 0x80000004) { - strcpy(cpu_string, "Platform info not available"); - } else { - u32 *p = (u32 *) cpu_string; - for (i = 2; i <= 4; i++) { - cpuidr = cpuid(index + i); - *p++ = cpuidr.eax; - *p++ = cpuidr.ebx; - *p++ = cpuidr.ecx; - *p++ = cpuidr.edx; - } - } - /* Skip leading spaces in CPU name string */ - while (cpu_name[0] == ' ') - cpu_name++; + fill_processor_name(cpu_name);
microcode_ver.lo = 0; microcode_ver.hi = 0;