[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aBESvsREQ51B8AzJ@google.com>
Date: Tue, 29 Apr 2025 10:56:14 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: Tom Lendacky <thomas.lendacky@....com>
Cc: Liam Merwick <liam.merwick@...cle.com>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, x86@...nel.org,
Paolo Bonzini <pbonzini@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>, Michael Roth <michael.roth@....com>
Subject: Re: [PATCH] KVM: SVM: Update dump_ghcb() to use the GHCB snapshot fields
On Tue, Apr 29, 2025, Tom Lendacky wrote:
> On 4/29/25 11:31, Liam Merwick wrote:
> > On 29/04/2025 16:22, Sean Christopherson wrote:
> >> 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);
> >
> > Would printing "GHCB snapshot (GPA= ...." here instead of just "GHCB (GPA=
> > ..."
> > help gently remind people just looking at the debug output of this too?
>
> Except the GPA is that of the actual GHCB. And the values being printed
> are the actual values sent by the guest and being used by KVM at the time
> the GHCB was read. So I'm not sure if that would clear things up at all.
I personally like the "snapshot" addendum. Yes, the GPA is the GPA of the GHCB,
but it also the GPA from which the snapshot was obtained. Ditto for the values.
For folks that aren't aware that KVM operates on a snapshot of the GHCB, they
could end up really confused if they somehow have access to the raw GHCB, e.g.
from the guest side or something.
Powered by blists - more mailing lists