17 Jan, 2018

1 commit


12 Jan, 2018

1 commit

  • Commit 3d1ad640f8c94 ("KVM: arm/arm64: Fix GICv4 ITS initialization
    issues") moved the vgic_supports_direct_msis() check in vgic_v4_init().
    However when vgic_v4_init is called from vgic_its_create(), the has_its
    field is not yet set. Hence vgic_supports_direct_msis returns false and
    vgic_v4_init does nothing.

    The gic/its init sequence is a bit messy, so let's be specific about the
    prerequisite checks in the various call paths instead of relying on a
    common wrapper.

    Fixes: 3d1ad640f8c94 ("KVM: arm/arm64: Fix GICv4 ITS initialization issues")
    Reported-by: Eric Auger
    Signed-off-by: Christoffer Dall

    Christoffer Dall
     

11 Jan, 2018

1 commit

  • KVM only supports PMD hugepages at stage 2 but doesn't actually check
    that the provided hugepage memory pagesize is PMD_SIZE before populating
    stage 2 entries.

    In cases where the backing hugepage size is smaller than PMD_SIZE (such
    as when using contiguous hugepages), KVM can end up creating stage 2
    mappings that extend beyond the supplied memory.

    Fix this by checking for the pagesize of userspace vma before creating
    PMD hugepage at stage 2.

    Fixes: 66b3923a1a0f77a ("arm64: hugetlb: add support for PTE contiguous bit")
    Signed-off-by: Punit Agrawal
    Cc: Marc Zyngier
    Cc: # v4.5+
    Reviewed-by: Christoffer Dall
    Signed-off-by: Christoffer Dall

    Punit Agrawal
     

18 Dec, 2017

6 commits

  • …el/git/kvmarm/kvmarm into HEAD

    KVM/ARM Fixes for v4.15, Round 2

    Fixes:
    - A bug in our handling of SPE state for non-vhe systems
    - A bug that causes hyp unmapping to go off limits and crash the system on
    shutdown
    - Three timer fixes that were introduced as part of the timer optimizations
    for v4.15

    Paolo Bonzini
     
  • Reported by syzkaller:

    BUG: KASAN: stack-out-of-bounds in write_mmio+0x11e/0x270 [kvm]
    Read of size 8 at addr ffff8803259df7f8 by task syz-executor/32298

    CPU: 6 PID: 32298 Comm: syz-executor Tainted: G OE 4.15.0-rc2+ #18
    Hardware name: LENOVO ThinkCentre M8500t-N000/SHARKBAY, BIOS FBKTC1AUS 02/16/2016
    Call Trace:
    dump_stack+0xab/0xe1
    print_address_description+0x6b/0x290
    kasan_report+0x28a/0x370
    write_mmio+0x11e/0x270 [kvm]
    emulator_read_write_onepage+0x311/0x600 [kvm]
    emulator_read_write+0xef/0x240 [kvm]
    emulator_fix_hypercall+0x105/0x150 [kvm]
    em_hypercall+0x2b/0x80 [kvm]
    x86_emulate_insn+0x2b1/0x1640 [kvm]
    x86_emulate_instruction+0x39a/0xb90 [kvm]
    handle_exception+0x1b4/0x4d0 [kvm_intel]
    vcpu_enter_guest+0x15a0/0x2640 [kvm]
    kvm_arch_vcpu_ioctl_run+0x549/0x7d0 [kvm]
    kvm_vcpu_ioctl+0x479/0x880 [kvm]
    do_vfs_ioctl+0x142/0x9a0
    SyS_ioctl+0x74/0x80
    entry_SYSCALL_64_fastpath+0x23/0x9a

    The path of patched vmmcall will patch 3 bytes opcode 0F 01 C1(vmcall)
    to the guest memory, however, write_mmio tracepoint always prints 8 bytes
    through *(u64 *)val since kvm splits the mmio access into 8 bytes. This
    leaks 5 bytes from the kernel stack (CVE-2017-17741). This patch fixes
    it by just accessing the bytes which we operate on.

    Before patch:

    syz-executor-5567 [007] .... 51370.561696: kvm_mmio: mmio write len 3 gpa 0x10 val 0x1ffff10077c1010f

    After patch:

    syz-executor-13416 [002] .... 51302.299573: kvm_mmio: mmio write len 3 gpa 0x10 val 0xc1010f

    Reported-by: Dmitry Vyukov
    Reviewed-by: Darren Kenny
    Reviewed-by: Marc Zyngier
    Tested-by: Marc Zyngier
    Cc: Paolo Bonzini
    Cc: Radim Krčmář
    Cc: Marc Zyngier
    Cc: Christoffer Dall
    Signed-off-by: Wanpeng Li
    Signed-off-by: Paolo Bonzini

    Wanpeng Li
     
  • When enabling the timer on the first run, we fail to ever restore the
    state and mark it as loaded. That means, that in the initial entry to
    the VCPU ioctl, unless we exit to userspace for some reason such as a
    pending signal, if the guest programs a timer and blocks, we will wait
    forever, because we never read back the hardware state (the loaded flag
    is not set), and so we think the timer is disabled, and we never
    schedule a background soft timer.

    The end result? The VCPU blocks forever, and the only solution is to
    kill the thread.

    Fixes: 4a2c4da1250d ("arm/arm64: KVM: Load the timer state when enabling the timer")
    Reported-by: Marc Zyngier
    Reviewed-by: Marc Zyngier
    Tested-by: Marc Zyngier
    Signed-off-by: Christoffer Dall

    Christoffer Dall
     
  • The recent timer rework was assuming that once the timer was disabled,
    we should no longer see any interrupts from the timer. This assumption
    turns out to not be true, and instead we have to handle the case when
    the timer ISR runs even after the timer has been disabled.

    This requires a couple of changes:

    First, we should never overwrite the cached guest state of the timer
    control register when the ISR runs, because KVM may have disabled its
    timers when doing vcpu_put(), even though the guest still had the timer
    enabled.

    Second, we shouldn't assume that the timer is actually firing just
    because we see an interrupt, but we should check the actual state of the
    timer in the timer control register to understand if the hardware timer
    is really firing or not.

    We also add an ISB to vtimer_save_state() to ensure the timer is
    actually disabled once we enable interrupts, which should clarify the
    intention of the implementation, and reduce the risk of unwanted
    interrupts.

    Fixes: b103cc3f10c0 ("KVM: arm/arm64: Avoid timer save/restore in vcpu entry/exit")
    Reported-by: Marc Zyngier
    Reported-by: Jia He
    Reviewed-by: Marc Zyngier
    Tested-by: Marc Zyngier
    Signed-off-by: Christoffer Dall

    Christoffer Dall
     
  • If we don't have a usable GIC, do not try to set the vcpu affinity
    as this is guaranteed to fail.

    Reported-by: Andre Przywara
    Reviewed-by: Andre Przywara
    Tested-by: Andre Przywara
    Reviewed-by: Christoffer Dall
    Signed-off-by: Marc Zyngier
    Signed-off-by: Christoffer Dall

    Marc Zyngier
     
  • When we unmap the HYP memory, we try to be clever and unmap one
    PGD at a time. If we start with a non-PGD aligned address and try
    to unmap a whole PGD, things go horribly wrong in unmap_hyp_range
    (addr and end can never match, and it all goes really badly as we
    keep incrementing pgd and parse random memory as page tables...).

    The obvious fix is to let unmap_hyp_range do what it does best,
    which is to iterate over a range.

    The size of the linear mapping, which begins at PAGE_OFFSET, can be
    easily calculated by subtracting PAGE_OFFSET form high_memory, because
    high_memory is defined as the linear map address of the last byte of
    DRAM, plus one.

    The size of the vmalloc region is given trivially by VMALLOC_END -
    VMALLOC_START.

    Cc: stable@vger.kernel.org
    Reported-by: Andre Przywara
    Tested-by: Andre Przywara
    Reviewed-by: Christoffer Dall
    Signed-off-by: Marc Zyngier
    Signed-off-by: Christoffer Dall

    Marc Zyngier
     

06 Dec, 2017

2 commits

  • Implementation of the unpinned APIC page didn't update the VMCS address
    cache when invalidation was done through range mmu notifiers.
    This became a problem when the page notifier was removed.

    Re-introduce the arch-specific helper and call it from ...range_start.

    Reported-by: Fabian Grünbichler
    Fixes: 38b9917350cb ("kvm: vmx: Implement set_apic_access_page_addr")
    Fixes: 369ea8242c0f ("mm/rmap: update to new mmu_notifier semantic v2")
    Cc:
    Reviewed-by: Paolo Bonzini
    Reviewed-by: Andrea Arcangeli
    Tested-by: Wanpeng Li
    Tested-by: Fabian Grünbichler
    Signed-off-by: Radim Krčmář

    Radim Krčmář
     
  • KVM/ARM Fixes for v4.15.

    Fixes:
    - A number of issues in the vgic discovered using SMATCH
    - A bit one-off calculation in out stage base address mask (32-bit and
    64-bit)
    - Fixes to single-step debugging instructions that trap for other
    reasons such as MMMIO aborts
    - Printing unavailable hyp mode as error
    - Potential spinlock deadlock in the vgic
    - Avoid calling vgic vcpu free more than once
    - Broken bit calculation for big endian systems

    Radim Krčmář
     

04 Dec, 2017

1 commit

  • We are incorrectly rearranging 32-bit words inside a 64-bit typed value
    for big endian systems, which would result in never marking a virtual
    interrupt as inactive on big endian systems (assuming 32 or fewer LRs on
    the hardware). Fix this by not doing any word order manipulation for
    the typed values.

    Cc:
    Acked-by: Christoffer Dall
    Signed-off-by: Christoffer Dall

    Christoffer Dall
     

01 Dec, 2017

3 commits

  • kvm_vgic_vcpu_destroy already gets called from kvm_vgic_destroy for
    each vcpu, so we don't have to call it from kvm_arch_vcpu_free.

    Additionally the other architectures set kvm->online_vcpus to zero
    after freeing them. We might as well do that for ARM too.

    Signed-off-by: Andrew Jones
    Signed-off-by: Christoffer Dall

    Andrew Jones
     
  • vgic_set_owner acquires the irq lock without disabling interrupts,
    resulting in a lockdep splat (an interrupt could fire and result
    in the same lock being taken if the same virtual irq is to be
    injected).

    In practice, it is almost impossible to trigger this bug, but
    better safe than sorry. Convert the lock acquisition to a
    spin_lock_irqsave() and keep lockdep happy.

    Reported-by: James Morse
    Signed-off-by: Marc Zyngier
    Signed-off-by: Christoffer Dall

    Marc Zyngier
     
  • Pull KVM fixes from Paolo Bonzini:

    - x86 bugfixes: APIC, nested virtualization, IOAPIC

    - PPC bugfix: HPT guests on a POWER9 radix host

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (26 commits)
    KVM: Let KVM_SET_SIGNAL_MASK work as advertised
    KVM: VMX: Fix vmx->nested freeing when no SMI handler
    KVM: VMX: Fix rflags cache during vCPU reset
    KVM: X86: Fix softlockup when get the current kvmclock
    KVM: lapic: Fixup LDR on load in x2apic
    KVM: lapic: Split out x2apic ldr calculation
    KVM: PPC: Book3S HV: Fix migration and HPT resizing of HPT guests on radix hosts
    KVM: vmx: use X86_CR4_UMIP and X86_FEATURE_UMIP
    KVM: x86: Fix CPUID function for word 6 (80000001_ECX)
    KVM: nVMX: Fix vmx_check_nested_events() return value in case an event was reinjected to L2
    KVM: x86: ioapic: Preserve read-only values in the redirection table
    KVM: x86: ioapic: Clear Remote IRR when entry is switched to edge-triggered
    KVM: x86: ioapic: Remove redundant check for Remote IRR in ioapic_set_irq
    KVM: x86: ioapic: Don't fire level irq when Remote IRR set
    KVM: x86: ioapic: Fix level-triggered EOI and IOAPIC reconfigure race
    KVM: x86: inject exceptions produced by x86_decode_insn
    KVM: x86: Allow suppressing prints on RDMSR/WRMSR of unhandled MSRs
    KVM: x86: fix em_fxstor() sleeping while in atomic
    KVM: nVMX: Fix mmu context after VMLAUNCH/VMRESUME failure
    KVM: nVMX: Validate the IA32_BNDCFGS on nested VM-entry
    ...

    Linus Torvalds
     

30 Nov, 2017

2 commits


29 Nov, 2017

8 commits

  • The system state of KVM when using userspace emulation is not complete
    until we return into KVM_RUN. To handle mmio related updates we wait
    until they have been committed and then schedule our KVM_EXIT_DEBUG.

    The kvm_arm_handle_step_debug() helper tells us if we need to return
    and sets up the exit_reason for us.

    Signed-off-by: Alex Bennée
    Signed-off-by: Christoffer Dall

    Alex Bennée
     
  • Before performing an unmap, let's check that what we have was
    really mapped the first place.

    Reviewed-by: Christoffer Dall
    Signed-off-by: Marc Zyngier
    Signed-off-by: Christoffer Dall

    Marc Zyngier
     
  • We miss a test against NULL after allocation.

    Fixes: 6d03a68f8054 ("KVM: arm64: vgic-its: Turn device_id validation into generic ID validation")
    Cc: stable@vger.kernel.org # 4.8
    Reported-by: AKASHI Takahiro
    Acked-by: Christoffer Dall
    Signed-off-by: Marc Zyngier
    Signed-off-by: Christoffer Dall

    Marc Zyngier
     
  • The current pending table parsing code assumes that we keep the
    previous read of the pending bits, but keep that variable in
    the current block, making sure it is discarded on each loop.

    We end-up using whatever is on the stack. Who knows, it might
    just be the right thing...

    Fixes: 33d3bc9556a7d ("KVM: arm64: vgic-its: Read initial LPI pending table")
    Cc: stable@vger.kernel.org # 4.8
    Reported-by: AKASHI Takahiro
    Reviewed-by: Christoffer Dall
    Signed-off-by: Marc Zyngier
    Signed-off-by: Christoffer Dall

    Marc Zyngier
     
  • The current pending table parsing code assumes that we keep the
    previous read of the pending bits, but keep that variable in
    the current block, making sure it is discarded on each loop.

    We end-up using whatever is on the stack. Who knows, it might
    just be the right thing...

    Fixes: 280771252c1ba ("KVM: arm64: vgic-v3: KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLES")
    Cc: stable@vger.kernel.org # 4.12
    Reported-by: AKASHI Takahiro
    Reviewed-by: Christoffer Dall
    Signed-off-by: Marc Zyngier
    Signed-off-by: Christoffer Dall

    Marc Zyngier
     
  • Using the size of the structure we're allocating is a good idea
    and avoids any surprise... In this case, we're happilly confusing
    kvm_kernel_irq_routing_entry and kvm_irq_routing_entry...

    Fixes: 95b110ab9a09 ("KVM: arm/arm64: Enable irqchip routing")
    Cc: stable@vger.kernel.org # 4.8
    Reported-by: AKASHI Takahiro
    Reviewed-by: Christoffer Dall
    Signed-off-by: Marc Zyngier
    Signed-off-by: Christoffer Dall

    Marc Zyngier
     
  • Commit f39d16cbabf9 ("KVM: arm/arm64: Guard kvm_vgic_map_is_active against
    !vgic_initialized") introduced a check whether the VGIC has been
    initialized before accessing the spinlock and the VGIC data structure.
    However the vgic_get_irq() call in the variable declaration sneaked
    through the net, so lets make sure that this also gets called only after
    we actually allocated the arrays this function accesses.

    Reviewed-by: Eric Auger
    Signed-off-by: Andre Przywara
    Signed-off-by: Christoffer Dall

    Andre Przywara
     
  • After the timer optimization rework we accidentally end up calling
    physical timer enable/disable functions on VHE systems, which is neither
    needed nor correct, since the CNTHCTL_EL2 register format is
    different when HCR_EL2.E2H is set.

    The CNTHCTL_EL2 is initialized when CPUs become online in
    kvm_timer_init_vhe() and we don't have to call these functions on VHE
    systems, which also allows us to inline the non-VHE functionality.

    Reported-by: Jintack Lim
    Signed-off-by: Christoffer Dall

    Christoffer Dall
     

28 Nov, 2017

1 commit

  • KVM API says for the signal mask you set via KVM_SET_SIGNAL_MASK, that
    "any unblocked signal received [...] will cause KVM_RUN to return with
    -EINTR" and that "the signal will only be delivered if not blocked by
    the original signal mask".

    This, however, is only true, when the calling task has a signal handler
    registered for a signal. If not, signal evaluation is short-circuited for
    SIG_IGN and SIG_DFL, and the signal is either ignored without KVM_RUN
    returning or the whole process is terminated.

    Make KVM_SET_SIGNAL_MASK behave as advertised by utilizing logic similar
    to that in do_sigtimedwait() to avoid short-circuiting of signals.

    Signed-off-by: Jan H. Schönherr
    Signed-off-by: Paolo Bonzini

    Jan H. Schönherr
     

25 Nov, 2017

1 commit

  • Pull KVM updates from Radim Krčmář:
    "Trimmed second batch of KVM changes for Linux 4.15:

    - GICv4 Support for KVM/ARM

    - re-introduce support for CPUs without virtual NMI (cc stable) and
    allow testing of KVM without virtual NMI on available CPUs

    - fix long-standing performance issues with assigned devices on AMD
    (cc stable)"

    * tag 'kvm-4.15-2' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (30 commits)
    kvm: vmx: Allow disabling virtual NMI support
    kvm: vmx: Reinstate support for CPUs without virtual NMI
    KVM: SVM: obey guest PAT
    KVM: arm/arm64: Don't queue VLPIs on INV/INVALL
    KVM: arm/arm64: Fix GICv4 ITS initialization issues
    KVM: arm/arm64: GICv4: Theory of operations
    KVM: arm/arm64: GICv4: Enable VLPI support
    KVM: arm/arm64: GICv4: Prevent userspace from changing doorbell affinity
    KVM: arm/arm64: GICv4: Prevent a VM using GICv4 from being saved
    KVM: arm/arm64: GICv4: Enable virtual cpuif if VLPIs can be delivered
    KVM: arm/arm64: GICv4: Hook vPE scheduling into vgic flush/sync
    KVM: arm/arm64: GICv4: Use the doorbell interrupt as an unblocking source
    KVM: arm/arm64: GICv4: Add doorbell interrupt handling
    KVM: arm/arm64: GICv4: Use pending_last as a scheduling hint
    KVM: arm/arm64: GICv4: Handle INVALL applied to a vPE
    KVM: arm/arm64: GICv4: Propagate property updates to VLPIs
    KVM: arm/arm64: GICv4: Handle MOVALL applied to a vPE
    KVM: arm/arm64: GICv4: Handle CLEAR applied to a VLPI
    KVM: arm/arm64: GICv4: Propagate affinity changes to the physical ITS
    KVM: arm/arm64: GICv4: Unmap VLPI when freeing an LPI
    ...

    Linus Torvalds
     

18 Nov, 2017

1 commit

  • Pull compat and uaccess updates from Al Viro:

    - {get,put}_compat_sigset() series

    - assorted compat ioctl stuff

    - more set_fs() elimination

    - a few more timespec64 conversions

    - several removals of pointless access_ok() in places where it was
    followed only by non-__ variants of primitives

    * 'misc.compat' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (24 commits)
    coredump: call do_unlinkat directly instead of sys_unlink
    fs: expose do_unlinkat for built-in callers
    ext4: take handling of EXT4_IOC_GROUP_ADD into a helper, get rid of set_fs()
    ipmi: get rid of pointless access_ok()
    pi433: sanitize ioctl
    cxlflash: get rid of pointless access_ok()
    mtdchar: get rid of pointless access_ok()
    r128: switch compat ioctls to drm_ioctl_kernel()
    selection: get rid of field-by-field copyin
    VT_RESIZEX: get rid of field-by-field copyin
    i2c compat ioctls: move to ->compat_ioctl()
    sched_rr_get_interval(): move compat to native, get rid of set_fs()
    mips: switch to {get,put}_compat_sigset()
    sparc: switch to {get,put}_compat_sigset()
    s390: switch to {get,put}_compat_sigset()
    ppc: switch to {get,put}_compat_sigset()
    parisc: switch to {get,put}_compat_sigset()
    get_compat_sigset()
    get rid of {get,put}_compat_itimerspec()
    io_getevents: Use timespec64 to represent timeouts
    ...

    Linus Torvalds
     

17 Nov, 2017

2 commits

  • …/git/kvmarm/kvmarm into HEAD

    GICv4 Support for KVM/ARM for v4.15

    Paolo Bonzini
     
  • Pull KVM updates from Radim Krčmář:
    "First batch of KVM changes for 4.15

    Common:
    - Python 3 support in kvm_stat
    - Accounting of slabs to kmemcg

    ARM:
    - Optimized arch timer handling for KVM/ARM
    - Improvements to the VGIC ITS code and introduction of an ITS reset
    ioctl
    - Unification of the 32-bit fault injection logic
    - More exact external abort matching logic

    PPC:
    - Support for running hashed page table (HPT) MMU mode on a host that
    is using the radix MMU mode; single threaded mode on POWER 9 is
    added as a pre-requisite
    - Resolution of merge conflicts with the last second 4.14 HPT fixes
    - Fixes and cleanups

    s390:
    - Some initial preparation patches for exitless interrupts and crypto
    - New capability for AIS migration
    - Fixes

    x86:
    - Improved emulation of LAPIC timer mode changes, MCi_STATUS MSRs,
    and after-reset state
    - Refined dependencies for VMX features
    - Fixes for nested SMI injection
    - A lot of cleanups"

    * tag 'kvm-4.15-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (89 commits)
    KVM: s390: provide a capability for AIS state migration
    KVM: s390: clear_io_irq() requests are not expected for adapter interrupts
    KVM: s390: abstract conversion between isc and enum irq_types
    KVM: s390: vsie: use common code functions for pinning
    KVM: s390: SIE considerations for AP Queue virtualization
    KVM: s390: document memory ordering for kvm_s390_vcpu_wakeup
    KVM: PPC: Book3S HV: Cosmetic post-merge cleanups
    KVM: arm/arm64: fix the incompatible matching for external abort
    KVM: arm/arm64: Unify 32bit fault injection
    KVM: arm/arm64: vgic-its: Implement KVM_DEV_ARM_ITS_CTRL_RESET
    KVM: arm/arm64: Document KVM_DEV_ARM_ITS_CTRL_RESET
    KVM: arm/arm64: vgic-its: Free caches when GITS_BASER Valid bit is cleared
    KVM: arm/arm64: vgic-its: New helper functions to free the caches
    KVM: arm/arm64: vgic-its: Remove kvm_its_unmap_device
    arm/arm64: KVM: Load the timer state when enabling the timer
    KVM: arm/arm64: Rework kvm_timer_should_fire
    KVM: arm/arm64: Get rid of kvm_timer_flush_hwstate
    KVM: arm/arm64: Avoid phys timer emulation in vcpu entry/exit
    KVM: arm/arm64: Move phys_timer_emulate function
    KVM: arm/arm64: Use kvm_arm_timer_set/get_reg for guest register traps
    ...

    Linus Torvalds
     

16 Nov, 2017

2 commits

  • KVM: s390: fixes and improvements for 4.15

    - Some initial preparation patches for exitless interrupts and crypto
    - New capability for AIS migration
    - Fixes
    - merge of the sthyi tree from the base s390 team, which moves the sthyi
    out of KVM into a shared function also for non-KVM

    Radim Krčmář
     
  • Pull arm64 updates from Will Deacon:
    "The big highlight is support for the Scalable Vector Extension (SVE)
    which required extensive ABI work to ensure we don't break existing
    applications by blowing away their signal stack with the rather large
    new vector context ( of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (97 commits)
    arm64: Make ARMV8_DEPRECATED depend on SYSCTL
    arm64: Implement __lshrti3 library function
    arm64: support __int128 on gcc 5+
    arm64/sve: Add documentation
    arm64/sve: Detect SVE and activate runtime support
    arm64/sve: KVM: Hide SVE from CPU features exposed to guests
    arm64/sve: KVM: Treat guest SVE use as undefined instruction execution
    arm64/sve: KVM: Prevent guests from using SVE
    arm64/sve: Add sysctl to set the default vector length for new processes
    arm64/sve: Add prctl controls for userspace vector length management
    arm64/sve: ptrace and ELF coredump support
    arm64/sve: Preserve SVE registers around EFI runtime service calls
    arm64/sve: Preserve SVE registers around kernel-mode NEON use
    arm64/sve: Probe SVE capabilities and usable vector lengths
    arm64: cpufeature: Move sys_caps_initialised declarations
    arm64/sve: Backend logic for setting the vector length
    arm64/sve: Signal handling support
    arm64/sve: Support vector length resetting for new processes
    arm64/sve: Core task context handling
    arm64/sve: Low-level CPU setup
    ...

    Linus Torvalds
     

10 Nov, 2017

8 commits

  • Since VLPIs are injected directly by the hardware there's no need to
    mark these as pending in software and queue them on the AP list.

    Reviewed-by: Marc Zyngier
    Signed-off-by: Christoffer Dall

    Christoffer Dall
     
  • We should only try to initialize GICv4 data structures on a GICv4
    capable system. Move the vgic_supports_direct_msis() check inito
    vgic_v4_init() so that any KVM VGIC initialization path does not fail
    on non-GICv4 systems.

    Also be slightly more strict in the checking of the return value in
    vgic_its_create, and only error out on negative return values from the
    vgic_v4_init() function. This is important because the kvm device code
    only treats negative values as errors and only cleans up in this case.
    Errornously treating a positive return value as an error from the
    vgic_v4_init() function can lead to NULL pointer dereferences, as has
    recently been observed.

    Acked-by: Marc Zyngier
    Signed-off-by: Christoffer Dall

    Christoffer Dall
     
  • Yet another braindump so I can free some cells...

    Acked-by: Christoffer Dall
    Signed-off-by: Marc Zyngier
    Signed-off-by: Christoffer Dall

    Marc Zyngier
     
  • All it takes is the has_v4 flag to be set in gic_kvm_info
    as well as "kvm-arm.vgic_v4_enable=1" being passed on the
    command line for GICv4 to be enabled in KVM.

    Acked-by: Christoffer Dall
    Signed-off-by: Marc Zyngier
    Signed-off-by: Christoffer Dall

    Marc Zyngier
     
  • We so far allocate the doorbell interrupts without taking any
    special measure regarding the affinity of these interrupts. We
    simply move them around as required when the vcpu gets scheduled
    on a different CPU.

    But that's counting without userspace (and the evil irqbalance) that
    can try and move the VPE interrupt around, causing the ITS code
    to emit VMOVP commands and remap the doorbell to another redistributor.
    Worse, this can happen while the vcpu is running, causing all kind
    of trouble if the VPE is already resident, and we end-up in UNPRED
    territory.

    So let's take a definitive action and prevent userspace from messing
    with us. This is just a matter of adding IRQ_NO_BALANCING to the
    set of flags we already have, letting the kernel in sole control
    of the affinity.

    Acked-by: Christoffer Dall
    Reviewed-by: Eric Auger
    Signed-off-by: Marc Zyngier
    Signed-off-by: Christoffer Dall

    Marc Zyngier
     
  • The GICv4 architecture doesn't make it easy for save/restore to
    work, as it doesn't give any guarantee that the pending state
    is written into the pending table.

    So let's not take any chance, and let's return an error if
    we encounter any LPI that has the HW bit set. In order for
    userspace to distinguish this error from other failure modes,
    use -EACCES as an error code.

    Reviewed-by: Eric Auger
    Signed-off-by: Marc Zyngier
    Signed-off-by: Christoffer Dall

    Marc Zyngier
     
  • In order for VLPIs to be delivered to the guest, we must make sure that
    the virtual cpuif is always enabled, irrespective of the presence of
    virtual interrupt in the LRs.

    Acked-by: Christoffer Dall
    Reviewed-by: Eric Auger
    Signed-off-by: Marc Zyngier
    Signed-off-by: Christoffer Dall

    Marc Zyngier
     
  • The redistributor needs to be told which vPE is about to be run,
    and tells us whether there is any pending VLPI on exit.

    Let's add the scheduling calls to the vgic flush/sync functions,
    allowing the VLPIs to be delivered to the guest.

    Reviewed-by: Christoffer Dall
    Signed-off-by: Marc Zyngier
    Signed-off-by: Christoffer Dall

    Marc Zyngier