• W
    arm64: irqflags: fix incomplete save & restore · e7e6a881
    Wei Li 提交于
    hulk inclusion
    category: bugfix
    bugzilla: 12844
    CVE: NA
    
    -------------------------------------------------
    
    To support the arm64 pseudo nmi, function arch_local_irq_save() and
    arch_local_irq_restore() now operate ICC_PMR_EL1 instead of daif.
    But i found the logic of the save and restore may be suspicious:
    
    arch_local_irq_save():
    daif.i_on  pmr_on   ->  flag.i_on
    1           0       |   0
    1           1       |   1
    0           1       |   0		--[1]
    0           0       |   0
    
    arch_local_irq_restore():
    daif.i_on  pmr_on  <-  flag.i_on
    x           0       |   0
    x           1       |   1
    
    As we see, the condintion [1] will never be restored honestly. When doing
    function_graph trace at gic_handle_irq(), calling local_irq_save() and
    local_irq_restore() in trace_graph_entry() will just go into this
    condintion. Therefore the irq can never be processed and lead to hang.
    
    In this patch, we do the save & restore exactly, and make sure the
    arch_irqs_disabled_flags() returns correctly.
    
    Fixes: 3021bd9cb776 ("arm64: irqflags: Use ICC_PMR_EL1 for interrupt masking")
    Signed-off-by: NWei Li <liwei391@huawei.com>
    Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
    Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
    e7e6a881
irqflags.h 3.4 KB