[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YuvfHZLGbU08S4ee@google.com>
Date: Thu, 4 Aug 2022 15:00:45 +0000
From: Sean Christopherson <seanjc@...gle.com>
To: Like Xu <like.xu.linux@...il.com>
Cc: Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org, Paolo Bonzini <pbonzini@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH v2 7/7] KVM: VMX: Simplify capability check when handling
PERF_CAPABILITIES write
On Thu, Aug 04, 2022, Like Xu wrote:
> On 4/8/2022 3:26 am, Sean Christopherson wrote:
> > Explicitly check for the absence of host support for LBRs or PEBS when
> > userspace attempts to enable said features by writing PERF_CAPABILITIES.
> > Comparing host support against the incoming value is unnecessary and
> > weird since the checks are buried inside an if-statement that verifies
> > userspace wants to enable the feature.
>
> If you mean this part in the KVM:
>
> case MSR_IA32_PERF_CAPABILITIES: {
> ...
> if (data & ~msr_ent.data)
> return 1;
> ...
>
> then this patch brings a flaw, for example:
>
> a user space can successfully set 0x1 on a host that reports a value of 0x5,
> which should not happen since the semantics of 0x1 and 0x5 for LBR_FMT
> may be completely different from the guest LBR driver's perspective.
/facepalm
I keep forgetting the caps need to match the host exactly. Thanks!
Powered by blists - more mailing lists