From: Ian Campbell Subject: Re: x86_64: Fix off-by-one error setting up the Interrupt Stack Tables Date: Wed, 9 May 2012 12:00:00 +0100 Message-ID: <1336561200.25514.81.camel@zakaz.uk.xensource.com> References: <4FAA4554.3080005@citrix.com> <1336559473.25514.64.camel@zakaz.uk.xensource.com> <4FAA693102000078000827D0@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4FAA693102000078000827D0@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Andrew Cooper , "Keir (Xen.org)" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Wed, 2012-05-09 at 11:55 +0100, Jan Beulich wrote: > >>> On 09.05.12 at 12:31, Ian Campbell wrote: > > On Wed, 2012-05-09 at 11:22 +0100, Andrew Cooper wrote: > >> diff -r 8f1e0cc4a507 xen/include/asm-x86/processor.h > >> --- a/xen/include/asm-x86/processor.h > >> +++ b/xen/include/asm-x86/processor.h > >> @@ -424,7 +424,9 @@ struct tss_struct { > >> union { u64 rsp1, esp1; }; > >> union { u64 rsp2, esp2; }; > >> u64 reserved1; > >> - u64 ist[7]; > >> + u64 ist[7]; /* Interrupt Stack Table is 1-based so tss->ist[0] > >> + * corresponds to an IST value of 1 in an Interrupt > >> + * Descriptor */ > > > > Would it be too sneaky to drop "reserved1" and make ist be 8 elements? > > then ist[1] would actually be the slot corresponding to a value of 1 in > > an IDT entry. > > While appealing at a first glance, I wouldn't recommend doing so: > Documentation specifies it the way it's defined currently, and Linux > also uses the same definition, so we'd only call for future bugs if > we did it differently in our code. I thought someone would say something like that ;-) OK then. > > Jan > > >> u64 reserved2; > >> u16 reserved3; > > >