diff options
author | Heiko Carstens | 2021-11-25 19:59:16 +0100 |
---|---|---|
committer | Heiko Carstens | 2021-12-06 14:42:26 +0100 |
commit | 402ff5a3387dc8ec6987a80d3ce26b0c25773622 (patch) | |
tree | 40d58922ce2087a9bdf3166e7c0993c7694a0cc0 /arch/s390/kernel/nmi.c | |
parent | 32ddf3e124ee35b70c86e239b31d30827f993d3f (diff) |
s390/nmi: add missing __pa/__va address conversion of extended save area
Add missing __pa/__va address conversion of machine check extended
save area designation, which is an absolute address.
Note: this currently doesn't fix a real bug, since virtual addresses
are indentical to physical ones.
Reported-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Tested-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/kernel/nmi.c')
-rw-r--r-- | arch/s390/kernel/nmi.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/s390/kernel/nmi.c b/arch/s390/kernel/nmi.c index 20f8e1868853..3f18c1412eba 100644 --- a/arch/s390/kernel/nmi.c +++ b/arch/s390/kernel/nmi.c @@ -68,7 +68,7 @@ void __init nmi_alloc_boot_cpu(struct lowcore *lc) { if (!nmi_needs_mcesa()) return; - lc->mcesad = (unsigned long) &boot_mcesa; + lc->mcesad = __pa(&boot_mcesa); if (MACHINE_HAS_GS) lc->mcesad |= ilog2(MCESA_MAX_SIZE); } @@ -94,7 +94,7 @@ static int __init nmi_init(void) __ctl_store(cr0, 0, 0); __ctl_clear_bit(0, 28); /* disable lowcore protection */ /* Replace boot_mcesa on the boot CPU */ - S390_lowcore.mcesad = origin | mcesa_origin_lc; + S390_lowcore.mcesad = __pa(origin) | mcesa_origin_lc; __ctl_load(cr0, 0, 0); return 0; } @@ -111,7 +111,7 @@ int nmi_alloc_per_cpu(struct lowcore *lc) return -ENOMEM; /* The pointer is stored with mcesa_bits ORed in */ kmemleak_not_leak((void *) origin); - lc->mcesad = origin | mcesa_origin_lc; + lc->mcesad = __pa(origin) | mcesa_origin_lc; return 0; } @@ -119,7 +119,7 @@ void nmi_free_per_cpu(struct lowcore *lc) { if (!nmi_needs_mcesa()) return; - kmem_cache_free(mcesa_cache, (void *)(lc->mcesad & MCESA_ORIGIN_MASK)); + kmem_cache_free(mcesa_cache, __va(lc->mcesad & MCESA_ORIGIN_MASK)); } static notrace void s390_handle_damage(void) @@ -246,7 +246,7 @@ static int notrace s390_validate_registers(union mci mci, int umode) : "Q" (S390_lowcore.fpt_creg_save_area)); } - mcesa = (struct mcesa *)(S390_lowcore.mcesad & MCESA_ORIGIN_MASK); + mcesa = __va(S390_lowcore.mcesad & MCESA_ORIGIN_MASK); if (!MACHINE_HAS_VX) { /* Validate floating point registers */ asm volatile( |