[PATCH] powerpc: Add interrupt mode information in /proc/cpuinfo

Cédric Le Goater clg at kaod.org
Tue Apr 28 21:36:20 AEST 2020


On 4/28/20 1:03 PM, Michael Ellerman wrote:
> Cédric Le Goater <clg at kaod.org> writes:
>> PowerNV and pSeries machines can run using the XIVE or XICS interrupt
>> mode. Report this information in /proc/cpuinfo :
>>
>>     timebase    : 512000000
>>     platform    : PowerNV
>>     model       : 9006-22C
>>     machine     : PowerNV 9006-22C
>>     firmware    : OPAL
>>     MMU         : Radix
>>     IRQ         : XIVE
> 
> Hmmmm, I dunno. At what point do we stop putting random non CPU-related
> things in cpuinfo? :)

True. 

> The IRQ mode is (reasonably) easily discovered in sys, eg:
> 
>   $ cat /sys/kernel/irq/*/chip_name | grep -m 1 XIVE
>   XIVE-IRQ
> 
> vs:
> 
>   $ cat /sys/kernel/irq/*/chip_name | grep -m 1 XICS
>   XICS


That's good enough for error reporting

Thanks.

C.

> 
> cheers
> 
>> diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
>> index 3bc188da82ba..39ef3394038d 100644
>> --- a/arch/powerpc/platforms/powernv/setup.c
>> +++ b/arch/powerpc/platforms/powernv/setup.c
>> @@ -196,14 +196,18 @@ static void pnv_show_cpuinfo(struct seq_file *m)
>>  		model = of_get_property(root, "model", NULL);
>>  	seq_printf(m, "machine\t\t: PowerNV %s\n", model);
>>  	if (firmware_has_feature(FW_FEATURE_OPAL))
>> -		seq_printf(m, "firmware\t: OPAL\n");
>> +		seq_puts(m, "firmware\t: OPAL\n");
>>  	else
>> -		seq_printf(m, "firmware\t: BML\n");
>> +		seq_puts(m, "firmware\t: BML\n");
>>  	of_node_put(root);
>>  	if (radix_enabled())
>> -		seq_printf(m, "MMU\t\t: Radix\n");
>> +		seq_puts(m, "MMU\t\t: Radix\n");
>>  	else
>> -		seq_printf(m, "MMU\t\t: Hash\n");
>> +		seq_puts(m, "MMU\t\t: Hash\n");
>> +	if (xive_enabled())
>> +		seq_puts(m, "IRQ\t\t: XIVE\n");
>> +	else
>> +		seq_puts(m, "IRQ\t\t: XICS\n");
>>  }
>>  
>>  static void pnv_prepare_going_down(void)
>> diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
>> index 0c8421dd01ab..d248fca67797 100644
>> --- a/arch/powerpc/platforms/pseries/setup.c
>> +++ b/arch/powerpc/platforms/pseries/setup.c
>> @@ -95,9 +95,13 @@ static void pSeries_show_cpuinfo(struct seq_file *m)
>>  	seq_printf(m, "machine\t\t: CHRP %s\n", model);
>>  	of_node_put(root);
>>  	if (radix_enabled())
>> -		seq_printf(m, "MMU\t\t: Radix\n");
>> +		seq_puts(m, "MMU\t\t: Radix\n");
>>  	else
>> -		seq_printf(m, "MMU\t\t: Hash\n");
>> +		seq_puts(m, "MMU\t\t: Hash\n");
>> +	if (xive_enabled())
>> +		seq_puts(m, "IRQ\t\t: XIVE\n");
>> +	else
>> +		seq_puts(m, "IRQ\t\t: XICS\n");
>>  }
>>  
>>  /* Initialize firmware assisted non-maskable interrupts if
>> -- 
>> 2.25.3



More information about the Linuxppc-dev mailing list