pmu_lbr: drop check for MSR_LBR_TOS != 0
PATCH 1/1 pmu_lbr: drop check for MSR_LBR_TOS != 0
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.
--- x86/pmu_lbr.c | 1 - 1 file changed, 1 deletion(-)
x86/pmu_lbr.c +0 -1
@@ -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 ;
Signature · 1 line
2.26.3
Quoted 21 lines · Maxim Levitsky
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 <[email protected]>--- x86/pmu_lbr.c | 1 - 1 file changed, 1 deletion(-)x86/pmu_lbr.c +0
-0
x86/pmu_lbr.c int main(int ac, char **av) · line 103
Quoted 7 lines
x86/pmu_lbr.c +0
-1@@ -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
Quoted 7 lines · Maxim Levitsky
A very kind ping on this patch.
Best regards,
Maxim Levitsky
Another very kind ping on this patch.
Best regards,
Maxim Levitsky
Quoted 10 lines · Maxim Levitsky
Quoted 7 lines · Maxim Levitsky
A very kind ping on this patch.
Best regards,
Maxim Levitsky
Another very kind ping on this patch.
Any update?
Best regards,
Maxim Levitsky
Quoted 4 lines
Best regards,
Maxim Levitsky
Quoted 21 lines · Maxim Levitsky
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 <[email protected]>--- x86/pmu_lbr.c | 1 - 1 file changed, 1 deletion(-)x86/pmu_lbr.c +0
-0
x86/pmu_lbr.c int main(int ac, char **av) · line 103
Quoted 7 lines
x86/pmu_lbr.c +0
-1@@ -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 ;
Hi,
This is the other kvm-unit-tests patch that I have a ticket open for, and I would like to get this merged and close the ticket.
Thanks,
Best regards,
Maxim Levitsky
Sean Christopherson
reviewerQuoted 32 lines · Maxim Levitsky
Quoted 21 lines · Maxim Levitsky
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 <[email protected]>--- x86/pmu_lbr.c | 1 - 1 file changed, 1 deletion(-)x86/pmu_lbr.c +0
-0x86/pmu_lbr.c int main(int ac, char **av) · line 103
Quoted 7 lines
x86/pmu_lbr.c +0
-1@@ -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 ;Hi,
Quoted 2 lines
This is the other kvm-unit-tests patch that I have a ticket open for, and I would like to get this merged and close the ticket.
I'll grab it. I'm hoping to get the pull request put together tomorrow, but I might not get to it until Thusrday.
Quoted 10 lines · Maxim Levitsky
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.
[...]
Applied to kvm-x86 next (and now pulled by Paolo), thanks!
[1/1] pmu_lbr: drop check for MSR_LBR_TOS != 0
https://github.com/kvm-x86/kvm-unit-tests/commit/584a927eaf58