Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\microcode\intel.c Create Date:2022-07-28 08:08:40
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:generic_load_microcode

Proto:static enum ucode_state generic_load_microcode(int cpu, struct iov_iter *iter)

Type:enum ucode_state

Parameter:

TypeParameterName
intcpu
struct iov_iter *iter
864  uci = ucode_cpu_info + cpu
865  curr_mc_size = 0 , new_mc_size = 0
866  ret = UCODE_OK
867  new_rev = rev
868  u8 * new_mc = NULL, * mc = NULL
871  When iov_iter_count(iter) cycle
876  If Not copy_from_iter_full( & mc_header, size of mc_header , iter) Then
877  pr_err("error! Truncated or inaccessible header in microcode data file\n")
878  Break
881  mc_size = get_totalsize( & mc_header)
882  If mc_size < size of mc_header Then
883  pr_err("error! Bad data in microcode data file (totalsize too small)\n")
884  Break
886  data_size = mc_size - size of mc_header
887  If data_size > iov_iter_count(iter) Then
888  pr_err("error! Bad data in microcode data file (truncated file?)\n")
889  Break
893  If Not mc || mc_size > curr_mc_size Then
894  vfree(mc)
895  mc = vmalloc(mc_size)
896  If Not mc Then Break
901  memcpy(mc, & mc_header, size of mc_header )
902  data = mc + size of mc_header
905  Break
908  csig = sig
909  cpf = pf
911  vfree(new_mc)
912  new_rev = rev
913  new_mc = mc
915  mc = NULL
916  ret = UCODE_NEW
920  vfree(mc)
922  If iov_iter_count(iter) Then
923  vfree(new_mc)
924  Return UCODE_ERROR
927  If Not new_mc Then Return UCODE_NFOUND
930  vfree(mc)
931  mc = new_mc
938  Save this microcode patch. It will be loaded early when a CPU is* hot-added or resumes.
940  pr_debug("CPU%d found a matching microcode update with version 0x%x (current=0x%x)\n", cpu, new_rev, rev)
943  Return ret
Caller
NameDescribe
request_microcode_fw
request_microcode_user