All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Anthony PERARD" <anthony.perard@vates.tech>
To: "Carlo Nonato" <carlo.nonato@minervasys.tech>
Cc: xen-devel@lists.xenproject.org, andrea.bastoni@minervasys.tech,
	marco.solieri@minervasys.tech, "Juergen Gross" <jgross@suse.com>
Subject: Re: [PATCH v10 06/12] tools: add support for cache coloring configuration
Date: Wed, 20 Nov 2024 16:25:25 +0000	[thread overview]
Message-ID: <Zz4NdBcbMLx3HywA@l14> (raw)
In-Reply-To: <20241119141329.44221-7-carlo.nonato@minervasys.tech>

Hi Carlo,

On Tue, Nov 19, 2024 at 03:13:23PM +0100, Carlo Nonato wrote:
> diff --git a/tools/libs/ctrl/xc_domain.c b/tools/libs/ctrl/xc_domain.c
> index e3538ec0ba..4ed339e6e4 100644
> --- a/tools/libs/ctrl/xc_domain.c
> +++ b/tools/libs/ctrl/xc_domain.c
> @@ -2195,6 +2195,41 @@ int xc_domain_soft_reset(xc_interface *xch,
>      domctl.domain = domid;
>      return do_domctl(xch, &domctl);
>  }
> +
> +int xc_domain_set_llc_colors(xc_interface *xch, uint32_t domid,
> +                             const unsigned int *llc_colors,

The hypercall seems to take a buffer of `uint32_t` for `llc_colors`, but
the parameter of the function is `unsigned int` instead, is there any
reason for them to be different?

> +                             unsigned int num_llc_colors)
> +{
> +    struct xen_domctl domctl = {};
> +    DECLARE_HYPERCALL_BUFFER(uint32_t, local);
> +    int ret = -1;
> +
> +    if ( num_llc_colors )
> +    {
> +        size_t bytes = sizeof(uint32_t) * num_llc_colors;
> +
> +        local = xc_hypercall_buffer_alloc(xch, local, bytes);
> +        if ( local == NULL )
> +        {
> +            PERROR("Could not allocate LLC colors for set_llc_colors");
> +            ret = -ENOMEM;

I think we are supposed to return -1 in case of error, see:
    https://elixir.bootlin.com/xen/v4.19.0/source/tools/include/xenctrl.h#L101

And there's nothing else to do, xc_hypercall_buffer_alloc() should
already have set `errno`, and PERROR() preserves it.

> +            goto out;
> +        }

Thanks,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


  reply	other threads:[~2024-11-20 16:25 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-19 14:13 [PATCH v10 00/12] Arm cache coloring Carlo Nonato
2024-11-19 14:13 ` [PATCH v10 01/12] xen/common: add cache coloring common code Carlo Nonato
2024-11-27 10:48   ` Michal Orzel
2024-11-27 13:24     ` Carlo Nonato
2024-11-27 13:57       ` Michal Orzel
2024-11-28 10:39   ` Jan Beulich
2024-11-19 14:13 ` [PATCH v10 02/12] xen/arm: add initial support for LLC coloring on arm64 Carlo Nonato
2024-11-27 14:32   ` Michal Orzel
2024-11-28 10:42   ` Jan Beulich
2024-11-19 14:13 ` [PATCH v10 03/12] xen/arm: permit non direct-mapped Dom0 construction Carlo Nonato
2024-11-28 10:34   ` Michal Orzel
2024-11-29  9:06     ` Carlo Nonato
2024-11-19 14:13 ` [PATCH v10 04/12] xen/arm: add Dom0 cache coloring support Carlo Nonato
2024-11-28 11:27   ` Michal Orzel
2024-11-19 14:13 ` [PATCH v10 05/12] xen: extend domctl interface for cache coloring Carlo Nonato
2024-11-19 14:13 ` [PATCH v10 06/12] tools: add support for cache coloring configuration Carlo Nonato
2024-11-20 16:25   ` Anthony PERARD [this message]
2024-11-21 11:48     ` Carlo Nonato
2024-11-20 16:48   ` Anthony PERARD
2024-11-19 14:13 ` [PATCH v10 07/12] xen/arm: add support for cache coloring configuration via device-tree Carlo Nonato
2024-11-28 12:00   ` Michal Orzel
2024-11-19 14:13 ` [PATCH v10 08/12] xen/page_alloc: introduce preserved page flags macro Carlo Nonato
2024-11-28 11:04   ` Jan Beulich
2024-11-29  9:32     ` Carlo Nonato
2024-11-29 11:09       ` Jan Beulich
2024-12-02 12:51         ` Andrea Bastoni
2024-12-02 14:28           ` Jan Beulich
2024-11-19 14:13 ` [PATCH v10 09/12] xen: add cache coloring allocator for domains Carlo Nonato
2024-11-28 11:43   ` Jan Beulich
2024-11-29  9:37     ` Carlo Nonato
2024-11-29 11:17       ` Jan Beulich
2024-11-19 14:13 ` [PATCH v10 10/12] xen/arm: add Xen cache colors command line parameter Carlo Nonato
2024-11-19 14:13 ` [PATCH v10 11/12] xen/arm: make consider_modules() available for xen relocation Carlo Nonato
2024-12-02  8:59   ` Michal Orzel
2024-11-19 14:13 ` [PATCH v10 12/12] xen/arm: add cache coloring support for Xen Carlo Nonato
2024-11-28 11:53   ` 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=Zz4NdBcbMLx3HywA@l14 \
    --to=anthony.perard@vates.tech \
    --cc=andrea.bastoni@minervasys.tech \
    --cc=carlo.nonato@minervasys.tech \
    --cc=jgross@suse.com \
    --cc=marco.solieri@minervasys.tech \
    --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.