virtio,acpi,pci: fixes, cleanups, tools.
The following changes since commit d4b78317b7cf8c0c635b70086503813f79ff21ec:
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200623' into staging (2020-06-23 18:57:05 +0100)
are available in the Git repository at:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to f6f746db6bae1ba74967fd7bea2bb5e169502948:
tests: disassemble-asm.sh: generate AML in readable format (2020-06-24 19:03:57 -0400)
----------------------------------------------------------------
virtio,acpi,pci: fixes, cleanups, tools.
Fixes, cleanups in ACPI, PCI, virtio.
A handy script for testing ACPI.
----------------------------------------------------------------
Ani Sinha (1):
Rename use_acpi_pci_hotplug to more appropriate use_acpi_hotplug_bridge
Eric Auger (3):
acpi: Some build_tpm2() code reshape arm/acpi: Add the TPM2.0 device under the DSDT docs/specs/tpm: ACPI boot now supported for TPM/ARM
Gerd Hoffmann (12):
qtest: allow DSDT acpi table changes
acpi: bios-tables-test: show more context on asl diffs
acpi: move aml builder code for floppy device
floppy: make isa_fdc_get_drive_max_chs static
floppy: move cmos_get_fd_drive_type() from pc
acpi: move aml builder code for i8042 (kbd+mouse) device
acpi: factor out fw_cfg_add_acpi_dsdt()
acpi: simplify build_isa_devices_aml()
acpi: drop serial/parallel enable bits from dsdt
acpi: drop build_piix4_pm()
acpi: q35: drop _SB.PCI0.ISA.LPCD opregion. tests/acpi: update expected data files
Michael S. Tsirkin (1):
tests: disassemble-asm.sh: generate AML in readable format
Raphael Norwitz (1):
Stop vhost-user sending uninitialized mmap_offsets
Thomas Huth (1):
tests/qtest/bios-tables: Only run the TPM test with CONFIG_TPM enabled
hw/i386/fw_cfg.h | 1 + include/hw/acpi/acpi-defs.h | 18 --- include/hw/block/fdc.h | 3 +- include/hw/i386/pc.h | 1 - tests/qtest/bios-tables-test-allowed-diff.h | 18 +++ hw/acpi/aml-build.c | 51 ++++--- hw/acpi/piix4.c | 21 +-- hw/arm/virt-acpi-build.c | 34 +++++ hw/block/fdc.c | 111 ++++++++++++++- hw/i386/acpi-build.c | 210 +--------------------------- hw/i386/fw_cfg.c | 28 ++++ hw/i386/pc.c | 25 ---- hw/input/pckbd.c | 31 ++++ hw/virtio/vhost-user.c | 12 +- stubs/cmos.c | 7 + tests/qtest/bios-tables-test.c | 8 +- docs/specs/tpm.rst | 2 - stubs/Makefile.objs | 1 + tests/data/acpi/disassemle-aml.sh | 52 +++++++ tests/data/acpi/pc/DSDT | Bin 5014 -> 4934 bytes tests/data/acpi/pc/DSDT.acpihmat | Bin 6338 -> 6258 bytes tests/data/acpi/pc/DSDT.bridge | Bin 6873 -> 6793 bytes tests/data/acpi/pc/DSDT.cphp | Bin 5477 -> 5397 bytes tests/data/acpi/pc/DSDT.dimmpxm | Bin 6667 -> 6587 bytes tests/data/acpi/pc/DSDT.ipmikcs | Bin 5086 -> 5006 bytes tests/data/acpi/pc/DSDT.memhp | Bin 6373 -> 6293 bytes tests/data/acpi/pc/DSDT.numamem | Bin 5020 -> 4940 bytes tests/data/acpi/q35/DSDT | Bin 7752 -> 7678 bytes tests/data/acpi/q35/DSDT.acpihmat | Bin 9076 -> 9002 bytes tests/data/acpi/q35/DSDT.bridge | Bin 7769 -> 7695 bytes tests/data/acpi/q35/DSDT.cphp | Bin 8215 -> 8141 bytes tests/data/acpi/q35/DSDT.dimmpxm | Bin 9405 -> 9331 bytes tests/data/acpi/q35/DSDT.ipmibt | Bin 7827 -> 7753 bytes tests/data/acpi/q35/DSDT.memhp | Bin 9111 -> 9037 bytes tests/data/acpi/q35/DSDT.mmio64 | Bin 8882 -> 8808 bytes tests/data/acpi/q35/DSDT.numamem | Bin 7758 -> 7684 bytes tests/data/acpi/q35/DSDT.tis | Bin 8357 -> 8283 bytes 37 files changed, 344 insertions(+), 290 deletions(-) create mode 100644 stubs/cmos.c create mode 100755 tests/data/acpi/disassemle-aml.sh
[PULL 02/19] acpi: bios-tables-test: show more context on asl diffs
From: Gerd Hoffmann <[email protected]>
Makes it easier to create good commit messages from the logs.
Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/bios-tables-test.c +1 -1
@@ -469,7 +469,7 @@ static void test_acpi_asl(test_data *data)fflush (stderr);if (getenv ("V" )) {const char *diff_env =getenv ("DIFF" ); -const char *diff_cmd = diff_env ? diff_env :"diff -u" ; +const char *diff_cmd = diff_env ? diff_env :"diff -U 16" ;char *diff =g_strdup_printf ("%s %s %s" , diff_cmd, exp_sdt->asl_file, sdt->asl_file);int out =dup (STDOUT_FILENO );
Signature · 1 line
MST
[PULL 03/19] acpi: move aml builder code for floppy device
In reply to Michael S. TsirkinFrom: Gerd Hoffmann <[email protected]>
DSDT change: isa device order changes in case MI1 (ipmi) is present.
Message-Id: <[email protected]>
--- hw/block/fdc.c | 83 ++++++++++++++++++++++++++++++++++++++++++++ hw/i386/acpi-build.c | 83 -------------------------------------------- stubs/cmos.c | 7 ++++ stubs/Makefile.objs | 1 + 4 files changed, 91 insertions(+), 83 deletions(-) create mode 100644 stubs/cmos.c
hw/block/fdc.c +83 -0
@@ -32,6 +32,8 @@#include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/timer.h" +#include "hw/i386/pc.h" +#include "hw/acpi/aml-build.h" #include "hw/irq.h" #include "hw/isa/isa.h" #include "hw/qdev-properties.h"
@@ -2768,6 +2770,85 @@ void isa_fdc_get_drive_max_chs(FloppyDriveType type, (*maxc)--; } +static Aml *build_fdinfo_aml (int idx,FloppyDriveType type) +{ +Aml *dev, *fdi; +uint8_t maxc, maxh, maxs; + +isa_fdc_get_drive_max_chs (type, &maxc, &maxh, &maxs); + + dev =aml_device ("FLP%c" ,'A' + idx); + +aml_append (dev,aml_name_decl ("_ADR" ,aml_int (idx))); + + fdi =aml_package (16 ); +aml_append (fdi,aml_int (idx));/* Drive Number */ +aml_append (fdi, +aml_int (cmos_get_fd_drive_type (type)));/* Device Type */ +/* +* the values below are the limits of the drive, and are thus independent +* of the inserted media +*/ +aml_append (fdi,aml_int (maxc));/* Maximum Cylinder Number */ +aml_append (fdi,aml_int (maxs));/* Maximum Sector Number */ +aml_append (fdi,aml_int (maxh));/* Maximum Head Number */ +/* +* SeaBIOS returns the below values for int 0x13 func 0x08 regardless of +* the drive type, so shall we +*/ +aml_append (fdi,aml_int (0xAF ));/* disk_specify_1 */ +aml_append (fdi,aml_int (0x02 ));/* disk_specify_2 */ +aml_append (fdi,aml_int (0x25 ));/* disk_motor_wait */ +aml_append (fdi,aml_int (0x02 ));/* disk_sector_siz */ +aml_append (fdi,aml_int (0x12 ));/* disk_eot */ +aml_append (fdi,aml_int (0x1B ));/* disk_rw_gap */ +aml_append (fdi,aml_int (0xFF ));/* disk_dtl */ +aml_append (fdi,aml_int (0x6C ));/* disk_formt_gap */ +aml_append (fdi,aml_int (0xF6 ));/* disk_fill */ +aml_append (fdi,aml_int (0x0F ));/* disk_head_sttl */ +aml_append (fdi,aml_int (0x08 ));/* disk_motor_strt */ + +aml_append (dev,aml_name_decl ("_FDI" , fdi)); +return dev; +} + +static void fdc_isa_build_aml (ISADevice *isadev,Aml *scope) +{ +Aml *dev; +Aml *crs; +int i; + +#define ACPI_FDE_MAX_FD 4 +uint32_t fde_buf[5 ] = { +0 ,0 ,0 ,0 ,/* presence of floppy drives #0 - #3 */ +cpu_to_le32 (2 )/* tape presence (2 == never present) */ + }; + + crs =aml_resource_template (); +aml_append (crs,aml_io (AML_DECODE16 ,0x03F2 ,0x03F2 ,0x00 ,0x04 )); +aml_append (crs,aml_io (AML_DECODE16 ,0x03F7 ,0x03F7 ,0x00 ,0x01 )); +aml_append (crs,aml_irq_no_flags (6 )); +aml_append (crs, +aml_dma (AML_COMPATIBILITY ,AML_NOTBUSMASTER ,AML_TRANSFER8 ,2 )); + + dev =aml_device ("FDC0" ); +aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0700" ))); +aml_append (dev,aml_name_decl ("_CRS" , crs)); + +for (i =0 ; i <MIN (MAX_FD ,ACPI_FDE_MAX_FD ); i++) { +FloppyDriveType type =isa_fdc_get_drive_type (isadev, i); + +if (type <FLOPPY_DRIVE_TYPE_NONE ) { + fde_buf[i] =cpu_to_le32 (1 );/* drive present */ +aml_append (dev,build_fdinfo_aml (i, type)); + } + } +aml_append (dev,aml_name_decl ("_FDE" , +aml_buffer (sizeof (fde_buf), (uint8_t *)fde_buf))); + +aml_append (scope, dev); +} +static const VMStateDescription vmstate_isa_fdc ={ .name ="fdc" , .version_id =2 ,
@@ -2801,11 +2882,13 @@ static Property isa_fdc_properties[] = {static void isabus_fdc_class_init (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass); +ISADeviceClass *isa =ISA_DEVICE_CLASS (klass); dc->realize = isabus_fdc_realize; dc->fw_name ="fdc" ; dc->reset = fdctrl_external_reset_isa; dc->vmsd = &vmstate_isa_fdc; + isa->build_aml = fdc_isa_build_aml;device_class_set_props (dc, isa_fdc_properties);set_bit (DEVICE_CATEGORY_STORAGE , dc->categories); }
hw/i386/acpi-build.c +0 -83
101 lines not on this page · raw message
stubs/cmos.c new file +7 -0
@@ -0,0 +1,7 @@ +#include "qemu/osdep.h" +#include "hw/i386/pc.h" + +int cmos_get_fd_drive_type (FloppyDriveType fd0) +{ +return 0 ; +}
stubs/Makefile.objs +1 -0
@@ -1,4 +1,5 @@ stub-obj-y += blk-commit-all.o +stub-obj-y += cmos.o stub-obj-y += cpu-get-clock.o stub-obj-y += cpu-get-icount.o stub-obj-y += dump.o
Signature · 1 line
MST
[PULL 01/19] qtest: allow DSDT acpi table changes
In reply to Michael S. TsirkinFrom: Gerd Hoffmann <[email protected]>
Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test-allowed-diff.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +18 -0
@@ -1 +1,19 @@/* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/pc/DSDT" , +"tests/data/acpi/pc/DSDT.acpihmat" , +"tests/data/acpi/pc/DSDT.bridge" , +"tests/data/acpi/pc/DSDT.cphp" , +"tests/data/acpi/pc/DSDT.dimmpxm" , +"tests/data/acpi/pc/DSDT.ipmikcs" , +"tests/data/acpi/pc/DSDT.memhp" , +"tests/data/acpi/pc/DSDT.numamem" , +"tests/data/acpi/q35/DSDT" , +"tests/data/acpi/q35/DSDT.acpihmat" , +"tests/data/acpi/q35/DSDT.bridge" , +"tests/data/acpi/q35/DSDT.cphp" , +"tests/data/acpi/q35/DSDT.dimmpxm" , +"tests/data/acpi/q35/DSDT.ipmibt" , +"tests/data/acpi/q35/DSDT.memhp" , +"tests/data/acpi/q35/DSDT.mmio64" , +"tests/data/acpi/q35/DSDT.numamem" , +"tests/data/acpi/q35/DSDT.tis",
Signature · 1 line
MST
[PULL 07/19] acpi: factor out fw_cfg_add_acpi_dsdt()
In reply to Michael S. TsirkinFrom: Gerd Hoffmann <[email protected]>
Add helper function to add fw_cfg device,
also move code to hw/i386/fw_cfg.c.
Message-Id: <[email protected]>
--- hw/i386/fw_cfg.h | 1 + hw/i386/acpi-build.c | 24 +----------------------- hw/i386/fw_cfg.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 23 deletions(-)
hw/i386/fw_cfg.h +1 -0
@@ -25,5 +25,6 @@ FWCfgState *fw_cfg_arch_create(MachineState *ms, uint16_t apic_id_limit);void fw_cfg_build_smbios (MachineState *ms,FWCfgState *fw_cfg);void fw_cfg_build_feature_control (MachineState *ms,FWCfgState *fw_cfg); +void fw_cfg_add_acpi_dsdt (Aml *scope,FWCfgState *fw_cfg);#endif
hw/i386/acpi-build.c +1 -23
@@ -1802,30 +1802,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,/* create fw_cfg node, unconditionally */ { -/* when using port i/o, the 8-bit data register *always* overlaps -* with half of the 16-bit control register. Hence, the total size -* of the i/o region used is FW_CFG_CTL_SIZE; when using DMA, the -* DMA control register is located at FW_CFG_DMA_IO_BASE + 4 */ -uint8_t io_size =object_property_get_bool (OBJECT (x86ms->fw_cfg), -"dma_enabled" ,NULL ) ? -ROUND_UP (FW_CFG_CTL_SIZE ,4 ) +sizeof (dma_addr_t) : -FW_CFG_CTL_SIZE ; - scope =aml_scope ("\\_SB.PCI0" ); - dev =aml_device ("FWCF" ); - -aml_append (dev,aml_name_decl ("_HID" ,aml_string ("QEMU0002" ))); - -/* device present, functioning, decoding, not shown in UI */ -aml_append (dev,aml_name_decl ("_STA" ,aml_int (0xB ))); - - crs =aml_resource_template (); -aml_append (crs, -aml_io (AML_DECODE16 ,FW_CFG_IO_BASE ,FW_CFG_IO_BASE ,0x01 , io_size) - ); -aml_append (dev,aml_name_decl ("_CRS" , crs)); - -aml_append (scope, dev); +fw_cfg_add_acpi_dsdt (scope, x86ms->fw_cfg);aml_append (dsdt, scope); }
hw/i386/fw_cfg.c +28 -0
@@ -15,6 +15,7 @@#include "qemu/osdep.h" #include "sysemu/numa.h" #include "hw/acpi/acpi.h" +#include "hw/acpi/aml-build.h" #include "hw/firmware/smbios.h" #include "hw/i386/fw_cfg.h" #include "hw/timer/hpet.h"
@@ -179,3 +180,30 @@ void fw_cfg_build_feature_control(MachineState *ms, FWCfgState *fw_cfg) *val =cpu_to_le64 (feature_control_bits |FEATURE_CONTROL_LOCKED );fw_cfg_add_file (fw_cfg,"etc/msr_feature_control" , val,sizeof (*val)); } + +void fw_cfg_add_acpi_dsdt (Aml *scope,FWCfgState *fw_cfg) +{ +/* +* when using port i/o, the 8-bit data register *always* overlaps +* with half of the 16-bit control register. Hence, the total size +* of the i/o region used is FW_CFG_CTL_SIZE; when using DMA, the +* DMA control register is located at FW_CFG_DMA_IO_BASE + 4 +*/ +Object *obj =OBJECT (fw_cfg); +uint8_t io_size =object_property_get_bool (obj,"dma_enabled" ,NULL ) ? +ROUND_UP (FW_CFG_CTL_SIZE ,4 ) +sizeof (dma_addr_t) : +FW_CFG_CTL_SIZE ; +Aml *dev =aml_device ("FWCF" ); +Aml *crs =aml_resource_template (); + +aml_append (dev,aml_name_decl ("_HID" ,aml_string ("QEMU0002" ))); + +/* device present, functioning, decoding, not shown in UI */ +aml_append (dev,aml_name_decl ("_STA" ,aml_int (0xB ))); + +aml_append (crs, +aml_io (AML_DECODE16 ,FW_CFG_IO_BASE ,FW_CFG_IO_BASE ,0x01 , io_size)); + +aml_append (dev,aml_name_decl ("_CRS" , crs)); +aml_append (scope, dev); +}
Signature · 1 line
MST
[PULL 04/19] floppy: make isa_fdc_get_drive_max_chs static
In reply to Michael S. TsirkinFrom: Gerd Hoffmann <[email protected]>
acpi aml generator needs this, but it is in floppy code now so we can make the function static.
Message-Id: <[email protected]>
--- include/hw/block/fdc.h | 2 -- hw/block/fdc.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-)
include/hw/block/fdc.h +0 -2
@@ -16,7 +16,5 @@ void sun4m_fdctrl_init(qemu_irq irq, hwaddr io_base, DriveInfo **fds, qemu_irq *fdc_tc);FloppyDriveType isa_fdc_get_drive_type (ISADevice *fdc,int i); -void isa_fdc_get_drive_max_chs (FloppyDriveType type, -uint8_t *maxc,uint8_t *maxh,uint8_t *maxs);#endif
hw/block/fdc.c +2 -2
@@ -2747,8 +2747,8 @@ FloppyDriveType isa_fdc_get_drive_type(ISADevice *fdc, int i)return isa->state.drives[i].drive; } -void isa_fdc_get_drive_max_chs (FloppyDriveType type, -uint8_t *maxc,uint8_t *maxh,uint8_t *maxs) +static void isa_fdc_get_drive_max_chs (FloppyDriveType type,uint8_t *maxc, +uint8_t *maxh,uint8_t *maxs) {const FDFormat *fdf;
Signature · 1 line
MST
[PULL 05/19] floppy: move cmos_get_fd_drive_type() from pc
In reply to Michael S. TsirkinFrom: Gerd Hoffmann <[email protected]>
Message-Id: <[email protected]>
--- include/hw/block/fdc.h | 1 + include/hw/i386/pc.h | 1 - hw/block/fdc.c | 26 +++++++++++++++++++++++++- hw/i386/pc.c | 25 ------------------------- 4 files changed, 26 insertions(+), 27 deletions(-)
include/hw/block/fdc.h +1 -0
@@ -16,5 +16,6 @@ void sun4m_fdctrl_init(qemu_irq irq, hwaddr io_base, DriveInfo **fds, qemu_irq *fdc_tc);FloppyDriveType isa_fdc_get_drive_type (ISADevice *fdc,int i); +int cmos_get_fd_drive_type (FloppyDriveType fd0);#endif
include/hw/i386/pc.h +0 -1
@@ -178,7 +178,6 @@ typedef void (*cpu_set_smm_t)(int smm, void *arg);void pc_i8259_create (ISABus *isa_bus,qemu_irq *i8259_irqs);ISADevice *pc_find_fdc0 (void ); -int cmos_get_fd_drive_type (FloppyDriveType fd0);/* port92.c */ #define PORT92_A20_LINE "a20"
hw/block/fdc.c +25 -1
@@ -32,7 +32,6 @@#include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/timer.h" -#include "hw/i386/pc.h" #include "hw/acpi/aml-build.h" #include "hw/irq.h" #include "hw/isa/isa.h"
@@ -2812,6 +2811,31 @@ static Aml *build_fdinfo_aml(int idx, FloppyDriveType type)return dev; } +int cmos_get_fd_drive_type (FloppyDriveType fd0) +{ +int val; + +switch (fd0) { +case FLOPPY_DRIVE_TYPE_144 : +/* 1.44 Mb 3"5 drive */ + val =4 ; +break ; +case FLOPPY_DRIVE_TYPE_288 : +/* 2.88 Mb 3"5 drive */ + val =5 ; +break ; +case FLOPPY_DRIVE_TYPE_120 : +/* 1.2 Mb 5"5 drive */ + val =2 ; +break ; +case FLOPPY_DRIVE_TYPE_NONE : +default : + val =0 ; +break ; + } +return val; +} +static void fdc_isa_build_aml (ISADevice *isadev,Aml *scope) {Aml *dev;
hw/i386/pc.c +0 -25
@@ -386,31 +386,6 @@ static uint64_t ioportF0_read(void *opaque, hwaddr addr, unsigned size)#define REG_EQUIPMENT_BYTE 0x14 -int cmos_get_fd_drive_type (FloppyDriveType fd0) -{ -int val; - -switch (fd0) { -case FLOPPY_DRIVE_TYPE_144 : -/* 1.44 Mb 3"5 drive */ - val =4 ; -break ; -case FLOPPY_DRIVE_TYPE_288 : -/* 2.88 Mb 3"5 drive */ - val =5 ; -break ; -case FLOPPY_DRIVE_TYPE_120 : -/* 1.2 Mb 5"5 drive */ - val =2 ; -break ; -case FLOPPY_DRIVE_TYPE_NONE : -default : - val =0 ; -break ; - } -return val; -} -static void cmos_init_hd (ISADevice *s,int type_ofs,int info_ofs,int16_t cylinders,int8_t heads,int8_t sectors) {
Signature · 1 line
MST
[PULL 10/19] acpi: drop build_piix4_pm()
In reply to Michael S. TsirkinFrom: Gerd Hoffmann <[email protected]>
The _SB.PCI0.PX13.P13C opregion (holds isa device enable bits) is not used any more, remove it from DSDT.
piix4 DSDT changes:
Scope (_SB.PCI0)
{- Device (PX13)
- {
- Name (_ADR, 0x00010003) // _ADR: Address
- OperationRegion (P13C, PCI_Config, Zero, 0xFF)
- }
- }
-
- Scope (_SB.PCI0)
- {
Device (ISA)
{
Name (_ADR, 0x00010000) // _ADR: Address
OperationRegion (P40C, PCI_Config, 0x60, 0x04)
}
}Message-Id: <[email protected]>
--- hw/i386/acpi-build.c | 16 ---------------- 1 file changed, 16 deletions(-)
hw/i386/acpi-build.c +0 -16
@@ -1364,21 +1364,6 @@ static void build_q35_isa_bridge(Aml *table)aml_append (table, scope); } -static void build_piix4_pm (Aml *table) -{ -Aml *dev; -Aml *scope; - - scope =aml_scope ("_SB.PCI0" ); - dev =aml_device ("PX13" ); -aml_append (dev,aml_name_decl ("_ADR" ,aml_int (0x00010003 ))); - -aml_append (dev,aml_operation_region ("P13C" ,AML_PCI_CONFIG , -aml_int (0x00 ),0xff )); -aml_append (scope, dev); -aml_append (table, scope); -} -static void build_piix4_isa_bridge (Aml *table) {Aml *dev;
@@ -1530,7 +1515,6 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,aml_append (dsdt, sb_scope);build_hpet_aml (dsdt); -build_piix4_pm (dsdt);build_piix4_isa_bridge (dsdt);build_isa_devices_aml (dsdt);build_piix4_pci_hotplug (dsdt);
Signature · 1 line
MST
[PULL 13/19] acpi: Some build_tpm2() code reshape
In reply to Michael S. TsirkinFrom: Eric Auger <[email protected]>
Remove any reference to Acpi20TPM2 and adopt an implementation similar to build_ghes_v2().
Message-Id: <[email protected]>
--- include/hw/acpi/acpi-defs.h | 18 ------------- hw/acpi/aml-build.c | 51 +++++++++++++++++++++++-------------- 2 files changed, 32 insertions(+), 37 deletions(-)
include/hw/acpi/acpi-defs.h +0 -18
@@ -465,24 +465,6 @@ struct Acpi20Tcpa { }QEMU_PACKED ;typedef struct Acpi20Tcpa Acpi20Tcpa ; -/* -* TPM2 -* -* Following Version 1.2, Revision 8 of specs: -* https://trustedcomputinggroup.org/tcg-acpi-specification/ -*/ -struct Acpi20TPM2 { -ACPI_TABLE_HEADER_DEF - uint16_t platform_class; -uint16_t reserved; -uint64_t control_area_address; -uint32_t start_method; -uint8_t start_method_params[12 ]; -uint32_t log_area_minimum_length; -uint64_t log_area_start_address; -}QEMU_PACKED ; -typedef struct Acpi20TPM2 Acpi20TPM2 ; -/* DMAR - DMA Remapping table r2.2 */ struct AcpiTableDmar {ACPI_TABLE_HEADER_DEF
hw/acpi/aml-build.c +32 -19
80 lines not on this page · raw message
Signature · 1 line
MST
[PULL 08/19] acpi: simplify build_isa_devices_aml()
In reply to Michael S. TsirkinFrom: Gerd Hoffmann <[email protected]>
x86 machines can have a single ISA bus only.
Message-Id: <[email protected]>
--- hw/i386/acpi-build.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-)
hw/i386/acpi-build.c +6 -10
@@ -979,18 +979,14 @@ static void build_isa_devices_aml(Aml *table) {VMBusBridge *vmbus_bridge =vmbus_bridge_find ();bool ambiguous; - -Aml *scope =aml_scope ("_SB.PCI0.ISA" );Object *obj =object_resolve_path_type ("" ,TYPE_ISA_BUS , &ambiguous); +Aml *scope; -if (ambiguous) { -error_report ("Multiple ISA busses, unable to define IPMI ACPI data" ); - }else if (!obj) { -error_report ("No ISA bus, unable to define IPMI ACPI data" ); - }else { -build_acpi_ipmi_devices (scope,BUS (obj),"\\_SB.PCI0.ISA" ); -isa_build_aml (ISA_BUS (obj), scope); - } +assert (obj && !ambiguous); + + scope =aml_scope ("_SB.PCI0.ISA" ); +build_acpi_ipmi_devices (scope,BUS (obj),"\\_SB.PCI0.ISA" ); +isa_build_aml (ISA_BUS (obj), scope);if (vmbus_bridge) {aml_append (scope,build_vmbus_device_aml (vmbus_bridge));
Signature · 1 line
MST
[PULL 06/19] acpi: move aml builder code for i8042 (kbd+mouse) device
In reply to Michael S. TsirkinFrom: Gerd Hoffmann <[email protected]>
DSDT change: isa device order changes in case MI1 (ipmi) is present.
Message-Id: <[email protected]>
--- hw/i386/acpi-build.c | 39 --------------------------------------- hw/input/pckbd.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 39 deletions(-)
hw/i386/acpi-build.c +0 -39
@@ -938,42 +938,6 @@ static void build_hpet_aml(Aml *table)aml_append (table, scope); } -static Aml *build_kbd_device_aml (void ) -{ -Aml *dev; -Aml *crs; - - dev =aml_device ("KBD" ); -aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0303" ))); - -aml_append (dev,aml_name_decl ("_STA" ,aml_int (0xf ))); - - crs =aml_resource_template (); -aml_append (crs,aml_io (AML_DECODE16 ,0x0060 ,0x0060 ,0x01 ,0x01 )); -aml_append (crs,aml_io (AML_DECODE16 ,0x0064 ,0x0064 ,0x01 ,0x01 )); -aml_append (crs,aml_irq_no_flags (1 )); -aml_append (dev,aml_name_decl ("_CRS" , crs)); - -return dev; -} - -static Aml *build_mouse_device_aml (void ) -{ -Aml *dev; -Aml *crs; - - dev =aml_device ("MOU" ); -aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0F13" ))); - -aml_append (dev,aml_name_decl ("_STA" ,aml_int (0xf ))); - - crs =aml_resource_template (); -aml_append (crs,aml_irq_no_flags (12 )); -aml_append (dev,aml_name_decl ("_CRS" , crs)); - -return dev; -} -static Aml *build_vmbus_device_aml (VMBusBridge *vmbus_bridge) {Aml *dev;
@@ -1019,9 +983,6 @@ static void build_isa_devices_aml(Aml *table)Aml *scope =aml_scope ("_SB.PCI0.ISA" );Object *obj =object_resolve_path_type ("" ,TYPE_ISA_BUS , &ambiguous); -aml_append (scope,build_kbd_device_aml ()); -aml_append (scope,build_mouse_device_aml ()); -if (ambiguous) {error_report ("Multiple ISA busses, unable to define IPMI ACPI data" ); }else if (!obj) {
hw/input/pckbd.c +31 -0
@@ -26,6 +26,7 @@#include "qemu/log.h" #include "hw/isa/isa.h" #include "migration/vmstate.h" +#include "hw/acpi/aml-build.h" #include "hw/input/ps2.h" #include "hw/irq.h" #include "hw/input/i8042.h"
@@ -561,12 +562,42 @@ static void i8042_realizefn(DeviceState *dev, Error **errp)qemu_register_reset (kbd_reset, s); } +static void i8042_build_aml (ISADevice *isadev,Aml *scope) +{ +Aml *kbd; +Aml *mou; +Aml *crs; + + crs =aml_resource_template (); +aml_append (crs,aml_io (AML_DECODE16 ,0x0060 ,0x0060 ,0x01 ,0x01 )); +aml_append (crs,aml_io (AML_DECODE16 ,0x0064 ,0x0064 ,0x01 ,0x01 )); +aml_append (crs,aml_irq_no_flags (1 )); + + kbd =aml_device ("KBD" ); +aml_append (kbd,aml_name_decl ("_HID" ,aml_eisaid ("PNP0303" ))); +aml_append (kbd,aml_name_decl ("_STA" ,aml_int (0xf ))); +aml_append (kbd,aml_name_decl ("_CRS" , crs)); + + crs =aml_resource_template (); +aml_append (crs,aml_irq_no_flags (12 )); + + mou =aml_device ("MOU" ); +aml_append (mou,aml_name_decl ("_HID" ,aml_eisaid ("PNP0F13" ))); +aml_append (mou,aml_name_decl ("_STA" ,aml_int (0xf ))); +aml_append (mou,aml_name_decl ("_CRS" , crs)); + +aml_append (scope, kbd); +aml_append (scope, mou); +} +static void i8042_class_initfn (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass); +ISADeviceClass *isa =ISA_DEVICE_CLASS (klass); dc->realize = i8042_realizefn; dc->vmsd = &vmstate_kbd_isa; + isa->build_aml = i8042_build_aml;set_bit (DEVICE_CATEGORY_INPUT , dc->categories); }
Signature · 1 line
MST
[PULL 11/19] acpi: q35: drop _SB.PCI0.ISA.LPCD opregion.
In reply to Michael S. TsirkinFrom: Gerd Hoffmann <[email protected]>
Seems to be unused.
ich9 DSDT changes:
Scope (_SB.PCI0)
{
Device (ISA)
{
Name (_ADR, 0x001F0000) // _ADR: Address
OperationRegion (PIRQ, PCI_Config, 0x60, 0x0C)
- OperationRegion (LPCD, PCI_Config, 0x80, 0x02)
- Field (LPCD, AnyAcc, NoLock, Preserve)
- {
- COMA, 3,
- , 1,
- COMB, 3,
- Offset (0x01),
- LPTD, 2
- }
}
}Message-Id: <[email protected]>
--- hw/i386/acpi-build.c | 11 ----------- 1 file changed, 11 deletions(-)
hw/i386/acpi-build.c +0 -11
@@ -1340,7 +1340,6 @@ static void build_q35_isa_bridge(Aml *table) {Aml *dev;Aml *scope; -Aml *field; scope =aml_scope ("_SB.PCI0" ); dev =aml_device ("ISA" );
@@ -1350,16 +1349,6 @@ static void build_q35_isa_bridge(Aml *table)aml_append (dev,aml_operation_region ("PIRQ" ,AML_PCI_CONFIG ,aml_int (0x60 ),0x0C )); -aml_append (dev,aml_operation_region ("LPCD" ,AML_PCI_CONFIG , -aml_int (0x80 ),0x02 )); - field =aml_field ("LPCD" ,AML_ANY_ACC ,AML_NOLOCK ,AML_PRESERVE ); -aml_append (field,aml_named_field ("COMA" ,3 )); -aml_append (field,aml_reserved_field (1 )); -aml_append (field,aml_named_field ("COMB" ,3 )); -aml_append (field,aml_reserved_field (1 )); -aml_append (field,aml_named_field ("LPTD" ,2 )); -aml_append (dev, field); -aml_append (scope, dev);aml_append (table, scope); }
Signature · 1 line
MST
[PULL 14/19] arm/acpi: Add the TPM2.0 device under the DSDT
In reply to Michael S. TsirkinFrom: Eric Auger <[email protected]>
In case it is dynamically instantiated, add the TPM 2.0 device object under the DSDT table in the ACPI namespace. Its HID is MSFT0101 while its current resource settings (CRS) property is initialized with the guest physical address and MMIO size of the device.
Message-Id: <[email protected]>
--- hw/arm/virt-acpi-build.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
hw/arm/virt-acpi-build.c +34 -0
@@ -46,6 +46,7 @@#include "hw/pci/pci.h" #include "hw/arm/virt.h" #include "hw/mem/nvdimm.h" +#include "hw/platform-bus.h" #include "sysemu/numa.h" #include "sysemu/reset.h" #include "sysemu/tpm.h"
@@ -364,6 +365,38 @@ static void acpi_dsdt_add_power_button(Aml *scope)aml_append (scope, dev); } +static void acpi_dsdt_add_tpm (Aml *scope,VirtMachineState *vms) +{ +PlatformBusDevice *pbus =PLATFORM_BUS_DEVICE (vms->platform_bus_dev); +hwaddr pbus_base = vms->memmap[VIRT_PLATFORM_BUS ].base; +SysBusDevice *sbdev =SYS_BUS_DEVICE (tpm_find ()); +MemoryRegion *sbdev_mr; +hwaddr tpm_base; + +if (!sbdev) { +return ; + } + + tpm_base =platform_bus_get_mmio_addr (pbus, sbdev,0 ); +assert (tpm_base !=-1 ); + + tpm_base += pbus_base; + + sbdev_mr =sysbus_mmio_get_region (sbdev,0 ); + +Aml *dev =aml_device ("TPM0" ); +aml_append (dev,aml_name_decl ("_HID" ,aml_string ("MSFT0101" ))); +aml_append (dev,aml_name_decl ("_UID" ,aml_int (0 ))); + +Aml *crs =aml_resource_template (); +aml_append (crs, +aml_memory32_fixed (tpm_base, + (uint32_t )memory_region_size (sbdev_mr), +AML_READ_WRITE )); +aml_append (dev,aml_name_decl ("_CRS" , crs)); +aml_append (scope, dev); +} +static void build_iort (GArray *table_data,BIOSLinker *linker,VirtMachineState *vms) {
@@ -762,6 +795,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) }acpi_dsdt_add_power_button (scope); +acpi_dsdt_add_tpm (scope, vms);aml_append (dsdt, scope);
Signature · 1 line
MST
[PULL 19/19] tests: disassemble-asm.sh: generate AML in readable format
In reply to Michael S. TsirkinOn systems where the IASL tool exists, we can convert extected ACPI tables to ASL format, which is useful
for debugging and documentation purposes.
This script does this for all ACPI tables under tests/data/acpi/.
--- tests/data/acpi/disassemle-aml.sh | 52 +++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 tests/data/acpi/disassemle-aml.sh
tests/data/acpi/disassemle-aml.sh new file +52 -0
@@ -0,0 +1,52 @@ +#!/usr/bin/bash + +outdir= +while getopts "o:" arg; do + case ${arg} in + o ) + outdir=$OPTARG + ;; + \? ) + echo "Usage: ./tests/data/acpi/disassemle-aml.sh [-o <output-directory>]" + exit 1 + ;; + + esac +done + +for machine in tests/data/acpi/* +do + if [[ ! -d "$machine" ]]; + then + continue + fi + + if [[ "${outdir}" ]]; + then + mkdir -p "${outdir}"/${machine} || exit $? + fi + for aml in $machine/* + do + if [[ "$aml" == $machine/*.dsl ]]; + then + continue + fi + if [[ "$aml" == $machine/SSDT*.* ]]; + then + dsdt=${aml/SSDT*./DSDT.} + extra="-e ${dsdt}" + elif [[ "$aml" == $machine/SSDT* ]]; + then + dsdt=${aml/SSDT*/DSDT}; + extra="-e ${dsdt}" + else + extra="" + fi + asl=${aml}.dsl + if [[ "${outdir}" ]]; + then + asl="${outdir}"/${machine}/${asl} + fi + iasl -d -p ${asl} ${extra} ${aml} + done +done
Signature · 1 line
MST
[PULL 09/19] acpi: drop serial/parallel enable bits from dsdt
In reply to Michael S. TsirkinFrom: Gerd Hoffmann <[email protected]>
The _STA methods for COM+LPT used to reference them, but that isn't the case any more.
piix4 DSDT changes:
Scope (_SB.PCI0)
{
Device (ISA)
{
Name (_ADR, 0x00010000) // _ADR: Address
OperationRegion (P40C, PCI_Config, 0x60, 0x04)- Field (^PX13.P13C, AnyAcc, NoLock, Preserve)
- {
- Offset (0x5F),
- , 7,
- LPEN, 1,
- Offset (0x67),
- , 3,
- CAEN, 1,
- , 3,
- CBEN, 1
- }
}
}ich9 DSDT changes:
Scope (_SB.PCI0)
{
Device (ISA)
{
Name (_ADR, 0x001F0000) // _ADR: Address
OperationRegion (PIRQ, PCI_Config, 0x60, 0x0C)
OperationRegion (LPCD, PCI_Config, 0x80, 0x02)
Field (LPCD, AnyAcc, NoLock, Preserve)
{
COMA, 3,
, 1,
COMB, 3,
Offset (0x01),
LPTD, 2
}
-
- OperationRegion (LPCE, PCI_Config, 0x82, 0x02)
- Field (LPCE, AnyAcc, NoLock, Preserve)
- {
- CAEN, 1,
- CBEN, 1,
- LPEN, 1
- }
}
}Message-Id: <[email protected]>
--- hw/i386/acpi-build.c | 23 ----------------------- 1 file changed, 23 deletions(-)
hw/i386/acpi-build.c +0 -23
@@ -1360,15 +1360,6 @@ static void build_q35_isa_bridge(Aml *table)aml_append (field,aml_named_field ("LPTD" ,2 ));aml_append (dev, field); -aml_append (dev,aml_operation_region ("LPCE" ,AML_PCI_CONFIG , -aml_int (0x82 ),0x02 )); -/* enable bits */ - field =aml_field ("LPCE" ,AML_ANY_ACC ,AML_NOLOCK ,AML_PRESERVE ); -aml_append (field,aml_named_field ("CAEN" ,1 )); -aml_append (field,aml_named_field ("CBEN" ,1 )); -aml_append (field,aml_named_field ("LPEN" ,1 )); -aml_append (dev, field); -aml_append (scope, dev);aml_append (table, scope); }
@@ -1392,7 +1383,6 @@ static void build_piix4_isa_bridge(Aml *table) {Aml *dev;Aml *scope; -Aml *field; scope =aml_scope ("_SB.PCI0" ); dev =aml_device ("ISA" );
@@ -1401,19 +1391,6 @@ static void build_piix4_isa_bridge(Aml *table)/* PIIX PCI to ISA irq remapping */ aml_append (dev,aml_operation_region ("P40C" ,AML_PCI_CONFIG ,aml_int (0x60 ),0x04 )); -/* enable bits */ - field =aml_field ("^PX13.P13C" ,AML_ANY_ACC ,AML_NOLOCK ,AML_PRESERVE ); -/* Offset(0x5f),, 7, */ -aml_append (field,aml_reserved_field (0x2f8 )); -aml_append (field,aml_reserved_field (7 )); -aml_append (field,aml_named_field ("LPEN" ,1 )); -/* Offset(0x67),, 3, */ -aml_append (field,aml_reserved_field (0x38 )); -aml_append (field,aml_reserved_field (3 )); -aml_append (field,aml_named_field ("CAEN" ,1 )); -aml_append (field,aml_reserved_field (3 )); -aml_append (field,aml_named_field ("CBEN" ,1 )); -aml_append (dev, field);aml_append (scope, dev);aml_append (table, scope);
Signature · 1 line
MST
[PULL 15/19] docs/specs/tpm: ACPI boot now supported for TPM/ARM
In reply to Michael S. TsirkinFrom: Eric Auger <[email protected]>
ACPI boot now is supported. Let's remove the comment saying it is not.
Message-Id: <[email protected]>
--- docs/specs/tpm.rst | 2 -- 1 file changed, 2 deletions(-)
docs/specs/tpm.rst +0 -2
@@ -346,8 +346,6 @@ In case an Arm virt machine is emulated, use the following command line: -drive if=pflash,format=raw,file=flash0.img,readonly \ -drive if=pflash,format=raw,file=flash1.img - On Arm, ACPI boot with TPM is not yet supported. - In case SeaBIOS is used as firmware, it should show the TPM menu item after entering the menu with 'ESC'.
Signature · 1 line
MST
[PULL 12/19] tests/acpi: update expected data files
In reply to Michael S. TsirkinFrom: Gerd Hoffmann <[email protected]>
Message-Id: <[email protected]>
--- tests/data/acpi/pc/DSDT | Bin 5014 -> 4934 bytes tests/data/acpi/pc/DSDT.acpihmat | Bin 6338 -> 6258 bytes tests/data/acpi/pc/DSDT.bridge | Bin 6873 -> 6793 bytes tests/data/acpi/pc/DSDT.cphp | Bin 5477 -> 5397 bytes tests/data/acpi/pc/DSDT.dimmpxm | Bin 6667 -> 6587 bytes tests/data/acpi/pc/DSDT.ipmikcs | Bin 5086 -> 5006 bytes tests/data/acpi/pc/DSDT.memhp | Bin 6373 -> 6293 bytes tests/data/acpi/pc/DSDT.numamem | Bin 5020 -> 4940 bytes tests/data/acpi/q35/DSDT | Bin 7752 -> 7678 bytes tests/data/acpi/q35/DSDT.acpihmat | Bin 9076 -> 9002 bytes tests/data/acpi/q35/DSDT.bridge | Bin 7769 -> 7695 bytes tests/data/acpi/q35/DSDT.cphp | Bin 8215 -> 8141 bytes tests/data/acpi/q35/DSDT.dimmpxm | Bin 9405 -> 9331 bytes tests/data/acpi/q35/DSDT.ipmibt | Bin 7827 -> 7753 bytes tests/data/acpi/q35/DSDT.memhp | Bin 9111 -> 9037 bytes tests/data/acpi/q35/DSDT.mmio64 | Bin 8882 -> 8808 bytes tests/data/acpi/q35/DSDT.numamem | Bin 7758 -> 7684 bytes tests/data/acpi/q35/DSDT.tis | Bin 8357 -> 8283 bytes 18 files changed, 0 insertions(+), 0 deletions(-)
tests/data/acpi/pc/DSDT binary +0 -0
tests/data/acpi/pc/DSDT.acpihmat binary +0 -0
tests/data/acpi/pc/DSDT.bridge binary +0 -0
tests/data/acpi/pc/DSDT.cphp binary +0 -0
tests/data/acpi/pc/DSDT.dimmpxm binary +0 -0
tests/data/acpi/pc/DSDT.ipmikcs binary +0 -0
tests/data/acpi/pc/DSDT.memhp binary +0 -0
tests/data/acpi/pc/DSDT.numamem binary +0 -0
tests/data/acpi/q35/DSDT binary +0 -0
tests/data/acpi/q35/DSDT.acpihmat binary +0 -0
tests/data/acpi/q35/DSDT.bridge binary +0 -0
tests/data/acpi/q35/DSDT.cphp binary +0 -0
tests/data/acpi/q35/DSDT.dimmpxm binary +0 -0
tests/data/acpi/q35/DSDT.ipmibt binary +0 -0
tests/data/acpi/q35/DSDT.memhp binary +0 -0
tests/data/acpi/q35/DSDT.mmio64 binary +0 -0
tests/data/acpi/q35/DSDT.numamem binary +0 -0
tests/data/acpi/q35/DSDT.tis binary +0 -0
Signature · 1 line
MST
[PULL 16/19] Stop vhost-user sending uninitialized mmap_offsets
In reply to Michael S. TsirkinFrom: Raphael Norwitz <[email protected]>
Prior to this change, the vhost_user_fill_msg_region function filled out all elements of the VhostUserMemoryRegion struct except the mmap_offset.
This function is often called on uninitialized structs, which are then copied into VHOST_USER_SET_MEM_TABLE and VHOST_USER_ADD/REM_MEM_REG messages. In some cases, where the mmap_offset was not needed, it was left uninitialized, causing QEMU to send the backend uninitialized data, which Coverity flagged as a series of issues.
This change augments the vhost_user_fill_msg_region API, adding a mmap_offset paramenter, forcing the caller to initialize mmap_offset.
Message-Id: <[email protected]>
--- hw/virtio/vhost-user.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
hw/virtio/vhost-user.c +6 -6
@@ -460,12 +460,14 @@ static MemoryRegion *vhost_user_get_mr_data(uint64_t addr, ram_addr_t *offset, }static void vhost_user_fill_msg_region (VhostUserMemoryRegion *dst, -struct vhost_memory_region *src) +struct vhost_memory_region *src, +uint64_t mmap_offset) {assert (src !=NULL && dst !=NULL ); dst->userspace_addr = src->userspace_addr; dst->memory_size = src->memory_size; dst->guest_phys_addr = src->guest_phys_addr; + dst->mmap_offset = mmap_offset; } static int vhost_user_fill_set_mem_table_msg(struct vhost_user *u,
@@ -500,9 +502,8 @@ static int vhost_user_fill_set_mem_table_msg(struct vhost_user *u,error_report ("Failed preparing vhost-user memory table msg" );return -1 ; } -vhost_user_fill_msg_region (®ion_buffer, reg); +vhost_user_fill_msg_region (®ion_buffer, reg, offset); msg->payload.memory.regions[*fd_num] = region_buffer; - msg->payload.memory.regions[*fd_num].mmap_offset = offset; fds[(*fd_num)++] = fd; }else if (track_ramblocks) { u->region_rb_offset[i] =0 ;
@@ -649,7 +650,7 @@ static int send_remove_regions(struct vhost_dev *dev,if (fd >0 ) { msg->hdr.request =VHOST_USER_REM_MEM_REG ; -vhost_user_fill_msg_region (®ion_buffer, shadow_reg); +vhost_user_fill_msg_region (®ion_buffer, shadow_reg,0 ); msg->payload.mem_reg.region = region_buffer;if (vhost_user_write (dev, msg, &fd,1 ) <0 ) {
@@ -709,9 +710,8 @@ static int send_add_regions(struct vhost_dev *dev, u->region_rb[reg_idx] = mr->ram_block; } msg->hdr.request =VHOST_USER_ADD_MEM_REG ; -vhost_user_fill_msg_region (®ion_buffer, reg); +vhost_user_fill_msg_region (®ion_buffer, reg, offset); msg->payload.mem_reg.region = region_buffer; - msg->payload.mem_reg.region.mmap_offset = offset;if (vhost_user_write (dev, msg, &fd,1 ) <0 ) {return -1 ;
Signature · 1 line
MST
[PULL 17/19] Rename use_acpi_pci_hotplug to more appropriate use_acpi_hotplug_bridge
In reply to Michael S. TsirkinFrom: Ani Sinha <[email protected]>
Currently, the option use_acpi_pci_hotplug is being used to control device hotplug capability using ACPI for slots of cold plugged bridges. Hence, we are renaming this option to better reflect what it actually does.
Message-Id: <[email protected]>
--- hw/acpi/piix4.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
hw/acpi/piix4.c +11 -10
@@ -77,7 +77,7 @@ typedef struct PIIX4PMState {Notifier powerdown_notifier;AcpiPciHpState acpi_pci_hotplug; -bool use_acpi_pci_hotplug; +bool use_acpi_hotplug_bridge;uint8_t disable_s3;uint8_t disable_s4;
@@ -204,16 +204,17 @@ static const VMStateDescription vmstate_pci_status = { } }; -static bool vmstate_test_use_acpi_pci_hotplug (void *opaque,int version_id) +static bool vmstate_test_use_acpi_hotplug_bridge (void *opaque,int version_id) {PIIX4PMState *s = opaque; -return s->use_acpi_pci_hotplug; +return s->use_acpi_hotplug_bridge; } -static bool vmstate_test_no_use_acpi_pci_hotplug (void *opaque,int version_id) +static bool vmstate_test_no_use_acpi_hotplug_bridge (void *opaque, +int version_id) {PIIX4PMState *s = opaque; -return !s->use_acpi_pci_hotplug; +return !s->use_acpi_hotplug_bridge; }static bool vmstate_test_use_memhp (void *opaque)
@@ -290,11 +291,11 @@ static const VMStateDescription vmstate_acpi = {VMSTATE_STRUCT_TEST ( acpi_pci_hotplug.acpi_pcihp_pci_status[ACPI_PCIHP_BSEL_DEFAULT ], PIIX4PMState, - vmstate_test_no_use_acpi_pci_hotplug, + vmstate_test_no_use_acpi_hotplug_bridge,2 , vmstate_pci_status, struct AcpiPciHpPciStatus),VMSTATE_PCI_HOTPLUG (acpi_pci_hotplug, PIIX4PMState, - vmstate_test_use_acpi_pci_hotplug), + vmstate_test_use_acpi_hotplug_bridge),VMSTATE_END_OF_LIST () }, .subsections = (const VMStateDescription*[]) {
@@ -530,7 +531,7 @@ I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, s->smi_irq = smi_irq; s->smm_enabled = smm_enabled;if (xen_enabled ()) { - s->use_acpi_pci_hotplug = false; + s->use_acpi_hotplug_bridge = false; }pci_realize_and_unref (pci_dev, bus, &error_fatal);
@@ -595,7 +596,7 @@ static void piix4_acpi_system_hot_add_init(MemoryRegion *parent,memory_region_add_subregion (parent,GPE_BASE , &s->io_gpe);acpi_pcihp_init (OBJECT (s), &s->acpi_pci_hotplug, bus, parent, - s->use_acpi_pci_hotplug); + s->use_acpi_hotplug_bridge); s->cpu_hotplug_legacy = true; object_property_add_bool(OBJECT(s), "cpu-hotplug-legacy",
@@ -633,7 +634,7 @@ static Property piix4_pm_properties[] = {DEFINE_PROP_UINT8 (ACPI_PM_PROP_S4_DISABLED , PIIX4PMState, disable_s4,0 ),DEFINE_PROP_UINT8 (ACPI_PM_PROP_S4_VAL , PIIX4PMState, s4_val,2 ),DEFINE_PROP_BOOL ("acpi-pci-hotplug-with-bridge-support" , PIIX4PMState, - use_acpi_pci_hotplug, true), + use_acpi_hotplug_bridge, true),DEFINE_PROP_BOOL ("memory-hotplug-support" , PIIX4PMState, acpi_memory_hotplug.is_enabled, true), DEFINE_PROP_END_OF_LIST(),
Signature · 1 line
MST
[PULL 18/19] tests/qtest/bios-tables: Only run the TPM test with CONFIG_TPM enabled
In reply to Michael S. TsirkinFrom: Thomas Huth <[email protected]>
"make check-qtest" currently fails if configure has been run with "--disable-tpm" - the TPM-related tests can only work if the TPM is enabled in the build. So let's use the CONFIG_TPM switch to disable the test if TPM is not available.
Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test.c | 6 ++++++ 1 file changed, 6 insertions(+)
tests/qtest/bios-tables-test.c +6 -0
@@ -877,6 +877,8 @@ static void test_acpi_piix4_tcg_numamem(void)free_test_data (&data); } +#ifdef CONFIG_TPM +uint64_t tpm_tis_base_addr; static void test_acpi_tcg_tpm(const char *machine, const char *tpm_if,
@@ -935,6 +937,8 @@ static void test_acpi_q35_tcg_tpm_tis(void) test_acpi_tcg_tpm("q35", "tis", 0xFED40000); } +#endif /* CONFIG_TPM */ +static void test_acpi_tcg_dimm_pxm (const char *machine) {test_data data;
@@ -1098,7 +1102,9 @@ int main(int argc, char *argv[])return ret; } +#ifdef CONFIG_TPM qtest_add_func ("acpi/q35/tpm-tis" , test_acpi_q35_tcg_tpm_tis); +#endif qtest_add_func ("acpi/piix4" , test_acpi_piix4_tcg);qtest_add_func ("acpi/piix4/bridge" , test_acpi_piix4_tcg_bridge);qtest_add_func ("acpi/q35" , test_acpi_q35_tcg);
Signature · 1 line
MST
Quoted 43 lines · Michael S. Tsirkin
The following changes since commit
d4b78317b7cf8c0c635b70086503813f79ff21ec:Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200623' into staging (2020-06-23 18:57:05 +0100)are available in the Git repository at:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.gittags/for_upstreamfor you to fetch changes up to
f6f746db6bae1ba74967fd7bea2bb5e169502948:tests:
disassemble-asm.sh: generate AML in readable format (2020-06-24 19:03:57 -0400)----------------------------------------------------------------
virtio,acpi,pci: fixes, cleanups, tools.Fixes, cleanups in ACPI, PCI, virtio.
A handy script for testing ACPI.Signed-off-by Michael S. Tsirkin <[email protected]>----------------------------------------------------------------
Ani Sinha (1):
Renameuse_acpi_pci_hotplugto more appropriateuse_acpi_hotplug_bridgeEric Auger (3):
acpi: Somebuild_tpm2()code reshape arm/acpi: Add the TPM2.0 device under the DSDT docs/specs/tpm: ACPI boot now supported for TPM/ARMGerd Hoffmann (12):
qtest: allow DSDT acpi table changes
acpi: bios-tables-test: show more context on asl diffs
acpi: move aml builder code for floppy device
floppy: makeisa_fdc_get_drive_max_chsstatic
floppy: movecmos_get_fd_drive_type()from pc
acpi: move aml builder code for i8042 (kbd+mouse) device
acpi: factor outfw_cfg_add_acpi_dsdt()
acpi: simplifybuild_isa_devices_aml()
acpi: drop serial/parallel enable bits from dsdt
acpi: dropbuild_piix4_pm()
acpi: q35: drop _SB.PCI0.ISA.LPCD opregion. tests/acpi: update expected data files
Quoted 8 lines
Michael S. Tsirkin (1):
tests:disassemble-asm.sh: generate AML in readable formatRaphael Norwitz (1):
Stop vhost-user sending uninitializedmmap_offsetsThomas Huth (1):
tests/qtest/bios-tables: Only run the TPM test withCONFIG_TPMenabled
Hi Michael!
Please drop my patch from your pull request - the issue has already been solved by Eric's patch that already got merged:
https://git.qemu.org/?p=qemu.git;a=commitdiff;h=55b9757c7e58092
Thanks,
Thomas
Quoted 55 lines · Thomas Huth
Quoted 43 lines · Michael S. Tsirkin
The following changes since commit
d4b78317b7cf8c0c635b70086503813f79ff21ec:Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200623' into staging (2020-06-23 18:57:05 +0100)are available in the Git repository at:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.gittags/for_upstreamfor you to fetch changes up to
f6f746db6bae1ba74967fd7bea2bb5e169502948:tests:
disassemble-asm.sh: generate AML in readable format (2020-06-24 19:03:57 -0400)----------------------------------------------------------------
virtio,acpi,pci: fixes, cleanups, tools.Fixes, cleanups in ACPI, PCI, virtio.
A handy script for testing ACPI.Signed-off-by Michael S. Tsirkin <[email protected]>----------------------------------------------------------------
Ani Sinha (1):
Renameuse_acpi_pci_hotplugto more appropriateuse_acpi_hotplug_bridgeEric Auger (3):
acpi: Somebuild_tpm2()code reshape arm/acpi: Add the TPM2.0 device under the DSDT docs/specs/tpm: ACPI boot now supported for TPM/ARMGerd Hoffmann (12):
qtest: allow DSDT acpi table changes
acpi: bios-tables-test: show more context on asl diffs
acpi: move aml builder code for floppy device
floppy: makeisa_fdc_get_drive_max_chsstatic
floppy: movecmos_get_fd_drive_type()from pc
acpi: move aml builder code for i8042 (kbd+mouse) device
acpi: factor outfw_cfg_add_acpi_dsdt()
acpi: simplifybuild_isa_devices_aml()
acpi: drop serial/parallel enable bits from dsdt
acpi: dropbuild_piix4_pm()
acpi: q35: drop _SB.PCI0.ISA.LPCD opregion. tests/acpi: update expected data filesQuoted 8 lines
Michael S. Tsirkin (1):
tests:disassemble-asm.sh: generate AML in readable formatRaphael Norwitz (1):
Stop vhost-user sending uninitializedmmap_offsetsThomas Huth (1):
tests/qtest/bios-tables: Only run the TPM test withCONFIG_TPMenabledHi Michael!
Quoted 7 lines
Please drop my patch from your pull request - the issue has already been solved by Eric's patch that already got merged:
https://git.qemu.org/?p=qemu.git;a=commitdiff;h=55b9757c7e58092
Thanks,
Thomas
OK done. Peter I pushed a new tag dropping a couple of patches accordingly. Same name.
Peter Maydell
AppliedQuoted 13 lines · Michael S. Tsirkin
The following changes since commit
d4b78317b7cf8c0c635b70086503813f79ff21ec:Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200623' into staging (2020-06-23 18:57:05 +0100)
are available in the Git repository at:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.gittags/for_upstreamfor you to fetch changes up to
f6f746db6bae1ba74967fd7bea2bb5e169502948:tests:
disassemble-asm.sh: generate AML in readable format (2020-06-24 19:03:57 -0400)
Quoted 8 lines
----------------------------------------------------------------
virtio,acpi,pci: fixes, cleanups, tools.Fixes, cleanups in ACPI, PCI, virtio.
A handy script for testing ACPI.Signed-off-by Michael S. Tsirkin <[email protected]>
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/5.1
for any user-visible changes.
-- PMM