11 Jan, 2012

1 commit

  • * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (53 commits)
    iommu/amd: Set IOTLB invalidation timeout
    iommu/amd: Init stats for iommu=pt
    iommu/amd: Remove unnecessary cache flushes in amd_iommu_resume
    iommu/amd: Add invalidate-context call-back
    iommu/amd: Add amd_iommu_device_info() function
    iommu/amd: Adapt IOMMU driver to PCI register name changes
    iommu/amd: Add invalid_ppr callback
    iommu/amd: Implement notifiers for IOMMUv2
    iommu/amd: Implement IO page-fault handler
    iommu/amd: Add routines to bind/unbind a pasid
    iommu/amd: Implement device aquisition code for IOMMUv2
    iommu/amd: Add driver stub for AMD IOMMUv2 support
    iommu/amd: Add stat counter for IOMMUv2 events
    iommu/amd: Add device errata handling
    iommu/amd: Add function to get IOMMUv2 domain for pdev
    iommu/amd: Implement function to send PPR completions
    iommu/amd: Implement functions to manage GCR3 table
    iommu/amd: Implement IOMMUv2 TLB flushing routines
    iommu/amd: Add support for IOMMUv2 domain mode
    iommu/amd: Add amd_iommu_domain_direct_map function
    ...

    Linus Torvalds
     

27 Dec, 2011

1 commit


10 Nov, 2011

1 commit

  • When mapping a memory region, split it to page sizes as supported
    by the iommu hardware. Always prefer bigger pages, when possible,
    in order to reduce the TLB pressure.

    The logic to do that is now added to the IOMMU core, so neither the iommu
    drivers themselves nor users of the IOMMU API have to duplicate it.

    This allows a more lenient granularity of mappings; traditionally the
    IOMMU API took 'order' (of a page) as a mapping size, and directly let
    the low level iommu drivers handle the mapping, but now that the IOMMU
    core can split arbitrary memory regions into pages, we can remove this
    limitation, so users don't have to split those regions by themselves.

    Currently the supported page sizes are advertised once and they then
    remain static. That works well for OMAP and MSM but it would probably
    not fly well with intel's hardware, where the page size capabilities
    seem to have the potential to be different between several DMA
    remapping devices.

    register_iommu() currently sets a default pgsize behavior, so we can convert
    the IOMMU drivers in subsequent patches. After all the drivers
    are converted, the temporary default settings will be removed.

    Mainline users of the IOMMU API (kvm and omap-iovmm) are adopted
    to deal with bytes instead of page order.

    Many thanks to Joerg Roedel for significant review!

    Signed-off-by: Ohad Ben-Cohen
    Cc: David Brown
    Cc: David Woodhouse
    Cc: Joerg Roedel
    Cc: Stepan Moskovchenko
    Cc: KyongHo Cho
    Cc: Hiroshi DOYU
    Cc: Laurent Pinchart
    Cc: kvm@vger.kernel.org
    Signed-off-by: Joerg Roedel

    Ohad Ben-Cohen
     

01 Nov, 2011

2 commits

  • This file has things like module_param_named() and MODULE_PARM_DESC()
    so it needs the full module.h header present. Without it, you'll get:

    CC arch/x86/kvm/../../../virt/kvm/iommu.o
    virt/kvm/iommu.c:37: error: expected ‘)’ before ‘bool’
    virt/kvm/iommu.c:39: error: expected ‘)’ before string constant
    make[3]: *** [arch/x86/kvm/../../../virt/kvm/iommu.o] Error 1
    make[2]: *** [arch/x86/kvm] Error 2

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     
  • This was coming in via an implicit module.h (and its sub-includes)
    before, but we'll be cleaning that up shortly. Call out the stat.h
    include requirement in advance.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

31 Oct, 2011

1 commit

  • * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (33 commits)
    iommu/core: Remove global iommu_ops and register_iommu
    iommu/msm: Use bus_set_iommu instead of register_iommu
    iommu/omap: Use bus_set_iommu instead of register_iommu
    iommu/vt-d: Use bus_set_iommu instead of register_iommu
    iommu/amd: Use bus_set_iommu instead of register_iommu
    iommu/core: Use bus->iommu_ops in the iommu-api
    iommu/core: Convert iommu_found to iommu_present
    iommu/core: Add bus_type parameter to iommu_domain_alloc
    Driver core: Add iommu_ops to bus_type
    iommu/core: Define iommu_ops and register_iommu only with CONFIG_IOMMU_API
    iommu/amd: Fix wrong shift direction
    iommu/omap: always provide iommu debug code
    iommu/core: let drivers know if an iommu fault handler isn't installed
    iommu/core: export iommu_set_fault_handler()
    iommu/omap: Fix build error with !IOMMU_SUPPORT
    iommu/omap: Migrate to the generic fault report mechanism
    iommu/core: Add fault reporting mechanism
    iommu/core: Use PAGE_SIZE instead of hard-coded value
    iommu/core: use the existing IS_ALIGNED macro
    iommu/msm: ->unmap() should return order of unmapped page
    ...

    Fixup trivial conflicts in drivers/iommu/Makefile: "move omap iommu to
    dedicated iommu folder" vs "Rename the DMAR and INTR_REMAP config
    options" just happened to touch lines next to each other.

    Linus Torvalds
     

21 Oct, 2011

2 commits


24 Sep, 2011

1 commit

  • Device drivers that create and destroy SR-IOV virtual functions via
    calls to pci_enable_sriov() and pci_disable_sriov can cause catastrophic
    failures if they attempt to destroy VFs while they are assigned to
    guest virtual machines. By adding a flag for use by the KVM module
    to indicate that a device is assigned a device driver can check that
    flag and avoid destroying VFs while they are assigned and avoid system
    failures.

    CC: Ian Campbell
    CC: Konrad Wilk
    Signed-off-by: Greg Rose
    Acked-by: Jesse Barnes
    Signed-off-by: Jeff Kirsher

    Greg Rose
     

24 Jul, 2011

1 commit

  • IOMMU interrupt remapping support provides a further layer of
    isolation for device assignment by preventing arbitrary interrupt
    block DMA writes by a malicious guest from reaching the host. By
    default, we should require that the platform provides interrupt
    remapping support, with an opt-in mechanism for existing behavior.

    Both AMD IOMMU and Intel VT-d2 hardware support interrupt
    remapping, however we currently only have software support on
    the Intel side. Users wishing to re-enable device assignment
    when interrupt remapping is not supported on the platform can
    use the "allow_unsafe_assigned_interrupts=1" module option.

    [avi: break long lines]

    Signed-off-by: Alex Williamson
    Signed-off-by: Marcelo Tosatti
    Signed-off-by: Avi Kivity

    Alex Williamson
     

02 Aug, 2010

1 commit

  • For 32bit machines where the physical address width is
    larger than the virtual address width the frame number types
    in KVM may overflow. Fix this by changing them to u64.

    [sfr: fix build on 32-bit ppc]

    Signed-off-by: Joerg Roedel
    Signed-off-by: Stephen Rothwell
    Signed-off-by: Marcelo Tosatti

    Joerg Roedel
     

01 Aug, 2010

2 commits

  • This patch fixes the following warning.

    ===================================================
    [ INFO: suspicious rcu_dereference_check() usage. ]
    ---------------------------------------------------
    include/linux/kvm_host.h:259 invoked rcu_dereference_check() without
    protection!

    other info that might help us debug this:

    rcu_scheduler_active = 1, debug_locks = 0
    no locks held by qemu-system-x86/29679.

    stack backtrace:
    Pid: 29679, comm: qemu-system-x86 Not tainted 2.6.35-rc3+ #200
    Call Trace:
    [] lockdep_rcu_dereference+0xa8/0xb1
    [] kvm_iommu_unmap_memslots+0xc9/0xde [kvm]
    [] kvm_iommu_unmap_guest+0x40/0x4e [kvm]
    [] kvm_arch_destroy_vm+0x1a/0x186 [kvm]
    [] kvm_put_kvm+0x110/0x167 [kvm]
    [] kvm_vcpu_release+0x18/0x1c [kvm]
    [] fput+0x22a/0x3a0
    [] filp_close+0xb4/0xcd
    [] put_files_struct+0x1b7/0x36b
    [] ? put_files_struct+0x48/0x36b
    [] ? do_raw_spin_unlock+0x118/0x160
    [] exit_files+0x6d/0x75
    [] do_exit+0x47d/0xc60
    [] ? _raw_spin_unlock_irq+0x30/0x36
    [] do_group_exit+0xcf/0x134
    [] get_signal_to_deliver+0x732/0x81d
    [] ? cpu_clock+0x4e/0x60
    [] do_notify_resume+0x117/0xc43
    [] ? trace_hardirqs_on+0xd/0xf
    [] ? sys_rt_sigtimedwait+0x2b5/0x3bf
    [] ? trace_hardirqs_off_thunk+0x3a/0x3c
    [] ? sysret_signal+0x5/0x3d
    [] int_signal+0x12/0x17

    Signed-off-by: Sheng Yang
    Signed-off-by: Marcelo Tosatti

    Sheng Yang
     
  • Signed-off-by: Avi Kivity

    Avi Kivity
     

09 Jun, 2010

1 commit

  • This is obviously a left-over from the the old interface taking the
    size. Apparently a mostly harmless issue with the current iommu_unmap
    implementation.

    Signed-off-by: Jan Kiszka
    Acked-by: Joerg Roedel
    Signed-off-by: Avi Kivity

    Jan Kiszka
     

22 May, 2010

1 commit

  • * 'kvm-updates/2.6.35' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (269 commits)
    KVM: x86: Add missing locking to arch specific vcpu ioctls
    KVM: PPC: Add missing vcpu_load()/vcpu_put() in vcpu ioctls
    KVM: MMU: Segregate shadow pages with different cr0.wp
    KVM: x86: Check LMA bit before set_efer
    KVM: Don't allow lmsw to clear cr0.pe
    KVM: Add cpuid.txt file
    KVM: x86: Tell the guest we'll warn it about tsc stability
    x86, paravirt: don't compute pvclock adjustments if we trust the tsc
    x86: KVM guest: Try using new kvm clock msrs
    KVM: x86: export paravirtual cpuid flags in KVM_GET_SUPPORTED_CPUID
    KVM: x86: add new KVMCLOCK cpuid feature
    KVM: x86: change msr numbers for kvmclock
    x86, paravirt: Add a global synchronization point for pvclock
    x86, paravirt: Enable pvclock flags in vcpu_time_info structure
    KVM: x86: Inject #GP with the right rip on efer writes
    KVM: SVM: Don't allow nested guest to VMMCALL into host
    KVM: x86: Fix exception reinjection forced to true
    KVM: Fix wallclock version writing race
    KVM: MMU: Don't read pdptrs with mmu spinlock held in mmu_alloc_roots
    KVM: VMX: enable VMXON check with SMX enabled (Intel TXT)
    ...

    Linus Torvalds
     

17 May, 2010

1 commit

  • The RCU/SRCU API have already changed for proving RCU usage.

    I got the following dmesg when PROVE_RCU=y because we used incorrect API.
    This patch coverts rcu_deference() to srcu_dereference() or family API.

    ===================================================
    [ INFO: suspicious rcu_dereference_check() usage. ]
    ---------------------------------------------------
    arch/x86/kvm/mmu.c:3020 invoked rcu_dereference_check() without protection!

    other info that might help us debug this:

    rcu_scheduler_active = 1, debug_locks = 0
    2 locks held by qemu-system-x86/8550:
    #0: (&kvm->slots_lock){+.+.+.}, at: [] kvm_set_memory_region+0x29/0x50 [kvm]
    #1: (&(&kvm->mmu_lock)->rlock){+.+...}, at: [] kvm_arch_commit_memory_region+0xa6/0xe2 [kvm]

    stack backtrace:
    Pid: 8550, comm: qemu-system-x86 Not tainted 2.6.34-rc4-tip-01028-g939eab1 #27
    Call Trace:
    [] lockdep_rcu_dereference+0xaa/0xb3
    [] kvm_mmu_calculate_mmu_pages+0x44/0x7d [kvm]
    [] kvm_arch_commit_memory_region+0xb7/0xe2 [kvm]
    [] __kvm_set_memory_region+0x636/0x6e2 [kvm]
    [] kvm_set_memory_region+0x37/0x50 [kvm]
    [] vmx_set_tss_addr+0x46/0x5a [kvm_intel]
    [] kvm_arch_vm_ioctl+0x17a/0xcf8 [kvm]
    [] ? unlock_page+0x27/0x2c
    [] ? __do_fault+0x3a9/0x3e1
    [] kvm_vm_ioctl+0x364/0x38d [kvm]
    [] ? up_read+0x23/0x3d
    [] vfs_ioctl+0x32/0xa6
    [] do_vfs_ioctl+0x495/0x4db
    [] ? fget_light+0xc2/0x241
    [] ? do_sys_open+0x104/0x116
    [] ? retint_swapgs+0xe/0x13
    [] sys_ioctl+0x47/0x6a
    [] system_call_fastpath+0x16/0x1b

    Signed-off-by: Lai Jiangshan
    Signed-off-by: Avi Kivity

    Lai Jiangshan
     

08 Mar, 2010

1 commit


01 Mar, 2010

4 commits


10 Jun, 2009

1 commit

  • Memory aliases with different memory type is a problem for guest. For the guest
    without assigned device, the memory type of guest memory would always been the
    same as host(WB); but for the assigned device, some part of memory may be used
    as DMA and then set to uncacheable memory type(UC/WC), which would be a conflict of
    host memory type then be a potential issue.

    Snooping control can guarantee the cache correctness of memory go through the
    DMA engine of VT-d.

    [avi: fix build on ia64]

    Signed-off-by: Sheng Yang
    Signed-off-by: Avi Kivity

    Sheng Yang
     

15 Feb, 2009

1 commit


03 Jan, 2009

3 commits