From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: Re: [PATCH] switch to a known good/static GDTbeforekexec Date: Fri, 03 Jul 2009 08:48:02 +0100 Message-ID: References: <4A4DCC350200007800008B3A@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4A4DCC350200007800008B3A@vpn.id2.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich , Ian Campbell Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 03/07/2009 08:15, "Jan Beulich" wrote: >> Actually no, I'm not sure what extra checking you think you'd need? You'd >> create the per-vcpu mapping when a vcpu is created and when it changes >> to/from compat mode, and that would be it wouldn't it? You'd only delete >> code from __context_switch(); not add different code to it? > > While you're right that my explanation wasn't really correct, moving this > back to the vCPU creation/mode-switching functions doesn't work because > the GDT is now per-CPU (and it's that patch where this code got added to > context switch): The installed mapping depends on the *physical* CPU the > code is running on. So the extra dependency that might be added here > would be to check whether the physical CPU the vCPU is running on > changed, but afair v->processor gets set before entering context_switch(), > so we'd have to additionally capture and store the last used value. Would > you think that's worth it? Ok, now I get it. I think. There's no way to avoid potentially having to rewrite the PTE on context switch, so may as well always do it. -- Keir