* [android-common:android16-6.12 1/1] arch/arm64/kvm/hyp/nvhe/mem_protect.c:2766:49: warning: suggest parentheses around '-' in operand of '&'
@ 2025-04-16 23:44 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-04-16 23:44 UTC (permalink / raw)
To: cros-kernel-buildreports; +Cc: oe-kbuild-all
tree: https://android.googlesource.com/kernel/common android16-6.12
head: 179c4d3da80ef129e67fba69fa022fe3f91c60be
commit: bd55bd84082e4882aaeff13ebfdcb78b329f5302 [1/1] ANDROID: KVM: arm64: Generalize guest PA query
config: arm64-randconfig-001-20250417 (https://download.01.org/0day-ci/archive/20250417/202504170716.InDP9qKb-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250417/202504170716.InDP9qKb-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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202504170716.InDP9qKb-lkp@intel.com/
All warnings (new ones prefixed by >>):
arch/arm64/kvm/hyp/nvhe/mem_protect.c: In function 'pkvm_get_guest_pa_request':
>> arch/arm64/kvm/hyp/nvhe/mem_protect.c:2766:49: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
*out_pa |= (ipa & kvm_granule_size(*out_level) - 1) & PAGE_MASK;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
vim +2766 arch/arm64/kvm/hyp/nvhe/mem_protect.c
2733
2734 /* Return PA for an owned guest IPA or request it, and repeat the guest HVC */
2735 int pkvm_get_guest_pa_request(struct pkvm_hyp_vcpu *hyp_vcpu, u64 ipa,
2736 size_t ipa_size_request, u64 *out_pa, s8 *out_level,
2737 u64 *exit_code)
2738 {
2739 struct kvm_hyp_req *req;
2740 kvm_pte_t pte;
2741 enum pkvm_page_state state;
2742 struct pkvm_hyp_vm *vm = pkvm_hyp_vcpu_to_hyp_vm(hyp_vcpu);
2743
2744 guest_lock_component(vm);
2745 WARN_ON(kvm_pgtable_get_leaf(&vm->pgt, ipa, &pte, out_level));
2746 guest_unlock_component(vm);
2747 if (!kvm_pte_valid(pte)) {
2748 /* Page not mapped, create a request*/
2749 req = pkvm_hyp_req_reserve(hyp_vcpu, KVM_HYP_REQ_TYPE_MAP);
2750 if (!req)
2751 return -ENOMEM;
2752
2753 req->map.guest_ipa = ipa;
2754 req->map.size = ipa_size_request;
2755 *exit_code = ARM_EXCEPTION_HYP_REQ;
2756 /* Repeat next time. */
2757 write_sysreg_el2(read_sysreg_el2(SYS_ELR) - 4, SYS_ELR);
2758 return -ENOENT;
2759 }
2760
2761 state = pkvm_getstate(kvm_pgtable_stage2_pte_prot(pte));
2762 if (state != PKVM_PAGE_OWNED)
2763 return -EPERM;
2764
2765 *out_pa = kvm_pte_to_phys(pte);
> 2766 *out_pa |= (ipa & kvm_granule_size(*out_level) - 1) & PAGE_MASK;
2767 return 0;
2768 }
2769
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-04-16 23:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-16 23:44 [android-common:android16-6.12 1/1] arch/arm64/kvm/hyp/nvhe/mem_protect.c:2766:49: warning: suggest parentheses around '-' in operand of '&' kernel test robot
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.