poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] Add io space MMAP for memory mapping devices and files


From: Andreas Klinger
Subject: Re: [PATCH v2] Add io space MMAP for memory mapping devices and files
Date: Sat, 6 Jan 2024 20:42:48 +0100

Hi Jose,

"Jose E. Marchesi" <jemarch@gnu.org> schrieb am Sa, 06. Jan 20:14:
> > I think that the approach of patch v2 could be optimized by a .set alignment
> > variable for those guys who are aware of such hardware constraints on their
> > architecture and want to optimize this. But I would set the default to a 
> > value
> > which works for all, which is the size of the address bus.
> 
> I think it is perfectly ok to have IOD specific configuration
> parameters, sure.
> 
> Let's make it a Poke variable that the user can customize, plus a
> setting in the registry so the .set dot-command works on it.  I suppose
> it shall have the name mmap in it, like pk_mmap_alignment.  WDYT?

great. It makes sense to name it mmap as it only applies to mmap io spaces.

There is another topic related to this I want to discuss.

When the user selects the wrong pk_mmap_alignment there will be a SIGBUS signal
which in turn terminates the program poke.

How should we deal with this situation?

I see the following options:

1) Let the program terminate at it is now.

2) Write a signal handler only used by the functions in iod-dev-mmap.c which
recovers from the error and prints a nice error message indicating that there's
a problem with the bus alignment.

3) Add a generic signal handler to poke for hardware generated signals which
prints out the call stack for diagnose and eventually recovers from the error.
This handler could also be used for other unexpected SIGSEGV, SIGILL, SIGPIPE
and SIGFPE.

WDYT?

Andreas

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]