lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y8rQJf3ki8a1aRjW@google.com>
Date:   Fri, 20 Jan 2023 17:32:21 +0000
From:   Sean Christopherson <seanjc@...gle.com>
To:     "Liang, Kan" <kan.liang@...ux.intel.com>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        "H. Peter Anvin" <hpa@...or.com>, linux-perf-users@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Jianfeng Gao <jianfeng.gao@...el.com>,
        Andrew Cooper <Andrew.Cooper3@...rix.com>,
        Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH] perf/x86: KVM: Disable vPMU support on hybrid CPUs (host
 PMUs)

On Fri, Jan 20, 2023, Liang, Kan wrote:
> 
> On 2023-01-19 7:40 p.m., Sean Christopherson wrote:
> > Disable KVM support for virtualizing PMUs on hosts with hybrid PMUs until
> > KVM gains a sane way to enumeration the hybrid vPMU to userspace and/or
> > gains a mechanism to let userspace opt-in to the dangers of exposing a
> > hybrid vPMU to KVM guests.
> > 
> > Virtualizing a hybrid PMU, or at least part of a hybrid PMU, is possible,
> > but it requires userspace to pin vCPUs to pCPUs to prevent migrating a
> > vCPU between a big core and a little core, requires the VMM to accurately
> > enumerate the topology to the guest (if exposing a hybrid CPU to the
> > guest), and also requires the VMM to accurately enumerate the vPMU
> > capabilities to the guest.
> 
> Current kernel only return the common counters to KVM, which is
> available on both e-core and p-core. In theory, there should be no
> problem with the migration between cores. You don't have to pin vCPU.
> The only problem is that you probably can only use the architecture events.

And how exactly is KVM supposed to tell the guest that it can only use
architectural events?  I see CPUID bits that enumerate which architectural events
are supported, but I'm not seeing anything that says _only_ architectural events
are supported.

> There is nothing wrong for the information provided by the kernel. I
> think it should be a KVM issue (my guess is the CPUID enumeration.) we
> should fix rather than simply disable the PMU for entire hybrid machines.

I'm not arguing this isn't KVM's problem, and I'm all for proper enabling in KVM,
but I'm not seeing any patches being posted.  In the meantime, we've got bug reports
coming in about KVM guests having PMU problems on hybrid hosts, and a pile of
evidence that strongly suggests this isn't going to be fixed by a one-line patch.

Again, I'm not against enabling vPMU on hybrid CPUs, but AFAICT the enabling is
non-trivial and may require new uAPI to provide the necessary information to
userspace.  As a short term fix, and something that can be backported to stable
trees, I don't see a better alternative than disabling vPMU support.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ