Commit 5dcadca3 authored by Michael Ellerman's avatar Michael Ellerman Committed by Marcelo Henrique Cerri

UBUNTU: SAUCE: rfi-flush: Allow HV to advertise multiple flush types

CVE-2017-5754

BugLink: http://bugs.launchpad.net/bugs/1742772

To enable migration between machines with different flush types
enabled, allow the hypervisor to advertise more than one flush type,
and if we see that we patch both in. On any given machine only one
will be active (due to firmware configuration), but a kernel will be
able to migrate between machines with different flush instructions
enabled without modification.
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Signed-off-by: default avatarMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
parent 313e806c
......@@ -502,27 +502,27 @@ static void __init find_and_init_phbs(void)
static void pSeries_setup_rfi_flush(void)
{
unsigned long character, behaviour, rc;
enum l1d_flush_type type;
enum l1d_flush_type types;
bool enable;
/* Default to fallback in case hcall is not available */
type = L1D_FLUSH_FALLBACK;
types = L1D_FLUSH_FALLBACK;
enable = true;
rc = plpar_get_cpu_characteristics(&character, &behaviour);
if (rc == H_SUCCESS) {
/* Default to no flush, unless firmware says otherwise */
type = L1D_FLUSH_NONE;
types = L1D_FLUSH_NONE;
if (character & H_GET_CPU_CHAR_CHAR_MTTRIG2_L1_FLUSH)
type = L1D_FLUSH_MTTRIG;
types |= L1D_FLUSH_MTTRIG;
if (character & H_GET_CPU_CHAR_CHAR_ORI30_L1_FLUSH)
type = L1D_FLUSH_ORI;
types |= L1D_FLUSH_ORI;
if (!(behaviour & H_GET_CPU_CHAR_BEHAV_L1_FLUSH_LOW_PRIV))
enable = false;
}
setup_rfi_flush(type, enable);
setup_rfi_flush(types, enable);
}
static void __init pSeries_setup_arch(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment