linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Safonov <0x7f454c46@gmail.com>
To: Kyle Huey <me@kylehuey.com>
Cc: "Robert O'Callahan" <robert@ocallahan.org>,
	open list <linux-kernel@vger.kernel.org>,
	Borislav Petkov <bp@suse.de>, Andy Lutomirski <luto@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
	<x86@kernel.org>, Al Viro <viro@zeniv.linux.org.uk>,
	Milosz Tanski <milosz@adfin.com>,
	"Dmitry V. Levin" <ldv@altlinux.org>,
	David Howells <dhowells@redhat.com>, Zach Brown <zab@redhat.com>,
	Eric B Munson <emunson@akamai.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Jiri Slaby <jslaby@suse.cz>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Borislav Petkov <bp@alien8.de>,
	Dmitry Vyukov <dvyukov@google.com>,
	Dmitry Safonov <dsafonov@virtuozzo.com>,
	Mateusz Guzik <mguzik@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>
Subject: Re: [RESEND][PATCH v2 1/3] syscalls,x86 Expose arch_prctl on x86-32.
Date: Thu, 15 Sep 2016 01:29:53 +0300	[thread overview]
Message-ID: <CAJwJo6YORjYvqBsvFdocNMvbRaa01ETQ1BVaEoK=ks9iFkCu9A@mail.gmail.com> (raw)
In-Reply-To: <CAP045AozcZ_F5dpJ0NfQvBc-_F0d36JkyS_kdo2Xtjb=ixh7Rg@mail.gmail.com>

2016-09-15 1:08 GMT+03:00 Kyle Huey <me@kylehuey.com>:
> On Wed, Sep 14, 2016 at 2:59 PM, Dmitry Safonov <0x7f454c46@gmail.com> wrote:
>> 2016-09-15 0:08 GMT+03:00 Kyle Huey <me@kylehuey.com>:
>>> Signed-off-by: Kyle Huey <khuey@kylehuey.com>
>>> ---
>>>  arch/x86/entry/syscalls/syscall_32.tbl |  1 +
>>>  arch/x86/kernel/process.c              | 80 ++++++++++++++++++++++++++++++++++
>>>  arch/x86/kernel/process_64.c           | 66 ----------------------------
>>>  3 files changed, 81 insertions(+), 66 deletions(-)
>>>
>>> diff --git a/arch/x86/entry/syscalls/syscall_32.tbl b/arch/x86/entry/syscalls/syscall_32.tbl
>>> index f848572..3b6965b 100644
>>> --- a/arch/x86/entry/syscalls/syscall_32.tbl
>>> +++ b/arch/x86/entry/syscalls/syscall_32.tbl
>>> @@ -386,3 +386,4 @@
>>>  377    i386    copy_file_range         sys_copy_file_range
>>>  378    i386    preadv2                 sys_preadv2                     compat_sys_preadv2
>>>  379    i386    pwritev2                sys_pwritev2                    compat_sys_pwritev2
>>> +380    i386    arch_prctl              sys_arch_prctl
>>
>> Why not define it as other 32-bit syscalls with compat_sys_ prefix
>> with the help of COMPAT_SYSCALL_DEFINE() macro?
>> Then you could omit code moving, drop is_32 helper.
>> I miss something obvious?
>
> The code will have to move regardless, because right now do_arch_prctl
> is in process-64.c which is only compiled on a 64 bit kernel.

Why? This code will not work anyway for 32-bit in your patches
by obscuring it with is_32.

> As I told Dave Hansen in the non-RESEND thread (not sure why
> git-send-email didn't put him in this one ...) I considered doing a
> compat_sys_arch_prctl that would reject the relevant arch_prctls that
> don't apply on 32 bit but I didn't see any prior art for it (in my
> admittedly non-exhaustive search).

Well, you could just add to 64-bit do_arch_prctl() new cases for your
prctls - that would be just a two-lines for each new prctl.
Also add compat_sys_ and define *only* what's needed there for you,
do not add there ARCH_{SET,GET}_{FS,GS}.
Does this make sense?

-- 
             Dmitry

  reply	other threads:[~2016-09-14 22:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14 21:08 [RESEND][PATCH v2] arch_prctl,x86 Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction Kyle Huey
2016-09-14 21:08 ` [RESEND][PATCH v2 1/3] syscalls,x86 Expose arch_prctl on x86-32 Kyle Huey
2016-09-14 21:59   ` Dmitry Safonov
2016-09-14 22:08     ` Kyle Huey
2016-09-14 22:29       ` Dmitry Safonov [this message]
2016-09-15  1:01         ` Kyle Huey
2016-09-14 21:08 ` [RESEND][PATCH v2 2/3] x86 Test and expose CPUID faulting capabilities in /proc/cpuinfo Kyle Huey
2016-09-14 21:08 ` [RESEND][PATCH v2 3/3] x86,arch_prctl Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction Kyle Huey
2016-09-14 21:10 ` [PATCH (man-pages)] arch_prctl.2: Note new support on x86-32, ARCH_[GET|SET]_CPUID Kyle Huey

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='CAJwJo6YORjYvqBsvFdocNMvbRaa01ETQ1BVaEoK=ks9iFkCu9A@mail.gmail.com' \
    --to=0x7f454c46@gmail.com \
    --cc=aryabinin@virtuozzo.com \
    --cc=bp@alien8.de \
    --cc=bp@suse.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dhowells@redhat.com \
    --cc=dsafonov@virtuozzo.com \
    --cc=dvyukov@google.com \
    --cc=emunson@akamai.com \
    --cc=hpa@zytor.com \
    --cc=jslaby@suse.cz \
    --cc=ldv@altlinux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=me@kylehuey.com \
    --cc=mguzik@redhat.com \
    --cc=milosz@adfin.com \
    --cc=mingo@redhat.com \
    --cc=mst@redhat.com \
    --cc=paul.gortmaker@windriver.com \
    --cc=peterz@infradead.org \
    --cc=robert@ocallahan.org \
    --cc=tglx@linutronix.de \
    --cc=viro@zeniv.linux.org.uk \
    --cc=x86@kernel.org \
    --cc=zab@redhat.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;
as well as URLs for NNTP newsgroup(s).