[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK1hOcOQkMCLoXa+BOpguHMZfcDQUoG2-f3gcVBRZYnBMEnorw@mail.gmail.com>
Date: Mon, 9 Mar 2015 15:14:11 +0100
From: Denys Vlasenko <vda.linux@...glemail.com>
To: Andy Lutomirski <luto@...capital.net>
Cc: Denys Vlasenko <dvlasenk@...hat.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...nel.org>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>, Oleg Nesterov <oleg@...hat.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Alexei Starovoitov <ast@...mgrid.com>,
Will Drewry <wad@...omium.org>,
Kees Cook <keescook@...omium.org>, X86 ML <x86@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86: make 32-bit "emergency stack" better documented
On Mon, Mar 9, 2015 at 2:43 PM, Andy Lutomirski <luto@...capital.net> wrote:
>> /* Offset from the sysenter stack to tss.sp0 */
>> DEFINE(TSS_sysenter_sp0, offsetof(struct tss_struct, x86_tss.sp0) -
>> - sizeof(struct tss_struct));
>> + (offsetof(struct tss_struct, SYSENTER_stack_last_word) + 4));
>
> Is there no way to do this using sizeof to avoid having a "last_word" member.
sizeof of a structure member? IIRC in C sizeof can't be used for that.
You need to concoct a fictitious object, dereference its member
and take sizeof of _that_.
It would look horrible. Something like:
offsetof(struct tss_struct, SYSENTER_stack) +
sizeof(((struct tss_struct*)NULL)->SYSENTER_stack)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists