[PATCH kernel] powerpc/kuap: Restore AMR after replaying soft interrupts

kernel test robot lkp at intel.com
Thu Dec 3 05:08:12 AEDT 2020


Hi Alexey,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on powerpc/next]
[also build test ERROR on linus/master v5.10-rc6 next-20201201]
[cannot apply to scottwood/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Alexey-Kardashevskiy/powerpc-kuap-Restore-AMR-after-replaying-soft-interrupts/20201202-094132
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc64-randconfig-r024-20201202 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 2671fccf0381769276ca8246ec0499adcb9b0355)
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
        # install powerpc64 cross compiling tool for clang build
        # apt-get install binutils-powerpc64-linux-gnu
        # https://github.com/0day-ci/linux/commit/6b38a9b10a8384beeaa820e1c935cc4cabdb951e
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Alexey-Kardashevskiy/powerpc-kuap-Restore-AMR-after-replaying-soft-interrupts/20201202-094132
        git checkout 6b38a9b10a8384beeaa820e1c935cc4cabdb951e
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

All errors (new ones prefixed by >>):

   In file included from arch/powerpc/kernel/irq.c:31:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:10:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:604:
   arch/powerpc/include/asm/io-defs.h:45:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(insw, (unsigned long p, void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:100:1: note: expanded from here
   __do_insw
   ^
   arch/powerpc/include/asm/io.h:542:56: note: expanded from macro '__do_insw'
   #define __do_insw(p, b, n)      readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from arch/powerpc/kernel/irq.c:31:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:10:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:604:
   arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:102:1: note: expanded from here
   __do_insl
   ^
   arch/powerpc/include/asm/io.h:543:56: note: expanded from macro '__do_insl'
   #define __do_insl(p, b, n)      readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
                                          ~~~~~~~~~~~~~~~~~~~~~^
   In file included from arch/powerpc/kernel/irq.c:31:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:10:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:604:
   arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:104:1: note: expanded from here
   __do_outsb
   ^
   arch/powerpc/include/asm/io.h:544:58: note: expanded from macro '__do_outsb'
   #define __do_outsb(p, b, n)     writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
   In file included from arch/powerpc/kernel/irq.c:31:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:10:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:604:
   arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:106:1: note: expanded from here
   __do_outsw
   ^
   arch/powerpc/include/asm/io.h:545:58: note: expanded from macro '__do_outsw'
   #define __do_outsw(p, b, n)     writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
   In file included from arch/powerpc/kernel/irq.c:31:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:10:
   In file included from arch/powerpc/include/asm/hardirq.h:6:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/powerpc/include/asm/io.h:604:
   arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
   DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
                   __do_##name al;                                 \
                   ^~~~~~~~~~~~~~
   <scratch space>:108:1: note: expanded from here
   __do_outsl
   ^
   arch/powerpc/include/asm/io.h:546:58: note: expanded from macro '__do_outsl'
   #define __do_outsl(p, b, n)     writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
                                           ~~~~~~~~~~~~~~~~~~~~~^
>> arch/powerpc/kernel/irq.c:224:29: error: implicit declaration of function 'get_kuap' [-Werror,-Wimplicit-function-declaration]
           unsigned long kuap_state = get_kuap();
                                      ^
>> arch/powerpc/kernel/irq.c:313:2: error: implicit declaration of function 'set_kuap' [-Werror,-Wimplicit-function-declaration]
           set_kuap(kuap_state);
           ^
   arch/powerpc/kernel/irq.c:313:2: note: did you mean 'get_kuap'?
   arch/powerpc/kernel/irq.c:224:29: note: 'get_kuap' declared here
           unsigned long kuap_state = get_kuap();
                                      ^
   12 warnings and 2 errors generated.

vim +/get_kuap +224 arch/powerpc/kernel/irq.c

   214	
   215	void replay_soft_interrupts(void)
   216	{
   217		/*
   218		 * We use local_paca rather than get_paca() to avoid all
   219		 * the debug_smp_processor_id() business in this low level
   220		 * function
   221		 */
   222		unsigned char happened = local_paca->irq_happened;
   223		struct pt_regs regs;
 > 224		unsigned long kuap_state = get_kuap();
   225	
   226		ppc_save_regs(&regs);
   227		regs.softe = IRQS_ENABLED;
   228	
   229	again:
   230		if (IS_ENABLED(CONFIG_PPC_IRQ_SOFT_MASK_DEBUG))
   231			WARN_ON_ONCE(mfmsr() & MSR_EE);
   232	
   233		if (happened & PACA_IRQ_HARD_DIS) {
   234			/*
   235			 * We may have missed a decrementer interrupt if hard disabled.
   236			 * Check the decrementer register in case we had a rollover
   237			 * while hard disabled.
   238			 */
   239			if (!(happened & PACA_IRQ_DEC)) {
   240				if (decrementer_check_overflow())
   241					happened |= PACA_IRQ_DEC;
   242			}
   243		}
   244	
   245		/*
   246		 * Force the delivery of pending soft-disabled interrupts on PS3.
   247		 * Any HV call will have this side effect.
   248		 */
   249		if (firmware_has_feature(FW_FEATURE_PS3_LV1)) {
   250			u64 tmp, tmp2;
   251			lv1_get_version_info(&tmp, &tmp2);
   252		}
   253	
   254		/*
   255		 * Check if an hypervisor Maintenance interrupt happened.
   256		 * This is a higher priority interrupt than the others, so
   257		 * replay it first.
   258		 */
   259		if (IS_ENABLED(CONFIG_PPC_BOOK3S) && (happened & PACA_IRQ_HMI)) {
   260			local_paca->irq_happened &= ~PACA_IRQ_HMI;
   261			regs.trap = 0xe60;
   262			handle_hmi_exception(&regs);
   263			if (!(local_paca->irq_happened & PACA_IRQ_HARD_DIS))
   264				hard_irq_disable();
   265		}
   266	
   267		if (happened & PACA_IRQ_DEC) {
   268			local_paca->irq_happened &= ~PACA_IRQ_DEC;
   269			regs.trap = 0x900;
   270			timer_interrupt(&regs);
   271			if (!(local_paca->irq_happened & PACA_IRQ_HARD_DIS))
   272				hard_irq_disable();
   273		}
   274	
   275		if (happened & PACA_IRQ_EE) {
   276			local_paca->irq_happened &= ~PACA_IRQ_EE;
   277			regs.trap = 0x500;
   278			do_IRQ(&regs);
   279			if (!(local_paca->irq_happened & PACA_IRQ_HARD_DIS))
   280				hard_irq_disable();
   281		}
   282	
   283		if (IS_ENABLED(CONFIG_PPC_DOORBELL) && (happened & PACA_IRQ_DBELL)) {
   284			local_paca->irq_happened &= ~PACA_IRQ_DBELL;
   285			if (IS_ENABLED(CONFIG_PPC_BOOK3E))
   286				regs.trap = 0x280;
   287			else
   288				regs.trap = 0xa00;
   289			doorbell_exception(&regs);
   290			if (!(local_paca->irq_happened & PACA_IRQ_HARD_DIS))
   291				hard_irq_disable();
   292		}
   293	
   294		/* Book3E does not support soft-masking PMI interrupts */
   295		if (IS_ENABLED(CONFIG_PPC_BOOK3S) && (happened & PACA_IRQ_PMI)) {
   296			local_paca->irq_happened &= ~PACA_IRQ_PMI;
   297			regs.trap = 0xf00;
   298			performance_monitor_exception(&regs);
   299			if (!(local_paca->irq_happened & PACA_IRQ_HARD_DIS))
   300				hard_irq_disable();
   301		}
   302	
   303		happened = local_paca->irq_happened;
   304		if (happened & ~PACA_IRQ_HARD_DIS) {
   305			/*
   306			 * We are responding to the next interrupt, so interrupt-off
   307			 * latencies should be reset here.
   308			 */
   309			trace_hardirqs_on();
   310			trace_hardirqs_off();
   311			goto again;
   312		}
 > 313		set_kuap(kuap_state);
   314	}
   315	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 23722 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20201203/e68dc48c/attachment-0001.gz>


More information about the Linuxppc-dev mailing list