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: <4d93a3de-c86d-454b-8a43-b24e62ea3be7@sirena.org.uk>
Date:   Thu, 23 Mar 2023 12:54:29 +0000
From:   Mark Brown <broonie@...nel.org>
To:     Anshuman Khandual <anshuman.khandual@....com>
Cc:     linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        will@...nel.org, catalin.marinas@....com, mark.rutland@....com,
        James Clark <james.clark@....com>,
        Rob Herring <robh@...nel.org>, Marc Zyngier <maz@...nel.org>,
        Suzuki Poulose <suzuki.poulose@....com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        linux-perf-users@...r.kernel.org
Subject: Re: [PATCH V9 00/10] arm64/perf: Enable branch stack sampling

On Thu, Mar 23, 2023 at 09:55:47AM +0530, Anshuman Khandual wrote:
> On 3/22/23 00:32, Mark Brown wrote:

> > document a requirement for those traps to be disabled now in case we
> > need them later, and do so during EL2 setup for KVM guests?  That could
> > always be done incrementally.

> Unlike all other instruction trap enable fields in SYS_HFGITR_EL2, these BRBE
> instructions ones are actually inverted in semantics i.e the particular fields
> need to be set for these traps to be disabled in EL2.

Right, for backwards compatibility all newly added fields are trap by
default.

> SYS_HFGITR_EL2.nBRBIALL
> SYS_HFGITR_EL2.nBRBINJ

> By default entire SYS_HFGITR_EL2 is set as cleared during init and that would
> prevent a guest from using BRBE.

It should prevent the host as well shouldn't it?  

> I guess something like the following (untested) needs to be done, to enable
> BRBE in guests.

> +       mrs     x1, id_aa64dfr0_el1
> +       ubfx    x1, x1, #ID_AA64DFR0_EL1_BRBE_SHIFT, #4
> +       cbz     x1, .Lskip_brbe_\@
> +       mov     x0, xzr
> +       orr     x0, x0, #HFGITR_EL2_nBRBIALL
> +       orr     x0, x0, #HFGITR_EL2_nBRBINJ
> +       msr_s   SYS_HFGITR_EL2, x0
> +
> +.Lskip_brbe_\@:

Yes, looks roughly what I'd expect.

> > I've got a patch adding the definition of that register to sysreg which
> > I should be sending shortly, no need to duplicate that effort.

> Sure, I assume you are moving the existing definition for SYS_HFGITR_EL2 along
> with all its fields from ../include/asm/sysreg.h to ../tools/sysreg. Right, it
> makes sense.

No fields at the minute but yes, like the other conversions.

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ