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: <CALMp9eQoKJg36AabLErekJ-U10-DkRHW=dn14q0bxQHh7XrGMQ@mail.gmail.com>
Date:   Thu, 4 Jun 2020 09:44:34 -0700
From:   Jim Mattson <jmattson@...gle.com>
To:     Paolo Bonzini <pbonzini@...hat.com>
Cc:     Sean Christopherson <sean.j.christopherson@...el.com>,
        "Xu, Like" <like.xu@...el.com>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Joerg Roedel <joro@...tes.org>, kvm list <kvm@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Like Xu <like.xu@...ux.intel.com>
Subject: Re: [PATCH] KVM: VMX: Always treat MSR_IA32_PERF_CAPABILITIES as a
 valid PMU MSR

On Thu, Jun 4, 2020 at 9:20 AM Paolo Bonzini <pbonzini@...hat.com> wrote:
>
> On 04/06/20 17:16, Sean Christopherson wrote:
> > On Thu, Jun 04, 2020 at 09:37:59AM +0800, Xu, Like wrote:
> >> On 2020/6/4 4:33, Sean Christopherson wrote:
> >>> Unconditionally return true when querying the validity of
> >>> MSR_IA32_PERF_CAPABILITIES so as to defer the validity check to
> >>> intel_pmu_{get,set}_msr(), which can properly give the MSR a pass when
> >>> the access is initiated from host userspace.
> >> Regardless of  the MSR is emulated or not, is it a really good assumption that
> >> the guest cpuids are not properly ready when we do initialization from host
> >> userspace
> >> ?
> >
> > I don't know if I would call it a "good assumption" so much as a "necessary
> > assumption".  KVM_{GET,SET}_MSRS are allowed, and must function correctly,
> > if they're called prior to KVM_SET_CPUID{2}.
>
> Generally speaking this is not the case for the PMU; get_gp_pmc for
> example depends on pmu->nr_arch_gp_counters which is initialized based
> on CPUID leaf 0xA.
>
> The assumption that this patch fixes is that you can blindly take the
> output of KVM_GET_MSR_INDEX_LIST and pass it to KVM_{GET,SET}_MSRS.

Is that an assumption or an invariant?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ