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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AD559C3DA4A for ; Thu, 22 Aug 2024 14:16:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hTffQgdQHLLpguZIXxT7EUrxX9qaIZ8KQ3Lw72tygl0=; b=Y823CyZBSOO71DTHQTarc5zCzp 3wnoCUrfyzLGGp7DAA44erDHhgTXZpUP41rjv/Vw6JbHqTc4mao5ekUsEJXOGhTBo6h9Qyem1bpGs /MEHDLsYE53adZasGKl3EC3bphXmMJGHc11BkVJlCIGriwuWtRYZzyEewOTC76YuRZ+ypCqsp3yUf bczkaBrGunzoC3AWzi5n1Woi3vB5rIRvag62Ou0xNM3zc28J9i2CaLCNIo9LhU1V4wdflS+EFdOpd e/SIjbaLRjLujZgeC0KtxjF736iayhoVPXcPJVvqAsySP/8nJIHQlCm5LXCCwZ2I7pYw0K0sUk8eS NbOZL65Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sh8bf-0000000D75C-3Iom; Thu, 22 Aug 2024 14:16:08 +0000 Received: from mgamail.intel.com ([192.198.163.7]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sh8av-0000000D6yo-0P9G for linux-arm-kernel@lists.infradead.org; Thu, 22 Aug 2024 14:15:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724336121; x=1755872121; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=N0UsVQc1quPucMHanRFreY+o7eT0pQqsYArCHU/T7LU=; b=lvpDKpder2tBxHioM+KXzRgJAXF6K1+X/ZFAnlXCwLBIIPu+ykQCAWCw PrE9+lMc5X6UB98ykZ/6ttcmQCYEkCScIn7vJEq9snaOjJDKywVH4V0+s 51S8usVDPaQViC1tKolqVFUR1J8fW/9XnyHUrR8EyEgAqHK27LOXX7dt1 LfPCReI2bxAuqEGk/4wI4Qqoz0QrUGvuenQCM+57oa7B0gbpc3OPRLOM3 MWdePUFt8BssfMUmBmD2b1sb4HxZiXqLMAQFIsg76V9+7wa70bq7tkkdp HyKNur0+ns5griM6O5zPw4Y2bp8VqLEKKX4zYZMG4pBIrdfBC+G8ov4KS w==; X-CSE-ConnectionGUID: xUgVq0RMQSqT8jIGUwJFCA== X-CSE-MsgGUID: NkLySUKyToWlV2Law7+hPw== X-IronPort-AV: E=McAfee;i="6700,10204,11172"; a="48146854" X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="48146854" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2024 07:15:17 -0700 X-CSE-ConnectionGUID: dT51fZTvSqWFhZRqkA8Wdw== X-CSE-MsgGUID: gLBrdYJoT2KS1cHWkU+wpQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,167,1719903600"; d="scan'208";a="62175288" Received: from lkp-server01.sh.intel.com (HELO 9a732dc145d3) ([10.239.97.150]) by orviesa008.jf.intel.com with ESMTP; 22 Aug 2024 07:15:12 -0700 Received: from kbuild by 9a732dc145d3 with local (Exim 4.96) (envelope-from ) id 1sh8aj-000Cqv-2a; Thu, 22 Aug 2024 14:15:09 +0000 Date: Thu, 22 Aug 2024 22:14:25 +0800 From: kernel test robot To: Steven Price , kvm@vger.kernel.org, kvmarm@lists.linux.dev Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, Steven Price , Catalin Marinas , Marc Zyngier , Will Deacon , James Morse , Oliver Upton , Suzuki K Poulose , Zenghui Yu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Joey Gouly , Alexandru Elisei , Christoffer Dall , Fuad Tabba , linux-coco@lists.linux.dev, Ganapatrao Kulkarni , Gavin Shan , Shanker Donthineni , Alper Gun Subject: Re: [PATCH v4 18/43] arm64: RME: Handle realm enter/exit Message-ID: <202408222119.6YF3UR6O-lkp@intel.com> References: <20240821153844.60084-19-steven.price@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240821153844.60084-19-steven.price@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240822_071521_228362_DA8D428D X-CRM114-Status: GOOD ( 15.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Steven, kernel test robot noticed the following build warnings: [auto build test WARNING on kvmarm/next] [also build test WARNING on kvm/queue arm64/for-next/core linus/master v6.11-rc4 next-20240822] [cannot apply to kvm/linux-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#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Steven-Price/KVM-Prepare-for-handling-only-shared-mappings-in-mmu_notifier-events/20240821-235327 base: https://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git next patch link: https://lore.kernel.org/r/20240821153844.60084-19-steven.price%40arm.com patch subject: [PATCH v4 18/43] arm64: RME: Handle realm enter/exit config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20240822/202408222119.6YF3UR6O-lkp@intel.com/config) compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 26670e7fa4f032a019d23d56c6a02926e854e8af) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240822/202408222119.6YF3UR6O-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202408222119.6YF3UR6O-lkp@intel.com/ All warnings (new ones prefixed by >>): In file included from arch/arm64/kvm/rme-exit.c:6: In file included from include/linux/kvm_host.h:16: In file included from include/linux/mm.h:2228: include/linux/vmstat.h:500:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 500 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 501 | item]; | ~~~~ include/linux/vmstat.h:507:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 507 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 508 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 514 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~ include/linux/vmstat.h:519:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 519 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 520 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ include/linux/vmstat.h:528:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 528 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 529 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ arch/arm64/kvm/rme-exit.c:61:23: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides] 61 | [ESR_ELx_EC_SYS64] = rec_exit_sys_reg, | ^~~~~~~~~~~~~~~~ arch/arm64/kvm/rme-exit.c:60:27: note: previous initialization is here 60 | [0 ... ESR_ELx_EC_MAX] = rec_exit_reason_notimpl, | ^~~~~~~~~~~~~~~~~~~~~~~ arch/arm64/kvm/rme-exit.c:62:26: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides] 62 | [ESR_ELx_EC_DABT_LOW] = rec_exit_sync_dabt, | ^~~~~~~~~~~~~~~~~~ arch/arm64/kvm/rme-exit.c:60:27: note: previous initialization is here 60 | [0 ... ESR_ELx_EC_MAX] = rec_exit_reason_notimpl, | ^~~~~~~~~~~~~~~~~~~~~~~ arch/arm64/kvm/rme-exit.c:63:26: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides] 63 | [ESR_ELx_EC_IABT_LOW] = rec_exit_sync_iabt | ^~~~~~~~~~~~~~~~~~ arch/arm64/kvm/rme-exit.c:60:27: note: previous initialization is here 60 | [0 ... ESR_ELx_EC_MAX] = rec_exit_reason_notimpl, | ^~~~~~~~~~~~~~~~~~~~~~~ >> arch/arm64/kvm/rme-exit.c:94:6: warning: variable 'top_ipa' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] 94 | if (realm_is_addr_protected(realm, base) && | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 95 | realm_is_addr_protected(realm, top - 1)) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/arm64/kvm/rme-exit.c:108:44: note: uninitialized use occurs here 108 | kvm_prepare_memory_fault_exit(vcpu, base, top_ipa - base, false, false, | ^~~~~~~ arch/arm64/kvm/rme-exit.c:94:2: note: remove the 'if' if its condition is always true 94 | if (realm_is_addr_protected(realm, base) && | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 95 | realm_is_addr_protected(realm, top - 1)) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> arch/arm64/kvm/rme-exit.c:94:6: warning: variable 'top_ipa' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized] 94 | if (realm_is_addr_protected(realm, base) && | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/arm64/kvm/rme-exit.c:108:44: note: uninitialized use occurs here 108 | kvm_prepare_memory_fault_exit(vcpu, base, top_ipa - base, false, false, | ^~~~~~~ arch/arm64/kvm/rme-exit.c:94:6: note: remove the '&&' if its condition is always true 94 | if (realm_is_addr_protected(realm, base) && | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/arm64/kvm/rme-exit.c:91:23: note: initialize the variable 'top_ipa' to silence this warning 91 | unsigned long top_ipa; | ^ | = 0 10 warnings generated. vim +94 arch/arm64/kvm/rme-exit.c 58 59 static exit_handler_fn rec_exit_handlers[] = { > 60 [0 ... ESR_ELx_EC_MAX] = rec_exit_reason_notimpl, 61 [ESR_ELx_EC_SYS64] = rec_exit_sys_reg, 62 [ESR_ELx_EC_DABT_LOW] = rec_exit_sync_dabt, 63 [ESR_ELx_EC_IABT_LOW] = rec_exit_sync_iabt 64 }; 65 66 static int rec_exit_psci(struct kvm_vcpu *vcpu) 67 { 68 struct realm_rec *rec = &vcpu->arch.rec; 69 int i; 70 int ret; 71 72 for (i = 0; i < REC_RUN_GPRS; i++) 73 vcpu_set_reg(vcpu, i, rec->run->exit.gprs[i]); 74 75 ret = kvm_smccc_call_handler(vcpu); 76 77 for (i = 0; i < REC_RUN_GPRS; i++) 78 rec->run->enter.gprs[i] = vcpu_get_reg(vcpu, i); 79 80 return ret; 81 } 82 83 static int rec_exit_ripas_change(struct kvm_vcpu *vcpu) 84 { 85 struct kvm *kvm = vcpu->kvm; 86 struct realm *realm = &kvm->arch.realm; 87 struct realm_rec *rec = &vcpu->arch.rec; 88 unsigned long base = rec->run->exit.ripas_base; 89 unsigned long top = rec->run->exit.ripas_top; 90 unsigned long ripas = rec->run->exit.ripas_value & 1; 91 unsigned long top_ipa; 92 int ret = -EINVAL; 93 > 94 if (realm_is_addr_protected(realm, base) && 95 realm_is_addr_protected(realm, top - 1)) { 96 kvm_mmu_topup_memory_cache(&vcpu->arch.mmu_page_cache, 97 kvm_mmu_cache_min_pages(vcpu->arch.hw_mmu)); 98 write_lock(&kvm->mmu_lock); 99 ret = realm_set_ipa_state(vcpu, base, top, ripas, &top_ipa); 100 write_unlock(&kvm->mmu_lock); 101 } 102 103 WARN(ret && ret != -ENOMEM, 104 "Unable to satisfy SET_IPAS for %#lx - %#lx, ripas: %#lx\n", 105 base, top, ripas); 106 107 /* Exit to VMM to complete the change */ > 108 kvm_prepare_memory_fault_exit(vcpu, base, top_ipa - base, false, false, 109 ripas == 1); 110 111 return 0; 112 } 113 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki