Re: Extending the number of PMP entries

Andrew Waterman

The situation hasn't changed: it has always been straightforward to write M-mode software to detect the number of PMP registers at runtime, relying on precise exceptions.  IMO, that means this stuff doesn't belong in the configuration structure, but lazier programmers disagree.

On Sun, May 24, 2020 at 7:53 PM Chang, Abner (HPS SW/FW Technologist) <abner.chang@...> wrote:

Just writing to confirm that there is no information regards to the # of PMP entries supported by hart mentioned in privilege spec . If my understanding is correct, then this information is good to go to RISC-V configurations structure.


-          Abner


From: tech-privileged@... [mailto:tech-privileged@...] On Behalf Of Andrew Waterman
Sent: Saturday, May 23, 2020 6:31 AM
To: Tariq Kurd <tariq.kurd@...>
Cc: tech-privileged@...
Subject: Re: [RISC-V] [tech-privileged] Extending the number of PMP entries


I've made a pull request to extend the number of PMP entries, and have attached the compiled PDF for convenience.  Feedback and error detection are appreciated: the fact that there used to be 16 PMP entries manifested in several places in the document.



On Fri, May 22, 2020 at 12:30 AM Tariq Kurd <tariq.kurd@...> wrote:

Hi Andrew,


That’s fine for me. Implementing 0 / 16 / 64 PMP entries is ok




From: Andrew Waterman [mailto:andrew@...]
Sent: 21 May 2020 17:50
To: Tariq Kurd <tariq.kurd@...>
Cc: tech-privileged@...
Subject: Re: [RISC-V] [tech-privileged] Extending the number of PMP entries




On Thu, May 21, 2020 at 8:17 AM Mr Tariq Kurd <tariq.kurd@...> wrote:

Hi everyone,


Can we allocate more CSRs so that we can have more PMP entries available? We already have one implementation which requires 20 PMP entries, for example.

Currently the CSR address space can allow up to 64 PMP entries (unless CSRs have been allocated which I don’t know about).

0x3A4 – 0x3AF could become pmpcfg4-15

0x3C0 – 0x3EF could become pmpaddr16-63


64 entries would be more than enough (I don’t envisage needing more than 32), but I don’t know about other users.


I’m happy to allocate the PMP entries in blocks of 16, for example, and make higher numbered unused entries read-only-zero to save area.

So in our case we would implement the CSRs for 32 entries, but entries 20-31 would be read-only-zero

The other option here is to allocate all 48 at once (and for your example 20-63 would be read-only-zero). This might be slightly easier for software portability and is neutral for HW cost.



What do people think?





Tariq Kurd

Processor Design I RISC-V Cores, Bristol

Tel: none I Mobile: +447711069063 I E-mail: Tariq.Kurd@...

Company: Huawei I Address: 160 Aztec West, Bristol, UK, BS32 4TU


This e-mail and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure,reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it !

本邮件及其附件含有华为公司的保密信息,仅限于发送给上面 地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件!



Join { to automatically receive all group messages.