[LTP] [PATCH] kvm_pagefault01: Do not write into tdp_mmu sysfile

Petr Vorel pvorel@suse.cz
Tue May 28 00:35:51 CEST 2024


Hi Martin,

> The tdp_mmu sysfile was made read-only in kernel v6.3. Do not modify
> it but only reload vendor KVM modules if needed. Some kernel versions
> before v6.3 have writable tdp_mmu sysfile which appears to be
> independent from vendor KVM module settings. Print a warning about
> false negatives if tdp_mmu appears enabled after reloading KVM
> modules. It is unclear if that state may impact bug reproducibility.

Good catch.

...
>  static void disable_tdp(void)
>  {
> -	if (!access(TDP_MMU_SYSFILE, F_OK)) {
> -		/* FIXME: Is setting tdp_mmu=0 sufficient to disable TDP? */
> -		return;
> -	}
> -
>  	if (read_bool_sys_param(TDP_AMD_SYSFILE) > 0)
>  		reload_module("kvm_amd", "npt=0");

>  	if (read_bool_sys_param(TDP_INTEL_SYSFILE) > 0)
>  		reload_module("kvm_intel", "ept=0");
> +
> +	if (read_bool_sys_param(TDP_MMU_SYSFILE) > 0)
> +		tst_res(TINFO, "tdp_mmu is enabled, beware of false negatives");

Wouldn't it be better to add "WARNING:" to make it more visible?
		tst_res(TINFO, "WARNING: tdp_mmu is enabled, beware of false negatives");

(if you agree, I can change it before merge)

Kind regards,
Petr


More information about the ltp mailing list