Linux EDAC development
 help / color / mirror / Atom feed
* [PATCH] x86/mm, mm/hwpoison: fix unmap kernel 1:1 pages
@ 2022-02-07  7:52 luofei
  2022-02-07  8:14 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: luofei @ 2022-02-07  7:52 UTC (permalink / raw)
  To: stable, tony.luck, bp, tglx, mingo, hpa, x86
  Cc: linux-edac, linux-kernel, luofei

Only unmap the page when the memory error is properly handled
by calling memory_failure(), not the other way around.

Fixes: 26f8c38bb466("x86/mm, mm/hwpoison: Don't unconditionally unmap kernel 1:1 pages")

Signed-off-by: luofei <luofei@unicloud.com>
Cc: stable@vger.kernel.org #v4.14
---
 arch/x86/kernel/cpu/mcheck/mce.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 95c09db1bba2..d8399a689165 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -589,7 +589,7 @@ static int srao_decode_notifier(struct notifier_block *nb, unsigned long val,
 
 	if (mce_usable_address(mce) && (mce->severity == MCE_AO_SEVERITY)) {
 		pfn = mce->addr >> PAGE_SHIFT;
-		if (memory_failure(pfn, MCE_VECTOR, 0))
+		if (!memory_failure(pfn, MCE_VECTOR, 0))
 			mce_unmap_kpfn(pfn);
 	}
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-07 10:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-07  7:52 [PATCH] x86/mm, mm/hwpoison: fix unmap kernel 1:1 pages luofei
2022-02-07  8:14 ` Greg KH
2022-02-07  9:35   ` Borislav Petkov
2022-02-07 10:00     ` Greg KH
     [not found]     ` <2a4b69472f034fc995a047c7ec945cd3@unicloud.com>
2022-02-07 10:18       ` 答复: " Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox