From: Tim Deegan Subject: Re: [PATCH 1/18 V2]: PVH xen: turn gdb_frames/gdt_ents into union Date: Thu, 21 Mar 2013 14:33:19 +0000 Message-ID: <20130321143319.GI12338@ocelot.phlegethon.org> References: <20130315171450.4318930a@mantra.us.oracle.com> <514706CB02000078000C64B8@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <514706CB02000078000C64B8@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: xen-devel List-Id: xen-devel@lists.xenproject.org At 11:21 +0000 on 18 Mar (1363605691), Jan Beulich wrote: > >>> On 16.03.13 at 01:14, Mukesh Rathor wrote: > > --- a/xen/include/public/arch-x86/xen.h > > +++ b/xen/include/public/arch-x86/xen.h > > @@ -170,7 +170,20 @@ struct vcpu_guest_context { > > struct cpu_user_regs user_regs; /* User-level CPU > > registers */ struct trap_info trap_ctxt[256]; /* Virtual > > IDT */ unsigned long ldt_base, ldt_ents; /* LDT > > (linear address, # ents) */ +#if __XEN_INTERFACE_VERSION__ < 0x00040300 > > unsigned long gdt_frames[16], gdt_ents; /* GDT (machine frames, # > > ents) */ +#else > > + union { > > + struct { > > + /* GDT (machine frames, # ents) */ > > + unsigned long gdt_frames[16], gdt_ents; > > + } pv; > > + struct { > > + /* PVH: GDTR addr and size */ > > + unsigned long gdtaddr, gdtsz; > > + } pvh; > > + } u; > > Leaving aside the line wrapping issue already pointed out by > others, I can only repeat that I don't see why you would name > the union as badly as "u" when the obvious name would be "gdt". > > With that, I can further more only repeat that dropping the > "gdt_" and "gdt" prefixes on the names would be much preferred. Agreed, on both points. > And finally I question the usefulness of having what is currently > named "gdtsz" be an "unsigned long" when this can't exceed a > 16-bit quantity (the more if you used a limit value here rather > than a size, just like hardware does). And in any case, we should not be adding any more fields to the public API that aren't explicitly sized. Tim.