[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [qemu-s390x] [PATCH v2 1/6] s390x/vfio: ap: Finding the AP bridge
From: |
Cornelia Huck |
Subject: |
Re: [qemu-s390x] [PATCH v2 1/6] s390x/vfio: ap: Finding the AP bridge |
Date: |
Thu, 29 Nov 2018 12:41:25 +0100 |
On Thu, 22 Nov 2018 17:35:50 +0100
Pierre Morel <address@hidden> wrote:
> In the case we will enter QEMU through interception of instructions,
> we will need to retrieve the AP devices.
> The base device is the AP bridge.
>
> Let us implement a way to retrieve the AP Bridge from qtree.
>
> Signed-off-by: Pierre Morel <address@hidden>
> ---
> hw/s390x/ap-bridge.c | 12 ++++++++++++
> include/hw/s390x/ap-bridge.h | 1 +
> 2 files changed, 13 insertions(+)
>
> diff --git a/hw/s390x/ap-bridge.c b/hw/s390x/ap-bridge.c
> index 3795d30..831ad5d 100644
> --- a/hw/s390x/ap-bridge.c
> +++ b/hw/s390x/ap-bridge.c
> @@ -14,6 +14,18 @@
> #include "hw/s390x/ap-bridge.h"
> #include "cpu.h"
>
> +DeviceState *s390_get_ap_bridge(void)
> +{
> + static DeviceState *apb;
> +
> + if (!apb) {
> + apb = DEVICE(object_resolve_path(TYPE_AP_BRIDGE, NULL));
> + assert(apb != NULL);
As you won't have an ap bridge if the ap feature is not provided,
better do a quick exit if the feature bit is not set? I'd naively
assume that this function can return NULL as well.
> + }
> +
> + return apb;
> +}
> +
> static char *ap_bus_get_dev_path(DeviceState *dev)
> {
> /* at most one */
- Re: [qemu-s390x] [PATCH v2 2/6] s390x/vfio: ap: Use the APdevice as a child of the APBus, (continued)
Re: [qemu-s390x] [PATCH v2 2/6] s390x/vfio: ap: Use the APdevice as a child of the APBus, Tony Krowiak, 2018/11/29
[qemu-s390x] [PATCH v2 1/6] s390x/vfio: ap: Finding the AP bridge, Pierre Morel, 2018/11/22
[qemu-s390x] [PATCH v2 3/6] s390x/vfio: ap: Linux uapi VFIO place holder, Pierre Morel, 2018/11/22
[qemu-s390x] [PATCH v2 5/6] s390x/vfio: ap: Definition for AP Adapter type, Pierre Morel, 2018/11/22
[qemu-s390x] [PATCH v2 6/6] s390x/vfio: ap: Implementing AP Queue Interrupt Control, Pierre Morel, 2018/11/22
Re: [qemu-s390x] [Qemu-devel] [PATCH v2 0/6] s390x/vfio: VFIO-AP interrupt control interception, Halil Pasic, 2018/11/29