|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v1 01/28] x86/hvm: move SVM feature printout to a separate function
From: Denis Mukhin <dmukhin@xxxxxxxx>
Isolate long SVM feature list printout in a separate function to
improve readability.
Not a functional change.
Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>
---
xen/arch/x86/hvm/svm/svm.c | 49 +++++++++++++++++++++-----------------
1 file changed, 27 insertions(+), 22 deletions(-)
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 666bcd3eb483..e11d5c55248d 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -2434,33 +2434,12 @@ static struct hvm_function_table __initdata_cf_clobber
svm_function_table = {
},
};
-const struct hvm_function_table * __init start_svm(void)
+static void __init print_svm_features(void)
{
bool printed = false;
- svm_host_osvw_reset();
-
- if ( _svm_cpu_up(true) )
- {
- setup_clear_cpu_cap(X86_FEATURE_SVM);
- printk("SVM: failed to initialise.\n");
- return NULL;
- }
-
- setup_vmcb_dump();
-
- if ( boot_cpu_data.extended_cpuid_level >= 0x8000000aU )
- svm_feature_flags = cpuid_edx(0x8000000aU);
-
printk("SVM: Supported advanced features:\n");
- /* DecodeAssists fast paths assume nextrip is valid for fast rIP update. */
- if ( !cpu_has_svm_nrips )
- __clear_bit(SVM_FEATURE_DECODEASSISTS, &svm_feature_flags);
-
- if ( cpu_has_tsc_ratio )
- svm_function_table.tsc_scaling.ratio_frac_bits = 32;
-
#define P(p,s) if ( p ) { printk(" - %s\n", s); printed = 1; }
P(cpu_has_svm_npt, "Nested Page Tables (NPT)");
P(cpu_has_svm_lbrv, "Last Branch Record (LBR) Virtualisation");
@@ -2481,11 +2460,37 @@ const struct hvm_function_table * __init start_svm(void)
if ( !printed )
printk(" - none\n");
+}
+
+const struct hvm_function_table * __init start_svm(void)
+{
+ svm_host_osvw_reset();
+
+ if ( _svm_cpu_up(true) )
+ {
+ setup_clear_cpu_cap(X86_FEATURE_SVM);
+ printk("SVM: failed to initialise.\n");
+ return NULL;
+ }
+
+ setup_vmcb_dump();
+
+ if ( boot_cpu_data.extended_cpuid_level >= 0x8000000aU )
+ svm_feature_flags = cpuid_edx(0x8000000aU);
+
+ /* DecodeAssists fast paths assume nextrip is valid for fast rIP update. */
+ if ( !cpu_has_svm_nrips )
+ __clear_bit(SVM_FEATURE_DECODEASSISTS, &svm_feature_flags);
+
+ if ( cpu_has_tsc_ratio )
+ svm_function_table.tsc_scaling.ratio_frac_bits = 32;
svm_function_table.caps.hap = cpu_has_svm_npt;
svm_function_table.caps.hap_superpage_2mb = true;
svm_function_table.caps.hap_superpage_1gb = cpu_has_page1gb;
+ print_svm_features();
+
return &svm_function_table;
}
--
2.55.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |