Skip to content

Commit d44450c

Browse files
KAGA-KOKObp3tk0v
authored andcommitted
x86/microcode/intel: Remove debug code
This is really of dubious value. Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d02a0ef commit d44450c

File tree

1 file changed

+0
-75
lines changed
  • arch/x86/kernel/cpu/microcode

1 file changed

+0
-75
lines changed

arch/x86/kernel/cpu/microcode/intel.c

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,7 @@
1010
* Copyright (C) 2012 Fenghua Yu <[email protected]>
1111
* H Peter Anvin" <[email protected]>
1212
*/
13-
14-
/*
15-
* This needs to be before all headers so that pr_debug in printk.h doesn't turn
16-
* printk calls into no_printk().
17-
*
18-
*#define DEBUG
19-
*/
2013
#define pr_fmt(fmt) "microcode: " fmt
21-
2214
#include <linux/earlycpio.h>
2315
#include <linux/firmware.h>
2416
#include <linux/uaccess.h>
@@ -405,69 +397,6 @@ scan_microcode(void *data, size_t size, struct ucode_cpu_info *uci, bool save)
405397
return patch;
406398
}
407399

408-
static void show_saved_mc(void)
409-
{
410-
#ifdef DEBUG
411-
int i = 0, j;
412-
unsigned int sig, pf, rev, total_size, data_size, date;
413-
struct ucode_cpu_info uci;
414-
struct ucode_patch *p;
415-
416-
if (list_empty(&microcode_cache)) {
417-
pr_debug("no microcode data saved.\n");
418-
return;
419-
}
420-
421-
intel_cpu_collect_info(&uci);
422-
423-
sig = uci.cpu_sig.sig;
424-
pf = uci.cpu_sig.pf;
425-
rev = uci.cpu_sig.rev;
426-
pr_debug("CPU: sig=0x%x, pf=0x%x, rev=0x%x\n", sig, pf, rev);
427-
428-
list_for_each_entry(p, &microcode_cache, plist) {
429-
struct microcode_header_intel *mc_saved_header;
430-
struct extended_sigtable *ext_header;
431-
struct extended_signature *ext_sig;
432-
int ext_sigcount;
433-
434-
mc_saved_header = (struct microcode_header_intel *)p->data;
435-
436-
sig = mc_saved_header->sig;
437-
pf = mc_saved_header->pf;
438-
rev = mc_saved_header->rev;
439-
date = mc_saved_header->date;
440-
441-
total_size = get_totalsize(mc_saved_header);
442-
data_size = intel_microcode_get_datasize(mc_saved_header);
443-
444-
pr_debug("mc_saved[%d]: sig=0x%x, pf=0x%x, rev=0x%x, total size=0x%x, date = %04x-%02x-%02x\n",
445-
i++, sig, pf, rev, total_size,
446-
date & 0xffff,
447-
date >> 24,
448-
(date >> 16) & 0xff);
449-
450-
/* Look for ext. headers: */
451-
if (total_size <= data_size + MC_HEADER_SIZE)
452-
continue;
453-
454-
ext_header = (void *)mc_saved_header + data_size + MC_HEADER_SIZE;
455-
ext_sigcount = ext_header->count;
456-
ext_sig = (void *)ext_header + EXT_HEADER_SIZE;
457-
458-
for (j = 0; j < ext_sigcount; j++) {
459-
sig = ext_sig->sig;
460-
pf = ext_sig->pf;
461-
462-
pr_debug("\tExtended[%d]: sig=0x%x, pf=0x%x\n",
463-
j, sig, pf);
464-
465-
ext_sig++;
466-
}
467-
}
468-
#endif
469-
}
470-
471400
/*
472401
* Save this microcode patch. It will be loaded early when a CPU is
473402
* hot-added or resumes.
@@ -480,7 +409,6 @@ static void save_mc_for_early(struct ucode_cpu_info *uci, u8 *mc, unsigned int s
480409
mutex_lock(&x86_cpu_microcode_mutex);
481410

482411
save_microcode_patch(uci, mc, size);
483-
show_saved_mc();
484412

485413
mutex_unlock(&x86_cpu_microcode_mutex);
486414
}
@@ -631,9 +559,6 @@ int __init save_microcode_in_initrd_intel(void)
631559
intel_cpu_collect_info(&uci);
632560

633561
scan_microcode(cp.data, cp.size, &uci, true);
634-
635-
show_saved_mc();
636-
637562
return 0;
638563
}
639564

0 commit comments

Comments
 (0)