Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Jul 2006 12:57:52 -0700
From:      "Kip Macy" <kip.macy@gmail.com>
To:        "Tijl Coosemans" <tijl@ulyssis.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: i386 page fault clobbers error code in trap frame
Message-ID:  <b1fa29170607291257h43592826j75513b465074f115@mail.gmail.com>
In-Reply-To: <200607292110.37733.tijl@ulyssis.org>
References:  <200607292110.37733.tijl@ulyssis.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Looking at siginfo it isn't clear that there is a "right way" to
provide SIGSEGV, eva, and the error code.

_fault._trapno should contain the machine's  error code and si_signo
should contain SIGSEGV, and si_addr contains the faulting pc. Maybe
one could abuse si_code to contain eva. Sorry for asking a question
that has already been answered but where is eva being put currently?

typedef struct __siginfo {
        int     si_signo;               /* signal number */
        int     si_errno;               /* errno association */
        /*
         * Cause of signal, one of the SI_ macros or signal-specific
         * values, i.e. one of the FPE_... values for SIGFPE.  This
         * value is equivalent to the second argument to an old-style
         * FreeBSD signal handler.
         */
        int     si_code;                /* signal code */
        __pid_t si_pid;                 /* sending process */
        __uid_t si_uid;                 /* sender's ruid */
        int     si_status;              /* exit value */
        void    *si_addr;               /* faulting instruction */
        union sigval si_value;          /* signal value */
        union   {
                struct {
                        int     _trapno;/* machine specific trap code */
                } _fault;
/* .... */


On 7/29/06, Tijl Coosemans <tijl@ulyssis.org> wrote:
> I'm refering to the following two lines in sys/i386/i386/trap.c
>
> /* kludge to pass faulting virtual address to sendsig */
> frame->tf_err = eva;
>
> Isn't there some other way to do this? Wouldn't the address still be
> available in %cr2 inside sendsig? Or could there have been other page
> faults by then?
>
> The reason I'm asking this is that Wine wants to know the error code in
> case of a page fault (the No eXec bit (AMD) and the read/write bit
> specifically).
>
>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b1fa29170607291257h43592826j75513b465074f115>