Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp526430rdb; Tue, 19 Sep 2023 02:42:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEl7uVsPzWp4tmjXBzQsf3oXg8oI4jGfy9/qfxPRBAIDKHwIaf/u0a+O4v1+AFmNczLxzXu X-Received: by 2002:a05:6a20:3952:b0:148:f16f:113f with SMTP id r18-20020a056a20395200b00148f16f113fmr4692486pzg.12.1695116537813; Tue, 19 Sep 2023 02:42:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695116537; cv=none; d=google.com; s=arc-20160816; b=06oQJW4+kSYqf8gpvHFO4fepiv3w3U6nEbkt/EvXkDgwyaSbcxoRQYwUa5aqDve2LX DxyA43kyHBWNap2bL3/SPX+cmH5iTN4J8FSWr/RP9Ehl7hXl8pIBzt7mr0KlTxKa5inY YF+1irkDCqZDVRePRhM4+e+uSIm+gd198PsDQHwjL28iw8kd+A9xKIIj56uZkorJdKVq Yp7f6A8BOVVg3Jz+19HuUrB9DN+tOo8ADTXQ5WdLm+128N+ZSEwoVmzvwb3BYTiLKkpO o3Li07NeMaBwPrxJQRVN5qLnYWXDi3QsInVYh3+NxA++DTPnBcd9izMkfewek0BACDDh WPDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=y8rJDvUqOXwqZuoo1W57hjmHySlMvZ2epmiMYH9qiJQ=; fh=PXJ1nrAkwnzNPHtj0xILXFW28d5sEdNuBWEBRL0T4wA=; b=u1hfG16PPGlnMsFDOipJZ+kOqty0VcrALctuJkE8iXBjs6AZS5vZKWfKqdLWxQJfCL kaO9afgf0lafC4xTLvMh2zWn8j11X5SdOjRkuod3wYCaB7xObLaopUJ8H0gDZsa5zWTN 9MLqYvRPylnUbX/NGaTn69L+c42npYPNS8iGuM/a8NNWKFJRYoomlYSsJXVR7rCJWWvE zUW9q6p/tHwRVlffZGnkSvW2V1vnyPq8vt1kkVeeZsedZ5IrebmMEeoaaTVwOPbWTQiS fbucmjiyaH34i28aeOHqTMt3Et6l/EnFAXaP8b4lL/54+IeEAWzPelL5sqXCbXn3EE7n Eiww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PACxhpoA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id m9-20020a654389000000b00573fffb12a6si9202327pgp.793.2023.09.19.02.42.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 02:42:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PACxhpoA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 3A00881B212F; Mon, 18 Sep 2023 20:52:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231366AbjISDwf (ORCPT + 99 others); Mon, 18 Sep 2023 23:52:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231319AbjISDwc (ORCPT ); Mon, 18 Sep 2023 23:52:32 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AA08FD for ; Mon, 18 Sep 2023 20:51:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695095508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y8rJDvUqOXwqZuoo1W57hjmHySlMvZ2epmiMYH9qiJQ=; b=PACxhpoAibkm8pCtRlEDCKD/Z/Qwax0BNXQCW+TRj2KpX9j9aUX7lHdvmUH3qBk7qqUxYR J+sSO789xW69eNcMxsYAG9/YL2/UphO4FA6xpRWxY5cBpyyCy0CE9TlurjX9GVM9N+NhI3 EAsm0VbU0QrFrDrwHj34GQ/IQxnk3+s= Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-680-WpYNb0sfP2GjOjb4wTT4Cw-1; Mon, 18 Sep 2023 23:51:46 -0400 X-MC-Unique: WpYNb0sfP2GjOjb4wTT4Cw-1 Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-274c4e3da1aso1515347a91.2 for ; Mon, 18 Sep 2023 20:51:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695095506; x=1695700306; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=y8rJDvUqOXwqZuoo1W57hjmHySlMvZ2epmiMYH9qiJQ=; b=LbMyTNtWmGgjZf5YA/h+naIJk9Cvs77++EwgWu21XEgCGMaScO1d83ObgwGIGOARjU YxxyHp/bt1TXDypSxdcVy8NXkijGY9fmKW6iNB1jL0ikQVzsvE7i9dQKqSAKlK6TbP9A 2iFs2HHYFof1zW25Mm/C8gwYWnSsVIUSxXDyW6lpSTIs3IDO+4HEMolwMQ5U+bosPx+M 3toMx4i1lUE8GlKQ/Z0pfFqCV5an0ZT3idwOfyp9rubInVncH/iVxrXfx4Ie2yRu0pfV 0ZxKRPgfLGA8uChgt1PtmqAe/Aj42QsUK5BechtnnPF/zO0FYsBqHixfyi8hom+r7IwE HSIQ== X-Gm-Message-State: AOJu0YwMUWoxo9J/oSXZsCdPSR3JMvJ0E4RGzB3l8/X09pUGHzfejsLn byUNG4iMWIkm0P3TxfK0k5l092msHMqxM8AcFtv9ClditBJFXn5xtKbXk8eaDBN3Itk8xdtc9fk GmJRtSEiIaR80RXIkyjUIbNHi X-Received: by 2002:a17:90b:393:b0:274:655f:123a with SMTP id ga19-20020a17090b039300b00274655f123amr8825722pjb.17.1695095505872; Mon, 18 Sep 2023 20:51:45 -0700 (PDT) X-Received: by 2002:a17:90b:393:b0:274:655f:123a with SMTP id ga19-20020a17090b039300b00274655f123amr8825704pjb.17.1695095505561; Mon, 18 Sep 2023 20:51:45 -0700 (PDT) Received: from ?IPV6:2001:8003:e5b0:9f00:dbbc:1945:6e65:ec5? ([2001:8003:e5b0:9f00:dbbc:1945:6e65:ec5]) by smtp.gmail.com with ESMTPSA id x34-20020a17090a6c2500b002684b837d88sm8566963pjj.14.2023.09.18.20.51.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Sep 2023 20:51:44 -0700 (PDT) Message-ID: <0743752e-fd7a-c0b6-a193-196aef12b2a3@redhat.com> Date: Tue, 19 Sep 2023 13:51:37 +1000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [RFC PATCH v2 29/35] irqchip/gic-v3: Don't return errors from gic_acpi_match_gicc() Content-Language: en-US From: Gavin Shan To: James Morse , linux-pm@vger.kernel.org, loongarch@lists.linux.dev, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, kvmarm@lists.linux.dev Cc: x86@kernel.org, Salil Mehta , Russell King , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com References: <20230913163823.7880-1-james.morse@arm.com> <20230913163823.7880-30-james.morse@arm.com> <31fa3aa7-c12c-3eb7-e9d2-5967a735ac78@redhat.com> In-Reply-To: <31fa3aa7-c12c-3eb7-e9d2-5967a735ac78@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 18 Sep 2023 20:52:34 -0700 (PDT) On 9/19/23 13:39, Gavin Shan wrote: > > On 9/14/23 02:38, James Morse wrote: >> gic_acpi_match_gicc() is only called via gic_acpi_count_gicr_regions(). >> It should only count the number of enabled redistributors, but it >> also tries to sanity check the GICC entry, currently returning an >> error if the Enabled bit is set, but the gicr_base_address is zero. >> >> Adding support for the online-capable bit to the sanity check >> complicates it, for no benefit. The existing check implicitly >> depends on gic_acpi_count_gicr_regions() previous failing to find >> any GICR regions (as it is valid to have gicr_base_address of zero if >> the redistributors are described via a GICR entry). >> >> Instead of complicating the check, remove it. Failures that happen >> at this point cause the irqchip not to register, meaning no irqs >> can be requested. The kernel grinds to a panic() pretty quickly. >> >> Without the check, MADT tables that exhibit this problem are still >> caught by gic_populate_rdist(), which helpfully also prints what >> went wrong: >> | CPU4: mpidr 100 has no re-distributor! >> >> Signed-off-by: James Morse >> --- >>   drivers/irqchip/irq-gic-v3.c | 18 ++++++------------ >>   1 file changed, 6 insertions(+), 12 deletions(-) >> > > With below nits resolved: > > Reviewed-by: Gavin Shan > >> diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c >> index 72d3cdebdad1..0f54811262eb 100644 >> --- a/drivers/irqchip/irq-gic-v3.c >> +++ b/drivers/irqchip/irq-gic-v3.c >> @@ -2415,21 +2415,15 @@ static int __init gic_acpi_match_gicc(union acpi_subtable_headers *header, >>       /* >>        * If GICC is enabled and has valid gicr base address, then it means >> -     * GICR base is presented via GICC >> +     * GICR base is presented via GICC. The redistributor is only known to >> +     * be accessible if the GICC is marked as enabled. If this bit is not >> +     * set, we'd need to add the redistributor at runtime, which isn't >> +     * supported. >>        */ >> -    if (acpi_gicc_is_usable(gicc) && gicc->gicr_base_address) { >> +    if (gicc->flags & ACPI_MADT_ENABLED && gicc->gicr_base_address) >>           acpi_data.enabled_rdists++; >> -        return 0; >> -    } > >     if (acpi_gicc_is_usable(gicc) && gicc->gicr_base_address) { > Please ignore this since acpi_gicc_is_usable() is changed to cover the bit ACPI_MADT_GICC_CPU_CAPABLE in next patch, which means "(gicc->flags & ACPI_MADT_ENABLED)" is needed here. > >> -    /* >> -     * It's perfectly valid firmware can pass disabled GICC entry, driver >> -     * should not treat as errors, skip the entry instead of probe fail. >> -     */ >> -    if (!acpi_gicc_is_usable(gicc)) >> -        return 0; >> - >> -    return -ENODEV; >> +    return 0; >>   } >>   static int __init gic_acpi_count_gicr_regions(void) Thanks, Gavin