1. 29 Sep, 2020 6 commits
    • Alexandru Elisei's avatar
      KVM: arm64: Add undocumented return values for PMU device control group · af130d0a
      Alexandru Elisei authored
      KVM_ARM_VCPU_PMU_V3_IRQ returns -EFAULT if get_user() fails when reading
      the interrupt number from kvm_device_attr.addr.
      
      KVM_ARM_VCPU_PMU_V3_INIT returns the error value from kvm_vgic_set_owner().
      kvm_arm_pmu_v3_init() checks that the vgic has been initialized and the
      interrupt number is valid, but kvm_vgic_set_owner() can still return the
      error code -EEXIST if another device has already claimed the interrupt.
      Signed-off-by: default avatarAlexandru Elisei <alexandru.elisei@arm.com>
      Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
      Reviewed-by: default avatarAndrew Jones <drjones@redhat.com>
      Link: https://lore.kernel.org/r/20200924123731.268177-2-alexandru.elisei@arm.com
      af130d0a
    • Marc Zyngier's avatar
      KVM: arm64: Document PMU filtering API · 8be86a5e
      Marc Zyngier authored
      Add a small blurb describing how the event filtering API gets used.
      Reviewed-by: default avatarAndrew Jones <drjones@redhat.com>
      Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
      8be86a5e
    • Marc Zyngier's avatar
      KVM: arm64: Mask out filtered events in PCMEID{0,1}_EL1 · 88865bec
      Marc Zyngier authored
      As we can now hide events from the guest, let's also adjust its view of
      PCMEID{0,1}_EL1 so that it can figure out why some common events are not
      counting as they should.
      
      The astute user can still look into the TRM for their CPU and find out
      they've been cheated, though. Nobody's perfect.
      Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
      88865bec
    • Marc Zyngier's avatar
      KVM: arm64: Add PMU event filtering infrastructure · d7eec236
      Marc Zyngier authored
      It can be desirable to expose a PMU to a guest, and yet not want the
      guest to be able to count some of the implemented events (because this
      would give information on shared resources, for example.
      
      For this, let's extend the PMUv3 device API, and offer a way to setup a
      bitmap of the allowed events (the default being no bitmap, and thus no
      filtering).
      
      Userspace can thus allow/deny ranges of event. The default policy
      depends on the "polarity" of the first filter setup (default deny if the
      filter allows events, and default allow if the filter denies events).
      This allows to setup exactly what is allowed for a given guest.
      
      Note that although the ioctl is per-vcpu, the map of allowed events is
      global to the VM (it can be setup from any vcpu until the vcpu PMU is
      initialized).
      Reviewed-by: default avatarAndrew Jones <drjones@redhat.com>
      Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
      d7eec236
    • Marc Zyngier's avatar
      KVM: arm64: Use event mask matching architecture revision · fd65a3b5
      Marc Zyngier authored
      The PMU code suffers from a small defect where we assume that the event
      number provided by the guest is always 16 bit wide, even if the CPU only
      implements the ARMv8.0 architecture. This isn't really problematic in
      the sense that the event number ends up in a system register, cropping
      it to the right width, but still this needs fixing.
      
      In order to make it work, let's probe the version of the PMU that the
      guest is going to use. This is done by temporarily creating a kernel
      event and looking at the PMUVer field that has been saved at probe time
      in the associated arm_pmu structure. This in turn gets saved in the kvm
      structure, and subsequently used to compute the event mask that gets
      used throughout the PMU code.
      Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
      fd65a3b5
    • Marc Zyngier's avatar
      KVM: arm64: Refactor PMU attribute error handling · 42223fb1
      Marc Zyngier authored
      The PMU emulation error handling is pretty messy when dealing with
      attributes. Let's refactor it so that we have less duplication,
      and that it is easy to extend later on.
      
      A functional change is that kvm_arm_pmu_v3_init() used to return
      -ENXIO when the PMU feature wasn't set. The error is now reported
      as -ENODEV, matching the documentation. -ENXIO is still returned
      when the interrupt isn't properly configured.
      Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
      42223fb1
  2. 07 Sep, 2020 1 commit
  3. 06 Sep, 2020 4 commits
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.9-2020-09-06' of git://git.kernel.dk/linux-block · a8205e31
      Linus Torvalds authored
      Pull more io_uring fixes from Jens Axboe:
       "Two followup fixes. One is fixing a regression from this merge window,
        the other is two commits fixing cancelation of deferred requests.
      
        Both have gone through full testing, and both spawned a few new
        regression test additions to liburing.
      
         - Don't play games with const, properly store the output iovec and
           assign it as needed.
      
         - Deferred request cancelation fix (Pavel)"
      
      * tag 'io_uring-5.9-2020-09-06' of git://git.kernel.dk/linux-block:
        io_uring: fix linked deferred ->files cancellation
        io_uring: fix cancel of deferred reqs with ->files
        io_uring: fix explicit async read/write mapping for large segments
      a8205e31
    • Linus Torvalds's avatar
      Merge tag 'iommu-fixes-v5.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · 2ccdd9f8
      Linus Torvalds authored
      Pull iommu fixes from Joerg Roedel:
      
       - three Intel VT-d fixes to fix address handling on 32bit, fix a NULL
         pointer dereference bug and serialize a hardware register access as
         required by the VT-d spec.
      
       - two patches for AMD IOMMU to force AMD GPUs into translation mode
         when memory encryption is active and disallow using IOMMUv2
         functionality.  This makes the AMDGPU driver work when memory
         encryption is active.
      
       - two more fixes for AMD IOMMU to fix updating the Interrupt Remapping
         Table Entries.
      
       - MAINTAINERS file update for the Qualcom IOMMU driver.
      
      * tag 'iommu-fixes-v5.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
        iommu/vt-d: Handle 36bit addressing for x86-32
        iommu/amd: Do not use IOMMUv2 functionality when SME is active
        iommu/amd: Do not force direct mapping when SME is active
        iommu/amd: Use cmpxchg_double() when updating 128-bit IRTE
        iommu/amd: Restore IRTE.RemapEn bit after programming IRTE
        iommu/vt-d: Fix NULL pointer dereference in dev_iommu_priv_set()
        iommu/vt-d: Serialize IOMMU GCMD register modifications
        MAINTAINERS: Update QUALCOMM IOMMU after Arm SMMU drivers move
      2ccdd9f8
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2020-09-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 015b3155
      Linus Torvalds authored
      Pull x86 fixes from Ingo Molnar:
      
       - more generic entry code ABI fallout
      
       - debug register handling bugfixes
      
       - fix vmalloc mappings on 32-bit kernels
      
       - kprobes instrumentation output fix on 32-bit kernels
      
       - fix over-eager WARN_ON_ONCE() on !SMAP hardware
      
       - NUMA debugging fix
      
       - fix Clang related crash on !RETPOLINE kernels
      
      * tag 'x86-urgent-2020-09-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/entry: Unbreak 32bit fast syscall
        x86/debug: Allow a single level of #DB recursion
        x86/entry: Fix AC assertion
        tracing/kprobes, x86/ptrace: Fix regs argument order for i386
        x86, fakenuma: Fix invalid starting node ID
        x86/mm/32: Bring back vmalloc faulting on x86_32
        x86/cmdline: Disable jump tables for cmdline.c
      015b3155
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.9-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · 68beef57
      Linus Torvalds authored
      Pull xen updates from Juergen Gross:
       "A small series for fixing a problem with Xen PVH guests when running
        as backends (e.g. as dom0).
      
        Mapping other guests' memory is now working via ZONE_DEVICE, thus not
        requiring to abuse the memory hotplug functionality for that purpose"
      
      * tag 'for-linus-5.9-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen: add helpers to allocate unpopulated memory
        memremap: rename MEMORY_DEVICE_DEVDAX to MEMORY_DEVICE_GENERIC
        xen/balloon: add header guard
      68beef57
  4. 05 Sep, 2020 28 commits
  5. 04 Sep, 2020 1 commit