RE: [PATCH V4] powerpc/85xx: Add machine check handler to fix PCIe erratum on mpc85xx
From: Jia Hongtao-B38951 <hidden>
Date: 2013-03-08 08:01:54
-----Original Message----- From: Wood Scott-B07421 Sent: Friday, March 08, 2013 12:38 AM To: Jia Hongtao-B38951 Cc: David Laight; Wood Scott-B07421; linuxppc-dev@lists.ozlabs.org; Stuart Yoder Subject: Re: [PATCH V4] powerpc/85xx: Add machine check handler to fix PCIe erratum on mpc85xx =20 On 03/07/2013 02:06:05 AM, Jia Hongtao-B38951 wrote:quoted
Here is the ideas from Scott: "quoted
+ if (is_in_pci_mem_space(addr)) { + inst =3D *(unsigned int *)regs->nip;Be careful about taking a fault here. A simple TLB miss should be safe given that we shouldn't be accessing PCIe in the middle of exception code, but what if the mapping has gone away (e.g. a userspace driver had its code munmap()ed or swapped out)? What if permissions allow execute but not read (not sure if Linux will allow this, but the hardware does)? What if it happened in a KVM guest? You can't access guest addresses directly. "=20 That means you need to be careful about how you read the instruction, not that you shouldn't do it at all. =20 -Scott
I agree. Do you have a more secure way to get the instruction? Or what should be done to avoid permission break issue? Thanks. -Hongtao