hw/ppc/spapr: Implement the h_page_init hypercall

Enterprise / Virtualization / QEMU - Thomas Huth [redhat.com] - 24 February 2016 20:58 UTC

This hypercall either initializes a page with zeros, or copies another page. According to LoPAPR, the i-cache of the page should also be flushed if using H_ICACHE_INVALIDATE or H_ICACHE_SYNCHRONIZE, and the d-cache should be synchronized to the RAM if the H_ICACHE_SYNCHRONIZE flag is used. For this, two new functions are introduced, kvmppc_dcbst_range() and kvmppc_icbi()_range, which use the corresponding assembler instructions to flush the caches if running with KVM on Power. If the code runs with TCG instead, the code only uses tb_flush(), assuming that this will be enough for synchronization.

3240dd9 hw/ppc/spapr: Implement the h_page_init hypercall
hw/ppc/spapr_hcall.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++
target-ppc/kvm_ppc.h | 36 ++++++++++++++++++++++++++++--
2 files changed, 94 insertions(+), 2 deletions(-)

Upstream: git.qemu.org


  • Share