summaryrefslogtreecommitdiffstats
path: root/hw/virtio/virtio-pci.c
diff options
context:
space:
mode:
authorPeter Maydell2021-02-18 14:27:03 +0100
committerPeter Maydell2021-02-18 14:27:03 +0100
commit91416a4254015e1e3f602f2b241b9ddb7879c10b (patch)
tree928b2ee36460116a33446935931e866260b98dff /hw/virtio/virtio-pci.c
parentMerge remote-tracking branch 'remotes/dgilbert-gitlab/tags/pull-virtiofs-2021... (diff)
parenttests/acceptance: add a memory callback check (diff)
downloadqemu-91416a4254015e1e3f602f2b241b9ddb7879c10b.tar.gz
qemu-91416a4254015e1e3f602f2b241b9ddb7879c10b.tar.xz
qemu-91416a4254015e1e3f602f2b241b9ddb7879c10b.zip
Merge remote-tracking branch 'remotes/stsquad/tags/pull-plugin-updates-180221-1' into staging
Plugin updates: - expose vdev name in PCI memory registration - new hwprofile plugin - bunch of style cleanups to contrib/plugins - fix call signature of inline instrumentation - re-factor the io_recompile code to push specialisation into hooks - add some acceptance tests for the plugins - clean-up and remove CF_NOCACHE handling from TCG - fix instrumentation of cpu_io_recompile sections - expand tests to check inline and cb count the same # gpg: Signature made Thu 18 Feb 2021 08:24:57 GMT # gpg: using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44 # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full] # Primary key fingerprint: 6685 AE99 E751 67BC AFC8 DF35 FBD0 DB09 5A9E 2A44 * remotes/stsquad/tags/pull-plugin-updates-180221-1: (23 commits) tests/acceptance: add a memory callback check tests/plugin: allow memory plugin to do both inline and callbacks tests/acceptance: add a new tests to detect counting errors accel/tcg: allow plugin instrumentation to be disable via cflags accel/tcg: remove CF_NOCACHE and special cases accel/tcg: re-factor non-RAM execution code accel/tcg: cache single instruction TB on pending replay exception accel/tcg: actually cache our partial icount TB tests/acceptance: add a new set of tests to exercise plugins tests/plugin: expand insn test to detect duplicate instructions target/sh4: Create superh_io_recompile_replay_branch target/mips: Create mips_io_recompile_replay_branch accel/tcg: Create io_recompile_replay_branch hook exec: Move TranslationBlock typedef to qemu/typedefs.h accel/tcg/plugin-gen: fix the call signature for inline callbacks contrib: Open brace '{' following struct go on the same line contrib: space required after that ',' contrib: Add spaces around operator contrib: Fix some code style problems, ERROR: "foo * bar" should be "foo *bar" contrib: Don't use '#' flag of printf format ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/virtio/virtio-pci.c')
-rw-r--r--hw/virtio/virtio-pci.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 094c36aa3e..883045a223 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1423,7 +1423,8 @@ static void virtio_pci_device_write(void *opaque, hwaddr addr,
}
}
-static void virtio_pci_modern_regions_init(VirtIOPCIProxy *proxy)
+static void virtio_pci_modern_regions_init(VirtIOPCIProxy *proxy,
+ const char *vdev_name)
{
static const MemoryRegionOps common_ops = {
.read = virtio_pci_common_read,
@@ -1470,36 +1471,41 @@ static void virtio_pci_modern_regions_init(VirtIOPCIProxy *proxy)
},
.endianness = DEVICE_LITTLE_ENDIAN,
};
+ g_autoptr(GString) name = g_string_new(NULL);
-
+ g_string_printf(name, "virtio-pci-common-%s", vdev_name);
memory_region_init_io(&proxy->common.mr, OBJECT(proxy),
&common_ops,
proxy,
- "virtio-pci-common",
+ name->str,
proxy->common.size);
+ g_string_printf(name, "virtio-pci-isr-%s", vdev_name);
memory_region_init_io(&proxy->isr.mr, OBJECT(proxy),
&isr_ops,
proxy,
- "virtio-pci-isr",
+ name->str,
proxy->isr.size);
+ g_string_printf(name, "virtio-pci-device-%s", vdev_name);
memory_region_init_io(&proxy->device.mr, OBJECT(proxy),
&device_ops,
proxy,
- "virtio-pci-device",
+ name->str,
proxy->device.size);
+ g_string_printf(name, "virtio-pci-notify-%s", vdev_name);
memory_region_init_io(&proxy->notify.mr, OBJECT(proxy),
&notify_ops,
proxy,
- "virtio-pci-notify",
+ name->str,
proxy->notify.size);
+ g_string_printf(name, "virtio-pci-notify-pio-%s", vdev_name);
memory_region_init_io(&proxy->notify_pio.mr, OBJECT(proxy),
&notify_pio_ops,
proxy,
- "virtio-pci-notify-pio",
+ name->str,
proxy->notify_pio.size);
}
@@ -1654,7 +1660,7 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp)
struct virtio_pci_cfg_cap *cfg_mask;
- virtio_pci_modern_regions_init(proxy);
+ virtio_pci_modern_regions_init(proxy, vdev->name);
virtio_pci_modern_mem_region_map(proxy, &proxy->common, &cap);
virtio_pci_modern_mem_region_map(proxy, &proxy->isr, &cap);