• D
    pseries: Use Book3S-HV TCE acceleration capabilities · 0f5cb298
    David Gibson 提交于
    The pseries machine of qemu implements the TCE mechanism used as a
    virtual IOMMU for the PAPR defined virtual IO devices.  Because the
    PAPR spec only defines a small DMA address space, the guest VIO
    drivers need to update TCE mappings very frequently - the virtual
    network device is particularly bad.  This means many slow exits to
    qemu to emulate the H_PUT_TCE hypercall.
    
    Sufficiently recent kernels allow this to be mitigated by implementing
    H_PUT_TCE in the host kernel.  To make use of this, however, qemu
    needs to initialize the necessary TCE tables, and map them into itself
    so that the VIO device implementations can retrieve the mappings when
    they access guest memory (which is treated as a virtual DMA
    operation).
    
    This patch adds the necessary calls to use the KVM TCE acceleration.
    If the kernel does not support acceleration, or there is some other
    error creating the accelerated TCE table, then it will still fall back
    to full userspace TCE implementation.
    Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
    Signed-off-by: NAlexander Graf <agraf@suse.de>
    0f5cb298
spapr_vio.c 18.8 KB