lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 12 Dec 2019 18:32:36 -0600
From:   Bjorn Helgaas <helgaas@...nel.org>
To:     Murali Karicheri <m-karicheri2@...com>,
        Richard Zhu <hongxing.zhu@....com>,
        Lucas Stach <l.stach@...gutronix.de>
Cc:     Russell King <linux@...linux.org.uk>,
        Andrew Murray <andrew.murray@....com>,
        linux-pci@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org
Subject: imx6 and keystone PCIe abort handling

Hi folks,

Why are ks_pcie_fault() and imx6q_pcie_abort_handler() different?  I
think they're doing the same thing, and the "instr & 0x0e100090" part
is the same, but only imx6 has the "instr & 0x0c100000" part.  And the
return values are different in some cases.

Could/should these be shared somehow?  They're both under #ifdef
CONFIG_ARM, so maybe it could be provided by arch/arm?

  static int ks_pcie_fault(unsigned long addr, unsigned int fsr,
			   struct pt_regs *regs)
  {
	  unsigned long instr = *(unsigned long *) instruction_pointer(regs);

	  if ((instr & 0x0e100090) == 0x00100090) {
		  int reg = (instr >> 12) & 15;

		  regs->uregs[reg] = -1;
		  regs->ARM_pc += 4;
	  }

	  return 0;
  }

  static int imx6q_pcie_abort_handler(unsigned long addr,
		  unsigned int fsr, struct pt_regs *regs)
  {
	  unsigned long pc = instruction_pointer(regs);
	  unsigned long instr = *(unsigned long *)pc;
	  int reg = (instr >> 12) & 15;

	  /*
	   * If the instruction being executed was a read,
	   * make it look like it read all-ones.
	   */
	  if ((instr & 0x0c100000) == 0x04100000) {
		  unsigned long val;

		  if (instr & 0x00400000)
			  val = 255;
		  else
			  val = -1;

		  regs->uregs[reg] = val;
		  regs->ARM_pc += 4;
		  return 0;
	  }

	  if ((instr & 0x0e100090) == 0x00100090) {
		  regs->uregs[reg] = -1;
		  regs->ARM_pc += 4;
		  return 0;
	  }

	  return 1;
  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ