Switch APIC (+nmi, +oprofile) to driver model
Quoted 18 lines · Pavel Machek
Quoted 2 lines
Also,
apic_physis (or should be)APIC_DEFAULT_PHYS_BASE, so you shouldn't need to makeapic_physglobal.Really?
/* * If no local APIC can be found then set up a fake all * zeroes page to simulate the local APIC and another * one for the IO-APIC. */ if (!smp_found_config && detect_init_APIC()) { apic_phys = (unsigned long) alloc_bootmem_pages(PAGE_SIZE); apic_phys = __pa(apic_phys); } else apic_phys = mp_lapic_addr; set_fixmap_nocache(FIX_APIC_BASE, apic_phys);
Quoted 1 line
So it seems to me it really is variable.
The original code has the property that apic_pm_state.active is true if and only if detect_init_APIC() was called and succeeded, which implies that apic_phys == mp_lapic_addr == APIC_DEFAULT_PHYS_BASE. You can also see that apic_pm_resume() writes APIC_DEFAULT_PHYS_BASE to MSR_IA32_APICBASE, which only makes sense in this situation.
You moved the apic_pm_state.active = 1 assignment from detect_init_APIC(), which is specific to UP_APIC, to setup_local_APIC(), which is called also in the SMP case. Do you intend to do suspend and resume on SMP boxes as well? If this is intensional, shouldn't device_apic be per-cpu?
/Mikael
Hi!
Quoted 7 lines
Quoted 1 line
So it seems to me it really is variable.
The original code has the property that apic_pm_state.active is true if and only if
detect_init_APIC()was called and succeeded, which implies thatapic_phys==mp_lapic_addr==APIC_DEFAULT_PHYS_BASE. You can also see thatapic_pm_resume()writesAPIC_DEFAULT_PHYS_BASEtoMSR_IA32_APICBASE, which only makes sense in this situation.
Ahha, sorry about previous comment. Yep, you are right. I wonder if I should BUG_ON() there, but I just cleaned it up for now.
Pavel
Signature · 2 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]
Hi!
Quoted 18 lines
Quoted 18 lines
Quoted 2 lines
Also,
apic_physis (or should be)APIC_DEFAULT_PHYS_BASE, so you shouldn't need to makeapic_physglobal.Really?
/* * If no local APIC can be found then set up a fake all * zeroes page to simulate the local APIC and another * one for the IO-APIC. */ if (!smp_found_config && detect_init_APIC()) { apic_phys = (unsigned long) alloc_bootmem_pages(PAGE_SIZE); apic_phys = __pa(apic_phys); } else apic_phys = mp_lapic_addr; set_fixmap_nocache(FIX_APIC_BASE, apic_phys);
Quoted 7 lines
Quoted 1 line
So it seems to me it really is variable.
The original code has the property that apic_pm_state.active is true if and only if
detect_init_APIC()was called and succeeded, which implies thatapic_phys==mp_lapic_addr==APIC_DEFAULT_PHYS_BASE. You can also see thatapic_pm_resume()writesAPIC_DEFAULT_PHYS_BASEtoMSR_IA32_APICBASE, which only makes sense in this situation.
Okay, I guess I do not rely on so complicated invariants...
Quoted 4 lines
You moved the apic_pm_state.active = 1 assignment from
detect_init_APIC(), which is specific toUP_APIC, tosetup_local_APIC(), which is called also in the SMP case. Do you intend to do suspend and resume on SMP boxes as well? If this is intensional, shouldn'tdevice_apicbe per-cpu?
Eventually, I do want suspend working on SMP machines, but that's still quite a long way to go: plan is to hot-unplug all but boot CPUs, then do suspend, then hot-plug them back.
Pavel
Signature · 2 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]