mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Anup Patel <apatel@ventanamicro.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Atish Patra <atishp@rivosinc.com>
Subject: arch/riscv/kvm/nacl.c:28:21: sparse: sparse: cast to restricted __le32
Date: Thu, 19 Dec 2024 19:04:43 +0800	[thread overview]
Message-ID: <202412191824.oRnRcOY5-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   eabcdba3ad4098460a376538df2ae36500223c1e
commit: d466c19cead5904d4d5d92adb2b213b411d3b849 RISC-V: KVM: Add common nested acceleration support
date:   7 weeks ago
config: riscv-randconfig-r113-20241219 (https://download.01.org/0day-ci/archive/20241219/202412191824.oRnRcOY5-lkp@intel.com/config)
compiler: riscv32-linux-gcc (GCC) 14.2.0
reproduce: (https://download.01.org/0day-ci/archive/20241219/202412191824.oRnRcOY5-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/202412191824.oRnRcOY5-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> arch/riscv/kvm/nacl.c:28:21: sparse: sparse: cast to restricted __le32
>> arch/riscv/kvm/nacl.c:46:15: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long @@     got restricted __le32 [usertype] @@
   arch/riscv/kvm/nacl.c:46:15: sparse:     expected unsigned long
   arch/riscv/kvm/nacl.c:46:15: sparse:     got restricted __le32 [usertype]
   arch/riscv/kvm/nacl.c:48:15: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long @@     got restricted __le32 [usertype] @@
   arch/riscv/kvm/nacl.c:48:15: sparse:     expected unsigned long
   arch/riscv/kvm/nacl.c:48:15: sparse:     got restricted __le32 [usertype]
   arch/riscv/kvm/nacl.c:50:15: sparse: sparse: incorrect type in assignment (different base types) @@     expected unsigned long @@     got restricted __le32 [usertype] @@
   arch/riscv/kvm/nacl.c:50:15: sparse:     expected unsigned long
   arch/riscv/kvm/nacl.c:50:15: sparse:     got restricted __le32 [usertype]

vim +28 arch/riscv/kvm/nacl.c

    16	
    17	void __kvm_riscv_nacl_hfence(void *shmem,
    18				     unsigned long control,
    19				     unsigned long page_num,
    20				     unsigned long page_count)
    21	{
    22		int i, ent = -1, try_count = 5;
    23		unsigned long *entp;
    24	
    25	again:
    26		for (i = 0; i < SBI_NACL_SHMEM_HFENCE_ENTRY_MAX; i++) {
    27			entp = shmem + SBI_NACL_SHMEM_HFENCE_ENTRY_CONFIG(i);
  > 28			if (lelong_to_cpu(*entp) & SBI_NACL_SHMEM_HFENCE_CONFIG_PEND)
    29				continue;
    30	
    31			ent = i;
    32			break;
    33		}
    34	
    35		if (ent < 0) {
    36			if (try_count) {
    37				nacl_sync_hfence(-1UL);
    38				goto again;
    39			} else {
    40				pr_warn("KVM: No free entry in NACL shared memory\n");
    41				return;
    42			}
    43		}
    44	
    45		entp = shmem + SBI_NACL_SHMEM_HFENCE_ENTRY_CONFIG(i);
  > 46		*entp = cpu_to_lelong(control);
    47		entp = shmem + SBI_NACL_SHMEM_HFENCE_ENTRY_PNUM(i);
    48		*entp = cpu_to_lelong(page_num);
    49		entp = shmem + SBI_NACL_SHMEM_HFENCE_ENTRY_PCOUNT(i);
    50		*entp = cpu_to_lelong(page_count);
    51	}
    52	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2024-12-19 11:05 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=202412191824.oRnRcOY5-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=apatel@ventanamicro.com \
    --cc=atishp@rivosinc.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®