[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABgObfZMQ1qcQf-XLZaPGFzmbtoe3gGuMvXF-N0qo_5Z9jf+vg@mail.gmail.com>
Date: Mon, 2 Sep 2024 17:05:08 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Ashish Kalra <Ashish.Kalra@....com>
Cc: seanjc@...gle.com, dave.hansen@...ux.intel.com, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, x86@...nel.org, hpa@...or.com,
peterz@...radead.org, linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
thomas.lendacky@....com, michael.roth@....com, kexec@...ts.infradead.org,
linux-coco@...ts.linux.dev
Subject: Re: [PATCH] x86/sev: Fix host kdump support for SNP
On Tue, Aug 27, 2024 at 10:40 PM Ashish Kalra <Ashish.Kalra@....com> wrote:
> +void snp_decommision_all(void)
Should be spelled snp_decommission_all (with two "s").
> +static DEFINE_SPINLOCK(snp_decommision_lock);
Same here.
> /*
> * Only MSR_TSC_AUX is switched via the user return hook. EFER is switched via
> * the VMCB, and the SYSCALL/SYSENTER MSRs are handled by VMLOAD/VMSAVE.
> @@ -594,9 +597,97 @@ static inline void kvm_cpu_svm_disable(void)
>
> static void svm_emergency_disable(void)
> {
> + static atomic_t waiting_for_cpus_synchronized;
> + static bool synchronize_cpus_initiated;
> + static bool snp_decommision_handled;
Same here, and below throughout the function (also SNP_DECOMMISSION).
Please create a new function sev_emergency_disable(), with a stub in
svm.h if CONFIG_KVM_AMD_
> @@ -749,6 +749,7 @@ void sev_snp_init_protected_guest_state(struct kvm_vcpu *vcpu);
> int sev_gmem_prepare(struct kvm *kvm, kvm_pfn_t pfn, gfn_t gfn, int max_order);
> void sev_gmem_invalidate(kvm_pfn_t start, kvm_pfn_t end);
> int sev_private_max_mapping_level(struct kvm *kvm, kvm_pfn_t pfn);
> +void snp_decommision_all(void);
> #else
> static inline struct page *snp_safe_alloc_page_node(int node, gfp_t gfp)
> {
> @@ -779,7 +780,7 @@ static inline int sev_private_max_mapping_level(struct kvm *kvm, kvm_pfn_t pfn)
> {
> return 0;
> }
> -
> +static void snp_decommision_all(void);
This should be inline (and after the change above it should be
sev_emergency_disable(), not snp_decommission_all(), that is exported
from sev.c).
Thanks,
Paolo
Powered by blists - more mailing lists