All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony@xenproject.org>
To: Ross Lagerwall <ross.lagerwall@citrix.com>
Cc: xen-devel@lists.xenproject.org,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>, Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH v3 4/5] libxc/PM: Ensure pxstat buffers are correctly sized
Date: Wed, 4 Jun 2025 17:30:42 +0200	[thread overview]
Message-ID: <aEBmouMKhk56UW8k@l14> (raw)
In-Reply-To: <20250527152635.2451449-5-ross.lagerwall@citrix.com>

On Tue, May 27, 2025 at 04:26:34PM +0100, Ross Lagerwall wrote:
> diff --git a/tools/libs/ctrl/xc_pm.c b/tools/libs/ctrl/xc_pm.c
> index ff7b5ada053f..0bd79031044f 100644
> --- a/tools/libs/ctrl/xc_pm.c
> +++ b/tools/libs/ctrl/xc_pm.c
> @@ -46,35 +46,34 @@ int xc_pm_get_pxstat(xc_interface *xch, int cpuid, struct xc_px_stat *pxpt)
>  {
>      struct xen_sysctl sysctl = {};
>      /* Sizes unknown until xc_pm_get_max_px */

This comment is wrong now and can be removed.

> -    DECLARE_NAMED_HYPERCALL_BOUNCE(trans, pxpt->trans_pt, 0, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
> -    DECLARE_NAMED_HYPERCALL_BOUNCE(pt, pxpt->pt, 0, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
> +    DECLARE_NAMED_HYPERCALL_BOUNCE(trans, pxpt->trans_pt,
> +                                   pxpt->total * pxpt->total * sizeof(uint64_t),
> +                                   XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
> +    DECLARE_NAMED_HYPERCALL_BOUNCE(pt, pxpt->pt,
> +                                   pxpt->total * sizeof(struct xc_px_val),
> +                                   XC_HYPERCALL_BUFFER_BOUNCE_BOTH);

The rest of the patch looks fine:
Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>

Thanks,

-- 
Anthony PERARD


  reply	other threads:[~2025-06-04 15:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-27 15:26 [PATCH v3 0/5] pmstat interface fixes Ross Lagerwall
2025-05-27 15:26 ` [PATCH v3 1/5] x86/pmstat: Check size of PMSTAT_get_pxstat buffers Ross Lagerwall
2025-06-05 10:10   ` Jan Beulich
2025-06-06  8:42     ` Ross Lagerwall
2025-05-27 15:26 ` [PATCH v3 2/5] public/sysctl: Clarify usage of pm_{px,cx}_stat Ross Lagerwall
2025-06-05 10:12   ` Jan Beulich
2025-05-27 15:26 ` [PATCH v3 3/5] cpufreq: Avoid potential buffer overrun and leak Ross Lagerwall
2025-06-05 10:13   ` Jan Beulich
2025-05-27 15:26 ` [PATCH v3 4/5] libxc/PM: Ensure pxstat buffers are correctly sized Ross Lagerwall
2025-06-04 15:30   ` Anthony PERARD [this message]
2025-05-27 15:26 ` [PATCH v3 5/5] libxc/PM: Retry get_pxstat if data is incomplete Ross Lagerwall

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=aEBmouMKhk56UW8k@l14 \
    --to=anthony@xenproject.org \
    --cc=anthony.perard@vates.tech \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=ross.lagerwall@citrix.com \
    --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.