Received: by 10.213.65.68 with SMTP id h4csp1139421imn; Wed, 14 Mar 2018 10:43:48 -0700 (PDT) X-Google-Smtp-Source: AG47ELv9CALYjhLVPjAqSoonYd1EzNMSyqC3BRujn5zRlijTy38SzsU48Hk15DkBrSwRD4SR/ukh X-Received: by 10.98.0.21 with SMTP id 21mr2748775pfa.48.1521049428404; Wed, 14 Mar 2018 10:43:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521049428; cv=none; d=google.com; s=arc-20160816; b=nvC5BE6JGtbjaam9m/53ek/ct90/hdGWYID4wVo4kY1jnQVMlDWt9SHPM5X0DDtQrd L8iKExG7S0h2a3I/MuOx/qdaG5qmpxPpxqpCHemSM1BeRZ3uoVhEUBgGEaJ84kcKkyKQ QDtfLbyyjKwuvjHD3KR8Lhg+W0oVerSJ3Lshoh17WyFzD5OVuxDAUQLrW8gb7yXcTP2s 9NSDMxLzQFAAu8V0+jyjU9enwxCkG5aW8f0KanNSAhYU+ummXue4MhINK+HbblgutAL2 YL2/7cPgcTcp88X9DffzzcQUL3Bhvw9NRDtQy44rkHNpgVIBLMJkSblhMGJj46UcK9rC qJFg== 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:organization:from:references:cc:to:subject :arc-authentication-results; bh=GW/tuY7t3dJQaCBeCvaZu35OqPqGI1zmT5+2gA35/RE=; b=UsZxEfTX834qeXJ+VhDMR3XAK6M7SAZoSuYFrFoYaSF8KSglU4IaW+RXDOKJl8xWqt JR/85zdBak6bN0hnOJuEGMg3NRoLsuJCN/0AJlAgtP7tOWTTrOd8eIlyEcqu/WoBVRcu 1PjLiYvxtttk73qnacgBzW5d3ItBPqY1NZqkME/+bpvA8jrHKIunSpgFLTgN6FsAQ2aV D18/UEh4J6B9qT2Tx9txSy9UD3paLUEQK0cW3pqmE5qVfI0kGGxfJzAdj4cmWGg+di7d HvCLt0oSxs9DPMkhr/zi0Kiso47BxOmMJmGvnSA7wG+eqv5ZWX2HxMEc8O0x7acb3vJk 3BXw== 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 y86si2458685pfi.19.2018.03.14.10.43.34; Wed, 14 Mar 2018 10:43:48 -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 S1752253AbeCNRmL (ORCPT + 99 others); Wed, 14 Mar 2018 13:42:11 -0400 Received: from foss.arm.com ([217.140.101.70]:57418 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752219AbeCNRmJ (ORCPT ); Wed, 14 Mar 2018 13:42:09 -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 A028780D; Wed, 14 Mar 2018 10:42:09 -0700 (PDT) Received: from [10.1.207.62] (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8BC5D3F53D; Wed, 14 Mar 2018 10:42:08 -0700 (PDT) Subject: Re: [PATCH 0/3] irqchip: GIC kexec/kdump improvement and workarounds To: Thomas Gleixner , Mark Rutland Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jason Cooper , Grzegorz Jaszczyk References: <20180313172103.24281-1-marc.zyngier@arm.com> <20180313175156.gmncij4rnqcdl5ie@lakrids.cambridge.arm.com> <72c7a6d2-a4c4-26b2-2982-c1d1ffb39b81@arm.com> <20180314165708.daoui66waxvicciq@lakrids.cambridge.arm.com> From: Marc Zyngier Organization: ARM Ltd Message-ID: <8e20eae8-aa9f-28a4-3e7d-3d8ec71b2953@arm.com> Date: Wed, 14 Mar 2018 17:42:06 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/03/18 17:11, Thomas Gleixner wrote: > On Wed, 14 Mar 2018, Mark Rutland wrote: >> On Tue, Mar 13, 2018 at 06:35:07PM +0000, Marc Zyngier wrote: >>> On 13/03/18 17:51, Mark Rutland wrote: >>>> On Tue, Mar 13, 2018 at 05:21:00PM +0000, Marc Zyngier wrote: >>>>> As kexec and kdump are getting used a bit more intensively, I've been >>>>> made aware of a number of shortcomings. >>>>> >>>>> The main gripe is from folks trying to launch a kdump kernel from >>>>> within an interrupt handler. If using EOImode==1, things work as >>>>> expected. If using EOImode==0 (such as in a guest), the secondary >>>>> kernel hangs as the previous interrupt hasn't been EOI'd, and the >>>>> active priority is still set. The first two patches are addressing >>>>> this situation for both GICv2 and GICv3 by reseting the APRs to their >>>>> default value. >>>> >>>> As a more general thing, if irqchip drivers have state that needs to be >>>> reset in their init code, can we live all this irqchip reset to the >>>> crashdump kernel, and kill machine_kexec_mask_interrupts() entirely? >>> >>> We could, once we know for sure that all the potential irqchips have >>> been fixed. Or we could just remove it immediately, and see what breaks. >> >> I would be very tempted to do the latter. > > Makes sense. Do we have any indicator that tells us that a particular irq > chip is missing something in the init code or do we have to rely on crash > reports? A way to work out what is potentially missing would be to make sure that whatever we're removing from machine_kexec_mask_interrupts, we can find it in the irqchip init code. Not an easy task, and certainly not perfect (patches 1 and 2 in this series have no equivalent in the kexec code). There is still another category of "reset" stuff that belongs to the teardown path, and that's for things that may have an impact on the secondary kernel. The case I have in mind is that of the GIC LPI pending tables. These are allocated to the GIC, which can write pending bits at any time. Think of it as a DMA engine. At the moment we enter the secondary kernel, we must make sure the GIC has already been shut down, as the table memory will be reallocated. For that particular case, I've started looking at some "reset" API that an irqchip to register with, and get called back on kexec/kdump. Not completely dissimilar to the shutdown method that some IOMMU drivers use to gracefully stop in the same circumstances. Thanks, M. -- Jazz is not dead. It just smells funny...