[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v9 12/27] xsplice: Implement support for applying/reverting/replacing patches.



On 27.04.2016 05:39, Konrad Rzeszutek Wilk wrote:
[...]
> +        /* "Mask" NMIs. */
> +        arch_xsplice_mask();

You mask here ...

> +        barrier(); /* MUST do it after get_cpu_maps. */
> +        cpus = num_online_cpus() - 1;
> +
> +        if ( cpus )
> +        {
> +            dprintk(XENLOG_DEBUG, XSPLICE "%s: CPU%u - IPIing the other %u 
> CPUs\n",
> +                    p->name, cpu, cpus);
> +            smp_call_function(reschedule_fn, NULL, 0);
> +        }
> +
> +        timeout = xsplice_work.timeout + NOW();
> +        if ( xsplice_spin(&xsplice_work.semaphore, timeout, cpus, "CPU") )
> +            goto abort;

... and potentially abort here, but the abort path does not unmask, so
you lose the NMI handler.

> +
> +        /* All CPUs are waiting, now signal to disable IRQs. */
> +        atomic_set(&xsplice_work.semaphore, 0);
> +        /*
> +         * MUST have a barrier after semaphore so that the other CPUs don't
> +         * leak out of the 'Wait for all CPUs to rendezvous' loop and 
> increment
> +         * 'semaphore' before we set it to zero.
> +         */
> +        smp_wmb();
> +        xsplice_work.ready = 1;
> +
> +        if ( !xsplice_spin(&xsplice_work.semaphore, timeout, cpus, "IRQ") )
> +        {
> +            local_irq_save(flags);
> +            /* Do the patching. */
> +            xsplice_do_action();
> +            /* Serialize and flush out the CPU via CPUID instruction (on 
> x86). */
> +            arch_xsplice_post_action();
> +            local_irq_restore(flags);
> +        }
> +        arch_xsplice_unmask();
> +
> + abort:
> +        per_cpu(work_to_do, cpu) = 0;
> +        xsplice_work.do_work = 0;
> +
> +        /* put_cpu_maps has an barrier(). */
> +        put_cpu_maps();
> +
> +        printk(XENLOG_INFO XSPLICE "%s finished %s with rc=%d\n",
> +               p->name, names[xsplice_work.cmd], p->rc);
> +    }
> +    else
[...]

Martin
Amazon Development Center Germany GmbH
Berlin - Dresden - Aachen
main office: Krausenstr. 38, 10117 Berlin
Geschaeftsfuehrer: Dr. Ralf Herbrich, Christian Schlaeger
Ust-ID: DE289237879
Eingetragen am Amtsgericht Charlottenburg HRB 149173 B
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.