From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC94BC43334 for ; Fri, 1 Jul 2022 13:51:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2BA266B0071; Fri, 1 Jul 2022 09:51:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 26AD66B0073; Fri, 1 Jul 2022 09:51:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 12F896B0074; Fri, 1 Jul 2022 09:51:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 030E36B0071 for ; Fri, 1 Jul 2022 09:51:30 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id C9DB580302 for ; Fri, 1 Jul 2022 13:51:29 +0000 (UTC) X-FDA: 79638668298.24.C9EF4CB Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf05.hostedemail.com (Postfix) with ESMTP id 2D8DE10005E for ; Fri, 1 Jul 2022 13:51:29 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 30820620BB; Fri, 1 Jul 2022 13:51:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8ECA0C3411E; Fri, 1 Jul 2022 13:51:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656683487; bh=zVCPcxPtyPPV4FvpPgHZp67VhjkGeOxEi++iTzWJmzQ=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=hSPBCLuTQiTigsOK2seN/QDyB5064QLkXrlZPhbAry3LWGFxzMaakrH+RIAPwvDRs XInpvznPMuVVaPjSE11egLcRWJXUF2ShRndsGhDH+dcy1djb+ixpawuWauGxkelZll az8AKLjzOwVRCgbFpZ+gJIfyGgeNVunnfCT1F6Nylx/uV0nP67aJ1YTIWDqduNN/1b AzIXPXCsu/opcwwz0TN8pwCL0371fQvg2W3AyhKumenQ6+SN0bpcaO9gDUIFBMURmZ 8jSaPGfpsKuAiFog3sAXg3qfo8IDf38yeXQ+QIECgIUI7sI7DEUNEGg7FN8lP2D4ya 9QeLkoCT2RobQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 356355C06A1; Fri, 1 Jul 2022 06:51:27 -0700 (PDT) Date: Fri, 1 Jul 2022 06:51:27 -0700 From: "Paul E. McKenney" To: "Chen, Rong A" Cc: kernel test robot , Frederic Weisbecker , kbuild-all@lists.01.org, Linux Memory Management List , Nicolas Saenz Julienne Subject: Re: [kbuild-all] Re: [linux-next:master 4040/7019] arch/powerpc/kernel/interrupt.c:542:55: error: suggest braces around empty body in an 'if' statement Message-ID: <20220701135127.GO1790663@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <202207010213.PDJ0d9Vj-lkp@intel.com> <20220630210115.GY1790663@paulmck-ThinkPad-P17-Gen-1> <1fc26d59-e5b9-cde3-7af2-d889d3fed7f9@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1fc26d59-e5b9-cde3-7af2-d889d3fed7f9@intel.com> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656683489; a=rsa-sha256; cv=none; b=6S0zllGLqYGNcNOHq8veb8kz6aSOTtqnp92owuc5SOhoMbJs46ul2RQV/PHHbG5qufg5s7 /C8ZIq8MSLxUvGlcfMFR7vmsYNPsuVDu8IxXElF7q3lGnwslVTvaDVk64k6k8KeFxfpQrb b0Fnq8fyaY3Jw4iDJaQrwME7erY/4oE= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=hSPBCLuT; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf05.hostedemail.com: domain of "SRS0=ig1H=XG=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=ig1H=XG=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656683489; h=from:from:sender:reply-to: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=elDmzYbcz+aWmuhHgb91FcecNVxaseLtmUifTffx5MY=; b=8hj2WGF9S7H5mdoYQrWXu4Kxf3RY3AZblIciQHt9rk8N+YWxZZJ1jI0OuSWGG6q+Bm7Gaq HL/YDVsUCb7s8szBjkdbeXZ68MKCfM6Us4z8ixY4nDN1cTyMdGQpryEFrWLCMz0HHVBdcH wsd/2cKwzr6X4oGtJuVzin8psvqkAMs= Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=hSPBCLuT; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf05.hostedemail.com: domain of "SRS0=ig1H=XG=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=ig1H=XG=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 2D8DE10005E X-Stat-Signature: 76pnd3hrodan19xh3ymssnyazmc7xfak X-Rspam-User: X-HE-Tag: 1656683489-187401 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jul 01, 2022 at 06:11:31PM +0800, Chen, Rong A wrote: > > > On 7/1/2022 5:01 AM, Paul E. McKenney wrote: > > On Fri, Jul 01, 2022 at 02:23:30AM +0800, kernel test robot wrote: > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > > > head: 6cc11d2a1759275b856e464265823d94aabd5eaf > > > commit: 408c74a2d8f01262e152b7eb09500033fbe6bafe [4040/7019] context_tracking: Convert state to atomic_t > > > config: powerpc-amigaone_defconfig (https://download.01.org/0day-ci/archive/20220701/202207010213.PDJ0d9Vj-lkp@intel.com/config) > > > compiler: powerpc-linux-gcc (GCC) 11.3.0 > > > reproduce (this is a W=1 build): > > > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > > > chmod +x ~/bin/make.cross > > > # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=408c74a2d8f01262e152b7eb09500033fbe6bafe > > > git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git > > > git fetch --no-tags linux-next master > > > git checkout 408c74a2d8f01262e152b7eb09500033fbe6bafe > > > # save the config file > > > mkdir build_dir && cp config build_dir/.config > > > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=powerpc SHELL=/bin/bash > > > > > > If you fix the issue, kindly add following tag where applicable > > > Reported-by: kernel test robot > > > > Good catch! Does the updated commit 344e00943785 ("context_tracking: > > Convert state to atomic_t") address this issue? > > > > Thanx, Paul > > Hi Paul, > > Yes, I have confirmed that there's no such issue on commit 344e00943785. Thank you! Thanx, Paul > Best Regards, > Rong Chen > > > > > > All errors (new ones prefixed by >>): > > > > > > arch/powerpc/kernel/interrupt.c: In function 'interrupt_exit_kernel_prepare': > > > > > arch/powerpc/kernel/interrupt.c:542:55: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] > > > 542 | CT_WARN_ON(ct_state() == CONTEXT_USER); > > > | ^ > > > cc1: all warnings being treated as errors > > > > > > > > > vim +/if +542 arch/powerpc/kernel/interrupt.c > > > > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 527 > > > bf9155f1970c4d arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 528 notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs) > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 529 { > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 530 unsigned long flags; > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 531 unsigned long ret = 0; > > > ad2d2344771dab arch/powerpc/kernel/interrupt.c Christophe Leroy 2021-03-12 532 unsigned long kuap; > > > 985faa78687de6 arch/powerpc/kernel/interrupt.c Mark Rutland 2021-11-29 533 bool stack_store = read_thread_flags() & _TIF_EMULATE_STACK_STORE; > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 534 > > > 806c0e6e7e97ad arch/powerpc/kernel/interrupt.c Christophe Leroy 2021-08-23 535 if (regs_is_unrecoverable(regs)) > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 536 unrecoverable_exception(regs); > > > f821bc97dee4f3 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2021-01-30 537 /* > > > f821bc97dee4f3 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2021-01-30 538 * CT_WARN_ON comes here via program_check_exception, > > > f821bc97dee4f3 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2021-01-30 539 * so avoid recursion. > > > f821bc97dee4f3 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2021-01-30 540 */ > > > 7153d4bf0b3734 arch/powerpc/kernel/interrupt.c Xiongwei Song 2021-04-14 541 if (TRAP(regs) != INTERRUPT_PROGRAM) > > > f821bc97dee4f3 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2021-01-30 @542 CT_WARN_ON(ct_state() == CONTEXT_USER); > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 543 > > > ad2d2344771dab arch/powerpc/kernel/interrupt.c Christophe Leroy 2021-03-12 544 kuap = kuap_get_and_assert_locked(); > > > c0d7dcf89e5151 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-04-29 545 > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 546 local_irq_save(flags); > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 547 > > > 344bb20b159dd0 arch/powerpc/kernel/interrupt.c Christophe Leroy 2021-02-08 548 if (!arch_irq_disabled_regs(regs)) { > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 549 /* Returning to a kernel context with local irqs enabled. */ > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 550 WARN_ON_ONCE(!(regs->msr & MSR_EE)); > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 551 again: > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 552 if (IS_ENABLED(CONFIG_PREEMPT)) { > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 553 /* Return to preemptible kernel context */ > > > 985faa78687de6 arch/powerpc/kernel/interrupt.c Mark Rutland 2021-11-29 554 if (unlikely(read_thread_flags() & _TIF_NEED_RESCHED)) { > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 555 if (preempt_count() == 0) > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 556 preempt_schedule_irq(); > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 557 } > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 558 } > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 559 > > > 6eaaf9de359986 arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-22 560 check_return_regs_valid(regs); > > > 6eaaf9de359986 arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-22 561 > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 562 /* > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 563 * Stack store exit can't be restarted because the interrupt > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 564 * stack frame might have been clobbered. > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 565 */ > > > 61eece2d170779 arch/powerpc/kernel/interrupt.c Christophe Leroy 2021-06-18 566 if (!prep_irq_for_enabled_exit(unlikely(stack_store))) { > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 567 /* > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 568 * Replay pending soft-masked interrupts now. Don't > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 569 * just local_irq_enabe(); local_irq_disable(); because > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 570 * if we are returning from an asynchronous interrupt > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 571 * here, another one might hit after irqs are enabled, > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 572 * and it would exit via this same path allowing > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 573 * another to fire, and so on unbounded. > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 574 */ > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 575 hard_irq_disable(); > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 576 replay_soft_interrupts(); > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 577 /* Took an interrupt, may have more exit work to do. */ > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 578 goto again; > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 579 } > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 580 #ifdef CONFIG_PPC64 > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 581 /* > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 582 * An interrupt may clear MSR[EE] and set this concurrently, > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 583 * but it will be marked pending and the exit will be retried. > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 584 * This leaves a racy window where MSR[EE]=0 and HARD_DIS is > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 585 * clear, until interrupt_exit_kernel_restart() calls > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 586 * hard_irq_disable(), which will set HARD_DIS again. > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 587 */ > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 588 local_paca->irq_happened &= ~PACA_IRQ_HARD_DIS; > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 589 > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 590 } else { > > > 6eaaf9de359986 arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-22 591 check_return_regs_valid(regs); > > > 6eaaf9de359986 arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-22 592 > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 593 if (unlikely(stack_store)) > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 594 __hard_EE_RI_disable(); > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 595 /* > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 596 * Returning to a kernel context with local irqs disabled. > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 597 * Here, if EE was enabled in the interrupted context, enable > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 598 * it on return as well. A problem exists here where a soft > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 599 * masked interrupt may have cleared MSR[EE] and set HARD_DIS > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 600 * here, and it will still exist on return to the caller. This > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 601 * will be resolved by the masked interrupt firing again. > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 602 */ > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 603 if (regs->msr & MSR_EE) > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 604 local_paca->irq_happened &= ~PACA_IRQ_HARD_DIS; > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 605 #endif /* CONFIG_PPC64 */ > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 606 } > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 607 > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 608 if (unlikely(stack_store)) { > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 609 clear_bits(_TIF_EMULATE_STACK_STORE, ¤t_thread_info()->flags); > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 610 ret = 1; > > > 13799748b957bc arch/powerpc/kernel/interrupt.c Nicholas Piggin 2021-06-18 611 } > > > 6cc0c16d82f889 arch/powerpc/kernel/syscall_64.c Nicholas Piggin 2020-02-26 612 > > > > > > :::::: The code at line 542 was first introduced by commit > > > :::::: f821bc97dee4f3ee92c3668d495af49dfd720fe0 powerpc/64s: move context tracking exit to interrupt exit path > > > > > > :::::: TO: Nicholas Piggin > > > :::::: CC: Michael Ellerman > > > > > > -- > > > 0-DAY CI Kernel Test Service > > > https://01.org/lkp > > _______________________________________________ > > kbuild-all mailing list -- kbuild-all@lists.01.org > > To unsubscribe send an email to kbuild-all-leave@lists.01.org > >