Use of paravirt_enabled() should be avoided at all costs in the kernel, we will be removing it. This page documents its current uses and plan of attack of how to replace them. We break things down into things with a solution already brewed and patches posted or soon to be posted and with pending items. Review the last discussion on this here .
Replacement completed on its way upstream one way or another
arch/x86/kernel/cpu/microcode/core.c: patch posted by Boris Ostrovsky x86, microcode: Remove unnecessary paravirt_enabled check
arch/x86/mm/dump_pagetables.c: patch posted by Boris Petkov x86/ptdump: Remove paravirt_enabled()
arch/x86/kernel/head.c reserve_ebda_region(): patch posted by Luis x86/init: make ebda depend on PC subarch - uses PC subarch
arch/x86/kernel/apm_32.c: patch posted by Luis apm32: remove paravirt_enabled() use relies on relevant boot params being zero, follow up patch just in case for lguest by Luis and another one to clear bss on Xen by Boris Ostrovsky (independent of Luis' series)
arch/x86/kernel/tboot.c: patch posted by Luis x86/tboot: remove paravirt_enabledAs with apm, relies on the respective boot params being zero
arch/x86/kernel/cpu/intel.c: f00f_workaround, patch posted by Luis x86/cpu/intel: replace paravirt_enabled for f00f work around - although Andy notes it should be safe to run this on guests, for now we can just use the subarch to be safe
arch/x86/kernel/rtc.c: patch posted by Luis x86/rtc: replace paravirt_enabled check with subarch check - folds no CMOS RTC paravirt flag to a generic x86 flag
drivers/pnp/pnpbios/core.c: patch posted by Luis pnpbios: replace paravirt_enabled() check with subarch checks - uses subarch
Replacement being brewed
- arch/x86/entry/entry_32.S: Andy notes that: "this is actually trying to check whether pv_cpu_ops.iret == native_iret. I sincerely hope that no additional support is *ever* added to x86 Linux for systems on which this is not the case."Andy noted perhaps we can rearrange the code a bit to look more like the 64-bit version, and referred to commit 7209a75d2009dbf7745e2fd354abf25c3deb3ca3 as a reference. Andy noted he'd work on this.