powerpc fixes for 4.11 #6

- cxl: Route eeh events to all slices for pci_channel_io_perm_failure state
  - powerpc/64s: Fix idle wakeup potential to clobber registers
  - Revert "powerpc/64: Disable use of radix under a hypervisor"
  - gcc-plugins: update architecture list in documentation
 
 Thanks to:
   Andrew Donnellan, Nicholas Piggin, Paul Mackerras, Vaibhav Jain.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJY1ySvAAoJEFHr6jzI4aWAYx8QAJHHLYvBc8Tl2kxXJRQos182
 6Dhff1dp8OJNNBSwPalJPPd/4SkJ4UTFP3CSobuhRmj5ZZ3qzQ3ONvZSC+9NtXFj
 yw2qGagabmGcInnHupVMTd13rrhveHOgC+7SabsnbjUeAqpoccv675P2MYLq0xYQ
 JILOTzbghVlwDhQD3e3/BBkqSSgWibMegGwO8rX8Z+Bw0c7X7tfz4Dpa5d5rnBzc
 jUgbzoBE9E9AQ0BJmp5Nqc8UwMvkWgFHwQ4/D5a+GEaE7rJmxG7twbYHJoGhgLkb
 ceB2iMfZDdagmCUrw179JmgKcSWBLoN9v/uykDrejdaEQCj+M8HTRFLZXccGd/1h
 p7FNr3z7lqLi9GxQnYDFtoOWbR4wK8Wirk45He5b9JSCqWYQxaxJcPqRx/IAG33O
 xXoMjdN79rrljerVnE1JZHB8WRXFEs4fEkGiahCnX8hC7VNIcSvMtgss2nsGgyHq
 vuMfdFvRhGfqKX6AL4cBukotCEvI1pPvo5LYpF6HiHxLM6+g/dX7ZlWrIOoEup1P
 5FhDk/pirRQurVI7Tvmiz3bUCqbloqhZBZ4vec0wz2lfHJ2+5cdoNM0+OGJkHJrN
 Jr7NvdlhH35Awz9Cf358oVpWlHNuPuJrmWnZSpWM+3/FTv7UM6WgComuzl9olF40
 jdqp+aUODC6gQH6sWlhP
 =4CFb
 -----END PGP SIGNATURE-----

Merge tag 'powerpc-4.11-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull more powerpc fixes from Michael Ellerman:
 "These are all pretty minor. The fix for idle wakeup would be a bad bug
  but has not been observed in practice.

  The update to the gcc-plugins docs was Cc'ed to Kees and Jon, Kees
  OK'ed it going via powerpc and I didn't hear from Jon.

   - cxl: Route eeh events to all slices for pci_channel_io_perm_failure state

   - powerpc/64s: Fix idle wakeup potential to clobber registers

   - Revert "powerpc/64: Disable use of radix under a hypervisor"

   - gcc-plugins: update architecture list in documentation

  Thanks to: Andrew Donnellan, Nicholas Piggin, Paul Mackerras, Vaibhav
  Jain"

* tag 'powerpc-4.11-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  gcc-plugins: update architecture list in documentation
  Revert "powerpc/64: Disable use of radix under a hypervisor"
  powerpc/64s: Fix idle wakeup potential to clobber registers
  cxl: Route eeh events to all slices for pci_channel_io_perm_failure state
This commit is contained in:
Linus Torvalds 2017-03-26 10:34:10 -07:00
commit 42234bf832
4 changed files with 26 additions and 14 deletions

View file

@ -18,8 +18,8 @@ because gcc versions 4.5 and 4.6 are compiled by a C compiler,
gcc-4.7 can be compiled by a C or a C++ compiler,
and versions 4.8+ can only be compiled by a C++ compiler.
Currently the GCC plugin infrastructure supports only the x86, arm and arm64
architectures.
Currently the GCC plugin infrastructure supports only the x86, arm, arm64 and
powerpc architectures.
This infrastructure was ported from grsecurity [6] and PaX [7].

View file

@ -449,9 +449,23 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300)
_GLOBAL(pnv_wakeup_tb_loss)
ld r1,PACAR1(r13)
/*
* Before entering any idle state, the NVGPRs are saved in the stack
* and they are restored before switching to the process context. Hence
* until they are restored, they are free to be used.
* Before entering any idle state, the NVGPRs are saved in the stack.
* If there was a state loss, or PACA_NAPSTATELOST was set, then the
* NVGPRs are restored. If we are here, it is likely that state is lost,
* but not guaranteed -- neither ISA207 nor ISA300 tests to reach
* here are the same as the test to restore NVGPRS:
* PACA_THREAD_IDLE_STATE test for ISA207, PSSCR test for ISA300,
* and SRR1 test for restoring NVGPRs.
*
* We are about to clobber NVGPRs now, so set NAPSTATELOST to
* guarantee they will always be restored. This might be tightened
* with careful reading of specs (particularly for ISA300) but this
* is already a slow wakeup path and it's simpler to be safe.
*/
li r0,1
stb r0,PACA_NAPSTATELOST(r13)
/*
*
* Save SRR1 and LR in NVGPRs as they might be clobbered in
* opal_call() (called in CHECK_HMI_INTERRUPT). SRR1 is required

View file

@ -397,8 +397,7 @@ static void early_check_vec5(void)
void __init mmu_early_init_devtree(void)
{
/* Disable radix mode based on kernel command line. */
/* We don't yet have the machinery to do radix as a guest. */
if (disable_radix || !(mfmsr() & MSR_HV))
if (disable_radix)
cur_cpu_spec->mmu_features &= ~MMU_FTR_TYPE_RADIX;
/*

View file

@ -1792,15 +1792,14 @@ static pci_ers_result_t cxl_pci_error_detected(struct pci_dev *pdev,
/* If we're permanently dead, give up. */
if (state == pci_channel_io_perm_failure) {
/* Tell the AFU drivers; but we don't care what they
* say, we're going away.
*/
for (i = 0; i < adapter->slices; i++) {
afu = adapter->afu[i];
/* Only participate in EEH if we are on a virtual PHB */
if (afu->phb == NULL)
return PCI_ERS_RESULT_NONE;
cxl_vphb_error_detected(afu, state);
/*
* Tell the AFU drivers; but we don't care what they
* say, we're going away.
*/
if (afu->phb != NULL)
cxl_vphb_error_detected(afu, state);
}
return PCI_ERS_RESULT_DISCONNECT;
}