From: Kele Huang <kele@cs.columbia.edu>
To: Christoph Hellwig <hch@infradead.org>
Cc: pbonzini@redhat.com, kvm@vger.kernel.org
Subject: Re: [1/1] KVM: restrict kvm_gfn_to_hva_cache_init() to only accept address ranges within one page
Date: Fri, 26 Apr 2024 23:50:11 -0400 [thread overview]
Message-ID: <CAOfLF_+QSvAQa9PSV2goxiY28w6=Nxd4kYb+WKdxLBc0xrmNQw@mail.gmail.com> (raw)
In-Reply-To: <ZitI9x3P43U8iuz4@infradead.org>
On Fri, Apr 26, 2024 at 2:26 AM Christoph Hellwig <hch@infradead.org> wrote:
>
> I don't really have enough knowledge to comment on the functionality,
> but this code structure is really odd to read.
>
> Try to handle error conditions with early returns first, please:
>
> if (unlikely(nr_pages_needed != 1))
> return -EINVAL;
> return __kvm_gfn_to_hva_cache_init(slots, ghc, gpa, len);
Thanks for the tip! This makes sense to me and I will take care of
this code structure.
prev parent reply other threads:[~2024-04-27 3:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-23 2:49 [1/1] KVM: restrict kvm_gfn_to_hva_cache_init() to only accept address ranges within one page Kele Huang
2024-04-26 1:16 ` Chen, Zide
[not found] ` <CAOfLF_L2UgSUyUsbiBDhLPskt2xLWujy1GBAhpcWzi2i3brAww@mail.gmail.com>
2024-04-26 4:18 ` Kele Huang
2024-04-26 16:17 ` Sean Christopherson
2024-04-27 4:27 ` Kele Huang
2024-04-29 20:13 ` Sean Christopherson
2024-04-30 19:29 ` Kele Huang
2024-04-26 6:25 ` Christoph Hellwig
2024-04-27 3:50 ` Kele Huang [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='CAOfLF_+QSvAQa9PSV2goxiY28w6=Nxd4kYb+WKdxLBc0xrmNQw@mail.gmail.com' \
--to=kele@cs.columbia.edu \
--cc=hch@infradead.org \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).