x86/amd: skip OSVW function calls if !CONFIG_HVM
authorWei Liu <wei.liu2@citrix.com>
Fri, 17 Aug 2018 15:12:36 +0000 (16:12 +0100)
committerWei Liu <wei.liu2@citrix.com>
Tue, 21 Aug 2018 14:01:13 +0000 (15:01 +0100)
The two functions are not needed when HVM is not supported in
hypervisor.

Note that using hvm_enabled won't work because early_microcode_init
gets to cpu_request_microcode before hvm_enabled is set in presmp init
call stage.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/microcode_amd.c

index 53f9f548cd4ecab3b07fe50588d4131e941b627e..fba44ccba962252aa637c98b39e9650d671207d7 100644 (file)
@@ -550,7 +550,9 @@ static int cpu_request_microcode(unsigned int cpu, const void *buf,
         xfree(mc_old);
 
   out:
+#if CONFIG_HVM
     svm_host_osvw_init();
+#endif
 
     /*
      * In some cases we may return an error even if processor's microcode has
@@ -609,6 +611,7 @@ err1:
 
 static int start_update(void)
 {
+#if CONFIG_HVM
     /*
      * We assume here that svm_host_osvw_init() will be called on each cpu (from
      * cpu_request_microcode()).
@@ -619,6 +622,7 @@ static int start_update(void)
      * supporting OSVW so we will not deal with this possibility.
      */
     svm_host_osvw_reset();
+#endif
 
     return 0;
 }