public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
From: Ben Dooks <ben.dooks@codethink.co.uk>
To: Palmer Dabbelt <palmer@dabbelt.com>
Cc: linux-riscv@lists.infradead.org
Subject: Re: RFC: extern illegal instruction trap and trap RDCYCLE
Date: Tue, 17 Sep 2024 15:01:34 +0100	[thread overview]
Message-ID: <bab6f17a-3e39-4be4-a20e-bbdbbc2e81f8@codethink.co.uk> (raw)
In-Reply-To: <mhng-ac746ffc-8099-447d-a45f-772550f23290@palmer-ri-x1c9>

On 17/09/2024 14:46, Palmer Dabbelt wrote:
> On Tue, 17 Sep 2024 06:08:50 PDT (-0700), ben.dooks@codethink.co.uk wrote:
>> This is a RFC series to change how the illegal instruction trap
>> is handled and then how to trap RDCYCLE and emulate it with RDTIME
>> instead.
> 
> Only 1/3 made it to lore for me, not sure if it's just stuck somewhere.
> 
>>
>> I did this when we found multiple libraries using RDCYCLE and
>> upgrading multiple runners to newer kernels caused many problems
> 
> OK, so I think we're kind of just stuck with RDCYCLE then -- it was part 
> of the base ISA when we merged the port, and every time it disappears we 
> end up breaking userspace.

Yes, it was an annoyance, we managed to track down all the users and
patch out.

I thought this might be a useful idea for more generic type, so might
look at updating to have a table of instruction masks to call.

> I'm not sure what exactly the right way to do this is: IIRC there's some 
> perf-related hooks for this, but there's also systems that just don't 
> implement the RDCYCLE instruction at all and thus we'll need some sort 
> of emulation for those.

I couldn't get the PMU driver to allow it, not sure if there was an
issue higher up or some other issue?

> So hopefully the other two patches get through the lists at some point, 
> but I think in general this is a reasonable thing to do -- or I guess 
> maybe a completely unreasonable thing to be stuck needing to do, but no 
> way around it ;)

I'll check back later, currently as OSS-EU

>>
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
> 


-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

https://www.codethink.co.uk/privacy.html

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2024-09-17 14:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-17 13:08 RFC: extern illegal instruction trap and trap RDCYCLE Ben Dooks
2024-09-17 13:08 ` [PATCH 1/3] riscv: ptrace: add regs_set_register() Ben Dooks
2024-09-17 13:08 ` [PATCH 2/3] riscv: traps: make insn fetch common in unknown instruction Ben Dooks
2024-09-17 13:08 ` [PATCH 3/3] riscv: add trap and emulation for RDCYCLE Ben Dooks
2024-09-17 14:08   ` Ben Dooks
2024-09-18  6:45   ` Andrew Jones
2024-09-18  9:07     ` Ben Dooks
2024-09-18  9:15     ` Ben Dooks
2024-09-17 13:46 ` RFC: extern illegal instruction trap and trap RDCYCLE Palmer Dabbelt
2024-09-17 14:01   ` Ben Dooks [this message]
2024-09-18  9:55     ` Atish Patra
2024-09-18  9:57       ` Ben Dooks
2024-09-18 23:23         ` Atish Kumar Patra
2024-10-01  9:41           ` Alexandre Ghiti
2024-10-01 21:00             ` Ben Dooks
2024-10-01 21:07               ` Ben Dooks

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=bab6f17a-3e39-4be4-a20e-bbdbbc2e81f8@codethink.co.uk \
    --to=ben.dooks@codethink.co.uk \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.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