1. 06 11月, 2019 1 次提交
  2. 29 10月, 2019 1 次提交
  3. 25 10月, 2019 3 次提交
  4. 16 10月, 2019 2 次提交
  5. 14 10月, 2019 1 次提交
    • M
      arm64: simplify syscall wrapper ifdeffery · ce87de45
      Mark Rutland 提交于
      Back in commit:
      
        4378a7d4 ("arm64: implement syscall wrappers")
      
      ... I implemented the arm64 syscall wrapper glue following the approach
      taken on x86. While doing so, I also copied across some ifdeffery that
      isn't necessary on arm64.
      
      On arm64 we don't share any of the native wrappers with compat tasks,
      and unlike x86 we don't have alternative implementations of
      SYSCALL_DEFINE0(), COND_SYSCALL(), or SYS_NI() defined when AArch32
      compat support is enabled.
      
      Thus we don't need to prevent multiple definitions of these macros, and
      can remove the #ifndef ... #endif guards protecting them. If any of
      these had been previously defined elsewhere, syscalls are unlikely to
      work correctly, and we'd want the compiler to warn about the multiple
      definitions.
      Acked-by: NWill Deacon <will@kernel.org>
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      ce87de45
  6. 08 10月, 2019 1 次提交
  7. 07 10月, 2019 11 次提交
  8. 04 10月, 2019 6 次提交
    • M
      ARM: dts: sunxi: Revert phy-names removal for ECHI and OHCI · e6064cf4
      Maxime Ripard 提交于
      This reverts commits 3d109bdc ("ARM: dts: sunxi: Remove useless
      phy-names from EHCI and OHCI"), 0a3df8bb ("ARM: dts: sunxi: h3/h5:
      Remove useless phy-names from EHCI and OHCI") and 3c7ab90a ("arm64:
      dts: allwinner: Remove useless phy-names from EHCI and OHCI").
      
      It turns out that while the USB bindings were not mentionning it, the PHY
      client bindings were mandating that phy-names is set when phys is. Let's
      add it back.
      
      Fixes: 3d109bdc ("ARM: dts: sunxi: Remove useless phy-names from EHCI and OHCI")
      Fixes: 0a3df8bb ("ARM: dts: sunxi: h3/h5: Remove useless phy-names from EHCI and OHCI")
      Fixes: 3c7ab90a ("arm64: dts: allwinner: Remove useless phy-names from EHCI and OHCI")
      Reported-by: NEmmanuel Vadot <manu@bidouilliste.com>
      Signed-off-by: NMaxime Ripard <mripard@kernel.org>
      Link: https://lore.kernel.org/r/20191002112651.100504-1-mripard@kernel.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e6064cf4
    • J
      arm64: ftrace: Ensure synchronisation in PLT setup for Neoverse-N1 #1542419 · dd8a1f13
      James Morse 提交于
      CPUs affected by Neoverse-N1 #1542419 may execute a stale instruction if
      it was recently modified. The affected sequence requires freshly written
      instructions to be executable before a branch to them is updated.
      
      There are very few places in the kernel that modify executable text,
      all but one come with sufficient synchronisation:
       * The module loader's flush_module_icache() calls flush_icache_range(),
         which does a kick_all_cpus_sync()
       * bpf_int_jit_compile() calls flush_icache_range().
       * Kprobes calls aarch64_insn_patch_text(), which does its work in
         stop_machine().
       * static keys and ftrace both patch between nops and branches to
         existing kernel code (not generated code).
      
      The affected sequence is the interaction between ftrace and modules.
      The module PLT is cleaned using __flush_icache_range() as the trampoline
      shouldn't be executable until we update the branch to it.
      
      Drop the double-underscore so that this path runs kick_all_cpus_sync()
      too.
      Signed-off-by: NJames Morse <james.morse@arm.com>
      Signed-off-by: NWill Deacon <will@kernel.org>
      dd8a1f13
    • J
      arm64: Fix incorrect irqflag restore for priority masking for compat · f46f27a5
      James Morse 提交于
      Commit bd82d4bd ("arm64: Fix incorrect irqflag restore for priority
      masking") added a macro to the entry.S call paths that leave the
      PSTATE.I bit set. This tells the pPNMI masking logic that interrupts
      are masked by the CPU, not by the PMR. This value is read back by
      local_daif_save().
      
      Commit bd82d4bd added this call to el0_svc, as el0_svc_handler
      is called with interrupts masked. el0_svc_compat was missed, but should
      be covered in the same way as both of these paths end up in
      el0_svc_common(), which expects to unmask interrupts.
      
      Fixes: bd82d4bd ("arm64: Fix incorrect irqflag restore for priority masking")
      Signed-off-by: NJames Morse <james.morse@arm.com>
      Cc: Julien Thierry <julien.thierry.kdev@gmail.com>
      Signed-off-by: NWill Deacon <will@kernel.org>
      f46f27a5
    • M
      arm64: mm: avoid virt_to_phys(init_mm.pgd) · e4365f96
      Mark Rutland 提交于
      If we take an unhandled fault in the kernel, we call show_pte() to dump
      the {PGDP,PGD,PUD,PMD,PTE} values for the corresponding page table walk,
      where the PGDP value is virt_to_phys(mm->pgd).
      
      The boot-time and runtime kernel page tables, init_pg_dir and
      swapper_pg_dir respectively, are kernel symbols. Thus, it is not valid
      to call virt_to_phys() on either of these, though we'll do so if we take
      a fault on a TTBR1 address.
      
      When CONFIG_DEBUG_VIRTUAL is not selected, virt_to_phys() will silently
      fix this up. However, when CONFIG_DEBUG_VIRTUAL is selected, this
      results in splats as below. Depending on when these occur, they can
      happen to suppress information needed to debug the original unhandled
      fault, such as the backtrace:
      
      | Unable to handle kernel paging request at virtual address ffff7fffec73cf0f
      | Mem abort info:
      |   ESR = 0x96000004
      |   EC = 0x25: DABT (current EL), IL = 32 bits
      |   SET = 0, FnV = 0
      |   EA = 0, S1PTW = 0
      | Data abort info:
      |   ISV = 0, ISS = 0x00000004
      |   CM = 0, WnR = 0
      | ------------[ cut here ]------------
      | virt_to_phys used for non-linear address: 00000000102c9dbe (swapper_pg_dir+0x0/0x1000)
      | WARNING: CPU: 1 PID: 7558 at arch/arm64/mm/physaddr.c:15 __virt_to_phys+0xe0/0x170 arch/arm64/mm/physaddr.c:12
      | Kernel panic - not syncing: panic_on_warn set ...
      | SMP: stopping secondary CPUs
      | Dumping ftrace buffer:
      |    (ftrace buffer empty)
      | Kernel Offset: disabled
      | CPU features: 0x0002,23000438
      | Memory Limit: none
      | Rebooting in 1 seconds..
      
      We can avoid this by ensuring that we call __pa_symbol() for
      init_mm.pgd, as this will always be a kernel symbol. As the dumped
      {PGD,PUD,PMD,PTE} values are the raw values from the relevant entries we
      don't need to handle these specially.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Cc: James Morse <james.morse@arm.com>
      Signed-off-by: NWill Deacon <will@kernel.org>
      e4365f96
    • J
      arm64: cpufeature: Effectively expose FRINT capability to userspace · 7230f7e9
      Julien Grall 提交于
      The HWCAP framework will detect a new capability based on the sanitized
      version of the ID registers.
      
      Sanitization is based on a whitelist, so any field not described will end
      up to be zeroed.
      
      At the moment, ID_AA64ISAR1_EL1.FRINTTS is not described in
      ftr_id_aa64isar1. This means the field will be zeroed and therefore the
      userspace will not be able to see the HWCAP even if the hardware
      supports the feature.
      
      This can be fixed by describing the field in ftr_id_aa64isar1.
      
      Fixes: ca9503fc ("arm64: Expose FRINT capabilities to userspace")
      Signed-off-by: NJulien Grall <julien.grall@arm.com>
      Cc: mark.brown@arm.com
      Signed-off-by: NWill Deacon <will@kernel.org>
      7230f7e9
    • W
      arm64: Mark functions using explicit register variables as '__always_inline' · a48e61de
      Will Deacon 提交于
      As of ac7c3e4f ("compiler: enable CONFIG_OPTIMIZE_INLINING forcibly"),
      inline functions are no longer annotated with '__always_inline', which
      allows the compiler to decide whether inlining is really a good idea or
      not. Although this is a great idea on paper, the reality is that AArch64
      GCC prior to 9.1 has been shown to get confused when creating an
      out-of-line copy of a function passing explicit 'register' variables
      into an inline assembly block:
      
        https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91111
      
      It's not clear whether this is specific to arm64 or not but, for now,
      ensure that all of our functions using 'register' variables are marked
      as '__always_inline' so that the old behaviour is effectively preserved.
      
      Hopefully other architectures are luckier with their compilers.
      
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: NWill Deacon <will@kernel.org>
      a48e61de
  9. 02 10月, 2019 1 次提交
  10. 01 10月, 2019 3 次提交
    • M
      arm64/sve: Fix wrong free for task->thread.sve_state · 4585fc59
      Masayoshi Mizuma 提交于
      The system which has SVE feature crashed because of
      the memory pointed by task->thread.sve_state was destroyed
      by someone.
      
      That is because sve_state is freed while the forking the
      child process. The child process has the pointer of sve_state
      which is same as the parent's because the child's task_struct
      is copied from the parent's one. If the copy_process()
      fails as an error on somewhere, for example, copy_creds(),
      then the sve_state is freed even if the parent is alive.
      The flow is as follows.
      
      copy_process
              p = dup_task_struct
                  => arch_dup_task_struct
                      *dst = *src;  // copy the entire region.
      :
              retval = copy_creds
              if (retval < 0)
                      goto bad_fork_free;
      :
      bad_fork_free:
      ...
              delayed_free_task(p);
                => free_task
                   => arch_release_task_struct
                      => fpsimd_release_task
                         => __sve_free
                            => kfree(task->thread.sve_state);
                               // free the parent's sve_state
      
      Move child's sve_state = NULL and clearing TIF_SVE flag
      to arch_dup_task_struct() so that the child doesn't free the
      parent's one.
      There is no need to wait until copy_process() to clear TIF_SVE for
      dst, because the thread flags for dst are initialized already by
      copying the src task_struct.
      This change simplifies the code, so get rid of comments that are no
      longer needed.
      
      As a note, arm64 used to have thread_info on the stack. So it
      would not be possible to clear TIF_SVE until the stack is initialized.
      From commit c02433dd ("arm64: split thread_info from task stack"),
      the thread_info is part of the task, so it should be valid to modify
      the flag from arch_dup_task_struct().
      
      Cc: stable@vger.kernel.org # 4.15.x-
      Fixes: bc0ee476 ("arm64/sve: Core task context handling")
      Signed-off-by: NMasayoshi Mizuma <m.mizuma@jp.fujitsu.com>
      Reported-by: NHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
      Suggested-by: NDave Martin <Dave.Martin@arm.com>
      Reviewed-by: NDave Martin <Dave.Martin@arm.com>
      Tested-by: NJulien Grall <julien.grall@arm.com>
      Signed-off-by: NWill Deacon <will@kernel.org>
      4585fc59
    • T
      arm64: errata: Update stale comment · 7a292b6c
      Thierry Reding 提交于
      Commit 73f38166 ("arm64: Advertise mitigation of Spectre-v2, or lack
      thereof") renamed the caller of the install_bp_hardening_cb() function
      but forgot to update a comment, which can be confusing when trying to
      follow the code flow.
      
      Fixes: 73f38166 ("arm64: Advertise mitigation of Spectre-v2, or lack thereof")
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NWill Deacon <will@kernel.org>
      7a292b6c
    • K
      arm64/ARM: configs: Change CONFIG_REMOTEPROC from m to y · a304c0a6
      Keerthy 提交于
      Commit 6334150e ("remoteproc: don't allow modular build")
      changes CONFIG_REMOTEPROC to a boolean from a tristate config
      option which inhibits all defconfigs marking CONFIG_REMOTEPROC as
      a module in compiling the remoteproc and dependent config options.
      
      So fix the configs to have CONFIG_REMOTEPROC built in.
      
      Link: https://lore.kernel.org/r/20190920075946.13282-5-j-keerthy@ti.com
      Fixes: 6334150e ("remoteproc: don't allow modular build")
      Signed-off-by: NKeerthy <j-keerthy@ti.com>
      Acked-by: NWill Deacon <will@kernel.org>
      [olof: Fixed up all 4 occurrances in this one commit]
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      a304c0a6
  11. 27 9月, 2019 1 次提交
    • M
      mm: treewide: clarify pgtable_page_{ctor,dtor}() naming · b4ed71f5
      Mark Rutland 提交于
      The naming of pgtable_page_{ctor,dtor}() seems to have confused a few
      people, and until recently arm64 used these erroneously/pointlessly for
      other levels of page table.
      
      To make it incredibly clear that these only apply to the PTE level, and to
      align with the naming of pgtable_pmd_page_{ctor,dtor}(), let's rename them
      to pgtable_pte_page_{ctor,dtor}().
      
      These changes were generated with the following shell script:
      
      ----
      git grep -lw 'pgtable_page_.tor' | while read FILE; do
          sed -i '{s/pgtable_page_ctor/pgtable_pte_page_ctor/}' $FILE;
          sed -i '{s/pgtable_page_dtor/pgtable_pte_page_dtor/}' $FILE;
      done
      ----
      
      ... with the documentation re-flowed to remain under 80 columns, and
      whitespace fixed up in macros to keep backslashes aligned.
      
      There should be no functional change as a result of this patch.
      
      Link: http://lkml.kernel.org/r/20190722141133.3116-1-mark.rutland@arm.comSigned-off-by: NMark Rutland <mark.rutland@arm.com>
      Reviewed-by: NMike Rapoport <rppt@linux.ibm.com>
      Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>	[m68k]
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Yu Zhao <yuzhao@google.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b4ed71f5
  12. 25 9月, 2019 7 次提交
  13. 21 9月, 2019 2 次提交