]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
powerpc/rfi-flush: Always enable fallback flush on pseries
authorMichael Ellerman <mpe@ellerman.id.au>
Wed, 14 Mar 2018 22:40:40 +0000 (19:40 -0300)
committerSeth Forshee <seth.forshee@canonical.com>
Mon, 9 Apr 2018 21:03:39 +0000 (16:03 -0500)
BugLink: https://bugs.launchpad.net/bugs/1760099
CVE-2017-5754

This ensures the fallback flush area is always allocated on pseries,
so in case a LPAR is migrated from a patched to an unpatched system,
it is possible to enable the fallback flush in the target system.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 84749a58b6e382f109abf1e734bc4dd43c2c25bb linux-next)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
arch/powerpc/platforms/pseries/setup.c

index 8bbbb4e753b5a31f131762bb4d83913804ec8a22..2708ddab209b3096523686cbb4e58aab75fae043 100644 (file)
@@ -468,26 +468,18 @@ static void pseries_setup_rfi_flush(void)
 
        /* Enable by default */
        enable = true;
+       types = L1D_FLUSH_FALLBACK;
 
        rc = plpar_get_cpu_characteristics(&result);
        if (rc == H_SUCCESS) {
-               types = L1D_FLUSH_NONE;
-
                if (result.character & H_CPU_CHAR_L1D_FLUSH_TRIG2)
                        types |= L1D_FLUSH_MTTRIG;
                if (result.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 ((!(result.behaviour & H_CPU_BEHAV_L1D_FLUSH_PR)) ||
                    (!(result.behaviour & H_CPU_BEHAV_FAVOUR_SECURITY)))
                        enable = false;
-       } else {
-               /* Default to fallback if case hcall is not available */
-               types = L1D_FLUSH_FALLBACK;
        }
 
        setup_rfi_flush(types, enable);