@@ -1451,6 +1451,9 @@ const struct hvm_function_table * __init start_svm(void)
if ( !cpu_has_svm_nrips )
clear_bit(SVM_FEATURE_DECODEASSISTS, &svm_feature_flags);
+ if ( cpu_has_tsc_ratio )
+ svm_function_table.tsc_scaling_supported = 1;
+
#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");
@@ -2272,6 +2275,10 @@ static struct hvm_function_table __initdata svm_function_table = {
.nhvm_hap_walk_L1_p2m = nsvm_hap_walk_L1_p2m,
.scale_tsc = svm_scale_tsc,
+
+ .default_tsc_scaling_ratio = DEFAULT_TSC_RATIO,
+ .max_tsc_scaling_ratio = ~TSC_RATIO_RSVD_BITS,
+ .tsc_scaling_ratio_frac_bits = 32,
};
void svm_vmexit_handler(struct cpu_user_regs *regs)
@@ -100,6 +100,18 @@ struct hvm_function_table {
unsigned int hap_capabilities;
/*
+ * Parameters of hardware-assisted TSC scaling.
+ */
+ /* is TSC scaling supported? */
+ bool_t tsc_scaling_supported;
+ /* number of bits of the fractional part of TSC scaling ratio */
+ uint8_t tsc_scaling_ratio_frac_bits;
+ /* default TSC scaling ratio (no scaling) */
+ uint64_t default_tsc_scaling_ratio;
+ /* maximum-allowed TSC scaling ratio */
+ uint64_t max_tsc_scaling_ratio;
+
+ /*
* Initialise/destroy HVM domain/vcpu resources
*/
int (*domain_initialise)(struct domain *d);