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] [day] [month] [year] [list]
Message-Id: <20220411134053.738799-1-sidongli1997@gmail.com>
Date:   Mon, 11 Apr 2022 21:40:53 +0800
From:   Dongli Si <kvmx86@...il.com>
To:     peterz@...radead.org
Cc:     acme@...nel.org, alexander.shishkin@...ux.intel.com, bp@...en8.de,
        dave.hansen@...ux.intel.com, hpa@...or.com, jolsa@...nel.org,
        joro@...tes.org, kim.phillips@....com, kvmx86@...il.com,
        liam.merwick@...cle.com, linux-kernel@...r.kernel.org,
        linux-perf-users@...r.kernel.org, mark.rutland@....com,
        mingo@...nel.org, namhyung@...nel.org, tglx@...utronix.de,
        x86@...nel.org
Subject: Re: [PATCH v4] perf/x86/amd: Don't touch the Host-only bit inside the guest hypervisor

On Fri, 1 Apr 2022 15:06:27 +0200, Peter Zijlstra wrote:
> If SVM enter/exit don't twiddle with counter EN bits, how is all this
> supposed to work consistently then?

Since KVM currently does not support the "Host/Guest Only" bits (41:40),
CPU wide events created on L1 HV will always count L1 HV and L2, so no
twiddle counter EN bits are needed when {dis,en}abling SVM on L1 HV.

This #GP warning is because KVM does not allow guest to set HO/GO bit,
It has been fixed in this commit 9b026073db2f
("KVM: x86/svm: Clear reserved bits written to PerfEvtSeln MSRs")
and has been merged to 5.18-rc1.

Because the commit df51fe7ea1c1c
("perf/x86/amd: Don't touch the AMD64_EVENTSEL_HOSTONLY bit inside the guest")
is to fix a very similar problem caused by the same reason,
I think it should be revert now, it make things obscure.

And perf_ctr_virt_mask is used to mask Host-Only bit when SVM is disabled,
Using it on a guest doesn't make sense and make things obscure.

I wrote a patch to clarifies what perf_ctr_virt_mask does.

Regards,
Dongli

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ