Re: [PATCH 3/5] x86/ioapic: Handle Extended Destination ID field in RTE

From: Peter Zijlstra
Date: Thu Oct 08 2020 - 05:12:42 EST


On Wed, Oct 07, 2020 at 01:20:44PM +0100, David Woodhouse wrote:
> @@ -1861,7 +1863,8 @@ static void ioapic_configure_entry(struct irq_data *irqd)
> * ioapic chip to verify that.
> */
> if (irqd->chip == &ioapic_chip) {
> - mpd->entry.dest = cfg->dest_apicid;
> + mpd->entry.dest = cfg->dest_apicid & 0xff;
> + mpd->entry.ext_dest = cfg->dest_apicid >> 8;
> mpd->entry.vector = cfg->vector;
> }
> for_each_irq_pin(entry, mpd->irq_2_pin)

All the other sites did memset(0) before the assignment, and this the
extra unconditional write of 0 to ext_dest is harmless.

This might be true for this site too, but it wasn't immediately obvious.