x86: consolidate microcode loading code
authorJan Beulich <jbeulich@suse.com>
Thu, 1 Dec 2011 16:55:26 +0000 (17:55 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 1 Dec 2011 16:55:26 +0000 (17:55 +0100)
commit0bda96825f7f8fcb32a609b3d507e8f0a0adf8a2
tree7c2659998f0dd83ac266787b5b373be4769861f4
parent943730ecffa8807ebb5c47f01a686e021f3c0390
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>
xen/arch/x86/Makefile
xen/arch/x86/microcode.c
xen/arch/x86/microcode_amd.c
xen/arch/x86/microcode_intel.c
xen/include/asm-x86/microcode.h