Skip to contentSkip to conversation

x86,amd,microcode: fix hypercall return code

PATCH In review Christoph Egger 2 participants 3 messages Sep 22, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86,amd,microcode: fix hypercall return code

Hi,

Attached patch makes the hypercall return failure
if the microcode didn't apply.

Signature · 12 lines
AMD Saxony, Dresden, Germany
Operating System Research Center

Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
   Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
   AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
   Dr. Hans-R. Deppe, Thomas McCoy
xen/arch/x86/microcode_amd.c +1 -2
diff -r 2e8ad0c35792 xen/arch/x86/microcode_amd.c
@@ -338,8 +338,7 @@ static int cpu_request_microcode(int cpu
          */
         if ( error == 1 )
         {
-            apply_microcode(cpu);
-            error = 0;
+            error = apply_microcode(cpu);
         }
         xfree(mc);
     }

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 11 lines

From: Christoph Egger
Sent: 2008年9月22日 20:23

Hi,

Attached patch makes the hypercall return failure
if the microcode didn't apply.

It's weird that you don't add a 'break' if apply_microcode failed, unless you're sure next invocation to get_next_ucode_from_buffer _amd return 0... But even that, this is a bad coding style.

Thanks,
Kevin

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
Quoted 6 lines · Kevin
Quoted 6 lines

From: Christoph Egger
Sent: 2008年9月22日 20:23

Hi,

Quoted 8 lines
Quoted 4 lines

Attached patch makes the hypercall return failure
if the microcode didn't apply.

It's weird that you don't add a 'break' if apply_microcode failed, unless you're sure next invocation to get_next_ucode_from_buffer _amd return 0... But even that, this is a bad coding style.

Yes, it is. Note, I ported that code from Linux. I don't know if code from BSD would have been accepted due to license incompatibilities.

Christoph

Signature · 12 lines
AMD Saxony, Dresden, Germany
Operating System Research Center

Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
   Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
   AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
   Dr. Hans-R. Deppe, Thomas McCoy