[PATCH 01/13] mtrr: Don't show an invalid CPU number

Simon Glass sjg at chromium.org
Mon Feb 20 20:49:15 CET 2023


When U-Boot did not do the MP init, we don't get an actual CPU number
here. Skip printing it in that case.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 cmd/x86/mtrr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cmd/x86/mtrr.c b/cmd/x86/mtrr.c
index b213a942fde..95916933e9a 100644
--- a/cmd/x86/mtrr.c
+++ b/cmd/x86/mtrr.c
@@ -145,7 +145,8 @@ static int do_mtrr(struct cmd_tbl *cmdtp, int flag, int argc,
 		for (; i >= 0; i = mp_next_cpu(cpu_select, i)) {
 			if (!first)
 				printf("\n");
-			printf("CPU %d:\n", i);
+			if (i < MP_SELECT_ALL)
+				printf("CPU %d:\n", i);
 			ret = do_mtrr_list(reg_count, i);
 			if (ret) {
 				printf("Failed to read CPU %d (err=%d)\n", i,
-- 
2.39.2.637.g21b0678d19-goog



More information about the U-Boot mailing list