summary refs log tree commit diff stats
path: root/include/hw/boards.h
diff options
context:
space:
mode:
authorLi Chen <chenl311@chinatelecom.cn>2025-05-28 18:53:35 +0800
committerMichael S. Tsirkin <mst@redhat.com>2025-07-14 09:16:40 -0400
commit54401d5abd13c7f2ff5d1cb65e73a067743230e3 (patch)
treed937e78fa64635f4c3799ae602d3dbfa0592cc5a /include/hw/boards.h
parent5788929e05e18ed5f76dc8ade4210f022c9ba5a1 (diff)
downloadfocaccia-qemu-54401d5abd13c7f2ff5d1cb65e73a067743230e3.tar.gz
focaccia-qemu-54401d5abd13c7f2ff5d1cb65e73a067743230e3.zip
acpi: Add machine option to disable SPCR table
The ACPI SPCR (Serial Port Console Redirection) table allows firmware
to specify a preferred serial console device to the operating system.
On ARM64 systems, Linux by default respects this table: even if the
kernel command line does not include a hardware serial console (e.g.,
"console=ttyAMA0"), the kernel still register the serial device
referenced by SPCR as a printk console.

While this behavior is standard-compliant, it can lead to situations
where guest console behavior is influenced by platform firmware rather
than user-specified configuration. To make guest console behavior more
predictable and under user control, this patch introduces a machine
option to explicitly disable SPCR table exposure:

    -machine spcr=off

By default, the option is enabled (spcr=on), preserving existing
behavior. When disabled, QEMU will omit the SPCR table from the guest's
ACPI namespace, ensuring that only consoles explicitly declared in the
kernel command line are registered.

Signed-off-by: Li Chen <chenl311@chinatelecom.cn>
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Message-Id: <20250528105404.457729-2-me@linux.beauty>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/hw/boards.h')
-rw-r--r--include/hw/boards.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/hw/boards.h b/include/hw/boards.h
index f424b2b505..f94713e6e2 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -443,6 +443,7 @@ struct MachineState {
     SmpCache smp_cache;
     struct NVDIMMState *nvdimms_state;
     struct NumaState *numa_state;
+    bool acpi_spcr_enabled;
 };
 
 /*