Skip to contentSkip to conversation

x86/kvm: Remove unused virt to phys translation in kvm_guest_cpu_init()

PATCH Applied Rafael Mendonca 3 participants 3 messages Oct 21, 2022 – Oct 22, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/kvm: Remove unused virt to phys translation in kvm_guest_cpu_init()

Presumably, this was introduced due to a conflict resolution with commit ef68017eb570 ("x86/kvm: Handle async page faults directly through do_page_fault()"), given that the last posted version [1] of the blamed commit was not based on the aforementioned commit.

[1] https://lore.kernel.org/kvm/[email protected]/

Fixes b1d405751cd5 ("KVM: x86: Switch KVM guest to using interrupts for page ready APF delivery")
---
 arch/x86/kernel/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/kvm.c +1 -1
index d4e48b4a438b..cf886f86038a 100644
@@ -349,7 +349,7 @@ static notrace void kvm_guest_apic_eoi_write(u32 reg, u32 val)
 static void kvm_guest_cpu_init(void)
 {
 	if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF_INT) && kvmapf) {
-		u64 pa = slow_virt_to_phys(this_cpu_ptr(&apf_reason));
+		u64 pa;
 
 		WARN_ON_ONCE(!static_branch_likely(&kvm_async_pf_enabled));
 
Signature · 1 line
2.34.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Rafael Mendonca

Presumably, this was introduced due to a conflict resolution with commit ef68017eb570 ("x86/kvm: Handle async page faults directly through do_page_fault()"), given that the last posted version [1] of the blamed commit was not based on the aforementioned commit.

[1] https://lore.kernel.org/kvm/[email protected]/

Fixes b1d405751cd5 ("KVM: x86: Switch KVM guest to using interrupts for page ready APF delivery")

Indeed, this looks like a mid-air collision happened upon commit/merge.

Quoted 10 lines
---
 arch/x86/kernel/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/kvm.c +0 -0
index d4e48b4a438b..cf886f86038a 100644

arch/x86/kernel/kvm.c static notrace void kvm_guest_apic_eoi_write(u32 reg, u32 val) · line 354

Quoted 7 lines
arch/x86/kernel/kvm.c +1 -1
@@ -349,7 +349,7 @@ static notrace void kvm_guest_apic_eoi_write(u32 reg, u32 val)
 static void kvm_guest_cpu_init(void)
 {
 	if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF_INT) && kvmapf) {
-		u64 pa = slow_virt_to_phys(this_cpu_ptr(&apf_reason));
+		u64 pa;
 
 		WARN_ON_ONCE(!static_branch_likely(&kvm_async_pf_enabled));
Signature · 1 line
Vitaly