1. 04 Mar, 2020 7 commits
    • Ionela Voinescu's avatar
      clocksource/drivers/arm_arch_timer: validate arch_timer_rate · dd5d4843
      Ionela Voinescu authored
      Using an arch timer with a frequency of less than 1MHz can potentially
      result in incorrect functionality in systems that assume a reasonable
      rate of the arch timer of 1 to 50MHz, described as typical in the
      architecture specification.
      Therefore, warn if the arch timer rate is below 1MHz, which is
      considered atypical and worth emphasizing.
      Signed-off-by: Ionela Voinescu's avatarIonela Voinescu <ionela.voinescu@arm.com>
      Suggested-by: default avatarValentin Schneider <valentin.schneider@arm.com>
      Acked-by: default avatarMarc Zyngier <maz@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Marc Zyngier <maz@kernel.org>
    • Ionela Voinescu's avatar
      arm64: use activity monitors for frequency invariance · d17966f6
      Ionela Voinescu authored
      The Frequency Invariance Engine (FIE) is providing a frequency
      scaling correction factor that helps achieve more accurate
      So far, for arm and arm64 platforms, this scale factor has been
      obtained based on the ratio between the current frequency and the
      maximum supported frequency recorded by the cpufreq policy. The
      setting of this scale factor is triggered from cpufreq drivers by
      calling arch_set_freq_scale. The current frequency used in computation
      is the frequency requested by a governor, but it may not be the
      frequency that was implemented by the platform.
      This correction factor can also be obtained using a core counter and a
      constant counter to get information on the performance (frequency based
      only) obtained in a period of time. This will more accurately reflect
      the actual current frequency of the CPU, compared with the alternative
      implementation that reflects the request of a performance level from
      the OS.
      Therefore, implement arch_scale_freq_tick to use activity monitors, if
      present, for the computation of the frequency scale factor.
      The use of AMU counters depends on:
       - CONFIG_ARM64_AMU_EXTN - depents on the AMU extension being present
       - CONFIG_CPU_FREQ - the current frequency obtained using counter
         information is divided by the maximum frequency obtained from the
         cpufreq policy.
      While it is possible to have a combination of CPUs in the system with
      and without support for activity monitors, the use of counters for
      frequency invariance is only enabled for a CPU if all related CPUs
      (CPUs in the same frequency domain) support and have enabled the core
      and constant activity monitor counters. In this way, there is a clear
      separation between the policies for which arch_set_freq_scale (cpufreq
      based FIE) is used, and the policies for which arch_scale_freq_tick
      (counter based FIE) is used to set the frequency scale factor. For
      this purpose, a late_initcall_sync is registered to trigger validation
      work for policies that will enable or disable the use of AMU counters
      for frequency invariance. If CONFIG_CPU_FREQ is not defined, the use
      of counters is enabled on all CPUs only if all possible CPUs correctly
      support the necessary counters.
      Signed-off-by: Ionela Voinescu's avatarIonela Voinescu <ionela.voinescu@arm.com>
      Reviewed-by: Lukasz Luba's avatarLukasz Luba <lukasz.luba@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
    • Ionela Voinescu's avatar
      cpufreq: add function to get the hardware max frequency · 249fa9e2
      Ionela Voinescu authored
      Add weak function to return the hardware maximum frequency of a CPU,
      with the default implementation returning cpuinfo.max_freq, which is
      the best information we can generically get from the cpufreq framework.
      The default can be overwritten by a strong function in platforms
      that want to provide an alternative implementation, with more accurate
      information, obtained either from hardware or firmware.
      Signed-off-by: Ionela Voinescu's avatarIonela Voinescu <ionela.voinescu@arm.com>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Reviewed-by: default avatarValentin Schneider <valentin.schneider@arm.com>
      Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
      Cc: Viresh Kumar <viresh.kumar@linaro.org>
    • Ionela Voinescu's avatar
      Documentation: arm64: document support for the AMU extension · 16d8927a
      Ionela Voinescu authored
      The activity monitors extension is an optional extension introduced
      by the ARMv8.4 CPU architecture.
      Add initial documentation for the AMUv1 extension:
       - arm64/amu.txt: AMUv1 documentation
       - arm64/booting.txt: system registers initialisation
      Signed-off-by: Ionela Voinescu's avatarIonela Voinescu <ionela.voinescu@arm.com>
      Reviewed-by: default avatarValentin Schneider <valentin.schneider@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
    • Ionela Voinescu's avatar
      arm64/kvm: disable access to AMU registers from kvm guests · e980286b
      Ionela Voinescu authored
      Access to the AMU counters should be disabled by default in kvm guests,
      as information from the counters might reveal activity in other guests
      or activity on the host.
      Therefore, disable access to AMU registers from EL0 and EL1 in kvm
      guests by:
       - Hiding the presence of the extension in the feature register
         (SYS_ID_AA64PFR0_EL1) on the VCPU.
       - Disabling access to the AMU registers before switching to the guest.
       - Trapping accesses and injecting an undefined instruction into the
      Signed-off-by: Ionela Voinescu's avatarIonela Voinescu <ionela.voinescu@arm.com>
      Reviewed-by: default avatarValentin Schneider <valentin.schneider@arm.com>
      Reviewed-by: Suzuki Poulose's avatarSuzuki K Poulose <suzuki.poulose@arm.com>
      Acked-by: default avatarMarc Zyngier <maz@kernel.org>
      Cc: Marc Zyngier <maz@kernel.org>
      Cc: James Morse <james.morse@arm.com>
      Cc: Julien Thierry <julien.thierry.kdev@gmail.com>
      Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will@kernel.org>
    • Ionela Voinescu's avatar
      arm64: trap to EL1 accesses to AMU counters from EL0 · e586fc33
      Ionela Voinescu authored
      The activity monitors extension is an optional extension introduced
      by the ARMv8.4 CPU architecture. In order to access the activity
      monitors counters safely, if desired, the kernel should detect the
      presence of the extension through the feature register, and mediate
      the access.
      Therefore, disable direct accesses to activity monitors counters
      from EL0 (userspace) and trap them to EL1 (kernel).
      To be noted that the ARM64_AMU_EXTN kernel config does not have an
      effect on this code. Given that the amuserenr_el0 resets to an
      UNKNOWN value, setting the trap of EL0 accesses to EL1 is always
      attempted for safety and security considerations. Therefore firmware
      should still ensure accesses to AMU registers are not trapped in
      EL2/EL3 as this code cannot be bypassed if the CPU implements the
      Activity Monitors Unit.
      Signed-off-by: Ionela Voinescu's avatarIonela Voinescu <ionela.voinescu@arm.com>
      Reviewed-by: Suzuki Poulose's avatarSuzuki K Poulose <suzuki.poulose@arm.com>
      Reviewed-by: default avatarValentin Schneider <valentin.schneider@arm.com>
      Reviewed-by: James Morse's avatarJames Morse <james.morse@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Steve Capper <steve.capper@arm.com>
    • Ionela Voinescu's avatar
      arm64: add support for the AMU extension v1 · 09651360
      Ionela Voinescu authored
      The activity monitors extension is an optional extension introduced
      by the ARMv8.4 CPU architecture. This implements basic support for
      version 1 of the activity monitors architecture, AMUv1.
      This support includes:
      - Extension detection on each CPU (boot, secondary, hotplugged)
      - Register interface for AMU aarch64 registers
      Signed-off-by: Ionela Voinescu's avatarIonela Voinescu <ionela.voinescu@arm.com>
      Reviewed-by: default avatarValentin Schneider <valentin.schneider@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
      Cc: Marc Zyngier <maz@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
  2. 26 Feb, 2020 7 commits
    • Linus Torvalds's avatar
      Merge tag 'tag-chrome-platform-fixes-for-v5.6-rc4' of... · bfdc6d91
      Linus Torvalds authored
      Merge tag 'tag-chrome-platform-fixes-for-v5.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux
      Pull chrome platform fix from Benson Leung:
       "Fix a build warning"
      * tag 'tag-chrome-platform-fixes-for-v5.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux:
        platform/chrome: wilco_ec: Include asm/unaligned instead of linux/ path
    • Linus Torvalds's avatar
      Merge tag 'trace-v5.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 91ad64a8
      Linus Torvalds authored
      Pull tracing and bootconfig updates:
       "Fixes and changes to bootconfig before it goes live in a release.
        Change in API of bootconfig (before it comes live in a release):
        - Have a magic value "BOOTCONFIG" in initrd to know a bootconfig
        - Set CONFIG_BOOT_CONFIG to 'n' by default
        - Show error if "bootconfig" on cmdline but not compiled in
        - Prevent redefining the same value
        - Have a way to append values
        - Added a SELECT BLK_DEV_INITRD to fix a build failure
        Synthetic event fixes:
        - Switch to raw_smp_processor_id() for recording CPU value in preempt
          section. (No care for what the value actually is)
        - Fix samples always recording u64 values
        - Fix endianess
        - Check number of values matches number of fields
        - Fix a printing bug
        Fix of trace_printk() breaking postponed start up tests
        Make a function static that is only used in a single file"
      * tag 'trace-v5.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        bootconfig: Fix CONFIG_BOOTTIME_TRACING dependency issue
        bootconfig: Add append value operator support
        bootconfig: Prohibit re-defining value on same key
        bootconfig: Print array as multiple commands for legacy command line
        bootconfig: Reject subkey and value on same parent key
        tools/bootconfig: Remove unneeded error message silencer
        bootconfig: Add bootconfig magic word for indicating bootconfig explicitly
        bootconfig: Set CONFIG_BOOT_CONFIG=n by default
        tracing: Clear trace_state when starting trace
        bootconfig: Mark boot_config_checksum() static
        tracing: Disable trace_printk() on post poned tests
        tracing: Have synthetic event test use raw_smp_processor_id()
        tracing: Fix number printing bug in print_synth_event()
        tracing: Check that number of vals matches number of synth event fields
        tracing: Make synth_event trace functions endian-correct
        tracing: Make sure synth_event_trace() example always uses u64
    • Linus Torvalds's avatar
      Merge tag 'linux-kselftest-kunit-5.6-rc4' of... · b98cce1e
      Linus Torvalds authored
      Merge tag 'linux-kselftest-kunit-5.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      Pull Kunit fixes from Shuah Khan:
       "This Kselftest kunit update consists of fixes to documentation and
        the run-time tool from Brendan Higgins and Heidi Fahim"
      * tag 'linux-kselftest-kunit-5.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
        kunit: run kunit_tool from any directory
        kunit: test: Improve error messages for kunit_tool when kunitconfig is invalid
        Documentation: kunit: fixed sphinx error in code block
    • Linus Torvalds's avatar
      Merge tag 'linux-kselftest-5.6-rc4' of... · 2fcc7417
      Linus Torvalds authored
      Merge tag 'linux-kselftest-5.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      Pull Kselftest fixes from Shuah Khan:
       - fixes to TIMEOUT failures and out-of-tree compilation compilation
         errors from Michael Ellerman.
       - declutter git status fix from Christophe Leroy
      * tag 'linux-kselftest-5.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
        selftests/rseq: Fix out-of-tree compilation
        selftests: Install settings files to fix TIMEOUT failures
        selftest/lkdtm: Don't pollute 'git status'
    • Christoph Hellwig's avatar
      Revert "KVM: x86: enable -Werror" · cfe2ce49
      Christoph Hellwig authored
      This reverts commit ead68df9
      Using the -Werror flag breaks the build for me due to mostly harmless
      KASAN or similar warnings:
        arch/x86/kvm/x86.c: In function ‘kvm_timer_init’:
        arch/x86/kvm/x86.c:7209:1: error: the frame size of 1112 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
      Feel free to add a CONFIG_WERROR if you care strong enough, but don't
      break peoples builds for absolutely no good reason.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    • Linus Torvalds's avatar
      signal: avoid double atomic counter increments for user accounting · fda31c50
      Linus Torvalds authored
      When queueing a signal, we increment both the users count of pending
      signals (for RLIMIT_SIGPENDING tracking) and we increment the refcount
      of the user struct itself (because we keep a reference to the user in
      the signal structure in order to correctly account for it when freeing).
      That turns out to be fairly expensive, because both of them are atomic
      updates, and particularly under extreme signal handling pressure on big
      machines, you can get a lot of cache contention on the user struct.
      That can then cause horrid cacheline ping-pong when you do these
      multiple accesses.
      So change the reference counting to only pin the user for the _first_
      pending signal, and to unpin it when the last pending signal is
      dequeued.  That means that when a user sees a lot of concurrent signal
      queuing - which is the only situation when this matters - the only
      atomic access needed is generally the 'sigpending' count update.
      This was noticed because of a particularly odd timing artifact on a
      dual-socket 96C/192T Cascade Lake platform: when you get into bad
      contention, on that machine for some reason seems to be much worse when
      the contention happens in the upper 32-byte half of the cacheline.
      As a result, the kernel test robot will-it-scale 'signal1' benchmark had
      an odd performance regression simply due to random alignment of the
      'struct user_struct' (and pointed to a completely unrelated and
      apparently nonsensical commit for the regression).
      Avoiding the double increments (and decrements on the dequeueing side,
      of course) makes for much less contention and hugely improved
      performance on that will-it-scale microbenchmark.
      Quoting Feng Tang:
       "It makes a big difference, that the performance score is tripled! bump
        from original 17000 to 54000. Also the gap between 5.0-rc6 and
        5.0-rc6+Jiri's patch is reduced to around 2%"
      [ The "2% gap" is the odd cacheline placement difference on that
        platform: under the extreme contention case, the effect of which half
        of the cacheline was hot was 5%, so with the reduced contention the
        odd timing artifact is reduced too ]
      It does help in the non-contended case too, but is not nearly as
      Reported-and-tested-by: default avatarFeng Tang <feng.tang@intel.com>
      Cc: Eric W. Biederman <ebiederm@xmission.com>
      Cc: Huang, Ying <ying.huang@intel.com>
      Cc: Philip Li <philip.li@intel.com>
      Cc: Andi Kleen <andi.kleen@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    • Masami Hiramatsu's avatar
      bootconfig: Fix CONFIG_BOOTTIME_TRACING dependency issue · 2910b5aa
      Masami Hiramatsu authored
      Since commit d8a953dd ("bootconfig: Set CONFIG_BOOT_CONFIG=n by
      default") also changed the CONFIG_BOOTTIME_TRACING to select
      CONFIG_BOOT_CONFIG to show the boot-time tracing on the menu,
      it introduced wrong dependencies with BLK_DEV_INITRD as below.
      WARNING: unmet direct dependencies detected for BOOT_CONFIG
        Depends on [n]: BLK_DEV_INITRD [=n]
        Selected by [y]:
        - BOOTTIME_TRACING [=y] && TRACING_SUPPORT [=y] && FTRACE [=y] && TRACING [=y]
      This makes the CONFIG_BOOT_CONFIG selects CONFIG_BLK_DEV_INITRD to
      fix this error and make CONFIG_BOOTTIME_TRACING=n by default, so
      that both boot-time tracing and boot configuration off but those
      appear on the menu list.
      Link: http://lkml.kernel.org/r/158264140162.23842.11237423518607465535.stgit@devnote2
      Fixes: d8a953dd
       ("bootconfig: Set CONFIG_BOOT_CONFIG=n by default")
      Reported-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Compiled-tested-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
  3. 25 Feb, 2020 3 commits
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linux-5.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · c5f86891
      Linus Torvalds authored
      Pull RISC-V fixes from Palmer Dabbelt:
       "This contains a handful of RISC-V related fixes that I've collected
        and would like to target for 5.6-rc4:
         - A fix to set up the PMPs on boot, which allows the kernel to access
           memory on systems that don't set up permissive PMPs before getting
           to Linux. This only effects machine-mode kernels, which currently
           means only NOMMU kernels.
         - A fix to avoid enabling supervisor-mode interrupts when running in
           machine-mode, also only for NOMMU kernels.
         - A pair of fixes to our KASAN support to avoid corrupting memory.
         - A gitignore fix.
        This boots on QEMU's virt board for me"
      * tag 'riscv-for-linux-5.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        riscv: adjust the indent
        riscv: allocate a complete page size for each page table
        riscv: Fix gitignore
        RISC-V: Don't enable all interrupts in trap_init()
        riscv: set pmp configuration if kernel is running in M-mode
    • Linus Torvalds's avatar
      Merge branch 'mips-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux · d67f250e
      Linus Torvalds authored
      Pull MIPS fixes from Paul Burton:
       "Here are a few MIPS fixes, and a MAINTAINERS update to hand over MIPS
        maintenance to Thomas Bogendoerfer - this will be my final pull
        request as MIPS maintainer.
        Thanks for your helpful comments, useful corrections & responsiveness
        during the time I've fulfilled the role, and I'm sure I'll pop up
        elsewhere in the tree somewhere down the line"
      * 'mips-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
        MAINTAINERS: Hand MIPS over to Thomas
        MIPS: ingenic: DTS: Fix watchdog nodes
        MIPS: X1000: Fix clock of watchdog node.
        MIPS: vdso: Wrap -mexplicit-relocs in cc-option
        MIPS: VPE: Fix a double free and a memory leak in 'release_vpe()'
        MIPS: cavium_octeon: Fix syncw generation.
        mips: vdso: add build time check that no 'jalr t9' calls left
        MIPS: Disable VDSO time functionality on microMIPS
        mips: vdso: fix 'jalr t9' crash in vdso code
    • Paul Burton's avatar
      MAINTAINERS: Hand MIPS over to Thomas · 3234f4ed
      Paul Burton authored
      My time with MIPS the company has reached its end, and so at best I'll
      have little time spend on maintaining arch/mips/.
      Ralf last authored a patch over 2 years ago, the last time he committed
      one is even further back & activity was sporadic for a while before
      that. The reality is that he isn't active.
      Having a new maintainer with time to do things properly will be
      beneficial all round. Thomas Bogendoerfer has been involved in MIPS
      development for a long time & has offered to step up as maintainer, so
      add Thomas and remove myself & Ralf from the MIPS entry.
      Ralf already has an entry in CREDITS to honor his contributions, so this
      just adds one for me.
      Signed-off-by: default avatarPaul Burton <paulburton@kernel.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Acked-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@vger.kernel.org
  4. 24 Feb, 2020 8 commits
  5. 23 Feb, 2020 12 commits
    • Linus Torvalds's avatar
      Merge tag 'for-5.6-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · d2eee258
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
       "These are fixes that were found during testing with help of error
        injection, plus some other stable material.
        There's a fixup to patch added to rc1 causing locking in wrong context
        warnings, tests found one more deadlock scenario. The patches are
        tagged for stable, two of them now in the queue but we'd like all
        three released at the same time.
        I'm not happy about fixes to fixes in such a fast succession during
        rcs, but I hope we found all the fallouts of commit 28553fa9
        ('Btrfs: fix race between shrinking truncate and fiemap')"
      * tag 'for-5.6-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        Btrfs: fix deadlock during fast fsync when logging prealloc extents beyond eof
        Btrfs: fix btrfs_wait_ordered_range() so that it waits for all ordered extents
        btrfs: fix bytes_may_use underflow in prealloc error condtition
        btrfs: handle logged extent failure properly
        btrfs: do not check delayed items are empty for single transaction cleanup
        btrfs: reset fs_root to NULL on error in open_ctree
        btrfs: destroy qgroup extent records on transaction abort
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · a3163ca0
      Linus Torvalds authored
      Pull ext4 fixes from Ted Ts'o:
       "More miscellaneous ext4 bug fixes (all stable fodder)"
      * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: fix mount failure with quota configured as module
        jbd2: fix ocfs2 corrupt when clearing block group bits
        ext4: fix race between writepages and enabling EXT4_EXTENTS_FL
        ext4: rename s_journal_flag_rwsem to s_writepages_rwsem
        ext4: fix potential race between s_flex_groups online resizing and access
        ext4: fix potential race between s_group_info online resizing and access
        ext4: fix potential race between online resizing and write operations
        ext4: add cond_resched() to __ext4_find_entry()
        ext4: fix a data race in EXT4_I(inode)->i_disksize
    • Linus Torvalds's avatar
      Merge tag 'csky-for-linus-5.6-rc3' of git://github.com/c-sky/csky-linux · c6188dff
      Linus Torvalds authored
      Pull csky updates from Guo Ren:
       "Sorry, I missed 5.6-rc1 merge window, but in this pull request the
        most are the fixes and the rests are between fixes and features. The
        only outside modification is the MAINTAINERS file update with our
        mailing list.
         - cache flush implementation fixes
         - ftrace modify panic fix
         - CONFIG_SMP boot problem fix
         - fix pt_regs saving for atomic.S
         - fix fixaddr_init without highmem.
         - fix stack protector support
         - fix fake Tightly-Coupled Memory code compile and use
         - fix some typos and coding convention"
      * tag 'csky-for-linus-5.6-rc3' of git://github.com/c-sky/csky-linux: (23 commits)
        csky: Replace <linux/clk-provider.h> by <linux/of_clk.h>
        csky: Implement copy_thread_tls
        csky: Add PCI support
        csky: Minimize defconfig to support buildroot config.fragment
        csky: Add setup_initrd check code
        csky: Cleanup old Kconfig options
        arch/csky: fix some Kconfig typos
        csky: Fixup compile warning for three unimplemented syscalls
        csky: Remove unused cache implementation
        csky: Fixup ftrace modify panic
        csky: Add flush_icache_mm to defer flush icache all
        csky: Optimize abiv2 copy_to_user_page with VM_EXEC
        csky: Enable defer flush_dcache_page for abiv2 cpus (807/810/860)
        csky: Remove unnecessary flush_icache_* implementation
        csky: Support icache flush without specific instructions
        csky/Kconfig: Add Kconfig.platforms to support some drivers
        csky/smp: Fixup boot failed when CONFIG_SMP
        csky: Set regs->usp to kernel sp, when the exception is from kernel
        csky/mm: Fixup export invalid_pte_table symbol
        csky: Separate fixaddr_init from highmem
    • Oliver Upton's avatar
      KVM: nVMX: Check IO instruction VM-exit conditions · 35a57134
      Oliver Upton authored
      Consult the 'unconditional IO exiting' and 'use IO bitmaps' VM-execution
      controls when checking instruction interception. If the 'use IO bitmaps'
      VM-execution control is 1, check the instruction access against the IO
      bitmaps to determine if the instruction causes a VM-exit.
      Signed-off-by: default avatarOliver Upton <oupton@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    • Oliver Upton's avatar
      KVM: nVMX: Refactor IO bitmap checks into helper function · e71237d3
      Oliver Upton authored
      Checks against the IO bitmap are useful for both instruction emulation
      and VM-exit reflection. Refactor the IO bitmap checks into a helper
      Signed-off-by: default avatarOliver Upton <oupton@google.com>
      Reviewed-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    • Paolo Bonzini's avatar
      KVM: nVMX: Don't emulate instructions in guest mode · 07721fee
      Paolo Bonzini authored
      vmx_check_intercept is not yet fully implemented. To avoid emulating
      instructions disallowed by the L1 hypervisor, refuse to emulate
      instructions by default.
      Cc: stable@vger.kernel.org
      [Made commit, added commit msg - Oliver]
      Signed-off-by: default avatarOliver Upton <oupton@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    • Oliver Upton's avatar
      KVM: nVMX: Emulate MTF when performing instruction emulation · 5ef8acbd
      Oliver Upton authored
      Since commit 5f3d45e7 ("kvm/x86: add support for
      MONITOR_TRAP_FLAG"), KVM has allowed an L1 guest to use the monitor trap
      flag processor-based execution control for its L2 guest. KVM simply
      forwards any MTF VM-exits to the L1 guest, which works for normal
      instruction execution.
      However, when KVM needs to emulate an instruction on the behalf of an L2
      guest, the monitor trap flag is not emulated. Add the necessary logic to
      kvm_skip_emulated_instruction() to synthesize an MTF VM-exit to L1 upon
      instruction emulation for L2.
      Fixes: 5f3d45e7
       ("kvm/x86: add support for MONITOR_TRAP_FLAG")
      Signed-off-by: default avatarOliver Upton <oupton@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    • Li RongQing's avatar
      KVM: fix error handling in svm_hardware_setup · dd58f3c9
      Li RongQing authored
      rename svm_hardware_unsetup as svm_hardware_teardown, move
      it before svm_hardware_setup, and call it to free all memory
      if fail to setup in svm_hardware_setup, otherwise memory will
      be leaked
      remove __exit attribute for it since it is called in __init
      Signed-off-by: default avatarLi RongQing <lirongqing@baidu.com>
      Reviewed-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    • Geert Uytterhoeven's avatar
      csky: Replace <linux/clk-provider.h> by <linux/of_clk.h> · 99db590b
      Geert Uytterhoeven authored
      The C-Sky platform code is not a clock provider, and just needs to call
      Hence it can include <linux/of_clk.h> instead of <linux/clk-provider.h>.
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
    • Linus Torvalds's avatar
      Merge tag 'ras-urgent-2020-02-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · dca132a6
      Linus Torvalds authored
      Pull RAS fixes from Thomas Gleixner:
       "Two fixes for the AMD MCE driver:
         - Populate the per CPU MCA bank descriptor pointer only after it has
           been completely set up to prevent a use-after-free in case that one
           of the subsequent initialization step fails
         - Implement a proper release function for the sysfs entries of MCA
           threshold controls instead of freeing the memory right in the CPU
           teardown code, which leads to another use-after-free when the
           associated sysfs file is opened and accessed"
      * tag 'ras-urgent-2020-02-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mce/amd: Fix kobject lifetime
        x86/mce/amd: Publish the bank pointer only after setup has succeeded
    • Linus Torvalds's avatar
      Merge tag 'irq-urgent-2020-02-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · f3cc2494
      Linus Torvalds authored
      Pull irq fixes from Thomas Gleixner:
       "Two fixes for the irq core code which are follow ups to the recent MSI
         - The WARN_ON which was put into the MSI setaffinity callback for
           paranoia reasons actually triggered via a callchain which escaped
           when all the possible ways to reach that code were analyzed.
           The proc/irq/$N/*affinity interfaces have a quirk which came in
           when ALPHA moved to the generic interface: In case that the written
           affinity mask does not contain any online CPU it calls into ALPHAs
           magic auto affinity setting code.
           A few years later this mechanism was also made available to x86 for
           no good reasons and in a way which circumvents all sanity checks
           for interrupts which cannot have their affinity set from process
           context on X86 due to the way the X86 interrupt delivery works.
           It would be possible to make this work properly, but there is no
           point in doing so. If the interrupt is not yet started then the
           affinity setting has no effect and if it is started already then it
           is already assigned to an online CPU so there is no point to
           randomly move it to some other CPU. Just return EINVAL as the code
           has done before that change forever.
         - The new MSI quirk bit in the irq domain flags turned out to be
           already occupied, which escaped the author and the reviewers
           because the already in use bits were 0,6,2,3,4,5 listed in that
           That bit 6 was simply overlooked because the ordering was straight
           forward linear otherwise. So the new bit ended up being a
           Fix it up by switching the oddball 6 to the obvious 1"
      * tag 'irq-urgent-2020-02-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        genirq/irqdomain: Make sure all irq domain flags are distinct
        genirq/proc: Reject invalid affinity masks (again)
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2020-02-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · fca10378
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "Two fixes for x86:
         - Remove the __force_oder definiton from the kaslr boot code as it is
           already defined in the page table code which makes GCC 10 builds
           fail because it changed the default to -fno-common.
         - Address the AMD erratum 1054 concerning the IRPERF capability and
           enable the Instructions Retired fixed counter on machines which are
           not affected by the erratum"
      * tag 'x86-urgent-2020-02-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/cpu/amd: Enable the fixed Instructions Retired counter IRPERF
        x86/boot/compressed: Don't declare __force_order in kaslr_64.c
  6. 22 Feb, 2020 3 commits