From: Ingo Molnar <mingo@kernel.org>
To: Dave Hansen <dave.hansen@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org, luto@kernel.org,
brgerst@gmail.com
Subject: Re: [PATCH] x86, syscalls: use SYSCALL_DEFINE() macros for sys_modify_ldt()
Date: Wed, 18 Oct 2017 15:17:47 +0200 [thread overview]
Message-ID: <20171018131747.xwte4c3oc5gt7yc5@gmail.com> (raw)
In-Reply-To: <20171017192231.72C327B4@viggo.jf.intel.com>
* Dave Hansen <dave.hansen@linux.intel.com> wrote:
>
> We do not have tracepoints for sys_modify_ldt() because we define
> it directly instead of using the normal SYSCALL_DEFINEx() macros.
>
> However, there is a reason sys_modify_ldt() does not use the macros:
> it has an 'int' return type instead of 'unsigned long'. This is
> a bug, but it's a bug cemented in the ABI.
>
> What does this mean? If we return -EINVAL from a function that
> returns 'int', we have 0x00000000ffffffea in %rax. But, if we
> return -EINVAL from a function returning 'unsigned long', we end
> up with 0xffffffffffffffea in %rax, which is wrong.
>
> To work around this and maintain the 'int' behavior while using
> the SYSCALL_DEFINEx() macros, so we add a cast to 'unsigned int'
> in both implementations of sys_modify_ldt().
>
> Cc: x86@kernel.org
> Cc: Andy Lutomirski <luto@kernel.org>
> Cc: Brian Gerst <brgerst@gmail.com>
I have added your:
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
let me know if that's OK.
Thanks,
Ingo
next prev parent reply other threads:[~2017-10-18 13:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-17 19:22 Dave Hansen
2017-10-17 22:01 ` Andy Lutomirski
2017-10-18 13:17 ` Ingo Molnar [this message]
2017-10-18 14:12 ` Dave Hansen
2017-10-18 14:30 ` Brian Gerst
2017-10-18 16:18 ` Ingo Molnar
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=20171018131747.xwte4c3oc5gt7yc5@gmail.com \
--to=mingo@kernel.org \
--cc=brgerst@gmail.com \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=x86@kernel.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
all inboxes | Powered by JetHome®