On Mon, 4 Mar 2024 at 03:56, David Howells <dhowells@xxxxxxxxxx> wrote: > > That said, I wonder if: > > #ifdef copy_mc_to_kernel > > should be: > > #ifdef CONFIG_ARCH_HAS_COPY_MC Hmm. Maybe. We do have that #ifdef copy_mc_to_kernel pattern already in <linux/uaccess.h>, so clearly we've done it both ways. I personally like the "just test for the thing you are using" model, which is then why I did it that way, but I don't have hugely strong opinions on it. > and whether it's possible to find out dynamically if MCEs can occur at all. I really wanted to do something like that, and look at the source page to decide "is this a pmem page that can cause machine checks", but I didn't find any obvious way to do that. Improvement suggestions more than welcome. Linus