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

[xen staging] xen/serial: switch txbuf runtime allocation to xvmalloc



commit b8625a9fdbaa036def27855ea3f9267bcc9d0f73
Author:     Denis Mukhin <dmukhin@xxxxxxxx>
AuthorDate: Wed Aug 12 10:47:21 2026 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Aug 12 10:47:21 2026 +0200

    xen/serial: switch txbuf runtime allocation to xvmalloc
    
    Switch 'txbuf' allocation to xvmalloc_array() since there is no
    hard requirement to have buffer physically contiguous.
    
    Suggested-by: Jan Beulich <jbeulich@xxxxxxxx>
    Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>
    Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 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 e3c3564089..cf0abf1893 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);
 }
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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