1. 25 4月, 2016 3 次提交
  2. 20 4月, 2016 5 次提交
  3. 16 4月, 2016 1 次提交
    • S
      arm64: vhe: Verify CPU Exception Levels · ac1ad20f
      Suzuki K Poulose 提交于
      With a VHE capable CPU, kernel can run at EL2 and is a decided at early
      boot. If some of the CPUs didn't start it EL2 or doesn't have VHE, we
      could have CPUs running at different exception levels, all in the same
      kernel! This patch adds an early check for the secondary CPUs to detect
      such situations.
      
      For each non-boot CPU add a sanity check to make sure we don't have
      different run levels w.r.t the boot CPU. We save the information on
      whether the boot CPU is running in hyp mode or not and ensure the
      remaining CPUs match it.
      
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Reviewed-by: NChristoffer Dall <christoffer.dall@linaro.org>
      Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      [will: made boot_cpu_hyp_mode static]
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      ac1ad20f
  4. 13 4月, 2016 1 次提交
  5. 04 3月, 2016 1 次提交
    • M
      arm64: make mrs_s prefixing implicit in read_cpuid · 1cc6ed90
      Mark Rutland 提交于
      Commit 0f54b14e ("arm64: cpufeature: Change read_cpuid() to use
      sysreg's mrs_s macro") changed read_cpuid to require a SYS_ prefix on
      register names, to allow manual assembly of registers unknown by the
      toolchain, using tables in sysreg.h.
      
      This interacts poorly with commit 42b55734 ("efi/arm64: Check
      for h/w support before booting a >4 KB granular kernel"), which is
      curretly queued via the tip tree, and uses read_cpuid without a SYS_
      prefix. Due to this, a build of next-20160304 fails if EFI and 64K pages
      are selected.
      
      To avoid this issue when trees are merged, move the required SYS_
      prefixing into read_cpuid, and revert all of the updated callsites to
      pass plain register names. This effectively reverts the bulk of commit
      0f54b14e.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Cc: James Morse <james.morse@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      1cc6ed90
  6. 01 3月, 2016 1 次提交
  7. 26 2月, 2016 1 次提交
  8. 25 2月, 2016 9 次提交
  9. 19 2月, 2016 3 次提交
    • J
      arm64: kernel: Don't toggle PAN on systems with UAO · 70544196
      James Morse 提交于
      If a CPU supports both Privileged Access Never (PAN) and User Access
      Override (UAO), we don't need to disable/re-enable PAN round all
      copy_to_user() like calls.
      
      UAO alternatives cause these calls to use the 'unprivileged' load/store
      instructions, which are overridden to be the privileged kind when
      fs==KERNEL_DS.
      
      This patch changes the copy_to_user() calls to have their PAN toggling
      depend on a new composite 'feature' ARM64_ALT_PAN_NOT_UAO.
      
      If both features are detected, PAN will be enabled, but the copy_to_user()
      alternatives will not be applied. This means PAN will be enabled all the
      time for these functions. If only PAN is detected, the toggling will be
      enabled as normal.
      
      This will save the time taken to disable/re-enable PAN, and allow us to
      catch copy_to_user() accesses that occur with fs==KERNEL_DS.
      
      Futex and swp-emulation code continue to hang their PAN toggling code on
      ARM64_HAS_PAN.
      Signed-off-by: NJames Morse <james.morse@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      70544196
    • J
      arm64: cpufeature: Test 'matches' pointer to find the end of the list · 644c2ae1
      James Morse 提交于
      CPU feature code uses the desc field as a test to find the end of the list,
      this means every entry must have a description. This generates noise for
      entries in the list that aren't really features, but combinations of them.
      e.g.
      > CPU features: detected feature: Privileged Access Never
      > CPU features: detected feature: PAN and not UAO
      
      These combination features are needed for corner cases with alternatives,
      where cpu features interact.
      
      Change all walkers of the arm64_features[] and arm64_hwcaps[] lists to test
      'matches' not 'desc', and only print 'desc' if it is non-NULL.
      Signed-off-by: NJames Morse <james.morse@arm.com>
      Reviewed-by : Suzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      644c2ae1
    • J
      arm64: kernel: Add support for User Access Override · 57f4959b
      James Morse 提交于
      'User Access Override' is a new ARMv8.2 feature which allows the
      unprivileged load and store instructions to be overridden to behave in
      the normal way.
      
      This patch converts {get,put}_user() and friends to use ldtr*/sttr*
      instructions - so that they can only access EL0 memory, then enables
      UAO when fs==KERNEL_DS so that these functions can access kernel memory.
      
      This allows user space's read/write permissions to be checked against the
      page tables, instead of testing addr<USER_DS, then using the kernel's
      read/write permissions.
      Signed-off-by: NJames Morse <james.morse@arm.com>
      [catalin.marinas@arm.com: move uao_thread_switch() above dsb()]
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      57f4959b
  10. 18 2月, 2016 2 次提交
  11. 16 2月, 2016 1 次提交
  12. 02 12月, 2015 1 次提交
  13. 27 11月, 2015 1 次提交
  14. 12 11月, 2015 1 次提交
    • A
      arm64: mark cpus_have_hwcap as __maybe_unused · 3d6d1035
      Arnd Bergmann 提交于
      cpus_have_hwcap() is defined as a 'static' function an only used in
      one place that is inside of an #ifdef, so we get a warning when
      the only user is disabled:
      
      arch/arm64/kernel/cpufeature.c:699:13: warning: 'cpus_have_hwcap' defined but not used [-Wunused-function]
      
      This marks the function as __maybe_unused, so the compiler knows that
      it can drop the function definition without warning about it.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: 37b01d53 ("arm64/HWCAP: Use system wide safe values")
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      3d6d1035
  15. 29 10月, 2015 1 次提交
  16. 21 10月, 2015 8 次提交