LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Benjamin Romer <benjamin.romer@unisys.com>
Cc: vgoyal@in.ibm.com, linux-kernel@vger.kernel.org
Subject: Re: PATCH: Update disable_IO_APIC to use 8-bit destination field (X86_64)
Date: Thu, 18 Jan 2007 11:14:30 -0700 [thread overview]
Message-ID: <m14pqo6w3d.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <1169141034.6665.6.camel@ustr-romerbm-2.na.uis.unisys.com> (Benjamin Romer's message of "Thu, 18 Jan 2007 12:23:54 -0500")
Benjamin Romer <benjamin.romer@unisys.com> writes:
> On Thu, 2007-01-18 at 13:30 +0530, Vivek Goyal wrote:
>> On Thu, Jan 18, 2007 at 12:10:55AM -0700, Eric W. Biederman wrote:
>> > Vivek Goyal <vgoyal@in.ibm.com> writes:
>> > >
>> > > Or how about making physical_dest field also 8bit like logical_dest field.
>> > > This will work both for 4bit and 8bit physical apic ids at the same time
>> > > code becomes more intutive and it is easier to know whether IOAPIC is
> being
>> > > put in physical or destination logical mode.
>> >
>> > Exactly what I was trying to suggest.
>> >
>> > Looking closer at the code I think it makes sense to just kill the union and
>> > stop the discrimination between physical and logical modes and just have a
>> > dest field in the structure. Roughly as you were suggesting at first.
>> >
>> > The reason we aren't bitten by this on a regular basis is the normal code
>> > path uses logical.logical_dest in both logical and physical modes.
>> > Which is a little confusing.
>> >
>> > Since there really isn't a distinction to be made we should just stop
>> > trying, which will make maintenance easier :)
>> >
>> > Currently there are several non-common case users of physical_dest
>> > that are probably bitten by this problem under the right
>> > circumstances.
>> >
>> > So I think we should just make the structure:
>> >
>> > struct IO_APIC_route_entry {
>> > __u32 vector : 8,
>> > delivery_mode : 3, /* 000: FIXED
>> > * 001: lowest prio
>> > * 111: ExtINT
>> > */
>> > dest_mode : 1, /* 0: physical, 1: logical */
>> > delivery_status : 1,
>> > polarity : 1,
>> > irr : 1,
>> > trigger : 1, /* 0: edge, 1: level */
>> > mask : 1, /* 0: enabled, 1: disabled */
>> > __reserved_2 : 15;
>> >
>> > __u32 __reserved_3 : 24,
>> > __dest : 8;
>> > } __attribute__ ((packed));
>> >
>> > And fixup the users. This should keep us from getting bit by this bug
>> > in the future. Like when people start introducing support for more
>> > than 256 cores and the low 24bits start getting used.
>> >
>> > Or when someone new starts working on the code and thinks the fact
>> > the field name says logical we are actually using the apic in logical
>> > mode.
>>
>> This makes perfect sense to me. Ben, interested in providing a patch
>> for this?
>>
>> Thanks
>> Vivek
>
> OK, here's the updated patch that uses the new definition and fixes up
> the other places that use it. I built and tested this on the ES7000/ONE
> and it works well. :)
Cool.
I hate to pick nits by why the double underscore on dest?
> struct IO_APIC_route_entry {
> - __u32 vector : 8,
> - delivery_mode : 3, /* 000: FIXED
> - * 001: lowest prio
> - * 111: ExtINT
> - */
> - dest_mode : 1, /* 0: physical, 1: logical */
> - delivery_status : 1,
> - polarity : 1,
> - irr : 1,
> - trigger : 1, /* 0: edge, 1: level */
> - mask : 1, /* 0: enabled, 1: disabled */
> - __reserved_2 : 15;
> -
> - union { struct { __u32
> - __reserved_1 : 24,
> - physical_dest : 4,
> - __reserved_2 : 4;
> - } physical;
> -
> - struct { __u32
> - __reserved_1 : 24,
> - logical_dest : 8;
> - } logical;
> - } dest;
> + __u32 vector : 8,
> + delivery_mode : 3, /* 000: FIXED
> + * 001: lowest prio
> + * 111: ExtINT
> + */
> + dest_mode : 1, /* 0: physical, 1: logical */
> + delivery_status : 1,
> + polarity : 1,
> + irr : 1,
> + trigger : 1, /* 0: edge, 1: level */
> + mask : 1, /* 0: enabled, 1: disabled */
> + __reserved_2 : 15;
>
> + __u32 __reserved_3 : 24,
> + __dest : 8;
> } __attribute__ ((packed));
>
> /*
next prev parent reply other threads:[~2007-01-18 18:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-17 16:46 Benjamin Romer
2007-01-17 19:08 ` Eric W. Biederman
2007-01-18 3:41 ` Vivek Goyal
2007-01-18 4:36 ` Vivek Goyal
2007-01-18 7:10 ` Eric W. Biederman
[not found] ` <2 0070118080003.GC31860@in.ibm.com>
2007-01-18 8:00 ` Vivek Goyal
2007-01-18 14:58 ` Benjamin Romer
2007-01-18 17:23 ` Benjamin Romer
2007-01-18 18:14 ` Eric W. Biederman [this message]
[not found] ` <1169147619.6665. 11.camel@ustr-romerbm-2.na.uis.unisys.com>
2007-01-18 19:13 ` Benjamin Romer
2007-01-19 3:49 ` Vivek Goyal
2007-01-19 15:11 ` Benjamin Romer
2007-01-19 15:43 ` Randy Dunlap
2007-01-19 17:14 ` Benjamin Romer
2007-01-19 15:55 ` Eric W. Biederman
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=m14pqo6w3d.fsf@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=benjamin.romer@unisys.com \
--cc=linux-kernel@vger.kernel.org \
--cc=vgoyal@in.ibm.com \
--subject='Re: PATCH: Update disable_IO_APIC to use 8-bit destination field (X86_64)' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).