Lines Matching refs:mc
51 static int find_matching_signature(void *mc, unsigned int csig, int cpf) in find_matching_signature() argument
53 struct microcode_header_intel *mc_hdr = mc; in find_matching_signature()
65 ext_hdr = mc + get_datasize(mc_hdr) + MC_HEADER_SIZE; in find_matching_signature()
79 static int has_newer_microcode(void *mc, unsigned int csig, int cpf, int new_rev) in has_newer_microcode() argument
81 struct microcode_header_intel *mc_hdr = mc; in has_newer_microcode()
86 return find_matching_signature(mc, csig, cpf); in has_newer_microcode()
166 static int microcode_sanity_check(void *mc, int print_err) in microcode_sanity_check() argument
169 struct microcode_header_intel *mc_header = mc; in microcode_sanity_check()
201 ext_header = mc + MC_HEADER_SIZE + data_size; in microcode_sanity_check()
235 orig_sum += ((u32 *)mc)[i]; in microcode_sanity_check()
398 static void save_mc_for_early(struct ucode_cpu_info *uci, u8 *mc, unsigned int size) in save_mc_for_early() argument
405 save_microcode_patch(uci, mc, size); in save_mc_for_early()
472 struct microcode_intel *mc; in print_ucode() local
476 mc = uci->mc; in print_ucode()
477 if (!mc) in print_ucode()
484 *current_mc_date_p = mc->hdr.date; in print_ucode()
490 struct microcode_intel *mc; in print_ucode() local
492 mc = uci->mc; in print_ucode()
493 if (!mc) in print_ucode()
496 print_ucode_info(uci, mc->hdr.date); in print_ucode()
502 struct microcode_intel *mc; in apply_microcode_early() local
505 mc = uci->mc; in apply_microcode_early()
506 if (!mc) in apply_microcode_early()
515 if (rev >= mc->hdr.rev) { in apply_microcode_early()
527 native_wrmsrl(MSR_IA32_UCODE_WRITE, (unsigned long)mc->bits); in apply_microcode_early()
530 if (rev != mc->hdr.rev) in apply_microcode_early()
538 print_ucode_info(uci, mc->hdr.date); in apply_microcode_early()
609 uci.mc = patch; in load_ucode_intel_bsp()
632 uci.mc = *iup; in load_ucode_intel_ap()
670 uci.mc = p; in reload_ucode_intel()
708 struct microcode_intel *mc; in apply_microcode_intel() local
718 mc = find_patch(uci); in apply_microcode_intel()
719 if (!mc) { in apply_microcode_intel()
720 mc = uci->mc; in apply_microcode_intel()
721 if (!mc) in apply_microcode_intel()
731 if (rev >= mc->hdr.rev) { in apply_microcode_intel()
743 wrmsrl(MSR_IA32_UCODE_WRITE, (unsigned long)mc->bits); in apply_microcode_intel()
747 if (rev != mc->hdr.rev) { in apply_microcode_intel()
749 cpu, mc->hdr.rev); in apply_microcode_intel()
756 mc->hdr.date & 0xffff, in apply_microcode_intel()
757 mc->hdr.date >> 24, in apply_microcode_intel()
758 (mc->hdr.date >> 16) & 0xff); in apply_microcode_intel()
781 u8 *new_mc = NULL, *mc = NULL; in generic_load_microcode() local
806 if (!mc || mc_size > curr_mc_size) { in generic_load_microcode()
807 vfree(mc); in generic_load_microcode()
808 mc = vmalloc(mc_size); in generic_load_microcode()
809 if (!mc) in generic_load_microcode()
814 memcpy(mc, &mc_header, sizeof(mc_header)); in generic_load_microcode()
815 data = mc + sizeof(mc_header); in generic_load_microcode()
817 microcode_sanity_check(mc, 1) < 0) { in generic_load_microcode()
823 if (has_newer_microcode(mc, csig, cpf, new_rev)) { in generic_load_microcode()
826 new_mc = mc; in generic_load_microcode()
828 mc = NULL; /* trigger new vmalloc */ in generic_load_microcode()
833 vfree(mc); in generic_load_microcode()
843 vfree(uci->mc); in generic_load_microcode()
844 uci->mc = (struct microcode_intel *)new_mc; in generic_load_microcode()