Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp4541657pxt; Wed, 11 Aug 2021 08:18:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7rIAhJkZk1u1McgFNRs0Yaurrcnr5f+ZMsgBg/72bnhP0udtP2X7j9HskSl/0RJb+n5/p X-Received: by 2002:a05:6e02:54c:: with SMTP id i12mr26415ils.103.1628695083224; Wed, 11 Aug 2021 08:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628695083; cv=none; d=google.com; s=arc-20160816; b=TVWj7NuT+Me067QL2Cb+Rlu1JIfafuI0/Sd47MWELyiVy55AA35JBiSV1hpAe4z/Rp xcffkgRInS4f9/MUPdGOV2z2zBuq4GkjcVvCpxRDOKDqxFGnUDryXy+NTOJqqXKbP7x7 HK3xwzC/VTC3mdrUXEeYMasYkG1DnPQB4Ky+iCKV4Bsipx5PHoxqLwWvpywwtCMkIUh5 W6tNDbnvBtWXxsUFXjzwOSe2DD+S/80gq53oEpBxP1eXm+n3pel8SAzPoz1KDWJnIQ4d 5Qn5VDFSBqiOwFipSaba+P+31PJ08UL2woGzJqiBAHqmmJJKl4L90lPA1EEHL8o7HxC9 7qDQ== 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=u+rWo3kkscnAGB0m91d1lxt9GhqtJ/5ryhoFQWe97gI=; b=xrwOrUKkVI94igMKeCTgzyfpD9PVBNh4tbmv9Kee3bW1vEUxx3IjMfZdTMiLwpFvZK 9C+eB7B/1/uXgfnCSCsp9XsuDszJBiMwb4blBvwwlvuMxtsgSY+M9pPBC1D6Z8wowYYS nDr5Uy0UlZ2WJc8+Bv7XTEo02hKQvRZ2rkdXcXyENeIAQoJoUhuJV8jeIt7MxvJ4iWnt tlOwPOEF7Jo1nM85ErlpH2bJb9eEYjHuXwzZz1P7FzwBib55q/5pGN0zsjeHmIIvVNwz 1G5Ffs5dXc8339bF76zxvvKmptDxfqYDtnbQw3VYj+CN/zrgrSK+Jz7WUX7zQdG8VHSZ QQLg== 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 f7si1456432jav.38.2021.08.11.08.17.50; Wed, 11 Aug 2021 08:18:03 -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 S233076AbhHKPRD (ORCPT + 99 others); Wed, 11 Aug 2021 11:17:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:51934 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233079AbhHKPPe (ORCPT ); Wed, 11 Aug 2021 11:15:34 -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 E124760F21; Wed, 11 Aug 2021 15:14:47 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] 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.2) (envelope-from ) id 1mDpwM-004Mac-2z; Wed, 11 Aug 2021 16:14:46 +0100 Date: Wed, 11 Aug 2021 16:14:45 +0100 Message-ID: <87im0c9foa.wl-maz@kernel.org> From: Marc Zyngier To: Thomas Gleixner Cc: Valentin Schneider , linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, Will Deacon , Mark Rutland , Sebastian Andrzej Siewior , Mel Gorman , Ard Biesheuvel Subject: Re: [SPLAT 2/3] irqchip/gic-v3-its: Sleeping spinlocks down gic_reserve_range() In-Reply-To: <87a6lop3mi.ffs@tglx> References: <20210810134127.1394269-1-valentin.schneider@arm.com> <20210810134127.1394269-3-valentin.schneider@arm.com> <87y2989xhh.wl-maz@kernel.org> <87a6lop3mi.ffs@tglx> 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: 185.219.108.64 X-SA-Exim-Rcpt-To: tglx@linutronix.de, valentin.schneider@arm.com, linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, will@kernel.org, mark.rutland@arm.com, bigeasy@linutronix.de, mgorman@techsingularity.net, ardb@kernel.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, 11 Aug 2021 13:28:21 +0100, Thomas Gleixner wrote: > > On Wed, Aug 11 2021 at 09:50, Marc Zyngier wrote: > > On Tue, 10 Aug 2021 14:41:26 +0100, > > Valentin Schneider wrote: > > The issue is that although the redistributor tables have been > > allocated ahead of time (outside of any cpuhp callback), they cannot > > be programmed into the RDs until the corresponding CPUs have been > > brought up (the registers may not be accessible). > > > > For the same reason, we don't know whether we can free them (because > > there is already a table programmed there) or have to reserve them > > with an efi_mem_reserve_persistent() call. efi_mem_reserve_iomem() > > uses GFP_ATOMIC for its allocation, but this is not sufficient for RT > > anymore. > > > > We could postpone the reservation of the memory to a later point (it > > is only useful for kexec), but it isn't clear where that point is. The > > CPU is not quite up yet, and we can't easily IPI the boot CPU to do > > the reserve call. > > Right, but don't you know about the need for reservation _before_ > bringing the CPU up? Unfortunately not. To find out, you need to access a pair of per-CPU registers which are not guaranteed to be powered-on until the corresponding CPU has made it into the kernel (the firmware will power things on as part of bringing the CPU up). Which is why we always allocate the memory upfront for all the CPUs, and each CPU either frees the memory if it already had something in its redistributor, or point the redistributor to the memory and reserves it. This is probably the most epic fail of the GICv3 architecture... Thanks, M. -- Without deviation from the norm, progress is not possible.