All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: fix hardware PMU exception bug on PowerVM compatibility mode systems
@ 2020-02-14  0:19 Desnes A. Nunes do Rosario
  2020-02-15  6:26 ` Leonardo Bras
  0 siblings, 1 reply; 4+ messages in thread
From: Desnes A. Nunes do Rosario @ 2020-02-14  0:19 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: desnesn, gromero

PowerVM systems running compatibility mode on a few Power8 revisions are
still vulnerable to the hardware defect that loses PMU exceptions arriving
prior to a context switch.

The software fix for this issue is enabled through the CPU_FTR_PMAO_BUG
cpu_feature bit, nevertheless this bit also needs to be set for PowerVM
compatibility mode systems.

Fixes: 68f2f0d431d9ea4 ("powerpc: Add a cpu feature CPU_FTR_PMAO_BUG")
Signed-off-by: Desnes A. Nunes do Rosario <desnesn@linux.ibm.com>
---
 arch/powerpc/kernel/cputable.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index e745abc5457a..5bfef6263dfb 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -2198,6 +2198,8 @@ static struct cpu_spec * __init setup_cpu_spec(unsigned long offset,
 		if (old.oprofile_cpu_type != NULL) {
 			t->oprofile_cpu_type = old.oprofile_cpu_type;
 			t->oprofile_type = old.oprofile_type;
+			if (old.cpu_features & CPU_FTR_PMAO_BUG)
+				t->cpu_features |= CPU_FTR_PMAO_BUG;
 		}
 	}
 
-- 
2.21.1


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

* Re: [PATCH] powerpc: fix hardware PMU exception bug on PowerVM compatibility mode systems
  2020-02-14  0:19 [PATCH] powerpc: fix hardware PMU exception bug on PowerVM compatibility mode systems Desnes A. Nunes do Rosario
@ 2020-02-15  6:26 ` Leonardo Bras
  0 siblings, 0 replies; 4+ messages in thread
From: Leonardo Bras @ 2020-02-15  6:26 UTC (permalink / raw)
  To: Desnes A. Nunes do Rosario, linuxppc-dev; +Cc: gromero

[-- Attachment #1: Type: text/plain, Size: 1509 bytes --]

Hello Desnes, thanks for the patch.

On Thu, 2020-02-13 at 21:19 -0300, Desnes A. Nunes do Rosario wrote:
> PowerVM systems running compatibility mode on a few Power8 revisions are
> still vulnerable to the hardware defect that loses PMU exceptions arriving
> prior to a context switch.
> 
> The software fix for this issue is enabled through the CPU_FTR_PMAO_BUG
> cpu_feature bit, nevertheless this bit also needs to be set for PowerVM
> compatibility mode systems.
> 
> Fixes: 68f2f0d431d9ea4 ("powerpc: Add a cpu feature CPU_FTR_PMAO_BUG")
> Signed-off-by: Desnes A. Nunes do Rosario <desnesn@linux.ibm.com>
> ---
>  arch/powerpc/kernel/cputable.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
> index e745abc5457a..5bfef6263dfb 100644
> --- a/arch/powerpc/kernel/cputable.c
> +++ b/arch/powerpc/kernel/cputable.c
> @@ -2198,6 +2198,8 @@ static struct cpu_spec * __init setup_cpu_spec(unsigned long offset,
>  		if (old.oprofile_cpu_type != NULL) {
>  			t->oprofile_cpu_type = old.oprofile_cpu_type;
>  			t->oprofile_type = old.oprofile_type;
> +			if (old.cpu_features & CPU_FTR_PMAO_BUG)
> +				t->cpu_features |= CPU_FTR_PMAO_BUG;
>  		}
>  	}
>  

What are your thoughts about doing:
        t->cpu_features |=  old.cpu_features & CPU_FTR_PMAO_BUG;

Also, I would recommend adding a short comment on top of the added
lines explaining why it is needed. 

Best regards,
Leonardo Bras

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] powerpc: fix hardware PMU exception bug on PowerVM compatibility mode systems
  2020-02-15  5:39 Leonardo Bras
@ 2020-02-27 13:29 ` Desnes Augusto Nunes do Rosario
  0 siblings, 0 replies; 4+ messages in thread
From: Desnes Augusto Nunes do Rosario @ 2020-02-27 13:29 UTC (permalink / raw)
  To: Leonardo Bras, linuxppc-dev; +Cc: gromero

Hello Leonardo,

On 2/15/20 2:39 AM, Leonardo Bras wrote:
> Hello Desnes, thanks for the patch.
>
> "Desnes A. Nunes do Rosario" <desnesn@linux.ibm.com> writes:
>
>> PowerVM systems running compatibility mode on a few Power8 revisions are
>> still vulnerable to the hardware defect that loses PMU exceptions arriving
>> prior to a context switch.
>>
>> The software fix for this issue is enabled through the CPU_FTR_PMAO_BUG
>> cpu_feature bit, nevertheless this bit also needs to be set for PowerVM
>> compatibility mode systems.
>>
>> Fixes: 68f2f0d431d9ea4 ("powerpc: Add a cpu feature CPU_FTR_PMAO_BUG")
>> Signed-off-by: Desnes A. Nunes do Rosario <desnesn@linux.ibm.com>
>> ---
>>   arch/powerpc/kernel/cputable.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
>> index e745abc5457a..5bfef6263dfb 100644
>> --- a/arch/powerpc/kernel/cputable.c
>> +++ b/arch/powerpc/kernel/cputable.c
>> @@ -2198,6 +2198,8 @@ static struct cpu_spec * __init setup_cpu_spec(unsigned long offset,
>>   		if (old.oprofile_cpu_type != NULL) {
>>   			t->oprofile_cpu_type = old.oprofile_cpu_type;
>>   			t->oprofile_type = old.oprofile_type;
>> +			if (old.cpu_features & CPU_FTR_PMAO_BUG)
>> +				t->cpu_features |= CPU_FTR_PMAO_BUG;
> What are your thoughts about doing:
> 	t->cpu_features |=  old.cpu_features & CPU_FTR_PMAO_BUG;
Looks good to me.
> Also, I would recommend adding a short comment on top of the added
> lines explaining why it is needed.
Sure, I'll send a second version.

Thanks for the review.
>
> Best regards,
> Leonardo Bras
>
-- 
Desnes A. Nunes do Rosario
--------------------------------
Advisory Software Engineer - IBM
Virtual Onsite Engineer - Red Hat


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

* Re: [PATCH] powerpc: fix hardware PMU exception bug on PowerVM compatibility mode systems
@ 2020-02-15  5:39 Leonardo Bras
  2020-02-27 13:29 ` Desnes Augusto Nunes do Rosario
  0 siblings, 1 reply; 4+ messages in thread
From: Leonardo Bras @ 2020-02-15  5:39 UTC (permalink / raw)
  To: desnesn, linuxppc-dev; +Cc: desnesn, gromero

[-- Attachment #1: Type: text/plain, Size: 1475 bytes --]

Hello Desnes, thanks for the patch.

"Desnes A. Nunes do Rosario" <desnesn@linux.ibm.com> writes:

> PowerVM systems running compatibility mode on a few Power8 revisions are
> still vulnerable to the hardware defect that loses PMU exceptions arriving
> prior to a context switch.
>
> The software fix for this issue is enabled through the CPU_FTR_PMAO_BUG
> cpu_feature bit, nevertheless this bit also needs to be set for PowerVM
> compatibility mode systems.
>
> Fixes: 68f2f0d431d9ea4 ("powerpc: Add a cpu feature CPU_FTR_PMAO_BUG")
> Signed-off-by: Desnes A. Nunes do Rosario <desnesn@linux.ibm.com>
> ---
>  arch/powerpc/kernel/cputable.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
> index e745abc5457a..5bfef6263dfb 100644
> --- a/arch/powerpc/kernel/cputable.c
> +++ b/arch/powerpc/kernel/cputable.c
> @@ -2198,6 +2198,8 @@ static struct cpu_spec * __init setup_cpu_spec(unsigned long offset,
>  		if (old.oprofile_cpu_type != NULL) {
>  			t->oprofile_cpu_type = old.oprofile_cpu_type;
>  			t->oprofile_type = old.oprofile_type;
> +			if (old.cpu_features & CPU_FTR_PMAO_BUG)
> +				t->cpu_features |= CPU_FTR_PMAO_BUG;

What are your thoughts about doing:
	t->cpu_features |=  old.cpu_features & CPU_FTR_PMAO_BUG;

Also, I would recommend adding a short comment on top of the added
lines explaining why it is needed. 

Best regards,
Leonardo Bras


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2020-02-27 13:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-14  0:19 [PATCH] powerpc: fix hardware PMU exception bug on PowerVM compatibility mode systems Desnes A. Nunes do Rosario
2020-02-15  6:26 ` Leonardo Bras
2020-02-15  5:39 Leonardo Bras
2020-02-27 13:29 ` Desnes Augusto Nunes do Rosario

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.