aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/microcode_amd.c
Commit message (Collapse)AuthorAgeFilesLines
* x86/ucode: Improve error handling and container file processing on AMDBoris Ostrovsky2012-12-111-49/+53
| | | | | | | | | | | | | | | Do not report error when a patch is not appplicable to current processor, simply skip it and move on to next patch in container file. Process container file to the end instead of stopping at the first applicable patch. Log the fact that a patch has been applied at KERN_WARNING level, modify debug messages. Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com> Signed-off-by: Jan Beulich <jbeulich@suse.com> Committed-by: Jan Beulich <jbeulich@suse.com>
* printk: prefer %#x et at over 0x%xJan Beulich2012-09-211-3/+3
| | | | | | | | | Performance is not an issue with printk(), so let the function do minimally more work and instead save a byte per affected format specifier. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86/AMD: Add support for AMD's OSVW feature in guests.Boris Ostrovsky2012-02-071-7/+35
| | | | | | | | | | | | | | | | | | In some cases guests should not provide workarounds for errata even when the physical processor is affected. For example, because of erratum 400 on family 10h processors a Linux guest will read an MSR (resulting in VMEXIT) before going to idle in order to avoid getting stuck in a non-C0 state. This is not necessary: HLT and IO instructions are intercepted and therefore there is no reason for erratum 400 workaround in the guest. This patch allows us to present a guest with certain errata as fixed, regardless of the state of actual hardware. Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com> Acked-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Jan Beulich <jbeulich@suse.com>
* x86: properly define size_tJan Beulich2012-01-121-4/+4
| | | | | | | | | | | | | | Having it defined unilaterally as 'unsigned long' got me surprised recently when I tried to use the 'z' printk type modifier, as that is expected by the compiler to be used only on the type it knows size_t is supposed to have. Generally the compiler provides a construct to do this, so use it when available. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Christoph Egger <Christoph.Egger@amd.com>
* x86/ucode: fix for AMD Fam15 CPUsChristoph Egger2011-12-151-48/+95
| | | | | | | | | | | | Remove hardcoded maximum size a microcode patch can have. This is dynamic now. The microcode patch for family15h can be larger than 2048 bytes and gets silently truncated. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Jan Beulich <jbeulich@suse.com> Committed-by: Jan Beulich <jbeulich@suse.com>
* x86: consolidate microcode loading codeJan Beulich2011-12-011-52/+96
| | | | | | | | | | | | | | | | | | | | | | - 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>
* x86/amd-ucode: further turn down verbosityJan Beulich2011-11-111-6/+5
| | | | | | | Turn up the log level on various (mostly debug-only) messages. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86/ucode-amd: fix regression from c/s 23871:503ee256fecfJan Beulich2011-10-241-12/+3
| | | | | | | | | | | | | | | | | | | microcode_fits() must return distinct values for the success and no-fit-but-no-error cases, so the caller can react accordingly. Make it return 1 in the success case, and adjust its single caller. Also remove an impossible code path - install_equiv_cpu_table(), which gets called prior to microcode_fits(), never leaves equiv_cpu_table being NULL without also returning an error. Note that this is still awaiting testing on a system where the regression was actually observed (which also requires a new enough microcode_ctl package). Note also that this will need to be backported to 4.0 and 4.1 (or the broken c/s that got backported there reverted). Signed-off-by: Jan Beulich <jbeulich@novell.com> Committed-by: Keir Fraser <keir@xen.org>
* use xzalloc in x86 codeJan Beulich2011-10-041-1/+0
| | | | | | | This includes the removal of a redundant memset() from microcode_amd.c. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: ucode-amd: Don't warn when no ucode is available for a CPU revisionJan Beulich2011-09-221-5/+1
| | | | | | | | | | | | | | | | | | | | This patch originally comes from the Linus mainline kernel (2.6.33), find below the patch details: From: Andreas Herrmann <herrmann.der.user@googlemail.com> There is no point in warning when there is no ucode available for a specific CPU revision. Currently the container-file, which provides the AMD ucode patches for OS load, contains only a few ucode patches. It's already clearly indicated by the printed patch_level whenever new ucode was available and an update happened. So the warning message is of no help but rather annoying on systems with many CPUs. Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Jan Beulich <jbeulich@suse.com>
* xen: Remove some initialised but otherwise unused variables.Olaf Hering2011-05-201-3/+0
| | | | | | Fixes the build under gcc-4.6 -Werror=unused-but-set-variable Signed-off-by: Olaf Hering <olaf@aepfle.de>
* x86: use rdmsrl/wrmsrlKeir Fraser2010-06-241-4/+3
| | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* Miscellaneous data placement adjustmentsKeir Fraser2009-10-281-1/+1
| | | | | | | Make various data items const or __read_mostly where possible/reasonable. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* x86: move ucode_cpu_info into per-CPU spaceKeir Fraser2009-07-131-3/+3
| | | | Signed-off-by: Jan Beulich <jbeulich@novell.com>
* x86 ucode: add S3 microcode updateKeir Fraser2009-01-221-0/+6
| | | | | | | When wakeup from S3, use per cpu microcode image to update cpu microcode. Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
* x86 ucode: cancel redundant input parameter of microcode functionsKeir Fraser2009-01-221-5/+5
| | | | | | | Cancel redundant input parameter 'uci', since it can get from another input parameter 'cpu' as index. Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
* x86: update microcode supportKeir Fraser2009-01-201-134/+99
| | | | | | | | | | | | | | | | | - Container header file holding the patches changed. Update to new format. - in cpu_request_microcode() move heap re-allocation & copy out of the loop. Side-effect: Remove limitation in only supporting fixed sized microcode patches. Also simplifies code a lot. - cleanup: use rdmsr and wrmsrl instead of inlined assembler - pass ucode_cpu_info as arguments. Improves reentrancy. - cleanup: simplify struct ucode_cpu_info and remove get_matching_microcode hook. Side-effect: reduces kernel size. - bugfix: fix xen kernel memory leak in error path. equiv_cpu_table was not freed. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* x86,amd,microcode: fix hypercall return codeKeir Fraser2008-09-221-4/+1
| | | | | | Make the hypercall return failure if the microcode didn't apply. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* x86, microcode: More code cleanups.Keir Fraser2008-09-161-21/+13
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86, microcode: Clean up for Xen coding style, and disable for nowKeir Fraser2008-09-161-274/+288
| | | | | | (until allocations in irq context are fixed). Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: Fix 32-bit build after AMD microcode update patch.Keir Fraser2008-09-151-5/+4
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: microcode update support for AMD CPUsKeir Fraser2008-09-121-0/+366
Microcode update support for AMD CPUs Family10h and Family11h. It is based on a patch for Linux which is on its way for 2.6.28. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>