From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 1/2] test: Add IDT framework Date: Thu, 10 Jun 2010 12:49:16 +0300 Message-ID: <4C10B51C.9070502@redhat.com> References: <1276140703-30046-1-git-send-email-sheng@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , kvm@vger.kernel.org To: Sheng Yang Return-path: Received: from mx1.redhat.com ([209.132.183.28]:39643 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752460Ab0FJJtT (ORCPT ); Thu, 10 Jun 2010 05:49:19 -0400 In-Reply-To: <1276140703-30046-1-git-send-email-sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On 06/10/2010 06:31 AM, Sheng Yang wrote: > + > +#define EXCEPTION_REGION_BEGIN(r, lb) \ > + asm volatile("pushq $"lb"\n\t" \ > + "mov $2, %0\n\t" \ > + : "=r"(r)) > +#define EXCEPTION_REGION_END(r, lb) \ > + asm volatile("popq %%rdx\n\t" \ > + "mov $0, %0\n\t" \ > + lb":\n\t": \ > + "=r"(r) :: "%rdx") > These mess up the stack, no? So if any intervening code uses %rsp based addressing, it will get incorrect information. I suggest using a special data section like the kernel. Also, most tests that use asm don't need an exception region, but will want to trap an exception on a single address. So need a macro designed to be placed in asm in front of the faulting instruction. -- error compiling committee.c: too many arguments to function