[09/30] x86/microcode/intel: Remove debug code

Message ID 20230810160805.480445927@linutronix.de
State New
Headers
Series x86/microcode: Cleanup and late loading enhancements |

Commit Message

Thomas Gleixner Aug. 10, 2023, 6:37 p.m. UTC
  From: Thomas Gleixner <tglx@linutronix.de>

This is really of dubious value.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/x86/kernel/cpu/microcode/intel.c |   65 ----------------------------------
 1 file changed, 65 deletions(-)
---
  

Comments

Nikolay Borisov Aug. 11, 2023, 10:45 a.m. UTC | #1
On 10.08.23 г. 21:37 ч., Thomas Gleixner wrote:
> From: Thomas Gleixner <tglx@linutronix.de>
> 
> This is really of dubious value.
> 
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

If this patch is re-ordered with the previous one then the diff there 
will be smaller as there won't be any changes in show_saved_mc
  

Patch

--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -10,15 +10,7 @@ 
  * Copyright (C) 2012 Fenghua Yu <fenghua.yu@intel.com>
  *		      H Peter Anvin" <hpa@zytor.com>
  */
-
-/*
- * This needs to be before all headers so that pr_debug in printk.h doesn't turn
- * printk calls into no_printk().
- *
- *#define DEBUG
- */
 #define pr_fmt(fmt) "microcode: " fmt
-
 #include <linux/earlycpio.h>
 #include <linux/firmware.h>
 #include <linux/uaccess.h>
@@ -310,59 +302,6 @@  scan_microcode(void *data, size_t size,
 	return patch;
 }
 
-static void show_saved_mc(void)
-{
-#ifdef DEBUG
-	unsigned int sig, pf, rev, total_size, data_size, date;
-	struct extended_sigtable *ext_header;
-	struct extended_signature *ext_sig;
-	struct ucode_cpu_info uci;
-	int j, ext_sigcount;
-
-	if (!intel_ucode_patch) {
-		pr_debug("no microcode data saved.\n");
-		return;
-	}
-
-	intel_cpu_collect_info(&uci);
-
-	sig	= uci.cpu_sig.sig;
-	pf	= uci.cpu_sig.pf;
-	rev	= uci.cpu_sig.rev;
-	pr_debug("CPU: sig=0x%x, pf=0x%x, rev=0x%x\n", sig, pf, rev);
-
-	sig	= intel_ucode_patch->hdr.sig;
-	pf	= intel_ucode_patch->hdr.pf;
-	rev	= intel_ucode_patch->hdr.rev;
-	date	= intel_ucode_patch->hdr.date;
-
-	total_size	= get_totalsize(mc_saved_header);
-	data_size	= intel_microcode_get_datasize(mc_saved_header);
-
-	pr_debug("mc_saved: sig=0x%x, pf=0x%x, rev=0x%x, total size=0x%x, date = %04x-%02x-%02x\n",
-		 sig, pf, rev, total_size, date & 0xffff,
-		 date >> 24, (date >> 16) & 0xff);
-
-	/* Look for ext. headers: */
-	if (total_size <= data_size + MC_HEADER_SIZE)
-		return;
-
-	ext_header = (void *)intel_ucode_patch + data_size + MC_HEADER_SIZE;
-	ext_sigcount = ext_header->count;
-	ext_sig = (void *)ext_header + EXT_HEADER_SIZE;
-
-	for (j = 0; j < ext_sigcount; j++) {
-		sig = ext_sig->sig;
-		pf = ext_sig->pf;
-
-		pr_debug("\tExtended[%d]: sig=0x%x, pf=0x%x\n",
-			 j, sig, pf);
-
-		ext_sig++;
-	}
-#endif
-}
-
 /*
  * Save this microcode patch. It will be loaded early when a CPU is
  * hot-added or resumes.
@@ -375,7 +314,6 @@  static void save_mc_for_early(struct uco
 	mutex_lock(&x86_cpu_microcode_mutex);
 
 	save_microcode_patch(mc, size);
-	show_saved_mc();
 
 	mutex_unlock(&x86_cpu_microcode_mutex);
 }
@@ -526,9 +464,6 @@  int __init save_microcode_in_initrd_inte
 	intel_cpu_collect_info(&uci);
 
 	scan_microcode(cp.data, cp.size, &uci, true);
-
-	show_saved_mc();
-
 	return 0;
 }