linux/arch/powerpc/platforms
Michael Ellerman 9583922563 powerpc: Fix is_kvm_guest() / kvm_para_available()
Commit a21d1becaa ("powerpc: Reintroduce is_kvm_guest() as a fast-path
check") added is_kvm_guest() and changed kvm_para_available() to use it.

is_kvm_guest() checks a static key, kvm_guest, and that static key is
set in check_kvm_guest().

The problem is check_kvm_guest() is only called on pseries, and even
then only in some configurations. That means is_kvm_guest() always
returns false on all non-pseries and some pseries depending on
configuration. That's a bug.

For PR KVM guests this is noticable because they no longer do live
patching of themselves, which can be detected by the omission of a
message in dmesg such as:

  KVM: Live patching for a fast VM worked

To fix it make check_kvm_guest() an initcall, to ensure it's always
called at boot. It needs to be core so that it runs before
kvm_guest_init() which is postcore. To be an initcall it needs to return
int, where 0 means success, so update that.

We still call it manually in pSeries_smp_probe(), because that runs
before init calls are run.

Fixes: a21d1becaa ("powerpc: Reintroduce is_kvm_guest() as a fast-path check")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210623130514.2543232-1-mpe@ellerman.id.au
2021-06-25 14:47:19 +10:00
..
4xx powerpc/4xx: Don't unmap NULL mbase 2020-05-28 23:24:36 +10:00
8xx powerpc: bad_page_fault get registers from regs 2021-02-09 00:02:09 +11:00
40x powerpc: Remove IBM405 Erratum #77 2020-05-28 23:24:36 +10:00
44x powerpc/44x: fix spelling mistake in Kconfig "varients" -> "variants" 2021-04-23 01:38:04 +10:00
52xx powerpc/52xx: Add fallthrough in mpc52xx_wdt_ioctl() 2021-06-15 17:12:05 +10:00
82xx powerpc/82xx/*: Move PHB discovery 2021-02-09 00:02:06 +11:00
83xx powerpc/83xx: Fix build error when CONFIG_PCI=n 2021-02-11 23:28:51 +11:00
85xx powerpc/85xx: Fix declaration made after definition 2020-11-19 14:50:13 +11:00
86xx powerpc: Don't use 'struct ppc_inst' to reference instruction location 2021-06-17 00:09:00 +10:00
512x powerpc/512x: Move PHB discovery 2021-02-09 00:02:05 +11:00
amigaone powerpc/amigaone: Make amigaone_discover_phbs() static 2021-02-11 23:28:51 +11:00
book3s powerpc/vas: Move update_csb/dump_crb to common book3s platform 2021-06-20 21:58:56 +10:00
cell powerpc/spider-pci: Remove set but not used variable 'val' 2021-06-15 17:12:27 +10:00
chrp powerpc/chrp: Make hydra_init() static 2021-03-24 14:09:29 +11:00
embedded6xx powerpc/64s: avoid reloading (H)SRR registers if they are still valid 2021-06-25 00:06:55 +10:00
maple powerpc/pci: fix warning comparing pointer to 0 2021-03-29 13:22:13 +11:00
microwatt powerpc/microwatt: Add support for hardware random number generator 2021-06-21 21:16:32 +10:00
pasemi powerpc/64s: avoid reloading (H)SRR registers if they are still valid 2021-06-25 00:06:55 +10:00
powermac powerpc: Remove klimit 2021-06-25 00:07:10 +10:00
powernv powerpc/64s: avoid reloading (H)SRR registers if they are still valid 2021-06-25 00:06:55 +10:00
ps3 powerpc/ps3: Add dma_mask to ps3_dma_region 2021-06-10 21:44:58 +10:00
pseries powerpc: Fix is_kvm_guest() / kvm_para_available() 2021-06-25 14:47:19 +10:00
fsl_uli1575.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
Kconfig powerpc/64s: Make prom_init require RELOCATABLE 2021-06-25 14:47:19 +10:00
Kconfig.cputype powerpc/32s: Activate KUAP and KUEP by default 2021-06-17 00:09:08 +10:00
Makefile powerpc: Add Microwatt platform 2021-06-21 21:15:26 +10:00