[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tools: Use posix_memalign instead of valloc for NetBSD


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Frediano Ziglio <freddy77@xxxxxxxxx>
  • Date: Fri, 26 Jun 2026 16:07:11 +0100
  • Arc-authentication-results: i=1; mx.google.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Kk8iyG32hvChxbpiDFLzLYzsZZHXYFo2LAI2DSu4lnw=; fh=QI3tLj5CQG0QL/Oi+zkPuYY3Kh/8qf0tAE5qJavUS+U=; b=KjqZvU89Chkemm/E4F9LZoOCZzQSqyahZJQYaB7RRD2XBJFacQVErKZRgwW12DtYAy P2n5u02o8AghMG1VX1nUnS+YGOf6gA7qDix/Sh9mXl5ekMW4vS2qA32VqeHJY+9hMvCo /0MlttITW7a0Ni6J+sU0SMV/SNr4kRc4GFAaZleyRJwHNRCJtv6rNzKQX3e+yfld0DoY fgghW9uZw3Kv8z2syZkplm/cqfwwwqXDol1OxQhLvMHkNnMYsZDRBCQ+/DBGYCXndwoh OWLsN3vlHw6cCCqIbPY/Vz1Jf6G3nm6ZXuZBGPN9XwA9moNLImE7CpjaSRPCLQb2SitU oUIQ==; darn=lists.xenproject.org
  • Arc-seal: i=1; a=rsa-sha256; t=1782486443; cv=none; d=google.com; s=arc-20260327; b=c3MLzg6ffOYX+Fz/oZ7Ls+QZDho6gkTonRbR591GVkj4BKUTMqN6w7X9k+Mi52uxaC QOIpuJlJ726b29cDi4GMitjC/pOjOszJ7JrgY7WWNCLqtp04AdzLuPmgT2UT2fJiNZcb VyDMHADPBv0KIEPTlH2nnrJw6YhDPHGSQ2KyOLz+YeoWesTcADjp49YL6ongRoXFNE0s izAU45S8zDEhz+hNljvRiJbcplIuGGMCT+m30PYUAKtQNvsAAjXOI4RtQr9xA79g9zXw Si1m0vdj+5+IbI0TAm1og+PpR7XUaLzpWpwoM0huIL4LQyThlL2xJw2Q8zESH34JJUxU TQkQ==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
  • Cc: bouyer@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, Frediano Ziglio <frediano.ziglio@xxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Fri, 26 Jun 2026 15:07:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, 30 Apr 2026 at 11:48, Roger Pau Monné <roger.pau@xxxxxxxxxx> wrote:
>
> Adding Manuel that maintains the NetBSD xen-tools package.
>
> On Thu, Apr 30, 2026 at 10:55:21AM +0100, Frediano Ziglio wrote:
> > More similar to other implementation.
> > posix_memalign was adde in NetBSD 8.0, released on July 17, 2018
> > and went out of support on May 4, 2024.
> >
> > Signed-off-by: Frediano Ziglio <frediano.ziglio@xxxxxxxxx>
> > ---
> >  tools/include/xenctrl.h     | 5 +++++
> >  tools/libs/ctrl/xc_netbsd.c | 9 ++++++++-
> >  2 files changed, 13 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
> > index d5dbf69c89..f4316089e7 100644
> > --- a/tools/include/xenctrl.h
> > +++ b/tools/include/xenctrl.h
> > @@ -1390,6 +1390,11 @@ int xc_lockprof_query(xc_interface *xch,
> >                        uint64_t *time,
> >                        xc_hypercall_buffer_t *data);
> >
> > +/**
> > + * Allocate memory with a given alignment.
> > + * The alignment must be a power of 2 and at least sizeof(void*).
> > + * It returns NULL on error, errno is not set.
> > + */
> >  void *xc_memalign(xc_interface *xch, size_t alignment, size_t size);
> >
> >  /**
> > diff --git a/tools/libs/ctrl/xc_netbsd.c b/tools/libs/ctrl/xc_netbsd.c
> > index 1318d4d906..d27154dce9 100644
> > --- a/tools/libs/ctrl/xc_netbsd.c
> > +++ b/tools/libs/ctrl/xc_netbsd.c
> > @@ -60,7 +60,14 @@ void discard_file_cache(xc_interface *xch, int fd, int 
> > flush)
> >
> >  void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
> >  {
> > -    return valloc(size);
> > +    int ret;
> > +    void *ptr;
> > +
> > +    ret = posix_memalign(&ptr, alignment, size);
> > +    if (ret != 0 || !ptr)
> > +        return NULL;
> > +
> > +    return ptr;
> >  }
> >
> >  int xc_pcidev_get_gsi(xc_interface *xch, uint32_t sbdf)
> > --
> > 2.43.0
> >

I saw Manuel reply almost 2 months ago.
Still pending.

Frediano



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.