[SRU][F/aws][PATCH v3 5/6] x86/kvm: Disable all PV features on crash

Krzysztof Kozlowski krzysztof.kozlowski at canonical.com
Thu May 20 17:06:42 UTC 2021


On 19/05/2021 11:15, Andrea Righi wrote:
> From: Vitaly Kuznetsov <vkuznets at redhat.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1920944
> 
> Crash shutdown handler only disables kvmclock and steal time, other PV
> features remain active so we risk corrupting memory or getting some
> side-effects in kdump kernel. Move crash handler to kvm.c and unify
> with CPU offline.
> 
> Signed-off-by: Vitaly Kuznetsov <vkuznets at redhat.com>
> Message-Id: <20210414123544.1060604-5-vkuznets at redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
> (backported from 3d6b84132d2a57b5a74100f6923a8feb679ac2ce)
> Signed-off-by: Andrea Righi <andrea.righi at canonical.com>
> ---
>  arch/x86/include/asm/kvm_para.h |  5 ----
>  arch/x86/kernel/kvm.c           | 44 ++++++++++++++++++++++++---------
>  arch/x86/kernel/kvmclock.c      | 21 ----------------
>  3 files changed, 32 insertions(+), 38 deletions(-)
> 
> diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h
> index a617fd360023..7ff8ad490a78 100644
> --- a/arch/x86/include/asm/kvm_para.h
> +++ b/arch/x86/include/asm/kvm_para.h
> @@ -91,7 +91,6 @@ unsigned int kvm_arch_para_hints(void);
>  void kvm_async_pf_task_wait(u32 token, int interrupt_kernel);
>  void kvm_async_pf_task_wake(u32 token);
>  u32 kvm_read_and_reset_pf_reason(void);
> -extern void kvm_disable_steal_time(void);

Why this was made extern? Original patch does not have it.

>  void do_async_page_fault(struct pt_regs *regs, unsigned long error_code, unsigned long address);
>  
>  #ifdef CONFIG_PARAVIRT_SPINLOCKS
> @@ -126,10 +125,6 @@ static inline u32 kvm_read_and_reset_pf_reason(void)
>  	return 0;
>  }
>  
> -static inline void kvm_disable_steal_time(void)
> -{
> -	return;
> -}
>  #endif
>  
>  #endif /* _ASM_X86_KVM_PARA_H */


Best regards,
Krzysztof



More information about the kernel-team mailing list