lbr_desc
struct lbr_desc *lbr_desc = vcpu_to_lbr_desc(vcpu);
if (!lbr_desc)
if (lbr_desc->event) {
perf_event_release_kernel(lbr_desc->event);
lbr_desc->event = NULL;
struct lbr_desc *lbr_desc = vcpu_to_lbr_desc(vcpu);
if (WARN_ON_ONCE(!lbr_desc))
if (unlikely(lbr_desc->event)) {
lbr_desc->event = event;
struct lbr_desc *lbr_desc = vcpu_to_lbr_desc(vcpu);
if (!lbr_desc->event && intel_pmu_create_guest_lbr_event(vcpu) < 0)
if (lbr_desc->event->state == PERF_EVENT_STATE_ACTIVE) {
static struct lbr_desc *vcpu_to_lbr_desc(struct kvm_vcpu *vcpu)
return &to_vmx(vcpu)->lbr_desc;
struct lbr_desc *lbr_desc = vcpu_to_lbr_desc(vcpu);
if (!lbr_desc)
memset(&lbr_desc->records, 0, sizeof(lbr_desc->records));
if (KVM_BUG_ON(lbr_desc->msr_passthrough, vcpu->kvm))
return &to_vmx(vcpu)->lbr_desc.records;
memcpy(&lbr_desc->records, &vmx_lbr_caps, sizeof(vmx_lbr_caps));
lbr_desc->records.nr = 0;
if (lbr_desc->records.nr)
struct lbr_desc *lbr_desc = vcpu_to_lbr_desc(vcpu);
if (!lbr_desc)
lbr_desc->records.nr = 0;
lbr_desc->event = NULL;
lbr_desc->msr_passthrough = false;
struct lbr_desc *lbr_desc = vcpu_to_lbr_desc(vcpu);
if (!lbr_desc->msr_passthrough)
lbr_desc->msr_passthrough = false;
struct lbr_desc *lbr_desc = vcpu_to_lbr_desc(vcpu);
if (lbr_desc->msr_passthrough)
lbr_desc->msr_passthrough = true;
struct lbr_desc *lbr_desc = vcpu_to_lbr_desc(vcpu);
if (WARN_ON_ONCE(!lbr_desc))
if (!lbr_desc->event) {
if (lbr_desc->event->state < PERF_EVENT_STATE_ACTIVE) {
if (intel_pmu_lbr_is_enabled(vcpu) && !to_vmx(vcpu)->lbr_desc.event &&
struct lbr_desc lbr_desc;