Skip to content

Commit

Permalink
hvf: Remove deprecated hv_vcpu_flush() calls
Browse files Browse the repository at this point in the history
When building on macOS 11 [*], we get:

  In file included from ../target/i386/hvf/hvf.c:59:
  ../target/i386/hvf/vmx.h:174:5: error: 'hv_vcpu_flush' is deprecated: first deprecated in macOS 11.0 - This API has no effect and always returns HV_UNSUPPORTED [-Werror,-Wdeprecated-declarations]
      hv_vcpu_flush(vcpu);
      ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Hypervisor.framework/Headers/hv.h:364:20: note: 'hv_vcpu_flush' has been explicitly marked deprecated here
  extern hv_return_t hv_vcpu_flush(hv_vcpuid_t vcpu)
                     ^

Since this call "has no effect", simply remove it ¯\_(ツ)_/¯

Not very useful deprecation doc:
https://developer.apple.com/documentation/hypervisor/1441386-hv_vcpu_flush

[*] Also 10.15 (Catalina):
    https://lore.kernel.org/qemu-devel/[email protected]/

Reviewed-by: Roman Bolshakov <[email protected]>
Tested-by: Roman Bolshakov <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
  • Loading branch information
philmd committed Mar 15, 2022
1 parent 40eab4d commit 2e84d85
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 5 deletions.
2 changes: 0 additions & 2 deletions target/i386/hvf/vmx.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ static inline void macvm_set_cr0(hv_vcpuid_t vcpu, uint64_t cr0)
wvmcs(vcpu, VMCS_GUEST_CR0, cr0 | CR0_NE_MASK | CR0_ET_MASK);

hv_vcpu_invalidate_tlb(vcpu);
hv_vcpu_flush(vcpu);
}

static inline void macvm_set_cr4(hv_vcpuid_t vcpu, uint64_t cr4)
Expand All @@ -172,7 +171,6 @@ static inline void macvm_set_cr4(hv_vcpuid_t vcpu, uint64_t cr4)
wvmcs(vcpu, VMCS_CR4_MASK, CR4_VMXE_MASK);

hv_vcpu_invalidate_tlb(vcpu);
hv_vcpu_flush(vcpu);
}

static inline void macvm_set_rip(CPUState *cpu, uint64_t rip)
Expand Down
1 change: 0 additions & 1 deletion target/i386/hvf/x86_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,4 @@ void vmx_handle_task_switch(CPUState *cpu, x68_segment_selector tss_sel, int rea
store_regs(cpu);

hv_vcpu_invalidate_tlb(cpu->hvf->fd);
hv_vcpu_flush(cpu->hvf->fd);
}
2 changes: 0 additions & 2 deletions target/i386/hvf/x86hvf.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ static void hvf_put_segments(CPUState *cpu_state)

hvf_set_segment(cpu_state, &seg, &env->ldt, false);
vmx_write_segment_descriptor(cpu_state, &seg, R_LDTR);

hv_vcpu_flush(cpu_state->hvf->fd);
}

void hvf_put_msrs(CPUState *cpu_state)
Expand Down

0 comments on commit 2e84d85

Please sign in to comment.