Subject: Re: [PATCH] powerpc: Fix emulation of illegal instructions on PowerNV platform

From: Anshuman Khandual <[email-masked]>
Date: Mon, 17 Jun 2013 15:02:20 +0530

On 06/14/2013 03:37 PM, Paul Mackerras wrote:
> Normally, the kernel emulates a few instructions that are unimplemented
> on some processors (e.g. the old dcba instruction), or privileged (e.g.
> mfpvr).  The emulation of unimplemented instructions is currently not
> working on the PowerNV platform.  The reason is that on these machines,
> unimplemented and illegal instructions cause a hypervisor emulation
> assist interrupt, rather than a program interrupt as on older CPUs.
> Our vector for the emulation assist interrupt just calls
> program_check_exception() directly, without setting the bit in SRR1
> that indicates an illegal instruction interrupt.  

Hey Paul,

The only difference between (1) Program interrupt and (2) Hypervisor
emulation assist interrupt is that in the earlier, HW sets "illegal
instruction" as the reason code in the SRR1 registers implicitly.
We fix it in the later interrupt vector by doing the same explicitly
in SW ? The cause of the problem before was not having the appropriate
reason code ("illegal instruction") in the SRR1 register for program_
check_exception() function to take it forward ?

Regards
Anshuman