From: "Jan Beulich" Subject: Re: [PATCH 9/18 V2]: PVH xen: create PVH vmcs, and initialization Date: Tue, 19 Mar 2013 09:19:57 +0000 Message-ID: <51483BCD02000078000C6A46@nat28.tlf.novell.com> References: <20130315173925.1a6a2051@mantra.us.oracle.com> <20130318152843.GK24560@phenom.dumpdata.com> <20130318180036.211c57e9@mantra.us.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130318180036.211c57e9@mantra.us.oracle.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Konrad Rzeszutek Wilk , Mukesh Rathor Cc: xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 19.03.13 at 02:00, Mukesh Rathor wrote: > On Mon, 18 Mar 2013 11:28:43 -0400 Konrad Rzeszutek Wilk wrote: >> On Fri, Mar 15, 2013 at 05:39:25PM -0700, Mukesh Rathor wrote: >> > + __vmwrite(GUEST_CS_SELECTOR, 0x10); >> >> 0x10. Could you use a #define for it? Somehow I thought it would >> be running in FLAT_KERNEL_CS but that would be odd. And of course >> since are booting in the Linux kernel without the PV MMU we would >> be using its native segments. So this would correspond to >> GDT_ENTRY_KERNEL_CS right? Might want to mention that >> so if the Linux kernel alters its GDT page we don't blow up? >> >> Thought I guess it does not matter - this is just the initial >> bootstrap segments. Presumarily the load_gdt in the Linux kernel >> later on resets it to whatever the "new" GDT is. > > Correct: > #define __KERNEL_CS (GDT_ENTRY_KERNEL_CS*8) What Linux does, or what selector values it uses doesn't matter at all here. Whatever value you want to put there, it needs an explanation if it's not one of the Xen defined ones (in particular if the value was arbitrarily chosen, as that would leave future readers completely clueless). Perhaps to some degree the same also goes for the descriptor attributes that you store, albeit one can certainly reconstruct why the value was chosen the way it is. Jan