Re: [PATCH v8 4/7] xen/serial: switch txbuf runtime allocation to xvmalloc

Stefano Stabellini <[email protected]>
Newsgroups gmane.comp.emulators.xen.devel
Message-ID <[email protected]>
On Mon, 27 Jul 2026, [email protected] wrote:

> From: Denis Mukhin <[email protected]> 
> 
> Switch 'txbuf' allocation to xvmalloc_array() since there is no
> hard requirement to have buffer physically contiguous.
> 
> Suggested-by: Jan Beulich <[email protected]>
> Signed-off-by: Denis Mukhin <[email protected]>

Reviewed-by: Stefano Stabellini <[email protected]>


> ---
> Changes since v7:
> - new patch
> ---
>  xen/drivers/char/serial.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c
> index e3c356408987..cf0abf1893e5 100644
> --- a/xen/drivers/char/serial.c
> +++ b/xen/drivers/char/serial.c
> @@ -12,6 +12,7 @@
>  #include <xen/param.h>
>  #include <xen/sections.h>
>  #include <xen/serial.h>
> +#include <xen/xvmalloc.h>
>  
>  #include <asm/processor.h>
>  
> @@ -524,8 +525,7 @@ void __init serial_async_transmit(struct serial_port *port)
>          serial_txbufsz = PAGE_SIZE;
>      while ( serial_txbufsz & (serial_txbufsz - 1) )
>          serial_txbufsz &= serial_txbufsz - 1;
> -    port->txbuf = alloc_xenheap_pages(
> -        get_order_from_bytes(serial_txbufsz), 0);
> +    port->txbuf = xvmalloc_array(char, serial_txbufsz);
>  }
>  
>  /*
> -- 
> 2.54.0
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.