The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Tom Lendacky <thomas.lendacky@amd.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	x86@kernel.org,  Paolo Bonzini <pbonzini@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	 Dave Hansen <dave.hansen@linux.intel.com>,
	Ingo Molnar <mingo@redhat.com>,
	 Thomas Gleixner <tglx@linutronix.de>,
	Michael Roth <michael.roth@amd.com>
Subject: Re: [PATCH] KVM: SVM: Update dump_ghcb() to use the GHCB snapshot fields
Date: Tue, 29 Apr 2025 08:22:00 -0700	[thread overview]
Message-ID: <aBDumDW9kWEotu0A@google.com> (raw)
In-Reply-To: <8f03878443681496008b1b37b7c4bf77a342b459.1745866531.git.thomas.lendacky@amd.com>

On Mon, Apr 28, 2025, Tom Lendacky wrote:
> @@ -3184,18 +3189,18 @@ static void dump_ghcb(struct vcpu_svm *svm)
>  		return;
>  	}
>  
> -	nbits = sizeof(ghcb->save.valid_bitmap) * 8;
> +	nbits = sizeof(svm->sev_es.valid_bitmap) * 8;

I'm planning on adding this comment to explain the use of KVM's snapshot.  Please
holler if it's wrong/misleading in any way.

	/*
	 * Print KVM's snapshot of the GHCB that was (unsuccessfully) used to
	 * handle the exit.  If the guest has since modified the GHCB itself,
	 * dumping the raw GHCB won't help debug why KVM was unable to handle
	 * the VMGEXIT that KVM observed.
	 */

>  	pr_err("GHCB (GPA=%016llx):\n", svm->vmcb->control.ghcb_gpa);
>  	pr_err("%-20s%016llx is_valid: %u\n", "sw_exit_code",
> -	       ghcb->save.sw_exit_code, ghcb_sw_exit_code_is_valid(ghcb));
> +	       kvm_ghcb_get_sw_exit_code(control), kvm_ghcb_sw_exit_code_is_valid(svm));
>  	pr_err("%-20s%016llx is_valid: %u\n", "sw_exit_info_1",
> -	       ghcb->save.sw_exit_info_1, ghcb_sw_exit_info_1_is_valid(ghcb));
> +	       control->exit_info_1, kvm_ghcb_sw_exit_info_1_is_valid(svm));
>  	pr_err("%-20s%016llx is_valid: %u\n", "sw_exit_info_2",
> -	       ghcb->save.sw_exit_info_2, ghcb_sw_exit_info_2_is_valid(ghcb));
> +	       control->exit_info_2, kvm_ghcb_sw_exit_info_2_is_valid(svm));
>  	pr_err("%-20s%016llx is_valid: %u\n", "sw_scratch",
> -	       ghcb->save.sw_scratch, ghcb_sw_scratch_is_valid(ghcb));
> -	pr_err("%-20s%*pb\n", "valid_bitmap", nbits, ghcb->save.valid_bitmap);
> +	       svm->sev_es.sw_scratch, kvm_ghcb_sw_scratch_is_valid(svm));
> +	pr_err("%-20s%*pb\n", "valid_bitmap", nbits, svm->sev_es.valid_bitmap);
>  }

  reply	other threads:[~2025-04-29 15:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-28 18:55 [PATCH] KVM: SVM: Update dump_ghcb() to use the GHCB snapshot fields Tom Lendacky
2025-04-29 15:22 ` Sean Christopherson [this message]
2025-04-29 16:31   ` Liam Merwick
2025-04-29 17:33     ` Tom Lendacky
2025-04-29 17:56       ` Sean Christopherson
2025-04-29 17:03   ` Tom Lendacky
2025-05-02 21:50 ` Sean Christopherson
2025-05-02 21:54   ` Tom Lendacky

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=aBDumDW9kWEotu0A@google.com \
    --to=seanjc@google.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.roth@amd.com \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.org \
    /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