Received: by 10.223.176.46 with SMTP id f43csp2397911wra; Thu, 25 Jan 2018 09:13:55 -0800 (PST) X-Google-Smtp-Source: AH8x2264cBFVznr6giE657frzN+MChH1n/QNqkLgMPeE1M5OHDIrTjWppBd3r9xb2djL4P9Ybtvv X-Received: by 2002:a17:902:9044:: with SMTP id w4-v6mr11989864plz.354.1516900435088; Thu, 25 Jan 2018 09:13:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516900435; cv=none; d=google.com; s=arc-20160816; b=sbi+LHHxo/6lBTSb+FSclhF1kRmBZBi8kgOUKy/aLqUejFg7COa4DIQI/RaP3Oi0F1 6WZKGq5mVv6d7pytnQWlg2sYeSq8N9z9UoR+5mHHHWK+D8jYXP6SQnz+21ReIhvFQusN 1CAphNzpql+W9H70dCn12rp0PWsOAgmW6L8ZrcUH7/jMBBeZ3thzsLFWwTS0CultPeeM uuIwlA7rs+iUpJDo7aMRMgRA6feL6B8RQTWwxFdY4tu8Ge5nfdnvk6tGtzXKHCXZs+7U YTBQReF2+FLxcmlFUjMTP9qJA5V9pRGEfazTnxvk6PDQTI984nQS4lbx+HcArrWRb2ZB sgLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=AMQoMXFH/Q+EXPzoA2eyQ3DbmMQufVRUDnVuCrEoasg=; b=p/UpK5FC+6NcuZA7hG1ZQyCD8d478Yig4UVvbow/boYqQblE4xHEEYmgkVcrnvP5lW VbpNq6b2w8mi48ejeHuPNseIH/z4GS1tqwk9jK8t2+Tu15pIg1o8M0bAw7L7A+rRmDnc Mz6qjJWMIIrGZA6X8ik/n3+WD8XuB1yqq+zfAvn+M+HK9Y428qARMBjHo4XarjhRL2g2 vQ4XEgjXzhjs4GU2/222Rpz6V5XHrnWhYqA9SFYYpu8eA9pqjKhfXHQDcCMKGJkwE33u By9fc0uI3r6brkkakUTC1oxlj8JZ5m1k2M55T5EZeZw4Xa1j5oxyfIqdvLBiCJTSIs92 drMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=nhHxp/9V; dkim=pass header.i=@codeaurora.org header.s=default header.b=FdRqoyai; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k4si1764861pgr.731.2018.01.25.09.13.40; Thu, 25 Jan 2018 09:13:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=nhHxp/9V; dkim=pass header.i=@codeaurora.org header.s=default header.b=FdRqoyai; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751392AbeAYRLS (ORCPT + 99 others); Thu, 25 Jan 2018 12:11:18 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:44996 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750994AbeAYRLO (ORCPT ); Thu, 25 Jan 2018 12:11:14 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 6DBBE6032C; Thu, 25 Jan 2018 17:11:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516900273; bh=ptkXdcXir+7UR/M1CIlCRNg5X9pQl8i84Br9OYgXyeQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=nhHxp/9VD3qgl7wSpZzbC9g4eHZkkzlAWSoDP/x0CJaV61u4cdhO4m3+1gYDGbWQr clX6lvTq41cIEqv5kRHSGxf/NWZevqIKdM/5MOmyxNq1WPHhKqsJtDzKJZEA8jzcSs WbfVQiG3bDQkhxta0iafTuUWuQcuWngKygagPb8g= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.235.228.52] (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tbaicar@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3648B6032C; Thu, 25 Jan 2018 17:11:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516900272; bh=ptkXdcXir+7UR/M1CIlCRNg5X9pQl8i84Br9OYgXyeQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=FdRqoyaiSKlIxTniTjvuKfgy0nil6E9AwENpmamOxh/oAv7DDRzQdT800bm+5kj9R sEIBAmQs+MmEWqvl+Qss2/PjXxBnZ3C3czKpGx/vSmi+CP8DOQXllyJiqZd80EBPRq FG6vcag8iNcpawQUZVim30V7oun7esfU0+wVe5PM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3648B6032C Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=tbaicar@codeaurora.org Subject: Re: [PATCH v4 0/4] arm64/ras: support sea error recovery To: Xie XiuQi , catalin.marinas@arm.com, will.deacon@arm.com, mingo@redhat.com, mark.rutland@arm.com, ard.biesheuvel@linaro.org, james.morse@arm.com, Dave.Martin@arm.com, takahiro.akashi@linaro.org, stephen.boyd@linaro.org, bp@suse.de, julien.thierry@arm.com, shiju.jose@huawei.com, zjzhang@codeaurora.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, wangxiongfeng2@huawei.com, zhengqiang10@huawei.com, gengdongjiu@huawei.com, huawei.libin@huawei.com, wangkefeng.wang@huawei.com, lijinyue@huawei.com, guohanjun@huawei.com, hanjun.guo@linaro.org, cj.chengjian@huawei.com References: <1506516620-20033-1-git-send-email-xiexiuqi@huawei.com> From: Tyler Baicar Message-ID: Date: Thu, 25 Jan 2018 12:11:09 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <1506516620-20033-1-git-send-email-xiexiuqi@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Xie, On 9/27/2017 8:50 AM, Xie XiuQi wrote: > With ARM v8.2 RAS Extension, SEA are usually triggered when memory errors > are consumed. According to the existing process, errors occurred in the > kernel, leading to direct panic, if it occurred the user-space, we should > just kill process. > > But there is a class of error, in fact, is not necessary to kill > process, you can recover and continue to run the process. Such as > the instruction data corrupted, where the memory page might be > read-only, which is has not been modified, the disk might have the > correct data, so you can directly drop the page, ant reload it when > necessary. > > So this patchset is just try to solve such problem: if the error is > consumed in user-space and the error occurs on a clean page, you can > directly drop the memory page without killing process. > > If the corrupted page is clean, just dropped it and return to user-space > without side effects. And if corrupted page is dirty, memory_failure() > will send SIGBUS with code=BUS_MCEERR_AR. While without this patchset, > do_sea() will just send SIGBUS, so the process was killed in the same place. > > Because memory_failure() may sleep, we can not call it directly in SEA > exception context. So we saved faulting physical address associated with > a process in the ghes handler and set __TIF_SEA_NOTIFY. When we return > from SEA exception context and get into do_notify_resume() before the > process running, we could check it and call memory_failure() to do > recovery. It's safe, because we are in process context. > > In some platform, when SEA triggerred, physical address could be reported > by memory section or by processor section, so we save address at this two > place. For this series - Tested-by: Tyler Baicar Note that this will probably need to be rebased on top of these patches: https://patchwork.codeaurora.org/patch/415877/ https://patchwork.codeaurora.org/patch/415879/ With that, the first patch should be able to be removed because the above patches already define the ARM error types: +#define CPER_ARM_CACHE_ERROR            0 +#define CPER_ARM_TLB_ERROR            1 +#define CPER_ARM_BUS_ERROR            2 +#define CPER_ARM_VENDOR_ERROR            3 Thanks, Tyler -- Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.