diff options
author | Jan Beulich <jbeulich@suse.com> | 2011-12-01 17:55:26 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2011-12-01 17:55:26 +0100 |
commit | 0bda96825f7f8fcb32a609b3d507e8f0a0adf8a2 (patch) | |
tree | 7c2659998f0dd83ac266787b5b373be4769861f4 /xen/include/asm-x86/microcode.h | |
parent | 943730ecffa8807ebb5c47f01a686e021f3c0390 (diff) | |
download | xen-0bda96825f7f8fcb32a609b3d507e8f0a0adf8a2.tar.gz xen-0bda96825f7f8fcb32a609b3d507e8f0a0adf8a2.tar.bz2 xen-0bda96825f7f8fcb32a609b3d507e8f0a0adf8a2.zip |
x86: consolidate microcode loading code
- memory was leaked on a CPU offline/online cycle (including S3)
- memory was leaked on AMD systems when microcode_update() ran a 2nd
time with the same data that was used on the first run
- microcode never got restored on APs during S3 resume (or post-boot
onlining of a CPU that was also online when microcode_update() first
ran [in the event the prior microcode update got lost intermediately,
which supposedly shouldn't happen]); this will still be the case when
no other online CPU has an identical signature (which however is now
consistent with bringing up such a CPU the very first time)
- resume was unimplemented in the AMD case
- there was a race between microcode_update_cpu() and
microcode_resume_cpu()
This also moves vendor specific type declarations to the vendor source
file and sets the stage for boot time microcode loading (i.e. without
Dom0 involvement).
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/include/asm-x86/microcode.h')
-rw-r--r-- | xen/include/asm-x86/microcode.h | 64 |
1 files changed, 1 insertions, 63 deletions
diff --git a/xen/include/asm-x86/microcode.h b/xen/include/asm-x86/microcode.h index f4a9481473..cb71661187 100644 --- a/xen/include/asm-x86/microcode.h +++ b/xen/include/asm-x86/microcode.h @@ -7,74 +7,12 @@ struct cpu_signature; struct ucode_cpu_info; struct microcode_ops { - int (*microcode_resume_match)(int cpu, struct cpu_signature *nsig); + int (*microcode_resume_match)(int cpu, const void *mc); int (*cpu_request_microcode)(int cpu, const void *buf, size_t size); int (*collect_cpu_info)(int cpu, struct cpu_signature *csig); int (*apply_microcode)(int cpu); }; -struct microcode_header_intel { - unsigned int hdrver; - unsigned int rev; - unsigned int date; - unsigned int sig; - unsigned int cksum; - unsigned int ldrver; - unsigned int pf; - unsigned int datasize; - unsigned int totalsize; - unsigned int reserved[3]; -}; - -struct microcode_intel { - struct microcode_header_intel hdr; - unsigned int bits[0]; -}; - -/* microcode format is extended from prescott processors */ -struct extended_signature { - unsigned int sig; - unsigned int pf; - unsigned int cksum; -}; - -struct extended_sigtable { - unsigned int count; - unsigned int cksum; - unsigned int reserved[3]; - struct extended_signature sigs[0]; -}; - -struct equiv_cpu_entry { - uint32_t installed_cpu; - uint32_t fixed_errata_mask; - uint32_t fixed_errata_compare; - uint16_t equiv_cpu; - uint16_t reserved; -} __attribute__((packed)); - -struct microcode_header_amd { - uint32_t data_code; - uint32_t patch_id; - uint8_t mc_patch_data_id[2]; - uint8_t mc_patch_data_len; - uint8_t init_flag; - uint32_t mc_patch_data_checksum; - uint32_t nb_dev_id; - uint32_t sb_dev_id; - uint16_t processor_rev_id; - uint8_t nb_rev_id; - uint8_t sb_rev_id; - uint8_t bios_api_rev; - uint8_t reserved1[3]; - uint32_t match_reg[8]; -} __attribute__((packed)); - -struct microcode_amd { - struct microcode_header_amd hdr; - unsigned int mpb[0]; -}; - struct cpu_signature { unsigned int sig; unsigned int pf; |