diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig index 48cfe9a89723..5399c8ca7267 100644 --- a/arch/arm64/kvm/Kconfig +++ b/arch/arm64/kvm/Kconfig @@ -92,6 +92,19 @@ config PROTECTED_NVHE_STACKTRACE If unsure, or not using protected nVHE (pKVM), say N. +config PKVM_DISABLE_STAGE2_ON_PANIC + bool "Disable the host stage-2 on panic" + default n + depends on NVHE_EL2_DEBUG + help + If panic occurs while the host lock is held and if, plagued by bad + luck the panic path triggers a host stage-2 memory abort, a lockup + would happen. The only way out is to disable the stage-2 page-table. + This however tamper the system security. This option should therefore + solely be enabled to debug specific issues. + + Just say N. + config PTDUMP_STAGE2_DEBUGFS bool "Present the stage-2 pagetables to debugfs" depends on KVM diff --git a/arch/arm64/kvm/hyp/nvhe/host.S b/arch/arm64/kvm/hyp/nvhe/host.S index 58f0cb2298cc..12254d3833aa 100644 --- a/arch/arm64/kvm/hyp/nvhe/host.S +++ b/arch/arm64/kvm/hyp/nvhe/host.S @@ -120,7 +120,7 @@ SYM_FUNC_START(__hyp_do_panic) mov x29, x0 -#ifdef CONFIG_NVHE_EL2_DEBUG +#ifdef CONFIG_PKVM_DISABLE_STAGE2_ON_PANIC /* Ensure host stage-2 is disabled */ mrs x0, hcr_el2 bic x0, x0, #HCR_VM