Commit 402ff5a3 authored by Heiko Carstens's avatar Heiko Carstens

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: default avatarVineeth Vijayan <vneethv@linux.ibm.com>
Tested-by: default avatarVineeth Vijayan <vneethv@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent 32ddf3e1
...@@ -86,7 +86,7 @@ static noinline void __machine_kdump(void *image) ...@@ -86,7 +86,7 @@ static noinline void __machine_kdump(void *image)
continue; continue;
} }
/* Store status of the boot CPU */ /* Store status of the boot CPU */
mcesa = (struct mcesa *)(S390_lowcore.mcesad & MCESA_ORIGIN_MASK); mcesa = __va(S390_lowcore.mcesad & MCESA_ORIGIN_MASK);
if (MACHINE_HAS_VX) if (MACHINE_HAS_VX)
save_vx_regs((__vector128 *) mcesa->vector_save_area); save_vx_regs((__vector128 *) mcesa->vector_save_area);
if (MACHINE_HAS_GS) { if (MACHINE_HAS_GS) {
......
...@@ -68,7 +68,7 @@ void __init nmi_alloc_boot_cpu(struct lowcore *lc) ...@@ -68,7 +68,7 @@ void __init nmi_alloc_boot_cpu(struct lowcore *lc)
{ {
if (!nmi_needs_mcesa()) if (!nmi_needs_mcesa())
return; return;
lc->mcesad = (unsigned long) &boot_mcesa; lc->mcesad = __pa(&boot_mcesa);
if (MACHINE_HAS_GS) if (MACHINE_HAS_GS)
lc->mcesad |= ilog2(MCESA_MAX_SIZE); lc->mcesad |= ilog2(MCESA_MAX_SIZE);
} }
...@@ -94,7 +94,7 @@ static int __init nmi_init(void) ...@@ -94,7 +94,7 @@ static int __init nmi_init(void)
__ctl_store(cr0, 0, 0); __ctl_store(cr0, 0, 0);
__ctl_clear_bit(0, 28); /* disable lowcore protection */ __ctl_clear_bit(0, 28); /* disable lowcore protection */
/* Replace boot_mcesa on the boot CPU */ /* 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); __ctl_load(cr0, 0, 0);
return 0; return 0;
} }
...@@ -111,7 +111,7 @@ int nmi_alloc_per_cpu(struct lowcore *lc) ...@@ -111,7 +111,7 @@ int nmi_alloc_per_cpu(struct lowcore *lc)
return -ENOMEM; return -ENOMEM;
/* The pointer is stored with mcesa_bits ORed in */ /* The pointer is stored with mcesa_bits ORed in */
kmemleak_not_leak((void *) origin); kmemleak_not_leak((void *) origin);
lc->mcesad = origin | mcesa_origin_lc; lc->mcesad = __pa(origin) | mcesa_origin_lc;
return 0; return 0;
} }
...@@ -119,7 +119,7 @@ void nmi_free_per_cpu(struct lowcore *lc) ...@@ -119,7 +119,7 @@ void nmi_free_per_cpu(struct lowcore *lc)
{ {
if (!nmi_needs_mcesa()) if (!nmi_needs_mcesa())
return; 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) static notrace void s390_handle_damage(void)
...@@ -246,7 +246,7 @@ static int notrace s390_validate_registers(union mci mci, int umode) ...@@ -246,7 +246,7 @@ static int notrace s390_validate_registers(union mci mci, int umode)
: "Q" (S390_lowcore.fpt_creg_save_area)); : "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) { if (!MACHINE_HAS_VX) {
/* Validate floating point registers */ /* Validate floating point registers */
asm volatile( asm volatile(
......
...@@ -622,7 +622,7 @@ int smp_store_status(int cpu) ...@@ -622,7 +622,7 @@ int smp_store_status(int cpu)
return -EIO; return -EIO;
if (!MACHINE_HAS_VX && !MACHINE_HAS_GS) if (!MACHINE_HAS_VX && !MACHINE_HAS_GS)
return 0; return 0;
pa = __pa(lc->mcesad & MCESA_ORIGIN_MASK); pa = lc->mcesad & MCESA_ORIGIN_MASK;
if (MACHINE_HAS_GS) if (MACHINE_HAS_GS)
pa |= lc->mcesad & MCESA_LC_MASK; pa |= lc->mcesad & MCESA_LC_MASK;
if (__pcpu_sigp_relax(pcpu->address, SIGP_STORE_ADDITIONAL_STATUS, if (__pcpu_sigp_relax(pcpu->address, SIGP_STORE_ADDITIONAL_STATUS,
......
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