Re: [RFC QEMU PATCH v9 2/2] virtio-pci: implement No_Soft_Reset bit

2024-04-16 Thread Igor Mammedov
On Tue, 16 Apr 2024 15:01:27 +0800 Jiqian Chen wrote: > In current code, when guest does S3, virtio-gpu are reset due to the > bit No_Soft_Reset is not set. After resetting, the display resources > of virtio-gpu are destroyed, then the display can't come back and only > show blank after

[PATCH] kvm: error out of kvm_irqchip_add_msi_route() in case of full route table

2024-04-08 Thread Igor Mammedov
re -accel kvm is set. virtio_bus_start_ioeventfd: failed. Fallback to userspace (slower). Signed-off-by: Igor Mammedov --- accel/kvm/kvm-all.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index d4d57da265..10fae1db05 100644 --- a

Re: [PATCH v2] hw/i386/acpi: Set PCAT_COMPAT bit only when pic is not disabled

2024-04-03 Thread Igor Mammedov
On Wed, 3 Apr 2024 10:59:53 -0400 Xiaoyao Li wrote: > A value 1 of PCAT_COMPAT (bit 0) of MADT.Flags indicates that the system > also has a PC-AT-compatible dual-8259 setup, i.e., the PIC. > > When PIC is not enabled (pic=off) for x86 machine, the PCAT_COMPAT bit > needs to be cleared.

Re: [PATCH for-9.0] docs/about: Mark the iaspc machine type as deprecated

2024-03-27 Thread Igor Mammedov
On Wed, 27 Mar 2024 10:49:43 + Daniel P. Berrangé wrote: > On Tue, Mar 26, 2024 at 05:16:32PM +0100, Igor Mammedov wrote: > > On Tue, 26 Mar 2024 14:29:58 +0100 > > Philippe Mathieu-Daudé wrote: > > > > > Hi Igor, > > > > > > On 26/3/2

Re: [PATCH-for-9.1] hw/i386: Add a config to only build the microvm machine

2024-03-26 Thread Igor Mammedov
On Tue, 26 Mar 2024 19:01:50 +0300 Michael Tokarev wrote: > 26.03.2024 18:58, Philippe Mathieu-Daudé: > > >> This is not enough.  This step is good already, but it lacks default > >> machine > >> type selection.  In debian we carry a tiny patch to make microvm the > >> default > >> machine

Re: [PATCH for-9.0] docs/about: Mark the iaspc machine type as deprecated

2024-03-26 Thread Igor Mammedov
On Tue, 26 Mar 2024 13:30:48 + Mark Cave-Ayland wrote: > On 26/03/2024 12:51, Igor Mammedov wrote: > > > ISAPC machine was introduced 25 years ago and it's a lot of time since > > such machine was around with real ISA only PC hardware practically defunct. > > A

Re: [PATCH for-9.0] docs/about: Mark the iaspc machine type as deprecated

2024-03-26 Thread Igor Mammedov
On Tue, 26 Mar 2024 14:29:58 +0100 Philippe Mathieu-Daudé wrote: > Hi Igor, > > On 26/3/24 14:08, Thomas Huth wrote: > > > > s/iaspc/isapc/ in the subject > > > > On 26/03/2024 13.51, Igor Mammedov wrote: > >> ISAPC machine was introduced

[PATCH for-9.0] docs/about: Mark the iaspc machine type as deprecated

2024-03-26 Thread Igor Mammedov
) Rather than spending time on fixing 'the oldest' no longer tested machine type, deprecate it so we can clean up QEMU code from legacy fixups and hopefully make it easier to follow. Folks who have to use ancient guest that requires ISAPC can still use older QEMU to play with it. Signed-off-by: Igor

Re: [PATCH trivial for-9.0] hw/i386/fw_cfg.c: fix non-legacy smbios build

2024-03-26 Thread Igor Mammedov
On Mon, 25 Mar 2024 21:01:42 +0300 Michael Tokarev wrote: > 25.03.2024 18:20, Igor Mammedov wrote > > On Mon, 25 Mar 2024 16:09:20 +0300 > > Michael Tokarev wrote: > > > >> When building qemu with smbios but not legacy mode (eg minimal microvm

[PATCH trivial for-9.0] smbios: add stub for smbios_get_table_legacy()

2024-03-26 Thread Igor Mammedov
el Tokarev Singned-off-by: Philippe Mathieu-Daudé Signed-off-by: Igor Mammedov --- Compile tested only. While it's fixing bug for off-tree usecase with non-upstream config, it's trivial enough to go into 9.0 if time frame allows. Benefit of it going into 9.0 is that folks who play with minimal builds

Re: [PATCH trivial for-9.0] hw/i386/fw_cfg.c: fix non-legacy smbios build

2024-03-25 Thread Igor Mammedov
On Mon, 25 Mar 2024 14:40:21 +0100 Philippe Mathieu-Daudé wrote: > Hi Michael, > > On 25/3/24 14:09, Michael Tokarev wrote: > > When building qemu with smbios but not legacy mode (eg minimal microvm > > build), > > link fails with: > > > >hw/i386/fw_cfg.c:74: undefined reference to

Re: [PATCH trivial for-9.0] hw/i386/fw_cfg.c: fix non-legacy smbios build

2024-03-25 Thread Igor Mammedov
On Mon, 25 Mar 2024 16:09:20 +0300 Michael Tokarev wrote: > When building qemu with smbios but not legacy mode (eg minimal microvm build), > link fails with: > > hw/i386/fw_cfg.c:74: undefined reference to `smbios_get_table_legacy' > > This is because fw_cfg interface can call this function

Re: [PATCH trivial for-9.0] hw/i386/fw_cfg.c: fix non-legacy smbios build

2024-03-25 Thread Igor Mammedov
On Mon, 25 Mar 2024 16:09:20 +0300 Michael Tokarev wrote: > When building qemu with smbios but not legacy mode (eg minimal microvm build), > link fails with: > > hw/i386/fw_cfg.c:74: undefined reference to `smbios_get_table_legacy' > > This is because fw_cfg interface can call this function

[PATCH v4 19/21] pc/q35: set SMBIOS entry point type to 'auto' by default

2024-03-14 Thread Igor Mammedov
of smbios-entry-point-type after series for pc/q35 machines: * 9.0-newer: 'auto' * 8.1-8.2: '64' * 8.0-older: '32' Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2008 Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- hw/i386/pc.c | 2 +- hw/i386

[PATCH v4 03/21] tests: smbios: add test for legacy mode CLI options

2024-03-14 Thread Igor Mammedov
Unfortunately having 2.0 machine type deprecated is not enough to get rid of legacy SMBIOS handling since 'isapc' also uses that and it's staying around. Hence add test for CLI options handling to be sure that it ain't broken during SMBIOS code refactoring. Signed-off-by: Igor Mammedov Reviewed

[PATCH v4 17/21] smbios: error out when building type 4 table is not possible

2024-03-14 Thread Igor Mammedov
-type='auto' Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- hw/smbios/smbios.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index d9dda226e6..be64919def 100644 --- a/hw/smbios/smbios.c

[PATCH v4 04/21] smbios: cleanup smbios_get_tables() from legacy handling

2024-03-14 Thread Igor Mammedov
it. Drop legacy related check in smbios_get_tables() and return from fw_cfg_build_smbios() early if legacy tables where built without proceeding to non legacy part of the function. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- hw/i386/fw_cfg.c | 1 + hw/smbios

[PATCH v4 01/21] tests: smbios: make it possible to write SMBIOS only test

2024-03-14 Thread Igor Mammedov
tions" test case. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- tests/qtest/bios-tables-test.c | 47 +++--- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-te

[PATCH v4 10/21] smbios: rename/expose structures/bitmaps used by both legacy and modern code

2024-03-14 Thread Igor Mammedov
will move legacy code into a separate file. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha --- include/hw/firmware/smbios.h | 16 + hw/smbios/smbios.c | 113 --- 2 files changed, 69 insertions(+), 60 deletions(-) diff --git a/include/hw

[PATCH v4 08/21] smbios: don't check type4 structures in legacy mode

2024-03-14 Thread Igor Mammedov
to add support for type4 to legacy code (both QEMU and SeaBIOS), simplify smbios_get_table_legacy() by dropping not relevant check in legacy code and error out on type4 blob. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- * The issue affects 'isapc' and pc-i440fx

[PATCH v4 06/21] smbios: get rid of smbios_legacy global

2024-03-14 Thread Igor Mammedov
clean up smbios_set_defaults() which is reused by legacy and non legacy machines from being aware of 'legacy' notion and need to turn it off. And push legacy handling up to PC machine code where it's relevant. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Acked-by: Daniel Henrique Barboza

[PATCH v4 20/21] tests: acpi: update expected SSDT.dimmpxm blob

2024-03-14 Thread Igor Mammedov
address shift is caused by switch to 32-bit SMBIOS entry point which has slightly different size from 64-bit one and happens to trigger a bit different memory layout. Expected diff: -Name (MEMA, 0x07FFE000) +Name (MEMA, 0x07FFF000) Signed-off-by: Igor Mammedov Acked-by: Ani Sinha

[PATCH v4 21/21] smbios: add extra comments to smbios_get_table_legacy()

2024-03-14 Thread Igor Mammedov
Signed-off-by: Igor Mammedov --- hw/smbios/smbios_legacy.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/smbios/smbios_legacy.c b/hw/smbios/smbios_legacy.c index 06907cd16c..c37a8ee821 100644 --- a/hw/smbios/smbios_legacy.c +++ b/hw/smbios/smbios_legacy.c @@ -151,6 +151,9

[PATCH v4 12/21] smbios: handle errors consistently

2024-03-14 Thread Igor Mammedov
smbios_tables pointer after freeing. that will avoid double free if smbios_get_tables() is called multiple times. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha --- include/hw/firmware/smbios.h | 4 ++-- hw/i386/fw_cfg.c | 3 ++- hw/smbios/smbios.c | 34

[PATCH v4 16/21] smbios: in case of entry point is 'auto' try to build v2 tables 1st

2024-03-14 Thread Igor Mammedov
that is not to possible to describe with SMBIOS 2.0 will switch automatically to SMBIOS 3.0 (which will trigger Windows bug but there is nothing QEMU can do here, so go and aks Microsoft to real fix). Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- hw/smbios/smbios.c

[PATCH v4 05/21] smbios: get rid of smbios_smp_sockets global

2024-03-14 Thread Igor Mammedov
it makes smbios_validate_table() independent from smbios_smp_sockets global, which in turn lets smbios_get_tables() avoid using not related legacy code. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- goal here is to isolate legacy handling from generic

[PATCH v4 18/21] tests: acpi/smbios: whitelist expected blobs

2024-03-14 Thread Igor Mammedov
Signed-off-by: Igor Mammedov Acked-by: Ani Sinha --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..81148a604f 100644 --- a/tests/qtest

[PATCH v4 14/21] smbios: clear smbios_type4_count before building tables

2024-03-14 Thread Igor Mammedov
it will help to keep type 4 tables accounting correct in case SMBIOS tables are built multiple times. Signed-off-by: Igor Mammedov Tested-by: Fiona Ebner --- hw/smbios/smbios.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index 7fefe98c85

[PATCH v4 15/21] smbios: extend smbios-entry-point-type with 'auto' value

2024-03-14 Thread Igor Mammedov
later patches will use it to pick SMBIOS version at runtime depending on configuration. Signed-off-by: Igor Mammedov Acked-by: Markus Armbruster Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- v3: - make sure i2nd line of comment is indented on 4 spaces only --- qapi/machine.json | 5

[PATCH v4 02/21] tests: smbios: add test for -smbios type=11 option

2024-03-14 Thread Igor Mammedov
Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- tests/data/smbios/type11_blob | Bin 0 -> 11 bytes tests/qtest/bios-tables-test.c | 17 + 2 files changed, 17 insertions(+) create mode 100644 tests/data/smbios/type11_blob diff --git a/te

[PATCH v4 09/21] smbios: add smbios_add_usr_blob_size() helper

2024-03-14 Thread Igor Mammedov
it will be used by follow up patch when legacy handling is moved out into a separate file. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha --- hw/smbios/smbios.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c

[PATCH v4 11/21] smbios: build legacy mode code only for 'pc' machine

2024-03-14 Thread Igor Mammedov
size; +(*(uint16_t *)smbios_entries) = +cpu_to_le16(le16_to_cpu(*(uint16_t *)smbios_entries) + 1); +usr_offset += size; +} + +smbios_build_type_0_fields(); +smbios_build_type_1_fields(); +smbios_validate_table(); +*length = smbios_entries_len; +r

[PATCH v4 13/21] smbios: get rid of global smbios_ep_type

2024-03-14 Thread Igor Mammedov
Signed-off-by: Igor Mammedov Acked-by: Daniel Henrique Barboza Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- hw/i386/fw_cfg.h | 3 ++- include/hw/firmware/smbios.h | 5 +++-- hw/arm/virt.c| 4 ++-- hw/i386/fw_cfg.c | 8 hw/i386/pc.c

[PATCH v4 00/21] Workaround Windows failing to find 64bit SMBIOS entry point with SeaBIOS

2024-03-14 Thread Igor Mammedov
/2008 Igor Mammedov (21): tests: smbios: make it possible to write SMBIOS only test tests: smbios: add test for -smbios type=11 option tests: smbios: add test for legacy mode CLI options smbios: cleanup smbios_get_tables() from legacy handling smbios: get rid of smbios_smp_sockets global

[PATCH v4 07/21] smbios: avoid mangling user provided tables

2024-03-14 Thread Igor Mammedov
of this and previous commits there is no need to generate legacy smbios_entries at the time options are parsed. Instead compose smbios_entries on demand from usr_blobs like it is done for non-legacy SMBIOS tables. Signed-off-by: Igor Mammedov Tested-by: Fiona Ebner Reviewed-by: Ani Sinha --- v4: fix

Re: [PATCH v3 00/20] Workaround Windows failing to find 64bit SMBIOS entry point with SeaBIOS

2024-03-13 Thread Igor Mammedov
On Tue, 12 Mar 2024 13:31:39 -0400 "Michael S. Tsirkin" wrote: > On Tue, Mar 12, 2024 at 05:10:30PM +0100, Igor Mammedov wrote: > > Changelog: > > v3: > >* whitespace missed by checkpatch > >* fix idndent in QAPI > >* reorder 17/20 before 1

[PATCH v3 06/20] smbios: get rid of smbios_legacy global

2024-03-12 Thread Igor Mammedov
clean up smbios_set_defaults() which is reused by legacy and non legacy machines from being aware of 'legacy' notion and need to turn it off. And push legacy handling up to PC machine code where it's relevant. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Acked-by: Daniel Henrique Barboza

[PATCH v3 15/20] smbios: extend smbios-entry-point-type with 'auto' value

2024-03-12 Thread Igor Mammedov
later patches will use it to pick SMBIOS version at runtime depending on configuration. Signed-off-by: Igor Mammedov Acked-by: Markus Armbruster Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- v3: - make sure i2nd line of comment is indented on 4 spaces only --- qapi/machine.json | 5

[PATCH v3 18/20] tests: acpi/smbios: whitelist expected blobs

2024-03-12 Thread Igor Mammedov
Signed-off-by: Igor Mammedov Acked-by: Ani Sinha --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..81148a604f 100644 --- a/tests/qtest

[PATCH v3 12/20] smbios: handle errors consistently

2024-03-12 Thread Igor Mammedov
smbios_tables pointer after freeing. that will avoid double free if smbios_get_tables() is called multiple times. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha --- include/hw/firmware/smbios.h | 4 ++-- hw/i386/fw_cfg.c | 3 ++- hw/smbios/smbios.c | 34

[PATCH v3 09/20] smbios: add smbios_add_usr_blob_size() helper

2024-03-12 Thread Igor Mammedov
it will be used by follow up patch when legacy handling is moved out into a separate file. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha --- hw/smbios/smbios.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c

[PATCH v3 11/20] smbios: build legacy mode code only for 'pc' machine

2024-03-12 Thread Igor Mammedov
size; +(*(uint16_t *)smbios_entries) = +cpu_to_le16(le16_to_cpu(*(uint16_t *)smbios_entries) + 1); +usr_offset += size; +} + +smbios_build_type_0_fields(); +smbios_build_type_1_fields(); +smbios_validate_table(); +*length = smbios_entries_len; +r

[PATCH v3 19/20] pc/q35: set SMBIOS entry point type to 'auto' by default

2024-03-12 Thread Igor Mammedov
of smbios-entry-point-type after series for pc/q35 machines: * 9.0-newer: 'auto' * 8.1-8.2: '64' * 8.0-older: '32' Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2008 Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- hw/i386/pc.c | 2 +- hw/i386

[PATCH v3 01/20] tests: smbios: make it possible to write SMBIOS only test

2024-03-12 Thread Igor Mammedov
tions" test case. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- tests/qtest/bios-tables-test.c | 47 +++--- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-te

[PATCH v3 20/20] tests: acpi: update expected SSDT.dimmpxm blob

2024-03-12 Thread Igor Mammedov
address shift is caused by switch to 32-bit SMBIOS entry point which has slightly different size from 64-bit one and happens to trigger a bit different memory layout. Expected diff: -Name (MEMA, 0x07FFE000) +Name (MEMA, 0x07FFF000) Signed-off-by: Igor Mammedov Acked-by: Ani Sinha

[PATCH v3 04/20] smbios: cleanup smbios_get_tables() from legacy handling

2024-03-12 Thread Igor Mammedov
it. Drop legacy related check in smbios_get_tables() and return from fw_cfg_build_smbios() early if legacy tables where built without proceeding to non legacy part of the function. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- hw/i386/fw_cfg.c | 1 + hw/smbios

[PATCH v3 05/20] smbios: get rid of smbios_smp_sockets global

2024-03-12 Thread Igor Mammedov
it makes smbios_validate_table() independent from smbios_smp_sockets global, which in turn lets smbios_get_tables() avoid using not related legacy code. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- goal here is to isolate legacy handling from generic

[PATCH v3 08/20] smbios: don't check type4 structures in legacy mode

2024-03-12 Thread Igor Mammedov
to add support for type4 to legacy code (both QEMU and SeaBIOS), simplify smbios_get_table_legacy() by dropping not relevant check in legacy code and error out on type4 blob. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- * The issue affects 'isapc' and pc-i440fx

[PATCH v3 10/20] smbios: rename/expose structures/bitmaps used by both legacy and modern code

2024-03-12 Thread Igor Mammedov
will move legacy code into a separate file. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha --- include/hw/firmware/smbios.h | 16 + hw/smbios/smbios.c | 113 --- 2 files changed, 69 insertions(+), 60 deletions(-) diff --git a/include/hw

[PATCH v3 17/20] smbios: error out when building type 4 table is not possible

2024-03-12 Thread Igor Mammedov
-type='auto' Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- hw/smbios/smbios.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index c4a953bbc9..b64d3bc227 100644 --- a/hw/smbios/smbios.c

[PATCH v3 14/20] smbios: clear smbios_type4_count before building tables

2024-03-12 Thread Igor Mammedov
it will help to keep type 4 tables accounting correct in case SMBIOS tables are built multiple times. Signed-off-by: Igor Mammedov Tested-by: Fiona Ebner --- hw/smbios/smbios.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index 5a791fd9eb

[PATCH v3 13/20] smbios: get rid of global smbios_ep_type

2024-03-12 Thread Igor Mammedov
Signed-off-by: Igor Mammedov Acked-by: Daniel Henrique Barboza Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- hw/i386/fw_cfg.h | 3 ++- include/hw/firmware/smbios.h | 5 +++-- hw/arm/virt.c| 4 ++-- hw/i386/fw_cfg.c | 8 hw/i386/pc.c

[PATCH v3 16/20] smbios: in case of entry point is 'auto' try to build v2 tables 1st

2024-03-12 Thread Igor Mammedov
that is not to possible to describe with SMBIOS 2.0 will switch automatically to SMBIOS 3.0 (which will trigger Windows bug but there is nothing QEMU can do here, so go and aks Microsoft to real fix). Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- hw/smbios/smbios.c

[PATCH v3 00/20] Workaround Windows failing to find 64bit SMBIOS entry point with SeaBIOS

2024-03-12 Thread Igor Mammedov
/2008 CC: imamm...@redhat.com CC: m...@redhat.com Igor Mammedov (20): tests: smbios: make it possible to write SMBIOS only test tests: smbios: add test for -smbios type=11 option tests: smbios: add test

[PATCH v3 07/20] smbios: avoid mangling user provided tables

2024-03-12 Thread Igor Mammedov
of this and previous commits there is no need to generate legacy smbios_entries at the time options are parsed. Instead compose smbios_entries on demand from usr_blobs like it is done for non-legacy SMBIOS tables. Signed-off-by: Igor Mammedov Tested-by: Fiona Ebner Reviewed-by: Ani Sinha --- hw/smbios/smbios.c

[PATCH v3 02/20] tests: smbios: add test for -smbios type=11 option

2024-03-12 Thread Igor Mammedov
Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- tests/data/smbios/type11_blob | Bin 0 -> 11 bytes tests/qtest/bios-tables-test.c | 17 + 2 files changed, 17 insertions(+) create mode 100644 tests/data/smbios/type11_blob diff --git a/te

[PATCH v3 03/20] tests: smbios: add test for legacy mode CLI options

2024-03-12 Thread Igor Mammedov
Unfortunately having 2.0 machine type deprecated is not enough to get rid of legacy SMBIOS handling since 'isapc' also uses that and it's staying around. Hence add test for CLI options handling to be sure that it ain't broken during SMBIOS code refactoring. Signed-off-by: Igor Mammedov Reviewed

Re: [PATCH v2 07/20] smbios: avoid mangling user provided tables

2024-03-08 Thread Igor Mammedov
On Thu, 7 Mar 2024 09:33:17 +0530 Ani Sinha wrote: > > On 06-Mar-2024, at 12:11, Ani Sinha wrote: > > > > > > > > On Tue, 5 Mar 2024, Igor Mammedov wrote: > > > >> currently smbios_entry_add() preserves internally '-smbios type=' > &

Re: [PATCH] target/i386: Add new CPU model SierraForest

2024-03-08 Thread Igor Mammedov
On Wed, 6 Dec 2023 21:19:23 +0800 Tao Su wrote: > SierraForest is Intel's first generation E-core based Xeon server > processor, which will be released in the first half of 2024. > > SierraForest mainly adds the following new features based on > GraniteRapids: > *) Please specify

[PATCH v3 14/20] smbios: extend smbios-entry-point-type with 'auto' value

2024-03-08 Thread Igor Mammedov
later patches will use it to pick SMBIOS version at runtime depending on configuration. Signed-off-by: Igor Mammedov Acked-by: Markus Armbruster Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- v3: - make sure i2nd line of comment is indented on 4 spaces only --- qapi/machine.json | 5

Re: [PATCH v2 11/20] smbios: build legacy mode code only for 'pc' machine

2024-03-06 Thread Igor Mammedov
On Wed, 6 Mar 2024 12:57:47 +0530 Ani Sinha wrote: > > On 05-Mar-2024, at 21:27, Igor Mammedov wrote: > > > > basically moving code around without functional change. > > And exposing some symbols so that they could be shared > > between smbbios.c and new smbi

[PATCH v3 11/20] smbios: build legacy mode code only for 'pc' machine

2024-03-06 Thread Igor Mammedov
size; +(*(uint16_t *)smbios_entries) = +cpu_to_le16(le16_to_cpu(*(uint16_t *)smbios_entries) + 1); +usr_offset += size; +} + +smbios_build_type_0_fields(); +smbios_build_type_1_fields(); +smbios_validate_table(); +*length = smbios_entries_len; +r

Re: [PATCH v2 20/20] tests: acpi: update expected SSDT.dimmpxm blob

2024-03-06 Thread Igor Mammedov
On Wed, 6 Mar 2024 14:50:20 +0530 Ani Sinha wrote: > > On 05-Mar-2024, at 21:27, Igor Mammedov wrote: > > > > address shift is caused by switch to 32-bit SMBIOS entry point > > which has slightly different size from 64-bit one and happens > > to trigger

Re: [PATCH v2 17/20] smbios: clear smbios_type4_count before building tables

2024-03-06 Thread Igor Mammedov
On Wed, 6 Mar 2024 13:17:39 +0530 Ani Sinha wrote: > > On 05-Mar-2024, at 21:27, Igor Mammedov wrote: > > > > it will help to keep type 4 tables accounting correct in case > > SMBIOS tables are built multiple times. > > > I suggest you arrange this befor

[PATCH v2 04/20] smbios: cleanup smbios_get_tables() from legacy handling

2024-03-05 Thread Igor Mammedov
it. Drop legacy related check in smbios_get_tables() and return from fw_cfg_build_smbios() early if legacy tables where built without proceeding to non legacy part of the function. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- hw/i386/fw_cfg.c | 1 + hw/smbios

[PATCH v2 12/20] smbios: handle errors consistently

2024-03-05 Thread Igor Mammedov
smbios_tables pointer after freeing. that will avoid double free if smbios_get_tables() is called multiple times. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha --- include/hw/firmware/smbios.h | 4 ++-- hw/i386/fw_cfg.c | 3 ++- hw/smbios/smbios.c | 34

[PATCH v2 16/20] smbios: error out when building type 4 table is not possible

2024-03-05 Thread Igor Mammedov
-type='auto' Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- hw/smbios/smbios.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index e54a9f21e6..bf5c7a8885 100644 --- a/hw/smbios/smbios.c

[PATCH v2 15/20] smbios: in case of entry point is 'auto' try to build v2 tables 1st

2024-03-05 Thread Igor Mammedov
that is not to possible to describe with SMBIOS 2.0 will switch automatically to SMBIOS 3.0 (which will trigger Windows bug but there is nothing QEMU can do here, so go and aks Microsoft to real fix). Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- hw/smbios/smbios.c

[PATCH v2 19/20] pc/q35: set SMBIOS entry point type to 'auto' by default

2024-03-05 Thread Igor Mammedov
of smbios-entry-point-type after series for pc/q35 machines: * 9.0-newer: 'auto' * 8.1-8.2: '64' * 8.0-older: '32' Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2008 Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- hw/i386/pc.c | 2 +- hw/i386

[PATCH v2 17/20] smbios: clear smbios_type4_count before building tables

2024-03-05 Thread Igor Mammedov
it will help to keep type 4 tables accounting correct in case SMBIOS tables are built multiple times. Signed-off-by: Igor Mammedov Tested-by: Fiona Ebner --- hw/smbios/smbios.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index bf5c7a8885

[PATCH v2 10/20] smbios: rename/expose structures/bitmaps used by both legacy and modern code

2024-03-05 Thread Igor Mammedov
will move legacy code into a separate file. Signed-off-by: Igor Mammedov --- include/hw/firmware/smbios.h | 16 + hw/smbios/smbios.c | 113 --- 2 files changed, 69 insertions(+), 60 deletions(-) diff --git a/include/hw/firmware/smbios.h b/include

[PATCH v2 14/20] smbios: extend smbios-entry-point-type with 'auto' value

2024-03-05 Thread Igor Mammedov
later patches will use it to pick SMBIOS version at runtime depending on configuration. Signed-off-by: Igor Mammedov Acked-by: Markus Armbruster Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- qapi/machine.json | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qapi

[PATCH v2 02/20] tests: smbios: add test for -smbios type=11 option

2024-03-05 Thread Igor Mammedov
Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- tests/data/smbios/type11_blob | Bin 0 -> 11 bytes tests/qtest/bios-tables-test.c | 17 + 2 files changed, 17 insertions(+) create mode 100644 tests/data/smbios/type11_blob diff --git a/te

[PATCH v2 05/20] smbios: get rid of smbios_smp_sockets global

2024-03-05 Thread Igor Mammedov
it makes smbios_validate_table() independent from smbios_smp_sockets global, which in turn lets smbios_get_tables() avoid using not related legacy code. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- goal here is to isolate legacy handling from generic

[PATCH v2 13/20] smbios: get rid of global smbios_ep_type

2024-03-05 Thread Igor Mammedov
Signed-off-by: Igor Mammedov Acked-by: Daniel Henrique Barboza Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- hw/i386/fw_cfg.h | 3 ++- include/hw/firmware/smbios.h | 5 +++-- hw/arm/virt.c| 4 ++-- hw/i386/fw_cfg.c | 8 hw/i386/pc.c

[PATCH v2 20/20] tests: acpi: update expected SSDT.dimmpxm blob

2024-03-05 Thread Igor Mammedov
address shift is caused by switch to 32-bit SMBIOS entry point which has slightly different size from 64-bit one and happens to trigger a bit different memory layout. Expected diff: -Name (MEMA, 0x07FFE000) +Name (MEMA, 0x07FFF000) Signed-off-by: Igor Mammedov --- tests/qtest/bios

[PATCH v2 18/20] tests: acpi/smbios: whitelist expected blobs

2024-03-05 Thread Igor Mammedov
Signed-off-by: Igor Mammedov --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..81148a604f 100644 --- a/tests/qtest/bios-tables-test

[PATCH v2 11/20] smbios: build legacy mode code only for 'pc' machine

2024-03-05 Thread Igor Mammedov
6_to_cpu(*(uint16_t *)smbios_entries) + 1); +usr_offset += size; +} + +smbios_build_type_0_fields(); +smbios_build_type_1_fields(); +smbios_validate_table(); +*length = smbios_entries_len; +return smbios_entries; +} diff --git a/hw/smbios/smbios_legacy_stub.c b/hw/smbios/smbios_leg

[PATCH v2 00/20] Workaround Windows failing to find 64bit SMBIOS entry point with SeaBIOS

2024-03-05 Thread Igor Mammedov
CC: qemu-...@nongnu.org CC: qemu-ri...@nongnu.org CC: f.eb...@proxmox.com Igor Mammedov (20): tests

[PATCH v2 06/20] smbios: get rid of smbios_legacy global

2024-03-05 Thread Igor Mammedov
clean up smbios_set_defaults() which is reused by legacy and non legacy machines from being aware of 'legacy' notion and need to turn it off. And push legacy handling up to PC machine code where it's relevant. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Acked-by: Daniel Henrique Barboza

[PATCH v2 09/20] smbios: add smbios_add_usr_blob_size() helper

2024-03-05 Thread Igor Mammedov
it will be used by follow up patch when legacy handling is moved out into a separate file. Signed-off-by: Igor Mammedov --- hw/smbios/smbios.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index 97cf762228

[PATCH v2 08/20] smbios: don't check type4 structures in legacy mode

2024-03-05 Thread Igor Mammedov
to add support for type4 to legacy code (both QEMU and SeaBIOS), simplify smbios_get_table_legacy() by dropping not relevant check in legacy code and error out on type4 blob. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- * The issue affects 'isapc' and pc-i440fx

[PATCH v2 03/20] tests: smbios: add test for legacy mode CLI options

2024-03-05 Thread Igor Mammedov
Unfortunately having 2.0 machine type deprecated is not enough to get rid of legacy SMBIOS handling since 'isapc' also uses that and it's staying around. Hence add test for CLI options handling to be sure that it ain't broken during SMBIOS code refactoring. Signed-off-by: Igor Mammedov Reviewed

[PATCH v2 01/20] tests: smbios: make it possible to write SMBIOS only test

2024-03-05 Thread Igor Mammedov
tions" test case. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Tested-by: Fiona Ebner --- tests/qtest/bios-tables-test.c | 47 +++--- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-te

[PATCH v2 07/20] smbios: avoid mangling user provided tables

2024-03-05 Thread Igor Mammedov
of this and previous commits there is no need to generate legacy smbios_entries at the time options are parsed. Instead compose smbios_entries on demand from usr_blobs like it is done for non-legacy SMBIOS tables. Signed-off-by: Igor Mammedov Tested-by: Fiona Ebner --- hw/smbios/smbios.c | 179

Re: [PATCH 00/19] Workaround Windows failing to find 64bit SMBIOS entry point with SeaBIOS

2024-03-05 Thread Igor Mammedov
On Tue, 5 Mar 2024 05:08:05 -0500 "Michael S. Tsirkin" wrote: > On Tue, Feb 27, 2024 at 04:47:30PM +0100, Igor Mammedov wrote: > > Windows (10) bootloader when running on top of SeaBIOS, fails to find > > > > SMBIOSv3 entry point. Tracing it shows that

Re: [PATCH 09/19] smbios: build legacy mode code only for 'pc' machine

2024-03-04 Thread Igor Mammedov
On Mon, 4 Mar 2024 15:23:00 +0100 Igor Mammedov wrote: > On Mon, 4 Mar 2024 16:25:03 +0530 > Ani Sinha wrote: > > > > On 27-Feb-2024, at 21:17, Igor Mammedov wrote: > > > > > > basically moving code around without functional change. > > >

Re: [PATCH 11/19] smbios: clear smbios_tables pointer after freeing

2024-03-04 Thread Igor Mammedov
On Mon, 4 Mar 2024 19:24:06 +0530 Ani Sinha wrote: > > On 27-Feb-2024, at 21:17, Igor Mammedov wrote: > > > > that will avoid double free if smbios_get_tables() is called > > multiple times. > > > > Signed-off-by: Igor Mammedov > > Maybe we can

Re: [PATCH 09/19] smbios: build legacy mode code only for 'pc' machine

2024-03-04 Thread Igor Mammedov
On Mon, 4 Mar 2024 16:25:03 +0530 Ani Sinha wrote: > > On 27-Feb-2024, at 21:17, Igor Mammedov wrote: > > > > basically moving code around without functional change. > > And exposing some symbols so that they could be shared > > between smbbios.c and new smbi

Re: [PATCH 07/19] smbios: avoid mangling user provided tables

2024-03-04 Thread Igor Mammedov
On Mon, 4 Mar 2024 15:25:11 +0530 (IST) Ani Sinha wrote: > On Tue, 27 Feb 2024, Igor Mammedov wrote: > > > currently smbios_entry_add() preserves internally '-smbios type=' > > options but tables provided with '-smbios file=' are stored directly > > into blob that ev

Re: [PATCH 10/19] smbios: handle errors consistently

2024-03-04 Thread Igor Mammedov
On Mon, 4 Mar 2024 16:44:34 +0530 (IST) Ani Sinha wrote: > On Tue, 27 Feb 2024, Igor Mammedov wrote: > > > Current code uses mix of error_report()+exit(1) > > and error_setg() to handle errors. > > Use newer error_setg() everywhere, beside consistency > > it will a

Re: [PATCH 06/19] smbios: get rid of smbios_legacy global

2024-02-29 Thread Igor Mammedov
On Thu, 29 Feb 2024 16:23:21 +0530 Ani Sinha wrote: > > On 27-Feb-2024, at 21:17, Igor Mammedov wrote: > > > > clean up smbios_set_defaults() which is reused by legacy > > and non legacy machines from being aware of 'legacy' notion > > and need to turn it of

Re: [PATCH v5 3/4] hw: Set virtio-iommu aw-bits default value on pc_q35 and arm virt

2024-02-29 Thread Igor Mammedov
On Thu, 15 Feb 2024 09:42:13 +0100 Eric Auger wrote: > Currently the default input range can extend to 64 bits. On x86, > when the virtio-iommu protects vfio devices, the physical iommu > may support only 39 bits. Let's set the default to 39, as done > for the intel-iommu. On ARM we set 48b as a

Re: [PATCH 03/19] tests: smbios: add test for legacy mode CLI options

2024-02-28 Thread Igor Mammedov
On Wed, 28 Feb 2024 16:41:22 +0530 Ani Sinha wrote: > > On 27-Feb-2024, at 21:17, Igor Mammedov wrote: > > > > Unfortunately having 2.0 machine type deprecated is not enough > > to get rid of legacy SMBIOS handling since 'isapc' also uses > > that and it's stay

Re: [PATCH v4] pc: q35: Bump max_cpus to 4096 vcpus

2024-02-28 Thread Igor Mammedov
> requested (1728) exceeds the recommended cpus supported by KVM (12) > Number of SMP cpus requested (1728) exceeds the maximum cpus supported by KVM > (1024) > > Cc: Daniel P. Berrangé > Cc: Igor Mammedov > Cc: Michael S. Tsirkin > Cc: Julia Suvorova > Cc: kra...

[PATCH 17/19] tests: acpi/smbios: whitelist expected blobs

2024-02-27 Thread Igor Mammedov
Signed-off-by: Igor Mammedov --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..81148a604f 100644 --- a/tests/qtest/bios-tables-test

[PATCH 06/19] smbios: get rid of smbios_legacy global

2024-02-27 Thread Igor Mammedov
clean up smbios_set_defaults() which is reused by legacy and non legacy machines from being aware of 'legacy' notion and need to turn it off. And push legacy handling up to PC machine code where it's relevant. Signed-off-by: Igor Mammedov --- PS: I've moved/kept legacy smbios_entries

[PATCH 08/19] smbios: don't check type4 structures in legacy mode

2024-02-27 Thread Igor Mammedov
to add support for type4 to legacy code (both QEMU and SeaBIOS), simplify smbios_get_table_legacy() by dropping not relevant check in legacy code and error out on type4 blob. Signed-off-by: Igor Mammedov --- * The issue affects 'isapc' and pc-i440fx-2.0. the later is in deprecated state

[PATCH 11/19] smbios: clear smbios_tables pointer after freeing

2024-02-27 Thread Igor Mammedov
that will avoid double free if smbios_get_tables() is called multiple times. Signed-off-by: Igor Mammedov --- hw/smbios/smbios.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index 7c28b5f748..d9ba2072b1 100644 --- a/hw/smbios/smbios.c +++ b/hw

[PATCH 13/19] smbios: extend smbios-entry-point-type with 'auto' value

2024-02-27 Thread Igor Mammedov
later patches will use it to pick SMBIOS version at runtime depending on configuration. Signed-off-by: Igor Mammedov --- qapi/machine.json | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qapi/machine.json b/qapi/machine.json index 93b4677286..4c68528507 100644 --- a/qapi

  1   2   3   4   5   6   7   8   9   10   >