From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: Re: [RFC PATCH 1/15]: PVH xen: turn gdb_frames/gdt_ents into union Date: Thu, 24 Jan 2013 18:04:21 -0800 Message-ID: <20130124180421.5d767935@mantra.us.oracle.com> References: <20130111172522.6e73d884@mantra.us.oracle.com> <20130124142932.GC20551@ocelot.phlegethon.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130124142932.GC20551@ocelot.phlegethon.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tim Deegan Cc: "Xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Thu, 24 Jan 2013 14:29:32 +0000 Tim Deegan wrote: > At 17:25 -0800 on 11 Jan (1357925122), Mukesh Rathor wrote: > > diff -r bf249cd5f2c1 -r 278d7a933d88 > > xen/include/public/arch-x86/xen.h --- > > a/xen/include/public/arch-x86/xen.h Tue Oct 30 18:12:11 2012 > > +0000 +++ b/xen/include/public/arch-x86/xen.h Fri Jan 11 > > 16:19:40 2013 -0800 @@ -157,7 +157,16 @@ 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) */ > > - unsigned long gdt_frames[16], gdt_ents; /* GDT (machine > > frames, # ents) */ > > + union { > > + struct { > > + /* GDT (machine frames, # ents) */ > > + unsigned long gdt_frames[16], gdt_ents; > > + } pv; > > + struct { > > + /* PVH: GDTR addr and size */ > > + unsigned long gdtaddr, gdtsz; > > The GDT size is always 16 bits; I'd be inclined to make the addr > explicitly 64 bits too, to help out 32-bit toolstacks. > > > + } pvh; > > + } u; > > Also, would you consider renaming this as: > > union { > struct { > /* GDT (machine frames, # ents) */ > unsigned long frames[16], ents; > } pv; > struct { > /* PVH: GDTR addr and size */ > unsigned long addr, sz; > } pvh; > } gdt; > > ? Then the calling code looks a little nicer. Initially, I had it called gdt, but during code review of linux patch (exact same change there), it was suggested to change it. Also, I really dont' like field names likes "addr" or "sz". I really don't wanna grep or cscope for them. Thanks Mukesh