public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "mikematic@privacy-mail.top" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug tdep/27015] ARC: "eret" value is collected from the wrong data in register cache
Date: Sat, 16 Oct 2021 00:06:21 +0000	[thread overview]
Message-ID: <bug-27015-4717-DRP4LFsgyS@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-27015-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=27015

Mikematics <mikematic@privacy-mail.top> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikematic@privacy-mail.top

--- Comment #25 from Mikematics <mikematic@privacy-mail.top> ---
I will have to get back to this later in the week.
I seem to get the feeling that No one has done this before.
Certainly not Microchip.
 asm("eret"); is a hack. but I guess it is why the default handler is in ASM.
Here is a list of other references you might want to check out.

Reference List:
https://infoguideghana.com/pounds-to-cedis-rate-today/
https://mikematics.com/saved-by-receipts-by-micheal-a-adeniyi/
https://infoguideghana.com/
https://ghanarecruitments.com/how-to-apply-for-ghana-immigration-service-recruitment/
https://infoguideghana.com/banks-in-ghana-and-their-sort-codes/
https://www.pedawan.net/
https://www.pedawan.net/category/entertainment/
https://mikematics.com/category/music-videos/
https://www.pedawan.net/category/lifestyle/
https://247hitz.com/
https://ghanarecruitments.com/
https://quotepeeps.com/
https://ghanarecruitments.com/category/recruitment-portals/
https://spotonnews.com/
https://newsankor.com/
https://mikematics.com
https://ictcatalogue.com

o, because either you are fine with the weak default _nmi_handler. Or it is
your responsibility to give a correct implementation of the _nmi_handler,
either as assembler or as .c code or a mixture of both, and it is your
responsibility to use the correct instructions depending on what you intend to
do. Either you are fine with the default prologue and epilogue and return
instruction or you have to do everything on your own. You can do whatever you
want and whatever you need, but you don't get any help.

For the other exception handlers, we got at least some help from the context
functions.

Speaking of those context functions, I start to get the impression that for a
returning and non-trivial NMI (which uses registers like v?/a?/t?/s?) you might
even need to save and restore any registers on your own. Because if those are
clobbered by the _nmi_handler there is nothing that restores them for the
normal program flow. The default prologue would save them, but if you are
having an assembler eret in the handler, you would skip the epilogue. So you
would need to implement something similar like the context functions or verify
that your nmi_handler does not clobber any register.

Is there nobody which has ever implemented a "continue from WTD / DMT timeout",
and maybe has that knowledge?



Meanwhile, I found in the "MIPS32 microAptiv UC Processor Core Family Software
User's Manual", that you definitely need an (optional) ERET for NMI Servicing.
It is in Figure 6.5 (see attached image). 

It seems, that at an NMI the processor completely resets, and goes through the
crt0.S startup code. That code first checks the NMI bit, and if it is set, it
jumps the _nmi_handler. 

Unfortunately, everything which tell you about the _nmi_handler, is the text
"NMI Service Code" inside a box with the dashed outline, followed by an arrow
to a box with ERET with the remark "(optional)".

Also, an eret corresponds to:
if SR[2]
  PC = ErrorEPC
else
  PC = EPC
SR[1] = 0
SR[2] = 0
LL = 0Note: We have SR[2] = STATUS register bit 2 = STATUS.ERL = Error level
bit = 1.


I really wonder whether maybe my previous suggestion is much easier

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2021-10-16  0:06 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04 15:04 [Bug tdep/27015] New: " shahab.vahedi at gmail dot com
2020-12-04 15:08 ` [Bug tdep/27015] " shahab.vahedi at gmail dot com
2020-12-04 15:10 ` tromey at sourceware dot org
2020-12-04 15:15 ` shahab.vahedi at gmail dot com
2021-06-27 17:52 ` ahmedsayeed1982 at yahoo dot com
2021-07-13  3:12 ` sherrixotyv29 at gmail dot com
2021-07-13  4:59 ` simark at simark dot ca
2021-08-09  9:35 ` phillipsaeverett84 at gmail dot com
2021-08-10 11:44 ` ucelsanicin at yahoo dot com
2021-08-20 15:56 ` kingjamescarl at gmail dot com
2021-08-20 15:56 ` kingjamescarl at gmail dot com
2021-08-20 16:05 ` mark at klomp dot org
2021-08-23  5:22 ` specification166din at gmail dot com
2021-09-02 11:06 ` donipah907 at mtlcz dot com
2021-09-05  7:36 ` kimolsun2020 at yahoo dot com
2021-09-06  9:08 ` focixujo at livinginsurance dot co.uk
2021-09-06  9:12 ` focixujo at livinginsurance dot co.uk
2021-09-10 19:36 ` mehmetgelisin at aol dot com
2021-09-14 12:54 ` jarilittlenen at yahoo dot com
2021-09-20  8:21 ` johnmartin1458 at gmail dot com
2021-09-20  8:22 ` johnmartin1458 at gmail dot com
2021-09-22  9:08 ` atifarif503 at gmail dot com
2021-09-22  9:08 ` atifarif503 at gmail dot com
2021-09-22 10:18 ` diheto5497 at secbuf dot com
2021-09-22 16:58 ` mervegunesli at aol dot com
2021-10-04  7:54 ` olivernicholle9052 at gmail dot com
2021-10-09 11:00 ` gulsenenginar at aol dot com
2021-10-09 17:51 ` svitvitraga at gmail dot com
2021-10-11  5:19 ` uzey67 at gmail dot com
2021-10-16  0:06 ` mikematic@privacy-mail.top [this message]
2021-10-18  8:09 ` pagefitzpatrick687 at gmail dot com
2021-10-18 19:58 ` ahmedsayeed1982 at hotmail dot com
2021-10-19  7:14 ` progonsaytu at gmail dot com
2021-10-19 13:34 ` bart@123-fietsen.nl
2021-10-19 13:49 ` peterverbaarschotrop at gmail dot com
2021-10-24 10:02 ` glassmtech at ukr dot net
2021-10-27  6:50 ` bathroomremodelrr at gmail dot com
2021-10-28  9:09 ` elpasotileinstallation at gmail dot com
2021-11-02  9:50 ` amosohxx90 at gmail dot com
2021-11-03  7:52 ` barronwbs85 at gmail dot com
2021-11-05  9:28 ` bertbxi85 at gmail dot com
2021-11-06 21:13 ` paneki8601 at dukeoo dot com
2021-11-08 11:49 ` richardsboyer67 at gmail dot com
2021-11-12 11:41 ` shannanalt11 at gmail dot com
2021-11-14 20:01 ` brickpavingcl at gmail dot com
2021-11-16 12:40 ` Uchemanuche at gmail dot com
2021-11-16 19:08 ` xecana8007 at funboxcn dot com
2021-11-16 19:15 ` xecana8007 at funboxcn dot com
2021-11-22 13:12 ` cheesecakesuperhuman at gmail dot com
2023-07-14 21:43 ` rleonard85 at gmail dot com

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=bug-27015-4717-DRP4LFsgyS@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).