diff mbox series

[kvm-unit-tests] pmu_lbr: drop check for MSR_LBR_TOS != 0

Message ID 20241002235658.215903-1-mlevitsk@redhat.com (mailing list archive)
State New, archived
Headers show
Series [kvm-unit-tests] pmu_lbr: drop check for MSR_LBR_TOS != 0 | expand

Commit Message

Maxim Levitsky Oct. 2, 2024, 11:56 p.m. UTC
While this is not likely, it is valid for the MSR_LBR_TOS
to contain 0 value, after a test which issues a series of branches, if the
number of branches recorded was divisible by the number of LBR msrs.

This unfortunately depends on the compiler, the number of LBR registers,
and it is not even deterministic between different runs of the test,
because interrupts, rescheduling, and various other events can affect total
number of branches done.

Therefore drop the check, instead of trying to fix it.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
---
 x86/pmu_lbr.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Maxim Levitsky Nov. 3, 2024, 9:06 p.m. UTC | #1
On Wed, 2024-10-02 at 19:56 -0400, Maxim Levitsky wrote:
> While this is not likely, it is valid for the MSR_LBR_TOS
> to contain 0 value, after a test which issues a series of branches, if the
> number of branches recorded was divisible by the number of LBR msrs.
> 
> This unfortunately depends on the compiler, the number of LBR registers,
> and it is not even deterministic between different runs of the test,
> because interrupts, rescheduling, and various other events can affect total
> number of branches done.
> 
> Therefore drop the check, instead of trying to fix it.
> 
> Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
> ---
>  x86/pmu_lbr.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/x86/pmu_lbr.c b/x86/pmu_lbr.c
> index c6f010847..8ca8ed044 100644
> --- a/x86/pmu_lbr.c
> +++ b/x86/pmu_lbr.c
> @@ -98,7 +98,6 @@ int main(int ac, char **av)
>  	lbr_test();
>  	wrmsr(MSR_IA32_DEBUGCTLMSR, 0);
>  
> -	report(rdmsr(MSR_LBR_TOS) != 0, "The guest LBR MSR_LBR_TOS value is good.");
>  	for (i = 0; i < max; ++i) {
>  		if (!rdmsr(lbr_to + i) || !rdmsr(lbr_from + i))
>  			break;

A very kind ping on this patch.

Best regards,
        Maxim Levitsky
diff mbox series

Patch

diff --git a/x86/pmu_lbr.c b/x86/pmu_lbr.c
index c6f010847..8ca8ed044 100644
--- a/x86/pmu_lbr.c
+++ b/x86/pmu_lbr.c
@@ -98,7 +98,6 @@  int main(int ac, char **av)
 	lbr_test();
 	wrmsr(MSR_IA32_DEBUGCTLMSR, 0);
 
-	report(rdmsr(MSR_LBR_TOS) != 0, "The guest LBR MSR_LBR_TOS value is good.");
 	for (i = 0; i < max; ++i) {
 		if (!rdmsr(lbr_to + i) || !rdmsr(lbr_from + i))
 			break;