mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
tests/qtest/libqos/pci: Introduce pio_limit
At the moment the IO space limit is hardcoded to QPCI_PIO_LIMIT = 0x10000. When accesses are performed to a bar, the base address of this latter is compared against the limit to decide whether we perform an IO or a memory access. On ARM, we cannot keep this PIO limit as the arm-virt machine uses [0x3eff0000, 0x3f000000 ] for the IO space map and we are mandated to allocate at 0x0. Add a new flag in QPCIBar indicating whether it is an IO bar or a memory bar. This flag is set on QPCIBar allocation and provisionned based on the BAR configuration. Then the new flag is used in access functions and in iomap() function. Signed-off-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20220504152025.1785704-2-eric.auger@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
76acef2b73
commit
3df72d1c55
4 changed files with 54 additions and 31 deletions
|
@ -16,8 +16,6 @@
|
|||
#include "../libqtest.h"
|
||||
#include "qgraph.h"
|
||||
|
||||
#define QPCI_PIO_LIMIT 0x10000
|
||||
|
||||
#define QPCI_DEVFN(dev, fn) (((dev) << 3) | (fn))
|
||||
|
||||
typedef struct QPCIDevice QPCIDevice;
|
||||
|
@ -51,7 +49,7 @@ struct QPCIBus {
|
|||
uint8_t offset, uint32_t value);
|
||||
|
||||
QTestState *qts;
|
||||
uint16_t pio_alloc_ptr;
|
||||
uint64_t pio_alloc_ptr, pio_limit;
|
||||
uint64_t mmio_alloc_ptr, mmio_limit;
|
||||
bool has_buggy_msi; /* TRUE for spapr, FALSE for pci */
|
||||
|
||||
|
@ -59,6 +57,7 @@ struct QPCIBus {
|
|||
|
||||
struct QPCIBar {
|
||||
uint64_t addr;
|
||||
bool is_io;
|
||||
};
|
||||
|
||||
struct QPCIDevice
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue