]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - arch/powerpc/platforms/pseries/setup.c
UBUNTU: SAUCE: rfi-flush: update H_CPU_* macro names to upstream
[mirror_ubuntu-artful-kernel.git] / arch / powerpc / platforms / pseries / setup.c
index b5d86426e97bc6a5cd17fd1b94573b7868449169..06d9dc7fb2d96a0c967a14b3f74f54ed620cb571 100644 (file)
@@ -455,6 +455,38 @@ static void __init find_and_init_phbs(void)
        of_pci_check_probe_only();
 }
 
+static void pSeries_setup_rfi_flush(void)
+{
+       unsigned long character, behaviour, rc;
+       enum l1d_flush_type types;
+       bool enable;
+
+       /* Enable by default */
+       enable = true;
+
+       rc = plpar_get_cpu_characteristics(&character, &behaviour);
+       if (rc == H_SUCCESS) {
+               types = L1D_FLUSH_NONE;
+
+               if (character & H_CPU_CHAR_L1D_FLUSH_TRIG2)
+                       types |= L1D_FLUSH_MTTRIG;
+               if (character & H_CPU_CHAR_L1D_FLUSH_ORI30)
+                       types |= L1D_FLUSH_ORI;
+
+               /* Use fallback if nothing set in hcall */
+               if (types == L1D_FLUSH_NONE)
+                       types = L1D_FLUSH_FALLBACK;
+
+               if (!(behaviour & H_CPU_BEHAV_L1D_FLUSH_PR))
+                       enable = false;
+       } else {
+               /* Default to fallback if case hcall is not available */
+               types = L1D_FLUSH_FALLBACK;
+       }
+
+       setup_rfi_flush(types, enable);
+}
+
 static void __init pSeries_setup_arch(void)
 {
        set_arch_panic_timeout(10, ARCH_PANIC_TIMEOUT);
@@ -472,6 +504,8 @@ static void __init pSeries_setup_arch(void)
 
        fwnmi_init();
 
+       pSeries_setup_rfi_flush();
+
        /* By default, only probe PCI (can be overridden by rtas_pci) */
        pci_add_flags(PCI_PROBE_ONLY);
 
@@ -722,7 +756,6 @@ define_machine(pseries) {
        .pcibios_fixup          = pSeries_final_fixup,
        .restart                = rtas_restart,
        .halt                   = rtas_halt,
-       .panic                  = rtas_os_term,
        .get_boot_time          = rtas_get_boot_time,
        .get_rtc_time           = rtas_get_rtc_time,
        .set_rtc_time           = rtas_set_rtc_time,