Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3923797ybc; Tue, 26 Nov 2019 00:36:22 -0800 (PST) X-Google-Smtp-Source: APXvYqzV8kBI+FtUInoVO9gTSrxporkBEiNASCXmya5wEHDhXCxHSwIGPHkLPCcw/2r2qFOkDNkO X-Received: by 2002:a17:906:7cb:: with SMTP id m11mr18651700ejc.76.1574757382756; Tue, 26 Nov 2019 00:36:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574757382; cv=none; d=google.com; s=arc-20160816; b=dzGlsvwZjRIcRJYCreT0JaHQUJGDwcdBoQQSnBIDLcuHUXcDfTaaD33IKrCwNe0U2w AxHku3xhYi1Y2p0xMkWfwE881G1n0FHJM/O03vK+PH2xkaSUHUw727QcYpbPMHwGzlwQ O3pRZHiGW3kDZo9mm4DTIN02ul6HGKUsNchdrHKUFCsJu4zNO4//cIOlZwu1DXmJLxFu 8xfFwuLlmcg3jduH/dqijorfKFesOzAAiSjT4Wq0NrhOAM3a0rtHSHPL8EOpuNXcdRXT 3W/xhFUVIFaFUnr+m718dmUkea46EBmSYkaiNpiZPtX48SvzqWMTqjRmJKvHcInb3lES 9MjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=lP+6ufsqX2zuMN9m3nNVIMGpzbr9PeIQSzO4jLnYSZc=; b=z+OcPnLwTKS/8PPXbIM+01lH1+ekFIlsoDTXyfwwkhdJyxhnsaass3dsFdCL9mpSBK Z0ly07wC9TyRadh+piVCQNjUMgP0FYrG+cr64kWHr2MLbAwvGyjD3xTDCNNpyX5gLJTC onj9Ou5W8+hx/SptVUduJaNg/r45kgCnQQsUMwpu2LaQoipH8Te33BmGqB9XpxfqZdFZ Mw3L7ruMqIohr1BTyhMMG1pAAZ4OKFGAMd/+rugCOcz/CyFGqAVfuCInj0cjwHJdQLWU AoGtxa1k8xMGaPKOF/4gAtuJglLr9mg7lXSazi7iq01hm3ejYFgSGHDeNJt4reuCdIZg AMyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=MPkfXtz+; 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 x95si7289581ede.192.2019.11.26.00.35.58; Tue, 26 Nov 2019 00:36:22 -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=@c-s.fr header.s=mail header.b=MPkfXtz+; 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 S1727328AbfKZINc (ORCPT + 99 others); Tue, 26 Nov 2019 03:13:32 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:42412 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725933AbfKZINb (ORCPT ); Tue, 26 Nov 2019 03:13:31 -0500 Received: from localhost (mailhub1-ext [192.168.12.233]) by localhost (Postfix) with ESMTP id 47Mc9N6dNWz9tybD; Tue, 26 Nov 2019 09:13:28 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=MPkfXtz+; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id CKxTymBTLFVX; Tue, 26 Nov 2019 09:13:28 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 47Mc9N5GFMz9tybB; Tue, 26 Nov 2019 09:13:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1574756008; bh=lP+6ufsqX2zuMN9m3nNVIMGpzbr9PeIQSzO4jLnYSZc=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=MPkfXtz+Y69nLJpN/cUXRuJf5EPEpua/aPXkACaUsgScQaD5mPUqXrTh/7EZ8kc1A HvU+y05BQTgqEB3uzK9+WcEGoCZRgPnIWv60i5IPxnKhfo4oRxiCA2p0Uep0TiBDKT IqSPWW+Nk3jMlPC4KY3P5vcLVYaiymS4X9Ede7k4= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id B02688B7D8; Tue, 26 Nov 2019 09:13:29 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id 0-ZfisYBtVh2; Tue, 26 Nov 2019 09:13:29 +0100 (CET) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id C4D198B771; Tue, 26 Nov 2019 09:13:28 +0100 (CET) Subject: =?UTF-8?B?UmU6IOetlOWkjTog562U5aSNOiBsb29wIG5lc3RpbmcgaW4gYWxpZ25t?= =?UTF-8?Q?ent_exception_and_machine_check?= To: "Wangshaobo (bobo)" Cc: "linux-arch@vger.kernel.org" , "alistair@popple.id.au" , "chengjian (D)" , Xiexiuqi , "linux-kernel@vger.kernel.org" , "oss@buserror.net" , "paulus@samba.org" , "Libin (Huawei)" , "agust@denx.de" , "linuxppc-dev@lists.ozlabs.org" References: <8215aeb3-57dd-223a-29d3-45ca22b0543c@c-s.fr> From: Christophe Leroy Message-ID: Date: Tue, 26 Nov 2019 09:13:28 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Le 01/11/2019 à 02:57, Wangshaobo (bobo) a écrit : > Hi, Christophe > > I am sorry that we are in some troubles for some unpredictable problems when we replay and haven't given you a quick reply. > > I also want to ask does the phenomeon(use memcpy_toio when copy ioremap_address) only occurs in powerpc ? does any other > arch also has the same problem ? we are in persuit of asking why this phenomenon happened. Our linux kernel version is 4.4. It's not a problem ... it's a feature. I have no idea whether the same kind of issue can happen on other arches, sorry. Christophe > > thanks very much. > > -----邮件原件----- > 发件人: Christophe Leroy [mailto:christophe.leroy@c-s.fr] > 发送时间: 2019年10月31日 19:13 > 收件人: Wangshaobo (bobo) > 抄送: chengjian (D) ; Libin (Huawei) ; Xiexiuqi ; zhangyi (F) > 主题: Re: 答复: loop nesting in alignment exception and machine check > > Hi, > > Did you try ? Does it work ? > > Christophe > > Le 28/10/2019 à 06:57, Wangshaobo (bobo) a écrit : >> Hi,Christophe >> >> Thank you for your quick reply. I will try to use memcpy_toio() instead of memcpy(). >> >> -----邮件原件----- >> 发件人: Christophe Leroy [mailto:christophe.leroy@c-s.fr] >> 发送时间: 2019年10月26日 19:20 >> 收件人: Wangshaobo (bobo) >> 抄送: linux-arch@vger.kernel.org; alistair@popple.id.au; chengjian (D) >> ; Xiexiuqi ; >> linux-kernel@vger.kernel.org; oss@buserror.net; paulus@samba.org; >> Libin (Huawei) ; agust@denx.de; >> linuxppc-dev@lists.ozlabs.org >> 主题: Re: loop nesting in alignment exception and machine check >> >> Hi, >> >> Le 26/10/2019 à 09:23, Wangshaobo (bobo) a écrit : >>> Hi, >>> >>> I encountered a problem about a loop nesting occurred in >>> manufacturing the alignment exception in machine check, trigger background is : >>> >>> problem: >>> >>> machine checkout or critical interrupt ->…->kbox_write[for recording >>> last words] -> memcpy(irremap_addr, src,size):_GLOBAL(memcpy)… >>> >>> when we enter memcpy,a command ‘dcbz r11,r6’ will cause a alignment >>> exception, in this situation,r11 loads the ioremap address,which >>> leads to the alignment exception, >> >> You can't use memcpy() on something else than memory. >> >> For an ioremapped area, you have to use memcpy_toio() >> >> Christophe >> >>> >>> then the command can not be process successfully,as we still in >>> machine check.at the end ,it triggers a new irq machine check in irq >>> handler function,a loop nesting begins. >>> >>> analysis: >>> >>> We have analysed a lot,but it still can not come to a reasonable >>> description,in common,the alignment triggered in machine check >>> context can still be collected into the Kbox >>> >>> after alignment exception be handled by handler function, but how >>> does the machine checkout can be triggered in the handler fucntion >>> for any causes? We print relevant registers >>> >>> as follow when first enter machine check and alignment exception >>> handler >>> function: >>> >>>          MSR:0x2      MSR:0x0 >>> >>>          SRR1:0x2      SRR1:0x21002 >>> >>>          But the manual says SRR1 should be set to MSR(0x2),why >>> that happened ? >>> >>>          Then a branch in handler function copy the SRR1 to >>> MSR,this enble MSR[ME] and MSR[CE],system collapses. >>> >>> Conclusion: >>> >>>          1)  why the alignment exception can not be handled in >>> machine check ? >>> >>>          2)  besides memcpy,any other function can cause the >>> alignment exception ? >>> >>> We still recurrent it, the line as follows: >>> >>>          Cpu dead lock->watch log->trigger >>> fiq->kbox_write->memcpy->alignment exception->print last words. >>> >>>          but for those problems as below,what the kbox printed is empty. >>> >>> ------------------kbox restart:[   10.147594]---------------- >>> >>> kbox verify fs magic fail >>> >>> kbox mem mabye destroyed, format it >>> >>> kbox: load OK >>> >>> lock-task: major[249] minor[0] >>> >>> -----start show_destroyed_kbox_mem_head---- >>> >>> 00000000: 00000000 00000000 00000000 00000000  ................ >>> >>> 00000010: 00000000 00000000 00000000 00000000  ................ >>> >>> 00000020: 00000000 00000000 00000000 00000000  ................ >>> >>> 00000030: 00000000 00000000 00000000 00000000  ................ >>> >>> 00000040: 00000000 00000000 00000000 00000000  ................ >>> >>> 00000050: 00000000 00000000 00000000 00000000  ................ >>> >>> 00000060: 00000000 00000000 00000000 00000000  ................ >>> >>> 00000070: 00000000 00000000 00000000 00000000  ................ >>> >>> 00000080: 00000000 00000000 00000000 00000000  ................ >>> >>> 00000090: 00000000 00000000 00000000 00000000  ................ >>>