Hi,
On Wed, Aug 05, 2015 at 04:53:43PM -0700, Leonid Yegoshin wrote:
if (nir) {Does this change belog to this patch? If so why?
err = mipsr6_emul(regs, nir);
if (err > 0) {
+ regs->cp0_epc = nepc;
Maybe a comment would help?Yes, we can. But we have a bunch of that in many places and somewhere it is difficult to avoid "#ifdef".
It does feel like it fixes a different problem but I haven't read your patch in depth.
Can we simply avoid the if/def for R6 please? Just leave this function as is and
#include "ieee754.h"
+#ifdef CONFIG_CPU_MIPSR6
use if(cpu_has_mips_r6) when calling it. If you can't do that, please explain
why.
+Could you use cpu_has_mips64 and avoid the if/def
+static int mipsr6_pc(struct pt_regs *regs, mips_instruction inst, unsigned long cpc,
+ unsigned long bpc, unsigned long r31)
+{
+ union mips_instruction ir = (union mips_instruction)inst;
+ register unsigned long vaddr;
+ unsigned int val;
+ int err = SIGILL;
+
+ if (ir.rel_format.opcode != pcrel_op)
+ return SIGILL;
+
+ switch (ir.rel_format.op) {
+ case addiupc_op:
+ vaddr = regs->cp0_epc + (ir.rel_format.simmediate << 2);
+ if (config_enabled(CONFIG_64BIT) && !(regs->cp0_status & ST0_UX))
+ __asm__ __volatile__("sll %0, %0, 0":"+&r"(vaddr)::);
+ regs->regs[ir.rel_format.rs] = vaddr;
+ return 0;
+#ifdef CONFIG_CPU_MIPS64
and return SIGILL if it is not
true?