[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 27/60] exec/ioport: Add portio_list_set_enabled()
From: |
Michael S. Tsirkin |
Subject: |
[PULL 27/60] exec/ioport: Add portio_list_set_enabled() |
Date: |
Wed, 14 Feb 2024 06:14:40 -0500 |
From: Bernhard Beschow <shentey@gmail.com>
Some SuperI/O devices such as the VIA south bridges or the PC87312 controller
allow to enable or disable their SuperI/O functions. Add a convenience function
for implementing this in the VIA south bridges.
The naming of the functions is inspired by its memory_region_set_enabled()
pendant.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Message-Id: <20240114123911.4877-7-shentey@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
include/exec/ioport.h | 1 +
system/ioport.c | 9 +++++++++
docs/devel/migration/main.rst | 1 +
3 files changed, 11 insertions(+)
diff --git a/include/exec/ioport.h b/include/exec/ioport.h
index 96858e5ac3..4397f12f93 100644
--- a/include/exec/ioport.h
+++ b/include/exec/ioport.h
@@ -71,6 +71,7 @@ void portio_list_add(PortioList *piolist,
struct MemoryRegion *address_space,
uint32_t addr);
void portio_list_del(PortioList *piolist);
+void portio_list_set_enabled(PortioList *piolist, bool enabled);
void portio_list_set_address(PortioList *piolist, uint32_t addr);
#endif /* IOPORT_H */
diff --git a/system/ioport.c b/system/ioport.c
index 000e0ee1af..fd551d0375 100644
--- a/system/ioport.c
+++ b/system/ioport.c
@@ -324,6 +324,15 @@ void portio_list_del(PortioList *piolist)
}
}
+void portio_list_set_enabled(PortioList *piolist, bool enabled)
+{
+ unsigned i;
+
+ for (i = 0; i < piolist->nr; ++i) {
+ memory_region_set_enabled(piolist->regions[i], enabled);
+ }
+}
+
void portio_list_set_address(PortioList *piolist, uint32_t addr)
{
MemoryRegionPortioList *mrpio;
diff --git a/docs/devel/migration/main.rst b/docs/devel/migration/main.rst
index 9439adcf66..331252a92c 100644
--- a/docs/devel/migration/main.rst
+++ b/docs/devel/migration/main.rst
@@ -444,6 +444,7 @@ Examples of such API functions are:
- memory_region_set_address()
- memory_region_set_alias_offset()
- portio_list_set_address()
+ - portio_list_set_enabled()
Iterative device migration
--------------------------
--
MST
- [PULL 11/60] hw/virtio: derive vhost-user-input from vhost-user-base, (continued)
- [PULL 11/60] hw/virtio: derive vhost-user-input from vhost-user-base, Michael S. Tsirkin, 2024/02/14
- [PULL 17/60] amd_iommu: report x2APIC support to the operating system, Michael S. Tsirkin, 2024/02/14
- [PULL 18/60] test: bios-tables-test: add IVRS changed binary, Michael S. Tsirkin, 2024/02/14
- [PULL 19/60] hw/i386/x86: Reverse if statement, Michael S. Tsirkin, 2024/02/14
- [PULL 20/60] hw/i386/x86: Fix PIC interrupt handling if APIC is globally disabled, Michael S. Tsirkin, 2024/02/14
- [PULL 21/60] target/i386/cpu: Fix typo in comment, Michael S. Tsirkin, 2024/02/14
- [PULL 23/60] hw/block/fdc-sysbus: Move iomem from FDCtrl to FDCtrlSysBus, Michael S. Tsirkin, 2024/02/14
- [PULL 24/60] hw/char/parallel: Move portio_list from ParallelState to ISAParallelState, Michael S. Tsirkin, 2024/02/14
- [PULL 25/60] exec/ioport: Resolve redundant .base attribute in struct MemoryRegionPortio, Michael S. Tsirkin, 2024/02/14
- [PULL 26/60] exec/ioport: Add portio_list_set_address(), Michael S. Tsirkin, 2024/02/14
- [PULL 27/60] exec/ioport: Add portio_list_set_enabled(),
Michael S. Tsirkin <=
- [PULL 28/60] hw/block/fdc-isa: Implement relocation and enabling/disabling for TYPE_ISA_FDC, Michael S. Tsirkin, 2024/02/14
- [PULL 29/60] hw/char/serial-isa: Implement relocation and enabling/disabling for TYPE_ISA_SERIAL, Michael S. Tsirkin, 2024/02/14
- [PULL 30/60] hw/char/parallel-isa: Implement relocation and enabling/disabling for TYPE_ISA_PARALLEL, Michael S. Tsirkin, 2024/02/14
- [PULL 31/60] hw/ppc/pegasos2: Let pegasos2 machine configure SuperI/O functions, Michael S. Tsirkin, 2024/02/14
- [PULL 32/60] hw/isa/vt82c686: Implement relocation and toggling of SuperI/O functions, Michael S. Tsirkin, 2024/02/14
- [PULL 33/60] vhost-user.rst: Fix vring address description, Michael S. Tsirkin, 2024/02/14
- [PULL 35/60] virtio_iommu: Clear IOMMUPciBus pointer cache when system reset, Michael S. Tsirkin, 2024/02/14
- [PULL 36/60] smmu: Clear SMMUPciBus pointer cache when system reset, Michael S. Tsirkin, 2024/02/14
- [PULL 34/60] MAINTAINERS: Drop myself as VT-d maintainers, Michael S. Tsirkin, 2024/02/14
- [PULL 40/60] cxl/cdat: Fix header sum value in CDAT checksum, Michael S. Tsirkin, 2024/02/14