Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3671pxy; Wed, 21 Apr 2021 16:39:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyA2LSTjtEVB+AAUCItM4iqCDaI6XdcXArh6reI7sz+sfVZD/uMxyyrUTVUcN3SGKK3wW1G X-Received: by 2002:a05:6a00:88a:b029:261:6d37:dac6 with SMTP id q10-20020a056a00088ab02902616d37dac6mr600333pfj.18.1619048363157; Wed, 21 Apr 2021 16:39:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619048363; cv=none; d=google.com; s=arc-20160816; b=U3TI0Rrx0X0tkdoCa9UofpDgEu8aX4Lc9k3IEFu9Z0wUMX8ZKGs7OE4ufEPVf6lWBV WmNM20lkFjB8wbrnCpy34t9NNOmQDbEjE8+09PyMFwZbX4Gpahhjz2bhfqMG9SARtnyw k97L/abdZaSlnkbu3wYG03Qp3pkzB7J7IYxNQH3xHdh8IayT36ye55NQZvIfA85ueq5Q VoSq3oIFQWacXU8SPC7XcwiukOQyj4J9VIeskXdPjhZop71li5HrSjX3bOcsg2FJ/46a OCjYMj14STEixtFtXhCucBijUQhat+62fctEJ2/rrwfxIbZ5fzDixgR/31//ERLUQWWP 80mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=/6dFXTg1/6Ub7j3fofdJMV7IaHKaWu57axVddaUa8w4=; b=w62yXY5F4orvcqVLGjD6FwwoOhJMnOCDEmBjweM2EXLyLo2fx7PALrXmi8crNVb1uX H+kDe+RSIYhHmPJ2CF+0w4Q7io/W1FteeEbLcivIKAZuSkpcoCWooUov4nTGSKH6RtUO 9/0NAzqIRd2AMbEfR643YFr7EPBaWxMYnu85L2cPfQruAHUqhSrmBrJQEGbZe7M3Ffas /Czj3CwiTGv86HKuAGYWVxMlvfeCsoG+H6DrPzq+dCC+puUaiddqozHFedUNj2Alh+ni nueY5Ew7R3PtBggmiPSiKTnCWLC9of+nOApWF+MCLdvoQYQiUiJperv0+Zh5wmo+Q5CH YZSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nm12si4299854pjb.161.2021.04.21.16.39.10; Wed, 21 Apr 2021 16:39:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240957AbhDUPtx (ORCPT + 99 others); Wed, 21 Apr 2021 11:49:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:38754 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235510AbhDUPtk (ORCPT ); Wed, 21 Apr 2021 11:49:40 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E64D86144A; Wed, 21 Apr 2021 15:49:06 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lZF68-008irZ-K6; Wed, 21 Apr 2021 16:49:04 +0100 Date: Wed, 21 Apr 2021 16:49:03 +0100 Message-ID: <87wnsvprio.wl-maz@kernel.org> From: Marc Zyngier To: dann frazier Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sumit Garg , kernel-team@android.com, Russell King , Catalin Marinas , Thomas Gleixner , Will Deacon , Fu Wei Subject: Re: [PATCH 08/11] irqchip/gic: Configure SGIs as standard interrupts In-Reply-To: References: <20200519161755.209565-1-maz@kernel.org> <20200519161755.209565-9-maz@kernel.org> <8735vjrjj3.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: dann.frazier@canonical.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, sumit.garg@linaro.org, kernel-team@android.com, linux@arm.linux.org.uk, catalin.marinas@arm.com, tglx@linutronix.de, will@kernel.org, fu.wei@linaro.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 21 Apr 2021 15:52:52 +0100, dann frazier wrote: > > [ + Fu Wei ] [...] > > > > Please feed this stacktrace to scripts/decode_stacktrace.sh so that I > > can get an idea about what is going wrong. I bet something is playing > > ungodly games with the one of the IPIs, and things go horribly wrong. > > hey Marc, > Sure: > > [ 7.927289] Unable to handle kernel read from unreadable memory at virtual address 0000000000000028 > [ 7.936326] Mem abort info: > [ 7.939108] ESR = 0x96000004 > [ 7.942151] EC = 0x25: DABT (current EL), IL = 32 bits > [ 7.947451] SET = 0, FnV = 0 > [ 7.950494] EA = 0, S1PTW = 0 > [ 7.953624] Data abort info: > [ 7.956492] ISV = 0, ISS = 0x00000004 > [ 7.960316] CM = 0, WnR = 0 > [ 7.963273] [0000000000000028] user address but active_mm is swapper > [ 7.969616] Internal error: Oops: 96000004 [#1] SMP > [ 7.974483] Modules linked in: > [ 7.977531] CPU: 9 PID: 1 Comm: swapper/0 Not tainted 5.12.0-rc8 #19 > [ 7.983874] Hardware name: GIGABYTE R120-T33/MT30-GS1, BIOS F02 08/06/2019 > [ 7.990737] pstate: 40400085 (nZcv daIf +PAN -UAO -TCO BTYPE=--) > [ 7.996732] pc : __ipi_send_mask (/home/ubuntu/linux/./include/linux/irqdomain.h:537 /home/ubuntu/linux/kernel/irq/ipi.c:283) > [ 8.000910] lr : smp_cross_call (/home/ubuntu/linux/arch/arm64/kernel/smp.c:958) > [ 8.004913] sp : ffff800012753c10 > [ 8.008216] x29: ffff800012753c10 x28: ffff000100de5d00 > [ 8.013521] x27: 000000000000000a x26: ffff80001225da20 > [ 8.018825] x25: 0000000000000000 x24: ffff000ff62719b0 > [ 8.024129] x23: ffff80001225d000 x22: ffff800012368108 > [ 8.029433] x21: ffff800010f69a20 x20: 0000000000000000 > [ 8.034737] x19: ffff000100143c60 x18: 0000000000000020 > [ 8.040041] x17: 000000008e74252f x16: 00000000bf0ab2ad > [ 8.045345] x15: ffffffffffffffff x14: 0000000000000000 > [ 8.050649] x13: 003d090000000000 x12: 00003d0900000000 > [ 8.055953] x11: 0000000000000000 x10: 00003d0900000000 > [ 8.061257] x9 : ffff800010027f14 x8 : 0000000000000000 > [ 8.066561] x7 : 00000000ffffffff x6 : ffff000ff6148698 > [ 8.071865] x5 : ffff80001159d040 x4 : ffff80001159d110 > [ 8.077169] x3 : ffff800010f69a00 x2 : 0000000000000000 > [ 8.082473] x1 : ffff800010f69a20 x0 : 0000000000000000 > [ 8.087777] Call trace: > [ 8.090213] __ipi_send_mask (/home/ubuntu/linux/./include/linux/irqdomain.h:537 /home/ubuntu/linux/kernel/irq/ipi.c:283) Thanks for that. This resolves to: if (irq_domain_is_ipi_per_cpu(data->domain)) { data->domain is NULL, and we probably are using freed memory... > > Now, here's a hunch: in the fine TX1 tradition, the firmware is broken > > and the GTDT table looks unusable. Amusingly, the crash happens right > > after the SBSA watchdog fails to probe. > > Yeah, I noticed that, but didn't highlight it as I didn't see it in > the backtrace... > > > And looking at the code that implements that driver, it looks dodgy as > > hell, as it unmaps an interrupt it doesn't even know is valid. And it > > does that right when the driver fails the way you experienced it. If, > > by any chance, the interrupt field is 0 in the firmware table, this > > results in SGI0 being unmapped. Given that this is the rescheduling > > interrupt, fireworks happen. > > ... and that explains why. I wouldn't have gotten there, but wish I'd > thought to test w/ the watchdog compiled out :( No worries. This IRQ series has uncovered a number of terrible driver behaviours since I merged it, and these bugs are worth every penny. > > Can you have a go with the patchlet below, and let me know if that > > helps? > > It does! Awesome. I'll Cc you on the actual patch, feel free to respond with a Tested-by: if you want. Thanks, M. -- Without deviation from the norm, progress is not possible.