All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: cros-kernel-buildreports@googlegroups.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [android-common:android16-6.12 1/1] arch/arm64/kvm/hyp/nvhe/mem_protect.c:2766:49: warning: suggest parentheses around '-' in operand of '&'
Date: Thu, 17 Apr 2025 07:44:56 +0800	[thread overview]
Message-ID: <202504170716.InDP9qKb-lkp@intel.com> (raw)

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

                 reply	other threads:[~2025-04-16 23:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202504170716.InDP9qKb-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=cros-kernel-buildreports@googlegroups.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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.