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: <YEkM4HWqjMdPoXvR@google.com>
Date:   Wed, 10 Mar 2021 10:16:00 -0800
From:   Sean Christopherson <seanjc@...gle.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Borislav Petkov <bp@...en8.de>, x86@...nel.org,
        Paolo Bonzini <pbonzini@...hat.com>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        "H. Peter Anvin" <hpa@...or.com>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Jim Mattson <jmattson@...gle.com>,
        Joerg Roedel <joro@...tes.org>, linux-kernel@...r.kernel.org,
        kvm@...r.kernel.org, Like Xu <like.xu@...ux.intel.com>,
        Dmitry Vyukov <dvyukov@...gle.com>,
        syzbot+cce9ef2dd25246f815ee@...kaller.appspotmail.com
Subject: Re: [PATCH v2] x86/perf: Use RET0 as default for guest_get_msrs to
 handle "no PMU" case

On Wed, Mar 10, 2021, Peter Zijlstra wrote:
> On Tue, Mar 09, 2021 at 09:10:19AM -0800, Sean Christopherson wrote:
> 
> > @@ -2024,9 +2021,6 @@ static int __init init_hw_perf_events(void)
> >  	if (!x86_pmu.read)
> >  		x86_pmu.read = _x86_pmu_read;
> >  
> > -	if (!x86_pmu.guest_get_msrs)
> > -		x86_pmu.guest_get_msrs = perf_guest_get_msrs_nop;
> 
> I suspect I might've been over eager here and we're now in trouble when
> *_pmu_init() clears x86_pmu.guest_get_msrs (like for instance on AMD).
> 
> When that happens we need to restore __static_call_return0, otherwise
> the following static_call_update() will patch in a NOP and RAX will be
> garbage again.
> 
> So I've taken the liberty to update the patch as below.

Doh, I managed to forget about that between v1 and v2, too.  Thanks much!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ