[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <C9BB696F3A938947B10DCAD29FAB8FFA66BB9450@CRSMSX101.amr.corp.intel.com>
Date: Thu, 31 May 2018 21:03:00 +0000
From: "Bae, Chang Seok" <chang.seok.bae@...el.com>
To: Andy Lutomirski <luto@...nel.org>
CC: "H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>,
Andi Kleen <ak@...ux.intel.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"Metzger, Markus T" <markus.t.metzger@...el.com>,
"Shankar, Ravi V" <ravi.v.shankar@...el.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH V2 01/15] x86/fsgsbase/64: Introduce FS/GS base helper
functions
>> Notion of "active" and "inactive" are used to distinguish
>> GS bases between "kernel" and "user". "inactive" GS base
>> is the GS base, backed up at kernel entries, of inactive
>> (user) task's.
> I'm fine with the code, but the changelog entry is confusing. A bunch
> of the active helpers don't contain the term "active".
Okay, will take "active" out from the note.
>> +/*
>> + * Read/write an (inactive) task's fsbase or gsbase. This returns
>> + * the value that the FS/GS base would have (if the task were to be
>> + * resumed). The current task is also supported.
>> + */
> Please change to "Read/write a task's fsbase or gsbase. ... These work
> on current or on a different non-running task."
Will do that.
>> +
>> +unsigned long read_task_fsbase(struct task_struct *task)
>> +{
>> + unsigned long fsbase;
>> +
>> + if (task == current)
>> + fsbase = read_fsbase();
>> + else
>> + /*
>> + * XXX: This will not behave as expected if called
>> + * if fsindex != 0
>> + */
>> + fsbase = task->thread.fsbase;
>> +
> Please put braces around the if and else blocks whenever either of
> them spans multiple lines. Also, maybe change add a note to the
> comment and/or the changelog that this is preserving an existing bug
> and that it's fixed later in the series.
Okay, thanks.
Powered by blists - more mailing lists