diff mbox series

[kvm-unit-tests,v9,03/31] powerpc: Mark known failing tests as kfail

Message ID 20240504122841.1177683-4-npiggin@gmail.com (mailing list archive)
State New
Headers show
Series powerpc improvements | expand

Commit Message

Nicholas Piggin May 4, 2024, 12:28 p.m. UTC
Mark the failing h_cede_tm and spapr_vpa tests as kfail.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 powerpc/spapr_vpa.c | 3 ++-
 powerpc/tm.c        | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Thomas Huth May 6, 2024, 7:37 a.m. UTC | #1
On 04/05/2024 14.28, Nicholas Piggin wrote:
> Mark the failing h_cede_tm and spapr_vpa tests as kfail.
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
>   powerpc/spapr_vpa.c | 3 ++-
>   powerpc/tm.c        | 3 ++-
>   2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/powerpc/spapr_vpa.c b/powerpc/spapr_vpa.c
> index c2075e157..46fa0485c 100644
> --- a/powerpc/spapr_vpa.c
> +++ b/powerpc/spapr_vpa.c
> @@ -150,7 +150,8 @@ static void test_vpa(void)
>   		report_fail("Could not deregister after registration");
>   
>   	disp_count1 = be32_to_cpu(vpa->vp_dispatch_count);
> -	report(disp_count1 % 2 == 1, "Dispatch count is odd after deregister");
> +	/* TCG known fail, could be wrong test, must verify against PowerVM */
> +	report_kfail(true, disp_count1 % 2 == 1, "Dispatch count is odd after deregister");

Using "true" as first argument looks rather pointless - then you could also 
simply delete the test completely if it can never be tested reliably.

Thus could you please introduce a helper function is_tcg() that could be 
used to check whether we run under TCG (and not KVM)? I think you could 
check for "linux,kvm" in the "compatible" property in /hypervisor in the 
device tree to see whether we're running in KVM mode or in TCG mode.

>   	report_prefix_pop();
>   }
> diff --git a/powerpc/tm.c b/powerpc/tm.c
> index 6b1ceeb6e..d9e7f455d 100644
> --- a/powerpc/tm.c
> +++ b/powerpc/tm.c
> @@ -133,7 +133,8 @@ int main(int argc, char **argv)
>   		report_skip("TM is not available");
>   		goto done;
>   	}
> -	report(cpus_with_tm == nr_cpus,
> +	/* KVM does not report TM in secondary threads in POWER9 */
> +	report_kfail(true, cpus_with_tm == nr_cpus,
>   	       "TM available in all 'ibm,pa-features' properties");

Could you check the PVR for POWER9 here instead of using "true" as first 
parameter?

  Thomas
Nicholas Piggin May 7, 2024, 4:07 a.m. UTC | #2
On Mon May 6, 2024 at 5:37 PM AEST, Thomas Huth wrote:
> On 04/05/2024 14.28, Nicholas Piggin wrote:
> > Mark the failing h_cede_tm and spapr_vpa tests as kfail.
> > 
> > Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> > ---
> >   powerpc/spapr_vpa.c | 3 ++-
> >   powerpc/tm.c        | 3 ++-
> >   2 files changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/powerpc/spapr_vpa.c b/powerpc/spapr_vpa.c
> > index c2075e157..46fa0485c 100644
> > --- a/powerpc/spapr_vpa.c
> > +++ b/powerpc/spapr_vpa.c
> > @@ -150,7 +150,8 @@ static void test_vpa(void)
> >   		report_fail("Could not deregister after registration");
> >   
> >   	disp_count1 = be32_to_cpu(vpa->vp_dispatch_count);
> > -	report(disp_count1 % 2 == 1, "Dispatch count is odd after deregister");
> > +	/* TCG known fail, could be wrong test, must verify against PowerVM */
> > +	report_kfail(true, disp_count1 % 2 == 1, "Dispatch count is odd after deregister");
>
> Using "true" as first argument looks rather pointless - then you could also 
> simply delete the test completely if it can never be tested reliably.
>
> Thus could you please introduce a helper function is_tcg() that could be 
> used to check whether we run under TCG (and not KVM)? I think you could 
> check for "linux,kvm" in the "compatible" property in /hypervisor in the 
> device tree to see whether we're running in KVM mode or in TCG mode.

This I added in patch 30.

The reason for the suboptimal patch ordering was just me being lazy and
avoiding rebasing annoyance. I'd written a bunch of failing test cases
for QEMU work, but hadn't done the kvm/tcg test yet. It had a few
conflicts so I put it at the end... can rebase if you'd really prefer.

>
> >   	report_prefix_pop();
> >   }
> > diff --git a/powerpc/tm.c b/powerpc/tm.c
> > index 6b1ceeb6e..d9e7f455d 100644
> > --- a/powerpc/tm.c
> > +++ b/powerpc/tm.c
> > @@ -133,7 +133,8 @@ int main(int argc, char **argv)
> >   		report_skip("TM is not available");
> >   		goto done;
> >   	}
> > -	report(cpus_with_tm == nr_cpus,
> > +	/* KVM does not report TM in secondary threads in POWER9 */
> > +	report_kfail(true, cpus_with_tm == nr_cpus,
> >   	       "TM available in all 'ibm,pa-features' properties");
>
> Could you check the PVR for POWER9 here instead of using "true" as first 
> parameter?

Also covered in patch 30.

Thanks,
Nick
Thomas Huth May 7, 2024, 11:44 a.m. UTC | #3
On 07/05/2024 06.07, Nicholas Piggin wrote:
> On Mon May 6, 2024 at 5:37 PM AEST, Thomas Huth wrote:
>> On 04/05/2024 14.28, Nicholas Piggin wrote:
>>> Mark the failing h_cede_tm and spapr_vpa tests as kfail.
>>>
>>> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
>>> ---
>>>    powerpc/spapr_vpa.c | 3 ++-
>>>    powerpc/tm.c        | 3 ++-
>>>    2 files changed, 4 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/powerpc/spapr_vpa.c b/powerpc/spapr_vpa.c
>>> index c2075e157..46fa0485c 100644
>>> --- a/powerpc/spapr_vpa.c
>>> +++ b/powerpc/spapr_vpa.c
>>> @@ -150,7 +150,8 @@ static void test_vpa(void)
>>>    		report_fail("Could not deregister after registration");
>>>    
>>>    	disp_count1 = be32_to_cpu(vpa->vp_dispatch_count);
>>> -	report(disp_count1 % 2 == 1, "Dispatch count is odd after deregister");
>>> +	/* TCG known fail, could be wrong test, must verify against PowerVM */
>>> +	report_kfail(true, disp_count1 % 2 == 1, "Dispatch count is odd after deregister");
>>
>> Using "true" as first argument looks rather pointless - then you could also
>> simply delete the test completely if it can never be tested reliably.
>>
>> Thus could you please introduce a helper function is_tcg() that could be
>> used to check whether we run under TCG (and not KVM)? I think you could
>> check for "linux,kvm" in the "compatible" property in /hypervisor in the
>> device tree to see whether we're running in KVM mode or in TCG mode.
> 
> This I added in patch 30.
> 
> The reason for the suboptimal patch ordering was just me being lazy and
> avoiding rebasing annoyance. I'd written a bunch of failing test cases
> for QEMU work, but hadn't done the kvm/tcg test yet. It had a few
> conflicts so I put it at the end... can rebase if you'd really prefer.

Ah, ok, no need to rebase then, as long it's there in the end, it's fine.

  Thanks,
   Thomas
diff mbox series

Patch

diff --git a/powerpc/spapr_vpa.c b/powerpc/spapr_vpa.c
index c2075e157..46fa0485c 100644
--- a/powerpc/spapr_vpa.c
+++ b/powerpc/spapr_vpa.c
@@ -150,7 +150,8 @@  static void test_vpa(void)
 		report_fail("Could not deregister after registration");
 
 	disp_count1 = be32_to_cpu(vpa->vp_dispatch_count);
-	report(disp_count1 % 2 == 1, "Dispatch count is odd after deregister");
+	/* TCG known fail, could be wrong test, must verify against PowerVM */
+	report_kfail(true, disp_count1 % 2 == 1, "Dispatch count is odd after deregister");
 
 	report_prefix_pop();
 }
diff --git a/powerpc/tm.c b/powerpc/tm.c
index 6b1ceeb6e..d9e7f455d 100644
--- a/powerpc/tm.c
+++ b/powerpc/tm.c
@@ -133,7 +133,8 @@  int main(int argc, char **argv)
 		report_skip("TM is not available");
 		goto done;
 	}
-	report(cpus_with_tm == nr_cpus,
+	/* KVM does not report TM in secondary threads in POWER9 */
+	report_kfail(true, cpus_with_tm == nr_cpus,
 	       "TM available in all 'ibm,pa-features' properties");
 
 	all = argc == 1 || !strcmp(argv[1], "all");