|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v6 4/4] xen/console: switch conring runtime allocation to xvmalloc
On 02.06.2026 11:49, Roger Pau Monné wrote:
> On Fri, May 08, 2026 at 05:57:14PM -0700, dmukhin@xxxxxxxx wrote:
>> From: Denis Mukhin <dmukhin@xxxxxxxx>
>>
>> The console ring only needs to be virtually contiguous; it does not need
>> a naturally aligned or physically contiguous allocation. Replace the
>> runtime xenheap allocation in console_init_ring() with an xvmalloc-backed
>> buffer.
>>
>> Also clamp the user-configured ring size to the supported range and emit
>> warnings when the requested size is adjusted.
>>
>> Suggested-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>> Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>
>> ---
>> Changes since v5:
>> - switched to xvmalloc_array()
>> - fixed conring size checks
>> - corrected diagnostic messages
>> ---
>> xen/drivers/char/console.c | 27 +++++++++++++++++++++------
>> 1 file changed, 21 insertions(+), 6 deletions(-)
>>
>> diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
>> index 5cac87d052b9..29b9359468e7 100644
>> --- a/xen/drivers/char/console.c
>> +++ b/xen/drivers/char/console.c
>> @@ -33,6 +33,7 @@
>> #include <asm/setup.h>
>> #include <xen/sections.h>
>> #include <xen/consoled.h>
>> +#include <xen/xvmalloc.h>
>>
>> #ifdef CONFIG_X86
>> #include <asm/guest.h>
>> @@ -343,6 +344,7 @@ static void cf_check do_dec_thresh(unsigned char key,
>> bool unused)
>> static unsigned int __initdata opt_conring_size;
>> size_param("conring_size", opt_conring_size);
>>
>> +#define CONRING_SIZE_MIN (1U << 14)
>> #define _CONRING_SIZE (1U << CONFIG_CONRING_SHIFT)
>> #define CONRING_IDX_MASK(i) ((i) & (conring_size - 1))
>> static char __initdata _conring[_CONRING_SIZE];
>> @@ -464,20 +466,33 @@ void __init console_init_ring(void)
>> {
>> char *ring;
>> XENCONS_RING_IDX i, size;
>> - unsigned int order, memflags;
>> + unsigned int order;
>> unsigned long flags;
>>
>> if ( !opt_conring_size )
>> return;
>>
>> order = get_order_from_bytes(max(opt_conring_size, conring_size));
>> - memflags = MEMF_bits(crashinfo_maxaddr_bits);
>> - while ( (ring = alloc_xenheap_pages(order, memflags)) == NULL )
>> + size = PAGE_SIZE << order;
>> + if ( size != opt_conring_size )
>> {
>> - BUG_ON(order == 0);
>> - order--;
>> + opt_conring_size = size;
>> + printk(XENLOG_WARNING "Normalizing console ring size.\n");
Nit: Both here and ...
> I think you want to also specify to what it has been normalized, ie:
>
> "Normalizing command line console ring size %u to %u.\n", opt_conring_size,
> size
... here: No full stop at the end of log messages please.
Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |