From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Molnar Subject: Re: kvm vmload/vmsave vs tss.ist Date: Thu, 25 Dec 2008 17:42:32 +0100 Message-ID: <20081225164232.GA25195@elte.hu> References: <49539FD0.7070103@redhat.com> <20081225151757.GA25117@elte.hu> <4953AAE5.4000708@redhat.com> <20081225162107.GB14486@elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "H. Peter Anvin" , Joerg Roedel , Benjamin Serebrin , linux-kernel , kvm@vger.kernel.org, Alexander Graf , Arjan van de Ven , Alexander van Heukelum To: Avi Kivity Return-path: Received: from mx2.mail.elte.hu ([157.181.151.9]:32859 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751874AbYLYQmr (ORCPT ); Thu, 25 Dec 2008 11:42:47 -0500 Content-Disposition: inline In-Reply-To: <20081225162107.GB14486@elte.hu> Sender: kvm-owner@vger.kernel.org List-ID: * Ingo Molnar wrote: > i'd suggest to reuse the irq-stacks for this. Right now on 64-bit we've > got the following stack layout: 8K process stacks, a 16K IRQ stack on > each CPU, shared by all IRQs. Then we have the IST stacks with weird > sizes: debug:8K, the others: 4K. this has to be done carefully though, as there's a subtle detail here: right now the pda_irqcount and the pda_irqstackptr logic in entry_64.S is not re-entry safe and relies on IRQs being off. If critical exceptions are moved to the IRQ stack then %rsp switching to the IRQ stack has to be done atomically: instead of using the pda_irqcount check the %rsp value itself should be checked against pda_irqstackptr - if it's within that 16K range then we are already on the IRQ stack and do not need to switch to it but can just use the current %rsp. Ingo