From: Joe Damato <ice799@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-x86_64@vger.kernel.org, linux-newbie@vger.kernel.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
"H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
Jeremy Fitzhardinge <jeremy@goop.org>,
Vegard Nossum <vegard.nossum@gmail.com>
Subject: Re: [PATCH 00/12] x86: Cleanup idt, gdt/ldt/tss structs
Date: Mon, 27 Oct 2008 21:15:51 +0000 [thread overview]
Message-ID: <49062F87.4060307@gmail.com> (raw)
In-Reply-To: <20081027105559.GA13895@elte.hu>
Ingo Molnar wrote:
> * Joe Damato <ice799@gmail.com> wrote:
>
>
>> Hi -
>>
>> This is my first submission to the kernel, so (beware!) please let
>> me know if I can make any improvements on these patches.
>>
>> I attempted to clean up the x86 structs for 32bit cpus that store
>> IDT/LDT/GDT data by removing the fields labeled "a" and "b" in favor
>> of more descriptive field names. I added some macros and went
>> through the kernel cleaning up the various places where "a" and "b"
>> were used.
>>
>> I tried building my kernel with my .config and then also did a make
>> allyesconfig build to help ensure I found everything that was using
>> the old structure names. I also tried a few grep patterns. Hopefully
>> I got everyone out.
>>
>
> hm, a couple of comments.
>
Thanks for your very useful comments and feedback. I've included a few
questions/comments below.
> Firstly, a patch logistical one: we moved all the x86 header files
> from include/asm-x86/ to arch/x86/include/asm/ in v2.6.28-rc1 - your
> patchset is against an older kernel. Should be easy enough to fix up.
>
Ah, sorry about that. Should be easy enough to fix with git.
> Secondly, i'm not that convinced about the expanded use of bitfields
> that your patchset implements. Their semantics are notoriously fragile
> so we'd rather get _away_ from them, not expand them.
Out of curiosity what exactly do you mean when you say "fragile"? Sorry
for my ignorance here...
> _But_, this area
> could be cleaned up some more - just in a different way. I'd suggest
> you introduce field accessor inline functions to descriptors.
>
> I.e. instead of:
>
> if (!idt_present(cpu->arch.idt[num].a, cpu->arch.idt[num].b))
>
> we could do a more compact form:
>
> if (!idt_present(cpu->arch.idt + num))
>
> and get away from the open-coded use of desc->a and desc->b fields,
> with proper inlined helpers.
>
That sounds reasonable, I will play around, write a few, and probably
resubmit in a few days.
> Small detail, the syntactic form you chose:
>
> + if (!cpu->arch.idt[num].p)
>
> is not very readable because it's not obvious at first sight that ".p"
> intends to mean "present bit". If then idt[num].present would have
> been the better choice - but it's even better to not do bitfields at
> all but an idt_present(desc *) helper inline function.
>
>
OK, I'll try to use more descriptive names. As hpa pointed out in his
email, 'p' is the name of the field in the intel x86 documentation.
That's why I chose that, but I agree it isn't particularly clear.
> Thirdly, as you can see it form my comments, this is not something
> that is really a best choice for a newbie, as it's a wide patchset
> that impacts a lot of critical code, wich has very high quality
> requirements.
>
> But if you dont mind having to go through a couple of iterations to
> get it right (with the inevitable feeling of ftrustration about such a
> difficult process) then sure, feel free to work on this!
>
I will probably continue to play around with it and try to resubmit
something in a few days that incorporates your feedback. I've done some
x86 stuff before (never with linux, though) and I enjoy crawling though
the intel docs and pushing bits around =].
Thanks again for the feedback,
Joe
WARNING: multiple messages have this Message-ID (diff)
From: Joe Damato <ice799@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-x86_64@vger.kernel.org, linux-newbie@vger.kernel.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
"H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
Jeremy Fitzhardinge <jeremy@goop.org>,
Vegard Nossum <vegard.nossum@gmail.com>
Subject: Re: [PATCH 00/12] x86: Cleanup idt, gdt/ldt/tss structs
Date: Mon, 27 Oct 2008 14:15:51 -0700 [thread overview]
Message-ID: <49062F87.4060307@gmail.com> (raw)
In-Reply-To: <20081027105559.GA13895@elte.hu>
Ingo Molnar wrote:
> * Joe Damato <ice799@gmail.com> wrote:
>
>
>> Hi -
>>
>> This is my first submission to the kernel, so (beware!) please let
>> me know if I can make any improvements on these patches.
>>
>> I attempted to clean up the x86 structs for 32bit cpus that store
>> IDT/LDT/GDT data by removing the fields labeled "a" and "b" in favor
>> of more descriptive field names. I added some macros and went
>> through the kernel cleaning up the various places where "a" and "b"
>> were used.
>>
>> I tried building my kernel with my .config and then also did a make
>> allyesconfig build to help ensure I found everything that was using
>> the old structure names. I also tried a few grep patterns. Hopefully
>> I got everyone out.
>>
>
> hm, a couple of comments.
>
Thanks for your very useful comments and feedback. I've included a few
questions/comments below.
> Firstly, a patch logistical one: we moved all the x86 header files
> from include/asm-x86/ to arch/x86/include/asm/ in v2.6.28-rc1 - your
> patchset is against an older kernel. Should be easy enough to fix up.
>
Ah, sorry about that. Should be easy enough to fix with git.
> Secondly, i'm not that convinced about the expanded use of bitfields
> that your patchset implements. Their semantics are notoriously fragile
> so we'd rather get _away_ from them, not expand them.
Out of curiosity what exactly do you mean when you say "fragile"? Sorry
for my ignorance here...
> _But_, this area
> could be cleaned up some more - just in a different way. I'd suggest
> you introduce field accessor inline functions to descriptors.
>
> I.e. instead of:
>
> if (!idt_present(cpu->arch.idt[num].a, cpu->arch.idt[num].b))
>
> we could do a more compact form:
>
> if (!idt_present(cpu->arch.idt + num))
>
> and get away from the open-coded use of desc->a and desc->b fields,
> with proper inlined helpers.
>
That sounds reasonable, I will play around, write a few, and probably
resubmit in a few days.
> Small detail, the syntactic form you chose:
>
> + if (!cpu->arch.idt[num].p)
>
> is not very readable because it's not obvious at first sight that ".p"
> intends to mean "present bit". If then idt[num].present would have
> been the better choice - but it's even better to not do bitfields at
> all but an idt_present(desc *) helper inline function.
>
>
OK, I'll try to use more descriptive names. As hpa pointed out in his
email, 'p' is the name of the field in the intel x86 documentation.
That's why I chose that, but I agree it isn't particularly clear.
> Thirdly, as you can see it form my comments, this is not something
> that is really a best choice for a newbie, as it's a wide patchset
> that impacts a lot of critical code, wich has very high quality
> requirements.
>
> But if you dont mind having to go through a couple of iterations to
> get it right (with the inevitable feeling of ftrustration about such a
> difficult process) then sure, feel free to work on this!
>
I will probably continue to play around with it and try to resubmit
something in a few days that incorporates your feedback. I've done some
x86 stuff before (never with linux, though) and I enjoy crawling though
the intel docs and pushing bits around =].
Thanks again for the feedback,
Joe
--
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
WARNING: multiple messages have this Message-ID (diff)
From: Joe Damato <ice799@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-x86_64@vger.kernel.org, linux-newbie@vger.kernel.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
"H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
Jeremy Fitzhardinge <jeremy@goop.org>,
Vegard Nossum <vegard.nossum@gmail.com>
Subject: Re: [PATCH 00/12] x86: Cleanup idt, gdt/ldt/tss structs
Date: Mon, 27 Oct 2008 14:15:51 -0700 [thread overview]
Message-ID: <49062F87.4060307@gmail.com> (raw)
In-Reply-To: <20081027105559.GA13895@elte.hu>
Ingo Molnar wrote:
> * Joe Damato <ice799@gmail.com> wrote:
>
>
>> Hi -
>>
>> This is my first submission to the kernel, so (beware!) please let
>> me know if I can make any improvements on these patches.
>>
>> I attempted to clean up the x86 structs for 32bit cpus that store
>> IDT/LDT/GDT data by removing the fields labeled "a" and "b" in favor
>> of more descriptive field names. I added some macros and went
>> through the kernel cleaning up the various places where "a" and "b"
>> were used.
>>
>> I tried building my kernel with my .config and then also did a make
>> allyesconfig build to help ensure I found everything that was using
>> the old structure names. I also tried a few grep patterns. Hopefully
>> I got everyone out.
>>
>
> hm, a couple of comments.
>
Thanks for your very useful comments and feedback. I've included a few
questions/comments below.
> Firstly, a patch logistical one: we moved all the x86 header files
> from include/asm-x86/ to arch/x86/include/asm/ in v2.6.28-rc1 - your
> patchset is against an older kernel. Should be easy enough to fix up.
>
Ah, sorry about that. Should be easy enough to fix with git.
> Secondly, i'm not that convinced about the expanded use of bitfields
> that your patchset implements. Their semantics are notoriously fragile
> so we'd rather get _away_ from them, not expand them.
Out of curiosity what exactly do you mean when you say "fragile"? Sorry
for my ignorance here...
> _But_, this area
> could be cleaned up some more - just in a different way. I'd suggest
> you introduce field accessor inline functions to descriptors.
>
> I.e. instead of:
>
> if (!idt_present(cpu->arch.idt[num].a, cpu->arch.idt[num].b))
>
> we could do a more compact form:
>
> if (!idt_present(cpu->arch.idt + num))
>
> and get away from the open-coded use of desc->a and desc->b fields,
> with proper inlined helpers.
>
That sounds reasonable, I will play around, write a few, and probably
resubmit in a few days.
> Small detail, the syntactic form you chose:
>
> + if (!cpu->arch.idt[num].p)
>
> is not very readable because it's not obvious at first sight that ".p"
> intends to mean "present bit". If then idt[num].present would have
> been the better choice - but it's even better to not do bitfields at
> all but an idt_present(desc *) helper inline function.
>
>
OK, I'll try to use more descriptive names. As hpa pointed out in his
email, 'p' is the name of the field in the intel x86 documentation.
That's why I chose that, but I agree it isn't particularly clear.
> Thirdly, as you can see it form my comments, this is not something
> that is really a best choice for a newbie, as it's a wide patchset
> that impacts a lot of critical code, wich has very high quality
> requirements.
>
> But if you dont mind having to go through a couple of iterations to
> get it right (with the inevitable feeling of ftrustration about such a
> difficult process) then sure, feel free to work on this!
>
I will probably continue to play around with it and try to resubmit
something in a few days that incorporates your feedback. I've done some
x86 stuff before (never with linux, though) and I enjoy crawling though
the intel docs and pushing bits around =].
Thanks again for the feedback,
Joe
next prev parent reply other threads:[~2008-10-27 21:15 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-25 3:15 [PATCH 00/12] x86: Cleanup idt, gdt/ldt/tss structs Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` [PATCH 01/12] x86: Cleanup x86 descriptors, remove a/b fields from structs Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` [PATCH 02/12] x86: Use new gate_struct for gate_desc Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` [PATCH 03/12] x86: Cleanup usage of struct desc_struct Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` [PATCH 04/12] x86: Add macros for gate_desc Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` [PATCH 05/12] x86: Refactor pack_gate " Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` [PATCH 06/12] x86: Refactor pack_descriptor Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` [PATCH 07/12] x86: Add a static initializer for IDTs Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` [PATCH 08/12] x86: Use static intializer for IDT entries Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` [PATCH 09/12] x86: Add static initiazlier for descriptors Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` [PATCH 10/12] x86: Use static initializers " Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` [PATCH 11/12] x86: Use macros for getting/setting descriptors Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` [PATCH 12/12] x86: Use struct fields instead of bitmasks Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-25 3:15 ` Joe Damato
2008-10-29 12:56 ` Jeremy Fitzhardinge
2008-10-29 12:56 ` Jeremy Fitzhardinge
2008-10-29 12:56 ` Jeremy Fitzhardinge
2008-10-29 12:58 ` [PATCH 09/12] x86: Add static initiazlier for descriptors Jeremy Fitzhardinge
2008-10-29 12:58 ` Jeremy Fitzhardinge
2008-10-29 12:58 ` Jeremy Fitzhardinge
2008-10-29 12:54 ` [PATCH 04/12] x86: Add macros for gate_desc Jeremy Fitzhardinge
2008-10-29 12:54 ` Jeremy Fitzhardinge
2008-10-29 12:54 ` Jeremy Fitzhardinge
2008-10-29 12:52 ` [PATCH 03/12] x86: Cleanup usage of struct desc_struct Jeremy Fitzhardinge
2008-10-29 12:52 ` Jeremy Fitzhardinge
2008-10-29 12:52 ` Jeremy Fitzhardinge
2008-10-29 12:53 ` [PATCH 02/12] x86: Use new gate_struct for gate_desc Jeremy Fitzhardinge
2008-10-29 12:53 ` Jeremy Fitzhardinge
2008-10-29 12:53 ` Jeremy Fitzhardinge
2008-10-25 5:40 ` [PATCH 00/12] x86: Cleanup idt, gdt/ldt/tss structs Willy Tarreau
2008-10-25 5:40 ` Willy Tarreau
2008-10-25 5:40 ` Willy Tarreau
2008-10-27 10:57 ` Ingo Molnar
2008-10-27 10:57 ` Ingo Molnar
2008-10-27 10:57 ` Ingo Molnar
2008-10-25 9:39 ` walter harms
2008-10-25 9:39 ` walter harms
2008-10-25 9:39 ` walter harms
2008-10-27 10:55 ` Ingo Molnar
2008-10-27 10:55 ` Ingo Molnar
2008-10-27 14:34 ` H. Peter Anvin
2008-10-27 14:34 ` H. Peter Anvin
2008-10-27 14:34 ` H. Peter Anvin
2008-10-27 21:15 ` Joe Damato [this message]
2008-10-27 21:15 ` Joe Damato
2008-10-27 21:15 ` Joe Damato
2008-10-27 23:02 ` Jeremy Fitzhardinge
2008-10-27 23:02 ` Jeremy Fitzhardinge
2008-10-27 23:02 ` Jeremy Fitzhardinge
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=49062F87.4060307@gmail.com \
--to=ice799@gmail.com \
--cc=hpa@zytor.com \
--cc=jeremy@goop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-newbie@vger.kernel.org \
--cc=linux-x86_64@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=vegard.nossum@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.