Subject: Re: [PATCH] powerpc/mce: Avoid using addr_to_pfn in realmode

From: Nicholas Piggin <[email-masked]>
Date: Mon, 22 Jun 2020 12:16:11 +1000

Excerpts from Ganesh Goudar's message of June 20, 2020 10:44 pm:
> When an UE or memory error exception is encountered the MCE handler
> tries to find the pfn using addr_to_pfn() which takes effective
> address as an argument, later pfn is used to poison the page where
> memory error occurred, recent rework in this area made addr_to_pfn
> to run in realmode, which can be fatal as it may try to access
> memory outside RMO region.
> 
> To fix this move the use of addr_to_pfn to save_mce_event(), which
> runs in virtual mode.

I'd rather this be done in the pseries mce handler rather than
change bare metal, and leaving save_mce_event as purely recording the 
event, decoding remains in its caller.

Radix guests also don't have an RMO, we could probably restrict that
pseries hack to hash. I want to get rid of it but it will take longer
to fix things properly.

Thanks,
Nick