Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp997459imm; Fri, 15 Jun 2018 09:30:17 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKPWHyFGyUJGGKrAdXAIu3xnbagV26AOpR8lMNq50Wp/68/8V1EWlI9dcuFa5UVyedJf6yf X-Received: by 2002:a63:bc0a:: with SMTP id q10-v6mr2256842pge.70.1529080217879; Fri, 15 Jun 2018 09:30:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529080217; cv=none; d=google.com; s=arc-20160816; b=KXb30s8oUcCkQJCWOXeZq+nQigrKtuGBA6O5+G4BHw0bd5FrRWKkIXPTwWneyBjQv5 GFdErLK6T+AFuQvCDC1MIwF8v5hoRRjHnT8o4BRyAmsh9CQDjTHDUGIPt2LZtSPe6pwF yDHrN1exwjycHGrti2G+SBBHTkMbShSRCDILPlRGa4GWnvZcDu4r0v8JDPHR/EffPgb+ RFInZIamPTVx+0er3xbTkH0prz/N4ZfWyGlF176ZA/dxW9BdwlCzXyi/unMZcDux1JgX yHk1l7kzaa1QWM2+0Yl15UmNS7o1REV1cD1Fc0JjGwFD3g5kVfnFB7J6kvrFVl0Arncf NeSA== 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:arc-authentication-results; bh=e17FnNsTbyEPR5xr0XH1l0kK6whA0bd/e2Fx7vcQtvE=; b=NT942MH02rxxdGakTG/Jr2mD0wgf+5r+2LIgYPiTfVmPPNpmD0BYeb/g/tLrms9mDG KGaSY5EQa39VqUB5nUG9jU7fJKstmUrdUMbPkTdfSpgon10siubo2ZZpa0mswHgfx5hr wFnXFT326vVzTxrwGVRQ8SiwDcGcDBAbN+NtLpkwz9H+svQ15VMlyzFk4FB1q7Wu9Sde EUOwSY4hXRTfpFZP6NRhanONMB0Yo3JML8qce0b0iUoN9Sf+x1ROd/yNhx/00R0qUkoa 4/9+jNWUbHhPid280BAY2Dqqm4u73rZkt8bfHlIm7p8gLfhEMCE08EuJ0c/RlXi05YIr ksWA== 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 c18-v6si8527828pls.407.2018.06.15.09.30.03; Fri, 15 Jun 2018 09:30:17 -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 S965993AbeFOQ3i (ORCPT + 99 others); Fri, 15 Jun 2018 12:29:38 -0400 Received: from foss.arm.com ([217.140.101.70]:44112 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965947AbeFOQ3h (ORCPT ); Fri, 15 Jun 2018 12:29:37 -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 9D7B61529; Fri, 15 Jun 2018 09:29:37 -0700 (PDT) Received: from [10.1.206.34] (melchizedek.cambridge.arm.com [10.1.206.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D36693F25D; Fri, 15 Jun 2018 09:29:33 -0700 (PDT) Subject: Re: [PATCH 0/3] arm64: kexec,kdump: fix boot failures on acpi-only system To: AKASHI Takahiro Cc: catalin.marinas@arm.com, will.deacon@arm.com, akpm@linux-foundation.org, ard.biesheuvel@linaro.org, tbaicar@codeaurora.org, bhsharma@redhat.com, dyoung@redhat.com, mark.rutland@arm.com, al.stone@linaro.org, graeme.gregory@linaro.org, hanjun.guo@linaro.org, lorenzo.pieralisi@arm.com, sudeep.holla@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kexec@lists.infradead.org References: <20180615075623.13454-1-takahiro.akashi@linaro.org> From: James Morse Message-ID: <81a9a385-3b9f-113d-96f0-379be74c19f0@arm.com> Date: Fri, 15 Jun 2018 17:29:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180615075623.13454-1-takahiro.akashi@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Akashi, Thanks for putting this together, On 15/06/18 08:56, AKASHI Takahiro wrote: > This patch series is a set of bug fixes to address kexec/kdump > failures which are sometimes observed on ACPI-only system and reported > in LAK-ML before. > > In short, the phenomena are: > 1. kexec'ed kernel can fail to boot because some ACPI table is corrupted > by a new kernel (or other data) being loaded into System RAM. Currently > kexec may possibly allocate space ignoring such "reserved" regions. > We will see no messages after "Bye!" > > 2. crash dump (kdump) kernel can fail to boot and get into panic due to > an alignment fault when accessing ACPI tables. This can happen because > those tables are not always properly aligned while they are mapped > non-cacheable (ioremap'ed) as they are not recognized as part of System > RAM under the current implementation. > > After discussing several possibilities to address those issues, > the agreed approach, in my understanding, is > * to add resource entries for every "reserved", i.e. memblock_reserve(), > regions to /proc/iomem. > (NOMAP regions, also marked as "reserved," remains at top-level for > backward compatibility.) This means user-space can tell the difference between reserved-system-ram and reserved-address-space. > * For case (1), user space (kexec-tools) should rule out such regions > in searching for free space for loaded data. ... but doesn't today, because it fails to account for second-level entries. We've always had second-level entries, so this is a user-space bug. We need both fixed to fix the issue. Our attempts to fix this just in the kernel reached a dead end, because Kdump needs to include reserved-system-ram, whereas kexec has to avoid it. User-space needs to be able to tell reserved-system-ram and reserved-address-space apart. Hence we need to expose that information, and pick it up in user-space. Patched-kernel and unpatch-user-space will work the same way it does today, as the additional reserved regions are ignored by user-space. Unpatched-kernel and patched-user-space will also work the same way it does today as the additional reserved regions are missing. I think this is the only way forwards on this issue... > * For case (2), the kernel should access ACPI tables by mapping > them with appropriate memory attributes described in UEFI memory map. > (This means that it doesn't require any changes in /proc/iomem, and > hence user space.) (this one is handled entirely in the kernel) Thanks, James