Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Mar 05, 2021
    • Linus Torvalds's avatar
      Merge tag 'trace-v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 54663cf3
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
       "Functional fixes:
      
         - Fix big endian conversion for arm64 in recordmcount processing
      
         - Fix timestamp corruption in ring buffer on discarding events
      
         - Fix memory leak in __create_synth_event()
      
         - Skip selftests if tracing is disabled as it will cause them to
           fail.
      
        Non-functional fixes:
      
         - Fix help text in Kconfig
      
         - Remove duplicate prototype for trace_empty()
      
         - Fix stale comment about the trace_event_call flags.
      
        Self test update:
      
         - Add more information to the validation output of when a corrupt
           timestamp is found in the ring buffer, and also trigger a warning
           to make sure that tests catch it"
      
      * tag 'trace-v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing: Fix comment about the trace_event_call flags
        tracing: Skip selftests if tracing is disabled
        tracing: Fix memory leak in __create_synth_event()
        ring-buffer: Add a little more information and a WARN when time stamp going backwards is detected
        ring-buffer: Force before_stamp and write_stamp to be different on discard
        tracing: Fix help text of TRACEPOINT_BENCHMARK in Kconfig
        tracing: Remove duplicate declaration from trace.h
        ftrace: Have recordmcount use w8 to read relp->r_info in arm64_is_fake_mcount
      54663cf3
  2. Mar 04, 2021
  3. Mar 03, 2021
  4. Mar 02, 2021
    • Linus Torvalds's avatar
      Merge tag 'misc-5.12-2021-03-02' of git://git.kernel.dk/linux-block · f69d02e3
      Linus Torvalds authored
      Pull misc fixes from Jens Axboe:
       "Two misc fixes that don't belong in other branches:
      
         - Fix a regression with ia64 signals, introduced by the
           TIF_NOTIFY_SIGNAL change in 5.11.
      
         - Fix the current swapfile regression from this merge window"
      
      * tag 'misc-5.12-2021-03-02' of git://git.kernel.dk/linux-block:
        swap: fix swapfile read/write offset
        ia64: don't call handle_signal() unless there's actually a signal queued
      f69d02e3
    • Jens Axboe's avatar
      swap: fix swapfile read/write offset · caf6912f
      Jens Axboe authored
      We're not factoring in the start of the file for where to write and
      read the swapfile, which leads to very unfortunate side effects of
      writing where we should not be...
      
      Fixes: 48d15436
      
       ("mm: remove get_swap_bio")
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      caf6912f
    • Jens Axboe's avatar
      ia64: don't call handle_signal() unless there's actually a signal queued · f5f4fc46
      Jens Axboe authored
      Sergei and John both reported that ia64 failed to boot in 5.11, and it
      was related to signals. Turns out the ia64 signal handling is a bit odd,
      it doesn't check the return value of get_signal() for whether there's a
      signal to deliver or not. With the introduction of TIF_NOTIFY_SIGNAL,
      then task_work could trigger it.
      
      Fix it by only calling handle_signal() if we actually have a real signal
      to deliver. This brings it in line with all other archs, too.
      
      Fixes: b269c229
      
       ("ia64: add support for TIF_NOTIFY_SIGNAL")
      Reported-by: default avatarSergei Trofimovich <slyich@gmail.com>
      Reported-by: default avatarJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Tested-by: default avatarSergei Trofimovich <slyich@gmail.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      f5f4fc46
    • Chen Jun's avatar
      ftrace: Have recordmcount use w8 to read relp->r_info in arm64_is_fake_mcount · 999340d5
      Chen Jun authored
      On little endian system, Use aarch64_be(gcc v7.3) downloaded from
      linaro.org to build image with CONFIG_CPU_BIG_ENDIAN = y,
      CONFIG_FTRACE = y, CONFIG_DYNAMIC_FTRACE = y.
      
      gcc will create symbols of _mcount but recordmcount can not create
      mcount_loc for *.o.
      aarch64_be-linux-gnu-objdump -r fs/namei.o | grep mcount
      00000000000000d0 R_AARCH64_CALL26  _mcount
      ...
      0000000000007190 R_AARCH64_CALL26  _mcount
      
      The reason is than funciton arm64_is_fake_mcount can not work correctly.
      A symbol of _mcount in *.o compiled with big endian compiler likes:
      00 00 00 2d 00 00 01 1b
      w(rp->r_info) will return 0x2d instead of 0x011b. Because w() takes
      uint32_t as parameter, which truncates rp->r_info.
      
      Use w8() instead w() to read relp->r_info
      
      Link: https://lkml.kernel.org/r/20210222135840.56250-1-chenjun102@huawei.com
      
      Fixes: ea0eada4
      
       ("recordmcount: only record relocation of type R_AARCH64_CALL26 on arm64.")
      Acked-by: default avatarWill Deacon <will@kernel...>
      999340d5
    • Babu Moger's avatar
      KVM: SVM: Clear the CR4 register on reset · 9e46f6c6
      Babu Moger authored
      
      This problem was reported on a SVM guest while executing kexec.
      Kexec fails to load the new kernel when the PCID feature is enabled.
      
      When kexec starts loading the new kernel, it starts the process by
      resetting the vCPU's and then bringing each vCPU online one by one.
      The vCPU reset is supposed to reset all the register states before the
      vCPUs are brought online. However, the CR4 register is not reset during
      this process. If this register is already setup during the last boot,
      all the flags can remain intact. The X86_CR4_PCIDE bit can only be
      enabled in long mode. So, it must be enabled much later in SMP
      initialization.  Having the X86_CR4_PCIDE bit set during SMP boot can
      cause a boot failures.
      
      Fix the issue by resetting the CR4 register in init_vmcb().
      
      Signed-off-by: default avatarBabu Moger <babu.moger@amd.com>
      Message-Id: <161471109108.30811.6392805173629704166.stgit@bmoger-ubuntu>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9e46f6c6
    • David Woodhouse's avatar
      KVM: x86/xen: Add support for vCPU runstate information · 30b5c851
      David Woodhouse authored
      
      This is how Xen guests do steal time accounting. The hypervisor records
      the amount of time spent in each of running/runnable/blocked/offline
      states.
      
      In the Xen accounting, a vCPU is still in state RUNSTATE_running while
      in Xen for a hypercall or I/O trap, etc. Only if Xen explicitly schedules
      does the state become RUNSTATE_blocked. In KVM this means that even when
      the vCPU exits the kvm_run loop, the state remains RUNSTATE_running.
      
      The VMM can explicitly set the vCPU to RUNSTATE_blocked by using the
      KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_CURRENT attribute, and can also use
      KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_ADJUST to retrospectively add a given
      amount of time to the blocked state and subtract it from the running
      state.
      
      The state_entry_time corresponds to get_kvmclock_ns() at the time the
      vCPU entered the current state, and the total times of all four states
      should always add up to state_entry_time.
      
      Co-developed-by: default avatarJoao Martins <joao.m.martins@oracle.com>
      Signed-off-by: default avatarJoao Martins <joao.m.martins@oracle.com>
      Signed-off-by: default avatarDavid Woodhouse <dwmw@amazon.co.uk>
      Message-Id: <20210301125309.874953-2-dwmw2@infradead.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      30b5c851
    • David Woodhouse's avatar
      KVM: x86/xen: Fix return code when clearing vcpu_info and vcpu_time_info · 7d7c5f76
      David Woodhouse authored
      When clearing the per-vCPU shared regions, set the return value to zero
      to indicate success. This was causing spurious errors to be returned to
      userspace on soft reset.
      
      Also add a paranoid BUILD_BUG_ON() for compat structure compatibility.
      
      Fixes: 0c165b3c
      
       ("KVM: x86/xen: Allow reset of Xen attributes")
      Signed-off-by: default avatarDavid Woodhouse <dwmw@amazon.co.uk>
      Message-Id: <20210301125309.874953-1-dwmw2@infradead.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      7d7c5f76