From: dmkhn@proton.me
To: Jan Beulich <jbeulich@suse.com>
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech,
julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
sstabellini@kernel.org, dmukhin@ford.com,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v6] xen/console: introduce domain_console struct
Date: Fri, 11 Jul 2025 07:25:29 +0000 [thread overview]
Message-ID: <aHC8ZBcRAId5wYoZ@kraken> (raw)
In-Reply-To: <f0d82045-4492-4d13-b0b1-97f95ad81727@suse.com>
On Fri, Jul 11, 2025 at 07:59:27AM +0200, Jan Beulich wrote:
> On 11.07.2025 03:07, dmkhn@proton.me wrote:
> > On Thu, Jul 10, 2025 at 01:16:24PM +0200, Jan Beulich wrote:
> >> On 10.07.2025 03:35, dmkhn@proton.me wrote:
> >>> @@ -877,6 +873,16 @@ struct domain *domain_create(domid_t domid,
> >>>
> >>> /* All error paths can depend on the above setup. */
> >>>
> >>> + BUILD_BUG_ON(DOMAIN_CONSOLE_BUF_SIZE <= 0);
> >>
> >> While the "equals 0" case can in principle happen, the "less than" part
> >> is dead code (and hence this needs checking differently): The type of
> >> DOMAIN_CONSOLE_BUF_SIZE is an unsigned one, so wrapping through 0 will
> >> yield huge positive values.
> >>
> >>> + err = -ENOMEM;
> >>> + d->console = xzalloc_bytes(DOMAIN_CONSOLE_SIZE);
> >>
> >> As previously indicated, new code ought to use the xv*alloc family of
> >> functions, which deliberately doesn't include any ..._bytes() forms.
> >> Note how instead there is xvzalloc_flex_struct() for situations like
> >> the one here.
> >
> > Looks like xvzalloc_flex_struct() is not used anywhere in the code base...
>
> And what do you mean to tell me by that? xvmalloc_flex_struct() is used,
> and x[mz]alloc_flex_struct() uses are still in need of conversion (which
> is going to be a slow-going process).
Just an observation; I was not aware of these APIs and I was not aware that
there's some slow-going process of switching to preferred use of
xvzalloc_flex_struct().
>
> Jan
next prev parent reply other threads:[~2025-07-11 7:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-10 1:35 [PATCH v6] xen/console: introduce domain_console struct dmkhn
2025-07-10 11:16 ` Jan Beulich
2025-07-11 1:07 ` dmkhn
2025-07-11 5:59 ` Jan Beulich
2025-07-11 7:25 ` dmkhn [this message]
2025-07-11 10:12 ` Jan Beulich
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=aHC8ZBcRAId5wYoZ@kraken \
--to=dmkhn@proton.me \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=dmukhin@ford.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.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 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.