Messages in this thread | | | Date | Tue, 17 May 2011 11:08:38 +0200 | From | Ingo Molnar <> | Subject | Re: [patch 4/4] x86, ioapic: remove duplicate code for saving/restoring RTEs |
| |
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
| |