Commit 82c1ead0 authored by Vitaly Kuznetsov's avatar Vitaly Kuznetsov Committed by Paolo Bonzini

KVM: x86: hyper-v: Drop redundant 'ex' parameter from kvm_hv_flush_tlb()

'struct kvm_hv_hcall' has all the required information already,
there's no need to pass 'ex' additionally.

No functional change intended.

Cc: stable@vger.kernel.org # 5.14.x
Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20220222154642.684285-3-vkuznets@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 50e523dd
...@@ -1749,7 +1749,7 @@ struct kvm_hv_hcall { ...@@ -1749,7 +1749,7 @@ struct kvm_hv_hcall {
sse128_t xmm[HV_HYPERCALL_MAX_XMM_REGISTERS]; sse128_t xmm[HV_HYPERCALL_MAX_XMM_REGISTERS];
}; };
static u64 kvm_hv_flush_tlb(struct kvm_vcpu *vcpu, struct kvm_hv_hcall *hc, bool ex) static u64 kvm_hv_flush_tlb(struct kvm_vcpu *vcpu, struct kvm_hv_hcall *hc)
{ {
int i; int i;
gpa_t gpa; gpa_t gpa;
...@@ -1764,7 +1764,8 @@ static u64 kvm_hv_flush_tlb(struct kvm_vcpu *vcpu, struct kvm_hv_hcall *hc, bool ...@@ -1764,7 +1764,8 @@ static u64 kvm_hv_flush_tlb(struct kvm_vcpu *vcpu, struct kvm_hv_hcall *hc, bool
int sparse_banks_len; int sparse_banks_len;
bool all_cpus; bool all_cpus;
if (!ex) { if (hc->code == HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST ||
hc->code == HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE) {
if (hc->fast) { if (hc->fast) {
flush.address_space = hc->ingpa; flush.address_space = hc->ingpa;
flush.flags = hc->outgpa; flush.flags = hc->outgpa;
...@@ -2246,32 +2247,20 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu) ...@@ -2246,32 +2247,20 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu)
kvm_hv_hypercall_complete_userspace; kvm_hv_hypercall_complete_userspace;
return 0; return 0;
case HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST: case HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST:
if (unlikely(!hc.rep_cnt || hc.rep_idx)) {
ret = HV_STATUS_INVALID_HYPERCALL_INPUT;
break;
}
ret = kvm_hv_flush_tlb(vcpu, &hc, false);
break;
case HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE:
if (unlikely(hc.rep)) {
ret = HV_STATUS_INVALID_HYPERCALL_INPUT;
break;
}
ret = kvm_hv_flush_tlb(vcpu, &hc, false);
break;
case HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST_EX: case HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST_EX:
if (unlikely(!hc.rep_cnt || hc.rep_idx)) { if (unlikely(!hc.rep_cnt || hc.rep_idx)) {
ret = HV_STATUS_INVALID_HYPERCALL_INPUT; ret = HV_STATUS_INVALID_HYPERCALL_INPUT;
break; break;
} }
ret = kvm_hv_flush_tlb(vcpu, &hc, true); ret = kvm_hv_flush_tlb(vcpu, &hc);
break; break;
case HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE:
case HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX: case HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX:
if (unlikely(hc.rep)) { if (unlikely(hc.rep)) {
ret = HV_STATUS_INVALID_HYPERCALL_INPUT; ret = HV_STATUS_INVALID_HYPERCALL_INPUT;
break; break;
} }
ret = kvm_hv_flush_tlb(vcpu, &hc, true); ret = kvm_hv_flush_tlb(vcpu, &hc);
break; break;
case HVCALL_SEND_IPI: case HVCALL_SEND_IPI:
if (unlikely(hc.rep)) { if (unlikely(hc.rep)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment