From: Paolo Bonzini <pbonzini@redhat.com>
To: Like Xu <like.xu.linux@gmail.com>
Cc: Sean Christopherson <seanjc@google.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND] KVM: x86/pmu: Make top-down.slots event unavailable in supported leaf
Date: Fri, 7 Jan 2022 17:59:49 +0100 [thread overview]
Message-ID: <b57f1785-e61f-20dd-49e1-76dfc1917df8@redhat.com> (raw)
In-Reply-To: <20220105050711.67280-1-likexu@tencent.com>
On 1/5/22 06:07, Like Xu wrote:
> + /*
> + * The 8th Intel pre-defined architectural event (Topdown Slots) will be supported
> + * if the 4th fixed counter exists && EAX[31:24] > 7 && EBX[7] = 0.
> + *
> + * Currently, KVM needs to set EAX[31:24] < 8 or EBX[7] == 1
> + * to make this event unavailable in a consistent way.
> + */
> + if (edx.split.num_counters_fixed < 4) {
> + if (eax.split.mask_length > 7)
> + eax.split.mask_length--;
> + if (eax.split.mask_length > 7)
> + cap.events_mask |= BIT_ULL(7);
> + }
> +
The first "> 7" is wrong; it should be == 8, shouldn't it? Something like
if (edx.split.num_counters_fixed < 4 && eax.split.mask_length >= 8) {
if (eax.split.mask_length == 8)
eax.split.mask_length--;
else
cap.events_mask |= BIT_ULL(7);
}
is what you mean, I think?
Paolo
prev parent reply other threads:[~2022-01-07 16:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-05 5:07 Like Xu
2022-01-05 21:09 ` Sean Christopherson
2022-01-07 16:59 ` Paolo Bonzini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b57f1785-e61f-20dd-49e1-76dfc1917df8@redhat.com \
--to=pbonzini@redhat.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=like.xu.linux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=seanjc@google.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome