qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 02/10] spapr_iommu: Disable in-kernel IOMMU


From: David Gibson
Subject: Re: [Qemu-devel] [RFC PATCH 02/10] spapr_iommu: Disable in-kernel IOMMU tables for >4GB windows
Date: Tue, 12 Aug 2014 11:17:24 +1000
User-agent: Mutt/1.5.23 (2014-03-12)

On Thu, Jul 31, 2014 at 07:34:06PM +1000, Alexey Kardashevskiy wrote:
> The existing KVM_CREATE_SPAPR_TCE ioctl only support 4G windows max.
> We are going to add huge DMA windows support so this will create small
> window and unexpectedly fail later.

I'm not entirely clear on what you're saying here.  Are you saying
that the kernel interface silently truncates a window > 4G, rather
than failing?

If so, that's a kernel bug which should be addressed - obviously we'd
still need this as a workaround for older kernels, but it should be
treated as a workaround, not as the real fix.

> This disables KVM_CREATE_SPAPR_TCE for windows bigger that 4GB. Since
> those windows are normally mapped at the boot time, there will be no
> performance impact.
> 
> Signed-off-by: Alexey Kardashevskiy <address@hidden>
> ---
>  hw/ppc/spapr_iommu.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c
> index f6e32a4..36f5d27 100644
> --- a/hw/ppc/spapr_iommu.c
> +++ b/hw/ppc/spapr_iommu.c
> @@ -113,11 +113,11 @@ static MemoryRegionIOMMUOps spapr_iommu_ops = {
>  static int spapr_tce_table_realize(DeviceState *dev)
>  {
>      sPAPRTCETable *tcet = SPAPR_TCE_TABLE(dev);
> +    uint64_t window_size = tcet->nb_table << tcet->page_shift;
>  
> -    if (kvm_enabled()) {
> +    if (kvm_enabled() && !(window_size >> 32)) {
>          tcet->table = kvmppc_create_spapr_tce(tcet->liobn,
> -                                              tcet->nb_table <<
> -                                              tcet->page_shift,
> +                                              window_size,
>                                                &tcet->fd,
>                                                tcet->vfio_accel);
>      }

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: pgpYI64_Ne135.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]