pc: acpi: force FADT rev1 for old i440fx machine types
PATCH 1/1 pc: acpi: force FADT rev1 for old i440fx machine types
w2k used to boot on QEMU until we bumped revision of FADT to rev3
(commit 77af8a2b hw/i386: Use Rev3 FADT (ACPI 2.0) instead of Rev1 to improve guest OS support.)
Considering that w2k is ancient and long time EOLed, leave default rev3 but make pc-i440fx-2.9 and older machine types to force rev1 so old setups won't break (w2k could boot).
---
CC: Programmingkid <[email protected]>
CC: Phil Dennis-Jordan <[email protected]>
CC: "Michael S. Tsirkin" <[email protected]>
Only compile test since I don't have w2k to test with
--- include/hw/i386/pc.h | 1 + hw/i386/acpi-build.c | 26 +++++++++++++++++++------- hw/i386/pc_piix.c | 2 ++ 3 files changed, 22 insertions(+), 7 deletions(-)
include/hw/i386/pc.h +1 -0
@@ -122,6 +122,7 @@ struct PCMachineClass {bool rsdp_in_ram;int legacy_acpi_table_size;unsigned acpi_data_size; +bool force_rev1_fadt;/* SMBIOS compat: */ bool smbios_defaults;
hw/i386/acpi-build.c +19 -7
@@ -272,7 +272,7 @@ build_facs(GArray *table_data, BIOSLinker *linker) }/* Load chipset information in FADT */ -static void fadt_setup (AcpiFadtDescriptorRev3 *fadt,AcpiPmInfo *pm) +static void fadt_setup (AcpiFadtDescriptorRev3 *fadt,AcpiPmInfo *pm,bool rev1) { fadt->model =1 ; fadt->reserved1 =0 ;
@@ -304,6 +304,9 @@ static void fadt_setup(AcpiFadtDescriptorRev3 *fadt, AcpiPmInfo *pm) fadt->flags |=cpu_to_le32 (1 <<ACPI_FADT_F_FORCE_APIC_CLUSTER_MODEL ); } fadt->century =RTC_CENTURY ; +if (rev1) { +return ; + } fadt->flags |=cpu_to_le32 (1 <<ACPI_FADT_F_RESET_REG_SUP ); fadt->reset_value =0xf ;
@@ -335,6 +338,7 @@ static void fadt_setup(AcpiFadtDescriptorRev3 *fadt, AcpiPmInfo *pm)/* FADT */ static void build_fadt (GArray *table_data,BIOSLinker *linker,AcpiPmInfo *pm, +MachineState *machine,unsigned facs_tbl_offset,unsigned dsdt_tbl_offset,const char *oem_id,const char *oem_table_id) {
@@ -342,6 +346,9 @@ build_fadt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm,unsigned fw_ctrl_offset = (char *)&fadt->firmware_ctrl - table_data->data;unsigned dsdt_entry_offset = (char *)&fadt->dsdt - table_data->data;unsigned xdsdt_entry_offset = (char *)&fadt->x_dsdt - table_data->data; +PCMachineClass *pcmc =PC_MACHINE_GET_CLASS (machine); +int fadt_size =sizeof (*fadt); +int rev =3 ;/* FACS address to be filled by Guest linker */ bios_linker_loader_add_pointer(linker,
@@ -349,16 +356,21 @@ build_fadt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm, ACPI_BUILD_TABLE_FILE, facs_tbl_offset);/* DSDT address to be filled by Guest linker */ -fadt_setup (fadt, pm); +fadt_setup (fadt, pm, pcmc->force_rev1_fadt);bios_linker_loader_add_pointer (linker,ACPI_BUILD_TABLE_FILE , dsdt_entry_offset,sizeof (fadt->dsdt),ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); -bios_linker_loader_add_pointer (linker, -ACPI_BUILD_TABLE_FILE , xdsdt_entry_offset,sizeof (fadt->x_dsdt), -ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); +if (pcmc->force_rev1_fadt) { + rev =1 ; + fadt_size = offsetof(typeof(*fadt), reset_register); + }else { +bios_linker_loader_add_pointer (linker, +ACPI_BUILD_TABLE_FILE , xdsdt_entry_offset,sizeof (fadt->x_dsdt), +ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); + }build_header (linker, table_data, - (void *)fadt,"FACP" ,sizeof (*fadt),3 , oem_id, oem_table_id); + (void *)fadt,"FACP" , fadt_size, rev, oem_id, oem_table_id); } void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid,
@@ -2667,7 +2679,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)/* ACPI tables pointed to by RSDT */ fadt = tables_blob->len;acpi_add_table (table_offsets, tables_blob); -build_fadt (tables_blob, tables->linker, &pm, facs, dsdt, +build_fadt (tables_blob, tables->linker, &pm, machine, facs, dsdt, slic_oem.id, slic_oem.table_id); aml_len += tables_blob->len - fadt;
hw/i386/pc_piix.c +2 -0
@@ -449,9 +449,11 @@ DEFINE_I440FX_MACHINE(v2_10, "pc-i440fx-2.10", NULL,static void pc_i440fx_2_9_machine_options (MachineClass *m) { +PCMachineClass *pcmc =PC_MACHINE_CLASS (m);pc_i440fx_2_10_machine_options (m); m->is_default =0 ; m->alias =NULL ; + pcmc->force_rev1_fadt = true;SET_MACHINE_COMPAT (m,PC_COMPAT_2_9 ); }
Signature · 1 line
2.7.4
Quoted 6 lines · Igor Mammedov
w2k used to boot on QEMU until we bumped revision of FADT to rev3
(commit77af8a2bhw/i386: Use Rev3 FADT (ACPI 2.0) instead of Rev1 to improve guest OS support.)Considering that w2k is ancient and long time EOLed, leave default rev3 but make pc-i440fx-2.9 and older machine types to force rev1 so old setups won't break (w2k could boot).
There needs to be a machine type property added to control this feature. When provisioning new VMs, management apps need to be able to set the property explicitly - having them rely on picking particular machine type name+versions is not viable, because downstream vendors replace the machine types with their own names + versions.
Quoted 124 lines
Signed-off-by Igor Mammedov <[email protected]>---
CC: Programmingkid <[email protected]>
CC: Phil Dennis-Jordan <[email protected]>
CC: "Michael S. Tsirkin" <[email protected]>Only compile test since I don't have w2k to test with
--- include/hw/i386/pc.h | 1 + hw/i386/acpi-build.c | 26 +++++++++++++++++++------- hw/i386/pc_piix.c | 2 ++ 3 files changed, 22 insertions(+), 7 deletions(-)include/hw/i386/pc.h +1
-0@@ -122,6 +122,7 @@ struct PCMachineClass {bool rsdp_in_ram;int legacy_acpi_table_size;unsigned acpi_data_size; +bool force_rev1_fadt;/* SMBIOS compat: */ bool smbios_defaults;hw/i386/acpi-build.c +19
-7@@ -272,7 +272,7 @@ build_facs(GArray *table_data, BIOSLinker *linker) }/* Load chipset information in FADT */ -static void fadt_setup (AcpiFadtDescriptorRev3 *fadt,AcpiPmInfo *pm) +static void fadt_setup (AcpiFadtDescriptorRev3 *fadt,AcpiPmInfo *pm,bool rev1) { fadt->model =1 ; fadt->reserved1 =0 ;@@ -304,6 +304,9 @@ static void fadt_setup(AcpiFadtDescriptorRev3 *fadt, AcpiPmInfo *pm) fadt->flags |=cpu_to_le32 (1 <<ACPI_FADT_F_FORCE_APIC_CLUSTER_MODEL ); } fadt->century =RTC_CENTURY ; +if (rev1) { +return ; + } fadt->flags |=cpu_to_le32 (1 <<ACPI_FADT_F_RESET_REG_SUP ); fadt->reset_value =0xf ;@@ -335,6 +338,7 @@ static void fadt_setup(AcpiFadtDescriptorRev3 *fadt, AcpiPmInfo *pm)/* FADT */ static void build_fadt (GArray *table_data,BIOSLinker *linker,AcpiPmInfo *pm, +MachineState *machine,unsigned facs_tbl_offset,unsigned dsdt_tbl_offset,const char *oem_id,const char *oem_table_id) {@@ -342,6 +346,9 @@ build_fadt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm,unsigned fw_ctrl_offset = (char *)&fadt->firmware_ctrl - table_data->data;unsigned dsdt_entry_offset = (char *)&fadt->dsdt - table_data->data;unsigned xdsdt_entry_offset = (char *)&fadt->x_dsdt - table_data->data; +PCMachineClass *pcmc =PC_MACHINE_GET_CLASS (machine); +int fadt_size =sizeof (*fadt); +int rev =3 ;/* FACS address to be filled by Guest linker */ bios_linker_loader_add_pointer(linker,@@ -349,16 +356,21 @@ build_fadt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm, ACPI_BUILD_TABLE_FILE, facs_tbl_offset);/* DSDT address to be filled by Guest linker */ -fadt_setup (fadt, pm); +fadt_setup (fadt, pm, pcmc->force_rev1_fadt);bios_linker_loader_add_pointer (linker,ACPI_BUILD_TABLE_FILE , dsdt_entry_offset,sizeof (fadt->dsdt),ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); -bios_linker_loader_add_pointer (linker, -ACPI_BUILD_TABLE_FILE , xdsdt_entry_offset,sizeof (fadt->x_dsdt), -ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); +if (pcmc->force_rev1_fadt) { + rev =1 ; + fadt_size = offsetof(typeof(*fadt), reset_register); + }else { +bios_linker_loader_add_pointer (linker, +ACPI_BUILD_TABLE_FILE , xdsdt_entry_offset,sizeof (fadt->x_dsdt), +ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); + }build_header (linker, table_data, - (void *)fadt,"FACP" ,sizeof (*fadt),3 , oem_id, oem_table_id); + (void *)fadt,"FACP" , fadt_size, rev, oem_id, oem_table_id); } void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid,@@ -2667,7 +2679,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)/* ACPI tables pointed to by RSDT */ fadt = tables_blob->len;acpi_add_table (table_offsets, tables_blob); -build_fadt (tables_blob, tables->linker, &pm, facs, dsdt, +build_fadt (tables_blob, tables->linker, &pm, machine, facs, dsdt, slic_oem.id, slic_oem.table_id); aml_len += tables_blob->len - fadt;hw/i386/pc_piix.c +2
-0@@ -449,9 +449,11 @@ DEFINE_I440FX_MACHINE(v2_10, "pc-i440fx-2.10", NULL,static void pc_i440fx_2_9_machine_options (MachineClass *m) { +PCMachineClass *pcmc =PC_MACHINE_CLASS (m);pc_i440fx_2_10_machine_options (m); m->is_default =0 ; m->alias =NULL ; + pcmc->force_rev1_fadt = true;SET_MACHINE_COMPAT (m,PC_COMPAT_2_9 ); }Signature · 1 line
2.7.4
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Quoted 8 lines · On Fri, 21 Jul 2017 10:49:55 +0100 "Daniel P. Berrange" <[email protected]>…
Quoted 6 lines · Igor Mammedov
w2k used to boot on QEMU until we bumped revision of FADT to rev3
(commit77af8a2bhw/i386: Use Rev3 FADT (ACPI 2.0) instead of Rev1 to improve guest OS support.)Considering that w2k is ancient and long time EOLed, leave default rev3 but make pc-i440fx-2.9 and older machine types to force rev1 so old setups won't break (w2k could boot).
Quoted 6 lines
There needs to be a machine type property added to control this feature. When provisioning new VMs, management apps need to be able to set the property explicitly - having them rely on picking particular machine type name+versions is not viable, because downstream vendors replace the machine types with their own names + versions.
having property doesn't really help here and we don't do it for every compat tweak /ex: save_tsc_khz, linuxboot_dma_enabled/.
Management would not benefit much from having property vs machine version as it would have to encode somewhere that for w2k it should set some machine property or pick a particular machine type.
Probably no one would worry about fixing virt-install or something else for the sake of w2k and if they are going to fix it it doesn't matter if they map machine type vs property.
Also with new machine type deprecation policy we would be able easily to phase out rev1 support along with 2.9 machine, but if you expose property then removing it would break CLI not only for 2.9 but possible later machines if it's set there.
So I'm against adding properties/CLI options for unless we have to in this case, and I'm not convinced that w2k deserves it.
Quoted 127 lines
Quoted 124 lines
Signed-off-by Igor Mammedov <[email protected]>---
CC: Programmingkid <[email protected]>
CC: Phil Dennis-Jordan <[email protected]>
CC: "Michael S. Tsirkin" <[email protected]>Only compile test since I don't have w2k to test with
--- include/hw/i386/pc.h | 1 + hw/i386/acpi-build.c | 26 +++++++++++++++++++------- hw/i386/pc_piix.c | 2 ++ 3 files changed, 22 insertions(+), 7 deletions(-)include/hw/i386/pc.h +1
-0@@ -122,6 +122,7 @@ struct PCMachineClass {bool rsdp_in_ram;int legacy_acpi_table_size;unsigned acpi_data_size; +bool force_rev1_fadt;/* SMBIOS compat: */ bool smbios_defaults;hw/i386/acpi-build.c +19
-7@@ -272,7 +272,7 @@ build_facs(GArray *table_data, BIOSLinker *linker) }/* Load chipset information in FADT */ -static void fadt_setup (AcpiFadtDescriptorRev3 *fadt,AcpiPmInfo *pm) +static void fadt_setup (AcpiFadtDescriptorRev3 *fadt,AcpiPmInfo *pm,bool rev1) { fadt->model =1 ; fadt->reserved1 =0 ;@@ -304,6 +304,9 @@ static void fadt_setup(AcpiFadtDescriptorRev3 *fadt, AcpiPmInfo *pm) fadt->flags |=cpu_to_le32 (1 <<ACPI_FADT_F_FORCE_APIC_CLUSTER_MODEL ); } fadt->century =RTC_CENTURY ; +if (rev1) { +return ; + } fadt->flags |=cpu_to_le32 (1 <<ACPI_FADT_F_RESET_REG_SUP ); fadt->reset_value =0xf ;@@ -335,6 +338,7 @@ static void fadt_setup(AcpiFadtDescriptorRev3 *fadt, AcpiPmInfo *pm)/* FADT */ static void build_fadt (GArray *table_data,BIOSLinker *linker,AcpiPmInfo *pm, +MachineState *machine,unsigned facs_tbl_offset,unsigned dsdt_tbl_offset,const char *oem_id,const char *oem_table_id) {@@ -342,6 +346,9 @@ build_fadt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm,unsigned fw_ctrl_offset = (char *)&fadt->firmware_ctrl - table_data->data;unsigned dsdt_entry_offset = (char *)&fadt->dsdt - table_data->data;unsigned xdsdt_entry_offset = (char *)&fadt->x_dsdt - table_data->data; +PCMachineClass *pcmc =PC_MACHINE_GET_CLASS (machine); +int fadt_size =sizeof (*fadt); +int rev =3 ;/* FACS address to be filled by Guest linker */ bios_linker_loader_add_pointer(linker,@@ -349,16 +356,21 @@ build_fadt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm, ACPI_BUILD_TABLE_FILE, facs_tbl_offset);/* DSDT address to be filled by Guest linker */ -fadt_setup (fadt, pm); +fadt_setup (fadt, pm, pcmc->force_rev1_fadt);bios_linker_loader_add_pointer (linker,ACPI_BUILD_TABLE_FILE , dsdt_entry_offset,sizeof (fadt->dsdt),ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); -bios_linker_loader_add_pointer (linker, -ACPI_BUILD_TABLE_FILE , xdsdt_entry_offset,sizeof (fadt->x_dsdt), -ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); +if (pcmc->force_rev1_fadt) { + rev =1 ; + fadt_size = offsetof(typeof(*fadt), reset_register); + }else { +bios_linker_loader_add_pointer (linker, +ACPI_BUILD_TABLE_FILE , xdsdt_entry_offset,sizeof (fadt->x_dsdt), +ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); + }build_header (linker, table_data, - (void *)fadt,"FACP" ,sizeof (*fadt),3 , oem_id, oem_table_id); + (void *)fadt,"FACP" , fadt_size, rev, oem_id, oem_table_id); } void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid,@@ -2667,7 +2679,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)/* ACPI tables pointed to by RSDT */ fadt = tables_blob->len;acpi_add_table (table_offsets, tables_blob); -build_fadt (tables_blob, tables->linker, &pm, facs, dsdt, +build_fadt (tables_blob, tables->linker, &pm, machine, facs, dsdt, slic_oem.id, slic_oem.table_id); aml_len += tables_blob->len - fadt;hw/i386/pc_piix.c +2
-0@@ -449,9 +449,11 @@ DEFINE_I440FX_MACHINE(v2_10, "pc-i440fx-2.10", NULL,static void pc_i440fx_2_9_machine_options (MachineClass *m) { +PCMachineClass *pcmc =PC_MACHINE_CLASS (m);pc_i440fx_2_10_machine_options (m); m->is_default =0 ; m->alias =NULL ; + pcmc->force_rev1_fadt = true;SET_MACHINE_COMPAT (m,PC_COMPAT_2_9 ); }Signature · 1 line
2.7.4Regards,
Daniel
Quoted 11 lines · Igor Mammedov
Quoted 8 lines · On Fri, 21 Jul 2017 10:49:55 +0100 "Daniel P. Berrange" <[email protected]>…
Quoted 6 lines · Igor Mammedov
w2k used to boot on QEMU until we bumped revision of FADT to rev3
(commit77af8a2bhw/i386: Use Rev3 FADT (ACPI 2.0) instead of Rev1 to improve guest OS support.)Considering that w2k is ancient and long time EOLed, leave default rev3 but make pc-i440fx-2.9 and older machine types to force rev1 so old setups won't break (w2k could boot).
Quoted 8 lines
Quoted 6 lines
There needs to be a machine type property added to control this feature. When provisioning new VMs, management apps need to be able to set the property explicitly - having them rely on picking particular machine type name+versions is not viable, because downstream vendors replace the machine types with their own names + versions.
having property doesn't really help here and we don't do it for every compat tweak /ex:
save_tsc_khz, linuxboot_dma_enabled/.
If those compat tweaks affect compatibility with particular guest OS then they should definitely be exposed as properties too.
Quoted 3 lines
Management would not benefit much from having property vs machine version as it would have to encode somewhere that for w2k it should set some machine property or pick a particular machine type.
It *would* be a significant benefit - property names are stable, machine type versions are not stable becasue downstream vendors change them.
Quoted 4 lines
Also with new machine type deprecation policy we would be able easily to phase out rev1 support along with 2.9 machine, but if you expose property then removing it would break CLI not only for 2.9 but possible later machines if it's set there.
We have the freedom to deprecate properties too if they become a significant burden. If removing machine types prevents us running certain guest OS, because we don't have a property to override, that would be a mark against removing the machine types at all IMHO.
Quoted 2 lines
So I'm against adding properties/CLI options for unless we have to in this case, and I'm not convinced that w2k deserves it.
w2k is just one OS that we happen to know of that breaks - who knows how many others suffer the same fate. So making decisions based on whether you care about a specific OS is flawed IMHO.
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Quoted 17 lines · Igor Mammedov
Quoted 8 lines · On Fri, 21 Jul 2017 10:49:55 +0100 "Daniel P. Berrange" <[email protected]>…
Quoted 6 lines · Igor Mammedov
w2k used to boot on QEMU until we bumped revision of FADT to rev3
(commit77af8a2bhw/i386: Use Rev3 FADT (ACPI 2.0) instead of Rev1 to improve guest OS support.)Considering that w2k is ancient and long time EOLed, leave default rev3 but make pc-i440fx-2.9 and older machine types to force rev1 so old setups won't break (w2k could boot).
Quoted 6 lines
There needs to be a machine type property added to control this feature. When provisioning new VMs, management apps need to be able to set the property explicitly - having them rely on picking particular machine type name+versions is not viable, because downstream vendors replace the machine types with their own names + versions.
Quoted 6 lines
having property doesn't really help here and we don't do it for every compat tweak /ex:
save_tsc_khz, linuxboot_dma_enabled/.Management would not benefit much from having property vs machine version as it would have to encode somewhere that for w2k it should set some machine property or pick a particular machine type.
I think I'd disagree with that. If
users might need this for compatibility with some guests, then it should be a property not just a machine type.
But see below - I think we rushed it for the PC anyway.
Quoted 11 lines
Probably no one would worry about fixing virt-install or something else for the sake of w2k and if they are going to fix it it doesn't matter if they map machine type vs property.
Also with new machine type deprecation policy we would be able easily to phase out rev1 support along with 2.9 machine, but if you expose property then removing it would break CLI not only for 2.9 but possible later machines if it's set there.
So I'm against adding properties/CLI options for unless we have to in this case, and I'm not convinced that w2k deserves it.
If I have to choose, I'd say Mac OSX is way less interesting than old windows versions. Lots of people have software that will only run on old windows and there's probably good money to be had running it on new hardware in VMs. And PC machine is all about compatibility - we have Q35 for new stuff. Besides OSX uses q35 anyway I think.
So maybe the right thing to do is to
- switch default for PC back to rev 1
- keep default for Q35 at rev 3
No machinetype hacks.
Quoted 110 lines
Quoted 110 lines
Quoted 110 lines
Signed-off-by Igor Mammedov <[email protected]>---
CC: Programmingkid <[email protected]>
CC: Phil Dennis-Jordan <[email protected]>
CC: "Michael S. Tsirkin" <[email protected]>Only compile test since I don't have w2k to test with
--- include/hw/i386/pc.h | 1 + hw/i386/acpi-build.c | 26 +++++++++++++++++++------- hw/i386/pc_piix.c | 2 ++ 3 files changed, 22 insertions(+), 7 deletions(-)include/hw/i386/pc.h +1
-0@@ -122,6 +122,7 @@ struct PCMachineClass {bool rsdp_in_ram;int legacy_acpi_table_size;unsigned acpi_data_size; +bool force_rev1_fadt;/* SMBIOS compat: */ bool smbios_defaults;hw/i386/acpi-build.c +19
-7@@ -272,7 +272,7 @@ build_facs(GArray *table_data, BIOSLinker *linker) }/* Load chipset information in FADT */ -static void fadt_setup (AcpiFadtDescriptorRev3 *fadt,AcpiPmInfo *pm) +static void fadt_setup (AcpiFadtDescriptorRev3 *fadt,AcpiPmInfo *pm,bool rev1) { fadt->model =1 ; fadt->reserved1 =0 ;@@ -304,6 +304,9 @@ static void fadt_setup(AcpiFadtDescriptorRev3 *fadt, AcpiPmInfo *pm) fadt->flags |=cpu_to_le32 (1 <<ACPI_FADT_F_FORCE_APIC_CLUSTER_MODEL ); } fadt->century =RTC_CENTURY ; +if (rev1) { +return ; + } fadt->flags |=cpu_to_le32 (1 <<ACPI_FADT_F_RESET_REG_SUP ); fadt->reset_value =0xf ;@@ -335,6 +338,7 @@ static void fadt_setup(AcpiFadtDescriptorRev3 *fadt, AcpiPmInfo *pm)/* FADT */ static void build_fadt (GArray *table_data,BIOSLinker *linker,AcpiPmInfo *pm, +MachineState *machine,unsigned facs_tbl_offset,unsigned dsdt_tbl_offset,const char *oem_id,const char *oem_table_id) {@@ -342,6 +346,9 @@ build_fadt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm,unsigned fw_ctrl_offset = (char *)&fadt->firmware_ctrl - table_data->data;unsigned dsdt_entry_offset = (char *)&fadt->dsdt - table_data->data;unsigned xdsdt_entry_offset = (char *)&fadt->x_dsdt - table_data->data; +PCMachineClass *pcmc =PC_MACHINE_GET_CLASS (machine); +int fadt_size =sizeof (*fadt); +int rev =3 ;/* FACS address to be filled by Guest linker */ bios_linker_loader_add_pointer(linker,@@ -349,16 +356,21 @@ build_fadt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm, ACPI_BUILD_TABLE_FILE, facs_tbl_offset);/* DSDT address to be filled by Guest linker */ -fadt_setup (fadt, pm); +fadt_setup (fadt, pm, pcmc->force_rev1_fadt);bios_linker_loader_add_pointer (linker,ACPI_BUILD_TABLE_FILE , dsdt_entry_offset,sizeof (fadt->dsdt),ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); -bios_linker_loader_add_pointer (linker, -ACPI_BUILD_TABLE_FILE , xdsdt_entry_offset,sizeof (fadt->x_dsdt), -ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); +if (pcmc->force_rev1_fadt) { + rev =1 ; + fadt_size = offsetof(typeof(*fadt), reset_register); + }else { +bios_linker_loader_add_pointer (linker, +ACPI_BUILD_TABLE_FILE , xdsdt_entry_offset,sizeof (fadt->x_dsdt), +ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); + }build_header (linker, table_data, - (void *)fadt,"FACP" ,sizeof (*fadt),3 , oem_id, oem_table_id); + (void *)fadt,"FACP" , fadt_size, rev, oem_id, oem_table_id); } void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid,@@ -2667,7 +2679,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)/* ACPI tables pointed to by RSDT */ fadt = tables_blob->len;acpi_add_table (table_offsets, tables_blob); -build_fadt (tables_blob, tables->linker, &pm, facs, dsdt, +build_fadt (tables_blob, tables->linker, &pm, machine, facs, dsdt, slic_oem.id, slic_oem.table_id); aml_len += tables_blob->len - fadt;hw/i386/pc_piix.c +0
-0@@ -449,9 +449,11 @@ DEFINE_I440FX_MACHINE(v2_10, "pc-i440fx-2.10", NULL,
Quoted 8 lines
Quoted 8 lines
hw/i386/pc_piix.c DEFINE_I440FX_MACHINE(v2_10, "pc-i440fx-2.10", NULL, · line 457
Quoted 8 lines
hw/i386/pc_piix.c +2
-0static void pc_i440fx_2_9_machine_options (MachineClass *m) { +PCMachineClass *pcmc =PC_MACHINE_CLASS (m);pc_i440fx_2_10_machine_options (m); m->is_default =0 ; m->alias =NULL ; + pcmc->force_rev1_fadt = true;SET_MACHINE_COMPAT (m,PC_COMPAT_2_9 );
whatever switch we use for this option, I think it makes sense to add comments to document why we keep this around.
Quoted 9 lines
Quoted 9 lines
Quoted 6 lines
hw/i386/pc_piix.c +0
-0}Signature · 1 line
2.7.4Regards,
Daniel
Quoted 52 lines · Michael S. Tsirkin
Quoted 17 lines · Igor Mammedov
Quoted 8 lines · On Fri, 21 Jul 2017 10:49:55 +0100 "Daniel P. Berrange" <[email protected]>…
Quoted 6 lines · Igor Mammedov
w2k used to boot on QEMU until we bumped revision of FADT to rev3
(commit77af8a2bhw/i386: Use Rev3 FADT (ACPI 2.0) instead of Rev1 to improve guest OS support.)Considering that w2k is ancient and long time EOLed, leave default rev3 but make pc-i440fx-2.9 and older machine types to force rev1 so old setups won't break (w2k could boot).
Quoted 6 lines
There needs to be a machine type property added to control this feature. When provisioning new VMs, management apps need to be able to set the property explicitly - having them rely on picking particular machine type name+versions is not viable, because downstream vendors replace the machine types with their own names + versions.
Quoted 6 lines
having property doesn't really help here and we don't do it for every compat tweak /ex:
save_tsc_khz, linuxboot_dma_enabled/.Management would not benefit much from having property vs machine version as it would have to encode somewhere that for w2k it should set some machine property or pick a particular machine type.
I think I'd disagree with that. If
users might need this for compatibility with some guests, then it should be a property not just a machine type.But see below - I think we rushed it for the PC anyway.
Quoted 11 lines
Probably no one would worry about fixing virt-install or something else for the sake of w2k and if they are going to fix it it doesn't matter if they map machine type vs property.
Also with new machine type deprecation policy we would be able easily to phase out rev1 support along with 2.9 machine, but if you expose property then removing it would break CLI not only for 2.9 but possible later machines if it's set there.
So I'm against adding properties/CLI options for unless we have to in this case, and I'm not convinced that w2k deserves it.
If I have to choose, I'd say Mac OSX is way less interesting than old windows versions. Lots of people have software that will only run on old windows and there's probably good money to be had running it on new hardware in VMs. And PC machine is all about compatibility - we have Q35 for new stuff. Besides OSX uses q35 anyway I think.
Quoted 5 lines
So maybe the right thing to do is to
- switch default for PC back to rev 1
- keep default for Q35 at rev 3No machinetype hacks.
I agree with your ideas.
Quoted 40 lines · On Sat, 22 Jul 2017 02:40:46 +0300 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 17 lines · Igor Mammedov
Quoted 8 lines · On Fri, 21 Jul 2017 10:49:55 +0100 "Daniel P. Berrange" <[email protected]>…
Quoted 6 lines · Igor Mammedov
w2k used to boot on QEMU until we bumped revision of FADT to rev3
(commit77af8a2bhw/i386: Use Rev3 FADT (ACPI 2.0) instead of Rev1 to improve guest OS support.)Considering that w2k is ancient and long time EOLed, leave default rev3 but make pc-i440fx-2.9 and older machine types to force rev1 so old setups won't break (w2k could boot).
Quoted 6 lines
There needs to be a machine type property added to control this feature. When provisioning new VMs, management apps need to be able to set the property explicitly - having them rely on picking particular machine type name+versions is not viable, because downstream vendors replace the machine types with their own names + versions.
Quoted 6 lines
having property doesn't really help here and we don't do it for every compat tweak /ex:
save_tsc_khz, linuxboot_dma_enabled/.Management would not benefit much from having property vs machine version as it would have to encode somewhere that for w2k it should set some machine property or pick a particular machine type.
I think I'd disagree with that. If
users might need this for compatibility with some guests, then it should be a property not just a machine type.But see below - I think we rushed it for the PC anyway.
Quoted 9 lines
Probably no one would worry about fixing virt-install or something else for the sake of w2k and if they are going to fix it it doesn't matter if they map machine type vs property.
Also with new machine type deprecation policy we would be able easily to phase out rev1 support along with 2.9 machine, but if you expose property then removing it would break CLI not only for 2.9 but possible later machines if it's set there.
Quoted 8 lines
Quoted 2 lines
So I'm against adding properties/CLI options for unless we have to in this case, and I'm not convinced that w2k deserves it.
If I have to choose, I'd say Mac OSX is way less interesting than old windows versions. Lots of people have software that will only run on old windows and there's probably good money to be had running it on new hardware in VMs. And PC machine is all about compatibility - we have Q35 for new stuff. Besides OSX uses q35 anyway I think.
Question is for how long we are going to maintain legacy stuff, ACPI spec periodically adds new stuff, which someday is going to break legacy OSes. And maintaining 2 branches of or worse a mix will cost us in time and future regressions, we need to have some policy to cut off legacy features that hold us back, like we are starting to do with machine types.
w2k has been EOLed in 2010 even if we drop its support now, users still can use it as they have an option to use old QEMU for that.
(Ladi said that w2k fails to install since 2.7).
Quoted 6 lines
So maybe the right thing to do is to
- switch default for PC back to rev 1
- keep default for Q35 at rev 3No machinetype hacks.
it's still machine hack pc vs q35 and an extra branch to look after but it's better than an option, I'll respin patch.
Quoted 111 lines
Quoted 111 lines
Quoted 111 lines
Quoted 111 lines
Signed-off-by Igor Mammedov <[email protected]>---
CC: Programmingkid <[email protected]>
CC: Phil Dennis-Jordan <[email protected]>
CC: "Michael S. Tsirkin" <[email protected]>Only compile test since I don't have w2k to test with
--- include/hw/i386/pc.h | 1 + hw/i386/acpi-build.c | 26 +++++++++++++++++++------- hw/i386/pc_piix.c | 2 ++ 3 files changed, 22 insertions(+), 7 deletions(-)include/hw/i386/pc.h +1
-0@@ -122,6 +122,7 @@ struct PCMachineClass {bool rsdp_in_ram;int legacy_acpi_table_size;unsigned acpi_data_size; +bool force_rev1_fadt;/* SMBIOS compat: */ bool smbios_defaults;hw/i386/acpi-build.c +19
-7@@ -272,7 +272,7 @@ build_facs(GArray *table_data, BIOSLinker *linker) }/* Load chipset information in FADT */ -static void fadt_setup (AcpiFadtDescriptorRev3 *fadt,AcpiPmInfo *pm) +static void fadt_setup (AcpiFadtDescriptorRev3 *fadt,AcpiPmInfo *pm,bool rev1) { fadt->model =1 ; fadt->reserved1 =0 ;@@ -304,6 +304,9 @@ static void fadt_setup(AcpiFadtDescriptorRev3 *fadt, AcpiPmInfo *pm) fadt->flags |=cpu_to_le32 (1 <<ACPI_FADT_F_FORCE_APIC_CLUSTER_MODEL ); } fadt->century =RTC_CENTURY ; +if (rev1) { +return ; + } fadt->flags |=cpu_to_le32 (1 <<ACPI_FADT_F_RESET_REG_SUP ); fadt->reset_value =0xf ;@@ -335,6 +338,7 @@ static void fadt_setup(AcpiFadtDescriptorRev3 *fadt, AcpiPmInfo *pm)/* FADT */ static void build_fadt (GArray *table_data,BIOSLinker *linker,AcpiPmInfo *pm, +MachineState *machine,unsigned facs_tbl_offset,unsigned dsdt_tbl_offset,const char *oem_id,const char *oem_table_id) {@@ -342,6 +346,9 @@ build_fadt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm,unsigned fw_ctrl_offset = (char *)&fadt->firmware_ctrl - table_data->data;unsigned dsdt_entry_offset = (char *)&fadt->dsdt - table_data->data;unsigned xdsdt_entry_offset = (char *)&fadt->x_dsdt - table_data->data; +PCMachineClass *pcmc =PC_MACHINE_GET_CLASS (machine); +int fadt_size =sizeof (*fadt); +int rev =3 ;/* FACS address to be filled by Guest linker */ bios_linker_loader_add_pointer(linker,@@ -349,16 +356,21 @@ build_fadt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm, ACPI_BUILD_TABLE_FILE, facs_tbl_offset);/* DSDT address to be filled by Guest linker */ -fadt_setup (fadt, pm); +fadt_setup (fadt, pm, pcmc->force_rev1_fadt);bios_linker_loader_add_pointer (linker,ACPI_BUILD_TABLE_FILE , dsdt_entry_offset,sizeof (fadt->dsdt),ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); -bios_linker_loader_add_pointer (linker, -ACPI_BUILD_TABLE_FILE , xdsdt_entry_offset,sizeof (fadt->x_dsdt), -ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); +if (pcmc->force_rev1_fadt) { + rev =1 ; + fadt_size = offsetof(typeof(*fadt), reset_register); + }else { +bios_linker_loader_add_pointer (linker, +ACPI_BUILD_TABLE_FILE , xdsdt_entry_offset,sizeof (fadt->x_dsdt), +ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); + }build_header (linker, table_data, - (void *)fadt,"FACP" ,sizeof (*fadt),3 , oem_id, oem_table_id); + (void *)fadt,"FACP" , fadt_size, rev, oem_id, oem_table_id); } void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid,@@ -2667,7 +2679,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)/* ACPI tables pointed to by RSDT */ fadt = tables_blob->len;acpi_add_table (table_offsets, tables_blob); -build_fadt (tables_blob, tables->linker, &pm, facs, dsdt, +build_fadt (tables_blob, tables->linker, &pm, machine, facs, dsdt, slic_oem.id, slic_oem.table_id); aml_len += tables_blob->len - fadt;hw/i386/pc_piix.c +0
-0@@ -449,9 +449,11 @@ DEFINE_I440FX_MACHINE(v2_10, "pc-i440fx-2.10", NULL,
Quoted 11 lines
Quoted 8 lines
Quoted 8 lines
hw/i386/pc_piix.c DEFINE_I440FX_MACHINE(v2_10, "pc-i440fx-2.10", NULL, · line 457
Quoted 8 lines
hw/i386/pc_piix.c +2
-0static void pc_i440fx_2_9_machine_options (MachineClass *m) { +PCMachineClass *pcmc =PC_MACHINE_CLASS (m);pc_i440fx_2_10_machine_options (m); m->is_default =0 ; m->alias =NULL ; + pcmc->force_rev1_fadt = true;SET_MACHINE_COMPAT (m,PC_COMPAT_2_9 );whatever switch we use for this option, I think it makes sense to add comments to document why we keep this around.
ok
Quoted 12 lines
Quoted 11 lines
Quoted 11 lines
Quoted 8 lines
hw/i386/pc_piix.c +0
-0}Signature · 1 line
2.7.4Regards,
Daniel
Quoted 51 lines · Igor Mammedov
Quoted 40 lines · On Sat, 22 Jul 2017 02:40:46 +0300 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 17 lines · Igor Mammedov
Quoted 8 lines · On Fri, 21 Jul 2017 10:49:55 +0100 "Daniel P. Berrange" <[email protected]>…
Quoted 6 lines · Igor Mammedov
w2k used to boot on QEMU until we bumped revision of FADT to rev3
(commit77af8a2bhw/i386: Use Rev3 FADT (ACPI 2.0) instead of Rev1 to improve guest OS support.)Considering that w2k is ancient and long time EOLed, leave default rev3 but make pc-i440fx-2.9 and older machine types to force rev1 so old setups won't break (w2k could boot).
Quoted 6 lines
There needs to be a machine type property added to control this feature. When provisioning new VMs, management apps need to be able to set the property explicitly - having them rely on picking particular machine type name+versions is not viable, because downstream vendors replace the machine types with their own names + versions.
Quoted 6 lines
having property doesn't really help here and we don't do it for every compat tweak /ex:
save_tsc_khz, linuxboot_dma_enabled/.Management would not benefit much from having property vs machine version as it would have to encode somewhere that for w2k it should set some machine property or pick a particular machine type.
I think I'd disagree with that. If
users might need this for compatibility with some guests, then it should be a property not just a machine type.But see below - I think we rushed it for the PC anyway.
Quoted 9 lines
Probably no one would worry about fixing virt-install or something else for the sake of w2k and if they are going to fix it it doesn't matter if they map machine type vs property.
Also with new machine type deprecation policy we would be able easily to phase out rev1 support along with 2.9 machine, but if you expose property then removing it would break CLI not only for 2.9 but possible later machines if it's set there.
Quoted 8 lines
Quoted 2 lines
So I'm against adding properties/CLI options for unless we have to in this case, and I'm not convinced that w2k deserves it.
If I have to choose, I'd say Mac OSX is way less interesting than old windows versions. Lots of people have software that will only run on old windows and there's probably good money to be had running it on new hardware in VMs. And PC machine is all about compatibility - we have Q35 for new stuff. Besides OSX uses q35 anyway I think.
Quoted 9 lines
Question is for how long we are going to maintain legacy stuff, ACPI spec periodically adds new stuff, which someday is going to break legacy OSes. And maintaining 2 branches of or worse a mix will cost us in time and future regressions, we need to have some policy to cut off legacy features that hold us back, like we are starting to do with machine types.
w2k has been EOLed in 2010 even if we drop its support now, users still can use it as they have an option to use old QEMU for that.
Users can't normally get old QEMU, even if they could it is not a good idea because of security.
Quoted 1 line
(Ladi said that w2k fails to install since 2.7).
Bisect will likely find what's wrong.
Quoted 145 lines
Quoted 6 lines
So maybe the right thing to do is to
- switch default for PC back to rev 1
- keep default for Q35 at rev 3No machinetype hacks.
it's still machine hack pc vs q35 and an extra branch to look after but it's better than an option, I'll respin patch.
Quoted 111 lines
Quoted 111 lines
Quoted 111 lines
Quoted 111 lines
Signed-off-by Igor Mammedov <[email protected]>---
CC: Programmingkid <[email protected]>
CC: Phil Dennis-Jordan <[email protected]>
CC: "Michael S. Tsirkin" <[email protected]>Only compile test since I don't have w2k to test with
--- include/hw/i386/pc.h | 1 + hw/i386/acpi-build.c | 26 +++++++++++++++++++------- hw/i386/pc_piix.c | 2 ++ 3 files changed, 22 insertions(+), 7 deletions(-)include/hw/i386/pc.h +1
-0@@ -122,6 +122,7 @@ struct PCMachineClass {bool rsdp_in_ram;int legacy_acpi_table_size;unsigned acpi_data_size; +bool force_rev1_fadt;/* SMBIOS compat: */ bool smbios_defaults;hw/i386/acpi-build.c +19
-7@@ -272,7 +272,7 @@ build_facs(GArray *table_data, BIOSLinker *linker) }/* Load chipset information in FADT */ -static void fadt_setup (AcpiFadtDescriptorRev3 *fadt,AcpiPmInfo *pm) +static void fadt_setup (AcpiFadtDescriptorRev3 *fadt,AcpiPmInfo *pm,bool rev1) { fadt->model =1 ; fadt->reserved1 =0 ;@@ -304,6 +304,9 @@ static void fadt_setup(AcpiFadtDescriptorRev3 *fadt, AcpiPmInfo *pm) fadt->flags |=cpu_to_le32 (1 <<ACPI_FADT_F_FORCE_APIC_CLUSTER_MODEL ); } fadt->century =RTC_CENTURY ; +if (rev1) { +return ; + } fadt->flags |=cpu_to_le32 (1 <<ACPI_FADT_F_RESET_REG_SUP ); fadt->reset_value =0xf ;@@ -335,6 +338,7 @@ static void fadt_setup(AcpiFadtDescriptorRev3 *fadt, AcpiPmInfo *pm)/* FADT */ static void build_fadt (GArray *table_data,BIOSLinker *linker,AcpiPmInfo *pm, +MachineState *machine,unsigned facs_tbl_offset,unsigned dsdt_tbl_offset,const char *oem_id,const char *oem_table_id) {@@ -342,6 +346,9 @@ build_fadt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm,unsigned fw_ctrl_offset = (char *)&fadt->firmware_ctrl - table_data->data;unsigned dsdt_entry_offset = (char *)&fadt->dsdt - table_data->data;unsigned xdsdt_entry_offset = (char *)&fadt->x_dsdt - table_data->data; +PCMachineClass *pcmc =PC_MACHINE_GET_CLASS (machine); +int fadt_size =sizeof (*fadt); +int rev =3 ;/* FACS address to be filled by Guest linker */ bios_linker_loader_add_pointer(linker,@@ -349,16 +356,21 @@ build_fadt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm, ACPI_BUILD_TABLE_FILE, facs_tbl_offset);/* DSDT address to be filled by Guest linker */ -fadt_setup (fadt, pm); +fadt_setup (fadt, pm, pcmc->force_rev1_fadt);bios_linker_loader_add_pointer (linker,ACPI_BUILD_TABLE_FILE , dsdt_entry_offset,sizeof (fadt->dsdt),ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); -bios_linker_loader_add_pointer (linker, -ACPI_BUILD_TABLE_FILE , xdsdt_entry_offset,sizeof (fadt->x_dsdt), -ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); +if (pcmc->force_rev1_fadt) { + rev =1 ; + fadt_size = offsetof(typeof(*fadt), reset_register); + }else { +bios_linker_loader_add_pointer (linker, +ACPI_BUILD_TABLE_FILE , xdsdt_entry_offset,sizeof (fadt->x_dsdt), +ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); + }build_header (linker, table_data, - (void *)fadt,"FACP" ,sizeof (*fadt),3 , oem_id, oem_table_id); + (void *)fadt,"FACP" , fadt_size, rev, oem_id, oem_table_id); } void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid,@@ -2667,7 +2679,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)/* ACPI tables pointed to by RSDT */ fadt = tables_blob->len;acpi_add_table (table_offsets, tables_blob); -build_fadt (tables_blob, tables->linker, &pm, facs, dsdt, +build_fadt (tables_blob, tables->linker, &pm, machine, facs, dsdt, slic_oem.id, slic_oem.table_id); aml_len += tables_blob->len - fadt;hw/i386/pc_piix.c +0
-0@@ -449,9 +449,11 @@ DEFINE_I440FX_MACHINE(v2_10, "pc-i440fx-2.10", NULL,Quoted 11 lines
Quoted 8 lines
Quoted 8 lines
hw/i386/pc_piix.c DEFINE_I440FX_MACHINE(v2_10, "pc-i440fx-2.10", NULL, · line 457
Quoted 8 lines
hw/i386/pc_piix.c +2
-0static void pc_i440fx_2_9_machine_options (MachineClass *m) { +PCMachineClass *pcmc =PC_MACHINE_CLASS (m);pc_i440fx_2_10_machine_options (m); m->is_default =0 ; m->alias =NULL ; + pcmc->force_rev1_fadt = true;SET_MACHINE_COMPAT (m,PC_COMPAT_2_9 );whatever switch we use for this option, I think it makes sense to add comments to document why we keep this around.
ok
Quoted 12 lines
Quoted 11 lines
Quoted 11 lines
Quoted 8 lines
hw/i386/pc_piix.c +0
-0}Signature · 1 line
2.7.4Regards,
Daniel
Quoted 62 lines · Michael S. Tsirkin
Quoted 51 lines · Igor Mammedov
Quoted 40 lines · On Sat, 22 Jul 2017 02:40:46 +0300 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 17 lines · Igor Mammedov
Quoted 8 lines · On Fri, 21 Jul 2017 10:49:55 +0100 "Daniel P. Berrange" <[email protected]>…
Quoted 6 lines · Igor Mammedov
w2k used to boot on QEMU until we bumped revision of FADT to rev3
(commit77af8a2bhw/i386: Use Rev3 FADT (ACPI 2.0) instead of Rev1 to improve guest OS support.)Considering that w2k is ancient and long time EOLed, leave default rev3 but make pc-i440fx-2.9 and older machine types to force rev1 so old setups won't break (w2k could boot).
Quoted 6 lines
There needs to be a machine type property added to control this feature. When provisioning new VMs, management apps need to be able to set the property explicitly - having them rely on picking particular machine type name+versions is not viable, because downstream vendors replace the machine types with their own names + versions.
Quoted 6 lines
having property doesn't really help here and we don't do it for every compat tweak /ex:
save_tsc_khz, linuxboot_dma_enabled/.Management would not benefit much from having property vs machine version as it would have to encode somewhere that for w2k it should set some machine property or pick a particular machine type.
I think I'd disagree with that. If
users might need this for compatibility with some guests, then it should be a property not just a machine type.But see below - I think we rushed it for the PC anyway.
Quoted 9 lines
Probably no one would worry about fixing virt-install or something else for the sake of w2k and if they are going to fix it it doesn't matter if they map machine type vs property.
Also with new machine type deprecation policy we would be able easily to phase out rev1 support along with 2.9 machine, but if you expose property then removing it would break CLI not only for 2.9 but possible later machines if it's set there.
Quoted 8 lines
Quoted 2 lines
So I'm against adding properties/CLI options for unless we have to in this case, and I'm not convinced that w2k deserves it.
If I have to choose, I'd say Mac OSX is way less interesting than old windows versions. Lots of people have software that will only run on old windows and there's probably good money to be had running it on new hardware in VMs. And PC machine is all about compatibility - we have Q35 for new stuff. Besides OSX uses q35 anyway I think.
Quoted 9 lines
Question is for how long we are going to maintain legacy stuff, ACPI spec periodically adds new stuff, which someday is going to break legacy OSes. And maintaining 2 branches of or worse a mix will cost us in time and future regressions, we need to have some policy to cut off legacy features that hold us back, like we are starting to do with machine types.
w2k has been EOLed in 2010 even if we drop its support now, users still can use it as they have an option to use old QEMU for that.
Quoted 6 lines
Users can't normally get old QEMU, even if they could it is not a good idea because of security.
Quoted 1 line
(Ladi said that w2k fails to install since 2.7).
Bisect will likely find what's wrong.
I still intend to find the issue. Unlike this FADT revision/length problem, setup fails after a long time, basically at the very end of the process. I tried to speed up bisecting it by saving the state of the VM before the failure and running just the problematic part but it didn't work. I'll just have to bite the bullet and run setup from the beginning every time.
Quoted 146 lines
Quoted 145 lines
Quoted 6 lines
So maybe the right thing to do is to
- switch default for PC back to rev 1
- keep default for Q35 at rev 3No machinetype hacks.
it's still machine hack pc vs q35 and an extra branch to look after but it's better than an option, I'll respin patch.
Quoted 111 lines
Quoted 111 lines
Quoted 111 lines
Quoted 111 lines
Signed-off-by Igor Mammedov <[email protected]>---
CC: Programmingkid <[email protected]>
CC: Phil Dennis-Jordan <[email protected]>
CC: "Michael S. Tsirkin" <[email protected]>Only compile test since I don't have w2k to test with
--- include/hw/i386/pc.h | 1 + hw/i386/acpi-build.c | 26 +++++++++++++++++++------- hw/i386/pc_piix.c | 2 ++ 3 files changed, 22 insertions(+), 7 deletions(-)include/hw/i386/pc.h +1
-0@@ -122,6 +122,7 @@ struct PCMachineClass {bool rsdp_in_ram;int legacy_acpi_table_size;unsigned acpi_data_size; +bool force_rev1_fadt;/* SMBIOS compat: */ bool smbios_defaults;hw/i386/acpi-build.c +19
-7@@ -272,7 +272,7 @@ build_facs(GArray *table_data, BIOSLinker *linker) }/* Load chipset information in FADT */ -static void fadt_setup (AcpiFadtDescriptorRev3 *fadt,AcpiPmInfo *pm) +static void fadt_setup (AcpiFadtDescriptorRev3 *fadt,AcpiPmInfo *pm,bool rev1) { fadt->model =1 ; fadt->reserved1 =0 ;@@ -304,6 +304,9 @@ static void fadt_setup(AcpiFadtDescriptorRev3 *fadt, AcpiPmInfo *pm) fadt->flags |=cpu_to_le32 (1 <<ACPI_FADT_F_FORCE_APIC_CLUSTER_MODEL ); } fadt->century =RTC_CENTURY ; +if (rev1) { +return ; + } fadt->flags |=cpu_to_le32 (1 <<ACPI_FADT_F_RESET_REG_SUP ); fadt->reset_value =0xf ;@@ -335,6 +338,7 @@ static void fadt_setup(AcpiFadtDescriptorRev3 *fadt, AcpiPmInfo *pm)/* FADT */ static void build_fadt (GArray *table_data,BIOSLinker *linker,AcpiPmInfo *pm, +MachineState *machine,unsigned facs_tbl_offset,unsigned dsdt_tbl_offset,const char *oem_id,const char *oem_table_id) {@@ -342,6 +346,9 @@ build_fadt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm,unsigned fw_ctrl_offset = (char *)&fadt->firmware_ctrl - table_data->data;unsigned dsdt_entry_offset = (char *)&fadt->dsdt - table_data->data;unsigned xdsdt_entry_offset = (char *)&fadt->x_dsdt - table_data->data; +PCMachineClass *pcmc =PC_MACHINE_GET_CLASS (machine); +int fadt_size =sizeof (*fadt); +int rev =3 ;/* FACS address to be filled by Guest linker */ bios_linker_loader_add_pointer(linker,@@ -349,16 +356,21 @@ build_fadt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm, ACPI_BUILD_TABLE_FILE, facs_tbl_offset);/* DSDT address to be filled by Guest linker */ -fadt_setup (fadt, pm); +fadt_setup (fadt, pm, pcmc->force_rev1_fadt);bios_linker_loader_add_pointer (linker,ACPI_BUILD_TABLE_FILE , dsdt_entry_offset,sizeof (fadt->dsdt),ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); -bios_linker_loader_add_pointer (linker, -ACPI_BUILD_TABLE_FILE , xdsdt_entry_offset,sizeof (fadt->x_dsdt), -ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); +if (pcmc->force_rev1_fadt) { + rev =1 ; + fadt_size = offsetof(typeof(*fadt), reset_register); + }else { +bios_linker_loader_add_pointer (linker, +ACPI_BUILD_TABLE_FILE , xdsdt_entry_offset,sizeof (fadt->x_dsdt), +ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); + }build_header (linker, table_data, - (void *)fadt,"FACP" ,sizeof (*fadt),3 , oem_id, oem_table_id); + (void *)fadt,"FACP" , fadt_size, rev, oem_id, oem_table_id); } void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid,@@ -2667,7 +2679,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)/* ACPI tables pointed to by RSDT */ fadt = tables_blob->len;acpi_add_table (table_offsets, tables_blob); -build_fadt (tables_blob, tables->linker, &pm, facs, dsdt, +build_fadt (tables_blob, tables->linker, &pm, machine, facs, dsdt, slic_oem.id, slic_oem.table_id); aml_len += tables_blob->len - fadt;hw/i386/pc_piix.c +0
-0@@ -449,9 +449,11 @@ DEFINE_I440FX_MACHINE(v2_10, "pc-i440fx-2.10", NULL,Quoted 11 lines
Quoted 8 lines
Quoted 8 lines
hw/i386/pc_piix.c DEFINE_I440FX_MACHINE(v2_10, "pc-i440fx-2.10", NULL, · line 457
Quoted 8 lines
hw/i386/pc_piix.c +2
-0static void pc_i440fx_2_9_machine_options (MachineClass *m) { +PCMachineClass *pcmc =PC_MACHINE_CLASS (m);pc_i440fx_2_10_machine_options (m); m->is_default =0 ; m->alias =NULL ; + pcmc->force_rev1_fadt = true;SET_MACHINE_COMPAT (m,PC_COMPAT_2_9 );whatever switch we use for this option, I think it makes sense to add comments to document why we keep this around.
ok
Quoted 12 lines
Quoted 11 lines
Quoted 11 lines
Quoted 8 lines
hw/i386/pc_piix.c +0
-1} --2.7.4
Regards,
Daniel
Quoted 78 lines · Ladi Prosek
Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Igor Mammedov
Quoted 6 lines · On Sat, 22 Jul 2017 02:40:46 +0300 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 5 lines · Igor Mammedov
Quoted 2 lines · On Fri, 21 Jul 2017 10:49:55 +0100 "Daniel P. Berrange" <[email protected]>…
Quoted 1 line · Igor Mammedov
w2k used to boot on QEMU until we bumped revision of FADT to
rev3
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
(commit
77af8a2bhw/i386: Use Rev3 FADT (ACPI 2.0) instead ofRev1 to improve guest OS support.)
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Considering that w2k is ancient and long time EOLed, leave
default
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
rev3 but make pc-i440fx-2.9 and older machine types to force
rev1
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
Quoted 1 line
so old setups won't break (w2k could boot).
There needs to be a machine type property added to control this feature. When provisioning new VMs, management apps need to be able to set the property explicitly - having them rely on picking particular machine type name+versions is not viable, because downstream vendors replace the machine types with their own names + versions.
having property doesn't really help here and we don't do it for
every
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
compat tweak /ex:
save_tsc_khz, linuxboot_dma_enabled/.Management would not benefit much from having property vs machine
version
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 2 lines
as it would have to encode somewhere that for w2k it should set some machine property or pick a particular machine type.
I think I'd disagree with that. If
users might need this for compatibility with some guests, then it should be a property not just a machine type.But see below - I think we rushed it for the PC anyway.
Quoted 4 lines
Probably no one would worry about fixing virt-install or something else for the sake of w2k and if they are going to fix it it doesn't matter if they map machine type vs property.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Also with new machine type deprecation policy we would be able easily to phase out rev1 support along with 2.9 machine, but if you expose property then removing it would break CLI not only for 2.9 but possible later machines if it's set there.
So I'm against adding properties/CLI options for unless we have to
in this case,
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
and I'm not convinced that w2k deserves it.
If I have to choose, I'd say Mac OSX is way less interesting than old windows versions. Lots of people have software that will only run on
old
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
windows and there's probably good money to be had running it on new hardware in VMs. And PC machine is all about compatibility - we have
Q35
Quoted 16 lines
Quoted 10 lines
Quoted 1 line
for new stuff. Besides OSX uses q35 anyway I think.
Question is for how long we are going to maintain legacy stuff, ACPI spec periodically adds new stuff, which someday is going to break legacy OSes. And maintaining 2 branches of or worse a mix will cost us in time and future regressions, we need to have some policy to cut off legacy features that hold us back, like we are starting to do with machine types.
w2k has been EOLed in 2010 even if we drop its support now, users still can use it as they have an option to use old QEMU for that.Users can't normally get old QEMU, even if they could it is not a good idea because of security.
Quoted 1 line
(Ladi said that w2k fails to install since 2.7).
Quoted 9 lines
Quoted 1 line
Bisect will likely find what's wrong.
I still intend to find the issue. Unlike this FADT revision/length problem, setup fails after a long time, basically at the very end of the process. I tried to speed up bisecting it by saving the state of the VM before the failure and running just the problematic part but it didn't work. I'll just have to bite the bullet and run setup from the beginning every time.
Anecdotal evidence: I managed to install Windows 2000 Pro from scratch a few days ago using this patch on qemu master. (i386, TCG, -m 512) No setup failures, system booted up fine after install. Maybe it doesn't like one of your options, or your installer disk image has got corrupted? (Or maybe there are different variants of Win2K installer images.)
Quoted 167 lines
Quoted 35 lines
Quoted 35 lines
Quoted 6 lines
So maybe the right thing to do is to
- switch default for PC back to rev 1
- keep default for Q35 at rev 3No machinetype hacks.
it's still machine hack pc vs q35 and an extra branch to look after but it's better than an option, I'll respin patch.
Quoted 26 lines
Quoted 26 lines
Quoted 26 lines
Quoted 26 lines
Signed-off-by Igor Mammedov <[email protected]>---
CC: Programmingkid <[email protected]>
CC: Phil Dennis-Jordan <[email protected]>
CC: "Michael S. Tsirkin" <[email protected]>Only compile test since I don't have w2k to test with
--- include/hw/i386/pc.h | 1 + hw/i386/acpi-build.c | 26 +++++++++++++++++++------- hw/i386/pc_piix.c | 2 ++ 3 files changed, 22 insertions(+), 7 deletions(-)include/hw/i386/pc.h +1
-0@@ -122,6 +122,7 @@ struct PCMachineClass {bool rsdp_in_ram;int legacy_acpi_table_size;unsigned acpi_data_size; +bool force_rev1_fadt;Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
hw/i386/acpi-build.c build_facs(GArray *table_data, BIOSLinker
Quoted 7 lines
include/hw/i386/pc.h +0
-0/* SMBIOS compat: */ bool smbios_defaults;hw/i386/acpi-build.c +0
-0@@ -272,7 +272,7 @@ build_facs(GArray *table_data, BIOSLinker*linker)
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
hw/i386/acpi-build.c build_facs(GArray *table_data, BIOSLinker · line 275
Quoted 4 lines
hw/i386/acpi-build.c +0
-1}/* Load chipset information in FADT */ -static void fadt_setup(AcpiFadtDescriptorRev3 *fadt,AcpiPmInfo *pm)
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
hw/i386/acpi-build.c build_facs(GArray *table_data, BIOSLinker · line 275
Quoted 1 line
hw/i386/acpi-build.c +1
-0+static void fadt_setup(AcpiFadtDescriptorRev3 *fadt,AcpiPmInfo *pm, bool rev1)
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
hw/i386/acpi-build.c static void
Quoted 4 lines
hw/i386/acpi-build.c +0
-0{ fadt->model =1 ; fadt->reserved1 =0 ;@@ -304,6 +304,9 @@ static void
fadt_setup(AcpiFadtDescriptorRev3 *fadt, AcpiPmInfo *pm)Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
hw/i386/acpi-build.c static void · line 304
Quoted 1 line
hw/i386/acpi-build.c +0
-0fadt->flags |= cpu_to_le32(1 <<
ACPI_FADT_F_FORCE_APIC_CLUSTER_MODEL);Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
hw/i386/acpi-build.c static void
Quoted 9 lines
hw/i386/acpi-build.c +3
-0} fadt->century =RTC_CENTURY ; +if (rev1) { +return ; + } fadt->flags |=cpu_to_le32 (1 <<ACPI_FADT_F_RESET_REG_SUP ); fadt->reset_value =0xf ;@@ -335,6 +338,7 @@ static void
fadt_setup(AcpiFadtDescriptorRev3 *fadt, AcpiPmInfo *pm)Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
hw/i386/acpi-build.c static void · line 340
Quoted 3 lines
hw/i386/acpi-build.c +0
-0/* FADT */ static void build_fadt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo*pm,
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
hw/i386/acpi-build.c build_fadt(GArray *table_data, BIOSLinker
Quoted 5 lines
hw/i386/acpi-build.c +1
-0+MachineState *machine, unsigned facs_tbl_offset, unsigned dsdt_tbl_offset, const char *oem_id, const char *oem_table_id) {@@ -342,6 +346,9 @@ build_fadt(GArray *table_data, BIOSLinker*linker, AcpiPmInfo *pm,
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
hw/i386/acpi-build.c build_fadt(GArray *table_data, BIOSLinker · line 346
Quoted 1 line
hw/i386/acpi-build.c +0
-0unsigned fw_ctrl_offset = (char *)&fadt->firmware_ctrl -
table_data->data;Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
hw/i386/acpi-build.c build_fadt(GArray *table_data, BIOSLinker · line 347
Quoted 1 line
hw/i386/acpi-build.c +0
-0unsigned dsdt_entry_offset = (char *)&fadt->dsdt -
table_data->data;Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
hw/i386/acpi-build.c build_fadt(GArray *table_data, BIOSLinker · line 348
Quoted 1 line
hw/i386/acpi-build.c +0
-0unsigned xdsdt_entry_offset = (char *)&fadt->x_dsdt -
table_data->data;Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
hw/i386/acpi-build.c build_fadt(GArray *table_data, BIOSLinker
Quoted 7 lines
hw/i386/acpi-build.c +3
-0+PCMachineClass *pcmc =PC_MACHINE_GET_CLASS (machine); +int fadt_size =sizeof (*fadt); +int rev =3 ;/* FACS address to be filled by Guest linker */ bios_linker_loader_add_pointer(linker,@@ -349,16 +356,21 @@ build_fadt(GArray *table_data, BIOSLinker*linker, AcpiPmInfo *pm,
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
hw/i386/acpi-build.c build_fadt(GArray *table_data, BIOSLinker · line 361
Quoted 7 lines
hw/i386/acpi-build.c +1
-1ACPI_BUILD_TABLE_FILE, facs_tbl_offset);/* DSDT address to be filled by Guest linker */ -fadt_setup (fadt, pm); +fadt_setup (fadt, pm, pcmc->force_rev1_fadt); bios_linker_loader_add_pointer(linker, ACPI_BUILD_TABLE_FILE, dsdt_entry_offset,
sizeof(fadt->dsdt),Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
hw/i386/acpi-build.c build_fadt(GArray *table_data, BIOSLinker · line 357
Quoted 3 lines
hw/i386/acpi-build.c +0
-2ACPI_BUILD_TABLE_FILE, dsdt_tbl_offset); - bios_linker_loader_add_pointer(linker, - ACPI_BUILD_TABLE_FILE, xdsdt_entry_offset,
sizeof(fadt->x_dsdt),Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
hw/i386/acpi-build.c build_fadt(GArray *table_data, BIOSLinker · line 368
Quoted 7 lines
hw/i386/acpi-build.c +6
-1- ACPI_BUILD_TABLE_FILE, dsdt_tbl_offset); +if (pcmc->force_rev1_fadt) { + rev =1 ; + fadt_size = offsetof(typeof(*fadt), reset_register); + }else { + bios_linker_loader_add_pointer(linker, + ACPI_BUILD_TABLE_FILE, xdsdt_entry_offset,
sizeof(fadt->x_dsdt),Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
hw/i386/acpi-build.c build_fadt(GArray *table_data, BIOSLinker · line 361
Quoted 5 lines
hw/i386/acpi-build.c +2
-1+ ACPI_BUILD_TABLE_FILE, dsdt_tbl_offset); + } build_header(linker, table_data, - (void *)fadt, "FACP", sizeof(*fadt), 3,
oem_id,oem_table_id);Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
hw/i386/acpi-build.c build_fadt(GArray *table_data, BIOSLinker · line 373
Quoted 1 line
hw/i386/acpi-build.c +1
-0+ (void *)fadt, "FACP", fadt_size, rev, oem_id,
oem_table_id);Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
hw/i386/acpi-build.c void acpi_build(AcpiBuildTables *tables,
Quoted 4 lines
hw/i386/acpi-build.c +0
-0} void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid,@@ -2667,7 +2679,7 @@ void acpi_build(AcpiBuildTables *tables,MachineState *machine)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
hw/i386/acpi-build.c void acpi_build(AcpiBuildTables *tables, · line 2682
Quoted 5 lines
hw/i386/acpi-build.c +1
-1/* ACPI tables pointed to by RSDT */ fadt = tables_blob->len;acpi_add_table (table_offsets, tables_blob); - build_fadt(tables_blob, tables->linker, &pm, facs, dsdt, + build_fadt(tables_blob, tables->linker, &pm, machine,facs, dsdt,
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
hw/i386/pc_piix.c DEFINE_I440FX_MACHINE(v2_10,
Quoted 8 lines
hw/i386/acpi-build.c +0
-0slic_oem.id, slic_oem.table_id); aml_len += tables_blob->len - fadt;hw/i386/pc_piix.c +0
-0@@ -449,9 +449,11 @@ DEFINE_I440FX_MACHINE(v2_10,"pc-i440fx-2.10", NULL,
Quoted 27 lines
Quoted 26 lines
Quoted 10 lines
Quoted 9 lines
Quoted 9 lines
hw/i386/pc_piix.c DEFINE_I440FX_MACHINE(v2_10, · line 456
Quoted 9 lines
hw/i386/pc_piix.c +2
-0static void pc_i440fx_2_9_machine_options (MachineClass *m) { +PCMachineClass *pcmc =PC_MACHINE_CLASS (m);pc_i440fx_2_10_machine_options (m); m->is_default =0 ; m->alias =NULL ; + pcmc->force_rev1_fadt = true;SET_MACHINE_COMPAT (m,PC_COMPAT_2_9 );Quoted 2 lines
whatever switch we use for this option, I think it makes sense to add comments to document why we keep this around.
ok
Quoted 12 lines
Quoted 11 lines
Quoted 11 lines
Quoted 8 lines
hw/i386/pc_piix.c +0
-1} --2.7.4
Regards,
Daniel
Quoted 7 lines · Igor Mammedov
w2k used to boot on QEMU until we bumped revision of FADT to rev3
(commit77af8a2bhw/i386: Use Rev3 FADT (ACPI 2.0) instead of Rev1 to improve guest OS support.)Considering that w2k is ancient and long time EOLed, leave default rev3 but make pc-i440fx-2.9 and older machine types to force rev1 so old setups won't break (w2k could boot).
Quoted 7 lines
Signed-off-by Igor Mammedov <[email protected]>---
CC: Programmingkid <[email protected]>
CC: Phil Dennis-Jordan <[email protected]>
CC: "Michael S. Tsirkin" <[email protected]>Only compile test since I don't have w2k to test with
Confirming that Windows 2000 boots with this patch and -machine pc-i440fx-2.9.
Quoted 14 lines · On Fri, 21 Jul 2017 11:54:20 +0200 Ladi Prosek <[email protected]> wrote:
Quoted 13 lines · Igor Mammedov
w2k used to boot on QEMU until we bumped revision of FADT to rev3
(commit77af8a2bhw/i386: Use Rev3 FADT (ACPI 2.0) instead of Rev1 to improve guest OS support.)Considering that w2k is ancient and long time EOLed, leave default rev3 but make pc-i440fx-2.9 and older machine types to force rev1 so old setups won't break (w2k could boot).
Signed-off-by Igor Mammedov <[email protected]>---
CC: Programmingkid <[email protected]>
CC: Phil Dennis-Jordan <[email protected]>
CC: "Michael S. Tsirkin" <[email protected]>
Quoted 3 lines
Quoted 1 line
Only compile test since I don't have w2k to test with
Confirming that Windows 2000 boots with this patch and -machine pc-i440fx-2.9.
Ladi,
Could you to try find out reason why w2k doesn't boot?
Quoted 2 lines
Tested-by Ladi Prosek <[email protected]>
Quoted 17 lines · Igor Mammedov
Quoted 14 lines · On Fri, 21 Jul 2017 11:54:20 +0200 Ladi Prosek <[email protected]> wrote:
Quoted 13 lines · Igor Mammedov
w2k used to boot on QEMU until we bumped revision of FADT to rev3
(commit77af8a2bhw/i386: Use Rev3 FADT (ACPI 2.0) instead of Rev1 to improve guest OS support.)Considering that w2k is ancient and long time EOLed, leave default rev3 but make pc-i440fx-2.9 and older machine types to force rev1 so old setups won't break (w2k could boot).
Signed-off-by Igor Mammedov <[email protected]>---
CC: Programmingkid <[email protected]>
CC: Phil Dennis-Jordan <[email protected]>
CC: "Michael S. Tsirkin" <[email protected]>
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Only compile test since I don't have w2k to test with
Confirming that Windows 2000 boots with this patch and -machine pc-i440fx-2.9.
Ladi,
Could you to try find out reason why w2k doesn't boot?
The FADT table must be 134 bytes or less. The revision number does not matter and neither does the checksum.
This is experimental data, I haven't been able to find the offending code.
Quoted 3 lines
Quoted 2 lines
Tested-by Ladi Prosek <[email protected]>
Quoted 132 lines · Igor Mammedov
w2k used to boot on QEMU until we bumped revision of FADT to rev3
(commit77af8a2bhw/i386: Use Rev3 FADT (ACPI 2.0) instead of Rev1 to improve guest OS support.)Considering that w2k is ancient and long time EOLed, leave default rev3 but make pc-i440fx-2.9 and older machine types to force rev1 so old setups won't break (w2k could boot).
Signed-off-by Igor Mammedov <[email protected]>---
CC: Programmingkid <[email protected]>
CC: Phil Dennis-Jordan <[email protected]>
CC: "Michael S. Tsirkin" <[email protected]>Only compile test since I don't have w2k to test with
---
include/hw/i386/pc.h | 1 + hw/i386/acpi-build.c | 26 +++++++++++++++++++------- hw/i386/pc_piix.c | 2 ++ 3 files changed, 22 insertions(+), 7 deletions(-)include/hw/i386/pc.h +1
-0@@ -122,6 +122,7 @@ struct PCMachineClass {bool rsdp_in_ram;int legacy_acpi_table_size;unsigned acpi_data_size; +bool force_rev1_fadt;/* SMBIOS compat: */ bool smbios_defaults;hw/i386/acpi-build.c +4
-1@@ -272,7 +272,7 @@ build_facs(GArray *table_data, BIOSLinker *linker) }/* Load chipset information in FADT */ -static void fadt_setup (AcpiFadtDescriptorRev3 *fadt,AcpiPmInfo *pm) +static void fadt_setup (AcpiFadtDescriptorRev3 *fadt,AcpiPmInfo *pm,bool rev1) { fadt->model =1 ; fadt->reserved1 =0 ;@@ -304,6 +304,9 @@ static void fadt_setup(AcpiFadtDescriptorRev3 *fadt, AcpiPmInfo *pm) fadt->flags |=cpu_to_le32 (1 <<ACPI_FADT_F_FORCE_APIC_CLUSTER_MODEL ); } fadt->century =RTC_CENTURY ; +if (rev1) { +return ; + } fadt->flags |=cpu_to_le32 (1 <<ACPI_FADT_F_RESET_REG_SUP ); fadt->reset_value =0xf ;@@ -335,6 +338,7 @@ static void fadt_setup(AcpiFadtDescriptorRev3 *fadt, AcpiPmInfo *pm)/* FADT */ static void
build_fadt(GArray*table_data, BIOSLinker *linker, AcpiPmInfo *pm,
+ MachineState *machine,
unsignedfacs_tbl_offset, unsigneddsdt_tbl_offset, const char*oem_id, const char*oem_table_id)
{hw/i386/acpi-build.c +14
-6@@ -342,6 +346,9 @@ build_fadt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm,unsigned fw_ctrl_offset = (char *)&fadt->firmware_ctrl - table_data->data;unsigned dsdt_entry_offset = (char *)&fadt->dsdt - table_data->data;unsigned xdsdt_entry_offset = (char *)&fadt->x_dsdt - table_data->data; +PCMachineClass *pcmc =PC_MACHINE_GET_CLASS (machine); +int fadt_size =sizeof (*fadt); +int rev =3 ;/* FACS address to be filled by Guest linker */ bios_linker_loader_add_pointer(linker,@@ -349,16 +356,21 @@ build_fadt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm, ACPI_BUILD_TABLE_FILE, facs_tbl_offset);/* DSDT address to be filled by Guest linker */ -fadt_setup (fadt, pm); +fadt_setup (fadt, pm, pcmc->force_rev1_fadt);bios_linker_loader_add_pointer (linker,ACPI_BUILD_TABLE_FILE , dsdt_entry_offset,sizeof (fadt->dsdt),ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); -bios_linker_loader_add_pointer (linker, -ACPI_BUILD_TABLE_FILE , xdsdt_entry_offset,sizeof (fadt->x_dsdt), -ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); +if (pcmc->force_rev1_fadt) { + rev =1 ; + fadt_size = offsetof(typeof(*fadt), reset_register); + }else { +bios_linker_loader_add_pointer (linker, +ACPI_BUILD_TABLE_FILE , xdsdt_entry_offset,sizeof (fadt->x_dsdt), +ACPI_BUILD_TABLE_FILE , dsdt_tbl_offset); + }build_header (linker, table_data, - (void *)fadt,"FACP" ,sizeof (*fadt),3 , oem_id, oem_table_id); + (void *)fadt,"FACP" , fadt_size, rev, oem_id, oem_table_id); } void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid,@@ -2667,7 +2679,7 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)/* ACPI tables pointed to by RSDT */ fadt = tables_blob->len;acpi_add_table (table_offsets, tables_blob); -build_fadt (tables_blob, tables->linker, &pm, facs, dsdt, +build_fadt (tables_blob, tables->linker, &pm, machine, facs, dsdt, slic_oem.id, slic_oem.table_id); aml_len += tables_blob->len - fadt;hw/i386/pc_piix.c +2
-0@@ -449,9 +449,11 @@ DEFINE_I440FX_MACHINE(v2_10, "pc-i440fx-2.10", NULL,static void pc_i440fx_2_9_machine_options (MachineClass *m) { +PCMachineClass *pcmc =PC_MACHINE_CLASS (m);pc_i440fx_2_10_machine_options (m); m->is_default =0 ; m->alias =NULL ; + pcmc->force_rev1_fadt = true;SET_MACHINE_COMPAT (m,PC_COMPAT_2_9 ); }Signature · 1 line
2.7.4
Windows 2000 boots for me when I use the “-machine pc-i440fx-2.9” option. Windows XP boots as well with the option.
I do have one suggestion. When the user runs "qemu-system-i386 -machine ?”, do you think we could add a note about how APCI 1.0 is used.
pc-i440fx-2.9 Standard PC (i440FX + PIIX + APCI 1.0, 1996).
pc-i440fx-2.10 Standard PC (i440FX + PIIX + APCI 2.0, 1996) (default)
This series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally.
Hi,
This series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally.
Type: series
Subject: [Qemu-devel] [PATCH] pc: acpi: force FADT rev1 for old i440fx machine types
Message-id: [email protected]
=== TEST SCRIPT BEGIN ===
#!/bin/bash
set -e
git submodule update --init dtc
# Let docker tests dump environment info
export SHOW_ENV=1
export J=8
time make docker-test-quick@centos6
time make docker-test-build@min-glib
time make docker-test-mingw@fedora
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384 Switched to a new branch 'test'
830d892 pc: acpi: force FADT rev1 for old i440fx machine types
=== OUTPUT BEGIN ===
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Cloning into '/var/tmp/patchew-tester-tmp-urbtfyxl/src/dtc'...
Submodule path 'dtc': checked out '558cd81bdd432769b59bff01240c44f82cfb1a9d'
BUILD centos6
make[1]: Entering directory '/var/tmp/patchew-tester-tmp-urbtfyxl/src'
ARCHIVE qemu.tgz
ARCHIVE dtc.tgz
COPY RUNNER
RUN test-quick in qemu:centos6/usr/bin/docker-current: Error response from daemon: containerd: container did not start before the specified timeout. Traceback (most recent call last):
File "./tests/docker/docker.py", line 382, in <module>
sys.exit(main())
File "./tests/docker/docker.py", line 379, in main
return args.cmdobj.run(args, argv)
File "./tests/docker/docker.py", line 237, in run
return Docker().run(argv, args.keep, quiet=args.quiet)
File "./tests/docker/docker.py", line 205, in run
quiet=quiet)
File "./tests/docker/docker.py", line 123, in _do_check
return subprocess.check_call(self._command + cmd, **kwargs)
File "/usr/lib64/python2.7/subprocess.py", line 186, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['docker', 'run', '--label', 'com.qemu.instance.uuid=3e6ab9b272cb11e7b1d2525400c803e1', '-u', '0', '-t', '--rm', '--net=none', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=8', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/var/tmp/patchew-tester-tmp-urbtfyxl/src/docker-src.2017-07-27-08.58.07.2271:/var/tmp/qemu:z,ro', '-v', '/root/.cache/qemu-docker-ccache:/var/tmp/ccache:z', 'qemu:centos6', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 125 tests/docker/Makefile.include:136: recipe for target 'docker-run' failed
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory '/var/tmp/patchew-tester-tmp-urbtfyxl/src'
tests/docker/Makefile.include:168: recipe for target 'docker-run-test-quick@centos6' failed
make: *** [docker-run-test-quick@centos6] Error 2
=== OUTPUT END ===
Test command exited with code: 2
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]