Re: [PATCH] xenpv: don't BUG when failing to setup NMI callback

From: David Vrabel
Date: Fri Jun 13 2014 - 09:32:37 EST


On 13/06/14 12:26, Vitaly Kuznetsov wrote:
>
> --- a/arch/x86/xen/setup.c
> +++ b/arch/x86/xen/setup.c
> @@ -593,8 +593,17 @@ void xen_enable_syscall(void)
> void xen_enable_nmi(void)
> {
> #ifdef CONFIG_X86_64
> - if (register_callback(CALLBACKTYPE_nmi, (char *)nmi))
> + int ret;
> +
> + ret = register_callback(CALLBACKTYPE_nmi, (char *)nmi);
> + if (ret == -EINVAL) {
> + /* Hypervisor probably forbids us to register NMI callback,
> + that is expected when running on top of Xen-3.1 and older */
> + pr_warn("xen: failed to register NMI callback\n");
> + } else if (ret != 0) {
> + /* Other hypervisor failure */
> BUG();

I don't think we ever want to BUG() if this hypercall fails. Just print
a warning.

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/