Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp22428imw; Thu, 7 Jul 2022 20:17:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tVsoE0bKCfixidedajJZMxtNhb18RmwoAeqYiBthARsGbrnVkK6iSt55xhLJvNATgttI2f X-Received: by 2002:a17:90b:1004:b0:1ef:9f33:2df4 with SMTP id gm4-20020a17090b100400b001ef9f332df4mr9300906pjb.31.1657250230811; Thu, 07 Jul 2022 20:17:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657250230; cv=none; d=google.com; s=arc-20160816; b=K0EKCj2OQNLA1Q1FzKskyDBXdaYAq+nBipjOSzyyE6ihLXVtQqOoZuf67gTjmqsnZL rRfGv2pzkR8N6+wjDONVPiValkMa1G9eGmWzk+RtGKOKjm6Ut8JptFOecABRYGFrQWNx 5rGU4Kx+a109J64QjNCQ+B0rw2O6iV2mICxFvxH/B6kJXgv5kdM5/fBD9Q3s5E3XTCLf eEEGl4ZxPJ+3glznJY3ceBh4T5o11dv+MUa9NpbCEoreEygrG/7Vt/nVHpkVhmYS3WoT EevRVFHQVR/7qCd9wcUPmHmKd2+mjbsJHd0jZcuLq2Gnis9P0OCHrr5k0clx0R9Iu/gV BxEA== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=TGIKBjKJBY8/kMNlD/sj4PFUQud2Ij5fYjoIm5xQg+k=; b=Zms5zgY/5M5BRp9IkNJ1kFzLeMFWoeM0kfWS5mYX4TF6oXcmyAabC/96Bsj50ryFnY 2vZNvu4s2EK19kftJd8IE7QXwo/jlRJv8ySTUM2qrabMwCVXDEclUP3kD7RHBrgd1kb7 WntyoGv36pAD/jkzcef3lGaoh290z4vQ8kOI2Ic55/qlsy7nTw2Ek9AGmkmOuptR3ZOz bRpank4ysJ/UfBeBGHkq1kYM/uzV5b2u7jhSl+HpBnOLZ1rtE0GWNkfqdF8OUd4Zq8P4 NKIcsYqUhoXp956nMCwdnO1p96d6dIdAntaVlCcYPoXLEX68Kytfy9dQahNG39VS1Ck0 B1AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=BZBSm3XK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id np3-20020a17090b4c4300b001ece9122d4esi1352198pjb.86.2022.07.07.20.16.32; Thu, 07 Jul 2022 20:17:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=BZBSm3XK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237009AbiGHDNw (ORCPT + 99 others); Thu, 7 Jul 2022 23:13:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236938AbiGHDNt (ORCPT ); Thu, 7 Jul 2022 23:13:49 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4024C74790 for ; Thu, 7 Jul 2022 20:13:48 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id m14so15293136plg.5 for ; Thu, 07 Jul 2022 20:13:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=TGIKBjKJBY8/kMNlD/sj4PFUQud2Ij5fYjoIm5xQg+k=; b=BZBSm3XKcCB5MlYwxVGxOfvNI6Wlc/jCHNo9MwhscgxXdUh5B+qLRYZoGeZdh0I75n HbLVl5+t8/W/X9dd1nrrb79es2fxskCmaBP5euvE/MoGTXJT7LoTjVFRJjTpzmKjzGU3 e8YEiU4DuRNiGVyL5KknSXccjMGhFMKsjAKcvYmPffvYA/TESbFg1pKVlHlHKQMH+OiQ EWo+Ryn+5OWUbQKobV10qWxULOXY4hIhMjHIKtCf1JJX/ZorXN+IAhe/kXxa+PRjOtH5 ChD9rCa564h/IsGIFizUsDDR1EfpJt+XguL7fP5O2c9Tdy+gzXIKxGBymdooTd/L14rH O4aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=TGIKBjKJBY8/kMNlD/sj4PFUQud2Ij5fYjoIm5xQg+k=; b=CuAuaSB2sAC0xY1dLGP9ck+1BL27coEqd7mvhq6LCHgjR5HicKWOMsKL4vFy6kWiDD LNRQv1mC80noeiPo0dDGc/c+H/y21zpEr9WxFg8/9ZKtFRRGVyJX1oLaOTnGD4+zPR99 NDJVwGfJcB7d5QoeKbtRFAEdxWJStL8cGBF6+3pw7P7APJC0pICt11TxfMpdbRwkYyOn T6Cto7ISrd1rsqVL4XPLnMPTxIBlIzVKRRY2pnoBwRvCsB392rmhcMsqpS7FkAYyUolm 6RPhlAvL88NmfQUuoENkXUFkDZ5Hhkv4JXcsLCuHD9JjokfR3BsJ70vbwfn3L2GfaVKO +iWg== X-Gm-Message-State: AJIora+bvxLsPQOWfynfta1LUw0oMmxo61aYGrR318tUdZ0oCQH5cyRM H7b3YdC7PYDFhrediE8G3rqyS+fUpEmBZQ== X-Received: by 2002:a17:902:e84f:b0:16b:8a74:d572 with SMTP id t15-20020a170902e84f00b0016b8a74d572mr1478266plg.146.1657250027747; Thu, 07 Jul 2022 20:13:47 -0700 (PDT) Received: from [10.4.255.21] ([139.177.225.235]) by smtp.gmail.com with ESMTPSA id e2-20020a17090ae4c200b001ef8a6836e3sm319394pju.55.2022.07.07.20.13.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Jul 2022 20:13:46 -0700 (PDT) Message-ID: Date: Fri, 8 Jul 2022 11:13:34 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.0 Subject: Re: [RFC PATCH 2/2] arm64: support HAVE_IRQ_EXIT_ON_IRQ_STACK Content-Language: en-US To: Arnd Bergmann Cc: Catalin Marinas , Will Deacon , Linux ARM , Linux Kernel Mailing List References: <20220707110511.52129-1-zhengqi.arch@bytedance.com> <20220707110511.52129-3-zhengqi.arch@bytedance.com> <42bfd82c-b3fb-c942-d6f2-ae5adec90a26@bytedance.com> <33a63e76-fb71-2b9e-3b3c-cc6f7a675cf3@bytedance.com> From: Qi Zheng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/7/8 04:55, Arnd Bergmann wrote: > On Thu, Jul 7, 2022 at 5:00 PM Qi Zheng wrote: >> On 2022/7/7 22:41, Arnd Bergmann wrote: >>> On Thu, Jul 7, 2022 at 3:38 PM Qi Zheng wrote: >>>> On 2022/7/7 20:49, Arnd Bergmann wrote: >>> >>> -asmlinkage void noinstr el1h_64_fiq_handler(struct pt_regs *regs) >>> +asmlinkage void noinstr el1h_64_irq_handler(struct pt_regs *regs) >>> +{ >>> + if (on_thread_stack()) >>> + call_on_irq_stack(regs, el1_irq); >> >> IMO, this can't work. Because el1_interrupt() will invoke >> arm64_preempt_schedule_irq(), which will cause scheduling on the >> IRQ stack. > > Ah, too bad. I spent some more time looking for a simpler approach, > but couldn't find one I'm happy with. One idea might be to have > callback functions for each combinations of irq/fiq with irq/pnmi > to avoid the nested callback pointers. Not sure if that helps. Maybe nested callback pointers are not always a wild beast. ;) This method does not change much, and we can also conveniently stuff all kinds of things in do_handler() that we want to run on the IRQ stack in addition to the handler(). Thanks, Qi > > Arnd -- Thanks, Qi