public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Shivansh Dhiman <shivansh.dhiman@amd.com>
Cc: pbonzini@redhat.com, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org,  tglx@linutronix.de, mingo@redhat.com,
	bp@alien8.de,  dave.hansen@linux.intel.com, x86@kernel.org,
	hpa@zytor.com, xin@zytor.com,  nikunj.dadhania@amd.com,
	santosh.shukla@amd.com
Subject: Re: [PATCH 6/7] KVM: SVM: Dump FRED context in dump_vmcb()
Date: Fri, 6 Mar 2026 18:03:49 -0800	[thread overview]
Message-ID: <aauHhQsIzJo68bW_@google.com> (raw)
In-Reply-To: <20260129063653.3553076-7-shivansh.dhiman@amd.com>

On Thu, Jan 29, 2026, Shivansh Dhiman wrote:
> Add fields related to FRED to dump_vmcb() to dump FRED context.
> 
> Signed-off-by: Shivansh Dhiman <shivansh.dhiman@amd.com>
> ---
>  arch/x86/kvm/svm/svm.c | 39 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 39 insertions(+)
> 
> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> index 374589784206..954df4eae90e 100644
> --- a/arch/x86/kvm/svm/svm.c
> +++ b/arch/x86/kvm/svm/svm.c
> @@ -3319,6 +3319,8 @@ static void dump_vmcb(struct kvm_vcpu *vcpu)
>  	pr_err("%-20s%016llx\n", "vmsa_pa:", control->vmsa_pa);
>  	pr_err("%-20s%016llx\n", "allowed_sev_features:", control->allowed_sev_features);
>  	pr_err("%-20s%016llx\n", "guest_sev_features:", control->guest_sev_features);
> +	pr_err("%-20s%016llx\n", "exit_int_data:", control->exit_int_data);
> +	pr_err("%-20s%016llx\n", "event_inj_data:", control->event_inj_data);
>  
>  	if (sev_es_guest(vcpu->kvm)) {
>  		save = sev_decrypt_vmsa(vcpu);
> @@ -3434,6 +3436,25 @@ static void dump_vmcb(struct kvm_vcpu *vcpu)
>  		       "r14:", vmsa->r14, "r15:", vmsa->r15);
>  		pr_err("%-15s %016llx %-13s %016llx\n",
>  		       "xcr0:", vmsa->xcr0, "xss:", vmsa->xss);
> +
> +		pr_err("%-27s %d %-18s%016llx\n",
> +		       "is_fred_enabled:", is_fred_enabled(vcpu),
> +		       "guest_evntinjdata:", vmsa->guest_event_inj_data);
> +		pr_err("%-12s %016llx %-18s%016llx\n",
> +		       "fred_config:", vmsa->fred_config,
> +		       "guest_exitintdata:", vmsa->guest_exit_int_data);
> +		pr_err("%-15s %016llx %-13s %016llx\n",
> +		       "fred_rsp0:", vmsa->fred_rsp0,
> +		       "fred_rsp1:", vmsa->fred_rsp1);
> +		pr_err("%-15s %016llx %-13s %016llx\n",
> +		       "fred_rsp2:", vmsa->fred_rsp2,
> +		       "fred_rsp3:", vmsa->fred_rsp3);
> +		pr_err("%-15s %016llx %-13s %016llx\n",
> +		       "fred_stklvls:", vmsa->fred_stklvls,
> +		       "fred_ssp1:", vmsa->fred_ssp1);
> +		pr_err("%-15s %016llx %-13s %016llx\n",
> +		       "fred_ssp2:", vmsa->fred_ssp2,
> +		       "fred_ssp3:", vmsa->fred_ssp3);
>  	} else {
>  		pr_err("%-15s %016llx %-13s %016lx\n",
>  		       "rax:", save->rax, "rbx:",
> @@ -3461,6 +3482,24 @@ static void dump_vmcb(struct kvm_vcpu *vcpu)
>  		       "r14:", vcpu->arch.regs[VCPU_REGS_R14],
>  		       "r15:", vcpu->arch.regs[VCPU_REGS_R15]);
>  #endif
> +		pr_err("%-26s %d %-18s %016llx\n",
> +		       "is_fred_enabled:", is_fred_enabled(vcpu),
> +		       "guest_evntinjdata:", save->guest_event_inj_data);
> +		pr_err("%-12s%016llx %-18s%016llx\n",
> +		       "fred_config:", save->fred_config,
> +		       "guest_exitintdata:", save->guest_exit_int_data);
> +		pr_err("%-15s %016llx %-13s %016llx\n",
> +		       "fred_rsp0:", save->fred_rsp0,
> +		       "fred_rsp1:", save->fred_rsp1);
> +		pr_err("%-15s %016llx %-13s %016llx\n",
> +		       "fred_rsp2:", save->fred_rsp2,
> +		       "fred_rsp3:", save->fred_rsp3);
> +		pr_err("%-15s %016llx %-13s %016llx\n",
> +		       "fred_stklvls:", save->fred_stklvls,
> +		       "fred_ssp1:", save->fred_ssp1);
> +		pr_err("%-15s %016llx %-13s %016llx\n",
> +		       "fred_ssp2:", save->fred_ssp2,
> +		       "fred_ssp3:", save->fred_ssp3);

These should all be gated on guest_cpu_cap_has(X86_FEATURE_FRED).  Just because
KVM can read and print garbage doesn't mean it should.

  reply	other threads:[~2026-03-07  2:03 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-29  6:36 [PATCH 0/7] KVM: SVM: Enable FRED support Shivansh Dhiman
2026-01-29  6:36 ` [PATCH 1/7] KVM: SVM: Initialize FRED VMCB fields Shivansh Dhiman
2026-03-07  1:58   ` Sean Christopherson
2026-03-09 17:46     ` Shivansh Dhiman
2026-03-09 18:57       ` Sean Christopherson
2026-03-11  4:18         ` Shivansh Dhiman
2026-03-27  6:41       ` Shivansh Dhiman
2026-01-29  6:36 ` [PATCH 2/7] KVM: SVM: Disable interception of FRED MSRs for FRED supported guests Shivansh Dhiman
2026-03-07  2:10   ` Sean Christopherson
2026-03-09 17:47     ` Shivansh Dhiman
2026-01-29  6:36 ` [PATCH 3/7] KVM: SVM: Save restore FRED_RSP0 " Shivansh Dhiman
2026-03-05 20:37   ` Shivansh Dhiman
2026-01-29  6:36 ` [PATCH 4/7] KVM: SVM: Populate FRED event data on event injection Shivansh Dhiman
2026-03-06 11:31   ` Paolo Bonzini
2026-03-09 19:47     ` Shivansh Dhiman
2026-01-29  6:36 ` [PATCH 5/7] KVM: SVM: Support FRED nested exception injection Shivansh Dhiman
2026-03-07  2:07   ` Sean Christopherson
2026-03-10 15:56     ` Shivansh Dhiman
2026-03-10 16:20       ` Sean Christopherson
2026-03-11  4:12         ` Shivansh Dhiman
2026-01-29  6:36 ` [PATCH 6/7] KVM: SVM: Dump FRED context in dump_vmcb() Shivansh Dhiman
2026-03-07  2:03   ` Sean Christopherson [this message]
2026-03-09 19:57     ` Shivansh Dhiman
2026-01-29  6:36 ` [PATCH 7/7] KVM: SVM: Enable save/restore of FRED MSRs Shivansh Dhiman
2026-03-07  2:14   ` Sean Christopherson
2026-03-09 18:20     ` Shivansh Dhiman
2026-02-06  9:22 ` [PATCH 0/7] KVM: SVM: Enable FRED support Shivansh Dhiman
2026-02-11  0:53   ` Andrew Cooper
2026-03-06  9:33     ` Shivansh Dhiman
2026-03-03 17:58 ` Shivansh Dhiman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aauHhQsIzJo68bW_@google.com \
    --to=seanjc@google.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nikunj.dadhania@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=santosh.shukla@amd.com \
    --cc=shivansh.dhiman@amd.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=xin@zytor.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox