* [PATCH] kvm: x86: annotate RCU pointers
@ 2021-03-05 19:11 Muhammad Usama Anjum
2021-03-12 18:17 ` Paolo Bonzini
0 siblings, 1 reply; 2+ messages in thread
From: Muhammad Usama Anjum @ 2021-03-05 19:11 UTC (permalink / raw)
To: Paolo Bonzini, Sean Christopherson, Vitaly Kuznetsov, Wanpeng Li,
Jim Mattson, Joerg Roedel, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, x86, H. Peter Anvin, linux-kernel
Cc: musamaanjum
This patch adds the annotation to fix the following sparse errors:
arch/x86/kvm//x86.c:8147:15: error: incompatible types in comparison expression (different address spaces):
arch/x86/kvm//x86.c:8147:15: struct kvm_apic_map [noderef] __rcu *
arch/x86/kvm//x86.c:8147:15: struct kvm_apic_map *
arch/x86/kvm//x86.c:10628:16: error: incompatible types in comparison expression (different address spaces):
arch/x86/kvm//x86.c:10628:16: struct kvm_apic_map [noderef] __rcu *
arch/x86/kvm//x86.c:10628:16: struct kvm_apic_map *
arch/x86/kvm//x86.c:10629:15: error: incompatible types in comparison expression (different address spaces):
arch/x86/kvm//x86.c:10629:15: struct kvm_pmu_event_filter [noderef] __rcu *
arch/x86/kvm//x86.c:10629:15: struct kvm_pmu_event_filter *
arch/x86/kvm//lapic.c:267:15: error: incompatible types in comparison expression (different address spaces):
arch/x86/kvm//lapic.c:267:15: struct kvm_apic_map [noderef] __rcu *
arch/x86/kvm//lapic.c:267:15: struct kvm_apic_map *
arch/x86/kvm//lapic.c:269:9: error: incompatible types in comparison expression (different address spaces):
arch/x86/kvm//lapic.c:269:9: struct kvm_apic_map [noderef] __rcu *
arch/x86/kvm//lapic.c:269:9: struct kvm_apic_map *
arch/x86/kvm//lapic.c:637:15: error: incompatible types in comparison expression (different address spaces):
arch/x86/kvm//lapic.c:637:15: struct kvm_apic_map [noderef] __rcu *
arch/x86/kvm//lapic.c:637:15: struct kvm_apic_map *
arch/x86/kvm//lapic.c:994:15: error: incompatible types in comparison expression (different address spaces):
arch/x86/kvm//lapic.c:994:15: struct kvm_apic_map [noderef] __rcu *
arch/x86/kvm//lapic.c:994:15: struct kvm_apic_map *
arch/x86/kvm//lapic.c:1036:15: error: incompatible types in comparison expression (different address spaces):
arch/x86/kvm//lapic.c:1036:15: struct kvm_apic_map [noderef] __rcu *
arch/x86/kvm//lapic.c:1036:15: struct kvm_apic_map *
arch/x86/kvm//lapic.c:1173:15: error: incompatible types in comparison expression (different address spaces):
arch/x86/kvm//lapic.c:1173:15: struct kvm_apic_map [noderef] __rcu *
arch/x86/kvm//lapic.c:1173:15: struct kvm_apic_map *
arch/x86/kvm//pmu.c:190:18: error: incompatible types in comparison expression (different address spaces):
arch/x86/kvm//pmu.c:190:18: struct kvm_pmu_event_filter [noderef] __rcu *
arch/x86/kvm//pmu.c:190:18: struct kvm_pmu_event_filter *
arch/x86/kvm//pmu.c:251:18: error: incompatible types in comparison expression (different address spaces):
arch/x86/kvm//pmu.c:251:18: struct kvm_pmu_event_filter [noderef] __rcu *
arch/x86/kvm//pmu.c:251:18: struct kvm_pmu_event_filter *
arch/x86/kvm//pmu.c:522:18: error: incompatible types in comparison expression (different address spaces):
arch/x86/kvm//pmu.c:522:18: struct kvm_pmu_event_filter [noderef] __rcu *
arch/x86/kvm//pmu.c:522:18: struct kvm_pmu_event_filter *
arch/x86/kvm//pmu.c:522:18: error: incompatible types in comparison expression (different address spaces):
arch/x86/kvm//pmu.c:522:18: struct kvm_pmu_event_filter [noderef] __rcu *
arch/x86/kvm//pmu.c:522:18: struct kvm_pmu_event_filter *
Signed-off-by: Muhammad Usama Anjum <musamaanjum@gmail.com>
---
arch/x86/include/asm/kvm_host.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 84499aad01a4..ad675c8c05e7 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -958,7 +958,7 @@ struct kvm_arch {
struct kvm_pit *vpit;
atomic_t vapics_in_nmi_mode;
struct mutex apic_map_lock;
- struct kvm_apic_map *apic_map;
+ struct kvm_apic_map __rcu *apic_map;
atomic_t apic_map_dirty;
bool apic_access_page_done;
@@ -1030,7 +1030,7 @@ struct kvm_arch {
bool bus_lock_detection_enabled;
- struct kvm_pmu_event_filter *pmu_event_filter;
+ struct kvm_pmu_event_filter __rcu *pmu_event_filter;
struct task_struct *nx_lpage_recovery_thread;
#ifdef CONFIG_X86_64
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] kvm: x86: annotate RCU pointers
2021-03-05 19:11 [PATCH] kvm: x86: annotate RCU pointers Muhammad Usama Anjum
@ 2021-03-12 18:17 ` Paolo Bonzini
0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2021-03-12 18:17 UTC (permalink / raw)
To: Muhammad Usama Anjum, Sean Christopherson, Vitaly Kuznetsov,
Wanpeng Li, Jim Mattson, Joerg Roedel, Thomas Gleixner,
Ingo Molnar, Borislav Petkov, x86, H. Peter Anvin, linux-kernel
On 05/03/21 20:11, Muhammad Usama Anjum wrote:
> This patch adds the annotation to fix the following sparse errors:
> arch/x86/kvm//x86.c:8147:15: error: incompatible types in comparison expression (different address spaces):
> arch/x86/kvm//x86.c:8147:15: struct kvm_apic_map [noderef] __rcu *
> arch/x86/kvm//x86.c:8147:15: struct kvm_apic_map *
> arch/x86/kvm//x86.c:10628:16: error: incompatible types in comparison expression (different address spaces):
> arch/x86/kvm//x86.c:10628:16: struct kvm_apic_map [noderef] __rcu *
> arch/x86/kvm//x86.c:10628:16: struct kvm_apic_map *
> arch/x86/kvm//x86.c:10629:15: error: incompatible types in comparison expression (different address spaces):
> arch/x86/kvm//x86.c:10629:15: struct kvm_pmu_event_filter [noderef] __rcu *
> arch/x86/kvm//x86.c:10629:15: struct kvm_pmu_event_filter *
> arch/x86/kvm//lapic.c:267:15: error: incompatible types in comparison expression (different address spaces):
> arch/x86/kvm//lapic.c:267:15: struct kvm_apic_map [noderef] __rcu *
> arch/x86/kvm//lapic.c:267:15: struct kvm_apic_map *
> arch/x86/kvm//lapic.c:269:9: error: incompatible types in comparison expression (different address spaces):
> arch/x86/kvm//lapic.c:269:9: struct kvm_apic_map [noderef] __rcu *
> arch/x86/kvm//lapic.c:269:9: struct kvm_apic_map *
> arch/x86/kvm//lapic.c:637:15: error: incompatible types in comparison expression (different address spaces):
> arch/x86/kvm//lapic.c:637:15: struct kvm_apic_map [noderef] __rcu *
> arch/x86/kvm//lapic.c:637:15: struct kvm_apic_map *
> arch/x86/kvm//lapic.c:994:15: error: incompatible types in comparison expression (different address spaces):
> arch/x86/kvm//lapic.c:994:15: struct kvm_apic_map [noderef] __rcu *
> arch/x86/kvm//lapic.c:994:15: struct kvm_apic_map *
> arch/x86/kvm//lapic.c:1036:15: error: incompatible types in comparison expression (different address spaces):
> arch/x86/kvm//lapic.c:1036:15: struct kvm_apic_map [noderef] __rcu *
> arch/x86/kvm//lapic.c:1036:15: struct kvm_apic_map *
> arch/x86/kvm//lapic.c:1173:15: error: incompatible types in comparison expression (different address spaces):
> arch/x86/kvm//lapic.c:1173:15: struct kvm_apic_map [noderef] __rcu *
> arch/x86/kvm//lapic.c:1173:15: struct kvm_apic_map *
> arch/x86/kvm//pmu.c:190:18: error: incompatible types in comparison expression (different address spaces):
> arch/x86/kvm//pmu.c:190:18: struct kvm_pmu_event_filter [noderef] __rcu *
> arch/x86/kvm//pmu.c:190:18: struct kvm_pmu_event_filter *
> arch/x86/kvm//pmu.c:251:18: error: incompatible types in comparison expression (different address spaces):
> arch/x86/kvm//pmu.c:251:18: struct kvm_pmu_event_filter [noderef] __rcu *
> arch/x86/kvm//pmu.c:251:18: struct kvm_pmu_event_filter *
> arch/x86/kvm//pmu.c:522:18: error: incompatible types in comparison expression (different address spaces):
> arch/x86/kvm//pmu.c:522:18: struct kvm_pmu_event_filter [noderef] __rcu *
> arch/x86/kvm//pmu.c:522:18: struct kvm_pmu_event_filter *
> arch/x86/kvm//pmu.c:522:18: error: incompatible types in comparison expression (different address spaces):
> arch/x86/kvm//pmu.c:522:18: struct kvm_pmu_event_filter [noderef] __rcu *
> arch/x86/kvm//pmu.c:522:18: struct kvm_pmu_event_filter *
>
> Signed-off-by: Muhammad Usama Anjum <musamaanjum@gmail.com>
> ---
> arch/x86/include/asm/kvm_host.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
> index 84499aad01a4..ad675c8c05e7 100644
> --- a/arch/x86/include/asm/kvm_host.h
> +++ b/arch/x86/include/asm/kvm_host.h
> @@ -958,7 +958,7 @@ struct kvm_arch {
> struct kvm_pit *vpit;
> atomic_t vapics_in_nmi_mode;
> struct mutex apic_map_lock;
> - struct kvm_apic_map *apic_map;
> + struct kvm_apic_map __rcu *apic_map;
> atomic_t apic_map_dirty;
>
> bool apic_access_page_done;
> @@ -1030,7 +1030,7 @@ struct kvm_arch {
>
> bool bus_lock_detection_enabled;
>
> - struct kvm_pmu_event_filter *pmu_event_filter;
> + struct kvm_pmu_event_filter __rcu *pmu_event_filter;
> struct task_struct *nx_lpage_recovery_thread;
>
> #ifdef CONFIG_X86_64
>
Queued, thanks.
Paolo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-12 18:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05 19:11 [PATCH] kvm: x86: annotate RCU pointers Muhammad Usama Anjum
2021-03-12 18:17 ` Paolo Bonzini
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).