git: eb15017f7d2e - stable/13 - vmm: Use VLAPIC_CTR* in more places.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 26 Jan 2023 22:11:47 UTC
The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=eb15017f7d2eaf24d5af48e8305649e9b79585ed commit eb15017f7d2eaf24d5af48e8305649e9b79585ed Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2022-11-18 18:00:59 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2023-01-26 21:45:34 +0000 vmm: Use VLAPIC_CTR* in more places. Reviewed by: corvink, markj Differential Revision: https://reviews.freebsd.org/D37155 (cherry picked from commit d030f941e63f5b20efa14833912aae29ff737fcf) --- sys/amd64/vmm/intel/vmx.c | 25 ++++++++++++------------- sys/amd64/vmm/io/vlapic.c | 9 ++++----- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c index ae9864343705..47e3be32c1b0 100644 --- a/sys/amd64/vmm/intel/vmx.c +++ b/sys/amd64/vmm/intel/vmx.c @@ -3703,15 +3703,15 @@ struct vlapic_vtx { #define VPR_PRIO_BIT(vpr) (1 << ((vpr) >> 4)) -#define VMX_CTR_PIR(vm, vcpuid, pir_desc, notify, vector, level, msg) \ +#define VMX_CTR_PIR(vlapic, pir_desc, notify, vector, level, msg) \ do { \ - VCPU_CTR2(vm, vcpuid, msg " assert %s-triggered vector %d", \ + VLAPIC_CTR2(vlapic, msg " assert %s-triggered vector %d", \ level ? "level" : "edge", vector); \ - VCPU_CTR1(vm, vcpuid, msg " pir0 0x%016lx", pir_desc->pir[0]); \ - VCPU_CTR1(vm, vcpuid, msg " pir1 0x%016lx", pir_desc->pir[1]); \ - VCPU_CTR1(vm, vcpuid, msg " pir2 0x%016lx", pir_desc->pir[2]); \ - VCPU_CTR1(vm, vcpuid, msg " pir3 0x%016lx", pir_desc->pir[3]); \ - VCPU_CTR1(vm, vcpuid, msg " notify: %s", notify ? "yes" : "no");\ + VLAPIC_CTR1(vlapic, msg " pir0 0x%016lx", pir_desc->pir[0]); \ + VLAPIC_CTR1(vlapic, msg " pir1 0x%016lx", pir_desc->pir[1]); \ + VLAPIC_CTR1(vlapic, msg " pir2 0x%016lx", pir_desc->pir[2]); \ + VLAPIC_CTR1(vlapic, msg " pir3 0x%016lx", pir_desc->pir[3]); \ + VLAPIC_CTR1(vlapic, msg " notify: %s", notify ? "yes" : "no"); \ } while (0) /* @@ -3769,8 +3769,8 @@ vmx_set_intr_ready(struct vlapic *vlapic, int vector, bool level) } } - VMX_CTR_PIR(vlapic->vm, vlapic->vcpuid, pir_desc, notify, vector, - level, "vmx_set_intr_ready"); + VMX_CTR_PIR(vlapic, pir_desc, notify, vector, level, + "vmx_set_intr_ready"); return (notify); } @@ -3830,8 +3830,7 @@ vmx_pending_intr(struct vlapic *vlapic, int *vecptr) if (ppr == 0) return (1); - VCPU_CTR1(vlapic->vm, vlapic->vcpuid, "HLT with non-zero PPR %d", - lapic->ppr); + VLAPIC_CTR1(vlapic, "HLT with non-zero PPR %d", lapic->ppr); vpr = 0; for (i = 3; i >= 0; i--) { @@ -3985,7 +3984,7 @@ vmx_inject_pir(struct vlapic *vlapic) vlapic_vtx = (struct vlapic_vtx *)vlapic; pir_desc = vlapic_vtx->pir_desc; if (atomic_cmpset_long(&pir_desc->pending, 1, 0) == 0) { - VCPU_CTR0(vlapic->vm, vlapic->vcpuid, "vmx_inject_pir: " + VLAPIC_CTR0(vlapic, "vmx_inject_pir: " "no posted interrupt pending"); return; } @@ -4055,7 +4054,7 @@ vmx_inject_pir(struct vlapic *vlapic) intr_status_new = (intr_status_old & 0xFF00) | rvi; if (intr_status_new > intr_status_old) { vmcs_write(VMCS_GUEST_INTR_STATUS, intr_status_new); - VCPU_CTR2(vlapic->vm, vlapic->vcpuid, "vmx_inject_pir: " + VLAPIC_CTR2(vlapic, "vmx_inject_pir: " "guest_intr_status changed from 0x%04x to 0x%04x", intr_status_old, intr_status_new); } diff --git a/sys/amd64/vmm/io/vlapic.c b/sys/amd64/vmm/io/vlapic.c index 76e3cd14a8f5..b3711685b70c 100644 --- a/sys/amd64/vmm/io/vlapic.c +++ b/sys/amd64/vmm/io/vlapic.c @@ -588,8 +588,7 @@ vlapic_process_eoi(struct vlapic *vlapic) } isrptr[idx] &= ~(1 << bitpos); vector = i * 32 + bitpos; - VCPU_CTR1(vlapic->vm, vlapic->vcpuid, "EOI vector %d", - vector); + VLAPIC_CTR1(vlapic, "EOI vector %d", vector); VLAPIC_CTR_ISR(vlapic, "vlapic_process_eoi"); vlapic->isrvec_stk_top--; vlapic_update_ppr(vlapic); @@ -600,7 +599,7 @@ vlapic_process_eoi(struct vlapic *vlapic) return; } } - VCPU_CTR0(vlapic->vm, vlapic->vcpuid, "Gratuitous EOI"); + VLAPIC_CTR0(vlapic, "Gratuitous EOI"); vmm_stat_incr(vlapic->vm, vlapic->vcpuid, VLAPIC_GRATUITOUS_EOI, 1); } @@ -915,8 +914,8 @@ vlapic_set_tpr(struct vlapic *vlapic, uint8_t val) struct LAPIC *lapic = vlapic->apic_page; if (lapic->tpr != val) { - VCPU_CTR2(vlapic->vm, vlapic->vcpuid, "vlapic TPR changed " - "from %#x to %#x", lapic->tpr, val); + VLAPIC_CTR2(vlapic, "vlapic TPR changed from %#x to %#x", + lapic->tpr, val); lapic->tpr = val; vlapic_update_ppr(vlapic); }