• Juergen Gross's avatar
    xen/events: defer eoi in case of excessive number of events · e99502f7
    Juergen Gross authored
    In case rogue guests are sending events at high frequency it might
    happen that xen_evtchn_do_upcall() won't stop processing events in
    dom0. As this is done in irq handling a crash might be the result.
    
    In order to avoid that, delay further inter-domain events after some
    time in xen_evtchn_do_upcall() by forcing eoi processing into a
    worker on the same cpu, thus inhibiting new events coming in.
    
    The time after which eoi processing is to be delayed is configurable
    via a new module parameter "event_loop_timeout" which specifies the
    maximum event loop time in jiffies (default: 2, the value was chosen
    after some tests showing that a value of 2 was the lowest with an
    only slight drop of dom0 network throughput while multiple guests
    performed an event storm).
    
    How long eoi processing will be delayed can be specified via another
    parameter "event_eoi_delay" (again in jiffies, default 10, again the
    value was chosen after testing with different delay values).
    
    This is part of XSA-332.
    
    Cc: stable@vger.kernel.org
    Reported-by: default avatarJulien Grall <julien@xen.org>
    Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
    Reviewed-by: default avatarStefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: default avatarWei Liu <wl@xen.org>
    e99502f7
events_base.c 46.9 KB