* arch/riscv/kvm/vcpu_exit.c:139:34: sparse: sparse: cast to restricted __le64
@ 2025-12-14 8:10 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-12-14 8:10 UTC (permalink / raw)
To: Anup Patel; +Cc: oe-kbuild-all, linux-kernel, Atish Patra, Nutty Liu
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
commit: 77ba6469fe1ed37a1f62bc76fb5a7b159f698aed RISC-V: KVM: Use ncsr_xyz() in kvm_riscv_vcpu_trap_redirect()
date: 5 months ago
config: riscv-randconfig-r123-20251214 (https://download.01.org/0day-ci/archive/20251214/202512141619.z9NzOFKH-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251214/202512141619.z9NzOFKH-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/202512141619.z9NzOFKH-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> arch/riscv/kvm/vcpu_exit.c:139:34: sparse: sparse: cast to restricted __le64
arch/riscv/kvm/vcpu_exit.c:155:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long @@ got restricted __le64 [usertype] @@
arch/riscv/kvm/vcpu_exit.c:155:9: sparse: expected unsigned long
arch/riscv/kvm/vcpu_exit.c:155:9: sparse: got restricted __le64 [usertype]
arch/riscv/kvm/vcpu_exit.c:158:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long @@ got restricted __le64 [usertype] @@
arch/riscv/kvm/vcpu_exit.c:158:9: sparse: expected unsigned long
arch/riscv/kvm/vcpu_exit.c:158:9: sparse: got restricted __le64 [usertype]
arch/riscv/kvm/vcpu_exit.c:159:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long @@ got restricted __le64 [usertype] @@
arch/riscv/kvm/vcpu_exit.c:159:9: sparse: expected unsigned long
arch/riscv/kvm/vcpu_exit.c:159:9: sparse: got restricted __le64 [usertype]
arch/riscv/kvm/vcpu_exit.c:160:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long @@ got restricted __le64 [usertype] @@
arch/riscv/kvm/vcpu_exit.c:160:9: sparse: expected unsigned long
arch/riscv/kvm/vcpu_exit.c:160:9: sparse: got restricted __le64 [usertype]
arch/riscv/kvm/vcpu_exit.c:163:41: sparse: sparse: cast to restricted __le64
vim +139 arch/riscv/kvm/vcpu_exit.c
129
130 /**
131 * kvm_riscv_vcpu_trap_redirect -- Redirect trap to Guest
132 *
133 * @vcpu: The VCPU pointer
134 * @trap: Trap details
135 */
136 void kvm_riscv_vcpu_trap_redirect(struct kvm_vcpu *vcpu,
137 struct kvm_cpu_trap *trap)
138 {
> 139 unsigned long vsstatus = ncsr_read(CSR_VSSTATUS);
140
141 /* Change Guest SSTATUS.SPP bit */
142 vsstatus &= ~SR_SPP;
143 if (vcpu->arch.guest_context.sstatus & SR_SPP)
144 vsstatus |= SR_SPP;
145
146 /* Change Guest SSTATUS.SPIE bit */
147 vsstatus &= ~SR_SPIE;
148 if (vsstatus & SR_SIE)
149 vsstatus |= SR_SPIE;
150
151 /* Clear Guest SSTATUS.SIE bit */
152 vsstatus &= ~SR_SIE;
153
154 /* Update Guest SSTATUS */
155 ncsr_write(CSR_VSSTATUS, vsstatus);
156
157 /* Update Guest SCAUSE, STVAL, and SEPC */
158 ncsr_write(CSR_VSCAUSE, trap->scause);
159 ncsr_write(CSR_VSTVAL, trap->stval);
160 ncsr_write(CSR_VSEPC, trap->sepc);
161
162 /* Set Guest PC to Guest exception vector */
163 vcpu->arch.guest_context.sepc = ncsr_read(CSR_VSTVEC);
164
165 /* Set Guest privilege mode to supervisor */
166 vcpu->arch.guest_context.sstatus |= SR_SPP;
167 }
168
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
* arch/riscv/kvm/vcpu_exit.c:139:34: sparse: sparse: cast to restricted __le64
@ 2026-05-05 12:38 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-05-05 12:38 UTC (permalink / raw)
To: Anup Patel; +Cc: oe-kbuild-all, linux-kernel, Atish Patra, Nutty Liu
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: a293ec25d59dd96309058c70df5a4dd0f889a1e4
commit: 77ba6469fe1ed37a1f62bc76fb5a7b159f698aed RISC-V: KVM: Use ncsr_xyz() in kvm_riscv_vcpu_trap_redirect()
date: 9 months ago
config: riscv-randconfig-r111-20260505 (https://download.01.org/0day-ci/archive/20260505/202605052050.CJsAMbd7-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 8.5.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260505/202605052050.CJsAMbd7-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
| Fixes: 77ba6469fe1e ("RISC-V: KVM: Use ncsr_xyz() in kvm_riscv_vcpu_trap_redirect()")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605052050.CJsAMbd7-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> arch/riscv/kvm/vcpu_exit.c:139:34: sparse: sparse: cast to restricted __le64
>> arch/riscv/kvm/vcpu_exit.c:155:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long @@ got restricted __le64 [usertype] @@
arch/riscv/kvm/vcpu_exit.c:155:9: sparse: expected unsigned long
arch/riscv/kvm/vcpu_exit.c:155:9: sparse: got restricted __le64 [usertype]
arch/riscv/kvm/vcpu_exit.c:158:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long @@ got restricted __le64 [usertype] @@
arch/riscv/kvm/vcpu_exit.c:158:9: sparse: expected unsigned long
arch/riscv/kvm/vcpu_exit.c:158:9: sparse: got restricted __le64 [usertype]
arch/riscv/kvm/vcpu_exit.c:159:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long @@ got restricted __le64 [usertype] @@
arch/riscv/kvm/vcpu_exit.c:159:9: sparse: expected unsigned long
arch/riscv/kvm/vcpu_exit.c:159:9: sparse: got restricted __le64 [usertype]
arch/riscv/kvm/vcpu_exit.c:160:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long @@ got restricted __le64 [usertype] @@
arch/riscv/kvm/vcpu_exit.c:160:9: sparse: expected unsigned long
arch/riscv/kvm/vcpu_exit.c:160:9: sparse: got restricted __le64 [usertype]
arch/riscv/kvm/vcpu_exit.c:163:41: sparse: sparse: cast to restricted __le64
vim +139 arch/riscv/kvm/vcpu_exit.c
129
130 /**
131 * kvm_riscv_vcpu_trap_redirect -- Redirect trap to Guest
132 *
133 * @vcpu: The VCPU pointer
134 * @trap: Trap details
135 */
136 void kvm_riscv_vcpu_trap_redirect(struct kvm_vcpu *vcpu,
137 struct kvm_cpu_trap *trap)
138 {
> 139 unsigned long vsstatus = ncsr_read(CSR_VSSTATUS);
140
141 /* Change Guest SSTATUS.SPP bit */
142 vsstatus &= ~SR_SPP;
143 if (vcpu->arch.guest_context.sstatus & SR_SPP)
144 vsstatus |= SR_SPP;
145
146 /* Change Guest SSTATUS.SPIE bit */
147 vsstatus &= ~SR_SPIE;
148 if (vsstatus & SR_SIE)
149 vsstatus |= SR_SPIE;
150
151 /* Clear Guest SSTATUS.SIE bit */
152 vsstatus &= ~SR_SIE;
153
154 /* Update Guest SSTATUS */
> 155 ncsr_write(CSR_VSSTATUS, vsstatus);
156
157 /* Update Guest SCAUSE, STVAL, and SEPC */
158 ncsr_write(CSR_VSCAUSE, trap->scause);
159 ncsr_write(CSR_VSTVAL, trap->stval);
160 ncsr_write(CSR_VSEPC, trap->sepc);
161
162 /* Set Guest PC to Guest exception vector */
163 vcpu->arch.guest_context.sepc = ncsr_read(CSR_VSTVEC);
164
165 /* Set Guest privilege mode to supervisor */
166 vcpu->arch.guest_context.sstatus |= SR_SPP;
167 }
168
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-05 12:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-05 12:38 arch/riscv/kvm/vcpu_exit.c:139:34: sparse: sparse: cast to restricted __le64 kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2025-12-14 8:10 kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox