Re: [patch 4/4] x86, ioapic: remove duplicate code forsaving/restoring RTEs

From: Ingo Molnar
Date: Tue May 17 2011 - 05:08:52 EST



ok, this series looks better, but as this bug has demonstrated it we need to do
better to keep the ioapic code clean.

Firstly, please introduce a 'struct ioapic' structure that starts out with a
nr_registers field, and add an ioapics[] array and consolidate
nr_ioapic_registers into this.

The consolidate other ioapic driver state as well:

- add a *saved_registers field and consolidate ioapic_saved_data into it

- add a 'struct mpc_ioapic mp_config' entry and consolidate mp_ioapics[]

- add a 'struct mp_ioapic_gsi gsi_config' entry and consolidate mp_gsi_routing[]

- add a 'int pin_programmed' field and consolidate mp_ioapic_routing[] into it

ioapics[] itself should be static to io_apic.c.

Please create a separate patch for each change: that way it's bisectable and
reviewable.

These changes alone will make the IO-APIC code a *lot* more readable, more
extensible - and hopefully much less prone to suspend/resume bugs as well.

Feel free to do this on top of your current queue to keep your patch-shuffling
overhead low.

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/