]> Git Repo - linux.git/commitdiff
Merge tag 'powerpc-4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
authorLinus Torvalds <[email protected]>
Fri, 24 Aug 2018 16:34:23 +0000 (09:34 -0700)
committerLinus Torvalds <[email protected]>
Fri, 24 Aug 2018 16:34:23 +0000 (09:34 -0700)
Pull powerpc fixes from Michael Ellerman:

 - An implementation for the newly added hv_ops->flush() for the OPAL
   hvc console driver backends, I forgot to apply this after merging the
   hvc driver changes before the merge window.

 - Enable all PCI bridges at boot on powernv, to avoid races when
   multiple children of a bridge try to enable it simultaneously. This
   is a workaround until the PCI core can be enhanced to fix the races.

 - A fix to query PowerVM for the correct system topology at boot before
   initialising sched domains, seen in some configurations to cause
   broken scheduling etc.

 - A fix for pte_access_permitted() on "nohash" platforms.

 - Two commits to fix SIGBUS when using remap_pfn_range() seen on Power9
   due to a workaround when using the nest MMU (GPUs, accelerators).

 - Another fix to the VFIO code used by KVM, the previous fix had some
   bugs which caused guests to not start in some configurations.

 - A handful of other minor fixes.

Thanks to: Aneesh Kumar K.V, Benjamin Herrenschmidt, Christophe Leroy,
Hari Bathini, Luke Dashjr, Mahesh Salgaonkar, Nicholas Piggin, Paul
Mackerras, Srikar Dronamraju.

* tag 'powerpc-4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/mce: Fix SLB rebolting during MCE recovery path.
  KVM: PPC: Book3S: Fix guest DMA when guest partially backed by THP pages
  powerpc/mm/radix: Only need the Nest MMU workaround for R -> RW transition
  powerpc/mm/books3s: Add new pte bit to mark pte temporarily invalid.
  powerpc/nohash: fix pte_access_permitted()
  powerpc/topology: Get topology for shared processors at boot
  powerpc64/ftrace: Include ftrace.h needed for enable/disable calls
  powerpc/powernv/pci: Work around races in PCI bridge enabling
  powerpc/fadump: cleanup crash memory ranges support
  powerpc/powernv: provide a console flush operation for opal hvc driver
  powerpc/traps: Avoid rate limit messages from show unhandled signals
  powerpc/64s: Fix PACA_IRQ_HARD_DIS accounting in idle_power4()

1  2 
arch/powerpc/kvm/book3s_hv.c
arch/powerpc/platforms/powernv/pci-ioda.c

index 574fc1dcb2bf98288db933d62c8f4ebb97fbab75,db677a1132fa36cedb227fa8e8420d036e7141f9..3e3a71594e63194acf20174576642b5b2454059d
@@@ -46,6 -46,7 +46,7 @@@
  #include <linux/compiler.h>
  #include <linux/of.h>
  
+ #include <asm/ftrace.h>
  #include <asm/reg.h>
  #include <asm/ppc-opcode.h>
  #include <asm/asm-prototypes.h>
@@@ -127,14 -128,14 +128,14 @@@ static int kvmppc_hv_setup_htab_rma(str
   * and SPURR count and should be set according to the number of
   * online threads in the vcore being run.
   */
 -#define RWMR_RPA_P8_1THREAD   0x164520C62609AECA
 -#define RWMR_RPA_P8_2THREAD   0x7FFF2908450D8DA9
 -#define RWMR_RPA_P8_3THREAD   0x164520C62609AECA
 -#define RWMR_RPA_P8_4THREAD   0x199A421245058DA9
 -#define RWMR_RPA_P8_5THREAD   0x164520C62609AECA
 -#define RWMR_RPA_P8_6THREAD   0x164520C62609AECA
 -#define RWMR_RPA_P8_7THREAD   0x164520C62609AECA
 -#define RWMR_RPA_P8_8THREAD   0x164520C62609AECA
 +#define RWMR_RPA_P8_1THREAD   0x164520C62609AECAUL
 +#define RWMR_RPA_P8_2THREAD   0x7FFF2908450D8DA9UL
 +#define RWMR_RPA_P8_3THREAD   0x164520C62609AECAUL
 +#define RWMR_RPA_P8_4THREAD   0x199A421245058DA9UL
 +#define RWMR_RPA_P8_5THREAD   0x164520C62609AECAUL
 +#define RWMR_RPA_P8_6THREAD   0x164520C62609AECAUL
 +#define RWMR_RPA_P8_7THREAD   0x164520C62609AECAUL
 +#define RWMR_RPA_P8_8THREAD   0x164520C62609AECAUL
  
  static unsigned long p8_rwmr_values[MAX_SMT_THREADS + 1] = {
        RWMR_RPA_P8_1THREAD,
@@@ -215,7 -216,7 +216,7 @@@ static void kvmppc_fast_vcpu_kick_hv(st
  
        wqp = kvm_arch_vcpu_wq(vcpu);
        if (swq_has_sleeper(wqp)) {
 -              swake_up(wqp);
 +              swake_up_one(wqp);
                ++vcpu->stat.halt_wakeup;
        }
  
@@@ -1807,7 -1808,7 +1808,7 @@@ static int threads_per_vcore(struct kv
        return threads_per_subcore;
  }
  
 -static struct kvmppc_vcore *kvmppc_vcore_create(struct kvm *kvm, int core)
 +static struct kvmppc_vcore *kvmppc_vcore_create(struct kvm *kvm, int id)
  {
        struct kvmppc_vcore *vcore;
  
        init_swait_queue_head(&vcore->wq);
        vcore->preempt_tb = TB_NIL;
        vcore->lpcr = kvm->arch.lpcr;
 -      vcore->first_vcpuid = core * kvm->arch.smt_mode;
 +      vcore->first_vcpuid = id;
        vcore->kvm = kvm;
        INIT_LIST_HEAD(&vcore->preempt_list);
  
@@@ -2037,26 -2038,12 +2038,26 @@@ static struct kvm_vcpu *kvmppc_core_vcp
        mutex_lock(&kvm->lock);
        vcore = NULL;
        err = -EINVAL;
 -      core = id / kvm->arch.smt_mode;
 +      if (cpu_has_feature(CPU_FTR_ARCH_300)) {
 +              if (id >= (KVM_MAX_VCPUS * kvm->arch.emul_smt_mode)) {
 +                      pr_devel("KVM: VCPU ID too high\n");
 +                      core = KVM_MAX_VCORES;
 +              } else {
 +                      BUG_ON(kvm->arch.smt_mode != 1);
 +                      core = kvmppc_pack_vcpu_id(kvm, id);
 +              }
 +      } else {
 +              core = id / kvm->arch.smt_mode;
 +      }
        if (core < KVM_MAX_VCORES) {
                vcore = kvm->arch.vcores[core];
 -              if (!vcore) {
 +              if (vcore && cpu_has_feature(CPU_FTR_ARCH_300)) {
 +                      pr_devel("KVM: collision on id %u", id);
 +                      vcore = NULL;
 +              } else if (!vcore) {
                        err = -ENOMEM;
 -                      vcore = kvmppc_vcore_create(kvm, core);
 +                      vcore = kvmppc_vcore_create(kvm,
 +                                      id & ~(kvm->arch.smt_mode - 1));
                        kvm->arch.vcores[core] = vcore;
                        kvm->arch.online_vcores++;
                }
@@@ -3191,7 -3178,7 +3192,7 @@@ static void kvmppc_vcore_blocked(struc
                }
        }
  
 -      prepare_to_swait(&vc->wq, &wait, TASK_INTERRUPTIBLE);
 +      prepare_to_swait_exclusive(&vc->wq, &wait, TASK_INTERRUPTIBLE);
  
        if (kvmppc_vcore_check_block(vc)) {
                finish_swait(&vc->wq, &wait);
@@@ -3314,7 -3301,7 +3315,7 @@@ static int kvmppc_run_vcpu(struct kvm_r
                        kvmppc_start_thread(vcpu, vc);
                        trace_kvm_guest_enter(vcpu);
                } else if (vc->vcore_state == VCORE_SLEEPING) {
 -                      swake_up(&vc->wq);
 +                      swake_up_one(&vc->wq);
                }
  
        }
@@@ -4564,8 -4551,6 +4565,8 @@@ static int kvmppc_book3s_init_hv(void
                        pr_err("KVM-HV: Cannot determine method for accessing XICS\n");
                        return -ENODEV;
                }
 +              /* presence of intc confirmed - node can be dropped again */
 +              of_node_put(np);
        }
  #endif
  
index 4e6302bf4073c2fb67b2c923d4bed859e2920e4f,463308786b8ab385ef3c414216359d6304974b26..cde710297a4e434c58d32f07da8ee61d0a24d4a7
@@@ -46,7 -46,6 +46,7 @@@
  
  #include "powernv.h"
  #include "pci.h"
 +#include "../../../../drivers/pci/pci.h"
  
  #define PNV_IODA1_M64_NUM     16      /* Number of M64 BARs   */
  #define PNV_IODA1_M64_SEGS    8       /* Segments per M64 BAR */
@@@ -2999,7 -2998,7 +2999,7 @@@ static void pnv_pci_ioda_fixup_iov_reso
        struct pci_dn *pdn;
        int mul, total_vfs;
  
 -      if (!pdev->is_physfn || pdev->is_added)
 +      if (!pdev->is_physfn || pci_dev_is_added(pdev))
                return;
  
        pdn = pci_get_pdn(pdev);
@@@ -3228,12 -3227,49 +3228,49 @@@ static void pnv_pci_ioda_create_dbgfs(v
  #endif /* CONFIG_DEBUG_FS */
  }
  
+ static void pnv_pci_enable_bridge(struct pci_bus *bus)
+ {
+       struct pci_dev *dev = bus->self;
+       struct pci_bus *child;
+       /* Empty bus ? bail */
+       if (list_empty(&bus->devices))
+               return;
+       /*
+        * If there's a bridge associated with that bus enable it. This works
+        * around races in the generic code if the enabling is done during
+        * parallel probing. This can be removed once those races have been
+        * fixed.
+        */
+       if (dev) {
+               int rc = pci_enable_device(dev);
+               if (rc)
+                       pci_err(dev, "Error enabling bridge (%d)\n", rc);
+               pci_set_master(dev);
+       }
+       /* Perform the same to child busses */
+       list_for_each_entry(child, &bus->children, node)
+               pnv_pci_enable_bridge(child);
+ }
+ static void pnv_pci_enable_bridges(void)
+ {
+       struct pci_controller *hose;
+       list_for_each_entry(hose, &hose_list, list_node)
+               pnv_pci_enable_bridge(hose->bus);
+ }
  static void pnv_pci_ioda_fixup(void)
  {
        pnv_pci_ioda_setup_PEs();
        pnv_pci_ioda_setup_iommu_api();
        pnv_pci_ioda_create_dbgfs();
  
+       pnv_pci_enable_bridges();
  #ifdef CONFIG_EEH
        pnv_eeh_post_init();
  #endif
This page took 0.094582 seconds and 4 git commands to generate.