All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Ackerley Tng <ackerleytng@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Sashiko Bot <sashiko-bot@kernel.org>,
	Yan Zhao <yan.y.zhao@intel.com>,
	 Binbin Wu <binbin.wu@linux.intel.com>,
	Haotian Jiang <jianghaotian.sunday@gmail.com>
Subject: Re: [PATCH v2 0/2] KVM: TDX: INIT_MEM_REGION fixes
Date: Tue, 22 Sep 2026 11:50:33 -0700	[thread overview]
Message-ID: <arLN-ZrD1oQETuPk@google.com> (raw)
In-Reply-To: <CAEvNRgFZBHqiZuXawTjDU1oPR=u3yqBzXW5ku+B2rvMAbBM3vA@mail.gmail.com>

On Tue, Sep 22, 2026, Ackerley Tng wrote:
> Sean Christopherson <seanjc@google.com> writes:
> 
> > I completely lost track of this, meant to post these patches weeks ago.
> > Compile tested only.
> >
> > v2:
> >  - Fix an off-by-one bug.
> >  - Use gpa_t instead of raw u64.
> >  - Tweak the order of checks to bundle similar checks together, and to perform
> >    the super basic checks (alignment, size, etc.) first.
> >
> > v1: https://lore.kernel.org/all/ak0skG064rhKUC8d@google.com
> >
> > Haotian Jiang (1):
> >   KVM: TDX: Reject INIT_MEM_REGION if number of bytes would overflow a
> >     u64
> >
> > Sean Christopherson (1):
> >   KVM: TDX: Fix a benign off-by-one bug on the end GPA for
> >     INIT_MEM_REGION
> >
> >  arch/x86/kvm/vmx/tdx.c | 10 +++++++---
> >  1 file changed, 7 insertions(+), 3 deletions(-)
> >
> >
> > base-commit: a806d364ef288a6443a1337820ea8410a7ccc6b3
> > --
> > 2.55.0.679.g6767b8d81c-goog
> 
> Looks good to me, just a question on the use of check_*_overflow: I
> thought Sean didn't like burying an out-param in an if-statement? [1]

I don't, but in this case I found it to be the lesser evil.  I think it helps
that both the out-params are used only in the same if-statement.  One could argue
that's even *more* evil, but t doesn't "surprise" me as much, e.g. I'm not having
to hunt for where some variable in the main loop is set.

> [1] https://lore.kernel.org/all/ag8BmtzxTlcuA_zy@google.com

      reply	other threads:[~2026-09-22 18:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06 17:06 [PATCH v2 0/2] KVM: TDX: INIT_MEM_REGION fixes Sean Christopherson
2026-08-06 17:06 ` [PATCH v2 1/2] KVM: TDX: Reject INIT_MEM_REGION if number of bytes would overflow a u64 Sean Christopherson
2026-08-10  6:27   ` Yan Zhao
2026-08-10  8:45   ` Binbin Wu
2026-08-06 17:06 ` [PATCH v2 2/2] KVM: TDX: Fix a benign off-by-one bug on the end GPA for INIT_MEM_REGION Sean Christopherson
2026-08-10  6:58   ` Yan Zhao
2026-08-10  9:23   ` Binbin Wu
2026-09-21 14:05 ` [PATCH v2 0/2] KVM: TDX: INIT_MEM_REGION fixes Sean Christopherson
2026-09-22 18:05 ` Ackerley Tng
2026-09-22 18:50   ` Sean Christopherson [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=arLN-ZrD1oQETuPk@google.com \
    --to=seanjc@google.com \
    --cc=ackerleytng@google.com \
    --cc=binbin.wu@linux.intel.com \
    --cc=jianghaotian.sunday@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=sashiko-bot@kernel.org \
    --cc=yan.y.zhao@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.