x86/pv: remove unlikely() from BUG_ON() condition in pv_map_ldt_shadow_page()
PATCH 1/1 x86/pv: remove unlikely() from BUG_ON() condition in pv_map_ldt_shadow_page()
BUG_ON() itself already contains an unlikely() wrapping the bug condition.
No functional change.
Signed-off-by Roger Pau Monné <[email protected]>
--- xen/arch/x86/pv/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/pv/mm.c +1 -1
@@ -55,7 +55,7 @@ bool pv_map_ldt_shadow_page(unsigned int offset)l1_pgentry_t gl1e, *pl1e;unsigned long linear = curr->arch.pv.ldt_base + offset; -BUG_ON (unlikely (in_irq ())); +BUG_ON (in_irq ());/* * Prior limit checking should guarantee this property. NB. This is
Signature · 1 line
2.46.0
Quoted 5 lines · Roger Pau Monne
BUG_ON()itself already contains anunlikely()wrapping the bug condition.No functional change.
Signed-off-by Roger Pau Monné <[email protected]>
Acked-by Andrew Cooper <[email protected]>
likely()/unlikely() annotations are notoriously difficult for humans to reason about, and I think we have many wrong examples in Xen.
In some copious free time, I was thinking of borrowing Linux's ftrace mechanism for identifying broken annotations. All it involves is turning if() into a macro...