From: Scott Wood <scottwood@freescale.com>
To: Alexander Graf <agraf@suse.de>
Cc: Mihai Caraman <mihai.caraman@freescale.com>,
kvm-ppc@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: PPC: Fix unknown SPR error message in emulation
Date: Thu, 26 Apr 2012 17:47:41 +0000 [thread overview]
Message-ID: <4F998A3D.8@freescale.com> (raw)
In-Reply-To: <799279E4-0845-4B1C-B85C-5EFE82B30596@suse.de>
On 04/26/2012 08:25 AM, Alexander Graf wrote:
>
> On 24.04.2012, at 11:23, Mihai Caraman wrote:
>
>> mtspr/mfspr emulation prints an error message for unknown SPRs. The message
>> was badly formatted displaying the hex value without 0x prefix. Use decimal
>> representation in accordance with the manuals, though the Linux headers
>> annoyingly use hex.
>>
>> Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
>> ---
>> arch/powerpc/kvm/emulate.c | 4 ++--
>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
>> index afc9154..06d12c4 100644
>> --- a/arch/powerpc/kvm/emulate.c
>> +++ b/arch/powerpc/kvm/emulate.c
>> @@ -296,7 +296,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
>> default:
>> emulated = kvmppc_core_emulate_mfspr(vcpu, sprn, rt);
>> if (emulated = EMULATE_FAIL) {
>> - printk("mfspr: unknown spr %x\n", sprn);
>> + printk("mfspr: unknown spr %u\n", sprn);
>
> This means that if an older kernel threw an error on let's say
> SPR_VRSAVE, we got an error saying that it couldn't find "100", while
Eww. Perhaps we should grep for bare %x and fix them all at once? And
not let any more in...
> with new kernels we'd get 256. However, we don't have any indication
> if we're on an old or new kernel, making user failures pretty hard to
> debug.
>
> So either we change the message to hex always, with 0x prefixed, or
> we rephrase it to give us some indication if the user is running a
> patched kernel.
How about:
printk("mfspr: unknown spr %u (dec)\n", sprn);
Or if we just care about having some sort of marker that those familiar
with the history will understand, and don't want something nicer-looking
that doesn't make it look like appending (dec) should be normal practice:
printk("mfspr: unknown spr #%u\n", sprn);
-Scott
WARNING: multiple messages have this Message-ID (diff)
From: Scott Wood <scottwood@freescale.com>
To: Alexander Graf <agraf@suse.de>
Cc: Mihai Caraman <mihai.caraman@freescale.com>,
<kvm-ppc@vger.kernel.org>, <kvm@vger.kernel.org>
Subject: Re: [PATCH] KVM: PPC: Fix unknown SPR error message in emulation
Date: Thu, 26 Apr 2012 12:47:41 -0500 [thread overview]
Message-ID: <4F998A3D.8@freescale.com> (raw)
In-Reply-To: <799279E4-0845-4B1C-B85C-5EFE82B30596@suse.de>
On 04/26/2012 08:25 AM, Alexander Graf wrote:
>
> On 24.04.2012, at 11:23, Mihai Caraman wrote:
>
>> mtspr/mfspr emulation prints an error message for unknown SPRs. The message
>> was badly formatted displaying the hex value without 0x prefix. Use decimal
>> representation in accordance with the manuals, though the Linux headers
>> annoyingly use hex.
>>
>> Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
>> ---
>> arch/powerpc/kvm/emulate.c | 4 ++--
>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
>> index afc9154..06d12c4 100644
>> --- a/arch/powerpc/kvm/emulate.c
>> +++ b/arch/powerpc/kvm/emulate.c
>> @@ -296,7 +296,7 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
>> default:
>> emulated = kvmppc_core_emulate_mfspr(vcpu, sprn, rt);
>> if (emulated == EMULATE_FAIL) {
>> - printk("mfspr: unknown spr %x\n", sprn);
>> + printk("mfspr: unknown spr %u\n", sprn);
>
> This means that if an older kernel threw an error on let's say
> SPR_VRSAVE, we got an error saying that it couldn't find "100", while
Eww. Perhaps we should grep for bare %x and fix them all at once? And
not let any more in...
> with new kernels we'd get 256. However, we don't have any indication
> if we're on an old or new kernel, making user failures pretty hard to
> debug.
>
> So either we change the message to hex always, with 0x prefixed, or
> we rephrase it to give us some indication if the user is running a
> patched kernel.
How about:
printk("mfspr: unknown spr %u (dec)\n", sprn);
Or if we just care about having some sort of marker that those familiar
with the history will understand, and don't want something nicer-looking
that doesn't make it look like appending (dec) should be normal practice:
printk("mfspr: unknown spr #%u\n", sprn);
-Scott
next prev parent reply other threads:[~2012-04-26 17:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-24 9:23 [PATCH] KVM: PPC: Fix unknown SPR error message in emulation Mihai Caraman
2012-04-24 9:23 ` Mihai Caraman
2012-04-26 13:25 ` Alexander Graf
2012-04-26 13:25 ` Alexander Graf
2012-04-26 17:47 ` Scott Wood [this message]
2012-04-26 17:47 ` Scott Wood
2012-04-28 19:34 ` Caraman Mihai Claudiu-B02008
Reply instructions:
You may reply publicly 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=4F998A3D.8@freescale.com \
--to=scottwood@freescale.com \
--cc=agraf@suse.de \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=mihai.caraman@freescale.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.