]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
console: allocate ring buffer earlier
authorJan Beulich <jbeulich@suse.com>
Mon, 15 Dec 2014 08:30:05 +0000 (09:30 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 15 Dec 2014 08:30:05 +0000 (09:30 +0100)
... when "conring_size=" was specified on the command line. We can't
really do this as early as we would want to when the option was not
specified, as the default depends on knowing the system CPU count. Yet
the parsing of the ACPI tables is one of the things that generates a
lot of output especially on large systems.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com> (ARM and generic bits)
Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/arch/arm/setup.c
xen/arch/x86/setup.c
xen/drivers/char/console.c
xen/include/xen/console.h

index d2dcc3a71fc3d833be92be94b80c9a7ef6129fbb..3991d64cc009671b429013b6d3d44910f28e9886 100644 (file)
@@ -745,6 +745,7 @@ void __init start_xen(unsigned long boot_phys_offset,
 
     dt_uart_init();
     console_init_preirq();
+    console_init_ring();
 
     system_state = SYS_STATE_boot;
 
index 73e95c69a73166b8f0da8e2ad4fd07a3bb993702..c27c49c347cb13c0114aef371b6586834b31c763 100644 (file)
@@ -1187,6 +1187,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     }
 
     vm_init();
+    console_init_ring();
     vesa_init();
 
     softirq_init();
index 2f03259610a9e59304aa7969b4e864adac404cbf..0b8d3d4a4d488c01c85eb1f687511d7414e7ee80 100644 (file)
@@ -744,15 +744,14 @@ void __init console_init_preirq(void)
     }
 }
 
-void __init console_init_postirq(void)
+void __init console_init_ring(void)
 {
     char *ring;
     unsigned int i, order, memflags;
-
-    serial_init_postirq();
+    unsigned long flags;
 
     if ( !opt_conring_size )
-        opt_conring_size = num_present_cpus() << (9 + xenlog_lower_thresh);
+        return;
 
     order = get_order_from_bytes(max(opt_conring_size, conring_size));
     memflags = MEMF_bits(crashinfo_maxaddr_bits);
@@ -763,17 +762,30 @@ void __init console_init_postirq(void)
     }
     opt_conring_size = PAGE_SIZE << order;
 
-    spin_lock_irq(&console_lock);
+    spin_lock_irqsave(&console_lock, flags);
     for ( i = conringc ; i != conringp; i++ )
         ring[i & (opt_conring_size - 1)] = conring[i & (conring_size - 1)];
     conring = ring;
     smp_wmb(); /* Allow users of console_force_unlock() to see larger buffer. */
     conring_size = opt_conring_size;
-    spin_unlock_irq(&console_lock);
+    spin_unlock_irqrestore(&console_lock, flags);
 
     printk("Allocated console ring of %u KiB.\n", opt_conring_size >> 10);
 }
 
+void __init console_init_postirq(void)
+{
+    serial_init_postirq();
+
+    if ( conring != _conring )
+        return;
+
+    if ( !opt_conring_size )
+        opt_conring_size = num_present_cpus() << (9 + xenlog_lower_thresh);
+
+    console_init_ring();
+}
+
 void __init console_endboot(void)
 {
     int i, j;
index cfb07a23e04b3c5f249c7144e39c675c066ad810..c7fd9ca8ea0859eb4fccd7f85871a518a1841e8b 100644 (file)
@@ -14,6 +14,7 @@ struct xen_sysctl_readconsole;
 long read_console_ring(struct xen_sysctl_readconsole *op);
 
 void console_init_preirq(void);
+void console_init_ring(void);
 void console_init_postirq(void);
 void console_endboot(void);
 int console_has(const char *device);