lkml.org 
[lkml]   [2023]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] KVM: x86: vPMU: truncate counter value to allowed width
From
On Fri, Jun 30, 2023, Roman Kagan wrote:
> On Thu, Jun 29, 2023 at 05:11:06PM -0700, Sean Christopherson wrote:
> > @@ -74,6 +74,14 @@ static inline u64 pmc_read_counter(struct kvm_pmc *pmc)
> > return counter & pmc_bitmask(pmc);
> > }
> >
> > +static inline void pmc_write_counter(struct kvm_pmc *pmc, u64 val)
> > +{
> > + if (pmc->perf_event && !pmc->is_paused)
> > + perf_event_set_count(pmc->perf_event, val);
> > +
> > + pmc->counter = val;
>
> Doesn't this still have the original problem of storing wider value than
> allowed?

Yes, this was just to fix the counter offset weirdness. My plan is to apply your
patch on top. Sorry for not making that clear.

\
 
 \ /
  Last update: 2023-06-30 16:30    [W:0.153 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site