1. 31 1月, 2017 1 次提交
    • I
      tools headers: Sync {tools/,}arch/powerpc/include/uapi/asm/kvm.h,... · c0621acf
      Ingo Molnar 提交于
      tools headers: Sync {tools/,}arch/powerpc/include/uapi/asm/kvm.h, {tools/,}arch/x86/include/asm/cpufeatures.h and {tools/,}arch/arm/include/uapi/asm/kvm.h
      
      The following upstream headers were updated:
      
       - The x86 cpufeatures.h file picked up a couple of new feature entries
       - The PowerPC and ARM KVM headers picked up new features
      
      None of which requires changes to perf tooling, so refresh the tooling copy.
      
      Solves these build time warnings:
      
       Warning: arch/x86/include/asm/cpufeatures.h differs from kernel
       Warning: arch/powerpc/include/uapi/asm/kvm.h differs from kernel
       Warning: arch/arm/include/uapi/asm/kvm.h differs from kernel
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20170130081131.GA8322@gmail.com
      [ resync tools/arch/x86/include/asm/cpufeatures.h ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c0621acf
  2. 13 7月, 2016 2 次提交
  3. 22 4月, 2015 1 次提交
    • A
      KVM: arm/arm64: check IRQ number on userland injection · fd1d0ddf
      Andre Przywara 提交于
      When userland injects a SPI via the KVM_IRQ_LINE ioctl we currently
      only check it against a fixed limit, which historically is set
      to 127. With the new dynamic IRQ allocation the effective limit may
      actually be smaller (64).
      So when now a malicious or buggy userland injects a SPI in that
      range, we spill over on our VGIC bitmaps and bytemaps memory.
      I could trigger a host kernel NULL pointer dereference with current
      mainline by injecting some bogus IRQ number from a hacked kvmtool:
      -----------------
      ....
      DEBUG: kvm_vgic_inject_irq(kvm, cpu=0, irq=114, level=1)
      DEBUG: vgic_update_irq_pending(kvm, cpu=0, irq=114, level=1)
      DEBUG: IRQ #114 still in the game, writing to bytemap now...
      Unable to handle kernel NULL pointer dereference at virtual address 00000000
      pgd = ffffffc07652e000
      [00000000] *pgd=00000000f658b003, *pud=00000000f658b003, *pmd=0000000000000000
      Internal error: Oops: 96000006 [#1] PREEMPT SMP
      Modules linked in:
      CPU: 1 PID: 1053 Comm: lkvm-msi-irqinj Not tainted 4.0.0-rc7+ #3027
      Hardware name: FVP Base (DT)
      task: ffffffc0774e9680 ti: ffffffc0765a8000 task.ti: ffffffc0765a8000
      PC is at kvm_vgic_inject_irq+0x234/0x310
      LR is at kvm_vgic_inject_irq+0x30c/0x310
      pc : [<ffffffc0000ae0a8>] lr : [<ffffffc0000ae180>] pstate: 80000145
      .....
      
      So this patch fixes this by checking the SPI number against the
      actual limit. Also we remove the former legacy hard limit of
      127 in the ioctl code.
      Signed-off-by: NAndre Przywara <andre.przywara@arm.com>
      Reviewed-by: NChristoffer Dall <christoffer.dall@linaro.org>
      CC: <stable@vger.kernel.org> # 4.0, 3.19, 3.18
      [maz: wrap KVM_ARM_IRQ_GIC_MAX with #ifndef __KERNEL__,
      as suggested by Christopher Covington]
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      fd1d0ddf
  4. 12 3月, 2015 1 次提交
    • E
      KVM: arm/arm64: add irqfd support · 174178fe
      Eric Auger 提交于
      This patch enables irqfd on arm/arm64.
      
      Both irqfd and resamplefd are supported. Injection is implemented
      in vgic.c without routing.
      
      This patch enables CONFIG_HAVE_KVM_EVENTFD and CONFIG_HAVE_KVM_IRQFD.
      
      KVM_CAP_IRQFD is now advertised. KVM_CAP_IRQFD_RESAMPLE capability
      automatically is advertised as soon as CONFIG_HAVE_KVM_IRQFD is set.
      
      Irqfd injection is restricted to SPI. The rationale behind not
      supporting PPI irqfd injection is that any device using a PPI would
      be a private-to-the-CPU device (timer for instance), so its state
      would have to be context-switched along with the VCPU and would
      require in-kernel wiring anyhow. It is not a relevant use case for
      irqfds.
      Signed-off-by: NEric Auger <eric.auger@linaro.org>
      Reviewed-by: NChristoffer Dall <christoffer.dall@linaro.org>
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NChristoffer Dall <christoffer.dall@linaro.org>
      174178fe
  5. 11 1月, 2015 1 次提交
    • E
      KVM: arm/arm64: vgic: add init entry to VGIC KVM device · 065c0034
      Eric Auger 提交于
      Since the advent of VGIC dynamic initialization, this latter is
      initialized quite late on the first vcpu run or "on-demand", when
      injecting an IRQ or when the guest sets its registers.
      
      This initialization could be initiated explicitly much earlier
      by the users-space, as soon as it has provided the requested
      dimensioning parameters.
      
      This patch adds a new entry to the VGIC KVM device that allows
      the user to manually request the VGIC init:
      - a new KVM_DEV_ARM_VGIC_GRP_CTRL group is introduced.
      - Its first attribute is KVM_DEV_ARM_VGIC_CTRL_INIT
      
      The rationale behind introducing a group is to be able to add other
      controls later on, if needed.
      Signed-off-by: NEric Auger <eric.auger@linaro.org>
      Signed-off-by: NChristoffer Dall <christoffer.dall@linaro.org>
      065c0034
  6. 19 9月, 2014 1 次提交
  7. 28 8月, 2014 1 次提交
  8. 30 4月, 2014 1 次提交
  9. 22 12月, 2013 3 次提交
  10. 13 10月, 2013 1 次提交
  11. 07 3月, 2013 1 次提交
  12. 12 2月, 2013 2 次提交
  13. 24 1月, 2013 5 次提交