1. 07 8月, 2018 14 次提交
  2. 30 7月, 2018 1 次提交
  3. 22 5月, 2018 1 次提交
  4. 08 2月, 2018 1 次提交
  5. 19 1月, 2018 6 次提交
  6. 10 1月, 2018 3 次提交
    • M
      powerpc/64s: Add support for RFI flush of L1-D cache · aa8a5e00
      Michael Ellerman 提交于
      On some CPUs we can prevent the Meltdown vulnerability by flushing the
      L1-D cache on exit from kernel to user mode, and from hypervisor to
      guest.
      
      This is known to be the case on at least Power7, Power8 and Power9. At
      this time we do not know the status of the vulnerability on other CPUs
      such as the 970 (Apple G5), pasemi CPUs (AmigaOne X1000) or Freescale
      CPUs. As more information comes to light we can enable this, or other
      mechanisms on those CPUs.
      
      The vulnerability occurs when the load of an architecturally
      inaccessible memory region (eg. userspace load of kernel memory) is
      speculatively executed to the point where its result can influence the
      address of a subsequent speculatively executed load.
      
      In order for that to happen, the first load must hit in the L1,
      because before the load is sent to the L2 the permission check is
      performed. Therefore if no kernel addresses hit in the L1 the
      vulnerability can not occur. We can ensure that is the case by
      flushing the L1 whenever we return to userspace. Similarly for
      hypervisor vs guest.
      
      In order to flush the L1-D cache on exit, we add a section of nops at
      each (h)rfi location that returns to a lower privileged context, and
      patch that with some sequence. Newer firmwares are able to advertise
      to us that there is a special nop instruction that flushes the L1-D.
      If we do not see that advertised, we fall back to doing a displacement
      flush in software.
      
      For guest kernels we support migration between some CPU versions, and
      different CPUs may use different flush instructions. So that we are
      prepared to migrate to a machine with a different flush instruction
      activated, we may have to patch more than one flush instruction at
      boot if the hypervisor tells us to.
      
      In the end this patch is mostly the work of Nicholas Piggin and
      Michael Ellerman. However a cast of thousands contributed to analysis
      of the issue, earlier versions of the patch, back ports testing etc.
      Many thanks to all of them.
      Tested-by: NJon Masters <jcm@redhat.com>
      Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      aa8a5e00
    • N
      powerpc/64s: Simple RFI macro conversions · 222f20f1
      Nicholas Piggin 提交于
      This commit does simple conversions of rfi/rfid to the new macros that
      include the expected destination context. By simple we mean cases
      where there is a single well known destination context, and it's
      simply a matter of substituting the instruction for the appropriate
      macro.
      Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      222f20f1
    • N
      powerpc/64: Add macros for annotating the destination of rfid/hrfid · 50e51c13
      Nicholas Piggin 提交于
      The rfid/hrfid ((Hypervisor) Return From Interrupt) instruction is
      used for switching from the kernel to userspace, and from the
      hypervisor to the guest kernel. However it can and is also used for
      other transitions, eg. from real mode kernel code to virtual mode
      kernel code, and it's not always clear from the code what the
      destination context is.
      
      To make it clearer when reading the code, add macros which encode the
      expected destination context.
      Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      50e51c13
  7. 16 10月, 2017 1 次提交
  8. 20 6月, 2017 5 次提交
  9. 19 6月, 2017 1 次提交
  10. 28 4月, 2017 5 次提交
  11. 23 4月, 2017 2 次提交