Skip to contentSkip to conversation

VFIO-Platform support for Qualcomm Technologies, Inc HiDMA

PATCH Superseded Shanker Donthineni 2 participants 6 messages Jan 29, 2016 – Feb 2, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover VFIO-Platform support for Qualcomm Technologies, Inc HiDMA

This patch series enables assigning Qualcomm Technolgies, Inc HiDMA platform device to guest virtual machines using the VFIO-Platform framework.

Since the existing Calxeda XGMAC function to create device-tree node is fairly generic, the first patch renames the function to allow reuse by other platform drivers like HiDMA driver.

Kernel patches for HiDMA driver, including VFIO-reset support are here:

    http://www.spinics.net/lists/arm-kernel/msg478402.html

Vikram Sethi (2):
hw/arm/sysbus-fdt: rename xgmac platform fdt node creation function hw/vfio/platform: Add Qualcomm Technologies, Inc HiDMA device support

 hw/arm/sysbus-fdt.c               |  6 +++--
 hw/vfio/Makefile.objs             |  1 +
 hw/vfio/qcom-hidma.c              | 57 +++++++++++++++++++++++++++++++++++++++
 include/hw/vfio/vfio-qcom-hidma.h | 49 +++++++++++++++++++++++++++++++++
 4 files changed, 111 insertions(+), 2 deletions(-)
 create mode 100644 hw/vfio/qcom-hidma.c
 create mode 100644 include/hw/vfio/vfio-qcom-hidma.h
Signature · 3 lines
Qualcomm Technologies, Inc. on behalf
of the Qualcomm Innovation Center, Inc.  The Qualcomm Innovation Center, Inc. 
is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
#1 lore raw

PATCH 1/2 hw/arm/sysbus-fdt: rename xgmac platform fdt node creation function

From: Vikram Sethi <[email protected]>

The function that creates a device tree node for the Calxeda XGMAC platform device is fairly generic and can be reused for other platform devices that require just reg, interrupts and dma-coherent properties. Rename add_calxeda_midway_xgmac_fdt_node to add_generic_platform_fdt_node to allow reuse.

---
 hw/arm/sysbus-fdt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/arm/sysbus-fdt.c +2 -2
index 9d28797..6ee7af2 100644
@@ -64,7 +64,7 @@ typedef struct NodeCreationPair {
  * Generates a simple node with following properties:
  * compatible string, regs, interrupts, dma-coherent
  */
-static int add_calxeda_midway_xgmac_fdt_node(SysBusDevice *sbdev, void *opaque)
+static int add_generic_platform_fdt_node(SysBusDevice *sbdev, void *opaque)
 {
     PlatformBusFDTData *data = opaque;
     PlatformBusDevice *pbus = data->pbus;
@@ -125,7 +125,7 @@ fail_reg:
 
 /* list of supported dynamic sysbus devices */
 static const NodeCreationPair add_fdt_node_functions[] = {
-    {TYPE_VFIO_CALXEDA_XGMAC, add_calxeda_midway_xgmac_fdt_node},
+    {TYPE_VFIO_CALXEDA_XGMAC, add_generic_platform_fdt_node},
     {"", NULL}, /* last element */
 };
 
Signature · 3 lines
Qualcomm Technologies, Inc. on behalf
of the Qualcomm Innovation Center, Inc.  The Qualcomm Innovation Center, Inc. 
is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
#2 lore raw

Re: [Qemu-devel] [PATCH 1/2] hw/arm/sysbus-fdt: rename xgmac platform fdt node creation function

Hi Vikram, Shanker,

Quoted 28 lines · Shanker Donthineni

From: Vikram Sethi <[email protected]>

The function that creates a device tree node for the Calxeda XGMAC platform device is fairly generic and can be reused for other platform devices that require just reg, interrupts and dma-coherent properties. Rename add_calxeda_midway_xgmac_fdt_node to add_generic_platform_fdt_node to allow reuse.

---
 hw/arm/sysbus-fdt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/arm/sysbus-fdt.c +1 -1
index 9d28797..6ee7af2 100644
@@ -64,7 +64,7 @@ typedef struct NodeCreationPair {
  * Generates a simple node with following properties:
  * compatible string, regs, interrupts, dma-coherent
  */
-static int add_calxeda_midway_xgmac_fdt_node(SysBusDevice *sbdev, void *opaque)
+static int add_generic_platform_fdt_node(SysBusDevice *sbdev, void *opaque)
 {
     PlatformBusFDTData *data = opaque;
     PlatformBusDevice *pbus = data->pbus;

hw/arm/sysbus-fdt.c fail_reg: · line 128

Quoted 5 lines
hw/arm/sysbus-fdt.c +1 -1
@@ -125,7 +125,7 @@ fail_reg:
 
 /* list of supported dynamic sysbus devices */
 static const NodeCreationPair add_fdt_node_functions[] = {
-    {TYPE_VFIO_CALXEDA_XGMAC, add_calxeda_midway_xgmac_fdt_node},
+    {TYPE_VFIO_CALXEDA_XGMAC, add_generic_platform_fdt_node},

Introducing such a "generic" node creation function was discussed in the past and Alex Graf (added in CC) warned against that. What is arguable is that interrupts are defined here as level sensitive and you have the dma-coherent property set. So where does genericity starts and where does it end? But Maybe Alex changed his mind ;-)

The type of IRQ can be retrieved generically by looking at intp->flags & VFIO_IRQ_INFO_AUTOMASKED as I did in add_amd_xgbe_fdt_node ([PATCH v6 7/8] hw/arm/sysbus-fdt: enable amd-xgbe dynamic instantiation)

The dma-coherent property can now be retrieved from host device-tree using the helpers introduced in the above series. However if you use ACPI on host there is no such helper yet.

Maybe another approach to factorize the code is to introduce a helper routine that adds the reg and interrupts properties to the node, using the above detection of IRQ type and you keep a differentiated function for HiDma, adding the dma-coherent capability.

Hope it helps

Best Regards

Eric

Quoted 4 lines
hw/arm/sysbus-fdt.c +0 -0
     {"", NULL}, /* last element */
 };
 
#3 lore raw

PATCH 2/2 hw/vfio/platform: Add Qualcomm Technologies, Inc HiDMA device support

In reply to Shanker Donthineni

From: Vikram Sethi <[email protected]>

This patch introduces a Qualcomm Technologies, Inc HiDMA device and allows the instantiation of the vfio-qcom-hidma device from the QEMU command line
(-device vfio-qcom-hidma,host="<device>").

A device tree node is created for the guest containing compat, dma-coherent, reg and interrupts properties.

---
 hw/arm/sysbus-fdt.c               |  2 ++
 hw/vfio/Makefile.objs             |  1 +
 hw/vfio/qcom-hidma.c              | 57 +++++++++++++++++++++++++++++++++++++++
 include/hw/vfio/vfio-qcom-hidma.h | 49 +++++++++++++++++++++++++++++++++
 4 files changed, 109 insertions(+)
 create mode 100644 hw/vfio/qcom-hidma.c
 create mode 100644 include/hw/vfio/vfio-qcom-hidma.h
hw/arm/sysbus-fdt.c +2 -0
index 6ee7af2..4a7419e 100644
@@ -28,6 +28,7 @@
 #include "sysemu/sysemu.h"
 #include "hw/vfio/vfio-platform.h"
 #include "hw/vfio/vfio-calxeda-xgmac.h"
+#include "hw/vfio/vfio-qcom-hidma.h"
 #include "hw/arm/fdt.h"
 
 /*
@@ -126,6 +127,7 @@ fail_reg:
 /* list of supported dynamic sysbus devices */
 static const NodeCreationPair add_fdt_node_functions[] = {
     {TYPE_VFIO_CALXEDA_XGMAC, add_generic_platform_fdt_node},
+    {TYPE_VFIO_QCOM_HIDMA, add_generic_platform_fdt_node},
     {"", NULL}, /* last element */
 };
 
hw/vfio/Makefile.objs +1 -0
index d324863..9bcb093 100644
@@ -3,4 +3,5 @@ obj-$(CONFIG_SOFTMMU) += common.o
 obj-$(CONFIG_PCI) += pci.o pci-quirks.o
 obj-$(CONFIG_SOFTMMU) += platform.o
 obj-$(CONFIG_SOFTMMU) += calxeda-xgmac.o
+obj-$(CONFIG_SOFTMMU) += qcom-hidma.o
 endif
hw/vfio/qcom-hidma.c new file +57 -0

57 lines not on this page · raw message

include/hw/vfio/vfio-qcom-hidma.h new file +49 -0

49 lines not on this page · raw message

Signature · 3 lines
Qualcomm Technologies, Inc. on behalf
of the Qualcomm Innovation Center, Inc.  The Qualcomm Innovation Center, Inc. 
is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
#4 lore raw

Re: [Qemu-devel] [PATCH 2/2] hw/vfio/platform: Add Qualcomm Technologies, Inc HiDMA device support

Hi Shanker, Vikram,

Quoted 88 lines · Shanker Donthineni

From: Vikram Sethi <[email protected]>

This patch introduces a Qualcomm Technologies, Inc HiDMA device and allows the instantiation of the vfio-qcom-hidma device from the QEMU command line
(-device vfio-qcom-hidma,host="<device>").

A device tree node is created for the guest containing compat, dma-coherent, reg and interrupts properties.

---
 hw/arm/sysbus-fdt.c               |  2 ++
 hw/vfio/Makefile.objs             |  1 +
 hw/vfio/qcom-hidma.c              | 57 +++++++++++++++++++++++++++++++++++++++
 include/hw/vfio/vfio-qcom-hidma.h | 49 +++++++++++++++++++++++++++++++++
 4 files changed, 109 insertions(+)
 create mode 100644 hw/vfio/qcom-hidma.c
 create mode 100644 include/hw/vfio/vfio-qcom-hidma.h
hw/arm/sysbus-fdt.c +2 -0
index 6ee7af2..4a7419e 100644
@@ -28,6 +28,7 @@
 #include "sysemu/sysemu.h"
 #include "hw/vfio/vfio-platform.h"
 #include "hw/vfio/vfio-calxeda-xgmac.h"
+#include "hw/vfio/vfio-qcom-hidma.h"
 #include "hw/arm/fdt.h"
 
 /*
@@ -126,6 +127,7 @@ fail_reg:
 /* list of supported dynamic sysbus devices */
 static const NodeCreationPair add_fdt_node_functions[] = {
     {TYPE_VFIO_CALXEDA_XGMAC, add_generic_platform_fdt_node},
+    {TYPE_VFIO_QCOM_HIDMA, add_generic_platform_fdt_node},
     {"", NULL}, /* last element */
 };
 
hw/vfio/Makefile.objs +1 -0
index d324863..9bcb093 100644
@@ -3,4 +3,5 @@ obj-$(CONFIG_SOFTMMU) += common.o
 obj-$(CONFIG_PCI) += pci.o pci-quirks.o
 obj-$(CONFIG_SOFTMMU) += platform.o
 obj-$(CONFIG_SOFTMMU) += calxeda-xgmac.o
+obj-$(CONFIG_SOFTMMU) += qcom-hidma.o
 endif
hw/vfio/qcom-hidma.c new file +31 -0
new file mode 100644
index 0000000..04acbd8
@@ -0,0 +1,57 @@
+/*
+ * Qualcomm Technologies, Inc VFIO HiDMA platform device
+ *
+ * Copyright (c) 2016, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include "hw/vfio/vfio-qcom-hidma.h"
+
+static void qcom_hidma_realize(DeviceState *dev, Error **errp)
+{
+    VFIOPlatformDevice *vdev = VFIO_PLATFORM_DEVICE(dev);
+    VFIOQcomHidmaDeviceClass *k = VFIO_QCOM_HIDMA_DEVICE_GET_CLASS(dev);
+
+    vdev->compat = g_strdup("qcom,hidma");
+
+    k->parent_realize(dev, errp);
+}
+
+static const VMStateDescription vfio_platform_vmstate = {
+    .name = TYPE_VFIO_QCOM_HIDMA,
+    .unmigratable = 1,

hw/vfio/qcom-hidma.c line 41

Quoted 10 lines
hw/vfio/qcom-hidma.c new file +10 -0
+};
+
+static void vfio_qcom_hidma_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+    VFIOQcomHidmaDeviceClass *vcxc = VFIO_QCOM_HIDMA_DEVICE_CLASS(klass);
+
+    vcxc->parent_realize = dc->realize;
+    dc->realize = qcom_hidma_realize;
+    dc->desc = "VFIO QCOM HIDMA";

If I am not wrong you miss the dc->vmsd = &vfio_platform_vmstate (VMStateDescription attachement)

This will cause an error with CLANG - I got that one already, reported by Peter ;-) -

error: unused variable
'vfio_platform_vmstate' [-Werror,-Wunused-const-variable] static const VMStateDescription vfio_platform_vmstate = {

Quoted 39 lines
hw/vfio/qcom-hidma.c new file +16 -0
+}
+
+static const TypeInfo vfio_qcom_hidma_dev_info = {
+    .name = TYPE_VFIO_QCOM_HIDMA,
+    .parent = TYPE_VFIO_PLATFORM,
+    .instance_size = sizeof(VFIOQcomHidmaDevice),
+    .class_init = vfio_qcom_hidma_class_init,
+    .class_size = sizeof(VFIOQcomHidmaDeviceClass),
+};
+
+static void register_qcom_hidma_dev_type(void)
+{
+    type_register_static(&vfio_qcom_hidma_dev_info);
+}
+
+type_init(register_qcom_hidma_dev_type)
include/hw/vfio/vfio-qcom-hidma.h new file +17 -0
new file mode 100644
index 0000000..a7cc8e6
@@ -0,0 +1,49 @@
+/*
+ * Qualcomm Technologies, Inc VFIO HiDMA platform device
+ *
+ * Copyright (c) 2016, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef HW_VFIO_VFIO_QCOM_HIDMA_H

include/hw/vfio/vfio-qcom-hidma.h line 27

Quoted 10 lines
include/hw/vfio/vfio-qcom-hidma.h new file +10 -0
+#define HW_VFIO_VFIO_QCOM_HIDMA_H
+
+#include "hw/vfio/vfio-platform.h"
+
+#define TYPE_VFIO_QCOM_HIDMA "vfio-qcom-hidma"
+
+/**
+ * This device exposes:
+ * - two MMIO regions corresponding to its register space
+ * - 1 IRQ

level sensitive?

Best Regards

Eric

Quoted 23 lines
include/hw/vfio/vfio-qcom-hidma.h new file +22 -0
+ */
+typedef struct VFIOQcomHidmaDevice {
+    VFIOPlatformDevice vdev;
+} VFIOQcomHidmaDevice;
+
+typedef struct VFIOQcomHidmaDeviceClass {
+    /*< private >*/
+    VFIOPlatformDeviceClass parent_class;
+    /*< public >*/
+    DeviceRealize parent_realize;
+} VFIOQcomHidmaDeviceClass;
+
+#define VFIO_QCOM_HIDMA_DEVICE(obj) \
+     OBJECT_CHECK(VFIOQcomHidmaDevice, (obj), TYPE_VFIO_QCOM_HIDMA)
+#define VFIO_QCOM_HIDMA_DEVICE_CLASS(klass) \
+     OBJECT_CLASS_CHECK(VFIOQcomHidmaDeviceClass, (klass), \
+                        TYPE_VFIO_QCOM_HIDMA)
+#define VFIO_QCOM_HIDMA_DEVICE_GET_CLASS(obj) \
+     OBJECT_GET_CLASS(VFIOQcomHidmaDeviceClass, (obj), \
+                      TYPE_VFIO_QCOM_HIDMA)
+
+#endif
#5 lore raw

Re: [Qemu-devel] [PATCH 2/2] hw/vfio/platform: Add Qualcomm Technologies, Inc HiDMA device support

Hi Eric,

Quoted 103 lines · Eric Auger

Hi Shanker, Vikram,

Quoted 88 lines · Shanker Donthineni

From: Vikram Sethi <[email protected]>

This patch introduces a Qualcomm Technologies, Inc HiDMA device and allows the instantiation of the vfio-qcom-hidma device from the QEMU command line
(-device vfio-qcom-hidma,host="<device>").

A device tree node is created for the guest containing compat, dma-coherent, reg and interrupts properties.

---
  hw/arm/sysbus-fdt.c               |  2 ++
  hw/vfio/Makefile.objs             |  1 +
  hw/vfio/qcom-hidma.c              | 57 +++++++++++++++++++++++++++++++++++++++
  include/hw/vfio/vfio-qcom-hidma.h | 49 +++++++++++++++++++++++++++++++++
  4 files changed, 109 insertions(+)

create mode 100644 hw/vfio/qcom-hidma.c create mode 100644 include/hw/vfio/vfio-qcom-hidma.h

hw/arm/sysbus-fdt.c +2 -0
index 6ee7af2..4a7419e 100644
@@ -28,6 +28,7 @@
  #include "sysemu/sysemu.h"
  #include "hw/vfio/vfio-platform.h"
  #include "hw/vfio/vfio-calxeda-xgmac.h"
+#include "hw/vfio/vfio-qcom-hidma.h"
  #include "hw/arm/fdt.h"
 
  /*
@@ -126,6 +127,7 @@ fail_reg:
  /* list of supported dynamic sysbus devices */
  static const NodeCreationPair add_fdt_node_functions[] = {
      {TYPE_VFIO_CALXEDA_XGMAC, add_generic_platform_fdt_node},
+    {TYPE_VFIO_QCOM_HIDMA, add_generic_platform_fdt_node},
      {"", NULL}, /* last element */
  };
 
hw/vfio/Makefile.objs +1 -0
index d324863..9bcb093 100644
@@ -3,4 +3,5 @@ obj-$(CONFIG_SOFTMMU) += common.o
  obj-$(CONFIG_PCI) += pci.o pci-quirks.o
  obj-$(CONFIG_SOFTMMU) += platform.o
  obj-$(CONFIG_SOFTMMU) += calxeda-xgmac.o
+obj-$(CONFIG_SOFTMMU) += qcom-hidma.o
  endif
hw/vfio/qcom-hidma.c new file +31 -0
new file mode 100644
index 0000000..04acbd8
@@ -0,0 +1,57 @@
+/*
+ * Qualcomm Technologies, Inc VFIO HiDMA platform device
+ *
+ * Copyright (c) 2016, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include "hw/vfio/vfio-qcom-hidma.h"
+
+static void qcom_hidma_realize(DeviceState *dev, Error **errp)
+{
+    VFIOPlatformDevice *vdev = VFIO_PLATFORM_DEVICE(dev);
+    VFIOQcomHidmaDeviceClass *k = VFIO_QCOM_HIDMA_DEVICE_GET_CLASS(dev);
+
+    vdev->compat = g_strdup("qcom,hidma");
+
+    k->parent_realize(dev, errp);
+}
+
+static const VMStateDescription vfio_platform_vmstate = {
+    .name = TYPE_VFIO_QCOM_HIDMA,
+    .unmigratable = 1,

hw/vfio/qcom-hidma.c line 41

Quoted 10 lines
hw/vfio/qcom-hidma.c new file +10 -0
+};
+
+static void vfio_qcom_hidma_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+    VFIOQcomHidmaDeviceClass *vcxc = VFIO_QCOM_HIDMA_DEVICE_CLASS(klass);
+
+    vcxc->parent_realize = dc->realize;
+    dc->realize = qcom_hidma_realize;
+    dc->desc = "VFIO QCOM HIDMA";

If I am not wrong you miss the dc->vmsd = &vfio_platform_vmstate (VMStateDescription attachement)

Quoted 6 lines

This will cause an error with CLANG - I got that one already, reported by Peter ;-) -

error: unused variable
'vfio_platform_vmstate' [-Werror,-Wunused-const-variable] static const VMStateDescription vfio_platform_vmstate = {

Thanks for your finding, I will fix.

Quoted 42 lines
Quoted 42 lines
hw/vfio/qcom-hidma.c new file +16 -0
+}
+
+static const TypeInfo vfio_qcom_hidma_dev_info = {
+    .name = TYPE_VFIO_QCOM_HIDMA,
+    .parent = TYPE_VFIO_PLATFORM,
+    .instance_size = sizeof(VFIOQcomHidmaDevice),
+    .class_init = vfio_qcom_hidma_class_init,
+    .class_size = sizeof(VFIOQcomHidmaDeviceClass),
+};
+
+static void register_qcom_hidma_dev_type(void)
+{
+    type_register_static(&vfio_qcom_hidma_dev_info);
+}
+
+type_init(register_qcom_hidma_dev_type)
include/hw/vfio/vfio-qcom-hidma.h new file +20 -0
new file mode 100644
index 0000000..a7cc8e6
@@ -0,0 +1,49 @@
+/*
+ * Qualcomm Technologies, Inc VFIO HiDMA platform device
+ *
+ * Copyright (c) 2016, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef HW_VFIO_VFIO_QCOM_HIDMA_H
+#define HW_VFIO_VFIO_QCOM_HIDMA_H
+
+#include "hw/vfio/vfio-platform.h"
Quoted 8 lines

include/hw/vfio/vfio-qcom-hidma.h line 27

Quoted 7 lines
include/hw/vfio/vfio-qcom-hidma.h new file +7 -0
+
+#define TYPE_VFIO_QCOM_HIDMA "vfio-qcom-hidma"
+
+/**
+ * This device exposes:
+ * - two MMIO regions corresponding to its register space
+ * - 1 IRQ

level sensitive?

Yes, the current HiDMA driver that we are attempting to upstream uses level sensitive interrupts.

Quoted 27 lines

Best Regards

Eric

Quoted 23 lines
include/hw/vfio/vfio-qcom-hidma.h new file +22 -0
+ */
+typedef struct VFIOQcomHidmaDevice {
+    VFIOPlatformDevice vdev;
+} VFIOQcomHidmaDevice;
+
+typedef struct VFIOQcomHidmaDeviceClass {
+    /*< private >*/
+    VFIOPlatformDeviceClass parent_class;
+    /*< public >*/
+    DeviceRealize parent_realize;
+} VFIOQcomHidmaDeviceClass;
+
+#define VFIO_QCOM_HIDMA_DEVICE(obj) \
+     OBJECT_CHECK(VFIOQcomHidmaDevice, (obj), TYPE_VFIO_QCOM_HIDMA)
+#define VFIO_QCOM_HIDMA_DEVICE_CLASS(klass) \
+     OBJECT_CLASS_CHECK(VFIOQcomHidmaDeviceClass, (klass), \
+                        TYPE_VFIO_QCOM_HIDMA)
+#define VFIO_QCOM_HIDMA_DEVICE_GET_CLASS(obj) \
+     OBJECT_GET_CLASS(VFIOQcomHidmaDeviceClass, (obj), \
+                      TYPE_VFIO_QCOM_HIDMA)
+
+#endif