From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: trap/interrupt gate for hypercall Date: Tue, 15 May 2007 16:30:16 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Tian, Kevin" , Keir Fraser , xen-devel@lists.xensource.com Cc: "Liu, Jinsong" List-Id: xen-devel@lists.xenproject.org On 15/5/07 16:18, "Tian, Kevin" wrote: >> Everything's an interrupt gate on 32-bit Xen, so that we can safely >> (atomically) save away guest segment register state. NMI is the only real >> pain, and I suppose MCE too. Coincidentally Jan just emailed about this >> very point. > > So why is atomic save required for hypercall here? NMI can break > atomic save here for both types, as you said. Normally external > interrupt handler doesn't need communicate with interrupted > context. So even when an external interrupt comes in the middle > of the guest context save for hypercall (if by trap gate), that > interrupted save process can still continue since interrupt handler > itself will impose atomic context save/restore on top of interrupted > context. Interrupt handlers save and restore segment registers. We could fault on a reload of a segment register and lose the original segment register value. -- Keir