LinuxPPC-Dev Archive on lore.kernel.org
 help / color / Atom feed
From: "Cédric Le Goater" <clg@kaod.org>
To: Jordan Niethe <jniethe5@gmail.com>,
	Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Mackerras <paulus@samba.org>,
	linuxppc-dev@lists.ozlabs.org,
	Nicholas Piggin <npiggin@gmail.com>
Subject: Re: [PATCH 1/3] powerpc/xmon: Check for HV mode when dumping XIVE info from OPAL
Date: Thu, 15 Aug 2019 10:15:25 +0200
Message-ID: <294237fc-13eb-a0eb-3c28-db4141140e8d@kaod.org> (raw)
In-Reply-To: <21746c620de5ac0b9489a10cdc1f584f94d592fd.camel@gmail.com>

On 15/08/2019 09:30, Jordan Niethe wrote:
> On Wed, 2019-08-14 at 17:47 +0200, Cédric Le Goater wrote:
>> Currently, the xmon 'dx' command calls OPAL to dump the XIVE state in
>> the OPAL logs and also outputs some of the fields of the internal
>> XIVE
>> structures in Linux. The OPAL calls can only be done on baremetal
>> (PowerNV) and they crash a pseries machine. Fix by checking the
>> hypervisor feature of the CPU.
>>
>> Signed-off-by: Cédric Le Goater <clg@kaod.org>
>> ---
>>  arch/powerpc/xmon/xmon.c | 17 ++++++++++-------
>>  1 file changed, 10 insertions(+), 7 deletions(-)
>>
>> diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
>> index 14e56c25879f..25d4adccf750 100644
>> --- a/arch/powerpc/xmon/xmon.c
>> +++ b/arch/powerpc/xmon/xmon.c
>> @@ -2534,13 +2534,16 @@ static void dump_pacas(void)
>>  static void dump_one_xive(int cpu)
>>  {
>>  	unsigned int hwid = get_hard_smp_processor_id(cpu);
>> -
>> -	opal_xive_dump(XIVE_DUMP_TM_HYP, hwid);
>> -	opal_xive_dump(XIVE_DUMP_TM_POOL, hwid);
>> -	opal_xive_dump(XIVE_DUMP_TM_OS, hwid);
>> -	opal_xive_dump(XIVE_DUMP_TM_USER, hwid);
>> -	opal_xive_dump(XIVE_DUMP_VP, hwid);
>> -	opal_xive_dump(XIVE_DUMP_EMU_STATE, hwid);
>> +	bool hv = cpu_has_feature(CPU_FTR_HVMODE);
>> +
>> +	if (hv) {
>> +		opal_xive_dump(XIVE_DUMP_TM_HYP, hwid);
>> +		opal_xive_dump(XIVE_DUMP_TM_POOL, hwid);
>> +		opal_xive_dump(XIVE_DUMP_TM_OS, hwid);
>> +		opal_xive_dump(XIVE_DUMP_TM_USER, hwid);
>> +		opal_xive_dump(XIVE_DUMP_VP, hwid);
>> +		opal_xive_dump(XIVE_DUMP_EMU_STATE, hwid);
>> +	}
>>  
>>  	if (setjmp(bus_error_jmp) != 0) {
>>  		catch_memory_errors = 0;
> dump_one_xive() / other xive functions are guarded by #ifdef
> CONFIG_PPC_POWERNV in xmon.c aren't they? With this series would it be
> that these guards can be removed?

One could compile without CONFIG_PPC_POWERNV but we would still want 
these commands to be available for pseries. I missed that.

I think we should move the opal_xive_dump calls to some other command, 
dxo for 'dump_xive_opal' may be, as they only output in the OPAL logs.

This needs some rework.

Thanks,

C.

  reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-14 15:47 [PATCH 0/3] powerpc/xmon: Fix dump of XIVE interrupt under pseries Cédric Le Goater
2019-08-14 15:47 ` [PATCH 1/3] powerpc/xmon: Check for HV mode when dumping XIVE info from OPAL Cédric Le Goater
2019-08-15  7:30   ` Jordan Niethe
2019-08-15  8:15     ` Cédric Le Goater [this message]
2019-08-15 16:44       ` Cédric Le Goater
2019-08-22 13:09   ` Michael Ellerman
2019-08-14 15:47 ` [PATCH 2/3] powerpc/xive: Fix dump of XIVE interrupt under pseries Cédric Le Goater
2019-08-14 15:47 ` [PATCH 3/3] powerpc/xmon: Add a dump of all XIVE interrupts Cédric Le Goater

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=294237fc-13eb-a0eb-3c28-db4141140e8d@kaod.org \
    --to=clg@kaod.org \
    --cc=jniethe5@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LinuxPPC-Dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linuxppc-dev/0 linuxppc-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linuxppc-dev linuxppc-dev/ https://lore.kernel.org/linuxppc-dev \
		linuxppc-dev@lists.ozlabs.org linuxppc-dev@ozlabs.org linuxppc-dev@archiver.kernel.org
	public-inbox-index linuxppc-dev


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.ozlabs.lists.linuxppc-dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox