Fix lack of keyboard in SeaBIOS/grub/FreeDOS
cover Fix lack of keyboard in SeaBIOS/grub/FreeDOS
It's too late for actual SeaBIOS fix to get merged in time for 7.2 so here goes a workaround in QEMU.
See patch 2/3 for full description.
Igor Mammedov (3):
tests: acpi: whitelist DSDT before moving PRQx to _SB scope
acpi: x86: move RPQx field back to _SB scope
tests: acpi: x86: update expected DSDT after moving PRQx fields in _SB
scope
hw/isa/lpc_ich9.c | 16 ++++------------ hw/isa/piix3.c | 12 ++++-------- tests/data/acpi/pc/DSDT | Bin 6501 -> 6458 bytes tests/data/acpi/pc/DSDT.acpierst | Bin 6461 -> 6418 bytes tests/data/acpi/pc/DSDT.acpihmat | Bin 7826 -> 7783 bytes tests/data/acpi/pc/DSDT.bridge | Bin 9575 -> 9532 bytes tests/data/acpi/pc/DSDT.cphp | Bin 6965 -> 6922 bytes tests/data/acpi/pc/DSDT.dimmpxm | Bin 8155 -> 8112 bytes tests/data/acpi/pc/DSDT.hpbridge | Bin 6461 -> 6418 bytes tests/data/acpi/pc/DSDT.hpbrroot | Bin 3107 -> 3064 bytes tests/data/acpi/pc/DSDT.ipmikcs | Bin 6573 -> 6530 bytes tests/data/acpi/pc/DSDT.memhp | Bin 7860 -> 7817 bytes tests/data/acpi/pc/DSDT.nohpet | Bin 6359 -> 6316 bytes tests/data/acpi/pc/DSDT.numamem | Bin 6507 -> 6464 bytes tests/data/acpi/pc/DSDT.roothp | Bin 6699 -> 6656 bytes tests/data/acpi/q35/DSDT | Bin 8412 -> 8310 bytes tests/data/acpi/q35/DSDT.acpierst | Bin 8429 -> 8327 bytes tests/data/acpi/q35/DSDT.acpihmat | Bin 9737 -> 9635 bytes tests/data/acpi/q35/DSDT.acpihmat-noinitiator | Bin 8691 -> 8589 bytes tests/data/acpi/q35/DSDT.applesmc | Bin 8458 -> 8356 bytes tests/data/acpi/q35/DSDT.bridge | Bin 11541 -> 11439 bytes tests/data/acpi/q35/DSDT.core-count2 | Bin 32552 -> 32450 bytes tests/data/acpi/q35/DSDT.cphp | Bin 8876 -> 8774 bytes tests/data/acpi/q35/DSDT.cxl | Bin 9738 -> 9636 bytes tests/data/acpi/q35/DSDT.dimmpxm | Bin 10066 -> 9964 bytes tests/data/acpi/q35/DSDT.ipmibt | Bin 8487 -> 8385 bytes tests/data/acpi/q35/DSDT.ipmismbus | Bin 8500 -> 8398 bytes tests/data/acpi/q35/DSDT.ivrs | Bin 8429 -> 8327 bytes tests/data/acpi/q35/DSDT.memhp | Bin 9771 -> 9669 bytes tests/data/acpi/q35/DSDT.mmio64 | Bin 9542 -> 9440 bytes tests/data/acpi/q35/DSDT.multi-bridge | Bin 8732 -> 8630 bytes tests/data/acpi/q35/DSDT.nohpet | Bin 8270 -> 8168 bytes tests/data/acpi/q35/DSDT.numamem | Bin 8418 -> 8316 bytes tests/data/acpi/q35/DSDT.pvpanic-isa | Bin 8513 -> 8411 bytes tests/data/acpi/q35/DSDT.tis.tpm12 | Bin 9018 -> 8916 bytes tests/data/acpi/q35/DSDT.tis.tpm2 | Bin 9044 -> 8942 bytes tests/data/acpi/q35/DSDT.viot | Bin 9521 -> 9419 bytes tests/data/acpi/q35/DSDT.xapic | Bin 35775 -> 35673 bytes 38 files changed, 8 insertions(+), 20 deletions(-)
Signature · 1 line
2.31.1
PATCH 1/3 tests: acpi: whitelist DSDT before moving PRQx to _SB scope
--- tests/qtest/bios-tables-test-allowed-diff.h | 36 +++++++++++++++++++++ 1 file changed, 36 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +36 -0
@@ -1 +1,37 @@/* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/pc/DSDT" , +"tests/data/acpi/pc/DSDT.acpierst" , +"tests/data/acpi/pc/DSDT.acpihmat" , +"tests/data/acpi/pc/DSDT.bridge" , +"tests/data/acpi/pc/DSDT.cphp" , +"tests/data/acpi/pc/DSDT.dimmpxm" , +"tests/data/acpi/pc/DSDT.hpbridge" , +"tests/data/acpi/pc/DSDT.hpbrroot" , +"tests/data/acpi/pc/DSDT.ipmikcs" , +"tests/data/acpi/pc/DSDT.memhp" , +"tests/data/acpi/pc/DSDT.nohpet" , +"tests/data/acpi/pc/DSDT.numamem" , +"tests/data/acpi/pc/DSDT.roothp" , +"tests/data/acpi/q35/DSDT" , +"tests/data/acpi/q35/DSDT.acpierst" , +"tests/data/acpi/q35/DSDT.acpihmat" , +"tests/data/acpi/q35/DSDT.acpihmat-noinitiator" , +"tests/data/acpi/q35/DSDT.applesmc" , +"tests/data/acpi/q35/DSDT.bridge" , +"tests/data/acpi/q35/DSDT.cphp" , +"tests/data/acpi/q35/DSDT.cxl" , +"tests/data/acpi/q35/DSDT.core-count2" , +"tests/data/acpi/q35/DSDT.dimmpxm" , +"tests/data/acpi/q35/DSDT.ipmibt" , +"tests/data/acpi/q35/DSDT.ipmismbus" , +"tests/data/acpi/q35/DSDT.ivrs" , +"tests/data/acpi/q35/DSDT.memhp" , +"tests/data/acpi/q35/DSDT.mmio64" , +"tests/data/acpi/q35/DSDT.multi-bridge" , +"tests/data/acpi/q35/DSDT.nohpet" , +"tests/data/acpi/q35/DSDT.numamem" , +"tests/data/acpi/q35/DSDT.pvpanic-isa" , +"tests/data/acpi/q35/DSDT.tis.tpm12" , +"tests/data/acpi/q35/DSDT.tis.tpm2" , +"tests/data/acpi/q35/DSDT.viot" , +"tests/data/acpi/q35/DSDT.xapic",
Signature · 1 line
2.31.1
PATCH 2/3 acpi: x86: move RPQx field back to _SB scope
In reply to Igor MammedovCommit 47a373faa6b2 (acpi: pc/q35: drop ad-hoc PCI-ISA bridge AML routines and let bus ennumeration generate AML) moved ISA bridge AML generation to respective devices and was usingaml_alias() to provide PRQx fields in _SB. scope. However, it turned
out that SeaBIOS was not able to process Alias opcode when parsing DSDT,
resulting in lack of keyboard during boot (SeaBIOS console, grub, FreeDOS).
While fix for SeaBIOS is posted
https://mail.coreboot.org/hyperkitty/list/[email protected]/thread/RGPL7HESH5U5JRLEO6FP77CZVHZK5J65/
fixed SeaBIOS might not make into QEMU-7.2 in time. Hence this workaround that puts PRQx back into _SB scope and gets rid of aliases in ISA bridge description, so DSDT will be parsable by broken SeaBIOS.
That brings back hardcoded references to ISA bridge
PCI0.S08.P40C/PCI0.SF8.PIRQ
where middle part now is auto generated based on slot it's plugged in, but it should be fine as bridge initialization also hardcodes PCI address of the bridge so it can't ever move. Once QEMU tree has fixed SeaBIOS blob, we should be able to drop this part and revert back to alias based approach
---
tested with (including hotplug):
pc: Fedora34x64, WS2003x32, WS2016x64, WS2022
q35: Fedora34x64, WS2008x64, WS2019x64, WS2022
--- hw/isa/lpc_ich9.c | 16 ++++------------ hw/isa/piix3.c | 12 ++++-------- 2 files changed, 8 insertions(+), 20 deletions(-)
hw/isa/lpc_ich9.c +4 -12
@@ -813,12 +813,13 @@ static void build_ich9_isa_aml(AcpiDevAmlIf *adev, Aml *scope)BusChild *kid;ICH9LPCState *s =ICH9_LPC_DEVICE (adev);BusState *bus =BUS (s->isa_bus); +Aml *sb_scope =aml_scope ("\\_SB" );/* ICH9 PCI to ISA irq remapping */ aml_append (scope,aml_operation_region ("PIRQ" ,AML_PCI_CONFIG ,aml_int (0x60 ),0x0C ));/* Fields declarion has to happen *after* operation region */ - field =aml_field ("PIRQ" ,AML_BYTE_ACC ,AML_NOLOCK ,AML_PRESERVE ); + field =aml_field ("PCI0.SF8.PIRQ" ,AML_BYTE_ACC ,AML_NOLOCK ,AML_PRESERVE );aml_append (field,aml_named_field ("PRQA" ,8 ));aml_append (field,aml_named_field ("PRQB" ,8 ));aml_append (field,aml_named_field ("PRQC" ,8 ));
@@ -828,17 +829,8 @@ static void build_ich9_isa_aml(AcpiDevAmlIf *adev, Aml *scope)aml_append (field,aml_named_field ("PRQF" ,8 ));aml_append (field,aml_named_field ("PRQG" ,8 ));aml_append (field,aml_named_field ("PRQH" ,8 )); -aml_append (scope, field); - -/* hack: put fields into _SB scope for LNKx to find them */ -aml_append (scope,aml_alias ("PRQA" ,"\\_SB.PRQA" )); -aml_append (scope,aml_alias ("PRQB" ,"\\_SB.PRQB" )); -aml_append (scope,aml_alias ("PRQC" ,"\\_SB.PRQC" )); -aml_append (scope,aml_alias ("PRQD" ,"\\_SB.PRQD" )); -aml_append (scope,aml_alias ("PRQE" ,"\\_SB.PRQE" )); -aml_append (scope,aml_alias ("PRQF" ,"\\_SB.PRQF" )); -aml_append (scope,aml_alias ("PRQG" ,"\\_SB.PRQG" )); -aml_append (scope,aml_alias ("PRQH" ,"\\_SB.PRQH" )); +aml_append (sb_scope, field); +aml_append (scope, sb_scope); QTAILQ_FOREACH(kid, &bus->children, sibling) {call_dev_aml_func (DEVICE (kid->child), scope);
hw/isa/piix3.c +4 -8
@@ -318,24 +318,20 @@ static void build_pci_isa_aml(AcpiDevAmlIf *adev, Aml *scope) {Aml *field;BusChild *kid; +Aml *sb_scope =aml_scope ("\\_SB" );BusState *bus =qdev_get_child_bus (DEVICE (adev),"isa.0" );/* PIIX PCI to ISA irq remapping */ aml_append (scope,aml_operation_region ("P40C" ,AML_PCI_CONFIG ,aml_int (0x60 ),0x04 ));/* Fields declarion has to happen *after* operation region */ - field =aml_field ("P40C" ,AML_BYTE_ACC ,AML_NOLOCK ,AML_PRESERVE ); + field =aml_field ("PCI0.S08.P40C" ,AML_BYTE_ACC ,AML_NOLOCK ,AML_PRESERVE );aml_append (field,aml_named_field ("PRQ0" ,8 ));aml_append (field,aml_named_field ("PRQ1" ,8 ));aml_append (field,aml_named_field ("PRQ2" ,8 ));aml_append (field,aml_named_field ("PRQ3" ,8 )); -aml_append (scope, field); - -/* hack: put fields into _SB scope for LNKx to find them */ -aml_append (scope,aml_alias ("PRQ0" ,"\\_SB.PRQ0" )); -aml_append (scope,aml_alias ("PRQ1" ,"\\_SB.PRQ1" )); -aml_append (scope,aml_alias ("PRQ2" ,"\\_SB.PRQ2" )); -aml_append (scope,aml_alias ("PRQ3" ,"\\_SB.PRQ3" )); +aml_append (sb_scope, field); +aml_append (scope, sb_scope); QTAILQ_FOREACH(kid, &bus->children, sibling) {call_dev_aml_func (DEVICE (kid->child), scope);
Signature · 1 line
2.31.1
PATCH 3/3 tests: acpi: x86: update expected DSDT after moving PRQx fields in _SB scope
In reply to Igor MammedovExpected DSDT changes,
pc:
- Field (P40C, ByteAcc, NoLock, Preserve)
+ Scope (\_SB)
{
- PRQ0, 8,
- PRQ1, 8,
- PRQ2, 8,
- PRQ3, 8
+ Field (PCI0.S08.P40C, ByteAcc, NoLock, Preserve)
+ {
+ PRQ0, 8,
+ PRQ1, 8,
+ PRQ2, 8,
+ PRQ3, 8
+ }
}- Alias (PRQ0, \_SB.PRQ0) - Alias (PRQ1, \_SB.PRQ1) - Alias (PRQ2, \_SB.PRQ2) - Alias (PRQ3, \_SB.PRQ3)
q35:
- Field (PIRQ, ByteAcc, NoLock, Preserve)
- {
- PRQA, 8,
- PRQB, 8,
- PRQC, 8,
- PRQD, 8,
- Offset (0x08),
- PRQE, 8,
- PRQF, 8,
- PRQG, 8,
- PRQH, 8
+ Scope (\_SB)
+ {
+ Field (PCI0.SF8.PIRQ, ByteAcc, NoLock, Preserve)
+ {
+ PRQA, 8,
+ PRQB, 8,
+ PRQC, 8,
+ PRQD, 8,
+ Offset (0x08),
+ PRQE, 8,
+ PRQF, 8,
+ PRQG, 8,
+ PRQH, 8
+ }
}- Alias (PRQA, \_SB.PRQA) - Alias (PRQB, \_SB.PRQB) - Alias (PRQC, \_SB.PRQC) - Alias (PRQD, \_SB.PRQD) - Alias (PRQE, \_SB.PRQE) - Alias (PRQF, \_SB.PRQF) - Alias (PRQG, \_SB.PRQG) - Alias (PRQH, \_SB.PRQH)
--- tests/qtest/bios-tables-test-allowed-diff.h | 36 ------------------ tests/data/acpi/pc/DSDT | Bin 6501 -> 6458 bytes tests/data/acpi/pc/DSDT.acpierst | Bin 6461 -> 6418 bytes tests/data/acpi/pc/DSDT.acpihmat | Bin 7826 -> 7783 bytes tests/data/acpi/pc/DSDT.bridge | Bin 9575 -> 9532 bytes tests/data/acpi/pc/DSDT.cphp | Bin 6965 -> 6922 bytes tests/data/acpi/pc/DSDT.dimmpxm | Bin 8155 -> 8112 bytes tests/data/acpi/pc/DSDT.hpbridge | Bin 6461 -> 6418 bytes tests/data/acpi/pc/DSDT.hpbrroot | Bin 3107 -> 3064 bytes tests/data/acpi/pc/DSDT.ipmikcs | Bin 6573 -> 6530 bytes tests/data/acpi/pc/DSDT.memhp | Bin 7860 -> 7817 bytes tests/data/acpi/pc/DSDT.nohpet | Bin 6359 -> 6316 bytes tests/data/acpi/pc/DSDT.numamem | Bin 6507 -> 6464 bytes tests/data/acpi/pc/DSDT.roothp | Bin 6699 -> 6656 bytes tests/data/acpi/q35/DSDT | Bin 8412 -> 8310 bytes tests/data/acpi/q35/DSDT.acpierst | Bin 8429 -> 8327 bytes tests/data/acpi/q35/DSDT.acpihmat | Bin 9737 -> 9635 bytes tests/data/acpi/q35/DSDT.acpihmat-noinitiator | Bin 8691 -> 8589 bytes tests/data/acpi/q35/DSDT.applesmc | Bin 8458 -> 8356 bytes tests/data/acpi/q35/DSDT.bridge | Bin 11541 -> 11439 bytes tests/data/acpi/q35/DSDT.core-count2 | Bin 32552 -> 32450 bytes tests/data/acpi/q35/DSDT.cphp | Bin 8876 -> 8774 bytes tests/data/acpi/q35/DSDT.cxl | Bin 9738 -> 9636 bytes tests/data/acpi/q35/DSDT.dimmpxm | Bin 10066 -> 9964 bytes tests/data/acpi/q35/DSDT.ipmibt | Bin 8487 -> 8385 bytes tests/data/acpi/q35/DSDT.ipmismbus | Bin 8500 -> 8398 bytes tests/data/acpi/q35/DSDT.ivrs | Bin 8429 -> 8327 bytes tests/data/acpi/q35/DSDT.memhp | Bin 9771 -> 9669 bytes tests/data/acpi/q35/DSDT.mmio64 | Bin 9542 -> 9440 bytes tests/data/acpi/q35/DSDT.multi-bridge | Bin 8732 -> 8630 bytes tests/data/acpi/q35/DSDT.nohpet | Bin 8270 -> 8168 bytes tests/data/acpi/q35/DSDT.numamem | Bin 8418 -> 8316 bytes tests/data/acpi/q35/DSDT.pvpanic-isa | Bin 8513 -> 8411 bytes tests/data/acpi/q35/DSDT.tis.tpm12 | Bin 9018 -> 8916 bytes tests/data/acpi/q35/DSDT.tis.tpm2 | Bin 9044 -> 8942 bytes tests/data/acpi/q35/DSDT.viot | Bin 9521 -> 9419 bytes tests/data/acpi/q35/DSDT.xapic | Bin 35775 -> 35673 bytes 37 files changed, 36 deletions(-)
tests/qtest/bios-tables-test-allowed-diff.h +0 -36
@@ -1,37 +1 @@/* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/pc/DSDT" , -"tests/data/acpi/pc/DSDT.acpierst" , -"tests/data/acpi/pc/DSDT.acpihmat" , -"tests/data/acpi/pc/DSDT.bridge" , -"tests/data/acpi/pc/DSDT.cphp" , -"tests/data/acpi/pc/DSDT.dimmpxm" , -"tests/data/acpi/pc/DSDT.hpbridge" , -"tests/data/acpi/pc/DSDT.hpbrroot" , -"tests/data/acpi/pc/DSDT.ipmikcs" , -"tests/data/acpi/pc/DSDT.memhp" , -"tests/data/acpi/pc/DSDT.nohpet" , -"tests/data/acpi/pc/DSDT.numamem" , -"tests/data/acpi/pc/DSDT.roothp" , -"tests/data/acpi/q35/DSDT" , -"tests/data/acpi/q35/DSDT.acpierst" , -"tests/data/acpi/q35/DSDT.acpihmat" , -"tests/data/acpi/q35/DSDT.acpihmat-noinitiator" , -"tests/data/acpi/q35/DSDT.applesmc" , -"tests/data/acpi/q35/DSDT.bridge" , -"tests/data/acpi/q35/DSDT.cphp" , -"tests/data/acpi/q35/DSDT.cxl" , -"tests/data/acpi/q35/DSDT.core-count2" , -"tests/data/acpi/q35/DSDT.dimmpxm" , -"tests/data/acpi/q35/DSDT.ipmibt" , -"tests/data/acpi/q35/DSDT.ipmismbus" , -"tests/data/acpi/q35/DSDT.ivrs" , -"tests/data/acpi/q35/DSDT.memhp" , -"tests/data/acpi/q35/DSDT.mmio64" , -"tests/data/acpi/q35/DSDT.multi-bridge" , -"tests/data/acpi/q35/DSDT.nohpet" , -"tests/data/acpi/q35/DSDT.numamem" , -"tests/data/acpi/q35/DSDT.pvpanic-isa" , -"tests/data/acpi/q35/DSDT.tis.tpm12" , -"tests/data/acpi/q35/DSDT.tis.tpm2" , -"tests/data/acpi/q35/DSDT.viot" , -"tests/data/acpi/q35/DSDT.xapic",
tests/data/acpi/pc/DSDT binary +0 -0
tests/data/acpi/pc/DSDT.acpierst binary +0 -0
tests/data/acpi/pc/DSDT.acpihmat binary +0 -0
tests/data/acpi/pc/DSDT.bridge binary +0 -0
tests/data/acpi/pc/DSDT.cphp binary +0 -0
tests/data/acpi/pc/DSDT.dimmpxm binary +0 -0
tests/data/acpi/pc/DSDT.hpbridge binary +0 -0
tests/data/acpi/pc/DSDT.hpbrroot binary +0 -0
tests/data/acpi/pc/DSDT.ipmikcs binary +0 -0
tests/data/acpi/pc/DSDT.memhp binary +0 -0
tests/data/acpi/pc/DSDT.nohpet binary +0 -0
tests/data/acpi/pc/DSDT.numamem binary +0 -0
tests/data/acpi/pc/DSDT.roothp binary +0 -0
tests/data/acpi/q35/DSDT binary +0 -0
tests/data/acpi/q35/DSDT.acpierst binary +0 -0
tests/data/acpi/q35/DSDT.acpihmat binary +0 -0
tests/data/acpi/q35/DSDT.acpihmat-noinitiator binary +0 -0
tests/data/acpi/q35/DSDT.applesmc binary +0 -0
tests/data/acpi/q35/DSDT.bridge binary +0 -0
tests/data/acpi/q35/DSDT.core-count2 binary +0 -0
tests/data/acpi/q35/DSDT.cphp binary +0 -0
tests/data/acpi/q35/DSDT.cxl binary +0 -0
tests/data/acpi/q35/DSDT.dimmpxm binary +0 -0
tests/data/acpi/q35/DSDT.ipmibt binary +0 -0
tests/data/acpi/q35/DSDT.ipmismbus binary +0 -0
tests/data/acpi/q35/DSDT.ivrs binary +0 -0
tests/data/acpi/q35/DSDT.memhp binary +0 -0
tests/data/acpi/q35/DSDT.mmio64 binary +0 -0
tests/data/acpi/q35/DSDT.multi-bridge binary +0 -0
tests/data/acpi/q35/DSDT.nohpet binary +0 -0
tests/data/acpi/q35/DSDT.numamem binary +0 -0
tests/data/acpi/q35/DSDT.pvpanic-isa binary +0 -0
tests/data/acpi/q35/DSDT.tis.tpm12 binary +0 -0
tests/data/acpi/q35/DSDT.tis.tpm2 binary +0 -0
tests/data/acpi/q35/DSDT.viot binary +0 -0
tests/data/acpi/q35/DSDT.xapic binary +0 -0
Signature · 1 line
2.31.1