[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3605561d0903291450v516a7e9csaff4309c0cacb121@mail.gmail.com>
Date: Sun, 29 Mar 2009 14:50:39 -0700
From: Joe Damato <ice799@...il.com>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: linux-x86_64@...r.kernel.org, w@....eu, mingo@...e.hu,
jeremy@...p.org, linux-newbie@...r.kernel.org,
kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] x86: Add getter/setter static inlines for x86
descriptors
On Sun, Mar 29, 2009 at 2:28 PM, H. Peter Anvin <hpa@...or.com> wrote:
> Joe Damato wrote:
>> Static inline getters/setters have been provided to encourage consumers not to touch the internals of 32bit x86 descriptors directly.
>>
>> Signed-off-by: Joe Damato <ice799@...il.com>
>
> Okay, what is the motivation for this?
>
> This is a serious question. The x86 descriptors are so complex that
> it's not clear to me that this restriction makes the code any more
> clear. Especially not with things like:
>
> - cpu->arch.gdt[i].b |= 0x00000100;
> + desc_set_hi(tmp, desc_get_hi(tmp) | 0x00000100);
>
> This isn't an improvement. If you're doing to so something like this,
> you need to actually implement the *intent* here.
Hi -
In my first patch set several months ago I replaced the structure
desc_struct with bit fields that exposed the fields for IDT/LDT/TSS
entries. This patch set was rejected for several reasons, one of which
was that Linux is trying to move away from bit fields. I also received
other comments such as "take a smaller bite", etc.
So instead of the bit fields, I implemented static inline
getters/setters. I thought that this small change would be a good
first step to re-test the waters of submitting patches to the kernel
before I started to clean out more pieces of the x86 architecture
specific code.
I agree that this isn't very clear, but from comments I received on my
first set, I assumed that this was closer to what people wanted to see
in the kernel. I am happy to iterate and submit something better, but
I am clearly misunderstanding what people would like to see.
Any suggestions on how this first-timer can help are greatly appreciated.
Joe
--
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