Re: git: e3572eb65473 - main - Allocate event for DMC-620 and CMN-600 controllers PMU. Add events supported by DMC-620 and CMN-600 controllers PMU.

From: Jessica Clarke <jrtc27_at_freebsd.org>
Date: Mon, 27 Jun 2022 00:51:15 UTC
On 27 Jun 2022, at 01:26, Bjoern A. Zeeb <bz@FreeBSD.org> wrote:
> 
> On Mon, 27 Jun 2022, Jessica Clarke wrote:
> 
>> On 26 Jun 2022, at 23:17, Toomas Soome <tsoome@FreeBSD.org> wrote:
>>> 
>>> The branch main has been updated by tsoome:
>>> 
>>> URL: https://cgit.FreeBSD.org/src/commit/?id=e3572eb654733a94e1e765fe9e95e0579981d851
>>> 
>>> commit e3572eb654733a94e1e765fe9e95e0579981d851
>>> Author: Aleksandr Rybalko <ray@freebsd.org>
>>> AuthorDate: 2022-02-16 00:19:19 +0000
>>> Commit: Toomas Soome <tsoome@FreeBSD.org>
>>> CommitDate: 2022-06-26 18:52:26 +0000
>>> 
>>> Allocate event for DMC-620 and CMN-600 controllers PMU. Add events supported by DMC-620 and CMN-600 controllers PMU.
>>> 
>>> Allocate event for DMC-620 and CMN-600 controllers PMU.
>>> Add events supported by DMC-620 and CMN-600 controllers PMU.
>>> 
>>> Reviewed by: bz
>>> Sponsored By: ARM
>>> Sponsored By: Ampere Computing
>>> Differential Revision: https://reviews.freebsd.org/D35609
>> 
>> This includes the following (skipped due to lines) diff:
>> 
>>> * 0x14100	0x0100		ARMv8 events
>>> + * 0x14200	0x0020		ARM DMC-620 clkdiv2 events
>>> + * 0x14220	0x0080		ARM DMC-620 clk events
>>> + * 0x14300	0x0100		ARM CMN-600 events
>> 
>> 
>> Not enough space was allocated for Armv8 events as it goes up to 0x3ff
>> in Armv8 (and beyond in later versions of the architecture). Downstream
>> we extend this range in CheriBSD as required for Morello’s events.
>> Please relocate these new events well past the end of the existing
>> Armv8 events so the space can remain contiguous.
> 
> Should this be 0x3ff then as well btw?
> https://github.com/CTSRD-CHERI/cheribsd/commit/4ea869cd8b717ca0b07672eb7acc99bf949249de

Well, 0x400 for count not max, but yes. We only extended as far as we
needed, not to cover the entire range (but intended to eventually
upstream it as the full v8 range).

> Looking more closely it seems from ARMv8.1 onwards it goes up to 0xFFFF
> if I read 'Table D8-7 Allocation of the PMU event number space' of ARM
> DDI 0487H.a correctly?

Yes, if you want to cover all the v8.1 space then you need to go that
high too, but it’ll get quite sparse in that range so it’s unclear if
we want to go ahead and do that already or try and be smarter (the
current EVENT_xH list would get a bit silly). We should probably
reserve all of it though at least so we can if we want to in future.

Jess

> So we should bump this to 0x15000 at least and use that space for
> other events?
> 
> I wonder if anyone will do the 700 soon as well?
> 
> /bz
> 
> -- 
> Bjoern A. Zeeb r15:7