[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrVHqi9ixUQbeN82T14CVom1N6QegSNR+r=jtjRgcfC0kg@mail.gmail.com>
Date: Wed, 16 Dec 2015 09:55:11 -0800
From: Andy Lutomirski <luto@...capital.net>
To: Tony Luck <tony.luck@...el.com>
Cc: Ingo Molnar <mingo@...nel.org>, Borislav Petkov <bp@...en8.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Andy Lutomirski <luto@...nel.org>,
Dan Williams <dan.j.williams@...el.com>,
Robert <elliott@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
linux-nvdimm <linux-nvdimm@...1.01.org>, X86 ML <x86@...nel.org>
Subject: Re: [PATCHV3 1/3] x86, ras: Add new infrastructure for machine check
fixup tables
On Tue, Dec 15, 2015 at 5:29 PM, Tony Luck <tony.luck@...el.com> wrote:
> Copy the existing page fault fixup mechanisms to create a new table
> to be used when fixing machine checks. Note:
> 1) At this time we only provide a macro to annotate assembly code
> 2) We assume all fixups will in code builtin to the kernel.
> 3) Only for x86_64
> 4) New code under CONFIG_MCE_KERNEL_RECOVERY (default 'n')
>
> Signed-off-by: Tony Luck <tony.luck@...el.com>
Looks generally good.
Reviewed-by: Andy Lutomirski <luto@...nel.org>
with trivial caveats:
> int __init mcheck_init(void)
> {
> +#ifdef CONFIG_MCE_KERNEL_RECOVERY
> + if (__stop___mcex_table > __start___mcex_table)
> + sort_extable(__start___mcex_table, __stop___mcex_table);
> +#endif
This doesn't matter unless we sprout a lot of these, but it could be
worthwhile to update sortextable.h as well.
> +#ifdef CONFIG_MCE_KERNEL_RECOVERY
> +int fixup_mcexception(struct pt_regs *regs)
> +{
> + const struct exception_table_entry *fixup;
> + unsigned long new_ip;
> +
> + fixup = search_mcexception_tables(regs->ip);
> + if (fixup) {
> + new_ip = ex_fixup_addr(fixup);
> +
> + regs->ip = new_ip;
You could very easily save a line of code here :)
> + return 1;
> + }
> +
> + return 0;
> +}
> +#endif
> +
--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists