1. 24 May, 2019 28 commits
    • Andrew Jones's avatar
      kvm: selftests: aarch64: fix default vm mode · 55eda003
      Andrew Jones authored
      VM_MODE_P52V48_4K is not a valid mode for AArch64. Replace its
      use in vm_create_default() with a mode that works and represents
      a good AArch64 default. (We didn't ever see a problem with this
      because we don't have any unit tests using vm_create_default(),
      but it's good to get it fixed in advance.)
      Reported-by: default avatarThomas Huth <thuth@redhat.com>
      Signed-off-by: default avatarAndrew Jones <drjones@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      55eda003
    • Andrew Jones's avatar
      kvm: selftests: aarch64: dirty_log_test: fix unaligned memslot size · bffed38d
      Andrew Jones authored
      The memory slot size must be aligned to the host's page size. When
      testing a guest with a 4k page size on a host with a 64k page size,
      then 3 guest pages are not host page size aligned. Since we just need
      a nearly arbitrary number of extra pages to ensure the memslot is not
      aligned to a 64 host-page boundary for this test, then we can use
      16, as that's 64k aligned, but not 64 * 64k aligned.
      
      Fixes: 76d58e0f ("KVM: fix KVM_CLEAR_DIRTY_LOG for memory slots of unaligned size", 2019-04-17)
      Signed-off-by: default avatarAndrew Jones <drjones@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      bffed38d
    • Christian Borntraeger's avatar
      KVM: s390: fix memory slot handling for KVM_SET_USER_MEMORY_REGION · 19ec166c
      Christian Borntraeger authored
      kselftests exposed a problem in the s390 handling for memory slots.
      Right now we only do proper memory slot handling for creation of new
      memory slots. Neither MOVE, nor DELETION are handled properly. Let us
      implement those.
      Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      19ec166c
    • Paolo Bonzini's avatar
      KVM: x86/pmu: do not mask the value that is written to fixed PMUs · 2924b521
      Paolo Bonzini authored
      According to the SDM, for MSR_IA32_PERFCTR0/1 "the lower-order 32 bits of
      each MSR may be written with any value, and the high-order 8 bits are
      sign-extended according to the value of bit 31", but the fixed counters
      in real hardware are limited to the width of the fixed counters ("bits
      beyond the width of the fixed-function counter are reserved and must be
      written as zeros").  Fix KVM to do the same.
      Reported-by: default avatarNadav Amit <nadav.amit@gmail.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      2924b521
    • Paolo Bonzini's avatar
      KVM: x86/pmu: mask the result of rdpmc according to the width of the counters · 0e6f467e
      Paolo Bonzini authored
      This patch will simplify the changes in the next, by enforcing the
      masking of the counters to RDPMC and RDMSR.
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      0e6f467e
    • Borislav Petkov's avatar
      x86/kvm/pmu: Set AMD's virt PMU version to 1 · a80c4ec1
      Borislav Petkov authored
      After commit:
      
        672ff6cf ("KVM: x86: Raise #GP when guest vCPU do not support PMU")
      
      my AMD guests started #GPing like this:
      
        general protection fault: 0000 [#1] PREEMPT SMP
        CPU: 1 PID: 4355 Comm: bash Not tainted 5.1.0-rc6+ #3
        Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
        RIP: 0010:x86_perf_event_update+0x3b/0xa0
      
      with Code: pointing to RDPMC. It is RDPMC because the guest has the
      hardware watchdog CONFIG_HARDLOCKUP_DETECTOR_PERF enabled which uses
      perf. Instrumenting kvm_pmu_rdpmc() some, showed that it fails due to:
      
        if (!pmu->version)
        	return 1;
      
      which the above commit added. Since AMD's PMU leaves the version at 0,
      that causes the #GP injection into the guest.
      
      Set pmu->version arbitrarily to 1 and move it above the non-applicable
      struct kvm_pmu members.
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Janakarajan Natarajan <Janakarajan.Natarajan@amd.com>
      Cc: kvm@vger.kernel.org
      Cc: Liran Alon <liran.alon@oracle.com>
      Cc: Mihai Carabas <mihai.carabas@oracle.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: "Radim Krčmář" <rkrcmar@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Cc: x86@kernel.org
      Cc: stable@vger.kernel.org
      Fixes: 672ff6cf ("KVM: x86: Raise #GP when guest vCPU do not support PMU")
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      a80c4ec1
    • Paolo Bonzini's avatar
      KVM: x86: do not spam dmesg with VMCS/VMCB dumps · 6f2f8453
      Paolo Bonzini authored
      Userspace can easily set up invalid processor state in such a way that
      dmesg will be filled with VMCS or VMCB dumps.  Disable this by default
      using a module parameter.
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      6f2f8453
    • Peter Xu's avatar
      kvm: Check irqchip mode before assign irqfd · 654f1f13
      Peter Xu authored
      When assigning kvm irqfd we didn't check the irqchip mode but we allow
      KVM_IRQFD to succeed with all the irqchip modes.  However it does not
      make much sense to create irqfd even without the kernel chips.  Let's
      provide a arch-dependent helper to check whether a specific irqfd is
      allowed by the arch.  At least for x86, it should make sense to check:
      
      - when irqchip mode is NONE, all irqfds should be disallowed, and,
      
      - when irqchip mode is SPLIT, irqfds that are with resamplefd should
        be disallowed.
      
      For either of the case, previously we'll silently ignore the irq or
      the irq ack event if the irqchip mode is incorrect.  However that can
      cause misterious guest behaviors and it can be hard to triage.  Let's
      fail KVM_IRQFD even earlier to detect these incorrect configurations.
      
      CC: Paolo Bonzini <pbonzini@redhat.com>
      CC: Radim Krčmář <rkrcmar@redhat.com>
      CC: Alex Williamson <alex.williamson@redhat.com>
      CC: Eduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      654f1f13
    • Suthikulpanit, Suravee's avatar
      kvm: svm/avic: fix off-by-one in checking host APIC ID · c9bcd3e3
      Suthikulpanit, Suravee authored
      Current logic does not allow VCPU to be loaded onto CPU with
      APIC ID 255. This should be allowed since the host physical APIC ID
      field in the AVIC Physical APIC table entry is an 8-bit value,
      and APIC ID 255 is valid in system with x2APIC enabled.
      Instead, do not allow VCPU load if the host APIC ID cannot be
      represented by an 8-bit value.
      
      Also, use the more appropriate AVIC_PHYSICAL_ID_ENTRY_HOST_PHYSICAL_ID_MASK
      instead of AVIC_MAX_PHYSICAL_ID_COUNT.
      Signed-off-by: default avatarSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      c9bcd3e3
    • Paolo Bonzini's avatar
      KVM: selftests: do not blindly clobber registers in guest asm · 204c91ef
      Paolo Bonzini authored
      The guest_code of sync_regs_test is assuming that the compiler will not
      touch %r11 outside the asm that increments it, which is a bit brittle.
      Instead, we can increment a variable and use a dummy asm to ensure the
      increment is not optimized away.  However, we also need to use a
      callee-save register or the compiler will insert a save/restore around
      the vmexit, breaking the whole idea behind the test.
      
      (Yes, "if it ain't broken...", but I would like the test to be clean
      before it is copied into the upcoming s390 selftests).
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      204c91ef
    • Thomas Huth's avatar
      KVM: selftests: Remove duplicated TEST_ASSERT in hyperv_cpuid.c · 12e9612c
      Thomas Huth authored
      The check for entry->index == 0 is done twice. One time should
      be sufficient.
      Suggested-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      12e9612c
    • Wanpeng Li's avatar
      KVM: LAPIC: Expose per-vCPU timer_advance_ns to userspace · 16ba3ab4
      Wanpeng Li authored
      Expose per-vCPU timer_advance_ns to userspace, so it is able to
      query the auto-adjusted value.
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Sean Christopherson <sean.j.christopherson@intel.com>
      Cc: Liran Alon <liran.alon@oracle.com>
      Signed-off-by: default avatarWanpeng Li <wanpengli@tencent.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      16ba3ab4
    • Wanpeng Li's avatar
      KVM: LAPIC: Fix lapic_timer_advance_ns parameter overflow · 0e6edceb
      Wanpeng Li authored
      After commit c3941d9e (KVM: lapic: Allow user to disable adaptive tuning of
      timer advancement), '-1' enables adaptive tuning starting from default
      advancment of 1000ns. However, we should expose an int instead of an overflow
      uint module parameter.
      
      Before patch:
      
      /sys/module/kvm/parameters/lapic_timer_advance_ns:4294967295
      
      After patch:
      
      /sys/module/kvm/parameters/lapic_timer_advance_ns:-1
      
      Fixes: c3941d9e (KVM: lapic: Allow user to disable adaptive tuning of timer advancement)
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Sean Christopherson <sean.j.christopherson@intel.com>
      Cc: Liran Alon <liran.alon@oracle.com>
      Reviewed-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
      Signed-off-by: default avatarWanpeng Li <wanpengli@tencent.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      0e6edceb
    • Yi Wang's avatar
      kvm: vmx: Fix -Wmissing-prototypes warnings · 4d259965
      Yi Wang authored
      We get a warning when build kernel W=1:
      arch/x86/kvm/vmx/vmx.c:6365:6: warning: no previous prototype for ‘vmx_update_host_rsp’ [-Wmissing-prototypes]
       void vmx_update_host_rsp(struct vcpu_vmx *vmx, unsigned long host_rsp)
      
      Add the missing declaration to fix this.
      Signed-off-by: default avatarYi Wang <wang.yi59@zte.com.cn>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      4d259965
    • Wanpeng Li's avatar
      KVM: nVMX: Fix using __this_cpu_read() in preemptible context · 541e886f
      Wanpeng Li authored
       BUG: using __this_cpu_read() in preemptible [00000000] code: qemu-system-x86/4590
        caller is nested_vmx_enter_non_root_mode+0xebd/0x1790 [kvm_intel]
        CPU: 4 PID: 4590 Comm: qemu-system-x86 Tainted: G           OE     5.1.0-rc4+ #1
        Call Trace:
         dump_stack+0x67/0x95
         __this_cpu_preempt_check+0xd2/0xe0
         nested_vmx_enter_non_root_mode+0xebd/0x1790 [kvm_intel]
         nested_vmx_run+0xda/0x2b0 [kvm_intel]
         handle_vmlaunch+0x13/0x20 [kvm_intel]
         vmx_handle_exit+0xbd/0x660 [kvm_intel]
         kvm_arch_vcpu_ioctl_run+0xa2c/0x1e50 [kvm]
         kvm_vcpu_ioctl+0x3ad/0x6d0 [kvm]
         do_vfs_ioctl+0xa5/0x6e0
         ksys_ioctl+0x6d/0x80
         __x64_sys_ioctl+0x1a/0x20
         do_syscall_64+0x6f/0x6c0
         entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      Accessing per-cpu variable should disable preemption, this patch extends the
      preemption disable region for __this_cpu_read().
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Signed-off-by: default avatarWanpeng Li <wanpengli@tencent.com>
      Fixes: 52017608 ("KVM: nVMX: add option to perform early consistency checks via H/W")
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      541e886f
    • Paolo Bonzini's avatar
      kvm: fix compilation on s390 · d30b214d
      Paolo Bonzini authored
      s390 does not have memremap, even though in this particular case it
      would be useful.
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      d30b214d
    • Jim Mattson's avatar
      kvm: x86: Include CPUID leaf 0x8000001e in kvm's supported CPUID · 382409b4
      Jim Mattson authored
      Kvm now supports extended CPUID functions through 0x8000001f.  CPUID
      leaf 0x8000001e is AMD's Processor Topology Information leaf. This
      contains similar information to CPUID leaf 0xb (Intel's Extended
      Topology Enumeration leaf), and should be included in the output of
      KVM_GET_SUPPORTED_CPUID, even though userspace is likely to override
      some of this information based upon the configuration of the
      particular VM.
      
      Cc: Brijesh Singh <brijesh.singh@amd.com>
      Cc: Borislav Petkov <bp@suse.de>
      Fixes: 8765d753 ("KVM: X86: Extend CPUID range to include new leaf")
      Signed-off-by: default avatarJim Mattson <jmattson@google.com>
      Reviewed-by: default avatarMarc Orr <marcorr@google.com>
      Reviewed-by: default avatarBorislav Petkov <bp@suse.de>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      382409b4
    • Jim Mattson's avatar
      kvm: x86: Include multiple indices with CPUID leaf 0x8000001d · 32a243df
      Jim Mattson authored
      Per the APM, "CPUID Fn8000_001D_E[D,C,B,A]X reports cache topology
      information for the cache enumerated by the value passed to the
      instruction in ECX, referred to as Cache n in the following
      description. To gather information for all cache levels, software must
      repeatedly execute CPUID with 8000_001Dh in EAX and ECX set to
      increasing values beginning with 0 until a value of 00h is returned in
      the field CacheType (EAX[4:0]) indicating no more cache descriptions
      are available for this processor."
      
      The termination condition is the same as leaf 4, so we can reuse that
      code block for leaf 0x8000001d.
      
      Fixes: 8765d753 ("KVM: X86: Extend CPUID range to include new leaf")
      Cc: Brijesh Singh <brijesh.singh@amd.com>
      Cc: Borislav Petkov <bp@suse.de>
      Signed-off-by: default avatarJim Mattson <jmattson@google.com>
      Reviewed-by: default avatarMarc Orr <marcorr@google.com>
      Reviewed-by: default avatarBorislav Petkov <bp@suse.de>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      32a243df
    • Thomas Huth's avatar
      KVM: selftests: Compile code with warnings enabled · 319f6f97
      Thomas Huth authored
      So far the KVM selftests are compiled without any compiler warnings
      enabled. That's quite bad, since we miss a lot of possible bugs this
      way. Let's enable at least "-Wall" and some other useful warning flags
      now, and fix at least the trivial problems in the code (like unused
      variables).
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      319f6f97
    • Paolo Bonzini's avatar
      kvm: selftests: avoid type punning · 3b339e25
      Paolo Bonzini authored
      Avoid warnings from -Wstrict-aliasing by using memcpy.
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      3b339e25
    • Dan Carpenter's avatar
      KVM: selftests: Fix a condition in test_hv_cpuid() · be7fcf1d
      Dan Carpenter authored
      The code is trying to check that all the padding is zeroed out and it
      does this:
      
          entry->padding[0] == entry->padding[1] == entry->padding[2] == 0
      
      Assume everything is zeroed correctly, then the first comparison is
      true, the next comparison is false and false is equal to zero so the
      overall condition is true.  This bug doesn't affect run time very
      badly, but the code should instead just check that all three paddings
      are zero individually.
      
      Also the error message was copy and pasted from an earlier error and it
      wasn't correct.
      
      Fixes: 7edcb734 ("KVM: selftests: Add hyperv_cpuid test")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      be7fcf1d
    • Wanpeng Li's avatar
      KVM: Fix spinlock taken warning during host resume · 2eb06c30
      Wanpeng Li authored
       WARNING: CPU: 0 PID: 13554 at kvm/arch/x86/kvm//../../../virt/kvm/kvm_main.c:4183 kvm_resume+0x3c/0x40 [kvm]
        CPU: 0 PID: 13554 Comm: step_after_susp Tainted: G           OE     5.1.0-rc4+ #1
        RIP: 0010:kvm_resume+0x3c/0x40 [kvm]
        Call Trace:
         syscore_resume+0x63/0x2d0
         suspend_devices_and_enter+0x9d1/0xa40
         pm_suspend+0x33a/0x3b0
         state_store+0x82/0xf0
         kobj_attr_store+0x12/0x20
         sysfs_kf_write+0x4b/0x60
         kernfs_fop_write+0x120/0x1a0
         __vfs_write+0x1b/0x40
         vfs_write+0xcd/0x1d0
         ksys_write+0x5f/0xe0
         __x64_sys_write+0x1a/0x20
         do_syscall_64+0x6f/0x6c0
         entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      Commit ca84d1a2 (KVM: x86: Add clock sync request to hardware enable) mentioned
      that "we always hold kvm_lock when hardware_enable is called.  The one place that
      doesn't need to worry about it is resume, as resuming a frozen CPU, the spinlock
      won't be taken." However, commit 6706dae9 (virt/kvm: Replace spin_is_locked() with
      lockdep) introduces a bug, it asserts when the lock is not held which is contrary
      to the original goal.
      
      This patch fixes it by WARN_ON when the lock is held.
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Radim Krčmář <rkrcmar@redhat.com>
      Cc: Paul E. McKenney <paulmck@linux.ibm.com>
      Signed-off-by: default avatarWanpeng Li <wanpengli@tencent.com>
      Fixes: 6706dae9 ("virt/kvm: Replace spin_is_locked() with lockdep")
      [Wrap with #ifdef CONFIG_LOCKDEP - Paolo]
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      2eb06c30
    • Sean Christopherson's avatar
      KVM: nVMX: Clear nested_run_pending if setting nested state fails · 21be4ca1
      Sean Christopherson authored
      VMX's nested_run_pending flag is subtly consumed when stuffing state to
      enter guest mode, i.e. needs to be set according before KVM knows if
      setting guest state is successful.  If setting guest state fails, clear
      the flag as a nested run is obviously not pending.
      Reported-by: default avatarAaron Lewis <aaronlewis@google.com>
      Signed-off-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      21be4ca1
    • Paolo Bonzini's avatar
      KVM: nVMX: really fix the size checks on KVM_SET_NESTED_STATE · db80927e
      Paolo Bonzini authored
      The offset for reading the shadow VMCS is sizeof(*kvm_state)+VMCS12_SIZE,
      so the correct size must be that plus sizeof(*vmcs12).  This could lead
      to KVM reading garbage data from userspace and not reporting an error,
      but is otherwise not sensitive.
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      db80927e
    • Paolo Bonzini's avatar
      Merge tag 'kvmarm-fixes-for-5.2' of... · 6bff2a3d
      Paolo Bonzini authored
      Merge tag 'kvmarm-fixes-for-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
      
      KVM/arm updates for 5.2-rc2
      
      - Correctly annotate HYP-callable code to be non-traceable
      - Remove Christoffer from the MAINTAINERS file as his request
      6bff2a3d
    • James Morse's avatar
      KVM: arm/arm64: Move cc/it checks under hyp's Makefile to avoid instrumentation · 623e1528
      James Morse authored
      KVM has helpers to handle the condition codes of trapped aarch32
      instructions. These are marked __hyp_text and used from HYP, but they
      aren't built by the 'hyp' Makefile, which has all the runes to avoid ASAN
      and KCOV instrumentation.
      
      Move this code to a new hyp/aarch32.c to avoid a hyp-panic when starting
      an aarch32 guest on a host built with the ASAN/KCOV debug options.
      
      Fixes: 021234ef ("KVM: arm64: Make kvm_condition_valid32() accessible from EL2")
      Fixes: 8cebe750 ("arm64: KVM: Make kvm_skip_instr32 available to HYP")
      Signed-off-by: default avatarJames Morse <james.morse@arm.com>
      Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      623e1528
    • James Morse's avatar
      KVM: arm64: Move pmu hyp code under hyp's Makefile to avoid instrumentation · b7c50fab
      James Morse authored
      KVM's pmu.c contains the __hyp_text needed to switch the pmu registers
      between host and guest. Because this isn't covered by the 'hyp' Makefile,
      it can be built with kasan and friends when these are enabled in Kconfig.
      
      When starting a guest, this results in:
      | Kernel panic - not syncing: HYP panic:
      | PS:a00003c9 PC:000083000028ada0 ESR:86000007
      | FAR:000083000028ada0 HPFAR:0000000029df5300 PAR:0000000000000000
      | VCPU:000000004e10b7d6
      | CPU: 0 PID: 3088 Comm: qemu-system-aar Not tainted 5.2.0-rc1 #11026
      | Hardware name: ARM LTD ARM Juno Development Platform/ARM Juno Development Plat
      | Call trace:
      |  dump_backtrace+0x0/0x200
      |  show_stack+0x20/0x30
      |  dump_stack+0xec/0x158
      |  panic+0x1ec/0x420
      |  panic+0x0/0x420
      | SMP: stopping secondary CPUs
      | Kernel Offset: disabled
      | CPU features: 0x002,25006082
      | Memory Limit: none
      | ---[ end Kernel panic - not syncing: HYP panic:
      
      This is caused by functions in pmu.c calling the instrumented
      code, which isn't mapped to hyp. From objdump -r:
      | RELOCATION RECORDS FOR [.hyp.text]:
      | OFFSET           TYPE              VALUE
      | 0000000000000010 R_AARCH64_CALL26  __sanitizer_cov_trace_pc
      | 0000000000000018 R_AARCH64_CALL26  __asan_load4_noabort
      | 0000000000000024 R_AARCH64_CALL26  __asan_load4_noabort
      
      Move the affected code to a new file under 'hyp's Makefile.
      
      Fixes: 3d91befb ("arm64: KVM: Enable !VHE support for :G/:H perf event modifiers")
      Cc: Andrew Murray <Andrew.Murray@arm.com>
      Signed-off-by: default avatarJames Morse <james.morse@arm.com>
      Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      b7c50fab
    • Christoffer Dall's avatar
      MAINTAINERS: KVM: arm/arm64: Remove myself as maintainer · 493fcbc8
      Christoffer Dall authored
      I no longer have time to actively review patches and manage the tree and
      it's time to make that official.
      
      Huge thanks to the incredible Linux community and all the contributors
      who have put up with me over the past years.
      
      I also take this opportunity to remove the website link to the Columbia
      web page, as that information is no longer up to date and I don't know
      who manages that anymore.
      Signed-off-by: default avatarChristoffer Dall <christoffer.dall@arm.com>
      Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      493fcbc8
  2. 20 May, 2019 3 commits
  3. 19 May, 2019 9 commits
    • Linus Torvalds's avatar
      Linux 5.2-rc1 · a188339c
      Linus Torvalds authored
      a188339c
    • Linus Torvalds's avatar
      Merge tag 'upstream-5.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs · 2e2c1220
      Linus Torvalds authored
      Pull UBIFS fixes from Richard Weinberger:
      
       - build errors wrt xattrs
      
       - mismerge which lead to a wrong Kconfig ifdef
      
       - missing endianness conversion
      
      * tag 'upstream-5.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs:
        ubifs: Convert xattr inum to host order
        ubifs: Use correct config name for encryption
        ubifs: Fix build error without CONFIG_UBIFS_FS_XATTR
      2e2c1220
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · cb6f8739
      Linus Torvalds authored
      Merge yet more updates from Andrew Morton:
       "A few final bits:
      
         - large changes to vmalloc, yielding large performance benefits
      
         - tweak the console-flush-on-panic code
      
         - a few fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        panic: add an option to replay all the printk message in buffer
        initramfs: don't free a non-existent initrd
        fs/writeback.c: use rcu_barrier() to wait for inflight wb switches going into workqueue when umount
        mm/compaction.c: correct zone boundary handling when isolating pages from a pageblock
        mm/vmap: add DEBUG_AUGMENT_LOWEST_MATCH_CHECK macro
        mm/vmap: add DEBUG_AUGMENT_PROPAGATE_CHECK macro
        mm/vmalloc.c: keep track of free blocks for vmap allocation
      cb6f8739
    • Linus Torvalds's avatar
      Merge tag 'kbuild-v5.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild · ff8583d6
      Linus Torvalds authored
      Pull more Kbuild updates from Masahiro Yamada:
      
       - remove unneeded use of cc-option, cc-disable-warning, cc-ldoption
      
       - exclude tracked files from .gitignore
      
       - re-enable -Wint-in-bool-context warning
      
       - refactor samples/Makefile
      
       - stop building immediately if syncconfig fails
      
       - do not sprinkle error messages when $(CC) does not exist
      
       - move arch/alpha/defconfig to the configs subdirectory
      
       - remove crappy header search path manipulation
      
       - add comment lines to .config to clarify the end of menu blocks
      
       - check uniqueness of module names (adding new warnings intentionally)
      
      * tag 'kbuild-v5.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (24 commits)
        kconfig: use 'else ifneq' for Makefile to improve readability
        kbuild: check uniqueness of module names
        kconfig: Terminate menu blocks with a comment in the generated config
        kbuild: add LICENSES to KBUILD_ALLDIRS
        kbuild: remove 'addtree' and 'flags' magic for header search paths
        treewide: prefix header search paths with $(srctree)/
        media: prefix header search paths with $(srctree)/
        media: remove unneeded header search paths
        alpha: move arch/alpha/defconfig to arch/alpha/configs/defconfig
        kbuild: terminate Kconfig when $(CC) or $(LD) is missing
        kbuild: turn auto.conf.cmd into a mandatory include file
        .gitignore: exclude .get_maintainer.ignore and .gitattributes
        kbuild: add all Clang-specific flags unconditionally
        kbuild: Don't try to add '-fcatch-undefined-behavior' flag
        kbuild: add some extra warning flags unconditionally
        kbuild: add -Wvla flag unconditionally
        arch: remove dangling asm-generic wrappers
        samples: guard sub-directories with CONFIG options
        kbuild: re-enable int-in-bool-context warning
        MAINTAINERS: kbuild: Add pattern for scripts/*vmlinux*
        ...
      ff8583d6
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · f23d8719
      Linus Torvalds authored
      Pull i2c updates from Wolfram Sang:
       "Some I2C core API additions which are kind of simple but enhance error
        checking for users a lot, especially by returning errno now.
      
        There are wrappers to still support the old API but it will be removed
        once all users are converted"
      
      * 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: core: add device-managed version of i2c_new_dummy
        i2c: core: improve return value handling of i2c_new_device and i2c_new_dummy
      f23d8719
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · c4d36b63
      Linus Torvalds authored
      Pull ext4 fixes from Ted Ts'o:
       "Some bug fixes, and an update to the URL's for the final version of
        Unicode 12.1.0"
      
      * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: avoid panic during forced reboot due to aborted journal
        ext4: fix block validity checks for journal inodes using indirect blocks
        unicode: update to Unicode 12.1.0 final
        unicode: add missing check for an error return from utf8lookup()
        ext4: fix miscellaneous sparse warnings
        ext4: unsigned int compared against zero
        ext4: fix use-after-free in dx_release()
        ext4: fix data corruption caused by overlapping unaligned and aligned IO
        jbd2: fix potential double free
        ext4: zero out the unused memory region in the extent tree block
      c4d36b63
    • Linus Torvalds's avatar
      Merge tag '5.2-rc-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 · d8848eef
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
       "Minor cleanup and fixes, one for stable, four rdma (smbdirect)
        related. Also adds SEEK_HOLE support"
      
      * tag '5.2-rc-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: add support for SEEK_DATA and SEEK_HOLE
        Fixed https://bugzilla.kernel.org/show_bug.cgi?id=202935 allow write on the same file
        cifs: Allocate memory for all iovs in smb2_ioctl
        cifs: Don't match port on SMBDirect transport
        cifs:smbd Use the correct DMA direction when sending data
        cifs:smbd When reconnecting to server, call smbd_destroy() after all MIDs have been called
        cifs: use the right include for signal_pending()
        smb3: trivial cleanup to smb2ops.c
        cifs: cleanup smb2ops.c and normalize strings
        smb3: display session id in debug data
      d8848eef
    • Linus Torvalds's avatar
      Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 1ba3b5dc
      Linus Torvalds authored
      Pull perf tooling updates from Ingo Molnar:
       "perf.data:
      
         - Streaming compression of perf ring buffer into
           PERF_RECORD_COMPRESSED user space records, resulting in ~3-5x
           perf.data file size reduction on variety of tested workloads what
           saves storage space on larger server systems where perf.data size
           can easily reach several tens or even hundreds of GiBs, especially
           when profiling with DWARF-based stacks and tracing of context
           switches.
      
        perf record:
      
         - Improve -user-regs/intr-regs suggestions to overcome errors
      
        perf annotate:
      
         - Remove hist__account_cycles() from callback, speeding up branch
           processing (perf record -b)
      
        perf stat:
      
         - Add a 'percore' event qualifier, e.g.: -e
           cpu/event=0,umask=0x3,percore=1/, that sums up the event counts for
           both hardware threads in a core.
      
           We can already do this with --per-core, but it's often useful to do
           this together with other metrics that are collected per hardware
           thread.
      
           I.e. now its possible to do this per-event, and have it mixed with
           other events not aggregated by core.
      
        arm64:
      
         - Map Brahma-B53 CPUID to cortex-a53 events.
      
         - Add Cortex-A57 and Cortex-A72 events.
      
        csky:
      
         - Add DWARF register mappings for libdw, allowing --call-graph=dwarf
           to work on the C-SKY arch.
      
        x86:
      
         - Add support for recording and printing XMM registers, available,
           for instance, on Icelake.
      
         - Add uncore_upi (Intel's "Ultra Path Interconnect" events) JSON
           support. UPI replaced the Intel QuickPath Interconnect (QPI) in
           Xeon Skylake-SP.
      
        Intel PT:
      
         - Fix instructions sampling rate.
      
         - Timestamp fixes.
      
         - Improve exported-sql-viewer GUI, allowing, for instance, to
           copy'n'paste the trees, useful for e-mailing"
      
      * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (73 commits)
        perf stat: Support 'percore' event qualifier
        perf stat: Factor out aggregate counts printing
        perf tools: Add a 'percore' event qualifier
        perf docs: Add description for stderr
        perf intel-pt: Fix sample timestamp wrt non-taken branches
        perf intel-pt: Fix improved sample timestamp
        perf intel-pt: Fix instructions sampling rate
        perf regs x86: Add X86 specific arch__intr_reg_mask()
        perf parse-regs: Add generic support for arch__intr/user_reg_mask()
        perf parse-regs: Split parse_regs
        perf vendor events arm64: Add Cortex-A57 and Cortex-A72 events
        perf vendor events arm64: Map Brahma-B53 CPUID to cortex-a53 events
        perf vendor events arm64: Remove [[:xdigit:]] wildcard
        perf jevents: Remove unused variable
        perf test zstd: Fixup verbose mode output
        perf tests: Implement Zstd comp/decomp integration test
        perf inject: Enable COMPRESSED record decompression
        perf report: Implement perf.data record decompression
        perf record: Implement -z,--compression_level[=<n>] option
        perf report: Add stub processing of compressed events for -D
        ...
      1ba3b5dc
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · a13f950e
      Linus Torvalds authored
      Pull clocksource updates from Ingo Molnar:
       "Misc clocksource/clockevent driver updates that came in a bit late but
        are ready for v5.2"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        misc: atmel_tclib: Do not probe already used TCBs
        clocksource/drivers/timer-atmel-tcb: Convert tc_clksrc_suspend|resume() to static
        clocksource/drivers/tcb_clksrc: Rename the file for consistency
        clocksource/drivers/timer-atmel-pit: Rework Kconfig option
        clocksource/drivers/tcb_clksrc: Move Kconfig option
        ARM: at91: Implement clocksource selection
        clocksource/drivers/tcb_clksrc: Use tcb as sched_clock
        clocksource/drivers/tcb_clksrc: Stop depending on atmel_tclib
        ARM: at91: move SoC specific definitions to SoC folder
        clocksource/drivers/timer-milbeaut: Cleanup common register accesses
        clocksource/drivers/timer-milbeaut: Add shutdown function
        clocksource/drivers/timer-milbeaut: Fix to enable one-shot timer
        clocksource/drivers/tegra: Rework for compensation of suspend time
        clocksource/drivers/sp804: Add COMPILE_TEST to CONFIG_ARM_TIMER_SP804
        clocksource/drivers/sun4i: Add a compatible for suniv
        dt-bindings: timer: Add Allwinner suniv timer
      a13f950e