All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Andrew Scull <ascull@google.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Marc Zyngier <maz@kernel.org>
Subject: arch/arm64/kvm/handle_exit.c:295:24: warning: no previous prototype for 'nvhe_hyp_panic_handler'
Date: Thu, 1 Jul 2021 22:01:58 +0800	[thread overview]
Message-ID: <202107012251.4X4d2ksB-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 12162 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   dbe69e43372212527abf48609aba7fc39a6daa27
commit: aec0fae62e47050019474936248a311a0ab08705 KVM: arm64: Log source when panicking from nVHE hyp
date:   3 months ago
config: arm64-buildonly-randconfig-r002-20210701 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.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/torvalds/linux.git/commit/?id=aec0fae62e47050019474936248a311a0ab08705
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout aec0fae62e47050019474936248a311a0ab08705
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64 

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

All warnings (new ones prefixed by >>):

   arch/arm64/kvm/handle_exit.c:177:21: warning: initialized field overwritten [-Woverride-init]
     177 |  [ESR_ELx_EC_WFx] = kvm_handle_wfx,
         |                     ^~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:177:21: note: (near initialization for 'arm_exit_handlers[1]')
   arch/arm64/kvm/handle_exit.c:178:25: warning: initialized field overwritten [-Woverride-init]
     178 |  [ESR_ELx_EC_CP15_32] = kvm_handle_cp15_32,
         |                         ^~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:178:25: note: (near initialization for 'arm_exit_handlers[3]')
   arch/arm64/kvm/handle_exit.c:179:25: warning: initialized field overwritten [-Woverride-init]
     179 |  [ESR_ELx_EC_CP15_64] = kvm_handle_cp15_64,
         |                         ^~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:179:25: note: (near initialization for 'arm_exit_handlers[4]')
   arch/arm64/kvm/handle_exit.c:180:25: warning: initialized field overwritten [-Woverride-init]
     180 |  [ESR_ELx_EC_CP14_MR] = kvm_handle_cp14_32,
         |                         ^~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:180:25: note: (near initialization for 'arm_exit_handlers[5]')
   arch/arm64/kvm/handle_exit.c:181:25: warning: initialized field overwritten [-Woverride-init]
     181 |  [ESR_ELx_EC_CP14_LS] = kvm_handle_cp14_load_store,
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:181:25: note: (near initialization for 'arm_exit_handlers[6]')
   arch/arm64/kvm/handle_exit.c:182:25: warning: initialized field overwritten [-Woverride-init]
     182 |  [ESR_ELx_EC_CP14_64] = kvm_handle_cp14_64,
         |                         ^~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:182:25: note: (near initialization for 'arm_exit_handlers[12]')
   arch/arm64/kvm/handle_exit.c:183:23: warning: initialized field overwritten [-Woverride-init]
     183 |  [ESR_ELx_EC_HVC32] = handle_hvc,
         |                       ^~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:183:23: note: (near initialization for 'arm_exit_handlers[18]')
   arch/arm64/kvm/handle_exit.c:184:23: warning: initialized field overwritten [-Woverride-init]
     184 |  [ESR_ELx_EC_SMC32] = handle_smc,
         |                       ^~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:184:23: note: (near initialization for 'arm_exit_handlers[19]')
   arch/arm64/kvm/handle_exit.c:185:23: warning: initialized field overwritten [-Woverride-init]
     185 |  [ESR_ELx_EC_HVC64] = handle_hvc,
         |                       ^~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:185:23: note: (near initialization for 'arm_exit_handlers[22]')
   arch/arm64/kvm/handle_exit.c:186:23: warning: initialized field overwritten [-Woverride-init]
     186 |  [ESR_ELx_EC_SMC64] = handle_smc,
         |                       ^~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:186:23: note: (near initialization for 'arm_exit_handlers[23]')
   arch/arm64/kvm/handle_exit.c:187:23: warning: initialized field overwritten [-Woverride-init]
     187 |  [ESR_ELx_EC_SYS64] = kvm_handle_sys_reg,
         |                       ^~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:187:23: note: (near initialization for 'arm_exit_handlers[24]')
   arch/arm64/kvm/handle_exit.c:188:21: warning: initialized field overwritten [-Woverride-init]
     188 |  [ESR_ELx_EC_SVE] = handle_sve,
         |                     ^~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:188:21: note: (near initialization for 'arm_exit_handlers[25]')
   arch/arm64/kvm/handle_exit.c:189:26: warning: initialized field overwritten [-Woverride-init]
     189 |  [ESR_ELx_EC_IABT_LOW] = kvm_handle_guest_abort,
         |                          ^~~~~~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:189:26: note: (near initialization for 'arm_exit_handlers[32]')
   arch/arm64/kvm/handle_exit.c:190:26: warning: initialized field overwritten [-Woverride-init]
     190 |  [ESR_ELx_EC_DABT_LOW] = kvm_handle_guest_abort,
         |                          ^~~~~~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:190:26: note: (near initialization for 'arm_exit_handlers[36]')
   arch/arm64/kvm/handle_exit.c:191:28: warning: initialized field overwritten [-Woverride-init]
     191 |  [ESR_ELx_EC_SOFTSTP_LOW]= kvm_handle_guest_debug,
         |                            ^~~~~~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:191:28: note: (near initialization for 'arm_exit_handlers[50]')
   arch/arm64/kvm/handle_exit.c:192:28: warning: initialized field overwritten [-Woverride-init]
     192 |  [ESR_ELx_EC_WATCHPT_LOW]= kvm_handle_guest_debug,
         |                            ^~~~~~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:192:28: note: (near initialization for 'arm_exit_handlers[52]')
   arch/arm64/kvm/handle_exit.c:193:28: warning: initialized field overwritten [-Woverride-init]
     193 |  [ESR_ELx_EC_BREAKPT_LOW]= kvm_handle_guest_debug,
         |                            ^~~~~~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:193:28: note: (near initialization for 'arm_exit_handlers[48]')
   arch/arm64/kvm/handle_exit.c:194:24: warning: initialized field overwritten [-Woverride-init]
     194 |  [ESR_ELx_EC_BKPT32] = kvm_handle_guest_debug,
         |                        ^~~~~~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:194:24: note: (near initialization for 'arm_exit_handlers[56]')
   arch/arm64/kvm/handle_exit.c:195:23: warning: initialized field overwritten [-Woverride-init]
     195 |  [ESR_ELx_EC_BRK64] = kvm_handle_guest_debug,
         |                       ^~~~~~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:195:23: note: (near initialization for 'arm_exit_handlers[60]')
   arch/arm64/kvm/handle_exit.c:196:26: warning: initialized field overwritten [-Woverride-init]
     196 |  [ESR_ELx_EC_FP_ASIMD] = handle_no_fpsimd,
         |                          ^~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:196:26: note: (near initialization for 'arm_exit_handlers[7]')
   arch/arm64/kvm/handle_exit.c:197:21: warning: initialized field overwritten [-Woverride-init]
     197 |  [ESR_ELx_EC_PAC] = kvm_handle_ptrauth,
         |                     ^~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:197:21: note: (near initialization for 'arm_exit_handlers[9]')
>> arch/arm64/kvm/handle_exit.c:295:24: warning: no previous prototype for 'nvhe_hyp_panic_handler' [-Wmissing-prototypes]
     295 | void __noreturn __cold nvhe_hyp_panic_handler(u64 esr, u64 spsr, u64 elr,
         |                        ^~~~~~~~~~~~~~~~~~~~~~


vim +/nvhe_hyp_panic_handler +295 arch/arm64/kvm/handle_exit.c

   174	
   175	static exit_handle_fn arm_exit_handlers[] = {
   176		[0 ... ESR_ELx_EC_MAX]	= kvm_handle_unknown_ec,
   177		[ESR_ELx_EC_WFx]	= kvm_handle_wfx,
   178		[ESR_ELx_EC_CP15_32]	= kvm_handle_cp15_32,
   179		[ESR_ELx_EC_CP15_64]	= kvm_handle_cp15_64,
   180		[ESR_ELx_EC_CP14_MR]	= kvm_handle_cp14_32,
   181		[ESR_ELx_EC_CP14_LS]	= kvm_handle_cp14_load_store,
   182		[ESR_ELx_EC_CP14_64]	= kvm_handle_cp14_64,
   183		[ESR_ELx_EC_HVC32]	= handle_hvc,
   184		[ESR_ELx_EC_SMC32]	= handle_smc,
   185		[ESR_ELx_EC_HVC64]	= handle_hvc,
   186		[ESR_ELx_EC_SMC64]	= handle_smc,
   187		[ESR_ELx_EC_SYS64]	= kvm_handle_sys_reg,
   188		[ESR_ELx_EC_SVE]	= handle_sve,
   189		[ESR_ELx_EC_IABT_LOW]	= kvm_handle_guest_abort,
   190		[ESR_ELx_EC_DABT_LOW]	= kvm_handle_guest_abort,
   191		[ESR_ELx_EC_SOFTSTP_LOW]= kvm_handle_guest_debug,
   192		[ESR_ELx_EC_WATCHPT_LOW]= kvm_handle_guest_debug,
   193		[ESR_ELx_EC_BREAKPT_LOW]= kvm_handle_guest_debug,
   194		[ESR_ELx_EC_BKPT32]	= kvm_handle_guest_debug,
 > 195		[ESR_ELx_EC_BRK64]	= kvm_handle_guest_debug,
   196		[ESR_ELx_EC_FP_ASIMD]	= handle_no_fpsimd,
   197		[ESR_ELx_EC_PAC]	= kvm_handle_ptrauth,
   198	};
   199	
   200	static exit_handle_fn kvm_get_exit_handler(struct kvm_vcpu *vcpu)
   201	{
   202		u32 esr = kvm_vcpu_get_esr(vcpu);
   203		u8 esr_ec = ESR_ELx_EC(esr);
   204	
   205		return arm_exit_handlers[esr_ec];
   206	}
   207	
   208	/*
   209	 * We may be single-stepping an emulated instruction. If the emulation
   210	 * has been completed in the kernel, we can return to userspace with a
   211	 * KVM_EXIT_DEBUG, otherwise userspace needs to complete its
   212	 * emulation first.
   213	 */
   214	static int handle_trap_exceptions(struct kvm_vcpu *vcpu)
   215	{
   216		int handled;
   217	
   218		/*
   219		 * See ARM ARM B1.14.1: "Hyp traps on instructions
   220		 * that fail their condition code check"
   221		 */
   222		if (!kvm_condition_valid(vcpu)) {
   223			kvm_incr_pc(vcpu);
   224			handled = 1;
   225		} else {
   226			exit_handle_fn exit_handler;
   227	
   228			exit_handler = kvm_get_exit_handler(vcpu);
   229			handled = exit_handler(vcpu);
   230		}
   231	
   232		return handled;
   233	}
   234	
   235	/*
   236	 * Return > 0 to return to guest, < 0 on error, 0 (and set exit_reason) on
   237	 * proper exit to userspace.
   238	 */
   239	int handle_exit(struct kvm_vcpu *vcpu, int exception_index)
   240	{
   241		struct kvm_run *run = vcpu->run;
   242	
   243		exception_index = ARM_EXCEPTION_CODE(exception_index);
   244	
   245		switch (exception_index) {
   246		case ARM_EXCEPTION_IRQ:
   247			return 1;
   248		case ARM_EXCEPTION_EL1_SERROR:
   249			return 1;
   250		case ARM_EXCEPTION_TRAP:
   251			return handle_trap_exceptions(vcpu);
   252		case ARM_EXCEPTION_HYP_GONE:
   253			/*
   254			 * EL2 has been reset to the hyp-stub. This happens when a guest
   255			 * is pre-empted by kvm_reboot()'s shutdown call.
   256			 */
   257			run->exit_reason = KVM_EXIT_FAIL_ENTRY;
   258			return 0;
   259		case ARM_EXCEPTION_IL:
   260			/*
   261			 * We attempted an illegal exception return.  Guest state must
   262			 * have been corrupted somehow.  Give up.
   263			 */
   264			run->exit_reason = KVM_EXIT_FAIL_ENTRY;
   265			return -EINVAL;
   266		default:
   267			kvm_pr_unimpl("Unsupported exception type: %d",
   268				      exception_index);
   269			run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
   270			return 0;
   271		}
   272	}
   273	
   274	/* For exit types that need handling before we can be preempted */
   275	void handle_exit_early(struct kvm_vcpu *vcpu, int exception_index)
   276	{
   277		if (ARM_SERROR_PENDING(exception_index)) {
   278			if (this_cpu_has_cap(ARM64_HAS_RAS_EXTN)) {
   279				u64 disr = kvm_vcpu_get_disr(vcpu);
   280	
   281				kvm_handle_guest_serror(vcpu, disr_to_esr(disr));
   282			} else {
   283				kvm_inject_vabt(vcpu);
   284			}
   285	
   286			return;
   287		}
   288	
   289		exception_index = ARM_EXCEPTION_CODE(exception_index);
   290	
   291		if (exception_index == ARM_EXCEPTION_EL1_SERROR)
   292			kvm_handle_guest_serror(vcpu, kvm_vcpu_get_esr(vcpu));
   293	}
   294	
 > 295	void __noreturn __cold nvhe_hyp_panic_handler(u64 esr, u64 spsr, u64 elr,

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 47319 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: arch/arm64/kvm/handle_exit.c:295:24: warning: no previous prototype for 'nvhe_hyp_panic_handler'
Date: Thu, 01 Jul 2021 22:01:58 +0800	[thread overview]
Message-ID: <202107012251.4X4d2ksB-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 12402 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   dbe69e43372212527abf48609aba7fc39a6daa27
commit: aec0fae62e47050019474936248a311a0ab08705 KVM: arm64: Log source when panicking from nVHE hyp
date:   3 months ago
config: arm64-buildonly-randconfig-r002-20210701 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.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/torvalds/linux.git/commit/?id=aec0fae62e47050019474936248a311a0ab08705
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout aec0fae62e47050019474936248a311a0ab08705
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64 

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

All warnings (new ones prefixed by >>):

   arch/arm64/kvm/handle_exit.c:177:21: warning: initialized field overwritten [-Woverride-init]
     177 |  [ESR_ELx_EC_WFx] = kvm_handle_wfx,
         |                     ^~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:177:21: note: (near initialization for 'arm_exit_handlers[1]')
   arch/arm64/kvm/handle_exit.c:178:25: warning: initialized field overwritten [-Woverride-init]
     178 |  [ESR_ELx_EC_CP15_32] = kvm_handle_cp15_32,
         |                         ^~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:178:25: note: (near initialization for 'arm_exit_handlers[3]')
   arch/arm64/kvm/handle_exit.c:179:25: warning: initialized field overwritten [-Woverride-init]
     179 |  [ESR_ELx_EC_CP15_64] = kvm_handle_cp15_64,
         |                         ^~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:179:25: note: (near initialization for 'arm_exit_handlers[4]')
   arch/arm64/kvm/handle_exit.c:180:25: warning: initialized field overwritten [-Woverride-init]
     180 |  [ESR_ELx_EC_CP14_MR] = kvm_handle_cp14_32,
         |                         ^~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:180:25: note: (near initialization for 'arm_exit_handlers[5]')
   arch/arm64/kvm/handle_exit.c:181:25: warning: initialized field overwritten [-Woverride-init]
     181 |  [ESR_ELx_EC_CP14_LS] = kvm_handle_cp14_load_store,
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:181:25: note: (near initialization for 'arm_exit_handlers[6]')
   arch/arm64/kvm/handle_exit.c:182:25: warning: initialized field overwritten [-Woverride-init]
     182 |  [ESR_ELx_EC_CP14_64] = kvm_handle_cp14_64,
         |                         ^~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:182:25: note: (near initialization for 'arm_exit_handlers[12]')
   arch/arm64/kvm/handle_exit.c:183:23: warning: initialized field overwritten [-Woverride-init]
     183 |  [ESR_ELx_EC_HVC32] = handle_hvc,
         |                       ^~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:183:23: note: (near initialization for 'arm_exit_handlers[18]')
   arch/arm64/kvm/handle_exit.c:184:23: warning: initialized field overwritten [-Woverride-init]
     184 |  [ESR_ELx_EC_SMC32] = handle_smc,
         |                       ^~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:184:23: note: (near initialization for 'arm_exit_handlers[19]')
   arch/arm64/kvm/handle_exit.c:185:23: warning: initialized field overwritten [-Woverride-init]
     185 |  [ESR_ELx_EC_HVC64] = handle_hvc,
         |                       ^~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:185:23: note: (near initialization for 'arm_exit_handlers[22]')
   arch/arm64/kvm/handle_exit.c:186:23: warning: initialized field overwritten [-Woverride-init]
     186 |  [ESR_ELx_EC_SMC64] = handle_smc,
         |                       ^~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:186:23: note: (near initialization for 'arm_exit_handlers[23]')
   arch/arm64/kvm/handle_exit.c:187:23: warning: initialized field overwritten [-Woverride-init]
     187 |  [ESR_ELx_EC_SYS64] = kvm_handle_sys_reg,
         |                       ^~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:187:23: note: (near initialization for 'arm_exit_handlers[24]')
   arch/arm64/kvm/handle_exit.c:188:21: warning: initialized field overwritten [-Woverride-init]
     188 |  [ESR_ELx_EC_SVE] = handle_sve,
         |                     ^~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:188:21: note: (near initialization for 'arm_exit_handlers[25]')
   arch/arm64/kvm/handle_exit.c:189:26: warning: initialized field overwritten [-Woverride-init]
     189 |  [ESR_ELx_EC_IABT_LOW] = kvm_handle_guest_abort,
         |                          ^~~~~~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:189:26: note: (near initialization for 'arm_exit_handlers[32]')
   arch/arm64/kvm/handle_exit.c:190:26: warning: initialized field overwritten [-Woverride-init]
     190 |  [ESR_ELx_EC_DABT_LOW] = kvm_handle_guest_abort,
         |                          ^~~~~~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:190:26: note: (near initialization for 'arm_exit_handlers[36]')
   arch/arm64/kvm/handle_exit.c:191:28: warning: initialized field overwritten [-Woverride-init]
     191 |  [ESR_ELx_EC_SOFTSTP_LOW]= kvm_handle_guest_debug,
         |                            ^~~~~~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:191:28: note: (near initialization for 'arm_exit_handlers[50]')
   arch/arm64/kvm/handle_exit.c:192:28: warning: initialized field overwritten [-Woverride-init]
     192 |  [ESR_ELx_EC_WATCHPT_LOW]= kvm_handle_guest_debug,
         |                            ^~~~~~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:192:28: note: (near initialization for 'arm_exit_handlers[52]')
   arch/arm64/kvm/handle_exit.c:193:28: warning: initialized field overwritten [-Woverride-init]
     193 |  [ESR_ELx_EC_BREAKPT_LOW]= kvm_handle_guest_debug,
         |                            ^~~~~~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:193:28: note: (near initialization for 'arm_exit_handlers[48]')
   arch/arm64/kvm/handle_exit.c:194:24: warning: initialized field overwritten [-Woverride-init]
     194 |  [ESR_ELx_EC_BKPT32] = kvm_handle_guest_debug,
         |                        ^~~~~~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:194:24: note: (near initialization for 'arm_exit_handlers[56]')
   arch/arm64/kvm/handle_exit.c:195:23: warning: initialized field overwritten [-Woverride-init]
     195 |  [ESR_ELx_EC_BRK64] = kvm_handle_guest_debug,
         |                       ^~~~~~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:195:23: note: (near initialization for 'arm_exit_handlers[60]')
   arch/arm64/kvm/handle_exit.c:196:26: warning: initialized field overwritten [-Woverride-init]
     196 |  [ESR_ELx_EC_FP_ASIMD] = handle_no_fpsimd,
         |                          ^~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:196:26: note: (near initialization for 'arm_exit_handlers[7]')
   arch/arm64/kvm/handle_exit.c:197:21: warning: initialized field overwritten [-Woverride-init]
     197 |  [ESR_ELx_EC_PAC] = kvm_handle_ptrauth,
         |                     ^~~~~~~~~~~~~~~~~~
   arch/arm64/kvm/handle_exit.c:197:21: note: (near initialization for 'arm_exit_handlers[9]')
>> arch/arm64/kvm/handle_exit.c:295:24: warning: no previous prototype for 'nvhe_hyp_panic_handler' [-Wmissing-prototypes]
     295 | void __noreturn __cold nvhe_hyp_panic_handler(u64 esr, u64 spsr, u64 elr,
         |                        ^~~~~~~~~~~~~~~~~~~~~~


vim +/nvhe_hyp_panic_handler +295 arch/arm64/kvm/handle_exit.c

   174	
   175	static exit_handle_fn arm_exit_handlers[] = {
   176		[0 ... ESR_ELx_EC_MAX]	= kvm_handle_unknown_ec,
   177		[ESR_ELx_EC_WFx]	= kvm_handle_wfx,
   178		[ESR_ELx_EC_CP15_32]	= kvm_handle_cp15_32,
   179		[ESR_ELx_EC_CP15_64]	= kvm_handle_cp15_64,
   180		[ESR_ELx_EC_CP14_MR]	= kvm_handle_cp14_32,
   181		[ESR_ELx_EC_CP14_LS]	= kvm_handle_cp14_load_store,
   182		[ESR_ELx_EC_CP14_64]	= kvm_handle_cp14_64,
   183		[ESR_ELx_EC_HVC32]	= handle_hvc,
   184		[ESR_ELx_EC_SMC32]	= handle_smc,
   185		[ESR_ELx_EC_HVC64]	= handle_hvc,
   186		[ESR_ELx_EC_SMC64]	= handle_smc,
   187		[ESR_ELx_EC_SYS64]	= kvm_handle_sys_reg,
   188		[ESR_ELx_EC_SVE]	= handle_sve,
   189		[ESR_ELx_EC_IABT_LOW]	= kvm_handle_guest_abort,
   190		[ESR_ELx_EC_DABT_LOW]	= kvm_handle_guest_abort,
   191		[ESR_ELx_EC_SOFTSTP_LOW]= kvm_handle_guest_debug,
   192		[ESR_ELx_EC_WATCHPT_LOW]= kvm_handle_guest_debug,
   193		[ESR_ELx_EC_BREAKPT_LOW]= kvm_handle_guest_debug,
   194		[ESR_ELx_EC_BKPT32]	= kvm_handle_guest_debug,
 > 195		[ESR_ELx_EC_BRK64]	= kvm_handle_guest_debug,
   196		[ESR_ELx_EC_FP_ASIMD]	= handle_no_fpsimd,
   197		[ESR_ELx_EC_PAC]	= kvm_handle_ptrauth,
   198	};
   199	
   200	static exit_handle_fn kvm_get_exit_handler(struct kvm_vcpu *vcpu)
   201	{
   202		u32 esr = kvm_vcpu_get_esr(vcpu);
   203		u8 esr_ec = ESR_ELx_EC(esr);
   204	
   205		return arm_exit_handlers[esr_ec];
   206	}
   207	
   208	/*
   209	 * We may be single-stepping an emulated instruction. If the emulation
   210	 * has been completed in the kernel, we can return to userspace with a
   211	 * KVM_EXIT_DEBUG, otherwise userspace needs to complete its
   212	 * emulation first.
   213	 */
   214	static int handle_trap_exceptions(struct kvm_vcpu *vcpu)
   215	{
   216		int handled;
   217	
   218		/*
   219		 * See ARM ARM B1.14.1: "Hyp traps on instructions
   220		 * that fail their condition code check"
   221		 */
   222		if (!kvm_condition_valid(vcpu)) {
   223			kvm_incr_pc(vcpu);
   224			handled = 1;
   225		} else {
   226			exit_handle_fn exit_handler;
   227	
   228			exit_handler = kvm_get_exit_handler(vcpu);
   229			handled = exit_handler(vcpu);
   230		}
   231	
   232		return handled;
   233	}
   234	
   235	/*
   236	 * Return > 0 to return to guest, < 0 on error, 0 (and set exit_reason) on
   237	 * proper exit to userspace.
   238	 */
   239	int handle_exit(struct kvm_vcpu *vcpu, int exception_index)
   240	{
   241		struct kvm_run *run = vcpu->run;
   242	
   243		exception_index = ARM_EXCEPTION_CODE(exception_index);
   244	
   245		switch (exception_index) {
   246		case ARM_EXCEPTION_IRQ:
   247			return 1;
   248		case ARM_EXCEPTION_EL1_SERROR:
   249			return 1;
   250		case ARM_EXCEPTION_TRAP:
   251			return handle_trap_exceptions(vcpu);
   252		case ARM_EXCEPTION_HYP_GONE:
   253			/*
   254			 * EL2 has been reset to the hyp-stub. This happens when a guest
   255			 * is pre-empted by kvm_reboot()'s shutdown call.
   256			 */
   257			run->exit_reason = KVM_EXIT_FAIL_ENTRY;
   258			return 0;
   259		case ARM_EXCEPTION_IL:
   260			/*
   261			 * We attempted an illegal exception return.  Guest state must
   262			 * have been corrupted somehow.  Give up.
   263			 */
   264			run->exit_reason = KVM_EXIT_FAIL_ENTRY;
   265			return -EINVAL;
   266		default:
   267			kvm_pr_unimpl("Unsupported exception type: %d",
   268				      exception_index);
   269			run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
   270			return 0;
   271		}
   272	}
   273	
   274	/* For exit types that need handling before we can be preempted */
   275	void handle_exit_early(struct kvm_vcpu *vcpu, int exception_index)
   276	{
   277		if (ARM_SERROR_PENDING(exception_index)) {
   278			if (this_cpu_has_cap(ARM64_HAS_RAS_EXTN)) {
   279				u64 disr = kvm_vcpu_get_disr(vcpu);
   280	
   281				kvm_handle_guest_serror(vcpu, disr_to_esr(disr));
   282			} else {
   283				kvm_inject_vabt(vcpu);
   284			}
   285	
   286			return;
   287		}
   288	
   289		exception_index = ARM_EXCEPTION_CODE(exception_index);
   290	
   291		if (exception_index == ARM_EXCEPTION_EL1_SERROR)
   292			kvm_handle_guest_serror(vcpu, kvm_vcpu_get_esr(vcpu));
   293	}
   294	
 > 295	void __noreturn __cold nvhe_hyp_panic_handler(u64 esr, u64 spsr, u64 elr,

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 47319 bytes --]

             reply	other threads:[~2021-07-01 14:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01 14:01 kernel test robot [this message]
2021-07-01 14:01 ` arch/arm64/kvm/handle_exit.c:295:24: warning: no previous prototype for 'nvhe_hyp_panic_handler' kernel test robot
2022-01-01  6:50 kernel test robot
2022-01-01  6:50 ` kernel test robot
2022-04-10  2:14 kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202107012251.4X4d2ksB-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ascull@google.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.