kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH] pmu_lbr: drop check for MSR_LBR_TOS != 0
@ 2024-10-02 23:56 Maxim Levitsky
  2024-11-03 21:06 ` Maxim Levitsky
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Maxim Levitsky @ 2024-10-02 23:56 UTC (permalink / raw)
  To: kvm; +Cc: Paolo Bonzini, 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 <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;
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [kvm-unit-tests PATCH] pmu_lbr: drop check for MSR_LBR_TOS != 0
  2024-10-02 23:56 [kvm-unit-tests PATCH] pmu_lbr: drop check for MSR_LBR_TOS != 0 Maxim Levitsky
@ 2024-11-03 21:06 ` Maxim Levitsky
  2024-11-22  1:33   ` Maxim Levitsky
  2025-02-19  0:06 ` Maxim Levitsky
  2025-02-24 17:23 ` Sean Christopherson
  2 siblings, 1 reply; 7+ messages in thread
From: Maxim Levitsky @ 2024-11-03 21:06 UTC (permalink / raw)
  To: kvm; +Cc: Paolo Bonzini

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [kvm-unit-tests PATCH] pmu_lbr: drop check for MSR_LBR_TOS != 0
  2024-11-03 21:06 ` Maxim Levitsky
@ 2024-11-22  1:33   ` Maxim Levitsky
  2024-12-14  0:18     ` Maxim Levitsky
  0 siblings, 1 reply; 7+ messages in thread
From: Maxim Levitsky @ 2024-11-22  1:33 UTC (permalink / raw)
  To: kvm; +Cc: Paolo Bonzini

On Sun, 2024-11-03 at 16:06 -0500, Maxim Levitsky wrote:
> A very kind ping on this patch.
> 
> 
> 
> Best regards,
> 
>         Maxim Levitsky

Another very kind ping on this patch.

Best regards,
        Maxim Levitsky


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [kvm-unit-tests PATCH] pmu_lbr: drop check for MSR_LBR_TOS != 0
  2024-11-22  1:33   ` Maxim Levitsky
@ 2024-12-14  0:18     ` Maxim Levitsky
  0 siblings, 0 replies; 7+ messages in thread
From: Maxim Levitsky @ 2024-12-14  0:18 UTC (permalink / raw)
  To: kvm; +Cc: Paolo Bonzini, Sean Christopherson

On Thu, 2024-11-21 at 20:33 -0500, Maxim Levitsky wrote:
> On Sun, 2024-11-03 at 16:06 -0500, Maxim Levitsky wrote:
> > A very kind ping on this patch.
> > 
> > 
> > 
> > Best regards,
> > 
> >         Maxim Levitsky
> 
> Another very kind ping on this patch.


Any update?

Best regards,
	Maxim Levitsky

> 
> Best regards,
>         Maxim Levitsky
> 



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [kvm-unit-tests PATCH] pmu_lbr: drop check for MSR_LBR_TOS != 0
  2024-10-02 23:56 [kvm-unit-tests PATCH] pmu_lbr: drop check for MSR_LBR_TOS != 0 Maxim Levitsky
  2024-11-03 21:06 ` Maxim Levitsky
@ 2025-02-19  0:06 ` Maxim Levitsky
  2025-02-19  0:45   ` Sean Christopherson
  2025-02-24 17:23 ` Sean Christopherson
  2 siblings, 1 reply; 7+ messages in thread
From: Maxim Levitsky @ 2025-02-19  0:06 UTC (permalink / raw)
  To: kvm; +Cc: Paolo Bonzini, Sean Christopherson

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;

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [kvm-unit-tests PATCH] pmu_lbr: drop check for MSR_LBR_TOS != 0
  2025-02-19  0:06 ` Maxim Levitsky
@ 2025-02-19  0:45   ` Sean Christopherson
  0 siblings, 0 replies; 7+ messages in thread
From: Sean Christopherson @ 2025-02-19  0:45 UTC (permalink / raw)
  To: Maxim Levitsky; +Cc: kvm, Paolo Bonzini

On Tue, Feb 18, 2025, Maxim Levitsky wrote:
> 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;
> 
> 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.

I'll grab it.  I'm hoping to get the pull request put together tomorrow, but I
might not get to it until Thusrday.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [kvm-unit-tests PATCH] pmu_lbr: drop check for MSR_LBR_TOS != 0
  2024-10-02 23:56 [kvm-unit-tests PATCH] pmu_lbr: drop check for MSR_LBR_TOS != 0 Maxim Levitsky
  2024-11-03 21:06 ` Maxim Levitsky
  2025-02-19  0:06 ` Maxim Levitsky
@ 2025-02-24 17:23 ` Sean Christopherson
  2 siblings, 0 replies; 7+ messages in thread
From: Sean Christopherson @ 2025-02-24 17:23 UTC (permalink / raw)
  To: Sean Christopherson, kvm, Maxim Levitsky; +Cc: Paolo Bonzini

On Wed, 02 Oct 2024 19:56:58 -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.
> 
> [...]

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

--
https://github.com/kvm-x86/kvm-unit-tests/tree/next

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-02-24 17:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-02 23:56 [kvm-unit-tests PATCH] pmu_lbr: drop check for MSR_LBR_TOS != 0 Maxim Levitsky
2024-11-03 21:06 ` Maxim Levitsky
2024-11-22  1:33   ` Maxim Levitsky
2024-12-14  0:18     ` Maxim Levitsky
2025-02-19  0:06 ` Maxim Levitsky
2025-02-19  0:45   ` Sean Christopherson
2025-02-24 17:23 ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).