Received: by 10.192.165.148 with SMTP id m20csp386448imm; Fri, 20 Apr 2018 00:28:31 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/BBFiU+2wSYSOcihnzxDRimU0E4TKBCOsUP3aqysyqwVmzhfucuAVcrzPKA2gZsttHFFeS X-Received: by 10.99.149.87 with SMTP id t23mr7518785pgn.77.1524209311429; Fri, 20 Apr 2018 00:28:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524209311; cv=none; d=google.com; s=arc-20160816; b=U6Gt3Fc9d6jc9qCb2+FQTzSkSJpzeR94bUYo4mN5hZgPCeNJ/hCxGQnNY6luIwzoHU aGyAjHgweyc5dbSsy7c5X/nEUDd3WRsGmy1kpnnKkihZs8SkaE0Sy0I4v8Ii27uZeeYB VgXU7Uc27ZLsBtmGw9fQKxhD7cFIG1YTpkK4ZXQri9X3dk0So14y9wgdm5YqR7QZ2w1j h8V/fXjXIVn9qbeeJKXHYoyn05k1SsSmFRryJZ2IwX27TrHJYtX4l05dszpP1b0ExHP7 ODxDKvaMTuX3lQ9OFWI6/o0d82Cr+18UHNHhZffrCFTa4F2KoE/g8lvslQiQh+5C/+Zm 6U2w== 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:arc-authentication-results; bh=xNfw3RWRETWvTNEdBoYzePRkWS+kiZy/I0PBNuSVFOc=; b=Zf5c6XSBzkhSY4s6iT20CBgnKeXFoMCg2OgaLVHlC87f45GmeBg3BICPSkI3yUkJbd /BG3IPz5WFvk0mpb8JEbiQBA8DMmDFwHaQO42IBxvoY6AA8gud3wqaReWFFzEXa8fE6o gl3Q8JxA15dPr72aRZc0rLBoa+HugnT61gBS44WchUK9AprilYIwH5x1cMZ7tiob0wqG mdGtFT0OZ9cm3kF7sT7iLb7ayMaVsTlkxNgLghV/ScDTcWtH5h9RZcVXtIJtnaQjj9YM auGnNlAEugClqV39TRHRpZKYeBVzH0u78oMQiHXFwgsNDEny5IqF1se9Yk2xDbmXUlkS bWPw== ARC-Authentication-Results: i=1; mx.google.com; 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 x124si4518890pgb.651.2018.04.20.00.28.16; Fri, 20 Apr 2018 00:28:31 -0700 (PDT) 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; 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 S1754025AbeDTH1O (ORCPT + 99 others); Fri, 20 Apr 2018 03:27:14 -0400 Received: from foss.arm.com ([217.140.101.70]:44960 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753874AbeDTH1M (ORCPT ); Fri, 20 Apr 2018 03:27:12 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 86BBC1435; Fri, 20 Apr 2018 00:27:12 -0700 (PDT) Received: from [172.16.5.172] (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 124503F59D; Fri, 20 Apr 2018 00:27:08 -0700 (PDT) Subject: Re: [RFC PATCH 3/4] acpi: apei: Do not panic() in NMI because of GHES messages To: "Alex G." Cc: linux-acpi@vger.kernel.org, rjw@rjwysocki.net, lenb@kernel.org, tony.luck@intel.com, bp@alien8.de, tbaicar@codeaurora.org, will.deacon@arm.com, shiju.jose@huawei.com, zjzhang@codeaurora.org, gengdongjiu@huawei.com, linux-kernel@vger.kernel.org, alex_gagniuc@dellteam.com, austin_bolen@dell.com, shyam_iyer@dell.com References: <20180403170830.29282-1-mr.nuke.me@gmail.com> <20180403170830.29282-4-mr.nuke.me@gmail.com> <338e9bb4-a837-69f9-36e5-5ee2ddcaaa38@arm.com> <9e29e5c6-b942-617e-f92e-728627799506@gmail.com> <2120d34a-41d2-9fff-2710-d11e9a19e12a@gmail.com> <855860ef-f84e-00af-ed44-55d6a5a41a94@arm.com> <70c0a230-945a-3a1a-7c49-4b0784a3cfa6@gmail.com> From: James Morse Message-ID: Date: Fri, 20 Apr 2018 08:27:09 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <70c0a230-945a-3a1a-7c49-4b0784a3cfa6@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alex, On 04/16/2018 10:59 PM, Alex G. wrote: > On 04/13/2018 11:38 AM, James Morse wrote: >> This assumes a cache-invalidate will clear the error, which I don't think we're >> guaranteed on arm. >> It also destroys any adjacent data, "everyone's happy" includes the thread that >> got a chunk of someone-else's stack frame, I don't think it will be happy for >> very long! > > Hmm, no cache-line (or page) invalidation on arm64? How does > dma_map/unmap_*() work then? You may not guarantee to fix the error, but There are cache-invalidate instructions, but I don't think 'solving' a RAS error with them is the right thing to do. > I don't buy into the "let's crash without trying" argument. Our 'cache writeback granule' may be as large as 2K, so we may have to invalidate up to 2K of data to convince the hardware this address is okay again. All we've done here is differently-corrupt the data so that it no longer generates a RAS fault, it just gives you the wrong data instead. Cache-invalidation is destructive. I don't think there is a one-size-fits-all solution here. >> (this is a side issue for AER though) > > Somebody muddled up AER with these tables, so we now have to worry about > it. :) Eh? I see there is a v2, maybe I'll understand this comment once I read it. >>> How does FFS handle race conditions that can occur when accessing HW >>> concurrently with the OS? I'm told it's the main reasons why BIOS >>> doesn't release unused cores from SMM early. >> >> This is firmware's problem, it depends on whether there is any hardware that is >> shared with the OS. Some hardware can be marked 'secure' in which case only >> firmware can access it, alternatively firmware can trap or just disable the OS's >> access to the shared hardware. > > It's everyone's problem. It's the firmware's responsibility. It depends on the SoC design. If there is no hardware that the OS and firmware both need to access to handle an error then I don't think firmware needs to do this. >> For example, with the v8.2 RAS Extensions, there are some per-cpu error >> registers. Firmware can disable these for the OS, so that it always reads 0 from >> them. Instead firmware takes the error via FF, reads the registers from >> firmware, and dumps CPER records into the OS's memory. >> >> If there is a shared hardware resource that both the OS and firmware may be >> accessing, yes firmware needs to pull the other CPUs in, but this depends on the >> SoC design, it doesn't necessarily happen. > > The problem with shared resources is just a problem. I've seen systems > where all 100 cores are held up for 300+ ms. In latency-critical > applications reliability drops exponentially. Am I correct in assuming > your answer would be to "hide" more stuff from the OS? No, I'm not a fan of firmware cycle stealing. If you can design the SoC or firmware so that the 'all CPUs' stuff doesn't need to happen, then you won't get these issues. (I don't design these things, I'm sure they're much more complicated than I think!) Because the firmware is SoC-specific, so it only needs to do exactly what is necessary. >>> I think the idea of firmware-first is broken. But it's there, it's >>> shipping in FW, so we have to accommodate it in SW. >> >> Part of our different-views here is firmware-first is taking something away from >> you, whereas for me its giving me information that would otherwise be in >> secret-soc-specific registers. > > Under this interpretation, FFS is a band-aid to the problem of "secret" > registers. "Secret" hardware doesn't really fit well into the idea of an > OS [1]. Sorry, I'm being sloppy with my terminology, by secret-soc-specific I mean either Linux can't access them (firmware privilege-level only) or Linux can't reasonably know where these registers are, as they're soc-specific and vary by manufacture. >>> And linux can handle a wide subset of MCEs just fine, so the >>> ghes_is_deferrable() logic would, under my argument, agree to pass >>> execution to the actual handlers. >> >> For some classes of error we can't safely get there. > > Optimize for the common case. At the expense of reliability? Thanks, James