aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/spapr_vio.c8
-rw-r--r--hw/spapr_vio.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/hw/spapr_vio.c b/hw/spapr_vio.c
index 35818e18f1..1da3032215 100644
--- a/hw/spapr_vio.c
+++ b/hw/spapr_vio.c
@@ -165,7 +165,13 @@ static void rtce_init(VIOsPAPRDevice *dev)
* sizeof(VIOsPAPR_RTCE);
if (size) {
- dev->rtce_table = g_malloc0(size);
+ dev->rtce_table = kvmppc_create_spapr_tce(dev->reg,
+ dev->rtce_window_size,
+ &dev->kvmtce_fd);
+
+ if (!dev->rtce_table) {
+ dev->rtce_table = g_malloc0(size);
+ }
}
}
diff --git a/hw/spapr_vio.h b/hw/spapr_vio.h
index 4fe5f742c2..a325a5f4b3 100644
--- a/hw/spapr_vio.h
+++ b/hw/spapr_vio.h
@@ -57,6 +57,7 @@ typedef struct VIOsPAPRDevice {
target_ulong signal_state;
uint32_t rtce_window_size;
VIOsPAPR_RTCE *rtce_table;
+ int kvmtce_fd;
VIOsPAPR_CRQ crq;
} VIOsPAPRDevice;