[SeaBIOS] Re: [PATCH] MP: fix mptable interrupt source generation for pci devices
Hi, On 20. 04. 22 15:18, Igor Mammedov wrote: relevant discussion https://lists.gnu.org/archive/html/qemu-devel/2022-01/msg04271.html gist: legacy tables aren't maintained nor really tested and subject to break without notice, add ACPI support to pet OS if possible (RSTD lookup and parsing MADT is not that difficult and well documented in ACPI spec) Well thats true for CPUs, but false for IRQ routing. To get PCI/PCIe routing you need to run ACPI bytecode interpreter to execute _PRT methods in the DSDT. For a toy OS, it means to integrate ACPICA, as no-one will write it from scratch. Also, some other use cases for MP-Table might be certified software where codebase size matters (and some flexibility of configuration of platform is still allowed). Thanks, Rudolf ___ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-le...@seabios.org
[SeaBIOS] Re: [PATCH] MP: fix mptable interrupt source generation for pci devices
On Wed, 20 Apr 2022 13:32:33 +0200 Paul Menzel wrote: > Dear Igor, dear Kevin, dear Gerd, > > > Am 20.04.22 um 11:14 schrieb Igor Mammedov: > > On Tue, 19 Apr 2022 09:52:42 -0400 Kevin O'Connor wrote: > > > >> On Tue, Apr 19, 2022 at 11:46:59AM +0200, Gerd Hoffmann wrote: > > diff --git a/src/fw/mptable.c b/src/fw/mptable.c > > index 47385cc..3a7b02f 100644 > > --- a/src/fw/mptable.c > > +++ b/src/fw/mptable.c > > If you look at the top of that file you'll see the notice: > > // DO NOT ADD NEW FEATURES HERE. (See paravirt.c / biostables.c > instead.) > > The mptable.c file in seabios is no longer modified. If a guest OS > needs a different mptable then it will be necessary to extend qemu to > pass the desired mptable to seabios (as is done for smbios and acpi). > >>> > >>> Maybe its time to think about removing this code? Current state of > >>> affairs in qemu is: > >>> > >>> # qemu-default -M help > >>> Supported machines are: > >>> [ ... ] > >>> pc-i440fx-2.1Standard PC (i440FX + PIIX, 1996) > >>> pc-i440fx-2.0Standard PC (i440FX + PIIX, 1996) > >>> pc-i440fx-1.7Standard PC (i440FX + PIIX, 1996) (deprecated) > >>> pc-i440fx-1.6Standard PC (i440FX + PIIX, 1996) (deprecated) > >>> pc-i440fx-1.5Standard PC (i440FX + PIIX, 1996) (deprecated) > >>> pc-i440fx-1.4Standard PC (i440FX + PIIX, 1996) (deprecated) > >>> [ ... ] > >>> > >>> So qemu plans to remove support for machine types 1.7 and older, this > >>> will probably happen later this year in the 7.1 or 7.2 release. > >>> > >>> qemu added support for passing acpi tables to the firmware in version > >>> 1.7, so the compatibility code is only used for machine types 1.6 and > >>> older. > >>> > >>> So in a year or so the only purpose the compatibility code will serve > >>> is confusing people ... > >> > >> I know qemu produces the acpi and smbios tables. I wasn't aware it > >> will currently pass in the mptable to seabios. (Nor the PIR table.) > > > > As far as I'm aware QEMU doesn't produce legacy mptable (which was > > supplemented by ACPI spec in 1996), so guest will have to parse ACPI > > tales instead (MADT at minimum). I guess whoever plays with some very > > legacy OS or does it for educational purpose can use old Seabios > > to do that. > > > > Along with this perhaps we also should prepare to remove code that > > generates SeaBIOS own version of ACPI tables /MADT/DSDT/SSDT/SRAT/ > > since QEMU does this task from 1.7 and onward. > > Old SeaBIOS ACPI code is likely bit-rotted at this point, we do not > > exercise related code in QEMU tests. > > That will also allow QEMU to drop quite a bit of legacy ABI/code > > that it's kept around since this code is still present in SeaBIOS. > > > >> I'm okay with removing support from seabios. As a first step we can > >> change the Kconfig defaults to not produce the tables. > > Please excuse my ignorance, but will it still be possible to run > alternative OS projects like KolibriOS [1] in QEMU and coreboot with > SeaBIOS payload? It boots for me in QEMU with MPTable disabled in config SeaBIOS. relevant discussion https://lists.gnu.org/archive/html/qemu-devel/2022-01/msg04271.html gist: legacy tables aren't maintained nor really tested and subject to break without notice, add ACPI support to pet OS if possible (RSTD lookup and parsing MADT is not that difficult and well documented in ACPI spec) > Kind regards, > > Paul > > > [1]: https://kolibrios.org/de/ > ___ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-le...@seabios.org
[SeaBIOS] Re: [PATCH] MP: fix mptable interrupt source generation for pci devices
Dear Igor, dear Kevin, dear Gerd, Am 20.04.22 um 11:14 schrieb Igor Mammedov: On Tue, 19 Apr 2022 09:52:42 -0400 Kevin O'Connor wrote: On Tue, Apr 19, 2022 at 11:46:59AM +0200, Gerd Hoffmann wrote: diff --git a/src/fw/mptable.c b/src/fw/mptable.c index 47385cc..3a7b02f 100644 --- a/src/fw/mptable.c +++ b/src/fw/mptable.c If you look at the top of that file you'll see the notice: // DO NOT ADD NEW FEATURES HERE. (See paravirt.c / biostables.c instead.) The mptable.c file in seabios is no longer modified. If a guest OS needs a different mptable then it will be necessary to extend qemu to pass the desired mptable to seabios (as is done for smbios and acpi). Maybe its time to think about removing this code? Current state of affairs in qemu is: # qemu-default -M help Supported machines are: [ ... ] pc-i440fx-2.1Standard PC (i440FX + PIIX, 1996) pc-i440fx-2.0Standard PC (i440FX + PIIX, 1996) pc-i440fx-1.7Standard PC (i440FX + PIIX, 1996) (deprecated) pc-i440fx-1.6Standard PC (i440FX + PIIX, 1996) (deprecated) pc-i440fx-1.5Standard PC (i440FX + PIIX, 1996) (deprecated) pc-i440fx-1.4Standard PC (i440FX + PIIX, 1996) (deprecated) [ ... ] So qemu plans to remove support for machine types 1.7 and older, this will probably happen later this year in the 7.1 or 7.2 release. qemu added support for passing acpi tables to the firmware in version 1.7, so the compatibility code is only used for machine types 1.6 and older. So in a year or so the only purpose the compatibility code will serve is confusing people ... I know qemu produces the acpi and smbios tables. I wasn't aware it will currently pass in the mptable to seabios. (Nor the PIR table.) As far as I'm aware QEMU doesn't produce legacy mptable (which was supplemented by ACPI spec in 1996), so guest will have to parse ACPI tales instead (MADT at minimum). I guess whoever plays with some very legacy OS or does it for educational purpose can use old Seabios to do that. Along with this perhaps we also should prepare to remove code that generates SeaBIOS own version of ACPI tables /MADT/DSDT/SSDT/SRAT/ since QEMU does this task from 1.7 and onward. Old SeaBIOS ACPI code is likely bit-rotted at this point, we do not exercise related code in QEMU tests. That will also allow QEMU to drop quite a bit of legacy ABI/code that it's kept around since this code is still present in SeaBIOS. I'm okay with removing support from seabios. As a first step we can change the Kconfig defaults to not produce the tables. Please excuse my ignorance, but will it still be possible to run alternative OS projects like KolibriOS [1] in QEMU and coreboot with SeaBIOS payload? Kind regards, Paul [1]: https://kolibrios.org/de/ ___ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-le...@seabios.org
[SeaBIOS] Re: [PATCH] MP: fix mptable interrupt source generation for pci devices
On Tue, 19 Apr 2022 09:52:42 -0400 Kevin O'Connor wrote: > On Tue, Apr 19, 2022 at 11:46:59AM +0200, Gerd Hoffmann wrote: > > > > diff --git a/src/fw/mptable.c b/src/fw/mptable.c > > > > index 47385cc..3a7b02f 100644 > > > > --- a/src/fw/mptable.c > > > > +++ b/src/fw/mptable.c > > > > > > If you look at the top of that file you'll see the notice: > > > > > > // DO NOT ADD NEW FEATURES HERE. (See paravirt.c / biostables.c instead.) > > > > > > The mptable.c file in seabios is no longer modified. If a guest OS > > > needs a different mptable then it will be necessary to extend qemu to > > > pass the desired mptable to seabios (as is done for smbios and acpi). > > > > Maybe its time to think about removing this code? Current state of > > affairs in qemu is: > > > > # qemu-default -M help > > Supported machines are: > > [ ... ] > > pc-i440fx-2.1Standard PC (i440FX + PIIX, 1996) > > pc-i440fx-2.0Standard PC (i440FX + PIIX, 1996) > > pc-i440fx-1.7Standard PC (i440FX + PIIX, 1996) (deprecated) > > pc-i440fx-1.6Standard PC (i440FX + PIIX, 1996) (deprecated) > > pc-i440fx-1.5Standard PC (i440FX + PIIX, 1996) (deprecated) > > pc-i440fx-1.4Standard PC (i440FX + PIIX, 1996) (deprecated) > > [ ... ] > > > > So qemu plans to remove support for machine types 1.7 and older, this > > will probably happen later this year in the 7.1 or 7.2 release. > > > > qemu added support for passing acpi tables to the firmware in version > > 1.7, so the compatibility code is only used for machine types 1.6 and > > older. > > > > So in a year or so the only purpose the compatibility code will serve > > is confusing people ... > > I know qemu produces the acpi and smbios tables. I wasn't aware it > will currently pass in the mptable to seabios. (Nor the PIR table.) As far as I'm aware QEMU doesn't produce legacy mptable (which was supplemented by ACPI spec in 1996), so guest will have to parse ACPI tales instead (MADT at minimum). I guess whoever plays with some very legacy OS or does it for educational purpose can use old Seabios to do that. Along with this perhaps we also should prepare to remove code that generates SeaBIOS own version of ACPI tables /MADT/DSDT/SSDT/SRAT/ since QEMU does this task from 1.7 and onward. Old SeaBIOS ACPI code is likely bit-rotted at this point, we do not exercise related code in QEMU tests. That will also allow QEMU to drop quite a bit of legacy ABI/code that it's kept around since this code is still present in SeaBIOS. > I'm okay with removing support from seabios. As a first step we can > change the Kconfig defaults to not produce the tables. > > -Kevin > ___ > SeaBIOS mailing list -- seabios@seabios.org > To unsubscribe send an email to seabios-le...@seabios.org > ___ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-le...@seabios.org
[SeaBIOS] Re: [PATCH] MP: fix mptable interrupt source generation for pci devices
On Tue, Apr 19, 2022 at 11:46:59AM +0200, Gerd Hoffmann wrote: > > > diff --git a/src/fw/mptable.c b/src/fw/mptable.c > > > index 47385cc..3a7b02f 100644 > > > --- a/src/fw/mptable.c > > > +++ b/src/fw/mptable.c > > > > If you look at the top of that file you'll see the notice: > > > > // DO NOT ADD NEW FEATURES HERE. (See paravirt.c / biostables.c instead.) > > > > The mptable.c file in seabios is no longer modified. If a guest OS > > needs a different mptable then it will be necessary to extend qemu to > > pass the desired mptable to seabios (as is done for smbios and acpi). > > Maybe its time to think about removing this code? Current state of > affairs in qemu is: > > # qemu-default -M help > Supported machines are: > [ ... ] > pc-i440fx-2.1Standard PC (i440FX + PIIX, 1996) > pc-i440fx-2.0Standard PC (i440FX + PIIX, 1996) > pc-i440fx-1.7Standard PC (i440FX + PIIX, 1996) (deprecated) > pc-i440fx-1.6Standard PC (i440FX + PIIX, 1996) (deprecated) > pc-i440fx-1.5Standard PC (i440FX + PIIX, 1996) (deprecated) > pc-i440fx-1.4Standard PC (i440FX + PIIX, 1996) (deprecated) > [ ... ] > > So qemu plans to remove support for machine types 1.7 and older, this > will probably happen later this year in the 7.1 or 7.2 release. > > qemu added support for passing acpi tables to the firmware in version > 1.7, so the compatibility code is only used for machine types 1.6 and > older. > > So in a year or so the only purpose the compatibility code will serve > is confusing people ... I know qemu produces the acpi and smbios tables. I wasn't aware it will currently pass in the mptable to seabios. (Nor the PIR table.) I'm okay with removing support from seabios. As a first step we can change the Kconfig defaults to not produce the tables. -Kevin ___ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-le...@seabios.org
[SeaBIOS] Re: [PATCH] MP: fix mptable interrupt source generation for pci devices
> > diff --git a/src/fw/mptable.c b/src/fw/mptable.c > > index 47385cc..3a7b02f 100644 > > --- a/src/fw/mptable.c > > +++ b/src/fw/mptable.c > > If you look at the top of that file you'll see the notice: > > // DO NOT ADD NEW FEATURES HERE. (See paravirt.c / biostables.c instead.) > > The mptable.c file in seabios is no longer modified. If a guest OS > needs a different mptable then it will be necessary to extend qemu to > pass the desired mptable to seabios (as is done for smbios and acpi). Maybe its time to think about removing this code? Current state of affairs in qemu is: # qemu-default -M help Supported machines are: [ ... ] pc-i440fx-2.1Standard PC (i440FX + PIIX, 1996) pc-i440fx-2.0Standard PC (i440FX + PIIX, 1996) pc-i440fx-1.7Standard PC (i440FX + PIIX, 1996) (deprecated) pc-i440fx-1.6Standard PC (i440FX + PIIX, 1996) (deprecated) pc-i440fx-1.5Standard PC (i440FX + PIIX, 1996) (deprecated) pc-i440fx-1.4Standard PC (i440FX + PIIX, 1996) (deprecated) [ ... ] So qemu plans to remove support for machine types 1.7 and older, this will probably happen later this year in the 7.1 or 7.2 release. qemu added support for passing acpi tables to the firmware in version 1.7, so the compatibility code is only used for machine types 1.6 and older. So in a year or so the only purpose the compatibility code will serve is confusing people ... take care, Gerd ___ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-le...@seabios.org
[SeaBIOS] Re: [PATCH] MP: fix mptable interrupt source generation for pci devices
On Fri, Apr 15, 2022 at 11:50:15AM -0400, Kevin O'Connor wrote: > On Fri, Apr 15, 2022 at 04:33:34PM +0530, Jay Khandkar wrote: > > Set the correct IOAPIC INTIN pin number for pci bus interrupt > > sources during MP spec table generation (on emulators). Currently, > > the pin number is set to the interrupt line field in the device's > > configuration space, which is set to either IRQ 10 or 11 as the > > boot rom driver expects. This works since qemu maps all ISA > > compatible PIC IRQs onto IOAPIC pins 0-15, including PIRQs. But it > > will break if, for some reason, the IRQ is routed to something > > other than the INTLINE value using, for eg. ACPI _CRS. This patch > > ensures the pin number is set to the correct value (16-23) that the > > INTx pin is routed to in APIC mode, in agreement with the ACPI _PRT > > provided routing. > > > > Tested on a Linux 5.17.2 guest on qemu with the pci=nomsi and > > acpi=noirq boot parameters to force MP table parsing for interrupt > > sources. > > > > Signed-off-by: Jay Khandkar > > --- > > src/fw/mptable.c | 30 -- > > 1 file changed, 28 insertions(+), 2 deletions(-) > > > > diff --git a/src/fw/mptable.c b/src/fw/mptable.c > > index 47385cc..3a7b02f 100644 > > --- a/src/fw/mptable.c > > +++ b/src/fw/mptable.c > > If you look at the top of that file you'll see the notice: > > // DO NOT ADD NEW FEATURES HERE. (See paravirt.c / biostables.c instead.) > > The mptable.c file in seabios is no longer modified. If a guest OS > needs a different mptable then it will be necessary to extend qemu to > pass the desired mptable to seabios (as is done for smbios and acpi). > > Cheers, > -Kevin Ah, my bad. Thanks! D Ah, my bad. Thanks! ___ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-le...@seabios.org
[SeaBIOS] Re: [PATCH] MP: fix mptable interrupt source generation for pci devices
On Fri, Apr 15, 2022 at 04:33:34PM +0530, Jay Khandkar wrote: > Set the correct IOAPIC INTIN pin number for pci bus interrupt > sources during MP spec table generation (on emulators). Currently, > the pin number is set to the interrupt line field in the device's > configuration space, which is set to either IRQ 10 or 11 as the > boot rom driver expects. This works since qemu maps all ISA > compatible PIC IRQs onto IOAPIC pins 0-15, including PIRQs. But it > will break if, for some reason, the IRQ is routed to something > other than the INTLINE value using, for eg. ACPI _CRS. This patch > ensures the pin number is set to the correct value (16-23) that the > INTx pin is routed to in APIC mode, in agreement with the ACPI _PRT > provided routing. > > Tested on a Linux 5.17.2 guest on qemu with the pci=nomsi and > acpi=noirq boot parameters to force MP table parsing for interrupt > sources. > > Signed-off-by: Jay Khandkar > --- > src/fw/mptable.c | 30 -- > 1 file changed, 28 insertions(+), 2 deletions(-) > > diff --git a/src/fw/mptable.c b/src/fw/mptable.c > index 47385cc..3a7b02f 100644 > --- a/src/fw/mptable.c > +++ b/src/fw/mptable.c If you look at the top of that file you'll see the notice: // DO NOT ADD NEW FEATURES HERE. (See paravirt.c / biostables.c instead.) The mptable.c file in seabios is no longer modified. If a guest OS needs a different mptable then it will be necessary to extend qemu to pass the desired mptable to seabios (as is done for smbios and acpi). Cheers, -Kevin ___ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-le...@seabios.org