From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8687FCD4848 for ; Thu, 5 Sep 2024 03:10:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C832E6B025B; Wed, 4 Sep 2024 23:10:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C33CA6B0442; Wed, 4 Sep 2024 23:10:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AD3836B0443; Wed, 4 Sep 2024 23:10:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 8F16E6B025B for ; Wed, 4 Sep 2024 23:10:03 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 09679160815 for ; Thu, 5 Sep 2024 03:10:03 +0000 (UTC) X-FDA: 82529205486.08.A3BA606 Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) by imf20.hostedemail.com (Postfix) with ESMTP id 9DDC91C000A for ; Thu, 5 Sep 2024 03:10:00 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=BAxgEyN2; spf=pass (imf20.hostedemail.com: domain of xueshuai@linux.alibaba.com designates 115.124.30.130 as permitted sender) smtp.mailfrom=xueshuai@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725505673; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=EEK3tU0+O04g/bTYssKY4oUfiGHLfHkoGwUrwDWQSJo=; b=J+7wl9L+I0KAxgO6+3aMUH37hDYET06h99jSYb61ao0ITofNe0DW1UImqZwuEGEdU1tXKT wq9qfNVgMoHKfFH2nTZfYfeU79isNRG2ghv3KUyLazywzXkJwhR2fWqL/jAgMbuQNlGQKT wg5iroFgGvNMC0OYLSygXtjNX7gJZ1Y= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=BAxgEyN2; spf=pass (imf20.hostedemail.com: domain of xueshuai@linux.alibaba.com designates 115.124.30.130 as permitted sender) smtp.mailfrom=xueshuai@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725505673; a=rsa-sha256; cv=none; b=TKm9We75fIjmNwF1q4m/cI/i8GE2rM0ztR9rDXBTMpA9S8eh5xnoVv6ghp/RF9MtyffUFr 4UHUpp2xYhJOsxmJaYOoJPeEg5hrxCd1Vb/DJlV2rDuCdPeHPxt3dtGcls7mj4BobCWECv jfYJvWR8oL9QMF7us6td27a4kRuvJRQ= DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1725505797; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=EEK3tU0+O04g/bTYssKY4oUfiGHLfHkoGwUrwDWQSJo=; b=BAxgEyN2X8Qmzl+WgU/TJczxDcEwwwzEuX/aEs80gX4BJ9mq8b7mFyls/gkwj99naX/V3tlg+xGjtuppdFqfLj/TORzMv5320uX3IZE81c3SfrDqWOle0gU/yxObmmnAmF1cNBKs7L1vgRmZz+K1QTwKN60I5/VW8aVwmTiL/R8= Received: from 30.246.162.144(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0WEJd2C3_1725505794) by smtp.aliyun-inc.com; Thu, 05 Sep 2024 11:09:55 +0800 Message-ID: Date: Thu, 5 Sep 2024 11:09:53 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v12 3/3] ACPI: APEI: handle synchronous exceptions in task work To: Jarkko Sakkinen , bp@alien8.de, rafael@kernel.org, wangkefeng.wang@huawei.com, tanxiaofei@huawei.com, mawupeng1@huawei.com, tony.luck@intel.com, linmiaohe@huawei.com, naoya.horiguchi@nec.com, james.morse@arm.com, tongtiangen@huawei.com, gregkh@linuxfoundation.org, will@kernel.org Cc: linux-acpi@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, linux-edac@vger.kernel.org, x86@kernel.org, justin.he@arm.com, ardb@kernel.org, ying.huang@intel.com, ashish.kalra@amd.com, baolin.wang@linux.alibaba.com, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, lenb@kernel.org, hpa@zytor.com, robert.moore@intel.com, lvying6@huawei.com, xiexiuqi@huawei.com, zhuo.song@linux.alibaba.com References: <20221027042445.60108-1-xueshuai@linux.alibaba.com> <20240902030034.67152-4-xueshuai@linux.alibaba.com> From: Shuai Xue In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 9DDC91C000A X-Stat-Signature: 5y1drg35tpn41btbkeahh48q51pm3rgn X-Rspam-User: X-HE-Tag: 1725505800-451623 X-HE-Meta: U2FsdGVkX187S363ySqEfsOJhBHHlrFLHCaghw+ObDmT+EIWJm9AtfBUcDfGaf4s8gxmcCTwmltj1YuZzWGhdSK/U4DNYaxmNaq1WHn3B1ma5W68Bqqi7jAP8ArzbKoZaoFTLCk+NohBSWgwjSds8y5jpX7mTRcJ0ST/WVPUaAlf4hKbhRn8qwdm3py4mWG+MV4wDRb3LKa0EKuZBj2RVCwC1IXtY+zxLjulknj11geBB+WOyLN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-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 在 2024/9/4 00:11, Jarkko Sakkinen 写道: > On Mon Sep 2, 2024 at 6:00 AM EEST, Shuai Xue wrote: >> The memory uncorrected error could be signaled by asynchronous interrupt >> (specifically, SPI in arm64 platform), e.g. when an error is detected by >> a background scrubber, or signaled by synchronous exception >> (specifically, data abort excepction in arm64 platform), e.g. when a CPU >> tries to access a poisoned cache line. Currently, both synchronous and >> asynchronous error use memory_failure_queue() to schedule >> memory_failure() exectute in kworker context. >> >> As a result, when a user-space process is accessing a poisoned data, a >> data abort is taken and the memory_failure() is executed in the kworker >> context: >> >> - will send wrong si_code by SIGBUS signal in early_kill mode, and >> - can not kill the user-space in some cases resulting a synchronous >> error infinite loop >> >> Issue 1: send wrong si_code in early_kill mode >> >> Since commit a70297d22132 ("ACPI: APEI: set memory failure flags as >> MF_ACTION_REQUIRED on synchronous events")', the flag MF_ACTION_REQUIRED >> could be used to determine whether a synchronous exception occurs on >> ARM64 platform. When a synchronous exception is detected, the kernel is >> expected to terminate the current process which has accessed poisoned >> page. This is done by sending a SIGBUS signal with an error code >> BUS_MCEERR_AR, indicating an action-required machine check error on >> read. >> >> However, when kill_proc() is called to terminate the processes who have >> the poisoned page mapped, it sends the incorrect SIGBUS error code >> BUS_MCEERR_AO because the context in which it operates is not the one >> where the error was triggered. >> >> To reproduce this problem: >> >> # STEP1: enable early kill mode >> #sysctl -w vm.memory_failure_early_kill=1 >> vm.memory_failure_early_kill = 1 >> >> # STEP2: inject an UCE error and consume it to trigger a synchronous error >> #einj_mem_uc single >> 0: single vaddr = 0xffffb0d75400 paddr = 4092d55b400 >> injecting ... >> triggering ... >> signal 7 code 5 addr 0xffffb0d75000 >> page not present >> Test passed >> >> The si_code (code 5) from einj_mem_uc indicates that it is BUS_MCEERR_AO >> error and it is not fact. >> >> To fix it, queue memory_failure() as a task_work so that it runs in >> the context of the process that is actually consuming the poisoned data. >> >> After this patch set: > > s/patch set/patch/ > Hi, Jarkko, Will fix the typo in next version. Thank you. Best Regards, Shuai