Commit db6e7adf authored by Sean Christopherson's avatar Sean Christopherson Committed by Paolo Bonzini

KVM: SVM: Rename AVIC helpers to use "avic" prefix instead of "svm"

Use "avic" instead of "svm" for SVM's all of APICv hooks and make a few
additional funciton name tweaks so that the AVIC functions conform to
their associated kvm_x86_ops hooks.

No functional change intended.
Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
Message-Id: <20220128005208.4008533-19-seanjc@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 4e71cad3
...@@ -578,7 +578,7 @@ int avic_init_vcpu(struct vcpu_svm *svm) ...@@ -578,7 +578,7 @@ int avic_init_vcpu(struct vcpu_svm *svm)
return ret; return ret;
} }
void avic_post_state_restore(struct kvm_vcpu *vcpu) void avic_apicv_post_state_restore(struct kvm_vcpu *vcpu)
{ {
if (avic_handle_apic_id_update(vcpu) != 0) if (avic_handle_apic_id_update(vcpu) != 0)
return; return;
...@@ -586,20 +586,20 @@ void avic_post_state_restore(struct kvm_vcpu *vcpu) ...@@ -586,20 +586,20 @@ void avic_post_state_restore(struct kvm_vcpu *vcpu)
avic_handle_ldr_update(vcpu); avic_handle_ldr_update(vcpu);
} }
void svm_set_virtual_apic_mode(struct kvm_vcpu *vcpu) void avic_set_virtual_apic_mode(struct kvm_vcpu *vcpu)
{ {
return; return;
} }
void svm_hwapic_irr_update(struct kvm_vcpu *vcpu, int max_irr) void avic_hwapic_irr_update(struct kvm_vcpu *vcpu, int max_irr)
{ {
} }
void svm_hwapic_isr_update(struct kvm_vcpu *vcpu, int max_isr) void avic_hwapic_isr_update(struct kvm_vcpu *vcpu, int max_isr)
{ {
} }
static int svm_set_pi_irte_mode(struct kvm_vcpu *vcpu, bool activate) static int avic_set_pi_irte_mode(struct kvm_vcpu *vcpu, bool activate)
{ {
int ret = 0; int ret = 0;
unsigned long flags; unsigned long flags;
...@@ -631,7 +631,7 @@ static int svm_set_pi_irte_mode(struct kvm_vcpu *vcpu, bool activate) ...@@ -631,7 +631,7 @@ static int svm_set_pi_irte_mode(struct kvm_vcpu *vcpu, bool activate)
return ret; return ret;
} }
void svm_refresh_apicv_exec_ctrl(struct kvm_vcpu *vcpu) void avic_refresh_apicv_exec_ctrl(struct kvm_vcpu *vcpu)
{ {
struct vcpu_svm *svm = to_svm(vcpu); struct vcpu_svm *svm = to_svm(vcpu);
struct vmcb *vmcb = svm->vmcb01.ptr; struct vmcb *vmcb = svm->vmcb01.ptr;
...@@ -648,7 +648,7 @@ void svm_refresh_apicv_exec_ctrl(struct kvm_vcpu *vcpu) ...@@ -648,7 +648,7 @@ void svm_refresh_apicv_exec_ctrl(struct kvm_vcpu *vcpu)
* we need to check and update the AVIC logical APIC ID table * we need to check and update the AVIC logical APIC ID table
* accordingly before re-activating. * accordingly before re-activating.
*/ */
avic_post_state_restore(vcpu); avic_apicv_post_state_restore(vcpu);
vmcb->control.int_ctl |= AVIC_ENABLE_MASK; vmcb->control.int_ctl |= AVIC_ENABLE_MASK;
} else { } else {
vmcb->control.int_ctl &= ~AVIC_ENABLE_MASK; vmcb->control.int_ctl &= ~AVIC_ENABLE_MASK;
...@@ -660,15 +660,15 @@ void svm_refresh_apicv_exec_ctrl(struct kvm_vcpu *vcpu) ...@@ -660,15 +660,15 @@ void svm_refresh_apicv_exec_ctrl(struct kvm_vcpu *vcpu)
else else
avic_vcpu_put(vcpu); avic_vcpu_put(vcpu);
svm_set_pi_irte_mode(vcpu, activated); avic_set_pi_irte_mode(vcpu, activated);
} }
void svm_load_eoi_exitmap(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap) void avic_load_eoi_exitmap(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap)
{ {
return; return;
} }
bool svm_dy_apicv_has_pending_interrupt(struct kvm_vcpu *vcpu) bool avic_dy_apicv_has_pending_interrupt(struct kvm_vcpu *vcpu)
{ {
return false; return false;
} }
...@@ -770,7 +770,7 @@ get_pi_vcpu_info(struct kvm *kvm, struct kvm_kernel_irq_routing_entry *e, ...@@ -770,7 +770,7 @@ get_pi_vcpu_info(struct kvm *kvm, struct kvm_kernel_irq_routing_entry *e,
} }
/* /*
* svm_update_pi_irte - set IRTE for Posted-Interrupts * avic_pi_update_irte - set IRTE for Posted-Interrupts
* *
* @kvm: kvm * @kvm: kvm
* @host_irq: host irq of the interrupt * @host_irq: host irq of the interrupt
...@@ -778,8 +778,8 @@ get_pi_vcpu_info(struct kvm *kvm, struct kvm_kernel_irq_routing_entry *e, ...@@ -778,8 +778,8 @@ get_pi_vcpu_info(struct kvm *kvm, struct kvm_kernel_irq_routing_entry *e,
* @set: set or unset PI * @set: set or unset PI
* returns 0 on success, < 0 on failure * returns 0 on success, < 0 on failure
*/ */
int svm_update_pi_irte(struct kvm *kvm, unsigned int host_irq, int avic_pi_update_irte(struct kvm *kvm, unsigned int host_irq,
uint32_t guest_irq, bool set) uint32_t guest_irq, bool set)
{ {
struct kvm_kernel_irq_routing_entry *e; struct kvm_kernel_irq_routing_entry *e;
struct kvm_irq_routing_table *irq_rt; struct kvm_irq_routing_table *irq_rt;
...@@ -879,7 +879,7 @@ int svm_update_pi_irte(struct kvm *kvm, unsigned int host_irq, ...@@ -879,7 +879,7 @@ int svm_update_pi_irte(struct kvm *kvm, unsigned int host_irq,
return ret; return ret;
} }
bool svm_check_apicv_inhibit_reasons(ulong bit) bool avic_check_apicv_inhibit_reasons(ulong bit)
{ {
ulong supported = BIT(APICV_INHIBIT_REASON_DISABLE) | ulong supported = BIT(APICV_INHIBIT_REASON_DISABLE) |
BIT(APICV_INHIBIT_REASON_ABSENT) | BIT(APICV_INHIBIT_REASON_ABSENT) |
......
...@@ -4595,13 +4595,13 @@ static struct kvm_x86_ops svm_x86_ops __initdata = { ...@@ -4595,13 +4595,13 @@ static struct kvm_x86_ops svm_x86_ops __initdata = {
.enable_nmi_window = svm_enable_nmi_window, .enable_nmi_window = svm_enable_nmi_window,
.enable_irq_window = svm_enable_irq_window, .enable_irq_window = svm_enable_irq_window,
.update_cr8_intercept = svm_update_cr8_intercept, .update_cr8_intercept = svm_update_cr8_intercept,
.set_virtual_apic_mode = svm_set_virtual_apic_mode, .set_virtual_apic_mode = avic_set_virtual_apic_mode,
.refresh_apicv_exec_ctrl = svm_refresh_apicv_exec_ctrl, .refresh_apicv_exec_ctrl = avic_refresh_apicv_exec_ctrl,
.check_apicv_inhibit_reasons = svm_check_apicv_inhibit_reasons, .check_apicv_inhibit_reasons = avic_check_apicv_inhibit_reasons,
.load_eoi_exitmap = svm_load_eoi_exitmap, .load_eoi_exitmap = avic_load_eoi_exitmap,
.hwapic_irr_update = svm_hwapic_irr_update, .hwapic_irr_update = avic_hwapic_irr_update,
.hwapic_isr_update = svm_hwapic_isr_update, .hwapic_isr_update = avic_hwapic_isr_update,
.apicv_post_state_restore = avic_post_state_restore, .apicv_post_state_restore = avic_apicv_post_state_restore,
.set_tss_addr = svm_set_tss_addr, .set_tss_addr = svm_set_tss_addr,
.set_identity_map_addr = svm_set_identity_map_addr, .set_identity_map_addr = svm_set_identity_map_addr,
...@@ -4631,8 +4631,8 @@ static struct kvm_x86_ops svm_x86_ops __initdata = { ...@@ -4631,8 +4631,8 @@ static struct kvm_x86_ops svm_x86_ops __initdata = {
.nested_ops = &svm_nested_ops, .nested_ops = &svm_nested_ops,
.deliver_interrupt = svm_deliver_interrupt, .deliver_interrupt = svm_deliver_interrupt,
.dy_apicv_has_pending_interrupt = svm_dy_apicv_has_pending_interrupt, .dy_apicv_has_pending_interrupt = avic_dy_apicv_has_pending_interrupt,
.pi_update_irte = svm_update_pi_irte, .pi_update_irte = avic_pi_update_irte,
.setup_mce = svm_setup_mce, .setup_mce = svm_setup_mce,
.smi_allowed = svm_smi_allowed, .smi_allowed = svm_smi_allowed,
......
...@@ -577,16 +577,16 @@ int avic_unaccelerated_access_interception(struct kvm_vcpu *vcpu); ...@@ -577,16 +577,16 @@ int avic_unaccelerated_access_interception(struct kvm_vcpu *vcpu);
int avic_init_vcpu(struct vcpu_svm *svm); int avic_init_vcpu(struct vcpu_svm *svm);
void avic_vcpu_load(struct kvm_vcpu *vcpu, int cpu); void avic_vcpu_load(struct kvm_vcpu *vcpu, int cpu);
void avic_vcpu_put(struct kvm_vcpu *vcpu); void avic_vcpu_put(struct kvm_vcpu *vcpu);
void avic_post_state_restore(struct kvm_vcpu *vcpu); void avic_apicv_post_state_restore(struct kvm_vcpu *vcpu);
void svm_set_virtual_apic_mode(struct kvm_vcpu *vcpu); void avic_set_virtual_apic_mode(struct kvm_vcpu *vcpu);
void svm_refresh_apicv_exec_ctrl(struct kvm_vcpu *vcpu); void avic_refresh_apicv_exec_ctrl(struct kvm_vcpu *vcpu);
bool svm_check_apicv_inhibit_reasons(ulong bit); bool avic_check_apicv_inhibit_reasons(ulong bit);
void svm_load_eoi_exitmap(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap); void avic_load_eoi_exitmap(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap);
void svm_hwapic_irr_update(struct kvm_vcpu *vcpu, int max_irr); void avic_hwapic_irr_update(struct kvm_vcpu *vcpu, int max_irr);
void svm_hwapic_isr_update(struct kvm_vcpu *vcpu, int max_isr); void avic_hwapic_isr_update(struct kvm_vcpu *vcpu, int max_isr);
bool svm_dy_apicv_has_pending_interrupt(struct kvm_vcpu *vcpu); bool avic_dy_apicv_has_pending_interrupt(struct kvm_vcpu *vcpu);
int svm_update_pi_irte(struct kvm *kvm, unsigned int host_irq, int avic_pi_update_irte(struct kvm *kvm, unsigned int host_irq,
uint32_t guest_irq, bool set); uint32_t guest_irq, bool set);
void avic_vcpu_blocking(struct kvm_vcpu *vcpu); void avic_vcpu_blocking(struct kvm_vcpu *vcpu);
void avic_vcpu_unblocking(struct kvm_vcpu *vcpu); void avic_vcpu_unblocking(struct kvm_vcpu *vcpu);
void avic_ring_doorbell(struct kvm_vcpu *vcpu); void avic_ring_doorbell(struct kvm_vcpu *vcpu);
......
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