RE: [PATCH V4] powerpc/85xx: Add machine check handler to fix PCIe erratum on mpc85xx
From: David Laight <hidden>
Date: 2013-03-12 09:48:49
From: David Laight <hidden>
Date: 2013-03-12 09:48:49
Is that OK if I use the following code?
...
if (is_in_pci_mem_space(addr)) {
if (!user_mode(regs)) {
ret =3D probe_kernel_address(regs->nip, inst);
=20
if (!ret) {
rd =3D get_rt(inst);
regs->gpr[rd] =3D 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. David