[PATCH 1/1] acpi: Consolidate the handling of OEM ID and OEM Table ID fields

2021-07-14 Thread Marian Postevca
Introduces structure AcpiBuildOem to hold the value of OEM fields and uses dedicated helper functions to initialize/set the values. Unnecessary dynamically allocated OEM fields are re-factored to static allocation. Signed-off-by: Marian Postevca --- hw/acpi/hmat.h | 2 +- hw

[PATCH v6 0/1] Rework ACPI OEM fields handling to simplify code (was: acpi: Remove duplicated code handling OEM ID and OEM table ID fields)

2021-07-14 Thread Marian Postevca
v5: - Rebase on mst tree latest HEAD v6: - Rebase on mst tree latest HEAD - Fixed compilation error in hw/acpi/ghes-stub.c - Fixed coding style error by typedefing struct AcpiBuildOem Marian Postevca (1): acpi: Consolidate the handling of OEM ID and OEM Table ID fields hw/acpi/hmat.h

[PATCH 1/1] acpi: Consolidate the handling of OEM ID and OEM Table ID fields

2021-07-14 Thread Marian Postevca
Introduces structure AcpiBuildOem to hold the value of OEM fields and uses dedicated helper functions to initialize/set the values. Unnecessary dynamically allocated OEM fields are re-factored to static allocation. Signed-off-by: Marian Postevca --- hw/acpi/hmat.h | 2 +- hw

[PATCH v5 1/1] acpi: Consolidate the handling of OEM ID and OEM Table ID fields

2021-05-24 Thread Marian Postevca
Introduces structure AcpiBuildOem to hold the value of OEM fields and uses dedicated helper functions to initialize/set the values. Unnecessary dynamically allocated OEM fields are re-factored to static allocation. Signed-off-by: Marian Postevca --- hw/acpi/hmat.h | 2 +- hw

[PATCH v5 0/1] Rework ACPI OEM fields handling to simplify code (was: acpi: Remove duplicated code handling OEM ID and OEM table ID fields)

2021-05-24 Thread Marian Postevca
v5: - Rebase on mst tree latest HEAD Marian Postevca (1): acpi: Consolidate the handling of OEM ID and OEM Table ID fields hw/acpi/hmat.h | 2 +- hw/i386/acpi-common.h| 2 +- include/hw/acpi/acpi-build-oem.h | 61 + include/hw/acpi/aml-build.h

[PATCH v4 1/1] acpi: Consolidate the handling of OEM ID and OEM Table ID fields

2021-04-01 Thread Marian Postevca
Introduces structure AcpiBuildOem to hold the value of OEM fields and uses dedicated helper functions to initialize/set the values. Unnecessary dynamically allocated OEM fields are re-factored to static allocation. Signed-off-by: Marian Postevca --- hw/acpi/hmat.h | 2 +- hw

[PATCH v4 0/1] Rework ACPI OEM fields handling to simplify code (was: acpi: Remove duplicated code handling OEM ID and OEM table ID fields)

2021-04-01 Thread Marian Postevca
_OEM_* - Didn't drop the defines ACPI_BUILD_APPNAME6 and ACPI_BUILD_APPNAME8 since ACPI_BUILD_APPNAME8 is still used in build_header() in aml-build.c and it feels better to keep them defined together. But if others prefer to drop the ACPI_BUILD_APPNAME6 define, will resend the patch. Ma

Re: [PATCH v3 1/1] acpi: Consolidate the handling of OEM ID and OEM Table ID fields

2021-03-23 Thread Marian Postevca
"Michael S. Tsirkin" writes: >> +#include "qemu/cutils.h" >> + >> +#define ACPI_BUILD_APPNAME6 "BOCHS " >> +#define ACPI_BUILD_APPNAME8 "BXPC" > > A single user for each of these now ... drop the defines? > Unfortunately ACPI_BUILD_APPNAME8 is still used in build_header() in aml-build.c, and

[PATCH v3 0/1] Rework ACPI OEM fields handling to simplify code (was: acpi: Remove duplicated code handling OEM ID and OEM table ID fields)

2021-03-22 Thread Marian Postevca
- Dropped "acpi: Move setters/getters of oem fields to X86MachineState" since it was accepted already Marian Postevca (1): acpi: Consolidate the handling of OEM ID and OEM Table ID fields hw/acpi/hmat.h | 2 +- hw/i386/acpi-common.h| 2 +-

[PATCH v3 1/1] acpi: Consolidate the handling of OEM ID and OEM Table ID fields

2021-03-22 Thread Marian Postevca
Introduces structure AcpiBuildOem to hold the value of OEM fields and uses dedicated macros to initialize/set the values. Unnecessary dynamically allocated OEM fields are re-factored to static allocation. Signed-off-by: Marian Postevca --- hw/acpi/hmat.h | 2 +- hw/i386/acpi

[PATCH 2/2] acpi: Consolidate the handling of OEM ID and OEM Table ID fields

2021-02-20 Thread Marian Postevca
Introduces structure AcpiBuildOem to hold the value of OEM fields and uses dedicated macros to initialize/set the values. Unnecessary dynamically allocated OEM fields are re-factored to static allocation. Signed-off-by: Marian Postevca --- hw/acpi/hmat.h | 2 +- hw/i386/acpi

[PATCH 1/2] acpi: Move setters/getters of oem fields to X86MachineState

2021-02-20 Thread Marian Postevca
The code that sets/gets oem fields is duplicated in both PC and MICROVM variants. This commit moves it to X86MachineState so that all x86 variants can use it and duplication is removed. Signed-off-by: Marian Postevca --- include/hw/i386/microvm.h | 4 --- include/hw/i386/pc.h | 4

[PATCH v2 0/2] Rework ACPI OEM fields handling to simplify code (was: acpi: Remove duplicated code handling OEM ID and OEM table ID fields)

2021-02-20 Thread Marian Postevca
the structure v2: - Move the setters/getters of OEM fields to X86MachineState to remove duplication - Change commit message to make it clear the second commit is a re-factor Marian Postevca (2): acpi: Move setters/getters of oem fields to X86MachineState acpi: Consolidate the handling of

Re: [PATCH] acpi: Remove duplicated code handling OEM ID and OEM table ID fields

2021-02-15 Thread Marian Postevca
Igor Mammedov writes: > hmm, looks like adding instead of removing > Do you mean that the commit message does not describe the change correctly, or that my refactoring is too extreme? If it is the latter, I think I tried to simplify things, by creating macros to be used in multiple places where

[PATCH] acpi: Remove duplicated code handling OEM ID and OEM table ID fields

2021-02-13 Thread Marian Postevca
The code handling OEM ID and OEM table ID fields had some duplicated code and was using unnecessary dynamically allocated memory. This change fixes that. Signed-off-by: Marian Postevca --- hw/acpi/hmat.h | 2 +- hw/i386/acpi-common.h| 2 +- include/hw/acpi/acpi

Re: [PATCH v4 2/5] acpi: Permit OEM ID and OEM table ID fields to be changed

2021-02-07 Thread Marian Postevca
"Michael S. Tsirkin" writes: > > > I queued this but there's a lot of code duplication with this. > Further, the use of g_strdup adds unnecessary dynamic memory > management where it's not needed. > I'd prefer > - a new struct AcpiBuildOem including the correct strings > - use sizeof of field

[PATCH v4 3/5] tests/acpi: add OEM ID and OEM TABLE ID test

2021-01-18 Thread Marian Postevca
Add support for testing the fields OEM ID and OEM TABLE ID in all ACPI tables for PC,Q35,MICROVM,AARCH64 Full diff of changed files disassembly: Table tests/data/acpi/virt/FACP diff: @@ -3,7 +3,7 @@ * AML/ASL+ Disassembler version 20200326 (64-bit version) * Copyright (c) 2000 - 2020 Intel Cor

[PATCH v4 5/5] tests/acpi: disallow updates for expected data files

2021-01-18 Thread Marian Postevca
Signed-off-by: Marian Postevca --- tests/qtest/bios-tables-test-allowed-diff.h | 94 - 1 file changed, 94 deletions(-) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index b20ae72949..dfb8523c8b 100644 --- a/tests

[PATCH v4 2/5] acpi: Permit OEM ID and OEM table ID fields to be changed

2021-01-18 Thread Marian Postevca
one missing. Note that the the OEM Table ID field will not be extended with the name of the table, but will use either the default name or the user provided one. This does not affect the -acpitable option (for user-defined ACPI tables), which has precedence over -machine option. Signed-off-by:

[PATCH v4 0/5] acpi: Permit OEM ID and OEM table ID fields to be changed

2021-01-18 Thread Marian Postevca
machine properties to set the OEM fields values - Pass the desired values from acpi_build() Marian Postevca (5): tests/acpi: allow updates for expected data files acpi: Permit OEM ID and OEM table ID fields to be changed tests/acpi: add OEM ID and OEM TABLE ID test tests/acpi: update expected

[PATCH v4 4/5] tests/acpi: update expected data files

2021-01-18 Thread Marian Postevca
Signed-off-by: Marian Postevca --- tests/data/acpi/microvm/APIC | Bin 70 -> 70 bytes tests/data/acpi/microvm/APIC.ioapic2 | Bin 82 -> 82 bytes tests/data/acpi/microvm/APIC.pcie| Bin 110 -> 110 bytes tests/data/acpi/microvm/DSDT | Bin 365 -> 365 bytes tes

[PATCH v4 1/5] tests/acpi: allow updates for expected data files

2021-01-18 Thread Marian Postevca
Signed-off-by: Marian Postevca --- tests/qtest/bios-tables-test-allowed-diff.h | 94 + 1 file changed, 94 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..b20ae72949 100644 --- a/tests