[PATCH 12/19] KVM: PPC: Book3S HV: record guest queue page address
Cédric Le Goater
clg at kaod.org
Tue Jan 8 05:43:24 AEDT 2019
The guest physical address of the event queue will be part of the
state to transfer in the migration. Cache its value when the queue is
configured, it will save us an OPAL call.
Signed-off-by: Cédric Le Goater <clg at kaod.org>
---
arch/powerpc/include/asm/xive.h | 2 ++
arch/powerpc/kvm/book3s_xive_native.c | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/arch/powerpc/include/asm/xive.h b/arch/powerpc/include/asm/xive.h
index 7a7aa22d8258..e90c3c5d9533 100644
--- a/arch/powerpc/include/asm/xive.h
+++ b/arch/powerpc/include/asm/xive.h
@@ -74,6 +74,8 @@ struct xive_q {
u32 esc_irq;
atomic_t count;
atomic_t pending_count;
+ u64 guest_qpage;
+ u32 guest_qsize;
};
/* Global enable flags for the XIVE support */
diff --git a/arch/powerpc/kvm/book3s_xive_native.c b/arch/powerpc/kvm/book3s_xive_native.c
index 35d806740c3a..4ca75aade069 100644
--- a/arch/powerpc/kvm/book3s_xive_native.c
+++ b/arch/powerpc/kvm/book3s_xive_native.c
@@ -708,6 +708,10 @@ static int kvmppc_h_int_set_queue_config(struct kvm_vcpu *vcpu,
}
qaddr = page_to_virt(page) + (qpage & ~PAGE_MASK);
+ /* Backup queue page address and size for migration */
+ q->guest_qpage = qpage;
+ q->guest_qsize = qsize;
+
rc = xive_native_configure_queue(xc->vp_id, q, priority,
(__be32 *) qaddr, qsize, true);
if (rc) {
--
2.20.1
More information about the Linuxppc-dev
mailing list