Loading arch/x86/kernel/microcode.c +12 −12 Original line number Original line Diff line number Diff line Loading @@ -102,17 +102,17 @@ MODULE_LICENSE("GPL"); #define MICROCODE_VERSION "1.14a" #define MICROCODE_VERSION "1.14a" #define DEFAULT_UCODE_DATASIZE (2000) /* 2000 bytes */ #define DEFAULT_UCODE_DATASIZE (2000) /* 2000 bytes */ #define MC_HEADER_SIZE (sizeof (microcode_header_t)) /* 48 bytes */ #define MC_HEADER_SIZE (sizeof (struct microcode_header)) /* 48 bytes */ #define DEFAULT_UCODE_TOTALSIZE (DEFAULT_UCODE_DATASIZE + MC_HEADER_SIZE) /* 2048 bytes */ #define DEFAULT_UCODE_TOTALSIZE (DEFAULT_UCODE_DATASIZE + MC_HEADER_SIZE) /* 2048 bytes */ #define EXT_HEADER_SIZE (sizeof (struct extended_sigtable)) /* 20 bytes */ #define EXT_HEADER_SIZE (sizeof (struct extended_sigtable)) /* 20 bytes */ #define EXT_SIGNATURE_SIZE (sizeof (struct extended_signature)) /* 12 bytes */ #define EXT_SIGNATURE_SIZE (sizeof (struct extended_signature)) /* 12 bytes */ #define DWSIZE (sizeof (u32)) #define DWSIZE (sizeof (u32)) #define get_totalsize(mc) \ #define get_totalsize(mc) \ (((microcode_t *)mc)->hdr.totalsize ? \ (((struct microcode *)mc)->hdr.totalsize ? \ ((microcode_t *)mc)->hdr.totalsize : DEFAULT_UCODE_TOTALSIZE) ((struct microcode *)mc)->hdr.totalsize : DEFAULT_UCODE_TOTALSIZE) #define get_datasize(mc) \ #define get_datasize(mc) \ (((microcode_t *)mc)->hdr.datasize ? \ (((struct microcode *)mc)->hdr.datasize ? \ ((microcode_t *)mc)->hdr.datasize : DEFAULT_UCODE_DATASIZE) ((struct microcode *)mc)->hdr.datasize : DEFAULT_UCODE_DATASIZE) #define sigmatch(s1, s2, p1, p2) \ #define sigmatch(s1, s2, p1, p2) \ (((s1) == (s2)) && (((p1) & (p2)) || (((p1) == 0) && ((p2) == 0)))) (((s1) == (s2)) && (((p1) & (p2)) || (((p1) == 0) && ((p2) == 0)))) Loading @@ -130,7 +130,7 @@ static struct ucode_cpu_info { unsigned int sig; unsigned int sig; unsigned int pf; unsigned int pf; unsigned int rev; unsigned int rev; microcode_t *mc; struct microcode *mc; } ucode_cpu_info[NR_CPUS]; } ucode_cpu_info[NR_CPUS]; static void collect_cpu_info(int cpu_num) static void collect_cpu_info(int cpu_num) Loading Loading @@ -171,7 +171,7 @@ static void collect_cpu_info(int cpu_num) } } static inline int microcode_update_match(int cpu_num, static inline int microcode_update_match(int cpu_num, microcode_header_t *mc_header, int sig, int pf) struct microcode_header *mc_header, int sig, int pf) { { struct ucode_cpu_info *uci = ucode_cpu_info + cpu_num; struct ucode_cpu_info *uci = ucode_cpu_info + cpu_num; Loading @@ -183,7 +183,7 @@ static inline int microcode_update_match(int cpu_num, static int microcode_sanity_check(void *mc) static int microcode_sanity_check(void *mc) { { microcode_header_t *mc_header = mc; struct microcode_header *mc_header = mc; struct extended_sigtable *ext_header = NULL; struct extended_sigtable *ext_header = NULL; struct extended_signature *ext_sig; struct extended_signature *ext_sig; unsigned long total_size, data_size, ext_table_size; unsigned long total_size, data_size, ext_table_size; Loading Loading @@ -268,7 +268,7 @@ static int microcode_sanity_check(void *mc) static int get_maching_microcode(void *mc, int cpu) static int get_maching_microcode(void *mc, int cpu) { { struct ucode_cpu_info *uci = ucode_cpu_info + cpu; struct ucode_cpu_info *uci = ucode_cpu_info + cpu; microcode_header_t *mc_header = mc; struct microcode_header *mc_header = mc; struct extended_sigtable *ext_header; struct extended_sigtable *ext_header; unsigned long total_size = get_totalsize(mc_header); unsigned long total_size = get_totalsize(mc_header); int ext_sigcount, i; int ext_sigcount, i; Loading Loading @@ -355,7 +355,7 @@ static unsigned int user_buffer_size; /* it's size */ static long get_next_ucode(void **mc, long offset) static long get_next_ucode(void **mc, long offset) { { microcode_header_t mc_header; struct microcode_header mc_header; unsigned long total_size; unsigned long total_size; /* No more data */ /* No more data */ Loading Loading @@ -497,13 +497,13 @@ MODULE_ALIAS_MISCDEV(MICROCODE_MINOR); static long get_next_ucode_from_buffer(void **mc, const u8 *buf, static long get_next_ucode_from_buffer(void **mc, const u8 *buf, unsigned long size, long offset) unsigned long size, long offset) { { microcode_header_t *mc_header; struct microcode_header *mc_header; unsigned long total_size; unsigned long total_size; /* No more data */ /* No more data */ if (offset >= size) if (offset >= size) return 0; return 0; mc_header = (microcode_header_t *)(buf + offset); mc_header = (struct microcode_header *)(buf + offset); total_size = get_totalsize(mc_header); total_size = get_totalsize(mc_header); if (offset + total_size > size) { if (offset + total_size > size) { Loading include/asm-x86/microcode.h +0 −3 Original line number Original line Diff line number Diff line Loading @@ -16,9 +16,6 @@ struct microcode { unsigned int bits[0]; unsigned int bits[0]; }; }; typedef struct microcode microcode_t; typedef struct microcode_header microcode_header_t; /* microcode format is extended from prescott processors */ /* microcode format is extended from prescott processors */ struct extended_signature { struct extended_signature { unsigned int sig; unsigned int sig; Loading Loading
arch/x86/kernel/microcode.c +12 −12 Original line number Original line Diff line number Diff line Loading @@ -102,17 +102,17 @@ MODULE_LICENSE("GPL"); #define MICROCODE_VERSION "1.14a" #define MICROCODE_VERSION "1.14a" #define DEFAULT_UCODE_DATASIZE (2000) /* 2000 bytes */ #define DEFAULT_UCODE_DATASIZE (2000) /* 2000 bytes */ #define MC_HEADER_SIZE (sizeof (microcode_header_t)) /* 48 bytes */ #define MC_HEADER_SIZE (sizeof (struct microcode_header)) /* 48 bytes */ #define DEFAULT_UCODE_TOTALSIZE (DEFAULT_UCODE_DATASIZE + MC_HEADER_SIZE) /* 2048 bytes */ #define DEFAULT_UCODE_TOTALSIZE (DEFAULT_UCODE_DATASIZE + MC_HEADER_SIZE) /* 2048 bytes */ #define EXT_HEADER_SIZE (sizeof (struct extended_sigtable)) /* 20 bytes */ #define EXT_HEADER_SIZE (sizeof (struct extended_sigtable)) /* 20 bytes */ #define EXT_SIGNATURE_SIZE (sizeof (struct extended_signature)) /* 12 bytes */ #define EXT_SIGNATURE_SIZE (sizeof (struct extended_signature)) /* 12 bytes */ #define DWSIZE (sizeof (u32)) #define DWSIZE (sizeof (u32)) #define get_totalsize(mc) \ #define get_totalsize(mc) \ (((microcode_t *)mc)->hdr.totalsize ? \ (((struct microcode *)mc)->hdr.totalsize ? \ ((microcode_t *)mc)->hdr.totalsize : DEFAULT_UCODE_TOTALSIZE) ((struct microcode *)mc)->hdr.totalsize : DEFAULT_UCODE_TOTALSIZE) #define get_datasize(mc) \ #define get_datasize(mc) \ (((microcode_t *)mc)->hdr.datasize ? \ (((struct microcode *)mc)->hdr.datasize ? \ ((microcode_t *)mc)->hdr.datasize : DEFAULT_UCODE_DATASIZE) ((struct microcode *)mc)->hdr.datasize : DEFAULT_UCODE_DATASIZE) #define sigmatch(s1, s2, p1, p2) \ #define sigmatch(s1, s2, p1, p2) \ (((s1) == (s2)) && (((p1) & (p2)) || (((p1) == 0) && ((p2) == 0)))) (((s1) == (s2)) && (((p1) & (p2)) || (((p1) == 0) && ((p2) == 0)))) Loading @@ -130,7 +130,7 @@ static struct ucode_cpu_info { unsigned int sig; unsigned int sig; unsigned int pf; unsigned int pf; unsigned int rev; unsigned int rev; microcode_t *mc; struct microcode *mc; } ucode_cpu_info[NR_CPUS]; } ucode_cpu_info[NR_CPUS]; static void collect_cpu_info(int cpu_num) static void collect_cpu_info(int cpu_num) Loading Loading @@ -171,7 +171,7 @@ static void collect_cpu_info(int cpu_num) } } static inline int microcode_update_match(int cpu_num, static inline int microcode_update_match(int cpu_num, microcode_header_t *mc_header, int sig, int pf) struct microcode_header *mc_header, int sig, int pf) { { struct ucode_cpu_info *uci = ucode_cpu_info + cpu_num; struct ucode_cpu_info *uci = ucode_cpu_info + cpu_num; Loading @@ -183,7 +183,7 @@ static inline int microcode_update_match(int cpu_num, static int microcode_sanity_check(void *mc) static int microcode_sanity_check(void *mc) { { microcode_header_t *mc_header = mc; struct microcode_header *mc_header = mc; struct extended_sigtable *ext_header = NULL; struct extended_sigtable *ext_header = NULL; struct extended_signature *ext_sig; struct extended_signature *ext_sig; unsigned long total_size, data_size, ext_table_size; unsigned long total_size, data_size, ext_table_size; Loading Loading @@ -268,7 +268,7 @@ static int microcode_sanity_check(void *mc) static int get_maching_microcode(void *mc, int cpu) static int get_maching_microcode(void *mc, int cpu) { { struct ucode_cpu_info *uci = ucode_cpu_info + cpu; struct ucode_cpu_info *uci = ucode_cpu_info + cpu; microcode_header_t *mc_header = mc; struct microcode_header *mc_header = mc; struct extended_sigtable *ext_header; struct extended_sigtable *ext_header; unsigned long total_size = get_totalsize(mc_header); unsigned long total_size = get_totalsize(mc_header); int ext_sigcount, i; int ext_sigcount, i; Loading Loading @@ -355,7 +355,7 @@ static unsigned int user_buffer_size; /* it's size */ static long get_next_ucode(void **mc, long offset) static long get_next_ucode(void **mc, long offset) { { microcode_header_t mc_header; struct microcode_header mc_header; unsigned long total_size; unsigned long total_size; /* No more data */ /* No more data */ Loading Loading @@ -497,13 +497,13 @@ MODULE_ALIAS_MISCDEV(MICROCODE_MINOR); static long get_next_ucode_from_buffer(void **mc, const u8 *buf, static long get_next_ucode_from_buffer(void **mc, const u8 *buf, unsigned long size, long offset) unsigned long size, long offset) { { microcode_header_t *mc_header; struct microcode_header *mc_header; unsigned long total_size; unsigned long total_size; /* No more data */ /* No more data */ if (offset >= size) if (offset >= size) return 0; return 0; mc_header = (microcode_header_t *)(buf + offset); mc_header = (struct microcode_header *)(buf + offset); total_size = get_totalsize(mc_header); total_size = get_totalsize(mc_header); if (offset + total_size > size) { if (offset + total_size > size) { Loading
include/asm-x86/microcode.h +0 −3 Original line number Original line Diff line number Diff line Loading @@ -16,9 +16,6 @@ struct microcode { unsigned int bits[0]; unsigned int bits[0]; }; }; typedef struct microcode microcode_t; typedef struct microcode_header microcode_header_t; /* microcode format is extended from prescott processors */ /* microcode format is extended from prescott processors */ struct extended_signature { struct extended_signature { unsigned int sig; unsigned int sig; Loading