linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] KVM: arm64: timers: Fix percpu address space issues in kvm_timer_hyp_init()
@ 2024-12-13 14:57 Uros Bizjak
  2024-12-13 14:57 ` [PATCH 2/3] irqchip/gic: Correct declaration of *percpu_base pointer in union gic_base Uros Bizjak
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Uros Bizjak @ 2024-12-13 14:57 UTC (permalink / raw)
  To: linux-arm-kernel, kvmarm, linux-kernel
  Cc: Uros Bizjak, Marc Zyngier, Oliver Upton, Joey Gouly,
	Suzuki K Poulose, Zenghui Yu, Catalin Marinas, Will Deacon

Cast return value from kvm_get_running_vcpus() in the __percpu
address space to the generic address space via uintptr_t [1]
to fix a couple of:

arch_timer.c:1395:66: warning: incorrect type in argument 2 (different address spaces)
arch_timer.c:1395:66:    expected void *vcpu_info
arch_timer.c:1395:66:    got struct kvm_vcpu *[noderef] __percpu *

sparse warnings.

There were no changes in the resulting object files.

[1] https://sparse.docs.kernel.org/en/latest/annotations.html#address-space-name

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Oliver Upton <oliver.upton@linux.dev>
Cc: Joey Gouly <joey.gouly@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Zenghui Yu <yuzenghui@huawei.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
---
 arch/arm64/kvm/arch_timer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/kvm/arch_timer.c b/arch/arm64/kvm/arch_timer.c
index 1215df590418..a13bb9e8dc19 100644
--- a/arch/arm64/kvm/arch_timer.c
+++ b/arch/arm64/kvm/arch_timer.c
@@ -1392,7 +1392,7 @@ int __init kvm_timer_hyp_init(bool has_gic)
 
 	if (has_gic) {
 		err = irq_set_vcpu_affinity(host_vtimer_irq,
-					    kvm_get_running_vcpus());
+					    (void *)(uintptr_t)kvm_get_running_vcpus());
 		if (err) {
 			kvm_err("kvm_arch_timer: error setting vcpu affinity\n");
 			goto out_free_vtimer_irq;
@@ -1416,7 +1416,7 @@ int __init kvm_timer_hyp_init(bool has_gic)
 
 		if (has_gic) {
 			err = irq_set_vcpu_affinity(host_ptimer_irq,
-						    kvm_get_running_vcpus());
+						    (void *)(uintptr_t)kvm_get_running_vcpus());
 			if (err) {
 				kvm_err("kvm_arch_timer: error setting vcpu affinity\n");
 				goto out_free_ptimer_irq;
-- 
2.42.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-01-16 15:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-13 14:57 [PATCH 1/3] KVM: arm64: timers: Fix percpu address space issues in kvm_timer_hyp_init() Uros Bizjak
2024-12-13 14:57 ` [PATCH 2/3] irqchip/gic: Correct declaration of *percpu_base pointer in union gic_base Uros Bizjak
2024-12-13 17:05   ` Marc Zyngier
2024-12-13 14:57 ` [PATCH 3/3] mailbox: zynqmp: Remove invalid __percpu annotation in zynqmp_ipi_probe() Uros Bizjak
2024-12-13 15:05   ` Michal Simek
2024-12-13 17:15 ` [PATCH 1/3] KVM: arm64: timers: Fix percpu address space issues in kvm_timer_hyp_init() Marc Zyngier
2024-12-16  7:37   ` Uros Bizjak
2025-01-16 14:25   ` Uros Bizjak
2025-01-16 15:09     ` Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).