On 7/7/21 7:54 PM, isaku.yamahata@xxxxxxxxx wrote:
From: Xiaoyao Li <xiaoyao.li@xxxxxxxxx> Reuse -cpu,tsc-frequency= to get user wanted tsc frequency and pass it to KVM_TDX_INIT_VM. Besides, sanity check the tsc frequency to be in the legal range and legal granularity (required by SEAM module). Signed-off-by: Xiaoyao Li <xiaoyao.li@xxxxxxxxx> Signed-off-by: Isaku Yamahata <isaku.yamahata@xxxxxxxxx> --- [..] + if (env->tsc_khz && (env->tsc_khz < TDX1_MIN_TSC_FREQUENCY_KHZ || + env->tsc_khz > TDX1_MAX_TSC_FREQUENCY_KHZ)) { + error_report("Invalid TSC %ld KHz, must specify cpu_frequecy between [%d, %d] kHz\n",
s/frequecy/frequency
+ env->tsc_khz, TDX1_MIN_TSC_FREQUENCY_KHZ, + TDX1_MAX_TSC_FREQUENCY_KHZ); + exit(1); + } + + if (env->tsc_khz % (25 * 1000)) { + error_report("Invalid TSC %ld KHz, it must be multiple of 25MHz\n", env->tsc_khz);
Should this be 25KHz instead of 25MHz?