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

[Xen-changelog] [xen-unstable] x86/microcode: Allow "ucode=" argument to be negative



# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1323766033 -3600
# Node ID 77528dbced3ea74901be6b1aeddedda22bfdaf63
# Parent  868d82faf6511de3b3edce18cc6a9e1c938f0b8f
x86/microcode: Allow "ucode=" argument to be negative

... to indicate counting from the end of the modules list.

Suggested by Tim Deegan.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 868d82faf651 -r 77528dbced3e xen/arch/x86/microcode.c
--- a/xen/arch/x86/microcode.c  Tue Dec 13 09:45:11 2011 +0100
+++ b/xen/arch/x86/microcode.c  Tue Dec 13 09:47:13 2011 +0100
@@ -41,7 +41,7 @@
 
 static module_t __initdata ucode_mod;
 static void *(*__initdata ucode_mod_map)(const module_t *);
-static unsigned int __initdata ucode_mod_idx;
+static signed int __initdata ucode_mod_idx;
 static bool_t __initdata ucode_mod_forced;
 static cpumask_t __initdata init_mask;
 
@@ -54,7 +54,7 @@
 static void __init parse_ucode(char *s)
 {
     if ( !ucode_mod_forced )
-        ucode_mod_idx = simple_strtoul(s, NULL, 0);
+        ucode_mod_idx = simple_strtol(s, NULL, 0);
 }
 custom_param("ucode", parse_ucode);
 
@@ -65,7 +65,9 @@
 {
     module_t *mod = (module_t *)__va(mbi->mods_addr);
 
-    if ( !ucode_mod_idx || ucode_mod_idx >= mbi->mods_count ||
+    if ( ucode_mod_idx < 0 )
+        ucode_mod_idx += mbi->mods_count;
+    if ( ucode_mod_idx <= 0 || ucode_mod_idx >= mbi->mods_count ||
          !__test_and_clear_bit(ucode_mod_idx, module_map) )
         return;
     ucode_mod = mod[ucode_mod_idx];

_______________________________________________
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®.