diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2020-12-10 20:26:04 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2020-12-15 16:19:37 +0100 |
commit | 62ebcda8a8dfa4aeaa3288020a082787910afebc (patch) | |
tree | d5671333409d71e98bf96ccbe8af5c096f81729d /drivers/xen/events | |
parent | f7a6f994b4f0ee69c656dda3da11431d92d6b08f (diff) | |
download | linux-62ebcda8a8dfa4aeaa3288020a082787910afebc.tar.gz linux-62ebcda8a8dfa4aeaa3288020a082787910afebc.tar.bz2 linux-62ebcda8a8dfa4aeaa3288020a082787910afebc.zip |
xen/events: Reduce irq_info:: Spurious_cnt storage size
To prepare for interrupt spreading reduce the storage size of
irq_info::spurious_cnt to u8 so the required flag for the spreading logic
will not increase the storage size.
Protect the usage site against overruns.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Link: https://lore.kernel.org/r/20201210194045.360198201@linutronix.de
Diffstat (limited to 'drivers/xen/events')
-rw-r--r-- | drivers/xen/events/events_base.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c index 679b2cbd2de4..b352440963ee 100644 --- a/drivers/xen/events/events_base.c +++ b/drivers/xen/events/events_base.c @@ -95,7 +95,7 @@ struct irq_info { struct list_head list; struct list_head eoi_list; short refcnt; - short spurious_cnt; + u8 spurious_cnt; enum xen_irq_type type; /* type */ unsigned irq; evtchn_port_t evtchn; /* event channel */ @@ -528,8 +528,10 @@ static void xen_irq_lateeoi_locked(struct irq_info *info, bool spurious) return; if (spurious) { - if ((1 << info->spurious_cnt) < (HZ << 2)) - info->spurious_cnt++; + if ((1 << info->spurious_cnt) < (HZ << 2)) { + if (info->spurious_cnt != 0xFF) + info->spurious_cnt++; + } if (info->spurious_cnt > 1) { delay = 1 << (info->spurious_cnt - 2); if (delay > HZ) |