public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org, Thomas Gleixner <tglx@kernel.org>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H . Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Subject: Re: [RFC PATCH 0/1] KVM: VMX: restore host CR2 after VM exit
Date: Thu, 23 Apr 2026 10:52:50 +0200	[thread overview]
Message-ID: <71d71392-fa97-4dcd-bc39-9fa5bd8e4f5d@virtuozzo.com> (raw)
In-Reply-To: <aekZxVXzxJ_sj4Ev@google.com>

On 4/22/26 20:56, Sean Christopherson wrote:
...
>> Patch properties:
>>
>>    - Hot path impact: one extra register compare in the common case,
>>      one extra MOV to CR2 under unlikely() when the guest modified CR2.
> 
> That's not unlikely.  The odds of guest CR2 matching host CR2 are basically zero.
> In practice, this likely adds two extra CR2 writes on the majority of entry/exit
> transitions.

Thank you very much for the review, Sean.

Agreed on the window: the patch only narrows the exposure, it doesn't close it.

I also mis-sold the cost. "One extra MOV to CR2 under unlikely()" is just wrong, how could i think of 
it, and thus it becomes expensive on a hot path, you are right.

With both points in hand, the patch doesn't carry its weight.
Dropping it.

--
Konstantin


      reply	other threads:[~2026-04-23  8:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-22 17:49 [RFC PATCH 0/1] KVM: VMX: restore host CR2 after VM exit Konstantin Khorenko
2026-04-22 17:50 ` [RFC PATCH 1/1] " Konstantin Khorenko
2026-04-22 18:56 ` [RFC PATCH 0/1] " Sean Christopherson
2026-04-23  8:52   ` Konstantin Khorenko [this message]

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=71d71392-fa97-4dcd-bc39-9fa5bd8e4f5d@virtuozzo.com \
    --to=khorenko@virtuozzo.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=pbonzini@redhat.com \
    --cc=ptikhomirov@virtuozzo.com \
    --cc=seanjc@google.com \
    --cc=tglx@kernel.org \
    --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