[PATCH V4] powerpc/85xx: Add machine check handler to fix PCIe erratum on mpc85xx

David Laight David.Laight at ACULAB.COM
Tue Mar 12 20:47:13 EST 2013

> Is that OK if I use the following code?
> 	if (is_in_pci_mem_space(addr)) {
> 		if (!user_mode(regs)) {
> 			ret = probe_kernel_address(regs->nip, inst);
> 			if (!ret) {
> 				rd = get_rt(inst);
> 				regs->gpr[rd] = 0xffffffff;
> 			}
> 		}

Don't you need to check that the instruction is actually
a memory read?

I also know that there are people mapping PCIe addresses
directly into userspace for 'simple' access to things like
fpga devices.

I suspect that such devices are the ones likely to generate
the faulting cycles. So you probably do want to handle
faults from normal userspace addresses.


More information about the Linuxppc-dev mailing list