[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86 ucode: optimizing microcode update



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1232622699 0
# Node ID adc3775bb6d8aa1070b8aaaa186a2a98898f9478
# Parent  a1d0868ffadf171ce9f4c61f4dc57f4d4abe4e4c
x86 ucode: optimizing microcode update

It's possible the data file has multiple matching ucode, we needn't to
update multiple times, just keep searching the latest version, and
update once.

Signed-off-by: Liu, Jinsong <jinsong.liu@xxxxxxxxx>
---
 xen/arch/x86/microcode_intel.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)

diff -r a1d0868ffadf -r adc3775bb6d8 xen/arch/x86/microcode_intel.c
--- a/xen/arch/x86/microcode_intel.c    Thu Jan 22 11:11:10 2009 +0000
+++ b/xen/arch/x86/microcode_intel.c    Thu Jan 22 11:11:39 2009 +0000
@@ -325,6 +325,7 @@ static int cpu_request_microcode(int cpu
     long offset = 0;
     int error = 0;
     void *mc;
+    unsigned int matching_count = 0;
 
     /* We should bind the task to the CPU */
     BUG_ON(cpu != raw_smp_processor_id());
@@ -343,7 +344,7 @@ static int cpu_request_microcode(int cpu
          */
         if ( error == 1 )
         {
-            apply_microcode(cpu);
+            matching_count++;
             error = 0;
         }
         xfree(mc);
@@ -352,6 +353,9 @@ static int cpu_request_microcode(int cpu
         xfree(mc);
     if ( offset < 0 )
         error = offset;
+
+    if ( !error && matching_count )
+        apply_microcode(cpu);
 
     return error;
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.