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 13:55:18 +0300 Message-ID: <4C10C496.2000405@redhat.com> References: <1276140703-30046-1-git-send-email-sheng@linux.intel.com> <4C10B51C.9070502@redhat.com> <201006101755.04411.sheng@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Marcelo Tosatti , kvm@vger.kernel.org To: Sheng Yang Return-path: Received: from mx1.redhat.com ([209.132.183.28]:10905 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754016Ab0FJKzV (ORCPT ); Thu, 10 Jun 2010 06:55:21 -0400 In-Reply-To: <201006101755.04411.sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On 06/10/2010 12:55 PM, Sheng Yang wrote: > On Thursday 10 June 2010 17:49:16 Avi Kivity wrote: > =20 >> On 06/10/2010 06:31 AM, Sheng Yang wrote: >> =20 >>> + >>> +#define EXCEPTION_REGION_BEGIN(r, lb) \ >>> + asm volatile("pushq $"lb"\n\t" \ >>> + "mov $2, %0\n\t" \ >>> + : "=3Dr"(r)) >>> +#define EXCEPTION_REGION_END(r, lb) \ >>> + asm volatile("popq %%rdx\n\t" \ >>> + "mov $0, %0\n\t" \ >>> + lb":\n\t": \ >>> + "=3Dr"(r) :: "%rdx") >>> =20 >> These mess up the stack, no? So if any intervening code uses %rsp b= ased >> addressing, it will get incorrect information. >> =20 > Yes, but I meant to only include instruction directly in the =E2=80=9C= region=E2=80=9D, and support > nobody should touch $rsp then. It's directly and simple enough. > =20 Something like "=3Dm"(blah) can cause access to %rsp, usually when=20 compiling without frame pointers. >> I suggest using a special data section like the kernel. >> =20 > Kind of more complex... > =20 Makes it more fun. I'll have a go. --=20 error compiling committee.c: too many arguments to function