Alpha arch development list
 help / color / mirror / Atom feed
From: Sergei Trofimovich <slyich@gmail.com>
To: linux-alpha@vger.kernel.org
Cc: Michael Cree <mcree@orcon.net.nz>,
	rth@twiddle.net, ink@jurassic.park.msu.ru, mattst88@gmail.com
Subject: Re: [PATCH] Alpha: unbreak osf_setsysinfo(SSI_NVPAIRS, [SSIN_UACPROC, UAC_SIGBUS])
Date: Sat, 13 Aug 2011 00:51:28 +0300	[thread overview]
Message-ID: <20110813005128.7644d5e4@sf.home> (raw)
In-Reply-To: <20110812125903.01e7bdf0@sf.home>

[-- Attachment #1: Type: text/plain, Size: 2453 bytes --]

> I'll build alpha toolchain / qemu root and will try to cook
> nicer patch with compile-time safety checks.

Sent reworked patch: http://marc.info/?l=linux-alpha&m=131318270531656&w=2

Yelling at the header I've found minor nit:
...
#define SET_UNALIGN_CTL(task,value)     ({                                   \
        task_thread_info(task)->flags = ((task_thread_info(task)->flags &    \
                ~ALPHA_UAC_MASK)
                | (((value) << ALPHA_UAC_SHIFT)       & (1<<TIF_UAC_NOPRINT))\
                | (((value) << (ALPHA_UAC_SHIFT + 1)) & (1<<TIF_UAC_SIGBUS)) \
                | (((value) << (ALPHA_UAC_SHIFT - 1)) & (1<<TIF_UAC_NOFIX)));\
        0; })

#define GET_UNALIGN_CTL(task,value)     ({                              \
        put_user((task_thread_info(task)->flags & (1 << TIF_UAC_NOPRINT))\
                  >> ALPHA_UAC_SHIFT                                    \
                 | (task_thread_info(task)->flags & (1 << TIF_UAC_SIGBUS))\
                 >> (ALPHA_UAC_SHIFT + 1)                               \
                 | (task_thread_info(task)->flags & (1 << TIF_UAC_NOFIX))\
                 >> (ALPHA_UAC_SHIFT - 1),                              \
                 (int __user *)(value));                                \
        })

The macros SET_UNALIGN_CTL/GET_UNALIGN_CTL are used
only in kernel/sys.c:prctl syscall.

> | (((value) << ALPHA_UAC_SHIFT)       & (1<<TIF_UAC_NOPRINT))
prctl.h: # define PR_UNALIGN_NOPRINT     1

> |  (((value) << (ALPHA_UAC_SHIFT + 1)) & (1<<TIF_UAC_SIGBUS))
prctl.h: # define PR_UNALIGN_SIGBUS      2

> | (((value) << (ALPHA_UAC_SHIFT - 1)) & (1<<TIF_UAC_NOFIX)));

prctl.h: no '4' value

Do you think it's worth adding to userspace interface
or should one just remove it from handled by prctl flags [ABI change]?

Thanks!

diff --git a/include/linux/prctl.h b/include/linux/prctl.h
index a3baeb2..f66539a 100644
--- a/include/linux/prctl.h
+++ b/include/linux/prctl.h
@@ -15,6 +15,7 @@
 #define PR_SET_UNALIGN   6
 # define PR_UNALIGN_NOPRINT    1       /* silently fix up unaligned user accesses */
 # define PR_UNALIGN_SIGBUS     2       /* generate SIGBUS on unaligned user access */
+# define PR_UNALIGN_NOFIX      4       /* skip offending instruction and do nothing */

 /* Get/set whether or not to drop capabilities on setuid() away from
  * uid 0 (as per security/commoncap.c) */

-- 

  Sergei

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2011-08-12 21:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-11 15:25 [PATCH] Alpha: unbreak osf_setsysinfo(SSI_NVPAIRS, [SSIN_UACPROC, UAC_SIGBUS]) slyich
2011-08-12  7:21 ` Michael Cree
2011-08-12  9:59   ` Sergei Trofimovich
2011-08-12 21:51     ` Sergei Trofimovich [this message]
2011-08-12 23:34       ` Michael Cree

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=20110813005128.7644d5e4@sf.home \
    --to=slyich@gmail.com \
    --cc=ink@jurassic.park.msu.ru \
    --cc=linux-alpha@vger.kernel.org \
    --cc=mattst88@gmail.com \
    --cc=mcree@orcon.net.nz \
    --cc=rth@twiddle.net \
    /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