From: Marc Zyngier <marc.zyngier@arm.com>
To: Will Deacon <will.deacon@arm.com>,
Agustin Vega-Frias <agustinv@codeaurora.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Jeremy Linton <jeremy.linton@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
timur@codeaurora.org
Subject: Re: [RFC V2 3/3] perf: qcom: Add Falkor CPU PMU IMPLEMENTATION DEFINED event support
Date: Wed, 13 Jun 2018 13:59:58 +0100 [thread overview]
Message-ID: <06c81a64-904f-59fa-5751-62818d6d2107@arm.com> (raw)
In-Reply-To: <20180613103555.GC26280@arm.com>
On 13/06/18 11:35, Will Deacon wrote:
> On Tue, Jun 12, 2018 at 04:41:32PM -0400, Agustin Vega-Frias wrote:
>> Hi Mark,
>>
>> On 2018-06-12 10:40, Mark Rutland wrote:
>>> Hi,
>>>
>>> On Thu, Jun 07, 2018 at 09:56:48AM -0400, Agustin Vega-Frias wrote:
>>>> Selection of these events can be envisioned as indexing them from
>>>> a 3D matrix:
>>>> - the first index selects a Region Event Selection Register
>>>> (PMRESRx_EL0)
>>>> - the second index selects a group from which only one event at a time
>>>> can be selected
>>>> - the third index selects the event
>>>>
>>>> The event is encoded into perf_event_attr.config as 0xPRCCG, where:
>>>> P [config:16 ] = prefix (flag that indicates a matrix-based
>>>> event)
>>>> R [config:12-15] = register (specifies the PMRESRx_EL0 instance)
>>>> G [config:0-3 ] = group (specifies the event group)
>>>> CC [config:4-11 ] = code (specifies the event)
>>>>
>>>> Events with the P flag set to zero are treated as common PMUv3 events
>>>> and are directly programmed into PMXEVTYPERx_EL0.
>>>>
>>>> The first two indexes are set combining the RESR and group number with
>>>> a base number and writing it into the architected PMXEVTYPER_EL0
>>>> register.
>>>> The third index is set by writing the code into the bits corresponding
>>>> with the group into the appropriate IMPLEMENTATION DEFINED PMRESRx_EL0
>>>> register.
>>>
>>> When are the IMP DEF registers accessible at EL0? Are those goverend by
>>> the same controls as the architected registers?
>>
>> No, there is a separate IMP DEF register to control access.
>
> Great :( We need to make sure we disable EL0 access during boot then, but
> that means we need to prove for the existence of this thing in head.S
> (since the PMU driver might not get loaded).
>
> Also, what's the kvm story here so that we don't accidentally open up a
> VM-VM side-channel via these registers? How do the EL1 trapping controls
> work?
We'd trap the IMPDEF register access and inject an UNDEF (assuming that
the IMPDEF trapping works correctly). I have strictly no plan to support
this in a guest.
Thanks,
M.
--
Jazz is not dead. It just smells funny...
next prev parent reply other threads:[~2018-06-13 13:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-07 13:56 [RFC V2 0/3] arm_pmu: acpi: variant support and QCOM Falkor extensions Agustin Vega-Frias
2018-06-07 13:56 ` [RFC V2 1/3] ACPI: add support for sentinel-delimited probe tables Agustin Vega-Frias
2018-06-07 13:56 ` [RFC V2 2/3] arm_pmu: acpi: add support for CPU PMU variant detection Agustin Vega-Frias
2018-06-07 13:56 ` [RFC V2 3/3] perf: qcom: Add Falkor CPU PMU IMPLEMENTATION DEFINED event support Agustin Vega-Frias
2018-06-12 14:40 ` Mark Rutland
2018-06-12 20:41 ` Agustin Vega-Frias
2018-06-13 10:35 ` Will Deacon
2018-06-13 12:59 ` Marc Zyngier [this message]
2018-06-13 13:02 ` Will Deacon
2018-06-14 15:30 ` Agustin Vega-Frias
2018-06-13 13:05 ` Mark Rutland
2018-06-22 19:46 [RFC V3 0/3] arm_pmu: acpi: variant support and QCOM Falkor extensions Agustin Vega-Frias
2018-06-22 19:46 ` [RFC V2 3/3] perf: qcom: Add Falkor CPU PMU IMPLEMENTATION DEFINED event support Agustin Vega-Frias
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=06c81a64-904f-59fa-5751-62818d6d2107@arm.com \
--to=marc.zyngier@arm.com \
--cc=agustinv@codeaurora.org \
--cc=catalin.marinas@arm.com \
--cc=jeremy.linton@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=mark.rutland@arm.com \
--cc=timur@codeaurora.org \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®