aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/microcode_intel.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-01-20 13:27:08 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-01-20 13:27:08 +0000
commit10de212aa9a4f9623f47a48c06805164f236cca4 (patch)
treec1f40054a5be2ddd9f6586e582007b6c98ce7f29 /xen/arch/x86/microcode_intel.c
parent93d98953f7249efe10ddcb71888fc14cdbdbf30a (diff)
downloadxen-10de212aa9a4f9623f47a48c06805164f236cca4.tar.gz
xen-10de212aa9a4f9623f47a48c06805164f236cca4.tar.bz2
xen-10de212aa9a4f9623f47a48c06805164f236cca4.zip
x86: update microcode support
- 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>
Diffstat (limited to 'xen/arch/x86/microcode_intel.c')
-rw-r--r--xen/arch/x86/microcode_intel.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/xen/arch/x86/microcode_intel.c b/xen/arch/x86/microcode_intel.c
index 92cc62bccb..1d9e51b89a 100644
--- a/xen/arch/x86/microcode_intel.c
+++ b/xen/arch/x86/microcode_intel.c
@@ -244,12 +244,11 @@ static int get_matching_microcode(void *mc, int cpu)
return 1;
}
-static int apply_microcode(int cpu)
+static int apply_microcode(struct ucode_cpu_info *uci, int cpu)
{
unsigned long flags;
unsigned int val[2];
int cpu_num = raw_smp_processor_id();
- struct ucode_cpu_info *uci = ucode_cpu_info + cpu_num;
/* We should bind the task to the CPU */
BUG_ON(cpu_num != cpu);
@@ -318,7 +317,8 @@ static long get_next_ucode_from_buffer(void **mc, const u8 *buf,
return offset + total_size;
}
-static int cpu_request_microcode(int cpu, const void *buf, size_t size)
+static int cpu_request_microcode(struct ucode_cpu_info *uci,
+ int cpu, const void *buf, size_t size)
{
long offset = 0;
int error = 0;
@@ -341,7 +341,7 @@ static int cpu_request_microcode(int cpu, const void *buf, size_t size)
*/
if ( error == 1 )
{
- apply_microcode(cpu);
+ apply_microcode(uci, cpu);
error = 0;
}
xfree(mc);
@@ -355,7 +355,6 @@ static int cpu_request_microcode(int cpu, const void *buf, size_t size)
}
static struct microcode_ops microcode_intel_ops = {
- .get_matching_microcode = get_matching_microcode,
.cpu_request_microcode = cpu_request_microcode,
.collect_cpu_info = collect_cpu_info,
.apply_microcode = apply_microcode,